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,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bridge between orchestrator types and the pluggable MemoryRoutingProvider.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
getMemoryRoutingProviderSync,
|
|
7
|
+
type MemoryAgentCapability,
|
|
8
|
+
type MemoryOrchestrationTask,
|
|
9
|
+
type MemoryRoutingProvider,
|
|
10
|
+
} from '../../../memory-routing/index.js';
|
|
11
|
+
import type { AgentCapability, OrchestrationTask } from '../types.js';
|
|
12
|
+
|
|
13
|
+
export function toMemoryCapability(caps: AgentCapability): MemoryAgentCapability {
|
|
14
|
+
const result: MemoryAgentCapability = {
|
|
15
|
+
capabilities: caps.capabilities,
|
|
16
|
+
complexityThreshold: caps.complexityThreshold,
|
|
17
|
+
concurrentTasks: caps.concurrentTasks,
|
|
18
|
+
};
|
|
19
|
+
if (caps.memorySignals) result.memorySignals = caps.memorySignals;
|
|
20
|
+
if (caps.memoryTags) result.memoryTags = caps.memoryTags;
|
|
21
|
+
return result;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function fromMemoryCapability(caps: MemoryAgentCapability): AgentCapability {
|
|
25
|
+
const result: AgentCapability = {
|
|
26
|
+
capabilities: caps.capabilities,
|
|
27
|
+
complexityThreshold: caps.complexityThreshold,
|
|
28
|
+
concurrentTasks: caps.concurrentTasks,
|
|
29
|
+
};
|
|
30
|
+
if (caps.memorySignals) result.memorySignals = caps.memorySignals;
|
|
31
|
+
if (caps.memoryTags) result.memoryTags = caps.memoryTags;
|
|
32
|
+
return result;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function toMemoryTask(task: OrchestrationTask): MemoryOrchestrationTask {
|
|
36
|
+
const result: MemoryOrchestrationTask = {
|
|
37
|
+
id: task.id,
|
|
38
|
+
description: task.description,
|
|
39
|
+
type: task.type,
|
|
40
|
+
};
|
|
41
|
+
if (task.priority) result.priority = task.priority;
|
|
42
|
+
if (task.dependencies) result.dependencies = task.dependencies;
|
|
43
|
+
if (task.estimatedComplexity !== undefined) result.estimatedComplexity = task.estimatedComplexity;
|
|
44
|
+
if (task.metadata) result.metadata = task.metadata as Record<string, unknown>;
|
|
45
|
+
return result;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function fromMemoryTask(task: MemoryOrchestrationTask): OrchestrationTask {
|
|
49
|
+
const result: OrchestrationTask = {
|
|
50
|
+
id: task.id,
|
|
51
|
+
description: task.description,
|
|
52
|
+
type: task.type,
|
|
53
|
+
};
|
|
54
|
+
if (task.priority) result.priority = task.priority;
|
|
55
|
+
if (task.dependencies) result.dependencies = task.dependencies;
|
|
56
|
+
if (task.estimatedComplexity !== undefined) result.estimatedComplexity = task.estimatedComplexity;
|
|
57
|
+
const metadata = task.metadata as OrchestrationTask['metadata'];
|
|
58
|
+
if (metadata) result.metadata = metadata;
|
|
59
|
+
return result;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function toMemoryCapabilityMap(
|
|
63
|
+
caps: Map<string, AgentCapability>,
|
|
64
|
+
): Map<string, MemoryAgentCapability> {
|
|
65
|
+
return new Map(
|
|
66
|
+
Array.from(caps.entries()).map(([k, v]) => [k, toMemoryCapability(v)]),
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function fromMemoryCapabilityMap(
|
|
71
|
+
caps: Map<string, MemoryAgentCapability>,
|
|
72
|
+
): Map<string, AgentCapability> {
|
|
73
|
+
return new Map(
|
|
74
|
+
Array.from(caps.entries()).map(([k, v]) => [k, fromMemoryCapability(v)]),
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function getProvider(): MemoryRoutingProvider {
|
|
79
|
+
return getMemoryRoutingProviderSync();
|
|
80
|
+
}
|
|
@@ -11,6 +11,11 @@ import type {
|
|
|
11
11
|
TaskValidation
|
|
12
12
|
} from '../types.js';
|
|
13
13
|
import { getAgentCapabilitiesManager } from '../config/agent-capabilities.js';
|
|
14
|
+
import {
|
|
15
|
+
getProvider,
|
|
16
|
+
toMemoryTask,
|
|
17
|
+
fromMemoryTask,
|
|
18
|
+
} from '../config/memory-routing-bridge.js';
|
|
14
19
|
|
|
15
20
|
/**
|
|
16
21
|
* Execution Planner
|
|
@@ -67,29 +72,41 @@ export class ExecutionPlanner {
|
|
|
67
72
|
tasks: OrchestrationTask[],
|
|
68
73
|
executionMode: string
|
|
69
74
|
): Promise<ExecutionPlan> {
|
|
75
|
+
const provider = getProvider();
|
|
76
|
+
const memoryTasks = provider.enrichTasks(tasks.map(toMemoryTask));
|
|
77
|
+
const enrichedTasks = memoryTasks.map(fromMemoryTask);
|
|
78
|
+
|
|
70
79
|
const agentAssignments = new Map<string, OrchestrationTask[]>();
|
|
71
80
|
|
|
72
81
|
switch (executionMode) {
|
|
73
82
|
case 'parallel':
|
|
74
|
-
this.createParallelPlan(
|
|
83
|
+
this.createParallelPlan(enrichedTasks, agentAssignments);
|
|
75
84
|
break;
|
|
76
85
|
case 'sequential':
|
|
77
|
-
this.createSequentialPlan(
|
|
86
|
+
this.createSequentialPlan(enrichedTasks, agentAssignments);
|
|
78
87
|
break;
|
|
79
88
|
case 'optimized':
|
|
80
89
|
default:
|
|
81
|
-
await this.createOptimizedPlan(
|
|
90
|
+
await this.createOptimizedPlan(enrichedTasks, agentAssignments);
|
|
82
91
|
break;
|
|
83
92
|
}
|
|
84
93
|
|
|
85
94
|
const estimatedDuration = this.estimateExecutionDuration(agentAssignments);
|
|
86
95
|
|
|
87
|
-
|
|
88
|
-
tasks,
|
|
96
|
+
const plan: ExecutionPlan = {
|
|
97
|
+
tasks: enrichedTasks,
|
|
89
98
|
strategy: executionMode as 'parallel' | 'sequential' | 'optimized',
|
|
90
99
|
agentAssignments,
|
|
91
100
|
estimatedDuration,
|
|
92
101
|
};
|
|
102
|
+
|
|
103
|
+
if (provider.id !== 'null') {
|
|
104
|
+
plan.memoryContext = {
|
|
105
|
+
...provider.buildInheritedContext(memoryTasks),
|
|
106
|
+
} as Record<string, unknown>;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return plan;
|
|
93
110
|
}
|
|
94
111
|
|
|
95
112
|
/**
|
|
@@ -197,9 +214,14 @@ export class ExecutionPlanner {
|
|
|
197
214
|
): void {
|
|
198
215
|
for (const task of tasks) {
|
|
199
216
|
const complexity = task.estimatedComplexity || 30;
|
|
217
|
+
const requiredCaps = [
|
|
218
|
+
task.type,
|
|
219
|
+
...(task.metadata?.memorySignals ?? []),
|
|
220
|
+
];
|
|
200
221
|
const agent = this.capabilitiesManager.selectAgentForTask(
|
|
201
|
-
|
|
202
|
-
complexity
|
|
222
|
+
requiredCaps,
|
|
223
|
+
complexity,
|
|
224
|
+
task.description,
|
|
203
225
|
) || 'orchestrator';
|
|
204
226
|
|
|
205
227
|
if (!agentAssignments.has(agent)) {
|
|
@@ -247,9 +269,14 @@ export class ExecutionPlanner {
|
|
|
247
269
|
});
|
|
248
270
|
|
|
249
271
|
// Assign to agent
|
|
272
|
+
const requiredCaps = [
|
|
273
|
+
task.type,
|
|
274
|
+
...(task.metadata?.memorySignals ?? []),
|
|
275
|
+
];
|
|
250
276
|
const agent = this.capabilitiesManager.selectAgentForTask(
|
|
251
|
-
|
|
252
|
-
complexity
|
|
277
|
+
requiredCaps,
|
|
278
|
+
complexity,
|
|
279
|
+
task.description,
|
|
253
280
|
) || 'orchestrator';
|
|
254
281
|
|
|
255
282
|
if (!assignments.has(agent)) {
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import { frameworkLogger } from '../../../core/framework-logger.js';
|
|
8
8
|
import { getExecutionPlanner } from '../execution/execution-planner.js';
|
|
9
|
+
import { addObservations, extractComplexityObservations } from '../aside-context.js';
|
|
9
10
|
import type { OrchestrationTask, ComplexityAnalysis } from '../types.js';
|
|
10
11
|
|
|
11
12
|
/**
|
|
@@ -18,9 +19,10 @@ export class ComplexityHandler {
|
|
|
18
19
|
/**
|
|
19
20
|
* Handle analyze-complexity request
|
|
20
21
|
*/
|
|
21
|
-
async handleAnalyzeComplexity(
|
|
22
|
-
tasks: OrchestrationTask[]
|
|
23
|
-
|
|
22
|
+
async handleAnalyzeComplexity(
|
|
23
|
+
args: { tasks: OrchestrationTask[] },
|
|
24
|
+
asideId?: string,
|
|
25
|
+
): Promise<{ content: Array<{ type: string; text: string }> }> {
|
|
24
26
|
const { tasks = [] } = args;
|
|
25
27
|
|
|
26
28
|
await frameworkLogger.log(
|
|
@@ -34,6 +36,10 @@ export class ComplexityHandler {
|
|
|
34
36
|
const analysis = await this.planner.analyzeTaskComplexity(tasks);
|
|
35
37
|
const recommendations = this.generateRecommendations(analysis);
|
|
36
38
|
|
|
39
|
+
if (asideId) {
|
|
40
|
+
addObservations(asideId, extractComplexityObservations(analysis));
|
|
41
|
+
}
|
|
42
|
+
|
|
37
43
|
return {
|
|
38
44
|
content: [
|
|
39
45
|
{
|
|
@@ -18,6 +18,8 @@ interface HistoryItem {
|
|
|
18
18
|
interface StatusHandlerDeps {
|
|
19
19
|
activeTasks: Map<string, unknown>;
|
|
20
20
|
taskHistory: HistoryItem[];
|
|
21
|
+
asideCount?: number;
|
|
22
|
+
asideIds?: string[];
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
/**
|
|
@@ -68,7 +70,15 @@ export class StatusHandler {
|
|
|
68
70
|
status = this.getOverallStatus(deps);
|
|
69
71
|
}
|
|
70
72
|
|
|
71
|
-
|
|
73
|
+
let response = this.formatStatusResponse(status, detailed);
|
|
74
|
+
|
|
75
|
+
if (detailed && deps.asideCount !== undefined) {
|
|
76
|
+
response += `\n\n**Active Aside Contexts:**`;
|
|
77
|
+
response += `\n• Count: ${deps.asideCount}`;
|
|
78
|
+
if (deps.asideIds && deps.asideIds.length > 0) {
|
|
79
|
+
response += `\n• IDs: ${deps.asideIds.join(', ')}`;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
72
82
|
|
|
73
83
|
return { content: [{ type: 'text', text: response }] };
|
|
74
84
|
} catch (error) {
|
|
@@ -7,11 +7,14 @@
|
|
|
7
7
|
import { frameworkLogger } from '../../../core/framework-logger.js';
|
|
8
8
|
import { getExecutionPlanner } from '../execution/execution-planner.js';
|
|
9
9
|
import { mcpClientManager } from '../../../mcps/mcp-client.js';
|
|
10
|
-
import
|
|
10
|
+
import { addObservations, extractOrchestrationObservations, spawnAside } from '../aside-context.js';
|
|
11
|
+
import { getProvider } from '../config/memory-routing-bridge.js';
|
|
12
|
+
import type { OrchestrationResult, OrchestrationTask } from '../types.js';
|
|
11
13
|
|
|
12
14
|
export interface TaskHandlerDeps {
|
|
13
15
|
taskHistory: OrchestrationHistoryItem[];
|
|
14
16
|
activeTasks: Map<string, unknown>;
|
|
17
|
+
asideId?: string;
|
|
15
18
|
}
|
|
16
19
|
|
|
17
20
|
interface OrchestrationHistoryItem {
|
|
@@ -74,9 +77,43 @@ export class TaskHandler {
|
|
|
74
77
|
// Analyze complexity and create execution plan
|
|
75
78
|
const executionPlan = await this.planner.createExecutionPlan(tasks, executionMode);
|
|
76
79
|
|
|
80
|
+
const memoryProvider = getProvider();
|
|
81
|
+
if (memoryProvider.id !== 'null' && executionPlan.memoryContext) {
|
|
82
|
+
await spawnAside({
|
|
83
|
+
description: `Orchestrate: ${description}`,
|
|
84
|
+
sessionId,
|
|
85
|
+
inheritedContext: {
|
|
86
|
+
memoryRouting: executionPlan.memoryContext,
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
|
|
77
91
|
// Execute orchestration (simulated for MCP server)
|
|
78
92
|
const results = await this.executePlan(executionPlan, sessionId, timeout);
|
|
79
93
|
|
|
94
|
+
// Feed per-task outcomes back to memory provider (not aggregate session stats)
|
|
95
|
+
if (memoryProvider.ingestFeedback) {
|
|
96
|
+
const outcomeByKey = new Map(
|
|
97
|
+
results.taskOutcomes.map((o) => [`${o.agent}:${o.taskId}`, o]),
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
for (const [agent, assignedTasks] of executionPlan.agentAssignments) {
|
|
101
|
+
for (const task of assignedTasks) {
|
|
102
|
+
const outcome = outcomeByKey.get(`${agent}:${task.id}`);
|
|
103
|
+
memoryProvider.ingestFeedback({
|
|
104
|
+
timestamp: new Date().toISOString(),
|
|
105
|
+
sessionId,
|
|
106
|
+
taskId: task.id,
|
|
107
|
+
assignedAgent: agent,
|
|
108
|
+
memorySignals: task.metadata?.memorySignals ?? [],
|
|
109
|
+
complexity: task.estimatedComplexity ?? 30,
|
|
110
|
+
success: outcome?.success ?? false,
|
|
111
|
+
durationMs: outcome?.durationMs ?? 0,
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
80
117
|
// Update result
|
|
81
118
|
orchestrationResult.success = results.success;
|
|
82
119
|
orchestrationResult.completedTasks = results.completedTasks;
|
|
@@ -88,6 +125,11 @@ export class TaskHandler {
|
|
|
88
125
|
orchestrationResult.agentOutputs = results.agentOutputs;
|
|
89
126
|
}
|
|
90
127
|
|
|
128
|
+
// Push observations into aside context if active
|
|
129
|
+
if (deps.asideId) {
|
|
130
|
+
addObservations(deps.asideId, extractOrchestrationObservations(orchestrationResult));
|
|
131
|
+
}
|
|
132
|
+
|
|
91
133
|
// Store in history
|
|
92
134
|
deps.taskHistory.push({
|
|
93
135
|
sessionId,
|
|
@@ -129,11 +171,23 @@ export class TaskHandler {
|
|
|
129
171
|
bottlenecks: string[];
|
|
130
172
|
recommendations: string[];
|
|
131
173
|
agentOutputs?: Record<string, string>;
|
|
174
|
+
taskOutcomes: Array<{
|
|
175
|
+
taskId: string;
|
|
176
|
+
agent: string;
|
|
177
|
+
success: boolean;
|
|
178
|
+
durationMs: number;
|
|
179
|
+
}>;
|
|
132
180
|
}> {
|
|
133
181
|
const agentUtilization: Record<string, number> = {};
|
|
134
182
|
let completedTasks = 0;
|
|
135
183
|
let failedTasks = 0;
|
|
136
184
|
const agentOutputs: Record<string, string> = {};
|
|
185
|
+
const taskOutcomes: Array<{
|
|
186
|
+
taskId: string;
|
|
187
|
+
agent: string;
|
|
188
|
+
success: boolean;
|
|
189
|
+
durationMs: number;
|
|
190
|
+
}> = [];
|
|
137
191
|
|
|
138
192
|
const skillServers = new Set([
|
|
139
193
|
'code-review', 'code-reviewer',
|
|
@@ -151,6 +205,7 @@ export class TaskHandler {
|
|
|
151
205
|
|
|
152
206
|
if (skillServers.has(agent)) {
|
|
153
207
|
for (const task of tasks) {
|
|
208
|
+
const taskStart = Date.now();
|
|
154
209
|
try {
|
|
155
210
|
const toolName = this.mapAgentToTool(agent);
|
|
156
211
|
const result = await mcpClientManager.callServerTool(agent, toolName, {
|
|
@@ -162,9 +217,21 @@ export class TaskHandler {
|
|
|
162
217
|
const outputText = this.extractTextFromMcpResult(result);
|
|
163
218
|
agentOutputs[`${agent}:${task.id}`] = outputText;
|
|
164
219
|
completedTasks++;
|
|
220
|
+
taskOutcomes.push({
|
|
221
|
+
taskId: task.id,
|
|
222
|
+
agent,
|
|
223
|
+
success: true,
|
|
224
|
+
durationMs: Date.now() - taskStart,
|
|
225
|
+
});
|
|
165
226
|
} catch (err) {
|
|
166
227
|
failedTasks++;
|
|
167
228
|
agentOutputs[`${agent}:${task.id}`] = `Error: ${err instanceof Error ? err.message : String(err)}`;
|
|
229
|
+
taskOutcomes.push({
|
|
230
|
+
taskId: task.id,
|
|
231
|
+
agent,
|
|
232
|
+
success: false,
|
|
233
|
+
durationMs: Date.now() - taskStart,
|
|
234
|
+
});
|
|
168
235
|
frameworkLogger.log('orchestrator.task-handler', 'task-execution-failed', 'warning', {
|
|
169
236
|
agent,
|
|
170
237
|
taskId: task.id,
|
|
@@ -174,7 +241,15 @@ export class TaskHandler {
|
|
|
174
241
|
}
|
|
175
242
|
} else {
|
|
176
243
|
// For non-MCP agents we still count them as "assigned" (they will be handled by the caller or legacy path)
|
|
177
|
-
|
|
244
|
+
for (const task of tasks) {
|
|
245
|
+
completedTasks++;
|
|
246
|
+
taskOutcomes.push({
|
|
247
|
+
taskId: task.id,
|
|
248
|
+
agent,
|
|
249
|
+
success: true,
|
|
250
|
+
durationMs: 0,
|
|
251
|
+
});
|
|
252
|
+
}
|
|
178
253
|
}
|
|
179
254
|
}
|
|
180
255
|
|
|
@@ -198,6 +273,7 @@ export class TaskHandler {
|
|
|
198
273
|
bottlenecks,
|
|
199
274
|
recommendations,
|
|
200
275
|
agentOutputs,
|
|
276
|
+
taskOutcomes,
|
|
201
277
|
};
|
|
202
278
|
}
|
|
203
279
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export { OrchestratorServer, createOrchestratorServer } from './server.js';
|
|
2
|
+
export { TaskHandler } from './handlers/task-handler.js';
|
|
3
|
+
export { ComplexityHandler } from './handlers/complexity-handler.js';
|
|
4
|
+
export { StatusHandler } from './handlers/status-handler.js';
|
|
5
|
+
export {
|
|
6
|
+
spawnAside,
|
|
7
|
+
closeAside,
|
|
8
|
+
closeAllAsides,
|
|
9
|
+
addObservations,
|
|
10
|
+
getActiveAsideCount,
|
|
11
|
+
getActiveAsideIds,
|
|
12
|
+
getAsideState,
|
|
13
|
+
resetAsideContext,
|
|
14
|
+
extractGovernanceObservations,
|
|
15
|
+
extractOrchestrationObservations,
|
|
16
|
+
extractComplexityObservations,
|
|
17
|
+
} from './aside-context.js';
|
|
18
|
+
export type {
|
|
19
|
+
AsideContextOptions,
|
|
20
|
+
AsideObservation,
|
|
21
|
+
AsideResult,
|
|
22
|
+
ActiveAside,
|
|
23
|
+
OrchestrationTask,
|
|
24
|
+
OrchestrationResult,
|
|
25
|
+
OrchestrationStatus,
|
|
26
|
+
ComplexityAnalysis,
|
|
27
|
+
TaskExecutionResult,
|
|
28
|
+
ExecutionPlan,
|
|
29
|
+
} from './types.js';
|
|
@@ -20,6 +20,16 @@ import { TaskHandler } from './handlers/task-handler.js';
|
|
|
20
20
|
import { ComplexityHandler } from './handlers/complexity-handler.js';
|
|
21
21
|
import { StatusHandler } from './handlers/status-handler.js';
|
|
22
22
|
import type { OrchestrationTask, OrchestrationResult } from './types.js';
|
|
23
|
+
import {
|
|
24
|
+
spawnAside,
|
|
25
|
+
closeAside,
|
|
26
|
+
closeAllAsides,
|
|
27
|
+
addObservations,
|
|
28
|
+
getActiveAsideCount,
|
|
29
|
+
getActiveAsideIds,
|
|
30
|
+
getAsideState,
|
|
31
|
+
extractGovernanceObservations,
|
|
32
|
+
} from './aside-context.js';
|
|
23
33
|
|
|
24
34
|
/**
|
|
25
35
|
* Orchestrator MCP Server
|
|
@@ -234,33 +244,65 @@ export class OrchestratorServer {
|
|
|
234
244
|
const { name, arguments: args } = request.params;
|
|
235
245
|
|
|
236
246
|
switch (name) {
|
|
237
|
-
case 'orchestrate-task':
|
|
238
|
-
|
|
247
|
+
case 'orchestrate-task': {
|
|
248
|
+
const orchArgs = args as {
|
|
239
249
|
description: string;
|
|
240
250
|
tasks?: OrchestrationTask[];
|
|
241
251
|
sessionId?: string;
|
|
242
252
|
executionMode?: string;
|
|
243
253
|
timeout?: number;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
tasks:
|
|
254
|
+
};
|
|
255
|
+
const aside = await spawnAside({
|
|
256
|
+
description: `Orchestration: ${orchArgs.description}`,
|
|
257
|
+
...(orchArgs.sessionId ? { sessionId: orchArgs.sessionId } : {}),
|
|
258
|
+
inheritedContext: { taskCount: orchArgs.tasks?.length ?? 0, executionMode: orchArgs.executionMode ?? 'optimized' },
|
|
249
259
|
});
|
|
250
|
-
|
|
260
|
+
try {
|
|
261
|
+
const result = await this.taskHandler.handleOrchestrateTask(
|
|
262
|
+
orchArgs,
|
|
263
|
+
{ taskHistory: this.taskHistory, activeTasks: this.activeTasks, asideId: aside.asideId },
|
|
264
|
+
);
|
|
265
|
+
return result;
|
|
266
|
+
} finally {
|
|
267
|
+
closeAside(aside.asideId);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
case 'analyze-complexity': {
|
|
271
|
+
const complexityArgs = args as { tasks: OrchestrationTask[] };
|
|
272
|
+
const aside = await spawnAside({
|
|
273
|
+
description: `Complexity analysis: ${complexityArgs.tasks.length} tasks`,
|
|
274
|
+
});
|
|
275
|
+
try {
|
|
276
|
+
return await this.complexityHandler.handleAnalyzeComplexity(complexityArgs, aside.asideId);
|
|
277
|
+
} finally {
|
|
278
|
+
closeAside(aside.asideId);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
251
281
|
case 'get-orchestration-status':
|
|
252
282
|
return await this.statusHandler.handleGetOrchestrationStatus(args as {
|
|
253
283
|
sessionId?: string;
|
|
254
284
|
detailed?: boolean;
|
|
255
|
-
}, {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
285
|
+
}, {
|
|
286
|
+
taskHistory: this.taskHistory,
|
|
287
|
+
activeTasks: this.activeTasks,
|
|
288
|
+
asideCount: getActiveAsideCount(),
|
|
289
|
+
asideIds: getActiveAsideIds(),
|
|
290
|
+
});
|
|
291
|
+
case 'cancel-orchestration': {
|
|
292
|
+
const cancelArgs = args as { sessionId?: string; taskId?: string; force?: boolean };
|
|
293
|
+
if (cancelArgs.force || (!cancelArgs.sessionId && !cancelArgs.taskId)) {
|
|
294
|
+
closeAllAsides();
|
|
295
|
+
} else if (cancelArgs.sessionId) {
|
|
296
|
+
const asideIds = getActiveAsideIds().filter(
|
|
297
|
+
(id) => getAsideState(id)?.sessionId === cancelArgs.sessionId,
|
|
298
|
+
);
|
|
299
|
+
for (const id of asideIds) closeAside(id);
|
|
300
|
+
}
|
|
301
|
+
return await this.statusHandler.handleCancelOrchestration(cancelArgs, {
|
|
302
|
+
taskHistory: this.taskHistory,
|
|
303
|
+
activeTasks: this.activeTasks,
|
|
304
|
+
});
|
|
305
|
+
}
|
|
264
306
|
case 'optimize-orchestration':
|
|
265
307
|
return await this.statusHandler.handleOptimizeOrchestration(args as {
|
|
266
308
|
history?: boolean;
|
|
@@ -311,26 +353,38 @@ export class OrchestratorServer {
|
|
|
311
353
|
skipApply: args.skipApply ?? false,
|
|
312
354
|
});
|
|
313
355
|
|
|
314
|
-
const
|
|
356
|
+
const aside = await spawnAside({
|
|
357
|
+
description: `Governance cycle: ${args.proposals.length} proposals`,
|
|
358
|
+
priorVerdictContext: { proposalCount: args.proposals.length },
|
|
359
|
+
});
|
|
360
|
+
|
|
361
|
+
let result: import('../../inference/inference-cycle.js').InferenceCycleResult;
|
|
362
|
+
try {
|
|
363
|
+
result = await cycle.governExternalProposals(args.proposals as any);
|
|
364
|
+
addObservations(aside.asideId, extractGovernanceObservations(result));
|
|
365
|
+
} finally {
|
|
366
|
+
closeAside(aside.asideId);
|
|
367
|
+
}
|
|
315
368
|
|
|
316
|
-
const approved = result
|
|
317
|
-
const rejected = result
|
|
369
|
+
const approved = result!.votes.filter((v) => v.decision === 'approve').length;
|
|
370
|
+
const rejected = result!.votes.length - approved;
|
|
318
371
|
|
|
319
372
|
return {
|
|
320
373
|
content: [{
|
|
321
374
|
type: 'text' as const,
|
|
322
375
|
text: JSON.stringify({
|
|
323
|
-
cycleId: result
|
|
376
|
+
cycleId: result!.cycleId,
|
|
377
|
+
asideId: aside.asideId,
|
|
324
378
|
approved,
|
|
325
379
|
rejected,
|
|
326
|
-
votes: result
|
|
327
|
-
proposals: result
|
|
380
|
+
votes: result!.votes,
|
|
381
|
+
proposals: result!.proposals.map((p) => ({
|
|
328
382
|
id: p.id,
|
|
329
383
|
title: p.title,
|
|
330
384
|
type: p.type,
|
|
331
385
|
status: p.status,
|
|
332
386
|
})),
|
|
333
|
-
duration: result
|
|
387
|
+
duration: result!.duration,
|
|
334
388
|
}, null, 2),
|
|
335
389
|
}],
|
|
336
390
|
};
|
|
@@ -360,6 +414,7 @@ export class OrchestratorServer {
|
|
|
360
414
|
* Stop the server
|
|
361
415
|
*/
|
|
362
416
|
async stop(): Promise<void> {
|
|
417
|
+
closeAllAsides();
|
|
363
418
|
await frameworkLogger.log('orchestrator.server', 'shutdown', 'info', {
|
|
364
419
|
message: '0xRay Orchestrator MCP Server shutting down',
|
|
365
420
|
});
|
|
@@ -8,6 +8,17 @@ export interface AgentCapability {
|
|
|
8
8
|
capabilities: string[];
|
|
9
9
|
complexityThreshold: number;
|
|
10
10
|
concurrentTasks: number;
|
|
11
|
+
/** Populated by active MemoryRoutingProvider (e.g. Repertoire) */
|
|
12
|
+
memorySignals?: string[];
|
|
13
|
+
memoryTags?: string[];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface OrchestrationTaskMetadata {
|
|
17
|
+
memorySignals?: string[];
|
|
18
|
+
matchedPrimitives?: string[];
|
|
19
|
+
synthesisContext?: string;
|
|
20
|
+
ontologicalTrapDetected?: boolean;
|
|
21
|
+
memoryProviderId?: string;
|
|
11
22
|
}
|
|
12
23
|
|
|
13
24
|
export interface OrchestrationTask {
|
|
@@ -17,6 +28,7 @@ export interface OrchestrationTask {
|
|
|
17
28
|
priority?: 'critical' | 'high' | 'medium' | 'low';
|
|
18
29
|
dependencies?: string[];
|
|
19
30
|
estimatedComplexity?: number;
|
|
31
|
+
metadata?: OrchestrationTaskMetadata;
|
|
20
32
|
}
|
|
21
33
|
|
|
22
34
|
export interface ExecutionPlan {
|
|
@@ -24,6 +36,7 @@ export interface ExecutionPlan {
|
|
|
24
36
|
strategy: 'parallel' | 'sequential' | 'optimized';
|
|
25
37
|
agentAssignments: Map<string, OrchestrationTask[]>;
|
|
26
38
|
estimatedDuration: number;
|
|
39
|
+
memoryContext?: Record<string, unknown>;
|
|
27
40
|
}
|
|
28
41
|
|
|
29
42
|
export interface OrchestrationResult {
|
|
@@ -52,6 +65,41 @@ export interface TaskValidation {
|
|
|
52
65
|
errors: string[];
|
|
53
66
|
}
|
|
54
67
|
|
|
68
|
+
export interface ActiveAside {
|
|
69
|
+
asideId: string;
|
|
70
|
+
description: string;
|
|
71
|
+
sessionId?: string;
|
|
72
|
+
parentAsideId?: string;
|
|
73
|
+
startedAt: number;
|
|
74
|
+
inheritedContext?: Record<string, unknown>;
|
|
75
|
+
priorVerdictContext?: Record<string, unknown>;
|
|
76
|
+
observations: AsideObservation[];
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export interface AsideObservation {
|
|
80
|
+
key: string;
|
|
81
|
+
value: string;
|
|
82
|
+
source: string;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export interface AsideContextOptions {
|
|
86
|
+
description: string;
|
|
87
|
+
inheritedContext?: Record<string, unknown>;
|
|
88
|
+
priorVerdictContext?: Record<string, unknown>;
|
|
89
|
+
sessionId?: string;
|
|
90
|
+
parentAsideId?: string;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export interface AsideResult {
|
|
94
|
+
asideId: string;
|
|
95
|
+
description: string;
|
|
96
|
+
success: boolean;
|
|
97
|
+
duration: number;
|
|
98
|
+
observations: AsideObservation[];
|
|
99
|
+
priorVerdictContext?: Record<string, unknown>;
|
|
100
|
+
error?: string;
|
|
101
|
+
}
|
|
102
|
+
|
|
55
103
|
export interface OrchestrationStatus {
|
|
56
104
|
activeSessions: number;
|
|
57
105
|
totalTasks: number;
|
|
@@ -62,6 +110,8 @@ export interface OrchestrationStatus {
|
|
|
62
110
|
tasks: number;
|
|
63
111
|
duration: number;
|
|
64
112
|
}>;
|
|
113
|
+
activeAsideCount?: number;
|
|
114
|
+
activeAsideIds?: string[];
|
|
65
115
|
}
|
|
66
116
|
|
|
67
117
|
export interface TaskExecutionContext {
|