@xpert-ai/contracts 3.18.2 → 3.18.4

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.
Files changed (33) hide show
  1. package/index.cjs.js +440 -70
  2. package/index.esm.js +403 -71
  3. package/package.json +2 -2
  4. package/src/ai/context-compression.model.d.ts +2 -1
  5. package/src/ai/evolution/candidate.d.ts +3 -0
  6. package/src/ai/evolution/change.d.ts +221 -0
  7. package/src/ai/evolution/evaluation.d.ts +1 -0
  8. package/src/ai/evolution/governance.d.ts +3 -1
  9. package/src/ai/evolution/index.d.ts +3 -0
  10. package/src/ai/evolution/learning-event.d.ts +2 -0
  11. package/src/ai/evolution/persistence.d.ts +82 -0
  12. package/src/ai/evolution/provider.d.ts +4 -0
  13. package/src/ai/evolution/release.d.ts +2 -0
  14. package/src/ai/evolution/strategy.d.ts +62 -0
  15. package/src/ai/evolution/target.d.ts +8 -5
  16. package/src/ai/index.d.ts +6 -0
  17. package/src/ai/knowledge-deletion.model.d.ts +25 -0
  18. package/src/ai/knowledge-doc.model.d.ts +29 -0
  19. package/src/ai/knowledge-filter.model.d.ts +3 -1
  20. package/src/ai/knowledge-graph.model.d.ts +22 -0
  21. package/src/ai/knowledge-identity.model.d.ts +42 -0
  22. package/src/ai/knowledge-parser.model.d.ts +15 -0
  23. package/src/ai/knowledge-pipeline.d.ts +3 -0
  24. package/src/ai/knowledge-wiki-identity.model.d.ts +11 -0
  25. package/src/ai/knowledge-wiki-organization.model.d.ts +110 -0
  26. package/src/ai/knowledge-wiki.model.d.ts +202 -0
  27. package/src/ai/knowledgebase-task.model.d.ts +2 -0
  28. package/src/ai/knowledgebase.model.d.ts +47 -2
  29. package/src/ai/mcp-capability.model.d.ts +7 -0
  30. package/src/ai/middleware.model.d.ts +2 -0
  31. package/src/ai/xpert-agent-execution.model.d.ts +1 -1
  32. package/src/ai/xpert-template.model.d.ts +20 -0
  33. package/src/ai/xpert.model.d.ts +5 -2
@@ -17,6 +17,22 @@ export declare enum KnowledgeGraphIndexJobStatus {
17
17
  CANCELLED = "cancelled"
18
18
  }
19
19
  export type KnowledgeGraphIndexJobType = 'document' | 'rebuild';
20
+ export type KnowledgeGraphIndexStage = 'extraction' | 'persistence' | 'indexing';
21
+ export type KnowledgeGraphIndexResult = 'indexed' | 'empty' | 'superseded' | 'disabled';
22
+ export type KnowledgeGraphDocumentStageState = 'pending' | 'running' | 'complete' | 'failed';
23
+ export type KnowledgeGraphDocumentState = 'disabled' | 'source_disabled' | 'waiting_source' | 'not_started' | 'outdated' | 'queued' | 'running' | 'ready' | 'failed' | 'cancelled' | 'no_content' | 'completed';
24
+ export declare const KNOWLEDGE_GRAPH_DOCUMENT_STATUS_BATCH_SIZE = 100;
25
+ export type KnowledgeGraphDocumentsProgressResponse = {
26
+ documents: KnowledgeGraphDocumentProgress[];
27
+ };
28
+ export type KnowledgeGraphDocumentProgress = {
29
+ documentId: string;
30
+ state: KnowledgeGraphDocumentState;
31
+ stages?: Record<KnowledgeGraphIndexStage, KnowledgeGraphDocumentStageState>;
32
+ processedChunks?: number | null;
33
+ totalChunks?: number | null;
34
+ error?: string | null;
35
+ };
20
36
  export type GraphRagRetrievalMode = 'vector' | 'keyword' | 'graph' | 'hybrid';
21
37
  export type KnowledgeGraphItemOrigin = 'extracted' | 'manual' | 'curated';
22
38
  export type KnowledgeGraphVisibility = 'active' | 'hidden';
@@ -36,6 +52,7 @@ export type KnowledgeGraphEvidence = {
36
52
  confidence?: number | null;
37
53
  };
