@metrevals/inspect-scout-viewer 0.4.3-beta.1765899631 → 0.4.4-beta.20251223202036
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.
- package/lib/api/api.d.ts +5 -2
- package/lib/api/request.d.ts +5 -1
- package/lib/app/arrowHelpers.d.ts +4 -0
- package/lib/app/components/Navbar.d.ts +1 -0
- package/lib/app/components/TaskName.d.ts +8 -0
- package/lib/app/hooks.d.ts +9 -12
- package/lib/app/scanJobs/ScanJobGrid.d.ts +5 -1
- package/lib/app/scanResults/ScanResultHeader.d.ts +2 -3
- package/lib/app/scans/ScansPanel.d.ts +2 -0
- package/lib/app/scans/ScansPanelBody.d.ts +6 -0
- package/lib/app/scans/ScansPanelTitle.d.ts +6 -0
- package/lib/app/scans/info/ScanInfo.d.ts +4 -1
- package/lib/app/scans/results/ScanResultsBody.d.ts +11 -1
- package/lib/app/scans/results/ScanResultsOutline.d.ts +4 -1
- package/lib/app/scans/results/ScanResultsPanel.d.ts +4 -1
- package/lib/app/scans/results/list/ScanResultsList.d.ts +2 -0
- package/lib/app/server/hooks.d.ts +11 -4
- package/lib/app/types.d.ts +32 -18
- package/lib/app/utils/results.d.ts +4 -3
- package/lib/hooks/useMapAsyncData.d.ts +27 -0
- package/lib/index.js +1227 -1272
- package/lib/index.js.map +1 -1
- package/lib/state/store.d.ts +1 -16
- package/lib/styles/index.css +50 -37
- package/lib/types/index.d.ts +38 -24
- package/lib/utils/asyncData.d.ts +66 -0
- package/lib/utils/asyncDataFromQuery.d.ts +13 -0
- package/lib/utils/brand.d.ts +70 -0
- package/lib/utils/path.d.ts +7 -4
- package/package.json +25 -24
- package/lib/app/scans/ScannerPanel.d.ts +0 -2
- package/lib/app/scans/ScannerPanelBody.d.ts +0 -3
- package/lib/app/scans/ScannerPanelTitle.d.ts +0 -2
package/lib/api/api.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { StateStorage } from 'zustand/middleware';
|
|
2
2
|
import { ScanResultInputData } from '../app/types';
|
|
3
|
-
import {
|
|
3
|
+
import { Status } from '../types';
|
|
4
4
|
export type ClientStorage = StateStorage;
|
|
5
5
|
export interface ScanApi {
|
|
6
|
-
|
|
6
|
+
getTranscriptsDir(): Promise<string>;
|
|
7
|
+
getTranscripts(transcriptsDir?: string): Promise<unknown[]>;
|
|
8
|
+
getScansDir(): Promise<string>;
|
|
9
|
+
getScans(scansDir?: string): Promise<Status[]>;
|
|
7
10
|
getScan(scanLocation: string): Promise<Status>;
|
|
8
11
|
getScannerDataframe(scanLocation: string, scanner: string): Promise<ArrayBuffer | Uint8Array>;
|
|
9
12
|
getScannerDataframeInput(scanLocation: string, scanner: string, uuid: string): Promise<ScanResultInputData>;
|
package/lib/api/request.d.ts
CHANGED
|
@@ -8,11 +8,15 @@ export interface Request<T> {
|
|
|
8
8
|
body?: string;
|
|
9
9
|
parse?: (text: string) => Promise<T>;
|
|
10
10
|
handleError?: (status: number) => T | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Opt into browser caching. Only use for endpoints that set appropriate caching
|
|
13
|
+
* headers (e.g., ETag). Caching is disabled by default.
|
|
14
|
+
*/
|
|
15
|
+
enableBrowserCache?: boolean;
|
|
11
16
|
}
|
|
12
17
|
export type HeaderProvider = () => Promise<Record<string, string>>;
|
|
13
18
|
export interface ServerRequestApi {
|
|
14
19
|
fetchString: (method: HttpMethod, path: string, headers?: Record<string, string>, body?: string) => Promise<{
|
|
15
|
-
parsed: any;
|
|
16
20
|
raw: string;
|
|
17
21
|
}>;
|
|
18
22
|
fetchBytes: (method: HttpMethod, path: string) => Promise<ArrayBuffer>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ColumnTable } from 'arquero';
|
|
2
|
+
import { ScanResultData, ScanResultSummary } from './types';
|
|
3
|
+
export declare const parseScanResultData: (filtered: ColumnTable) => Promise<ScanResultData>;
|
|
4
|
+
export declare const parseScanResultSummaries: (rowData: object[]) => Promise<ScanResultSummary[]>;
|
package/lib/app/hooks.d.ts
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import { ColumnTable } from 'arquero';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export declare const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
12
|
-
export declare const useSelectedScanResultInputData: () => ScanResultInputData | undefined;
|
|
13
|
-
export declare const useScannerCores: (columnTable?: ColumnTable) => {
|
|
2
|
+
import { Status } from '../types';
|
|
3
|
+
import { AsyncData } from '../utils/asyncData';
|
|
4
|
+
import { ScanResultData, ScanResultInputData, ScanResultSummary } from './types';
|
|
5
|
+
export declare const useSelectedScan: () => AsyncData<Status>;
|
|
6
|
+
export declare const useSelectedScanner: () => AsyncData<string>;
|
|
7
|
+
export declare const useSelectedScanDataframe: () => AsyncData<ColumnTable>;
|
|
8
|
+
export declare const useSelectedScanResultData: (scanResultUuid: string | undefined) => AsyncData<ScanResultData | undefined>;
|
|
9
|
+
export declare const useSelectedScanResultInputData: () => AsyncData<ScanResultInputData>;
|
|
10
|
+
export declare const useScanResultSummaries: (columnTable?: ColumnTable) => {
|
|
14
11
|
data: ScanResultSummary[];
|
|
15
12
|
isLoading: boolean;
|
|
16
13
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { Status } from '../../types';
|
|
3
|
-
import { ScanResultInputData
|
|
3
|
+
import { ScanResultInputData } from '../types';
|
|
4
4
|
interface ScanResultHeaderProps {
|
|
5
|
-
|
|
6
|
-
status?: Status;
|
|
5
|
+
scan?: Status;
|
|
7
6
|
inputData?: ScanResultInputData;
|
|
8
7
|
}
|
|
9
8
|
export declare const ScanResultHeader: FC<ScanResultHeaderProps>;
|
|
@@ -1,2 +1,12 @@
|
|
|
1
|
+
import { ColumnTable } from 'arquero';
|
|
1
2
|
import { FC } from 'react';
|
|
2
|
-
|
|
3
|
+
import { Status } from '../../../types';
|
|
4
|
+
export declare const ScanResultsBody: FC<{
|
|
5
|
+
selectedScan: Status;
|
|
6
|
+
scannerId: string;
|
|
7
|
+
selectedScanner: {
|
|
8
|
+
columnTable: ColumnTable | undefined;
|
|
9
|
+
isLoading: boolean;
|
|
10
|
+
error: string | undefined;
|
|
11
|
+
};
|
|
12
|
+
}>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ColumnTable } from 'arquero';
|
|
2
2
|
import { FC } from 'react';
|
|
3
|
+
import { Status } from '../../../../types';
|
|
3
4
|
export interface GridDescriptor {
|
|
4
5
|
gridStyle: Record<string, string>;
|
|
5
6
|
columns: string[];
|
|
@@ -7,6 +8,7 @@ export interface GridDescriptor {
|
|
|
7
8
|
interface ScanResultsListProps {
|
|
8
9
|
id: string;
|
|
9
10
|
columnTable?: ColumnTable;
|
|
11
|
+
selectedScan: Status;
|
|
10
12
|
}
|
|
11
13
|
export declare const ScanResultsList: FC<ScanResultsListProps>;
|
|
12
14
|
export {};
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { ColumnTable } from 'arquero';
|
|
2
|
+
import { Status } from '../../types';
|
|
3
|
+
import { AsyncData } from '../../utils/asyncData';
|
|
4
|
+
import { ScanResultInputData } from '../types';
|
|
5
|
+
export declare const useServerScansDir: () => AsyncData<string>;
|
|
6
|
+
export declare const useServerScans: () => AsyncData<Status[]>;
|
|
7
|
+
export declare const useServerScan: (location: string | undefined) => AsyncData<Status>;
|
|
8
|
+
export declare const useServerScanDataframe: (location: string | undefined, scanner: string | undefined) => AsyncData<ColumnTable>;
|
|
9
|
+
export declare const useServerScanDataframeInput: (location: string | undefined, scanner: string | undefined, uuid: string | undefined) => AsyncData<ScanResultInputData>;
|
|
10
|
+
export declare const useServerTranscriptsDir: () => AsyncData<string>;
|
|
11
|
+
export declare const useServerTranscripts: (location: string | undefined) => AsyncData<unknown[]>;
|
package/lib/app/types.d.ts
CHANGED
|
@@ -1,41 +1,33 @@
|
|
|
1
1
|
import { EventType } from '../transcript/types';
|
|
2
2
|
import { ModelUsage, Transcript } from '../types';
|
|
3
3
|
import { JsonValue, ChatMessageSystem, ChatMessageUser, ChatMessageAssistant, ChatMessageTool, Events, Messages } from '../types/log';
|
|
4
|
-
export type Input = Transcript | Messages | Events | MessageType | EventType;
|
|
5
|
-
export type InputType = "transcript" | "message" | "messages" | "event" | "events";
|
|
6
4
|
export interface ScanResultInputData {
|
|
7
5
|
input: Input;
|
|
8
6
|
inputType: InputType;
|
|
9
7
|
}
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
direction: "asc" | "desc";
|
|
13
|
-
}
|
|
14
|
-
export type ErrorScope = "scanjobs" | "scanner" | "dataframe" | "dataframe_input";
|
|
15
|
-
export type ResultGroup = "source" | "label" | "id" | "epoch" | "none";
|
|
16
|
-
export type ValueType = "boolean" | "number" | "string" | "array" | "object" | "null";
|
|
8
|
+
export type Input = Transcript | Messages | Events | MessageType | EventType;
|
|
9
|
+
export type InputType = "transcript" | "message" | "messages" | "event" | "events";
|
|
17
10
|
export interface ScanResultSummary {
|
|
18
11
|
uuid?: string;
|
|
19
|
-
inputType: InputType;
|
|
20
12
|
explanation?: string;
|
|
21
13
|
label?: string;
|
|
14
|
+
timestamp?: Date;
|
|
15
|
+
inputType: InputType;
|
|
22
16
|
eventReferences: ScanResultReference[];
|
|
23
17
|
messageReferences: ScanResultReference[];
|
|
24
18
|
validationResult: boolean | Record<string, boolean>;
|
|
25
19
|
validationTarget: boolean | Record<string, boolean>;
|
|
26
20
|
value: string | boolean | number | null | unknown[] | object;
|
|
27
21
|
valueType: ValueType;
|
|
28
|
-
transcriptMetadata: Record<string, JsonValue>;
|
|
29
|
-
transcriptSourceId: string;
|
|
30
22
|
scanError?: string;
|
|
31
23
|
scanErrorRefusal?: boolean;
|
|
24
|
+
transcriptSourceId: string;
|
|
25
|
+
transcriptTaskSet?: string;
|
|
26
|
+
transcriptTaskId?: string | number;
|
|
27
|
+
transcriptTaskRepeat?: number;
|
|
28
|
+
transcriptModel?: string;
|
|
29
|
+
transcriptMetadata: Record<string, JsonValue>;
|
|
32
30
|
}
|
|
33
|
-
export interface ScanResultReference {
|
|
34
|
-
type: "message" | "event";
|
|
35
|
-
id: string;
|
|
36
|
-
cite?: string;
|
|
37
|
-
}
|
|
38
|
-
export type MessageType = ChatMessageSystem | ChatMessageUser | ChatMessageAssistant | ChatMessageTool;
|
|
39
31
|
export interface ScanResultData extends ScanResultSummary {
|
|
40
32
|
answer?: string;
|
|
41
33
|
inputIds: string[];
|
|
@@ -55,7 +47,29 @@ export interface ScanResultData extends ScanResultSummary {
|
|
|
55
47
|
scannerParams: Record<string, JsonValue>;
|
|
56
48
|
transcriptId: string;
|
|
57
49
|
transcriptSourceUri: string;
|
|
50
|
+
transcriptDate?: Date;
|
|
51
|
+
transcriptAgent?: string;
|
|
52
|
+
transcriptAgentArgs?: Record<string, unknown>;
|
|
53
|
+
transcriptScore?: JsonValue;
|
|
54
|
+
transcriptSuccess?: boolean;
|
|
55
|
+
transcriptTotalTime?: number;
|
|
56
|
+
transcroptTotalTokens?: number;
|
|
57
|
+
transcriptError?: string;
|
|
58
|
+
transcriptLimit?: string;
|
|
58
59
|
}
|
|
60
|
+
export interface ScanResultReference {
|
|
61
|
+
type: "message" | "event";
|
|
62
|
+
id: string;
|
|
63
|
+
cite?: string;
|
|
64
|
+
}
|
|
65
|
+
export type MessageType = ChatMessageSystem | ChatMessageUser | ChatMessageAssistant | ChatMessageTool;
|
|
66
|
+
export interface SortColumn {
|
|
67
|
+
column: string;
|
|
68
|
+
direction: "asc" | "desc";
|
|
69
|
+
}
|
|
70
|
+
export type ErrorScope = "scanjobs" | "scanner" | "dataframe" | "dataframe_input";
|
|
71
|
+
export type ResultGroup = "source" | "label" | "id" | "epoch" | "model" | "none";
|
|
72
|
+
export type ValueType = "boolean" | "number" | "string" | "array" | "object" | "null";
|
|
59
73
|
export declare function isStringValue(result: ScanResultSummary): result is ScanResultSummary & {
|
|
60
74
|
valueType: "string";
|
|
61
75
|
value: string;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ScanResultSummary } from '../types';
|
|
2
2
|
export interface IdentifierInfo {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
taskSet?: string;
|
|
4
|
+
id: string | number;
|
|
5
|
+
secondaryId?: string | number;
|
|
6
|
+
epoch?: number;
|
|
6
7
|
}
|
|
7
8
|
export declare const resultIdentifierStr: (summary?: ScanResultSummary) => string | undefined;
|
|
8
9
|
export declare const resultIdentifier: (summary?: ScanResultSummary) => IdentifierInfo;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { AsyncData } from '../utils/asyncData';
|
|
2
|
+
/**
|
|
3
|
+
* The `useMapAsyncData` function is a custom React hook that transforms the data
|
|
4
|
+
* in an `AsyncData` object or an array of `AsyncData` objects. It uses the `useMemo`
|
|
5
|
+
* hook to avoid unnecessary recalculations.
|
|
6
|
+
*
|
|
7
|
+
* @template TBefore - The type of the data before the transformation
|
|
8
|
+
* @template TAfter - The type of the data after the transformation
|
|
9
|
+
* @param {AsyncData<TBefore> | AsyncData<TBefore>[]} input - The `AsyncData` object(s)
|
|
10
|
+
* to transform
|
|
11
|
+
* @param {(before: TBefore) => TAfter} transform - The function to transform the
|
|
12
|
+
* data
|
|
13
|
+
* @param {(err: Error) => Error} [errorTransform] - The function to transform any
|
|
14
|
+
* errors (optional)
|
|
15
|
+
* @returns {AsyncData<TAfter> | AsyncData<TAfter>[]} - The transformed `AsyncData`
|
|
16
|
+
* object(s)
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* const asyncData = { loading: false, data: 5 };
|
|
21
|
+
* const transform = (num: number) => num * 2;
|
|
22
|
+
* const result = useMapAsyncData(asyncData, transform);
|
|
23
|
+
* console.log(result); // { loading: false, data: 10 }
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare function useMapAsyncData<TBefore, TAfter>(input: AsyncData<TBefore>, transform: (before: TBefore) => TAfter, errorTransform?: (err: Error) => Error): AsyncData<TAfter>;
|
|
27
|
+
export declare function useMapAsyncData<TBefore, TAfter>(input: AsyncData<TBefore>[], transform: (before: TBefore) => TAfter, errorTransform?: (err: Error) => Error): AsyncData<TAfter>[];
|