@aiquants/enrichment-react 0.3.0 → 0.5.0
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/README.md +128 -71
- package/dist/index.cjs +3 -1
- package/dist/index.d.cts +236 -149
- package/dist/index.d.ts +236 -149
- package/dist/index.js +3 -1
- package/package.json +6 -6
package/dist/index.d.cts
CHANGED
|
@@ -1,17 +1,173 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import React, { ReactNode, JSX } from "react";
|
|
2
|
+
import { CircuitBreakerStatus, SearchDegradationReason, SearchMode, SearchQualityTier, CircuitBreakerService, SearchFusion, FilterableConfidentialityLevel, DiffLinePage, DocumentHistory, DocumentComparison, DocumentChangeFeedPage, DocumentCaptureAnswer, SourceSpec, ConfidentialityLevel, ReadableEntry, PipelineRunStatus, StoredTerm, PipelineStepKey, RestrictedRunMark, RemovableProtectionScheme, UnlockDisposition, CopyReason, RestrictedIngestMark, ChunkBodyFidelity, ChunkChangeKind, DocumentStateCause, DocumentFacet, FacetChangeCounts, JsonValue, EnrichmentStageKey, ChunkSource, PipelinePhase, PipelineStepMetric, DocumentKind, StepGate, PipelineFlow, NothingToReadToken, PipelineStepStatus, PipelineTrigger, RunTerminalStepOutcome, LedgerStepKey, RestrictedFailureMark } from "@aiquants/enrichment-core";
|
|
3
|
+
import { ResourceOutcome, ConsoleUiLabels } from "@aiquants/console-ui/core";
|
|
4
|
+
interface DocumentSearchParams {
|
|
5
|
+
readonly q: string;
|
|
6
|
+
readonly mode: SearchMode;
|
|
7
|
+
readonly limit: number;
|
|
8
|
+
readonly threshold?: number;
|
|
9
|
+
readonly fusion?: SearchFusion;
|
|
10
|
+
readonly rrf_k?: number;
|
|
11
|
+
readonly alpha?: number;
|
|
12
|
+
readonly department_id?: number;
|
|
13
|
+
readonly confidentiality_level?: FilterableConfidentialityLevel;
|
|
14
|
+
readonly mime_type?: string;
|
|
15
|
+
readonly tag?: string;
|
|
16
|
+
}
|
|
17
|
+
type DocumentVectorScoreKind = "cosine" | "bm25" | "mixed";
|
|
18
|
+
interface DocumentVectorScore {
|
|
19
|
+
readonly value: number;
|
|
20
|
+
readonly kind: DocumentVectorScoreKind;
|
|
21
|
+
}
|
|
22
|
+
interface DocumentScores {
|
|
23
|
+
readonly fused: number;
|
|
24
|
+
readonly vector: DocumentVectorScore | null;
|
|
25
|
+
readonly lexical_rank: number | null;
|
|
26
|
+
readonly graph_rank: number | null;
|
|
27
|
+
}
|
|
28
|
+
interface DocumentGraphRelation {
|
|
29
|
+
readonly relation: string;
|
|
30
|
+
readonly target_name: string;
|
|
31
|
+
}
|
|
32
|
+
interface DocumentSearchHit {
|
|
33
|
+
readonly metadata_id: number | null;
|
|
34
|
+
readonly file_uri: string | null;
|
|
35
|
+
readonly file_name: string | null;
|
|
36
|
+
readonly mime_type: string | null;
|
|
37
|
+
readonly folder_path: string | null;
|
|
38
|
+
readonly confidentiality_level: string | null;
|
|
39
|
+
readonly department_id: number | null;
|
|
40
|
+
readonly created_by: string | null;
|
|
41
|
+
readonly mtime: string | null;
|
|
42
|
+
readonly ai_summary: string | null;
|
|
43
|
+
readonly tags: readonly string[] | null;
|
|
44
|
+
readonly structured_data: unknown;
|
|
45
|
+
readonly scores: DocumentScores;
|
|
46
|
+
readonly graph_relations: readonly DocumentGraphRelation[] | null;
|
|
47
|
+
}
|
|
48
|
+
interface DocumentSearchAuthzScopes {
|
|
49
|
+
readonly row_scope_applied: boolean;
|
|
50
|
+
readonly column_scope_applied: boolean;
|
|
51
|
+
readonly hidden_columns: readonly string[];
|
|
52
|
+
}
|
|
53
|
+
interface DocumentSearchExecutedTiers {
|
|
54
|
+
readonly lexical: boolean;
|
|
55
|
+
readonly dense: boolean;
|
|
56
|
+
readonly sparse: boolean;
|
|
57
|
+
readonly graph: boolean;
|
|
58
|
+
}
|
|
59
|
+
interface DocumentSearchMetadata {
|
|
60
|
+
readonly search_mode: SearchMode;
|
|
61
|
+
readonly requested_mode: SearchMode;
|
|
62
|
+
readonly executed_tiers: DocumentSearchExecutedTiers;
|
|
63
|
+
readonly quality_tier: SearchQualityTier;
|
|
64
|
+
readonly is_degraded: boolean;
|
|
65
|
+
readonly degradation_reasons: readonly string[];
|
|
66
|
+
readonly circuit_breaker_status: Readonly<Record<CircuitBreakerService, CircuitBreakerStatus>>;
|
|
67
|
+
readonly execution_time_ms: number;
|
|
68
|
+
}
|
|
69
|
+
interface DocumentSearchAnswer {
|
|
70
|
+
readonly hits: readonly DocumentSearchHit[];
|
|
71
|
+
readonly authz_scopes: DocumentSearchAuthzScopes;
|
|
72
|
+
readonly search_metadata: DocumentSearchMetadata;
|
|
73
|
+
}
|
|
74
|
+
interface VariantComparisonInput {
|
|
75
|
+
readonly query: string;
|
|
76
|
+
readonly strategy_ids: readonly [
|
|
77
|
+
number,
|
|
78
|
+
number
|
|
79
|
+
];
|
|
80
|
+
readonly limit: number;
|
|
81
|
+
}
|
|
82
|
+
interface VariantHit {
|
|
83
|
+
readonly metadata_id: number;
|
|
84
|
+
readonly chunk_index: number;
|
|
85
|
+
readonly text: string | null;
|
|
86
|
+
readonly score: number;
|
|
87
|
+
}
|
|
88
|
+
interface VariantResult {
|
|
89
|
+
readonly strategy_id: number;
|
|
90
|
+
readonly execution_ms: number;
|
|
91
|
+
readonly dense_ran: boolean;
|
|
92
|
+
readonly degradation_reasons: readonly string[];
|
|
93
|
+
readonly hits: readonly VariantHit[];
|
|
94
|
+
}
|
|
95
|
+
interface VariantComparisonAnswer {
|
|
96
|
+
readonly results: readonly VariantResult[];
|
|
97
|
+
readonly text_hidden: boolean;
|
|
98
|
+
}
|
|
99
|
+
declare const HIDDEN_FIELD_TEXT = "\u975E\u8868\u793A (\u5217\u306E\u30B9\u30B3\u30FC\u30D7)";
|
|
100
|
+
declare const SEARCH_MODE_LABELS: Readonly<Record<SearchMode, {
|
|
101
|
+
readonly label: string;
|
|
102
|
+
readonly description: string;
|
|
103
|
+
}>>;
|
|
104
|
+
declare const SEARCH_FUSION_LABELS: Readonly<Record<SearchFusion, string>>;
|
|
105
|
+
declare const QUALITY_TIER_LABELS: Readonly<Record<SearchQualityTier, string>>;
|
|
106
|
+
declare const BREAKER_STATE_LABELS: Readonly<Record<CircuitBreakerStatus, string>>;
|
|
107
|
+
declare const DEGRADATION_REASON_LABELS: Readonly<Record<SearchDegradationReason, string>>;
|
|
108
|
+
declare function degradationReasonText(code: string): string;
|
|
109
|
+
declare const SCORE_DECIMALS = 3;
|
|
110
|
+
declare function vectorScoreText(score: DocumentVectorScore): string;
|
|
111
|
+
interface RankAgreement {
|
|
112
|
+
readonly sharedCount: number;
|
|
113
|
+
readonly overlapRatio: number | null;
|
|
114
|
+
readonly meanAbsoluteRankDifference: number | null;
|
|
8
115
|
}
|
|
116
|
+
declare function rankAgreement(a: readonly string[], b: readonly string[]): RankAgreement;
|
|
117
|
+
declare function variantHitKey(hit: Pick<VariantHit, "metadata_id" | "chunk_index">): string;
|
|
9
118
|
interface DegradedSearchBannerProps {
|
|
10
|
-
metadata:
|
|
11
|
-
|
|
119
|
+
readonly metadata: Pick<DocumentSearchMetadata, "is_degraded" | "requested_mode" | "search_mode" | "executed_tiers" | "quality_tier" | "degradation_reasons">;
|
|
120
|
+
readonly testId: string;
|
|
12
121
|
}
|
|
13
|
-
declare
|
|
14
|
-
|
|
122
|
+
declare function DegradedSearchBanner({ metadata, testId }: DegradedSearchBannerProps): ReactNode;
|
|
123
|
+
interface DocumentComparisonQuery {
|
|
124
|
+
readonly fromStateId: number;
|
|
125
|
+
readonly toStateId: number;
|
|
126
|
+
}
|
|
127
|
+
type DiffLineTarget = {
|
|
128
|
+
readonly facet: "text" | "summary";
|
|
129
|
+
} | {
|
|
130
|
+
readonly facet: "chunks";
|
|
131
|
+
readonly entry: number;
|
|
132
|
+
};
|
|
133
|
+
type DiffLinePageQuery = DocumentComparisonQuery & DiffLineTarget & {
|
|
134
|
+
readonly hunk: number;
|
|
135
|
+
readonly offset: number;
|
|
136
|
+
readonly limit: number;
|
|
137
|
+
};
|
|
138
|
+
type DiffLinePageReader = (query: DiffLinePageQuery, signal: AbortSignal) => Promise<ResourceOutcome<DiffLinePage>>;
|
|
139
|
+
interface DocumentHistoryHost {
|
|
140
|
+
readonly loadHistory: (metadataId: number, signal: AbortSignal) => Promise<ResourceOutcome<DocumentHistory>>;
|
|
141
|
+
readonly compare: (query: DocumentComparisonQuery, signal: AbortSignal) => Promise<ResourceOutcome<DocumentComparison>>;
|
|
142
|
+
readonly readLines: DiffLinePageReader;
|
|
143
|
+
readonly loadChanges: (cursor: string | null, signal: AbortSignal) => Promise<ResourceOutcome<DocumentChangeFeedPage>>;
|
|
144
|
+
}
|
|
145
|
+
type DocumentStateCapture = (metadataId: number) => Promise<ResourceOutcome<DocumentCaptureAnswer>>;
|
|
146
|
+
type DocumentHistoryTarget = {
|
|
147
|
+
readonly kind: "latest_state";
|
|
148
|
+
} | {
|
|
149
|
+
readonly kind: "run";
|
|
150
|
+
readonly runId: number;
|
|
151
|
+
} | {
|
|
152
|
+
readonly kind: "state";
|
|
153
|
+
readonly stateId: number;
|
|
154
|
+
};
|
|
155
|
+
interface DocumentChangeFeedProps {
|
|
156
|
+
readonly host: Pick<DocumentHistoryHost, "loadChanges">;
|
|
157
|
+
readonly onOpen?: (metadataId: number, stateId: number) => void;
|
|
158
|
+
}
|
|
159
|
+
declare function DocumentChangeFeed({ host, onOpen }: DocumentChangeFeedProps): ReactNode;
|
|
160
|
+
type DocumentHistoryReads = Pick<DocumentHistoryHost, "loadHistory" | "compare" | "readLines">;
|
|
161
|
+
interface DocumentHistoryInspectorProps {
|
|
162
|
+
readonly host: DocumentHistoryReads;
|
|
163
|
+
readonly metadataId: number;
|
|
164
|
+
readonly target: DocumentHistoryTarget;
|
|
165
|
+
readonly openRequest: number;
|
|
166
|
+
readonly onClose: () => void;
|
|
167
|
+
readonly returnFocusFallback: () => HTMLElement | null;
|
|
168
|
+
readonly captureState?: DocumentStateCapture;
|
|
169
|
+
}
|
|
170
|
+
declare function DocumentHistoryInspector({ host, metadataId, target, openRequest, onClose, returnFocusFallback, captureState }: DocumentHistoryInspectorProps): ReactNode;
|
|
15
171
|
interface DocumentIngestLabel {
|
|
16
172
|
labelKey: string;
|
|
17
173
|
category: "user" | "system" | "domain";
|
|
@@ -38,9 +194,14 @@ interface RecentIngestLastRun {
|
|
|
38
194
|
runId: number;
|
|
39
195
|
status: PipelineRunStatus;
|
|
40
196
|
retryScheduled: boolean;
|
|
41
|
-
failedStepKey: PipelineStepKey | null;
|
|
197
|
+
failedStepKey: StoredTerm<PipelineStepKey> | null;
|
|
42
198
|
finishedAt: string | null;
|
|
43
199
|
}
|
|
200
|
+
interface RecentIngestUnlock {
|
|
201
|
+
protectionScheme: RemovableProtectionScheme;
|
|
202
|
+
disposition: UnlockDisposition;
|
|
203
|
+
copyReason: CopyReason | null;
|
|
204
|
+
}
|
|
44
205
|
interface RecentIngestItem {
|
|
45
206
|
id: number;
|
|
46
207
|
fileUri: string;
|
|
@@ -52,8 +213,10 @@ interface RecentIngestItem {
|
|
|
52
213
|
createdAt: string;
|
|
53
214
|
updatedAt: string;
|
|
54
215
|
errorMessage?: string | null;
|
|
55
|
-
lastRun: RecentIngestLastRun | null;
|
|
216
|
+
lastRun: ReadableEntry<RecentIngestLastRun> | RestrictedRunMark | null;
|
|
217
|
+
unlock: RecentIngestUnlock | null;
|
|
56
218
|
}
|
|
219
|
+
type RecentIngestEntry = ReadableEntry<RecentIngestItem> | RestrictedIngestMark;
|
|
57
220
|
interface IngestDomainOption {
|
|
58
221
|
readonly key: string;
|
|
59
222
|
readonly label: string;
|
|
@@ -66,6 +229,7 @@ type IngestRowAction = {
|
|
|
66
229
|
readonly kind: "blocked";
|
|
67
230
|
readonly reason: string;
|
|
68
231
|
};
|
|
232
|
+
declare const NO_ENRICHMENT_RECORD_TEXT = "\u53D6\u308A\u8FBC\u307F\u306E\u8A18\u9332\u306A\u3057";
|
|
69
233
|
declare function ingestRowAction(item: Pick<RecentIngestItem, "syncStatus" | "isCurrent">): IngestRowAction;
|
|
70
234
|
interface IngestCapabilityPolicy {
|
|
71
235
|
confidentialityLevel: ConfidentialityLevel;
|
|
@@ -74,18 +238,50 @@ interface IngestCapabilityPolicy {
|
|
|
74
238
|
}
|
|
75
239
|
interface DocumentIngestConsoleProps {
|
|
76
240
|
tenantId: string;
|
|
241
|
+
sources: readonly SourceSpec[];
|
|
77
242
|
policies?: readonly IngestCapabilityPolicy[];
|
|
78
243
|
domainOptions: readonly IngestDomainOption[];
|
|
79
|
-
recentItems?:
|
|
244
|
+
recentItems?: readonly RecentIngestEntry[];
|
|
80
245
|
inspectionResult?: FileInspectionResult | null;
|
|
81
246
|
isSubmitting?: boolean;
|
|
82
247
|
isInspecting?: boolean;
|
|
248
|
+
isBusy?: boolean;
|
|
249
|
+
promotingId?: number | null;
|
|
83
250
|
onInspectUri?: (fileUri: string) => void;
|
|
84
251
|
onIngestDocument?: (payload: DocumentIngestPayload) => void;
|
|
85
252
|
onRetryItem?: (fileId: number) => void;
|
|
86
253
|
onShowHistory?: (metadataId: number) => void;
|
|
87
|
-
|
|
88
|
-
|
|
254
|
+
onPromoteUnlockedCopy?: (metadataId: number) => void;
|
|
255
|
+
listRefusal?: string;
|
|
256
|
+
}
|
|
257
|
+
declare function DocumentIngestConsole({ policies, tenantId, sources, domainOptions, recentItems, inspectionResult, isSubmitting, isInspecting, isBusy, promotingId, onInspectUri, onIngestDocument, onRetryItem, onShowHistory, onPromoteUnlockedCopy, listRefusal, }: DocumentIngestConsoleProps): ReactNode;
|
|
258
|
+
declare const FACET_LABELS: Readonly<Record<DocumentFacet, string>>;
|
|
259
|
+
declare const DOCUMENT_STATE_CAUSE_LABELS: Readonly<Record<DocumentStateCause, string>>;
|
|
260
|
+
declare const CHUNK_CHANGE_KIND_LABELS: Readonly<Record<ChunkChangeKind, string>>;
|
|
261
|
+
declare const CHUNK_BODY_FIDELITY_LABELS: Readonly<Record<ChunkBodyFidelity, string>>;
|
|
262
|
+
declare const WHITESPACE_NORMALIZED_NOTE = "\u30C1\u30E3\u30F3\u30AF\u306E\u672C\u6587\u306F\u3053\u306E\u533A\u9593\u306E\u6587\u3092\u7A7A\u767D\u3067\u7E4B\u304E\u76F4\u3057\u305F\u5F62\u3067\u3059\u3002";
|
|
263
|
+
declare const UNVERIFIED_CHUNK_NOTE = "\u3053\u306E\u65AD\u7247\u306F\u3053\u306E\u72B6\u614B\u306E\u62BD\u51FA\u672C\u6587\u3068\u5BFE\u5FDC\u3057\u307E\u305B\u3093\u3002";
|
|
264
|
+
declare const CHUNKING_ONLY_NOTE = "\u672C\u6587\u306F\u540C\u3058\u3067\u3001\u30C1\u30E3\u30F3\u30AF\u306E\u5207\u308A\u65B9\u3060\u3051\u304C\u5909\u308F\u308A\u307E\u3057\u305F\u3002";
|
|
265
|
+
declare const FIELD_LABELS: Readonly<Record<string, string>>;
|
|
266
|
+
declare function fieldLabel(field: string): string;
|
|
267
|
+
declare const RESTRICTED_DOCUMENT_TEXT = "\u9694\u96E2 (RESTRICTED) \u306E\u6587\u66F8";
|
|
268
|
+
declare const RESTRICTED_STATE_TEXT = "\u9694\u96E2\u3055\u308C\u3066\u3044\u305F\u671F\u9593\u306E\u72B6\u614B";
|
|
269
|
+
declare const RESTRICTED_RUN_TEXT = "\u9694\u96E2\u3055\u308C\u3066\u3044\u305F\u671F\u9593\u306E\u5B9F\u884C";
|
|
270
|
+
declare const NO_PREVIOUS_RECORD_TEXT = "\u76F4\u524D\u306E\u8A18\u9332\u3068\u306E\u6BD4\u8F03\u306F\u3042\u308A\u307E\u305B\u3093\u3002";
|
|
271
|
+
declare const FAILED_RUN_STATE_MARK = "\u5931\u6557\u3057\u305F\u5B9F\u884C\u306E\u5F8C\u306E\u72B6\u614B";
|
|
272
|
+
declare const UNRECORDED_RUN_MARK = "\u8A18\u9332\u3055\u308C\u3066\u3044\u307E\u305B\u3093";
|
|
273
|
+
declare const MODEL_ONLY_CHANGE_MARK = "\u30BD\u30FC\u30B9\u306F\u540C\u3058\u3067\u3001\u30E2\u30C7\u30EB\u306E\u51FA\u529B\u3060\u3051\u304C\u5909\u308F\u308A\u307E\u3057\u305F";
|
|
274
|
+
declare function unrecordedRunsMark(runIds: readonly number[]): string;
|
|
275
|
+
declare function revisionLabel(revision: number): string;
|
|
276
|
+
declare function revisionTransitionText(previousRevision: number, revision: number): string;
|
|
277
|
+
declare function facetCountsText(counts: FacetChangeCounts): string;
|
|
278
|
+
declare function jsonValueText(value: JsonValue): string;
|
|
279
|
+
declare const HISTORY_REFUSAL = "\u6587\u66F8\u306E\u5C65\u6B74\u3092\u95B2\u89A7\u3059\u308B\u6A29\u9650\u304C\u3042\u308A\u307E\u305B\u3093\u3002";
|
|
280
|
+
declare function historyFailureSentence(labels: ConsoleUiLabels, failure: {
|
|
281
|
+
readonly status: number | null;
|
|
282
|
+
readonly reason: string;
|
|
283
|
+
}, subject: string): string;
|
|
284
|
+
declare function historyFailedSentence(subject: string): (reason: string) => string;
|
|
89
285
|
type StrategyProvenance = "tenant" | "system";
|
|
90
286
|
interface EnrichmentStrategyRow {
|
|
91
287
|
id: number;
|
|
@@ -103,9 +299,10 @@ interface EnrichmentStrategyBoardProps {
|
|
|
103
299
|
onToggleStage?: (row: EnrichmentStrategyRow, stage: EnrichmentStageKey, enabled: boolean) => void | Promise<void>;
|
|
104
300
|
isUpdating?: boolean;
|
|
105
301
|
}
|
|
302
|
+
declare const INERT_STAGE_NOTE = "\u8981\u7D04\u751F\u6210\u30FB\u69CB\u9020\u5316\u62BD\u51FA\u30FB\u30A2\u30BB\u30C3\u30C8\u62BD\u51FA\u306E\u5207\u308A\u66FF\u3048\u306F\u4FDD\u5B58\u3055\u308C\u307E\u3059\u304C\u3001\u4ECA\u306F\u52B9\u304D\u307E\u305B\u3093 (\u30C9\u30E1\u30A4\u30F3\u306F\u30E2\u30C7\u30EB\u304C\u6C7A\u3081\u308B\u306E\u3067\u3001\u6295\u5F71\u306E\u6BB5\u3060\u3051\u304C\u6226\u7565\u3092\u8AAD\u307F\u307E\u3059)\u3002";
|
|
106
303
|
type GateState$1 = "open" | "closed" | "unmeasured" | "absent";
|
|
107
304
|
declare function gateStateOf(featureFlagKey: string | null, flags: Readonly<Record<string, boolean>>): GateState$1;
|
|
108
|
-
declare function EnrichmentStrategyBoard({ strategies, featureFlags, onToggleStage, isUpdating }: EnrichmentStrategyBoardProps): React
|
|
305
|
+
declare function EnrichmentStrategyBoard({ strategies, featureFlags, onToggleStage, isUpdating }: EnrichmentStrategyBoardProps): React.JSX.Element;
|
|
109
306
|
interface ServiceHealthStatus {
|
|
110
307
|
serviceName: string;
|
|
111
308
|
category: "vector" | "graph" | "cache" | "database" | "api";
|
|
@@ -133,134 +330,31 @@ interface InfrastructureHealthMonitorProps {
|
|
|
133
330
|
onRefresh?: () => void;
|
|
134
331
|
className?: string;
|
|
135
332
|
}
|
|
136
|
-
declare function InfrastructureHealthMonitor({ health, isRefreshing, onRefresh, className }: InfrastructureHealthMonitorProps): React
|
|
137
|
-
|
|
138
|
-
readonly
|
|
333
|
+
declare function InfrastructureHealthMonitor({ health, isRefreshing, onRefresh, className }: InfrastructureHealthMonitorProps): React.JSX.Element;
|
|
334
|
+
interface DeveloperSearchPreset {
|
|
335
|
+
readonly id: string;
|
|
336
|
+
readonly title: string;
|
|
139
337
|
readonly description: string;
|
|
140
|
-
|
|
141
|
-
type FusionStrategy = "rrf" | "linear";
|
|
142
|
-
type ConfidentialityLevelFilter = "ALL" | "PUBLIC" | "INTERNAL" | "DEPARTMENT" | "CONFIDENTIAL";
|
|
143
|
-
interface SearchHitScoreBreakdown {
|
|
144
|
-
fused: number;
|
|
145
|
-
vector?: {
|
|
146
|
-
value: number;
|
|
147
|
-
kind: "cosine" | "bm25" | "mixed";
|
|
148
|
-
};
|
|
149
|
-
lexicalRank?: number;
|
|
150
|
-
graphRank?: number;
|
|
151
|
-
}
|
|
152
|
-
interface SearchHitGraphRelation {
|
|
153
|
-
relation: string;
|
|
154
|
-
target_name: string;
|
|
155
|
-
}
|
|
156
|
-
interface MetadataSearchHit {
|
|
157
|
-
id: number;
|
|
158
|
-
file_uri: string;
|
|
159
|
-
file_name: string;
|
|
160
|
-
mime_type: string;
|
|
161
|
-
folder_path: string | null;
|
|
162
|
-
confidentiality_level: string;
|
|
163
|
-
department_id: number | null;
|
|
164
|
-
created_by: string;
|
|
165
|
-
mtime: string;
|
|
166
|
-
ai_summary: string | null;
|
|
167
|
-
tags: string[] | null;
|
|
168
|
-
structured_data: unknown;
|
|
169
|
-
scores?: SearchHitScoreBreakdown;
|
|
170
|
-
graph_relations?: SearchHitGraphRelation[];
|
|
171
|
-
}
|
|
172
|
-
interface MetadataSearchParams {
|
|
173
|
-
q: string;
|
|
174
|
-
mode: SearchMode;
|
|
175
|
-
limit: number;
|
|
176
|
-
threshold?: number;
|
|
177
|
-
fusion?: FusionStrategy;
|
|
178
|
-
rrf_k?: number;
|
|
179
|
-
alpha?: number;
|
|
180
|
-
department_id?: number;
|
|
181
|
-
confidentiality_level?: ConfidentialityLevelFilter;
|
|
182
|
-
mime_type?: string;
|
|
183
|
-
tag?: string;
|
|
184
|
-
}
|
|
185
|
-
interface SearchAuthzScopes {
|
|
186
|
-
rowScopeApplied: boolean;
|
|
187
|
-
columnScopeApplied: boolean;
|
|
188
|
-
}
|
|
189
|
-
interface MetadataSearchResult {
|
|
190
|
-
count: number;
|
|
191
|
-
hits: MetadataSearchHit[];
|
|
192
|
-
authzScopes: SearchAuthzScopes;
|
|
193
|
-
search_metadata: SearchMetadataLike & {
|
|
194
|
-
requested_mode?: SearchMode;
|
|
195
|
-
executed_tiers?: {
|
|
196
|
-
sql: boolean;
|
|
197
|
-
dense: boolean;
|
|
198
|
-
sparse: boolean;
|
|
199
|
-
graph: boolean;
|
|
200
|
-
};
|
|
201
|
-
execution_time_ms?: number;
|
|
202
|
-
circuit_breaker_status?: Record<string, string>;
|
|
203
|
-
};
|
|
338
|
+
readonly params: Pick<DocumentSearchParams, "mode" | "limit"> & Partial<Pick<DocumentSearchParams, "threshold" | "fusion" | "rrf_k">>;
|
|
204
339
|
}
|
|
205
|
-
|
|
340
|
+
declare const SEARCH_PRESETS: readonly DeveloperSearchPreset[];
|
|
341
|
+
declare const CONFIDENTIALITY_LEVEL_LABELS: Readonly<Record<FilterableConfidentialityLevel, string>>;
|
|
206
342
|
interface MetadataSearchWorkbenchProps {
|
|
207
|
-
tenantId: string;
|
|
208
|
-
onSearch: (params:
|
|
209
|
-
initialParams?: Partial<
|
|
210
|
-
initialResult?: MetadataSearchResult | null;
|
|
211
|
-
circuitBreakerStatus?: Record<string, CircuitBreakerState>;
|
|
212
|
-
isLoading?: boolean;
|
|
213
|
-
}
|
|
214
|
-
interface DeveloperSearchPreset {
|
|
215
|
-
id: string;
|
|
216
|
-
title: string;
|
|
217
|
-
description: string;
|
|
218
|
-
params: Pick<MetadataSearchParams, "mode" | "limit"> & Partial<Pick<MetadataSearchParams, "threshold" | "fusion" | "rrf_k">>;
|
|
343
|
+
readonly tenantId: string;
|
|
344
|
+
readonly onSearch: (params: DocumentSearchParams, signal: AbortSignal) => Promise<DocumentSearchAnswer>;
|
|
345
|
+
readonly initialParams?: Partial<DocumentSearchParams>;
|
|
219
346
|
}
|
|
220
|
-
declare
|
|
221
|
-
declare function MetadataSearchWorkbench({ tenantId, onSearch, initialParams, initialResult, circuitBreakerStatus, isLoading: externalLoading }: MetadataSearchWorkbenchProps): React.JSX.Element;
|
|
347
|
+
declare function MetadataSearchWorkbench({ tenantId, onSearch, initialParams }: MetadataSearchWorkbenchProps): ReactNode;
|
|
222
348
|
interface ComparisonVariant {
|
|
223
349
|
readonly strategyId: number;
|
|
224
350
|
readonly label: string;
|
|
225
351
|
readonly embeddingModel: string;
|
|
226
352
|
}
|
|
227
|
-
interface ComparisonHit {
|
|
228
|
-
readonly id: string;
|
|
229
|
-
readonly title: string;
|
|
230
|
-
readonly score: number;
|
|
231
|
-
}
|
|
232
|
-
interface ComparisonVariantResult {
|
|
233
|
-
readonly strategyId: number;
|
|
234
|
-
readonly executionMs: number;
|
|
235
|
-
readonly hits: readonly ComparisonHit[];
|
|
236
|
-
}
|
|
237
|
-
interface ComparisonInput {
|
|
238
|
-
readonly query: string;
|
|
239
|
-
readonly strategyIds: readonly [
|
|
240
|
-
number,
|
|
241
|
-
number
|
|
242
|
-
];
|
|
243
|
-
readonly limit: number;
|
|
244
|
-
}
|
|
245
|
-
type ComparisonOutcome = {
|
|
246
|
-
readonly ok: true;
|
|
247
|
-
readonly results: readonly ComparisonVariantResult[];
|
|
248
|
-
} | {
|
|
249
|
-
readonly ok: false;
|
|
250
|
-
readonly reason: string;
|
|
251
|
-
};
|
|
252
353
|
interface ModelComparisonWorkbenchProps {
|
|
253
|
-
variants: readonly ComparisonVariant[];
|
|
254
|
-
onCompare: (input:
|
|
354
|
+
readonly variants: readonly ComparisonVariant[];
|
|
355
|
+
readonly onCompare: (input: VariantComparisonInput, signal: AbortSignal) => Promise<VariantComparisonAnswer>;
|
|
255
356
|
}
|
|
256
357
|
declare const SCORE_DISPLAY_DECIMALS = 4;
|
|
257
|
-
declare function formatComparisonScore(score: number): string;
|
|
258
|
-
interface RankAgreement {
|
|
259
|
-
readonly sharedCount: number;
|
|
260
|
-
readonly overlapRatio: number | null;
|
|
261
|
-
readonly meanAbsoluteRankDifference: number | null;
|
|
262
|
-
}
|
|
263
|
-
declare function rankAgreement(a: readonly string[], b: readonly string[]): RankAgreement;
|
|
264
358
|
declare function ModelComparisonWorkbench({ variants, onCompare }: ModelComparisonWorkbenchProps): ReactNode;
|
|
265
359
|
interface OntologyClassItem {
|
|
266
360
|
name: string;
|
|
@@ -319,19 +413,6 @@ declare function stepGateState(gates: readonly StepGate[], featureFlags: Readonl
|
|
|
319
413
|
declare function stepGatePolicy(gates: readonly StepGate[]): StepGatePolicy;
|
|
320
414
|
declare function gateCaption(state: StepGateState, policy: StepGatePolicy): string;
|
|
321
415
|
declare function PipelineFlowViewer({ featureFlags, metrics, metricSampleWindow, selectedKind: controlledKind, onSelectKind, selectedStepKey: controlledStepKey, onSelectStep }: PipelineFlowViewerProps): ReactNode;
|
|
322
|
-
interface PipelineRunInspectorProps {
|
|
323
|
-
metadataId: number;
|
|
324
|
-
runs: readonly PipelineRunRecord[];
|
|
325
|
-
selectedRunId: number | null;
|
|
326
|
-
onSelectRun: (runId: number) => void;
|
|
327
|
-
isLoading: boolean;
|
|
328
|
-
failure: string | null;
|
|
329
|
-
onClose: () => void;
|
|
330
|
-
openRequest: number;
|
|
331
|
-
returnFocusFallback: () => HTMLElement | null;
|
|
332
|
-
}
|
|
333
|
-
declare const STEP_CARDS_OPEN_LIMIT = 8;
|
|
334
|
-
declare function PipelineRunInspector({ metadataId, runs, selectedRunId, onSelectRun, isLoading, failure, onClose, openRequest, returnFocusFallback }: PipelineRunInspectorProps): ReactNode;
|
|
335
416
|
declare const FLOW_NODE_TEXT: {
|
|
336
417
|
readonly inset: 12;
|
|
337
418
|
readonly labelFontSize: 13;
|
|
@@ -385,6 +466,10 @@ type PipelineRunPresentationKey = PipelineRunStatus | "FAILED_RETRY_SCHEDULED";
|
|
|
385
466
|
declare const PIPELINE_RUN_STATUS_PRESENTATION: Readonly<Record<PipelineRunPresentationKey, StatusPresentation>>;
|
|
386
467
|
declare const PIPELINE_STEP_STATUS_PRESENTATION: Readonly<Record<PipelineStepStatus, StepStatusPresentation>>;
|
|
387
468
|
declare const PIPELINE_TRIGGER_LABELS: Readonly<Record<PipelineTrigger, string>>;
|
|
469
|
+
declare const RUN_TERMINAL_STEP_LABEL = "\u6587\u66F8\u306E\u72B6\u614B\u306E\u8A18\u9332";
|
|
470
|
+
declare function ledgerStepLabel(key: StoredTerm<LedgerStepKey>): string;
|
|
471
|
+
declare function documentKindLabel(kind: StoredTerm<DocumentKind>): string;
|
|
472
|
+
declare const RUN_TERMINAL_STEP_OUTCOME_LABELS: Readonly<Record<RunTerminalStepOutcome, string>>;
|
|
388
473
|
declare const UNFINISHED_LABEL = "\u672A\u5B8C\u4E86";
|
|
389
474
|
declare function pipelineRunPresentationKey(run: {
|
|
390
475
|
readonly status: PipelineRunStatus;
|
|
@@ -461,6 +546,7 @@ interface FailedSyncItem {
|
|
|
461
546
|
error_message?: string | null;
|
|
462
547
|
failed_at: string | null;
|
|
463
548
|
}
|
|
549
|
+
type FailedSyncEntry = ReadableEntry<FailedSyncItem> | RestrictedFailureMark;
|
|
464
550
|
interface SyncStatusCounts {
|
|
465
551
|
PENDING?: number;
|
|
466
552
|
EXTRACTING?: number;
|
|
@@ -475,11 +561,12 @@ interface SyncStatusCounts {
|
|
|
475
561
|
interface SyncStatusMonitorProps {
|
|
476
562
|
counts: SyncStatusCounts;
|
|
477
563
|
totalFiles: number;
|
|
478
|
-
failedItems?:
|
|
564
|
+
failedItems?: readonly FailedSyncEntry[];
|
|
479
565
|
onRetryAll?: () => void | Promise<void>;
|
|
480
566
|
onRetryItem?: (id: string | number, fileUri: string) => void | Promise<void>;
|
|
481
567
|
isRetrying?: boolean;
|
|
482
568
|
onRefresh?: () => void;
|
|
569
|
+
listRefusal?: string;
|
|
483
570
|
}
|
|
484
|
-
declare function SyncStatusMonitor({ counts, totalFiles, failedItems, onRetryAll, onRetryItem, isRetrying, onRefresh }: SyncStatusMonitorProps): React
|
|
485
|
-
export { CHUNK_SOURCE_LABELS, type
|
|
571
|
+
declare function SyncStatusMonitor({ counts, totalFiles, failedItems, onRetryAll, onRetryItem, isRetrying, onRefresh, listRefusal }: SyncStatusMonitorProps): React.JSX.Element;
|
|
572
|
+
export { BREAKER_STATE_LABELS, CHUNKING_ONLY_NOTE, CHUNK_BODY_FIDELITY_LABELS, CHUNK_CHANGE_KIND_LABELS, CHUNK_SOURCE_LABELS, CONFIDENTIALITY_LEVEL_LABELS, type ComparisonVariant, DEGRADATION_REASON_LABELS, DOCUMENT_STATE_CAUSE_LABELS, DegradedSearchBanner, type DegradedSearchBannerProps, type DeveloperSearchPreset, type DiffLinePageQuery, type DiffLinePageReader, type DiffLineTarget, DocumentChangeFeed, type DocumentChangeFeedProps, type DocumentComparisonQuery, type DocumentGraphRelation, type DocumentHistoryHost, DocumentHistoryInspector, type DocumentHistoryInspectorProps, type DocumentHistoryReads, type DocumentHistoryTarget, DocumentIngestConsole, type DocumentIngestConsoleProps, type DocumentIngestLabel, type DocumentIngestPayload, type DocumentScores, type DocumentSearchAnswer, type DocumentSearchAuthzScopes, type DocumentSearchExecutedTiers, type DocumentSearchHit, type DocumentSearchMetadata, type DocumentSearchParams, type DocumentStateCapture, type DocumentVectorScore, type DocumentVectorScoreKind, EnrichmentStrategyBoard, type EnrichmentStrategyBoardProps, type EnrichmentStrategyRow, FACET_LABELS, FAILED_RUN_STATE_MARK, FIELD_LABELS, FLOW_FOCUS_RING, FLOW_GEOMETRY, FLOW_NODE_TEXT, type FailedSyncEntry, type FailedSyncItem, type FileInspectionResult, FinishedInstant, type FinishedInstantProps, type FlowGeometry, type FlowLayout, GATE_POLICY_LABELS, GATE_STATE_PRESENTATION, type GateState, HIDDEN_FIELD_TEXT, HISTORY_REFUSAL, INERT_STAGE_NOTE, InfrastructureHealthMonitor, type InfrastructureHealthMonitorProps, type IngestCapabilityPolicy, type IngestDomainOption, type IngestRowAction, type LaidOutEdge, type LaidOutStep, MODEL_ONLY_CHANGE_MARK, MetadataSearchWorkbench, type MetadataSearchWorkbenchProps, ModelComparisonWorkbench, type ModelComparisonWorkbenchProps, NOTHING_TO_READ_LABELS, NO_ENRICHMENT_RECORD_TEXT, NO_PREVIOUS_RECORD_TEXT, type OntologyClassItem, type OntologyPredicateItem, OntologyStatusCard, type OntologyStatusCardProps, type OntologyStatusData, PHASE_LABELS, PIPELINE_RUN_STATUS_PRESENTATION, PIPELINE_STEP_STATUS_PRESENTATION, PIPELINE_TRIGGER_LABELS, PipelineFlowViewer, type PipelineFlowViewerProps, type PipelineRunPresentationKey, QUALITY_TIER_LABELS, type QdrantCollectionInfo, type QdrantCollectionSelection, type QdrantHealthInfo, type QdrantResourceUsage, QdrantStorageCard, type QdrantStorageCardProps, type QdrantStorageOverview, RESTRICTED_DOCUMENT_TEXT, RESTRICTED_RUN_TEXT, RESTRICTED_STATE_TEXT, RUN_TERMINAL_STEP_LABEL, RUN_TERMINAL_STEP_OUTCOME_LABELS, type RankAgreement, type RecentIngestEntry, type RecentIngestItem, type RecentIngestLastRun, type RecentIngestUnlock, RecordedInstant, type RecordedInstantProps, SCORE_DECIMALS, SCORE_DISPLAY_DECIMALS, SEARCH_FUSION_LABELS, SEARCH_MODE_LABELS, SEARCH_PRESETS, type ServiceHealthStatus, type StatusPresentation, type StepGatePolicy, type StepGateState, type StepStatusPresentation, type StrategyProvenance, type SyncStatusCounts, SyncStatusMonitor, type SyncStatusMonitorProps, type SystemInfrastructureHealth, UNFINISHED_LABEL, UNRECORDED_RUN_MARK, UNVERIFIED_CHUNK_NOTE, type VariantComparisonAnswer, type VariantComparisonInput, type VariantHit, type VariantResult, WHITESPACE_NORMALIZED_NOTE, degradationReasonText, documentKindLabel, facetCountsText, fieldLabel, gateCaption, gateState, gateStateOf, historyFailedSentence, historyFailureSentence, ingestRowAction, jsonValueText, layoutFlow, ledgerStepLabel, pipelineRunPresentationKey, rankAgreement, revisionLabel, revisionTransitionText, skipReasonLabel, stepGatePolicy, stepGateState, unrecordedRunsMark, variantHitKey, vectorScoreText };
|