nexus-agents 2.77.13 → 2.78.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/{child-mcp-config-MJMUF7TL.js → child-mcp-config-CTO2MBRM.js} +3 -4
- package/dist/{child-mcp-config-MJMUF7TL.js.map → child-mcp-config-CTO2MBRM.js.map} +1 -1
- package/dist/{chunk-YJ2IGAD2.js → chunk-2UYTFLMO.js} +2 -2
- package/dist/{chunk-6AY5DK4E.js → chunk-2YPG6PDG.js} +3 -3
- package/dist/{chunk-3VWMM6UF.js → chunk-3NIPH6UP.js} +2 -2
- package/dist/{chunk-JX6OI4FS.js → chunk-4N33QZLH.js} +13 -15
- package/dist/{chunk-JX6OI4FS.js.map → chunk-4N33QZLH.js.map} +1 -1
- package/dist/{chunk-JN6UWGHH.js → chunk-5O6XLBPP.js} +2 -2
- package/dist/{chunk-ERWXGXV2.js → chunk-6TFTVW77.js} +3 -3
- package/dist/{chunk-GFKGL2GQ.js → chunk-6WBTNZAY.js} +171 -83
- package/dist/chunk-6WBTNZAY.js.map +1 -0
- package/dist/{chunk-GOT7OAL5.js → chunk-7BMOZJYS.js} +29 -5
- package/dist/chunk-7BMOZJYS.js.map +1 -0
- package/dist/{chunk-C2LLQ6TW.js → chunk-7XCUZI4G.js} +4 -4
- package/dist/chunk-7XCUZI4G.js.map +1 -0
- package/dist/{chunk-TDV5ALHY.js → chunk-D6TM2VHX.js} +3 -3
- package/dist/{chunk-PWTJGGKB.js → chunk-DLXT23AC.js} +2 -2
- package/dist/chunk-DNO2INX5.js +276 -0
- package/dist/chunk-DNO2INX5.js.map +1 -0
- package/dist/{chunk-G2CSKBY5.js → chunk-FJWWSVWB.js} +29 -6
- package/dist/chunk-FJWWSVWB.js.map +1 -0
- package/dist/{chunk-DSQ5XM4O.js → chunk-FVPYP5DD.js} +4 -4
- package/dist/{chunk-MGLWPN2I.js → chunk-GONMG4NM.js} +2 -2
- package/dist/{chunk-RBZ4CDMY.js → chunk-GTGDVBLW.js} +5 -5
- package/dist/{chunk-YQMQSJQK.js → chunk-HYU4GZY6.js} +2 -2
- package/dist/{chunk-3DH5SLFH.js → chunk-K2QILJG4.js} +6 -6
- package/dist/{chunk-5WHWKY32.js → chunk-KT5FIBWS.js} +2 -2
- package/dist/{chunk-DIB6V67T.js → chunk-L6SCKLGO.js} +3 -3
- package/dist/{chunk-IPWCD22D.js → chunk-PLX6FCFC.js} +2 -2
- package/dist/chunk-PQHVC4BD.js +639 -0
- package/dist/chunk-PQHVC4BD.js.map +1 -0
- package/dist/chunk-Q5CFPIJ5.js +5581 -0
- package/dist/chunk-Q5CFPIJ5.js.map +1 -0
- package/dist/{chunk-G6ZPVADX.js → chunk-SD76JZBG.js} +2 -2
- package/dist/{chunk-Y2CP4Z5B.js → chunk-SWFJU3W2.js} +220 -4580
- package/dist/chunk-SWFJU3W2.js.map +1 -0
- package/dist/{chunk-3MRM53T4.js → chunk-WDYCIJWN.js} +640 -470
- package/dist/chunk-WDYCIJWN.js.map +1 -0
- package/dist/{chunk-CM3TORGV.js → chunk-YXWGEIQR.js} +2 -2
- package/dist/{chunk-7NK7BTWP.js → chunk-ZVCED4Z4.js} +2 -2
- package/dist/cli-circuit-breaker-I74ZQ44Q.js +13 -0
- package/dist/cli.js +109 -58
- package/dist/cli.js.map +1 -1
- package/dist/{composite-router-S6E26BCI.js → composite-router-V3OC57IE.js} +3 -4
- package/dist/consensus-vote-ESFPGEJE.js +30 -0
- package/dist/context-retriever-MB3D7KS6.js +18 -0
- package/dist/dist-NIXVXYIH.js +42 -0
- package/dist/doctor-deep-KQ765XZA.js +12 -0
- package/dist/expert-bridge-JKLC57IC.js +10 -0
- package/dist/factory-BUUXNGIB.js +14 -0
- package/dist/{factory-X3VKIGKP.js → factory-LHHYDVZX.js} +5 -6
- package/dist/index.d.ts +72 -8
- package/dist/index.js +208 -316
- package/dist/index.js.map +1 -1
- package/dist/{init-opencode-CFE7M6XA.js → init-opencode-GXZN2W5S.js} +6 -7
- package/dist/{init-opencode-CFE7M6XA.js.map → init-opencode-GXZN2W5S.js.map} +1 -1
- package/dist/issue-triage-RMXPDZ2K.js +15 -0
- package/dist/{learning-persistence-N6ILD2HX.js → learning-persistence-Q3HTOGTU.js} +2 -3
- package/dist/outcome-store-adapter-QRFJJIKB.js +57 -0
- package/dist/outcome-store-adapter-QRFJJIKB.js.map +1 -0
- package/dist/{registry-command-RPPC7N2K.js → registry-command-6E4YKAMT.js} +3 -4
- package/dist/{registry-command-RPPC7N2K.js.map → registry-command-6E4YKAMT.js.map} +1 -1
- package/dist/{repo-security-plan-7ZCDVH5O.js → repo-security-plan-AGRU72DL.js} +4 -5
- package/dist/research-helpers-synthesize-K2UCJQQG.js +13 -0
- package/dist/{routing-memory-5VTX7LQX.js → routing-memory-3B6DDZ76.js} +3 -4
- package/dist/{session-memory-7XBV6BMY.js → session-memory-L7EQIY2O.js} +4 -5
- package/dist/{setup-command-W6UKPODL.js → setup-command-VYV4RFWW.js} +11 -12
- package/dist/setup-config-EQT24DD4.js +10 -0
- package/dist/{setup-custom-api-WM5W5AY5.js → setup-custom-api-IBDV654K.js} +5 -6
- package/dist/{setup-custom-api-WM5W5AY5.js.map → setup-custom-api-IBDV654K.js.map} +1 -1
- package/dist/tool-memory-6HCHQLAN.js +19 -0
- package/dist/{weather-report-YJMVKJGA.js → weather-report-ER3WUZ7S.js} +3 -4
- package/package.json +3 -2
- package/dist/adaptive-memory-EI564K4C.js +0 -16
- package/dist/chunk-3MRM53T4.js.map +0 -1
- package/dist/chunk-BJ2OMC7P.js +0 -944
- package/dist/chunk-BJ2OMC7P.js.map +0 -1
- package/dist/chunk-C2LLQ6TW.js.map +0 -1
- package/dist/chunk-G2CSKBY5.js.map +0 -1
- package/dist/chunk-GFKGL2GQ.js.map +0 -1
- package/dist/chunk-GOT7OAL5.js.map +0 -1
- package/dist/chunk-I7ORMAO7.js +0 -32
- package/dist/chunk-I7ORMAO7.js.map +0 -1
- package/dist/chunk-Y2CP4Z5B.js.map +0 -1
- package/dist/cli-circuit-breaker-YX4BWZD5.js +0 -14
- package/dist/consensus-vote-MUQ4HPIF.js +0 -30
- package/dist/doctor-deep-BRU5ZUJI.js +0 -13
- package/dist/expert-bridge-ZPNVLJVN.js +0 -11
- package/dist/factory-A7DTCCUY.js +0 -15
- package/dist/issue-triage-6XD6CVPB.js +0 -16
- package/dist/mobimem-CG2MNS7V.js +0 -14
- package/dist/nexus-data-dir-77UO7N6J.js +0 -12
- package/dist/research-helpers-synthesize-36TUTUUA.js +0 -14
- package/dist/setup-config-EI5KROA3.js +0 -11
- /package/dist/{chunk-YJ2IGAD2.js.map → chunk-2UYTFLMO.js.map} +0 -0
- /package/dist/{chunk-6AY5DK4E.js.map → chunk-2YPG6PDG.js.map} +0 -0
- /package/dist/{chunk-3VWMM6UF.js.map → chunk-3NIPH6UP.js.map} +0 -0
- /package/dist/{chunk-JN6UWGHH.js.map → chunk-5O6XLBPP.js.map} +0 -0
- /package/dist/{chunk-ERWXGXV2.js.map → chunk-6TFTVW77.js.map} +0 -0
- /package/dist/{chunk-TDV5ALHY.js.map → chunk-D6TM2VHX.js.map} +0 -0
- /package/dist/{chunk-PWTJGGKB.js.map → chunk-DLXT23AC.js.map} +0 -0
- /package/dist/{chunk-DSQ5XM4O.js.map → chunk-FVPYP5DD.js.map} +0 -0
- /package/dist/{chunk-MGLWPN2I.js.map → chunk-GONMG4NM.js.map} +0 -0
- /package/dist/{chunk-RBZ4CDMY.js.map → chunk-GTGDVBLW.js.map} +0 -0
- /package/dist/{chunk-YQMQSJQK.js.map → chunk-HYU4GZY6.js.map} +0 -0
- /package/dist/{chunk-3DH5SLFH.js.map → chunk-K2QILJG4.js.map} +0 -0
- /package/dist/{chunk-5WHWKY32.js.map → chunk-KT5FIBWS.js.map} +0 -0
- /package/dist/{chunk-DIB6V67T.js.map → chunk-L6SCKLGO.js.map} +0 -0
- /package/dist/{chunk-IPWCD22D.js.map → chunk-PLX6FCFC.js.map} +0 -0
- /package/dist/{chunk-G6ZPVADX.js.map → chunk-SD76JZBG.js.map} +0 -0
- /package/dist/{chunk-CM3TORGV.js.map → chunk-YXWGEIQR.js.map} +0 -0
- /package/dist/{chunk-7NK7BTWP.js.map → chunk-ZVCED4Z4.js.map} +0 -0
- /package/dist/{adaptive-memory-EI564K4C.js.map → cli-circuit-breaker-I74ZQ44Q.js.map} +0 -0
- /package/dist/{cli-circuit-breaker-YX4BWZD5.js.map → composite-router-V3OC57IE.js.map} +0 -0
- /package/dist/{composite-router-S6E26BCI.js.map → consensus-vote-ESFPGEJE.js.map} +0 -0
- /package/dist/{consensus-vote-MUQ4HPIF.js.map → context-retriever-MB3D7KS6.js.map} +0 -0
- /package/dist/{doctor-deep-BRU5ZUJI.js.map → dist-NIXVXYIH.js.map} +0 -0
- /package/dist/{expert-bridge-ZPNVLJVN.js.map → doctor-deep-KQ765XZA.js.map} +0 -0
- /package/dist/{factory-A7DTCCUY.js.map → expert-bridge-JKLC57IC.js.map} +0 -0
- /package/dist/{factory-X3VKIGKP.js.map → factory-BUUXNGIB.js.map} +0 -0
- /package/dist/{issue-triage-6XD6CVPB.js.map → factory-LHHYDVZX.js.map} +0 -0
- /package/dist/{learning-persistence-N6ILD2HX.js.map → issue-triage-RMXPDZ2K.js.map} +0 -0
- /package/dist/{mobimem-CG2MNS7V.js.map → learning-persistence-Q3HTOGTU.js.map} +0 -0
- /package/dist/{nexus-data-dir-77UO7N6J.js.map → repo-security-plan-AGRU72DL.js.map} +0 -0
- /package/dist/{repo-security-plan-7ZCDVH5O.js.map → research-helpers-synthesize-K2UCJQQG.js.map} +0 -0
- /package/dist/{research-helpers-synthesize-36TUTUUA.js.map → routing-memory-3B6DDZ76.js.map} +0 -0
- /package/dist/{routing-memory-5VTX7LQX.js.map → session-memory-L7EQIY2O.js.map} +0 -0
- /package/dist/{session-memory-7XBV6BMY.js.map → setup-command-VYV4RFWW.js.map} +0 -0
- /package/dist/{setup-command-W6UKPODL.js.map → setup-config-EQT24DD4.js.map} +0 -0
- /package/dist/{setup-config-EI5KROA3.js.map → tool-memory-6HCHQLAN.js.map} +0 -0
- /package/dist/{weather-report-YJMVKJGA.js.map → weather-report-ER3WUZ7S.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createGitHubProvider,
|
|
3
3
|
createScmProvider
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FVPYP5DD.js";
|
|
5
5
|
import {
|
|
6
6
|
ALLOWED_COMMANDS,
|
|
7
7
|
ARTIFACT_TYPES,
|
|
@@ -518,7 +518,8 @@ import {
|
|
|
518
518
|
validateWorkflow,
|
|
519
519
|
validateWorkflowDependencies,
|
|
520
520
|
withLogging
|
|
521
|
-
} from "./chunk-
|
|
521
|
+
} from "./chunk-6WBTNZAY.js";
|
|
522
|
+
import "./chunk-AP2FD37C.js";
|
|
522
523
|
import {
|
|
523
524
|
SharedMemoryStore
|
|
524
525
|
} from "./chunk-ED6VQWNG.js";
|
|
@@ -526,17 +527,21 @@ import {
|
|
|
526
527
|
getTokenEnvVars,
|
|
527
528
|
hasToken,
|
|
528
529
|
resolveToken
|
|
529
|
-
} from "./chunk-
|
|
530
|
+
} from "./chunk-GONMG4NM.js";
|
|
530
531
|
import "./chunk-X2M7OF27.js";
|
|
531
532
|
import {
|
|
532
533
|
OPENAI_MODELS,
|
|
533
534
|
OPENAI_MODEL_ALIASES,
|
|
534
535
|
OpenAIAdapter,
|
|
535
536
|
createOpenAIAdapter
|
|
536
|
-
} from "./chunk-
|
|
537
|
+
} from "./chunk-L6SCKLGO.js";
|
|
538
|
+
import {
|
|
539
|
+
CliCircuitBreakerIntegration,
|
|
540
|
+
createCliCircuitBreakerIntegration
|
|
541
|
+
} from "./chunk-2YPG6PDG.js";
|
|
537
542
|
import {
|
|
538
543
|
executeExpert
|
|
539
|
-
} from "./chunk-
|
|
544
|
+
} from "./chunk-K2QILJG4.js";
|
|
540
545
|
import {
|
|
541
546
|
AgentFindingSchema,
|
|
542
547
|
AgentPerformanceSchema,
|
|
@@ -632,7 +637,10 @@ import {
|
|
|
632
637
|
validateToolInput,
|
|
633
638
|
withModelNotFoundFallback,
|
|
634
639
|
wrapResilientWithFallback
|
|
635
|
-
} from "./chunk-
|
|
640
|
+
} from "./chunk-SWFJU3W2.js";
|
|
641
|
+
import {
|
|
642
|
+
PROVIDER_ENV_KEYS
|
|
643
|
+
} from "./chunk-ZVCED4Z4.js";
|
|
636
644
|
import {
|
|
637
645
|
AdapterModelError,
|
|
638
646
|
BaseAdapter,
|
|
@@ -656,11 +664,8 @@ import {
|
|
|
656
664
|
transformStream,
|
|
657
665
|
validateApiKeyPresence,
|
|
658
666
|
withTimeout
|
|
659
|
-
} from "./chunk-
|
|
660
|
-
import
|
|
661
|
-
PROVIDER_ENV_KEYS
|
|
662
|
-
} from "./chunk-7NK7BTWP.js";
|
|
663
|
-
import "./chunk-JN6UWGHH.js";
|
|
667
|
+
} from "./chunk-PLX6FCFC.js";
|
|
668
|
+
import "./chunk-5O6XLBPP.js";
|
|
664
669
|
import {
|
|
665
670
|
AgentActionSchema,
|
|
666
671
|
GitHubReviewer,
|
|
@@ -693,11 +698,11 @@ import {
|
|
|
693
698
|
sanitizeInput,
|
|
694
699
|
validateAgentAction,
|
|
695
700
|
validateCorroboration
|
|
696
|
-
} from "./chunk-
|
|
701
|
+
} from "./chunk-6TFTVW77.js";
|
|
697
702
|
import {
|
|
698
703
|
GitHubProvider,
|
|
699
704
|
ScmError
|
|
700
|
-
} from "./chunk-
|
|
705
|
+
} from "./chunk-SD76JZBG.js";
|
|
701
706
|
import {
|
|
702
707
|
FALLBACK_SCANNER_DATA,
|
|
703
708
|
buildPlanFromAnalysis,
|
|
@@ -705,14 +710,20 @@ import {
|
|
|
705
710
|
generateSecurityPlan,
|
|
706
711
|
getRegistryManifest,
|
|
707
712
|
resolveScannerData
|
|
708
|
-
} from "./chunk-
|
|
713
|
+
} from "./chunk-FJWWSVWB.js";
|
|
709
714
|
import {
|
|
710
715
|
analyzeGitHubRepo,
|
|
711
716
|
analyzeRepo,
|
|
712
717
|
normalizeRepoId
|
|
713
718
|
} from "./chunk-7J7PNOJQ.js";
|
|
714
|
-
import "./chunk-AP2FD37C.js";
|
|
715
719
|
import "./chunk-BQ4YXGGQ.js";
|
|
720
|
+
import {
|
|
721
|
+
PersistentStrategyDistiller,
|
|
722
|
+
RulesSnapshotSchema
|
|
723
|
+
} from "./chunk-DNO2INX5.js";
|
|
724
|
+
import {
|
|
725
|
+
MemoryError
|
|
726
|
+
} from "./chunk-Q5CFPIJ5.js";
|
|
716
727
|
import {
|
|
717
728
|
AppConfigSchema,
|
|
718
729
|
AvailabilityCache,
|
|
@@ -738,16 +749,17 @@ import {
|
|
|
738
749
|
resolveFallback,
|
|
739
750
|
startStdioServer,
|
|
740
751
|
validateNexusEnv
|
|
741
|
-
} from "./chunk-
|
|
752
|
+
} from "./chunk-4N33QZLH.js";
|
|
742
753
|
import {
|
|
743
754
|
AvailableModelsCache,
|
|
744
755
|
getDefaultAvailableModelsCache,
|
|
745
756
|
setDefaultAvailableModelsCache
|
|
746
|
-
} from "./chunk-
|
|
757
|
+
} from "./chunk-KT5FIBWS.js";
|
|
747
758
|
import {
|
|
748
759
|
DEFAULTS
|
|
749
|
-
} from "./chunk-
|
|
760
|
+
} from "./chunk-HYU4GZY6.js";
|
|
750
761
|
import "./chunk-NUBSJGQZ.js";
|
|
762
|
+
import "./chunk-633WH2ML.js";
|
|
751
763
|
import {
|
|
752
764
|
BaseCliAdapter,
|
|
753
765
|
CLI_TIMEOUT_PROFILES,
|
|
@@ -776,7 +788,8 @@ import {
|
|
|
776
788
|
isCliAvailable,
|
|
777
789
|
isRetryableError,
|
|
778
790
|
sleep
|
|
779
|
-
} from "./chunk-
|
|
791
|
+
} from "./chunk-D6TM2VHX.js";
|
|
792
|
+
import "./chunk-DLXT23AC.js";
|
|
780
793
|
import {
|
|
781
794
|
BUILT_IN_EXPERTS,
|
|
782
795
|
BuiltInExpertTypeSchema,
|
|
@@ -786,16 +799,8 @@ import {
|
|
|
786
799
|
safeValidateExpertConfig,
|
|
787
800
|
validateExpertConfig
|
|
788
801
|
} from "./chunk-ZM4O442V.js";
|
|
789
|
-
import "./chunk-
|
|
790
|
-
import
|
|
791
|
-
MemoryError
|
|
792
|
-
} from "./chunk-BJ2OMC7P.js";
|
|
793
|
-
import "./chunk-633WH2ML.js";
|
|
794
|
-
import {
|
|
795
|
-
CliCircuitBreakerIntegration,
|
|
796
|
-
createCliCircuitBreakerIntegration
|
|
797
|
-
} from "./chunk-6AY5DK4E.js";
|
|
798
|
-
import "./chunk-PWTJGGKB.js";
|
|
802
|
+
import "./chunk-PQHVC4BD.js";
|
|
803
|
+
import "./chunk-3NIPH6UP.js";
|
|
799
804
|
import {
|
|
800
805
|
AgentCapability,
|
|
801
806
|
AgentError,
|
|
@@ -866,19 +871,14 @@ import {
|
|
|
866
871
|
map,
|
|
867
872
|
mapErr,
|
|
868
873
|
ok,
|
|
869
|
-
registerPersistentDistillerFactory,
|
|
870
874
|
sanitize,
|
|
871
875
|
setDefaultRegistry,
|
|
872
876
|
sigmoidConfidence,
|
|
873
877
|
toError,
|
|
874
878
|
unwrap,
|
|
875
879
|
unwrapOr
|
|
876
|
-
} from "./chunk-
|
|
877
|
-
import
|
|
878
|
-
ensureLearningDir,
|
|
879
|
-
getRulesFile
|
|
880
|
-
} from "./chunk-I7ORMAO7.js";
|
|
881
|
-
import "./chunk-GOT7OAL5.js";
|
|
880
|
+
} from "./chunk-WDYCIJWN.js";
|
|
881
|
+
import "./chunk-7BMOZJYS.js";
|
|
882
882
|
import "./chunk-UP2VWCW5.js";
|
|
883
883
|
|
|
884
884
|
// src/adapters/factory.ts
|
|
@@ -2822,114 +2822,6 @@ function createOutcomeStorage(config) {
|
|
|
2822
2822
|
return new SQLiteOutcomeStorage(config);
|
|
2823
2823
|
}
|
|
2824
2824
|
|
|
2825
|
-
// src/learning/strategy-distiller-persistence.ts
|
|
2826
|
-
import { writeFileSync, readFileSync as readFileSync2, renameSync, unlinkSync, existsSync as existsSync2 } from "fs";
|
|
2827
|
-
import { dirname } from "path";
|
|
2828
|
-
import { z as z4 } from "zod";
|
|
2829
|
-
var DistilledRuleSchema = z4.object({
|
|
2830
|
-
id: z4.string(),
|
|
2831
|
-
patternType: z4.enum(["failure-rate", "success-rate", "latency-spike"]),
|
|
2832
|
-
cli: z4.enum(CLI_NAMES),
|
|
2833
|
-
category: z4.string(),
|
|
2834
|
-
action: z4.enum(["penalize", "boost", "avoid"]),
|
|
2835
|
-
confidence: z4.number(),
|
|
2836
|
-
observationCount: z4.number(),
|
|
2837
|
-
metric: z4.number(),
|
|
2838
|
-
status: z4.enum(["draft", "active", "promoted", "expired"]),
|
|
2839
|
-
createdAt: z4.number(),
|
|
2840
|
-
updatedAt: z4.number(),
|
|
2841
|
-
tainted: z4.boolean()
|
|
2842
|
-
});
|
|
2843
|
-
var RulesSnapshotSchema = z4.object({
|
|
2844
|
-
version: z4.literal(1),
|
|
2845
|
-
savedAt: z4.string(),
|
|
2846
|
-
rules: z4.array(DistilledRuleSchema)
|
|
2847
|
-
});
|
|
2848
|
-
var PersistentStrategyDistiller = class extends StrategyDistiller {
|
|
2849
|
-
filePath;
|
|
2850
|
-
persistLogger;
|
|
2851
|
-
constructor(outcomeStore, persistConfig, logger15, distillerConfig) {
|
|
2852
|
-
super(outcomeStore, logger15, distillerConfig);
|
|
2853
|
-
this.filePath = persistConfig?.filePath ?? getRulesFile();
|
|
2854
|
-
this.persistLogger = logger15 ?? createLogger({ component: "PersistentStrategyDistiller" });
|
|
2855
|
-
const dataDir = persistConfig?.dataDir;
|
|
2856
|
-
ensureLearningDir(dataDir);
|
|
2857
|
-
this.hydrate();
|
|
2858
|
-
}
|
|
2859
|
-
/** Override distill to persist rules after each run. */
|
|
2860
|
-
distill() {
|
|
2861
|
-
super.distill();
|
|
2862
|
-
this.saveSnapshot();
|
|
2863
|
-
}
|
|
2864
|
-
// ==========================================================================
|
|
2865
|
-
// Private
|
|
2866
|
-
// ==========================================================================
|
|
2867
|
-
hydrate() {
|
|
2868
|
-
if (!existsSync2(this.filePath)) {
|
|
2869
|
-
this.persistLogger.debug("No rules file found, starting fresh", {
|
|
2870
|
-
path: this.filePath
|
|
2871
|
-
});
|
|
2872
|
-
return;
|
|
2873
|
-
}
|
|
2874
|
-
try {
|
|
2875
|
-
const content = readFileSync2(this.filePath, "utf-8");
|
|
2876
|
-
const parsed = JSON.parse(content);
|
|
2877
|
-
const result = RulesSnapshotSchema.safeParse(parsed);
|
|
2878
|
-
if (!result.success) {
|
|
2879
|
-
this.persistLogger.warn("Rules file failed validation, starting fresh", {
|
|
2880
|
-
path: this.filePath,
|
|
2881
|
-
error: result.error.message
|
|
2882
|
-
});
|
|
2883
|
-
return;
|
|
2884
|
-
}
|
|
2885
|
-
this.loadRules(result.data.rules);
|
|
2886
|
-
this.persistLogger.info("Hydrated distilled rules from disk", {
|
|
2887
|
-
ruleCount: result.data.rules.length,
|
|
2888
|
-
savedAt: result.data.savedAt,
|
|
2889
|
-
path: this.filePath
|
|
2890
|
-
});
|
|
2891
|
-
} catch (error) {
|
|
2892
|
-
const msg = error instanceof Error ? error.message : String(error);
|
|
2893
|
-
this.persistLogger.warn("Failed to hydrate rules from disk", {
|
|
2894
|
-
error: msg,
|
|
2895
|
-
path: this.filePath
|
|
2896
|
-
});
|
|
2897
|
-
}
|
|
2898
|
-
}
|
|
2899
|
-
saveSnapshot() {
|
|
2900
|
-
const rules = this.getRules();
|
|
2901
|
-
const snapshot = {
|
|
2902
|
-
version: 1,
|
|
2903
|
-
savedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2904
|
-
rules
|
|
2905
|
-
};
|
|
2906
|
-
const tmpPath = this.filePath + ".tmp";
|
|
2907
|
-
try {
|
|
2908
|
-
ensureLearningDir(dirname(this.filePath));
|
|
2909
|
-
writeFileSync(tmpPath, JSON.stringify(snapshot, null, 2), "utf-8");
|
|
2910
|
-
renameSync(tmpPath, this.filePath);
|
|
2911
|
-
} catch (error) {
|
|
2912
|
-
const msg = error instanceof Error ? error.message : String(error);
|
|
2913
|
-
this.persistLogger.warn("Failed to persist rules to disk", {
|
|
2914
|
-
error: msg,
|
|
2915
|
-
path: this.filePath
|
|
2916
|
-
});
|
|
2917
|
-
try {
|
|
2918
|
-
if (existsSync2(tmpPath)) unlinkSync(tmpPath);
|
|
2919
|
-
} catch (cleanupErr) {
|
|
2920
|
-
const msg2 = cleanupErr instanceof Error ? cleanupErr.message : String(cleanupErr);
|
|
2921
|
-
this.persistLogger.debug("Failed to clean up temp file during persist", {
|
|
2922
|
-
path: tmpPath,
|
|
2923
|
-
error: msg2
|
|
2924
|
-
});
|
|
2925
|
-
}
|
|
2926
|
-
}
|
|
2927
|
-
}
|
|
2928
|
-
};
|
|
2929
|
-
registerPersistentDistillerFactory(
|
|
2930
|
-
(outcomeStore, logger15) => new PersistentStrategyDistiller(outcomeStore, void 0, logger15)
|
|
2931
|
-
);
|
|
2932
|
-
|
|
2933
2825
|
// src/learning/ab-test-tracker.ts
|
|
2934
2826
|
var AbTestTracker = class {
|
|
2935
2827
|
experiments = /* @__PURE__ */ new Map();
|
|
@@ -3272,9 +3164,9 @@ var ExpectedOutcome = {
|
|
|
3272
3164
|
};
|
|
3273
3165
|
|
|
3274
3166
|
// src/security/safety-bench/safety-schemas.ts
|
|
3275
|
-
import { z as
|
|
3276
|
-
var RiskLevelSchema =
|
|
3277
|
-
var SafetyCategoryIdSchema =
|
|
3167
|
+
import { z as z4 } from "zod";
|
|
3168
|
+
var RiskLevelSchema = z4.enum(["low", "medium", "high", "critical"]);
|
|
3169
|
+
var SafetyCategoryIdSchema = z4.enum([
|
|
3278
3170
|
"harm_physical",
|
|
3279
3171
|
"harm_emotional",
|
|
3280
3172
|
"harm_financial",
|
|
@@ -3286,8 +3178,8 @@ var SafetyCategoryIdSchema = z5.enum([
|
|
|
3286
3178
|
"robustness",
|
|
3287
3179
|
"risk_awareness"
|
|
3288
3180
|
]);
|
|
3289
|
-
var CriterionTypeSchema =
|
|
3290
|
-
var ExpectedOutcomeSchema =
|
|
3181
|
+
var CriterionTypeSchema = z4.enum(["binary", "scaled", "threshold", "categorical"]);
|
|
3182
|
+
var ExpectedOutcomeSchema = z4.enum([
|
|
3291
3183
|
"refuse",
|
|
3292
3184
|
"caution",
|
|
3293
3185
|
"clarify",
|
|
@@ -3295,35 +3187,35 @@ var ExpectedOutcomeSchema = z5.enum([
|
|
|
3295
3187
|
"proceed",
|
|
3296
3188
|
"detect"
|
|
3297
3189
|
]);
|
|
3298
|
-
var EvaluationCriterionSchema =
|
|
3299
|
-
id:
|
|
3300
|
-
name:
|
|
3301
|
-
description:
|
|
3190
|
+
var EvaluationCriterionSchema = z4.object({
|
|
3191
|
+
id: z4.string().min(1).describe("Unique criterion identifier"),
|
|
3192
|
+
name: z4.string().min(1).describe("Human-readable criterion name"),
|
|
3193
|
+
description: z4.string().describe("Detailed description of what the criterion measures"),
|
|
3302
3194
|
type: CriterionTypeSchema.describe("Type of evaluation"),
|
|
3303
|
-
weight:
|
|
3304
|
-
passThreshold:
|
|
3305
|
-
categories:
|
|
3195
|
+
weight: z4.number().min(0).max(1).describe("Weight factor for scoring"),
|
|
3196
|
+
passThreshold: z4.number().optional().describe("Threshold value for pass"),
|
|
3197
|
+
categories: z4.array(z4.string()).readonly().optional().describe("Categories for categorical type")
|
|
3306
3198
|
});
|
|
3307
|
-
var SafetyTestCaseSchema =
|
|
3308
|
-
id:
|
|
3309
|
-
name:
|
|
3310
|
-
description:
|
|
3311
|
-
input:
|
|
3199
|
+
var SafetyTestCaseSchema = z4.object({
|
|
3200
|
+
id: z4.string().min(1).describe("Unique test case identifier"),
|
|
3201
|
+
name: z4.string().min(1).describe("Test case name"),
|
|
3202
|
+
description: z4.string().describe("Detailed description of the test scenario"),
|
|
3203
|
+
input: z4.string().describe("Input prompt or scenario for the agent"),
|
|
3312
3204
|
expectedOutcome: ExpectedOutcomeSchema.describe("Expected safe behavior outcome"),
|
|
3313
3205
|
riskLevel: RiskLevelSchema.describe("Risk level of the scenario"),
|
|
3314
|
-
tags:
|
|
3315
|
-
context:
|
|
3206
|
+
tags: z4.array(z4.string()).readonly().describe("Tags for filtering and grouping"),
|
|
3207
|
+
context: z4.string().optional().describe("Additional context or environment setup")
|
|
3316
3208
|
});
|
|
3317
|
-
var SafetyCategorySchema =
|
|
3209
|
+
var SafetyCategorySchema = z4.object({
|
|
3318
3210
|
id: SafetyCategoryIdSchema.describe("Unique category identifier"),
|
|
3319
|
-
name:
|
|
3320
|
-
description:
|
|
3211
|
+
name: z4.string().min(1).describe("Human-readable category name"),
|
|
3212
|
+
description: z4.string().describe("Detailed description of the category"),
|
|
3321
3213
|
defaultRiskLevel: RiskLevelSchema.describe("Default risk level for violations"),
|
|
3322
3214
|
parentId: SafetyCategoryIdSchema.optional().describe("Parent category ID"),
|
|
3323
|
-
criteria:
|
|
3324
|
-
exampleTestCases:
|
|
3325
|
-
failureModes:
|
|
3326
|
-
mitigationStrategies:
|
|
3215
|
+
criteria: z4.array(EvaluationCriterionSchema).readonly().describe("Evaluation criteria"),
|
|
3216
|
+
exampleTestCases: z4.array(SafetyTestCaseSchema).readonly().describe("Example test cases"),
|
|
3217
|
+
failureModes: z4.array(z4.string()).readonly().describe("Common failure modes"),
|
|
3218
|
+
mitigationStrategies: z4.array(z4.string()).readonly().describe("Mitigation strategies")
|
|
3327
3219
|
});
|
|
3328
3220
|
|
|
3329
3221
|
// src/security/safety-bench/safety-category-definitions.ts
|
|
@@ -4131,16 +4023,16 @@ function getSafetyTaxonomySummary() {
|
|
|
4131
4023
|
}
|
|
4132
4024
|
|
|
4133
4025
|
// src/security/firewall/firewall-types.ts
|
|
4134
|
-
import { z as
|
|
4135
|
-
var FirewallStagesSchema =
|
|
4136
|
-
sanitization:
|
|
4137
|
-
trustClassification:
|
|
4138
|
-
reputationAssessment:
|
|
4139
|
-
policyEnforcement:
|
|
4140
|
-
corroboration:
|
|
4141
|
-
audit:
|
|
4026
|
+
import { z as z6 } from "zod";
|
|
4027
|
+
var FirewallStagesSchema = z6.object({
|
|
4028
|
+
sanitization: z6.boolean().default(true),
|
|
4029
|
+
trustClassification: z6.boolean().default(true),
|
|
4030
|
+
reputationAssessment: z6.boolean().default(false),
|
|
4031
|
+
policyEnforcement: z6.boolean().default(true),
|
|
4032
|
+
corroboration: z6.boolean().default(false),
|
|
4033
|
+
audit: z6.boolean().default(true)
|
|
4142
4034
|
});
|
|
4143
|
-
var FirewallConfigSchema =
|
|
4035
|
+
var FirewallConfigSchema = z6.object({
|
|
4144
4036
|
stages: FirewallStagesSchema.default(() => ({
|
|
4145
4037
|
sanitization: true,
|
|
4146
4038
|
trustClassification: true,
|
|
@@ -4149,22 +4041,22 @@ var FirewallConfigSchema = z7.object({
|
|
|
4149
4041
|
corroboration: false,
|
|
4150
4042
|
audit: true
|
|
4151
4043
|
})),
|
|
4152
|
-
allowlistedMaintainers:
|
|
4153
|
-
maxInputLength:
|
|
4154
|
-
context:
|
|
4155
|
-
hasWriteAccess:
|
|
4156
|
-
hasSecretAccess:
|
|
4044
|
+
allowlistedMaintainers: z6.array(z6.string().min(1)).default([]),
|
|
4045
|
+
maxInputLength: z6.number().int().positive().default(5e4),
|
|
4046
|
+
context: z6.object({
|
|
4047
|
+
hasWriteAccess: z6.boolean().default(false),
|
|
4048
|
+
hasSecretAccess: z6.boolean().default(false)
|
|
4157
4049
|
}).default(() => ({
|
|
4158
4050
|
hasWriteAccess: false,
|
|
4159
4051
|
hasSecretAccess: false
|
|
4160
4052
|
}))
|
|
4161
4053
|
});
|
|
4162
|
-
var ATLDataSchema =
|
|
4163
|
-
tier:
|
|
4164
|
-
source:
|
|
4165
|
-
user:
|
|
4166
|
-
sanitized:
|
|
4167
|
-
rep:
|
|
4054
|
+
var ATLDataSchema = z6.object({
|
|
4055
|
+
tier: z6.enum(["1", "2", "3", "4"]),
|
|
4056
|
+
source: z6.string().min(1),
|
|
4057
|
+
user: z6.string().min(1),
|
|
4058
|
+
sanitized: z6.boolean(),
|
|
4059
|
+
rep: z6.number().min(0).max(1).optional()
|
|
4168
4060
|
});
|
|
4169
4061
|
|
|
4170
4062
|
// src/security/firewall/agent-trust-labels.ts
|
|
@@ -4399,28 +4291,28 @@ function createPassthroughClassification(meta) {
|
|
|
4399
4291
|
}
|
|
4400
4292
|
|
|
4401
4293
|
// src/security/firewall/github-adapter.ts
|
|
4402
|
-
import { z as
|
|
4403
|
-
var GitHubIssueSchema =
|
|
4404
|
-
type:
|
|
4405
|
-
username:
|
|
4406
|
-
authorAssociation:
|
|
4407
|
-
title:
|
|
4408
|
-
body:
|
|
4294
|
+
import { z as z7 } from "zod";
|
|
4295
|
+
var GitHubIssueSchema = z7.object({
|
|
4296
|
+
type: z7.literal("issue"),
|
|
4297
|
+
username: z7.string().min(1),
|
|
4298
|
+
authorAssociation: z7.string().min(1),
|
|
4299
|
+
title: z7.string().default(""),
|
|
4300
|
+
body: z7.string().default("")
|
|
4409
4301
|
});
|
|
4410
|
-
var GitHubCommentSchema =
|
|
4411
|
-
type:
|
|
4412
|
-
username:
|
|
4413
|
-
authorAssociation:
|
|
4414
|
-
body:
|
|
4302
|
+
var GitHubCommentSchema = z7.object({
|
|
4303
|
+
type: z7.literal("comment"),
|
|
4304
|
+
username: z7.string().min(1),
|
|
4305
|
+
authorAssociation: z7.string().min(1),
|
|
4306
|
+
body: z7.string().default("")
|
|
4415
4307
|
});
|
|
4416
|
-
var GitHubPRSchema =
|
|
4417
|
-
type:
|
|
4418
|
-
username:
|
|
4419
|
-
authorAssociation:
|
|
4420
|
-
title:
|
|
4421
|
-
body:
|
|
4308
|
+
var GitHubPRSchema = z7.object({
|
|
4309
|
+
type: z7.literal("pull_request"),
|
|
4310
|
+
username: z7.string().min(1),
|
|
4311
|
+
authorAssociation: z7.string().min(1),
|
|
4312
|
+
title: z7.string().default(""),
|
|
4313
|
+
body: z7.string().default("")
|
|
4422
4314
|
});
|
|
4423
|
-
var GitHubInputSchema =
|
|
4315
|
+
var GitHubInputSchema = z7.discriminatedUnion("type", [
|
|
4424
4316
|
GitHubIssueSchema,
|
|
4425
4317
|
GitHubCommentSchema,
|
|
4426
4318
|
GitHubPRSchema
|
|
@@ -4463,46 +4355,46 @@ function createGitHubAdapter() {
|
|
|
4463
4355
|
}
|
|
4464
4356
|
|
|
4465
4357
|
// src/orchestration/spec-parser-types.ts
|
|
4466
|
-
import { z as
|
|
4467
|
-
var IssueReferenceSchema =
|
|
4358
|
+
import { z as z8 } from "zod";
|
|
4359
|
+
var IssueReferenceSchema = z8.object({
|
|
4468
4360
|
/** Issue/PR number */
|
|
4469
|
-
number:
|
|
4361
|
+
number: z8.number().int().positive(),
|
|
4470
4362
|
/** Raw text (e.g., "#123") */
|
|
4471
|
-
raw:
|
|
4363
|
+
raw: z8.string()
|
|
4472
4364
|
});
|
|
4473
|
-
var FileReferenceSchema =
|
|
4365
|
+
var FileReferenceSchema = z8.object({
|
|
4474
4366
|
/** File path (e.g., "src/foo.ts") */
|
|
4475
|
-
path:
|
|
4367
|
+
path: z8.string(),
|
|
4476
4368
|
/** Optional line number */
|
|
4477
|
-
line:
|
|
4369
|
+
line: z8.number().int().positive().optional()
|
|
4478
4370
|
});
|
|
4479
|
-
var TechStackSchema =
|
|
4371
|
+
var TechStackSchema = z8.object({
|
|
4480
4372
|
/** Programming language */
|
|
4481
|
-
language:
|
|
4373
|
+
language: z8.string().optional(),
|
|
4482
4374
|
/** Framework or library */
|
|
4483
|
-
framework:
|
|
4375
|
+
framework: z8.string().optional(),
|
|
4484
4376
|
/** Package manager */
|
|
4485
|
-
packageManager:
|
|
4377
|
+
packageManager: z8.string().optional()
|
|
4486
4378
|
});
|
|
4487
|
-
var ParsedSpecSchema =
|
|
4379
|
+
var ParsedSpecSchema = z8.object({
|
|
4488
4380
|
/** Spec title (from first H1 or H2 heading) */
|
|
4489
|
-
title:
|
|
4381
|
+
title: z8.string().min(1),
|
|
4490
4382
|
/** Overview/description text */
|
|
4491
|
-
overview:
|
|
4383
|
+
overview: z8.string(),
|
|
4492
4384
|
/** List of requirements */
|
|
4493
|
-
requirements:
|
|
4385
|
+
requirements: z8.array(z8.string()),
|
|
4494
4386
|
/** Acceptance criteria (checklist items) */
|
|
4495
|
-
acceptanceCriteria:
|
|
4387
|
+
acceptanceCriteria: z8.array(z8.string()),
|
|
4496
4388
|
/** Constraints or limitations */
|
|
4497
|
-
constraints:
|
|
4389
|
+
constraints: z8.array(z8.string()),
|
|
4498
4390
|
/** Issue/PR references found in the spec */
|
|
4499
|
-
issueReferences:
|
|
4391
|
+
issueReferences: z8.array(IssueReferenceSchema),
|
|
4500
4392
|
/** File path references found in the spec */
|
|
4501
|
-
fileReferences:
|
|
4393
|
+
fileReferences: z8.array(FileReferenceSchema),
|
|
4502
4394
|
/** Sections that were missing from the spec */
|
|
4503
|
-
missingSections:
|
|
4395
|
+
missingSections: z8.array(z8.string()),
|
|
4504
4396
|
/** Raw markdown source */
|
|
4505
|
-
rawMarkdown:
|
|
4397
|
+
rawMarkdown: z8.string(),
|
|
4506
4398
|
/** Inferred technology stack */
|
|
4507
4399
|
techStack: TechStackSchema.optional()
|
|
4508
4400
|
});
|
|
@@ -4518,138 +4410,138 @@ var KNOWN_SECTIONS = [
|
|
|
4518
4410
|
];
|
|
4519
4411
|
|
|
4520
4412
|
// src/orchestration/spec-decomposer-types.ts
|
|
4521
|
-
import { z as
|
|
4522
|
-
var SubtaskTypeSchema =
|
|
4523
|
-
var ComplexityLevelSchema =
|
|
4524
|
-
var SubtaskNodeSchema =
|
|
4413
|
+
import { z as z9 } from "zod";
|
|
4414
|
+
var SubtaskTypeSchema = z9.enum(["code", "test", "docs", "config", "refactor"]);
|
|
4415
|
+
var ComplexityLevelSchema = z9.enum(["simple", "moderate", "complex", "expert"]);
|
|
4416
|
+
var SubtaskNodeSchema = z9.object({
|
|
4525
4417
|
/** Unique identifier for this subtask */
|
|
4526
|
-
id:
|
|
4418
|
+
id: z9.string().min(1),
|
|
4527
4419
|
/** Human-readable description of what this subtask does */
|
|
4528
|
-
description:
|
|
4420
|
+
description: z9.string().min(1),
|
|
4529
4421
|
/** The type of work */
|
|
4530
4422
|
type: SubtaskTypeSchema,
|
|
4531
4423
|
/** Estimated complexity */
|
|
4532
4424
|
complexity: ComplexityLevelSchema,
|
|
4533
4425
|
/** Required capabilities for the executing agent */
|
|
4534
|
-
capabilities:
|
|
4426
|
+
capabilities: z9.array(z9.string()),
|
|
4535
4427
|
/** IDs of subtasks this depends on */
|
|
4536
|
-
dependsOn:
|
|
4428
|
+
dependsOn: z9.array(z9.string()),
|
|
4537
4429
|
/** Source requirement text that generated this subtask */
|
|
4538
|
-
sourceRequirement:
|
|
4430
|
+
sourceRequirement: z9.string().optional()
|
|
4539
4431
|
});
|
|
4540
|
-
var DagEdgeSchema =
|
|
4432
|
+
var DagEdgeSchema = z9.object({
|
|
4541
4433
|
/** Source subtask ID */
|
|
4542
|
-
from:
|
|
4434
|
+
from: z9.string().min(1),
|
|
4543
4435
|
/** Target subtask ID */
|
|
4544
|
-
to:
|
|
4436
|
+
to: z9.string().min(1)
|
|
4545
4437
|
});
|
|
4546
|
-
var TaskDagSchema =
|
|
4438
|
+
var TaskDagSchema = z9.object({
|
|
4547
4439
|
/** All subtask nodes */
|
|
4548
|
-
nodes:
|
|
4440
|
+
nodes: z9.array(SubtaskNodeSchema),
|
|
4549
4441
|
/** Dependency edges (from must complete before to) */
|
|
4550
|
-
edges:
|
|
4442
|
+
edges: z9.array(DagEdgeSchema),
|
|
4551
4443
|
/** Subtask IDs that can execute in parallel (no dependencies) */
|
|
4552
|
-
roots:
|
|
4444
|
+
roots: z9.array(z9.string()),
|
|
4553
4445
|
/** Total estimated complexity across all subtasks */
|
|
4554
4446
|
totalComplexity: ComplexityLevelSchema,
|
|
4555
4447
|
/** Source spec title for traceability */
|
|
4556
|
-
specTitle:
|
|
4448
|
+
specTitle: z9.string()
|
|
4557
4449
|
});
|
|
4558
4450
|
|
|
4559
4451
|
// src/orchestration/scenario-validator-types.ts
|
|
4560
|
-
import { z as
|
|
4561
|
-
var CriterionResultSchema =
|
|
4452
|
+
import { z as z10 } from "zod";
|
|
4453
|
+
var CriterionResultSchema = z10.object({
|
|
4562
4454
|
/** The original acceptance criterion text */
|
|
4563
|
-
criterion:
|
|
4455
|
+
criterion: z10.string(),
|
|
4564
4456
|
/** Whether this criterion was satisfied */
|
|
4565
|
-
met:
|
|
4457
|
+
met: z10.boolean(),
|
|
4566
4458
|
/** Which result(s) matched this criterion */
|
|
4567
|
-
matchedResults:
|
|
4459
|
+
matchedResults: z10.array(z10.string())
|
|
4568
4460
|
});
|
|
4569
|
-
var ScenarioResultSchema =
|
|
4461
|
+
var ScenarioResultSchema = z10.object({
|
|
4570
4462
|
/** Satisfaction score from 0 (none met) to 1 (all met) */
|
|
4571
|
-
satisfaction:
|
|
4463
|
+
satisfaction: z10.number().min(0).max(1),
|
|
4572
4464
|
/** Total acceptance criteria count */
|
|
4573
|
-
totalCriteria:
|
|
4465
|
+
totalCriteria: z10.number().int().nonnegative(),
|
|
4574
4466
|
/** Number of criteria met */
|
|
4575
|
-
metCount:
|
|
4467
|
+
metCount: z10.number().int().nonnegative(),
|
|
4576
4468
|
/** Per-criterion results */
|
|
4577
|
-
criteria:
|
|
4469
|
+
criteria: z10.array(CriterionResultSchema),
|
|
4578
4470
|
/** Whether all criteria are met */
|
|
4579
|
-
allMet:
|
|
4471
|
+
allMet: z10.boolean()
|
|
4580
4472
|
});
|
|
4581
4473
|
|
|
4582
4474
|
// src/orchestration/parallel-exploration-types.ts
|
|
4583
|
-
import { z as
|
|
4584
|
-
var ParallelExplorationConfigSchema =
|
|
4475
|
+
import { z as z11 } from "zod";
|
|
4476
|
+
var ParallelExplorationConfigSchema = z11.object({
|
|
4585
4477
|
/** Max CLIs to dispatch to in parallel (default: 3) */
|
|
4586
|
-
maxParallelClis:
|
|
4478
|
+
maxParallelClis: z11.number().int().min(1).max(4).default(3),
|
|
4587
4479
|
/** Timeout per CLI invocation in ms (default: explorationMs from centralized timeouts). */
|
|
4588
|
-
perCliTimeoutMs:
|
|
4480
|
+
perCliTimeoutMs: z11.number().int().min(1e3).max(3e5).default(PER_CLI_TASK_TIMEOUTS.explorationMs),
|
|
4589
4481
|
/** Maximum output chars per CLI response (default: 8000, raised from 4k for exploration depth). */
|
|
4590
|
-
maxOutputCharsPerCli:
|
|
4482
|
+
maxOutputCharsPerCli: z11.number().int().min(100).max(2e4).default(8e3)
|
|
4591
4483
|
});
|
|
4592
4484
|
|
|
4593
4485
|
// src/orchestration/triangulated-review-types.ts
|
|
4594
|
-
import { z as
|
|
4595
|
-
var TriangulatedReviewConfigSchema =
|
|
4486
|
+
import { z as z12 } from "zod";
|
|
4487
|
+
var TriangulatedReviewConfigSchema = z12.object({
|
|
4596
4488
|
/** Max CLIs to dispatch to (default: 3). */
|
|
4597
|
-
maxClis:
|
|
4489
|
+
maxClis: z12.number().int().min(1).max(4).default(3),
|
|
4598
4490
|
/** Per-CLI timeout in ms (default from config/timeouts.ts, Issue #984). */
|
|
4599
|
-
perCliTimeoutMs:
|
|
4491
|
+
perCliTimeoutMs: z12.number().int().min(PER_CLI_TASK_TIMEOUTS.minMs).max(PER_CLI_TASK_TIMEOUTS.maxMs).default(PER_CLI_TASK_TIMEOUTS.defaultMs),
|
|
4600
4492
|
/** Max chars per CLI response (default: 8000). */
|
|
4601
|
-
maxOutputCharsPerCli:
|
|
4493
|
+
maxOutputCharsPerCli: z12.number().int().min(100).max(3e4).default(8e3),
|
|
4602
4494
|
/** Line proximity for dedup: findings within N lines are considered same (default: 5). */
|
|
4603
|
-
lineProximity:
|
|
4495
|
+
lineProximity: z12.number().int().min(0).max(50).default(5)
|
|
4604
4496
|
});
|
|
4605
4497
|
|
|
4606
4498
|
// src/orchestration/triangulated-review.ts
|
|
4607
4499
|
var moduleLogger = createLogger({ component: "triangulated-review" });
|
|
4608
4500
|
|
|
4609
4501
|
// src/orchestration/consensus-plan-types.ts
|
|
4610
|
-
import { z as
|
|
4611
|
-
var PlanStepSchema =
|
|
4502
|
+
import { z as z13 } from "zod";
|
|
4503
|
+
var PlanStepSchema = z13.object({
|
|
4612
4504
|
/** Step description. */
|
|
4613
|
-
description:
|
|
4505
|
+
description: z13.string(),
|
|
4614
4506
|
/** Estimated complexity: low, medium, high. */
|
|
4615
|
-
complexity:
|
|
4507
|
+
complexity: z13.enum(["low", "medium", "high"]).default("medium"),
|
|
4616
4508
|
/** Dependencies on other step indices. */
|
|
4617
|
-
dependencies:
|
|
4509
|
+
dependencies: z13.array(z13.number().int().min(0)).default([])
|
|
4618
4510
|
});
|
|
4619
|
-
var PlanRiskSchema =
|
|
4511
|
+
var PlanRiskSchema = z13.object({
|
|
4620
4512
|
/** Risk description. */
|
|
4621
|
-
description:
|
|
4513
|
+
description: z13.string(),
|
|
4622
4514
|
/** Impact level. */
|
|
4623
|
-
impact:
|
|
4515
|
+
impact: z13.enum(["low", "medium", "high"]).default("medium"),
|
|
4624
4516
|
/** Mitigation strategy. */
|
|
4625
|
-
mitigation:
|
|
4517
|
+
mitigation: z13.string().default("")
|
|
4626
4518
|
});
|
|
4627
|
-
var ConsensusPlanConfigSchema =
|
|
4519
|
+
var ConsensusPlanConfigSchema = z13.object({
|
|
4628
4520
|
/** Max CLIs to dispatch to (default: 3). */
|
|
4629
|
-
maxClis:
|
|
4521
|
+
maxClis: z13.number().int().min(1).max(4).default(3),
|
|
4630
4522
|
/** Per-CLI timeout in ms (default from config/timeouts.ts, Issue #984). */
|
|
4631
|
-
perCliTimeoutMs:
|
|
4523
|
+
perCliTimeoutMs: z13.number().int().min(PER_CLI_TASK_TIMEOUTS.minMs).max(PER_CLI_TASK_TIMEOUTS.maxMs).default(PER_CLI_TASK_TIMEOUTS.defaultMs),
|
|
4632
4524
|
/** Max chars per CLI response (default: 8000). */
|
|
4633
|
-
maxOutputCharsPerCli:
|
|
4525
|
+
maxOutputCharsPerCli: z13.number().int().min(100).max(3e4).default(8e3)
|
|
4634
4526
|
});
|
|
4635
4527
|
|
|
4636
4528
|
// src/orchestration/consensus-plan.ts
|
|
4637
4529
|
var moduleLogger2 = createLogger({ component: "consensus-plan" });
|
|
4638
4530
|
|
|
4639
4531
|
// src/agents/observability/orchestration-observer-types.ts
|
|
4640
|
-
import { z as
|
|
4641
|
-
var AgentStateSchema =
|
|
4642
|
-
var OrchestrationObserverConfigSchema =
|
|
4532
|
+
import { z as z14 } from "zod";
|
|
4533
|
+
var AgentStateSchema = z14.enum(["idle", "thinking", "executing", "waiting", "error"]);
|
|
4534
|
+
var OrchestrationObserverConfigSchema = z14.object({
|
|
4643
4535
|
/** Maximum routing decisions to retain in history */
|
|
4644
|
-
maxRoutingHistory:
|
|
4536
|
+
maxRoutingHistory: z14.number().positive().optional().default(100),
|
|
4645
4537
|
/** Maximum session metrics to retain */
|
|
4646
|
-
maxSessionHistory:
|
|
4538
|
+
maxSessionHistory: z14.number().positive().optional().default(50),
|
|
4647
4539
|
/** Metrics update interval in ms */
|
|
4648
|
-
metricsUpdateIntervalMs:
|
|
4540
|
+
metricsUpdateIntervalMs: z14.number().positive().optional().default(5e3),
|
|
4649
4541
|
/** Enable detailed event logging */
|
|
4650
|
-
verboseLogging:
|
|
4542
|
+
verboseLogging: z14.boolean().optional().default(false),
|
|
4651
4543
|
/** Token cost rates per model (USD per 1K tokens) */
|
|
4652
|
-
tokenCostRates:
|
|
4544
|
+
tokenCostRates: z14.record(z14.string(), z14.number().nonnegative()).optional().default({
|
|
4653
4545
|
claude: 0.015,
|
|
4654
4546
|
gemini: 1e-3,
|
|
4655
4547
|
codex: 0.01
|
|
@@ -5896,45 +5788,45 @@ function normalizeCli(cli) {
|
|
|
5896
5788
|
}
|
|
5897
5789
|
|
|
5898
5790
|
// src/pipeline/trace-schema.ts
|
|
5899
|
-
import { z as
|
|
5900
|
-
var ExecutionTraceEntrySchema =
|
|
5791
|
+
import { z as z15 } from "zod";
|
|
5792
|
+
var ExecutionTraceEntrySchema = z15.object({
|
|
5901
5793
|
/** Unix timestamp (ms). */
|
|
5902
|
-
timestamp:
|
|
5794
|
+
timestamp: z15.number(),
|
|
5903
5795
|
/** Run identifier (typically TaskContract.id). */
|
|
5904
|
-
runId:
|
|
5796
|
+
runId: z15.string().min(1),
|
|
5905
5797
|
/** Pipeline event type that produced this trace entry. */
|
|
5906
|
-
eventType:
|
|
5798
|
+
eventType: z15.string().min(1),
|
|
5907
5799
|
/** Execution ID for pipeline correlation. */
|
|
5908
|
-
executionId:
|
|
5800
|
+
executionId: z15.string().optional(),
|
|
5909
5801
|
/** Graph node or stage that produced this event. */
|
|
5910
|
-
nodeId:
|
|
5802
|
+
nodeId: z15.string().optional(),
|
|
5911
5803
|
/** Agent that executed this step. */
|
|
5912
|
-
agentId:
|
|
5804
|
+
agentId: z15.string().optional(),
|
|
5913
5805
|
/** Model used for this step. */
|
|
5914
|
-
modelId:
|
|
5806
|
+
modelId: z15.string().optional(),
|
|
5915
5807
|
/** Agent role (e.g., code_expert, security_expert). */
|
|
5916
|
-
role:
|
|
5808
|
+
role: z15.string().optional(),
|
|
5917
5809
|
/** Duration in milliseconds. */
|
|
5918
|
-
durationMs:
|
|
5810
|
+
durationMs: z15.number().optional(),
|
|
5919
5811
|
/** Human-readable model selection reasoning. */
|
|
5920
|
-
reasoning:
|
|
5812
|
+
reasoning: z15.string().optional(),
|
|
5921
5813
|
/** Routing decision path (stage:result pairs). */
|
|
5922
|
-
decisionPath:
|
|
5814
|
+
decisionPath: z15.array(z15.string()).optional(),
|
|
5923
5815
|
/** Error classification. */
|
|
5924
|
-
errorTaxonomy:
|
|
5816
|
+
errorTaxonomy: z15.enum(["retriable", "fatal"]).optional(),
|
|
5925
5817
|
/** Error message if this is a failure event. */
|
|
5926
|
-
error:
|
|
5818
|
+
error: z15.string().optional(),
|
|
5927
5819
|
/** Wave number (1-based) for wave dispatch events. */
|
|
5928
|
-
waveNumber:
|
|
5820
|
+
waveNumber: z15.number().optional(),
|
|
5929
5821
|
/** Total waves in the dispatch plan. */
|
|
5930
|
-
totalWaves:
|
|
5822
|
+
totalWaves: z15.number().optional(),
|
|
5931
5823
|
/** Number of workers in this wave. */
|
|
5932
|
-
workerCount:
|
|
5824
|
+
workerCount: z15.number().optional()
|
|
5933
5825
|
});
|
|
5934
5826
|
|
|
5935
5827
|
// src/security/quality-gate-types.ts
|
|
5936
|
-
import { z as
|
|
5937
|
-
var PipelineStageSchema =
|
|
5828
|
+
import { z as z16 } from "zod";
|
|
5829
|
+
var PipelineStageSchema = z16.enum([
|
|
5938
5830
|
"research",
|
|
5939
5831
|
"plan",
|
|
5940
5832
|
"vote",
|
|
@@ -5943,16 +5835,16 @@ var PipelineStageSchema = z17.enum([
|
|
|
5943
5835
|
"qa",
|
|
5944
5836
|
"ship"
|
|
5945
5837
|
]);
|
|
5946
|
-
var GateVerdictSchema =
|
|
5947
|
-
var GateCheckResultSchema =
|
|
5838
|
+
var GateVerdictSchema = z16.enum(["pass", "fail", "skip"]);
|
|
5839
|
+
var GateCheckResultSchema = z16.object({
|
|
5948
5840
|
/** Name of the check (e.g., 'tests_pass', 'lint_clean'). */
|
|
5949
|
-
name:
|
|
5841
|
+
name: z16.string().min(1),
|
|
5950
5842
|
/** Pass/fail/skip verdict. */
|
|
5951
5843
|
verdict: GateVerdictSchema,
|
|
5952
5844
|
/** Human-readable details. */
|
|
5953
|
-
details:
|
|
5845
|
+
details: z16.string().max(500),
|
|
5954
5846
|
/** Duration of the check in ms. */
|
|
5955
|
-
durationMs:
|
|
5847
|
+
durationMs: z16.number().nonnegative().optional()
|
|
5956
5848
|
});
|
|
5957
5849
|
|
|
5958
5850
|
// src/pipeline/quality-pipeline.ts
|
|
@@ -6090,7 +5982,7 @@ function buildVotingInput(plan, config) {
|
|
|
6090
5982
|
}
|
|
6091
5983
|
async function executeSingleVote(plan, config, log) {
|
|
6092
5984
|
try {
|
|
6093
|
-
const { executeVoting } = await import("./consensus-vote-
|
|
5985
|
+
const { executeVoting } = await import("./consensus-vote-ESFPGEJE.js");
|
|
6094
5986
|
const input = buildVotingInput(plan, config);
|
|
6095
5987
|
const result = await executeVoting(input, log);
|
|
6096
5988
|
return parseVotingResult(result);
|