Commit Graph

25 Commits

Author SHA1 Message Date
Maciej Lisiewski
cb11f287b5 fix(whatsapp): warn on a bot opened through config.yaml allow_from
The setup warning read only WHATSAPP_ALLOWED_USERS; the adapter's DM allowlist prefers a config.yaml allow_from/allowFrom by key presence. Resolve it with the adapter's own _select_allowlist so the warning follows the same precedence, and pin the self-chat exclusion and the config.yaml home-channel check.

Co-authored-by: BearHuddleston <196404565+BearHuddleston@users.noreply.github.com>
2026-11-13 14:40:35 +01:00
Maciej Lisiewski
e37bc3485c fix(whatsapp): trim allowlist entries in the setup warning; document group admins
`a, *` now trips the customer-facing warning. The recipe also sets
group_allow_admin_from, since DM admins are not group admins, and the
slash-command anchor matches the slug Docusaurus generates.

Refs #95705
2026-11-13 14:37:24 +01:00
Maciej Lisiewski
192a857931 fix(gateway): keep the /sethome nudge from non-admins on gated chats
The first-contact "no home channel, type /sethome" notice went to any
authorized sender. With allow_admin_from set, a non-admin can't run
/sethome, so on a customer-facing bot the notice only exposed operator
setup to customers. It is now gated on the same slash-access policy the
command itself uses (policy_for_runner_source(...).can_run(user, "sethome")).

Also document a customer-facing WhatsApp hardening recipe (tool_progress,
interim_assistant_messages, home channel, allow_admin_from) and have
`hermes whatsapp` warn once when bot mode allows everyone with no home
channel set.

Fixes #95705
2026-11-13 14:37:23 +01:00
Maciej Lisiewski
f2cadb13ae fix(whatsapp): launch bridge.js from the scrubbed child env
The gateway bridge and both pairing launches (dashboard, `hermes whatsapp`)
built their env with with_hermes_node_path(), which copies os.environ, so the
networked Node bridge and its third-party npm deps saw every provider key,
platform token and gateway allowlist. They now start from
hermes_subprocess_env(); the gateway path still re-injects every WHATSAPP_*
value bridge.js reads from the adapter's resolved settings, so the
blocklisted WHATSAPP_ALLOWED_USERS keeps reaching the bridge's DM gate.

Fixes #38079
2026-11-12 22:57:42 +01:00
Maciej Lisiewski
0ef9c17630 fix(whatsapp): keep the session store and bridge.log owner-only
creds.json and the signal keys grant full access to the WhatsApp account,
and bridge.log carries the QR pairing payloads, yet the session dir was a
plain mkdir and Baileys writes its keys from the Node child at the
process umask: under 022 every local account could read them.

ensure_private_store() creates/tightens the session dir to 0700 and
hands back umask 0o077 for the child that writes into it, so the gateway
bridge and both pairing paths (`hermes whatsapp`, dashboard onboarding)
write creds.json + session-*.json as 0600 without patching Baileys.
bridge.log is opened 0600 and an existing one tightened. Managed and
container installs keep their inherited modes, the same carve-outs
_secure_file makes.

Fixes #80090
2026-11-12 15:56:01 +01:00
kshitijk4poor
c734375c9f fix(whatsapp): drop the fixed pair timeout and honour the npm timeout knob
The pairing subprocess got timeout=900 with TimeoutExpired suppressed. That
window has to cover the QR scan, a 60 s page load, the signer's own 600 s
WebAuthn bound and an untimed confirmation prompt; when it fired, the user
saw only "Pairing may not have completed" and node was SIGKILLed, skipping
readline's terminal restore. Pairing already ends on success, failure or
Ctrl+C, so drop the outer timeout (HX006 allow, same as the interactive
importer child in setup_agent_import.py).

The new CLI npm install timeout was a literal 300 s while the adapter and
the dashboard read WHATSAPP_NPM_INSTALL_TIMEOUT (slow NAS installs), and
this branch adds playwright-core to that install. Use the same env_int.

The passkey-browser forwarding check only guarded MagicMock-style args; the
tests already use SimpleNamespace and the real parser.

The pairing test now writes a valid identity in every case, so the exit
status is what decides enablement: removing the returncode check turns it
red (it stayed green before).
2026-11-08 15:52:48 +05:30
helix4u
618b0d6bbe fix(whatsapp): stop passkey retry loops and tighten pairing setup 2026-11-08 15:52:48 +05:30
helix4u
d37547bf73 fix(whatsapp): package pinned passkey runtime and refresh stale dependencies 2026-11-08 15:52:48 +05:30
helix4u
9929bc74e7 fix(whatsapp): wire local passkey signer and validate pairing completion
Co-authored-by: vinikjkkj <viniwarrior4@gmail.com>
2026-11-08 15:52:48 +05:30
Teknium
f11062a837 refactor(whatsapp_cloud): move WhatsApp Cloud adapter into a bundled platform plugin
gateway/platforms/whatsapp_cloud.py -> plugins/platforms/whatsapp_cloud/adapter.py and
hermes_cli/setup_whatsapp_cloud.py -> plugins/platforms/whatsapp_cloud/setup_wizard.py (git mv).
register(ctx) wires adapter_factory, check_fn, is_connected, required_env, install_hint,
setup_fn (the same wizard `hermes whatsapp-cloud` runs), allowed_users/allow_all env,
cron_deliver_env_var, label/emoji. gateway/platforms/whatsapp_common.py stays in core
(shared with the Baileys plugin and CLI helpers). Tests and docs point at the plugin path.

