inspect-ai 0.3.81__py3-none-any.whl → 0.3.82__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- inspect_ai/_cli/eval.py +35 -2
- inspect_ai/_cli/util.py +44 -1
- inspect_ai/_display/core/config.py +1 -1
- inspect_ai/_display/core/display.py +13 -4
- inspect_ai/_display/core/results.py +1 -1
- inspect_ai/_display/textual/widgets/task_detail.py +5 -4
- inspect_ai/_eval/eval.py +38 -1
- inspect_ai/_eval/evalset.py +5 -0
- inspect_ai/_eval/run.py +5 -2
- inspect_ai/_eval/task/log.py +53 -6
- inspect_ai/_eval/task/run.py +51 -10
- inspect_ai/_util/constants.py +2 -0
- inspect_ai/_util/file.py +17 -1
- inspect_ai/_util/json.py +36 -1
- inspect_ai/_view/server.py +113 -1
- inspect_ai/_view/www/App.css +1 -1
- inspect_ai/_view/www/dist/assets/index.css +518 -296
- inspect_ai/_view/www/dist/assets/index.js +38803 -36307
- inspect_ai/_view/www/eslint.config.mjs +1 -1
- inspect_ai/_view/www/log-schema.json +13 -0
- inspect_ai/_view/www/node_modules/flatted/python/flatted.py +149 -0
- inspect_ai/_view/www/package.json +8 -2
- inspect_ai/_view/www/src/App.tsx +151 -855
- inspect_ai/_view/www/src/api/api-browser.ts +176 -5
- inspect_ai/_view/www/src/api/api-vscode.ts +75 -1
- inspect_ai/_view/www/src/api/client-api.ts +66 -10
- inspect_ai/_view/www/src/api/jsonrpc.ts +2 -0
- inspect_ai/_view/www/src/api/types.ts +107 -2
- inspect_ai/_view/www/src/appearance/icons.ts +1 -0
- inspect_ai/_view/www/src/components/AsciinemaPlayer.tsx +3 -3
- inspect_ai/_view/www/src/components/DownloadPanel.tsx +2 -2
- inspect_ai/_view/www/src/components/ExpandablePanel.tsx +56 -61
- inspect_ai/_view/www/src/components/FindBand.tsx +17 -9
- inspect_ai/_view/www/src/components/HumanBaselineView.tsx +1 -1
- inspect_ai/_view/www/src/components/JsonPanel.tsx +14 -24
- inspect_ai/_view/www/src/components/LargeModal.tsx +2 -35
- inspect_ai/_view/www/src/components/LightboxCarousel.tsx +27 -11
- inspect_ai/_view/www/src/components/LiveVirtualList.module.css +11 -0
- inspect_ai/_view/www/src/components/LiveVirtualList.tsx +177 -0
- inspect_ai/_view/www/src/components/MarkdownDiv.tsx +3 -3
- inspect_ai/_view/www/src/components/MessageBand.tsx +14 -9
- inspect_ai/_view/www/src/components/MorePopOver.tsx +3 -3
- inspect_ai/_view/www/src/components/NavPills.tsx +20 -8
- inspect_ai/_view/www/src/components/NoContentsPanel.module.css +12 -0
- inspect_ai/_view/www/src/components/NoContentsPanel.tsx +20 -0
- inspect_ai/_view/www/src/components/ProgressBar.module.css +5 -4
- inspect_ai/_view/www/src/components/ProgressBar.tsx +3 -2
- inspect_ai/_view/www/src/components/PulsingDots.module.css +81 -0
- inspect_ai/_view/www/src/components/PulsingDots.tsx +45 -0
- inspect_ai/_view/www/src/components/TabSet.tsx +4 -37
- inspect_ai/_view/www/src/components/ToolButton.tsx +3 -4
- inspect_ai/_view/www/src/index.tsx +26 -94
- inspect_ai/_view/www/src/logfile/remoteLogFile.ts +9 -1
- inspect_ai/_view/www/src/logfile/remoteZipFile.ts +30 -4
- inspect_ai/_view/www/src/metadata/RenderedContent.tsx +4 -6
- inspect_ai/_view/www/src/plan/ScorerDetailView.tsx +1 -1
- inspect_ai/_view/www/src/samples/InlineSampleDisplay.module.css +9 -1
- inspect_ai/_view/www/src/samples/InlineSampleDisplay.tsx +67 -28
- inspect_ai/_view/www/src/samples/SampleDialog.tsx +51 -22
- inspect_ai/_view/www/src/samples/SampleDisplay.module.css +4 -0
- inspect_ai/_view/www/src/samples/SampleDisplay.tsx +144 -90
- inspect_ai/_view/www/src/samples/SampleSummaryView.module.css +4 -0
- inspect_ai/_view/www/src/samples/SampleSummaryView.tsx +82 -35
- inspect_ai/_view/www/src/samples/SamplesTools.tsx +23 -30
- inspect_ai/_view/www/src/samples/chat/ChatMessage.tsx +2 -1
- inspect_ai/_view/www/src/samples/chat/ChatMessageRenderer.tsx +1 -1
- inspect_ai/_view/www/src/samples/chat/ChatViewVirtualList.tsx +45 -53
- inspect_ai/_view/www/src/samples/chat/MessageContent.tsx +4 -1
- inspect_ai/_view/www/src/samples/chat/MessageContents.tsx +3 -0
- inspect_ai/_view/www/src/samples/chat/messages.ts +34 -0
- inspect_ai/_view/www/src/samples/chat/tools/ToolCallView.module.css +3 -0
- inspect_ai/_view/www/src/samples/chat/tools/ToolCallView.tsx +10 -1
- inspect_ai/_view/www/src/samples/chat/tools/ToolInput.tsx +22 -46
- inspect_ai/_view/www/src/samples/descriptor/samplesDescriptor.tsx +25 -17
- inspect_ai/_view/www/src/samples/descriptor/score/ObjectScoreDescriptor.tsx +2 -1
- inspect_ai/_view/www/src/samples/descriptor/types.ts +6 -5
- inspect_ai/_view/www/src/samples/list/SampleFooter.module.css +21 -3
- inspect_ai/_view/www/src/samples/list/SampleFooter.tsx +20 -1
- inspect_ai/_view/www/src/samples/list/SampleList.tsx +105 -85
- inspect_ai/_view/www/src/samples/list/SampleRow.module.css +6 -0
- inspect_ai/_view/www/src/samples/list/SampleRow.tsx +27 -14
- inspect_ai/_view/www/src/samples/sample-tools/SelectScorer.tsx +29 -18
- inspect_ai/_view/www/src/samples/sample-tools/SortFilter.tsx +28 -28
- inspect_ai/_view/www/src/samples/sample-tools/sample-filter/SampleFilter.tsx +19 -9
- inspect_ai/_view/www/src/samples/sampleDataAdapter.ts +33 -0
- inspect_ai/_view/www/src/samples/sampleLimit.ts +2 -2
- inspect_ai/_view/www/src/samples/scores/SampleScoreView.tsx +7 -9
- inspect_ai/_view/www/src/samples/scores/SampleScores.tsx +7 -11
- inspect_ai/_view/www/src/samples/transcript/ErrorEventView.tsx +0 -13
- inspect_ai/_view/www/src/samples/transcript/InfoEventView.tsx +0 -13
- inspect_ai/_view/www/src/samples/transcript/InputEventView.tsx +0 -13
- inspect_ai/_view/www/src/samples/transcript/ModelEventView.module.css +4 -0
- inspect_ai/_view/www/src/samples/transcript/ModelEventView.tsx +10 -24
- inspect_ai/_view/www/src/samples/transcript/SampleInitEventView.tsx +0 -13
- inspect_ai/_view/www/src/samples/transcript/SampleLimitEventView.tsx +4 -22
- inspect_ai/_view/www/src/samples/transcript/SandboxEventView.tsx +15 -24
- inspect_ai/_view/www/src/samples/transcript/ScoreEventView.tsx +0 -13
- inspect_ai/_view/www/src/samples/transcript/StepEventView.tsx +6 -28
- inspect_ai/_view/www/src/samples/transcript/SubtaskEventView.tsx +24 -34
- inspect_ai/_view/www/src/samples/transcript/ToolEventView.module.css +4 -0
- inspect_ai/_view/www/src/samples/transcript/ToolEventView.tsx +8 -13
- inspect_ai/_view/www/src/samples/transcript/TranscriptView.tsx +197 -338
- inspect_ai/_view/www/src/samples/transcript/TranscriptVirtualListComponent.module.css +16 -0
- inspect_ai/_view/www/src/samples/transcript/TranscriptVirtualListComponent.tsx +44 -0
- inspect_ai/_view/www/src/samples/transcript/event/EventNav.tsx +7 -4
- inspect_ai/_view/www/src/samples/transcript/event/EventPanel.tsx +52 -58
- inspect_ai/_view/www/src/samples/transcript/event/EventProgressPanel.module.css +23 -0
- inspect_ai/_view/www/src/samples/transcript/event/EventProgressPanel.tsx +27 -0
- inspect_ai/_view/www/src/samples/transcript/state/StateEventRenderers.tsx +30 -1
- inspect_ai/_view/www/src/samples/transcript/state/StateEventView.tsx +102 -72
- inspect_ai/_view/www/src/scoring/utils.ts +87 -0
- inspect_ai/_view/www/src/state/appSlice.ts +244 -0
- inspect_ai/_view/www/src/state/hooks.ts +397 -0
- inspect_ai/_view/www/src/state/logPolling.ts +196 -0
- inspect_ai/_view/www/src/state/logSlice.ts +214 -0
- inspect_ai/_view/www/src/state/logsPolling.ts +118 -0
- inspect_ai/_view/www/src/state/logsSlice.ts +181 -0
- inspect_ai/_view/www/src/state/samplePolling.ts +311 -0
- inspect_ai/_view/www/src/state/sampleSlice.ts +127 -0
- inspect_ai/_view/www/src/state/sampleUtils.ts +21 -0
- inspect_ai/_view/www/src/state/scrolling.ts +206 -0
- inspect_ai/_view/www/src/state/store.ts +168 -0
- inspect_ai/_view/www/src/state/store_filter.ts +84 -0
- inspect_ai/_view/www/src/state/utils.ts +23 -0
- inspect_ai/_view/www/src/storage/index.ts +26 -0
- inspect_ai/_view/www/src/types/log.d.ts +2 -0
- inspect_ai/_view/www/src/types.ts +94 -32
- inspect_ai/_view/www/src/utils/attachments.ts +58 -23
- inspect_ai/_view/www/src/utils/logger.ts +52 -0
- inspect_ai/_view/www/src/utils/polling.ts +100 -0
- inspect_ai/_view/www/src/utils/react.ts +30 -0
- inspect_ai/_view/www/src/utils/vscode.ts +1 -1
- inspect_ai/_view/www/src/workspace/WorkSpace.tsx +181 -216
- inspect_ai/_view/www/src/workspace/WorkSpaceView.tsx +11 -53
- inspect_ai/_view/www/src/workspace/navbar/Navbar.tsx +8 -18
- inspect_ai/_view/www/src/workspace/navbar/PrimaryBar.module.css +1 -0
- inspect_ai/_view/www/src/workspace/navbar/PrimaryBar.tsx +40 -22
- inspect_ai/_view/www/src/workspace/navbar/ResultsPanel.module.css +0 -1
- inspect_ai/_view/www/src/workspace/navbar/ResultsPanel.tsx +98 -39
- inspect_ai/_view/www/src/workspace/navbar/RunningStatusPanel.module.css +32 -0
- inspect_ai/_view/www/src/workspace/navbar/RunningStatusPanel.tsx +32 -0
- inspect_ai/_view/www/src/workspace/navbar/SecondaryBar.tsx +11 -13
- inspect_ai/_view/www/src/workspace/navbar/StatusPanel.tsx +6 -2
- inspect_ai/_view/www/src/workspace/sidebar/LogDirectoryTitleView.tsx +4 -4
- inspect_ai/_view/www/src/workspace/sidebar/Sidebar.tsx +28 -13
- inspect_ai/_view/www/src/workspace/tabs/InfoTab.tsx +5 -10
- inspect_ai/_view/www/src/workspace/tabs/JsonTab.tsx +4 -4
- inspect_ai/_view/www/src/workspace/tabs/RunningNoSamples.module.css +22 -0
- inspect_ai/_view/www/src/workspace/tabs/RunningNoSamples.tsx +19 -0
- inspect_ai/_view/www/src/workspace/tabs/SamplesTab.tsx +110 -115
- inspect_ai/_view/www/src/workspace/tabs/grouping.ts +37 -5
- inspect_ai/_view/www/src/workspace/tabs/types.ts +4 -0
- inspect_ai/_view/www/src/workspace/types.ts +4 -3
- inspect_ai/_view/www/src/workspace/utils.ts +4 -4
- inspect_ai/_view/www/vite.config.js +6 -0
- inspect_ai/_view/www/yarn.lock +370 -354
- inspect_ai/log/_condense.py +26 -0
- inspect_ai/log/_log.py +6 -3
- inspect_ai/log/_recorders/buffer/__init__.py +14 -0
- inspect_ai/log/_recorders/buffer/buffer.py +30 -0
- inspect_ai/log/_recorders/buffer/database.py +685 -0
- inspect_ai/log/_recorders/buffer/filestore.py +259 -0
- inspect_ai/log/_recorders/buffer/types.py +84 -0
- inspect_ai/log/_recorders/eval.py +2 -11
- inspect_ai/log/_recorders/types.py +30 -0
- inspect_ai/log/_transcript.py +27 -1
- inspect_ai/model/_call_tools.py +1 -0
- inspect_ai/model/_generate_config.py +2 -2
- inspect_ai/model/_model.py +1 -0
- inspect_ai/tool/_tool_support_helpers.py +4 -4
- inspect_ai/tool/_tools/_web_browser/_web_browser.py +3 -1
- inspect_ai/util/_subtask.py +1 -0
- {inspect_ai-0.3.81.dist-info → inspect_ai-0.3.82.dist-info}/METADATA +1 -1
- {inspect_ai-0.3.81.dist-info → inspect_ai-0.3.82.dist-info}/RECORD +178 -138
- inspect_ai/_view/www/src/samples/transcript/SampleTranscript.tsx +0 -22
- {inspect_ai-0.3.81.dist-info → inspect_ai-0.3.82.dist-info}/WHEEL +0 -0
- {inspect_ai-0.3.81.dist-info → inspect_ai-0.3.82.dist-info}/entry_points.txt +0 -0
- {inspect_ai-0.3.81.dist-info → inspect_ai-0.3.82.dist-info}/licenses/LICENSE +0 -0
- {inspect_ai-0.3.81.dist-info → inspect_ai-0.3.82.dist-info}/top_level.txt +0 -0
@@ -1048,6 +1048,18 @@
|
|
1048
1048
|
"default": null,
|
1049
1049
|
"title": "Log Buffer"
|
1050
1050
|
},
|
1051
|
+
"log_shared": {
|
1052
|
+
"anyOf": [
|
1053
|
+
{
|
1054
|
+
"type": "integer"
|
1055
|
+
},
|
1056
|
+
{
|
1057
|
+
"type": "null"
|
1058
|
+
}
|
1059
|
+
],
|
1060
|
+
"default": null,
|
1061
|
+
"title": "Log Shared"
|
1062
|
+
},
|
1051
1063
|
"score_display": {
|
1052
1064
|
"anyOf": [
|
1053
1065
|
{
|
@@ -1082,6 +1094,7 @@
|
|
1082
1094
|
"log_samples",
|
1083
1095
|
"log_images",
|
1084
1096
|
"log_buffer",
|
1097
|
+
"log_shared",
|
1085
1098
|
"score_display"
|
1086
1099
|
],
|
1087
1100
|
"additionalProperties": false
|
@@ -0,0 +1,149 @@
|
|
1
|
+
# ISC License
|
2
|
+
#
|
3
|
+
# Copyright (c) 2018-2025, Andrea Giammarchi, @WebReflection
|
4
|
+
#
|
5
|
+
# Permission to use, copy, modify, and/or distribute this software for any
|
6
|
+
# purpose with or without fee is hereby granted, provided that the above
|
7
|
+
# copyright notice and this permission notice appear in all copies.
|
8
|
+
#
|
9
|
+
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
10
|
+
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
11
|
+
# AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
12
|
+
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
13
|
+
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
14
|
+
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
15
|
+
# PERFORMANCE OF THIS SOFTWARE.
|
16
|
+
|
17
|
+
import json as _json
|
18
|
+
|
19
|
+
class _Known:
|
20
|
+
def __init__(self):
|
21
|
+
self.key = []
|
22
|
+
self.value = []
|
23
|
+
|
24
|
+
class _String:
|
25
|
+
def __init__(self, value):
|
26
|
+
self.value = value
|
27
|
+
|
28
|
+
|
29
|
+
def _array_keys(value):
|
30
|
+
keys = []
|
31
|
+
i = 0
|
32
|
+
for _ in value:
|
33
|
+
keys.append(i)
|
34
|
+
i += 1
|
35
|
+
return keys
|
36
|
+
|
37
|
+
def _object_keys(value):
|
38
|
+
keys = []
|
39
|
+
for key in value:
|
40
|
+
keys.append(key)
|
41
|
+
return keys
|
42
|
+
|
43
|
+
def _is_array(value):
|
44
|
+
return isinstance(value, (list, tuple))
|
45
|
+
|
46
|
+
def _is_object(value):
|
47
|
+
return isinstance(value, dict)
|
48
|
+
|
49
|
+
def _is_string(value):
|
50
|
+
return isinstance(value, str)
|
51
|
+
|
52
|
+
def _index(known, input, value):
|
53
|
+
input.append(value)
|
54
|
+
index = str(len(input) - 1)
|
55
|
+
known.key.append(value)
|
56
|
+
known.value.append(index)
|
57
|
+
return index
|
58
|
+
|
59
|
+
def _loop(keys, input, known, output):
|
60
|
+
for key in keys:
|
61
|
+
value = output[key]
|
62
|
+
if isinstance(value, _String):
|
63
|
+
_ref(key, input[int(value.value)], input, known, output)
|
64
|
+
|
65
|
+
return output
|
66
|
+
|
67
|
+
def _ref(key, value, input, known, output):
|
68
|
+
if _is_array(value) and value not in known:
|
69
|
+
known.append(value)
|
70
|
+
value = _loop(_array_keys(value), input, known, value)
|
71
|
+
elif _is_object(value) and value not in known:
|
72
|
+
known.append(value)
|
73
|
+
value = _loop(_object_keys(value), input, known, value)
|
74
|
+
|
75
|
+
output[key] = value
|
76
|
+
|
77
|
+
def _relate(known, input, value):
|
78
|
+
if _is_string(value) or _is_array(value) or _is_object(value):
|
79
|
+
try:
|
80
|
+
return known.value[known.key.index(value)]
|
81
|
+
except:
|
82
|
+
return _index(known, input, value)
|
83
|
+
|
84
|
+
return value
|
85
|
+
|
86
|
+
def _transform(known, input, value):
|
87
|
+
if _is_array(value):
|
88
|
+
output = []
|
89
|
+
for val in value:
|
90
|
+
output.append(_relate(known, input, val))
|
91
|
+
return output
|
92
|
+
|
93
|
+
if _is_object(value):
|
94
|
+
obj = {}
|
95
|
+
for key in value:
|
96
|
+
obj[key] = _relate(known, input, value[key])
|
97
|
+
return obj
|
98
|
+
|
99
|
+
return value
|
100
|
+
|
101
|
+
def _wrap(value):
|
102
|
+
if _is_string(value):
|
103
|
+
return _String(value)
|
104
|
+
|
105
|
+
if _is_array(value):
|
106
|
+
i = 0
|
107
|
+
for val in value:
|
108
|
+
value[i] = _wrap(val)
|
109
|
+
i += 1
|
110
|
+
|
111
|
+
elif _is_object(value):
|
112
|
+
for key in value:
|
113
|
+
value[key] = _wrap(value[key])
|
114
|
+
|
115
|
+
return value
|
116
|
+
|
117
|
+
def parse(value, *args, **kwargs):
|
118
|
+
json = _json.loads(value, *args, **kwargs)
|
119
|
+
wrapped = []
|
120
|
+
for value in json:
|
121
|
+
wrapped.append(_wrap(value))
|
122
|
+
|
123
|
+
input = []
|
124
|
+
for value in wrapped:
|
125
|
+
if isinstance(value, _String):
|
126
|
+
input.append(value.value)
|
127
|
+
else:
|
128
|
+
input.append(value)
|
129
|
+
|
130
|
+
value = input[0]
|
131
|
+
|
132
|
+
if _is_array(value):
|
133
|
+
return _loop(_array_keys(value), input, [value], value)
|
134
|
+
|
135
|
+
if _is_object(value):
|
136
|
+
return _loop(_object_keys(value), input, [value], value)
|
137
|
+
|
138
|
+
return value
|
139
|
+
|
140
|
+
|
141
|
+
def stringify(value, *args, **kwargs):
|
142
|
+
known = _Known()
|
143
|
+
input = []
|
144
|
+
output = []
|
145
|
+
i = int(_index(known, input, value))
|
146
|
+
while i < len(input):
|
147
|
+
output.append(_transform(known, input, input[i]))
|
148
|
+
i += 1
|
149
|
+
return _json.dumps(output, *args, **kwargs)
|
@@ -9,12 +9,15 @@
|
|
9
9
|
"build": "vite build",
|
10
10
|
"watch": "vite build --watch",
|
11
11
|
"dev-watch": "NODE_ENV=development vite build --mode development --watch",
|
12
|
+
"dev-watch-log": "cross-env DEV_LOGGING=true NODE_ENV=development vite build --mode development --watch",
|
12
13
|
"dev": "vite",
|
13
14
|
"prettier:check": "prettier --check src",
|
14
15
|
"prettier:write": "prettier --write src",
|
15
16
|
"test": "echo \"Error: no test specified\" && exit 1",
|
16
17
|
"lint": "eslint 'src/**/*.{js,jsx,mjs,ts,tsx}'",
|
17
|
-
"lint:fix": "eslint 'src/**/*.{js,jsx,mjs,ts,tsx}' --fix"
|
18
|
+
"lint:fix": "eslint 'src/**/*.{js,jsx,mjs,ts,tsx}' --fix",
|
19
|
+
"tsc": "tsc --noEmit",
|
20
|
+
"check-all": "yarn tsc && yarn lint:fix && yarn prettier:write && yarn build"
|
18
21
|
},
|
19
22
|
"exports": {
|
20
23
|
".": "./src/App.mjs"
|
@@ -30,6 +33,7 @@
|
|
30
33
|
"@types/react": "^19.0.7",
|
31
34
|
"@types/react-dom": "^19.0.3",
|
32
35
|
"@vitejs/plugin-react": "^4.3.4",
|
36
|
+
"cross-env": "^7.0.3",
|
33
37
|
"eslint": "9.x",
|
34
38
|
"eslint-plugin-react-hooks": "^5.1.0",
|
35
39
|
"globals": "^15.6.0",
|
@@ -56,6 +60,7 @@
|
|
56
60
|
"fflate": "^0.8.2",
|
57
61
|
"filtrex": "^3.1.0",
|
58
62
|
"htm": "^3.1.1",
|
63
|
+
"immer": "^10.1.1",
|
59
64
|
"json": "^11.0.0",
|
60
65
|
"json5": "^2.2.3",
|
61
66
|
"jsondiffpatch": "^0.6.0",
|
@@ -65,6 +70,7 @@
|
|
65
70
|
"prismjs": "^1.30.0",
|
66
71
|
"react": "^19.0.0",
|
67
72
|
"react-dom": "^19.0.0",
|
68
|
-
"react-virtuoso": "^4.12.5"
|
73
|
+
"react-virtuoso": "^4.12.5",
|
74
|
+
"zustand": "^5.0.3"
|
69
75
|
}
|
70
76
|
}
|