38
54
  export interface IKnowledgeGraphEntity extends IBasePerTenantAndOrganizationEntityModel {
55
+ identityId?: string | null;
39
56
  knowledgebaseId?: string;
40
57
  knowledgebase?: IKnowledgebase;
41
58
  type: string;
@@ -112,6 +129,11 @@ export interface IKnowledgeGraphIndexJob extends IBasePerTenantAndOrganizationEn
112
129
  document?: IKnowledgeDocument | null;
113
130
  type: KnowledgeGraphIndexJobType;
114
131
  status: KnowledgeGraphIndexJobStatus;
132
+ stage?: KnowledgeGraphIndexStage | null;
133
+ result?: KnowledgeGraphIndexResult | null;
134
+ sourceContentHash?: string | null;
135
+ sourcePublicationEpoch?: number | null;
136
+ extractionId?: string | null;
115
137
  revision?: number | null;
116
138
  totalChunks?: number | null;
117
139
  processedChunks?: number | null;
@@ -0,0 +1,42 @@
1
+ /** Identity belongs to the knowledgebase, independently of its Wiki and Graph projections. */
2
+ export type KnowledgeEntityType = 'person' | 'organization' | 'product' | 'project' | 'place' | 'event' | 'other' | 'unknown';
3
+ export type KnowledgeIdentityDescriptor = {
4
+ kind: 'entity';
5
+ entityType: KnowledgeEntityType;
6
+ description: string;
7
+ scope: string | null;
8
+ /** Include the issuing authority and scope in the namespace. */
9
+ identifiers: Array<{
10
+ namespace: string;
11
+ value: string;
12
+ }>;
13
+ } | {
14
+ kind: 'concept';
15
+ definition: string;
16
+ domain: string | null;
17
+ scope: string | null;
18
+ };
19
+ export type KnowledgeIdentityEmbedding = {
20
+ modelFingerprint: string;
21
+ contentFingerprint: string;
22
+ vector: number[];
23
+ };
24
+ export type KnowledgeIdentityProfile = {
25
+ descriptor: KnowledgeIdentityDescriptor;
26
+ aliases: string[];
27
+ embedding: KnowledgeIdentityEmbedding | null;
28
+ };
29
+ export type KnowledgeIdentityDecision = {
30
+ outcome: 'new' | 'same' | 'uncertain';
31
+ reason: string;
32
+ comparedIdentityIds: string[];
33
+ };
34
+ export type KnowledgeIdentityObservationPayload = {
35
+ canonicalName: string;
36
+ descriptor: KnowledgeIdentityDescriptor;
37
+ aliases: string[];
38
+ facts: Array<{
39
+ text: string;
40
+ sourceChunkIds: string[];
41
+ }>;
42
+ };
@@ -0,0 +1,15 @@
1
+ import type { DocumentTextParserConfig } from './knowledge-doc.model';
2
+ import type { KnowledgebaseParserConfig } from './knowledgebase.model';
3
+ import type { IKnowledgeDocumentChunk, IDocChunkMetadata } from './knowledge-doc-chunk.model';
4
+ export interface KnowledgeChunkPreviewInput {
5
+ text: string;
6
+ type: 'txt' | 'md';
7
+ parserConfig: KnowledgebaseParserConfig;
8
+ }
9
+ export interface KnowledgeChunkPreviewResult {
10
+ chunks: IKnowledgeDocumentChunk<IDocChunkMetadata>[];
11
+ }
12
+ /** Only copy configured defaults; do not turn built-in defaults into document overrides. */
13
+ export declare function knowledgebaseDocumentParserDefaults(config?: KnowledgebaseParserConfig | null, documentType?: string): DocumentTextParserConfig;
14
+ /** Arrays are the canonical ordered format; retain the plugin's legacy comma syntax. */
15
+ export declare function decodeKnowledgeSeparators(value?: string | string[]): string[];
@@ -41,8 +41,11 @@ export interface IDocumentSourceProvider extends IDocumentNodeProvider {
41
41
  category: DocumentSourceProviderCategoryEnum;
42
42
  }
43
43
  export interface IDocumentProcessorProvider extends IDocumentNodeProvider {
44
+ /** Explicit file extensions supported for per-format knowledgebase defaults. */
45
+ supportedFileTypes?: string[];
44
46
  }
45
47
  export interface IDocumentChunkerProvider extends IDocumentNodeProvider {
48
+ structure?: KnowledgeStructureEnum;
46
49
  }
47
50
  export interface IDocumentUnderstandingProvider extends IDocumentNodeProvider {
48
51
  }
@@ -0,0 +1,11 @@
1
+ import { KnowledgeEntityType, KnowledgeIdentityDecision, KnowledgeIdentityDescriptor, KnowledgeIdentityEmbedding } from './knowledge-identity.model';
2
+ export type KnowledgeWikiEntityType = KnowledgeEntityType;
3
+ export type KnowledgeWikiIdentityDescriptor = KnowledgeIdentityDescriptor | {
4
+ kind: 'summary';
5
+ };
6
+ export type KnowledgeWikiIdentityEmbedding = KnowledgeIdentityEmbedding;
7
+ export type KnowledgeWikiIdentityDecision = KnowledgeIdentityDecision | {
8
+ outcome: 'source';
9
+ reason: string;
10
+ comparedIdentityIds: string[];
11
+ };
@@ -0,0 +1,110 @@
1
+ import type { KnowledgeWikiJobStatus, KnowledgeWikiPageListItem, KnowledgeWikiPageListParams, KnowledgeWikiPageType } from './knowledge-wiki.model';
2
+ export type KnowledgeWikiTaxonomyQuery = Pick<KnowledgeWikiPageListParams, 'search' | 'pageType' | 'pageGroup'>;
3
+ export type KnowledgeWikiFolder = {
4
+ id: string;
5
+ parentId: string | null;
6
+ name: string;
7
+ description: string;
8
+ position: number;
9
+ version: number;
10
+ pageCount: number;
11
+ };
12
+ export type KnowledgeWikiFolderInput = Pick<KnowledgeWikiFolder, 'name' | 'description' | 'parentId' | 'position'>;
13
+ export type KnowledgeWikiPlacement = {
14
+ folderId: string | null;
15
+ source: 'automatic' | 'manual';
16
+ version: number;
17
+ };
18
+ export type KnowledgeWikiTaxonomy = {
19
+ enabled: boolean;
20
+ revision: number;
21
+ folders: KnowledgeWikiFolder[];
22
+ unclassifiedCount: number;
23
+ total: number;
24
+ };
25
+ export type KnowledgeWikiClassificationOutput = {
26
+ folderId: string | null;
27
+ reason: string;
28
+ };
29
+ export type KnowledgeWikiPageClassificationInput = {
30
+ mode?: 'page';
31
+ runId: string;
32
+ pageId: string;
33
+ pageVersionId: string;
34
+ taxonomyRevision: number;
35
+ placementVersion: number;
36
+ applyAutomatically: boolean;
37
+ /** Older automatic jobs without a trigger were queued by publication. */
38
+ trigger?: 'publication' | 'backfill';
39
+ result?: KnowledgeWikiClassificationOutput;
40
+ outcome?: 'applied' | 'suggested' | 'unclassified' | 'stale';
41
+ };
42
+ export type KnowledgeWikiTaxonomyOutput = {
43
+ folders: Array<{
44
+ name: string;
45
+ description: string;
46
+ pageIds: string[];
47
+ }>;
48
+ unclassifiedPageIds: string[];
49
+ };
50
+ export type KnowledgeWikiPendingPublication = {
51
+ pageId: string;
52
+ pageVersionId: string;
53
+ runId: string;
54
+ billingPrincipalId: string;
55
+ };
56
+ export type KnowledgeWikiTaxonomyClassificationInput = {
57
+ mode: 'taxonomy';
58
+ /** Publications arriving while this taxonomy is being generated. Drained atomically on completion. */
59
+ pendingPublications?: KnowledgeWikiPendingPublication[];
60
+ runId: string;
61
+ taxonomyRevision: number;
62
+ pages: Array<{
63
+ pageId: string;
64
+ pageVersionId: string;
65
+ placementVersion: number;
66
+ }>;
67
+ appliedTaxonomyRevision?: number;
68
+ results?: Array<{
69
+ pageId: string;
70
+ result: KnowledgeWikiClassificationOutput;
71
+ outcome: 'applied' | 'unclassified' | 'stale';
72
+ }>;
73
+ };
74
+ export type KnowledgeWikiClassificationInput = KnowledgeWikiPageClassificationInput | KnowledgeWikiTaxonomyClassificationInput;
75
+ export type KnowledgeWikiClassificationStatus = {
76
+ activeJobs: number;
77
+ };
78
+ export type KnowledgeWikiClassificationItem = {
79
+ jobId: string;
80
+ runId: string;
81
+ pageId: string;
82
+ title: string;
83
+ status: KnowledgeWikiJobStatus;
84
+ result?: KnowledgeWikiClassificationOutput;
85
+ outcome?: KnowledgeWikiPageClassificationInput['outcome'];
86
+ error?: string;
87
+ requiresAdditionalChargeConfirmation: boolean;
88
+ };
89
+ export type KnowledgeWikiGraphParams = {
90
+ focusPageId?: string;
91
+ depth?: number;
92
+ take?: number;
93
+ pageType?: KnowledgeWikiPageType;
94
+ includeIndex?: boolean;
95
+ };
96
+ export type KnowledgeWikiGraphNode = KnowledgeWikiPageListItem & {
97
+ sourceCount: number;
98
+ };
99
+ export type KnowledgeWikiGraphEdge = {
100
+ id: string;
101
+ source: string;
102
+ target: string;
103
+ label?: string | null;
104
+ sectionAnchor?: string | null;
105
+ };
106
+ export type KnowledgeWikiGraph = {
107
+ nodes: KnowledgeWikiGraphNode[];
108
+ edges: KnowledgeWikiGraphEdge[];
109
+ truncated: boolean;
110
+ };
@@ -0,0 +1,202 @@
1
+ import type { IDocChunkMetadata } from './knowledge-doc-chunk.model';
2
+ export declare const KNOWLEDGE_WIKI_SCHEMA_VERSION = 1;
3
+ export type KnowledgeWikiExtractionGranularity = 'focused' | 'standard' | 'exhaustive';
4
+ export type KnowledgebaseWikiConfig = {
5
+ enabled: boolean;
6
+ extractionGranularity: KnowledgeWikiExtractionGranularity;
7
+ contentGenerationRequirements?: string;
8
+ extractionFocus?: string;
9
+ };
10
+ export type ResolvedKnowledgebaseWikiConfig = KnowledgebaseWikiConfig & {
11
+ contentGenerationRequirements: string;
12
+ extractionFocus: string;
13
+ };
14
+ export declare const KNOWLEDGE_WIKI_MAX_CUSTOM_INSTRUCTION_LENGTH = 4000;
15
+ export declare const DEFAULT_KNOWLEDGEBASE_WIKI_CONFIG: {
16
+ readonly enabled: false;
17
+ readonly extractionGranularity: "standard";
18
+ readonly contentGenerationRequirements: "";
19
+ readonly extractionFocus: "";
20
+ };
21
+ export declare function normalizeKnowledgebaseWikiConfig(config?: Partial<KnowledgebaseWikiConfig> | null): ResolvedKnowledgebaseWikiConfig;
22
+ export type KnowledgeWikiStatus = 'disabled' | 'indexing' | 'ready' | 'failed' | 'rebuild_required';
23
+ export type KnowledgeWikiAvailability = 'unavailable' | 'ready' | 'degraded';
24
+ export type KnowledgeWikiPageType = 'summary' | 'entity' | 'concept' | 'index';
25
+ export type KnowledgeWikiMappedPageType = Exclude<KnowledgeWikiPageType, 'index'>;
26
+ export type KnowledgeWikiPageStatus = 'building' | 'ready' | 'stale' | 'failed' | 'archived';
27
+ export type KnowledgeWikiProjectionStatus = 'pending' | 'ready' | 'failed' | 'disabled';
28
+ export type KnowledgeWikiJobType = 'classify' | 'source_map' | 'identity_resolve' | 'page_reduce' | 'retract' | 'rebuild' | 'finalize';
29
+ export type KnowledgeWikiJobStatus = 'queued' | 'running' | 'succeeded' | 'failed' | 'stale' | 'cancelled';
30
+ export type KnowledgeWikiInvocationStatus = 'prepared' | 'running' | 'reconciling' | 'succeeded' | 'failed' | 'indeterminate';
31
+ export type KnowledgeWikiRecoveryAction = {
32
+ jobId: string;
33
+ invocationId: string;
34
+ reconciliationStatus: 'not_available' | 'pending' | 'recovered' | 'not_executed' | 'indeterminate';
35
+ failureReason?: 'preparation_failed' | 'request_rejected';
36
+ canRetry: boolean;
37
+ requiresAdditionalChargeConfirmation: boolean;
38
+ inputCurrent: boolean;
39
+ recommendedAction: 'wait' | 'retry_job' | 'full_rebuild';
40
+ };
41
+ export type KnowledgeWikiReaderStatus = {
42
+ canManage: false;
43
+ enabled: boolean;
44
+ status: KnowledgeWikiStatus;
45
+ availability: KnowledgeWikiAvailability;
46
+ readyPageCount: number;
47
+ requiresManagement: boolean;
48
+ errorCode?: string | null;
49
+ };
50
+ export type KnowledgeWikiJobCounts = {
51
+ queued: number;
52
+ running: number;
53
+ failed: number;
54
+ };
55
+ export type KnowledgeWikiPageCounts = {
56
+ ready: number;
57
+ stale: number;
58
+ failed: number;
59
+ archived: number;
60
+ projectionFailed: number;
61
+ };
62
+ export type KnowledgeWikiManagementStatus = Omit<KnowledgeWikiReaderStatus, 'canManage'> & {
63
+ canManage: true;
64
+ activeRevision?: number | null;
65
+ stagedRevision?: number | null;
66
+ activeConfigFingerprint?: string | null;
67
+ targetConfigFingerprint?: string | null;
68
+ rebuildRequiredReason?: 'generator_upgrade' | null;
69
+ generationJobs: KnowledgeWikiJobCounts;
70
+ pages: KnowledgeWikiPageCounts;
71
+ indeterminateInvocationCount: number;
72
+ billingRecoveryCount: number;
73
+ cleanupPendingCount: number;
74
+ cleanupFailedCount: number;
75
+ recoveryActions: KnowledgeWikiRecoveryAction[];
76
+ };
77
+ export type KnowledgeWikiStatusResponse = KnowledgeWikiReaderStatus | KnowledgeWikiManagementStatus;
78
+ export declare const KNOWLEDGE_WIKI_DOCUMENT_STATUS_BATCH_SIZE = 100;
79
+ export type KnowledgeWikiDocumentStatusResponse = {
80
+ /** Sources of currently published, usable Wiki pages, not merely completed parsing jobs. */
81
+ indexedDocumentIds: string[];
82
+ documents?: KnowledgeWikiDocumentProgress[];
83
+ };
84
+ export type KnowledgeWikiDocumentProgressState = 'not_started' | 'queued' | 'generating' | 'indexing' | 'publishing' | 'ready' | 'failed' | 'outdated' | 'no_content';
85
+ export type KnowledgeWikiDocumentStageState = 'pending' | 'running' | 'complete' | 'failed' | 'skipped';
86
+ export type KnowledgeWikiDocumentProgress = {
87
+ documentId: string;
88
+ state: KnowledgeWikiDocumentProgressState;
89
+ stages: {
90
+ generation: KnowledgeWikiDocumentStageState;
91
+ indexing: KnowledgeWikiDocumentStageState;
92
+ publication: KnowledgeWikiDocumentStageState;
93
+ };
94
+ /** A full rebuild publishes as a batch; another source can block publication. */
95
+ waitingForBatch?: boolean;
96
+ error?: string;
97
+ errorCode?: string;
98
+ retry?: {
99
+ jobId: string;
100
+ requiresAdditionalChargeConfirmation: boolean;
101
+ };
102
+ canView: boolean;
103
+ };
104
+ export type KnowledgeWikiPageContributionPayload = {
105
+ schemaVersion: typeof KNOWLEDGE_WIKI_SCHEMA_VERSION;
106
+ pageType: KnowledgeWikiMappedPageType;
107
+ canonicalName: string;
108
+ aliases: string[];
109
+ summary: string;
110
+ facts: Array<{
111
+ text: string;
112
+ sourceChunkIds: string[];
113
+ }>;
114
+ suggestedLinks: Array<{
115
+ targetType: KnowledgeWikiPageType;
116
+ targetCanonicalName: string;
117
+ label?: string;
118
+ }>;
119
+ };
120
+ /** One source's contributions after identity resolution. Aggregate counts may exceed Map output limits. */
121
+ export type KnowledgeWikiPageSourcePayload = KnowledgeWikiPageContributionPayload;
122
+ export declare const KNOWLEDGE_WIKI_MAX_ALIASES = 20;
123
+ export declare const KNOWLEDGE_WIKI_MAX_FACTS = 100;
124
+ export declare const KNOWLEDGE_WIKI_MAX_SUGGESTED_LINKS = 50;
125
+ export declare const KNOWLEDGE_WIKI_MAX_SOURCE_CHUNKS_PER_FACT = 50;
126
+ export declare const KNOWLEDGE_WIKI_MAX_CANONICAL_NAME_LENGTH = 512;
127
+ export declare const KNOWLEDGE_WIKI_MAX_SUMMARY_LENGTH = 8000;
128
+ export declare const KNOWLEDGE_WIKI_MAX_FACT_LENGTH = 4000;
129
+ export declare function isKnowledgeWikiPageContributionPayload(value: unknown): value is KnowledgeWikiPageContributionPayload;
130
+ export declare function isKnowledgeWikiPageSourcePayload(value: unknown): value is KnowledgeWikiPageSourcePayload;
131
+ export type KnowledgeWikiPageGroup = 'knowledge' | 'summary';
132
+ export type KnowledgeWikiPageListParams = {
133
+ pageGroup?: KnowledgeWikiPageGroup;
134
+ folderId?: string;
135
+ unclassified?: boolean;
136
+ search?: string;
137
+ pageType?: KnowledgeWikiPageType;
138
+ status?: KnowledgeWikiPageStatus;
139
+ skip?: number;
140
+ take?: number;
141
+ };
142
+ export type KnowledgeWikiPageListItem = {
143
+ identityId?: string | null;
144
+ placement?: import('./knowledge-wiki-organization.model').KnowledgeWikiPlacement;
145
+ id: string;
146
+ pageKey: string;
147
+ pageType: KnowledgeWikiPageType;
148
+ canonicalName: string;
149
+ title: string;
150
+ slug: string;
151
+ summary: string;
152
+ aliases: string[];
153
+ status: KnowledgeWikiPageStatus;
154
+ projectionStatus: KnowledgeWikiProjectionStatus;
155
+ updatedAt?: Date;
156
+ };
157
+ export type KnowledgeWikiPageListResult = {
158
+ items: KnowledgeWikiPageListItem[];
159
+ total: number;
160
+ };
161
+ export type KnowledgeWikiPageEvidence = {
162
+ id: string;
163
+ sourceDocumentId: string;
164
+ sourceChunkId: string;
165
+ quote: string;
166
+ ordinal: number;
167
+ sectionAnchor?: string | null;
168
+ sourceAvailable: boolean;
169
+ };
170
+ export type KnowledgeWikiPageLink = {
171
+ pageId: string;
172
+ pageType: KnowledgeWikiPageType;
173
+ title: string;
174
+ slug: string;
175
+ sectionAnchor?: string | null;
176
+ label?: string | null;
177
+ };
178
+ export type KnowledgeWikiPageDetail = KnowledgeWikiPageListItem & {
179
+ markdown: string;
180
+ revision: number;
181
+ links: KnowledgeWikiPageLink[];
182
+ backlinks: KnowledgeWikiPageLink[];
183
+ evidence: KnowledgeWikiPageEvidence[];
184
+ };
185
+ export interface IKnowledgeWikiChunkMetadata extends IDocChunkMetadata {
186
+ contentKind: 'wiki';
187
+ wikiPageId: string;
188
+ wikiPageVersionId: string;
189
+ wikiPageKey: string;
190
+ wikiPageType: KnowledgeWikiPageType;
191
+ wikiRevision: number;
192
+ sectionAnchor: string;
193
+ projectionStatus: KnowledgeWikiProjectionStatus;
194
+ }
195
+ export declare function isKnowledgeWikiChunkMetadata(value: unknown): value is IKnowledgeWikiChunkMetadata;
196
+ export declare const KNOWLEDGE_WIKI_DEFAULT_PAGE_SIZE = 50;
197
+ export declare const KNOWLEDGE_WIKI_MAX_PAGE_SIZE = 100;
198
+ export declare const KNOWLEDGE_WIKI_MAX_SEARCH_LENGTH = 200;
199
+ export declare const KNOWLEDGE_WIKI_FAILED_CONTENT_RETENTION_DAYS = 7;
200
+ export declare const KNOWLEDGE_WIKI_OPERATION_RETENTION_DAYS = 30;
201
+ export declare const KNOWLEDGE_WIKI_DELETION_RECEIPT_RETENTION_DAYS = 90;
202
+ export declare const KNOWLEDGE_WIKI_STALE_VECTOR_CLEANUP_SLO_HOURS = 24;
@@ -24,6 +24,8 @@ export interface IKnowledgebaseTask extends IBasePerTenantAndOrganizationEntityM
24
24
  documents?: Partial<IKnowledgeDocument>[];
25
25
  /** Propagates full conversion vs. snapshot-only rechunking through the background task. */
26
26
  processingMode?: KnowledgeDocumentProcessingMode;
27
+ /** Server-created preview ID -> saved document ID bindings, grouped by source node. */
28
+ materializedSources?: Record<string, Record<string, string>>;
27
29
  };
