319 Commits

Author SHA1 Message Date
dylan
bf41b47859 docs: add Discord media support design spec
Spec for adding file, image, and audio support to Discord adapter,
matching Telegram adapter's v0.5.2 capabilities.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: aa9a2339bc1a
2026-03-23 14:40:03 +07:00
dylan
9b0ab085e3 docs: update README with Discord adapter support
Add Discord as a supported channel alongside Telegram throughout the
README: prerequisites, setup wizard, usage commands, and session transfer.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: acbb57bda5a2
2026-03-23 14:19:38 +07:00
dylan
477c45cccc chore: remove accidentally staged worktree dirs
Entire-Checkpoint: 1281ebb0a57c
2026-03-23 14:18:46 +07:00
dylan
a5d463c3a9 merge: sync upstream/develop into develop
Resolves conflicts in package.json (keep both discord.js and
fastest-levenshtein) and pnpm-lock.yaml (regenerated).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: d7e8e9299f36
2026-03-23 14:18:29 +07:00
dylan
1e0e164e5c Merge branch 'worktree-discord-adapter' into develop 2026-03-23 14:15:35 +07:00
dylan
f71aa5a82a feat(config): streamline Discord setup with combined token+guild flow
Discord config editor now asks for bot token and guild ID together,
validates both against the Discord API (including guild membership check),
and auto-enables on success. Clears old channel IDs to force recreation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 14:15:23 +07:00
dylan
f6438f1382 Merge branch 'worktree-discord-adapter' into develop 2026-03-23 14:03:29 +07:00
dylan
4658388ffe fix(discord): fallback to text channel with threads when Community mode is disabled
Forum channels require Community mode. Instead of throwing an error,
now falls back to a regular text channel with threads for sessions.
- ensureForums: create GuildForum if Community enabled, GuildText otherwise
- createSessionThread: handle both Forum posts and Text channel threads
- setupAssistant: reuse createSessionThread for consistent thread creation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 14:03:23 +07:00
dylan
7ceff64f59 Merge branch 'worktree-discord-adapter' into develop 2026-03-23 13:54:14 +07:00
dylan
160224748f fix(discord): address PR review issues #4-9
- #6: Normalize userId to string in allowedUserIds check (supports both
  Telegram numeric IDs and Discord snowflake strings)
- #9: Validate guild has Community mode before creating forum channel,
  throw helpful error message if not enabled
- #4/#5: Wire discord.js REST rateLimited event to DiscordSendQueue.onRateLimited()
  to drop queued text edits when rate limited
- #7: Archive + lock threads instead of permanently deleting them,
  preserving conversation history

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 13:54:08 +07:00
dylan
5f5eafd914 Merge branch 'worktree-discord-adapter' into develop 2026-03-23 13:47:29 +07:00
dylan
49c7e80605 fix(discord): reuse existing channels on restart, handle deleted channels gracefully
- ensureForums: fetch existing forum/notification channels by saved ID before creating new ones
- setupAssistant: verify assistant thread exists and unarchive if needed
- Gracefully recreate channels if saved IDs point to deleted channels
- Log "Reusing existing..." on restart for clarity

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 13:47:22 +07:00
Leo Agent
272bcf041c merge: resolve conflicts with upstream/develop (file-service feature) 2026-03-23 13:46:52 +07:00
0xmrpeter
bae30700c5 chore: release v0.5.2
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
v0.5.2
2026-03-23 13:37:06 +07:00
0xmrpeter
d595a91cf6 feat: add file, image, and audio support via adapters
- Add FileService for saving/resolving files in ~/.openacp/files/<sessionId>/
- Support OGG→WAV voice conversion using ogg-opus-decoder + node-wav
- Extend ACP prompt to send image/audio as base64 when agent supports it,
  fallback to file path when not
