@okf/ootils 1.41.0 → 1.41.2
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 +58 -18
- package/dist/browser.d.ts +58 -18
- package/dist/browser.js +60 -2
- package/dist/browser.mjs +60 -2
- package/dist/node.d.mts +58 -18
- package/dist/node.d.ts +58 -18
- package/dist/node.js +60 -2
- package/dist/node.mjs +60 -2
- package/dist/universal.d.mts +58 -18
- package/dist/universal.d.ts +58 -18
- package/dist/universal.js +60 -2
- package/dist/universal.mjs +60 -2
- package/package.json +1 -1
package/dist/browser.d.mts
CHANGED
|
@@ -487,7 +487,7 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
487
487
|
}
|
|
488
488
|
export { workerConfig_4 as workerConfig };
|
|
489
489
|
}
|
|
490
|
-
namespace
|
|
490
|
+
namespace AI_AUTO_ANNOTATE_PREP_QUEUE {
|
|
491
491
|
let id_5: string;
|
|
492
492
|
export { id_5 as id };
|
|
493
493
|
export namespace queueConfig_5 {
|
|
@@ -527,7 +527,7 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
527
527
|
}
|
|
528
528
|
export { workerConfig_5 as workerConfig };
|
|
529
529
|
}
|
|
530
|
-
namespace
|
|
530
|
+
namespace AI_AUTO_ANNOTATE_QUEUE {
|
|
531
531
|
let id_6: string;
|
|
532
532
|
export { id_6 as id };
|
|
533
533
|
export namespace queueConfig_6 {
|
|
@@ -567,7 +567,7 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
567
567
|
}
|
|
568
568
|
export { workerConfig_6 as workerConfig };
|
|
569
569
|
}
|
|
570
|
-
namespace
|
|
570
|
+
namespace AI_AUTO_ANNOTATE_CHUNK_QUEUE {
|
|
571
571
|
let id_7: string;
|
|
572
572
|
export { id_7 as id };
|
|
573
573
|
export namespace queueConfig_7 {
|
|
@@ -607,7 +607,7 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
607
607
|
}
|
|
608
608
|
export { workerConfig_7 as workerConfig };
|
|
609
609
|
}
|
|
610
|
-
namespace
|
|
610
|
+
namespace ANNOS_ELASTIC_SYNC_QUEUE {
|
|
611
611
|
let id_8: string;
|
|
612
612
|
export { id_8 as id };
|
|
613
613
|
export namespace queueConfig_8 {
|
|
@@ -647,7 +647,7 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
647
647
|
}
|
|
648
648
|
export { workerConfig_8 as workerConfig };
|
|
649
649
|
}
|
|
650
|
-
namespace
|
|
650
|
+
namespace CHUNKS_ELASTIC_SYNC_QUEUE {
|
|
651
651
|
let id_9: string;
|
|
652
652
|
export { id_9 as id };
|
|
653
653
|
export namespace queueConfig_9 {
|
|
@@ -687,7 +687,7 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
687
687
|
}
|
|
688
688
|
export { workerConfig_9 as workerConfig };
|
|
689
689
|
}
|
|
690
|
-
namespace
|
|
690
|
+
namespace USERS_ELASTIC_SYNC_QUEUE {
|
|
691
691
|
let id_10: string;
|
|
692
692
|
export { id_10 as id };
|
|
693
693
|
export namespace queueConfig_10 {
|
|
@@ -727,7 +727,7 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
727
727
|
}
|
|
728
728
|
export { workerConfig_10 as workerConfig };
|
|
729
729
|
}
|
|
730
|
-
namespace
|
|
730
|
+
namespace CONTENT_ELASTIC_SYNC_QUEUE {
|
|
731
731
|
let id_11: string;
|
|
732
732
|
export { id_11 as id };
|
|
733
733
|
export namespace queueConfig_11 {
|
|
@@ -767,7 +767,7 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
767
767
|
}
|
|
768
768
|
export { workerConfig_11 as workerConfig };
|
|
769
769
|
}
|
|
770
|
-
namespace
|
|
770
|
+
namespace SARVAM_TRANSCRIPTION_QUEUE {
|
|
771
771
|
let id_12: string;
|
|
772
772
|
export { id_12 as id };
|
|
773
773
|
export namespace queueConfig_12 {
|
|
@@ -807,7 +807,7 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
807
807
|
}
|
|
808
808
|
export { workerConfig_12 as workerConfig };
|
|
809
809
|
}
|
|
810
|
-
namespace
|
|
810
|
+
namespace INTERCOM_CONVERSATIONS_QUEUE {
|
|
811
811
|
let id_13: string;
|
|
812
812
|
export { id_13 as id };
|
|
813
813
|
export namespace queueConfig_13 {
|
|
@@ -847,7 +847,7 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
847
847
|
}
|
|
848
848
|
export { workerConfig_13 as workerConfig };
|
|
849
849
|
}
|
|
850
|
-
namespace
|
|
850
|
+
namespace TAG_SYNC_PLAN_QUEUE {
|
|
851
851
|
let id_14: string;
|
|
852
852
|
export { id_14 as id };
|
|
853
853
|
export namespace queueConfig_14 {
|
|
@@ -887,11 +887,13 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
887
887
|
}
|
|
888
888
|
export { workerConfig_14 as workerConfig };
|
|
889
889
|
}
|
|
890
|
-
namespace
|
|
890
|
+
namespace TAG_SYNC_BATCH_QUEUE {
|
|
891
891
|
let id_15: string;
|
|
892
892
|
export { id_15 as id };
|
|
893
893
|
export namespace queueConfig_15 {
|
|
894
894
|
export namespace defaultJobOptions_15 {
|
|
895
|
+
let attempts_15: number;
|
|
896
|
+
export { attempts_15 as attempts };
|
|
895
897
|
export namespace backoff_15 {
|
|
896
898
|
let type_15: string;
|
|
897
899
|
export { type_15 as type };
|
|
@@ -899,8 +901,6 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
899
901
|
export { delay_15 as delay };
|
|
900
902
|
}
|
|
901
903
|
export { backoff_15 as backoff };
|
|
902
|
-
let attempts_15: number;
|
|
903
|
-
export { attempts_15 as attempts };
|
|
904
904
|
let removeOnComplete_15: number;
|
|
905
905
|
export { removeOnComplete_15 as removeOnComplete };
|
|
906
906
|
let removeOnFail_15: number;
|
|
@@ -927,13 +927,11 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
927
927
|
}
|
|
928
928
|
export { workerConfig_15 as workerConfig };
|
|
929
929
|
}
|
|
930
|
-
namespace
|
|
930
|
+
namespace SCHEDULED_EXTERNAL_SYNC_QUEUE {
|
|
931
931
|
let id_16: string;
|
|
932
932
|
export { id_16 as id };
|
|
933
933
|
export namespace queueConfig_16 {
|
|
934
934
|
export namespace defaultJobOptions_16 {
|
|
935
|
-
let attempts_16: number;
|
|
936
|
-
export { attempts_16 as attempts };
|
|
937
935
|
export namespace backoff_16 {
|
|
938
936
|
let type_16: string;
|
|
939
937
|
export { type_16 as type };
|
|
@@ -941,8 +939,8 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
941
939
|
export { delay_16 as delay };
|
|
942
940
|
}
|
|
943
941
|
export { backoff_16 as backoff };
|
|
944
|
-
let
|
|
945
|
-
export {
|
|
942
|
+
let attempts_16: number;
|
|
943
|
+
export { attempts_16 as attempts };
|
|
946
944
|
let removeOnComplete_16: number;
|
|
947
945
|
export { removeOnComplete_16 as removeOnComplete };
|
|
948
946
|
let removeOnFail_16: number;
|
|
@@ -969,6 +967,48 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
969
967
|
}
|
|
970
968
|
export { workerConfig_16 as workerConfig };
|
|
971
969
|
}
|
|
970
|
+
namespace REINDEX_QUEUE {
|
|
971
|
+
let id_17: string;
|
|
972
|
+
export { id_17 as id };
|
|
973
|
+
export namespace queueConfig_17 {
|
|
974
|
+
export namespace defaultJobOptions_17 {
|
|
975
|
+
let attempts_17: number;
|
|
976
|
+
export { attempts_17 as attempts };
|
|
977
|
+
export namespace backoff_17 {
|
|
978
|
+
let type_17: string;
|
|
979
|
+
export { type_17 as type };
|
|
980
|
+
let delay_17: number;
|
|
981
|
+
export { delay_17 as delay };
|
|
982
|
+
}
|
|
983
|
+
export { backoff_17 as backoff };
|
|
984
|
+
let delay_18: number;
|
|
985
|
+
export { delay_18 as delay };
|
|
986
|
+
let removeOnComplete_17: number;
|
|
987
|
+
export { removeOnComplete_17 as removeOnComplete };
|
|
988
|
+
let removeOnFail_17: number;
|
|
989
|
+
export { removeOnFail_17 as removeOnFail };
|
|
990
|
+
}
|
|
991
|
+
export { defaultJobOptions_17 as defaultJobOptions };
|
|
992
|
+
export namespace streams_17 {
|
|
993
|
+
export namespace events_17 {
|
|
994
|
+
let maxLen_17: number;
|
|
995
|
+
export { maxLen_17 as maxLen };
|
|
996
|
+
}
|
|
997
|
+
export { events_17 as events };
|
|
998
|
+
}
|
|
999
|
+
export { streams_17 as streams };
|
|
1000
|
+
}
|
|
1001
|
+
export { queueConfig_17 as queueConfig };
|
|
1002
|
+
export namespace workerConfig_17 {
|
|
1003
|
+
let concurrency_17: number;
|
|
1004
|
+
export { concurrency_17 as concurrency };
|
|
1005
|
+
let lockDuration_17: number;
|
|
1006
|
+
export { lockDuration_17 as lockDuration };
|
|
1007
|
+
let maxStalledCount_17: number;
|
|
1008
|
+
export { maxStalledCount_17 as maxStalledCount };
|
|
1009
|
+
}
|
|
1010
|
+
export { workerConfig_17 as workerConfig };
|
|
1011
|
+
}
|
|
972
1012
|
}
|
|
973
1013
|
|
|
974
1014
|
interface PlatformContextContentItem {
|
package/dist/browser.d.ts
CHANGED
|
@@ -487,7 +487,7 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
487
487
|
}
|
|
488
488
|
export { workerConfig_4 as workerConfig };
|
|
489
489
|
}
|
|
490
|
-
namespace
|
|
490
|
+
namespace AI_AUTO_ANNOTATE_PREP_QUEUE {
|
|
491
491
|
let id_5: string;
|
|
492
492
|
export { id_5 as id };
|
|
493
493
|
export namespace queueConfig_5 {
|
|
@@ -527,7 +527,7 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
527
527
|
}
|
|
528
528
|
export { workerConfig_5 as workerConfig };
|
|
529
529
|
}
|
|
530
|
-
namespace
|
|
530
|
+
namespace AI_AUTO_ANNOTATE_QUEUE {
|
|
531
531
|
let id_6: string;
|
|
532
532
|
export { id_6 as id };
|
|
533
533
|
export namespace queueConfig_6 {
|
|
@@ -567,7 +567,7 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
567
567
|
}
|
|
568
568
|
export { workerConfig_6 as workerConfig };
|
|
569
569
|
}
|
|
570
|
-
namespace
|
|
570
|
+
namespace AI_AUTO_ANNOTATE_CHUNK_QUEUE {
|
|
571
571
|
let id_7: string;
|
|
572
572
|
export { id_7 as id };
|
|
573
573
|
export namespace queueConfig_7 {
|
|
@@ -607,7 +607,7 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
607
607
|
}
|
|
608
608
|
export { workerConfig_7 as workerConfig };
|
|
609
609
|
}
|
|
610
|
-
namespace
|
|
610
|
+
namespace ANNOS_ELASTIC_SYNC_QUEUE {
|
|
611
611
|
let id_8: string;
|
|
612
612
|
export { id_8 as id };
|
|
613
613
|
export namespace queueConfig_8 {
|
|
@@ -647,7 +647,7 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
647
647
|
}
|
|
648
648
|
export { workerConfig_8 as workerConfig };
|
|
649
649
|
}
|
|
650
|
-
namespace
|
|
650
|
+
namespace CHUNKS_ELASTIC_SYNC_QUEUE {
|
|
651
651
|
let id_9: string;
|
|
652
652
|
export { id_9 as id };
|
|
653
653
|
export namespace queueConfig_9 {
|
|
@@ -687,7 +687,7 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
687
687
|
}
|
|
688
688
|
export { workerConfig_9 as workerConfig };
|
|
689
689
|
}
|
|
690
|
-
namespace
|
|
690
|
+
namespace USERS_ELASTIC_SYNC_QUEUE {
|
|
691
691
|
let id_10: string;
|
|
692
692
|
export { id_10 as id };
|
|
693
693
|
export namespace queueConfig_10 {
|
|
@@ -727,7 +727,7 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
727
727
|
}
|
|
728
728
|
export { workerConfig_10 as workerConfig };
|
|
729
729
|
}
|
|
730
|
-
namespace
|
|
730
|
+
namespace CONTENT_ELASTIC_SYNC_QUEUE {
|
|
731
731
|
let id_11: string;
|
|
732
732
|
export { id_11 as id };
|
|
733
733
|
export namespace queueConfig_11 {
|
|
@@ -767,7 +767,7 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
767
767
|
}
|
|
768
768
|
export { workerConfig_11 as workerConfig };
|
|
769
769
|
}
|
|
770
|
-
namespace
|
|
770
|
+
namespace SARVAM_TRANSCRIPTION_QUEUE {
|
|
771
771
|
let id_12: string;
|
|
772
772
|
export { id_12 as id };
|
|
773
773
|
export namespace queueConfig_12 {
|
|
@@ -807,7 +807,7 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
807
807
|
}
|
|
808
808
|
export { workerConfig_12 as workerConfig };
|
|
809
809
|
}
|
|
810
|
-
namespace
|
|
810
|
+
namespace INTERCOM_CONVERSATIONS_QUEUE {
|
|
811
811
|
let id_13: string;
|
|
812
812
|
export { id_13 as id };
|
|
813
813
|
export namespace queueConfig_13 {
|
|
@@ -847,7 +847,7 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
847
847
|
}
|
|
848
848
|
export { workerConfig_13 as workerConfig };
|
|
849
849
|
}
|
|
850
|
-
namespace
|
|
850
|
+
namespace TAG_SYNC_PLAN_QUEUE {
|
|
851
851
|
let id_14: string;
|
|
852
852
|
export { id_14 as id };
|
|
853
853
|
export namespace queueConfig_14 {
|
|
@@ -887,11 +887,13 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
887
887
|
}
|
|
888
888
|
export { workerConfig_14 as workerConfig };
|
|
889
889
|
}
|
|
890
|
-
namespace
|
|
890
|
+
namespace TAG_SYNC_BATCH_QUEUE {
|
|
891
891
|
let id_15: string;
|
|
892
892
|
export { id_15 as id };
|
|
893
893
|
export namespace queueConfig_15 {
|
|
894
894
|
export namespace defaultJobOptions_15 {
|
|
895
|
+
let attempts_15: number;
|
|
896
|
+
export { attempts_15 as attempts };
|
|
895
897
|
export namespace backoff_15 {
|
|
896
898
|
let type_15: string;
|
|
897
899
|
export { type_15 as type };
|
|
@@ -899,8 +901,6 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
899
901
|
export { delay_15 as delay };
|
|
900
902
|
}
|
|
901
903
|
export { backoff_15 as backoff };
|
|
902
|
-
let attempts_15: number;
|
|
903
|
-
export { attempts_15 as attempts };
|
|
904
904
|
let removeOnComplete_15: number;
|
|
905
905
|
export { removeOnComplete_15 as removeOnComplete };
|
|
906
906
|
let removeOnFail_15: number;
|
|
@@ -927,13 +927,11 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
927
927
|
}
|
|
928
928
|
export { workerConfig_15 as workerConfig };
|
|
929
929
|
}
|
|
930
|
-
namespace
|
|
930
|
+
namespace SCHEDULED_EXTERNAL_SYNC_QUEUE {
|
|
931
931
|
let id_16: string;
|
|
932
932
|
export { id_16 as id };
|
|
933
933
|
export namespace queueConfig_16 {
|
|
934
934
|
export namespace defaultJobOptions_16 {
|
|
935
|
-
let attempts_16: number;
|
|
936
|
-
export { attempts_16 as attempts };
|
|
937
935
|
export namespace backoff_16 {
|
|
938
936
|
let type_16: string;
|
|
939
937
|
export { type_16 as type };
|
|
@@ -941,8 +939,8 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
941
939
|
export { delay_16 as delay };
|
|
942
940
|
}
|
|
943
941
|
export { backoff_16 as backoff };
|
|
944
|
-
let
|
|
945
|
-
export {
|
|
942
|
+
let attempts_16: number;
|
|
943
|
+
export { attempts_16 as attempts };
|
|
946
944
|
let removeOnComplete_16: number;
|
|
947
945
|
export { removeOnComplete_16 as removeOnComplete };
|
|
948
946
|
let removeOnFail_16: number;
|
|
@@ -969,6 +967,48 @@ declare namespace BASE_BULLMQ_CONFIG {
|
|
|
969
967
|
}
|
|
970
968
|
export { workerConfig_16 as workerConfig };
|
|
971
969
|
}
|
|
970
|
+
namespace REINDEX_QUEUE {
|
|
971
|
+
let id_17: string;
|
|
972
|
+
export { id_17 as id };
|
|
973
|
+
export namespace queueConfig_17 {
|
|
974
|
+
export namespace defaultJobOptions_17 {
|
|
975
|
+
let attempts_17: number;
|
|
976
|
+
export { attempts_17 as attempts };
|
|
977
|
+
export namespace backoff_17 {
|
|
978
|
+
let type_17: string;
|
|
979
|
+
export { type_17 as type };
|
|
980
|
+
let delay_17: number;
|
|
981
|
+
export { delay_17 as delay };
|
|
982
|
+
}
|
|
983
|
+
export { backoff_17 as backoff };
|
|
984
|
+
let delay_18: number;
|
|
985
|
+
export { delay_18 as delay };
|
|
986
|
+
let removeOnComplete_17: number;
|
|
987
|
+
export { removeOnComplete_17 as removeOnComplete };
|
|
988
|
+
let removeOnFail_17: number;
|
|
989
|
+
export { removeOnFail_17 as removeOnFail };
|
|
990
|
+
}
|
|
991
|
+
export { defaultJobOptions_17 as defaultJobOptions };
|
|
992
|
+
export namespace streams_17 {
|
|
993
|
+
export namespace events_17 {
|
|
994
|
+
let maxLen_17: number;
|
|
995
|
+
export { maxLen_17 as maxLen };
|
|
996
|
+
}
|
|
997
|
+
export { events_17 as events };
|
|
998
|
+
}
|
|
999
|
+
export { streams_17 as streams };
|
|
1000
|
+
}
|
|
1001
|
+
export { queueConfig_17 as queueConfig };
|
|
1002
|
+
export namespace workerConfig_17 {
|
|
1003
|
+
let concurrency_17: number;
|
|
1004
|
+
export { concurrency_17 as concurrency };
|
|
1005
|
+
let lockDuration_17: number;
|
|
1006
|
+
export { lockDuration_17 as lockDuration };
|
|
1007
|
+
let maxStalledCount_17: number;
|
|
1008
|
+
export { maxStalledCount_17 as maxStalledCount };
|
|
1009
|
+
}
|
|
1010
|
+
export { workerConfig_17 as workerConfig };
|
|
1011
|
+
}
|
|
972
1012
|
}
|
|
973
1013
|
|
|
974
1014
|
interface PlatformContextContentItem {
|
package/dist/browser.js
CHANGED
|
@@ -966,6 +966,58 @@ var BASE_BULLMQ_CONFIG = {
|
|
|
966
966
|
}
|
|
967
967
|
}
|
|
968
968
|
},
|
|
969
|
+
AI_AUTO_ANNOTATE_PREP_QUEUE: {
|
|
970
|
+
// PREP queue — the front of the per-doc Flow pipeline. The FE-facing
|
|
971
|
+
// /AIAutoAnnotate handler no longer fetches + summarizes + chunks +
|
|
972
|
+
// enqueues each doc inline (that serial, LLM-heavy loop blocked the HTTP
|
|
973
|
+
// request and risked App Engine clipping large batches mid-loop, silently
|
|
974
|
+
// dropping every doc past the cutoff). Instead the handler computes the
|
|
975
|
+
// batch-level prereqs ONCE (7th criterion + platform-derived categories)
|
|
976
|
+
// and enqueues one PREP job per doc here, then returns fast.
|
|
977
|
+
//
|
|
978
|
+
// Each prep job's worker (okf-sub) calls okf-be /internal/prepDoc, which
|
|
979
|
+
// does the per-doc work: fetch → summarizeDocument (warms the doc-level
|
|
980
|
+
// summary cache) → chunk fields → enqueue that doc's Flow (parent on
|
|
981
|
+
// AI_AUTO_ANNOTATE_QUEUE + one child per chunk on the CHUNK queue). So the
|
|
982
|
+
// Flow parents now get created rolling, as each prep job completes, rather
|
|
983
|
+
// than all up-front in the request. A prep failure isolates to its one doc
|
|
984
|
+
// (that doc is skipped); sibling prep jobs keep going.
|
|
985
|
+
id: "ai-auto-annotate-prep-queue",
|
|
986
|
+
queueConfig: {
|
|
987
|
+
defaultJobOptions: {
|
|
988
|
+
// attempts:1 — a retry would re-summarize (cache-HIT, cheap) but then
|
|
989
|
+
// re-enqueue the doc's Flow, double-annotating the doc. The rest of
|
|
990
|
+
// the per-doc Flow pipeline is attempts:1 for the same fail-loud
|
|
991
|
+
// reason (a retry just re-fires expensive LLM work).
|
|
992
|
+
attempts: 1,
|
|
993
|
+
backoff: {
|
|
994
|
+
type: "exponential",
|
|
995
|
+
delay: 5e3
|
|
996
|
+
},
|
|
997
|
+
removeOnComplete: 30,
|
|
998
|
+
removeOnFail: 100
|
|
999
|
+
},
|
|
1000
|
+
streams: {
|
|
1001
|
+
events: {
|
|
1002
|
+
maxLen: 10
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
},
|
|
1006
|
+
workerConfig: {
|
|
1007
|
+
// Each prep job = one Mongo doc fetch + ONE summarize LLM call + a
|
|
1008
|
+
// deterministic chunk + a Flow enqueue. It's lighter than a chunk job
|
|
1009
|
+
// (which does ~4 LLM calls), so we can run more in parallel — 10 keeps
|
|
1010
|
+
// prep comfortably AHEAD of the downstream chunk queue (concurrency 5),
|
|
1011
|
+
// which is the real throughput cap. Going much higher than that buys
|
|
1012
|
+
// little: prep would just drain faster into a chunk queue that still
|
|
1013
|
+
// processes 5 at a time, while adding concurrent okf-be /internal/prepDoc
|
|
1014
|
+
// load + concurrent summarize calls against the shared OpenAI TPM budget.
|
|
1015
|
+
concurrency: 10,
|
|
1016
|
+
lockDuration: 3e5,
|
|
1017
|
+
// 5 min — generous ceiling over the 180s summarizer timeout
|
|
1018
|
+
maxStalledCount: 1
|
|
1019
|
+
}
|
|
1020
|
+
},
|
|
969
1021
|
AI_AUTO_ANNOTATE_QUEUE: {
|
|
970
1022
|
// PARENT queue in the per-doc Flow. One job per doc; child jobs (one
|
|
971
1023
|
// per chunk) live on AI_AUTO_ANNOTATE_CHUNK_QUEUE. BullMQ Flow fires
|
|
@@ -1769,6 +1821,7 @@ var buildFilterConfigurations = ({ groups, type, selectedTpls, allTpls, isRollup
|
|
|
1769
1821
|
scope: section.filterScope
|
|
1770
1822
|
};
|
|
1771
1823
|
};
|
|
1824
|
+
const isSelfTerminalTag = element.rollupPath.length === 1 && !isLastTagProfile && !isTerminalValuePath;
|
|
1772
1825
|
return {
|
|
1773
1826
|
filterId: `ROLLUP_${section.filterScope}_${element.rollupPath.join(
|
|
1774
1827
|
"_"
|
|
@@ -1782,9 +1835,14 @@ var buildFilterConfigurations = ({ groups, type, selectedTpls, allTpls, isRollup
|
|
|
1782
1835
|
scope: section.filterScope
|
|
1783
1836
|
}),
|
|
1784
1837
|
contentType: element.rollupPath[0],
|
|
1785
|
-
path: `tags.${element.rollupPath[1]}`,
|
|
1838
|
+
path: `tags.${isSelfTerminalTag ? element.rollupPath[0] : element.rollupPath[1]}`,
|
|
1786
1839
|
source: getSourceConfig(),
|
|
1787
|
-
target: {
|
|
1840
|
+
target: isSelfTerminalTag ? {
|
|
1841
|
+
filterType: "tagType",
|
|
1842
|
+
tagType: element.rollupPath[0],
|
|
1843
|
+
rollupPath: element.rollupPath,
|
|
1844
|
+
...isAnno && { isAnno: true }
|
|
1845
|
+
} : {
|
|
1788
1846
|
filterType: "nestedRollupTagType",
|
|
1789
1847
|
rollupPath: element.rollupPath,
|
|
1790
1848
|
...isAnno && { isAnno: true }
|
package/dist/browser.mjs
CHANGED
|
@@ -896,6 +896,58 @@ var BASE_BULLMQ_CONFIG = {
|
|
|
896
896
|
}
|
|
897
897
|
}
|
|
898
898
|
},
|
|
899
|
+
AI_AUTO_ANNOTATE_PREP_QUEUE: {
|
|
900
|
+
// PREP queue — the front of the per-doc Flow pipeline. The FE-facing
|
|
901
|
+
// /AIAutoAnnotate handler no longer fetches + summarizes + chunks +
|
|
902
|
+
// enqueues each doc inline (that serial, LLM-heavy loop blocked the HTTP
|
|
903
|
+
// request and risked App Engine clipping large batches mid-loop, silently
|
|
904
|
+
// dropping every doc past the cutoff). Instead the handler computes the
|
|
905
|
+
// batch-level prereqs ONCE (7th criterion + platform-derived categories)
|
|
906
|
+
// and enqueues one PREP job per doc here, then returns fast.
|
|
907
|
+
//
|
|
908
|
+
// Each prep job's worker (okf-sub) calls okf-be /internal/prepDoc, which
|
|
909
|
+
// does the per-doc work: fetch → summarizeDocument (warms the doc-level
|
|
910
|
+
// summary cache) → chunk fields → enqueue that doc's Flow (parent on
|
|
911
|
+
// AI_AUTO_ANNOTATE_QUEUE + one child per chunk on the CHUNK queue). So the
|
|
912
|
+
// Flow parents now get created rolling, as each prep job completes, rather
|
|
913
|
+
// than all up-front in the request. A prep failure isolates to its one doc
|
|
914
|
+
// (that doc is skipped); sibling prep jobs keep going.
|
|
915
|
+
id: "ai-auto-annotate-prep-queue",
|
|
916
|
+
queueConfig: {
|
|
917
|
+
defaultJobOptions: {
|
|
918
|
+
// attempts:1 — a retry would re-summarize (cache-HIT, cheap) but then
|
|
919
|
+
// re-enqueue the doc's Flow, double-annotating the doc. The rest of
|
|
920
|
+
// the per-doc Flow pipeline is attempts:1 for the same fail-loud
|
|
921
|
+
// reason (a retry just re-fires expensive LLM work).
|
|
922
|
+
attempts: 1,
|
|
923
|
+
backoff: {
|
|
924
|
+
type: "exponential",
|
|
925
|
+
delay: 5e3
|
|
926
|
+
},
|
|
927
|
+
removeOnComplete: 30,
|
|
928
|
+
removeOnFail: 100
|
|
929
|
+
},
|
|
930
|
+
streams: {
|
|
931
|
+
events: {
|
|
932
|
+
maxLen: 10
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
},
|
|
936
|
+
workerConfig: {
|
|
937
|
+
// Each prep job = one Mongo doc fetch + ONE summarize LLM call + a
|
|
938
|
+
// deterministic chunk + a Flow enqueue. It's lighter than a chunk job
|
|
939
|
+
// (which does ~4 LLM calls), so we can run more in parallel — 10 keeps
|
|
940
|
+
// prep comfortably AHEAD of the downstream chunk queue (concurrency 5),
|
|
941
|
+
// which is the real throughput cap. Going much higher than that buys
|
|
942
|
+
// little: prep would just drain faster into a chunk queue that still
|
|
943
|
+
// processes 5 at a time, while adding concurrent okf-be /internal/prepDoc
|
|
944
|
+
// load + concurrent summarize calls against the shared OpenAI TPM budget.
|
|
945
|
+
concurrency: 10,
|
|
946
|
+
lockDuration: 3e5,
|
|
947
|
+
// 5 min — generous ceiling over the 180s summarizer timeout
|
|
948
|
+
maxStalledCount: 1
|
|
949
|
+
}
|
|
950
|
+
},
|
|
899
951
|
AI_AUTO_ANNOTATE_QUEUE: {
|
|
900
952
|
// PARENT queue in the per-doc Flow. One job per doc; child jobs (one
|
|
901
953
|
// per chunk) live on AI_AUTO_ANNOTATE_CHUNK_QUEUE. BullMQ Flow fires
|
|
@@ -1699,6 +1751,7 @@ var buildFilterConfigurations = ({ groups, type, selectedTpls, allTpls, isRollup
|
|
|
1699
1751
|
scope: section.filterScope
|
|
1700
1752
|
};
|
|
1701
1753
|
};
|
|
1754
|
+
const isSelfTerminalTag = element.rollupPath.length === 1 && !isLastTagProfile && !isTerminalValuePath;
|
|
1702
1755
|
return {
|
|
1703
1756
|
filterId: `ROLLUP_${section.filterScope}_${element.rollupPath.join(
|
|
1704
1757
|
"_"
|
|
@@ -1712,9 +1765,14 @@ var buildFilterConfigurations = ({ groups, type, selectedTpls, allTpls, isRollup
|
|
|
1712
1765
|
scope: section.filterScope
|
|
1713
1766
|
}),
|
|
1714
1767
|
contentType: element.rollupPath[0],
|
|
1715
|
-
path: `tags.${element.rollupPath[1]}`,
|
|
1768
|
+
path: `tags.${isSelfTerminalTag ? element.rollupPath[0] : element.rollupPath[1]}`,
|
|
1716
1769
|
source: getSourceConfig(),
|
|
1717
|
-
target: {
|
|
1770
|
+
target: isSelfTerminalTag ? {
|
|
1771
|
+
filterType: "tagType",
|
|
1772
|
+
tagType: element.rollupPath[0],
|
|
1773
|
+
rollupPath: element.rollupPath,
|
|
1774
|
+
...isAnno && { isAnno: true }
|
|
1775
|
+
} : {
|
|
1718
1776
|
filterType: "nestedRollupTagType",
|
|
1719
1777
|
rollupPath: element.rollupPath,
|
|
1720
1778
|
...isAnno && { isAnno: true }
|