Skip to content
humansinstitutePublic

About

Wingman v2 - Wingmen! Multiplayer, remote first, agent teams. Solvitur Ambulando.

Resources

Stars

6 stars

Watchers

0 watching

Forks

Repository files navigation

Wingman

Wingman is the orchestration and control-plane layer for the Wingman suite.

In the current stack:

  • wingman-tower is the workspace authority for auth, groups, encrypted record sync, storage, and service discovery
  • wingman-fd is Flight Deck, the human-first local-first browser workspace
  • wingman-yoke is the agent/operator CLI workspace client
  • wingman-flightlog is the optional memory/history layer
  • wingmen is the session harness that launches, supervises, and connects agents to the rest of the suite

Wingmen does not replace Tower as the source of truth for workspace data. It sits beside the workspace stack and manages agents, sessions, live views, app runtimes, MCP tooling, NIP-98-protected operational APIs, and per-user bot-key flows.

Core Responsibilities

  • Launch and manage agent sessions for Codex, Claude, Goose, OpenCode, and other supported adapters
  • Provide browser control surfaces such as /home and /live
  • Broker MCP tools and agent-side capabilities back into Wingman over HTTP
  • Manage per-user bot keys, session identity, and delegated NIP-98 flows
  • Expose operational APIs for apps, git/Gitea, jobs, memories, Nostr, and SuperBased/Flux operations
  • Inject agent-local environment and MCP configuration, including bot-key material when available

Terminology Notes

Some internal routes and modules still use older naming:

  • autopilot-jobs is the current internal/API path for the Jobs subsystem
  • AGENT_NSEC is the environment variable used to inject a session bot key into an agent process
  • some wm21 references are deployment-specific defaults or admin fallbacks, not product concepts

Those names are still real implementation details, but the current product framing is:

  • Wingman = orchestration platform
  • Jobs = reusable job definitions and runs
  • Delegate sessions / agent sessions = the programmable session layer around agents

Getting Started

Install dependencies:

bun install

Launch the orchestration server:

bun start

Visit:

  • http://localhost:<PORT>/home for the session dashboard
  • http://localhost:<PORT>/live for the real-time live/session surface

Runtime Model

Wingmen is a long-running Bun server that:

  1. serves the web UI and operational HTTP APIs
  2. allocates ports and spawns agent runtimes
  3. tracks sessions, logs, messages, and status
  4. injects MCP config and per-session identity/env context
  5. exposes higher-level app, git, job, memory, and Nostr tooling to agents and operators

Jobs

The current Jobs subsystem is user-facing as “Jobs”, but internally still uses autopilot-jobs in API paths and some module names.

Examples:

  • /api/autopilot-jobs/definitions
  • /api/autopilot-jobs/runs
  • src/jobs-api.ts

Treat this as a naming-compatibility layer rather than a separate product.

App Lifecycle CLI (NIP-98)

Use scripts/wingman-appctl.ts to control registered apps over HTTP with NIP-98 auth headers.

export WINGMAN_NSEC=nsec1...

bun run appctl list
bun run appctl status <app-id>
bun run appctl start <app-id>
bun run appctl stop <app-id>
bun run appctl setup <app-id>

Options:

  • --base-url <url> target Wingman base URL
  • --key <nsec|hex> override signing key for this invocation
  • --json print raw API responses

Environment

Variable Description Default
PORT Primary Wingman UI/API port 3600
AGENT_PORTS Starting port assigned to agent subprocesses 3700
AGENT_MAX Total number of concurrent agent ports available 10
HOST_URL_BASE Template for app links; <port> is replaced with the app's assigned port https://host.otherstuff.ai/<port>
DIRECTORY_DEF Working directory used when launching agent subprocesses ~/code
FOLDERACCESS Comma-separated directories exposed to file browsers and pickers DIRECTORY_DEF
AGENT_SPAWN_MODE Primary spawn-mode setting: bun or pm2 bun
AGENT_MODE Deprecated compatibility input only unset
AGENTAPI_BIN Primary binary path for the AgentAPI executable ./out/agentapi
CLAUDE_CLI Executable invoked for Claude sessions claude
GLOVES Claude approval mode; OFF adds skip-permissions unset
GOOSE_CLI Executable invoked for Goose sessions goose
CODEX_CLI Executable invoked for Codex sessions codex
OPENCODE_CLI Executable invoked for OpenCode sessions opencode
AGENTAPI_ALLOWED_ORIGINS Value passed to AgentAPI --allowed-origins *
AGENTAPI_ALLOWED_HOSTS Value passed to AgentAPI --allowed-hosts localhost,127.0.0.1,[::1]

Workflow Overview

  • Home lists sessions and lets operators start or stop agents.
  • Live shows running sessions, conversation state, logs, and prompt dispatch.
  • Jobs let operators define reusable manager/worker execution patterns.
  • App management controls registered local apps.
  • MCP tooling exposes memories, git, Nostr, image generation, SuperBased access, and more to agents.

Refer to docs/architecture.md for the current technical split.

Session Persistence

For persistence across Wingman restarts, use PM2-backed spawning:

AGENT_SPAWN_MODE=pm2 bun start

Legacy fallback also works:

AGENT_MODE=pm2 bun start

Active contract:

  • use AGENT_SPAWN_MODE to choose bun or pm2
  • use AGENTAPI_BIN to choose which agentapi binary Wingman launches
  • AGENT_MODE is deprecated compatibility only

Documentation Notes

  • docs/architecture.md is the main current technical map
  • docs/asbuilt/ and docs/as_built/ contain historical snapshots and implementation notes
  • design docs may still mention older internal names such as autopilot-jobs; treat those as implementation compatibility unless they explicitly propose a new contract

About

Wingman v2 - Wingmen! Multiplayer, remote first, agent teams. Solvitur Ambulando.

Resources

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages