25 Commits

Author SHA1 Message Date
Leo Agent
638c425f29 merge upstream/develop: integrate tunnel/viewer features with session persistence 2026-03-20 13:16:43 +07:00
Leo Agent
038f3bae46 refactor: code review fixes and add design docs
- Extract shared spawn logic into spawnSubprocess() helper
- Remove signal handler leak in JsonFileSessionStore.destroy()
- Replace sessionStore! assertion with local variable capture
- Restore debug log for resolved agent command
- Fix IPv4-only networking (setDefaultAutoSelectFamily)
- Fix native fetch for grammY (client: { fetch })
- Add session persistence spec and implementation plan

Entire-Checkpoint: d3283b6c39ce
2026-03-20 12:54:26 +07:00
lngdao
24edd9c269 feat: add tunnel service with file/code viewer
Tunnel Service:
- Pluggable TunnelProvider interface with Cloudflare built-in
- Local HTTP server (Hono) on configurable port (default 3100)
- In-memory ViewerStore with TTL, path validation, 1MB limit
- Optional auth (Bearer token)
- Opt-in via config: tunnel.enabled (default: false)
- Env overrides: OPENACP_TUNNEL_ENABLED, OPENACP_TUNNEL_PORT,
  OPENACP_TUNNEL_PROVIDER

