aboutsummaryrefslogtreecommitdiff
path: root/modules/core/module-orchestrator.js
diff options
context:
space:
mode:
authorAgando <roduccomm@gmail.com>2026-06-04 06:01:04 +0200
committerAgando <roduccomm@gmail.com>2026-06-04 06:01:04 +0200
commita5023e61be61f2f2287342039addab6bb28ad2fd (patch)
tree9b1b3c166869cd6fee91bffe1f4134513005b8b1 /modules/core/module-orchestrator.js
parent301f75ab03302a05b3c35950a3b0ab49f9f69ed6 (diff)
auto: 2026-06-04_06:00 changes
Diffstat (limited to 'modules/core/module-orchestrator.js')
-rw-r--r--modules/core/module-orchestrator.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/modules/core/module-orchestrator.js b/modules/core/module-orchestrator.js
index 4fab599..de88424 100644
--- a/modules/core/module-orchestrator.js
+++ b/modules/core/module-orchestrator.js
@@ -75,6 +75,22 @@ class OrchestratorModule {
agent = Object.values(this._agents).find(a => a.status === 'idle');
}
if (!agent) return this.terminal.print('❌ No available agents', 'error');
+
+ // A2A Contract handshake — validate task against agent's contract
+ const registry = this.terminal.moduleManager.modules['AgentRegistryModule'];
+ let contractValid = true;
+ if (registry) {
+ const result = registry.validateTask(agent.role, task);
+ if (!result.valid) {
+ this.terminal.print(`⚠️ A2A validation: ${result.reason}`, 'warning');
+ this.terminal.print(` Contract for '${agent.role}' requires: ${(registry.getContract(agent.role) || {}).input_schema || 'free-form'}`, 'warning');
+ // Offer to proceed anyway (permissive) — user can create a proper contract
+ contractValid = false;
+ } else if (result.reason === 'matched') {
+ this.terminal.print(`✅ A2A contract matched for role '${agent.role}'`, 'success');
+ }
+ }
+
// Create a lease
const leaseModule = this.terminal.moduleManager.modules['LeaseModule'];
const lease = leaseModule ? leaseModule.createLease(['lease-create', agent.id, '60', task]) : null;