{"version":3,"file":"todo-cli.d.ts","sourceRoot":"","sources":["../../../src/core/todo/todo-cli.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,MAAM,WAAW,mBAAmB;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,gBAAgB;IAChC,KAAK,EAAE;QACN,QAAQ,EAAE,WAAW,CAAC;QACtB,WAAW,EAAE,YAAY,CAAC;QAC1B,QAAQ,EAAE,kCAAkC,CAAC;QAC7C,cAAc,EAAE,MAAM,CAAC;QACvB,WAAW,EAAE,gBAAgB,CAAC;QAC9B,aAAa,EAAE,MAAM,CAAC;QACtB,QAAQ,EAAE,IAAI,CAAC;KACf,CAAC;IACF,IAAI,CAAC,EAAE,mBAAmB,CAAC;CAC3B;AAED,6DAA6D;AAC7D,wBAAgB,qBAAqB,CAAC,WAAW,CAAC,EAAE,mBAAmB,GAAG,gBAAgB,CAazF;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAkBjE","sourcesContent":["/**\n * TODO operability CLI surfaces.\n *\n * The TODO store is advisory session/runtime coordination state. These\n * read-only diagnostics describe the canonical model and, when a live engine\n * diagnostic is supplied, the current scope health. They never expose\n * unrelated task content by default.\n */\n\nimport { DEFAULT_TODO_ENGINE_LIMITS } from \"./todo-engine.js\";\n\nexport interface TodoDiagnosticInput {\n\tscopeId?: string;\n\tprogressEpoch?: number;\n\tlastTodoReadRevision?: number;\n\tsnapshotCount?: number;\n\tledgerCount?: number;\n\teventCount?: number;\n\tchainActive?: boolean;\n\tchainConsecutive?: number;\n\tisLoopBlocked?: boolean;\n}\n\nexport interface TodoStatusReport {\n\tmodel: {\n\t\trevision: \"monotonic\";\n\t\tconcurrency: \"optimistic\";\n\t\trecovery: \"internal_read_and_rebase_bounded\";\n\t\trebaseAttempts: number;\n\t\tidempotency: \"bounded_ledger\";\n\t\tloopThreshold: number;\n\t\tadvisory: true;\n\t};\n\tlive?: TodoDiagnosticInput;\n}\n\n/** Build the canonical TODO status report (text or JSON). */\nexport function buildTodoStatusReport(diagnostics?: TodoDiagnosticInput): TodoStatusReport {\n\treturn {\n\t\tmodel: {\n\t\t\trevision: \"monotonic\",\n\t\t\tconcurrency: \"optimistic\",\n\t\t\trecovery: \"internal_read_and_rebase_bounded\",\n\t\t\trebaseAttempts: DEFAULT_TODO_ENGINE_LIMITS.maxInternalRebaseAttempts,\n\t\t\tidempotency: \"bounded_ledger\",\n\t\t\tloopThreshold: DEFAULT_TODO_ENGINE_LIMITS.maxNoProgressFailures,\n\t\t\tadvisory: true,\n\t\t},\n\t\tlive: diagnostics,\n\t};\n}\n\nexport function formatTodoStatus(report: TodoStatusReport): string {\n\tconst lines: string[] = [];\n\tlines.push(\"TODO subsystem: advisory, NOT execution authority\");\n\tlines.push(`  revision:        ${report.model.revision}`);\n\tlines.push(`  concurrency:     ${report.model.concurrency}`);\n\tlines.push(`  stale recovery:  ${report.model.recovery} (${report.model.rebaseAttempts} attempt(s))`);\n\tlines.push(`  idempotency:     ${report.model.idempotency}`);\n\tlines.push(`  loop threshold:  ${report.model.loopThreshold} consecutive no-progress failure(s)`);\n\tif (report.live) {\n\t\tlines.push(`  scope:           ${report.live.scopeId ?? \"n/a\"}`);\n\t\tlines.push(`  progress epoch:  ${report.live.progressEpoch ?? 0}`);\n\t\tlines.push(`  snapshots:       ${report.live.snapshotCount ?? 0}`);\n\t\tlines.push(`  applied intents: ${report.live.ledgerCount ?? 0}`);\n\t\tlines.push(`  loop blocked:    ${report.live.isLoopBlocked ?? false}`);\n\t} else {\n\t\tlines.push(\"  scope:           (no live session state)\");\n\t}\n\treturn lines.join(\"\\n\");\n}\n"]}