Commit e1e3e55
authored
feat(kiloclaw): deliver morning briefing to configured channels (#2813)
* feat(kiloclaw): deliver Morning Briefing to configured channels
Send generated briefings to configured Telegram, Discord, and Slack routes with channel-friendly formatting and delivery status reporting so users can receive briefings where they work. Add robust routing, timeout/retry hardening, and run-path warmup handling so generation success is decoupled from delivery flakiness.
* refactor(kiloclaw): consolidate morning briefing delivery internals
Split command and channel-delivery concerns into dedicated modules, tighten timeout retry semantics, and reuse shared UI typing to reduce schema drift. Add cron JSON compatibility fallback to avoid controller/runtime option skew.
* fix(kiloclaw): avoid exposing delivery payloads in UI errors
Render morning briefing delivery failures with reason-only text in Settings so stored command errors remain available for diagnostics without leaking message content in the dashboard.
* fix(kiloclaw): stabilize morning briefing warmup transitions
Treat gateway and briefing readiness as boot-session fresh data to avoid stale Disabled flaps, and clear cached gateway/morning-briefing queries on start, provision, and restarts so controls remain in warmup state until current boot data arrives.
* fix(kiloclaw): remove warmup disabled-state flap
Stop emitting synthetic enabled=false during morning-briefing warmup and treat gateway_warming_up as authoritative in the dashboard card. Keep warmup badge styling and delivery visibility gated until status fields are resolved to prevent transient Disabled and Last delivery flaps.
* fix(kiloclaw): polish morning briefing status metadata UI
Move Last delivery beneath Last generated, render channel/status labels with user-friendly capitalization, and top-align action buttons so the card layout stays consistent as metadata lines appear.
* fix(kiloclaw): align morning briefing metadata layout
Add a topical Morning Briefing icon, keep delivery labels user-friendly and capitalized, and place the source summary in the same content column so metadata lines share a consistent leading edge.
* fix(kiloclaw): format last delivery provider labels
Render Morning Briefing Last delivery entries as provider-first labels with status in parentheses while keeping the bullet delimiter for readability.
* fix(kiloclaw): simplify morning briefing failures section
Rename the report heading to Failures and keep the section omitted when no failures exist so the daily briefing body stays concise and focused.
* style(web): apply formatting for morning briefing UI
* fix(kiloclaw): preserve links with parentheses in delivery text
Replace regex-only markdown link expansion with a balanced-parentheses parser so channel messages keep full URLs when links contain nested parentheses.
* fix(kiloclaw): stop retrying run requests on timeout
Use endpoint-specific warmup retry policy so morning-briefing run no longer retries timeout errors that can overlap in-flight runs and duplicate sends. Return a dedicated run-timeout response code for clients.
* test(web): lock warmup state against disabled flap
Extract morning briefing card state derivation and add regression coverage for stale enabled values plus gateway_warming_up payloads so the card stays in warmup state instead of flashing Disabled.
* fix(kiloclaw): sanitize stored morning briefing delivery errors
Store concise delivery failure details instead of full command text to reduce sensitive payload exposure while preserving operator diagnostics. Update lifecycle assertions to match sanitized error persistence.
* fix(kiloclaw): tighten briefing run timeout and delivery observability
Rename timeout test semantics, add focused delivery-utils unit coverage, and emit structured delivery outcome events for sent/skipped/failed paths. Include latest Morning Briefing warmup/source-summary alignment tweak in the same push-ready set.
* refactor(kiloclaw): share morning briefing delivery constants
Extract delivery channel/status/reason enums into a shared module and reuse them in gateway response schemas and plugin delivery utilities to prevent drift.
* Revert "refactor(kiloclaw): share morning briefing delivery constants"
This reverts commit 384cc0d.
* refactor(kiloclaw): dedupe delivery enums via shared constants
Define morning briefing delivery channel/status/reason enums once and reuse them in both plugin delivery logic and gateway controller response schemas to prevent drift.
* fix(kiloclaw): import delivery channels from constants module
Resolve plugin pack build failure by importing DELIVERY_CHANNELS directly from delivery-constants instead of delivery-utils, keeping a single source for delivery enum declarations.1 parent f81c552 commit e1e3e55
19 files changed
Lines changed: 1757 additions & 117 deletions
File tree
- apps/web/src
- app/(app)/claw/components
- hooks
- lib/kiloclaw
- services/kiloclaw
- plugins/kiloclaw-morning-briefing/src
- src
- durable-objects
- kiloclaw-instance
- routes
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
18 | | - | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | | - | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| 70 | + | |
69 | 71 | | |
70 | 72 | | |
71 | 73 | | |
| |||
500 | 502 | | |
501 | 503 | | |
502 | 504 | | |
503 | | - | |
504 | | - | |
505 | | - | |
506 | | - | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | | - | |
514 | | - | |
515 | | - | |
516 | | - | |
517 | | - | |
518 | | - | |
519 | | - | |
520 | | - | |
| 505 | + | |
521 | 506 | | |
522 | 507 | | |
523 | 508 | | |
| |||
553 | 538 | | |
554 | 539 | | |
555 | 540 | | |
556 | | - | |
557 | | - | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
558 | 547 | | |
559 | 548 | | |
560 | | - | |
561 | 549 | | |
562 | 550 | | |
563 | 551 | | |
| |||
596 | 584 | | |
597 | 585 | | |
598 | 586 | | |
599 | | - | |
600 | | - | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
601 | 590 | | |
602 | 591 | | |
603 | 592 | | |
| |||
623 | 612 | | |
624 | 613 | | |
625 | 614 | | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
626 | 634 | | |
627 | 635 | | |
628 | 636 | | |
629 | | - | |
630 | | - | |
631 | | - | |
632 | | - | |
633 | | - | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
634 | 681 | | |
635 | | - | |
636 | | - | |
637 | | - | |
638 | | - | |
639 | | - | |
640 | | - | |
641 | | - | |
642 | | - | |
643 | | - | |
644 | | - | |
645 | 682 | | |
646 | 683 | | |
647 | 684 | | |
| |||
712 | 749 | | |
713 | 750 | | |
714 | 751 | | |
715 | | - | |
716 | | - | |
717 | | - | |
718 | | - | |
719 | | - | |
720 | | - | |
721 | | - | |
722 | 752 | | |
723 | 753 | | |
724 | 754 | | |
725 | 755 | | |
726 | 756 | | |
727 | 757 | | |
728 | | - | |
729 | | - | |
730 | 758 | | |
731 | 759 | | |
732 | 760 | | |
| |||
1314 | 1342 | | |
1315 | 1343 | | |
1316 | 1344 | | |
1317 | | - | |
1318 | | - | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
1319 | 1349 | | |
1320 | 1350 | | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
1321 | 1379 | | |
1322 | 1380 | | |
1323 | 1381 | | |
| |||
1867 | 1925 | | |
1868 | 1926 | | |
1869 | 1927 | | |
1870 | | - | |
1871 | | - | |
1872 | | - | |
| 1928 | + | |
1873 | 1929 | | |
1874 | 1930 | | |
1875 | 1931 | | |
| |||
Lines changed: 38 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
Lines changed: 39 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
163 | 168 | | |
164 | 169 | | |
165 | 170 | | |
| |||
183 | 188 | | |
184 | 189 | | |
185 | 190 | | |
186 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
187 | 199 | | |
188 | 200 | | |
189 | 201 | | |
190 | 202 | | |
191 | 203 | | |
192 | | - | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
193 | 210 | | |
194 | 211 | | |
195 | 212 | | |
| |||
222 | 239 | | |
223 | 240 | | |
224 | 241 | | |
| 242 | + | |
225 | 243 | | |
226 | 244 | | |
227 | 245 | | |
| |||
232 | 250 | | |
233 | 251 | | |
234 | 252 | | |
| 253 | + | |
235 | 254 | | |
236 | 255 | | |
237 | 256 | | |
| |||
0 commit comments