@xpert-ai/contracts 3.15.18 → 3.17.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/index.cjs.js +301 -472
- package/index.esm.js +270 -465
- package/package.json +1 -1
- package/src/agent/ai-model.d.ts +4 -1
- package/src/agent/graph.d.ts +2 -0
- package/src/ai/ai-model.model.d.ts +2 -1
- package/src/ai/assistant-binding.model.d.ts +0 -1
- package/src/ai/evolution/candidate.d.ts +67 -0
- package/src/ai/evolution/capability-version.d.ts +45 -0
- package/src/ai/evolution/evaluation.d.ts +93 -0
- package/src/ai/evolution/example.d.ts +42 -0
- package/src/ai/evolution/experience.d.ts +21 -0
- package/src/ai/evolution/governance.d.ts +87 -0
- package/src/ai/evolution/index.d.ts +11 -0
- package/src/ai/evolution/learning-event.d.ts +69 -0
- package/src/ai/evolution/provider.d.ts +30 -0
- package/src/ai/evolution/release.d.ts +144 -0
- package/src/ai/evolution/runtime.d.ts +81 -0
- package/src/ai/evolution/target.d.ts +83 -0
- package/src/ai/feature.model.d.ts +3 -1
- package/src/ai/index.d.ts +5 -0
- package/src/ai/knowledge-doc-chunk.model.d.ts +143 -0
- package/src/ai/knowledge-doc.model.d.ts +53 -4
- package/src/ai/knowledge-filter.model.d.ts +92 -0
- package/src/ai/knowledge-retrieval-log.model.d.ts +18 -2
- package/src/ai/knowledgebase-task.model.d.ts +3 -1
- package/src/ai/knowledgebase.model.d.ts +6 -0
- package/src/ai/membership.model.d.ts +224 -7
- package/src/ai/model-access.model.d.ts +229 -0
- package/src/ai/model-gateway.model.d.ts +164 -0
- package/src/ai/model-usage.model.d.ts +163 -0
- package/src/ai/role-permissions.d.ts +11 -1
- package/src/ai/sandbox-terminal.model.d.ts +4 -0
- package/src/ai/xpert-agent-execution.model.d.ts +2 -0
- package/src/ai/xpert.model.d.ts +31 -11
- package/src/{analytics/data-source-type.d.ts → data-source-type.model.d.ts} +1 -1
- package/src/{analytics/data-source.d.ts → data-source.model.d.ts} +4 -7
- package/src/feature.model.d.ts +3 -1
- package/src/index.d.ts +4 -1
- package/src/plugin.d.ts +4 -0
- package/src/referral.model.d.ts +36 -0
- package/src/role-permission.model.d.ts +5 -3
- package/src/role.model.d.ts +0 -1
- package/src/tenant.model.d.ts +5 -0
- package/src/user.model.d.ts +1 -0
- package/src/utils.d.ts +5 -0
- package/src/view-extension/model.d.ts +12 -1
- package/src/analytics/ai.d.ts +0 -73
- package/src/analytics/approval-policy.model.d.ts +0 -30
- package/src/analytics/business-area-user.model.d.ts +0 -35
- package/src/analytics/business-area.d.ts +0 -17
- package/src/analytics/certification.model.d.ts +0 -11
- package/src/analytics/chatbi-conversation.model.d.ts +0 -15
- package/src/analytics/chatbi-model.model.d.ts +0 -18
- package/src/analytics/collection.model.d.ts +0 -6
- package/src/analytics/comment.model.d.ts +0 -10
- package/src/analytics/favorite.d.ts +0 -14
- package/src/analytics/features.d.ts +0 -23
- package/src/analytics/feed-model.d.ts +0 -13
- package/src/analytics/gateway.d.ts +0 -28
- package/src/analytics/index.d.ts +0 -38
- package/src/analytics/indicator-app.d.ts +0 -44
- package/src/analytics/indicator-market.d.ts +0 -4
- package/src/analytics/indicator.d.ts +0 -105
- package/src/analytics/model-query-log.model.d.ts +0 -41
- package/src/analytics/model-query.d.ts +0 -21
- package/src/analytics/notification-destination.d.ts +0 -10
- package/src/analytics/permission-approval-user.model.d.ts +0 -10
- package/src/analytics/permission-approval.model.d.ts +0 -47
- package/src/analytics/project.model.d.ts +0 -50
- package/src/analytics/role-permissions.d.ts +0 -28
- package/src/analytics/schema.d.ts +0 -262
- package/src/analytics/screenshot.model.d.ts +0 -24
- package/src/analytics/semantic-model-entity.d.ts +0 -38
- package/src/analytics/semantic-model-member.d.ts +0 -27
- package/src/analytics/semantic-model.d.ts +0 -183
- package/src/analytics/story-point.d.ts +0 -11
- package/src/analytics/story-template.model.d.ts +0 -28
- package/src/analytics/story-widget.d.ts +0 -12
- package/src/analytics/story.d.ts +0 -93
- package/src/analytics/subscription.d.ts +0 -38
- package/src/analytics/visit.model.d.ts +0 -34
- package/src/analytics/webSocket.d.ts +0 -48
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { LearningEvent, LearningEventInput } from './learning-event';
|
|
2
|
+
import { CapabilityVersion, CapabilityVersionBundle } from './capability-version';
|
|
3
|
+
import { EvolutionChannel, EvolutionExecutionMode, EvolutionScope } from './target';
|
|
4
|
+
export interface EvolutionRuntimeObservationInput {
|
|
5
|
+
observationId?: string;
|
|
6
|
+
targetId: string;
|
|
7
|
+
scope: EvolutionScope;
|
|
8
|
+
executionId: string;
|
|
9
|
+
bundleId: string;
|
|
10
|
+
deploymentId?: string;
|
|
11
|
+
subjectKey: string;
|
|
12
|
+
channel: EvolutionChannel;
|
|
13
|
+
success: boolean;
|
|
14
|
+
severeError: boolean;
|
|
15
|
+
latencyMs: number;
|
|
16
|
+
cost?: number;
|
|
17
|
+
correctionRequired?: boolean;
|
|
18
|
+
observedAt: string;
|
|
19
|
+
}
|
|
20
|
+
export interface EvolutionRuntimeObservation extends EvolutionRuntimeObservationInput {
|
|
21
|
+
observationId: string;
|
|
22
|
+
createdAt: string;
|
|
23
|
+
}
|
|
24
|
+
export interface ResolveCapabilityExecutionPlanRequest {
|
|
25
|
+
tenantId: string;
|
|
26
|
+
organizationId?: string | null;
|
|
27
|
+
scope: EvolutionScope;
|
|
28
|
+
targetIds: string[];
|
|
29
|
+
subjectKey: string;
|
|
30
|
+
executionId: string;
|
|
31
|
+
}
|
|
32
|
+
export interface CapabilityExecutionAssignment {
|
|
33
|
+
targetId: string;
|
|
34
|
+
channel: EvolutionChannel;
|
|
35
|
+
versionId: string;
|
|
36
|
+
deploymentId?: string;
|
|
37
|
+
selectionReason?: 'manual_test_override';
|
|
38
|
+
manualTestOverrideId?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface CapabilityExecutionManualTestOverride {
|
|
41
|
+
overrideId: string;
|
|
42
|
+
releasePackageId: string;
|
|
43
|
+
deploymentId: string;
|
|
44
|
+
targetId: string;
|
|
45
|
+
consumedAt: string;
|
|
46
|
+
}
|
|
47
|
+
export interface CapabilityExecutionPlan {
|
|
48
|
+
executionId: string;
|
|
49
|
+
executionMode: EvolutionExecutionMode;
|
|
50
|
+
subjectKey: string;
|
|
51
|
+
bundle: CapabilityVersionBundle;
|
|
52
|
+
assignments: CapabilityExecutionAssignment[];
|
|
53
|
+
/** Explicit audit marker; never present for normal deterministic Canary routing. */
|
|
54
|
+
manualTestOverrides?: CapabilityExecutionManualTestOverride[];
|
|
55
|
+
shadowBundle?: CapabilityVersionBundle;
|
|
56
|
+
shadowAssignments?: CapabilityExecutionAssignment[];
|
|
57
|
+
resolvedAt: string;
|
|
58
|
+
}
|
|
59
|
+
export interface EvolutionRuntimeApi {
|
|
60
|
+
ingestLearningEvent(input: {
|
|
61
|
+
tenantId: string;
|
|
62
|
+
organizationId?: string | null;
|
|
63
|
+
event: LearningEventInput;
|
|
64
|
+
}): Promise<LearningEvent>;
|
|
65
|
+
resolveExecutionPlan(request: ResolveCapabilityExecutionPlanRequest): Promise<CapabilityExecutionPlan>;
|
|
66
|
+
getCapabilityBundle(input: {
|
|
67
|
+
tenantId: string;
|
|
68
|
+
organizationId?: string | null;
|
|
69
|
+
bundleId: string;
|
|
70
|
+
}): Promise<CapabilityVersionBundle>;
|
|
71
|
+
getCapabilityVersion(input: {
|
|
72
|
+
tenantId: string;
|
|
73
|
+
organizationId?: string | null;
|
|
74
|
+
versionId: string;
|
|
75
|
+
}): Promise<CapabilityVersion>;
|
|
76
|
+
recordRuntimeObservation(input: {
|
|
77
|
+
tenantId: string;
|
|
78
|
+
organizationId?: string | null;
|
|
79
|
+
observation: EvolutionRuntimeObservationInput;
|
|
80
|
+
}): Promise<EvolutionRuntimeObservation>;
|
|
81
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { I18nText } from '../../i18n.model';
|
|
2
|
+
export type EvolutionTargetType = 'prompt_policy' | 'routing_policy' | 'extraction_policy' | 'test_fixture';
|
|
3
|
+
export type EvolutionScopeType = 'tenant' | 'organization' | 'workspace' | 'project';
|
|
4
|
+
export type EvolutionExecutionMode = 'production' | 'replay' | 'shadow' | 'canary';
|
|
5
|
+
export type EvolutionChannel = 'production' | 'shadow' | 'canary';
|
|
6
|
+
export type EvolutionRiskLevel = 'R1' | 'R2' | 'R3' | 'R4';
|
|
7
|
+
export interface EvolutionScopeDimensions {
|
|
8
|
+
productFamily?: string;
|
|
9
|
+
customerId?: string;
|
|
10
|
+
workspaceId?: string;
|
|
11
|
+
projectId?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface EvolutionScope {
|
|
14
|
+
type: EvolutionScopeType;
|
|
15
|
+
key: string;
|
|
16
|
+
dimensions?: EvolutionScopeDimensions;
|
|
17
|
+
}
|
|
18
|
+
export interface EvolutionActor {
|
|
19
|
+
actorId: string;
|
|
20
|
+
actorType: 'human' | 'agent' | 'system';
|
|
21
|
+
actorRole?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface EvolutionProviderContext {
|
|
24
|
+
tenantId: string;
|
|
25
|
+
organizationId?: string | null;
|
|
26
|
+
targetId: string;
|
|
27
|
+
scope: EvolutionScope;
|
|
28
|
+
correlationId: string;
|
|
29
|
+
executionId?: string;
|
|
30
|
+
actor: EvolutionActor;
|
|
31
|
+
}
|
|
32
|
+
export interface EvolutionTargetCapabilities {
|
|
33
|
+
candidateBuild: boolean;
|
|
34
|
+
replay: boolean;
|
|
35
|
+
shadow: boolean;
|
|
36
|
+
canary: boolean;
|
|
37
|
+
install: boolean;
|
|
38
|
+
rollback: boolean;
|
|
39
|
+
}
|
|
40
|
+
export type EvolutionCandidateChangeFieldType = 'string' | 'number' | 'boolean' | 'string_array' | 'select';
|
|
41
|
+
export interface EvolutionCandidateChangeFieldDescriptor {
|
|
42
|
+
key: string;
|
|
43
|
+
label: I18nText;
|
|
44
|
+
description?: I18nText;
|
|
45
|
+
type: EvolutionCandidateChangeFieldType;
|
|
46
|
+
required?: boolean;
|
|
47
|
+
placeholder?: I18nText;
|
|
48
|
+
defaultValue?: string | number | boolean | string[];
|
|
49
|
+
options?: Array<{
|
|
50
|
+
label: I18nText;
|
|
51
|
+
value: string;
|
|
52
|
+
}>;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Optional, provider-owned description used by the platform to render a
|
|
56
|
+
* domain-neutral Candidate Change Set editor. The platform never interprets
|
|
57
|
+
* the field keys or embeds domain rules of its own.
|
|
58
|
+
*/
|
|
59
|
+
export interface EvolutionCandidateFormDescriptor {
|
|
60
|
+
description?: I18nText;
|
|
61
|
+
fields: EvolutionCandidateChangeFieldDescriptor[];
|
|
62
|
+
}
|
|
63
|
+
export interface EvolutionTargetDescriptor {
|
|
64
|
+
targetId: string;
|
|
65
|
+
targetType: EvolutionTargetType;
|
|
66
|
+
displayName: string;
|
|
67
|
+
providerKey: string;
|
|
68
|
+
providerVersion: string;
|
|
69
|
+
artifactSchemaVersion: string;
|
|
70
|
+
supportedScopes: EvolutionScopeType[];
|
|
71
|
+
riskLevel: EvolutionRiskLevel;
|
|
72
|
+
metricSetId: string;
|
|
73
|
+
relatedTargetIds?: string[];
|
|
74
|
+
candidateForm?: EvolutionCandidateFormDescriptor;
|
|
75
|
+
capabilities: EvolutionTargetCapabilities;
|
|
76
|
+
status: 'active' | 'disabled' | 'provider_unavailable';
|
|
77
|
+
}
|
|
78
|
+
export interface EvolutionArtifactRef {
|
|
79
|
+
uri: string;
|
|
80
|
+
hash: string;
|
|
81
|
+
schemaVersion: string;
|
|
82
|
+
mediaType: 'application/json';
|
|
83
|
+
}
|
|
@@ -4,8 +4,10 @@ export declare enum AiFeatureEnum {
|
|
|
4
4
|
FEATURE_COPILOT_CHAT = "FEATURE_COPILOT_CHAT",
|
|
5
5
|
FEATURE_COPILOT_MONITORING = "FEATURE_COPILOT_MONITORING",
|
|
6
6
|
FEATURE_MEMBERSHIP_PLAN = "FEATURE_MEMBERSHIP_PLAN",
|
|
7
|
+
FEATURE_MEMBERSHIP_PURCHASE = "FEATURE_MEMBERSHIP_PURCHASE",
|
|
8
|
+
FEATURE_MODEL_ACCESS_REQUEST = "FEATURE_MODEL_ACCESS_REQUEST",
|
|
9
|
+
FEATURE_MODEL_GATEWAY = "FEATURE_MODEL_GATEWAY",
|
|
7
10
|
FEATURE_XPERT = "FEATURE_XPERT",
|
|
8
|
-
FEATURE_XPERT_CHATBI = "FEATURE_XPERT_CHATBI",
|
|
9
11
|
FEATURE_XPERT_CLAWXPERT = "FEATURE_XPERT_CLAWXPERT",
|
|
10
12
|
FEATURE_XPERT_CODEXPERT = "FEATURE_XPERT_CODEXPERT",
|
|
11
13
|
FEATURE_XPERT_DEEP_RESEARCH = "FEATURE_XPERT_DEEP_RESEARCH",
|
package/src/ai/index.d.ts
CHANGED
|
@@ -24,9 +24,13 @@ export * from './copilot-usage.model';
|
|
|
24
24
|
export * from './copilot.model';
|
|
25
25
|
export * from './feature.model';
|
|
26
26
|
export * from './membership.model';
|
|
27
|
+
export * from './model-access.model';
|
|
28
|
+
export * from './model-gateway.model';
|
|
29
|
+
export * from './model-usage.model';
|
|
27
30
|
export * from './rag';
|
|
28
31
|
export * from './rag-web';
|
|
29
32
|
export * from './knowledgebase.model';
|
|
33
|
+
export * from './knowledge-filter.model';
|
|
30
34
|
export * from './knowledge-doc.model';
|
|
31
35
|
export * from './knowledge-doc-page.model';
|
|
32
36
|
export * from './role-permissions';
|
|
@@ -63,3 +67,4 @@ export * from './context-compression.model';
|
|
|
63
67
|
export * from './sandbox';
|
|
64
68
|
export * from './message-content.utils';
|
|
65
69
|
export * from './mobile.model';
|
|
70
|
+
export * from './evolution';
|
|
@@ -11,6 +11,134 @@ export type TDocumentAsset = {
|
|
|
11
11
|
order?: number;
|
|
12
12
|
altText?: string;
|
|
13
13
|
};
|
|
14
|
+
/** Stable, provider-neutral layout categories understood by the preview UI. */
|
|
15
|
+
export type DocumentAnalysisBlockType = 'text' | 'title' | 'table' | 'image' | 'formula' | 'header' | 'footer' | 'footnote' | 'page-number' | 'seal' | 'other';
|
|
16
|
+
/** Rectangle in the transformer-reported page coordinate system; values are not normalized to 0..1. */
|
|
17
|
+
export type DocumentAnalysisBounds = {
|
|
18
|
+
x: number;
|
|
19
|
+
y: number;
|
|
20
|
+
width: number;
|
|
21
|
+
height: number;
|
|
22
|
+
};
|
|
23
|
+
/** Polygon vertex in the transformer-reported page coordinate system. */
|
|
24
|
+
export type DocumentAnalysisPoint = {
|
|
25
|
+
x: number;
|
|
26
|
+
y: number;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Provider-neutral page-layout metadata emitted by a document transformer before text splitting.
|
|
30
|
+
* Coordinates use the top-left of the recognized page as their origin.
|
|
31
|
+
*/
|
|
32
|
+
export type DocumentLayoutMetadata = {
|
|
33
|
+
schemaVersion: 1;
|
|
34
|
+
/** Global, 1-based source-document page number, including documents converted in batches. */
|
|
35
|
+
page: number;
|
|
36
|
+
/** Provider-reported page dimensions used to project bounds over the rendered source page. */
|
|
37
|
+
pageWidth: number;
|
|
38
|
+
pageHeight: number;
|
|
39
|
+
/** Stable identifier and reading order before downstream text splitting. */
|
|
40
|
+
blockId: string;
|
|
41
|
+
order: number;
|
|
42
|
+
type: DocumentAnalysisBlockType;
|
|
43
|
+
providerType?: string;
|
|
44
|
+
providerSubType?: string;
|
|
45
|
+
bounds?: DocumentAnalysisBounds;
|
|
46
|
+
polygon?: DocumentAnalysisPoint[];
|
|
47
|
+
/** Optional archived image/table asset associated with this exact layout block. */
|
|
48
|
+
asset?: TDocumentAsset;
|
|
49
|
+
/** Lossless provider payload retained for inspection; consumers must not assume its schema. */
|
|
50
|
+
raw?: Record<string, unknown>;
|
|
51
|
+
};
|
|
52
|
+
/** Provider-neutral description of the structured document produced by a transformer. */
|
|
53
|
+
export type DocumentAnalysisMetadata = {
|
|
54
|
+
schemaVersion: 1;
|
|
55
|
+
provider: string;
|
|
56
|
+
engine?: string;
|
|
57
|
+
pageCount?: number;
|
|
58
|
+
coordinateSystem: 'page-top-left';
|
|
59
|
+
markdownAsset?: TDocumentAsset;
|
|
60
|
+
/** Provider-neutral page/block payload used to materialize the protected analysis preview. */
|
|
61
|
+
analysisAsset?: TDocumentAsset;
|
|
62
|
+
/** Durable offset map from the merged Markdown back to source pages and layout blocks. */
|
|
63
|
+
sourceMapAsset?: TDocumentAsset;
|
|
64
|
+
rawAssets?: TDocumentAsset[];
|
|
65
|
+
};
|
|
66
|
+
/** One source block archived before the converter merges layout fragments into Markdown. */
|
|
67
|
+
export type DocumentAnalysisSourceBlock = {
|
|
68
|
+
id: string;
|
|
69
|
+
order: number;
|
|
70
|
+
type: DocumentAnalysisBlockType;
|
|
71
|
+
providerType?: string;
|
|
72
|
+
providerSubType?: string;
|
|
73
|
+
markdown: string;
|
|
74
|
+
bounds?: DocumentAnalysisBounds;
|
|
75
|
+
polygon?: DocumentAnalysisPoint[];
|
|
76
|
+
asset?: TDocumentAsset;
|
|
77
|
+
raw?: Record<string, unknown>;
|
|
78
|
+
};
|
|
79
|
+
/** Provider-neutral page record stored by a document converter for later preview materialization. */
|
|
80
|
+
export type DocumentAnalysisSourcePage = {
|
|
81
|
+
schemaVersion: 1;
|
|
82
|
+
page: number;
|
|
83
|
+
width: number;
|
|
84
|
+
height: number;
|
|
85
|
+
blocks: DocumentAnalysisSourceBlock[];
|
|
86
|
+
};
|
|
87
|
+
/** File payload referenced by `DocumentAnalysisMetadata.analysisAsset`. */
|
|
88
|
+
export type DocumentAnalysisSource = {
|
|
89
|
+
schemaVersion: 1;
|
|
90
|
+
pages: DocumentAnalysisSourcePage[];
|
|
91
|
+
};
|
|
92
|
+
/** A character interval in merged Markdown and its corresponding source-document range. */
|
|
93
|
+
export type DocumentMarkdownSourceMapEntry = {
|
|
94
|
+
startOffset: number;
|
|
95
|
+
endOffset: number;
|
|
96
|
+
pageStart: number;
|
|
97
|
+
pageEnd: number;
|
|
98
|
+
blockIds?: string[];
|
|
99
|
+
assets?: TDocumentAsset[];
|
|
100
|
+
};
|
|
101
|
+
/** Ephemeral/durable source map consumed by splitters to restore page and asset provenance. */
|
|
102
|
+
export type DocumentMarkdownSourceMap = {
|
|
103
|
+
schemaVersion: 1;
|
|
104
|
+
entries: DocumentMarkdownSourceMapEntry[];
|
|
105
|
+
};
|
|
106
|
+
/** Read model returned for one block in the paged analysis-preview API. */
|
|
107
|
+
export type KnowledgeDocumentAnalysisBlock = {
|
|
108
|
+
id: string;
|
|
109
|
+
order: number;
|
|
110
|
+
type: DocumentAnalysisBlockType;
|
|
111
|
+
providerType?: string;
|
|
112
|
+
providerSubType?: string;
|
|
113
|
+
markdown: string;
|
|
114
|
+
bounds?: DocumentAnalysisBounds;
|
|
115
|
+
polygon?: DocumentAnalysisPoint[];
|
|
116
|
+
assetId?: string;
|
|
117
|
+
};
|
|
118
|
+
/** Self-contained page record loaded independently for large documents. */
|
|
119
|
+
export type KnowledgeDocumentAnalysisPage = {
|
|
120
|
+
schemaVersion: 1;
|
|
121
|
+
page: number;
|
|
122
|
+
width: number;
|
|
123
|
+
height: number;
|
|
124
|
+
markdown: string;
|
|
125
|
+
blocks: KnowledgeDocumentAnalysisBlock[];
|
|
126
|
+
};
|
|
127
|
+
/** Capability response; unavailable snapshots expose a reason instead of throwing during page setup. */
|
|
128
|
+
export type KnowledgeDocumentAnalysisPreview = {
|
|
129
|
+
available: false;
|
|
130
|
+
reason: 'missing' | 'stale' | 'corrupt' | 'unsupported';
|
|
131
|
+
} | {
|
|
132
|
+
available: true;
|
|
133
|
+
schemaVersion: 1;
|
|
134
|
+
provider: string;
|
|
135
|
+
engine?: string;
|
|
136
|
+
pageCount: number;
|
|
137
|
+
pages: number[];
|
|
138
|
+
sourceType?: string;
|
|
139
|
+
sourceMimeType?: string;
|
|
140
|
+
views: Array<'markdown' | 'structure' | 'tables' | 'images' | 'json'>;
|
|
141
|
+
};
|
|
14
142
|
export interface IDocChunkMetadata {
|
|
15
143
|
chunkId: string;
|
|
16
144
|
parentId?: string | null;
|
|
@@ -27,6 +155,21 @@ export interface IDocChunkMetadata {
|
|
|
27
155
|
* Associated assets like images, videos, etc.
|
|
28
156
|
*/
|
|
29
157
|
assets?: TDocumentAsset[];
|
|
158
|
+
/** Explicit content discriminator so generic preprocessing does not flatten Markdown syntax. */
|
|
159
|
+
contentFormat?: 'text' | 'markdown';
|
|
160
|
+
/** Global source page for a chunk contained entirely within one page. */
|
|
161
|
+
page?: number;
|
|
162
|
+
/** Inclusive global source-page interval when a chunk spans multiple pages. */
|
|
163
|
+
pageStart?: number;
|
|
164
|
+
pageEnd?: number;
|
|
165
|
+
/** Stable pre-merge layout identifiers contributing content to this chunk. */
|
|
166
|
+
sourceBlockIds?: string[];
|
|
167
|
+
/** Pre-split offset map; splitters must consume it instead of copying it to every final chunk. */
|
|
168
|
+
markdownSourceMap?: DocumentMarkdownSourceMap;
|
|
169
|
+
/** Durable source-map asset retained after the inline pre-split map is consumed. */
|
|
170
|
+
sourceMapAsset?: TDocumentAsset;
|
|
171
|
+
/** Original structured layout before text splitting. */
|
|
172
|
+
documentLayout?: DocumentLayoutMetadata;
|
|
30
173
|
/**
|
|
31
174
|
* Whether the chunk is represented as a vector in the vector store
|
|
32
175
|
*/
|
|
@@ -5,7 +5,7 @@ import { IKnowledgeDocumentPage } from './knowledge-doc-page.model';
|
|
|
5
5
|
import { IKnowledgebaseTask } from './knowledgebase-task.model';
|
|
6
6
|
import { IKnowledgebase, KBMetadataFieldDef } from './knowledgebase.model';
|
|
7
7
|
import { TRagWebOptions } from './rag-web';
|
|
8
|
-
import { IKnowledgeDocumentChunk } from './knowledge-doc-chunk.model';
|
|
8
|
+
import { DocumentAnalysisMetadata, IKnowledgeDocumentChunk } from './knowledge-doc-chunk.model';
|
|
9
9
|
import { DocumentSourceProviderCategoryEnum } from './knowledge-pipeline';
|
|
10
10
|
import { TCopilotModel } from './copilot-model.model';
|
|
11
11
|
import { I18nObject } from '../types';
|
|
@@ -88,6 +88,52 @@ export declare enum KBDocumentStatusEnum {
|
|
|
88
88
|
ERROR = "error"
|
|
89
89
|
}
|
|
90
90
|
export type KnowledgeDocumentIncrementalSyncMode = 'incremental' | 'full' | 'skipped';
|
|
91
|
+
/** `rechunk` reuses the saved pre-split transformer output and never invokes the converter. */
|
|
92
|
+
export type KnowledgeDocumentProcessingMode = 'full' | 'rechunk';
|
|
93
|
+
/** Converter identity included in fingerprints so credentials/config changes invalidate stale snapshots. */
|
|
94
|
+
export type KnowledgeDocumentTransformerIdentity = {
|
|
95
|
+
provider: string;
|
|
96
|
+
integrationId?: string | null;
|
|
97
|
+
config?: {
|
|
98
|
+
[key: string]: unknown;
|
|
99
|
+
} | null;
|
|
100
|
+
};
|
|
101
|
+
/** Integrity-checked reference to the pre-split converter output used by rechunk processing. */
|
|
102
|
+
export type KnowledgeDocumentTransformSnapshotRef = {
|
|
103
|
+
schemaVersion: 1;
|
|
104
|
+
filePath: string;
|
|
105
|
+
manifestPath: string;
|
|
106
|
+
sha256: string;
|
|
107
|
+
size: number;
|
|
108
|
+
itemCount: number;
|
|
109
|
+
chunkCount: number;
|
|
110
|
+
transformFingerprint: string;
|
|
111
|
+
sourceHash?: string | null;
|
|
112
|
+
transformer: KnowledgeDocumentTransformerIdentity;
|
|
113
|
+
createdAt: string;
|
|
114
|
+
};
|
|
115
|
+
/** Reference to the immutable, paged layout snapshot consumed by the analysis-preview API. */
|
|
116
|
+
export type KnowledgeDocumentAnalysisSnapshotRef = {
|
|
117
|
+
schemaVersion: 1;
|
|
118
|
+
manifestPath: string;
|
|
119
|
+
manifestSha256: string;
|
|
120
|
+
manifestSize: number;
|
|
121
|
+
transformFingerprint: string;
|
|
122
|
+
sourceHash?: string | null;
|
|
123
|
+
provider: string;
|
|
124
|
+
engine?: string;
|
|
125
|
+
pageCount: number;
|
|
126
|
+
createdAt: string;
|
|
127
|
+
};
|
|
128
|
+
/** Server-computed actions available for a document under its current source and converter fingerprint. */
|
|
129
|
+
export type KnowledgeDocumentReprocessCapabilities = {
|
|
130
|
+
full: true;
|
|
131
|
+
rechunk: {
|
|
132
|
+
available: boolean;
|
|
133
|
+
reason?: 'missing' | 'stale' | 'corrupt';
|
|
134
|
+
snapshot?: KnowledgeDocumentTransformSnapshotRef;
|
|
135
|
+
};
|
|
136
|
+
};
|
|
91
137
|
export type KnowledgeDocumentLastIncrementalSync = {
|
|
92
138
|
mode: KnowledgeDocumentIncrementalSyncMode;
|
|
93
139
|
total: number;
|
|
@@ -194,8 +240,8 @@ export type TKnowledgeDocument = {
|
|
|
194
240
|
integrationId?: string;
|
|
195
241
|
integration?: IIntegration;
|
|
196
242
|
/**
|
|
197
|
-
|
|
198
|
-
|
|
243
|
+
* @deprecated use chunks instead
|
|
244
|
+
*/
|
|
199
245
|
pages?: IKnowledgeDocumentPage[];
|
|
200
246
|
chunks?: IKnowledgeDocumentChunk[];
|
|
201
247
|
tasks?: IKnowledgebaseTask[];
|
|
@@ -230,6 +276,9 @@ export interface StandardDocumentMetadata {
|
|
|
230
276
|
lastIncrementalSync?: KnowledgeDocumentLastIncrementalSync;
|
|
231
277
|
}
|
|
232
278
|
export interface KnowledgeDocumentMetadata extends StandardDocumentMetadata {
|
|
279
|
+
transformSnapshot?: KnowledgeDocumentTransformSnapshotRef;
|
|
280
|
+
analysisSnapshot?: KnowledgeDocumentAnalysisSnapshotRef;
|
|
281
|
+
documentAnalysis?: DocumentAnalysisMetadata;
|
|
233
282
|
[key: string]: any;
|
|
234
283
|
}
|
|
235
284
|
export interface IKnowledgeDocumentCreateInput extends IKnowledgeDocument, IBasePerTenantAndOrganizationEntityModel {
|
|
@@ -252,4 +301,4 @@ export declare const STANDARD_METADATA_FIELDS: {
|
|
|
252
301
|
group: I18nObject;
|
|
253
302
|
fields: KBMetadataFieldDef[];
|
|
254
303
|
}[];
|
|
255
|
-
export type StandardMetadataFieldKey = typeof STANDARD_METADATA_FIELDS[number]['fields'][number]['key'];
|
|
304
|
+
export type StandardMetadataFieldKey = (typeof STANDARD_METADATA_FIELDS)[number]['fields'][number]['key'];
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
export declare const KNOWLEDGE_FILTER_VERSION: 2;
|
|
2
|
+
export declare const KNOWLEDGE_FILTER_MAX_DEPTH = 3;
|
|
3
|
+
export declare const KNOWLEDGE_FILTER_MAX_CONDITIONS = 20;
|
|
4
|
+
export declare const KNOWLEDGE_FILTER_MAX_SET_VALUES = 100;
|
|
5
|
+
export declare const KNOWLEDGE_FILTER_MAX_STRING_LENGTH = 512;
|
|
6
|
+
export type KnowledgeFilterOperator = 'eq' | 'neq' | 'in' | 'notIn' | 'contains' | 'notContains' | 'startsWith' | 'endsWith' | 'under' | 'gt' | 'gte' | 'lt' | 'lte' | 'between' | 'exists' | 'containsAny' | 'containsAll' | 'isEmpty' | 'jsonContains';
|
|
7
|
+
type KnowledgeFilterJSONPrimitive = null | string | number | boolean;
|
|
8
|
+
type KnowledgeFilterJSONObjectLevel1 = Record<string, KnowledgeFilterJSONPrimitive | KnowledgeFilterJSONPrimitive[]>;
|
|
9
|
+
/** A finite JSON shape keeps ORM DeepPartial types bounded while covering filter literals and JSON containment. */
|
|
10
|
+
export type KnowledgeFilterJSONValue = KnowledgeFilterJSONPrimitive | KnowledgeFilterJSONPrimitive[] | KnowledgeFilterJSONObjectLevel1 | KnowledgeFilterJSONObjectLevel1[] | Record<string, KnowledgeFilterJSONPrimitive | KnowledgeFilterJSONPrimitive[] | KnowledgeFilterJSONObjectLevel1 | KnowledgeFilterJSONObjectLevel1[]>;
|
|
11
|
+
export type KnowledgeFilterLiteralValue = {
|
|
12
|
+
kind: 'literal';
|
|
13
|
+
value: KnowledgeFilterJSONValue;
|
|
14
|
+
};
|
|
15
|
+
export type KnowledgeFilterVariableValue = {
|
|
16
|
+
kind: 'variable';
|
|
17
|
+
selector: string;
|
|
18
|
+
};
|
|
19
|
+
export type KnowledgeFilterValue = KnowledgeFilterLiteralValue | KnowledgeFilterVariableValue;
|
|
20
|
+
export type KnowledgeFilterCondition = {
|
|
21
|
+
kind: 'condition';
|
|
22
|
+
field: string;
|
|
23
|
+
operator: KnowledgeFilterOperator;
|
|
24
|
+
value?: KnowledgeFilterValue;
|
|
25
|
+
};
|
|
26
|
+
export type KnowledgeFilterGroupLevel1 = {
|
|
27
|
+
kind: 'group';
|
|
28
|
+
operator: 'and' | 'or';
|
|
29
|
+
children: KnowledgeFilterCondition[];
|
|
30
|
+
};
|
|
31
|
+
export type KnowledgeFilterGroupLevel2 = {
|
|
32
|
+
kind: 'group';
|
|
33
|
+
operator: 'and' | 'or';
|
|
34
|
+
children: Array<KnowledgeFilterCondition | KnowledgeFilterGroupLevel1>;
|
|
35
|
+
};
|
|
36
|
+
export type KnowledgeFilterGroupLevel3 = {
|
|
37
|
+
kind: 'group';
|
|
38
|
+
operator: 'and' | 'or';
|
|
39
|
+
children: Array<KnowledgeFilterCondition | KnowledgeFilterGroupLevel1 | KnowledgeFilterGroupLevel2>;
|
|
40
|
+
};
|
|
41
|
+
/** The fourth level is reserved for the server-owned root that merges validated sources. */
|
|
42
|
+
export type KnowledgeFilterGroupLevel4 = {
|
|
43
|
+
kind: 'group';
|
|
44
|
+
operator: 'and' | 'or';
|
|
45
|
+
children: Array<KnowledgeFilterCondition | KnowledgeFilterGroupLevel1 | KnowledgeFilterGroupLevel2 | KnowledgeFilterGroupLevel3>;
|
|
46
|
+
};
|
|
47
|
+
export type KnowledgeFilterGroup = KnowledgeFilterGroupLevel1 | KnowledgeFilterGroupLevel2 | KnowledgeFilterGroupLevel3 | KnowledgeFilterGroupLevel4;
|
|
48
|
+
export type KnowledgeFilterNode = KnowledgeFilterCondition | KnowledgeFilterGroup;
|
|
49
|
+
export type KnowledgeFilterSources = {
|
|
50
|
+
fixed?: KnowledgeFilterNode;
|
|
51
|
+
request?: KnowledgeFilterNode;
|
|
52
|
+
dynamic?: KnowledgeFilterNode;
|
|
53
|
+
};
|
|
54
|
+
export type KnowledgeFilterStatus = 'not_applied' | 'applied' | 'dynamic_fallback' | 'failed';
|
|
55
|
+
export type KnowledgeFilterErrorCode = 'invalid_filter' | 'unknown_field' | 'invalid_operator' | 'invalid_value' | 'missing_fixed_variable' | 'filter_too_complex' | 'graph_search_failed' | 'unsupported_backend' | 'unsupported_retrieval_mode';
|
|
56
|
+
export type KnowledgeFilterDiagnostics = {
|
|
57
|
+
filterVersion: typeof KNOWLEDGE_FILTER_VERSION;
|
|
58
|
+
fixedFilter?: KnowledgeFilterNode;
|
|
59
|
+
requestFilter?: KnowledgeFilterNode;
|
|
60
|
+
dynamicFilter?: KnowledgeFilterNode;
|
|
61
|
+
effectiveFilter?: KnowledgeFilterNode;
|
|
62
|
+
filterHash?: string;
|
|
63
|
+
filterStatus: KnowledgeFilterStatus;
|
|
64
|
+
fallbackReason?: 'invalid_dynamic_filter';
|
|
65
|
+
errorCode?: KnowledgeFilterErrorCode;
|
|
66
|
+
candidateDocumentCount?: number;
|
|
67
|
+
candidateChunkCount?: number;
|
|
68
|
+
hitCount: number;
|
|
69
|
+
vectorBackend?: string;
|
|
70
|
+
filterLatency?: number;
|
|
71
|
+
vectorLatency?: number;
|
|
72
|
+
vectorBranchHitCount?: number;
|
|
73
|
+
graphBranchHitCount?: number;
|
|
74
|
+
graphGlobalCandidateCount?: number;
|
|
75
|
+
graphCandidateScanLimit?: number;
|
|
76
|
+
graphCandidateScanRounds?: number;
|
|
77
|
+
graphCandidateTruncated?: boolean;
|
|
78
|
+
eligibleSeedEntityCount?: number;
|
|
79
|
+
eligibleRelationCount?: number;
|
|
80
|
+
eligibleMentionCount?: number;
|
|
81
|
+
graphCandidateChunkCount?: number;
|
|
82
|
+
graphSeedLatency?: number;
|
|
83
|
+
graphFilterLatency?: number;
|
|
84
|
+
graphExpansionLatency?: number;
|
|
85
|
+
graphChunkLatency?: number;
|
|
86
|
+
hybridGraphFallbackReason?: string;
|
|
87
|
+
retryableWithoutDynamic?: boolean;
|
|
88
|
+
errors?: string[];
|
|
89
|
+
};
|
|
90
|
+
export declare const KNOWLEDGE_SYSTEM_FILTER_FIELDS: readonly ["document.fileName", "document.folderPath", "document.fileExtension", "document.mimeType", "document.category", "document.sourceType", "document.createdAt", "document.updatedAt"];
|
|
91
|
+
export type KnowledgeSystemFilterField = (typeof KNOWLEDGE_SYSTEM_FILTER_FIELDS)[number];
|
|
92
|
+
export {};
|
|
@@ -1,10 +1,26 @@
|
|
|
1
|
-
import { IBasePerTenantAndOrganizationEntityModel } from
|
|
2
|
-
import { IKnowledgebase } from
|
|
1
|
+
import { IBasePerTenantAndOrganizationEntityModel } from '../base-entity.model';
|
|
2
|
+
import { IKnowledgebase } from './knowledgebase.model';
|
|
3
|
+
import { KnowledgeFilterDiagnostics, KnowledgeFilterNode, KnowledgeFilterStatus } from './knowledge-filter.model';
|
|
3
4
|
export interface IKnowledgeRetrievalLog extends IBasePerTenantAndOrganizationEntityModel {
|
|
4
5
|
query: string;
|
|
5
6
|
source: string;
|
|
6
7
|
hitCount: number;
|
|
7
8
|
requestId: string;
|
|
9
|
+
filterVersion?: number;
|
|
10
|
+
fixedFilter?: KnowledgeFilterNode;
|
|
11
|
+
dynamicFilter?: KnowledgeFilterNode;
|
|
12
|
+
requestFilter?: KnowledgeFilterNode;
|
|
13
|
+
effectiveFilter?: KnowledgeFilterNode;
|
|
14
|
+
filterHash?: string;
|
|
15
|
+
filterStatus?: KnowledgeFilterStatus;
|
|
16
|
+
fallbackReason?: string;
|
|
17
|
+
errorCode?: string;
|
|
18
|
+
candidateDocumentCount?: number;
|
|
19
|
+
candidateChunkCount?: number;
|
|
20
|
+
vectorBackend?: string;
|
|
21
|
+
filterLatency?: number;
|
|
22
|
+
vectorLatency?: number;
|
|
23
|
+
diagnostics?: KnowledgeFilterDiagnostics;
|
|
8
24
|
knowledgebaseId?: string;
|
|
9
25
|
knowledgebase?: IKnowledgebase;
|
|
10
26
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IBasePerTenantAndOrganizationEntityModel } from '../base-entity.model';
|
|
2
2
|
import { IChatConversation } from './chat.model';
|
|
3
|
-
import { IKnowledgeDocument } from './knowledge-doc.model';
|
|
3
|
+
import { IKnowledgeDocument, KnowledgeDocumentProcessingMode } from './knowledge-doc.model';
|
|
4
4
|
import { IKnowledgebase } from './knowledgebase.model';
|
|
5
5
|
import { IXpertAgentExecution } from './xpert-agent-execution.model';
|
|
6
6
|
/**
|
|
@@ -22,6 +22,8 @@ export interface IKnowledgebaseTask extends IBasePerTenantAndOrganizationEntityM
|
|
|
22
22
|
*/
|
|
23
23
|
context?: {
|
|
24
24
|
documents?: Partial<IKnowledgeDocument>[];
|
|
25
|
+
/** Propagates full conversion vs. snapshot-only rechunking through the background task. */
|
|
26
|
+
processingMode?: KnowledgeDocumentProcessingMode;
|
|
25
27
|
};
|
|
26
28
|
/**
|
|
27
29
|
* Many to Many of documents in task
|
|
@@ -186,6 +186,10 @@ export type KBMetadataFieldDef = {
|
|
|
186
186
|
key: string;
|
|
187
187
|
label?: I18nObject;
|
|
188
188
|
type: MetadataFieldType;
|
|
189
|
+
/**
|
|
190
|
+
* Storage scope of the metadata value. Existing definitions are migrated to `document`.
|
|
191
|
+
*/
|
|
192
|
+
scope?: 'document' | 'chunk';
|
|
189
193
|
enumValues?: string[];
|
|
190
194
|
description?: string;
|
|
191
195
|
};
|
|
@@ -201,6 +205,8 @@ export declare const KnowledgeTask = "task_id";
|
|
|
201
205
|
* Specify the data source to run
|
|
202
206
|
*/
|
|
203
207
|
export declare const KNOWLEDGE_SOURCES_NAME = "sources";
|
|
208
|
+
/** Workflow-state key carrying the requested document processing resume point. */
|
|
209
|
+
export declare const KNOWLEDGE_PROCESSING_MODE_NAME = "processing_mode";
|
|
204
210
|
export declare const KNOWLEDGE_DOCUMENTS_NAME = "documents";
|
|
205
211
|
export declare const KNOWLEDGE_FOLDER_ID_NAME = "folder_id";
|
|
206
212
|
export declare const KNOWLEDGE_STAGE_NAME = "stage";
|