name: content_production
version: "1.0"
description: "AI内容生产全流水线 - 从选题到发布就绪"

variables:
  default_tone: "professional"
  default_platform: "zhihu"

stages:
  - name: topic_selection
    agent: content_generator
    action: generate_topics
    inputs:
      knowledge_base_ids: "${kb_ids}"
      brand_context: "${brand_name}"
      industry: "${industry}"
      count: 5
    outputs: [topics, topic_scores]
    timeout_seconds: 120

  - name: content_generation
    agent: content_generator
    action: generate_article
    depends_on: [topic_selection]
    inputs:
      topic: "${stages.topic_selection.outputs.topics}"
      knowledge_context: "${knowledge_context}"
      tone: "${tone}"
      word_count: 2000
    outputs: [draft_content, outline]
    timeout_seconds: 300

  - name: deai_processing
    agent: deai_agent
    action: humanize
    depends_on: [content_generation]
    inputs:
      content: "${stages.content_generation.outputs.draft_content}"
      style: "natural"
    outputs: [humanized_content]
    timeout_seconds: 180

  - name: geo_optimization
    agent: geo_optimizer
    action: optimize
    depends_on: [deai_processing]
    inputs:
      content: "${stages.deai_processing.outputs.humanized_content}"
      target_keywords: "${target_keywords}"
      platform: "${target_platform}"
    outputs: [optimized_content, seo_score]
    timeout_seconds: 180

  - name: rule_validation
    agent: rule_checker
    action: validate
    depends_on: [geo_optimization]
    inputs:
      content: "${stages.geo_optimization.outputs.optimized_content}"
      platform: "${target_platform}"
      rules: "${platform_rules}"
    outputs: [is_valid, issues, suggestions]
    timeout_seconds: 60
    continue_on_failure: true
