6 Commits

Author SHA1 Message Date
Marcello Pichini
129aadcf57 fix(cli): print notebook text without parsing Rich markup (#2849)
Notebook names, descriptions, record titles and IDs were interpolated
into Rich markup strings, so `notebook show` and `notebook list` altered
bracketed text and crashed with MarkupError on an unmatched closing tag.
Render those values as rich.text.Text instead.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 00:26:02 +08:00
Bingxi Zhao (Frank)
2cc3c4ae27 Merge #2317 from rudycelekli 2026-11-06 01:56:40 +08:00
Bortlesboat
f8540eb5c7 fix(cli): print session and notebook JSON without Rich markup or wrapping
`session show --format json`, `notebook show --format json` and
`notebook create` passed json.dumps() output to console.print(), which
treats a plain string as Rich text: long lines were wrapped inside JSON
strings (invalid JSON), [bracketed] text was dropped, a stray closing
tag such as [/INST] raised MarkupError, and :name: codes became emoji.

Use console.print_json() as the kb, config and doctor commands already
do, and turn off emoji codes in the `run --format json` NDJSON stream,
which already disabled markup and wrapping.
2026-11-05 00:37:16 -05:00
Rudy Celekli
bbdf745f42 fix(cli): decode non-UTF-8 markdown in notebook add-md/replace-md
`notebook add-md` and `replace-md` read the file with read_text(encoding="utf-8"),
so a markdown file in another encoding (e.g. a Windows-authored cp1252/latin-1
file) aborted the command with an uncaught UnicodeDecodeError traceback instead
of the clean CLI errors these commands raise for other problems.

Read the bytes and decode through FileTypeRouter.decode_bytes, the shared
fallback-encoding chain the rest of the app already uses for text input (as in
`deeptutor notebook`'s sibling `kb` command).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-01 09:34:39 -05:00
Bingxi Zhao (Frank)
824bf778df fix: lint & logging system 2026-05-01 01:39:08 +08:00
Albert Zheng
ecb1a9349a feat(cli): add add-md and replace-md commands to notebook group
deeptutor notebook add-md <notebook_id> <file> [--title T] [--type TYPE]
  Read a markdown file and add it as a record to a notebook.

deeptutor notebook replace-md <notebook_id> <record_id> <file>
  Replace an existing record's output with content from a markdown file.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-24 20:23:53 +08:00