Commit Graph

13 Commits

Author SHA1 Message Date
Cameron
8c4a472480 feat: add LETTABOT_CONFIG env var for config path (#152)
* docs: add TESTING.md guide

Comprehensive testing documentation covering:
- Unit test setup and patterns
- E2E test setup with Letta Cloud
- MockChannelAdapter usage
- CI/CD workflow
- Best practices

Written by Cameron ◯ Letta Code

* feat: add LETTABOT_CONFIG env var for config path

Addresses Discord feedback from fpl9000 who was confused about where
to put the config file after a global npm install.

Changes:
- Add LETTABOT_CONFIG env var that overrides the config search order
- Update error messages to show the env var option
- Document in docs/configuration.md

Now users doing global installs can either:
- Create ~/.lettabot/config.yaml, or
- Set LETTABOT_CONFIG=/path/to/config.yaml

Written by Cameron ◯ Letta Code

"Configuration should be explicit, not magic." - The Twelve-Factor App
2026-02-04 18:36:10 -08:00
Cameron
fe233b2f8f feat: add e2e tests with Letta Cloud (#149)
E2E testing infrastructure that tests the full message flow against a real Letta Cloud agent.

Changes:
- Add MockChannelAdapter for simulating inbound/outbound messages
- Add e2e/bot.e2e.test.ts with 4 e2e tests:
  - Simple message/response
  - /status command
  - /help command
  - Conversation context retention
- Add 'mock' to ChannelId type
- Update CI workflow with separate e2e job (uses secrets)
- Add npm run test:e2e script

E2E tests require:
- LETTA_API_KEY (already in repo secrets)
- LETTA_E2E_AGENT_ID (needs to be added)

E2E tests are skipped locally without these env vars.

Written by Cameron ◯ Letta Code

"Trust, but verify." - Ronald Reagan (on e2e testing)
2026-02-04 17:51:23 -08:00
Cameron
df0343d0be feat: add reset-conversation command and better error detection (#122)
When conversations become corrupted on Letta Cloud, users see empty
responses with no useful error message. This adds:

1. Warning message when empty result detected:
   - Logs: "Agent returned empty result with no response"
   - Suggests running `lettabot reset-conversation`

2. New CLI command `lettabot reset-conversation`:
   - Clears the conversationId from lettabot-agent.json
   - Preserves agent and memory
   - Next message creates fresh conversation

Symptoms of corrupted conversation:
- stop_reason: "error" with empty result
- Messages not appearing in agent history
- duration_api_ms: 0 (no API call made)

Written by Cameron ◯ Letta Code

"When in doubt, start fresh." - Ancient debugging wisdom
2026-02-03 21:59:08 -08:00
Cameron
3e3d81b9f2 feat: add Railway volume support for persistent storage (#113)
Auto-detect RAILWAY_VOLUME_MOUNT_PATH and use it for all persistent data
(agent ID, cron jobs, logs). On local machines, data stays in project
directory. Template now includes volume by default.

- Add src/utils/paths.ts with getDataDir() and getWorkingDir() helpers
- Update Store, cron service, CLI tools to use data directory
- Log storage locations on startup for debugging
- Update deploy button URLs with UTM tracking

Written by Cameron ◯ Letta Code

"The best way to predict the future is to invent it." - Alan Kay
2026-02-03 16:49:08 -08:00
Cameron
8017c4617e Add update-notifier to CLI (#53)
Shows a notification when a new version is available, helping users
stay up to date with security fixes.

Written by Cameron ◯ Letta Code
2026-01-30 17:16:49 -08:00
cthomas
1d66f42dad feat: add non-interactive onboarding and SKILL.md (#45)
* feat: add non-interactive onboarding and SKILL.md

Add agent-friendly setup flow:
- lettabot onboard --non-interactive flag
- Reads all config from environment variables
- SKILL.md documents env-based setup for agents
- Supports all channels (Telegram, Slack, Discord, WhatsApp, Signal)
- No prompts - ideal for coding agents automating setup

👾 Generated with [Letta Code](https://letta.com)

Co-Authored-By: Letta <noreply@letta.com>

* fix: address non-interactive setup issues

- Add SLACK_APP_NAME for customizable app name (defaults to LETTA_AGENT_NAME or LettaBot)
- Clarify WhatsApp requires WHATSAPP_ENABLED and WHATSAPP_SELF_CHAT to be explicit
- Document all 5 channels supported (Telegram, Slack, Discord, WhatsApp, Signal)
- Fix WhatsApp selfChat default to be explicit false

* docs: recommend non-interactive setup as primary method

Update README per review feedback to show env-based setup first.
This is simpler for most users and ideal for automation.

* docs: rewrite setup to be AI-first per feedback

Make recommended setup AI-focused:
- Show prompt to paste into AI coding assistants
- AI handles clone/install/config autonomously
- Manual wizard becomes Option 2 for human users

---------

Co-authored-by: Letta <noreply@letta.com>
2026-01-30 16:14:29 -08:00
Sarah Wooders
b64aea9b61 Fix: Resolve main.js path relative to CLI file, not cwd
When running via `npx lettabot server`, the CLI was looking for
main.js/main.ts relative to process.cwd() (user's directory), but
the compiled files are in the npm cache or node_modules.

Now uses import.meta.url to find main.js in the same directory as
cli.js, which works correctly for:
- npx lettabot
- global install (npm install -g)
- local development

Fixes ERR_MODULE_NOT_FOUND error on server restart.

🐙 Generated with [Letta Code](https://letta.com)

Co-Authored-By: Letta <noreply@letta.com>
2026-01-29 22:58:22 -08:00
cpacker
c176a74533 fix: use correct path for tsx fallback in server command
When running `lettabot server` without a built dist/ directory, the
fallback to tsx was using a path relative to import.meta.url. This
resolved to dist/main.ts when running from the compiled CLI, but that
file doesn't exist (only dist/main.js exists after compilation).

Changed to use an absolute path to src/main.ts for the development
fallback.

Fixes #28

👾 Generated with [Letta Code](https://letta.com)

Co-Authored-By: Letta <noreply@letta.com>
2026-01-29 16:39:28 -08:00
Jason Carreira
0f68b9b52f Add Discord channel support (#16)
* Add Discord channel support and pairing (#15)

* Address Discord adapter review feedback

* Fix stream counter after merge

* Remove stream count logging

---------

Co-authored-by: Jason Carreira <jason@visotrust.com>
2026-01-29 14:11:50 -08:00
Cameron
9d135f160c Fix CLI instructions to use npx prefix
Changed "lettabot server" to "npx lettabot server" in:
- Onboarding completion message
- Logout completion message

🐙 Generated with [Letta Code](https://letta.com)

Co-Authored-By: Letta <noreply@letta.com>
2026-01-29 10:55:04 -08:00
Sarah Wooders
7a0be1cb33 Remove all .env usage, use lettabot.yaml only 2026-01-28 23:16:29 -08:00
Caren Thomas
ee0fbc205a feat: improve config menu UX and model selection with pagination
- Convert config menu to @clack/prompts select (arrow key navigation)
- Check both .env file and shell environment for config display
- Filter placeholder values (e.g., "your_telegram_bot_token")
- Import 'dotenv/config' so API calls work from CLI
- Add pagination to model selector (maxItems: 10, shows all models)
- Remove arbitrary limits (was 15 base + 3 BYOK, now shows all)
- Shared model-selection utility used in both onboard and config
- Better tier labels: "🆓 Free", " Premium", "💰 Pay-per-use"
- BYOK models labeled as "🔑 BYOK"
- Sort base by tier (free first), BYOK alphabetically

Inspired by letta-code's ModelSelector UX patterns.

👾 Generated with [Letta Code](https://letta.com)

Co-Authored-By: Letta <noreply@letta.com>
2026-01-28 18:41:08 -08:00
Sarah Wooders
22770e6e88 Initial commit - LettaBot multi-channel AI assistant
Co-authored-by: Cameron Pfiffer <cameron@pfiffer.org>
Co-authored-by: Caren Thomas <carenthomas@gmail.com>
Co-authored-by: Charles Packer <packercharles@gmail.com>
Co-authored-by: Sarah Wooders <sarahwooders@gmail.com>
2026-01-28 18:02:51 -08:00