Replace /hooks/wake + HEARTBEAT.md approach with direct /hooks/agent
channel targeting. Discovered channels are now sent to the notifications
service which stores them and uses them for delivery.
- Remove HEARTBEAT.md read/write/section-replace logic (~100 lines)
- Simplify configureHooksOnInstance to only set hooks.token
- Send discovered channels in the enable API request
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Hoist sanitizeSessionValue to module scope (out of loop)
- Also strip quote/backtick chars to prevent LLM prompt injection
- Remove redundant sessionsPath alias, use SESSIONS_PATH directly
- Backtick-wrap channel/target values in HEARTBEAT.md output
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Strip newlines/control chars and limit length on channel/to values
parsed from session keys to prevent prompt injection via HEARTBEAT.md
- Ensure newline separator between preceding content and replaced section
- Remove extra blank line after configureHooksOnInstance
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Extract hardcoded paths as named constants
- Replace regex section replacement with split-on-header approach
- Reset stale heartbeat target when channels disappear
- Add error handling for fetch, getAccountId, and configureHooksOnInstance
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Instead of injecting instructions via /hooks/wake, directly write relay
instructions to HEARTBEAT.md and configure heartbeat delivery target from
discovered session channels. Adds sms.received to help text.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Send { text, mode } instead of { message, name } to match the
/hooks/wake endpoint which injects into the main session.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Use accountId directly instead of stripping email prefix, so
notifications match on atxp_acct_* rather than agent_* identities
- Fix heartbeat instruction: use 'message' field (not 'text'),
reference /hooks/agent endpoint, add sender name
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- sendHeartbeatInstruction now warns on non-OK responses instead of
silently treating them as success
- Guard webhook.eventTypes with optional chaining to prevent TypeError
- Replace Record<string, unknown> casts with typed EnableResponse interface
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Only show "try logging in again" for 401, not network errors
- Show HTTP status code for non-401 failures, "network error" otherwise
- Guard res.json() with .catch() for non-JSON responses
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add fetchAccountInfo() that returns HTTP status on failure so
whoamiCommand can distinguish 401 from other errors
- Keep getAccountInfo() as simple null-returning wrapper for callers
that don't need status details (e.g. notifications getEmailUserId)
- Document sendHeartbeatInstruction trust boundary for maintainers
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- getMachineId: only fall back to hostname if it matches Fly machine
ID pattern (hex, 10+ chars), preventing accidental registration
from developer machines
- Validate API response shape before accessing nested properties
- Remove unused positionalArg parameter and 'add' alias
- Remove os import (now require'd inline in getMachineId)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove ~200 lines of non-functional code (list, remove, test,
re-enable, rotate-secret, failures, replay) that depend on broken
OAuth auth. Simplify help text to only show `enable`. Improve
whoami error message to mention token may be invalid/expired.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Only `notifications enable` works currently. The other commands
(list, remove, test, re-enable, rotate-secret, failures, replay)
require OAuth auth that isn't wired up yet.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extract getAccountInfo() as shared export from whoami.ts and use it
in webhook.ts to resolve the email local part (e.g. agent_xyz) for
cross-system event matching between email-mcp and atxp account IDs.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fly sets FLY_MACHINE_ID on the VM but nested shells may not inherit it.
The hostname is also set to the machine ID, so use it as fallback.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Simplified flow: CLI posts machine_id to /notifications/enable,
no OAuth required. Includes enable, list, remove, test, re-enable,
rotate-secret, failures, and replay subcommands.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The previous fix only passed -y to npx (to auto-install the skills
package) but not to the skills add command itself, which has its own
interactive confirmation prompts.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
OpenClaw's exec tool in allowlist mode blocks shell builtins like
`source` and command substitution `$()`. The CLI already reads
credentials from ~/.atxp/config directly via getConnection() — this
commit removes the shell-sourcing path entirely:
- Config format changed from `export ATXP_CONNECTION="value"` to plain
`ATXP_CONNECTION=value` (backward-compatible regex parses both)
- Deleted getShellProfile() and updateShellProfile() — no more shell
profile modification on login
- Login output now says "npx atxp whoami" instead of "source ~/.atxp/config"
- SKILL.md: removed grep/cut/source patterns, added OpenClaw Integration section
- README.md: replaced source instruction with whoami verification
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Agents couldn't find or use claim-username because the parameter was
documented as <n> (looks numeric) instead of <username>. Expanded the
description to explain what the command does and valid username format.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The topup command has been removed from the CLI. The fund command
now handles both Stripe payment links and USDC deposit addresses.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>