inspect-ai 0.3.62__py3-none-any.whl → 0.3.63__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (415) hide show
  1. inspect_ai/_cli/main.py +1 -1
  2. inspect_ai/_cli/trace.py +8 -0
  3. inspect_ai/_display/core/active.py +2 -3
  4. inspect_ai/_eval/eval.py +4 -4
  5. inspect_ai/_eval/evalset.py +6 -6
  6. inspect_ai/_eval/task/run.py +3 -0
  7. inspect_ai/_util/hash.py +1 -1
  8. inspect_ai/_view/www/.vscode/extensions.json +3 -0
  9. inspect_ai/_view/www/.vscode/settings.json +8 -0
  10. inspect_ai/_view/www/App.css +92 -29
  11. inspect_ai/_view/www/dist/assets/index.css +16637 -14676
  12. inspect_ai/_view/www/dist/assets/index.js +58897 -51440
  13. inspect_ai/_view/www/dist/index.html +1 -1
  14. inspect_ai/_view/www/index.html +2 -2
  15. inspect_ai/_view/www/log-schema.json +1 -0
  16. inspect_ai/_view/www/package.json +22 -4
  17. inspect_ai/_view/www/postcss.config.cjs +8 -9
  18. inspect_ai/_view/www/src/{App.mjs → App.tsx} +355 -365
  19. inspect_ai/_view/www/src/AppErrorBoundary.tsx +47 -0
  20. inspect_ai/_view/www/src/api/api-browser.ts +2 -2
  21. inspect_ai/_view/www/src/api/api-http.ts +3 -5
  22. inspect_ai/_view/www/src/api/api-vscode.ts +6 -6
  23. inspect_ai/_view/www/src/api/client-api.ts +4 -4
  24. inspect_ai/_view/www/src/api/index.ts +4 -4
  25. inspect_ai/_view/www/src/api/{Types.ts → types.ts} +25 -9
  26. inspect_ai/_view/www/src/appearance/colors.ts +9 -0
  27. inspect_ai/_view/www/src/appearance/fonts.ts +39 -0
  28. inspect_ai/_view/www/src/appearance/icons.ts +100 -0
  29. inspect_ai/_view/www/src/appearance/{Styles.mjs → styles.ts} +2 -32
  30. inspect_ai/_view/www/src/components/AnsiDisplay.tsx +198 -0
  31. inspect_ai/_view/www/src/components/AsciinemaPlayer.tsx +86 -0
  32. inspect_ai/_view/www/src/components/Card.css +60 -0
  33. inspect_ai/_view/www/src/components/Card.tsx +109 -0
  34. inspect_ai/_view/www/src/components/CopyButton.module.css +11 -0
  35. inspect_ai/_view/www/src/components/CopyButton.tsx +58 -0
  36. inspect_ai/_view/www/src/components/DownloadButton.css +4 -0
  37. inspect_ai/_view/www/src/components/DownloadButton.tsx +25 -0
  38. inspect_ai/_view/www/src/components/DownloadPanel.css +10 -0
  39. inspect_ai/_view/www/src/components/DownloadPanel.tsx +30 -0
  40. inspect_ai/_view/www/src/components/EmptyPanel.css +12 -0
  41. inspect_ai/_view/www/src/components/EmptyPanel.tsx +15 -0
  42. inspect_ai/_view/www/src/components/ErrorPanel.css +37 -0
  43. inspect_ai/_view/www/src/components/ErrorPanel.tsx +39 -0
  44. inspect_ai/_view/www/src/components/ExpandablePanel.css +40 -0
  45. inspect_ai/_view/www/src/components/ExpandablePanel.tsx +115 -0
  46. inspect_ai/_view/www/src/components/FindBand.css +49 -0
  47. inspect_ai/_view/www/src/components/FindBand.tsx +130 -0
  48. inspect_ai/_view/www/src/components/HumanBaselineView.css +41 -0
  49. inspect_ai/_view/www/src/components/HumanBaselineView.tsx +162 -0
  50. inspect_ai/_view/www/src/components/JsonPanel.css +20 -0
  51. inspect_ai/_view/www/src/components/JsonPanel.tsx +82 -0
  52. inspect_ai/_view/www/src/components/LabeledValue.css +20 -0
  53. inspect_ai/_view/www/src/components/LabeledValue.tsx +41 -0
  54. inspect_ai/_view/www/src/components/LargeModal.module.css +54 -0
  55. inspect_ai/_view/www/src/components/LargeModal.tsx +199 -0
  56. inspect_ai/_view/www/src/components/LightboxCarousel.css +95 -0
  57. inspect_ai/_view/www/src/components/LightboxCarousel.tsx +132 -0
  58. inspect_ai/_view/www/src/components/MarkdownDiv.css +3 -0
  59. inspect_ai/_view/www/src/components/MarkdownDiv.tsx +133 -0
  60. inspect_ai/_view/www/src/components/MessageBand.css +43 -0
  61. inspect_ai/_view/www/src/components/MessageBand.tsx +39 -0
  62. inspect_ai/_view/www/src/components/MorePopOver.tsx +67 -0
  63. inspect_ai/_view/www/src/components/NavPills.module.css +18 -0
  64. inspect_ai/_view/www/src/components/NavPills.tsx +99 -0
  65. inspect_ai/_view/www/src/components/ProgressBar.module.css +37 -0
  66. inspect_ai/_view/www/src/components/ProgressBar.tsx +22 -0
  67. inspect_ai/_view/www/src/components/TabSet.module.css +40 -0
  68. inspect_ai/_view/www/src/components/TabSet.tsx +200 -0
  69. inspect_ai/_view/www/src/components/ToolButton.css +3 -0
  70. inspect_ai/_view/www/src/components/ToolButton.tsx +27 -0
  71. inspect_ai/_view/www/src/components/VirtualList.module.css +19 -0
  72. inspect_ai/_view/www/src/components/VirtualList.tsx +292 -0
  73. inspect_ai/_view/www/src/{index.js → index.tsx} +45 -19
  74. inspect_ai/_view/www/src/{log → logfile}/remoteLogFile.ts +3 -7
  75. inspect_ai/_view/www/src/{utils/remoteZipFile.mjs → logfile/remoteZipFile.ts} +86 -80
  76. inspect_ai/_view/www/src/metadata/MetaDataGrid.tsx +83 -0
  77. inspect_ai/_view/www/src/metadata/MetaDataView.module.css +35 -0
  78. inspect_ai/_view/www/src/metadata/MetaDataView.tsx +95 -0
  79. inspect_ai/_view/www/src/metadata/MetadataGrid.module.css +15 -0
  80. inspect_ai/_view/www/src/metadata/RenderedContent.module.css +12 -0
  81. inspect_ai/_view/www/src/{components/RenderedContent/RenderedContent.mjs → metadata/RenderedContent.tsx} +92 -73
  82. inspect_ai/_view/www/src/metadata/types.ts +18 -0
  83. inspect_ai/_view/www/src/plan/DatasetDetailView.module.css +3 -0
  84. inspect_ai/_view/www/src/plan/DatasetDetailView.tsx +37 -0
  85. inspect_ai/_view/www/src/plan/DetailStep.module.css +9 -0
  86. inspect_ai/_view/www/src/plan/DetailStep.tsx +31 -0
  87. inspect_ai/_view/www/src/plan/PlanCard.tsx +28 -0
  88. inspect_ai/_view/www/src/plan/PlanDetailView.module.css +48 -0
  89. inspect_ai/_view/www/src/plan/PlanDetailView.tsx +309 -0
  90. inspect_ai/_view/www/src/plan/ScorerDetailView.module.css +3 -0
  91. inspect_ai/_view/www/src/plan/ScorerDetailView.tsx +30 -0
  92. inspect_ai/_view/www/src/plan/SolverDetailView.module.css +15 -0
  93. inspect_ai/_view/www/src/plan/SolverDetailView.tsx +32 -0
  94. inspect_ai/_view/www/src/samples/InlineSampleDisplay.module.css +8 -0
  95. inspect_ai/_view/www/src/samples/InlineSampleDisplay.tsx +53 -0
  96. inspect_ai/_view/www/src/samples/SampleDialog.tsx +122 -0
  97. inspect_ai/_view/www/src/samples/SampleDisplay.module.css +29 -0
  98. inspect_ai/_view/www/src/samples/SampleDisplay.tsx +326 -0
  99. inspect_ai/_view/www/src/samples/SampleSummaryView.module.css +24 -0
  100. inspect_ai/_view/www/src/samples/SampleSummaryView.tsx +175 -0
  101. inspect_ai/_view/www/src/samples/SamplesTools.tsx +60 -0
  102. inspect_ai/_view/www/src/samples/chat/ChatMessage.module.css +29 -0
  103. inspect_ai/_view/www/src/samples/chat/ChatMessage.tsx +76 -0
  104. inspect_ai/_view/www/src/samples/chat/ChatMessageRenderer.tsx +60 -0
  105. inspect_ai/_view/www/src/samples/chat/ChatMessageRow.module.css +9 -0
  106. inspect_ai/_view/www/src/samples/chat/ChatMessageRow.tsx +57 -0
  107. inspect_ai/_view/www/src/samples/chat/ChatView.tsx +46 -0
  108. inspect_ai/_view/www/src/samples/chat/ChatViewVirtualList.module.css +4 -0
  109. inspect_ai/_view/www/src/samples/chat/ChatViewVirtualList.tsx +58 -0
  110. inspect_ai/_view/www/src/samples/chat/MessageContent.module.css +4 -0
  111. inspect_ai/_view/www/src/samples/chat/MessageContent.tsx +143 -0
  112. inspect_ai/_view/www/src/samples/chat/MessageContents.module.css +3 -0
  113. inspect_ai/_view/www/src/samples/chat/MessageContents.tsx +131 -0
  114. inspect_ai/_view/www/src/samples/chat/messages.ts +112 -0
  115. inspect_ai/_view/www/src/samples/chat/tools/ToolCallView.tsx +145 -0
  116. inspect_ai/_view/www/src/samples/chat/tools/ToolInput.module.css +14 -0
  117. inspect_ai/_view/www/src/samples/chat/tools/ToolInput.tsx +86 -0
  118. inspect_ai/_view/www/src/samples/chat/tools/ToolOutput.module.css +19 -0
  119. inspect_ai/_view/www/src/samples/chat/tools/ToolOutput.tsx +53 -0
  120. inspect_ai/_view/www/src/samples/chat/tools/ToolTitle.module.css +4 -0
  121. inspect_ai/_view/www/src/samples/chat/tools/ToolTitle.tsx +18 -0
  122. inspect_ai/_view/www/src/samples/chat/tools/tool.ts +107 -0
  123. inspect_ai/_view/www/src/samples/descriptor/samplesDescriptor.tsx +363 -0
  124. inspect_ai/_view/www/src/samples/descriptor/score/BooleanScoreDescriptor.module.css +22 -0
  125. inspect_ai/_view/www/src/samples/descriptor/score/BooleanScoreDescriptor.tsx +26 -0
  126. inspect_ai/_view/www/src/samples/descriptor/score/CategoricalScoreDescriptor.tsx +18 -0
  127. inspect_ai/_view/www/src/samples/descriptor/score/NumericScoreDescriptor.tsx +27 -0
  128. inspect_ai/_view/www/src/samples/descriptor/score/ObjectScoreDescriptor.module.css +18 -0
  129. inspect_ai/_view/www/src/samples/descriptor/score/ObjectScoreDescriptor.tsx +71 -0
  130. inspect_ai/_view/www/src/samples/descriptor/score/OtherScoreDescriptor.tsx +20 -0
  131. inspect_ai/_view/www/src/samples/descriptor/score/PassFailScoreDescriptor.module.css +28 -0
  132. inspect_ai/_view/www/src/samples/descriptor/score/PassFailScoreDescriptor.tsx +81 -0
  133. inspect_ai/_view/www/src/samples/descriptor/score/ScoreDescriptor.tsx +99 -0
  134. inspect_ai/_view/www/src/samples/descriptor/types.ts +55 -0
  135. inspect_ai/_view/www/src/samples/error/FlatSampleErrorView.module.css +19 -0
  136. inspect_ai/_view/www/src/samples/error/FlatSampleErrorView.tsx +22 -0
  137. inspect_ai/_view/www/src/samples/error/SampleErrorView.module.css +17 -0
  138. inspect_ai/_view/www/src/samples/error/SampleErrorView.tsx +31 -0
  139. inspect_ai/_view/www/src/samples/error/error.ts +15 -0
  140. inspect_ai/_view/www/src/samples/list/SampleFooter.module.css +9 -0
  141. inspect_ai/_view/www/src/samples/list/SampleFooter.tsx +14 -0
  142. inspect_ai/_view/www/src/samples/list/SampleHeader.module.css +13 -0
  143. inspect_ai/_view/www/src/samples/list/SampleHeader.tsx +36 -0
  144. inspect_ai/_view/www/src/samples/list/SampleList.module.css +11 -0
  145. inspect_ai/_view/www/src/samples/list/SampleList.tsx +247 -0
  146. inspect_ai/_view/www/src/samples/list/SampleRow.module.css +33 -0
  147. inspect_ai/_view/www/src/samples/list/SampleRow.tsx +98 -0
  148. inspect_ai/_view/www/src/samples/list/SampleSeparator.module.css +6 -0
  149. inspect_ai/_view/www/src/samples/list/SampleSeparator.tsx +24 -0
  150. inspect_ai/_view/www/src/samples/sample-tools/EpochFilter.module.css +9 -0
  151. inspect_ai/_view/www/src/samples/sample-tools/EpochFilter.tsx +51 -0
  152. inspect_ai/_view/www/src/samples/sample-tools/SelectScorer.module.css +16 -0
  153. inspect_ai/_view/www/src/samples/sample-tools/SelectScorer.tsx +173 -0
  154. inspect_ai/_view/www/src/samples/sample-tools/SortFilter.module.css +9 -0
  155. inspect_ai/_view/www/src/samples/sample-tools/SortFilter.tsx +182 -0
  156. inspect_ai/_view/www/src/samples/{tools/filters.mjs → sample-tools/filters.ts} +86 -81
  157. inspect_ai/_view/www/src/samples/sample-tools/sample-filter/SampleFilter.module.css +16 -0
  158. inspect_ai/_view/www/src/samples/sample-tools/sample-filter/SampleFilter.tsx +288 -0
  159. inspect_ai/_view/www/src/samples/sample-tools/sample-filter/completions.ts +346 -0
  160. inspect_ai/_view/www/src/samples/sample-tools/sample-filter/language.ts +19 -0
  161. inspect_ai/_view/www/src/samples/sample-tools/sample-filter/tokenize.ts +97 -0
  162. inspect_ai/_view/www/src/samples/{SampleLimit.mjs → sampleLimit.ts} +3 -6
  163. inspect_ai/_view/www/src/samples/scores/SampleScoreView.module.css +53 -0
  164. inspect_ai/_view/www/src/samples/scores/SampleScoreView.tsx +168 -0
  165. inspect_ai/_view/www/src/samples/scores/SampleScores.module.css +5 -0
  166. inspect_ai/_view/www/src/samples/scores/SampleScores.tsx +37 -0
  167. inspect_ai/_view/www/src/samples/transcript/ApprovalEventView.tsx +66 -0
  168. inspect_ai/_view/www/src/samples/transcript/ErrorEventView.tsx +51 -0
  169. inspect_ai/_view/www/src/samples/transcript/InfoEventView.module.css +3 -0
  170. inspect_ai/_view/www/src/samples/transcript/InfoEventView.tsx +54 -0
  171. inspect_ai/_view/www/src/samples/transcript/InputEventView.tsx +48 -0
  172. inspect_ai/_view/www/src/samples/transcript/LoggerEventView.module.css +6 -0
  173. inspect_ai/_view/www/src/samples/transcript/LoggerEventView.tsx +36 -0
  174. inspect_ai/_view/www/src/samples/transcript/ModelEventView.module.css +43 -0
  175. inspect_ai/_view/www/src/samples/transcript/ModelEventView.tsx +223 -0
  176. inspect_ai/_view/www/src/samples/transcript/SampleInitEventView.module.css +23 -0
  177. inspect_ai/_view/www/src/samples/transcript/SampleInitEventView.tsx +108 -0
  178. inspect_ai/_view/www/src/samples/transcript/SampleLimitEventView.tsx +75 -0
  179. inspect_ai/_view/www/src/samples/transcript/SampleTranscript.tsx +22 -0
  180. inspect_ai/_view/www/src/samples/transcript/ScoreEventView.module.css +15 -0
  181. inspect_ai/_view/www/src/samples/transcript/ScoreEventView.tsx +100 -0
  182. inspect_ai/_view/www/src/samples/transcript/StepEventView.tsx +171 -0
  183. inspect_ai/_view/www/src/samples/transcript/SubtaskEventView.module.css +19 -0
  184. inspect_ai/_view/www/src/samples/transcript/SubtaskEventView.tsx +133 -0
  185. inspect_ai/_view/www/src/samples/transcript/ToolEventView.module.css +10 -0
  186. inspect_ai/_view/www/src/samples/transcript/ToolEventView.tsx +91 -0
  187. inspect_ai/_view/www/src/samples/transcript/TranscriptView.module.css +49 -0
  188. inspect_ai/_view/www/src/samples/transcript/TranscriptView.tsx +449 -0
  189. inspect_ai/_view/www/src/samples/transcript/event/EventNav.module.css +5 -0
  190. inspect_ai/_view/www/src/samples/transcript/event/EventNav.tsx +43 -0
  191. inspect_ai/_view/www/src/samples/transcript/event/EventNavs.module.css +3 -0
  192. inspect_ai/_view/www/src/samples/transcript/event/EventNavs.tsx +38 -0
  193. inspect_ai/_view/www/src/samples/transcript/event/EventPanel.module.css +25 -0
  194. inspect_ai/_view/www/src/samples/transcript/event/EventPanel.tsx +190 -0
  195. inspect_ai/_view/www/src/samples/transcript/event/EventRow.module.css +13 -0
  196. inspect_ai/_view/www/src/samples/transcript/event/EventRow.tsx +32 -0
  197. inspect_ai/_view/www/src/samples/transcript/event/EventSection.module.css +8 -0
  198. inspect_ai/_view/www/src/samples/transcript/event/EventSection.tsx +29 -0
  199. inspect_ai/_view/www/src/samples/transcript/state/StateDiffView.tsx +67 -0
  200. inspect_ai/_view/www/src/samples/transcript/state/StateEventRenderers.tsx +274 -0
  201. inspect_ai/_view/www/src/samples/transcript/state/StateEventRenders.module.css +10 -0
  202. inspect_ai/_view/www/src/samples/transcript/state/StateEventView.module.css +9 -0
  203. inspect_ai/_view/www/src/samples/transcript/state/{StateEventView.mjs → StateEventView.tsx} +148 -110
  204. inspect_ai/_view/www/src/samples/transcript/types.ts +58 -0
  205. inspect_ai/_view/www/src/types/log.d.ts +1 -0
  206. inspect_ai/_view/www/src/types/prism.d.ts +11 -0
  207. inspect_ai/_view/www/src/types.ts +71 -0
  208. inspect_ai/_view/www/src/usage/ModelTokenTable.tsx +22 -0
  209. inspect_ai/_view/www/src/usage/ModelUsagePanel.module.css +24 -0
  210. inspect_ai/_view/www/src/usage/ModelUsagePanel.tsx +95 -0
  211. inspect_ai/_view/www/src/usage/TokenTable.module.css +17 -0
  212. inspect_ai/_view/www/src/usage/TokenTable.tsx +91 -0
  213. inspect_ai/_view/www/src/usage/UsageCard.module.css +15 -0
  214. inspect_ai/_view/www/src/usage/UsageCard.tsx +67 -0
  215. inspect_ai/_view/www/src/utils/attachments.ts +42 -0
  216. inspect_ai/_view/www/src/utils/{Base64.mjs → base64.ts} +1 -6
  217. inspect_ai/_view/www/src/{components/Browser.mjs → utils/browser.ts} +0 -1
  218. inspect_ai/_view/www/src/utils/debugging.ts +28 -0
  219. inspect_ai/_view/www/src/utils/dom.ts +30 -0
  220. inspect_ai/_view/www/src/utils/format.ts +194 -0
  221. inspect_ai/_view/www/src/utils/git.ts +7 -0
  222. inspect_ai/_view/www/src/utils/html.ts +6 -0
  223. inspect_ai/_view/www/src/utils/http.ts +14 -0
  224. inspect_ai/_view/www/src/utils/{Path.mjs → path.ts} +2 -9
  225. inspect_ai/_view/www/src/utils/{Print.mjs → print.ts} +34 -26
  226. inspect_ai/_view/www/src/utils/queue.ts +51 -0
  227. inspect_ai/_view/www/src/utils/sync.ts +114 -0
  228. inspect_ai/_view/www/src/utils/{Type.mjs → type.ts} +3 -6
  229. inspect_ai/_view/www/src/utils/vscode.ts +13 -0
  230. inspect_ai/_view/www/src/workspace/WorkSpace.tsx +324 -0
  231. inspect_ai/_view/www/src/workspace/WorkSpaceView.module.css +33 -0
  232. inspect_ai/_view/www/src/workspace/WorkSpaceView.tsx +160 -0
  233. inspect_ai/_view/www/src/workspace/error/TaskErrorPanel.module.css +3 -0
  234. inspect_ai/_view/www/src/workspace/error/TaskErrorPanel.tsx +28 -0
  235. inspect_ai/_view/www/src/workspace/navbar/Navbar.module.css +54 -0
  236. inspect_ai/_view/www/src/workspace/navbar/Navbar.tsx +68 -0
  237. inspect_ai/_view/www/src/workspace/navbar/PrimaryBar.module.css +52 -0
  238. inspect_ai/_view/www/src/workspace/navbar/PrimaryBar.tsx +113 -0
  239. inspect_ai/_view/www/src/workspace/navbar/ResultsPanel.module.css +67 -0
  240. inspect_ai/_view/www/src/workspace/navbar/ResultsPanel.tsx +156 -0
  241. inspect_ai/_view/www/src/workspace/navbar/SecondaryBar.module.css +28 -0
  242. inspect_ai/_view/www/src/workspace/navbar/SecondaryBar.tsx +222 -0
  243. inspect_ai/_view/www/src/workspace/navbar/StatusPanel.module.css +14 -0
  244. inspect_ai/_view/www/src/workspace/navbar/StatusPanel.tsx +61 -0
  245. inspect_ai/_view/www/src/workspace/sidebar/EvalStatus.module.css +15 -0
  246. inspect_ai/_view/www/src/workspace/sidebar/EvalStatus.tsx +71 -0
  247. inspect_ai/_view/www/src/workspace/sidebar/LogDirectoryTitleView.module.css +5 -0
  248. inspect_ai/_view/www/src/workspace/sidebar/LogDirectoryTitleView.tsx +56 -0
  249. inspect_ai/_view/www/src/workspace/sidebar/Sidebar.module.css +68 -0
  250. inspect_ai/_view/www/src/workspace/sidebar/Sidebar.tsx +85 -0
  251. inspect_ai/_view/www/src/workspace/sidebar/SidebarLogEntry.module.css +29 -0
  252. inspect_ai/_view/www/src/workspace/sidebar/SidebarLogEntry.tsx +95 -0
  253. inspect_ai/_view/www/src/workspace/sidebar/SidebarScoreView.module.css +23 -0
  254. inspect_ai/_view/www/src/workspace/sidebar/SidebarScoreView.tsx +41 -0
  255. inspect_ai/_view/www/src/workspace/sidebar/SidebarScoresView.module.css +35 -0
  256. inspect_ai/_view/www/src/workspace/sidebar/SidebarScoresView.tsx +61 -0
  257. inspect_ai/_view/www/src/workspace/tabs/InfoTab.tsx +80 -0
  258. inspect_ai/_view/www/src/workspace/tabs/JsonTab.module.css +5 -0
  259. inspect_ai/_view/www/src/workspace/tabs/JsonTab.tsx +46 -0
  260. inspect_ai/_view/www/src/workspace/tabs/SamplesTab.tsx +204 -0
  261. inspect_ai/_view/www/src/workspace/tabs/grouping.ts +195 -0
  262. inspect_ai/_view/www/src/workspace/tabs/types.ts +19 -0
  263. inspect_ai/_view/www/src/workspace/types.ts +10 -0
  264. inspect_ai/_view/www/tsconfig.json +23 -9
  265. inspect_ai/_view/www/vite.config.js +8 -17
  266. inspect_ai/_view/www/yarn.lock +627 -556
  267. inspect_ai/dataset/_dataset.py +36 -0
  268. inspect_ai/dataset/_sources/csv.py +8 -0
  269. inspect_ai/dataset/_sources/file.py +4 -0
  270. inspect_ai/dataset/_sources/hf.py +11 -1
  271. inspect_ai/dataset/_sources/json.py +8 -0
  272. inspect_ai/log/_log.py +3 -6
  273. inspect_ai/log/_message.py +1 -1
  274. inspect_ai/log/_recorders/json.py +5 -7
  275. inspect_ai/model/_call_tools.py +2 -1
  276. inspect_ai/model/_providers/anthropic.py +3 -3
  277. inspect_ai/model/_providers/openai_o1.py +3 -5
  278. inspect_ai/model/_providers/openrouter.py +86 -0
  279. inspect_ai/model/_providers/providers.py +11 -0
  280. inspect_ai/scorer/_answer.py +7 -7
  281. inspect_ai/scorer/_classification.py +34 -18
  282. inspect_ai/scorer/_common.py +2 -8
  283. inspect_ai/solver/_multiple_choice.py +24 -9
  284. inspect_ai/tool/__init__.py +2 -0
  285. inspect_ai/tool/{beta → _tools}/_computer/_computer.py +2 -5
  286. inspect_ai/tool/_tools/_computer/_resources/tool/__init__.py +0 -0
  287. inspect_ai/tool/{beta → _tools}/_computer/_resources/tool/_x11_client.py +1 -1
  288. inspect_ai/tool/_tools/_computer/_resources/tool/requirements.txt +0 -0
  289. inspect_ai/tool/_tools/_execute.py +8 -2
  290. inspect_ai/tool/beta.py +3 -0
  291. inspect_ai/util/_sandbox/docker/docker.py +32 -85
  292. inspect_ai/util/_sandbox/self_check.py +124 -16
  293. {inspect_ai-0.3.62.dist-info → inspect_ai-0.3.63.dist-info}/METADATA +2 -1
  294. inspect_ai-0.3.63.dist-info/RECORD +618 -0
  295. inspect_ai/_view/www/src/Register.mjs +0 -3
  296. inspect_ai/_view/www/src/Types.mjs +0 -38
  297. inspect_ai/_view/www/src/appearance/Colors.mjs +0 -27
  298. inspect_ai/_view/www/src/appearance/Fonts.mjs +0 -66
  299. inspect_ai/_view/www/src/appearance/Icons.mjs +0 -240
  300. inspect_ai/_view/www/src/components/AnsiDisplay.mjs +0 -184
  301. inspect_ai/_view/www/src/components/AppErrorBoundary.mjs +0 -34
  302. inspect_ai/_view/www/src/components/AsciiCinemaPlayer.mjs +0 -74
  303. inspect_ai/_view/www/src/components/Card.mjs +0 -126
  304. inspect_ai/_view/www/src/components/ChatView.mjs +0 -441
  305. inspect_ai/_view/www/src/components/CopyButton.mjs +0 -48
  306. inspect_ai/_view/www/src/components/Dialog.mjs +0 -61
  307. inspect_ai/_view/www/src/components/DownloadButton.mjs +0 -15
  308. inspect_ai/_view/www/src/components/DownloadPanel.mjs +0 -29
  309. inspect_ai/_view/www/src/components/EmptyPanel.mjs +0 -23
  310. inspect_ai/_view/www/src/components/ErrorPanel.mjs +0 -66
  311. inspect_ai/_view/www/src/components/ExpandablePanel.mjs +0 -136
  312. inspect_ai/_view/www/src/components/FindBand.mjs +0 -157
  313. inspect_ai/_view/www/src/components/HumanBaselineView.mjs +0 -168
  314. inspect_ai/_view/www/src/components/JsonPanel.mjs +0 -61
  315. inspect_ai/_view/www/src/components/LabeledValue.mjs +0 -32
  316. inspect_ai/_view/www/src/components/LargeModal.mjs +0 -190
  317. inspect_ai/_view/www/src/components/LightboxCarousel.mjs +0 -217
  318. inspect_ai/_view/www/src/components/MarkdownDiv.mjs +0 -118
  319. inspect_ai/_view/www/src/components/MessageBand.mjs +0 -48
  320. inspect_ai/_view/www/src/components/MessageContent.mjs +0 -111
  321. inspect_ai/_view/www/src/components/MetaDataGrid.mjs +0 -92
  322. inspect_ai/_view/www/src/components/MetaDataView.mjs +0 -109
  323. inspect_ai/_view/www/src/components/MorePopOver.mjs +0 -50
  324. inspect_ai/_view/www/src/components/NavPills.mjs +0 -63
  325. inspect_ai/_view/www/src/components/ProgressBar.mjs +0 -51
  326. inspect_ai/_view/www/src/components/RenderedContent/ChatMessageRenderer.mjs +0 -54
  327. inspect_ai/_view/www/src/components/RenderedContent/Types.mjs +0 -19
  328. inspect_ai/_view/www/src/components/TabSet.mjs +0 -184
  329. inspect_ai/_view/www/src/components/ToolButton.mjs +0 -16
  330. inspect_ai/_view/www/src/components/Tools.mjs +0 -376
  331. inspect_ai/_view/www/src/components/VirtualList.mjs +0 -280
  332. inspect_ai/_view/www/src/components/ansi-output.js +0 -932
  333. inspect_ai/_view/www/src/json/JsonTab.mjs +0 -48
  334. inspect_ai/_view/www/src/log-reader/Log-Reader.mjs +0 -25
  335. inspect_ai/_view/www/src/log-reader/Native-Log-Reader.mjs +0 -13
  336. inspect_ai/_view/www/src/log-reader/Open-AI-Log-Reader.mjs +0 -263
  337. inspect_ai/_view/www/src/navbar/Navbar.mjs +0 -418
  338. inspect_ai/_view/www/src/navbar/SecondaryBar.mjs +0 -175
  339. inspect_ai/_view/www/src/plan/PlanCard.mjs +0 -418
  340. inspect_ai/_view/www/src/samples/SampleDialog.mjs +0 -123
  341. inspect_ai/_view/www/src/samples/SampleDisplay.mjs +0 -516
  342. inspect_ai/_view/www/src/samples/SampleError.mjs +0 -99
  343. inspect_ai/_view/www/src/samples/SampleList.mjs +0 -427
  344. inspect_ai/_view/www/src/samples/SampleScoreView.mjs +0 -172
  345. inspect_ai/_view/www/src/samples/SampleScores.mjs +0 -34
  346. inspect_ai/_view/www/src/samples/SampleTranscript.mjs +0 -20
  347. inspect_ai/_view/www/src/samples/SamplesDescriptor.mjs +0 -771
  348. inspect_ai/_view/www/src/samples/SamplesTab.mjs +0 -399
  349. inspect_ai/_view/www/src/samples/SamplesTools.mjs +0 -64
  350. inspect_ai/_view/www/src/samples/tools/EpochFilter.mjs +0 -38
  351. inspect_ai/_view/www/src/samples/tools/SampleFilter.mjs +0 -756
  352. inspect_ai/_view/www/src/samples/tools/SelectScorer.mjs +0 -141
  353. inspect_ai/_view/www/src/samples/tools/SortFilter.mjs +0 -151
  354. inspect_ai/_view/www/src/samples/transcript/ApprovalEventView.mjs +0 -71
  355. inspect_ai/_view/www/src/samples/transcript/ErrorEventView.mjs +0 -44
  356. inspect_ai/_view/www/src/samples/transcript/EventPanel.mjs +0 -271
  357. inspect_ai/_view/www/src/samples/transcript/EventRow.mjs +0 -46
  358. inspect_ai/_view/www/src/samples/transcript/EventSection.mjs +0 -33
  359. inspect_ai/_view/www/src/samples/transcript/InfoEventView.mjs +0 -59
  360. inspect_ai/_view/www/src/samples/transcript/InputEventView.mjs +0 -44
  361. inspect_ai/_view/www/src/samples/transcript/LoggerEventView.mjs +0 -32
  362. inspect_ai/_view/www/src/samples/transcript/ModelEventView.mjs +0 -216
  363. inspect_ai/_view/www/src/samples/transcript/SampleInitEventView.mjs +0 -107
  364. inspect_ai/_view/www/src/samples/transcript/SampleLimitEventView.mjs +0 -74
  365. inspect_ai/_view/www/src/samples/transcript/ScoreEventView.mjs +0 -100
  366. inspect_ai/_view/www/src/samples/transcript/StepEventView.mjs +0 -187
  367. inspect_ai/_view/www/src/samples/transcript/SubtaskEventView.mjs +0 -133
  368. inspect_ai/_view/www/src/samples/transcript/ToolEventView.mjs +0 -88
  369. inspect_ai/_view/www/src/samples/transcript/TranscriptView.mjs +0 -459
  370. inspect_ai/_view/www/src/samples/transcript/Types.mjs +0 -44
  371. inspect_ai/_view/www/src/samples/transcript/state/StateDiffView.mjs +0 -53
  372. inspect_ai/_view/www/src/samples/transcript/state/StateEventRenderers.mjs +0 -254
  373. inspect_ai/_view/www/src/sidebar/Sidebar.mjs +0 -418
  374. inspect_ai/_view/www/src/usage/ModelTokenTable.mjs +0 -72
  375. inspect_ai/_view/www/src/usage/UsageCard.mjs +0 -159
  376. inspect_ai/_view/www/src/utils/Format.mjs +0 -260
  377. inspect_ai/_view/www/src/utils/Git.mjs +0 -12
  378. inspect_ai/_view/www/src/utils/Html.mjs +0 -21
  379. inspect_ai/_view/www/src/utils/attachments.mjs +0 -31
  380. inspect_ai/_view/www/src/utils/debugging.mjs +0 -23
  381. inspect_ai/_view/www/src/utils/http.mjs +0 -18
  382. inspect_ai/_view/www/src/utils/queue.mjs +0 -67
  383. inspect_ai/_view/www/src/utils/sync.mjs +0 -101
  384. inspect_ai/_view/www/src/workspace/TaskErrorPanel.mjs +0 -17
  385. inspect_ai/_view/www/src/workspace/WorkSpace.mjs +0 -516
  386. inspect_ai/tool/beta/__init__.py +0 -5
  387. inspect_ai-0.3.62.dist-info/RECORD +0 -481
  388. /inspect_ai/{tool/beta/_computer/_resources/tool/__init__.py → _view/www/src/components/MorePopOver.css} +0 -0
  389. /inspect_ai/_view/www/src/{constants.mjs → constants.ts} +0 -0
  390. /inspect_ai/{tool/beta/_computer/_resources/tool/requirements.txt → _view/www/src/workspace/tabs/InfoTab.module.css} +0 -0
  391. /inspect_ai/tool/{beta → _tools}/_computer/__init__.py +0 -0
  392. /inspect_ai/tool/{beta → _tools}/_computer/_common.py +0 -0
  393. /inspect_ai/tool/{beta → _tools}/_computer/_computer_split.py +0 -0
  394. /inspect_ai/tool/{beta → _tools}/_computer/_resources/Dockerfile +0 -0
  395. /inspect_ai/tool/{beta → _tools}/_computer/_resources/README.md +0 -0
  396. /inspect_ai/tool/{beta → _tools}/_computer/_resources/entrypoint/entrypoint.sh +0 -0
  397. /inspect_ai/tool/{beta → _tools}/_computer/_resources/entrypoint/novnc_startup.sh +0 -0
  398. /inspect_ai/tool/{beta → _tools}/_computer/_resources/entrypoint/x11vnc_startup.sh +0 -0
  399. /inspect_ai/tool/{beta → _tools}/_computer/_resources/entrypoint/xfce_startup.sh +0 -0
  400. /inspect_ai/tool/{beta → _tools}/_computer/_resources/entrypoint/xvfb_startup.sh +0 -0
  401. /inspect_ai/tool/{beta → _tools}/_computer/_resources/image_home_dir/.config/Code/User/globalStorage/state.vscdb +0 -0
  402. /inspect_ai/tool/{beta → _tools}/_computer/_resources/image_home_dir/.config/Code/User/settings.json +0 -0
  403. /inspect_ai/tool/{beta → _tools}/_computer/_resources/image_home_dir/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml +0 -0
  404. /inspect_ai/tool/{beta → _tools}/_computer/_resources/image_home_dir/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-screensaver.xml +0 -0
  405. /inspect_ai/tool/{beta → _tools}/_computer/_resources/image_home_dir/Desktop/Firefox Web Browser.desktop +0 -0
  406. /inspect_ai/tool/{beta → _tools}/_computer/_resources/image_home_dir/Desktop/Terminal.desktop +0 -0
  407. /inspect_ai/tool/{beta → _tools}/_computer/_resources/image_home_dir/Desktop/Visual Studio Code.desktop +0 -0
  408. /inspect_ai/tool/{beta → _tools}/_computer/_resources/tool/_logger.py +0 -0
  409. /inspect_ai/tool/{beta → _tools}/_computer/_resources/tool/_run.py +0 -0
  410. /inspect_ai/tool/{beta → _tools}/_computer/_resources/tool/_tool_result.py +0 -0
  411. /inspect_ai/tool/{beta → _tools}/_computer/_resources/tool/computer_tool.py +0 -0
  412. {inspect_ai-0.3.62.dist-info → inspect_ai-0.3.63.dist-info}/LICENSE +0 -0
  413. {inspect_ai-0.3.62.dist-info → inspect_ai-0.3.63.dist-info}/WHEEL +0 -0
  414. {inspect_ai-0.3.62.dist-info → inspect_ai-0.3.63.dist-info}/entry_points.txt +0 -0
  415. {inspect_ai-0.3.62.dist-info → inspect_ai-0.3.63.dist-info}/top_level.txt +0 -0
