#!/usr/bin/env node // mosaic inbox | decide | tasks | agents | trail | talk | stop | launches, // and mosaic bus start|stop|status. See packages/cli/README.md. Exit codes // are in src/errors.mjs. // // The human commands read and resolve through the broker's human transport // (src/transport.mjs), never the SQLite file. `bus start` is the trusted // host (src/host.mjs) the systemd unit mosaic-bus@ runs; with // --pm it also launches the business's PM (src/launcher.mjs). import { lstatSync, readFileSync } from "node:fs"; import { join } from "node:path"; import { createInterface } from "node:readline/promises"; import { fileURLToPath } from "node:url"; import { BINDING_NAME } from "../../discord/src/binding.mjs"; import { projectBusCommand, projectCommand, PROJECT_BUS_USAGE, PROJECT_USAGE } from "./project.mjs"; import { resolveThread, threadCommand, threadMembers, threadsCommand, THREAD_TALK_USAGE, THREAD_USAGE, THREADS_USAGE } from "./thread.mjs"; import { sessionCommand, SESSION_USAGE } from "./session.mjs"; import { limitsCommand, LIMITS_USAGE } from "./limits.mjs"; import { pluginsCommand, PLUGINS_USAGE } from "./plugins.mjs"; import { proxyCommand } from "./model-proxy.mjs"; import { credentialsCommand, CREDENTIALS_USAGE } from "./credentials.mjs"; import { hostsCommand, HOSTS_USAGE } from "./hosts.mjs"; import { grantsCommand, GRANTS_USAGE } from "./grants.mjs"; import { instancesCommand, INSTANCES_USAGE } from "./instances.mjs"; import { accessCommand, accessContextFor } from "./access.mjs"; import { createChannelCaller } from "../../plugins/src/channel.mjs"; import { PluginError } from "../../plugins/src/kinds.mjs"; import { CliError } from "./errors.mjs"; import { bootConfig, loadSystem, socketPath } from "./config.mjs"; import { bootLine, readBootStatus, recordBootOk, recordBootRefused } from "./boot-status.mjs"; import { businessFilePath, configDir } from "../../business/src/index.mjs"; import { busExit, humanTransport, refuseInsideAgent, testerTransport } from "./transport.mjs"; import { formatAgents, formatDecision, formatInbox, formatTasks, formatTrail, shortId } from "./format.mjs"; import { hostStatus, readHostState, startHost, stopHost } from "./host.mjs"; import { createLauncher } from "./launcher.mjs"; import { quitLine, runApp } from "./app.mjs"; import { readSessions, stopSession } from "../../seat/src/session.mjs"; import { SeatError } from "../../seat/src/seat.mjs"; import { usageCommand, USAGE_USAGE } from "./usage.mjs"; export const USAGE = `usage: ${USAGE_USAGE} ${LIMITS_USAGE} ${PLUGINS_USAGE} ${CREDENTIALS_USAGE} mosaic proxy fetch | init [--port N] [--business ID] [--rotate-grace-minutes N] [--first-output-seconds N] ${HOSTS_USAGE} ${GRANTS_USAGE} ${INSTANCES_USAGE} ${PROJECT_USAGE} ${PROJECT_BUS_USAGE} ${THREADS_USAGE} ${THREAD_USAGE} ${SESSION_USAGE} mosaic inbox [--business ] [--json] [--tester] mosaic inbox --read ... | --read-all [--business ] mosaic decide