101 Commits

Author SHA1 Message Date
bdj 46199d1ce5 feat(image): pass --model and --aspect-ratio through to image MCP server; bump @atxp/client to ^0.11.7
The `atxp image` command was dropping any model/aspect-ratio the user wanted
to pin — `imageCommand(prompt)` only forwarded the prompt to
`image_create_image_async`. That left the server-side default in charge
which, for direct MCP callers (no atxp-pics wrapping), recently caused a
production incident where the default `gpt-4o-mini` path produced unfaithful
outputs until the env var was switched to `gpt-image-2`.

This adds:
- `--model <model>` — forwarded as the tool's `model` arg (gpt-image-2,
  gpt-4o, dall-e-3, gemini-3-pro-image-preview, etc.)
- `--aspect-ratio <ratio>` (also accepts `--aspectRatio` for parity with the
  underlying tool parameter name) — forwarded as `aspectRatio`

Empty/unset options are not added to the args object so server defaults
still kick in when nothing is specified.

Also bumps `@atxp/client` from `^0.10.5` to `^0.11.7` to match what
production MCP servers (image, music) are running. The 0.10.x series
predates the middleware-settlement work and several payment-protocol
fixes that landed in 0.11.x; the API surface used here (`atxpClient`,
`ATXPAccount`) is unchanged. `npm install` regenerated `package-lock.json`.

Help text + README usage examples updated.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 09:32:38 -07:00
David Noël-Romas 431fa10b75 feat(git): add git repository hosting command and skill
Adds `atxp git` CLI command (create, list, remote-url, delete) backed by
the git.mcp.atxp.ai MCP server. Includes a separate atxp-git skill with
documentation emphasizing the ephemeral nature of authenticated remote URLs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-02 12:08:48 -05:00
David Noël-Romas ef7aed6785 feat(email): add mark-read command for explicit read status
The email service no longer auto-marks messages as read on retrieval.
This adds `npx atxp email mark-read <messageId>` to explicitly mark
messages as read using the new email_mark_as_read tool.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 21:27:03 -05:00
David Noël-Romas bfd79ff3d3 feat(email): add --unread-only flag for inbox and search commands
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 15:46:35 -05:00
David Noël-Romas 14312054b6 feat: add phone mark-read CLI command
Adds `npx atxp phone mark-read <id> [id...]` to mark SMS messages as
read via the new phone_mark_read MCP tool.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 21:10:29 -05:00
David Noël-Romas 792ea91ec0 fix(music): add musicOptions to help early-return object
Fixes TypeScript build error from missing property in the help flag
early-return path.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 13:19:24 -05:00
David Noël-Romas dac5e6e851 feat(music): add --lyrics flag for music generation
Allow users to pass custom lyrics to the music generation tool via
--lyrics, forwarded to the music_create_async MCP endpoint.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 13:12:53 -05:00
David Noël-Romas e51523c22a feat(search): add date filtering with --start-date and --end-date flags
Support startPublishedDate and endPublishedDate parameters on the
search_search MCP tool, allowing users to restrict results by
publication date. Also fixes toolArgs extraction to properly skip
flag values that would otherwise leak into the query string.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 00:19:16 -05:00
R-M-Naveen 294666622c fix(agent): pass --redeem referral code to registration endpoint
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 20:20:48 -05:00
Claude 52d3aac2cf feat(email): add attachment support for send and reply
Add --attach flag (repeatable) to email send and reply commands. The CLI
reads local files, detects MIME type from extension, and base64-encodes
content before passing to the MCP tool. Inbox and search results now
display attachment metadata (filename, type, size) inline.

