rust-pipe 0.1.1

Lightweight typed task dispatch from Rust to polyglot workers (TypeScript, Python, Go, Java, C#, Ruby, Elixir, Swift, PHP)
Documentation
#!/bin/bash
# Mock ssh command for testing SshTransport
# Ignores all SSH flags, just acts as a stdio pipe to the "remote command"

# Skip all flags until we find the user@host argument
while [[ "$1" == -* ]]; do
  if [[ "$1" == "-o" || "$1" == "-p" || "$1" == "-i" ]]; then
    shift 2
  else
    shift
  fi
done

# $1 is now user@host, $2 is the remote command — we just act as a worker
while IFS= read -r line; do
  msg_type=$(echo "$line" | jq -r '.type // empty' 2>/dev/null)
  case "$msg_type" in
    "TaskDispatch")
      task_id=$(echo "$line" | jq -r '.task.id')
      task_type=$(echo "$line" | jq -r '.task.taskType')
      echo "{\"type\":\"TaskResult\",\"result\":{\"taskId\":\"$task_id\",\"status\":\"Completed\",\"payload\":{\"source\":\"ssh\",\"taskType\":\"$task_type\"},\"durationMs\":3,\"workerId\":\"ssh-mock\"}}"
      ;;
    "Shutdown")
      exit 0
      ;;
  esac
done