0xray 3.1.1 → 3.3.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/.opencode/codex.codex +1 -1
- package/.opencode/commands/auto-format.md +3 -3
- package/.opencode/commands/auto-summary-capture.md +2 -2
- package/.opencode/commands/enforcer-daily-scan.md +3 -3
- package/.opencode/commands/framework-compliance-audit.md +4 -4
- package/.opencode/commands/interactive-validator.md +2 -2
- package/.opencode/commands/job-summary-logger.md +2 -2
- package/.opencode/commands/mode-switch.md +1 -1
- package/.opencode/commands/model-health-check.md +2 -2
- package/.opencode/commands/performance-analysis.md +2 -2
- package/.opencode/commands/pre-commit-introspection.md +3 -3
- package/.opencode/commands/security-scan.md +3 -3
- package/.opencode/commands/sisyphus-validation.md +3 -3
- package/.opencode/commands/summary-logger.md +2 -2
- package/AGENTS.md +3 -13
- package/README.md +3 -3
- package/dist/AGENTS.md +3 -13
- package/dist/CHANGELOG.md +55 -0
- package/dist/README.md +3 -3
- package/dist/analytics/consent-manager.js +0 -1
- package/dist/analytics/emerging-pattern-detector.js +0 -1
- package/dist/analytics/pattern-learning-engine.js +0 -1
- package/dist/analytics/pattern-performance-tracker.js +0 -1
- package/dist/analytics/predictive-analytics.js +0 -1
- package/dist/analytics/prompt-pattern-analyzer.js +0 -1
- package/dist/analytics/routing-performance-analyzer.js +0 -1
- package/dist/analytics/routing-refiner.js +0 -1
- package/dist/analytics/simple-pattern-analyzer.js +0 -1
- package/dist/cli/commands/archive-logs.js +0 -1
- package/dist/cli/commands/opencode-install.js +13 -0
- package/dist/cli/commands/plugin-commands.js +0 -1
- package/dist/cli/commands/status.js +11 -13
- package/dist/cli/index.js +2 -7
- package/dist/core/activity-logger.js +0 -1
- package/dist/core/adaptive-kernel.js +0 -1
- package/dist/core/boot-orchestrator.js +2 -12
- package/dist/core/bridge.mjs +0 -1
- package/dist/core/codex-formatter.js +0 -1
- package/dist/core/codex-injector.js +0 -1
- package/dist/core/config-loader.js +36 -28
- package/dist/core/context-loader.js +0 -1
- package/dist/core/context-validator.js +0 -1
- package/dist/core/features-config.js +40 -1
- package/dist/core/kernel-patterns.js +0 -1
- package/dist/core/model-router.js +23 -64
- package/dist/core/system-prompt-generator.js +0 -1
- package/dist/delegation/agent-delegator.js +0 -1
- package/dist/delegation/agent-expertise.js +0 -1
- package/dist/delegation/analytics/index.js +0 -1
- package/dist/delegation/analytics/learning-engine.js +0 -1
- package/dist/delegation/analytics/outcome-tracker.js +0 -1
- package/dist/delegation/analytics/routing-analytics.js +0 -1
- package/dist/delegation/ast-code-parser.js +0 -1
- package/dist/delegation/complexity-analyzer.js +0 -1
- package/dist/delegation/dependency-graph-builder.js +0 -1
- package/dist/delegation/index.js +0 -1
- package/dist/delegation/metrics-aggregator.js +0 -1
- package/dist/delegation/session-coordinator.js +0 -1
- package/dist/delegation/strategy-selector.js +0 -1
- package/dist/delegation/voting-coordinator.js +0 -1
- package/dist/delegation/voting-types.js +0 -1
- package/dist/delegation/weighted-voting-aggregator.js +0 -1
- package/dist/enforcement/core/index.js +0 -1
- package/dist/enforcement/core/rule-executor.js +0 -1
- package/dist/enforcement/core/rule-hierarchy.js +0 -1
- package/dist/enforcement/core/rule-registry.js +0 -1
- package/dist/enforcement/core/violation-fixer.js +0 -1
- package/dist/enforcement/index.js +0 -1
- package/dist/enforcement/loaders/agent-triage-loader.js +0 -1
- package/dist/enforcement/loaders/agents-md-validation-loader.js +0 -1
- package/dist/enforcement/loaders/base-loader.js +0 -1
- package/dist/enforcement/loaders/codex-loader.js +0 -1
- package/dist/enforcement/loaders/index.js +0 -1
- package/dist/enforcement/loaders/loader-orchestrator.js +0 -1
- package/dist/enforcement/loaders/processor-loader.js +0 -1
- package/dist/enforcement/types.js +0 -1
- package/dist/enforcement/validators/architecture-validators.js +0 -1
- package/dist/enforcement/validators/base-validator.js +0 -1
- package/dist/enforcement/validators/code-quality-validators.js +0 -1
- package/dist/enforcement/validators/index.js +0 -1
- package/dist/enforcement/validators/security-validators.js +0 -1
- package/dist/enforcement/validators/testing-validators.js +0 -1
- package/dist/enforcement/validators/validator-registry.js +0 -1
- package/dist/governance/codex-policy.service.js +0 -1
- package/dist/inference/inference-agent-invoker.js +67 -0
- package/dist/inference/inference-applier.js +178 -0
- package/dist/inference/inference-cycle.js +51 -827
- package/dist/inference/inference-proposal-generator.js +149 -0
- package/dist/infrastructure/iac-validator.js +465 -0
- package/dist/infrastructure/schemas/cloud-schemas.js +488 -0
- package/dist/integrations/base/ExampleIntegration.js +0 -1
- package/dist/integrations/base/Integration.js +0 -1
- package/dist/integrations/base/index.js +0 -1
- package/dist/integrations/base/registry.js +0 -1
- package/dist/integrations/base/types.js +0 -1
- package/dist/integrations/enforcement-gate.js +3 -3
- package/dist/integrations/governance/governance-client.js +0 -1
- package/dist/integrations/governance/index.js +11 -19
- package/dist/integrations/governance/types.js +0 -1
- package/dist/integrations/hermes-agent/__init__.py +4 -0
- package/dist/integrations/hermes-agent/bridge.mjs +37 -0
- package/dist/integrations/openclaw/api-server.js +0 -1
- package/dist/integrations/openclaw/client.js +0 -1
- package/dist/integrations/openclaw/config.js +0 -1
- package/dist/integrations/openclaw/hooks/xray-hooks.js +0 -1
- package/dist/integrations/openclaw/index.js +0 -1
- package/dist/integrations/openclaw/types.js +0 -1
- package/dist/integrations/plugins/index.js +0 -1
- package/dist/integrations/plugins/plugin-integration.js +0 -1
- package/dist/integrations/plugins/plugin-registry.js +0 -1
- package/dist/mcps/agent-resolver.js +0 -1
- package/dist/mcps/architect-tools.server.js +119 -185
- package/dist/mcps/auto-format.server.js +56 -74
- package/dist/mcps/boot-orchestrator.server.js +67 -85
- package/dist/mcps/config/config-loader.js +6 -0
- package/dist/mcps/config/plugin-server-registry.js +0 -1
- package/dist/mcps/enforcer-tools.server.js +207 -273
- package/dist/mcps/estimation.server.js +63 -107
- package/dist/mcps/framework-compliance-audit.server.js +52 -81
- package/dist/mcps/framework-help.server.js +71 -89
- package/dist/mcps/governance.server.js +97 -149
- package/dist/mcps/knowledge-skills/api-design.server.js +33 -65
- package/dist/mcps/knowledge-skills/architecture-patterns.server.js +33 -65
- package/dist/mcps/knowledge-skills/bug-triage-specialist.server.js +123 -163
- package/dist/mcps/knowledge-skills/code-analyzer.server.js +210 -237
- package/dist/mcps/knowledge-skills/code-review.server.js +108 -142
- package/dist/mcps/knowledge-skills/content-creator.server.js +203 -225
- package/dist/mcps/knowledge-skills/database-design.server.js +116 -150
- package/dist/mcps/knowledge-skills/devops-deployment.server.js +123 -157
- package/dist/mcps/knowledge-skills/git-workflow.server.js +34 -67
- package/dist/mcps/knowledge-skills/growth-strategist.server.js +301 -323
- package/dist/mcps/knowledge-skills/log-monitor.server.js +139 -159
- package/dist/mcps/knowledge-skills/mobile-development.server.js +170 -200
- package/dist/mcps/knowledge-skills/multimodal-looker.server.js +122 -158
- package/dist/mcps/knowledge-skills/performance-optimization.server.js +88 -138
- package/dist/mcps/knowledge-skills/project-analysis.server.js +131 -218
- package/dist/mcps/knowledge-skills/refactoring-strategies.server.js +115 -150
- package/dist/mcps/knowledge-skills/security-audit.server.js +16 -143
- package/dist/mcps/knowledge-skills/seo-consultant.server.js +20 -213
- package/dist/mcps/knowledge-skills/session-management.server.js +13 -90
- package/dist/mcps/knowledge-skills/skill-invocation.server.js +43 -421
- package/dist/mcps/knowledge-skills/strategist.server.js +10 -55
- package/dist/mcps/knowledge-skills/tech-writer.server.js +16 -191
- package/dist/mcps/knowledge-skills/testing-best-practices.server.js +18 -191
- package/dist/mcps/knowledge-skills/testing-strategy.server.js +18 -156
- package/dist/mcps/knowledge-skills/ui-ux-design.server.js +22 -296
- package/dist/mcps/lint.server.js +50 -91
- package/dist/mcps/model-health-check.server.js +32 -60
- package/dist/mcps/orchestrator/aside-context.js +207 -0
- package/dist/mcps/orchestrator/config/agent-capabilities.js +30 -11
- package/dist/mcps/orchestrator/config/memory-routing-bridge.js +70 -0
- package/dist/mcps/orchestrator/execution/execution-planner.js +25 -7
- package/dist/mcps/orchestrator/handlers/complexity-handler.js +5 -1
- package/dist/mcps/orchestrator/handlers/status-handler.js +8 -1
- package/dist/mcps/orchestrator/handlers/task-handler.js +59 -1
- package/dist/mcps/orchestrator/index.js +5 -0
- package/dist/mcps/orchestrator/server.js +63 -8
- package/dist/mcps/performance-analysis.server.js +56 -87
- package/dist/mcps/processor-pipeline.server.js +68 -99
- package/dist/mcps/researcher.server.js +80 -153
- package/dist/mcps/security-scan.server.js +56 -70
- package/dist/mcps/shared/knowledge-skill-base.js +11 -4
- package/dist/mcps/state-manager.server.js +124 -152
- package/dist/memory-routing/index.js +4 -0
- package/dist/memory-routing/null-provider.js +51 -0
- package/dist/memory-routing/provider-loader.js +91 -0
- package/dist/memory-routing/provider-registry.js +40 -0
- package/dist/memory-routing/types.js +7 -0
- package/dist/memory-routing/validate-config.js +32 -0
- package/dist/monitoring/nudge-watchdog.js +0 -1
- package/dist/nucleus/default-plugins.js +13 -19
- package/dist/nucleus/index.js +0 -1
- package/dist/nucleus/thin-dispatch.js +29 -1
- package/dist/orchestrator/agent-spawn-governor.js +0 -1
- package/dist/orchestrator/intelligent-commit-batcher.js +2 -10
- package/dist/orchestrator/multi-agent-orchestration-coordinator.js +0 -1
- package/dist/orchestrator/orchestrator.js +8 -18
- package/dist/orchestrator/self-direction-activation.js +0 -1
- package/dist/orchestrator/universal-registry-bridge.js +0 -1
- package/dist/performance/performance-budget-enforcer.js +0 -1
- package/dist/performance/performance-regression-tester.js +0 -1
- package/dist/plugin/plugin-codex-context.js +87 -0
- package/dist/plugin/plugin-helpers.js +155 -0
- package/dist/plugin/plugin-logger.js +46 -0
- package/dist/plugin/plugin-modules.js +144 -0
- package/dist/plugin/plugin-quality-gate.js +88 -0
- package/dist/plugin/plugin-types.js +1 -0
- package/dist/plugin/xray-codex-injection.js +338 -0
- package/dist/postprocessor/PostProcessor.js +3 -9
- package/dist/postprocessor/analysis/CodeChangeAnalyzer.js +50 -0
- package/dist/postprocessor/config/ProcessorConfigLoader.js +16 -0
- package/dist/postprocessor/integration.js +194 -0
- package/dist/postprocessor/metamorphosis/SelfProposalEngine.js +472 -0
- package/dist/postprocessor/metamorphosis/index.js +1 -0
- package/dist/postprocessor/redeploy/RetryHandler.js +118 -0
- package/dist/postprocessor/services/RegressionAnalysisService.js +0 -1
- package/dist/postprocessor/triggers/APITrigger.js +0 -1
- package/dist/postprocessor/triggers/WebhookTrigger.js +0 -1
- package/dist/processors/implementations/agents-md-validation-processor.js +0 -1
- package/dist/processors/implementations/async-pattern-processor.js +0 -1
- package/dist/processors/implementations/console-log-guard-processor.js +0 -1
- package/dist/processors/implementations/coverage-analysis-processor.js +0 -1
- package/dist/processors/implementations/inference-improvement-processor.js +2 -9
- package/dist/processors/implementations/log-protection-processor.js +0 -1
- package/dist/processors/implementations/nudge-processor.js +0 -1
- package/dist/processors/implementations/performance-budget-processor.js +0 -1
- package/dist/processors/implementations/postprocessor-chain-validator.js +0 -1
- package/dist/processors/implementations/publish-preflight-processor.js +4 -12
- package/dist/processors/implementations/session-summary-processor.js +8 -16
- package/dist/processors/implementations/spawn-governance-processor.js +0 -1
- package/dist/processors/implementations/storytelling-trigger-processor.js +3 -28
- package/dist/processors/implementations/test-auto-creation-processor.js +0 -1
- package/dist/processors/implementations/typescript-compilation-processor.js +0 -1
- package/dist/processors/implementations/version-compliance-processor.js +0 -1
- package/dist/processors/processor-interfaces.js +0 -1
- package/dist/processors/processor-types.js +0 -1
- package/dist/scripts/integration.js +0 -1
- package/dist/security/comprehensive-security-audit.js +0 -1
- package/dist/security/security-agent-coordinator.js +0 -1
- package/dist/security/security-auditor.js +0 -1
- package/dist/security/security-hardener.js +0 -1
- package/dist/security/security-hardening-system.js +0 -1
- package/dist/security/security-headers.js +0 -1
- package/dist/security/security-orchestration-layer.js +0 -1
- package/dist/services/inference-tuner.js +0 -1
- package/dist/session/session-cleanup-manager.js +0 -1
- package/dist/session/session-monitor.js +0 -1
- package/dist/session/session-state-manager.js +0 -1
- package/dist/skills/xray-orchestrator/index.js +0 -1
- package/dist/utils/codex-parser.js +0 -1
- package/dist/utils/language-detector.js +0 -1
- package/dist/utils/shutdown-handler.js +0 -1
- package/dist/validation/agent-config-validator.js +280 -0
- package/dist/validation/orchestration-flow-validator.js +606 -0
- package/package.json +1 -1
- package/scripts/node/release.mjs +2 -2
- package/scripts/node/setup.cjs +28 -0
- package/scripts/node/universal-version-manager.js +1 -1
- package/src/mcps/agent-resolver.ts +0 -1
- package/src/mcps/architect-tools.server.ts +129 -211
- package/src/mcps/auto-format.server.ts +74 -103
- package/src/mcps/boot-orchestrator.server.ts +71 -96
- package/src/mcps/config/__tests__/config-loader.test.ts +6 -6
- package/src/mcps/config/config-loader.ts +7 -0
- package/src/mcps/config/plugin-server-registry.ts +0 -1
- package/src/mcps/enforcer-tools.server.ts +217 -294
- package/src/mcps/estimation.server.ts +62 -122
- package/src/mcps/framework-compliance-audit.server.ts +53 -95
- package/src/mcps/framework-help.server.ts +74 -96
- package/src/mcps/governance.server.ts +97 -162
- package/src/mcps/knowledge-skills/api-design.server.ts +33 -72
- package/src/mcps/knowledge-skills/architecture-patterns.server.ts +33 -72
- package/src/mcps/knowledge-skills/bug-triage-specialist.server.ts +148 -193
- package/src/mcps/knowledge-skills/code-analyzer.server.ts +222 -254
- package/src/mcps/knowledge-skills/code-review.server.ts +115 -157
- package/src/mcps/knowledge-skills/content-creator.server.ts +219 -246
- package/src/mcps/knowledge-skills/database-design.server.ts +119 -160
- package/src/mcps/knowledge-skills/devops-deployment.server.ts +126 -167
- package/src/mcps/knowledge-skills/git-workflow.server.ts +32 -77
- package/src/mcps/knowledge-skills/growth-strategist.server.ts +322 -360
- package/src/mcps/knowledge-skills/log-monitor.server.ts +68 -95
- package/src/mcps/knowledge-skills/mobile-development.server.ts +16 -56
- package/src/mcps/knowledge-skills/multimodal-looker.server.ts +13 -59
- package/src/mcps/knowledge-skills/performance-optimization.server.ts +13 -74
- package/src/mcps/knowledge-skills/project-analysis.server.ts +13 -120
- package/src/mcps/knowledge-skills/refactoring-strategies.server.ts +13 -60
- package/src/mcps/knowledge-skills/security-audit.server.ts +19 -157
- package/src/mcps/knowledge-skills/seo-consultant.server.ts +23 -227
- package/src/mcps/knowledge-skills/session-management.server.ts +17 -106
- package/src/mcps/knowledge-skills/skill-invocation.server.ts +45 -446
- package/src/mcps/knowledge-skills/strategist.server.ts +13 -63
- package/src/mcps/knowledge-skills/tech-writer.server.ts +19 -204
- package/src/mcps/knowledge-skills/testing-best-practices.server.ts +21 -204
- package/src/mcps/knowledge-skills/testing-strategy.server.ts +21 -165
- package/src/mcps/knowledge-skills/ui-ux-design.server.ts +25 -342
- package/src/mcps/lint.server.ts +52 -105
- package/src/mcps/model-health-check.server.ts +34 -70
- package/src/mcps/orchestrator/aside-context.ts +245 -0
- package/src/mcps/orchestrator/config/agent-capabilities.ts +49 -14
- package/src/mcps/orchestrator/config/memory-routing-bridge.ts +80 -0
- package/src/mcps/orchestrator/execution/execution-planner.ts +36 -9
- package/src/mcps/orchestrator/handlers/complexity-handler.ts +9 -3
- package/src/mcps/orchestrator/handlers/status-handler.ts +11 -1
- package/src/mcps/orchestrator/handlers/task-handler.ts +78 -2
- package/src/mcps/orchestrator/index.ts +29 -0
- package/src/mcps/orchestrator/server.ts +79 -24
- package/src/mcps/orchestrator/types.ts +50 -0
- package/src/mcps/performance-analysis.server.ts +59 -102
- package/src/mcps/processor-pipeline.server.ts +70 -108
- package/src/mcps/researcher.server.ts +87 -175
- package/src/mcps/security-scan.server.ts +57 -76
- package/src/mcps/shared/knowledge-skill-base.ts +12 -4
- package/src/mcps/state-manager.server.ts +129 -169
- package/src/opencode/codex.codex +1 -1
- package/src/opencode/commands/auto-format.md +3 -3
- package/src/opencode/commands/auto-summary-capture.md +2 -2
- package/src/opencode/commands/enforcer-daily-scan.md +3 -3
- package/src/opencode/commands/framework-compliance-audit.md +4 -4
- package/src/opencode/commands/interactive-validator.md +2 -2
- package/src/opencode/commands/job-summary-logger.md +2 -2
- package/src/opencode/commands/mode-switch.md +1 -1
- package/src/opencode/commands/model-health-check.md +2 -2
- package/src/opencode/commands/performance-analysis.md +2 -2
- package/src/opencode/commands/pre-commit-introspection.md +3 -3
- package/src/opencode/commands/security-scan.md +3 -3
- package/src/opencode/commands/sisyphus-validation.md +3 -3
- package/src/opencode/commands/summary-logger.md +2 -2
- package/src/skills/xray-orchestrator/index.ts +0 -1
- package/dist/nucleus/orchestrator.js +0 -479
|
@@ -0,0 +1,488 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cloud Infrastructure Schemas
|
|
3
|
+
*
|
|
4
|
+
* Schema definitions for cloud provider configurations, ensuring
|
|
5
|
+
* enterprise-grade validation and compliance with Universal Development Codex v1.2.0.
|
|
6
|
+
*
|
|
7
|
+
* @since 2026-01-08
|
|
8
|
+
*/
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
// ============================================================================
|
|
11
|
+
// AWS Schemas
|
|
12
|
+
// ============================================================================
|
|
13
|
+
export const AWSCredentialsSchema = z.object({
|
|
14
|
+
accessKeyId: z.string(),
|
|
15
|
+
secretAccessKey: z.string(),
|
|
16
|
+
sessionToken: z.string().optional(),
|
|
17
|
+
region: z.string().default("us-east-1"),
|
|
18
|
+
});
|
|
19
|
+
export const AWSVPCConfigSchema = z.object({
|
|
20
|
+
vpcId: z.string().optional(),
|
|
21
|
+
subnetIds: z.array(z.string()).optional(),
|
|
22
|
+
securityGroupIds: z.array(z.string()).optional(),
|
|
23
|
+
createVpc: z.boolean().default(false),
|
|
24
|
+
cidrBlock: z.string().default("10.0.0.0/16"),
|
|
25
|
+
availabilityZones: z.array(z.string()).optional(),
|
|
26
|
+
});
|
|
27
|
+
export const AWSLoadBalancerConfigSchema = z.object({
|
|
28
|
+
name: z.string(),
|
|
29
|
+
type: z.enum(["application", "network", "gateway"]).default("application"),
|
|
30
|
+
scheme: z.enum(["internet-facing", "internal"]).default("internet-facing"),
|
|
31
|
+
securityGroups: z.array(z.string()).optional(),
|
|
32
|
+
subnets: z.array(z.string()).optional(),
|
|
33
|
+
enableDeletionProtection: z.boolean().default(true),
|
|
34
|
+
idleTimeout: z.number().min(1).max(4000).default(60),
|
|
35
|
+
// Rate limiting configuration
|
|
36
|
+
rateLimit: z
|
|
37
|
+
.object({
|
|
38
|
+
enabled: z.boolean().default(true),
|
|
39
|
+
requestsPerSecond: z.number().min(1).max(100000).default(1000),
|
|
40
|
+
burstLimit: z.number().min(1).max(100000).default(2000),
|
|
41
|
+
byIp: z.boolean().default(true),
|
|
42
|
+
byHeader: z
|
|
43
|
+
.object({
|
|
44
|
+
enabled: z.boolean().default(false),
|
|
45
|
+
headerName: z.string().optional(),
|
|
46
|
+
headerValues: z.array(z.string()).optional(),
|
|
47
|
+
})
|
|
48
|
+
.optional(),
|
|
49
|
+
customRules: z
|
|
50
|
+
.array(z.object({
|
|
51
|
+
name: z.string(),
|
|
52
|
+
priority: z.number(),
|
|
53
|
+
action: z.enum(["allow", "deny", "count"]),
|
|
54
|
+
conditions: z.array(z.object({
|
|
55
|
+
type: z.enum([
|
|
56
|
+
"httpMethod",
|
|
57
|
+
"path",
|
|
58
|
+
"header",
|
|
59
|
+
"queryString",
|
|
60
|
+
"sourceIp",
|
|
61
|
+
]),
|
|
62
|
+
values: z.array(z.string()),
|
|
63
|
+
})),
|
|
64
|
+
}))
|
|
65
|
+
.optional(),
|
|
66
|
+
})
|
|
67
|
+
.optional(),
|
|
68
|
+
});
|
|
69
|
+
export const AWSAPIGatewayConfigSchema = z.object({
|
|
70
|
+
name: z.string(),
|
|
71
|
+
description: z.string().optional(),
|
|
72
|
+
protocolType: z.enum(["HTTP", "WEBSOCKET"]).default("HTTP"),
|
|
73
|
+
corsConfiguration: z
|
|
74
|
+
.object({
|
|
75
|
+
allowCredentials: z.boolean().optional(),
|
|
76
|
+
allowHeaders: z.array(z.string()).optional(),
|
|
77
|
+
allowMethods: z.array(z.string()).optional(),
|
|
78
|
+
allowOrigins: z.array(z.string()).optional(),
|
|
79
|
+
exposeHeaders: z.array(z.string()).optional(),
|
|
80
|
+
maxAge: z.number().optional(),
|
|
81
|
+
})
|
|
82
|
+
.optional(),
|
|
83
|
+
// Rate limiting for API Gateway
|
|
84
|
+
throttling: z
|
|
85
|
+
.object({
|
|
86
|
+
burstLimit: z.number().min(1).max(10000).default(5000),
|
|
87
|
+
rateLimit: z.number().min(0.05).max(10000).default(10000),
|
|
88
|
+
})
|
|
89
|
+
.optional(),
|
|
90
|
+
// Usage plans for rate limiting
|
|
91
|
+
usagePlans: z
|
|
92
|
+
.array(z.object({
|
|
93
|
+
name: z.string(),
|
|
94
|
+
description: z.string().optional(),
|
|
95
|
+
throttle: z.object({
|
|
96
|
+
burstLimit: z.number().min(1).max(10000),
|
|
97
|
+
rateLimit: z.number().min(0.05).max(10000),
|
|
98
|
+
}),
|
|
99
|
+
quota: z
|
|
100
|
+
.object({
|
|
101
|
+
limit: z.number().min(1),
|
|
102
|
+
offset: z.number().optional(),
|
|
103
|
+
period: z.enum(["DAY", "WEEK", "MONTH"]),
|
|
104
|
+
})
|
|
105
|
+
.optional(),
|
|
106
|
+
apiStages: z
|
|
107
|
+
.array(z.object({
|
|
108
|
+
apiId: z.string(),
|
|
109
|
+
stage: z.string(),
|
|
110
|
+
throttle: z
|
|
111
|
+
.record(z.string(), z.object({
|
|
112
|
+
burstLimit: z.number(),
|
|
113
|
+
rateLimit: z.number(),
|
|
114
|
+
}))
|
|
115
|
+
.optional(),
|
|
116
|
+
}))
|
|
117
|
+
.optional(),
|
|
118
|
+
}))
|
|
119
|
+
.optional(),
|
|
120
|
+
});
|
|
121
|
+
export const AWSCloudFormationTemplateSchema = z.object({
|
|
122
|
+
AWSTemplateFormatVersion: z.string().optional(),
|
|
123
|
+
Description: z.string().optional(),
|
|
124
|
+
Metadata: z.record(z.string(), z.any()).optional(),
|
|
125
|
+
Parameters: z
|
|
126
|
+
.record(z.string(), z.object({
|
|
127
|
+
Type: z.string(),
|
|
128
|
+
Default: z.any().optional(),
|
|
129
|
+
AllowedValues: z.array(z.any()).optional(),
|
|
130
|
+
AllowedPattern: z.string().optional(),
|
|
131
|
+
ConstraintDescription: z.string().optional(),
|
|
132
|
+
Description: z.string().optional(),
|
|
133
|
+
MaxLength: z.number().optional(),
|
|
134
|
+
MinLength: z.number().optional(),
|
|
135
|
+
MaxValue: z.number().optional(),
|
|
136
|
+
MinValue: z.number().optional(),
|
|
137
|
+
NoEcho: z.boolean().optional(),
|
|
138
|
+
}))
|
|
139
|
+
.optional(),
|
|
140
|
+
Mappings: z
|
|
141
|
+
.record(z.string(), z.record(z.string(), z.record(z.string(), z.any())))
|
|
142
|
+
.optional(),
|
|
143
|
+
Conditions: z.record(z.string(), z.any()).optional(),
|
|
144
|
+
Transform: z.union([z.string(), z.array(z.string())]).optional(),
|
|
145
|
+
Resources: z.record(z.string(), z.object({
|
|
146
|
+
Type: z.string(),
|
|
147
|
+
Properties: z.record(z.string(), z.any()).optional(),
|
|
148
|
+
DependsOn: z.union([z.string(), z.array(z.string())]).optional(),
|
|
149
|
+
Metadata: z.record(z.string(), z.any()).optional(),
|
|
150
|
+
DeletionPolicy: z.enum(["Delete", "Retain", "Snapshot"]).optional(),
|
|
151
|
+
UpdateReplacePolicy: z.enum(["Delete", "Retain", "Snapshot"]).optional(),
|
|
152
|
+
Condition: z.string().optional(),
|
|
153
|
+
})),
|
|
154
|
+
Outputs: z
|
|
155
|
+
.record(z.string(), z.object({
|
|
156
|
+
Description: z.string().optional(),
|
|
157
|
+
Value: z.any(),
|
|
158
|
+
Export: z
|
|
159
|
+
.object({
|
|
160
|
+
Name: z.string(),
|
|
161
|
+
})
|
|
162
|
+
.optional(),
|
|
163
|
+
Condition: z.string().optional(),
|
|
164
|
+
}))
|
|
165
|
+
.optional(),
|
|
166
|
+
});
|
|
167
|
+
// ============================================================================
|
|
168
|
+
// Azure Schemas
|
|
169
|
+
// ============================================================================
|
|
170
|
+
export const AzureCredentialsSchema = z.object({
|
|
171
|
+
clientId: z.string(),
|
|
172
|
+
clientSecret: z.string(),
|
|
173
|
+
tenantId: z.string(),
|
|
174
|
+
subscriptionId: z.string(),
|
|
175
|
+
});
|
|
176
|
+
export const AzureLoadBalancerConfigSchema = z.object({
|
|
177
|
+
name: z.string(),
|
|
178
|
+
location: z.string(),
|
|
179
|
+
sku: z.object({
|
|
180
|
+
name: z.enum(["Basic", "Standard"]).default("Standard"),
|
|
181
|
+
tier: z.enum(["Regional", "Global"]).default("Regional"),
|
|
182
|
+
}),
|
|
183
|
+
frontendIPConfigurations: z.array(z.object({
|
|
184
|
+
name: z.string(),
|
|
185
|
+
properties: z.object({
|
|
186
|
+
privateIPAllocationMethod: z.enum(["Static", "Dynamic"]).optional(),
|
|
187
|
+
privateIPAddress: z.string().optional(),
|
|
188
|
+
subnet: z
|
|
189
|
+
.object({
|
|
190
|
+
id: z.string(),
|
|
191
|
+
})
|
|
192
|
+
.optional(),
|
|
193
|
+
publicIPAddress: z
|
|
194
|
+
.object({
|
|
195
|
+
id: z.string(),
|
|
196
|
+
})
|
|
197
|
+
.optional(),
|
|
198
|
+
}),
|
|
199
|
+
})),
|
|
200
|
+
backendAddressPools: z
|
|
201
|
+
.array(z.object({
|
|
202
|
+
name: z.string(),
|
|
203
|
+
}))
|
|
204
|
+
.optional(),
|
|
205
|
+
loadBalancingRules: z
|
|
206
|
+
.array(z.object({
|
|
207
|
+
name: z.string(),
|
|
208
|
+
properties: z.object({
|
|
209
|
+
frontendIPConfiguration: z.object({
|
|
210
|
+
id: z.string(),
|
|
211
|
+
}),
|
|
212
|
+
backendAddressPool: z.object({
|
|
213
|
+
id: z.string(),
|
|
214
|
+
}),
|
|
215
|
+
probe: z.object({
|
|
216
|
+
id: z.string(),
|
|
217
|
+
}),
|
|
218
|
+
protocol: z.enum(["Tcp", "Udp", "All"]),
|
|
219
|
+
frontendPort: z.number(),
|
|
220
|
+
backendPort: z.number(),
|
|
221
|
+
idleTimeoutInMinutes: z.number().optional(),
|
|
222
|
+
enableFloatingIP: z.boolean().optional(),
|
|
223
|
+
loadDistribution: z
|
|
224
|
+
.enum(["Default", "SourceIP", "SourceIPProtocol"])
|
|
225
|
+
.optional(),
|
|
226
|
+
}),
|
|
227
|
+
}))
|
|
228
|
+
.optional(),
|
|
229
|
+
// Rate limiting configuration
|
|
230
|
+
rateLimit: z
|
|
231
|
+
.object({
|
|
232
|
+
enabled: z.boolean().default(true),
|
|
233
|
+
rules: z
|
|
234
|
+
.array(z.object({
|
|
235
|
+
name: z.string(),
|
|
236
|
+
priority: z.number(),
|
|
237
|
+
matchConditions: z.array(z.object({
|
|
238
|
+
matchVariables: z.array(z.object({
|
|
239
|
+
variableName: z.enum([
|
|
240
|
+
"RemoteAddr",
|
|
241
|
+
"RequestMethod",
|
|
242
|
+
"QueryString",
|
|
243
|
+
"PostArgs",
|
|
244
|
+
"RequestUri",
|
|
245
|
+
"RequestHeaders",
|
|
246
|
+
]),
|
|
247
|
+
selector: z.string().optional(),
|
|
248
|
+
})),
|
|
249
|
+
operator: z.enum([
|
|
250
|
+
"Any",
|
|
251
|
+
"IPMatch",
|
|
252
|
+
"GeoMatch",
|
|
253
|
+
"Equal",
|
|
254
|
+
"Contains",
|
|
255
|
+
"LessThan",
|
|
256
|
+
"GreaterThan",
|
|
257
|
+
"LessThanOrEqual",
|
|
258
|
+
"GreaterThanOrEqual",
|
|
259
|
+
"BeginsWith",
|
|
260
|
+
"EndsWith",
|
|
261
|
+
"RegEx",
|
|
262
|
+
]),
|
|
263
|
+
matchValues: z.array(z.string()),
|
|
264
|
+
transforms: z
|
|
265
|
+
.array(z.enum([
|
|
266
|
+
"Lowercase",
|
|
267
|
+
"Trim",
|
|
268
|
+
"UrlDecode",
|
|
269
|
+
"UrlEncode",
|
|
270
|
+
"RemoveNulls",
|
|
271
|
+
"HtmlEntityDecode",
|
|
272
|
+
]))
|
|
273
|
+
.optional(),
|
|
274
|
+
})),
|
|
275
|
+
action: z.enum(["Allow", "Block", "Log", "Redirect"]),
|
|
276
|
+
}))
|
|
277
|
+
.optional(),
|
|
278
|
+
})
|
|
279
|
+
.optional(),
|
|
280
|
+
});
|
|
281
|
+
export const AzureAPIManagementConfigSchema = z.object({
|
|
282
|
+
name: z.string(),
|
|
283
|
+
location: z.string(),
|
|
284
|
+
sku: z.object({
|
|
285
|
+
name: z
|
|
286
|
+
.enum(["Developer", "Basic", "Standard", "Premium", "Consumption"])
|
|
287
|
+
.default("Developer"),
|
|
288
|
+
capacity: z.number().min(1).default(1),
|
|
289
|
+
}),
|
|
290
|
+
publisherEmail: z.string().email(),
|
|
291
|
+
publisherName: z.string(),
|
|
292
|
+
// Rate limiting and throttling
|
|
293
|
+
policies: z
|
|
294
|
+
.object({
|
|
295
|
+
inbound: z
|
|
296
|
+
.array(z.object({
|
|
297
|
+
rateLimit: z
|
|
298
|
+
.object({
|
|
299
|
+
calls: z.number(),
|
|
300
|
+
renewalPeriod: z.number(),
|
|
301
|
+
counterKey: z.string().optional(),
|
|
302
|
+
})
|
|
303
|
+
.optional(),
|
|
304
|
+
rateLimitByKey: z
|
|
305
|
+
.object({
|
|
306
|
+
calls: z.number(),
|
|
307
|
+
renewalPeriod: z.number(),
|
|
308
|
+
counterKey: z.string(),
|
|
309
|
+
incrementCondition: z.string().optional(),
|
|
310
|
+
incrementCount: z.number().optional(),
|
|
311
|
+
})
|
|
312
|
+
.optional(),
|
|
313
|
+
}))
|
|
314
|
+
.optional(),
|
|
315
|
+
outbound: z.array(z.any()).optional(),
|
|
316
|
+
backend: z.array(z.any()).optional(),
|
|
317
|
+
onError: z.array(z.any()).optional(),
|
|
318
|
+
})
|
|
319
|
+
.optional(),
|
|
320
|
+
});
|
|
321
|
+
// ============================================================================
|
|
322
|
+
// GCP Schemas
|
|
323
|
+
// ============================================================================
|
|
324
|
+
export const GCPCredentialsSchema = z.object({
|
|
325
|
+
type: z.literal("service_account"),
|
|
326
|
+
project_id: z.string(),
|
|
327
|
+
private_key_id: z.string(),
|
|
328
|
+
private_key: z.string(),
|
|
329
|
+
client_email: z.string(),
|
|
330
|
+
client_id: z.string(),
|
|
331
|
+
auth_uri: z.string(),
|
|
332
|
+
token_uri: z.string(),
|
|
333
|
+
auth_provider_x509_cert_url: z.string(),
|
|
334
|
+
client_x509_cert_url: z.string(),
|
|
335
|
+
});
|
|
336
|
+
export const GCPLoadBalancerConfigSchema = z.object({
|
|
337
|
+
name: z.string(),
|
|
338
|
+
region: z.string(),
|
|
339
|
+
backendService: z.object({
|
|
340
|
+
name: z.string(),
|
|
341
|
+
backends: z.array(z.object({
|
|
342
|
+
group: z.string(),
|
|
343
|
+
balancingMode: z.enum(["UTILIZATION", "RATE"]).default("UTILIZATION"),
|
|
344
|
+
maxUtilization: z.number().min(0).max(1).default(0.8),
|
|
345
|
+
maxRatePerInstance: z.number().optional(),
|
|
346
|
+
capacityScaler: z.number().min(0).max(1).default(1.0),
|
|
347
|
+
})),
|
|
348
|
+
healthChecks: z.array(z.string()),
|
|
349
|
+
loadBalancingScheme: z.enum(["INTERNAL", "EXTERNAL"]).default("EXTERNAL"),
|
|
350
|
+
protocol: z
|
|
351
|
+
.enum(["HTTP", "HTTPS", "HTTP2", "TCP", "UDP", "GRPC"])
|
|
352
|
+
.default("HTTP"),
|
|
353
|
+
}),
|
|
354
|
+
// Rate limiting configuration
|
|
355
|
+
rateLimit: z
|
|
356
|
+
.object({
|
|
357
|
+
enabled: z.boolean().default(true),
|
|
358
|
+
rateLimiter: z
|
|
359
|
+
.object({
|
|
360
|
+
enforceOnKey: z
|
|
361
|
+
.enum(["ALL", "IP", "HTTP_HEADER", "XFF_IP"])
|
|
362
|
+
.default("IP"),
|
|
363
|
+
enforceOnKeyName: z.string().optional(),
|
|
364
|
+
rateLimitThreshold: z.object({
|
|
365
|
+
count: z.number(),
|
|
366
|
+
intervalSec: z.number(),
|
|
367
|
+
}),
|
|
368
|
+
})
|
|
369
|
+
.optional(),
|
|
370
|
+
})
|
|
371
|
+
.optional(),
|
|
372
|
+
});
|
|
373
|
+
export const GCPAPIGatewayConfigSchema = z.object({
|
|
374
|
+
name: z.string(),
|
|
375
|
+
displayName: z.string(),
|
|
376
|
+
description: z.string().optional(),
|
|
377
|
+
apiConfig: z.object({
|
|
378
|
+
name: z.string(),
|
|
379
|
+
displayName: z.string(),
|
|
380
|
+
description: z.string().optional(),
|
|
381
|
+
openapiDocuments: z.array(z.object({
|
|
382
|
+
document: z.object({
|
|
383
|
+
path: z.string(),
|
|
384
|
+
contents: z.string(),
|
|
385
|
+
}),
|
|
386
|
+
})),
|
|
387
|
+
gatewayConfig: z
|
|
388
|
+
.object({
|
|
389
|
+
backendConfig: z
|
|
390
|
+
.object({
|
|
391
|
+
googleServiceAccount: z.string().optional(),
|
|
392
|
+
})
|
|
393
|
+
.optional(),
|
|
394
|
+
})
|
|
395
|
+
.optional(),
|
|
396
|
+
// Rate limiting
|
|
397
|
+
quota: z
|
|
398
|
+
.object({
|
|
399
|
+
limits: z
|
|
400
|
+
.array(z.object({
|
|
401
|
+
name: z.string(),
|
|
402
|
+
metric: z.string(),
|
|
403
|
+
unit: z.enum(["MINUTE", "HOUR", "DAY"]),
|
|
404
|
+
values: z.record(z.string(), z.string()),
|
|
405
|
+
}))
|
|
406
|
+
.optional(),
|
|
407
|
+
})
|
|
408
|
+
.optional(),
|
|
409
|
+
}),
|
|
410
|
+
});
|
|
411
|
+
// ============================================================================
|
|
412
|
+
// Common Infrastructure Validation
|
|
413
|
+
// ============================================================================
|
|
414
|
+
export const InfrastructureConfigSchema = z.object({
|
|
415
|
+
provider: z.enum(["aws", "azure", "gcp"]),
|
|
416
|
+
region: z.string(),
|
|
417
|
+
environment: z.enum(["dev", "staging", "prod"]).default("dev"),
|
|
418
|
+
tags: z.record(z.string(), z.string()).optional(),
|
|
419
|
+
// Security configurations
|
|
420
|
+
security: z
|
|
421
|
+
.object({
|
|
422
|
+
enableEncryption: z.boolean().default(true),
|
|
423
|
+
enableLogging: z.boolean().default(true),
|
|
424
|
+
enableMonitoring: z.boolean().default(true),
|
|
425
|
+
complianceFrameworks: z
|
|
426
|
+
.array(z.enum(["SOC2", "HIPAA", "PCI-DSS", "GDPR"]))
|
|
427
|
+
.optional(),
|
|
428
|
+
})
|
|
429
|
+
.optional(),
|
|
430
|
+
// Networking
|
|
431
|
+
networking: z
|
|
432
|
+
.object({
|
|
433
|
+
vpc: z.any().optional(), // Provider-specific VPC config
|
|
434
|
+
loadBalancers: z.array(z.any()).optional(), // Provider-specific LB config
|
|
435
|
+
apiGateways: z.array(z.any()).optional(), // Provider-specific API Gateway config
|
|
436
|
+
firewalls: z
|
|
437
|
+
.array(z.object({
|
|
438
|
+
name: z.string(),
|
|
439
|
+
direction: z.enum(["INGRESS", "EGRESS"]),
|
|
440
|
+
priority: z.number(),
|
|
441
|
+
allowed: z
|
|
442
|
+
.array(z.object({
|
|
443
|
+
ipProtocol: z.string(),
|
|
444
|
+
ports: z.array(z.string()).optional(),
|
|
445
|
+
}))
|
|
446
|
+
.optional(),
|
|
447
|
+
denied: z
|
|
448
|
+
.array(z.object({
|
|
449
|
+
ipProtocol: z.string(),
|
|
450
|
+
ports: z.array(z.string()).optional(),
|
|
451
|
+
}))
|
|
452
|
+
.optional(),
|
|
453
|
+
sourceRanges: z.array(z.string()).optional(),
|
|
454
|
+
destinationRanges: z.array(z.string()).optional(),
|
|
455
|
+
targetTags: z.array(z.string()).optional(),
|
|
456
|
+
sourceTags: z.array(z.string()).optional(),
|
|
457
|
+
}))
|
|
458
|
+
.optional(),
|
|
459
|
+
})
|
|
460
|
+
.optional(),
|
|
461
|
+
// Rate limiting (global)
|
|
462
|
+
rateLimiting: z
|
|
463
|
+
.object({
|
|
464
|
+
enabled: z.boolean().default(true),
|
|
465
|
+
globalLimits: z
|
|
466
|
+
.object({
|
|
467
|
+
requestsPerSecond: z.number().min(1).default(1000),
|
|
468
|
+
requestsPerMinute: z.number().min(1).default(60000),
|
|
469
|
+
requestsPerHour: z.number().min(1).default(3600000),
|
|
470
|
+
burstMultiplier: z.number().min(1).max(10).default(2),
|
|
471
|
+
})
|
|
472
|
+
.optional(),
|
|
473
|
+
ipBasedLimits: z
|
|
474
|
+
.object({
|
|
475
|
+
enabled: z.boolean().default(true),
|
|
476
|
+
whitelist: z.array(z.string()).optional(),
|
|
477
|
+
blacklist: z.array(z.string()).optional(),
|
|
478
|
+
})
|
|
479
|
+
.optional(),
|
|
480
|
+
endpointLimits: z
|
|
481
|
+
.record(z.string(), z.object({
|
|
482
|
+
requestsPerSecond: z.number(),
|
|
483
|
+
requestsPerMinute: z.number().optional(),
|
|
484
|
+
}))
|
|
485
|
+
.optional(),
|
|
486
|
+
})
|
|
487
|
+
.optional(),
|
|
488
|
+
});
|
|
@@ -25,7 +25,7 @@ async function loadRegistry() {
|
|
|
25
25
|
return cached;
|
|
26
26
|
const candidatePaths = [
|
|
27
27
|
() => import("../enforcement/validators/validator-registry.js"),
|
|
28
|
-
() => import("../../node_modules/0xray/dist/enforcement/validators/validator-registry.js"),
|
|
28
|
+
() => import(/* skip-ts */ "../../node_modules/0xray/dist/enforcement/validators/validator-registry.js"),
|
|
29
29
|
];
|
|
30
30
|
for (const load of candidatePaths) {
|
|
31
31
|
try {
|
|
@@ -305,7 +305,7 @@ async function loadStateManager() {
|
|
|
305
305
|
// xrayStateManager fallback removed in v2.2
|
|
306
306
|
const candidatePaths = [
|
|
307
307
|
() => import("../state/state-manager.js"),
|
|
308
|
-
() => import("../../node_modules/0xray/dist/state/state-manager.js"),
|
|
308
|
+
() => import(/* skip-ts */ "../../node_modules/0xray/dist/state/state-manager.js"),
|
|
309
309
|
];
|
|
310
310
|
for (const load of candidatePaths) {
|
|
311
311
|
try {
|
|
@@ -323,7 +323,7 @@ async function loadStateManager() {
|
|
|
323
323
|
async function loadProcessorManager() {
|
|
324
324
|
const candidatePaths = [
|
|
325
325
|
() => import("../processors/processor-manager.js"),
|
|
326
|
-
() => import("../../node_modules/0xray/dist/processors/processor-manager.js"),
|
|
326
|
+
() => import(/* skip-ts */ "../../node_modules/0xray/dist/processors/processor-manager.js"),
|
|
327
327
|
];
|
|
328
328
|
for (const load of candidatePaths) {
|
|
329
329
|
try {
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* Client for calling the chrono-warp-drive Dynamo governance endpoint.
|
|
5
5
|
* Handles HTTP requests, retries, and response validation.
|
|
6
6
|
*
|
|
7
|
-
* @version 1.0.0
|
|
8
7
|
* @since 2026-05-11
|
|
9
8
|
*/
|
|
10
9
|
import { GovernanceError, GovernanceErrorCode, GovernanceTimeoutError, GovernanceNetworkError, } from './types.js';
|
|
@@ -4,15 +4,13 @@
|
|
|
4
4
|
* Integrates chrono-warp-drive Dynamo governance endpoint for external
|
|
5
5
|
* inference checking in governance decision-making.
|
|
6
6
|
*
|
|
7
|
-
* @version 1.0.0
|
|
8
7
|
* @since 2026-05-11
|
|
9
8
|
*/
|
|
10
9
|
import { BaseIntegration } from '../base/index.js';
|
|
11
10
|
import { DEFAULT_GOVERNANCE_CONFIG } from './types.js';
|
|
12
11
|
import { GovernanceClient } from './governance-client.js';
|
|
13
12
|
import { frameworkLogger } from '../../core/framework-logger.js';
|
|
14
|
-
import
|
|
15
|
-
import * as path from 'path';
|
|
13
|
+
import { featuresConfigLoader } from '../../core/features-config.js';
|
|
16
14
|
/**
|
|
17
15
|
* Main Governance Integration class
|
|
18
16
|
*
|
|
@@ -283,24 +281,19 @@ export class InferenceGovernanceIntegration extends BaseIntegration {
|
|
|
283
281
|
*/
|
|
284
282
|
async loadConfig() {
|
|
285
283
|
try {
|
|
286
|
-
const
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
return;
|
|
290
|
-
}
|
|
291
|
-
const content = fs.readFileSync(configPath, 'utf-8');
|
|
292
|
-
const features = JSON.parse(content);
|
|
293
|
-
if (features.inference_governance) {
|
|
284
|
+
const features = featuresConfigLoader.loadConfig();
|
|
285
|
+
const inferenceGovernance = features.inference_governance;
|
|
286
|
+
if (inferenceGovernance) {
|
|
294
287
|
this.configData = {
|
|
295
288
|
...DEFAULT_GOVERNANCE_CONFIG,
|
|
296
|
-
enabled:
|
|
297
|
-
endpointUrl:
|
|
298
|
-
requestTimeoutMs:
|
|
299
|
-
minConfidenceThreshold:
|
|
289
|
+
enabled: inferenceGovernance.enabled ?? false,
|
|
290
|
+
endpointUrl: inferenceGovernance.endpoint_url ?? DEFAULT_GOVERNANCE_CONFIG.endpointUrl,
|
|
291
|
+
requestTimeoutMs: inferenceGovernance.request_timeout_ms ?? DEFAULT_GOVERNANCE_CONFIG.requestTimeoutMs,
|
|
292
|
+
minConfidenceThreshold: inferenceGovernance.min_confidence_threshold ?? DEFAULT_GOVERNANCE_CONFIG.minConfidenceThreshold,
|
|
300
293
|
decisionLogic: {
|
|
301
|
-
passConfidenceMin:
|
|
302
|
-
revisionConfidenceMax:
|
|
303
|
-
voteWeightMultiplier:
|
|
294
|
+
passConfidenceMin: inferenceGovernance.decision_logic?.pass_confidence_min ?? DEFAULT_GOVERNANCE_CONFIG.decisionLogic.passConfidenceMin,
|
|
295
|
+
revisionConfidenceMax: inferenceGovernance.decision_logic?.revision_confidence_max ?? DEFAULT_GOVERNANCE_CONFIG.decisionLogic.revisionConfidenceMax,
|
|
296
|
+
voteWeightMultiplier: inferenceGovernance.decision_logic?.vote_weight_multiplier ?? DEFAULT_GOVERNANCE_CONFIG.decisionLogic.voteWeightMultiplier,
|
|
304
297
|
},
|
|
305
298
|
};
|
|
306
299
|
}
|
|
@@ -313,7 +306,6 @@ export class InferenceGovernanceIntegration extends BaseIntegration {
|
|
|
313
306
|
await this.log('error', 'Failed to load configuration', {
|
|
314
307
|
error: error instanceof Error ? error.message : String(error),
|
|
315
308
|
});
|
|
316
|
-
// Use defaults on error
|
|
317
309
|
this.configData = DEFAULT_GOVERNANCE_CONFIG;
|
|
318
310
|
}
|
|
319
311
|
}
|
|
@@ -722,6 +722,10 @@ def register(ctx):
|
|
|
722
722
|
f"[plugin-loaded] Xray Hermes Plugin v2.2 — "
|
|
723
723
|
f"6 tools, 2 hooks, subagent enforcement, bridge={BRIDGE_PATH.exists()}")
|
|
724
724
|
|
|
725
|
+
# Log session-start since on_session_start may not fire in oneshot mode
|
|
726
|
+
_log_to_file("activity.log",
|
|
727
|
+
f"[session-start] session={session_id}")
|
|
728
|
+
|
|
725
729
|
logger.info(
|
|
726
730
|
"[xray] Plugin v2.2 loaded: 6 tools, 2 hooks, "
|
|
727
731
|
"subagent enforcement active, bridge=%s",
|