Commit Graph

67 Commits

Author SHA1 Message Date
Your Name f8b5c08ee5 feat: emoji-visualized gold + weather entertainment plugins
gold: headline price is now USD per gram (XAU/oz divided by 31.1034768),
ounce + bid/ask as reference, timestamp cleaned of timezone/fraction.
weather: per-WMO-code emoji (day/night-aware clear sky), temp + feels
like, humidity, wind. Both verified live; safe in default plain send mode.
2026-08-09 14:14:14 +00:00
Your Name 52413a6a68 feat: pos tree — print the CLI command tree
pos tree derives the hierarchy live from bin/pos-* filenames + # POS:
/# POS_SUBCMDS: headers, so it always matches what the dispatcher can
run. Category-less tool (like pos-config); --depth N limits nesting.

Also sharpen the agent-facing docs that the work exposed:
- AGENTS.md: drop the stale "one category-less exception" claim; document
  the category-less pattern (pos-config, pos-tree) and that gen only reads
  the text after the first em-dash in # POS: headers
- DEV.md: category-less vs categorized rule + header extraction note
- AGENT_Context "Adding a New Tool": new step 0 — pin the exact CLI verb
  and runtime context (dev/repo-only vs installed) before writing code
- POS.md: new config + tree sections; category-less tools get their own
  sections
- README: pos tree bullet following the pos X convention
2026-08-09 12:50:52 +00:00
Your Name 4d8f70d770 refactor: telegram config via pos config telegram; fix listener pipe + entertainment bugs
- Drop sender 'config'/'config set' subcommand — redundant with 'pos config
  telegram' (same POS_CONFIG registry: masked token input/display, chat-id
  validation, chmod 600); sender/listener error hints now point there.
- Listener: load_map now uses a \x1f delimiter, so mapped /commands
  containing '|' are no longer truncated at the first pipe.
- entertainment send: forward extra plugin args (previously dropped); pass
  '--' before the message so leading '-' plugin output isn't parsed as an
  option.
- write_config_key/cfg_write: replace unescaped sed writes with grep-v+append
  so values with &, |, \ round-trip safely.
- sync_systemd: daemon-reload after removing timer units.
- config-ui: 'digits' validation accepts negative group/supergroup chat ids.
2026-08-09 12:22:12 +00:00
Your Name 97e9d57f45 fix: telegram listener editor crashes on remove/edit/test
ui_pick printed its menu listing to stdout, so 'idx="$(ui_pick)"' captured
the menu plus the picked number; the array subscript MAP_CMDS[$idx] then
arithmetically evaluated the multi-line string and died with 'syntax error
in expression (error token is ...)'. Menu decoration now goes to stderr so
only the index reaches stdout. Pre-existing bug, exposed by the ::desc
description column.
2026-08-09 11:28:29 +00:00
Your Name 498979a78d feat: telegram listener pushes command list to bot menu via setMyCommands
Map entries may now carry a menu description (/cmd::desc=bash) shown in
the bot's "/" menu; it falls back to the bash command (~40 chars) when
omitted. The command list is pushed automatically after every map edit,
on --enable, and at daemon start, plus a manual --sync-commands flag
(wired into POS_FLAGS completion). Names are validated against Telegram's
lowercase [a-z0-9_] rule — invalid ones are skipped from the menu with a
warning but still resolve when typed; an empty map clears the menu.

Fixes found by unit-testing the sync path: map_has always returned false
(awk END{exit 1} overrode the match), map_set had a local cross-reference
that broke under set -u, and warn() leaked into the generated JSON (now
stderr). Docs + AGENT_TODO updated; make gen && make check pass.
2026-08-09 09:54:05 +00:00
Your Name cb82acb155 fix: cache pos config scopes for completion; stop per-TAB registry scan
pos config <TAB> re-scanned every tool's '# POS_CONFIG:' header per
keypress (dozens of subshells, greps, seds). On the loaded homelab box a
stuck completion wedged interactive shells at 69% CPU for ~an hour. make
gen now emits a static _pos_config_scopes array into completions/pos.bash
(no runtime scan; live-scan fallback if the cache is missing).
2026-08-09 04:31:07 -04:00
Your Name 0b7fdb4954 feat: pos config — interactive config editor driven by the POS_CONFIG registry
Add bin/pos-config + lib/config-ui.sh: reads the '# POS_CONFIG:' headers
across tools into a unified runtime config (~/.config/linux_post_install/
<scope>.env, chmod 600). Secret masking with show/hide, digits:/num:/url:
validation, '-' clears, blank keeps; '*plugins' expands entertainment
plugin vars from entertainment-lib.sh. pos config with no scope opens a
picker (scope list when not a TTY); completion offers scopes from the
registry at runtime.