- Handle agent→user image/audio content events via SessionBridge
- Telegram adapter: incoming photo, document, voice, audio, video_note handlers
- Telegram adapter: outgoing attachment sending (photo/voice/document)
- Add Attachment type, extend IncomingMessage/OutgoingMessage/AgentEvent
- Log agent prompt capabilities on init for debugging
- Fix agent-installer test to match version-stripping behavior

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 13:34:58 +07:00
dylan
bee030f7f0 Merge branch 'worktree-discord-adapter' into develop 2026-03-23 13:31:47 +07:00
dylan
ebebe88735 fix: add enable/disable toggle for channels in config editor
- Add enable/disable toggle for both Telegram and Discord in config editor
- Auto-set enabled=true when bot token is configured
- Show enabled status in channel settings display
- Fix Discord not starting because config was missing enabled=true

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 13:31:31 +07:00
Leo Agent
f19eaa99cb docs: add implementation plans for UI dashboard backend and scaffold
Entire-Checkpoint: 1f8a6b980840
2026-03-23 12:28:53 +07:00
Leo Agent
3f050d797e style(ui): polish UI with glassmorphism, gradient accents, and improved Config layout
Entire-Checkpoint: 1a94c35d4d67
2026-03-23 12:11:05 +07:00
dylan
8e4241f006 Merge branch 'worktree-discord-adapter' into develop 2026-03-23 11:47:21 +07:00
Leo Agent
2db55b28a4 fix(api): separate API 404 from static serving to prevent SPA fallback on API routes
Entire-Checkpoint: 79facd3181fe
2026-03-23 11:42:26 +07:00
Leo Agent
d819414145 feat(ui): implement Topics management page
Add TopicsPage with list, delete (with force option for active sessions), and bulk cleanup for finished/error topics.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 11:40:13 +07:00
Leo Agent
1596ed86f0 feat(ui): implement Config editor page with grouped fields
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 11:39:59 +07:00
Leo Agent
0dd18aef7f feat(ui): implement Session Detail page with live events and prompt input
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 6833363db6fe
2026-03-23 11:39:42 +07:00
Leo Agent
3a99f4be39 feat(ui): implement Sessions list page with filtering and create modal
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 11:37:41 +07:00
Leo Agent
38a111e711 feat(ui): implement Agents overview page with card grid
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 11:37:00 +07:00
Leo Agent
cbf299bdfe feat(ui): implement Dashboard overview page
Adds DashboardPage with 4 stat cards (System, Sessions, Adapters, Tunnel),
live SSE health updates, and quick action buttons (View Sessions, Restart Server).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 7cb710c4745f
2026-03-23 11:36:40 +07:00
dylan
5c3e84f3b0 feat: add channel selection to CLI config editor and onboarding
- Add "Channels" parent menu in config editor (choose Telegram/Discord inside)
- Add editDiscord() function for editing Discord bot token and guild ID
- Make setup step numbering dynamic based on channel selection
- Update hardcoded Telegram references to be channel-agnostic
- Update product guide to mention both Telegram and Discord

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 11:34:07 +07:00
dylan
64e64e57a9 Merge branch 'worktree-fix-critical-issues-21' into develop 2026-03-23 11:23:35 +07:00
dylan
193ffe325a fix: address PR #34 review feedback
- stopDaemon: handle EPERM on initial check by cleaning stale PID file
- stopDaemon: return stopped:false when process survives SIGKILL
- escapeSystemdValue: escape $ to prevent systemd variable expansion
- api-server: warn when secret file has insecure permissions (like SSH)
- api-server: explicit utf-8 encoding in Buffer.from for timingSafeEqual

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 11:22:57 +07:00
0xmrpeter
df9150a67c Merge branch 'develop'
# Conflicts:
#	src/adapters/telegram/commands/agents.ts
#	src/cli/commands.ts
2026-03-23 11:21:04 +07:00
0xmrpeter
cc8cc53c30 chore: release v0.5.1
- Generic bi-directional handoff for all agents (not just Claude)
- CLI typo suggestions with fuzzy matching
- Per-agent setup instructions shown after install
- Fix ACP flag stripping and base args in agents run
- Comprehensive test coverage (+410 test cases across 22 new test files)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
v0.5.1
2026-03-23 11:20:02 +07:00
dylan
031d0fbefc fix(test): update setup integration test for channel selection step
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 11:15:59 +07:00
Leo Agent
4f4c159347 feat(ui): scaffold React + Vite dashboard with layout, theme, API client, SSE hook, and shared components
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 770afb5e0f45
2026-03-23 11:13:36 +07:00
dylan
51f995816e feat(discord): add Discord to interactive setup flow
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 11:13:24 +07:00
dylan
85090ed1bb feat(discord): add Discord doctor health check
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 11:12:17 +07:00
dylan
9095ad73aa feat(discord): integrate Discord adapter in main.ts, fix channel-aware platform storage
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 11:11:14 +07:00
dylan
1d7fcec8c4 feat(discord): add main DiscordAdapter class
Implements DiscordAdapter wiring all leaf modules together: send queue,
tool tracker, draft manager, activity tracker, skill command manager,
permission handler, forums, assistant, and slash command routing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 11:08:47 +07:00
dylan
248342fd84 feat(discord): add assistant session management
Implements Task 11: spawnAssistant, buildWelcomeMessage, buildAssistantSystemPrompt,
and handleAssistantMessage for Discord-specific assistant sessions with full
system prompt including current state, action playbook, and product guide.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 11:04:44 +07:00
Mr.Peter
0ccf54e896
Merge pull request #39 from vincentlab3/fix/36-setup-claude-agent
fix(setup): show Claude in agent selection list during onboarding
2026-03-23 11:03:52 +07:00
Leo Agent
52601a1f24 refactor(api-server): decompose into SSEManager and StaticServer modules
Extract SSE connection pool logic into src/core/sse-manager.ts and
static file serving into src/core/static-server.ts to reduce api-server.ts
from 1035 lines per PR review feedback. No behavior changes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 0ce098c92766
2026-03-23 11:03:25 +07:00
dylan
05f0c287c3 feat(discord): add slash commands and interaction routing
Implements Task 10: complete Discord slash command infrastructure with
SLASH_COMMANDS array, central router, and all command handlers (new-session,
session, admin, menu, agents, doctor, integrate, settings).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 11:02:58 +07:00
vincent
a1400aff97 fix(setup): remove unnecessary as const from disabled field
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 10:59:44 +07:00
dylan
2f0600cd45 feat(discord): add skill command manager 2026-03-23 10:54:56 +07:00
dylan
463e6b7f14 feat(discord): add permission handler 2026-03-23 10:54:15 +07:00
dylan
f043a0ea70 feat(discord): add forum channel management 2026-03-23 10:53:09 +07:00
dylan
64ace651b6 feat(discord): add tool call tracker, action detection, and draft manager 2026-03-23 10:52:42 +07:00
dylan
a03bf64f74 feat(discord): add activity tracking 2026-03-23 10:50:53 +07:00
Leo Agent
16f366b9b0 feat(api): serve embedded UI dashboard as static files
Add static file serving to ApiServer so the React SPA can be served
from the same HTTP server. Accepts optional uiDir as 5th constructor
parameter with auto-detection fallback for dev and publish layouts.
Includes path traversal guard and SPA fallback to index.html.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 1fe28d47aa9b
2026-03-23 10:49:45 +07:00
vincent
8583269487 fix(setup): show Claude in agent selection list during onboarding
Claude was pre-installed before the checkbox was shown, then filtered
out as "already installed", making it invisible. Now installed agents
appear as pre-checked disabled items so users can see Claude is ready.

Fixes #36

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 10:48:45 +07:00