14 Commits

Author SHA1 Message Date
teknium1
e73f94fa83 refactor(platforms): every plugin setup wizard uses the shared declines_reconfigure gate
Fourteen platform plugins hand-rolled the "already configured? Reconfigure? [y/N]"
gate at the top of interactive_setup (env check + info line + prompt_yes_no(..., False)),
with drifting wording ("X: already configured" vs "X is already configured." vs
"already enabled") and, for LINE and SimpleX, raw input() loops with their own
EOF/KeyboardInterrupt handling and no gate at all. Fixes to the gate (non-interactive
handling, wording, default) therefore reached only the core Telegram/BlueBubbles/webhook
wizards.

- hermes_cli/setup_platforms.py: `_declines_reconfigure` becomes the public
  `declines_reconfigure(label, question, *env_vars)` (any-of env check, so Matrix's
  token-or-password gate fits); `_save_prompted` becomes `save_prompted` alongside it.
  No alias kept; the three core callers are updated.
- buzz, dingtalk, discord, feishu, google_chat, irc, matrix, mattermost, raft, slack,
  teams, wecom: the hand-rolled gate is replaced by one `declines_reconfigure(...)` call;
  post-decline extras (Discord allowlist nudge, Slack manifest refresh, Raft "Keeping"
  line) stay local and unchanged.
- line, simplex: the raw input() loops move onto hermes_cli.cli_output.prompt (masked
  for secrets, "" on Ctrl-C/EOF) and gain the shared gate on their primary env var.

Behavior change: the gate's info line is now uniformly "<Label>: already configured"
(DingTalk/Feishu/WeCom lose the trailing period + inline ID; Buzz/IRC/Google Chat/Raft/
Teams no longer echo the current value in that line). Feishu and WeCom now gate on the
app/bot ID alone instead of ID AND secret. LINE and SimpleX gain a "Reconfigure?" [y/N]
prompt when already configured; their prompts now honour HERMES_NONINTERACTIVE and print
via the CLI helpers instead of bare print(). Prompt defaults (No) are unchanged everywhere.

Not touched: WhatsApp's gate keys on WHATSAPP_ENABLED being truthy (a "false" value must
not count as configured), which the shared any-set gate cannot express — left hand-rolled.

Test: tests/plugins/platforms/test_interactive_setup_reconfigure_gate.py parametrized over
the 14 wizards — with the primary env var set and the user declining, each wizard must have
called declines_reconfigure with that var and returned without prompting or saving.
Sabotage: reverting mattermost's gate fails that row.
2026-09-13 05:32:38 -07:00
Teknium
e83816a4d1 review-fix(comments): restore lost #NNNN rationale comments across non-test source (mechanical sweep, condensed, code unchanged)
For each issue anchor present in BASE 63279301bc non-test .py and absent on HEAD, the BASE comment/docstring block was re-attached at the HEAD location of the code it explained (matched by the distinctive code line / enclosing def). Sentences already covered by an existing HEAD comment were deduped; the issue number always survives. Insert-only: no code lines changed.
2026-09-03 09:44:26 -07:00
Teknium
14519d7493 refactor(hermes_cli): setup cluster — pack hidden-env suffix and home-channel tables 2026-09-02 22:39:06 -07:00
Teknium
c798443ec7 refactor(hermes_cli): setup cluster — contextlib.suppress for swallow-only try blocks 2026-09-02 22:34:54 -07:00
Teknium
bcddf6a084 refactor(hermes_cli): setup cluster — drop statement-separating blanks inside function bodies (AST-neutral) 2026-09-02 22:25:24 -07:00
Teknium
8ec7d0bfc5 refactor(hermes_cli): setup cluster — unify blank-slate epilogue and allowlist prompt 2026-09-02 22:04:25 -07:00
Teknium
f622145b84 refactor(hermes_cli): setup cluster — hug lone closing brackets 2026-09-02 21:53:35 -07:00
Teknium
f2b25bebe7 refactor(hermes_cli): setup cluster — print_header(gap=), yes/no answer table, bws _step helper, sync row table 2026-09-02 21:33:24 -07:00
Teknium
71e0cb0301 refactor(hermes_cli): setup cluster — join wrapped prose literals, drop blanks after local imports 2026-09-02 21:20:04 -07:00
Teknium
756507554b refactor(hermes_cli): setup cluster pass 1 — unify env-var prompt/save, nous-flow, migration-step, bws setup phase helpers 2026-09-02 20:36:04 -07:00
Teknium
324701cd84 refactor(cli/setup_*): table-drive bluebubbles/vercel prompts, flatten telegram allowlist branches, compact prose 2026-09-02 16:04:47 -07:00
Teknium
3ab00ea93a refactor(cli/setup.py): shared _info() line printer; pack print_info runs across setup modules 2026-09-02 15:57:06 -07:00
Teknium
4e64c5d1a1 refactor(cli/setup.py): drop dead _DEFAULT_PROVIDER_MODELS table and _setup_qqbot shim; compact prose, imports and banners 2026-09-02 15:53:44 -07:00
Teknium
9128bb5610 refactor(cli/setup.py): split wizard into setup_{tts,terminal,platforms,summary,migration,quick} modules; table-drive summary/agent settings; shared banner helper 2026-09-02 15:46:06 -07:00