28
30
  /**
29
31
  * Many to Many of documents in task
@@ -1,3 +1,4 @@
1
+ import type { TKBRetrievalSettings } from './xpert.model';
1
2
  import { ICopilotModel } from './copilot-model.model';
2
3
  import { I18nObject, TAvatar } from '../types';
3
4
  import { IBasePerWorkspaceEntityModel } from './xpert-workspace.model';
@@ -6,6 +7,7 @@ import { IXpert } from './xpert.model';
6
7
  import { IIntegration } from '../integration.model';
7
8
  import { IDocChunkMetadata } from './knowledge-doc-chunk.model';
8
9
  import type { GraphRagConfig, KnowledgeGraphStatus } from './knowledge-graph.model';
10
+ import type { KnowledgebaseWikiConfig, KnowledgeWikiStatus, KnowledgeWikiAvailability } from './knowledge-wiki.model';
9
11
  /**
10
12
  * Non-internal types should remain the same as IntegrationEnum.
11
13
  */
@@ -36,6 +38,8 @@ export declare const DEFAULT_KNOWLEDGEBASE_FAQ_CONFIG: {
36
38
  readonly negativeMatchMode: "exact";
37
39
  };
38
40
  export type KnowledgeRetrievalMode = 'vector' | 'keyword' | 'graph' | 'hybrid';