https://claude.ai/code/session_013ZfRLDGZ9mawSATTJ8ToQg
2026-03-15 17:06:18 +00:00
R-M-Naveen 4bea6a20c9 feat(atxp): switch to /hooks/agent, remove HEARTBEAT.md logic
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>
2026-03-06 17:02:58 -06:00
R-M-Naveen 0e1120f227 fix(atxp): strip markdown brackets in sanitizer, remove trailing blank line, add heading comment
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 14:53:42 -06:00
R-M-Naveen 87bdb0f7a9 fix(atxp): hoist sanitize, drop redundant alias, backtick-wrap prompt values
- 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>
2026-03-06 14:42:32 -06:00
R-M-Naveen 5a2ad993af fix(atxp): suppress no-control-regex lint error in sanitization regex
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 14:26:39 -06:00
R-M-Naveen 57caf38731 fix(atxp): sanitize session values, fix section-replace newline, remove extra blank line
- 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>
2026-03-06 14:17:15 -06:00
R-M-Naveen c593b616aa fix(atxp): harden notifications — extract constants, fix section replace, reset stale target
- 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>
2026-03-06 13:35:03 -06:00
R-M-Naveen 5c8af2f5b9 feat(atxp): auto-discover channels and write HEARTBEAT.md for multi-channel notification relay
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>
2026-03-06 13:28:15 -06:00
R-M-Naveen 6fa6966f36 fix: update heartbeat instruction to /hooks/wake payload format
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>
2026-03-05 22:59:58 -06:00
R-M-Naveen 465c908647 refactor(atxp): rename email_user_id to account_id in notifications request
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 18:04:01 -06:00
R-M-Naveen 95694c9f61 fix(atxp): send account_id for notification matching, fix heartbeat payload
- 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>
2026-03-05 17:53:24 -06:00
R-M-Naveen d71050e3a9 fix(atxp): remove unused PhoneOptions and ContactsOptions type imports
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 10:29:13 -06:00
R-M-Naveen c25821db35 fix(atxp): help text says 'enable' not 'manage' for notifications
Only the enable subcommand exists, so don't imply broader management.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 10:22:28 -06:00
R-M-Naveen 043ba5df85 fix(atxp): log non-OK heartbeat response, guard eventTypes, type response
- 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>
2026-03-05 10:17:28 -06:00
R-M-Naveen 6805b57c47 fix(atxp): scope login hint to 401, show status codes, guard res.json
- 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>
2026-03-05 10:12:50 -06:00
R-M-Naveen ab74f76ecd fix(atxp): restore 401-specific error in whoami, add trust boundary doc
- 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>
2026-03-05 10:07:21 -06:00
R-M-Naveen e859d4eedf fix(atxp): use es module import for os to fix lint error
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 10:00:44 -06:00
R-M-Naveen c56d4bba25 fix(atxp): address code review feedback on notifications
- 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>
2026-03-05 09:58:10 -06:00
R-M-Naveen 2a3addf0d9 refactor(atxp): rename webhook.ts to notifications.ts
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 09:56:31 -06:00
R-M-Naveen 080b17ffa0 refactor(atxp): strip dead notification commands, improve error msg
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>
2026-03-05 09:53:09 -06:00
R-M-Naveen 4771d9d528 chore: remove unsupported notification commands from help and SKILL.md
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>
2026-03-05 09:44:20 -06:00
R-M-Naveen 92e5e6cc09 feat(atxp): pass email_user_id during notifications enable
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>
2026-03-05 08:50:14 -06:00
R-M-Naveen 3445df30f0 fix(atxp): fall back to os.hostname() for machine ID detection
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>
2026-03-04 20:24:10 -06:00
R-M-Naveen 87ca4709fa feat(atxp): add notifications command with machine-ID based auth
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>
2026-03-04 20:14:42 -06:00
David Noël-Romas ecbcd1a944 fix(atxp): pass -y to skills add command to skip interactive prompts
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>
2026-03-03 12:28:40 -06:00
David Noël-Romas 3d1cd2d212 fix(atxp): remove shell sourcing dependency for OpenClaw compatibility
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>
2026-03-03 09:51:19 -06:00
David Noël-Romas 4ceb47036b fix(atxp): pass -y to npx skills to skip interactive prompt
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 16:22:57 -06:00
R-M-Naveen 7e3f973592 fix(atxp): replace no-explicit-any with Record<string, unknown> in polling
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 13:27:30 -06:00
David Noël-Romas 3464db95c2 feat(atxp): use async polling for image, music, and video generation
Switch from synchronous blocking MCP calls to async initiate+poll
pattern for slow generation tools, avoiding timeout issues and showing
a spinner during generation.

- image: image_create_image_async + image_get_image_async (3s poll)
- music: music_create_async + music_get_async (5s poll)
- video: create_video + wait_for_video (10s poll)
- Extract getClient() and extractResult() from call-tool.ts for reuse

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 12:01:23 -06:00
R-M-Naveen 029cf85707 fix(atxp): read X-ATXP-Client version from package.json, add to list endpoint
- Replace hardcoded 'cli/1.19.1' with dynamic version from package.json
  so the header stays in sync across releases
