[kimi] Add bark message producer for Matrix bark messages (#671) #732

Merged
kimi merged 1 commits from kimi/issue-671 into main 2026-03-21 14:01:43 +00:00
Collaborator

Fixes #671

Summary

Added produce_bark() function to src/infrastructure/presence.py that formats chat responses as Matrix bark messages for the 3D world.

Changes

  • src/infrastructure/presence.py: Added produce_bark(agent_id, text, reply_to=None, style="speech") function

    • Returns dict with type="bark", agent_id, data={text, reply_to, style}, and ts
    • style defaults to "speech", supports "thought", "whisper", "shout"
    • Text truncated to 280 characters (bark, not essay)
    • Invalid styles fall back to "speech"
    • Added BARK_STYLES constant for valid style values
  • tests/unit/test_presence.py: Added comprehensive TestProduceBark test class

    • Tests message structure, data fields, defaults
    • Tests 280-char truncation
    • Tests all valid styles and invalid style fallback
    • Tests empty text handling
    • Tests timestamp generation

Verification

  • All 2474 tests pass (including 17 new bark tests)
  • tox -e lint passes
  • tox -e unit passes
Fixes #671 ## Summary Added `produce_bark()` function to `src/infrastructure/presence.py` that formats chat responses as Matrix bark messages for the 3D world. ## Changes - **src/infrastructure/presence.py**: Added `produce_bark(agent_id, text, reply_to=None, style="speech")` function - Returns dict with `type="bark"`, `agent_id`, `data={text, reply_to, style}`, and `ts` - `style` defaults to "speech", supports "thought", "whisper", "shout" - Text truncated to 280 characters (bark, not essay) - Invalid styles fall back to "speech" - Added `BARK_STYLES` constant for valid style values - **tests/unit/test_presence.py**: Added comprehensive `TestProduceBark` test class - Tests message structure, data fields, defaults - Tests 280-char truncation - Tests all valid styles and invalid style fallback - Tests empty text handling - Tests timestamp generation ## Verification - All 2474 tests pass (including 17 new bark tests) - tox -e lint passes - tox -e unit passes
kimi added 1 commit 2026-03-21 14:01:18 +00:00
feat: Add produce_bark message producer for Matrix bark messages
Some checks failed
Tests / lint (pull_request) Has been cancelled
Tests / test (pull_request) Has been cancelled
30d83162d6
Adds produce_bark() to src/infrastructure/presence.py that formats
chat responses as Matrix bark messages with:
- type='bark', agent_id, data={text, reply_to, style}, ts
- style defaults to 'speech', supports 'thought', 'whisper', 'shout'
- Text truncated to 280 characters
- Invalid styles fall back to 'speech'

Adds comprehensive tests for all bark functionality.

Fixes #671
kimi merged commit 2fa5b23c0c into main 2026-03-21 14:01:43 +00:00
kimi deleted branch kimi/issue-671 2026-03-21 14:01:43 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#732