@@ -1,46 +0,0 @@
1
- // @ts-check
2
- import { html } from "htm/preact";
3
- import { ApplicationIcons } from "../../appearance/Icons.mjs";
4
- import { FontSize, TextStyle } from "../../appearance/Fonts.mjs";
5
-
6
- /**
7
- * Renders the EventRow component.
8
- *
9
- * @param {Object} props - The properties passed to the component.
10
- * @param {string | undefined} props.title - The name of the event
11
- * @param {string | undefined} props.icon - The name of the event
12
- * @param {Object} props.style - The style of the event
13
- * @param {import("preact").ComponentChildren} props.children - The rendered event.
14
- * @returns {import("preact").JSX.Element} The component.
15
- */
16
- export const EventRow = ({ title, icon, style, children }) => {
17
- const contentEl = title
18
- ? html`<div
19
- style=${{
20
- marginLeft: "0.5em",
21
- display: "grid",
22
- gridTemplateColumns: "max-content max-content minmax(0, 1fr)",
23
- columnGap: "0.5em",
24
- fontSize: FontSize.small,
25
- }}
26
- >
27
- <i class=${icon || ApplicationIcons.metadata} />
28
- <div style=${{ ...TextStyle.label }}>${title}</div>
29
- <div>${children}</div>
30
- </div>`
31
- : "";
32
-
33
- const card = html` <div
34
- class="card"
35
- style=${{
36
- padding: "0.4em",
37
- marginBottom: "0",
38
- border: "solid 1px var(--bs-light-border-subtle)",
39
- borderRadius: "var(--bs-border-radius)",
40
- ...style,
41
- }}
42
- >
43
- ${contentEl}
44
- </div>`;
45
- return card;
46
- };
@@ -1,33 +0,0 @@
1
- // @ts-check
2
- import { html } from "htm/preact";
3
- import { FontSize, TextStyle } from "../../appearance/Fonts.mjs";
4
-
5
- /**
6
- * Renders the Event Section component.
7
- *
8
- * @param {Object} props - The properties passed to the component.
9
- * @param {string | undefined} props.title - The name of the event
10
- * @param {Object | undefined} props.style - The name of the event
11
- * @param {import("preact").ComponentChildren} props.children - The rendered event.
12
- * @returns {import("preact").JSX.Element} The component.
13
- */
14
- export const EventSection = ({ title, style, children }) => {
15
- return html`<div
16
- style=${{
17
- margin: "1em 0 0 0",
18
- ...style,
19
- }}
20
- >
21
- <div
22
- style=${{
23
- fontSize: FontSize.smaller,
24
- ...TextStyle.label,
25
- fontWeight: 600,
26
- paddingBottom: "0.3em",
27
- }}
28
- >
29
- ${title}
30
- </div>
31
- ${children}
32
- </div>`;
33
- };
@@ -1,59 +0,0 @@
1
- // @ts-check
2
- import { html } from "htm/preact";
3
- import { ApplicationIcons } from "../../appearance/Icons.mjs";
4
- import { EventPanel } from "./EventPanel.mjs";
5
- import { JSONPanel } from "../../components/JsonPanel.mjs";
6
- import { MarkdownDiv } from "../../components/MarkdownDiv.mjs";
7
- import { formatDateTime } from "../../utils/Format.mjs";
8
-
9
- /**
10
- * Renders the InfoEventView component.
11
- *
12
- * @param {Object} props - The properties passed to the component.
13
- * @param { string } props.id - The id of this event.
14
- * @param { Object } props.style - The depth of this event.
15
- * @param {import("../../types/log").InfoEvent} props.event - The event object to display.
16
- * @param {import("./Types.mjs").TranscriptEventState} props.eventState - The state for this event
17
- * @param {(state: import("./Types.mjs").TranscriptEventState) => void} props.setEventState - Update the state for this event
18
- * @returns {import("preact").JSX.Element} The component.
19
- */
20
- export const InfoEventView = ({
21
- id,
22
- event,
23
- style,
24
- eventState,
25
- setEventState,
26
- }) => {
27
- const panels = [];
28
- if (typeof event.data === "string") {
29
- panels.push(
30
- html`<${MarkdownDiv}
31
- markdown=${event.data}
32
- style=${{ margin: "0.5em 0" }}
33
- />`,
34
- );
35
- } else {
36
- panels.push(
37
- html`<${JSONPanel} data=${event.data} style=${{ margin: "0.5em 0" }} />`,
38
- );
39
- }
40
-
41
- return html`
42
- <${EventPanel}
43
- id=${id}
44
- title="Info"
45
- subTitle=${formatDateTime(new Date(event.timestamp))}
46
- icon=${ApplicationIcons.info}
47
- style=${style}
48
- selectedNav=${eventState.selectedNav || ""}
49
- onSelectedNav=${(selectedNav) => {
50
- setEventState({ ...eventState, selectedNav });
51
- }}
52
- collapsed=${eventState.collapsed}
53
- onCollapsed=${(collapsed) => {
54
- setEventState({ ...eventState, collapsed });
55
- }}
56
- >
57
- ${panels}
58
- </${EventPanel}>`;
59
- };
@@ -1,44 +0,0 @@
1
- // @ts-check
2
- import { html } from "htm/preact";
3
- import { EventPanel } from "./EventPanel.mjs";
4
- import { ApplicationIcons } from "../../appearance/Icons.mjs";
5
- import { ANSIDisplay } from "../../components/AnsiDisplay.mjs";
6
- import { formatDateTime } from "../../utils/Format.mjs";
7
-
8
- /**
9
- * Renders the ErrorEventView component.
10
- *
11
- * @param {Object} props - The properties passed to the component.
12
- * @param { string } props.id - The id of this event.
13
- * @param {import("../../types/log").InputEvent} props.event - The event object to display.
14
- * @param { Object } props.style - The style of this event.
15
- * @param {import("./Types.mjs").TranscriptEventState} props.eventState - The state for this event
16
- * @param {(state: import("./Types.mjs").TranscriptEventState) => void} props.setEventState - Update the state for this event
17
- * @returns {import("preact").JSX.Element} The component.
18
- */
19
- export const InputEventView = ({
20
- id,
21
- event,
22
- style,
23
- eventState,
24
- setEventState,
25
- }) => {
26
- return html`
27
- <${EventPanel}
28
- id=${id}
29
- title="Input"
30
- subTitle=${formatDateTime(new Date(event.timestamp))}
31
- icon=${ApplicationIcons.input}
32
- style=${style}
33
- selectedNav=${eventState.selectedNav || ""}
34
- onSelectedNav=${(selectedNav) => {
35
- setEventState({ ...eventState, selectedNav });
36
- }}
37
- collapsed=${eventState.collapsed}
38
- onCollapsed=${(collapsed) => {
39
- setEventState({ ...eventState, collapsed });
40
- }}
41
- >
42
- <${ANSIDisplay} output=${event.input_ansi} style=${{ fontSize: "clamp(0.4rem, 1.15vw, 0.9rem)", ...style }}/>
43
- </${EventPanel}>`;
44
- };
@@ -1,32 +0,0 @@
1
- // @ts-check
2
- import { html } from "htm/preact";
3
- import { ApplicationIcons } from "../../appearance/Icons.mjs";
4
- import { FontSize, TextStyle } from "../../appearance/Fonts.mjs";
5
- import { EventRow } from "./EventRow.mjs";
6
-
7
- /**
8
- * Renders the LoggerEventView component.
9
- *
10
- * @param {Object} props - The properties passed to the component.
11
- * @param { string } props.id - The id of this event.
12
- * @param {import("../../types/log").LoggerEvent} props.event - The event object to display.
13
- * @param { Object } props.style - The style of this event.
14
- * @returns {import("preact").JSX.Element} The component.
15
- */
16
- export const LoggerEventView = ({ id, event, style }) => {
17
- // Create a Date object from the timestamp
18
- return html`
19
- <${EventRow}
20
- id=${id}
21
- title=${event.message.level}
22
- icon=${ApplicationIcons.logging[event.message.level.toLowerCase()]}
23
- style=${style}
24
- >
25
- <div
26
- style=${{ width: "100%", display: "grid", gridTemplateColumns: "1fr max-content", columnGap: "1em", fontSize: FontSize.base }}
27
- >
28
- <div style=${{ fontSize: FontSize.smaller }}>${event.message.message}</div>
29
- <div style=${{ fontSize: FontSize.smaller, ...TextStyle.secondary }}>${event.message.filename}:${event.message.lineno}</div>
30
- </div>
31
- </${EventRow}>`;
32
- };
@@ -1,216 +0,0 @@
1
- // @ts-check
2
- /// <reference path="../../types/prism.d.ts" />
3
- import Prism from "prismjs";
4
- import "prismjs/components/prism-python";
5
- import "prismjs/components/prism-bash";
6
- import "prismjs/components/prism-json";
7
-
8
- import { html } from "htm/preact";
9
- import { useEffect, useMemo, useRef } from "preact/hooks";
10
- import { ChatView } from "../../components/ChatView.mjs";
11
- import { EventPanel } from "./EventPanel.mjs";
12
- import { EventSection } from "./EventSection.mjs";
13
- import { ApplicationIcons } from "../../appearance/Icons.mjs";
14
- import { MetaDataGrid } from "../../components/MetaDataGrid.mjs";
15
- import { FontSize, TextStyle } from "../../appearance/Fonts.mjs";
16
- import { ModelUsagePanel } from "../../usage/UsageCard.mjs";
17
- import {
18
- formatDateTime,
19
- formatNumber,
20
- formatPrettyDecimal,
21
- } from "../../utils/Format.mjs";
22
-
23
- /**
24
- * Renders the StateEventView component.
25
- *
26
- * @param {Object} props - The properties passed to the component.
27
- * @param { string } props.id - The id of this event.
28
- * @param {import("../../types/log").ModelEvent} props.event - The event object to display.
29
- * @param {import("./Types.mjs").TranscriptEventState} props.eventState - The state for this event
30
- * @param {(state: import("./Types.mjs").TranscriptEventState) => void} props.setEventState - Update the state for this event
31
- * @param { Object } props.style - The style of this event.
32
- * @param {string} props.baseId - The baseId of the event.
33
- * @returns {import("preact").JSX.Element} The component.
34
- */
35
- export const ModelEventView = ({
36
- id,
37
- event,
38
- eventState,
39
- setEventState,
40
- style,
41
- }) => {
42
- const totalUsage = event.output.usage?.total_tokens;
43
- const callTime = event.output.time;
44
-
45
- const subItems = [];
46
- if (totalUsage) {
47
- subItems.push(`${formatNumber(totalUsage)} tokens`);
48
- }
49
- if (callTime) {
50
- subItems.push(`${formatPrettyDecimal(callTime)} sec`);
51
- }
52
- const subtitle = subItems.length > 0 ? `(${subItems.join(", ")})` : "";
53
-
54
- // Note: despite the type system saying otherwise, this has appeared empircally
55
- // to sometimes be undefined
56
- const outputMessages = event.output.choices?.map((choice) => {
57
- return choice.message;
58
- });
59
-
60
- const entries = { ...event.config };
61
- entries["tool_choice"] = event.tool_choice;
62
- delete entries["max_connections"];
63
-
64
- const tableSectionStyle = {
65
- width: "fit-content",
66
- alignSelf: "start",
67
- justifySelf: "start",
68
- };
69
-
70
- // For any user messages which immediately preceded this model call, including a
71
- // panel and display those user messages (exclude tool_call messages as they
72
- // are already shown in the tool call above)
73
- const userMessages = [];
74
- for (const msg of event.input.slice().reverse()) {
75
- if (msg.role === "user" && !msg.tool_call_id) {
76
- userMessages.push(msg);
77
- } else {
78
- break;
79
- }
80
- }
81
-
82
- return html`
83
- <${EventPanel}
84
- id=${id}
85
- title="Model Call: ${event.model} ${subtitle}"
86
- subTitle=${formatDateTime(new Date(event.timestamp))}
87
- icon=${ApplicationIcons.model}
88
- style=${style}
89
- selectedNav=${eventState.selectedNav || ""}
90
- onSelectedNav=${(selectedNav) => {
91
- setEventState({ ...eventState, selectedNav });
92
- }}
93
- collapsed=${eventState.collapsed}
94
- onCollapsed=${(collapsed) => {
95
- setEventState({ ...eventState, collapsed });
96
- }}
97
- >
98
-
99
- <div name="Summary" style=${{ margin: "0.5em 0" }}>
100
- <${ChatView}
101
- id="${id}-model-output"
102
- messages=${[...userMessages, ...(outputMessages || [])]}
103
- style=${{ paddingTop: "1em" }}
104
- numbered=${false}
105
- toolCallStyle="compact"
106
- />
107
- </div>
108
-
109
- <div name="All" style=${{ margin: "0.5em 0" }}>
110
-
111
- <div style=${{ display: "grid", gridTemplateColumns: "1fr 1fr", columnGap: "1em" }}>
112
- <${EventSection} title="Configuration" style=${tableSectionStyle}>
113
- <${MetaDataGrid} entries=${entries} plain=${true}/>
114
- </${EventSection}>
115
-
116
- <${EventSection} title="Usage" style=${tableSectionStyle}>
117
- <${ModelUsagePanel} usage=${event.output.usage}/>
118
- </${EventSection}>
119
-
120
- <${EventSection} title="Tools" style=${{ gridColumn: "-1/1", ...tableSectionStyle }}>
121
- <${ToolsConfig} tools=${event.tools}/>
122
- </${EventSection}>
123
-
124
- </div>
125
-
126
- <${EventSection} title="Messages">
127
- <${ChatView}
128
- id="${id}-model-input-full"
129
- messages=${[...event.input, ...(outputMessages || [])]}
130
- />
131
- </${EventSection}>
132
-
133
- </div>
134
-
135
- ${event.call ? html`<${APIView} name="API" call=${event.call} style=${{ margin: "0.5em 0", width: "100%" }} />` : ""}
136
-
137
- </${EventPanel}>`;
138
- };
139
-
140
- export const APIView = ({ call, style }) => {
141
- if (!call) {
142
- return "";
143
- }
144
-
145
- return html`<div style=${style}>
146
-
147
- <${EventSection} title="Request">
148
- <${APICodeCell} contents=${call.request} />
149
- </${EventSection}>
150
- <${EventSection} title="Response">
151
- <${APICodeCell} contents=${call.response} />
152
- </${EventSection}>
153
-
154
- </div>`;
155
- };
156
-
157
- export const APICodeCell = ({ id, contents }) => {
158
- if (!contents) {
159
- return "";
160
- }
161
-
162
- const codeRef = useRef();
163
- const sourceCode = useMemo(() => {
164
- return JSON.stringify(contents, undefined, 2);
165
- }, [contents]);
166
-
167
- useEffect(() => {
168
- if (codeRef.current) {
169
- // @ts-ignore
170
- Prism.highlightElement(codeRef.current);
171
- }
172
- }, [codeRef.current, contents]);
173
-
174
- return html`<div>
175
- <pre
176
- style=${{
177
- background: "var(--bs-light)",
178
- width: "100%",
179
- padding: "0.5em",
180
- borderRadius: "var(--bs-border-radius)",
181
- }}
182
- >
183
- <code
184
- id=${id}
185
- ref=${codeRef}
186
- class="language-json"
187
- style=${{
188
- fontSize: FontSize.small,
189
- whiteSpace: "pre-wrap",
190
- wordWrap: "anywhere",
191
- }}>
192
- ${sourceCode}
193
- </code>
194
- </pre>
195
- </div>`;
196
- };
197
-
198
- const ToolsConfig = ({ tools }) => {
199
- const toolEls = tools.map((tool) => {
200
- return html`<div style=${{ ...TextStyle.label, ...TextStyle.secondary }}>
201
- ${tool.name}
202
- </div>
203
- <div>${tool.description}</div>`;
204
- });
205
-
206
- return html`<div
207
- style=${{
208
- display: "grid",
209
- gridTemplateColumns: "max-content auto",
210
- columnGap: "1em",
211
- rowGap: "0.5em",
212
- }}
213
- >
214
- ${toolEls}
215
- </div>`;
216
- };
@@ -1,107 +0,0 @@
1
- // @ts-check
2
- import { html } from "htm/preact";
3
- import { EventPanel } from "./EventPanel.mjs";
4
- import { MetaDataGrid } from "../../components/MetaDataGrid.mjs";
5
- import { ChatView } from "../../components/ChatView.mjs";
6
- import { EventSection } from "./EventSection.mjs";
7
- import { toArray } from "../../utils/Type.mjs";
8
- import { ApplicationIcons } from "../../appearance/Icons.mjs";
9
- import { formatDateTime } from "../../utils/Format.mjs";
10
-
11
- /**
12
- * Renders the SampleInitEventView component.
13
- *
14
- * @param {Object} props - The properties passed to the component.
15
- * @param { string } props.id - The id of this event.
16
- * @param {import("../../types/log").SampleInitEvent} props.event - The event object to display.
17
- * @param {Object} props.style - The style for this view
18
- * @param {import("./Types.mjs").TranscriptEventState} props.eventState - The state for this event
19
- * @param {(state: import("./Types.mjs").TranscriptEventState) => void} props.setEventState - Update the state for this event
20
- * @returns {import("preact").JSX.Element} The component.
21
- */
22
- export const SampleInitEventView = ({
23
- id,
24
- event,
25
- style,
26
- eventState,
27
- setEventState,
28
- }) => {
29
- /**
30
- * @type {Record<string, unknown>}
31
- */
32
- //@ts-ignore
33
- const stateObj = event.state;
34
-
35
- const sections = [];
36
-
37
- if (event.sample.files && Object.keys(event.sample.files).length > 0) {
38
- sections.push(html`<${EventSection} title="Files">
39
- ${Object.keys(event.sample.files).map((file) => {
40
- return html`<pre style=${{ marginBottom: "0" }}>${file}</pre>`;
41
- })}
42
- </${EventSection}>
43
- `);
44
- }
45
-
46
- if (event.sample.setup) {
47
- sections.push(html`<${EventSection} title="Setup">
48
- <pre style=${{ background: "var(--bs-light)", borderRadius: "var(--bs-border-radius)" }}><code class="sourceCode" >${event.sample.setup}</code></pre>
49
- </${EventSection}>
50
- `);
51
- }
52
-
53
- return html`
54
- <${EventPanel}
55
- id=${id}
56
- style=${style}
57
- title="Sample"
58
- icon=${ApplicationIcons.sample}
59
- subTitle=${formatDateTime(new Date(event.timestamp))}
60
- selectedNav=${eventState.selectedNav || ""}
61
- onSelectedNav=${(selectedNav) => {
62
- setEventState({ ...eventState, selectedNav });
63
- }}
64
- collapsed=${eventState.collapsed}
65
- onCollapsed=${(collapsed) => {
66
- setEventState({ ...eventState, collapsed });
67
- }}
68
- >
69
- <div name="Sample" style=${{ margin: "1em 0em" }}>
70
- <${ChatView} messages=${stateObj["messages"]}/>
71
- <div>
72
- ${
73
- event.sample.choices
74
- ? event.sample.choices.map((choice, index) => {
75
- return html`<div>
76
- ${String.fromCharCode(65 + index)}) ${choice}
77
- </div>`;
78
- })
79
- : ""
80
- }
81
- ${
82
- sections.length > 0
83
- ? html`
84
- <div
85
- style=${{
86
- display: "flex",
87
- flexWrap: "wrap",
88
- gap: "1em",
89
- overflowWrap: "break-word",
90
- }}
91
- >
92
- ${sections}
93
- </div>
94
- `
95
- : ""
96
- }
97
- <${EventSection} title="Target">
98
- ${toArray(event.sample.target).map((target) => {
99
- return html`<div>${target}</div>`;
100
- })}
101
- </${EventSection}>
102
- </div>
103
- </div>
104
- ${event.sample.metadata && Object.keys(event.sample.metadata).length > 0 ? html`<${MetaDataGrid} name="Metadata" style=${{ margin: "0.5em 0" }} entries=${event.sample.metadata} />` : ""}
105
-
106
- </${EventPanel}>`;
107
- };
@@ -1,74 +0,0 @@
1
- // @ts-check
2
- import { html } from "htm/preact";
3
- import { ApplicationIcons } from "../../appearance/Icons.mjs";
4
- import { EventPanel } from "./EventPanel.mjs";
5
-
6
- /**
7
- * Renders the InfoEventView component.
8
- *
9
- * @param {Object} props - The properties passed to the component.
10
- * @param { string } props.id - The id of this event.
11
- * @param { Object } props.style - The style of this event.
12
- * @param {import("../../types/log").SampleLimitEvent} props.event - The event object to display.
13
- * @param {import("./Types.mjs").TranscriptEventState} props.eventState - The state for this event
14
- * @param {(state: import("./Types.mjs").TranscriptEventState) => void} props.setEventState - Update the state for this event
15
- * @returns {import("preact").JSX.Element} The component.
16
- */
17
- export const SampleLimitEventView = ({
18
- id,
19
- event,
20
- eventState,
21
- setEventState,
22
- style,
23
- }) => {
24
- const resolve_title = (type) => {
25
- switch (type) {
26
- case "context":
27
- return "Context Limit Exceeded";
28
- case "time":
29
- return "Time Limit Execeeded";
30
- case "message":
31
- return "Message Limit Exceeded";
32
- case "token":
33
- return "Token Limit Exceeded";
34
- case "operator":
35
- return "Operator Canceled";
36
- }
37
- };
38
-
39
- const resolve_icon = (type) => {
40
- switch (type) {
41
- case "context":
42
- return ApplicationIcons.limits.context;
43
- case "time":
44
- return ApplicationIcons.limits.time;
45
- case "message":
46
- return ApplicationIcons.limits.messages;
47
- case "token":
48
- return ApplicationIcons.limits.tokens;
49
- case "operator":
50
- return ApplicationIcons.limits.operator;
51
- }
52
- };
53
-
54
- const title = resolve_title(event.type);
55
- const icon = resolve_icon(event.type);
56
-
57
- return html`
58
- <${EventPanel}
59
- id=${id}
60
- title=${title}
61
- icon=${icon}
62
- style=${style}
63
- selectedNav=${eventState.selectedNav || ""}
64
- onSelectedNav=${(selectedNav) => {
65
- setEventState({ ...eventState, selectedNav });
66
- }}
67
- collapsed=${eventState.collapsed}
68
- onCollapsed=${(collapsed) => {
69
- setEventState({ ...eventState, collapsed });
70
- }}
71
- >
72
- ${event.message}
73
- </${EventPanel}>`;
74
- };