inspect-ai 0.3.74__py3-none-any.whl → 0.3.76__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- inspect_ai/__init__.py +3 -2
- inspect_ai/_cli/cache.py +1 -1
- inspect_ai/_cli/common.py +15 -0
- inspect_ai/_cli/eval.py +4 -5
- inspect_ai/_cli/log.py +1 -1
- inspect_ai/_cli/sandbox.py +1 -1
- inspect_ai/_cli/trace.py +1 -1
- inspect_ai/_cli/view.py +1 -1
- inspect_ai/_display/core/config.py +3 -1
- inspect_ai/_eval/eval.py +55 -61
- inspect_ai/_eval/evalset.py +64 -154
- inspect_ai/_eval/loader.py +27 -54
- inspect_ai/_eval/registry.py +4 -15
- inspect_ai/_eval/run.py +7 -4
- inspect_ai/_eval/task/__init__.py +8 -2
- inspect_ai/_eval/task/log.py +9 -1
- inspect_ai/_eval/task/resolved.py +35 -0
- inspect_ai/_eval/task/run.py +4 -0
- inspect_ai/_eval/task/task.py +50 -69
- inspect_ai/_eval/task/tasks.py +30 -0
- inspect_ai/_util/constants.py +3 -0
- inspect_ai/_util/dotenv.py +17 -0
- inspect_ai/_util/logger.py +3 -0
- inspect_ai/_util/registry.py +43 -2
- inspect_ai/_view/server.py +28 -10
- inspect_ai/_view/www/dist/assets/index.css +32 -19
- inspect_ai/_view/www/dist/assets/index.js +17682 -29989
- inspect_ai/_view/www/log-schema.json +79 -9
- inspect_ai/_view/www/package.json +2 -2
- inspect_ai/_view/www/src/appearance/styles.ts +6 -5
- inspect_ai/_view/www/src/components/AnsiDisplay.tsx +2 -2
- inspect_ai/_view/www/src/constants.ts +3 -0
- inspect_ai/_view/www/src/logfile/remoteZipFile.ts +141 -20
- inspect_ai/_view/www/src/plan/PlanDetailView.tsx +2 -1
- inspect_ai/_view/www/src/samples/SampleSummaryView.tsx +1 -1
- inspect_ai/_view/www/src/samples/chat/tools/tool.ts +7 -5
- inspect_ai/_view/www/src/samples/descriptor/score/CategoricalScoreDescriptor.tsx +1 -1
- inspect_ai/_view/www/src/samples/descriptor/score/NumericScoreDescriptor.tsx +2 -2
- inspect_ai/_view/www/src/samples/error/FlatSampleErrorView.module.css +1 -0
- inspect_ai/_view/www/src/samples/error/FlatSampleErrorView.tsx +3 -1
- inspect_ai/_view/www/src/samples/sample-tools/SortFilter.tsx +1 -1
- inspect_ai/_view/www/src/samples/sample-tools/sample-filter/SampleFilter.tsx +5 -2
- inspect_ai/_view/www/src/samples/transcript/ModelEventView.module.css +2 -2
- inspect_ai/_view/www/src/samples/transcript/state/StateEventView.tsx +5 -1
- inspect_ai/_view/www/src/types/log.d.ts +11 -5
- inspect_ai/_view/www/src/workspace/navbar/PrimaryBar.tsx +17 -12
- inspect_ai/_view/www/src/workspace/sidebar/SidebarLogEntry.tsx +2 -1
- inspect_ai/_view/www/yarn.lock +12 -5
- inspect_ai/log/_log.py +10 -1
- inspect_ai/log/_recorders/eval.py +27 -8
- inspect_ai/log/_recorders/json.py +10 -2
- inspect_ai/log/_transcript.py +13 -4
- inspect_ai/model/_call_tools.py +13 -4
- inspect_ai/model/_chat_message.py +15 -1
- inspect_ai/model/_model.py +30 -12
- inspect_ai/model/_model_output.py +6 -1
- inspect_ai/model/_openai.py +11 -6
- inspect_ai/model/_providers/anthropic.py +167 -77
- inspect_ai/model/_providers/google.py +6 -2
- inspect_ai/model/_providers/none.py +31 -0
- inspect_ai/model/_providers/openai.py +11 -8
- inspect_ai/model/_providers/providers.py +7 -0
- inspect_ai/model/_providers/vertex.py +5 -2
- inspect_ai/solver/_bridge/bridge.py +1 -1
- inspect_ai/solver/_chain.py +7 -6
- inspect_ai/tool/__init__.py +4 -0
- inspect_ai/tool/_tool_call.py +5 -2
- inspect_ai/tool/_tool_support_helpers.py +200 -0
- inspect_ai/tool/_tools/_bash_session.py +119 -0
- inspect_ai/tool/_tools/_computer/_computer.py +1 -1
- inspect_ai/tool/_tools/_text_editor.py +121 -0
- inspect_ai/tool/_tools/_web_browser/_back_compat.py +150 -0
- inspect_ai/tool/_tools/_web_browser/_web_browser.py +75 -130
- inspect_ai/tool/_tools/_web_search.py +2 -2
- inspect_ai/util/_json.py +28 -0
- inspect_ai/util/_sandbox/context.py +18 -8
- inspect_ai/util/_sandbox/docker/config.py +1 -1
- inspect_ai/util/_sandbox/docker/internal.py +3 -3
- inspect_ai/util/_sandbox/environment.py +17 -2
- {inspect_ai-0.3.74.dist-info → inspect_ai-0.3.76.dist-info}/METADATA +8 -5
- {inspect_ai-0.3.74.dist-info → inspect_ai-0.3.76.dist-info}/RECORD +85 -108
- {inspect_ai-0.3.74.dist-info → inspect_ai-0.3.76.dist-info}/WHEEL +1 -1
- inspect_ai/tool/_tools/_web_browser/_resources/.pylintrc +0 -8
- inspect_ai/tool/_tools/_web_browser/_resources/.vscode/launch.json +0 -24
- inspect_ai/tool/_tools/_web_browser/_resources/.vscode/settings.json +0 -25
- inspect_ai/tool/_tools/_web_browser/_resources/Dockerfile +0 -22
- inspect_ai/tool/_tools/_web_browser/_resources/README.md +0 -63
- inspect_ai/tool/_tools/_web_browser/_resources/accessibility_tree.py +0 -71
- inspect_ai/tool/_tools/_web_browser/_resources/accessibility_tree_node.py +0 -323
- inspect_ai/tool/_tools/_web_browser/_resources/cdp/__init__.py +0 -5
- inspect_ai/tool/_tools/_web_browser/_resources/cdp/a11y.py +0 -279
- inspect_ai/tool/_tools/_web_browser/_resources/cdp/dom.py +0 -9
- inspect_ai/tool/_tools/_web_browser/_resources/cdp/dom_snapshot.py +0 -293
- inspect_ai/tool/_tools/_web_browser/_resources/cdp/page.py +0 -94
- inspect_ai/tool/_tools/_web_browser/_resources/constants.py +0 -2
- inspect_ai/tool/_tools/_web_browser/_resources/images/usage_diagram.svg +0 -2
- inspect_ai/tool/_tools/_web_browser/_resources/mock_environment.py +0 -45
- inspect_ai/tool/_tools/_web_browser/_resources/playwright_browser.py +0 -50
- inspect_ai/tool/_tools/_web_browser/_resources/playwright_crawler.py +0 -48
- inspect_ai/tool/_tools/_web_browser/_resources/playwright_page_crawler.py +0 -280
- inspect_ai/tool/_tools/_web_browser/_resources/pyproject.toml +0 -65
- inspect_ai/tool/_tools/_web_browser/_resources/rectangle.py +0 -64
- inspect_ai/tool/_tools/_web_browser/_resources/rpc_client_helpers.py +0 -146
- inspect_ai/tool/_tools/_web_browser/_resources/scale_factor.py +0 -64
- inspect_ai/tool/_tools/_web_browser/_resources/test_accessibility_tree_node.py +0 -180
- inspect_ai/tool/_tools/_web_browser/_resources/test_playwright_crawler.py +0 -99
- inspect_ai/tool/_tools/_web_browser/_resources/test_rectangle.py +0 -15
- inspect_ai/tool/_tools/_web_browser/_resources/test_web_client.py +0 -44
- inspect_ai/tool/_tools/_web_browser/_resources/web_browser_rpc_types.py +0 -39
- inspect_ai/tool/_tools/_web_browser/_resources/web_client.py +0 -214
- inspect_ai/tool/_tools/_web_browser/_resources/web_client_new_session.py +0 -35
- inspect_ai/tool/_tools/_web_browser/_resources/web_server.py +0 -192
- {inspect_ai-0.3.74.dist-info → inspect_ai-0.3.76.dist-info}/entry_points.txt +0 -0
- {inspect_ai-0.3.74.dist-info → inspect_ai-0.3.76.dist-info/licenses}/LICENSE +0 -0
- {inspect_ai-0.3.74.dist-info → inspect_ai-0.3.76.dist-info}/top_level.txt +0 -0
@@ -200,8 +200,16 @@
|
|
200
200
|
"description": "Assistant chat message.",
|
201
201
|
"properties": {
|
202
202
|
"id": {
|
203
|
-
"
|
204
|
-
|
203
|
+
"anyOf": [
|
204
|
+
{
|
205
|
+
"type": "string"
|
206
|
+
},
|
207
|
+
{
|
208
|
+
"type": "null"
|
209
|
+
}
|
210
|
+
],
|
211
|
+
"default": null,
|
212
|
+
"title": "Id"
|
205
213
|
},
|
206
214
|
"content": {
|
207
215
|
"anyOf": [
|
@@ -286,8 +294,16 @@
|
|
286
294
|
"description": "System chat message.",
|
287
295
|
"properties": {
|
288
296
|
"id": {
|
289
|
-
"
|
290
|
-
|
297
|
+
"anyOf": [
|
298
|
+
{
|
299
|
+
"type": "string"
|
300
|
+
},
|
301
|
+
{
|
302
|
+
"type": "null"
|
303
|
+
}
|
304
|
+
],
|
305
|
+
"default": null,
|
306
|
+
"title": "Id"
|
291
307
|
},
|
292
308
|
"content": {
|
293
309
|
"anyOf": [
|
@@ -356,8 +372,16 @@
|
|
356
372
|
"description": "Tool chat message.",
|
357
373
|
"properties": {
|
358
374
|
"id": {
|
359
|
-
"
|
360
|
-
|
375
|
+
"anyOf": [
|
376
|
+
{
|
377
|
+
"type": "string"
|
378
|
+
},
|
379
|
+
{
|
380
|
+
"type": "null"
|
381
|
+
}
|
382
|
+
],
|
383
|
+
"default": null,
|
384
|
+
"title": "Id"
|
361
385
|
},
|
362
386
|
"content": {
|
363
387
|
"anyOf": [
|
@@ -435,6 +459,18 @@
|
|
435
459
|
"default": null,
|
436
460
|
"title": "Function"
|
437
461
|
},
|
462
|
+
"internal_name": {
|
463
|
+
"anyOf": [
|
464
|
+
{
|
465
|
+
"type": "string"
|
466
|
+
},
|
467
|
+
{
|
468
|
+
"type": "null"
|
469
|
+
}
|
470
|
+
],
|
471
|
+
"default": null,
|
472
|
+
"title": "Internal Name"
|
473
|
+
},
|
438
474
|
"error": {
|
439
475
|
"anyOf": [
|
440
476
|
{
|
@@ -454,6 +490,7 @@
|
|
454
490
|
"role",
|
455
491
|
"tool_call_id",
|
456
492
|
"function",
|
493
|
+
"internal_name",
|
457
494
|
"error"
|
458
495
|
],
|
459
496
|
"title": "ChatMessageTool",
|
@@ -464,8 +501,16 @@
|
|
464
501
|
"description": "User chat message.",
|
465
502
|
"properties": {
|
466
503
|
"id": {
|
467
|
-
"
|
468
|
-
|
504
|
+
"anyOf": [
|
505
|
+
{
|
506
|
+
"type": "string"
|
507
|
+
},
|
508
|
+
{
|
509
|
+
"type": "null"
|
510
|
+
}
|
511
|
+
],
|
512
|
+
"default": null,
|
513
|
+
"title": "Id"
|
469
514
|
},
|
470
515
|
"content": {
|
471
516
|
"anyOf": [
|
@@ -4431,10 +4476,21 @@
|
|
4431
4476
|
"type": "object"
|
4432
4477
|
},
|
4433
4478
|
"type": {
|
4434
|
-
"const": "function",
|
4435
4479
|
"title": "Type",
|
4436
4480
|
"type": "string"
|
4437
4481
|
},
|
4482
|
+
"internal_name": {
|
4483
|
+
"anyOf": [
|
4484
|
+
{
|
4485
|
+
"type": "string"
|
4486
|
+
},
|
4487
|
+
{
|
4488
|
+
"type": "null"
|
4489
|
+
}
|
4490
|
+
],
|
4491
|
+
"default": null,
|
4492
|
+
"title": "Internal Name"
|
4493
|
+
},
|
4438
4494
|
"parse_error": {
|
4439
4495
|
"anyOf": [
|
4440
4496
|
{
|
@@ -4464,6 +4520,7 @@
|
|
4464
4520
|
"function",
|
4465
4521
|
"arguments",
|
4466
4522
|
"type",
|
4523
|
+
"internal_name",
|
4467
4524
|
"parse_error",
|
4468
4525
|
"view"
|
4469
4526
|
],
|
@@ -4623,6 +4680,18 @@
|
|
4623
4680
|
"title": "Arguments",
|
4624
4681
|
"type": "object"
|
4625
4682
|
},
|
4683
|
+
"internal_name": {
|
4684
|
+
"anyOf": [
|
4685
|
+
{
|
4686
|
+
"type": "string"
|
4687
|
+
},
|
4688
|
+
{
|
4689
|
+
"type": "null"
|
4690
|
+
}
|
4691
|
+
],
|
4692
|
+
"default": null,
|
4693
|
+
"title": "Internal Name"
|
4694
|
+
},
|
4626
4695
|
"view": {
|
4627
4696
|
"anyOf": [
|
4628
4697
|
{
|
@@ -4809,6 +4878,7 @@
|
|
4809
4878
|
"id",
|
4810
4879
|
"function",
|
4811
4880
|
"arguments",
|
4881
|
+
"internal_name",
|
4812
4882
|
"view",
|
4813
4883
|
"result",
|
4814
4884
|
"truncated",
|
@@ -39,7 +39,7 @@
|
|
39
39
|
"vite": "^5.3.2"
|
40
40
|
},
|
41
41
|
"dependencies": {
|
42
|
-
"@codemirror/autocomplete": "^6.18.
|
42
|
+
"@codemirror/autocomplete": "^6.18.6",
|
43
43
|
"@codemirror/language": "^6.10.8",
|
44
44
|
"@codemirror/lint": "^6.8.4",
|
45
45
|
"@codemirror/state": "^6.5.2",
|
@@ -62,7 +62,7 @@
|
|
62
62
|
"markdown-it": "^14.1.0",
|
63
63
|
"murmurhash": "^2.0.1",
|
64
64
|
"postcss-url": "^10.1.3",
|
65
|
-
"prismjs": "^1.
|
65
|
+
"prismjs": "^1.30.0",
|
66
66
|
"react": "^19.0.0",
|
67
67
|
"react-dom": "^19.0.0",
|
68
68
|
"react-virtuoso": "^4.12.5"
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { CSSProperties } from "react";
|
1
2
|
import { FontSize, TextStyle } from "./fonts";
|
2
3
|
|
3
4
|
export const ApplicationStyles = {
|
@@ -9,15 +10,15 @@ export const ApplicationStyles = {
|
|
9
10
|
},
|
10
11
|
threeLineClamp: {
|
11
12
|
display: "-webkit-box",
|
12
|
-
|
13
|
-
|
13
|
+
WebkitLineClamp: "3",
|
14
|
+
WebkitBoxOrient: "vertical",
|
14
15
|
overflow: "hidden",
|
15
16
|
},
|
16
|
-
lineClamp: (len: number) => {
|
17
|
+
lineClamp: (len: number): CSSProperties => {
|
17
18
|
return {
|
18
19
|
display: "-webkit-box",
|
19
|
-
|
20
|
-
|
20
|
+
WebkitLineClamp: `${len}`,
|
21
|
+
WebkitBoxOrient: "vertical",
|
21
22
|
overflow: "hidden",
|
22
23
|
};
|
23
24
|
},
|
@@ -20,10 +20,10 @@ export const ANSIDisplay: FC<ANSIDisplayProps> = ({
|
|
20
20
|
let firstOutput = false;
|
21
21
|
return (
|
22
22
|
<div className={clsx("ansi-display", className)} style={{ ...style }}>
|
23
|
-
{ansiOutput.outputLines.map((line) => {
|
23
|
+
{ansiOutput.outputLines.map((line, index) => {
|
24
24
|
firstOutput = firstOutput || !!line.outputRuns.length;
|
25
25
|
return (
|
26
|
-
<div className={"ansi-display-line"}>
|
26
|
+
<div key={index} className={"ansi-display-line"}>
|
27
27
|
{!line.outputRuns.length ? (
|
28
28
|
firstOutput ? (
|
29
29
|
<br />
|
@@ -65,8 +65,54 @@ export const openRemoteZipFile = async (
|
|
65
65
|
);
|
66
66
|
const eocdrView = new DataView(eocdrBuffer.buffer);
|
67
67
|
|
68
|
-
|
69
|
-
|
68
|
+
// Check signature to make sure we found the EOCD record
|
69
|
+
if (eocdrView.getUint32(0, true) !== 0x06054b50) {
|
70
|
+
throw new Error("End of central directory record not found");
|
71
|
+
}
|
72
|
+
|
73
|
+
let centralDirOffset = eocdrView.getUint32(16, true);
|
74
|
+
let centralDirSize = eocdrView.getUint32(12, true);
|
75
|
+
|
76
|
+
// Check if we need to use ZIP64 format
|
77
|
+
const needsZip64 =
|
78
|
+
centralDirOffset === 0xffffffff || centralDirSize === 0xffffffff;
|
79
|
+
|
80
|
+
if (needsZip64) {
|
81
|
+
// We need to locate and read the ZIP64 EOCD record and locator
|
82
|
+
// First, read the ZIP64 EOCD locator which is just before the standard EOCD
|
83
|
+
// Standard EOCD (22 bytes) + Locator (20 bytes)
|
84
|
+
const locatorBuffer = await fetchBytes(
|
85
|
+
url,
|
86
|
+
contentLength - 22 - 20,
|
87
|
+
contentLength - 23,
|
88
|
+
);
|
89
|
+
const locatorView = new DataView(locatorBuffer.buffer);
|
90
|
+
|
91
|
+
// Verify the ZIP64 EOCD locator signature
|
92
|
+
if (locatorView.getUint32(0, true) !== 0x07064b50) {
|
93
|
+
throw new Error("ZIP64 End of central directory locator not found");
|
94
|
+
}
|
95
|
+
|
96
|
+
// Get the offset to the ZIP64 EOCD record
|
97
|
+
const zip64EOCDOffset = Number(locatorView.getBigUint64(8, true));
|
98
|
+
|
99
|
+
// Now read the ZIP64 EOCD record
|
100
|
+
const zip64EOCDBuffer = await fetchBytes(
|
101
|
+
url,
|
102
|
+
zip64EOCDOffset,
|
103
|
+
zip64EOCDOffset + 56,
|
104
|
+
);
|
105
|
+
const zip64EOCDView = new DataView(zip64EOCDBuffer.buffer);
|
106
|
+
|
107
|
+
// Verify the ZIP64 EOCD signature
|
108
|
+
if (zip64EOCDView.getUint32(0, true) !== 0x06064b50) {
|
109
|
+
throw new Error("ZIP64 End of central directory record not found");
|
110
|
+
}
|
111
|
+
|
112
|
+
// Get the 64-bit central directory size and offset
|
113
|
+
centralDirSize = Number(zip64EOCDView.getBigUint64(40, true));
|
114
|
+
centralDirOffset = Number(zip64EOCDView.getBigUint64(48, true));
|
115
|
+
}
|
70
116
|
|
71
117
|
// Fetch and parse the central directory
|
72
118
|
const centralDirBuffer = await fetchBytes(
|
@@ -75,6 +121,7 @@ export const openRemoteZipFile = async (
|
|
75
121
|
centralDirOffset + centralDirSize - 1,
|
76
122
|
);
|
77
123
|
const centralDirectory = parseCentralDirectory(centralDirBuffer);
|
124
|
+
|
78
125
|
return {
|
79
126
|
centralDirectory: centralDirectory,
|
80
127
|
readFile: async (file, maxBytes): Promise<Uint8Array> => {
|
@@ -97,6 +144,8 @@ export const openRemoteZipFile = async (
|
|
97
144
|
|
98
145
|
// 28-29 bytes in local header
|
99
146
|
const extraFieldLength = headerData[28] + (headerData[29] << 8);
|
147
|
+
|
148
|
+
// Use the entry's compressed size from the central directory
|
100
149
|
const totalSizeToFetch =
|
101
150
|
headerSize + filenameLength + extraFieldLength + entry.compressedSize;
|
102
151
|
|
@@ -118,13 +167,13 @@ export const openRemoteZipFile = async (
|
|
118
167
|
// No compression
|
119
168
|
return zipFileEntry.data;
|
120
169
|
} else if (zipFileEntry.compressionMethod === 8) {
|
121
|
-
//
|
170
|
+
// Deflate compression
|
122
171
|
const results = await decompressAsync(zipFileEntry.data, {
|
123
172
|
size: zipFileEntry.uncompressedSize,
|
124
173
|
});
|
125
174
|
return results;
|
126
175
|
} else {
|
127
|
-
throw new Error(`Unsupported
|
176
|
+
throw new Error(`Unsupported compression method for file ${file}`);
|
128
177
|
}
|
129
178
|
},
|
130
179
|
};
|
@@ -194,15 +243,63 @@ const parseZipFileEntry = async (
|
|
194
243
|
offset += 4; // Skip last mod time and date
|
195
244
|
const crc32 = view.getUint32(offset, true);
|
196
245
|
offset += 4;
|
197
|
-
|
246
|
+
|
247
|
+
// Get initial sizes from standard header
|
248
|
+
let compressedSize = view.getUint32(offset, true);
|
198
249
|
offset += 4;
|
199
|
-
|
250
|
+
let uncompressedSize = view.getUint32(offset, true);
|
200
251
|
offset += 4;
|
252
|
+
|
201
253
|
const filenameLength = view.getUint16(offset, true);
|
202
254
|
offset += 2;
|
203
255
|
const extraFieldLength = view.getUint16(offset, true);
|
204
256
|
offset += 2;
|
205
257
|
|
258
|
+
// The original header offset
|
259
|
+
const headerOffset = offset;
|
260
|
+
|
261
|
+
// Check if we need to look for ZIP64 extra fields
|
262
|
+
const needsZip64 =
|
263
|
+
compressedSize === 0xffffffff || uncompressedSize === 0xffffffff;
|
264
|
+
|
265
|
+
if (needsZip64) {
|
266
|
+
// Skip the filename
|
267
|
+
offset += filenameLength;
|
268
|
+
|
269
|
+
// Look through extra fields for ZIP64 data
|
270
|
+
const extraFieldEnd = offset + extraFieldLength;
|
271
|
+
while (offset < extraFieldEnd) {
|
272
|
+
const tag = view.getUint16(offset, true);
|
273
|
+
const size = view.getUint16(offset + 2, true);
|
274
|
+
|
275
|
+
if (tag === 0x0001) {
|
276
|
+
// ZIP64 Extra Field
|
277
|
+
// Position in the extra field data
|
278
|
+
let zip64Offset = offset + 4;
|
279
|
+
|
280
|
+
// Read values in the order they appear in the ZIP64 extra field
|
281
|
+
if (
|
282
|
+
uncompressedSize === 0xffffffff &&
|
283
|
+
zip64Offset + 8 <= extraFieldEnd
|
284
|
+
) {
|
285
|
+
uncompressedSize = Number(view.getBigUint64(zip64Offset, true));
|
286
|
+
zip64Offset += 8;
|
287
|
+
}
|
288
|
+
|
289
|
+
if (compressedSize === 0xffffffff && zip64Offset + 8 <= extraFieldEnd) {
|
290
|
+
compressedSize = Number(view.getBigUint64(zip64Offset, true));
|
291
|
+
}
|
292
|
+
|
293
|
+
break;
|
294
|
+
}
|
295
|
+
offset += 4 + size;
|
296
|
+
}
|
297
|
+
|
298
|
+
// Reset offset
|
299
|
+
offset = headerOffset;
|
300
|
+
}
|
301
|
+
|
302
|
+
// Skip filename and extra field to get to the data
|
206
303
|
offset += filenameLength + extraFieldLength;
|
207
304
|
|
208
305
|
const data = rawData.subarray(offset, offset + compressedSize);
|
@@ -223,7 +320,7 @@ const kFileHeaderSize = 46;
|
|
223
320
|
/**
|
224
321
|
* Parses the central directory of a ZIP file from the provided buffer and returns a map of entries.
|
225
322
|
*/
|
226
|
-
const parseCentralDirectory = (buffer: Uint8Array
|
323
|
+
const parseCentralDirectory = (buffer: Uint8Array) => {
|
227
324
|
let offset = 0;
|
228
325
|
const view = new DataView(buffer.buffer);
|
229
326
|
const entries = new Map();
|
@@ -236,6 +333,11 @@ const parseCentralDirectory = (buffer: Uint8Array<ArrayBufferLike>) => {
|
|
236
333
|
const extraFieldLength = view.getUint16(offset + 30, true);
|
237
334
|
const fileCommentLength = view.getUint16(offset + 32, true);
|
238
335
|
|
336
|
+
// Get initial 32-bit values
|
337
|
+
let compressedSize = view.getUint32(offset + 20, true);
|
338
|
+
let uncompressedSize = view.getUint32(offset + 24, true);
|
339
|
+
let fileOffset = view.getUint32(offset + 42, true);
|
340
|
+
|
239
341
|
const filename = new TextDecoder().decode(
|
240
342
|
buffer.subarray(
|
241
343
|
offset + kFileHeaderSize,
|
@@ -243,34 +345,53 @@ const parseCentralDirectory = (buffer: Uint8Array<ArrayBufferLike>) => {
|
|
243
345
|
),
|
244
346
|
);
|
245
347
|
|
246
|
-
//
|
247
|
-
|
348
|
+
// Check if we need to use ZIP64 extra fields
|
349
|
+
const needsZip64 =
|
350
|
+
fileOffset === 0xffffffff ||
|
351
|
+
compressedSize === 0xffffffff ||
|
352
|
+
uncompressedSize === 0xffffffff;
|
248
353
|
|
249
|
-
|
250
|
-
if (fileOffset === 0xffffffff) {
|
354
|
+
if (needsZip64) {
|
251
355
|
// Move to extra field
|
252
356
|
let extraOffset = offset + kFileHeaderSize + filenameLength;
|
357
|
+
const extraEnd = extraOffset + extraFieldLength;
|
358
|
+
|
253
359
|
// Look through extra fields until we find zip64 extra field
|
254
|
-
while (
|
255
|
-
extraOffset <
|
256
|
-
offset + kFileHeaderSize + filenameLength + extraFieldLength
|
257
|
-
) {
|
360
|
+
while (extraOffset < extraEnd) {
|
258
361
|
const tag = view.getUint16(extraOffset, true);
|
259
362
|
const size = view.getUint16(extraOffset + 2, true);
|
363
|
+
|
260
364
|
if (tag === 0x0001) {
|
261
|
-
// ZIP64 Extra Field
|
262
|
-
|
365
|
+
// ZIP64 Extra Field
|
366
|
+
// Position in the extra field data
|
367
|
+
let zip64Offset = extraOffset + 4;
|
368
|
+
|
369
|
+
// Read values in the order they appear in the ZIP64 extra field
|
370
|
+
if (uncompressedSize === 0xffffffff && zip64Offset + 8 <= extraEnd) {
|
371
|
+
uncompressedSize = Number(view.getBigUint64(zip64Offset, true));
|
372
|
+
zip64Offset += 8;
|
373
|
+
}
|
374
|
+
|
375
|
+
if (compressedSize === 0xffffffff && zip64Offset + 8 <= extraEnd) {
|
376
|
+
compressedSize = Number(view.getBigUint64(zip64Offset, true));
|
377
|
+
zip64Offset += 8;
|
378
|
+
}
|
379
|
+
|
380
|
+
if (fileOffset === 0xffffffff && zip64Offset + 8 <= extraEnd) {
|
381
|
+
fileOffset = Number(view.getBigUint64(zip64Offset, true));
|
382
|
+
}
|
383
|
+
|
263
384
|
break;
|
264
385
|
}
|
265
|
-
extraOffset += 4 + size;
|
386
|
+
extraOffset += 4 + size;
|
266
387
|
}
|
267
388
|
}
|
268
389
|
|
269
390
|
const entry = {
|
270
391
|
filename,
|
271
392
|
compressionMethod: view.getUint16(offset + 10, true),
|
272
|
-
compressedSize
|
273
|
-
uncompressedSize
|
393
|
+
compressedSize,
|
394
|
+
uncompressedSize,
|
274
395
|
fileOffset,
|
275
396
|
};
|
276
397
|
|
@@ -8,6 +8,7 @@ import { SolversDetailView } from "./SolverDetailView";
|
|
8
8
|
|
9
9
|
import clsx from "clsx";
|
10
10
|
import { FC, ReactNode } from "react";
|
11
|
+
import { kModelNone } from "../constants";
|
11
12
|
import styles from "./PlanDetailView.module.css";
|
12
13
|
|
13
14
|
interface PlanDetailViewProps {
|
@@ -71,7 +72,7 @@ export const PlanDetailView: FC<PlanDetailViewProps> = ({
|
|
71
72
|
taskInformation["Tags"] = evaluation.tags.join(", ");
|
72
73
|
}
|
73
74
|
|
74
|
-
if (evaluation?.model) {
|
75
|
+
if (evaluation?.model && evaluation.model !== kModelNone) {
|
75
76
|
config["model"] = evaluation.model;
|
76
77
|
}
|
77
78
|
|
@@ -146,7 +146,7 @@ export const SampleSummaryView: FC<SampleSummaryViewProps> = ({
|
|
146
146
|
// TODO: Cleanup once the PR lands which makes sample / sample summary share common interface
|
147
147
|
sampleDescriptor?.selectedScore(sample)?.render() || ""
|
148
148
|
),
|
149
|
-
size: "minmax(2em,
|
149
|
+
size: "minmax(2em, 30em)",
|
150
150
|
center: true,
|
151
151
|
});
|
152
152
|
|
@@ -53,11 +53,13 @@ const extractInput = (
|
|
53
53
|
): { input?: string; args: string[] } => {
|
54
54
|
const formatArg = (key: string, value: unknown) => {
|
55
55
|
const quotedValue =
|
56
|
-
|
57
|
-
?
|
58
|
-
: typeof value === "
|
59
|
-
?
|
60
|
-
:
|
56
|
+
value === null
|
57
|
+
? "None"
|
58
|
+
: typeof value === "string"
|
59
|
+
? `"${value}"`
|
60
|
+
: typeof value === "object" || Array.isArray(value)
|
61
|
+
? JSON.stringify(value, undefined, 2)
|
62
|
+
: String(value);
|
61
63
|
return `${key}: ${quotedValue}`;
|
62
64
|
};
|
63
65
|
if (args) {
|
@@ -9,7 +9,7 @@ export const categoricalScoreDescriptor = (
|
|
9
9
|
scoreType: kScoreTypeCategorical,
|
10
10
|
categories: values,
|
11
11
|
compare: (a, b) => {
|
12
|
-
return String(a).localeCompare(String(b));
|
12
|
+
return String(a.value).localeCompare(String(b.value));
|
13
13
|
},
|
14
14
|
render: (score) => {
|
15
15
|
return String(score);
|
@@ -13,8 +13,8 @@ export const numericScoreDescriptor = (values: Value2[]): ScoreDescriptor => {
|
|
13
13
|
min: Math.min(...onlyNumeric),
|
14
14
|
max: Math.max(...onlyNumeric),
|
15
15
|
compare: (a, b) => {
|
16
|
-
if (typeof a === "number" && typeof b === "number") {
|
17
|
-
return a - b;
|
16
|
+
if (typeof a.value === "number" && typeof b.value === "number") {
|
17
|
+
return a.value - b.value;
|
18
18
|
} else {
|
19
19
|
console.warn("Comparing non-numerics using a numeric score descriptor");
|
20
20
|
return 0;
|
@@ -15,7 +15,9 @@ export const FlatSampleError: FC<FlatSampleErrorViewProps> = ({ message }) => {
|
|
15
15
|
return (
|
16
16
|
<div className={clsx(styles.flatBody)}>
|
17
17
|
<i className={clsx(ApplicationIcons.error, styles.iconSmall)} />
|
18
|
-
<div className={clsx(styles.lineBase)}>
|
18
|
+
<div className={clsx(styles.lineBase, "text-truncate")}>
|
19
|
+
{errorType(message)}
|
20
|
+
</div>
|
19
21
|
</div>
|
20
22
|
);
|
21
23
|
};
|
@@ -138,8 +138,11 @@ const getLints = (
|
|
138
138
|
if (!filterError) return [];
|
139
139
|
return [
|
140
140
|
{
|
141
|
-
from: filterError.from || 0,
|
142
|
-
to:
|
141
|
+
from: Math.min(filterError.from || 0, view.state.doc.length),
|
142
|
+
to: Math.min(
|
143
|
+
filterError.to || view.state.doc.length,
|
144
|
+
view.state.doc.length,
|
145
|
+
),
|
143
146
|
severity: filterError.severity,
|
144
147
|
message: filterError.message,
|
145
148
|
},
|
@@ -17,7 +17,7 @@ import {
|
|
17
17
|
StoreSpecificRenderableTypes,
|
18
18
|
} from "./StateEventRenderers";
|
19
19
|
|
20
|
-
import {
|
20
|
+
import { FC, useMemo } from "react";
|
21
21
|
import styles from "./StateEventView.module.css";
|
22
22
|
|
23
23
|
interface StateEventViewProps {
|
@@ -246,6 +246,10 @@ const synthesizeComparable = (changes: Changes) => {
|
|
246
246
|
setPath(before, change.path, change.value);
|
247
247
|
break;
|
248
248
|
case "replace":
|
249
|
+
// 'Fill in' arrays with empty strings to ensure there is no unnecessary diff
|
250
|
+
initializeArrays(before, change.path);
|
251
|
+
initializeArrays(after, change.path);
|
252
|
+
|
249
253
|
setPath(before, change.path, change.replaced);
|
250
254
|
setPath(after, change.path, change.value);
|
251
255
|
break;
|