@adoptai/genui-components 0.1.57 → 0.1.58
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/dist/composites/document-field-extraction/FieldAuditLog.d.ts +27 -0
- package/dist/composites/document-field-extraction/FieldAuditLog.d.ts.map +1 -0
- package/dist/composites/document-field-extraction/FieldDetail.d.ts +22 -0
- package/dist/composites/document-field-extraction/FieldDetail.d.ts.map +1 -0
- package/dist/composites/document-field-extraction/FieldDetails.d.ts +18 -0
- package/dist/composites/document-field-extraction/FieldDetails.d.ts.map +1 -0
- package/dist/composites/document-field-extraction/bboxTransform.d.ts +25 -0
- package/dist/composites/document-field-extraction/bboxTransform.d.ts.map +1 -0
- package/dist/composites/document-field-extraction/fieldLabels.d.ts +2 -0
- package/dist/composites/document-field-extraction/fieldLabels.d.ts.map +1 -0
- package/dist/composites/document-field-extraction/resolver.d.ts +16 -0
- package/dist/composites/document-field-extraction/resolver.d.ts.map +1 -0
- package/dist/index.cjs +2097 -246
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1892 -45
- package/dist/index.js.map +1 -1
- package/dist/renderer.cjs +1917 -181
- package/dist/renderer.cjs.map +1 -1
- package/dist/renderer.js +1774 -38
- package/dist/renderer.js.map +1 -1
- package/dist/resolver.cjs +1916 -180
- package/dist/resolver.cjs.map +1 -1
- package/dist/resolver.d.ts.map +1 -1
- package/dist/resolver.js +1774 -38
- package/dist/resolver.js.map +1 -1
- package/dist/schemas/document-field-extraction.d.ts +258 -0
- package/dist/schemas/document-field-extraction.d.ts.map +1 -0
- package/dist/schemas/index.cjs +178 -0
- package/dist/schemas/index.cjs.map +1 -1
- package/dist/schemas/index.d.ts +258 -0
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +178 -0
- package/dist/schemas/index.js.map +1 -1
- package/dist/tool-definitions.json +227 -3
- package/package.json +1 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** One row of the document's field-change history. Shape mirrors the docstore
|
|
2
|
+
* audit endpoint (GET .../extraction/audit), newest first. */
|
|
3
|
+
export interface AuditEvent {
|
|
4
|
+
id: string;
|
|
5
|
+
field_key: string;
|
|
6
|
+
previous_value?: string | null;
|
|
7
|
+
new_value?: string | null;
|
|
8
|
+
actor_type?: string | null;
|
|
9
|
+
actor_name?: string | null;
|
|
10
|
+
event_type?: string | null;
|
|
11
|
+
created_at?: string | null;
|
|
12
|
+
reason?: string | null;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Flat chronological audit trail for all fields in a document. Ported from
|
|
16
|
+
* adoptwebui's file-explorer review pane (documentViewer/AuditTrailPanel.jsx)
|
|
17
|
+
* to inline styles + theme tokens. Read-only.
|
|
18
|
+
*/
|
|
19
|
+
export declare function FieldAuditLog({ events, loading, fields, }: {
|
|
20
|
+
events?: AuditEvent[];
|
|
21
|
+
loading?: boolean;
|
|
22
|
+
fields?: {
|
|
23
|
+
field_key: string;
|
|
24
|
+
label?: string;
|
|
25
|
+
}[];
|
|
26
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
//# sourceMappingURL=FieldAuditLog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldAuditLog.d.ts","sourceRoot":"","sources":["../../../src/composites/document-field-extraction/FieldAuditLog.tsx"],"names":[],"mappings":"AAMA;+DAC+D;AAC/D,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAwBD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAC5B,MAAW,EACX,OAAe,EACf,MAAW,GACZ,EAAE;IACD,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAClD,2CA8KA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { SchemaPayload } from "../../schemas";
|
|
3
|
+
type Field = NonNullable<SchemaPayload<"document-field-extraction">["fields"]>[number];
|
|
4
|
+
/**
|
|
5
|
+
* One editable field card in the extraction modal's right-hand list. Ported from
|
|
6
|
+
* adoptwebui's file-explorer review pane (documentViewer/FieldCard.jsx) so chat
|
|
7
|
+
* and the explorer behave identically: click to select (drives two-way bbox
|
|
8
|
+
* highlight), pencil to edit, Save (⌘↵) / Cancel (Esc).
|
|
9
|
+
*
|
|
10
|
+
* `onSave` is host-provided and async; it throws on failure (surfaced inline).
|
|
11
|
+
* When `onSave` is absent the card is read-only (legacy / non-docstore payloads).
|
|
12
|
+
*/
|
|
13
|
+
export declare function FieldDetail({ field, selected, onSelect, onSave, correctionCount, cardRef, }: {
|
|
14
|
+
field: Field;
|
|
15
|
+
selected: boolean;
|
|
16
|
+
onSelect: (key: string | null) => void;
|
|
17
|
+
onSave?: (fieldKey: string, value: string) => Promise<void>;
|
|
18
|
+
correctionCount?: number;
|
|
19
|
+
cardRef?: React.Ref<HTMLDivElement>;
|
|
20
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=FieldDetail.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldDetail.d.ts","sourceRoot":"","sources":["../../../src/composites/document-field-extraction/FieldDetail.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAInD,KAAK,KAAK,GAAG,WAAW,CAAC,aAAa,CAAC,2BAA2B,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AA+DvF;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,eAAmB,EACnB,OAAO,GACR,EAAE;IACD,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACvC,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5D,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;CACrC,2CAiTA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { SchemaPayload } from "../../schemas";
|
|
2
|
+
type Payload = SchemaPayload<"document-field-extraction">;
|
|
3
|
+
type Summary = NonNullable<Payload["summary"]>;
|
|
4
|
+
/**
|
|
5
|
+
* "Details" tab — a read-only summary of one document's extracted data. Ported
|
|
6
|
+
* from adoptwebui's file-explorer review pane (documentViewer/DocumentDetails.jsx)
|
|
7
|
+
* so chat and the explorer show the identical document summary. Driven entirely
|
|
8
|
+
* by the deterministic `summary` projection the extraction pipeline produced
|
|
9
|
+
* (no client-side inference); shows an empty state when absent.
|
|
10
|
+
*/
|
|
11
|
+
export declare function FieldDetails({ summary, fileName, pageCount, pagesProcessed, }: {
|
|
12
|
+
summary?: Summary | null;
|
|
13
|
+
fileName?: string;
|
|
14
|
+
pageCount?: number;
|
|
15
|
+
pagesProcessed?: number;
|
|
16
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=FieldDetails.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldDetails.d.ts","sourceRoot":"","sources":["../../../src/composites/document-field-extraction/FieldDetails.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAGnD,KAAK,OAAO,GAAG,aAAa,CAAC,2BAA2B,CAAC,CAAC;AAC1D,KAAK,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;AAc/C;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,EAC3B,OAAO,EACP,QAAQ,EACR,SAAS,EACT,cAAc,GACf,EAAE;IACD,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,2CAkOA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type Bbox = [number, number, number, number];
|
|
2
|
+
/** Page size in PDF points (from PageDimension.width_pt / height_pt). */
|
|
3
|
+
export interface PagePoints {
|
|
4
|
+
wPts: number;
|
|
5
|
+
hPts: number;
|
|
6
|
+
}
|
|
7
|
+
/** Rendered size of the page image in CSS pixels (measured at runtime). */
|
|
8
|
+
export interface RenderPx {
|
|
9
|
+
wPx: number;
|
|
10
|
+
hPx: number;
|
|
11
|
+
}
|
|
12
|
+
/** A top-left-origin pixel rectangle ready for absolute positioning. */
|
|
13
|
+
export interface Rect {
|
|
14
|
+
left: number;
|
|
15
|
+
top: number;
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Convert a PDF-point, bottom-left bbox into a top-left pixel rect scaled to the
|
|
21
|
+
* rendered page image. Returns `null` for a missing/degenerate bbox or page size
|
|
22
|
+
* (callers skip rendering a box in that case).
|
|
23
|
+
*/
|
|
24
|
+
export declare function bboxToRect(bbox: Bbox | null | undefined, page: PagePoints, px: RenderPx): Rect | null;
|
|
25
|
+
//# sourceMappingURL=bboxTransform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bboxTransform.d.ts","sourceRoot":"","sources":["../../../src/composites/document-field-extraction/bboxTransform.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAEpD,yEAAyE;AACzE,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,2EAA2E;AAC3E,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAED,wEAAwE;AACxE,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,EAC7B,IAAI,EAAE,UAAU,EAChB,EAAE,EAAE,QAAQ,GACX,IAAI,GAAG,IAAI,CAkBb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fieldLabels.d.ts","sourceRoot":"","sources":["../../../src/composites/document-field-extraction/fieldLabels.ts"],"names":[],"mappings":"AAmBA,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAKjD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { SchemaPayload } from "../../schemas";
|
|
2
|
+
import { type AuditEvent } from "./FieldAuditLog";
|
|
3
|
+
type Payload = SchemaPayload<"document-field-extraction">;
|
|
4
|
+
/** Handler/data props the HOST injects after resolveUI (NOT part of the LLM
|
|
5
|
+
* payload). When `onFieldSave` is present the field cards become editable and
|
|
6
|
+
* the audit tab is shown; otherwise the card stays read-only. */
|
|
7
|
+
export interface DocumentFieldExtractionHandlers {
|
|
8
|
+
onFieldSave?: (fieldKey: string, value: string) => Promise<void>;
|
|
9
|
+
auditEvents?: AuditEvent[];
|
|
10
|
+
auditLoading?: boolean;
|
|
11
|
+
onLoadAudit?: () => void;
|
|
12
|
+
}
|
|
13
|
+
export declare function DocumentFieldExtractionResolver(p: Payload & DocumentFieldExtractionHandlers): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function DocumentFieldExtractionSkeleton(): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../../../src/composites/document-field-extraction/resolver.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAOnD,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAEjE,KAAK,OAAO,GAAG,aAAa,CAAC,2BAA2B,CAAC,CAAC;AAI1D;;kEAEkE;AAClE,MAAM,WAAW,+BAA+B;IAC9C,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACjE,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC;IAC3B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;CAC1B;AA+dD,wBAAgB,+BAA+B,CAC7C,CAAC,EAAE,OAAO,GAAG,+BAA+B,2CAqO7C;AAED,wBAAgB,+BAA+B,4CAiG9C"}
|