File/Code Viewer:
- Monaco Editor (VS Code engine) loaded from CDN
- Syntax highlighting for all languages
- Line numbers, minimap, word wrap, dark/light theme
- Line range highlighting via URL hash (#L42-L55)
- Copy button, file path breadcrumb

Diff Viewer:
- Monaco diff editor with side-by-side + inline toggle
- +/- change stats
- Dark/light theme

Integration:
- Core enriches tool_call/tool_update with viewerLinks metadata
- Telegram adapter renders clickable View file/View diff links
- ViewerLinks persist across tool updates (carried forward)
- File info extraction handles ACP diff content format
2026-03-20 12:26:25 +07:00
Leo Agent
9e59331158 test: add integration tests for session persistence and lazy resume 2026-03-20 12:20:18 +07:00
Leo Agent
4207509961 feat(telegram): persist topicId in session store for lazy resume
Entire-Checkpoint: 98f62d373a43
2026-03-20 12:19:38 +07:00
Leo Agent
1b8c6ba034 feat(core): add lazy resume with store status updates on session_end/error
Entire-Checkpoint: 50e741d4722f
2026-03-20 12:18:35 +07:00
Leo Agent
6e04d7f4bf feat(agent-instance): add resume() method with fallback to newSession
Entire-Checkpoint: 26699f7d6aad
2026-03-20 12:16:15 +07:00
Leo Agent
d8a995a72d feat(session-manager): integrate SessionStore for persistence
Entire-Checkpoint: 97a35cc408f1
2026-03-20 12:15:44 +07:00
Leo Agent
057774e284 feat(session-store): add JsonFileSessionStore with auto-cleanup
Entire-Checkpoint: af64d46e784e
2026-03-20 12:13:22 +07:00
Leo Agent
145b85e5fc feat(session): add agentSessionId field for resume support
Entire-Checkpoint: 9af6bd13426c
2026-03-20 12:10:00 +07:00
Leo Agent
ffc3cd1e1c feat(config): add sessionStore.ttlDays option (default 30)
Entire-Checkpoint: 59b2745cb184
2026-03-20 12:09:57 +07:00
Leo Agent
7116af864d feat(types): add SessionRecord and TelegramPlatformData types
Entire-Checkpoint: 36c1062c2553
2026-03-20 12:09:35 +07:00
dylan
69b4e74bd1 Update setup 2026-03-20 11:04:40 +07:00
dylan
70c9e618c3 feat(setup): improve onboarding UI with colors, auto-detect group chat, and supergroup guide
- Add ANSI colored output for success/warning/error messages
- Auto-detect group chat ID via getUpdates polling (press 'm' for manual entry)
- Add inline guide for creating a Telegram supergroup
- Strip quotes from workspace path input
- Clean up verbose output, show only essential info

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 2d9b6b0b7549
2026-03-20 10:55:34 +07:00
dylan
0e815c042d fix: update test imports for new project structure
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 832c6f31e5db
2026-03-20 10:27:02 +07:00
0xmrpeter
4cb124174f fix(telegram): update command autocomplete to include agent name
- Modified the updateCommandAutocomplete method to accept the agent name as a parameter, ensuring that command descriptions are prefixed with the agent's name for better context.
- Removed the static command reset in cleanupSkillCommands to maintain existing command context during cleanup.
2026-03-20 09:59:43 +07:00
0xmrpeter
5812e9cc82 feat(logging): enhance root logger with pino-pretty transport and proxy for child loggers
- Updated the root logger to use pino-pretty for improved log formatting with colorization and time translation.
- Implemented a Proxy for child loggers to ensure they inherit the initialized logger configuration, allowing for consistent logging behavior across modules.
2026-03-20 09:52:29 +07:00
Mr.Peter
144e17638c
Merge pull request #8 from lngdao/fix/pr2-review-issues
fix: address PR #2 review feedback
2026-03-20 09:44:07 +07:00
0xmrpeter
44f07cb03f fix(telegram): comment out debug log for message sending
- Commented out the debug log statement in the Telegram adapter's message sending method to reduce verbosity in logs.
2026-03-20 09:42:43 +07:00
lngdao
f5f27d242f fix: address PR #2 review feedback
- Replace `as any` with `as never` + proper type annotations (convention)
- Add comment explaining why allowed_updates transformer is needed alongside bot.start()
- Fix bot.catch to extract root cause from grammY BotError via err.error
- Add depth limit (max 5) to extractContentText to prevent stack overflow
- Use required `status: string` type for tool_update metadata
2026-03-20 08:53:04 +07:00
0xmrpeter
29130a8ae7 feat(telegram): implement dynamic skill command handling and autocomplete
- Added support for dynamic skill commands in the Telegram adapter, allowing for real-time command updates based on user interactions.
- Implemented methods to send and clean up skill commands, enhancing user experience with pinned messages and command autocomplete.
- Updated command handling to include skill-specific callbacks and keyboard generation for better interaction.
- Refactored existing command setup to accommodate new skill command features.
2026-03-19 23:46:21 +07:00
0xmrpeter
b59303c202 feat(telegram): add typing indicators and session warm-up notifications
- Implemented typing indicators for assistant and core message handling to improve user experience.
- Added user notifications during session setup to inform them of potential delays.
- Introduced a warm-up function for the session to prime the model cache while the user types their first message.
2026-03-19 22:12:10 +07:00
0xmrpeter
95bf9f9b81 feat: enhance ACP stream logging with raw NDJSON support
- Introduced Transform streams for logging raw NDJSON data sent to and received from the agent.
- Updated the creation of ACP streams to include logging functionality for better debugging and monitoring.
2026-03-19 21:58:13 +07:00
0xmrpeter
c82e2b98ed refactor: enhance logging and project structure for improved clarity and maintainability
- Updated logging system to use Pino for structured logging, including session-specific loggers.
- Refactored project structure in CLAUDE.md for better organization and clarity.
- Added new build scripts and commands in README.md for easier usage.
- Improved error handling and logging in core components and Telegram adapter.
- Introduced session log retention and cleanup functionality.
- Updated package.json and pnpm-lock.yaml to include new logging dependencies.
2026-03-19 21:32:18 +07:00
0xmrpeter
40777e75e2 chore: update package.json and pnpm-lock.yaml for dependency management and build configuration
- Added new dependencies: @agentclientprotocol/sdk, @inquirer/prompts, grammy, nanoid, and zod.
- Updated build scripts to use TypeScript compiler directly and modified entry points for the CLI.
- Removed outdated pnpm workspace and TypeScript configuration files.
- Adjusted tsup configuration for improved output structure and TypeScript declaration generation.
2026-03-19 19:03:47 +07:00