41
+ /** Request-local content selection, independent of algorithms and persisted recall settings. */
42
+ export type KnowledgeRetrievalContentScope = 'all' | 'original' | 'wiki';
39
43
  export declare enum KnowledgebaseStatusEnum {
40
44
  READY = "ready",
41
45
  REBUILD_REQUIRED = "rebuild_required",
@@ -53,6 +57,23 @@ export type KnowledgebaseParserConfig = {
53
57
  chunkSize: number | null;
54
58
  chunkOverlap: number | null;
55
59
  delimiter: string | null;
60
+ pdfParser?: {
61
+ transformerType: string;
62
+ transformerIntegration?: string;
63
+ transformer?: {
64
+ [key: string]: unknown;
65
+ };
66
+ };
67
+ textSplitterType?: string;
68
+ textSplitter?: {
69
+ [key: string]: unknown;
70
+ };
71
+ separators?: string[];
72
+ imageUnderstandingEnabled?: boolean;
73
+ imageUnderstandingType?: string;
74
+ imageUnderstanding?: {
75
+ [key: string]: unknown;
76
+ };
56
77
  };
57
78
  /**
58
79
  * Type of rag knowledgebase
@@ -70,6 +91,19 @@ export type TKnowledgebase = {
70
91
  * Creation-time indexing behavior for FAQ knowledge bases.
71
92
  */
72
93
  faqConfig?: KnowledgebaseFAQConfig | null;
94
+ /** Optional generated Wiki capability for Standard knowledgebases. */
95
+ wikiConfig?: KnowledgebaseWikiConfig | null;
96
+ wikiStatus?: KnowledgeWikiStatus | null;
97
+ wikiAvailability?: KnowledgeWikiAvailability | null;
98
+ wikiRevision?: number | null;
99
+ wikiActiveRevision?: number | null;
100
+ wikiStagedRevision?: number | null;
101
+ wikiBuildError?: string | null;
102
+ wikiRebuildRequiredReason?: 'generator_upgrade' | null;
103
+ wikiGeneratorVersion?: string | null;
104
+ wikiConfigFingerprint?: string | null;
105
+ canManageWiki?: boolean;
106
+ canManageDocumentDeletions?: boolean;
73
107
  /**
74
108
  * English | Chinese
75
109
  */
@@ -102,6 +136,9 @@ export type TKnowledgebase = {
102
136
  */
103
137
  chatModel?: ICopilotModel | null;
104
138
  chatModelId?: string | null;
139
+ /** Optional dedicated LLM for Wiki generation. Falls back to chatModel when unset. */
140
+ wikiModel?: ICopilotModel | null;
141
+ wikiModelId?: string | null;
105
142
  embeddingCollectionName?: string | null;
106
143
  embeddingModelFingerprint?: string | null;
107
144
  embeddingDimensions?: number | null;
@@ -193,6 +230,8 @@ export declare enum KnowledgebasePermission {
193
230
  * Recall parameters
194
231
  */
195
232
  export type TKBRecallParams = {
233
+ /** Default content selection, used only when Wiki is enabled. */
234
+ contentScope?: KnowledgeRetrievalContentScope;
196
235
  /**
197
236
  * Default retrieval mode for this knowledgebase.
198
237
  */
@@ -202,9 +241,13 @@ export type TKBRecallParams = {
202
241
  */
203
242
  topK?: number;
204
243
  /**
205
- * At least the similarity threshold
244
+ * Minimum vector similarity. Null disables the threshold.
206
245
  */
207
- score?: number;
246
+ score?: number | null;
247
+ /**
248
+ * Minimum relevance score returned by the rerank model. Null disables the threshold.
249
+ */
250
+ rerankThreshold?: number | null;
208
251
  /**
209
252
  * Weight in EnsembleRetriever
210
253
  */
@@ -280,3 +323,5 @@ export declare const KNOWLEDGE_PROCESSING_MODE_NAME = "processing_mode";
280
323
  export declare const KNOWLEDGE_DOCUMENTS_NAME = "documents";
281
324
  export declare const KNOWLEDGE_FOLDER_ID_NAME = "folder_id";
282
325
  export declare const KNOWLEDGE_STAGE_NAME = "stage";
326
+ /** Check the sources that can execute within the selected content scope. */
327
+ export declare function hasEnabledKnowledgeRetrievalSource(retrieval: Partial<IKnowledgebase & TKBRetrievalSettings> | null | undefined, allowGraphRetrieval?: boolean, contentScope?: KnowledgeRetrievalContentScope): boolean;
@@ -1,3 +1,4 @@
1
+ import type { McpCapabilityApprovalMode } from './mcp-publication.model';
1
2
  import type { JSONValue } from '../core.model';
2
3
  export declare const MCP_CAPABILITY_DESCRIPTOR_VERSION: 1;
3
4
  export declare const MCP_CAPABILITY_TYPES: readonly ["tool", "resource", "resource_template", "prompt", "app"];
@@ -54,6 +55,8 @@ export interface McpToolCapabilityDescriptor extends McpCapabilityDescriptorBase
54
55
  inputSchema: McpJsonSchema;
55
56
  outputSchema?: McpJsonSchema;
56
57
  behavior: McpToolBehavior;
58
+ /** Plugin default used when a Publication has no explicit approval override. */
59
+ defaultApprovalMode?: McpCapabilityApprovalMode;
57
60
  annotations?: McpToolAnnotations;
58
61
  appResourceKey?: string;
59
62
  taskMode?: 'optional' | 'required';
@@ -99,4 +102,8 @@ type McpCapabilityDeclarationOf<TDescriptor extends McpCapabilityDescriptor> = T
99
102
  } : never;
100
103
  /** Plugin-side declaration before the host binds it to a concrete toolset instance. */
101
104
  export type McpCapabilityDeclaration = McpCapabilityDeclarationOf<McpCapabilityDescriptor>;
105
+ /** Resolve the declaration default; callers must apply explicit Publication policy first. */
106
+ export declare function defaultMcpToolApprovalMode(descriptor: Pick<McpToolCapabilityDescriptor, 'behavior' | 'defaultApprovalMode'>): McpCapabilityApprovalMode;
107
+ /** Dangerous tools may run directly only when their owner explicitly declares that policy. */
108
+ export declare function canAllowMcpToolDirectly(descriptor: Pick<McpToolCapabilityDescriptor, 'behavior' | 'defaultApprovalMode'>): boolean;
102
109
  export {};
@@ -31,6 +31,8 @@ export type TAgentMiddlewareMeta = {
31
31
  description?: I18nObject;
32
32
  configSchema?: JsonSchemaObjectType;
33
33
  features?: Array<TXpertFeatureKey | string>;
34
+ /** Optional display labels keyed by declared Feature identifier; never grants capabilities. */
35
+ featureLabels?: Record<string, I18nObject>;
34
36
  slashCommands?: SkillSlashCommand[];
35
37
  builtin?: boolean;
36
38
  /**
@@ -104,7 +104,7 @@ export type TAgentExecutionMetadata = {
104
104
  * AI Model
105
105
  */
106
106
  model?: string;
107
- /** Opaque Assistant model option used by the Primary Agent. */
107
+ /** Opaque Assistant model option used by the base and Primary models. */
108
108
  primaryModelId?: string;
109
109
  primaryModelSource?: import('./assistant-model.model').TAssistantPrimaryModelSelectionSource;
110
110
  /** Sanitized model snapshot used to keep resume and retry deterministic. */
@@ -94,6 +94,11 @@ export type TTemplate = {
94
94
  startPrompts?: string[];
95
95
  promptWorkflows?: TPromptWorkflow[];
96
96
  releaseNotes?: string;
97
+ availableLocales?: string[];
98
+ defaultLocale?: string;
99
+ locale?: string;
100
+ pluginVersion?: string;
101
+ contentHash?: string;
97
102
  xpertName?: string;
98
103
  dependencies?: XpertTemplatePluginDependencies;
99
104
  /** Trusted plugin App explicitly linked to this Assistant template. */
@@ -104,6 +109,21 @@ export type TXpertTemplate = TTemplate & {
104
109
  type: XpertTypeEnum | 'project';
105
110
  copilotModel?: Partial<TCopilotModel>;
106
111
  };
112
+ export type TXpertTemplateSummary = Omit<TXpertTemplate, 'export_data'>;
113
+ export interface TXpertTemplateCatalogQuery {
114
+ search?: string;
115
+ category?: string;
116
+ pluginName?: string;
117
+ offset?: number;
118
+ limit?: number;
119
+ }
120
+ export interface TXpertTemplateCatalogPage {
121
+ items: TXpertTemplateSummary[];
122
+ total: number;
123
+ offset: number;
124
+ limit: number;
125
+ categories: string[];
126
+ }
107
127
  export interface IXpertMCPTemplate extends TTemplate {
108
128
  /**
109
129
  * string is the backward compatible image file URL format
@@ -278,6 +278,9 @@ export type TXpertTemplateSource = {
278
278
  installedAt?: string;
279
279
  lastSyncedAt?: string;
280
280
  releaseNotes?: string;
281
+ locale?: string;
282
+ pluginVersion?: string;
283
+ contentHash?: string;
281
284
  };
282
285
  export type TXpertTemplateSyncResult = {
283
286
  xpertId: string;
@@ -643,9 +646,9 @@ export type TChatOptions = {
643
646
  * Per-request runtime context forwarded to agent middleware/tools.
644
647
  */
645
648
  context?: Record<string, unknown>;
646
- /** Resolved runtime override for the Assistant Primary Agent only. */
649
+ /** Resolved Primary model; explicit and preference selections also supply Assistant base inheritance. */
647
650
  primaryCopilotModel?: TCopilotModel;
648
- /** Opaque Assistant model option id recorded for audit and retry. */
651
+ /** Trusted Assistant model selection, also recorded for audit and retry. */
649
652
  primaryModelId?: string;
650
653
  /** Published Primary Agent key to which the override is restricted. */
651
654
  primaryAgentKey?: string;