aethershell 11.0.1

The world's first multi-agent shell with typed functional pipelines and multi-modal AI
// AetherShell TUI Agent Swarm Demo
// Launch with: ae tui
//
// This demo showcases multi-agent coordination in the TUI:
// - Agent creation
// - Swarm coordination
// - Real-time agent status
// - Task distribution
//
// It calls a live model, so it needs a provider. Without one it says so and
// stops rather than failing partway through.

if env("AETHER_AI") == null {
  print("Skipping: this example calls a live model. Set AETHER_AI to one of openai, ollama, irongate or compat (plus the matching API key) and run it again.")
}
if env("AETHER_AI") == null { exit(0) }

// A swarm takes the goal, the tools its agents may use, and a step budget.
// An earlier version of this file built individual `agent {...}` objects and
// passed them to `swarm {agents: [...], policy: ...}`; no such shape exists,
// so none of it ran.
let content_team = swarm({
  goal: "Create a comprehensive guide on functional programming",
  tools: ["read_file", "write_file", "web_search"],
  max_steps: 15
})

print(content_team)

// The TUI provides:
// - Agent status panel (active, idle, completed)
// - Message blackboard view
// - Step-by-step execution trace
// - Agent communication visualization
// - Resource usage metrics
// - Pause/resume controls
//

// Sequential alternative: one agent per step, each with its own goal.
// (`agents_run_sync` was called here and has never existed.)
let step1 = agent({goal: "Gather requirements", tools: ["read_file"], max_steps: 5})
let step2 = agent({goal: "Design the solution", tools: ["read_file"], max_steps: 5})
let step3 = agent({goal: "Review the design", tools: ["read_file"], max_steps: 3})

print(step1)
print(step2)
print(step3)

print("TUI Agent Swarm Demo Ready! Launch with: ae tui")