Commit Graph

4189 Commits

Author SHA1 Message Date
Tobias Bischoff
a0bb2bccaf Onboarding: add MiniMax hosted API key option 2026-01-09 13:39:28 +01:00
Josh Palmer
7b79823b24 Adjust UI install for offline pnpm fetch (#568)
* 🤖 codex: make ui build install prod deps for offline pnpm (issue-pnpm-offline)

* 🤖 codex: ensure ui:test installs dev deps (issue-pnpm-offline)
2026-01-09 13:38:46 +01:00
Peter Steinberger
17a7dfc966 chore: update dev identity default 2026-01-09 13:34:45 +01:00
Peter Steinberger
22d517a520 fix: clarify WhatsApp owner number prompts 2026-01-09 13:32:52 +01:00
Peter Steinberger
201c879772 fix(sandbox): compare list to config images (#563) - thanks @pasogott 2026-01-09 13:29:47 +01:00
sheeek
7883491ce2 test(sandbox): add unit tests for formatter functions
Add comprehensive tests for sandbox-formatters.ts (20 tests):
- formatStatus: running/stopped with emojis
- formatSimpleStatus: running/stopped without emojis
- formatImageMatch: match/mismatch indicators
- formatAge: seconds, minutes, hours, days with edge cases
- countRunning: count items by running state
- countMismatches: count items by image mismatch

All pure functions now covered. 152 LOC tests added.

Total test count: 39 tests (19 integration + 20 unit)
Test coverage increased from ~66% to ~80%.
2026-01-09 13:23:16 +01:00
sheeek
7f02b62bba style(sandbox): fix linting errors
- Remove unused normalizeOptions function
- Fix line length violations (format long lines)
- Fix import order (alphabetical)
- Format function signatures for readability

All lint checks now passing.
2026-01-09 13:23:16 +01:00
sheeek
b0c97d6178 refactor(sandbox-cli): improve structure and reduce duplication
Improvements:
- Extract help text examples into EXAMPLES constant object
- Add createRunner() helper to reduce try-catch boilerplate
- Add normalizeOptions() helper (prepared for future use)
- Fix command names from 'clawd' to 'clawdbot' throughout
- Update main sandbox command to show help by default
- Better organize code with clear section comments

Increases from 82 to 137 LOC but with much better organization
and reduced duplication in error handling.
2026-01-09 13:23:16 +01:00
sheeek
1c757ae35e refactor(sandbox): use extracted display and formatter modules
Update sandbox.ts to import and use functions from:
- sandbox-display.ts for all UI output
- sandbox-formatters.ts for data formatting

Removes 141 LOC of display/formatting code from sandbox.ts,
reducing it from 351 to 210 LOC (-40%).

Core business logic now clearer and more focused.
2026-01-09 13:23:16 +01:00
sheeek
81c55be19b refactor(sandbox): extract display logic into separate module
Move all display functions to sandbox-display.ts:
- displayContainers, displayBrowsers with generic displayItems helper
- displaySummary with image mismatch warnings
- displayRecreatePreview, displayRecreateResult

Uses DisplayConfig pattern to reduce duplication between container
and browser display logic. 156 LOC.
2026-01-09 13:23:16 +01:00
sheeek
dd0104290e refactor(sandbox): extract formatters into separate module
Move formatting utilities to sandbox-formatters.ts:
- formatStatus, formatSimpleStatus, formatImageMatch, formatAge
- countRunning, countMismatches helper functions
- ContainerItem type definition

Improves modularity and reusability. 49 LOC.
2026-01-09 13:23:16 +01:00
sheeek
6ca34c1259 docs(sandbox): fix command name from clawd to clawdbot
Update all command examples in documentation to use 'clawdbot' instead
of 'clawd' for consistency with actual CLI command name.
2026-01-09 13:23:16 +01:00
sheeek
c3932c8508 test(sandbox): add comprehensive test suite for CLI commands
Add 19 tests covering sandboxListCommand and sandboxRecreateCommand:
- List command: human/JSON output, browser flag, error handling
- Recreate command: validation, filtering (session/agent), confirmation flow
- Factory functions (createContainer, createBrowser) reduce duplication
- Helper functions (expectLogContains, setupDefaultMocks) improve readability

All tests passing. 365 LOC with ~66% production code coverage.
2026-01-09 13:23:16 +01:00
sheeek
00b77421dd refactor: improve sandbox commands code structure
Improvements:
- Extract validation into separate function
- Split display logic from business logic
- Create reusable container matcher for agent filtering
- Abstract status/image formatting into helpers
- Reduce code duplication between containers and browsers
- Extract container removal into generic function
- Add type safety with FilteredContainers type
- Improve readability with smaller, focused functions

Changes:
- validateRecreateOptions(): Validate mutual exclusivity
- fetchAndFilterContainers(): Fetch + filter in one place
- createAgentMatcher(): Reusable agent filter predicate
- displayContainers/Browsers(): Dedicated display functions
- displaySummary/RecreatePreview/Result(): Clear separation
- removeContainer(): Generic removal with error handling
- Format helpers: formatStatus, formatImageMatch, etc.
- Count helpers: countRunning, countMismatches

Result: 85 more lines but much better maintainability and testability.
2026-01-09 13:23:16 +01:00
sheeek
bcd52ee546 chore: update CHANGELOG for sandbox CLI commands 2026-01-09 13:23:16 +01:00
sheeek
75927d736a docs: add sandbox CLI documentation 2026-01-09 13:22:51 +01:00
sheeek
5e78d5a21f feat: add sandbox CLI commands for container management
Add 'clawd sandbox list' and 'clawd sandbox recreate' commands to manage
sandbox containers. This fixes the issue where containers continue using
old images/configs after updates.

Problem:
- When sandbox Docker images or configs are updated, existing containers
  keep running with old settings
- Containers are only recreated after 24h inactivity (pruning)
- If agents are used regularly, old containers run indefinitely

Solution:
- 'clawd sandbox list': Show all containers with status, age, and image match
- 'clawd sandbox recreate': Force container removal (recreated on next use)
  - Supports --all, --session, --agent, --browser filters
  - Requires confirmation unless --force is used

Implementation:
- Added helper functions to sandbox.ts (list/remove containers)
- Created sandbox-cli.ts following existing CLI patterns
- Created commands/sandbox.ts with list and recreate logic
- Integrated into program.ts

Use case: After updating sandbox images or changing sandbox config,
run 'clawd sandbox recreate --all' to ensure fresh containers.
2026-01-09 13:22:51 +01:00
Peter Steinberger
ae6f268987 refactor(msteams): validate send recipient
Co-authored-by: Onur <onutc@users.noreply.github.com>
2026-01-09 11:22:59 +01:00
Peter Steinberger
08cceb6435 fix(config): add gateway remote ssh fields 2026-01-09 11:18:37 +01:00
Peter Steinberger
6b107e9e74 refactor(msteams): consolidate stores and send context 2026-01-09 11:18:33 +01:00
Peter Steinberger
6d223303eb refactor(msteams): extract sdk + storage helpers 2026-01-09 11:07:32 +01:00
Peter Steinberger
8875dbd449 refactor(msteams): split monitor handler and poll store 2026-01-09 11:07:32 +01:00
Peter Steinberger
475d598ecb fix: normalize poll providers and msteams deps 2026-01-09 11:07:32 +01:00
Peter Steinberger
e55358c65d feat: finalize msteams polls + outbound parity 2026-01-09 11:07:32 +01:00
Onur
a2bba7ef51 fix(msteams): add msteams to pairing provider labels 2026-01-09 11:07:32 +01:00
Onur
7f326ae4ae fix: sync doctor-prompter.ts with main 2026-01-09 11:07:17 +01:00
Onur
13b47e6047 fix(doctor): restore initialValue behavior in non-interactive mode
The repair/force commit added an early return that broke non-interactive
mode - migrations would return false instead of using initialValue.
2026-01-09 11:07:01 +01:00
Onur
0bc50abd73 style: format quickstart note and media-note test 2026-01-09 11:07:00 +01:00
Onur
c469fac8ef Tests: speed up media note prompt setup 2026-01-09 11:07:00 +01:00
Onur
a542a285a3 Wizard: preserve QuickStart gateway settings 2026-01-09 11:07:00 +01:00
Onur
eb908985f7 Gateway: fix reload tests for MS Teams provider 2026-01-09 11:07:00 +01:00
Onur
1df7bfefe7 MSTeams: stop on shutdown and honor chunk limit 2026-01-09 11:07:00 +01:00
Onur
9f9b6044aa docs(msteams): expand setup guide with missing details
- Add Azure Bot deprecation notice (multi-tenant deprecated after 2025-07-31)
- Add RSC vs Graph API comparison table
- Add Known Limitations section (webhook timeouts, formatting limits)
- Add Reply Style section explaining threads vs posts channel UI
- Add Updating an existing app section with version bump steps
- Add icon sizes and zip instructions to manifest setup
- Expand troubleshooting with manifest upload errors
2026-01-09 11:07:00 +01:00
Onur
73c1d11eb9 Remove tmp files 2026-01-09 11:07:00 +01:00
Onur
ea1cd2c734 wip 2026-01-09 11:07:00 +01:00
Onur
54d82e4e83 wip [skip ci] 2026-01-09 11:07:00 +01:00
Onur
3cb3460398 add doc 2026-01-09 11:07:00 +01:00
Onur
96b4d885ac wip [skip ci] 2026-01-09 11:07:00 +01:00
Onur
678d704341 image works in DM 2026-01-09 11:07:00 +01:00
Onur
15e6761035 wip [skip ci] 2026-01-09 11:06:49 +01:00
Onur
e67ca92443 MS Teams: ingest inbound image attachments 2026-01-09 11:06:49 +01:00
Onur
2ab5890eab wip 2026-01-09 11:06:49 +01:00
Onur
d6256a388e feat(msteams): wire up proactive messaging in routeReply for queued replies 2026-01-09 11:06:49 +01:00
Onur
04b1eb57eb MS Teams: fix top-level replies (agent reference) 2026-01-09 11:06:39 +01:00
Onur
8d096ef85d Tests: stabilize file watchers 2026-01-09 11:06:39 +01:00
Onur
a2bab7d923 MS Teams: refactor provider + replyStyle + reliability 2026-01-09 11:06:38 +01:00
Onur
81f81be816 feat(msteams): add replyStyle config for thread vs top-level replies
- Add replyStyle config at global, team, and channel levels
- "thread" replies to the original message (for Posts layout channels)
- "top-level" posts as a new message (for Threads layout channels)
- Default based on requireMention: false → top-level, true → thread
- DMs always use thread style (direct reply)
2026-01-09 11:06:28 +01:00
Onur
269a3c4000 feat(msteams): add outbound sends and fix reply delivery
- Add sendMessageMSTeams for proactive messaging via CLI/gateway
- Wire msteams into outbound delivery, heartbeat targets, and gateway send
- Fix reply delivery to use SDK's getConversationReference() for proper
  bot info, avoiding "Activity Recipient undefined" errors
- Use proactive messaging for replies to post as top-level messages
  (not threaded) by omitting activityId from conversation reference
- Add lazy logger in send.ts to avoid test initialization issues
2026-01-09 11:06:14 +01:00
Onur
2c7d5c82f3 feat(msteams): add per-channel requireMention config
- Add teams/channels config structure to MSTeamsConfig
- Implement requireMention check in monitor.ts
  - Resolution order: channel > team > global > default (true)
- Update zod schema for validation
- Document RSC permissions for receiving all messages without @mention
- Document Graph API Proxy pattern for historical message access
- Document private channel limitations
- Document team/channel ID format (use URL path, not groupId)
2026-01-09 11:05:46 +01:00
Onur
7d72fcf7f8 add notes [skip ci] 2026-01-09 11:05:34 +01:00