vibe-action 0.2.2

Command router — execute shell commands and LLM prompts via simple YAML actions.
version: 0.0.1

name: translate-deep
about: Deep two-stage translation using local drafting and cloud polishing
notify: true

args:
  - name: to
    short: l
    input: string
    default: 'Russian'
    help: Target language (e.g., Russian, English, Chinese)

api:
  output: clipboard
  input: query

actions:
  # Read input from query (prioritize file path if valid, otherwise use raw text)
  - tag: tag_content
    run: cmd
    expect: string
    check: .+
    action:
      - when: '{query|file_path|empty:not}'
        then: cat "{query|file_path|load}"
      - when: '{query|empty:not}'
        then: echo "{query}"
      - when: 'true'
        then: echo "ERROR - No input provided"

  # Local model generates a raw text translation
  - tag: tag_draft
    run: small
    expect: string
    action: |
      [Task]
      Translate the entire [Text] to the language specified in [User].
      Do not translate proper names, code, or comments inside code blocks.
      Reply with the full raw translated text.

      [User]
      {to}

      [Text]
      {tag_content}

  # Powerful cloud model polishes and refines the draft without original context
  - tag: tag_translated
    run: medium
    expect: string
    action: |
      [Task]
      Act as an expert native editor and senior technical writer.
      Review, polish, and fix the IT slang and phrasing in this rough draft translated into the language specified in [User].
      Keep formatting, code blocks, and proper names intact. Output ONLY the polished final text.

      [User]
      {to}

      [Rough Draft]
      {tag_draft}

  # Copy result to clipboard and output
  - tag: tag_clipboard
    run: value
    expect: string
    action: '{tag_translated|clipboard}'