# SPDX-FileCopyrightText: 2025 OmniNode.ai Inc.
# SPDX-License-Identifier: MIT

# Copyright (c) 2025 OmniNode Team
#
# ONEX Node Contract — generated by generate_skill_node.py
# Node: NodeSkillSKILL_NAME_SNAKEOrchestrator
# Skill: SKILL_NAME
# Created: CREATED_DATE
#
# Orchestrator shell node: dispatches skill invocations to the polymorphic
# agent (Polly) via the shared handle_skill_requested handler.
# All heavy logic lives in the shared handler — this node is a thin shell.

# Contract identifiers
name: node_skill_SKILL_NAME_SNAKE_orchestrator
contract_name: node_skill_SKILL_NAME_SNAKE_orchestrator
node_name: node_skill_SKILL_NAME_SNAKE_orchestrator

contract_version:
  major: 1
  minor: 0
  patch: 0

node_version:
  major: 1
  minor: 0
  patch: 0

# Node type
node_type: ORCHESTRATOR_GENERIC

# Description
description: >
  Orchestrator node for the SKILL_NAME skill.
  SKILL_DESCRIPTION
  Dispatches skill invocations to the polymorphic agent via the shared
  handle_skill_requested handler. Subscribes to command events, emits
  outcome events on success or failure.

# Strongly typed I/O models (shared across all skill nodes)
input_model:
  name: ModelSkillRequest
  module: omniclaude.shared.models

output_model:
  name: ModelSkillResult
  module: omniclaude.shared.models

# Execution backend configuration
execution:
  backend: claude_code       # claude_code | local_llm
  model_purpose: null        # null for claude_code; required for local_llm
                             # valid: CODE_ANALYSIS | REASONING | ROUTING | GENERAL

# Event bus configuration
event_bus:
  subscribe:
    topic: "onex.cmd.omniclaude.SKILL_NAME.v1"
    consumer_group: "omniclaude.skill.SKILL_NAME_SNAKE"
  publish:
    success_topic: "onex.evt.omniclaude.SKILL_NAME-completed.v1"
    failure_topic: "onex.evt.omniclaude.SKILL_NAME-failed.v1"

  # Canonical topic registry (gap-analysis scanner) [OMN-3373]
  subscribe_topics:
    - "onex.cmd.omniclaude.SKILL_NAME.v1"
  publish_topics:
    - "onex.evt.omniclaude.SKILL_NAME-completed.v1"
    - "onex.evt.omniclaude.SKILL_NAME-failed.v1"

# Capabilities
capabilities:
  - name: skill.SKILL_NAME_SNAKE
    description: Dispatch SKILL_NAME skill to polymorphic agent
    version: 1.0.0

# IO operations
io_operations:
  - operation: skill_requested
    description: Dispatch SKILL_NAME skill invocation to polymorphic agent
    handler_method: handle_skill_requested
    input_fields:
      - skill_name: str
      - skill_path: str
      - args: dict[str, str]
      - correlation_id: UUID
    output_fields:
      - skill_name: str
      - status: SkillResultStatus
      - output: str | None
      - error: str | None
      - correlation_id: UUID
    idempotent: false

# Dependencies
dependencies:
  - name: handler_skill_requested
    type: handler
    function: handle_skill_requested
    module: omniclaude.shared
    pluggable: false

# Error handling
error_handling:
  retry_policy:
    max_retries: 2
    initial_delay_ms: 500
    max_delay_ms: 5000
    exponential_base: 2
    retry_on:
      - SkillDispatchError
      - SkillTimeoutError
  circuit_breaker:
    enabled: false

# Metadata
metadata:
  author: OmniNode Team
  license: MIT
  generated_by: generate_skill_node.py
  maturity: stub
  tags:
    - orchestrator
    - skill
    - SKILL_NAME_SNAKE