gen-docs.sh now handles category-less tools (pos-config) instead of
emitting pos-config-config; fix set -e/pipefail abort that truncated the
header registry mid-read. install.sh ships config-ui.sh.
2026-08-09 03:57:17 -04:00
Your Name 873ae84b49 refactor: rename telegram tool to pos-communication-telegram-sender; drop --send legacy alias
The --send flag duplicated the send subcommand — completion suggested both.
Now 'pos communication telegram <TAB>' completes to just 'sender' and
'listener'. send is the single canonical action.

- git mv bin/pos-communication-telegram bin/pos-communication-telegram-sender
- remove --send branch + POS_FLAGS entry; add --markdown to completion
- lib/notify.sh: notify_sender_name() maps platform telegram -> telegram-sender
  (notify_send otherwise looks for bin/pos-communication-telegram)
- pos-system-health --send 'sent:' check + pos-entertainment-send use the new
  name and the send subcommand
- completion: keys with nested tools but no direct tool complete to the group
  suffixes (sender/listener); --type/--parse-mode value completion moved to
  the new word positions
- docs updated (POS.md, AGENT_Context, DEV.md, SCRIPTS.md, notify.env,
  HOWTO.md, postinstall.sh); removed phantom webhook/log/broadcast subcommands
  from howto/communication.md
2026-08-09 03:28:30 -04:00
Your Name 16bc6685f8 fix: honor --dry-run across install phases; repair repo conventions and doc drift
- spawn() now respects DRY_RUN, install.sh exports it to child phases, and
  postinstall.sh wraps every user-home mutation in run() — '--dry-run' no
  longer runs apt/install/clone or edits dotfiles for real
- gen-docs.sh chmods regenerated files to 644 (mktemp mv left them at 0600)
- make check now syntax-checks apps/, entertainment/, features/, templates/
- .gitignore protects config/authorized_keys + config/rclone.conf; drop the
  tracked empty authorized_keys and the stray 6 MB session file
- pos-system-health --send prints 'sent:' only when a platform sender exists,
  otherwise warns on stderr (notify_send is silent-fail)
- standardize sourced libs (no shebang); refresh AGENT_Context/DEV/APPS/SCRIPTS
  doc drift: notify.sh in lib lists, pos-health systemd units, tsui, scripts/,
  INTERACTIVE_CMDS list, entertainment scheduler (systemd timers only)
2026-08-09 03:01:58 -04:00
Your Name 7dff27206b fix: health --send is notification-only; listener @quiet prefix kills double reply 2026-08-07 14:15:33 -04:00
Your Name 81ac553590 fix: entertainment 1h timer never fired (invalid OnCalendar); drop cron backend, systemd-only 2026-08-07 13:43:45 -04:00
Your Name f99acc36a2 feat: nested pos subcommands — POS_SUBCMDS header, nested category help + completion 2026-08-06 04:01:39 -04:00
Your Name b9edd07801 feat: pos communication telegram listener — /command to bash map + owner-only daemon 2026-08-06 03:48:08 -04:00
Your Name 03e9d4c8e6 feat: add pos system nfs-server and nfs-client (systemd persistent mounts) 2026-08-06 03:19:42 -04:00
Your Name 8bef0f8c6d docs: add pos HOW-TO guide set (index + 8 category guides) 2026-08-06 02:54:36 -04:00
Your Name 025971ca1e feat: multi-platform alerting + shared system.env config with dynamic help values
- lib/notify.sh: route notify_send to every platform in NOTIFY_PLATFORM
  (notify.env, default telegram; comma-separated = send to all). New
  platforms need only a bin/pos-communication-<p> sender implementing
  'send <value> [--markdown]' (Matrix/Synapse ready)
- pos-communication-telegram: add --markdown as alias for --parse-mode
  markdown to match the sender contract
- lib/common.sh: load_system_env() — shared ~/.config/linux_post_install/
  system.env for pos-system-* tools (env exported > file > default)
- pos-system-health/backup: load system.env and show effective dynamic
  values (NOTIFY_PLATFORM, HEALTH_BACKUP_MAX_AGE_DAYS, BACKUP_SERVICE_ROOTS)
  in --help
- config/system.env + config/notify.env templates copied by postinstall
- systemd/pos-health.service: EnvironmentFile for both configs so the
  daily digest honors them
2026-08-06 02:37:56 -04:00
Your Name 9a94329dd0 feat: add pos system health, lib/notify.sh, and daily Telegram digest timer
- bin/pos-system-health: host dashboard (disk, RAM, failed units, backup age,
  fail2ban, docker); exits 1 on any FAIL; --send/--markdown via Telegram
- lib/notify.sh: self-contained opt-in alerting helper; silent-fails, wired
  into pos-system-backup (success + ERR trap) and pos-system-firewall
- systemd/pos-health.{service,timer}: 08:00 digest as installing user;
  postinstall enables timer once telegram.env exists, now copies *.timer
- AGENT_TODO.md: worklist with Now/Next/Later/Done history; linked from AGENTS.md
2026-08-06 02:25:23 -04:00