Class CliStateStore

java.lang.Object
ai.mindconnect.cli.CliStateStore

@Component public class CliStateStore extends Object
Reads and writes CliState to ~/.mindconnect-cli/state.json.

Failure-tolerant: a missing file, malformed JSON, or any IO error returns CliState.empty() and logs a warning. Writes are best-effort — if the file cannot be written the CLI continues to work, the user just won't be resumed on the next start.

Writes are atomic: data goes to state.json.tmp first and is then moved over state.json with StandardCopyOption.ATOMIC_MOVE so a crash mid-write can never leave a half-written state file.

  • Constructor Details

    • CliStateStore

      public CliStateStore(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
  • Method Details