app

package
v0.32.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2026 License: Apache-2.0 Imports: 102 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package app wires each binary: it reads the environment, builds the adapters and servers, and runs them until the root context ends. It is the only importer of every adapter; cmd/<bin>/main.go only builds the root context and logger and calls app.Run<Bin>.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotAdmitted = errors.New("the room refused this run")

ErrNotAdmitted is RunGate's failure when the bridge will never hold the room.

Functions

func RunBridge

func RunBridge(ctx context.Context, log *slog.Logger, getenv func(string) string) error

RunBridge runs room-bridge, the native sidecar of an AgentRun sandbox with a roomRef, until ctx ends, then flushes what it holds. getenv reads its environment (docs/integration.md). It fails before starting on a missing variable, a BROKER_URL that is not https:// or a BROKER_CA_FILE with no CA (GP-18), or a HEALTH_ADDR it cannot listen on.

func RunBroker

func RunBroker(ctx context.Context, log *slog.Logger, args []string, getenv func(string) string) error

RunBroker runs room-broker's subcommand args[0]: serve (the default), retention, migrate or migrate-group. getenv reads ROOMS_CONFIG, ROOMS_DATABASE_URL, POD_NAMESPACE, ROOMS_MCP_KEY, ROOMS_GITHUB_APP_DIR and, for migrate alone, ROOMS_MIGRATION_DATABASE_URL.

func RunController

func RunController(ctx context.Context, logger *slog.Logger, getenv func(string) string) error

RunController runs the run-controller (adoption 3a) until ctx ends. Its cache holds runs and pods in the runs' namespace only; Secrets are read uncached, so it never lists them.

func RunFactory

func RunFactory(ctx context.Context, log *slog.Logger, getenv func(string) string) error

RunFactory runs agent-factory (SP3): the Task reconciler, the issue poller, the run meter and the stop's sweep on the leader; the run-request API on :8082 (plaintext inside the mesh; the broker's :8443 is the TLS listener), :9090 metrics and probes and the GitHub ping on every replica. getenv reads FACTORY_CONFIG and POD_NAMESPACE. A config that does not load fails the start, so a bad config fails the rollout rather than the running factory (§4).

func RunGate

func RunGate(ctx context.Context, log *slog.Logger, getenv func(string) string) error

RunGate runs room-bridge gate, the init container between the bridge and the harness (F15). It returns nil once the bridge holds the room's lease, so the harness may start, and an error once the room refuses the run or ctx ends: the pod's restartPolicy Never then fails the run before the harness runs. It reads the bridge's /admission on loopback at HEALTH_ADDR's port.

func RunMaku

func RunMaku(ctx context.Context, args []string, stdout io.Writer) error

RunMaku runs one maku command (SP2 §8): its files under maku.Dir; a pre-v0.30.0 CLI's directory (formerly `roomctl/`) is imported there once, and its egress goes through httpx.

func RunSlackApp

func RunSlackApp(ctx context.Context, log *slog.Logger, args []string, getenv func(string) string) error

RunSlackApp runs factory-slack-app: Slack's events, the broker's webhooks and the ops listener, until ctx ends. args is `--config <file>` (SLACK_APP_CONFIG when absent).

Types

type ListenFunc

type ListenFunc func(ctx context.Context, network, addr string) (net.Listener, error)

ListenFunc opens one listener. Production passes net.ListenConfig.Listen; tests pass a fake that records the addresses, so the chosen ones are asserted without binding a port.

type Maku

type Maku struct {
	Dir    string       // config.json and token.json, both owner-only
	HC     *http.Client // the room list and the IdP: bounded
	Stream *http.Client // the WebSocket: bounded by the context, not a whole-exchange timeout
	In     io.Reader    // mcp's messages; nil is stdin
	Out    io.Writer
	Err    io.Writer // hints; nil is stderr

	// setup's seams; the zero values are the real home, working directory, PATH and exec.
	Home, Cwd string
	LookPath  func(string) (string, error)
	RunCmd    func(ctx context.Context, argv []string) error

	// Apply creates a run's claim (maku run); nil runs kubectl apply -f - with the manifest on stdin.
	Apply func(ctx context.Context, manifest []byte) error

	// Capture runs a command and returns its output (setup's OpenCode service check); nil runs it.
	Capture func(ctx context.Context, argv []string) (string, error)

	// Ask puts a yes/no question to the developer; nil asks on the terminal when In is one, else
	// nothing is asked. Tests set it.
	Ask func(prompt string) (bool, error)
}

Maku is maku's wiring: where its files live, and its two HTTP clients.

func (Maku) ConfirmConfig

func (r Maku) ConfirmConfig(next, old maku.Config, yes bool) error

ConfirmConfig shows what `configure --from` will write, and what it replaces, then decides: an issuer outside the URL's registrable domain is refused unless yes; a terminal is asked unless yes. The values come from the broker's answer, so the developer sees the two a hostile one would plant.

func (Maku) Run

func (r Maku) Run(ctx context.Context, args []string) error

Run runs one command. A transport failure leaves it naming its cause and fix (#48).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL