diff --git a/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/@types/asciicinema-player.d.ts b/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/@types/asciicinema-player.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..85faf89e3b30981bf9c4ec45539a6ee1742e6b11 --- /dev/null +++ b/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/@types/asciicinema-player.d.ts @@ -0,0 +1,26 @@ +declare module "asciinema-player" { + export const create: ( + src: string | Object, + el: HTMLElement, + opts: { + cols?: number; + rows?: number; + autoPlay?: boolean; + preload?: boolean; + loop?: boolean; + theme?: string; + startAt?: number | string; + speed?: number; + idleTimeLimit?: number; + poster?: string; + fit?: string; + controls?: boolean; + markers?: Array | Array<[number, string]>; + pauseOnMarkers?: boolean; + terminalFontSize?: string; + terminalFontFamily?: string; + terminalLineHeight?: string; + logger?: Object; + }, + ) => any; +} diff --git a/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/@types/jsondiffpatch.d.ts b/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/@types/jsondiffpatch.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..79972421da5a0f53bad744109d242de5ee370b5a --- /dev/null +++ b/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/@types/jsondiffpatch.d.ts @@ -0,0 +1,8 @@ +declare module "jsondiffpatch/formatters/html" { + export { + default as HtmlFormatter, + showUnchanged, + hideUnchanged, + format, + } from "jsondiffpatch/lib/formatters/html"; +} diff --git a/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/@types/log.d.ts b/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/@types/log.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..15cf16aa9a88019a4bec7ac12d8f60e6f0c8444d --- /dev/null +++ b/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/@types/log.d.ts @@ -0,0 +1,2238 @@ +/* + * This file is automatically generated by schema.py + * DO NOT MODIFY IT BY HAND. + * To regenerate, run: python -m ../schema.py from within the + * src/inspect_ai/_view/www directory. + */ + +export type Version = number; +export type Status = "started" | "success" | "cancelled" | "error"; +export type EvalSetId = string | null; +export type EvalId = string; +export type RunId = string; +export type Created = string; +export type Task = string; +export type TaskId = string; +export type TaskVersion = number | string; +export type TaskFile = string | null; +export type TaskDisplayName = string | null; +export type TaskRegistryName = string | null; +export type Solver = string | null; +export type SolverArgs = { + [k: string]: unknown; +} | null; +export type SolverArgsPassed = { + [k: string]: unknown; +} | null; +export type Tags = string[] | null; +export type Name = string | null; +export type Location = string | null; +export type Samples = number | null; +export type SampleIds = string[] | number[] | (string | number)[] | null; +export type Shuffled = boolean | null; +export type Type = string; +export type Model = string; +export type MaxRetries = number | null; +export type Timeout = number | null; +export type AttemptTimeout = number | null; +export type MaxConnections = number | null; +export type SystemMessage = string | null; +export type MaxTokens = number | null; +export type TopP = number | null; +export type Temperature = number | null; +export type StopSeqs = string[] | null; +export type BestOf = number | null; +export type FrequencyPenalty = number | null; +export type PresencePenalty = number | null; +export type LogitBias = { + [k: string]: number; +} | null; +export type Seed = number | null; +export type TopK = number | null; +export type NumChoices = number | null; +export type Logprobs = boolean | null; +export type TopLogprobs = number | null; +export type ParallelToolCalls = boolean | null; +export type InternalTools = boolean | null; +export type MaxToolOutput = number | null; +export type CachePrompt = "auto" | boolean | null; +export type Verbosity = ("low" | "medium" | "high") | null; +export type Effort = ("low" | "medium" | "high" | "max") | null; +export type ReasoningEffort = + | ("none" | "minimal" | "low" | "medium" | "high" | "xhigh") + | null; +export type ReasoningTokens = number | null; +export type ReasoningSummary = + | ("none" | "concise" | "detailed" | "auto") + | null; +export type ReasoningHistory = ("none" | "all" | "last" | "auto") | null; +export type Name1 = string; +export type Type1 = + | ("string" | "integer" | "number" | "boolean" | "array" | "object" | "null") + | ( + | "string" + | "integer" + | "number" + | "boolean" + | "array" + | "object" + | "null" + )[] + | null; +export type Format = string | null; +export type Description = string | null; +export type Enum = unknown[] | null; +export type Properties = { + [k: string]: JSONSchema; +} | null; +export type Additionalproperties = JSONSchema | boolean | null; +export type Anyof = JSONSchema[] | null; +export type Required = string[] | null; +export type Description1 = string | null; +export type Strict = boolean | null; +export type ExtraHeaders = { + [k: string]: string; +} | null; +export type ExtraBody = { + [k: string]: unknown; +} | null; +export type Modalities = ("image" | ImageOutput)[] | null; +export type Options = { + [k: string]: { + [k: string]: unknown; + }; +} | null; +export type Cache = boolean | CachePolicy | null; +export type Expiry = string | null; +export type PerEpoch = boolean; +export type Batch = boolean | number | BatchConfig | null; +export type Size = number | null; +export type MaxSize = number | null; +export type SendDelay = number | null; +export type Tick = number | null; +export type MaxBatches = number | null; +export type MaxConsecutiveCheckFailures = number | null; +export type ModelBaseUrl = string | null; +export type ModelRoles = { + [k: string]: ModelConfig; +} | null; +export type Model1 = string; +export type BaseUrl = string | null; +export type Limit = number | [unknown, unknown] | null; +export type SampleId = + | string + | number + | string[] + | number[] + | (string | number)[] + | null; +export type SampleShuffle = boolean | number | null; +export type Epochs = number | null; +export type EpochsReducer = string[] | null; +export type Name2 = string; +export type Tools = string | string[]; +export type Approvers = ApproverPolicyConfig[]; +export type FailOnError = boolean | number | null; +export type ContinueOnFail = boolean | null; +export type RetryOnError = number | null; +export type MessageLimit = number | null; +export type TokenLimit = number | null; +export type TimeLimit = number | null; +export type WorkingLimit = number | null; +export type CostLimit = number | null; +export type MaxSamples = number | null; +export type MaxDatasetMemory = number | null; +export type MaxTasks = number | null; +export type MaxSubprocesses = number | null; +export type MaxSandboxes = number | null; +export type SandboxCleanup = boolean | null; +export type LogSamples = boolean | null; +export type LogRealtime = boolean | null; +export type LogImages = boolean | null; +export type LogModelApi = boolean | null; +export type LogBuffer = number | null; +export type LogShared = number | null; +export type ScoreDisplay = boolean | null; +export type Type2 = "git"; +export type Origin = string; +export type Commit = string; +export type Dirty = boolean | null; +export type Metadata = { + [k: string]: unknown; +} | null; +export type Scorers = EvalScorer[] | null; +export type Name3 = string; +export type Options1 = { + [k: string]: unknown; +} | null; +export type Metrics = + | ( + | EvalMetricDefinition + | { + [k: string]: EvalMetricDefinition[]; + } + )[] + | { + [k: string]: EvalMetricDefinition[]; + } + | null; +export type Name4 = string; +export type Options2 = { + [k: string]: unknown; +} | null; +export type Metadata1 = { + [k: string]: unknown; +} | null; +export type Metrics1 = + | ( + | EvalMetricDefinition + | { + [k: string]: EvalMetricDefinition[]; + } + )[] + | { + [k: string]: EvalMetricDefinition[]; + } + | null; +export type Name5 = string; +export type Solver1 = string; +export type Steps = EvalPlanStep[]; +export type TotalSamples = number; +export type CompletedSamples = number; +export type Manager = string; +export type Id = string | number; +export type Epoch = number; +export type Reason = string | null; +export type Metadata2 = { + [k: string]: JsonValue; +} | null; +export type JsonValue = unknown; +export type EarlyStops = EarlyStop[]; +export type Name6 = string; +export type Scorer = string; +export type Reducer = string | null; +export type ScoredSamples = number | null; +export type UnscoredSamples = number | null; +export type Name7 = string; +export type Value = number; +export type Metadata4 = { + [k: string]: unknown; +} | null; +export type Metadata5 = { + [k: string]: unknown; +} | null; +export type Scores = EvalScore[]; +export type Metadata6 = { + [k: string]: unknown; +} | null; +export type StartedAt = string | ""; +export type CompletedAt = string | ""; +export type InputTokens = number; +export type OutputTokens = number; +export type TotalTokens = number; +export type InputTokensCacheWrite = number | null; +export type InputTokensCacheRead = number | null; +export type ReasoningTokens1 = number | null; +export type TotalCost = number | null; +export type Message = string; +export type Traceback = string; +export type TracebackAnsi = string; +export type Invalidated = boolean; +export type LogUpdates = LogUpdate[] | null; +export type Type3 = "tags"; +export type TagsAdd = string[]; +export type TagsRemove = string[]; +export type Type4 = "metadata"; +export type MetadataRemove = string[]; +export type Edits = (TagsEdit | MetadataEdit)[]; +export type Timestamp = string; +export type Author = string; +export type Reason1 = string | null; +export type Tags1 = string[]; +export type Samples1 = EvalSample[] | null; +export type Id1 = number | string; +export type Epoch1 = number; +export type Input = + | string + | ( + | ChatMessageSystem + | ChatMessageUser + | ChatMessageAssistant + | ChatMessageTool + )[]; +export type Id2 = string | null; +export type Content = + | string + | ( + | ContentText + | ContentReasoning + | ContentImage + | ContentAudio + | ContentVideo + | ContentData + | ContentToolUse + | ContentDocument + )[]; +export type Type5 = "text"; +export type Text = string; +export type Refusal = boolean | null; +export type Citations = + | (ContentCitation | DocumentCitation | UrlCitation)[] + | null; +export type CitedText = string | [number, number] | null; +export type Title = string | null; +export type Internal = { + [k: string]: JsonValue; +} | null; +export type Type6 = "content"; +export type CitedText1 = string | [number, number] | null; +export type Title1 = string | null; +export type Internal1 = { + [k: string]: JsonValue; +} | null; +export type Type7 = "document"; +export type Type8 = "block" | "page" | "char"; +export type StartIndex = number; +export type EndIndex = number; +export type CitedText2 = string | [number, number] | null; +export type Title2 = string | null; +export type Internal2 = { + [k: string]: JsonValue; +} | null; +export type Type9 = "url"; +export type Url = string; +export type Type10 = "reasoning"; +export type Reasoning = string; +export type Summary = string | null; +export type Signature = string | null; +export type Redacted = boolean; +export type Type11 = "image"; +export type Image = string; +export type Detail = "auto" | "low" | "high" | "original"; +export type Type12 = "audio"; +export type Audio = string; +export type Format1 = "wav" | "mp3"; +export type Type13 = "video"; +export type Video = string; +export type Format2 = "mp4" | "mpeg" | "mov"; +export type Type14 = "data"; +export type Type15 = "tool_use"; +export type ToolType = "web_search" | "mcp_call" | "code_execution"; +export type Id3 = string; +export type Name8 = string; +export type Context = string | null; +export type Arguments = string; +export type Result = string; +export type Error = string | null; +export type Type16 = "document"; +export type Document = string; +export type Filename = string; +export type MimeType = string; +export type Source = ("input" | "generate") | null; +export type Metadata9 = { + [k: string]: unknown; +} | null; +export type Role = "system"; +export type Id4 = string | null; +export type Content1 = + | string + | ( + | ContentText + | ContentReasoning + | ContentImage + | ContentAudio + | ContentVideo + | ContentData + | ContentToolUse + | ContentDocument + )[]; +export type Source1 = ("input" | "generate") | null; +export type Metadata10 = { + [k: string]: unknown; +} | null; +export type Role1 = "user"; +export type ToolCallId = string[] | null; +export type Id5 = string | null; +export type Content2 = + | string + | ( + | ContentText + | ContentReasoning + | ContentImage + | ContentAudio + | ContentVideo + | ContentData + | ContentToolUse + | ContentDocument + )[]; +export type Source2 = ("input" | "generate") | null; +export type Metadata11 = { + [k: string]: unknown; +} | null; +export type Role2 = "assistant"; +export type ToolCalls = ToolCall[] | null; +export type Id6 = string; +export type Function = string; +export type ParseError = string | null; +export type Title3 = string | null; +export type Format3 = "text" | "markdown"; +export type Content3 = string; +export type Type17 = "function" | "custom"; +export type Model2 = string | null; +export type Id7 = string | null; +export type Content4 = + | string + | ( + | ContentText + | ContentReasoning + | ContentImage + | ContentAudio + | ContentVideo + | ContentData + | ContentToolUse + | ContentDocument + )[]; +export type Source3 = ("input" | "generate") | null; +export type Metadata12 = { + [k: string]: unknown; +} | null; +export type Role3 = "tool"; +export type ToolCallId1 = string | null; +export type Function1 = string | null; +export type Type18 = + | "parsing" + | "timeout" + | "unicode_decode" + | "permission" + | "file_not_found" + | "is_a_directory" + | "limit" + | "approval" + | "unknown" + | "output_limit"; +export type Message1 = string; +export type Choices = string[] | null; +export type Target = string | string[]; +export type Files = string[] | null; +export type Setup = string | null; +export type Messages = ( + | ChatMessageSystem + | ChatMessageUser + | ChatMessageAssistant + | ChatMessageTool +)[]; +export type Model3 = string; +export type StopReason = + | "stop" + | "max_tokens" + | "model_length" + | "tool_calls" + | "content_filter" + | "unknown"; +export type Token = string; +export type Logprob1 = number; +export type Bytes = number[] | null; +export type TopLogprobs1 = TopLogprob[] | null; +export type Token1 = string; +export type Logprob2 = number; +export type Bytes1 = number[] | null; +export type Content5 = Logprob[]; +export type Choices1 = ChatCompletionChoice[]; +export type Completion = string; +export type Time = number | null; +export type Metadata13 = { + [k: string]: unknown; +} | null; +export type Error1 = string | null; +export type Scores1 = { + [k: string]: Score; +} | null; +export type Value1 = + | string + | number + | boolean + | (string | number | boolean)[] + | { + [k: string]: string | number | boolean | null; + }; +export type Answer = string | null; +export type Explanation = string | null; +export type Metadata14 = { + [k: string]: unknown; +} | null; +export type Value2 = + | string + | number + | boolean + | (string | number | boolean)[] + | { + [k: string]: string | number | boolean | null; + } + | "UNCHANGED"; +export type Answer1 = string | "UNCHANGED" | null; +export type Explanation1 = string | "UNCHANGED" | null; +export type Metadata15 = + | { + [k: string]: unknown; + } + | "UNCHANGED"; +export type History = ScoreEdit[]; +export type Uuid = string | null; +export type SpanId = string | null; +export type Timestamp1 = string; +export type WorkingStart = number; +export type Metadata17 = { + [k: string]: unknown; +} | null; +export type Pending = boolean | null; +export type Event = "sample_init"; +export type Input1 = + | string + | ( + | ChatMessageSystem + | ChatMessageUser + | ChatMessageAssistant + | ChatMessageTool + )[]; +export type Choices2 = string[] | null; +export type Target1 = string | string[]; +export type Id8 = number | string | null; +export type Metadata18 = { + [k: string]: unknown; +} | null; +export type Files1 = { + [k: string]: string; +} | null; +export type Setup1 = string | null; +export type Uuid1 = string | null; +export type SpanId1 = string | null; +export type Timestamp2 = string; +export type WorkingStart1 = number; +export type Metadata19 = { + [k: string]: unknown; +} | null; +export type Pending1 = boolean | null; +export type Event1 = "sample_limit"; +export type Type19 = + | "message" + | "time" + | "working" + | "token" + | "cost" + | "operator" + | "custom"; +export type Message2 = string; +export type Limit1 = number | null; +export type Uuid2 = string | null; +export type SpanId2 = string | null; +export type Timestamp3 = string; +export type WorkingStart2 = number; +export type Metadata20 = { + [k: string]: unknown; +} | null; +export type Pending2 = boolean | null; +export type Event2 = "sandbox"; +export type Action = "exec" | "read_file" | "write_file"; +export type Cmd = string | null; +export type Options3 = { + [k: string]: JsonValue; +} | null; +export type File = string | null; +export type Input2 = string | null; +export type Result1 = number | null; +export type Output = string | null; +export type Completed = string | null; +export type Uuid3 = string | null; +export type SpanId3 = string | null; +export type Timestamp4 = string; +export type WorkingStart3 = number; +export type Metadata21 = { + [k: string]: unknown; +} | null; +export type Pending3 = boolean | null; +export type Event3 = "state"; +export type Op = "remove" | "add" | "replace" | "move" | "test" | "copy"; +export type Path = string; +export type From = string | null; +export type Changes = JsonChange[]; +export type Uuid4 = string | null; +export type SpanId4 = string | null; +export type Timestamp5 = string; +export type WorkingStart4 = number; +export type Metadata22 = { + [k: string]: unknown; +} | null; +export type Pending4 = boolean | null; +export type Event4 = "store"; +export type Changes1 = JsonChange[]; +export type Uuid5 = string | null; +export type SpanId5 = string | null; +export type Timestamp6 = string; +export type WorkingStart5 = number; +export type Metadata23 = { + [k: string]: unknown; +} | null; +export type Pending5 = boolean | null; +export type Event5 = "model"; +export type Model4 = string; +export type Role4 = string | null; +export type Input3 = ( + | ChatMessageSystem + | ChatMessageUser + | ChatMessageAssistant + | ChatMessageTool +)[]; +export type InputRefs = [unknown, unknown][] | null; +export type Name9 = string; +export type Description2 = string; +export type Type20 = "object"; +export type Required1 = string[]; +export type Additionalproperties1 = JSONSchema | boolean | null; +export type Options4 = { + [k: string]: unknown; +} | null; +export type Tools1 = ToolInfo[]; +export type ToolChoice = ("auto" | "any" | "none") | ToolFunction; +export type Name10 = string; +export type Retries = number | null; +export type Error2 = string | null; +export type Traceback1 = string | null; +export type TracebackAnsi1 = string | null; +export type Cache1 = ("read" | "write") | null; +export type Response = { + [k: string]: JsonValue; +} | null; +export type Error3 = boolean | null; +export type Time1 = number | null; +export type CallRefs = [unknown, unknown][] | null; +export type CallKey = string | null; +export type Completed1 = string | null; +export type WorkingTime = number | null; +export type Uuid6 = string | null; +export type SpanId6 = string | null; +export type Timestamp7 = string; +export type WorkingStart6 = number; +export type Metadata24 = { + [k: string]: unknown; +} | null; +export type Pending6 = boolean | null; +export type Event6 = "tool"; +export type Type21 = "function"; +export type Id9 = string; +export type Function2 = string; +export type Result2 = + | string + | number + | boolean + | ContentText + | ContentImage + | ContentAudio + | ContentVideo + | ContentDocument + | ( + | ContentText + | ContentImage + | ContentAudio + | ContentVideo + | ContentDocument + )[]; +export type Truncated = [unknown, unknown] | null; +export type Events1 = unknown[]; +export type Completed2 = string | null; +export type WorkingTime1 = number | null; +export type Agent = string | null; +export type AgentSpanId = string | null; +export type Failed = boolean | null; +export type MessageId = string | null; +export type Uuid7 = string | null; +export type SpanId7 = string | null; +export type Timestamp8 = string; +export type WorkingStart7 = number; +export type Metadata25 = { + [k: string]: unknown; +} | null; +export type Pending7 = boolean | null; +export type Event7 = "approval"; +export type Message3 = string; +export type Approver = string; +export type Decision = + | "approve" + | "modify" + | "reject" + | "escalate" + | "terminate"; +export type Explanation2 = string | null; +export type Uuid8 = string | null; +export type SpanId8 = string | null; +export type Timestamp9 = string; +export type WorkingStart8 = number; +export type Metadata26 = { + [k: string]: unknown; +} | null; +export type Pending8 = boolean | null; +export type Event8 = "compaction"; +export type Type22 = "summary" | "edit" | "trim"; +export type TokensBefore = number | null; +export type TokensAfter = number | null; +export type Source4 = string | null; +export type Uuid9 = string | null; +export type SpanId9 = string | null; +export type Timestamp10 = string; +export type WorkingStart9 = number; +export type Metadata27 = { + [k: string]: unknown; +} | null; +export type Pending9 = boolean | null; +export type Event9 = "input"; +export type Input4 = string; +export type InputAnsi = string; +export type Uuid10 = string | null; +export type SpanId10 = string | null; +export type Timestamp11 = string; +export type WorkingStart10 = number; +export type Metadata28 = { + [k: string]: unknown; +} | null; +export type Pending10 = boolean | null; +export type Event10 = "score"; +export type Target2 = string | string[] | null; +export type Intermediate = boolean; +export type ModelUsage2 = { + [k: string]: ModelUsage1; +} | null; +export type RoleUsage1 = { + [k: string]: ModelUsage1; +} | null; +export type Uuid11 = string | null; +export type SpanId11 = string | null; +export type Timestamp12 = string; +export type WorkingStart11 = number; +export type Metadata29 = { + [k: string]: unknown; +} | null; +export type Pending11 = boolean | null; +export type Event11 = "score_edit"; +export type ScoreName = string; +export type Uuid12 = string | null; +export type SpanId12 = string | null; +export type Timestamp13 = string; +export type WorkingStart12 = number; +export type Metadata30 = { + [k: string]: unknown; +} | null; +export type Pending12 = boolean | null; +export type Event12 = "error"; +export type Uuid13 = string | null; +export type SpanId13 = string | null; +export type Timestamp14 = string; +export type WorkingStart13 = number; +export type Metadata31 = { + [k: string]: unknown; +} | null; +export type Pending13 = boolean | null; +export type Event13 = "logger"; +export type Name11 = string | null; +export type Level = + | "debug" + | "trace" + | "http" + | "sandbox" + | "info" + | "warning" + | "error" + | "critical"; +export type Message4 = string; +export type Created1 = number; +export type Filename1 = string; +export type Module = string; +export type Lineno = number; +export type Uuid14 = string | null; +export type SpanId14 = string | null; +export type Timestamp15 = string; +export type WorkingStart14 = number; +export type Metadata32 = { + [k: string]: unknown; +} | null; +export type Pending14 = boolean | null; +export type Event14 = "info"; +export type Source5 = string | null; +export type Uuid15 = string | null; +export type SpanId15 = string | null; +export type Timestamp16 = string; +export type WorkingStart15 = number; +export type Metadata33 = { + [k: string]: unknown; +} | null; +export type Pending15 = boolean | null; +export type Event15 = "span_begin"; +export type Id10 = string; +export type ParentId = string | null; +export type Type23 = string | null; +export type Name12 = string; +export type Uuid16 = string | null; +export type SpanId16 = string | null; +export type Timestamp17 = string; +export type WorkingStart16 = number; +export type Metadata34 = { + [k: string]: unknown; +} | null; +export type Pending16 = boolean | null; +export type Event16 = "span_end"; +export type Id11 = string; +export type Uuid17 = string | null; +export type SpanId17 = string | null; +export type Timestamp18 = string; +export type WorkingStart17 = number; +export type Metadata35 = { + [k: string]: unknown; +} | null; +export type Pending17 = boolean | null; +export type Event17 = "step"; +export type Action1 = "begin" | "end"; +export type Type24 = string | null; +export type Name13 = string; +export type Uuid18 = string | null; +export type SpanId18 = string | null; +export type Timestamp19 = string; +export type WorkingStart18 = number; +export type Metadata36 = { + [k: string]: unknown; +} | null; +export type Pending18 = boolean | null; +export type Event18 = "subtask"; +export type Name14 = string; +export type Type25 = string | null; +export type Events2 = unknown[]; +export type Completed3 = string | null; +export type WorkingTime2 = number | null; +export type Events = ( + | SampleInitEvent + | SampleLimitEvent + | SandboxEvent + | StateEvent + | StoreEvent + | ModelEvent + | ToolEvent + | ApprovalEvent + | CompactionEvent + | InputEvent + | ScoreEvent + | ScoreEditEvent + | ErrorEvent + | LoggerEvent + | InfoEvent + | SpanBeginEvent + | SpanEndEvent + | StepEvent + | SubtaskEvent +)[]; +export type Timelines = Timeline[] | null; +export type Name15 = string; +export type Description3 = string; +export type Type26 = "span"; +export type Id12 = string; +export type Name16 = string; +export type SpanType = string | null; +export type Type27 = "event"; +export type Event19 = + | SampleInitEvent + | SampleLimitEvent + | SandboxEvent + | StateEvent + | StoreEvent + | ModelEvent + | ToolEvent + | ApprovalEvent + | CompactionEvent + | InputEvent + | ScoreEvent + | ScoreEditEvent + | ErrorEvent + | LoggerEvent + | InfoEvent + | SpanBeginEvent + | SpanEndEvent + | StepEvent + | SubtaskEvent; +export type Content6 = (TimelineEvent | TimelineSpan)[]; +export type Type28 = "branch"; +export type ForkedAt = string; +export type Content7 = (TimelineEvent | TimelineSpan)[]; +export type Branches = TimelineBranch[]; +export type Description4 = string | null; +export type Utility = boolean; +export type AgentResult = string | null; +export type Event20 = string; +export type Children = OutlineNode[]; +export type Nodes = OutlineNode[]; +export type StartedAt1 = string | null; +export type CompletedAt1 = string | null; +export type TotalTime = number | null; +export type WorkingTime3 = number | null; +export type Uuid19 = string | null; +export type ErrorRetries = EvalError[] | null; +export type MessagePool = ( + | ChatMessageSystem + | ChatMessageUser + | ChatMessageAssistant + | ChatMessageTool +)[]; +export type CallPool = JsonValue[]; +export type Type29 = + | "context" + | "time" + | "working" + | "message" + | "token" + | "cost" + | "operator" + | "custom"; +export type Limit2 = number; +export type Reductions = EvalSampleReductions[] | null; +export type Scorer1 = string; +export type Reducer1 = string | null; +export type Value3 = + | string + | number + | boolean + | (string | number | boolean)[] + | { + [k: string]: string | number | boolean | null; + }; +export type Answer2 = string | null; +export type Explanation3 = string | null; +export type Metadata37 = { + [k: string]: unknown; +} | null; +export type History1 = ScoreEdit[]; +export type SampleId1 = string | number | null; +export type Samples2 = EvalSampleScore[]; +export type Location1 = string; +export type Etag = string | null; +export type EvalSetId1 = string; +export type Name17 = string | null; +export type TaskId1 = string; +export type TaskFile1 = string | null; +export type Model5 = string; +export type ModelRoles1 = { + [k: string]: string; +} | null; +export type Sequence = number; +export type Tasks = EvalSetTask[]; + +/** + * Evaluation log. + */ +export interface EvalLog { + version?: Version; + status?: Status; + eval: EvalSpec; + plan?: EvalPlan; + results?: EvalResults | null; + stats?: EvalStats; + error?: EvalError | null; + invalidated?: Invalidated; + log_updates?: LogUpdates; + tags?: Tags1; + metadata?: Metadata8; + samples?: Samples1; + reductions?: Reductions; + location?: Location1; + etag?: Etag; + eval_set_info?: EvalSet | null; +} +/** + * Eval target and configuration. + */ +export interface EvalSpec { + eval_set_id: EvalSetId; + eval_id: EvalId; + run_id: RunId; + created: Created; + task: Task; + task_id: TaskId; + task_version: TaskVersion; + task_file: TaskFile; + task_display_name: TaskDisplayName; + task_registry_name: TaskRegistryName; + task_attribs: TaskAttribs; + task_args: TaskArgs; + task_args_passed: TaskArgsPassed; + solver: Solver; + solver_args: SolverArgs; + solver_args_passed: SolverArgsPassed; + tags: Tags; + dataset: EvalDataset; + sandbox: SandboxEnvironmentSpec | null; + model: Model; + model_generate_config: GenerateConfig; + model_base_url: ModelBaseUrl; + model_args: ModelArgs; + model_roles: ModelRoles; + config: EvalConfig; + revision: EvalRevision | null; + packages: Packages; + metadata: Metadata; + scorers: Scorers; + metrics: Metrics1; +} +export interface TaskAttribs { + [k: string]: unknown; +} +export interface TaskArgs { + [k: string]: unknown; +} +export interface TaskArgsPassed { + [k: string]: unknown; +} +/** + * Dataset used for evaluation. + */ +export interface EvalDataset { + name: Name; + location: Location; + samples: Samples; + sample_ids: SampleIds; + shuffled: Shuffled; +} +/** + * Specification of a SandboxEnvironment. + */ +export interface SandboxEnvironmentSpec { + type: Type; + config: Config; +} +export interface Config { + [k: string]: unknown; +} +/** + * Model generation options. + */ +export interface GenerateConfig { + max_retries: MaxRetries; + timeout: Timeout; + attempt_timeout: AttemptTimeout; + max_connections: MaxConnections; + system_message: SystemMessage; + max_tokens: MaxTokens; + top_p: TopP; + temperature: Temperature; + stop_seqs: StopSeqs; + best_of: BestOf; + frequency_penalty: FrequencyPenalty; + presence_penalty: PresencePenalty; + logit_bias: LogitBias; + seed: Seed; + top_k: TopK; + num_choices: NumChoices; + logprobs: Logprobs; + top_logprobs: TopLogprobs; + parallel_tool_calls: ParallelToolCalls; + internal_tools: InternalTools; + max_tool_output: MaxToolOutput; + cache_prompt: CachePrompt; + verbosity: Verbosity; + effort: Effort; + reasoning_effort: ReasoningEffort; + reasoning_tokens: ReasoningTokens; + reasoning_summary: ReasoningSummary; + reasoning_history: ReasoningHistory; + response_schema: ResponseSchema | null; + extra_headers: ExtraHeaders; + extra_body: ExtraBody; + modalities: Modalities; + cache: Cache; + batch: Batch; +} +/** + * Schema for model response when using Structured Output. + */ +export interface ResponseSchema { + name: Name1; + json_schema: JSONSchema; + description: Description1; + strict: Strict; +} +/** + * JSON Schema for type. + */ +export interface JSONSchema { + type: Type1; + format: Format; + description: Description; + default: Default; + enum: Enum; + items: JSONSchema | null; + properties: Properties; + additionalProperties: Additionalproperties; + anyOf: Anyof; + required: Required; +} +export interface Default { + [k: string]: unknown; +} +/** + * Image output configuration. + * + * Use the `options` field to pass provider-specific options directly + * to the underlying API (e.g. OpenAI image_generation tool parameters). + */ +export interface ImageOutput { + options: Options; +} +/** + * Caching options for model generation. + */ +export interface CachePolicy { + expiry: Expiry; + per_epoch: PerEpoch; + scopes: Scopes; +} +export interface Scopes { + [k: string]: string; +} +/** + * Batch processing configuration. + */ +export interface BatchConfig { + size: Size; + max_size: MaxSize; + send_delay: SendDelay; + tick: Tick; + max_batches: MaxBatches; + max_consecutive_check_failures: MaxConsecutiveCheckFailures; +} +export interface ModelArgs { + [k: string]: unknown; +} +/** + * Model config. + */ +export interface ModelConfig { + model: Model1; + config: GenerateConfig; + base_url: BaseUrl; + args: Args; +} +export interface Args { + [k: string]: unknown; +} +/** + * Configuration used for evaluation. + */ +export interface EvalConfig { + limit: Limit; + sample_id: SampleId; + sample_shuffle: SampleShuffle; + epochs: Epochs; + epochs_reducer: EpochsReducer; + approval: ApprovalPolicyConfig | null; + fail_on_error: FailOnError; + continue_on_fail: ContinueOnFail; + retry_on_error: RetryOnError; + message_limit: MessageLimit; + token_limit: TokenLimit; + time_limit: TimeLimit; + working_limit: WorkingLimit; + cost_limit: CostLimit; + max_samples: MaxSamples; + max_dataset_memory: MaxDatasetMemory; + max_tasks: MaxTasks; + max_subprocesses: MaxSubprocesses; + max_sandboxes: MaxSandboxes; + sandbox_cleanup: SandboxCleanup; + log_samples: LogSamples; + log_realtime: LogRealtime; + log_images: LogImages; + log_model_api: LogModelApi; + log_buffer: LogBuffer; + log_shared: LogShared; + score_display: ScoreDisplay; +} +export interface ApprovalPolicyConfig { + approvers: Approvers; +} +/** + * Configuration format for approver policies. + * + * For example, here is a configuration in YAML: + * + * ```yaml + * approvers: + * - name: human + * tools: web_browser*, bash, pyhton + * choices: [approve, reject] + * + * - name: auto + * tools: * + * decision: approve + * ``` + */ +export interface ApproverPolicyConfig { + name: Name2; + tools: Tools; + params: Params; +} +export interface Params { + [k: string]: unknown; +} +/** + * Git revision for evaluation. + */ +export interface EvalRevision { + type: Type2; + origin: Origin; + commit: Commit; + dirty: Dirty; +} +export interface Packages { + [k: string]: string; +} +export interface EvalScorer { + name: Name3; + options: Options1; + metrics: Metrics; + metadata: Metadata1; +} +export interface EvalMetricDefinition { + name: Name4; + options: Options2; +} +/** + * Plan (solvers) used in evaluation. + */ +export interface EvalPlan { + name: Name5; + steps: Steps; + finish: EvalPlanStep | null; + config: GenerateConfig1; +} +/** + * Solver step. + */ +export interface EvalPlanStep { + solver: Solver1; + params: Params1; + params_passed: ParamsPassed; +} +export interface Params1 { + [k: string]: unknown; +} +export interface ParamsPassed { + [k: string]: unknown; +} +/** + * Model generation options. + */ +export interface GenerateConfig1 { + max_retries: MaxRetries; + timeout: Timeout; + attempt_timeout: AttemptTimeout; + max_connections: MaxConnections; + system_message: SystemMessage; + max_tokens: MaxTokens; + top_p: TopP; + temperature: Temperature; + stop_seqs: StopSeqs; + best_of: BestOf; + frequency_penalty: FrequencyPenalty; + presence_penalty: PresencePenalty; + logit_bias: LogitBias; + seed: Seed; + top_k: TopK; + num_choices: NumChoices; + logprobs: Logprobs; + top_logprobs: TopLogprobs; + parallel_tool_calls: ParallelToolCalls; + internal_tools: InternalTools; + max_tool_output: MaxToolOutput; + cache_prompt: CachePrompt; + verbosity: Verbosity; + effort: Effort; + reasoning_effort: ReasoningEffort; + reasoning_tokens: ReasoningTokens; + reasoning_summary: ReasoningSummary; + reasoning_history: ReasoningHistory; + response_schema: ResponseSchema | null; + extra_headers: ExtraHeaders; + extra_body: ExtraBody; + modalities: Modalities; + cache: Cache; + batch: Batch; +} +/** + * Scoring results from evaluation. + */ +export interface EvalResults { + total_samples: TotalSamples; + completed_samples: CompletedSamples; + early_stopping: EarlyStoppingSummary | null; + scores: Scores; + metadata: Metadata6; +} +/** + * Summary of early stopping applied to task. + */ +export interface EarlyStoppingSummary { + manager: Manager; + early_stops: EarlyStops; + metadata: Metadata3; +} +/** + * Directive to stop a sample early. + */ +export interface EarlyStop { + id: Id; + epoch: Epoch; + reason: Reason; + metadata: Metadata2; +} +export interface Metadata3 { + [k: string]: JsonValue; +} +/** + * Score for evaluation task. + */ +export interface EvalScore { + name: Name6; + scorer: Scorer; + reducer: Reducer; + scored_samples: ScoredSamples; + unscored_samples: UnscoredSamples; + params: Params2; + metrics: Metrics2; + metadata: Metadata5; +} +export interface Params2 { + [k: string]: unknown; +} +export interface Metrics2 { + [k: string]: EvalMetric; +} +/** + * Metric for evaluation score. + */ +export interface EvalMetric { + name: Name7; + value: Value; + params: Params3; + metadata: Metadata4; +} +export interface Params3 { + [k: string]: unknown; +} +/** + * Timing and usage statistics. + */ +export interface EvalStats { + started_at: StartedAt; + completed_at: CompletedAt; + model_usage: ModelUsage; + role_usage: RoleUsage; +} +export interface ModelUsage { + [k: string]: ModelUsage1; +} +/** + * Token usage for completion. + */ +export interface ModelUsage1 { + input_tokens: InputTokens; + output_tokens: OutputTokens; + total_tokens: TotalTokens; + input_tokens_cache_write: InputTokensCacheWrite; + input_tokens_cache_read: InputTokensCacheRead; + reasoning_tokens: ReasoningTokens1; + total_cost: TotalCost; +} +export interface RoleUsage { + [k: string]: ModelUsage1; +} +/** + * Eval error details. + */ +export interface EvalError { + message: Message; + traceback: Traceback; + traceback_ansi: TracebackAnsi; +} +/** + * A group of edits that share provenance. + */ +export interface LogUpdate { + edits: Edits; + provenance: ProvenanceData; +} +/** + * Edit action for tags. + */ +export interface TagsEdit { + type: Type3; + tags_add: TagsAdd; + tags_remove: TagsRemove; +} +/** + * Edit action for metadata. + */ +export interface MetadataEdit { + type: Type4; + metadata_set: MetadataSet; + metadata_remove: MetadataRemove; +} +export interface MetadataSet { + [k: string]: unknown; +} +/** + * Metadata about who made an edit and why. + */ +export interface ProvenanceData { + timestamp: Timestamp; + author: Author; + reason: Reason1; + metadata: Metadata7; +} +export interface Metadata7 { + [k: string]: unknown; +} +export interface Metadata8 { + [k: string]: unknown; +} +/** + * Sample from evaluation task. + */ +export interface EvalSample { + id: Id1; + epoch: Epoch1; + input: Input; + choices: Choices; + target: Target; + sandbox: SandboxEnvironmentSpec | null; + files: Files; + setup: Setup; + messages: Messages; + output: ModelOutput; + scores: Scores1; + metadata: Metadata16; + store: Store; + events: Events; + timelines: Timelines; + model_usage: ModelUsage3; + role_usage: RoleUsage2; + started_at: StartedAt1; + completed_at: CompletedAt1; + total_time: TotalTime; + working_time: WorkingTime3; + uuid: Uuid19; + invalidation: ProvenanceData | null; + error: EvalError | null; + error_retries: ErrorRetries; + attachments: Attachments; + message_pool: MessagePool; + call_pool: CallPool; + limit: EvalSampleLimit | null; +} +/** + * System chat message. + */ +export interface ChatMessageSystem { + id: Id2; + content: Content; + source: Source; + metadata: Metadata9; + role: Role; +} +/** + * Text content. + */ +export interface ContentText { + internal: unknown; + type: Type5; + text: Text; + refusal: Refusal; + citations: Citations; +} +/** + * A generic content citation. + */ +export interface ContentCitation { + cited_text: CitedText; + title: Title; + internal: Internal; + type: Type6; +} +/** + * A citation that refers to a page range in a document. + */ +export interface DocumentCitation { + cited_text: CitedText1; + title: Title1; + internal: Internal1; + type: Type7; + range: DocumentRange | null; +} +/** + * A range specifying a section of a document. + */ +export interface DocumentRange { + type: Type8; + start_index: StartIndex; + end_index: EndIndex; +} +/** + * A citation that refers to a URL. + */ +export interface UrlCitation { + cited_text: CitedText2; + title: Title2; + internal: Internal2; + type: Type9; + url: Url; +} +/** + * Reasoning content. + * + * See the specification for [thinking blocks](https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking#understanding-thinking-blocks) for Claude models. + */ +export interface ContentReasoning { + internal: unknown; + type: Type10; + reasoning: Reasoning; + summary: Summary; + signature: Signature; + redacted: Redacted; +} +/** + * Image content. + */ +export interface ContentImage { + internal: unknown; + type: Type11; + image: Image; + detail: Detail; +} +/** + * Audio content. + */ +export interface ContentAudio { + internal: unknown; + type: Type12; + audio: Audio; + format: Format1; +} +/** + * Video content. + */ +export interface ContentVideo { + internal: unknown; + type: Type13; + video: Video; + format: Format2; +} +/** + * Model internal. + */ +export interface ContentData { + internal: unknown; + type: Type14; + data: Data; +} +export interface Data { + [k: string]: JsonValue; +} +/** + * Server side tool use. + */ +export interface ContentToolUse { + internal: unknown; + type: Type15; + tool_type: ToolType; + id: Id3; + name: Name8; + context: Context; + arguments: Arguments; + result: Result; + error: Error; +} +/** + * Document content (e.g. a PDF). + */ +export interface ContentDocument { + internal: unknown; + type: Type16; + document: Document; + filename: Filename; + mime_type: MimeType; +} +/** + * User chat message. + */ +export interface ChatMessageUser { + id: Id4; + content: Content1; + source: Source1; + metadata: Metadata10; + role: Role1; + tool_call_id: ToolCallId; +} +/** + * Assistant chat message. + */ +export interface ChatMessageAssistant { + id: Id5; + content: Content2; + source: Source2; + metadata: Metadata11; + role: Role2; + tool_calls: ToolCalls; + model: Model2; +} +export interface ToolCall { + id: Id6; + function: Function; + arguments: Arguments1; + parse_error: ParseError; + view: ToolCallContent | null; + type: Type17; +} +export interface Arguments1 { + [k: string]: unknown; +} +/** + * Content to include in tool call view. + */ +export interface ToolCallContent { + title: Title3; + format: Format3; + content: Content3; +} +/** + * Tool chat message. + */ +export interface ChatMessageTool { + id: Id7; + content: Content4; + source: Source3; + metadata: Metadata12; + role: Role3; + tool_call_id: ToolCallId1; + function: Function1; + error: ToolCallError | null; +} +export interface ToolCallError { + type: Type18; + message: Message1; +} +/** + * Output from model generation. + */ +export interface ModelOutput { + model: Model3; + choices: Choices1; + completion: Completion; + usage: ModelUsage1 | null; + time: Time; + metadata: Metadata13; + error: Error1; +} +/** + * Choice generated for completion. + */ +export interface ChatCompletionChoice { + message: ChatMessageAssistant; + stop_reason: StopReason; + logprobs: Logprobs1 | null; +} +/** + * Log probability information for a completion choice. + */ +export interface Logprobs1 { + content: Content5; +} +/** + * Log probability for a token. + */ +export interface Logprob { + token: Token; + logprob: Logprob1; + bytes: Bytes; + top_logprobs: TopLogprobs1; +} +/** + * List of the most likely tokens and their log probability, at this token position. + */ +export interface TopLogprob { + token: Token1; + logprob: Logprob2; + bytes: Bytes1; +} +/** + * Score generated by a scorer. + */ +export interface Score { + value: Value1; + answer: Answer; + explanation: Explanation; + metadata: Metadata14; + history: History; +} +/** + * A single edit to a score. + */ +export interface ScoreEdit { + value: Value2; + answer: Answer1; + explanation: Explanation1; + metadata: Metadata15; + provenance: ProvenanceData | null; +} +export interface Metadata16 { + [k: string]: unknown; +} +export interface Store { + [k: string]: unknown; +} +/** + * Beginning of processing a Sample. + */ +export interface SampleInitEvent { + uuid: Uuid; + span_id: SpanId; + timestamp: Timestamp1; + working_start: WorkingStart; + metadata: Metadata17; + pending: Pending; + event: Event; + sample: Sample; + state: JsonValue; +} +/** + * Sample for an evaluation task. + */ +export interface Sample { + input: Input1; + choices: Choices2; + target: Target1; + id: Id8; + metadata: Metadata18; + sandbox: SandboxEnvironmentSpec | null; + files: Files1; + setup: Setup1; +} +/** + * The sample was unable to finish processing due to a limit + */ +export interface SampleLimitEvent { + uuid: Uuid1; + span_id: SpanId1; + timestamp: Timestamp2; + working_start: WorkingStart1; + metadata: Metadata19; + pending: Pending1; + event: Event1; + type: Type19; + message: Message2; + limit: Limit1; +} +/** + * Sandbox execution or I/O + */ +export interface SandboxEvent { + uuid: Uuid2; + span_id: SpanId2; + timestamp: Timestamp3; + working_start: WorkingStart2; + metadata: Metadata20; + pending: Pending2; + event: Event2; + action: Action; + cmd: Cmd; + options: Options3; + file: File; + input: Input2; + result: Result1; + output: Output; + completed: Completed; +} +/** + * Change to the current `TaskState` + */ +export interface StateEvent { + uuid: Uuid3; + span_id: SpanId3; + timestamp: Timestamp4; + working_start: WorkingStart3; + metadata: Metadata21; + pending: Pending3; + event: Event3; + changes: Changes; +} +/** + * Describes a change to data using JSON Patch format. + */ +export interface JsonChange { + op: Op; + path: Path; + from: From; + value: { + [k: string]: unknown; + }; + replaced: { + [k: string]: unknown; + }; +} +/** + * Change to data within the current `Store`. + */ +export interface StoreEvent { + uuid: Uuid4; + span_id: SpanId4; + timestamp: Timestamp5; + working_start: WorkingStart4; + metadata: Metadata22; + pending: Pending4; + event: Event4; + changes: Changes1; +} +/** + * Call to a language model. + */ +export interface ModelEvent { + uuid: Uuid5; + span_id: SpanId5; + timestamp: Timestamp6; + working_start: WorkingStart5; + metadata: Metadata23; + pending: Pending5; + event: Event5; + model: Model4; + role: Role4; + input: Input3; + input_refs: InputRefs; + tools: Tools1; + tool_choice: ToolChoice; + config: GenerateConfig; + output: ModelOutput; + retries: Retries; + error: Error2; + traceback: Traceback1; + traceback_ansi: TracebackAnsi1; + cache: Cache1; + call: ModelCall | null; + completed: Completed1; + working_time: WorkingTime; +} +/** + * Specification of a tool (JSON Schema compatible) + * + * If you are implementing a ModelAPI, most LLM libraries can + * be passed this object (dumped to a dict) directly as a function + * specification. For example, in the OpenAI provider: + * + * ```python + * ChatCompletionToolParam( + * type="function", + * function=tool.model_dump(exclude_none=True), + * ) + * ``` + * + * In some cases the field names don't match up exactly. In that case + * call `model_dump()` on the `parameters` field. For example, in the + * Anthropic provider: + * + * ```python + * ToolParam( + * name=tool.name, + * description=tool.description, + * input_schema=tool.parameters.model_dump(exclude_none=True), + * ) + * ``` + */ +export interface ToolInfo { + name: Name9; + description: Description2; + parameters: ToolParams; + options: Options4; +} +/** + * Description of tool parameters object in JSON Schema format. + */ +export interface ToolParams { + type: Type20; + properties: Properties1; + required: Required1; + additionalProperties: Additionalproperties1; +} +export interface Properties1 { + [k: string]: JSONSchema; +} +export interface ToolFunction { + name: Name10; +} +/** + * Model call (raw request/response data). + */ +export interface ModelCall { + request: Request; + response: Response; + error: Error3; + time: Time1; + call_refs: CallRefs; + call_key: CallKey; +} +export interface Request { + [k: string]: JsonValue; +} +/** + * Call to a tool. + */ +export interface ToolEvent { + uuid: Uuid6; + span_id: SpanId6; + timestamp: Timestamp7; + working_start: WorkingStart6; + metadata: Metadata24; + pending: Pending6; + event: Event6; + type: Type21; + id: Id9; + function: Function2; + arguments: Arguments2; + view: ToolCallContent | null; + result: Result2; + truncated: Truncated; + error: ToolCallError | null; + events: Events1; + completed: Completed2; + working_time: WorkingTime1; + agent: Agent; + agent_span_id: AgentSpanId; + failed: Failed; + message_id: MessageId; +} +export interface Arguments2 { + [k: string]: JsonValue; +} +/** + * Tool approval. + */ +export interface ApprovalEvent { + uuid: Uuid7; + span_id: SpanId7; + timestamp: Timestamp8; + working_start: WorkingStart7; + metadata: Metadata25; + pending: Pending7; + event: Event7; + message: Message3; + call: ToolCall; + view: ToolCallView | null; + approver: Approver; + decision: Decision; + modified: ToolCall | null; + explanation: Explanation2; +} +/** + * Custom view of a tool call. + * + * Both `context` and `call` are optional. If `call` is not specified + * then the view will default to a syntax highlighted Python function call. + */ +export interface ToolCallView { + context: ToolCallContent | null; + call: ToolCallContent | null; +} +/** + * Compaction of conversation history. + */ +export interface CompactionEvent { + uuid: Uuid8; + span_id: SpanId8; + timestamp: Timestamp9; + working_start: WorkingStart8; + metadata: Metadata26; + pending: Pending8; + event: Event8; + type: Type22; + tokens_before: TokensBefore; + tokens_after: TokensAfter; + source: Source4; +} +/** + * Input screen interaction. + */ +export interface InputEvent { + uuid: Uuid9; + span_id: SpanId9; + timestamp: Timestamp10; + working_start: WorkingStart9; + metadata: Metadata27; + pending: Pending9; + event: Event9; + input: Input4; + input_ansi: InputAnsi; +} +/** + * Event with score. + * + * Can be the final score for a `Sample`, or can be an intermediate score + * resulting from a call to `score`. + */ +export interface ScoreEvent { + uuid: Uuid10; + span_id: SpanId10; + timestamp: Timestamp11; + working_start: WorkingStart10; + metadata: Metadata28; + pending: Pending10; + event: Event10; + score: Score; + target: Target2; + intermediate: Intermediate; + model_usage: ModelUsage2; + role_usage: RoleUsage1; +} +/** + * Event recorded when a score is edited. + */ +export interface ScoreEditEvent { + uuid: Uuid11; + span_id: SpanId11; + timestamp: Timestamp12; + working_start: WorkingStart11; + metadata: Metadata29; + pending: Pending11; + event: Event11; + score_name: ScoreName; + edit: ScoreEdit; +} +/** + * Event with sample error. + */ +export interface ErrorEvent { + uuid: Uuid12; + span_id: SpanId12; + timestamp: Timestamp13; + working_start: WorkingStart12; + metadata: Metadata30; + pending: Pending12; + event: Event12; + error: EvalError; +} +/** + * Log message recorded with Python logger. + */ +export interface LoggerEvent { + uuid: Uuid13; + span_id: SpanId13; + timestamp: Timestamp14; + working_start: WorkingStart13; + metadata: Metadata31; + pending: Pending13; + event: Event13; + message: LoggingMessage; +} +/** + * Message written to Python log. + */ +export interface LoggingMessage { + name: Name11; + level: Level; + message: Message4; + created: Created1; + filename: Filename1; + module: Module; + lineno: Lineno; +} +/** + * Event with custom info/data. + */ +export interface InfoEvent { + uuid: Uuid14; + span_id: SpanId14; + timestamp: Timestamp15; + working_start: WorkingStart14; + metadata: Metadata32; + pending: Pending14; + event: Event14; + source: Source5; + data: JsonValue; +} +/** + * Mark the beginning of a transcript span. + */ +export interface SpanBeginEvent { + uuid: Uuid15; + span_id: SpanId15; + timestamp: Timestamp16; + working_start: WorkingStart15; + metadata: Metadata33; + pending: Pending15; + event: Event15; + id: Id10; + parent_id: ParentId; + type: Type23; + name: Name12; +} +/** + * Mark the end of a transcript span. + */ +export interface SpanEndEvent { + uuid: Uuid16; + span_id: SpanId16; + timestamp: Timestamp17; + working_start: WorkingStart16; + metadata: Metadata34; + pending: Pending16; + event: Event16; + id: Id11; +} +/** + * Step within current sample or subtask. + */ +export interface StepEvent { + uuid: Uuid17; + span_id: SpanId17; + timestamp: Timestamp18; + working_start: WorkingStart17; + metadata: Metadata35; + pending: Pending17; + event: Event17; + action: Action1; + type: Type24; + name: Name13; +} +/** + * Subtask spawned. + */ +export interface SubtaskEvent { + uuid: Uuid18; + span_id: SpanId18; + timestamp: Timestamp19; + working_start: WorkingStart18; + metadata: Metadata36; + pending: Pending18; + event: Event18; + name: Name14; + type: Type25; + input: Input5; + result: Result3; + events: Events2; + completed: Completed3; + working_time: WorkingTime2; +} +export interface Input5 { + [k: string]: unknown; +} +export interface Result3 { + [k: string]: unknown; +} +/** + * A named timeline view over a transcript. + * + * Multiple timelines allow different interpretations of the same event + * stream — e.g. a default agent-centric view alongside an alternative + * grouping or filtered view. + */ +export interface Timeline { + name: Name15; + description: Description3; + root: TimelineSpan; +} +/** + * A span of execution — agent, scorer, tool, or root. + */ +export interface TimelineSpan { + type: Type26; + id: Id12; + name: Name16; + span_type: SpanType; + content: Content6; + branches: Branches; + description: Description4; + utility: Utility; + agent_result: AgentResult; + outline: Outline | null; +} +/** + * Wraps a single Event. + */ +export interface TimelineEvent { + type: Type27; + event: Event19; +} +/** + * A discarded alternative path from a branch point. + */ +export interface TimelineBranch { + type: Type28; + forked_at: ForkedAt; + content: Content7; +} +/** + * Hierarchical outline of events for an agent. + */ +export interface Outline { + nodes: Nodes; +} +/** + * A node in an agent's outline, referencing an event by UUID. + */ +export interface OutlineNode { + event: Event20; + children: Children; +} +export interface ModelUsage3 { + [k: string]: ModelUsage1; +} +export interface RoleUsage2 { + [k: string]: ModelUsage1; +} +export interface Attachments { + [k: string]: string; +} +/** + * Limit encountered by sample. + */ +export interface EvalSampleLimit { + type: Type29; + limit: Limit2; +} +/** + * Score reductions. + */ +export interface EvalSampleReductions { + scorer: Scorer1; + reducer: Reducer1; + samples: Samples2; +} +/** + * Score and sample_id scored. + */ +export interface EvalSampleScore { + value: Value3; + answer: Answer2; + explanation: Explanation3; + metadata: Metadata37; + history: History1; + sample_id: SampleId1; +} +export interface EvalSet { + eval_set_id: EvalSetId1; + tasks: Tasks; +} +export interface EvalSetTask { + name: Name17; + task_id: TaskId1; + task_file: TaskFile1; + task_args: TaskArgs1; + model: Model5; + model_args: ModelArgs1; + model_roles: ModelRoles1; + sequence: Sequence; +} +export interface TaskArgs1 { + [k: string]: unknown; +} +export interface ModelArgs1 { + [k: string]: unknown; +} diff --git a/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/@types/markdown-it-mathjax3.d.ts b/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/@types/markdown-it-mathjax3.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ca865aba752678f28ff0982dc4709bd6516c3109 --- /dev/null +++ b/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/@types/markdown-it-mathjax3.d.ts @@ -0,0 +1,35 @@ +declare module "markdown-it-mathjax3" { + import MarkdownIt from "markdown-it"; + + interface MathjaxOptions { + tex?: { + inlineMath?: [string, string][]; + displayMath?: [string, string][]; + tags?: string; + tagSide?: string; + tagIndent?: string; + useLabelIds?: boolean; + multlineWidth?: string; + maxMacros?: number; + maxBuffer?: number; + }; + svg?: { + fontCache?: string; + localID?: string | null; + }; + chtml?: { + scale?: number; + minScale?: number; + matchFontHeight?: boolean; + fontURL?: string; + }; + startup?: { + typeset?: boolean; + ready?: () => void; + }; + } + + const markdownItMathjax3: (md: MarkdownIt, options?: MathjaxOptions) => void; + + export default markdownItMathjax3; +} diff --git a/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/@types/prism.d.ts b/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/@types/prism.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ffee12676cc3a464e1dde8bcbc9b44af7505ea49 --- /dev/null +++ b/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/@types/prism.d.ts @@ -0,0 +1,15 @@ +declare var Prism: { + languages: any; + highlight(contents: any, tokens: any, type: any): string; + highlightElement( + element: HTMLElement, + async?: boolean, + callback?: (element: HTMLElement) => void, + ); + + highlightAllUnder( + element: HTMLElement, + async?: boolean, + callback?: (element: HTMLElement) => void, + ); +}; diff --git a/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/app/App.css b/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/app/App.css new file mode 100644 index 0000000000000000000000000000000000000000..0d4bac60badde2d03a5e3a23d297f006203cec31 --- /dev/null +++ b/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/app/App.css @@ -0,0 +1,1300 @@ +:root { + --bs-border-radius: 3px; + --bs-border-radius-lg: 4px; + --bs-popover-max-width: 50%; + --bs-code-color: #8b0000; + --inspect-find-background: var(--bs-body-bg); + --inspect-find-foreground: var(--bs-body-color); + --inspect-input-background: var(--bs-body-bg); + --inspect-input-foreground: var(--bs-body-color); + --inspect-input-border: var(--bs-light-border-subtle); + --inspect-diff-add-color: #dafbe1; + --inspect-diff-remove-color: #ffebe9; + --inspect-inactive-selection-background: var( + --vscode-editor-inactiveSelectionBackground, + #d9d9d9 + ); + --inspect-active-selection-background: var( + --vscode-editor-selectionBackground, + #d7d4f0 + ); + --inspect-focus-border-color: #86b7fe; + --inspect-focus-border-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25); + --inspect-focus-border-gray-color: #808080; + --inspect-focus-border-gray-shadow: 0 0 0 0.25rem rgba(48, 48, 48, 0.25); + + /* Inspect Font Sizes */ + --inspect-font-size-title: 1.5rem; + --inspect-font-size-title-secondary: 1.3rem; + --inspect-font-size-largest: 1.2rem; + --inspect-font-size-larger: 1.1rem; + --inspect-font-size-large: 1rem; + --inspect-font-size-base: 0.9rem; + --inspect-font-size-small: 0.8rem; + --inspect-font-size-smaller: 0.8rem; + --inspect-font-size-smallest: 0.7rem; + --inspect-font-size-smallestest: 0.6rem; + + /* Inspect Glass */ + --inspect-glass-color: #000000; + --inspect-glass-opacity: 0.3; + + --inspect-event-panel-sticky-top: 30px; + --inspect-event-panel-sticky-margin: -5px -10px -5px 0; + --inspect-event-panel-sticky-stuck-margin-left: -22px; + --inspect-event-panel-sticky-stuck-margin-right: -10px; +} + +body:not([class^="vscode-"]) button { + --bs-nav-pills-link-active-bg: #e3eaf1; + --bs-nav-pills-link-active-color: black; + --bs-nav-link-color: black; +} + +/* AG Grid Theming */ +body { + --ag-background-color: var(--bs-body-bg); + --ag-foreground-color: var(--bs-body-color); + --ag-header-background-color: var(--bs-light-bg); + --ag-header-font-size: var(--inspect-font-size-small); + --ag-header-font-weight: 500; + --ag-header-text-color: var(--bs-secondary); + + --ag-font-family: var(--bs-body-font-family); + --ag-wrapper-border: none; + --ag-row-hover-color: var(--bs-secondary-bg-subtle); + --ag-selected-row-background-color: var(--bs-secondary-bg-subtle); +} + +#app { + height: 100vh; + overflow-y: hidden; +} + +.app-main-grid { + display: grid; + height: 100vh; + overflow-y: hidden; + grid-template-rows: max-content max-content 1fr; +} + +a { + color: var(--bs-link-color); +} + +a:hover { + color: var(--bs-link-hover-color); +} + +.modal { + --bs-modal-margin: 0.25rem; +} + +li > p { + margin-bottom: 0; +} + +li > ol, +li > ul { + margin-bottom: 0.5rem; +} + +.modal-backdrop { + --bs-backdrop-opacity: 0.4; +} + +.app-main-grid.single-file-mode { + grid-template-rows: max-content max-content 1fr; +} + +/* Inspect Text Styles */ +.text-style-label { + text-transform: uppercase !important; +} + +.text-style-secondary { + color: var(--bs-secondary) !important; +} + +.text-style-tertiary { + color: var(--bs-tertiary-color) !important; +} + +/* Inspect Font Size Styles */ +.text-size-title { + font-size: var(--inspect-font-size-title) !important; +} + +.text-size-title-secondary { + font-size: var(--inspect-font-size-title-secondary) !important; +} + +.text-size-largest { + font-size: var(--inspect-font-size-largest) !important; +} + +.text-size-larger { + font-size: var(--inspect-font-size-larger) !important; +} + +.text-size-large { + font-size: var(--inspect-font-size-large) !important; +} + +.text-size-base { + font-size: var(--inspect-font-size-base) !important; +} + +.text-size-small { + font-size: var(--inspect-font-size-small) !important; +} + +.text-size-smaller { + font-size: var(--inspect-font-size-smaller) !important; +} + +.text-size-smallest { + font-size: var(--inspect-font-size-smallest) !important; +} + +.text-size-smallestest { + font-size: var(--inspect-font-size-smallestest) !important; +} + +.text-truncate { + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} + +.three-line-clamp { + display: -webkit-box; + -webkit-line-clamp: 3; + -webkit-box-orient: vertical; + overflow: hidden; + max-height: calc(3em * var(--bs-body-line-height)); +} + +body[class^="vscode-"] { + --bs-border-radius: 0; + --bs-border-radius-lg: 0; + --bs-body-bg: var(--vscode-editor-background); + --bs-secondary-bg-subtle: var(--vscode-editorHoverWidget-background); + --bs-card-bg: var(--vscode-editor-background); + --bs-table-bg: var(--vscode-editor-background); + --bs-light-bg-subtle: var(--vscode-sideBar-background); + --bs-light-border-subtle: var(--vscode-editorHoverWidget-border); + --bs-body-color: var(--vscode-editor-foreground); + --bs-table-color: var(--vscode-editor-foreground); + --bs-accordion-btn-color: var(--vscode-editor-foreground); + --bs-emphasis-color: var(--vscode-editor-foreground); + --bs-navbar-brand-color: var(--vscode-editor-foreground); + --bs-navbar-brand-hover-color: var(--vscode-editor-foreground); + --bs-code-color: var(--vscode-editorInfo-foreground); + --bs-light: var(--vscode-sideBar-background); + --bs-btn-bg: var(--vscode-peekViewTitle-background); + --bs-primary: var(--vscode-banner-iconForeground); + --bs-nav-pills-link-active-bg: var(--vscode-banner-iconForeground); + --bs-link-color: var(--vscode-textLink-foreground); + --bs-link-hover-color: var(--vscode-textLink-activeForeground); + --bs-secondary: var(--vscode-breadcrumb-foreground); + --bs-secondary-bg: var(--vscode-list-inactiveSelectionBackground); + --bs-border-color: var(--vscode-editorGroup-border); + --bs-card-border-color: var(--vscode-editorGroup-border); + --bs-warning-bg-subtle: var(--vscode-inputValidation-warningBackground); + --bs-warning-text-emphasis: var(--vscode-input-foreground); + --bs-breadcrumb-divider-color: var(--vscode-foreground); + --inspect-find-background: var(--vscode-editorWidget-background); + --inspect-find-foreground: var(--vscode-editorWidget-foreground); + --inspect-input-background: var(--vscode-input-background); + --inspect-input-foreground: var(--vscode-input-foreground); + --inspect-input-border: var(--vscode-input-border); + --inspect-diff-add-color: var(--vscode-diffEditor-insertedTextBackground); + --inspect-diff-remove-color: var(--vscode-diffEditor-removedTextBackground); + --inspect-glass-color: var(--vscode-editor-foreground); + --inspect-glass-opacity: 0.15; + --inspect-event-panel-sticky-top: 25px; + --inspect-event-panel-sticky-margin: 0px -10px -5px 0; + --inspect-event-panel-sticky-stuck-margin-left: -19px; + --inspect-event-panel-sticky-stuck-margin-right: -10px; +} + +html.vscode { + font-size: 13px; +} + +html.vscode .sample-input { + line-height: 1.3em; + -webkit-line-clamp: 4 !important; +} + +body[class^="vscode-"] .modal-backdrop { + --bs-backdrop-opacity: 0.15; + --bs-backdrop-bg: var(--vscode-editor-foreground); +} + +body[class^="vscode-"] code { + background-color: transparent; +} + +body[class^="vscode-"] .popover.rendered-content, +body[class^="vscode-"] .modal-dialog { + border: solid 1px var(--bs-border-color); +} + +body[class^="vscode-"] .popover-arrow::before { + border-left-color: var(--bs-border-color) !important; +} + +body[class^="vscode-"] + [data-popper-placement^="bottom"] + > .popper-arrow-container + > div, +body[class^="vscode-"] + [data-popper-placement^="left"] + > .popper-arrow-container + > div, +body[class^="vscode-"] + [data-popper-placement^="right"] + > .popper-arrow-container + > div { + border-color: transparent transparent var(--bs-card-border-color) !important; +} + +body[class^="vscode-"] .modal-content { + background-clip: unset; +} + +body[class^="vscode-"] .multi-score-label { + margin-bottom: 5px; +} + +body[class^="vscode-"] { + min-width: 400px; +} + +body[class^="vscode-"] .navbar-brand { + font-size: 1.1em; +} +body[class^="vscode-"] .navbar-brand > div { + margin-top: -0.2rem !important; +} + +body[class^="vscode-"] .task-title { + margin-top: 0.4em; +} + +body[class^="vscode-"] .task-model { + margin-top: 0.2rem; + font-size: 0.9rem; +} + +body[class^="vscode-"] .accordion-button::after { + --bs-accordion-btn-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='black'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e"); + background: white; + mask-image: var(--bs-accordion-btn-icon); +} + +.copy-button i.bi, +body[class^="vscode-"] .navbar-text i.bi { + color: var(--vscode-editor-foreground); +} + +body[class^="vscode-"] .btn-tools { + --bs-btn-hover-bg: var(--vscode-peekViewTitle-background); + --bs-btn-bg: var(--vscode-peekViewTitle-background); + --bs-btn-border-color: var(--vscode-peekViewTitle-background); + --bs-btn-hover-border-color: var(--vscode-peekViewTitle-background); + --bs-btn-color: var(--vscode-peekViewTitleDescription-foreground); + --bs-btn-hover-color: var(--vscode-peekViewTitleDescription-foreground); +} + +body[class^="vscode-"] .btn-primary { + --bs-btn-bg: var(--vscode-button-background); + --bs-btn-border-color: var(--vscode-button-background); + --bs-btn-hover-bg: var(--vscode-button-hoverBackground); + --bs-btn-hover-border-color: var(--vscode-button-hoverBackground); + --bs-btn-color: var(--vscode-button-foreground); + --bs-btn-hover-color: var(--vscode-button-foreground); + --bs-btn-disabled-color: var(--vscode-button-foreground); + --bs-btn-disabled-bg: var(--vscode-button-background); + --bs-btn-disabled-border-color: var(--vscode-button-background); + --bs-btn-disabled-opacity: 0.8; +} + +body[class^="vscode-"] .navbar-brand { + --bs-navbar-brand-color: var(--vscode-sideBarSectionHeader-foreground); + --bs-navbar-brand-hover-color: var(--vscode-sideBarSectionHeader-foreground); +} + +body[class^="vscode-"] .navbar-text { + --bs-navbar-color: var(--vscode-sideBarSectionHeader-foreground); +} + +body[class^="vscode-"] .accordion-item { + --bs-accordion-active-bg: var(--vscode-list-inactiveSelectionBackground); +} + +body[class^="vscode-"] .card-header { + --bs-border-color: var(--vscode-editorGroup-border); + --bs-card-border-color: var(--vscode-editorGroup-border); +} + +body[class^="vscode-"] .card { + --bs-border-color: var(--vscode-editorGroup-border); + --bs-card-border-color: var(--vscode-editorGroup-border); +} + +body[class^="vscode-"] .nav-pills { + --bs-nav-pills-link-active-bg: var(--vscode-notifications-background); + --bs-nav-pills-link-active-color: var(--vscode-notifications-foreground); +} + +body[class^="vscode-"] .nav-link { + --bs-nav-link-color: var(--vscode-notificationLink-foreground); + --bs-link-hover-color: var(--vscode-notificationLink-foreground); +} + +body[class^="vscode-"] .nav-link:hover { + --bs-nav-link-color: var(--vscode-notificationLink-foreground); + --bs-nav-link-hover-color: var(--vscode-notificationLink-foreground); + --bs-nav-tabs-link-hover-border-color: var( + --vscode-notificationLink-foreground + ); +} + +body[class^="vscode-"] .ansi-display { + --ansiBlack: var(--vscode-terminal-ansiBlack); + --ansiRed: var(--vscode-terminal-ansiRed); + --ansiGreen: var(--vscode-terminal-ansiGreen); + --ansiYellow: var(--vscode-terminal-ansiYellow); + --ansiBlue: var(--vscode-terminal-ansiBlue); + --ansiMagenta: var(--vscode-terminal-ansiMagenta); + --ansiCyan: var(--vscode-terminal-ansiCyan); + --ansiWhite: var(--vscode-terminal-ansiWhite); + --ansiBrightBlack: var(--vscode-terminal-ansiBrightBlack); + --ansiBrightRed: var(--vscode-terminal-ansiBrightRed); + --ansiBrightGreen: var(--vscode-terminal-ansiBrightGreen); + --ansiBrightYellow: var(--vscode-terminal-ansiBrightYellow); + --ansiBrightBlue: var(--vscode-terminal-ansiBrightBlue); + --ansiBrightMagenta: var(--vscode-terminal-ansiBrightMagenta); + --ansiBrightCyan: var(--vscode-terminal-ansiBrightCyan); + --ansiBrightWhite: var(--vscode-terminal-ansiBrightWhite); +} + +body[class^="vscode-"] .sidebar .list-group { + --bs-tertiary-bg: var(--vscode-list-hoverBackground); + --bs-secondary-color: var(--vscode-foreground); + --bs-list-group-active-bg: var(--vscode-sideBarSectionHeader-background); + --bs-list-group-active-border-color: var( + --vscode-sideBarSectionHeader-background + ); + --bs-list-group-action-active-bg: var( + --vscode-sideBarSectionHeader-background + ); + --bs-list-group-active-color: var(--vscode-sideBarSectionHeader-foreground); +} + +body[class^="vscode-"] .breadcrumb-item { + --bs-breadcrumb-divider-color: var(--vscode-foreground); +} + +body[class^="vscode-"] div.ap-control-bar .ap-fullscreen-button { + display: none; +} + +:root { + --bs-navbar-padding-y: 0; + --bs-navbar-brand-padding-y: 0; + --sidebar-width: 550px; +} + +body { + margin: 0; + padding: 0; +} + +.navbar { + padding-top: 0; + padding-bottom: 0; + background-color: var(--bs-light); + top: 0; +} + +.navbar-title-grid { + display: grid; + grid-template-columns: minmax(350px, 1fr) 1fr; + width: 100%; +} + +@media (max-width: 575px) { + .navbar .vertical-metric-label { + font-size: 0.7rem !important; + } +} + +@media (max-width: 575px) { + .tab-tools select { + width: 50px; + } +} + +@media (max-width: 575px) { + .navbar .vertical-metric-value { + margin-top: 0.2rem !important; + font-size: 0.9rem !important; + } +} + +@media (max-width: 575px) { + .navbar-title-grid { + grid-template-columns: 1fr auto-fill; + } +} + +[data-bs-theme="dark"] .navbar { + background-color: unset; +} + +.navbar-brand { + font-weight: 400; + font-size: 1.4em; +} + +.navbar-text { + padding-top: 0px; + padding-bottom: 0px; +} + +#sidebarToggle > i.bi { + font-size: 1.5em; +} + +.nav-link.active { + border-bottom-width: 0 !important; +} + +.workspace { + display: flex; + flex-direction: column; +} + +.workspace.full-screen { + top: 0; +} + +@media (min-width: 768px) { + .workspace { + left: var(--sidebar-width); + } + .workspace.full-screen { + left: 0; + } + .workspace.off-canvas { + left: 0; + } +} + +.no-last-para-padding > p:last-of-type { + margin-bottom: 0; +} + +.sidebar .list-group-item { + cursor: pointer; + border-left-width: none; + border-top: none; + border-right: none; + border-radius: 0; +} + +.btn-tools { + --bs-btn-bg: var(--bs-secondary-bg-subtle); + --bs-btn-hover-bg: var(--bs-secondary-bg-subtle); + --bs-btn-border-color: var(--bs-secondary-bg-subtle); + --bs-btn-hover-border-color: var(--bs-secondary-bg-subtle); +} + +.sidebar .list-group { + --bs-list-group-active-color: var(--bs-gray-700); + --bs-list-group-active-bg: var(--bs-gray-200); + --bs-list-group-active-border-color: var(--bs-gray-200); +} + +[data-bs-theme="dark"] .sidebar .list-group { + --bs-list-group-active-color: var(--bs-gray-300); + --bs-list-group-active-bg: var(--bs-gray-800); + --bs-list-group-active-border-color: var(--bs-gray-800); +} + +.markdown-content pre > code, +.markdown-content pre { + white-space: pre-wrap !important; + word-wrap: anywhere !important; +} + +.log pre code { + white-space: pre-wrap; + font-size: 0.9em; +} + +.log pre[class*="language-"] { + margin: 0; + padding: 0.3em; +} + +.log :not(pre) > code[class*="language-"], +.log pre[class*="language-"] { + background-color: var(--bs-body-background); +} + +.workspace pre[class*="language-"] { + margin: 0; + padding: 0.3em; +} + +.workspace :not(pre) > code[class*="language-"], +.workspace pre[class*="language-"] { + background-color: var(--bs-body-background); +} + +.tbd { + font-weight: 300; + opacity: 0.9; + width: 100%; + text-align: center; + padding-top: 10em; +} + +code:not(.sourceCode):not(.source-code):not([class^="language-"]) { + color: var(--bs-code-color); +} + +.token.attr-name, +.token.builtin, +.token.char, +.token.inserted, +.token.selector, +.token.string { + color: var(--bs-body-color); +} + +.token.operator { + background: inherit; +} + +pre[class*="language-"] { + border: unset; + border-radius: unset; + box-shadow: unset; +} + +.font-title { + font-size: 1.5rem; + font-weight: 600; +} + +.font-subtitle { + font-size: 1.1rem; + font-weight: 200; +} + +.tight-paragraphs p { + margin-bottom: 0; +} + +.tight-last-paragraph p:last-of-type { + margin-bottom: 0; +} + +.card { + margin-bottom: 0.5em; +} + +.card-header { + padding: 0.1em 1em 0.1em 1em; + font-size: 0.8rem; + font-weight: 500; +} + +.btn .btn-link { + cursor: pointer; +} + +[aria-expanded="false"] .hide-when-collapsed { + display: none; +} + +[aria-expanded="true"] .hide-when-expanded { + opacity: 0 !important; +} + +[aria-expanded="true"] .no-bottom-padding-when-expanded { + padding-bottom: 0 !important; +} + +[aria-expanded="true"] .zerowidth-when-expanded { + height: 0px !important; + width: 0px !important; + padding-left: 0 !important; + padding-right: 0 !important; + margin-left: 0 !important; + margin-right: 0 !important; +} + +[aria-expanded="true"] .zeroheight-when-expanded { + height: 0px !important; +} + +.accordion-item:not(.no-highlight) .accordion-button:not(.collapsed) { + border-left: solid var(--bs-accordion-active-bg) 2px; + border-right: solid var(--bs-accordion-active-bg) 2px; + border-top: solid var(--bs-accordion-active-bg) 2px; + background-color: var(--bs-body-background); + color: var(--bs-body-color); +} + +.accordion-item .accordion-button { + border-left: solid var(--bs-body-bg) 2px; + border-right: solid var(--bs-body-bg) 2px; + border-top: solid var(--bs-body-bg) 2px; + background-color: var(--bs-body-bg); + color: var(--bs-body-color); +} + +.accordion-button[aria-expanded="true"] .giant-text-when-expanded { + font-weight: 500; + font-size: 0.9rem !important; + flex-grow: 40; + padding-top: 0rem; + padding-bottom: 0rem; +} + +.accordion-button[aria-expanded="true"] .full-flex-basis-when-expanded { + flex-basis: content !important; + flex-shrink: 1; +} + +.markdown-content h1, +.markdown-content h2, +.markdown-content h3, +.markdown-content h4, +.markdown-content h5, +.markdown-content h6 { + font-size: 0.9em; + font-weight: 600; + margin-top: 0.25em; + margin-bottom: 0.25em; +} + +.sample-answer .markdown-content h1, +.sample-answer .markdown-content h2, +.sample-answer .markdown-content h3, +.sample-answer .markdown-content h4, +.sample-answer .markdown-content h5, +.sample-answer .markdown-content h6 { + font-size: 1em; + font-weight: 400; + margin-top: 0em; + margin-bottom: 0em; +} + +.accordion-item:not(.no-highlight) .collapse.show.highlight-when-expanded, +.accordion-item:not(.no-highlight) .collapsing.highlight-when-expanded, +.accordion-item:not(.no-highlight) + .accordion-button[aria-expanded="true"].highlight-when-expanded { + border-left: solid var(--bs-accordion-active-bg) 2px; + border-right: solid var(--bs-accordion-active-bg) 2px; + border-bottom: solid var(--bs-accordion-active-bg) 2px; +} + +.accordion-item.no-highlight .accordion-button { + background-color: var(--bs-body-bg); +} + +.accordion-button.toggle-rotated:after { + background-size: 0.8em; + height: 0.8em; + width: 0.8em; +} + +.accordion-header > :last-child::after, +.accordion-button:last-child:after { + color: white !important; +} + +.card .accordion-button.toggle-rotated:after { + margin-right: 1rem; +} + +.no-highlight, +.no-highlight:hover, +.no-highlight:active { + color: inherit; +} + +.toggle-rotated:before { + transition: transform 0.3s linear; +} + +[aria-expanded="false"] .toggle-rotated:before { + transform: none; +} + +[aria-expanded="true"] .toggle-rotated:before { + transform: rotate(90deg); +} + +.fadeout-when-not-collapsed:not(.collapsed) { + opacity: 0 !important; +} + +table.table { + width: unset; +} + +.table > :not(caption) > * > * { + background-color: unset; +} + +table.table.table-sm td { + padding: 0.1em; +} + +.popover.rendered-content { + display: flex; + flex-direction: column; + max-height: 80%; + max-width: 80%; + /** Do not define an overflow on the wrapper or your arrow to the element will disapear */ +} + +.popover.rendered-content .popover-header { + font-size: 0.8em; + font-weight: 400; +} + +.popover.rendered-content .popover-body { + overflow: auto; +} + +.modal-footer button { + padding: 0.2rem 0.5rem; + font-size: 0.8em; +} + +.tab-tools > * { + flex: 0 1 auto; + height: 1.5rem; + margin-left: 0.5rem; +} + +.tab-tools > input { + font-size: 0.7rem; +} + +.tab-tools .btn { + font-size: 0.7rem; + padding: 0.2em 0.8em; +} + +.tab-tools { + font-size: 0.7rem; +} + +.do-not-collapse-self { + display: block; + height: auto !important; +} + +[data-tooltip] { + position: relative; +} +[data-tooltip]:hover::after { + content: attr(data-tooltip); + position: absolute; + line-height: 1.25; + background: var(--bs-light); + color: var(--bs-body-color); + opacity: 1; + padding: 4px 8px; + border-radius: 4px; + border: 1px solid var(--bs-border-color); + box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.25); + white-space: pre-wrap; + width: max-content; + max-width: 400px; + z-index: 1000; +} +[data-tooltip][data-tooltip-position="bottom-left"]:hover::after { + right: 0%; + top: 100%; +} + +/* ANSI Coloring */ +.ansi-display { + font-family: monospace; + white-space: pre-wrap; + --ansiBlack: #000000; + --ansiRed: #cd3131; + --ansiGreen: #00bc00; + --ansiYellow: #949800; + --ansiBlue: #0451a5; + --ansiMagenta: #bc05bc; + --ansiCyan: #0598bc; + --ansiWhite: #555555; + --ansiBrightBlack: #666666; + --ansiBrightRed: #cd3131; + --ansiBrightGreen: #14ce14; + --ansiBrightYellow: #b5ba00; + --ansiBrightBlue: #0451a5; + --ansiBrightMagenta: #bc05bc; + --ansiBrightCyan: #0598bc; + --ansiBrightWhite: #a5a5a5; +} + +@keyframes ansi-display-run-blink { + 50% { + opacity: 0; + } +} + +.tab-tools .form-select { + background-position: right 0.3rem center; + background-size: 10px 10px; + padding: 0.1rem 20px 0.1rem 10px; +} + +.tab-content > .active { + display: flex; +} + +.left-to-right-animate { + position: absolute; + animation: moveLeftToRight 2s linear infinite; +} + +@keyframes moveLeftToRight { + from { + margin-left: 0; + } + to { + margin-left: 95%; + } +} + +.expandable-panel pre { + overflow: unset; +} + +.markdown-content pre[class*="language-"], +pre[class*="language-"].tool-output, +.tool-output { + background-color: #f8f8f8; +} + +.vscode-dark .model-call pre[class*="language-"], +.vscode-dark .markdown-content pre[class*="language-"], +.vscode-dark pre[class*="language-"].tool-output, +.vscode-dark .tool-output { + background-color: #333333; +} + +.model-call pre[class*="language-"], +.markdown-content pre[class*="language-"], +pre[class*="language-"].tool-output { + border: none !important; + box-shadow: none !important; + border-radius: var(--bs-border-radius) !important; +} + +.vscode-dark pre.jsonPanel { + background: none !important; + border: none !important; + box-shadow: none !important; + border-radius: var(--bs-border-radius) !important; +} + +/* lightbox styles */ + +.lightbox-overlay .close-button, +.lightbox-overlay .nav-button { + /* Hide by default */ + opacity: 0; + pointer-events: none; /* so it doesn't register clicks when hidden */ + transition: opacity 0.3s ease; +} + +.lightbox-overlay:hover .close-button, +.lightbox-overlay .nav-button { + /* Show on hover */ + opacity: 1; + pointer-events: auto; +} + +/* jsondiffpatch */ + +.jsondiffpatch-delta { + padding: 1em; + background: var(--bs-light); + font-family: var(--bs-font-monospace); + font-size: 0.9em; +} +.jsondiffpatch-delta pre { + white-space: pre-wrap; + word-wrap: break-word; + word-break: break-all; + margin-bottom: 0; +} +ul.jsondiffpatch-delta { + list-style-type: none; + padding: 0 0 0 1.5em; + margin: 0; +} +.jsondiffpatch-delta ul { + list-style-type: none; + padding: 0 0 0 1.5em; + margin: 0; +} +.jsondiffpatch-added, +.jsondiffpatch-modified .jsondiffpatch-right-value pre, +.jsondiffpatch-textdiff-added { + background: var(--inspect-diff-add-color); +} + +.jsondiffpatch-deleted .jsondiffpatch-property-name, +.jsondiffpatch-deleted pre, +.jsondiffpatch-modified .jsondiffpatch-left-value pre, +.jsondiffpatch-textdiff-deleted { + background: var(--inspect-diff-remove-color); + text-decoration: line-through; +} +.jsondiffpatch-unchanged, +.jsondiffpatch-movedestination { + color: gray; +} +.jsondiffpatch-unchanged, +.jsondiffpatch-movedestination > .jsondiffpatch-value { + transition: all 0.5s; + -webkit-transition: all 0.5s; + overflow-y: hidden; +} +.jsondiffpatch-unchanged-showing .jsondiffpatch-unchanged, +.jsondiffpatch-unchanged-showing + .jsondiffpatch-movedestination + > .jsondiffpatch-value { + max-height: 100px; +} +.jsondiffpatch-unchanged-hidden .jsondiffpatch-unchanged, +.jsondiffpatch-unchanged-hidden + .jsondiffpatch-movedestination + > .jsondiffpatch-value { + max-height: 0; +} +.jsondiffpatch-unchanged-hiding + .jsondiffpatch-movedestination + > .jsondiffpatch-value, +.jsondiffpatch-unchanged-hidden + .jsondiffpatch-movedestination + > .jsondiffpatch-value { + display: block; +} +.jsondiffpatch-unchanged-visible .jsondiffpatch-unchanged, +.jsondiffpatch-unchanged-visible + .jsondiffpatch-movedestination + > .jsondiffpatch-value { + max-height: 100px; +} +.jsondiffpatch-unchanged-hiding .jsondiffpatch-unchanged, +.jsondiffpatch-unchanged-hiding + .jsondiffpatch-movedestination + > .jsondiffpatch-value { + max-height: 0; +} +.jsondiffpatch-unchanged-showing .jsondiffpatch-arrow, +.jsondiffpatch-unchanged-hiding .jsondiffpatch-arrow { + display: none; +} +.jsondiffpatch-value { + display: inline-block; +} +.jsondiffpatch-property-name { + display: inline-block; + padding-right: 5px; + vertical-align: top; +} +.jsondiffpatch-property-name:after { + content: ": "; +} +.jsondiffpatch-child-node-type-array > .jsondiffpatch-property-name:after { + content: ": ["; +} +.jsondiffpatch-child-node-type-array:after { + content: "],"; +} +div.jsondiffpatch-child-node-type-array:before { + content: "["; +} +div.jsondiffpatch-child-node-type-array:after { + content: "]"; +} +.jsondiffpatch-child-node-type-object > .jsondiffpatch-property-name:after { + content: ": {"; +} +.jsondiffpatch-child-node-type-object:after { + content: "},"; +} +div.jsondiffpatch-child-node-type-object:before { + content: "{"; +} +div.jsondiffpatch-child-node-type-object:after { + content: "}"; +} +.jsondiffpatch-value pre:after { + content: ","; +} +li:last-child > .jsondiffpatch-value pre:after, +.jsondiffpatch-modified > .jsondiffpatch-left-value pre:after { + content: ""; +} +.jsondiffpatch-modified .jsondiffpatch-value { + display: inline-block; +} +.jsondiffpatch-modified .jsondiffpatch-right-value { + margin-left: 0; +} +.jsondiffpatch-moved .jsondiffpatch-value { + display: none; +} +.jsondiffpatch-moved .jsondiffpatch-moved-destination { + display: inline-block; + background: #ffffbb; + color: #888; +} +.jsondiffpatch-moved .jsondiffpatch-moved-destination:before { + content: " => "; +} +ul.jsondiffpatch-textdiff { + padding: 0; +} +.jsondiffpatch-textdiff-location { + color: #bbb; + display: inline-block; + min-width: 60px; +} +.jsondiffpatch-textdiff-line { + display: inline-block; +} +.jsondiffpatch-textdiff-line-number:after { + content: ","; +} +.jsondiffpatch-error { + background: red; + color: white; + font-weight: bold; +} + +/* prism-custom.css */ +code[class*="language-"], +pre[class*="language-"] { + font-size: 0.7rem !important; +} + +.token { + font-size: 0.7rem !important; +} + +/* PrismJS 1.29.0 https://prismjs.com/download.html#themes=prism-dark&languages=markup+css+clike+javascript+bash+python */ +/* This has been generated from the URL above, then scoped within the + * .vscode-dark class. If it needs to be regenerated, be sure to add that back in. */ +.vscode-dark code[class*="language-"], +.vscode-dark pre[class*="language-"] { + color: #fff; + background: 0 0; + text-shadow: 0 -0.1em 0.2em #000; + font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; + font-size: 1em; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + line-height: 1.5; + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; +} +@media print { + .vscode-dark code[class*="language-"], + .vscode-dark pre[class*="language-"] { + text-shadow: none; + } +} +.vscode-dark :not(pre) > code[class*="language-"], +.vscode-dark pre[class*="language-"] { + background: #4c3f33; +} +.vscode-dark pre[class*="language-"] { + padding: 1em; + margin: 0.5em 0; + overflow: auto; + /* border: 0.3em solid #7a6651; */ + border-radius: 0.5em; + box-shadow: 1px 1px 0.5em #000 inset; +} +.vscode-dark :not(pre) > code[class*="language-"] { + padding: 0.15em 0.2em 0.05em; + border-radius: 0.3em; + /* border: 0.13em solid #7a6651; */ + box-shadow: 1px 1px 0.3em -0.1em #000 inset; + white-space: normal; +} +.vscode-dark .token.cdata, +.vscode-dark .token.comment, +.vscode-dark .token.doctype, +.vscode-dark .token.prolog { + color: #997f66; +} +.vscode-dark .token.punctuation { + opacity: 0.7; +} +.vscode-dark .token.namespace { + opacity: 0.7; +} +.vscode-dark .token.boolean, +.vscode-dark .token.constant, +.vscode-dark .token.number, +.vscode-dark .token.property, +.vscode-dark .token.symbol, +.vscode-dark .token.tag { + color: #d1939e; +} +.vscode-dark .token.attr-name, +.vscode-dark .token.builtin, +.vscode-dark .token.char, +.vscode-dark .token.inserted, +.vscode-dark .token.selector, +.vscode-dark .token.string { + color: #bce051; +} +.vscode-dark .language-css .token.string, +.vscode-dark .style .token.string, +.vscode-dark .token.entity, +.vscode-dark .token.operator, +.vscode-dark .token.url, +.vscode-dark .token.variable { + color: #f4b73d; +} +.vscode-dark .token.atrule, +.vscode-dark .token.attr-value, +.vscode-dark .token.keyword { + color: #d1939e; +} +.vscode-dark .token.important, +.vscode-dark .token.regex { + color: #e90; +} +.vscode-dark .token.bold, +.vscode-dark .token.important { + font-weight: 700; +} +.vscode-dark .token.italic { + font-style: italic; +} +.vscode-dark .token.entity { + cursor: help; +} +.vscode-dark .token.deleted { + color: red; +} +/* END PrismJS */ + +/* SVG Icon styles - following Bootstrap Icons pattern */ +.ii:before { + background-color: var(--bs-body-color); +} + +.inspect-icon-16::before { + content: ""; + width: 1em; + height: 1em; + display: inline-block; + vertical-align: middle; + mask: url("../img/inspect-16.svg") no-repeat center / contain; + -webkit-mask: url("../img/inspect-16.svg") no-repeat center / contain; +} + +.inspect-icon-back::before { + content: ""; + width: 1em; + height: 1em; + display: inline-block; + vertical-align: middle; + mask: url("../img/inspect-back.svg") no-repeat center / contain; + -webkit-mask: url("../img/inspect-back.svg") no-repeat center / contain; +} + +.inspect-icon-forward::before { + content: ""; + width: 1em; + height: 1em; + display: inline-block; + vertical-align: middle; + mask: url("../img/inspect-forward.svg") no-repeat center / contain; + -webkit-mask: url("../img/inspect-forward.svg") no-repeat center / contain; +} + +.inspect-icon-file::before { + content: ""; + width: 1em; + height: 1em; + display: inline-block; + vertical-align: middle; + mask: url("../img/inspect-file.svg") no-repeat center / contain; + -webkit-mask: url("../img/inspect-file.svg") no-repeat center / contain; +} + +.inspect-icon-home::before { + content: ""; + width: 1em; + height: 1em; + display: inline-block; + vertical-align: middle; + mask: url("../img/inspect-home.svg") no-repeat center / contain; + -webkit-mask: url("../img/inspect-home.svg") no-repeat center / contain; +} + +.inspect-icon-tasks::before { + content: ""; + width: 1em; + height: 1em; + display: inline-block; + vertical-align: middle; + margin-top: -2px; + mask: url("../img/tasks.svg") no-repeat center / contain; + -webkit-mask: url("../img/tasks.svg") no-repeat center / contain; +} + +.inspect-flow::before { + content: ""; + margin-top: -4px; + width: 1.05em; + height: 1.05em; + display: inline-block; + vertical-align: middle; + mask: url("../img/inspect-flow.svg") no-repeat center / contain; + -webkit-mask: url("../img/inspect-flow.svg") no-repeat center / contain; +} + +/* Use this very carefully, find relies upon checking the +document selection to determine if it should skip a find match +so disabling selection can break that functionality */ +.hideSelection { + user-select: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; +} diff --git a/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/app/App.tsx b/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/app/App.tsx new file mode 100644 index 0000000000000000000000000000000000000000..a8c4e090cf1cbe3d307467a3118c3e6e12f89e37 --- /dev/null +++ b/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/app/App.tsx @@ -0,0 +1,209 @@ +import "bootstrap-icons/font/bootstrap-icons.css"; +import "bootstrap/dist/css/bootstrap.css"; +import JSON5 from "json5"; + +import "prismjs"; +import "prismjs/components/prism-bash"; +import "prismjs/components/prism-clike"; +import "prismjs/components/prism-javascript"; +import "prismjs/components/prism-json"; +import "prismjs/components/prism-python"; +import "prismjs/components/prism-yaml"; +import "prismjs/themes/prism.css"; +import "./App.css"; + +import ClipboardJS from "clipboard"; +import { FC, useCallback, useEffect } from "react"; +import { RouterProvider } from "react-router-dom"; +import { ClientAPI, HostMessage } from "../client/api/types.ts"; +import { useStore } from "../state/store.ts"; +import { basename, dirname } from "../utils/path.ts"; +import { isUri } from "../utils/uri.ts"; +import { AppRouter } from "./routing/AppRouter.tsx"; + +interface AppProps { + api: ClientAPI; +} + +/** + * Renders the Main Application + */ +export const App: FC = ({ api }) => { + // Whether the app was rehydrated + const rehydrated = useStore((state) => state.app.rehydrated); + + const logDir = useStore((state) => state.logs.logDir); + const selectedLogFile = useStore((state) => state.logs.selectedLogFile); + const loadedLogFile = useStore((state) => state.log.loadedLog); + const selectedLogDetails = useStore((state) => state.log.selectedLogDetails); + + const setInitialState = useStore((state) => state.appActions.setInitialState); + const setLoading = useStore((state) => state.appActions.setLoading); + + const syncLogs = useStore((state) => state.logsActions.syncLogs); + const setLogDir = useStore((state) => state.logsActions.setLogDir); + const setLogFiles = useStore((state) => state.logsActions.setLogHandles); + const setSelectedLogFile = useStore( + (state) => state.logsActions.setSelectedLogFile, + ); + + const loadLog = useStore((state) => state.logActions.syncLog); + const pollLog = useStore((state) => state.logActions.pollLog); + + const setSingleFileMode = useStore( + (state) => state.appActions.setSingleFileMode, + ); + + // Load a specific log + useEffect(() => { + const loadSpecificLog = async () => { + // Ignore if there is no log file. + if (!selectedLogFile) { + return; + } + + if (selectedLogFile === loadedLogFile && selectedLogDetails) { + // The log is already loaded and we have the data + return; + } + + try { + // Set loading first and wait for it to update + setLoading(true); + + // Then load the log + await loadLog(selectedLogFile); + + // Finally set loading to false + setLoading(false); + } catch (e) { + console.log(e); + setLoading(false, e as Error); + } + }; + + loadSpecificLog(); + }, [selectedLogFile, loadedLogFile, selectedLogDetails, loadLog, setLoading]); + + useEffect(() => { + // If the component re-mounts and there is a running load loaded + // start up polling + const doPoll = async () => { + await pollLog(); + }; + if (selectedLogDetails?.status === "started") { + doPoll(); + } + }, [pollLog, selectedLogDetails?.status]); + + const onMessage = useCallback( + async (e: HostMessage) => { + switch (e.data.type) { + case "updateState": { + if (e.data.url) { + const decodedUrl = decodeURIComponent(e.data.url); + + let targetFile = decodedUrl; + if (isUri(targetFile)) { + // If it's a URI, just set the log file directly + const dir = dirname(targetFile); + targetFile = basename(targetFile); + setLogDir(dir); + } + + if (!rehydrated) { + setInitialState( + targetFile, + e.data.sample_id, + e.data.sample_epoch, + ); + } + } + break; + } + case "backgroundUpdate": { + const decodedUrl = decodeURIComponent(e.data.url); + const log_dir = e.data.log_dir; + const isFocused = document.hasFocus(); + if (!isFocused) { + if (log_dir === logDir) { + setSelectedLogFile(decodedUrl); + } else { + api.open_log_file(e.data.url, e.data.log_dir); + } + } else { + syncLogs(); + } + break; + } + } + }, + [ + setInitialState, + setLogDir, + logDir, + setSelectedLogFile, + api, + syncLogs, + rehydrated, + ], + ); + + // listen for updateState messages from vscode + useEffect(() => { + window.addEventListener("message", onMessage); + return () => { + window.removeEventListener("message", onMessage); + }; + }, [onMessage]); + + useEffect(() => { + const loadLogsAndState = async () => { + // First see if there is embedded state and if so, use that + const embeddedState = document.getElementById("logview-state"); + if (embeddedState) { + const state = JSON5.parse(embeddedState.textContent || ""); + onMessage({ data: state }); + setSingleFileMode(true); + } else { + // For non-route URL params support (legacy) + const urlParams = new URLSearchParams(window.location.search); + + // If the URL provides a task file, load that + const logPath = urlParams.get("task_file"); + + // Replace spaces with a '+' sign: + const resolvedLogPath = logPath ? logPath.replace(" ", "+") : logPath; + + if (resolvedLogPath) { + // Clear any log dir + setLogDir(undefined); + // Load just the passed file + setLogFiles([{ name: resolvedLogPath }]); + setSingleFileMode(true); + } else { + // If a log file was passed, select it + const log_file = urlParams.get("log_file"); + if (log_file) { + setSelectedLogFile(log_file); + setSingleFileMode(true); + } + // Else do nothing - RouteProvider will handle it + } + } + + new ClipboardJS(".clipboard-button,.copy-button"); + }; + + loadLogsAndState(); + }, [ + setLogDir, + setLogFiles, + setSelectedLogFile, + syncLogs, + onMessage, + setSingleFileMode, + ]); + + return ; +}; diff --git a/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/app/AppErrorBoundary.tsx b/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/app/AppErrorBoundary.tsx new file mode 100644 index 0000000000000000000000000000000000000000..88348816bde8417bc1c58e428c615d6ab8fb8514 --- /dev/null +++ b/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/app/AppErrorBoundary.tsx @@ -0,0 +1,47 @@ +import { Component, ErrorInfo, ReactNode } from "react"; +import { ErrorPanel } from "../components/ErrorPanel"; + +interface Props { + children: ReactNode; +} + +interface State { + hasError: boolean; + error?: Error; +} + +export class AppErrorBoundary extends Component { + constructor(props: Props) { + super(props); + this.state = { hasError: false }; + } + + static getDerivedStateFromError(error: Error): State { + // Update state so the next render will show the fallback UI. + return { hasError: true, error: error }; + } + + componentDidCatch(error: Error, errorInfo: ErrorInfo): void { + // You can also log the error to an error reporting service + console.log({ error, errorInfo }); + } + + render(): ReactNode { + if (this.state.hasError) { + console.error({ e: this.state.error }); + if (this.state.error) { + return ( + + ); + } else { + return ( +
An unknown error with no additional information occured.
+ ); + } + } + return this.props.children; + } +} diff --git a/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/app/appearance/colors.ts b/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/app/appearance/colors.ts new file mode 100644 index 0000000000000000000000000000000000000000..8c4907075dacb06c8f2b21fa7c2bc3243e9fdbab --- /dev/null +++ b/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/app/appearance/colors.ts @@ -0,0 +1,9 @@ +export const ApplicationColors = { + logging: { + debug: "var(--bs-secondary)", + info: "var(--bs-blue)", + warning: "var(--bs-warning)", + error: "var(--bs-danger)", + critical: "var(--bs-danger)", + }, +}; diff --git a/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/app/appearance/fonts.ts b/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/app/appearance/fonts.ts new file mode 100644 index 0000000000000000000000000000000000000000..ac2efe772ce305a9617b5d91bb7bfbcca0372dce --- /dev/null +++ b/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/app/appearance/fonts.ts @@ -0,0 +1,39 @@ +/** + * The base font size in rem units. + */ +const kBaseFontSize: number = 0.9; + +/** + * Scales the base font size by the provided scale factor. + */ +const ScaleBaseFont = (scale: number): string => { + return `${kBaseFontSize + scale}rem`; +}; + +/** + * An object representing font sizes for different text elements. + */ +export const FontSize = { + title: ScaleBaseFont(0.6), + "title-secondary": ScaleBaseFont(0.4), + larger: ScaleBaseFont(0.2), + large: ScaleBaseFont(0.1), + base: ScaleBaseFont(0), + small: ScaleBaseFont(-0.1), + smaller: ScaleBaseFont(-0.1), +}; + +/** + * An object representing text styles for different elements. + */ +export const TextStyle = { + label: { + textTransform: "uppercase", + }, + secondary: { + color: "var(--bs-secondary)", + }, + tertiary: { + color: "var(--bs-tertiary-color)", + }, +}; diff --git a/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/app/types.ts b/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/app/types.ts new file mode 100644 index 0000000000000000000000000000000000000000..0ea0fda03202a04f4c841e08cfa8ff47d8b49917 --- /dev/null +++ b/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/app/types.ts @@ -0,0 +1,219 @@ +import { GridState } from "ag-grid-community"; +import { StateSnapshot } from "react-virtuoso"; +import { + ApprovalEvent, + CompactionEvent, + ContentDocument, + ContentImage, + ContentText, + EvalSample, + EvalSet, + InfoEvent, + LoggerEvent, + ModelEvent, + SampleInitEvent, + SampleLimitEvent, + SandboxEvent, + ScoreEvent, + StateEvent, + StepEvent, + StoreEvent, + SubtaskEvent, + ToolEvent, +} from "../@types/log"; +import { + AttachmentData, + EvalHeader, + EventData, + LogDetails, + LogHandle, + LogPreview, + PendingSamples, + SampleSummary, +} from "../client/api/types"; + +export interface AppState { + status: AppStatus; + nativeFind?: boolean; + showFind: boolean; + tabs: { + workspace: string; + sample: string; + }; + dialogs: { + transcriptFilter: boolean; + options: boolean; + }; + scrollPositions: Record; + listPositions: Record; + visibleRanges: Record; + collapsed: Record; + messages: Record; + propertyBags: Record>; + urlHash?: string; + initialState?: { + log: string; + sample_id?: string; + sample_epoch?: string; + }; + rehydrated?: boolean; + singleFileMode?: boolean; + displayMode?: "rendered" | "raw"; + logsSampleView: boolean; +} + +export interface DisplayedSample { + logFile: string; + sampleId: string | number; + epoch: number; +} + +export interface LogsState { + logDir?: string; + logs: LogHandle[]; + logPreviews: Record; + logDetails: Record; + evalSet?: EvalSet; + selectedLogFile?: string; + listing: LogsListing; + pendingRequests: Map>; + dbStats: { + logCount: number; + previewCount: number; + detailsCount: number; + }; + samplesListState: { + gridState?: GridState; + displayedSamples?: Array; + columnVisibility: Record; + previousSamplesPath?: string; + }; + flow?: string; + flowDir?: string; + showRetriedLogs: boolean; +} + +export interface LogsListing { + filteredCount?: number; + watchedLogs?: LogHandle[]; + selectedRowIndex?: number | null; + gridState?: GridState; + previousLogPath?: string; + columnVisibility: Record; +} + +export interface SampleHandle { + id: string | number; + epoch: number; + logFile: string; +} + +export interface LogState { + loadedLog?: string; + + selectedSampleHandle?: SampleHandle; + selectedLogDetails?: LogDetails; + pendingSampleSummaries?: PendingSamples; + + filter: string; + filterError?: FilterError; + + selectedScores?: ScoreLabel[]; + scores?: ScoreLabel[]; + + filteredSampleCount?: number; +} + +export type SampleStatus = "ok" | "loading" | "streaming" | "error"; + +export interface EventFilter { + filteredTypes: string[]; +} + +export interface SampleState { + sample_identifier: SampleHandle | undefined; + sampleInState: boolean; + selectedSampleObject?: EvalSample; + sampleStatus: SampleStatus; + sampleError: Error | undefined; + sampleNeedsReload: number; + eventsCleared: boolean; + + visiblePopover?: string; + + // Events and attachments + runningEvents: Event[]; + collapsedEvents: Record> | null; + collapsedIdBuckets: Record>; + collapsedMode: "collapsed" | "expanded" | null; + eventFilter: EventFilter; + + selectedOutlineId?: string; +} + +export type Event = + | SampleInitEvent + | SampleLimitEvent + | CompactionEvent + | SandboxEvent + | StateEvent + | StoreEvent + | ModelEvent + | ToolEvent + | ApprovalEvent + | InputEvent + | ScoreEvent + | ErrorEvent + | LoggerEvent + | InfoEvent + | StepEvent + | SubtaskEvent; + +export interface AppStatus { + // Waiting while loading data, show large form of progress + loading: number; + + // Background syncing data, show small form of activity + syncing: boolean; + error?: Error; +} + +export interface CurrentLog { + name: string; + contents: LogDetails; +} + +export interface Logs { + log_dir: string; + files: string[]; +} + +export interface ScoreLabel { + name: string; + scorer: string; +} + +export interface SampleFilter { + value?: string; + error?: FilterError; +} + +export interface FilterError { + from: number; + to: number; + message: string; + severity: "warning" | "error"; +} + +export type SampleMode = "none" | "single" | "many"; + +export interface ContentTool { + type: "tool"; + content: (ContentImage | ContentText | ContentDocument)[]; +} + +export interface RunningSampleData { + events: Map; + attachments: Map; + summary?: SampleSummary; +} diff --git a/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/components/ActivityBar.module.css b/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/components/ActivityBar.module.css new file mode 100644 index 0000000000000000000000000000000000000000..1b82245eccc19ce84c1cb2490678d3fedeb6b12a --- /dev/null +++ b/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/components/ActivityBar.module.css @@ -0,0 +1,38 @@ +.wrapper { + display: flex; + align-items: center; + justify-content: center; + width: 100%; + height: 0; + overflow-y: visible; + overflow-x: visible; + text-align: center; +} + +.container { + width: 100%; + height: 1px; + background-color: transparent; + position: sticky; + overflow: hidden; + z-index: 1200; +} + +.animate { + width: 5%; + height: 1px; + animation: leftToRight 2s linear infinite; + background-color: #3b82f6; + position: absolute; + left: 0; + top: 0; +} + +@keyframes leftToRight { + 0% { + transform: translateX(-100%); + } + 100% { + transform: translateX(2000%); + } +} diff --git a/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/components/ActivityBar.tsx b/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/components/ActivityBar.tsx new file mode 100644 index 0000000000000000000000000000000000000000..2c7d2d913548810d58cd02fe09292c74eec65da9 --- /dev/null +++ b/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/components/ActivityBar.tsx @@ -0,0 +1,24 @@ +import clsx from "clsx"; +import { FC } from "react"; +import styles from "./ActivityBar.module.css"; + +interface ActivityBarProps { + animating: boolean; +} + +export const ActivityBar: FC = ({ animating }) => { + return ( +
+
+ {animating &&
} +
+
+ ); +}; diff --git a/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/components/AnsiDisplay.tsx b/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/components/AnsiDisplay.tsx new file mode 100644 index 0000000000000000000000000000000000000000..6a64e1bce776a4d00ffd18c37926767d6bbfbb30 --- /dev/null +++ b/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/components/AnsiDisplay.tsx @@ -0,0 +1,278 @@ +import { ANSIColor, ANSIOutput, ANSIOutputRun, ANSIStyle } from "ansi-output"; +import clsx from "clsx"; +import { CSSProperties, FC, useState } from "react"; +import { ToolButton } from "./ToolButton"; + +import styles from "./AnsiDisplay.module.css"; + +interface ANSIDisplayProps { + output: string; + style?: CSSProperties; + className?: string[] | string; +} + +export const ANSIDisplay: FC = ({ + output, + style, + className, +}) => { + const [showRaw, setShowRaw] = useState(false); + const ansiOutput = new ANSIOutput(); + ansiOutput.processOutput(output); + + // Check if more than 80% of lines share the same background color + const getUniformBackgroundColor = (): string | undefined => { + const backgroundColorCounts = new Map(); + let totalLinesWithBackground = 0; + + // Count background colors across all lines + for (const line of ansiOutput.outputLines) { + let lineBackgroundColor: string | undefined = undefined; + + // Get the background color for this line (from any run that has one) + for (const run of line.outputRuns) { + if (run.format?.backgroundColor) { + lineBackgroundColor = run.format.backgroundColor; + break; + } + } + + if (lineBackgroundColor) { + totalLinesWithBackground++; + backgroundColorCounts.set( + lineBackgroundColor, + (backgroundColorCounts.get(lineBackgroundColor) || 0) + 1, + ); + } + } + + // Return undefined if no lines have backgrounds + if (totalLinesWithBackground === 0) { + return undefined; + } + + // Compute percentages for each background color + const backgroundColorPercentages = new Map(); + for (const [color, count] of backgroundColorCounts.entries()) { + backgroundColorPercentages.set(color, count / totalLinesWithBackground); + } + + // Find the color with the highest percentage + let dominantColor: string | undefined = undefined; + let maxPercentage = 0; + + for (const [color, percentage] of backgroundColorPercentages.entries()) { + if (percentage > maxPercentage) { + maxPercentage = percentage; + dominantColor = color; + } + } + + // Return the color if it appears in more than 80% of lines + return maxPercentage > 0.8 ? dominantColor : undefined; + }; + + const uniformBackgroundColor = getUniformBackgroundColor(); + const backgroundStyle = uniformBackgroundColor + ? computeForegroundBackgroundColor(kBackground, uniformBackgroundColor) + : {}; + + let firstOutput = false; + return ( +
+ setShowRaw(!showRaw)} + title={showRaw ? "Show rendered output" : "Show raw output"} + /> + {showRaw ? ( +
+          {output}
+        
+ ) : ( +
+ {ansiOutput.outputLines.map((line, index) => { + firstOutput = firstOutput || !!line.outputRuns.length; + return ( +
+ {!line.outputRuns.length ? ( + firstOutput ? ( +
+ ) : null + ) : ( + line.outputRuns.map((outputRun) => ( + + )) + )} +
+ ); + })} +
+ )} +
+ ); +}; + +const kForeground = 0; +const kBackground = 1; + +interface OutputRunProps { + run: ANSIOutputRun; +} + +const OutputRun: FC = ({ run }) => { + // Render. + return {run.text}; +}; + +const computeCSSProperties = (outputRun: ANSIOutputRun) => { + return !outputRun.format + ? {} + : { + ...computeStyles(outputRun.format.styles || []), + ...computeForegroundBackgroundColor( + kForeground, + outputRun.format.foregroundColor, + ), + ...computeForegroundBackgroundColor( + kBackground, + outputRun.format.backgroundColor, + ), + }; +}; + +const computeStyles = (styles: ANSIStyle[]) => { + let cssProperties = {}; + if (styles) { + styles.forEach((style) => { + switch (style) { + // Bold. + case ANSIStyle.Bold: + cssProperties = { ...cssProperties, ...{ fontWeight: "bold" } }; + break; + + // Dim. + case ANSIStyle.Dim: + cssProperties = { ...cssProperties, ...{ fontWeight: "lighter" } }; + break; + + // Italic. + case ANSIStyle.Italic: + cssProperties = { ...cssProperties, ...{ fontStyle: "italic" } }; + break; + + // Underlined. + case ANSIStyle.Underlined: + cssProperties = { + ...cssProperties, + ...{ + textDecorationLine: "underline", + textDecorationStyle: "solid", + }, + }; + break; + + // Slow blink. + case ANSIStyle.SlowBlink: + cssProperties = { + ...cssProperties, + ...{ animation: "ansi-display-run-blink 1s linear infinite" }, + }; + break; + + // Rapid blink. + case ANSIStyle.RapidBlink: + cssProperties = { + ...cssProperties, + ...{ animation: "ansi-display-run-blink 0.5s linear infinite" }, + }; + break; + + // Hidden. + case ANSIStyle.Hidden: + cssProperties = { ...cssProperties, ...{ visibility: "hidden" } }; + break; + + // CrossedOut. + case ANSIStyle.CrossedOut: + cssProperties = { + ...cssProperties, + ...{ + textDecorationLine: "line-through", + textDecorationStyle: "solid", + }, + }; + break; + + // TODO Fraktur + + // DoubleUnderlined. + case ANSIStyle.DoubleUnderlined: + cssProperties = { + ...cssProperties, + ...{ + textDecorationLine: "underline", + textDecorationStyle: "double", + }, + }; + break; + + // TODO Framed + // TODO Encircled + // TODO Overlined + // TODO Superscript + // TODO Subscript + } + }); + } + + return cssProperties; +}; + +const computeForegroundBackgroundColor = ( + colorType: number, + color?: string, +) => { + switch (color) { + // Undefined. + case undefined: + return {}; + + // One of the standard colors. + case ANSIColor.Black: + case ANSIColor.Red: + case ANSIColor.Green: + case ANSIColor.Yellow: + case ANSIColor.Blue: + case ANSIColor.Magenta: + case ANSIColor.Cyan: + case ANSIColor.White: + case ANSIColor.BrightBlack: + case ANSIColor.BrightRed: + case ANSIColor.BrightGreen: + case ANSIColor.BrightYellow: + case ANSIColor.BrightBlue: + case ANSIColor.BrightMagenta: + case ANSIColor.BrightCyan: + case ANSIColor.BrightWhite: + if (colorType === kForeground) { + return { color: `var(--${color})` }; + } else { + return { background: `var(--${color})` }; + } + + // TODO@softwarenerd - This isn't hooked up. + default: + if (colorType === kForeground) { + return { color: color }; + } else { + return { background: color }; + } + } +}; diff --git a/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/components/AsciinemaPlayer.tsx b/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/components/AsciinemaPlayer.tsx new file mode 100644 index 0000000000000000000000000000000000000000..665995beee5e0116edb93d3f73250e528f15d399 --- /dev/null +++ b/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/components/AsciinemaPlayer.tsx @@ -0,0 +1,86 @@ +import * as AsciicinemaPlayerJS from "asciinema-player"; +import "asciinema-player/dist/bundle/asciinema-player.css"; +import { CSSProperties, FC, useEffect, useRef } from "react"; + +interface AsciinemaPlayerProps { + id?: string; + inputUrl: string; + outputUrl: string; + timingUrl: string; + rows?: number; + cols?: number; + fit?: string; + style?: CSSProperties; + speed?: number; + autoPlay?: boolean; + loop?: boolean; + theme?: string; + idleTimeLimit?: number; + className?: string; +} + +export const AsciinemaPlayer: FC = ({ + id, + rows, + cols, + inputUrl, + outputUrl, + timingUrl, + fit, + speed, + autoPlay, + loop, + theme, + idleTimeLimit = 2, + style, +}) => { + const playerContainerRef = useRef(null); + + useEffect(() => { + if (!playerContainerRef.current) return; + + const player = AsciicinemaPlayerJS.create( + { + url: [timingUrl, outputUrl, inputUrl], + parser: "typescript", + }, + playerContainerRef.current, + { + rows, + cols, + autoPlay, + loop, + theme, + speed, + idleTimeLimit, + fit, + }, + ); + + player.play(); + + return () => { + player.dispose(); + }; + }, [ + timingUrl, + outputUrl, + inputUrl, + rows, + cols, + autoPlay, + loop, + theme, + speed, + idleTimeLimit, + fit, + ]); + + return ( +
+ ); +}; diff --git a/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/components/Card.css b/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/components/Card.css new file mode 100644 index 0000000000000000000000000000000000000000..adbfcffd46f75d1764ffb8b2d329a23d5611a274 --- /dev/null +++ b/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/components/Card.css @@ -0,0 +1,62 @@ +.card-header-container { + display: grid; + grid-template-columns: max-content auto; + column-gap: 0em; + padding: 0.5em 0.5em 0.5em 0.5em; + font-size: var(--inspect-font-size-small); + font-weight: 600; + border-bottom: solid 1px var(--bs-light-border-subtle); +} + +.card-header-icon { + padding-right: 0.2rem; +} + +.card-body { + background-color: var(--bs-body-bg); + + padding: 0.5em; +} + +.card { + background-color: var(--bs-light-bg-subtle); + border: solid 1px var(--bs-light-border-subtle); + border-radius: var(--bs-border-radius); +} + +.card-collaping-header { + border-bottom: none; +} + +.card-collapsing-header-container { + justify-content: space-between; + align-items: center; +} + +.card-collapsing-header-icon { + flex: 0 0 content; + padding-right: 0.5rem; +} + +.card-collapsing-header-contents { + color: var(--body-color); + opacity: 0.8; + flex: 1 1 auto; + font-size: var(--inspect-font-size-smaller); + padding-right: 0; + padding-left: 0; + transition: opacity 0.2s ease-out; + display: flex; + justify-content: space-between; +} + +.card-collapsing-header-toggle { + flex: 0 1 1em; + text-align: right; + padding: 0 0.5em 0.1em 0.5em; + font-size: var(--inspect-font-size-smaller); +} + +.card-body.card-no-padding { + padding: 0; +} diff --git a/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/components/Card.tsx b/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/components/Card.tsx new file mode 100644 index 0000000000000000000000000000000000000000..96cf6b7323a0e3dd8582ad852d273a8fcacb4bc9 --- /dev/null +++ b/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/components/Card.tsx @@ -0,0 +1,125 @@ +import clsx from "clsx"; +import { FC, ReactNode } from "react"; +import { ApplicationIcons } from "../app/appearance/icons"; +import "./Card.css"; + +interface CardHeaderProps { + id?: string; + icon?: string; + label?: string; + className?: string; + children?: ReactNode; +} + +interface CardBodyProps { + id?: string; + children?: ReactNode; + className?: string | string[]; + padded?: boolean; +} + +interface CardProps { + id?: string; + children?: ReactNode; + className?: string | string[]; +} + +interface CardCollapsingHeaderProps { + id: string; + icon: string; + label: string; + cardBodyId: string; + children?: ReactNode; +} + +export const CardHeader: FC = ({ + id, + icon, + label, + className, + children, +}) => { + return ( +
+ {icon ? ( + + ) : ( + + )} + {label ? label : ""} {children} +
+ ); +}; + +export const CardBody: FC = ({ + id, + children, + className, + padded = true, +}) => { + return ( +
+ {children} +
+ ); +}; + +export const Card: FC = ({ id, children, className }) => { + return ( +
+ {children} +
+ ); +}; + +export const CardCollapsingHeader: FC = ({ + id, + icon, + label, + cardBodyId, + children, +}) => { + return ( + + + + ); +}; diff --git a/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/components/CodePanel.module.css b/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/components/CodePanel.module.css new file mode 100644 index 0000000000000000000000000000000000000000..a691c2ca53ffe46dfe912500f15c6c3649ec18a9 --- /dev/null +++ b/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/components/CodePanel.module.css @@ -0,0 +1,15 @@ +.panel { + margin: 0rem; + overflow-y: scroll; + overflow-x: auto; +} + +.code { + padding: 0; +} + +.code code { + white-space: pre-wrap !important; + overflow-wrap: break-word !important; + word-break: break-all !important; +} diff --git a/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/components/CodePanel.tsx b/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/components/CodePanel.tsx new file mode 100644 index 0000000000000000000000000000000000000000..e77d3699907b1567bfa1caf59485b79d3da86b5f --- /dev/null +++ b/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/components/CodePanel.tsx @@ -0,0 +1,24 @@ +import { FC, useRef } from "react"; + +import clsx from "clsx"; + +import styles from "./CodePanel.module.css"; +import { usePrismHighlight } from "./prism"; + +interface CodePanelProps { + code: string; + language?: string; +} + +export const CodePanel: FC = ({ code, language = "json" }) => { + // Syntax highlighting + const codeContainerRef = useRef(null); + usePrismHighlight(codeContainerRef, code.length); + return ( +
+
+        {code}
+      
+
+ ); +}; diff --git a/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/components/CopyButton.module.css b/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/components/CopyButton.module.css new file mode 100644 index 0000000000000000000000000000000000000000..e9ac443f3ce0960317cbacc233bc85ab81ca8200 --- /dev/null +++ b/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/components/CopyButton.module.css @@ -0,0 +1,11 @@ +.copyButton { + border: none; + background-color: inherit; + opacity: 0.5; + padding-top: 0; + transition: opacity 0.2s; +} + +.copyButton:hover { + opacity: 0.75; +} diff --git a/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/components/CopyButton.tsx b/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/components/CopyButton.tsx new file mode 100644 index 0000000000000000000000000000000000000000..bfcd97460304a5a96219e790157d248ce85af682 --- /dev/null +++ b/data/conda_envs/evalclaw/lib/python3.11/site-packages/inspect_ai/_view/www/src/components/CopyButton.tsx @@ -0,0 +1,56 @@ +import clsx from "clsx"; +import { JSX, useState } from "react"; +import { ApplicationIcons } from "../app/appearance/icons"; +import styles from "./CopyButton.module.css"; + +interface CopyButtonProps { + icon?: string; + value: string; + onCopySuccess?: () => void; + onCopyError?: (error: Error) => void; + className?: string; + ariaLabel?: string; +} + +export const CopyButton = ({ + icon = ApplicationIcons.copy, + value, + onCopySuccess, + onCopyError, + className = "", + ariaLabel = "Copy to clipboard", +}: CopyButtonProps): JSX.Element => { + const [isCopied, setIsCopied] = useState(false); + + const handleClick = async (): Promise => { + try { + await navigator.clipboard.writeText(value); + setIsCopied(true); + onCopySuccess?.(); + + // Reset copy state after delay + setTimeout(() => { + setIsCopied(false); + }, 1250); + } catch (error) { + onCopyError?.( + error instanceof Error ? error : new Error("Failed to copy"), + ); + } + }; + + return ( +