(ctx context.Context, line string, engine *agent.QueryEngine, stateRef **agent.AgentState, store *session.Store, sessionID *string, backend luminaui.RendererBackend)
| 372 | } |
| 373 | } |
| 374 | return time.Time{} |
| 375 | } |
| 376 | |
| 377 | func writeJSON(w io.Writer, value any) error { |
| 378 | enc := json.NewEncoder(w) |
| 379 | enc.SetIndent("", " ") |
| 380 | return enc.Encode(value) |
| 381 | } |
| 382 | |
| 383 | func run(args []string) error { |
| 384 | if len(args) > 0 && args[0] == "layout" { |
| 385 | return runLayoutCLI(args[1:]) |
| 386 | } |
| 387 | if len(args) > 0 && args[0] == "daemon" { |
| 388 | return backend.RunDaemonCLI(args[1:]) |
| 389 | } |
| 390 | if len(args) > 0 && args[0] == "shutdown" { |
| 391 | return backend.RunShutdownCLI(args[1:]) |
| 392 | } |
| 393 | if len(args) > 0 && args[0] == "memory" { |
| 394 | return runMemoryCLI(args[1:]) |
| 395 | } |
| 396 | if len(args) > 0 && args[0] == "models" { |
| 397 | return runModelsCLI(args[1:]) |
| 398 | } |
| 399 | if len(args) > 0 && args[0] == "runtime" { |
| 400 | return runRuntimeCLI(args[1:]) |
| 401 | } |
| 402 | if len(args) > 0 && args[0] == "session" { |
| 403 | return runSessionCLI(args[1:]) |
| 404 | } |
| 405 | if len(args) > 0 && args[0] == "cluster" { |
| 406 | return runClusterCLI(args[1:]) |
| 407 | } |
| 408 | flags := flag.NewFlagSet("lumina", flag.ContinueOnError) |
| 409 | flags.SetOutput(os.Stderr) |
| 410 | |
| 411 | prompt := flags.String("prompt", "", "Single-shot mode: execute one prompt and exit.") |
| 412 | promptShort := flags.String("p", "", "Single-shot mode: execute one prompt and exit.") |
| 413 | model := flags.String("model", "", "Model to use.") |
| 414 | apiType := flags.String("api-type", "", "API request format: openai_compatible, anthropic, or auto.") |
| 415 | apiKey := flags.String("api-key", "", "API key.") |
| 416 | baseURL := flags.String("base-url", "", "API base URL.") |
| 417 | maxTokens := flags.Int("max-tokens", 0, "Context window tokens used for local compression.") |
| 418 | yolo := flags.Bool("yolo", false, "Skip permission prompts and OS sandbox isolation.") |
| 419 | cwd := flags.String("cwd", "", "Working directory.") |
| 420 | verbose := flags.Bool("verbose", false, "Enable debug output.") |
| 421 | verboseShort := flags.Bool("v", false, "Enable debug output.") |
| 422 | bare := flags.Bool("bare", false, "Disable long-term memory and other persistent features.") |
| 423 | harnessMode := flags.String("harness-mode", "", "Benchmark harness mode. Supported: terminal-bench.") |
| 424 | listFlag := flags.Bool("list", false, "List saved session files and exit.") |
| 425 | storageFlag := flags.Bool("storage", false, "Show session storage usage and exit.") |
| 426 | cleanupFlag := flags.Bool("cleanup", false, "Dry-run session storage cleanup and exit.") |
| 427 | enforceCleanup := flags.Bool("enforce", false, "Actually apply --cleanup actions.") |
| 428 | resume := flags.String("resume", "", "Resume a previous session by ID.") |
| 429 | |
| 430 | if err := flags.Parse(args); err != nil { |
| 431 | return err |
no test coverage detected