@okf/ootils 1.37.1 → 1.39.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/dist/browser.d.mts +80 -17
- package/dist/browser.d.ts +80 -17
- package/dist/browser.js +99 -7
- package/dist/browser.mjs +98 -7
- package/dist/node.d.mts +80 -17
- package/dist/node.d.ts +80 -17
- package/dist/node.js +99 -7
- package/dist/node.mjs +98 -7
- package/dist/universal.d.mts +80 -17
- package/dist/universal.d.ts +80 -17
- package/dist/universal.js +99 -7
- package/dist/universal.mjs +98 -7
- package/package.json +1 -1
package/dist/browser.d.mts
CHANGED
|
@@ -222,6 +222,29 @@ declare const _recursExtractBlocks: ({ data, cb, sectionStack, blockPathPrefix }
|
|
|
222
222
|
*/
|
|
223
223
|
declare const isTplAnnotationEnabled: (tpl: any) => boolean;
|
|
224
224
|
|
|
225
|
+
/**
|
|
226
|
+
* Collect annotation (mark-node) ids from a serialized Lexical editorState tree,
|
|
227
|
+
* in document reading order, deduped on FIRST occurrence.
|
|
228
|
+
*
|
|
229
|
+
* Lexical stores annotation highlights as MarkNodes: `{ type: "mark", ids: [...],
|
|
230
|
+
* children: [...] }`. Overlapping annotations split the text into contiguous
|
|
231
|
+
* segments, each a mark whose `ids` lists every annotation covering that segment —
|
|
232
|
+
* so a single annotation can appear across multiple marks, and a single mark can
|
|
233
|
+
* carry multiple ids. A depth-first walk visits segments left-to-right (document
|
|
234
|
+
* order); taking each id's first appearance yields the position where that
|
|
235
|
+
* annotation's highlight first starts. Two annotations that start at the exact
|
|
236
|
+
* same character share their first segment, so their relative order falls to that
|
|
237
|
+
* segment's `ids` array order — an inherent tie with no positional answer.
|
|
238
|
+
*
|
|
239
|
+
* Pass the editorState root (the `{ root: { children } }` tree). It walks generic
|
|
240
|
+
* JSON, so any subtree works too — but never pass an object that also nests
|
|
241
|
+
* unrelated mark-bearing states (e.g. a Lexical value's sibling `annoData`, whose
|
|
242
|
+
* per-anno `fragment` mini-states would inject out-of-order marks).
|
|
243
|
+
*
|
|
244
|
+
* Callers that only need the unordered SET of ids can wrap the result in `new Set(...)`.
|
|
245
|
+
*/
|
|
246
|
+
declare const collectMarkIdsInOrder: (editorState: any) => string[];
|
|
247
|
+
|
|
225
248
|
/**
|
|
226
249
|
* Calculates all possible rollup relationships for a tag type
|
|
227
250
|
*
|
|
@@ -597,7 +620,7 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
597
620
|
}
|
|
598
621
|
export { workerConfig_7 as workerConfig };
|
|
599
622
|
}
|
|
600
|
-
namespace
|
|
623
|
+
namespace AI_AUTO_ANNOTATE_CHUNK_QUEUE {
|
|
601
624
|
let id_8: string;
|
|
602
625
|
export { id_8 as id };
|
|
603
626
|
export namespace queueConfig_8 {
|
|
@@ -637,7 +660,7 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
637
660
|
}
|
|
638
661
|
export { workerConfig_8 as workerConfig };
|
|
639
662
|
}
|
|
640
|
-
namespace
|
|
663
|
+
namespace ANNOS_ELASTIC_SYNC_QUEUE {
|
|
641
664
|
let id_9: string;
|
|
642
665
|
export { id_9 as id };
|
|
643
666
|
export namespace queueConfig_9 {
|
|
@@ -677,7 +700,7 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
677
700
|
}
|
|
678
701
|
export { workerConfig_9 as workerConfig };
|
|
679
702
|
}
|
|
680
|
-
namespace
|
|
703
|
+
namespace CHUNKS_ELASTIC_SYNC_QUEUE {
|
|
681
704
|
let id_10: string;
|
|
682
705
|
export { id_10 as id };
|
|
683
706
|
export namespace queueConfig_10 {
|
|
@@ -717,7 +740,7 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
717
740
|
}
|
|
718
741
|
export { workerConfig_10 as workerConfig };
|
|
719
742
|
}
|
|
720
|
-
namespace
|
|
743
|
+
namespace USERS_ELASTIC_SYNC_QUEUE {
|
|
721
744
|
let id_11: string;
|
|
722
745
|
export { id_11 as id };
|
|
723
746
|
export namespace queueConfig_11 {
|
|
@@ -757,7 +780,7 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
757
780
|
}
|
|
758
781
|
export { workerConfig_11 as workerConfig };
|
|
759
782
|
}
|
|
760
|
-
namespace
|
|
783
|
+
namespace CONTENT_ELASTIC_SYNC_QUEUE {
|
|
761
784
|
let id_12: string;
|
|
762
785
|
export { id_12 as id };
|
|
763
786
|
export namespace queueConfig_12 {
|
|
@@ -797,7 +820,7 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
797
820
|
}
|
|
798
821
|
export { workerConfig_12 as workerConfig };
|
|
799
822
|
}
|
|
800
|
-
namespace
|
|
823
|
+
namespace SARVAM_TRANSCRIPTION_QUEUE {
|
|
801
824
|
let id_13: string;
|
|
802
825
|
export { id_13 as id };
|
|
803
826
|
export namespace queueConfig_13 {
|
|
@@ -837,7 +860,7 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
837
860
|
}
|
|
838
861
|
export { workerConfig_13 as workerConfig };
|
|
839
862
|
}
|
|
840
|
-
namespace
|
|
863
|
+
namespace INTERCOM_CONVERSATIONS_QUEUE {
|
|
841
864
|
let id_14: string;
|
|
842
865
|
export { id_14 as id };
|
|
843
866
|
export namespace queueConfig_14 {
|
|
@@ -877,7 +900,7 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
877
900
|
}
|
|
878
901
|
export { workerConfig_14 as workerConfig };
|
|
879
902
|
}
|
|
880
|
-
namespace
|
|
903
|
+
namespace TAG_SYNC_PLAN_QUEUE {
|
|
881
904
|
let id_15: string;
|
|
882
905
|
export { id_15 as id };
|
|
883
906
|
export namespace queueConfig_15 {
|
|
@@ -917,11 +940,13 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
917
940
|
}
|
|
918
941
|
export { workerConfig_15 as workerConfig };
|
|
919
942
|
}
|
|
920
|
-
namespace
|
|
943
|
+
namespace TAG_SYNC_BATCH_QUEUE {
|
|
921
944
|
let id_16: string;
|
|
922
945
|
export { id_16 as id };
|
|
923
946
|
export namespace queueConfig_16 {
|
|
924
947
|
export namespace defaultJobOptions_16 {
|
|
948
|
+
let attempts_16: number;
|
|
949
|
+
export { attempts_16 as attempts };
|
|
925
950
|
export namespace backoff_16 {
|
|
926
951
|
let type_16: string;
|
|
927
952
|
export { type_16 as type };
|
|
@@ -929,8 +954,6 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
929
954
|
export { delay_16 as delay };
|
|
930
955
|
}
|
|
931
956
|
export { backoff_16 as backoff };
|
|
932
|
-
let attempts_16: number;
|
|
933
|
-
export { attempts_16 as attempts };
|
|
934
957
|
let removeOnComplete_16: number;
|
|
935
958
|
export { removeOnComplete_16 as removeOnComplete };
|
|
936
959
|
let removeOnFail_16: number;
|
|
@@ -957,13 +980,11 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
957
980
|
}
|
|
958
981
|
export { workerConfig_16 as workerConfig };
|
|
959
982
|
}
|
|
960
|
-
namespace
|
|
983
|
+
namespace SCHEDULED_EXTERNAL_SYNC_QUEUE {
|
|
961
984
|
let id_17: string;
|
|
962
985
|
export { id_17 as id };
|
|
963
986
|
export namespace queueConfig_17 {
|
|
964
987
|
export namespace defaultJobOptions_17 {
|
|
965
|
-
let attempts_17: number;
|
|
966
|
-
export { attempts_17 as attempts };
|
|
967
988
|
export namespace backoff_17 {
|
|
968
989
|
let type_17: string;
|
|
969
990
|
export { type_17 as type };
|
|
@@ -971,8 +992,8 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
971
992
|
export { delay_17 as delay };
|
|
972
993
|
}
|
|
973
994
|
export { backoff_17 as backoff };
|
|
974
|
-
let
|
|
975
|
-
export {
|
|
995
|
+
let attempts_17: number;
|
|
996
|
+
export { attempts_17 as attempts };
|
|
976
997
|
let removeOnComplete_17: number;
|
|
977
998
|
export { removeOnComplete_17 as removeOnComplete };
|
|
978
999
|
let removeOnFail_17: number;
|
|
@@ -999,6 +1020,48 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
999
1020
|
}
|
|
1000
1021
|
export { workerConfig_17 as workerConfig };
|
|
1001
1022
|
}
|
|
1023
|
+
namespace REINDEX_QUEUE {
|
|
1024
|
+
let id_18: string;
|
|
1025
|
+
export { id_18 as id };
|
|
1026
|
+
export namespace queueConfig_18 {
|
|
1027
|
+
export namespace defaultJobOptions_18 {
|
|
1028
|
+
let attempts_18: number;
|
|
1029
|
+
export { attempts_18 as attempts };
|
|
1030
|
+
export namespace backoff_18 {
|
|
1031
|
+
let type_18: string;
|
|
1032
|
+
export { type_18 as type };
|
|
1033
|
+
let delay_18: number;
|
|
1034
|
+
export { delay_18 as delay };
|
|
1035
|
+
}
|
|
1036
|
+
export { backoff_18 as backoff };
|
|
1037
|
+
let delay_19: number;
|
|
1038
|
+
export { delay_19 as delay };
|
|
1039
|
+
let removeOnComplete_18: number;
|
|
1040
|
+
export { removeOnComplete_18 as removeOnComplete };
|
|
1041
|
+
let removeOnFail_18: number;
|
|
1042
|
+
export { removeOnFail_18 as removeOnFail };
|
|
1043
|
+
}
|
|
1044
|
+
export { defaultJobOptions_18 as defaultJobOptions };
|
|
1045
|
+
export namespace streams_18 {
|
|
1046
|
+
export namespace events_18 {
|
|
1047
|
+
let maxLen_18: number;
|
|
1048
|
+
export { maxLen_18 as maxLen };
|
|
1049
|
+
}
|
|
1050
|
+
export { events_18 as events };
|
|
1051
|
+
}
|
|
1052
|
+
export { streams_18 as streams };
|
|
1053
|
+
}
|
|
1054
|
+
export { queueConfig_18 as queueConfig };
|
|
1055
|
+
export namespace workerConfig_18 {
|
|
1056
|
+
let concurrency_18: number;
|
|
1057
|
+
export { concurrency_18 as concurrency };
|
|
1058
|
+
let lockDuration_18: number;
|
|
1059
|
+
export { lockDuration_18 as lockDuration };
|
|
1060
|
+
let maxStalledCount_18: number;
|
|
1061
|
+
export { maxStalledCount_18 as maxStalledCount };
|
|
1062
|
+
}
|
|
1063
|
+
export { workerConfig_18 as workerConfig };
|
|
1064
|
+
}
|
|
1002
1065
|
}
|
|
1003
1066
|
|
|
1004
1067
|
interface PlatformContextContentItem {
|
|
@@ -1937,4 +2000,4 @@ declare class BlockRegistry {
|
|
|
1937
2000
|
/** Singleton instance — the one registry shared across the app. */
|
|
1938
2001
|
declare const blockRegistry: BlockRegistry;
|
|
1939
2002
|
|
|
1940
|
-
export { BASE_BULLMQ_CONFIG, type BlockCapabilities, type BlockDef, BlockRegistry, CHUNKING_PRESETS, ELASTIC_MAPPING_PRESETS, FILTER_IDS, MONGO_SCHEMA_PRESETS, TEMP_removeDuplicateFilters, UI_CONTENT, _self_managed_buildAnnoHierarchyConfig, _self_managed_buildDocHierarchyConfig, _self_managed_getFixedAnnoRollupBlocks, _self_managed_getFixedAnnoTagBlock, autoGenFilterConfigsFromTpl, blockRegistry, buildFilterConfigurations, compareAndGroupBlocks, deleteVal, extractAllBlocksFromTpl, extractAndOrganizeBlocks, genCleanCamelCaseId, genTagId, generateFilterKey, getAnnoFilterBucketKey, getFilterKeyForBlock, getPlatformContextContent, getRollupPossibilities, getRoutePathToContentTypeLanding, getRoutePathToEditContent, getRoutePathToModerateContent, getRoutePathToMyContent, getRoutePathToPublishedContent, getRoutePathToReviewDashboard, getRoutePathToTCI, getRoutePathToTagCategoryLanding, getVal, isTplAnnotationEnabled, mergeAnnoDataIntoAnnotationsTags, parseSpecialConfigSyntax, plainTextToLexical, processAuthorAndCommonFilters, _recursExtractBlocks as recursivelyExtractBlocks, segrigateDocs, setVal, toArray };
|
|
2003
|
+
export { BASE_BULLMQ_CONFIG, type BlockCapabilities, type BlockDef, BlockRegistry, CHUNKING_PRESETS, ELASTIC_MAPPING_PRESETS, FILTER_IDS, MONGO_SCHEMA_PRESETS, TEMP_removeDuplicateFilters, UI_CONTENT, _self_managed_buildAnnoHierarchyConfig, _self_managed_buildDocHierarchyConfig, _self_managed_getFixedAnnoRollupBlocks, _self_managed_getFixedAnnoTagBlock, autoGenFilterConfigsFromTpl, blockRegistry, buildFilterConfigurations, collectMarkIdsInOrder, compareAndGroupBlocks, deleteVal, extractAllBlocksFromTpl, extractAndOrganizeBlocks, genCleanCamelCaseId, genTagId, generateFilterKey, getAnnoFilterBucketKey, getFilterKeyForBlock, getPlatformContextContent, getRollupPossibilities, getRoutePathToContentTypeLanding, getRoutePathToEditContent, getRoutePathToModerateContent, getRoutePathToMyContent, getRoutePathToPublishedContent, getRoutePathToReviewDashboard, getRoutePathToTCI, getRoutePathToTagCategoryLanding, getVal, isTplAnnotationEnabled, mergeAnnoDataIntoAnnotationsTags, parseSpecialConfigSyntax, plainTextToLexical, processAuthorAndCommonFilters, _recursExtractBlocks as recursivelyExtractBlocks, segrigateDocs, setVal, toArray };
|
package/dist/browser.d.ts
CHANGED
|
@@ -222,6 +222,29 @@ declare const _recursExtractBlocks: ({ data, cb, sectionStack, blockPathPrefix }
|
|
|
222
222
|
*/
|
|
223
223
|
declare const isTplAnnotationEnabled: (tpl: any) => boolean;
|
|
224
224
|
|
|
225
|
+
/**
|
|
226
|
+
* Collect annotation (mark-node) ids from a serialized Lexical editorState tree,
|
|
227
|
+
* in document reading order, deduped on FIRST occurrence.
|
|
228
|
+
*
|
|
229
|
+
* Lexical stores annotation highlights as MarkNodes: `{ type: "mark", ids: [...],
|
|
230
|
+
* children: [...] }`. Overlapping annotations split the text into contiguous
|
|
231
|
+
* segments, each a mark whose `ids` lists every annotation covering that segment —
|
|
232
|
+
* so a single annotation can appear across multiple marks, and a single mark can
|
|
233
|
+
* carry multiple ids. A depth-first walk visits segments left-to-right (document
|
|
234
|
+
* order); taking each id's first appearance yields the position where that
|
|
235
|
+
* annotation's highlight first starts. Two annotations that start at the exact
|
|
236
|
+
* same character share their first segment, so their relative order falls to that
|
|
237
|
+
* segment's `ids` array order — an inherent tie with no positional answer.
|
|
238
|
+
*
|
|
239
|
+
* Pass the editorState root (the `{ root: { children } }` tree). It walks generic
|
|
240
|
+
* JSON, so any subtree works too — but never pass an object that also nests
|
|
241
|
+
* unrelated mark-bearing states (e.g. a Lexical value's sibling `annoData`, whose
|
|
242
|
+
* per-anno `fragment` mini-states would inject out-of-order marks).
|
|
243
|
+
*
|
|
244
|
+
* Callers that only need the unordered SET of ids can wrap the result in `new Set(...)`.
|
|
245
|
+
*/
|
|
246
|
+
declare const collectMarkIdsInOrder: (editorState: any) => string[];
|
|
247
|
+
|
|
225
248
|
/**
|
|
226
249
|
* Calculates all possible rollup relationships for a tag type
|
|
227
250
|
*
|
|
@@ -597,7 +620,7 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
597
620
|
}
|
|
598
621
|
export { workerConfig_7 as workerConfig };
|
|
599
622
|
}
|
|
600
|
-
namespace
|
|
623
|
+
namespace AI_AUTO_ANNOTATE_CHUNK_QUEUE {
|
|
601
624
|
let id_8: string;
|
|
602
625
|
export { id_8 as id };
|
|
603
626
|
export namespace queueConfig_8 {
|
|
@@ -637,7 +660,7 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
637
660
|
}
|
|
638
661
|
export { workerConfig_8 as workerConfig };
|
|
639
662
|
}
|
|
640
|
-
namespace
|
|
663
|
+
namespace ANNOS_ELASTIC_SYNC_QUEUE {
|
|
641
664
|
let id_9: string;
|
|
642
665
|
export { id_9 as id };
|
|
643
666
|
export namespace queueConfig_9 {
|
|
@@ -677,7 +700,7 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
677
700
|
}
|
|
678
701
|
export { workerConfig_9 as workerConfig };
|
|
679
702
|
}
|
|
680
|
-
namespace
|
|
703
|
+
namespace CHUNKS_ELASTIC_SYNC_QUEUE {
|
|
681
704
|
let id_10: string;
|
|
682
705
|
export { id_10 as id };
|
|
683
706
|
export namespace queueConfig_10 {
|
|
@@ -717,7 +740,7 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
717
740
|
}
|
|
718
741
|
export { workerConfig_10 as workerConfig };
|
|
719
742
|
}
|
|
720
|
-
namespace
|
|
743
|
+
namespace USERS_ELASTIC_SYNC_QUEUE {
|
|
721
744
|
let id_11: string;
|
|
722
745
|
export { id_11 as id };
|
|
723
746
|
export namespace queueConfig_11 {
|
|
@@ -757,7 +780,7 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
757
780
|
}
|
|
758
781
|
export { workerConfig_11 as workerConfig };
|
|
759
782
|
}
|
|
760
|
-
namespace
|
|
783
|
+
namespace CONTENT_ELASTIC_SYNC_QUEUE {
|
|
761
784
|
let id_12: string;
|
|
762
785
|
export { id_12 as id };
|
|
763
786
|
export namespace queueConfig_12 {
|
|
@@ -797,7 +820,7 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
797
820
|
}
|
|
798
821
|
export { workerConfig_12 as workerConfig };
|
|
799
822
|
}
|
|
800
|
-
namespace
|
|
823
|
+
namespace SARVAM_TRANSCRIPTION_QUEUE {
|
|
801
824
|
let id_13: string;
|
|
802
825
|
export { id_13 as id };
|
|
803
826
|
export namespace queueConfig_13 {
|
|
@@ -837,7 +860,7 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
837
860
|
}
|
|
838
861
|
export { workerConfig_13 as workerConfig };
|
|
839
862
|
}
|
|
840
|
-
namespace
|
|
863
|
+
namespace INTERCOM_CONVERSATIONS_QUEUE {
|
|
841
864
|
let id_14: string;
|
|
842
865
|
export { id_14 as id };
|
|
843
866
|
export namespace queueConfig_14 {
|
|
@@ -877,7 +900,7 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
877
900
|
}
|
|
878
901
|
export { workerConfig_14 as workerConfig };
|
|
879
902
|
}
|
|
880
|
-
namespace
|
|
903
|
+
namespace TAG_SYNC_PLAN_QUEUE {
|
|
881
904
|
let id_15: string;
|
|
882
905
|
export { id_15 as id };
|
|
883
906
|
export namespace queueConfig_15 {
|
|
@@ -917,11 +940,13 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
917
940
|
}
|
|
918
941
|
export { workerConfig_15 as workerConfig };
|
|
919
942
|
}
|
|
920
|
-
namespace
|
|
943
|
+
namespace TAG_SYNC_BATCH_QUEUE {
|
|
921
944
|
let id_16: string;
|
|
922
945
|
export { id_16 as id };
|
|
923
946
|
export namespace queueConfig_16 {
|
|
924
947
|
export namespace defaultJobOptions_16 {
|
|
948
|
+
let attempts_16: number;
|
|
949
|
+
export { attempts_16 as attempts };
|
|
925
950
|
export namespace backoff_16 {
|
|
926
951
|
let type_16: string;
|
|
927
952
|
export { type_16 as type };
|
|
@@ -929,8 +954,6 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
929
954
|
export { delay_16 as delay };
|
|
930
955
|
}
|
|
931
956
|
export { backoff_16 as backoff };
|
|
932
|
-
let attempts_16: number;
|
|
933
|
-
export { attempts_16 as attempts };
|
|
934
957
|
let removeOnComplete_16: number;
|
|
935
958
|
export { removeOnComplete_16 as removeOnComplete };
|
|
936
959
|
let removeOnFail_16: number;
|
|
@@ -957,13 +980,11 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
957
980
|
}
|
|
958
981
|
export { workerConfig_16 as workerConfig };
|
|
959
982
|
}
|
|
960
|
-
namespace
|
|
983
|
+
namespace SCHEDULED_EXTERNAL_SYNC_QUEUE {
|
|
961
984
|
let id_17: string;
|
|
962
985
|
export { id_17 as id };
|
|
963
986
|
export namespace queueConfig_17 {
|
|
964
987
|
export namespace defaultJobOptions_17 {
|
|
965
|
-
let attempts_17: number;
|
|
966
|
-
export { attempts_17 as attempts };
|
|
967
988
|
export namespace backoff_17 {
|
|
968
989
|
let type_17: string;
|
|
969
990
|
export { type_17 as type };
|
|
@@ -971,8 +992,8 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
971
992
|
export { delay_17 as delay };
|
|
972
993
|
}
|
|
973
994
|
export { backoff_17 as backoff };
|
|
974
|
-
let
|
|
975
|
-
export {
|
|
995
|
+
let attempts_17: number;
|
|
996
|
+
export { attempts_17 as attempts };
|
|
976
997
|
let removeOnComplete_17: number;
|
|
977
998
|
export { removeOnComplete_17 as removeOnComplete };
|
|
978
999
|
let removeOnFail_17: number;
|
|
@@ -999,6 +1020,48 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
999
1020
|
}
|
|
1000
1021
|
export { workerConfig_17 as workerConfig };
|
|
1001
1022
|
}
|
|
1023
|
+
namespace REINDEX_QUEUE {
|
|
1024
|
+
let id_18: string;
|
|
1025
|
+
export { id_18 as id };
|
|
1026
|
+
export namespace queueConfig_18 {
|
|
1027
|
+
export namespace defaultJobOptions_18 {
|
|
1028
|
+
let attempts_18: number;
|
|
1029
|
+
export { attempts_18 as attempts };
|
|
1030
|
+
export namespace backoff_18 {
|
|
1031
|
+
let type_18: string;
|
|
1032
|
+
export { type_18 as type };
|
|
1033
|
+
let delay_18: number;
|
|
1034
|
+
export { delay_18 as delay };
|
|
1035
|
+
}
|
|
1036
|
+
export { backoff_18 as backoff };
|
|
1037
|
+
let delay_19: number;
|
|
1038
|
+
export { delay_19 as delay };
|
|
1039
|
+
let removeOnComplete_18: number;
|
|
1040
|
+
export { removeOnComplete_18 as removeOnComplete };
|
|
1041
|
+
let removeOnFail_18: number;
|
|
1042
|
+
export { removeOnFail_18 as removeOnFail };
|
|
1043
|
+
}
|
|
1044
|
+
export { defaultJobOptions_18 as defaultJobOptions };
|
|
1045
|
+
export namespace streams_18 {
|
|
1046
|
+
export namespace events_18 {
|
|
1047
|
+
let maxLen_18: number;
|
|
1048
|
+
export { maxLen_18 as maxLen };
|
|
1049
|
+
}
|
|
1050
|
+
export { events_18 as events };
|
|
1051
|
+
}
|
|
1052
|
+
export { streams_18 as streams };
|
|
1053
|
+
}
|
|
1054
|
+
export { queueConfig_18 as queueConfig };
|
|
1055
|
+
export namespace workerConfig_18 {
|
|
1056
|
+
let concurrency_18: number;
|
|
1057
|
+
export { concurrency_18 as concurrency };
|
|
1058
|
+
let lockDuration_18: number;
|
|
1059
|
+
export { lockDuration_18 as lockDuration };
|
|
1060
|
+
let maxStalledCount_18: number;
|
|
1061
|
+
export { maxStalledCount_18 as maxStalledCount };
|
|
1062
|
+
}
|
|
1063
|
+
export { workerConfig_18 as workerConfig };
|
|
1064
|
+
}
|
|
1002
1065
|
}
|
|
1003
1066
|
|
|
1004
1067
|
interface PlatformContextContentItem {
|
|
@@ -1937,4 +2000,4 @@ declare class BlockRegistry {
|
|
|
1937
2000
|
/** Singleton instance — the one registry shared across the app. */
|
|
1938
2001
|
declare const blockRegistry: BlockRegistry;
|
|
1939
2002
|
|
|
1940
|
-
export { BASE_BULLMQ_CONFIG, type BlockCapabilities, type BlockDef, BlockRegistry, CHUNKING_PRESETS, ELASTIC_MAPPING_PRESETS, FILTER_IDS, MONGO_SCHEMA_PRESETS, TEMP_removeDuplicateFilters, UI_CONTENT, _self_managed_buildAnnoHierarchyConfig, _self_managed_buildDocHierarchyConfig, _self_managed_getFixedAnnoRollupBlocks, _self_managed_getFixedAnnoTagBlock, autoGenFilterConfigsFromTpl, blockRegistry, buildFilterConfigurations, compareAndGroupBlocks, deleteVal, extractAllBlocksFromTpl, extractAndOrganizeBlocks, genCleanCamelCaseId, genTagId, generateFilterKey, getAnnoFilterBucketKey, getFilterKeyForBlock, getPlatformContextContent, getRollupPossibilities, getRoutePathToContentTypeLanding, getRoutePathToEditContent, getRoutePathToModerateContent, getRoutePathToMyContent, getRoutePathToPublishedContent, getRoutePathToReviewDashboard, getRoutePathToTCI, getRoutePathToTagCategoryLanding, getVal, isTplAnnotationEnabled, mergeAnnoDataIntoAnnotationsTags, parseSpecialConfigSyntax, plainTextToLexical, processAuthorAndCommonFilters, _recursExtractBlocks as recursivelyExtractBlocks, segrigateDocs, setVal, toArray };
|
|
2003
|
+
export { BASE_BULLMQ_CONFIG, type BlockCapabilities, type BlockDef, BlockRegistry, CHUNKING_PRESETS, ELASTIC_MAPPING_PRESETS, FILTER_IDS, MONGO_SCHEMA_PRESETS, TEMP_removeDuplicateFilters, UI_CONTENT, _self_managed_buildAnnoHierarchyConfig, _self_managed_buildDocHierarchyConfig, _self_managed_getFixedAnnoRollupBlocks, _self_managed_getFixedAnnoTagBlock, autoGenFilterConfigsFromTpl, blockRegistry, buildFilterConfigurations, collectMarkIdsInOrder, compareAndGroupBlocks, deleteVal, extractAllBlocksFromTpl, extractAndOrganizeBlocks, genCleanCamelCaseId, genTagId, generateFilterKey, getAnnoFilterBucketKey, getFilterKeyForBlock, getPlatformContextContent, getRollupPossibilities, getRoutePathToContentTypeLanding, getRoutePathToEditContent, getRoutePathToModerateContent, getRoutePathToMyContent, getRoutePathToPublishedContent, getRoutePathToReviewDashboard, getRoutePathToTCI, getRoutePathToTagCategoryLanding, getVal, isTplAnnotationEnabled, mergeAnnoDataIntoAnnotationsTags, parseSpecialConfigSyntax, plainTextToLexical, processAuthorAndCommonFilters, _recursExtractBlocks as recursivelyExtractBlocks, segrigateDocs, setVal, toArray };
|
package/dist/browser.js
CHANGED
|
@@ -35,6 +35,7 @@ __export(browser_exports, {
|
|
|
35
35
|
autoGenFilterConfigsFromTpl: () => autoGenFilterConfigsFromTpl,
|
|
36
36
|
blockRegistry: () => blockRegistry,
|
|
37
37
|
buildFilterConfigurations: () => buildFilterConfigurations,
|
|
38
|
+
collectMarkIdsInOrder: () => collectMarkIdsInOrder,
|
|
38
39
|
compareAndGroupBlocks: () => compareAndGroupBlocks,
|
|
39
40
|
deleteVal: () => deleteVal,
|
|
40
41
|
extractAllBlocksFromTpl: () => extractAllBlocksFromTpl,
|
|
@@ -692,6 +693,31 @@ var isTplAnnotationEnabled = (tpl) => {
|
|
|
692
693
|
return blockRegistry.getAnnotationEnabledBlocks(allBlocks).length > 0;
|
|
693
694
|
};
|
|
694
695
|
|
|
696
|
+
// src/utils/collectMarkIdsInOrder.ts
|
|
697
|
+
var collectMarkIdsInOrder = (editorState) => {
|
|
698
|
+
const ordered = [];
|
|
699
|
+
const seen = /* @__PURE__ */ new Set();
|
|
700
|
+
const walk = (node) => {
|
|
701
|
+
if (Array.isArray(node)) {
|
|
702
|
+
for (const n of node) walk(n);
|
|
703
|
+
return;
|
|
704
|
+
}
|
|
705
|
+
if (node && typeof node === "object") {
|
|
706
|
+
if (node.type === "mark" && Array.isArray(node.ids)) {
|
|
707
|
+
for (const id of node.ids) {
|
|
708
|
+
if (!seen.has(id)) {
|
|
709
|
+
seen.add(id);
|
|
710
|
+
ordered.push(id);
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
for (const key in node) walk(node[key]);
|
|
715
|
+
}
|
|
716
|
+
};
|
|
717
|
+
walk(editorState);
|
|
718
|
+
return ordered;
|
|
719
|
+
};
|
|
720
|
+
|
|
695
721
|
// src/utils/getRollupPossibilities.ts
|
|
696
722
|
var MAX_DEPTH_ROLLUP_POSSIBILITIES = 10;
|
|
697
723
|
function getRollupPossibilities({
|
|
@@ -990,6 +1016,15 @@ var BASE_BULLMQ_CONFIG = {
|
|
|
990
1016
|
}
|
|
991
1017
|
},
|
|
992
1018
|
AI_AUTO_ANNOTATE_QUEUE: {
|
|
1019
|
+
// PARENT queue in the per-doc Flow. One job per doc; child jobs (one
|
|
1020
|
+
// per chunk) live on AI_AUTO_ANNOTATE_CHUNK_QUEUE. BullMQ Flow fires
|
|
1021
|
+
// the parent only after all children settle. Parent job's worker
|
|
1022
|
+
// collects children's suggestions, runs ONE doc-level inductive batch
|
|
1023
|
+
// dedup, applies merged annotations to editor state, writes the doc.
|
|
1024
|
+
//
|
|
1025
|
+
// The progress tracker aggregator (calculateSegByAutoAnnotateIdJobs in
|
|
1026
|
+
// okf-sub) filters by this queue's id, so parents = 1 job per doc
|
|
1027
|
+
// matches the existing FE progress counting semantics 1:1.
|
|
993
1028
|
id: "ai-auto-annotate-queue",
|
|
994
1029
|
queueConfig: {
|
|
995
1030
|
defaultJobOptions: {
|
|
@@ -1008,14 +1043,70 @@ var BASE_BULLMQ_CONFIG = {
|
|
|
1008
1043
|
}
|
|
1009
1044
|
},
|
|
1010
1045
|
workerConfig: {
|
|
1011
|
-
// Parallel-safe:
|
|
1012
|
-
//
|
|
1013
|
-
//
|
|
1014
|
-
//
|
|
1015
|
-
|
|
1046
|
+
// Parallel-safe across docs: per-doc isolation on annotations.tags
|
|
1047
|
+
// rollup (each parent processes a different doc); tenant-level Redis
|
|
1048
|
+
// lock in resolveInductiveBatch serializes inductive dedup across
|
|
1049
|
+
// concurrent parents; createTag/createSubTheme catch E11000 on the
|
|
1050
|
+
// unique tagId index. See ai/dualAgentAnnotation/tools/createTaxonomyItem.js
|
|
1051
|
+
// + ai/dualAgentAnnotation/tools/resolveInductiveBatch.js.
|
|
1052
|
+
concurrency: 5,
|
|
1016
1053
|
lockDuration: 3e5,
|
|
1017
|
-
// 5
|
|
1018
|
-
|
|
1054
|
+
// 5 min — generous ceiling so heartbeat stutters don't trip stalled detection
|
|
1055
|
+
// With attempts:1 a stalled job has no retry left anyway, but keeping
|
|
1056
|
+
// stalled-count low ensures BullMQ doesn't mis-pickup a job whose
|
|
1057
|
+
// worker is just CPU-busy.
|
|
1058
|
+
maxStalledCount: 1
|
|
1059
|
+
}
|
|
1060
|
+
},
|
|
1061
|
+
AI_AUTO_ANNOTATE_CHUNK_QUEUE: {
|
|
1062
|
+
// CHILDREN queue in the per-doc Flow. One job per (doc, field, chunk).
|
|
1063
|
+
// Each job calls okf-be /internal/getChunkSuggestions for its one chunk
|
|
1064
|
+
// — a small fast call well under App Engine's 60s ceiling regardless
|
|
1065
|
+
// of how large the source doc is. Failure of a single chunk does NOT
|
|
1066
|
+
// kill the parent (children opt in via failParentOnFailure: false) —
|
|
1067
|
+
// the parent's worker handles partial-success aggregation, mirroring
|
|
1068
|
+
// the Promise.allSettled semantic at the BullMQ level.
|
|
1069
|
+
//
|
|
1070
|
+
// The progress tracker IGNORES this queue (the aggregator filters on
|
|
1071
|
+
// AI_AUTO_ANNOTATE_QUEUE.id), so chunk granularity is available in
|
|
1072
|
+
// job state for any future drill-in UI without disrupting today's
|
|
1073
|
+
// doc-level progress UI.
|
|
1074
|
+
id: "ai-auto-annotate-chunk-queue",
|
|
1075
|
+
queueConfig: {
|
|
1076
|
+
defaultJobOptions: {
|
|
1077
|
+
// One try, no retries. A retry would re-fire the dual-agent LLM
|
|
1078
|
+
// chain (annotator + moderator + attribute classifier) for the
|
|
1079
|
+
// same chunk — expensive, and if the first try hit an OpenAI
|
|
1080
|
+
// 429/timeout the retry will likely hit the same condition.
|
|
1081
|
+
// Failed chunks surface to the parent via getFailedChildrenValues
|
|
1082
|
+
// and become a partial-success on the field (the rest still apply).
|
|
1083
|
+
attempts: 1,
|
|
1084
|
+
backoff: {
|
|
1085
|
+
type: "exponential",
|
|
1086
|
+
delay: 5e3
|
|
1087
|
+
},
|
|
1088
|
+
removeOnComplete: 100,
|
|
1089
|
+
// chunks fan out wider; keep a few more
|
|
1090
|
+
removeOnFail: 300
|
|
1091
|
+
},
|
|
1092
|
+
streams: {
|
|
1093
|
+
events: {
|
|
1094
|
+
maxLen: 10
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
},
|
|
1098
|
+
workerConfig: {
|
|
1099
|
+
// OpenAI gpt-4.1-mini TPM ceiling is 10M tokens/min. Each chunk
|
|
1100
|
+
// does ~4 LLM calls in series totalling ~22K tokens.
|
|
1101
|
+
// 5 chunks in flight × 4 calls/chunk × 60s / 15s-per-call
|
|
1102
|
+
// ≈ 80 calls/min × 6.5K tokens
|
|
1103
|
+
// ≈ 520K tokens/min sustained → ~5% of TPM ceiling.
|
|
1104
|
+
// Comfortable headroom for variance (long-tail chunks, bigger
|
|
1105
|
+
// taxonomies, mixed-tenant batches).
|
|
1106
|
+
concurrency: 5,
|
|
1107
|
+
lockDuration: 18e4,
|
|
1108
|
+
// 3 min — a single chunk's dual-agent run fits well under
|
|
1109
|
+
maxStalledCount: 1
|
|
1019
1110
|
}
|
|
1020
1111
|
},
|
|
1021
1112
|
ANNOS_ELASTIC_SYNC_QUEUE: {
|
|
@@ -2765,6 +2856,7 @@ var plainTextToLexical = (value) => {
|
|
|
2765
2856
|
autoGenFilterConfigsFromTpl,
|
|
2766
2857
|
blockRegistry,
|
|
2767
2858
|
buildFilterConfigurations,
|
|
2859
|
+
collectMarkIdsInOrder,
|
|
2768
2860
|
compareAndGroupBlocks,
|
|
2769
2861
|
deleteVal,
|
|
2770
2862
|
extractAllBlocksFromTpl,
|