- Add X-ATXP-Client header to GET /agents (listAgents) for consistent
  traffic attribution across all agent endpoints

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 22:22:03 -06:00
R-M-Naveen 4aae0d649e feat(atxp): add X-ATXP-Client header to agent registration requests
Sends cli/1.19.1 identifier on POST /agents/register and POST /agents
so the server can distinguish CLI traffic from direct API bot calls.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 22:14:49 -06:00
David Noël-Romas 80416f31f8 fix(atxp): pass userPrompt parameter to video MCP tool
The video MCP server expects `userPrompt` but the CLI was sending `prompt`,
causing the positional argument to arrive as undefined.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 11:57:25 -06:00
R-M-Naveen b8c0a90bc6 feat(atxp): require device context for agent registration and creation
Fail explicitly with error codes (E_REG_001, E_REG_002) and support
contact when device context is unavailable or the server rejects the
request, instead of silently omitting the context parameter.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 11:40:56 -06:00
David Noël-Romas e0e04e11e8 feat(atxp): add contacts command and phone filter options
Add local contacts database (add/list/show/edit/remove/search) stored
in ~/.atxp/contacts.json with cloud push/pull backup. Add --unread-only
and --direction filters to phone sms/calls commands, and update
direction labels from inbound/outbound to incoming/sent.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 11:19:27 -06:00
David Noël-Romas 760b5690ad feat(atxp): show registered phone number in whoami output
Fetches phone number from phone.mcp.atxp.ai in parallel with the
account info request and displays it when present.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 10:17:39 -06:00
David Noël-Romas 4ac62b74ec feat(atxp): add phone command for SMS and voice calls
Exposes phone.mcp.atxp.ai MCP server with 11 subcommands: register,
release, configure-voice, sms, read-sms, send-sms, get-attachment,
call, calls, read-call, and search. Updates skill documentation with
phone command reference, security boundaries, and pricing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 16:57:26 -06:00
David Noël-Romas 145d2a4936 feat(atxp): auto-install zvec on first use, default to skill install
Auto-install @zvec/zvec into ~/.atxp/deps on first `memory index` or
`memory search` call so agents using npx get local vector search
without manual setup. Fix zvec optional dep version to ^0.2.0. When
`npx atxp` is run with no arguments, install the atxp skill via
`npx skills add`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 11:30:05 -06:00
David Noël-Romas a8bae206ce fix(atxp): fix zvec integration bugs and improve memory file collection
Fix three zvec integration bugs: ESM dynamic import not unwrapping
CJS default export, wrong indexParams key (type→indexType), and search
query being contaminated with flag values. Replace .md-only file filter
with gitignore-aware collection of all text files, skip binary files
and common directories (node_modules, .git, etc.), and increase file
limit to 500.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 11:08:54 -06:00
R-M-Naveen 4b79a71c81 feat(atxp): unify fund command, remove topup
Replace separate `topup` and `deposit` commands with a unified `fund`
command that calls POST /api/funding/fund and displays both crypto
deposit addresses and payment links (for agent accounts).

- Rewrite deposit.ts to use Bearer auth and call unified endpoint
- Remove topup.ts (functionality merged into fund)
- Update help.ts and index.ts routing
- Include transactions command and memory from main merge

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 10:41:43 -06:00
David Noël-Romas 1a5f6c8514 feat(atxp): send runtime context with auth requests
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 09:53:39 -06:00
Claude 5f23c242f2 refactor(atxp): rename backup to memory, add local vector search via zvec
Refactor the backup tool and skill into a broader "memory management"
system. Cloud backup/restore (push/pull/status) is preserved with full
backward compatibility ('backup' is an alias for 'memory'). Two new
subcommands are added:

- memory index --path <dir>: chunks .md files by heading, generates
  feature-hash embeddings (256-dim), and stores them in a local zvec
  HNSW index for fast approximate nearest-neighbor search.
- memory search <query> --path <dir>: converts the query to the same
  vector space and returns the top-k most similar memory chunks with
  file paths, headings, line numbers, and similarity scores.

Local search is fully offline — no network or authentication required.

https://claude.ai/code/session_017TjuWQCrpzPM4rYdTTPFBQ
2026-02-22 22:07:54 +00:00