feat(journal): passive matcher for robust multi-line entries

`@command.new` silently drops `!journal\n<content>` because
maubot's parser only treats a *space* as the command/args
delimiter — when a newline immediately follows the command
name, the parser fails to recognise the command at all (no
handler invoked, no error). Real users WILL paste:

    !journal
    - thing one
    - thing two

and lose the entry without any feedback.

Switching to `@command.passive` with a regex that admits
[ \t\r\n] as the delimiter catches every form. Subcommand
dispatch (show/today) moves into the handler body — small
loss of decorator ergonomics, big gain in robustness for the
dominant use case (freeform multi-line entries).

Bumped to 0.2.0 since the structural change warrants a minor
bump (not a fix-level patch).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Padreug 2026-05-24 09:32:22 +02:00
commit 057ed0ed45
2 changed files with 63 additions and 41 deletions

View file

@ -1,6 +1,6 @@
maubot: 0.1.0
id: dev.aiolabs.journal
version: 0.1.3
version: 0.2.0
license: AGPL-3.0-or-later
modules:
- journal