{
  "$schema": "https://agora-protocol.org/schemas/orchestration/v1",
  "protocolVersion": "1.0",
  "name": "Ghost AGORA Orchestration",
  "description": "Natural language-driven orchestration protocol for Ghost — enables Ghost to understand, decompose, and route complex multi-step requests to appropriate on-device capabilities or delegate to external agents.",
  "agent": {
    "id": "ghost-ai-personal-intelligence",
    "name": "Ghost",
    "role": "orchestrator",
    "description": "Ghost acts as a personal orchestrator — receiving natural language requests, decomposing them into tasks, executing on-device capabilities, and optionally delegating to external agents."
  },
  "orchestration": {
    "mode": "conversational",
    "decomposition": {
      "strategy": "llm_driven",
      "model": "reflex",
      "description": "Ghost uses its on-device Gate and Reflex models to decompose complex requests into actionable tasks."
    },
    "routing": {
      "strategy": "capability_match",
      "preferences": [
        {
          "priority": 1,
          "target": "on_device",
          "description": "Prefer executing tasks locally on-device for privacy and speed"
        },
        {
          "priority": 2,
          "target": "local_agents",
          "description": "Delegate to agents on the local network via ANP"
        },
        {
          "priority": 3,
          "target": "remote_agents",
          "description": "Delegate to cloud agents only with explicit user consent"
        }
      ]
    },
    "taskLifecycle": {
      "states": ["proposed", "approved", "executing", "completed", "failed", "cancelled"],
      "transitions": [
        {"from": "proposed", "to": "approved", "requires": "auto_or_user_approval"},
        {"from": "approved", "to": "executing", "trigger": "start"},
        {"from": "executing", "to": "completed", "trigger": "success"},
        {"from": "executing", "to": "failed", "trigger": "error"},
        {"from": "any", "to": "cancelled", "trigger": "user_cancel"}
      ]
    }
  },
  "capabilities": {
    "internalCapabilities": [
      {
        "id": "conversation",
        "naturalLanguageTriggers": [
          "talk to me about *",
          "explain *",
          "help me with *",
          "what do you know about *"
        ]
      },
      {
        "id": "memory_store",
        "naturalLanguageTriggers": [
          "remember that *",
          "note that *",
          "save this: *",
          "keep in mind that *"
        ]
      },
      {
        "id": "memory_recall",
        "naturalLanguageTriggers": [
          "what do you remember about *",
          "recall *",
          "what did I tell you about *",
          "search my memories for *"
        ]
      },
      {
        "id": "compose",
        "naturalLanguageTriggers": [
          "write a * about *",
          "draft an email *",
          "compose a message *",
          "create a summary of *"
        ]
      },
      {
        "id": "translate",
        "naturalLanguageTriggers": [
          "translate * to *",
          "say * in *",
          "how do you say * in *"
        ]
      },
      {
        "id": "voice_mode",
        "naturalLanguageTriggers": [
          "let's talk",
          "voice mode",
          "speak to me in *",
          "read that aloud"
        ]
      }
    ],
    "delegatable": [
      {
        "id": "web_search",
        "description": "Internet search (Ghost is offline — delegates to web-capable agents)",
        "naturalLanguageTriggers": ["search the web for *", "google *", "find online *"],
        "requiresConsent": true
      },
      {
        "id": "calendar_action",
        "description": "Calendar management via external calendar agents",
        "naturalLanguageTriggers": ["add to calendar *", "schedule *", "check my calendar"],
        "requiresConsent": true
      },
      {
        "id": "email_send",
        "description": "Email sending via external email agents",
        "naturalLanguageTriggers": ["send an email to *", "email * about *"],
        "requiresConsent": true
      },
      {
        "id": "smart_home",
        "description": "Smart home control via IoT agents",
        "naturalLanguageTriggers": ["turn on the *", "set temperature to *", "dim the lights"],
        "requiresConsent": true
      }
    ]
  },
  "conversation": {
    "followUpStrategy": "memory_augmented",
    "clarificationThreshold": 0.6,
    "maxTurns": 100,
    "contextCarryover": true,
    "description": "Ghost maintains conversation context in neural cache and augments with memory graph. Asks clarifying questions when intent confidence drops below threshold."
  }
}
