forked from Rockachopa/Timmy-time-dashboard
- Add sandboxed calculator tool to Timmy's toolkit so arithmetic questions
get exact answers instead of LLM hallucinations
- Update system prompts (lite + full) to instruct Timmy to always use the
calculator and never attempt multi-digit math in his head
- Add self-contradiction guard to both prompts ("commit to your facts")
- Render Timmy's chat responses as markdown via marked.js + DOMPurify
instead of raw escaped text
- Suppress empty briefing notification on startup when there are 0
pending approval items
- Add calculator to session response sanitizer regex
- 18 new calculator tests, 2 updated briefing notification tests
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
24 lines
781 B
HTML
24 lines
781 B
HTML
<div class="chat-message user">
|
|
<div class="msg-meta">YOU // {{ timestamp }}</div>
|
|
<div class="msg-body">{{ user_message | e }}</div>
|
|
</div>
|
|
{% if response %}
|
|
<div class="chat-message agent">
|
|
<div class="msg-meta">TIMMY // {{ timestamp }}</div>
|
|
<div class="msg-body timmy-md">{{ response | e }}</div>
|
|
</div>
|
|
<script>
|
|
(function() {
|
|
var el = document.currentScript.previousElementSibling.querySelector('.timmy-md');
|
|
if (el && typeof marked !== 'undefined' && typeof DOMPurify !== 'undefined') {
|
|
el.innerHTML = DOMPurify.sanitize(marked.parse(el.textContent));
|
|
}
|
|
})();
|
|
</script>
|
|
{% elif error %}
|
|
<div class="chat-message error-msg">
|
|
<div class="msg-meta">SYSTEM // {{ timestamp }}</div>
|
|
<div class="msg-body">{{ error | e }}</div>
|
|
</div>
|
|
{% endif %}
|