From a5023e61be61f2f2287342039addab6bb28ad2fd Mon Sep 17 00:00:00 2001 From: Agando Date: Thu, 4 Jun 2026 06:01:04 +0200 Subject: auto: 2026-06-04_06:00 changes --- modules/core/module-orchestrator.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'modules/core/module-orchestrator.js') 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; -- cgit v1.2.3