DISCOVERED FROM REAL IMPORT EDGES

Architecture

Public façades, their true dependencies (including lazy-loaded engines), owned helper folders, executables, and built-in IO modes — collected from the source tree on every build.

Public modules

Agent lib/agent.js

Depends on: Agent.Context, Agent.Env, Agent.IO, Agent.Jobs

Owns lib/agent/ (29 files)

Agent.Context lib/context.js

Depends on no other public module.

Owns lib/context/ (13 files)

Agent.Env lib/env.js

Depends on no other public module.

Owns lib/env/ (38 files)

Agent.IO lib/io.js

Depends on: Agent.Context, Agent.Env

Owns lib/io/ (10 files)

Agent.Jobs lib/jobs.js

Depends on: Agent, Agent.Context, Agent.Env, Agent.IO

Owns lib/jobs/ (19 files)

App lib/app.js

Depends on: Agent, Agent.Context, Agent.Env, Agent.IO, App.CLI, App.GTUI, App.Markdown, App.TUI, App.Web

Owns lib/app/cli/ (15 files — the user-editable endpoint policies the TUI and Web settings menus share: `providers.<endpoint>.disabled` (endpoint only) and `maxActive` (endpoint, or one model through `providers.<endpoint>.models.<model>.maxActive`). Reads come from the Env catalog plus the settings view; writes go through the settings view, which persists only the changed path.)

Owns lib/app/gtui/ (31 files — lib/app/gtui)

Owns lib/app/host/ (3 files — shared (used by lib/app/cli, lib/app/tui, lib/app/web))

Owns lib/app/markdown/ (10 files — shared (used by lib/app/tui, lib/app/web))

Owns lib/app/shared/ (6 files — shared (used by lib/app/cli, lib/app/tui, lib/app/web))

Owns lib/app/tui/ (45 files — Private access-menu execution. Reducers capture targets; tasks own asynchronous work.)

Owns lib/app/web/ (63 files — Agent status projection.)

App.CLI lib/app/cli.js

Depends on: Agent, Agent.Context

Owns lib/app/cli/ (15 files)

App.GTUI lib/app/gtui/gtui.js

Depends on no other public module.

Owns lib/app/gtui/ (31 files)

App.Markdown lib/app/markdown/index.js

Depends on no other public module.

Owns lib/app/markdown/ (10 files)

App.TUI lib/app/tui/index.js

Depends on: Agent, Agent.Context, Agent.Env, Agent.IO, App.CLI, App.GTUI, App.Markdown

Owns lib/app/tui/ (45 files)

App.Web lib/app/web/index.js

Depends on: Agent, Agent.Context, Agent.Env, Agent.IO, App.CLI, App.Markdown

Owns lib/app/web/ (63 files)

Executables

  • agent — agent — headless tool-loop CLI (thin binding over lib/agent.js).
  • app — app — map command-line syntax into normalized application state.
  • io — io — one-request provider CLI (thin binding over lib/io.js).
  • jobs — Thin operator CLI: maps argv to the Jobs façade and prints short notes.
  • rename — bin/scripts/rename — switch the product namespace and regenerate bin wrappers.
  • skills — skills — the skill-registry CLI.
  • tool — tool — call any registered tool directly from the terminal (a thin wrapper over Env.toolCall, see lib/env/tool-registry.js and the "Tool contract" section of API.md).
  • tools2bash — Generate direct shell commands for non-agent-specific tools.
  • web-demo — web-demo — run the web app against the scripted TEST provider with an isolated settings + sessions folder (ai-tmp/web-demo), so the UI can be exercised end to end with no network, no real model, and no writes to the user's real settings or sessions.

Built-in IO modes

alt inline line

Environment auto-detection

At startup Agent.Env.open(path) loads providers and detects endpoints from process environment keys and local-server probes. Environment-only discovery is cached once per Env and provider; local probes and custom detectors remain live, and settings-file discovery continues. Detected connection facts and credentials stay in memory, while endpoint and model preferences can persist through env.settings. Repeated identical detection preserves learned catalogs and runtime edits. Explicit settings retain precedence over detected facts; no key is written to disk by detection.

environmentdetected endpoint
OPENAI_API_KEY (+ optional OPENAI_BASE_URL)openai (OpenAI Responses)
AZURE_OPENAI_API_KEY (+ required AZURE_OPENAI_BASE_URL)azure-openai (OpenAI Responses)
XAI_API_KEYxai (OpenAI Responses)
MOONSHOT_API_KEY (+ optional MOONSHOT_BASE_URL)moonshot (Kimi Platform)
KIMI_API_KEYkimi (Kimi Platform; Kimi Code subscription requires separate sign-in)
ANTHROPIC_API_KEY or ANTHROPIC_AUTH_TOKEN (+ optional ANTHROPIC_BASE_URL)anthropic (Anthropic Messages)
Ollama server probe, http://localhost:11434/api/tagsollama
LM Studio server probe, http://localhost:1234/v1/modelslm-studio (OpenAI-compatible)

Harness environment variables

The namespace-derived set the harness itself reads (OMOYA_/omoya become <NS>_/<ns> when the package is renamed; the plain AI_* settings names are the still-honored legacy spellings):

variableeffect
OMOYA_SETTINGS_DIR / OMOYA_SETTINGS / AI_SETTINGS_DIR / AI_SETTINGSOverride the user settings folder (first non-empty wins; created when missing).
OMOYA_SKILLS_DIRDelimiter-separated extra skill roots, scanned after the package and settings layers.
OMOYA_PROMPTS_DIRDelimiter-separated extra prompt roots, accumulated the same way.
OMOYA_OS_SANDBOXSet to none to disable the OS write-sandbox probe — the Agent then forces safe mode. Intended for tests and restricted hosts.
OMOYA_TOOL_WORKERInternal marker the tool sandbox sets on forked mutating-tool workers.