gotrip-fx-transaction-form 1.0.298-dev → 1.0.300-dev

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gotrip-fx-transaction-form",
3
- "version": "1.0.298-dev",
3
+ "version": "1.0.300-dev",
4
4
  "description": "FX Transaction Form ES6 module",
5
5
  "main": "index.js",
6
6
  "types": "types/index.d.ts",
@@ -0,0 +1,15 @@
1
+ type Props = {
2
+ /** Document to preview; null closes the dialog. */
3
+ documentId: number | null;
4
+ title: string;
5
+ onClose: () => void;
6
+ };
7
+ /**
8
+ * Shows the uploaded source file so an admin can check it against the chunks
9
+ * that were extracted from it.
10
+ *
11
+ * The file is fetched as a short-lived signed URL each time the dialog opens
12
+ * rather than being cached, since the URL expires after 30 minutes.
13
+ */
14
+ export declare const RagDocumentPreviewDialog: ({ documentId, title, onClose }: Props) => import("react/jsx-runtime").JSX.Element;
15
+ export {};
@@ -0,0 +1,7 @@
1
+ import { ERagDocumentStatus, ERagEmbeddingStatus } from '../../types/rag';
2
+ export declare const RagDocumentStatusBadge: ({ status }: {
3
+ status: ERagDocumentStatus;
4
+ }) => import("react/jsx-runtime").JSX.Element;
5
+ export declare const RagEmbeddingStatusBadge: ({ status }: {
6
+ status: ERagEmbeddingStatus;
7
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,45 @@
1
+ import { ERagDocumentStatus, ERagQueryOutcome, IPaginated, IRagChunk, IRagDocument, IRagDocumentFile, IRagIndexHealth, IRagPreviewResult, IRagQueryLog, IRagSettings } from '../types/rag';
2
+ export declare const useRagAdmin: () => {
3
+ listDocuments: (params: {
4
+ page?: number;
5
+ limit?: number;
6
+ status?: ERagDocumentStatus;
7
+ search?: string;
8
+ }) => Promise<IPaginated<IRagDocument>>;
9
+ uploadDocument: (file: File, title?: string) => Promise<IRagDocument>;
10
+ getDocument: (id: number) => Promise<IRagDocument>;
11
+ getDocumentFileUrl: (id: number) => Promise<IRagDocumentFile>;
12
+ updateDocument: (id: number, changes: {
13
+ title?: string;
14
+ status?: ERagDocumentStatus;
15
+ }) => Promise<IRagDocument>;
16
+ deleteDocument: (id: number) => Promise<void>;
17
+ reindexDocument: (id: number) => Promise<void>;
18
+ reindexAll: () => Promise<void>;
19
+ listChunks: (documentId: number, params: {
20
+ page?: number;
21
+ limit?: number;
22
+ }) => Promise<IPaginated<IRagChunk>>;
23
+ updateChunk: (chunkId: number, changes: {
24
+ content?: string;
25
+ section?: string | null;
26
+ sensitive?: boolean;
27
+ }) => Promise<IRagChunk>;
28
+ deleteChunk: (chunkId: number) => Promise<void>;
29
+ preview: (question: string) => Promise<IRagPreviewResult>;
30
+ listLogs: (params: {
31
+ page?: number;
32
+ limit?: number;
33
+ outcome?: ERagQueryOutcome;
34
+ }) => Promise<IPaginated<IRagQueryLog>>;
35
+ getSettings: () => Promise<IRagSettings>;
36
+ updateRetrievalSettings: (changes: {
37
+ topK?: number;
38
+ minSimilarity?: number;
39
+ }) => Promise<any>;
40
+ updateGuardSettings: (changes: {
41
+ keywords?: string[];
42
+ patterns?: string[];
43
+ }) => Promise<any>;
44
+ getIndexHealth: () => Promise<IRagIndexHealth>;
45
+ };
@@ -0,0 +1 @@
1
+ export declare const RagDocumentDetailPage: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const RagDocumentListPage: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const RagLogsPage: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const RagPlaygroundPage: () => import("react/jsx-runtime").JSX.Element;
@@ -15,7 +15,14 @@ export declare enum EChatSessionStatus {
15
15
  export declare enum EChatSenderType {
16
16
  AGENCY = "agency",
17
17
  ADMIN = "admin",
18
- SYSTEM = "system"
18
+ SYSTEM = "system",
19
+ BOT = "bot"
20
+ }
21
+ export interface IChatCitation {
22
+ index: number;
23
+ title: string;
24
+ section?: string | null;
25
+ documentId: number;
19
26
  }
20
27
  export interface UserInfo {
21
28
  id: number;
@@ -71,11 +78,15 @@ export interface IChatMedia {
71
78
  export interface IChatMessage {
72
79
  id: number;
73
80
  sessionId: number;
74
- senderId: number;
81
+ senderId: number | null;
75
82
  senderType: EChatSenderType;
76
83
  senderInfo?: SenderInfo;
77
84
  content: string;
78
85
  media?: IChatMedia[] | null;
86
+ metadata?: {
87
+ citations?: IChatCitation[];
88
+ ragQueryLogId?: number | null;
89
+ } | null;
79
90
  messageType: 'text' | 'image' | 'system_event';
80
91
  createdAt: string;
81
92
  }
@@ -0,0 +1,116 @@
1
+ export declare enum ERagDocumentStatus {
2
+ PENDING = "pending",
3
+ PROCESSING = "processing",
4
+ READY = "ready",
5
+ FAILED = "failed",
6
+ DISABLED = "disabled"
7
+ }
8
+ export declare enum ERagSourceType {
9
+ DOCX = "docx",
10
+ PDF = "pdf",
11
+ MD = "md",
12
+ TXT = "txt"
13
+ }
14
+ export declare enum ERagEmbeddingStatus {
15
+ PENDING = "pending",
16
+ INDEXED = "indexed",
17
+ SKIPPED_SENSITIVE = "skipped_sensitive",
18
+ FAILED = "failed"
19
+ }
20
+ export declare enum ERagQueryOutcome {
21
+ ANSWERED = "answered",
22
+ LOW_CONFIDENCE = "low_confidence",
23
+ GUARD_BLOCKED = "guard_blocked",
24
+ TRUNCATED = "truncated",
25
+ RATE_LIMITED = "rate_limited",
26
+ ERROR = "error"
27
+ }
28
+ export interface IRagDocument {
29
+ id: number;
30
+ publicId: string;
31
+ title: string;
32
+ sourceType: ERagSourceType;
33
+ originalFilename: string;
34
+ status: ERagDocumentStatus;
35
+ errorMessage: string | null;
36
+ chunkCount: number;
37
+ createdAt: string;
38
+ updatedAt: string;
39
+ }
40
+ export interface IRagChunk {
41
+ id: number;
42
+ documentId: number;
43
+ chunkIndex: number;
44
+ section: string | null;
45
+ content: string;
46
+ tokenCount: number;
47
+ sensitive: boolean;
48
+ embeddingStatus: ERagEmbeddingStatus;
49
+ indexedAt: string | null;
50
+ }
51
+ export interface IRagQueryLog {
52
+ id: number;
53
+ sessionId: number | null;
54
+ question: string;
55
+ retrieved: Array<{
56
+ chunkId: number;
57
+ documentId: number;
58
+ score: number;
59
+ }>;
60
+ topScore: number | null;
61
+ model: string | null;
62
+ outcome: ERagQueryOutcome;
63
+ guardReason: string | null;
64
+ latencyMs: number | null;
65
+ cacheHit: boolean;
66
+ systemPrompt: string | null;
67
+ rawPrompt: string | null;
68
+ rawResponse: string | null;
69
+ createdAt: string;
70
+ }
71
+ export interface IRagPreviewResult {
72
+ retrieved: Array<{
73
+ chunkId: number;
74
+ documentId: number;
75
+ documentTitle: string;
76
+ section: string | null;
77
+ score: number;
78
+ preview: string;
79
+ }>;
80
+ answer: string;
81
+ citations: Array<{
82
+ index: number;
83
+ title: string;
84
+ section: string | null;
85
+ }>;
86
+ outcome: ERagQueryOutcome;
87
+ }
88
+ export interface IRagSettings {
89
+ retrieval: {
90
+ topK: number;
91
+ minSimilarity: number;
92
+ };
93
+ guard: {
94
+ keywords: string[];
95
+ patterns: string[];
96
+ };
97
+ kbVersion: number;
98
+ }
99
+ export interface IRagIndexHealth {
100
+ vectorStoreReachable: boolean;
101
+ expectedPoints: number;
102
+ actualPoints: number | null;
103
+ inSync: boolean;
104
+ }
105
+ export interface IRagDocumentFile {
106
+ url: string;
107
+ expiresAt: number;
108
+ filename: string;
109
+ sourceType: ERagSourceType;
110
+ }
111
+ export interface IPaginated<T> {
112
+ data: T[];
113
+ total: number;
114
+ page: number;
115
+ limit: number;
116
+ }
@@ -73,5 +73,6 @@ export declare enum EPermissionKey {
73
73
  CREATE_INSURANCE_ORDER = "CREATE_INSURANCE_ORDER",
74
74
  VIEW_INSURANCE_LIST = "VIEW_INSURANCE_LIST",
75
75
  UPDATE_INSURANCE_ORDER = "UPDATE_INSURANCE_ORDER",
76
- VIEW_INSURANCE_DETAIL = "VIEW_INSURANCE_DETAIL"
76
+ VIEW_INSURANCE_DETAIL = "VIEW_INSURANCE_DETAIL",
77
+ RAG_ADMIN = "RAG_ADMIN"
77
78
  }
@@ -1,3 +1,5 @@
1
+ export declare const showSuccessToast: (message: string, duration?: number) => void;
2
+ export declare const showErrorToast: (message: string, duration?: number) => void;
1
3
  export declare const showToast: (message: string, type: "success" | "error" | "info", duration?: number, options?: {
2
4
  position?: "top-right" | "top-left" | "bottom-right" | "bottom-left";
3
5
  title?: string;