From 3b6f56f93c829a741df4ded189a4b8c98ce7fdff Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Sat, 26 Sep 2026 08:24:02 +0200 Subject: Add calc, mail, playing and finance example tools All read-only: each command is fixed in its tool file, so the model fills parameters but can never reach mailctl tag or firefly tx add. qalc reads "17.5% of 240" as a modulo, so the calc hint shows percent as a factor. Co-Authored-By: Claude Opus 5.5 --- examples/tools/mail.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 examples/tools/mail.sh (limited to 'examples/tools/mail.sh') diff --git a/examples/tools/mail.sh b/examples/tools/mail.sh new file mode 100755 index 0000000..4e0e9c1 --- /dev/null +++ b/examples/tools/mail.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# desktop-assistant tool: unread mail summary through mailctl (read-only). +# Copyright (C) 2026 Danilo M. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# mail.sh [QUERY]: thread count and the 10 newest threads for a notmuch +# query, default unread mail in the inbox, across every account. Only +# mailctl's search runs here: nothing is tagged, moved or synced. +# MAILCTL overrides the command (default mailctl.py on PATH). + +set -uo pipefail + +query="${1:-tag:unread and tag:inbox}" +json=$("${MAILCTL:-mailctl.py}" search "$query" --json) || { echo "mail search failed" >&2; exit 1; } +jq -r 'length as $n + | if $n == 0 then "no threads match" + else "\($n) threads", (.[:10][] | "\(.date_relative), \(.authors): \(.subject)") + end' <<<"$json" -- cgit v1.2.3