import type { ChildProcess, SpawnOptions } from 'node:child_process';
import { init } from './init.js';
type AgentsModule = typeof import('./agents/index.js');
export declare const HELP = "Usage:\n next-observer init [--root
] [--proxy]\n Connect a Next.js app to next-observe: install it, wrap next.config in withObserve(), add instrumentation.ts and\n instrumentation-client.ts, and an \"observe\" script. Safe to run again. --proxy also adds the runtime proxy route.\n\n next-observer dev [--root ] [--port ] [-- ]\n Start the collector and `next dev` for the app in (default: current directory).\n Example: next-observer dev --root apps/web -- -p 3100\n\n next-observer collector [--host ] [--port ] [--api-key ] [--ui-password ] [--demo]\n Start only the collector (e.g. on a server). Reads OBSERVE_HOST, OBSERVE_PORT, OBSERVE_API_KEY, OBSERVE_UI_PASSWORD.\n --api-key protects ingest (x-api-key); --ui-password protects the UI, API and chat (browser login).\n --demo preloads the workshop \"shop\" scenario (a regression in v2, 30% inventory errors, an N+1, an error new in v2).\n\nEnvironment: OBSERVE_ROOT, OBSERVE_PORT (default 4318), OBSERVE_HOST (default 127.0.0.1), OBSERVE_API_KEY,\n OBSERVE_AI (mock | real), OBSERVE_DETECTOR (off to disable the anomaly detector),\n OBSERVE_APP_URL (where the checks from observe.checks.ts are sent; default http://localhost:3000),\n OBSERVE_MODEL_TIMEOUT_MS (one model call; default 90000, a call that hangs is started again once),\n OBSERVE_AUTO_INVESTIGATIONS (investigations the agents start on their own: 5, 5/30m or 5/2h; default 5 per\n 60 min, 0 = only when asked)";
export declare class CliError extends Error {
}
export type Env = Record;
export interface CliArgs {
command: 'init' | 'dev' | 'collector' | 'help';
root: string;
port: number;
host: string;
apiKey?: string;
uiPassword?: string;
demo: boolean;
proxy: boolean;
nextArgs: string[];
}
export declare function parseCliArgs(argv: string[], env: Env, cwd: string): CliArgs;
export interface CliDeps {
env: Env;
cwd: string;
log: (line: string) => void;
spawn: (command: string, args: string[], options: SpawnOptions) => ChildProcess;
/** Resolves when the CLI should stop (SIGINT/SIGTERM in real use). */
shutdownSignal: Promise;
/** Replaces init() in tests. */
init?: typeof init;
/** Loads the agents module; injectable for tests. */
loadAgents?: () => Promise;
}
export declare const AGENTS_FILES: string[];
export declare const CHECKS_FILES: string[];
/**
* Where checks with a path go: OBSERVE_APP_URL, else the host and port `next dev` was given (-H, -p, PORT), else
* localhost:3000. A guess: when that port is busy `next dev` moves to the next free one without telling us — the banner
* names the address so it can be compared with the one Next prints.
*/
export declare function appUrl(env: Env, nextArgs?: string[]): string;
/** What protects the collector — and a warning when it listens beyond this machine with an open UI. */
export declare function authLines(args: Pick): string[];
export declare function run(argv: string[], deps: CliDeps): Promise;
export {};