Co-authored-by: sprmn24 <oncuevtv@gmail.com>
(cherry picked from commit a3b08efc0249c2dcd3472e4a25addc3f3a2b0d5c)
2026-10-16 07:09:45 -07:00
Maciej Lisiewski
0006a5e229 ci: fix PLW1509, PLW1510, PLW2101 linter errors 2026-10-10 15:20:13 +02:00
teknium1
64ad33e32d refactor: remove Skill Sync (hermes sync) and the org skill mirror from core
Skill Sync only worked against a Nous Portal sync plane that was never made
publicly accessible, so no install has ever used it. We don't want it in core
right now, so this deletes it outright instead of moving it behind a plugin
hook surface nobody needs yet:

- `hermes sync` command, `tools/skills_sync_client*.py` and their tests
- the personal pull ticks (gateway housekeeping, classic CLI startup,
  `hermes serve` maintenance) and the debounced post-write push
- the per-skill `sync` usage flag (`set_sync` / `is_sync_enabled`)
- the `skills/_org/<org_id>/` mirror: index gating on `.active_org`, the
  `[org-shared]` / name-collision labels, the org provenance header and
  `org_provenance` field on skill_view, the org delete guard and the
  auto-propose `org_sharing` note on skill_manage

The code is preserved in the private NousResearch/hermes-skill-sync repo if
the feature comes back.
2026-10-03 23:05:48 -07:00
ethernet
e4b886f71c fix: retain WhatsApp runtime binary guards under optimized Python 2026-09-24 01:55:51 -04:00
ethernet
b681f0c50e merge: reconcile origin/main with PM runtime ownership
Preserve upstream fixes without restoring retired dependency installers.
Run configured-feature checks in the selected build interpreter. Reuse a
supported base Python during bootstrap, and preserve durable backup media.

Refresh the dependency lock through PM. Keep the frozen historical import
surface unchanged. Adapt incoming native tests to the platform markers.

Verification: the incoming 86-file pass found two fixture mismatches;
both passed after correction. Targeted PM/update/compatibility checks,
Electron and renderer typechecks, and desktop tests passed.
Native Windows/macOS update journeys and the full suite remain unrun.
2026-09-12 16:55:32 -04:00
ethernet
5e4a2a3d24 refactor(pm): remove legacy dependency and launch managers
Competing installers and checkout-local venv assumptions bypassed PM
selection, install consent, and generation lifetimes. Route consumers
through PM and installation-bound launchers. Refresh source launchers
before obsolete Python entries can be collected.

Remove Node, browser, and CUA acquisition engines, obsolete venv-holder
handling, detached sync, and unused PM APIs. Keep historical updater
exports inert and preserve external tool ownership and native integration.

Share product freshness and prepared inputs across builders. Align plugin
admission, Docker provisioning, setup instructions, and behavioral tests.

Verified targeted Python and JavaScript tests, desktop and web typechecks,
scoped lint, real product builds, and the Docker frontend smoke test.
The missed post-setup test cleanup is included and verified.

Native Windows/macOS execution, full Rust compilation, and the complete
repository suite remain unverified. Historical compatibility requirements
were preserved and extended, not fully rescanned.
2026-09-12 14:57:38 -04:00
bixycler
70d0f556d7 fix(branding): use the Caduceus ☤ (U+2624), not the Rod of Asclepius ⚕ (U+2625)
Every inline glyph — CLI banner/status bar/response labels/goodbye, setup
and doctor boxes, gateway update prompts, WhatsApp reply prefix, TUI theme,
locale strings and the docs — used ⚕, the staff of Asclepius (medicine).
Hermes carries the Caduceus ☤. The ASCII-art logo was already correct.

Mechanical swap across 60 files (no logic change); both glyphs are
East-Asian-width Neutral so no layout shifts. Skins that set their own
`response_label` / `goodbye` are unaffected.

Direction from PR #7064 (@bixycler), the earliest of #7064 / #9611 / #15574,
redone against current main.

Fixes #9565
2026-09-12 08:25:54 -07:00
Teknium
491e53ef3c simplify(compat): tool_search/skills_sync_client — drop 22 re-exports, repoint 5 callers + 5 test files; drop stale re-export prose in web_tools_truncate/file_operations_lint 2026-09-03 13:33:47 -07:00
Teknium
31bc234a66 refactor(hermes_cli): compact setup-flow docstrings/comments; fold env-ref identity indexing 2026-09-02 21:54:56 -07:00
Teknium
a6e3fe5f5b refactor(hermes_cli): try/except-pass -> contextlib.suppress in setup flows 2026-09-02 21:05:31 -07:00
Teknium
3709a7334e refactor(hermes_cli): join remaining closer lines in setup flows 2026-09-02 21:00:49 -07:00
Teknium
2bdd7c6abb refactor(hermes_cli): pack re-export imports and closers in setup flows 2026-09-02 20:56:35 -07:00
Teknium
9f9401cf05 refactor(hermes_cli): azure flow — current-settings dataclass, transport-detection phase helper; squeeze import blanks 2026-09-02 20:49:52 -07:00
Teknium
f4996ddbee refactor(hermes_cli): main_platform_setup — WhatsApp phase helpers, sync subcommand dispatch, _say/_err banners 2026-09-02 20:43:00 -07:00
Teknium
b5f96ab3e5 refactor(hermes_cli): AST-neutral layout compaction of provider/platform setup flows 2026-09-02 20:03:18 -07:00
Teknium
aa4ffc98e9 refactor(hermes_cli/main): extract WhatsApp/Slack/Skill-Sync setup wizards to main_platform_setup.py 2026-09-02 16:59:52 -07:00