@okf/ootils 1.31.1 → 1.31.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.d.mts +70 -5
- package/dist/browser.d.ts +70 -5
- package/dist/browser.js +230 -186
- package/dist/browser.mjs +230 -186
- package/dist/node.d.mts +70 -5
- package/dist/node.d.ts +70 -5
- package/dist/node.js +230 -186
- package/dist/node.mjs +230 -186
- package/dist/universal.d.mts +70 -5
- package/dist/universal.d.ts +70 -5
- package/dist/universal.js +230 -186
- package/dist/universal.mjs +230 -186
- package/package.json +1 -1
package/dist/node.mjs
CHANGED
|
@@ -375,6 +375,34 @@ var init_GLOBAL_BULLMQ_CONFIG = __esm({
|
|
|
375
375
|
maxStalledCount: 3
|
|
376
376
|
}
|
|
377
377
|
},
|
|
378
|
+
SARVAM_TRANSCRIPTION_QUEUE: {
|
|
379
|
+
id: "sarvam-transcription-queue",
|
|
380
|
+
queueConfig: {
|
|
381
|
+
defaultJobOptions: {
|
|
382
|
+
attempts: 10,
|
|
383
|
+
// Sarvam jobs need many poll cycles, not retries per se
|
|
384
|
+
backoff: {
|
|
385
|
+
type: "exponential",
|
|
386
|
+
delay: 15e3
|
|
387
|
+
// First retry at 15s, then 30s, 60s, etc.
|
|
388
|
+
},
|
|
389
|
+
removeOnComplete: 50,
|
|
390
|
+
removeOnFail: 200
|
|
391
|
+
},
|
|
392
|
+
streams: {
|
|
393
|
+
events: {
|
|
394
|
+
maxLen: 10
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
},
|
|
398
|
+
workerConfig: {
|
|
399
|
+
concurrency: 5,
|
|
400
|
+
// Multiple transcription polls can run in parallel safely
|
|
401
|
+
lockDuration: 12e4,
|
|
402
|
+
// 2 min — fetching results from Sarvam can be slow
|
|
403
|
+
maxStalledCount: 3
|
|
404
|
+
}
|
|
405
|
+
},
|
|
378
406
|
REINDEX_QUEUE: {
|
|
379
407
|
id: "reindex-queue",
|
|
380
408
|
queueConfig: {
|
|
@@ -2957,8 +2985,203 @@ var compareAndGroupBlocks = (blocksPerTpl) => {
|
|
|
2957
2985
|
return Array.from(templateGroupToFilters.values());
|
|
2958
2986
|
};
|
|
2959
2987
|
|
|
2988
|
+
// src/blockRegistry/schemaPresets.ts
|
|
2989
|
+
var MONGO_SCHEMA_PRESETS = {
|
|
2990
|
+
object: { type: Object },
|
|
2991
|
+
string: { type: String }
|
|
2992
|
+
};
|
|
2993
|
+
var ELASTIC_MAPPING_PRESETS = {
|
|
2994
|
+
largeText: {
|
|
2995
|
+
properties: {
|
|
2996
|
+
allText: {
|
|
2997
|
+
type: "text",
|
|
2998
|
+
analyzer: "LargeTextAnalyzer"
|
|
2999
|
+
}
|
|
3000
|
+
}
|
|
3001
|
+
}
|
|
3002
|
+
};
|
|
3003
|
+
var CHUNKING_PRESETS = {
|
|
3004
|
+
// Lexical-shaped text — uses semantic chunking on allText
|
|
3005
|
+
lexicalSemantic: {
|
|
3006
|
+
strategy: "semanticChunking",
|
|
3007
|
+
windowSize: 3,
|
|
3008
|
+
minSimilarityScore: 0.7
|
|
3009
|
+
},
|
|
3010
|
+
// Plain text input — single chunk per field
|
|
3011
|
+
simpleText: {
|
|
3012
|
+
strategy: "simpleChunking"
|
|
3013
|
+
}
|
|
3014
|
+
};
|
|
3015
|
+
|
|
3016
|
+
// src/blockRegistry/blocks/LexicalTextEditor.ts
|
|
3017
|
+
var LexicalTextEditor = {
|
|
3018
|
+
compName: "LexicalTextEditor",
|
|
3019
|
+
// Identity
|
|
3020
|
+
category: "text",
|
|
3021
|
+
qualQuant: "qual",
|
|
3022
|
+
// Schema
|
|
3023
|
+
mongoSchemaType: MONGO_SCHEMA_PRESETS.object,
|
|
3024
|
+
esMapping: ELASTIC_MAPPING_PRESETS.largeText,
|
|
3025
|
+
// Capabilities
|
|
3026
|
+
capabilities: {
|
|
3027
|
+
hasPlainText: true,
|
|
3028
|
+
annotation: true,
|
|
3029
|
+
aiAnnotation: true,
|
|
3030
|
+
aiEnrichment: true,
|
|
3031
|
+
searchable: true,
|
|
3032
|
+
directDataImport: true,
|
|
3033
|
+
csvExport: true,
|
|
3034
|
+
translatable: true,
|
|
3035
|
+
documentSummarizer: true,
|
|
3036
|
+
stripFromMainOnAnnoChunkSync: true,
|
|
3037
|
+
excludeFromListingProjection: true
|
|
3038
|
+
},
|
|
3039
|
+
// Field paths
|
|
3040
|
+
fieldPaths: {
|
|
3041
|
+
plainTextString: "allText",
|
|
3042
|
+
searchField: "allText",
|
|
3043
|
+
displayValue: "allText"
|
|
3044
|
+
},
|
|
3045
|
+
// Validation
|
|
3046
|
+
validation: {
|
|
3047
|
+
populatedCheckFn: "lexicalTextEditorHasValue",
|
|
3048
|
+
formValidationFn: "lexicalTextEditorHasValue"
|
|
3049
|
+
},
|
|
3050
|
+
// Translation
|
|
3051
|
+
translation: {
|
|
3052
|
+
handlerType: "LexicalBlockHandler"
|
|
3053
|
+
},
|
|
3054
|
+
// Table rendering
|
|
3055
|
+
tableCell: {
|
|
3056
|
+
cellComp: "RichTextAsPlainTextLex",
|
|
3057
|
+
sortPathSuffix: "editorState.root.children.0.children.0.text"
|
|
3058
|
+
},
|
|
3059
|
+
// CSV export
|
|
3060
|
+
csvExport: {
|
|
3061
|
+
transformFn: "KPRichLexicalEditor"
|
|
3062
|
+
},
|
|
3063
|
+
// Slack
|
|
3064
|
+
slackFormat: {
|
|
3065
|
+
handlerFn: "lexicalRichText"
|
|
3066
|
+
},
|
|
3067
|
+
// Batch import
|
|
3068
|
+
batchImport: {
|
|
3069
|
+
valueInjectorFn: "toLexicalValue"
|
|
3070
|
+
},
|
|
3071
|
+
// Content block option — TCI template builder & direct import UI
|
|
3072
|
+
contentBlockOption: {
|
|
3073
|
+
display: "Rich Text Field",
|
|
3074
|
+
icon: "TextAa",
|
|
3075
|
+
directImportGroupsIdx: [2, 2]
|
|
3076
|
+
},
|
|
3077
|
+
// Chunking config — used by okf-sub CreateChunksHandler
|
|
3078
|
+
chunkingConfig: CHUNKING_PRESETS.lexicalSemantic
|
|
3079
|
+
};
|
|
3080
|
+
|
|
3081
|
+
// src/blockRegistry/registry.ts
|
|
3082
|
+
var BlockRegistry = class {
|
|
3083
|
+
constructor() {
|
|
3084
|
+
this.blocks = /* @__PURE__ */ new Map();
|
|
3085
|
+
this.register(LexicalTextEditor);
|
|
3086
|
+
}
|
|
3087
|
+
/** Register a block descriptor. */
|
|
3088
|
+
register(descriptor) {
|
|
3089
|
+
this.blocks.set(descriptor.compName, descriptor);
|
|
3090
|
+
}
|
|
3091
|
+
/** Get the full descriptor for a block type. Returns undefined if not registered. */
|
|
3092
|
+
getBlock(compType) {
|
|
3093
|
+
return this.blocks.get(compType);
|
|
3094
|
+
}
|
|
3095
|
+
/** Check if a block type is registered in the registry. */
|
|
3096
|
+
isRegistered(compType) {
|
|
3097
|
+
return this.blocks.has(compType);
|
|
3098
|
+
}
|
|
3099
|
+
/**
|
|
3100
|
+
* Get all registered block descriptors that have a given capability set to a truthy value.
|
|
3101
|
+
* Optionally pass a specific value to match (e.g. for enum-style capabilities).
|
|
3102
|
+
*/
|
|
3103
|
+
getBlocksByCapability(capability, value = true) {
|
|
3104
|
+
return Array.from(this.blocks.values()).filter((b) => {
|
|
3105
|
+
const cap = b.capabilities[capability];
|
|
3106
|
+
if (value === true) return !!cap;
|
|
3107
|
+
return cap === value;
|
|
3108
|
+
});
|
|
3109
|
+
}
|
|
3110
|
+
/**
|
|
3111
|
+
* Get compType strings for all registered blocks with a given capability.
|
|
3112
|
+
* Replaces scattered hardcoded arrays like:
|
|
3113
|
+
* const TEXT_FIELD_COMPONENTS = ["TextInput", "LexicalTextEditor", ...]
|
|
3114
|
+
* becomes:
|
|
3115
|
+
* const TEXT_FIELD_COMPONENTS = blockRegistry.getComps('aiTextExtraction')
|
|
3116
|
+
*/
|
|
3117
|
+
getComps(capability, value = true) {
|
|
3118
|
+
return this.getBlocksByCapability(capability, value).map((b) => b.compName);
|
|
3119
|
+
}
|
|
3120
|
+
/** Get all registered blocks in a given category. */
|
|
3121
|
+
getBlocksByCategory(category) {
|
|
3122
|
+
return Array.from(this.blocks.values()).filter((b) => b.category === category);
|
|
3123
|
+
}
|
|
3124
|
+
/** Get compType strings for all qual blocks. */
|
|
3125
|
+
getQualBlocks() {
|
|
3126
|
+
return Array.from(this.blocks.values()).filter((b) => b.qualQuant === "qual").map((b) => b.compName);
|
|
3127
|
+
}
|
|
3128
|
+
/** Get compType strings for all quant blocks. */
|
|
3129
|
+
getQuantBlocks() {
|
|
3130
|
+
return Array.from(this.blocks.values()).filter((b) => b.qualQuant === "quant").map((b) => b.compName);
|
|
3131
|
+
}
|
|
3132
|
+
/** Check if a specific block has a specific capability. */
|
|
3133
|
+
hasCapability(compType, capability) {
|
|
3134
|
+
const block = this.blocks.get(compType);
|
|
3135
|
+
if (!block) return false;
|
|
3136
|
+
return !!block.capabilities[capability];
|
|
3137
|
+
}
|
|
3138
|
+
/** Get all registered block descriptors. */
|
|
3139
|
+
getAll() {
|
|
3140
|
+
return Array.from(this.blocks.values());
|
|
3141
|
+
}
|
|
3142
|
+
/**
|
|
3143
|
+
* Get compName strings for all registered blocks that have a chunking config.
|
|
3144
|
+
* Used by chunking pipelines and prompt-string injection (e.g. searchChunks tool
|
|
3145
|
+
* description) to know which fields actually have chunks to search.
|
|
3146
|
+
*/
|
|
3147
|
+
getCompsWithChunking() {
|
|
3148
|
+
return Array.from(this.blocks.values()).filter((b) => !!b.chunkingConfig).map((b) => b.compName);
|
|
3149
|
+
}
|
|
3150
|
+
/**
|
|
3151
|
+
* Filter a list of block instances down to those where annotation is enabled.
|
|
3152
|
+
* A block is annotation-enabled if its registry capability `annotation` is true.
|
|
3153
|
+
* For backwards compat with un-migrated blocks (e.g. deprecated KPRichInput/RichTextEditor),
|
|
3154
|
+
* falls back to the legacy per-instance `props.annotation.enable` toggle.
|
|
3155
|
+
*
|
|
3156
|
+
* Today: every registered annotation-capable block (e.g. LexicalTextEditor) is auto-enabled.
|
|
3157
|
+
*/
|
|
3158
|
+
getAnnotationEnabledBlocks(allBlocks) {
|
|
3159
|
+
return allBlocks.filter((block) => {
|
|
3160
|
+
const blockDef = this.blocks.get(block.comp);
|
|
3161
|
+
if (blockDef) return !!blockDef.capabilities.annotation;
|
|
3162
|
+
return block.props?.annotation?.enable === true;
|
|
3163
|
+
});
|
|
3164
|
+
}
|
|
3165
|
+
/**
|
|
3166
|
+
* Resolve the tagTypesConfig for a block instance.
|
|
3167
|
+
*
|
|
3168
|
+
* Resolution order:
|
|
3169
|
+
* 1. `hardCodedTagTypesConfigForSM` — the intended self-managed default, which takes
|
|
3170
|
+
* priority over per-instance values (justifies not persisting per-block on self-managed).
|
|
3171
|
+
* Sourced from `GET_SELF_MANAGED_BASE_CONFIGS().annotation_tagTypesConfig` on BE,
|
|
3172
|
+
* or `platformConfigs.SELF_MANAGED_BASE_CONFIGS.annotation_tagTypesConfig` on FE.
|
|
3173
|
+
* Pass null/undefined for non-SM tenants.
|
|
3174
|
+
* 2. `block.props.annotation.tagTypesConfig` — legacy per-instance persisted value.
|
|
3175
|
+
* 3. Empty array.
|
|
3176
|
+
*/
|
|
3177
|
+
getTagTypesConfig(block, hardCodedTagTypesConfigForSM) {
|
|
3178
|
+
return hardCodedTagTypesConfigForSM || block.props?.annotation?.tagTypesConfig || [];
|
|
3179
|
+
}
|
|
3180
|
+
};
|
|
3181
|
+
var blockRegistry = new BlockRegistry();
|
|
3182
|
+
|
|
2960
3183
|
// src/utils/autoGenFilterConfigsFromTpl/utils/extractAndOrganizeBlocks.ts
|
|
2961
|
-
var extractAndOrganizeBlocks = (selectedTpls, allTpls) => {
|
|
3184
|
+
var extractAndOrganizeBlocks = (selectedTpls, allTpls, { smTagTypesConfig } = {}) => {
|
|
2962
3185
|
const extractedBlocks = {};
|
|
2963
3186
|
const templateBlocksCache = /* @__PURE__ */ new Map();
|
|
2964
3187
|
const getCachedBlocks = (tpl) => {
|
|
@@ -2969,7 +3192,7 @@ var extractAndOrganizeBlocks = (selectedTpls, allTpls) => {
|
|
|
2969
3192
|
};
|
|
2970
3193
|
extractedBlocks.annoTagBlocks = selectedTpls.map((tpl) => {
|
|
2971
3194
|
const allBlocks = getCachedBlocks(tpl);
|
|
2972
|
-
const allTagTypes = allBlocks.
|
|
3195
|
+
const allTagTypes = blockRegistry.getAnnotationEnabledBlocks(allBlocks).flatMap((block) => blockRegistry.getTagTypesConfig(block, smTagTypesConfig).map((d) => d.tagType));
|
|
2973
3196
|
const uniqueTagTypes = [...new Set(allTagTypes)];
|
|
2974
3197
|
return {
|
|
2975
3198
|
contentType: tpl.kp_content_type,
|
|
@@ -2983,13 +3206,13 @@ var extractAndOrganizeBlocks = (selectedTpls, allTpls) => {
|
|
|
2983
3206
|
const allBlocks = getCachedBlocks(tpl);
|
|
2984
3207
|
return {
|
|
2985
3208
|
contentType: tpl.kp_content_type,
|
|
2986
|
-
blocks:
|
|
3209
|
+
blocks: blockRegistry.getAnnotationEnabledBlocks(allBlocks)
|
|
2987
3210
|
};
|
|
2988
3211
|
});
|
|
2989
3212
|
extractedBlocks.annoRollupBlocks = selectedTpls.map((tpl) => {
|
|
2990
3213
|
const allBlocks = getCachedBlocks(tpl);
|
|
2991
3214
|
const uniqueTagTypes = Array.from(new Set(
|
|
2992
|
-
|
|
3215
|
+
blockRegistry.getAnnotationEnabledBlocks(allBlocks).flatMap((block) => blockRegistry.getTagTypesConfig(block, smTagTypesConfig)).map((conf) => conf.tagType)
|
|
2993
3216
|
));
|
|
2994
3217
|
return {
|
|
2995
3218
|
contentType: tpl.kp_content_type,
|
|
@@ -3636,9 +3859,10 @@ var autoGenFilterConfigsFromTpl = ({
|
|
|
3636
3859
|
allTpls,
|
|
3637
3860
|
filterScopes,
|
|
3638
3861
|
isSelfManagedTenant = false,
|
|
3639
|
-
annotationTagsCount
|
|
3862
|
+
annotationTagsCount,
|
|
3863
|
+
smTagTypesConfig
|
|
3640
3864
|
}) => {
|
|
3641
|
-
const extractedBlocks = extractAndOrganizeBlocks(selectedTpls, allTpls);
|
|
3865
|
+
const extractedBlocks = extractAndOrganizeBlocks(selectedTpls, allTpls, { smTagTypesConfig });
|
|
3642
3866
|
const allAnnoEnabledBlocks = filterScopes.includes("anno") ? extractedBlocks.annoEnabledBlocks.flatMap((item) => item.blocks).reduce((acc, block) => {
|
|
3643
3867
|
if (!acc.find((b) => b.valuePath === block.valuePath)) {
|
|
3644
3868
|
acc.push(block);
|
|
@@ -3760,186 +3984,6 @@ var genCleanCamelCaseId = (id) => {
|
|
|
3760
3984
|
return result.slice(0, MAX_LENGTH);
|
|
3761
3985
|
};
|
|
3762
3986
|
|
|
3763
|
-
// src/blockRegistry/schemaPresets.ts
|
|
3764
|
-
var MONGO_SCHEMA_PRESETS = {
|
|
3765
|
-
object: { type: Object },
|
|
3766
|
-
string: { type: String }
|
|
3767
|
-
};
|
|
3768
|
-
var ELASTIC_MAPPING_PRESETS = {
|
|
3769
|
-
largeText: {
|
|
3770
|
-
properties: {
|
|
3771
|
-
allText: {
|
|
3772
|
-
type: "text",
|
|
3773
|
-
analyzer: "LargeTextAnalyzer"
|
|
3774
|
-
}
|
|
3775
|
-
}
|
|
3776
|
-
}
|
|
3777
|
-
};
|
|
3778
|
-
var CHUNKING_PRESETS = {
|
|
3779
|
-
// Lexical-shaped text — uses semantic chunking on allText
|
|
3780
|
-
lexicalSemantic: {
|
|
3781
|
-
strategy: "semanticChunking",
|
|
3782
|
-
windowSize: 3,
|
|
3783
|
-
minSimilarityScore: 0.7
|
|
3784
|
-
},
|
|
3785
|
-
// Plain text input — single chunk per field
|
|
3786
|
-
simpleText: {
|
|
3787
|
-
strategy: "simpleChunking"
|
|
3788
|
-
}
|
|
3789
|
-
};
|
|
3790
|
-
|
|
3791
|
-
// src/blockRegistry/blocks/LexicalTextEditor.ts
|
|
3792
|
-
var LexicalTextEditor = {
|
|
3793
|
-
compName: "LexicalTextEditor",
|
|
3794
|
-
// Identity
|
|
3795
|
-
category: "text",
|
|
3796
|
-
qualQuant: "qual",
|
|
3797
|
-
// Schema
|
|
3798
|
-
mongoSchemaType: MONGO_SCHEMA_PRESETS.object,
|
|
3799
|
-
esMapping: ELASTIC_MAPPING_PRESETS.largeText,
|
|
3800
|
-
// Capabilities
|
|
3801
|
-
capabilities: {
|
|
3802
|
-
hasPlainText: true,
|
|
3803
|
-
annotation: true,
|
|
3804
|
-
aiAnnotation: true,
|
|
3805
|
-
aiEnrichment: true,
|
|
3806
|
-
searchable: true,
|
|
3807
|
-
directDataImport: true,
|
|
3808
|
-
csvExport: true,
|
|
3809
|
-
translatable: true,
|
|
3810
|
-
documentSummarizer: true,
|
|
3811
|
-
stripFromMainOnAnnoChunkSync: true,
|
|
3812
|
-
excludeFromListingProjection: true
|
|
3813
|
-
},
|
|
3814
|
-
// Field paths
|
|
3815
|
-
fieldPaths: {
|
|
3816
|
-
plainTextString: "allText",
|
|
3817
|
-
searchField: "allText",
|
|
3818
|
-
displayValue: "allText"
|
|
3819
|
-
},
|
|
3820
|
-
// Validation
|
|
3821
|
-
validation: {
|
|
3822
|
-
populatedCheckFn: "lexicalTextEditorHasValue",
|
|
3823
|
-
formValidationFn: "lexicalTextEditorHasValue"
|
|
3824
|
-
},
|
|
3825
|
-
// Translation
|
|
3826
|
-
translation: {
|
|
3827
|
-
handlerType: "LexicalBlockHandler"
|
|
3828
|
-
},
|
|
3829
|
-
// Table rendering
|
|
3830
|
-
tableCell: {
|
|
3831
|
-
cellComp: "RichTextAsPlainTextLex",
|
|
3832
|
-
sortPathSuffix: "editorState.root.children.0.children.0.text"
|
|
3833
|
-
},
|
|
3834
|
-
// CSV export
|
|
3835
|
-
csvExport: {
|
|
3836
|
-
transformFn: "KPRichLexicalEditor"
|
|
3837
|
-
},
|
|
3838
|
-
// Slack
|
|
3839
|
-
slackFormat: {
|
|
3840
|
-
handlerFn: "lexicalRichText"
|
|
3841
|
-
},
|
|
3842
|
-
// Batch import
|
|
3843
|
-
batchImport: {
|
|
3844
|
-
valueInjectorFn: "toLexicalValue"
|
|
3845
|
-
},
|
|
3846
|
-
// Content block option — TCI template builder & direct import UI
|
|
3847
|
-
contentBlockOption: {
|
|
3848
|
-
display: "Rich Text Field",
|
|
3849
|
-
icon: "TextAa",
|
|
3850
|
-
directImportGroupsIdx: [2, 2]
|
|
3851
|
-
},
|
|
3852
|
-
// Chunking config — used by okf-sub CreateChunksHandler
|
|
3853
|
-
chunkingConfig: CHUNKING_PRESETS.lexicalSemantic
|
|
3854
|
-
};
|
|
3855
|
-
|
|
3856
|
-
// src/blockRegistry/registry.ts
|
|
3857
|
-
var BlockRegistry = class {
|
|
3858
|
-
constructor() {
|
|
3859
|
-
this.blocks = /* @__PURE__ */ new Map();
|
|
3860
|
-
this.register(LexicalTextEditor);
|
|
3861
|
-
}
|
|
3862
|
-
/** Register a block descriptor. */
|
|
3863
|
-
register(descriptor) {
|
|
3864
|
-
this.blocks.set(descriptor.compName, descriptor);
|
|
3865
|
-
}
|
|
3866
|
-
/** Get the full descriptor for a block type. Returns undefined if not registered. */
|
|
3867
|
-
getBlock(compType) {
|
|
3868
|
-
return this.blocks.get(compType);
|
|
3869
|
-
}
|
|
3870
|
-
/** Check if a block type is registered in the registry. */
|
|
3871
|
-
isRegistered(compType) {
|
|
3872
|
-
return this.blocks.has(compType);
|
|
3873
|
-
}
|
|
3874
|
-
/**
|
|
3875
|
-
* Get all registered block descriptors that have a given capability set to a truthy value.
|
|
3876
|
-
* Optionally pass a specific value to match (e.g. for enum-style capabilities).
|
|
3877
|
-
*/
|
|
3878
|
-
getBlocksByCapability(capability, value = true) {
|
|
3879
|
-
return Array.from(this.blocks.values()).filter((b) => {
|
|
3880
|
-
const cap = b.capabilities[capability];
|
|
3881
|
-
if (value === true) return !!cap;
|
|
3882
|
-
return cap === value;
|
|
3883
|
-
});
|
|
3884
|
-
}
|
|
3885
|
-
/**
|
|
3886
|
-
* Get compType strings for all registered blocks with a given capability.
|
|
3887
|
-
* Replaces scattered hardcoded arrays like:
|
|
3888
|
-
* const TEXT_FIELD_COMPONENTS = ["TextInput", "LexicalTextEditor", ...]
|
|
3889
|
-
* becomes:
|
|
3890
|
-
* const TEXT_FIELD_COMPONENTS = blockRegistry.getComps('aiTextExtraction')
|
|
3891
|
-
*/
|
|
3892
|
-
getComps(capability, value = true) {
|
|
3893
|
-
return this.getBlocksByCapability(capability, value).map((b) => b.compName);
|
|
3894
|
-
}
|
|
3895
|
-
/** Get all registered blocks in a given category. */
|
|
3896
|
-
getBlocksByCategory(category) {
|
|
3897
|
-
return Array.from(this.blocks.values()).filter((b) => b.category === category);
|
|
3898
|
-
}
|
|
3899
|
-
/** Get compType strings for all qual blocks. */
|
|
3900
|
-
getQualBlocks() {
|
|
3901
|
-
return Array.from(this.blocks.values()).filter((b) => b.qualQuant === "qual").map((b) => b.compName);
|
|
3902
|
-
}
|
|
3903
|
-
/** Get compType strings for all quant blocks. */
|
|
3904
|
-
getQuantBlocks() {
|
|
3905
|
-
return Array.from(this.blocks.values()).filter((b) => b.qualQuant === "quant").map((b) => b.compName);
|
|
3906
|
-
}
|
|
3907
|
-
/** Check if a specific block has a specific capability. */
|
|
3908
|
-
hasCapability(compType, capability) {
|
|
3909
|
-
const block = this.blocks.get(compType);
|
|
3910
|
-
if (!block) return false;
|
|
3911
|
-
return !!block.capabilities[capability];
|
|
3912
|
-
}
|
|
3913
|
-
/** Get all registered block descriptors. */
|
|
3914
|
-
getAll() {
|
|
3915
|
-
return Array.from(this.blocks.values());
|
|
3916
|
-
}
|
|
3917
|
-
/**
|
|
3918
|
-
* Get compName strings for all registered blocks that have a chunking config.
|
|
3919
|
-
* Used by chunking pipelines and prompt-string injection (e.g. searchChunks tool
|
|
3920
|
-
* description) to know which fields actually have chunks to search.
|
|
3921
|
-
*/
|
|
3922
|
-
getCompsWithChunking() {
|
|
3923
|
-
return Array.from(this.blocks.values()).filter((b) => !!b.chunkingConfig).map((b) => b.compName);
|
|
3924
|
-
}
|
|
3925
|
-
/**
|
|
3926
|
-
* Filter a list of block instances down to those where annotation is enabled.
|
|
3927
|
-
* A block is annotation-enabled if its registry capability `annotation` is true.
|
|
3928
|
-
* For backwards compat with un-migrated blocks (e.g. deprecated KPRichInput/RichTextEditor),
|
|
3929
|
-
* falls back to the legacy per-instance `props.annotation.enable` toggle.
|
|
3930
|
-
*
|
|
3931
|
-
* Today: every registered annotation-capable block (e.g. LexicalTextEditor) is auto-enabled.
|
|
3932
|
-
*/
|
|
3933
|
-
getAnnotationEnabledBlocks(allBlocks) {
|
|
3934
|
-
return allBlocks.filter((block) => {
|
|
3935
|
-
const blockDef = this.blocks.get(block.comp);
|
|
3936
|
-
if (blockDef) return !!blockDef.capabilities.annotation;
|
|
3937
|
-
return block.props?.annotation?.enable === true;
|
|
3938
|
-
});
|
|
3939
|
-
}
|
|
3940
|
-
};
|
|
3941
|
-
var blockRegistry = new BlockRegistry();
|
|
3942
|
-
|
|
3943
3987
|
// src/node.ts
|
|
3944
3988
|
var import_MongoConnector3 = __toESM(require_MongoConnector());
|
|
3945
3989
|
var import_ElasticSearchConnector = __toESM(require_ElasticSearchConnector());
|
package/dist/universal.d.mts
CHANGED
|
@@ -749,7 +749,7 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
749
749
|
}
|
|
750
750
|
export { workerConfig_11 as workerConfig };
|
|
751
751
|
}
|
|
752
|
-
namespace
|
|
752
|
+
namespace SARVAM_TRANSCRIPTION_QUEUE {
|
|
753
753
|
let id_12: string;
|
|
754
754
|
export { id_12 as id };
|
|
755
755
|
export namespace queueConfig_12 {
|
|
@@ -763,8 +763,6 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
763
763
|
export { delay_12 as delay };
|
|
764
764
|
}
|
|
765
765
|
export { backoff_12 as backoff };
|
|
766
|
-
let delay_13: number;
|
|
767
|
-
export { delay_13 as delay };
|
|
768
766
|
let removeOnComplete_12: number;
|
|
769
767
|
export { removeOnComplete_12 as removeOnComplete };
|
|
770
768
|
let removeOnFail_12: number;
|
|
@@ -791,6 +789,48 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
791
789
|
}
|
|
792
790
|
export { workerConfig_12 as workerConfig };
|
|
793
791
|
}
|
|
792
|
+
namespace REINDEX_QUEUE {
|
|
793
|
+
let id_13: string;
|
|
794
|
+
export { id_13 as id };
|
|
795
|
+
export namespace queueConfig_13 {
|
|
796
|
+
export namespace defaultJobOptions_13 {
|
|
797
|
+
let attempts_13: number;
|
|
798
|
+
export { attempts_13 as attempts };
|
|
799
|
+
export namespace backoff_13 {
|
|
800
|
+
let type_13: string;
|
|
801
|
+
export { type_13 as type };
|
|
802
|
+
let delay_13: number;
|
|
803
|
+
export { delay_13 as delay };
|
|
804
|
+
}
|
|
805
|
+
export { backoff_13 as backoff };
|
|
806
|
+
let delay_14: number;
|
|
807
|
+
export { delay_14 as delay };
|
|
808
|
+
let removeOnComplete_13: number;
|
|
809
|
+
export { removeOnComplete_13 as removeOnComplete };
|
|
810
|
+
let removeOnFail_13: number;
|
|
811
|
+
export { removeOnFail_13 as removeOnFail };
|
|
812
|
+
}
|
|
813
|
+
export { defaultJobOptions_13 as defaultJobOptions };
|
|
814
|
+
export namespace streams_13 {
|
|
815
|
+
export namespace events_13 {
|
|
816
|
+
let maxLen_13: number;
|
|
817
|
+
export { maxLen_13 as maxLen };
|
|
818
|
+
}
|
|
819
|
+
export { events_13 as events };
|
|
820
|
+
}
|
|
821
|
+
export { streams_13 as streams };
|
|
822
|
+
}
|
|
823
|
+
export { queueConfig_13 as queueConfig };
|
|
824
|
+
export namespace workerConfig_13 {
|
|
825
|
+
let concurrency_13: number;
|
|
826
|
+
export { concurrency_13 as concurrency };
|
|
827
|
+
let lockDuration_13: number;
|
|
828
|
+
export { lockDuration_13 as lockDuration };
|
|
829
|
+
let maxStalledCount_13: number;
|
|
830
|
+
export { maxStalledCount_13 as maxStalledCount };
|
|
831
|
+
}
|
|
832
|
+
export { workerConfig_13 as workerConfig };
|
|
833
|
+
}
|
|
794
834
|
}
|
|
795
835
|
|
|
796
836
|
interface PlatformContextContentItem {
|
|
@@ -942,7 +982,9 @@ declare const buildFilterConfigurations: ({ groups, type, selectedTpls, allTpls,
|
|
|
942
982
|
|
|
943
983
|
declare const compareAndGroupBlocks: (blocksPerTpl: any[]) => any[];
|
|
944
984
|
|
|
945
|
-
declare const extractAndOrganizeBlocks: (selectedTpls: any[], allTpls: any[]
|
|
985
|
+
declare const extractAndOrganizeBlocks: (selectedTpls: any[], allTpls: any[], { smTagTypesConfig }?: {
|
|
986
|
+
smTagTypesConfig?: any[] | null;
|
|
987
|
+
}) => any;
|
|
946
988
|
|
|
947
989
|
declare const processAuthorAndCommonFilters: (allTpls: any[], filterScopes: string[], annoEnabledBlocks?: any[]) => {
|
|
948
990
|
authorTagConfigs: {
|
|
@@ -1188,12 +1230,13 @@ declare const getFilterKeyForBlock: ({ block, scope }?: {
|
|
|
1188
1230
|
* - DEFAULT TENANTS: Dynamically discovers rollups from template structure
|
|
1189
1231
|
* - SELF-MANAGED TENANTS: Uses predefined hierarchy with conditional filters
|
|
1190
1232
|
*/
|
|
1191
|
-
declare const autoGenFilterConfigsFromTpl: ({ selectedTpls, allTpls, filterScopes, isSelfManagedTenant, annotationTagsCount, }: {
|
|
1233
|
+
declare const autoGenFilterConfigsFromTpl: ({ selectedTpls, allTpls, filterScopes, isSelfManagedTenant, annotationTagsCount, smTagTypesConfig, }: {
|
|
1192
1234
|
selectedTpls: any[];
|
|
1193
1235
|
allTpls: any[];
|
|
1194
1236
|
filterScopes: string[];
|
|
1195
1237
|
isSelfManagedTenant?: boolean;
|
|
1196
1238
|
annotationTagsCount?: any;
|
|
1239
|
+
smTagTypesConfig?: any[] | null;
|
|
1197
1240
|
}) => ({
|
|
1198
1241
|
sectionId: string;
|
|
1199
1242
|
sectionTitle: string;
|
|
@@ -1580,6 +1623,28 @@ declare class BlockRegistry {
|
|
|
1580
1623
|
comp: string;
|
|
1581
1624
|
props?: any;
|
|
1582
1625
|
}>): any[];
|
|
1626
|
+
/**
|
|
1627
|
+
* Resolve the tagTypesConfig for a block instance.
|
|
1628
|
+
*
|
|
1629
|
+
* Resolution order:
|
|
1630
|
+
* 1. `hardCodedTagTypesConfigForSM` — the intended self-managed default, which takes
|
|
1631
|
+
* priority over per-instance values (justifies not persisting per-block on self-managed).
|
|
1632
|
+
* Sourced from `GET_SELF_MANAGED_BASE_CONFIGS().annotation_tagTypesConfig` on BE,
|
|
1633
|
+
* or `platformConfigs.SELF_MANAGED_BASE_CONFIGS.annotation_tagTypesConfig` on FE.
|
|
1634
|
+
* Pass null/undefined for non-SM tenants.
|
|
1635
|
+
* 2. `block.props.annotation.tagTypesConfig` — legacy per-instance persisted value.
|
|
1636
|
+
* 3. Empty array.
|
|
1637
|
+
*/
|
|
1638
|
+
getTagTypesConfig(block: {
|
|
1639
|
+
comp: string;
|
|
1640
|
+
props?: any;
|
|
1641
|
+
}, hardCodedTagTypesConfigForSM?: Array<{
|
|
1642
|
+
tagType: string;
|
|
1643
|
+
reactKey?: string;
|
|
1644
|
+
}> | null): Array<{
|
|
1645
|
+
tagType: string;
|
|
1646
|
+
reactKey?: string;
|
|
1647
|
+
}>;
|
|
1583
1648
|
}
|
|
1584
1649
|
/** Singleton instance — the one registry shared across the app. */
|
|
1585
1650
|
declare const blockRegistry: BlockRegistry;
|
package/dist/universal.d.ts
CHANGED
|
@@ -749,7 +749,7 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
749
749
|
}
|
|
750
750
|
export { workerConfig_11 as workerConfig };
|
|
751
751
|
}
|
|
752
|
-
namespace
|
|
752
|
+
namespace SARVAM_TRANSCRIPTION_QUEUE {
|
|
753
753
|
let id_12: string;
|
|
754
754
|
export { id_12 as id };
|
|
755
755
|
export namespace queueConfig_12 {
|
|
@@ -763,8 +763,6 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
763
763
|
export { delay_12 as delay };
|
|
764
764
|
}
|
|
765
765
|
export { backoff_12 as backoff };
|
|
766
|
-
let delay_13: number;
|
|
767
|
-
export { delay_13 as delay };
|
|
768
766
|
let removeOnComplete_12: number;
|
|
769
767
|
export { removeOnComplete_12 as removeOnComplete };
|
|
770
768
|
let removeOnFail_12: number;
|
|
@@ -791,6 +789,48 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
791
789
|
}
|
|
792
790
|
export { workerConfig_12 as workerConfig };
|
|
793
791
|
}
|
|
792
|
+
namespace REINDEX_QUEUE {
|
|
793
|
+
let id_13: string;
|
|
794
|
+
export { id_13 as id };
|
|
795
|
+
export namespace queueConfig_13 {
|
|
796
|
+
export namespace defaultJobOptions_13 {
|
|
797
|
+
let attempts_13: number;
|
|
798
|
+
export { attempts_13 as attempts };
|
|
799
|
+
export namespace backoff_13 {
|
|
800
|
+
let type_13: string;
|
|
801
|
+
export { type_13 as type };
|
|
802
|
+
let delay_13: number;
|
|
803
|
+
export { delay_13 as delay };
|
|
804
|
+
}
|
|
805
|
+
export { backoff_13 as backoff };
|
|
806
|
+
let delay_14: number;
|
|
807
|
+
export { delay_14 as delay };
|
|
808
|
+
let removeOnComplete_13: number;
|
|
809
|
+
export { removeOnComplete_13 as removeOnComplete };
|
|
810
|
+
let removeOnFail_13: number;
|
|
811
|
+
export { removeOnFail_13 as removeOnFail };
|
|
812
|
+
}
|
|
813
|
+
export { defaultJobOptions_13 as defaultJobOptions };
|
|
814
|
+
export namespace streams_13 {
|
|
815
|
+
export namespace events_13 {
|
|
816
|
+
let maxLen_13: number;
|
|
817
|
+
export { maxLen_13 as maxLen };
|
|
818
|
+
}
|
|
819
|
+
export { events_13 as events };
|
|
820
|
+
}
|
|
821
|
+
export { streams_13 as streams };
|
|
822
|
+
}
|
|
823
|
+
export { queueConfig_13 as queueConfig };
|
|
824
|
+
export namespace workerConfig_13 {
|
|
825
|
+
let concurrency_13: number;
|
|
826
|
+
export { concurrency_13 as concurrency };
|
|
827
|
+
let lockDuration_13: number;
|
|
828
|
+
export { lockDuration_13 as lockDuration };
|
|
829
|
+
let maxStalledCount_13: number;
|
|
830
|
+
export { maxStalledCount_13 as maxStalledCount };
|
|
831
|
+
}
|
|
832
|
+
export { workerConfig_13 as workerConfig };
|
|
833
|
+
}
|
|
794
834
|
}
|
|
795
835
|
|
|
796
836
|
interface PlatformContextContentItem {
|
|
@@ -942,7 +982,9 @@ declare const buildFilterConfigurations: ({ groups, type, selectedTpls, allTpls,
|
|
|
942
982
|
|
|
943
983
|
declare const compareAndGroupBlocks: (blocksPerTpl: any[]) => any[];
|
|
944
984
|
|
|
945
|
-
declare const extractAndOrganizeBlocks: (selectedTpls: any[], allTpls: any[]
|
|
985
|
+
declare const extractAndOrganizeBlocks: (selectedTpls: any[], allTpls: any[], { smTagTypesConfig }?: {
|
|
986
|
+
smTagTypesConfig?: any[] | null;
|
|
987
|
+
}) => any;
|
|
946
988
|
|
|
947
989
|
declare const processAuthorAndCommonFilters: (allTpls: any[], filterScopes: string[], annoEnabledBlocks?: any[]) => {
|
|
948
990
|
authorTagConfigs: {
|
|
@@ -1188,12 +1230,13 @@ declare const getFilterKeyForBlock: ({ block, scope }?: {
|
|
|
1188
1230
|
* - DEFAULT TENANTS: Dynamically discovers rollups from template structure
|
|
1189
1231
|
* - SELF-MANAGED TENANTS: Uses predefined hierarchy with conditional filters
|
|
1190
1232
|
*/
|
|
1191
|
-
declare const autoGenFilterConfigsFromTpl: ({ selectedTpls, allTpls, filterScopes, isSelfManagedTenant, annotationTagsCount, }: {
|
|
1233
|
+
declare const autoGenFilterConfigsFromTpl: ({ selectedTpls, allTpls, filterScopes, isSelfManagedTenant, annotationTagsCount, smTagTypesConfig, }: {
|
|
1192
1234
|
selectedTpls: any[];
|
|
1193
1235
|
allTpls: any[];
|
|
1194
1236
|
filterScopes: string[];
|
|
1195
1237
|
isSelfManagedTenant?: boolean;
|
|
1196
1238
|
annotationTagsCount?: any;
|
|
1239
|
+
smTagTypesConfig?: any[] | null;
|
|
1197
1240
|
}) => ({
|
|
1198
1241
|
sectionId: string;
|
|
1199
1242
|
sectionTitle: string;
|
|
@@ -1580,6 +1623,28 @@ declare class BlockRegistry {
|
|
|
1580
1623
|
comp: string;
|
|
1581
1624
|
props?: any;
|
|
1582
1625
|
}>): any[];
|
|
1626
|
+
/**
|
|
1627
|
+
* Resolve the tagTypesConfig for a block instance.
|
|
1628
|
+
*
|
|
1629
|
+
* Resolution order:
|
|
1630
|
+
* 1. `hardCodedTagTypesConfigForSM` — the intended self-managed default, which takes
|
|
1631
|
+
* priority over per-instance values (justifies not persisting per-block on self-managed).
|
|
1632
|
+
* Sourced from `GET_SELF_MANAGED_BASE_CONFIGS().annotation_tagTypesConfig` on BE,
|
|
1633
|
+
* or `platformConfigs.SELF_MANAGED_BASE_CONFIGS.annotation_tagTypesConfig` on FE.
|
|
1634
|
+
* Pass null/undefined for non-SM tenants.
|
|
1635
|
+
* 2. `block.props.annotation.tagTypesConfig` — legacy per-instance persisted value.
|
|
1636
|
+
* 3. Empty array.
|
|
1637
|
+
*/
|
|
1638
|
+
getTagTypesConfig(block: {
|
|
1639
|
+
comp: string;
|
|
1640
|
+
props?: any;
|
|
1641
|
+
}, hardCodedTagTypesConfigForSM?: Array<{
|
|
1642
|
+
tagType: string;
|
|
1643
|
+
reactKey?: string;
|
|
1644
|
+
}> | null): Array<{
|
|
1645
|
+
tagType: string;
|
|
1646
|
+
reactKey?: string;
|
|
1647
|
+
}>;
|
|
1583
1648
|
}
|
|
1584
1649
|
/** Singleton instance — the one registry shared across the app. */
|
|
1585
1650
|
declare const blockRegistry: BlockRegistry;
|