inspect-ai 0.3.95__py3-none-any.whl → 0.3.97__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 (142) hide show
  1. inspect_ai/_eval/eval.py +10 -2
  2. inspect_ai/_eval/task/util.py +32 -3
  3. inspect_ai/_util/local_server.py +16 -0
  4. inspect_ai/_util/registry.py +7 -0
  5. inspect_ai/_util/timer.py +13 -0
  6. inspect_ai/_view/www/dist/assets/index.css +275 -195
  7. inspect_ai/_view/www/dist/assets/index.js +8568 -7376
  8. inspect_ai/_view/www/src/app/App.css +1 -0
  9. inspect_ai/_view/www/src/app/App.tsx +27 -10
  10. inspect_ai/_view/www/src/app/appearance/icons.ts +5 -0
  11. inspect_ai/_view/www/src/app/content/RecordTree.module.css +22 -0
  12. inspect_ai/_view/www/src/app/content/RecordTree.tsx +370 -0
  13. inspect_ai/_view/www/src/app/content/RenderedContent.module.css +5 -0
  14. inspect_ai/_view/www/src/app/content/RenderedContent.tsx +32 -19
  15. inspect_ai/_view/www/src/app/content/record_processors/store.ts +101 -0
  16. inspect_ai/_view/www/src/app/content/record_processors/types.ts +3 -0
  17. inspect_ai/_view/www/src/app/content/types.ts +5 -0
  18. inspect_ai/_view/www/src/app/log-view/LogView.tsx +1 -0
  19. inspect_ai/_view/www/src/app/log-view/LogViewContainer.tsx +35 -28
  20. inspect_ai/_view/www/src/app/log-view/LogViewLayout.tsx +1 -8
  21. inspect_ai/_view/www/src/app/log-view/navbar/PrimaryBar.tsx +2 -4
  22. inspect_ai/_view/www/src/app/log-view/navbar/ResultsPanel.tsx +13 -3
  23. inspect_ai/_view/www/src/app/log-view/navbar/ScoreGrid.module.css +15 -0
  24. inspect_ai/_view/www/src/app/log-view/navbar/ScoreGrid.tsx +14 -10
  25. inspect_ai/_view/www/src/app/log-view/tabs/InfoTab.tsx +9 -3
  26. inspect_ai/_view/www/src/app/log-view/tabs/JsonTab.tsx +1 -3
  27. inspect_ai/_view/www/src/app/log-view/tabs/SamplesTab.tsx +8 -2
  28. inspect_ai/_view/www/src/app/log-view/types.ts +1 -0
  29. inspect_ai/_view/www/src/app/plan/ModelCard.module.css +7 -0
  30. inspect_ai/_view/www/src/app/plan/ModelCard.tsx +5 -2
  31. inspect_ai/_view/www/src/app/plan/PlanCard.tsx +13 -8
  32. inspect_ai/_view/www/src/app/routing/navigationHooks.ts +63 -8
  33. inspect_ai/_view/www/src/app/routing/url.ts +45 -0
  34. inspect_ai/_view/www/src/app/samples/InlineSampleDisplay.module.css +2 -1
  35. inspect_ai/_view/www/src/app/samples/InlineSampleDisplay.tsx +15 -8
  36. inspect_ai/_view/www/src/app/samples/SampleDialog.module.css +3 -0
  37. inspect_ai/_view/www/src/app/samples/SampleDialog.tsx +16 -5
  38. inspect_ai/_view/www/src/app/samples/SampleDisplay.module.css +9 -1
  39. inspect_ai/_view/www/src/app/samples/SampleDisplay.tsx +68 -31
  40. inspect_ai/_view/www/src/app/samples/chat/ChatMessage.module.css +12 -7
  41. inspect_ai/_view/www/src/app/samples/chat/ChatMessage.tsx +17 -5
  42. inspect_ai/_view/www/src/app/samples/chat/ChatMessageRow.module.css +9 -0
  43. inspect_ai/_view/www/src/app/samples/chat/ChatMessageRow.tsx +48 -18
  44. inspect_ai/_view/www/src/app/samples/chat/ChatView.tsx +0 -1
  45. inspect_ai/_view/www/src/app/samples/chat/ChatViewVirtualList.module.css +4 -0
  46. inspect_ai/_view/www/src/app/samples/chat/ChatViewVirtualList.tsx +41 -1
  47. inspect_ai/_view/www/src/app/samples/chat/messages.ts +7 -0
  48. inspect_ai/_view/www/src/app/samples/chat/tools/ToolCallView.module.css +0 -3
  49. inspect_ai/_view/www/src/app/samples/chat/tools/ToolCallView.tsx +1 -1
  50. inspect_ai/_view/www/src/app/samples/chat/tools/ToolInput.module.css +1 -1
  51. inspect_ai/_view/www/src/app/samples/chat/tools/ToolOutput.module.css +1 -1
  52. inspect_ai/_view/www/src/app/samples/descriptor/score/NumericScoreDescriptor.tsx +5 -1
  53. inspect_ai/_view/www/src/app/samples/descriptor/score/PassFailScoreDescriptor.tsx +11 -6
  54. inspect_ai/_view/www/src/app/samples/list/SampleList.tsx +7 -0
  55. inspect_ai/_view/www/src/app/samples/list/SampleRow.tsx +5 -18
  56. inspect_ai/_view/www/src/app/samples/sample-tools/SortFilter.tsx +1 -1
  57. inspect_ai/_view/www/src/app/samples/scores/SampleScoresGrid.tsx +18 -5
  58. inspect_ai/_view/www/src/app/samples/scores/SampleScoresView.module.css +0 -6
  59. inspect_ai/_view/www/src/app/samples/scores/SampleScoresView.tsx +4 -1
  60. inspect_ai/_view/www/src/app/samples/transcript/ApprovalEventView.tsx +4 -2
  61. inspect_ai/_view/www/src/app/samples/transcript/ErrorEventView.tsx +6 -4
  62. inspect_ai/_view/www/src/app/samples/transcript/InfoEventView.module.css +1 -1
  63. inspect_ai/_view/www/src/app/samples/transcript/InfoEventView.tsx +13 -6
  64. inspect_ai/_view/www/src/app/samples/transcript/InputEventView.tsx +6 -4
  65. inspect_ai/_view/www/src/app/samples/transcript/LoggerEventView.tsx +4 -2
  66. inspect_ai/_view/www/src/app/samples/transcript/ModelEventView.tsx +11 -8
  67. inspect_ai/_view/www/src/app/samples/transcript/SampleInitEventView.tsx +14 -8
  68. inspect_ai/_view/www/src/app/samples/transcript/SampleLimitEventView.tsx +13 -8
  69. inspect_ai/_view/www/src/app/samples/transcript/SandboxEventView.tsx +25 -16
  70. inspect_ai/_view/www/src/app/samples/transcript/ScoreEventView.tsx +7 -5
  71. inspect_ai/_view/www/src/app/samples/transcript/SpanEventView.tsx +11 -28
  72. inspect_ai/_view/www/src/app/samples/transcript/StepEventView.tsx +12 -20
  73. inspect_ai/_view/www/src/app/samples/transcript/SubtaskEventView.tsx +12 -31
  74. inspect_ai/_view/www/src/app/samples/transcript/ToolEventView.tsx +25 -29
  75. inspect_ai/_view/www/src/app/samples/transcript/TranscriptVirtualList.tsx +297 -0
  76. inspect_ai/_view/www/src/app/samples/transcript/TranscriptVirtualListComponent.module.css +0 -8
  77. inspect_ai/_view/www/src/app/samples/transcript/TranscriptVirtualListComponent.tsx +43 -25
  78. inspect_ai/_view/www/src/app/samples/transcript/event/EventPanel.module.css +43 -0
  79. inspect_ai/_view/www/src/app/samples/transcript/event/EventPanel.tsx +109 -43
  80. inspect_ai/_view/www/src/app/samples/transcript/state/StateEventView.tsx +19 -8
  81. inspect_ai/_view/www/src/app/samples/transcript/transform/treeify.ts +128 -60
  82. inspect_ai/_view/www/src/app/samples/transcript/transform/utils.ts +14 -4
  83. inspect_ai/_view/www/src/app/samples/transcript/types.ts +6 -4
  84. inspect_ai/_view/www/src/app/types.ts +12 -1
  85. inspect_ai/_view/www/src/components/Card.css +6 -3
  86. inspect_ai/_view/www/src/components/Card.tsx +15 -2
  87. inspect_ai/_view/www/src/components/CopyButton.tsx +4 -6
  88. inspect_ai/_view/www/src/components/ExpandablePanel.module.css +20 -14
  89. inspect_ai/_view/www/src/components/ExpandablePanel.tsx +17 -22
  90. inspect_ai/_view/www/src/components/LargeModal.tsx +5 -1
  91. inspect_ai/_view/www/src/components/LiveVirtualList.tsx +25 -1
  92. inspect_ai/_view/www/src/components/MarkdownDiv.css +4 -0
  93. inspect_ai/_view/www/src/components/MarkdownDiv.tsx +2 -2
  94. inspect_ai/_view/www/src/components/TabSet.module.css +6 -1
  95. inspect_ai/_view/www/src/components/TabSet.tsx +8 -2
  96. inspect_ai/_view/www/src/state/hooks.ts +83 -13
  97. inspect_ai/_view/www/src/state/logPolling.ts +2 -2
  98. inspect_ai/_view/www/src/state/logSlice.ts +1 -2
  99. inspect_ai/_view/www/src/state/logsSlice.ts +9 -9
  100. inspect_ai/_view/www/src/state/samplePolling.ts +1 -1
  101. inspect_ai/_view/www/src/state/sampleSlice.ts +134 -7
  102. inspect_ai/_view/www/src/state/scoring.ts +1 -1
  103. inspect_ai/_view/www/src/state/scrolling.ts +39 -6
  104. inspect_ai/_view/www/src/state/store.ts +5 -0
  105. inspect_ai/_view/www/src/state/store_filter.ts +47 -44
  106. inspect_ai/_view/www/src/utils/debugging.ts +95 -0
  107. inspect_ai/_view/www/src/utils/format.ts +2 -2
  108. inspect_ai/_view/www/src/utils/json.ts +29 -0
  109. inspect_ai/agent/__init__.py +2 -1
  110. inspect_ai/agent/_agent.py +12 -0
  111. inspect_ai/agent/_react.py +184 -48
  112. inspect_ai/agent/_types.py +15 -2
  113. inspect_ai/analysis/beta/__init__.py +11 -3
  114. inspect_ai/analysis/beta/_dataframe/columns.py +11 -16
  115. inspect_ai/analysis/beta/_dataframe/evals/table.py +101 -39
  116. inspect_ai/analysis/beta/_dataframe/events/columns.py +50 -0
  117. inspect_ai/analysis/beta/_dataframe/events/extract.py +26 -0
  118. inspect_ai/analysis/beta/_dataframe/events/table.py +77 -3
  119. inspect_ai/analysis/beta/_dataframe/extract.py +44 -25
  120. inspect_ai/analysis/beta/_dataframe/messages/columns.py +1 -1
  121. inspect_ai/analysis/beta/_dataframe/messages/table.py +30 -29
  122. inspect_ai/analysis/beta/_dataframe/progress.py +56 -0
  123. inspect_ai/analysis/beta/_dataframe/record.py +13 -9
  124. inspect_ai/analysis/beta/_dataframe/samples/columns.py +8 -4
  125. inspect_ai/analysis/beta/_dataframe/samples/extract.py +5 -33
  126. inspect_ai/analysis/beta/_dataframe/samples/table.py +211 -60
  127. inspect_ai/analysis/beta/_dataframe/util.py +33 -28
  128. inspect_ai/log/_file.py +9 -2
  129. inspect_ai/model/_call_tools.py +1 -1
  130. inspect_ai/model/_providers/anthropic.py +18 -5
  131. inspect_ai/model/_providers/azureai.py +7 -2
  132. inspect_ai/model/_providers/util/llama31.py +3 -3
  133. inspect_ai/solver/_task_state.py +1 -1
  134. inspect_ai/tool/_mcp/_sandbox.py +17 -14
  135. {inspect_ai-0.3.95.dist-info → inspect_ai-0.3.97.dist-info}/METADATA +2 -2
  136. {inspect_ai-0.3.95.dist-info → inspect_ai-0.3.97.dist-info}/RECORD +140 -133
  137. {inspect_ai-0.3.95.dist-info → inspect_ai-0.3.97.dist-info}/WHEEL +1 -1
  138. inspect_ai/_view/www/src/app/samples/transcript/TranscriptView.module.css +0 -48
  139. inspect_ai/_view/www/src/app/samples/transcript/TranscriptView.tsx +0 -276
  140. {inspect_ai-0.3.95.dist-info → inspect_ai-0.3.97.dist-info}/entry_points.txt +0 -0
  141. {inspect_ai-0.3.95.dist-info → inspect_ai-0.3.97.dist-info}/licenses/LICENSE +0 -0
  142. {inspect_ai-0.3.95.dist-info → inspect_ai-0.3.97.dist-info}/top_level.txt +0 -0
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.4.0)
2
+ Generator: setuptools (80.7.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,48 +0,0 @@
1
- .darkenedBg {
2
- background-color: var(--bs-light-bg-subtle);
3
- }
4
-
5
- .normalBg {
6
- background-color: var(--bs-body-bg);
7
- }
8
-
9
- .node {
10
- padding-top: 0;
11
- padding-bottom: 0.65em;
12
- }
13
-
14
- .nodes {
15
- width: 100%;
16
- margin-top: 1em;
17
- }
18
-
19
- .transcriptComponent {
20
- display: grid;
21
- margin: 0 0 0 0;
22
- width: 100%;
23
- }
24
-
25
- .eventNode {
26
- background-color: var(--bs-body-bg);
27
- }
28
-
29
- .eventNode.darkenBg {
30
- background-color: var(--bs-light-bg-subtle);
31
- }
32
-
33
- .eventNode.lastNode {
34
- margin-bottom: 0;
35
- }
36
-
37
- .eventNodeContainer {
38
- padding-top: 0.7em;
39
- }
40
-
41
- .eventNodeContainer.noBottom {
42
- padding-bottom: 0;
43
- }
44
-
45
- .attached {
46
- padding-top: 0rem;
47
- margin-top: -8px;
48
- }
@@ -1,276 +0,0 @@
1
- import { FC, JSX, memo, RefObject, useMemo } from "react";
2
- import { Events } from "../../../@types/log";
3
- import { ApprovalEventView } from "./ApprovalEventView";
4
- import { ErrorEventView } from "./ErrorEventView";
5
- import { InfoEventView } from "./InfoEventView";
6
- import { InputEventView } from "./InputEventView";
7
- import { LoggerEventView } from "./LoggerEventView";
8
- import { ModelEventView } from "./ModelEventView";
9
- import { SampleInitEventView } from "./SampleInitEventView";
10
- import { SampleLimitEventView } from "./SampleLimitEventView";
11
- import { SandboxEventView } from "./SandboxEventView";
12
- import { ScoreEventView } from "./ScoreEventView";
13
- import { StateEventView } from "./state/StateEventView";
14
- import { StepEventView } from "./StepEventView";
15
- import { SubtaskEventView } from "./SubtaskEventView";
16
- import { ToolEventView } from "./ToolEventView";
17
- import { EventNode } from "./types";
18
-
19
- import clsx from "clsx";
20
- import { SpanEventView } from "./SpanEventView";
21
- import styles from "./TranscriptView.module.css";
22
- import { TranscriptVirtualListComponent } from "./TranscriptVirtualListComponent";
23
- import { fixupEventStream } from "./transform/fixups";
24
- import { treeifyEvents } from "./transform/treeify";
25
-
26
- interface TranscriptViewProps {
27
- id: string;
28
- events: Events;
29
- depth: number;
30
- }
31
-
32
- /**
33
- * Renders the TranscriptView component.
34
- */
35
- export const TranscriptView: FC<TranscriptViewProps> = ({
36
- id,
37
- events,
38
- depth,
39
- }) => {
40
- // Normalize Events themselves
41
- const resolvedEvents = fixupEventStream(events);
42
- const eventNodes = treeifyEvents(
43
- resolvedEvents,
44
- depth !== undefined ? depth : 0,
45
- );
46
- return <TranscriptComponent id={id} eventNodes={eventNodes} />;
47
- };
48
-
49
- interface TranscriptVirtualListProps {
50
- id: string;
51
- events: Events;
52
- depth?: number;
53
- scrollRef: RefObject<HTMLDivElement | null>;
54
- running?: boolean;
55
- }
56
-
57
- /**
58
- * Renders the Transcript Virtual List.
59
- */
60
- export const TranscriptVirtualList: FC<TranscriptVirtualListProps> = memo(
61
- (props) => {
62
- let { id, scrollRef, events, depth, running } = props;
63
-
64
- // Normalize Events themselves
65
- const eventNodes = useMemo(() => {
66
- const resolvedEvents = fixupEventStream(events, !running);
67
- const eventNodes = treeifyEvents(resolvedEvents, depth || 0);
68
- return eventNodes;
69
- }, [events, depth]);
70
-
71
- return (
72
- <TranscriptVirtualListComponent
73
- id={id}
74
- eventNodes={eventNodes}
75
- scrollRef={scrollRef}
76
- running={running}
77
- />
78
- );
79
- },
80
- );
81
-
82
- interface TranscriptComponentProps {
83
- id: string;
84
- eventNodes: EventNode[];
85
- }
86
- /**
87
- * Renders the Transcript component.
88
- */
89
- export const TranscriptComponent: FC<TranscriptComponentProps> = memo(
90
- ({ id, eventNodes }) => {
91
- const rows: JSX.Element[] = [];
92
-
93
- let attached = false;
94
- for (let i = 0; i < eventNodes.length; i++) {
95
- const eventNode = eventNodes[i];
96
- const clz = [styles.eventNode];
97
- const containerClz = [];
98
-
99
- if (eventNode.event.event !== "tool") {
100
- attached = false;
101
- }
102
-
103
- // Special handling for toggling color
104
- if (eventNode.depth % 2 == 0) {
105
- clz.push(styles.darkenBg);
106
- }
107
-
108
- // Note last node
109
- if (i === eventNodes.length - 1) {
110
- clz.push(styles.lastNode);
111
- }
112
-
113
- if (attached) {
114
- containerClz.push(styles.attached);
115
- }
116
-
117
- const eventId = `${id}|event|${i}`;
118
- const row = (
119
- <div
120
- key={eventId}
121
- className={clsx(
122
- styles.eventNodeContainer,
123
- i === eventNodes.length - 1 ? styles.noBottom : undefined,
124
- containerClz,
125
- )}
126
- >
127
- <RenderedEventNode
128
- id={eventId}
129
- node={eventNode}
130
- className={clsx(clz)}
131
- />
132
- </div>
133
- );
134
- rows.push(row);
135
-
136
- if (eventNode.event.event === "model") {
137
- attached = true;
138
- }
139
- }
140
-
141
- return (
142
- <div
143
- id={id}
144
- className={clsx("text-size-small", styles.transcriptComponent)}
145
- >
146
- {rows}
147
- </div>
148
- );
149
- },
150
- );
151
-
152
- interface RenderedEventNodeProps {
153
- id: string;
154
- node: EventNode;
155
- className?: string | string[];
156
- }
157
- /**
158
- * Renders the event based on its type.
159
- */
160
- export const RenderedEventNode: FC<RenderedEventNodeProps> = memo(
161
- ({ id, node, className }) => {
162
- switch (node.event.event) {
163
- case "sample_init":
164
- return (
165
- <SampleInitEventView
166
- id={id}
167
- event={node.event}
168
- className={className}
169
- />
170
- );
171
-
172
- case "sample_limit":
173
- return (
174
- <SampleLimitEventView
175
- id={id}
176
- event={node.event}
177
- className={className}
178
- />
179
- );
180
-
181
- case "info":
182
- return (
183
- <InfoEventView id={id} event={node.event} className={className} />
184
- );
185
-
186
- case "logger":
187
- return <LoggerEventView event={node.event} className={className} />;
188
-
189
- case "model":
190
- return (
191
- <ModelEventView id={id} event={node.event} className={className} />
192
- );
193
-
194
- case "score":
195
- return (
196
- <ScoreEventView id={id} event={node.event} className={className} />
197
- );
198
-
199
- case "state":
200
- return (
201
- <StateEventView id={id} event={node.event} className={className} />
202
- );
203
-
204
- case "span_begin":
205
- return (
206
- <SpanEventView
207
- id={id}
208
- event={node.event}
209
- children={node.children}
210
- className={className}
211
- />
212
- );
213
-
214
- case "step":
215
- return (
216
- <StepEventView
217
- id={id}
218
- event={node.event}
219
- children={node.children}
220
- className={className}
221
- />
222
- );
223
-
224
- case "store":
225
- return (
226
- <StateEventView
227
- id={id}
228
- event={node.event}
229
- className={className}
230
- isStore={true}
231
- />
232
- );
233
-
234
- case "subtask":
235
- return (
236
- <SubtaskEventView
237
- id={id}
238
- event={node.event}
239
- className={className}
240
- depth={node.depth}
241
- />
242
- );
243
-
244
- case "tool":
245
- return (
246
- <ToolEventView
247
- id={id}
248
- event={node.event}
249
- className={className}
250
- children={node.children}
251
- />
252
- );
253
-
254
- case "input":
255
- return (
256
- <InputEventView id={id} event={node.event} className={className} />
257
- );
258
-
259
- case "error":
260
- return (
261
- <ErrorEventView id={id} event={node.event} className={className} />
262
- );
263
-
264
- case "approval":
265
- return <ApprovalEventView event={node.event} className={className} />;
266
-
267
- case "sandbox":
268
- return (
269
- <SandboxEventView id={id} event={node.event} className={className} />
270
- );
271
-
272
- default:
273
- return null;
274
- }
275
- },
276
- );