Skip to main content

Module todo

Module todo 

Source
Expand description

Phased todo tool (init/start/done/drop/rm/append/view). Todo tool — phased task management with 7 ops.

omp tools/todo.ts (938줄) 계약 이식:

  • 7 ops: init, start, done, drop, rm, append, view
  • 3상태 정규화 (in_progress는 한 phase에 하나)
  • Markdown 라운드트립
  • sub-agent 매칭 헬퍼 (⑥ 연동 후 활성화)

Structs§

CollapsedSelection
Result of select_collapsed_todos: the rows to render plus an optional “… N more” summary line.
InitListEntry
A phase seed supplied to the init op.
MidRunNudgeState
Tracks mutating-tool-call volume since the last todo touch, to fire a hidden mid-run reconciliation nudge. Ports omp’s TodoTracker’s nudge half (todo-tracker.ts:15-16, 110-116).
StopReminderState
State for the stop-time incomplete-todo reminder, scoped to a single agent run. build_stop_reminder mutates it to dedup unchanged open-task sets and cap total reminders.
TodoCompletionTransition
Describes a task that newly transitioned to completed.
TodoItem
A single task within a phase.
TodoPhase
A named group of related tasks within a todo list.
TodoTool
todo agent tool. 상태 비저장 (상태는 TodoStateProvider가 보유).
TodoUpdateResult
Result of applying a batch of todo ops.

Enums§

TodoOp
Operations that can be applied to a todo list.
TodoStatus
Status of a single todo task.

Constants§

MAX_TODO_STOP_REMINDERS
Maximum stop-reminder injections per agent run. A hard cap so a misbehaving agent (e.g. one that keeps adding todos and then stopping) cannot loop indefinitely.

Functions§

apply_ops
Apply a sequence of ops, returning the result + transitions + errors.
build_stop_reminder
Build a stop-time reminder when the todo list has open tasks.
find_phase_fuzzy
Exact (case-insensitive) -> unique prefix -> unique substring. Ambiguous or no match -> None. Ports omp’s findPhaseFuzzy (todo-command-controller.ts:81-92).
find_task_fuzzy
Exact content match -> unique substring match -> if ambiguous, prefer a single in_progress/pending hit. Ports omp’s findTaskFuzzy (todo-command-controller.ts:94-113).
format_summary
Render a human-readable summary of the todo list for display.
markdown_to_phases
Markdown 체크리스트 → phases. 헤더 (## Phase 또는 N. Phase)와 체크박스 파싱. omp markdownToPhases 계약.
phases_to_markdown
phases → Markdown 체크리스트. 다중 phase면 로마 숫자 헤더.
reconcile_with_subagents
Auto-complete open todos whose content matches a subagent that finished successfully. Ports omp’s #reconcileTodosWithSubagents (interactive-mode.ts:2369-2404). Idempotent: never touches an already closed task. Failed/aborted subagents are the caller’s responsibility to exclude from completed_descriptions — this function only matches.
roman_numeral
Convert a small integer (1–3999) to its uppercase Roman-numeral string (e.g. 4"IV", 6"VI"). Used for phase display names.
select_collapsed_todos
Walking-viewport selection for a phase’s collapsed todo preview. Ports omp’s selectCollapsedTodos (todo.ts:332-350).
todo_matches_any_description
todo 내용과 서브에이전트 설명이 같은 작업을 가리키는지. 6자 이상 중복 정규화 매칭 (omp TODO_DESCRIPTION_MIN_OVERLAP).
tokenize_quoted
Quote-aware tokenizer: splits on whitespace, respects "…" groups, and honors backslash escapes. Ports omp’s tokenize (todo-command-controller.ts:37-58).