Skip to content

Add terminal transcript export to the desktop terminal#4

Draft
Copilot wants to merge 32 commits intomainfrom
copilot/check-for-possible-enhancements
Draft

Add terminal transcript export to the desktop terminal#4
Copilot wants to merge 32 commits intomainfrom
copilot/check-for-possible-enhancements

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 30, 2026

This PR addresses the feature-enhancement request by adding a small, high-value workflow improvement to the desktop terminal. Users can now export the active terminal session transcript directly from the UI, which makes it easier to retain command output for evidence, notes, or reporting.

  • Terminal transcript export

    • Added an export action for the active terminal session.
    • Exposes the action in both the terminal header and the terminal context menu.
    • Generates a timestamped .txt download with a sanitized session-based filename.
  • Export behavior

    • Reads the active xterm buffer and serializes visible + scrollback content into plain text.
    • Trims trailing empty lines to avoid noisy exports.
    • Disables export when no terminal session is active.
    • Shows a lightweight toast for empty exports and successful downloads.
  • Documentation

    • Updated the terminal feature description in README.md to reflect transcript export support.
const filename = exportTerminalTranscript(terminal.xterm, terminal.name);

if (!filename) {
  toast({ title: "Nothing to export", description: "Run a command to capture terminal output first." });
  return;
}

toast({ title: "Session exported", description: filename });
  • Files changed

    • apps/desktop/src/pages/Terminal.tsx
    • apps/desktop/src/lib/terminal-export.ts
    • README.md
  • screenshot
    Terminal export UI

Original prompt

Check for possible enhancement in term of features

hlsitechio and others added 30 commits March 29, 2026 16:24
Removed the banner image from the README.
- Platform detection: compile-time BUILD_TARGET (web vs electron)
- vite.config.ts: conditional base, outDir, strip service key from web builds
- Fix: SecurityMonitor window.electron bug → IS_ELECTRON
- Fix: conditional pt-8 padding (no wasted space on web)
- Fix: landing page copy (9 agents, web-first messaging)
- Add: .env.staging + .env.production (no secrets)
- Add: ci.yml (typecheck + lint + dual build + secret audit)
- Add: deploy-web.yml (main→staging, v*→production)
- Update: release.yml (per-platform VITE_PLATFORM, VPS backup)
- Update: docker.yml (build-args for target/platform)
- Branding: CrowByte Terminal → CrowByte
- README: cleanup (remove tech stack, screenshots, fix AI infra table, fix contacts)
README:
- Rewrite all feature claims to match actual code
- Remove false claims: auto-capture, CSPM scanning, SBOM gen, pre-built SIEM connectors
- Security section: remove X25519 (uses P-256), remove audit logging (not implemented), remove no-telemetry
- Add accurate claims: ECDH+AES-256-GCM, credential encryption, activity logging, conversation encryption
- Move unfinished features to Roadmap where they belong

Tor removal:
- Remove checkTorStatus/checkTorIndicators from ip-status.ts
- Remove isTor from IPStatusData interface
- Remove Tor status UI from Dashboard
- Remove check-tor IPC handler from main.cjs
- Remove checkTor from preload.js and global.d.ts
- Remove check.torproject.org from CSP whitelist
- analytics.ts: all methods now explicit no-ops, clear NO TELEMETRY header
- Logs page: add Export dropdown (CSV + JSON) with timestamped filenames
- ip-status.ts: add loggingService calls for network events (success + warnings)
- README: add 'No Telemetry' + 'Exportable as CSV or JSON' claims (now true)
- README: update roadmap (export done, cloud sync still pending)
- Install @sentry/browser SDK (GlitchTip-compatible)
- Create glitchtip.ts service with:
  - Auto error capture via Sentry SDK
  - Manual captureError/captureMessage methods
  - User context (set on login, clear on logout)
  - Breadcrumb tracking
  - API client for AI agent: getIssues, getIssueEvents, getErrorSummary
  - resolveIssue API for triage
  - getIssuesForAgent — formatted output for AI consumption
- Initialize in App.tsx on mount
- Add DSN to .env, .env.production, .env.staging
- Add app.glitchtip.com to nginx CSP connect-src
- Filter noisy errors (ResizeObserver, extensions)
- Bridge: errors go to both GlitchTip AND local logging service
- Add @sentry/electron SDK
- Initialize Sentry in electron/main.cjs (main process crash capture)
- Set autoSessionTracking: false (GlitchTip requirement)
- Lower tracesSampleRate to 0.01 (1% in production)
- Renderer uses @sentry/browser (works for both web + Electron renderer)
- Enable sourcemap generation in Vite build
- @sentry/vite-plugin auto-uploads maps to GlitchTip on SENTRY_AUTH_TOKEN
- Maps auto-deleted post-upload (don't ship to users)
- GlitchTip MCP server added to Claude Code settings
- Permissions for mcp__glitchtip__* tools
…porter

- Removed @sentry/browser, @sentry/electron, @sentry/vite-plugin
- Renderer: custom error reporter using fetch() to GlitchTip store API
  - Global error + unhandledrejection handlers
  - Stack trace parsing (Chrome + Firefox)
  - Breadcrumb tracking, user context, noise filtering
- Main process: same pattern, pure Node fetch()
- Bundle size: -76 KB (2,531 → 2,455 KB)
- Zero external dependencies for error monitoring
- GlitchTip MCP server still configured for AI-assisted debugging
- sourcemap: 'hidden' — generates .map files without URL refs in bundles
- scripts/upload-sourcemaps.sh archives maps per version, strips from dist
- Proper filenames: chart-vendor-oyh-UeQZ.js.map (not GUIDs)
- sourcemaps/ dir gitignored (local debugging only)
- GlitchTip SaaS doesn't support release file uploads — archive locally
- Agent can now call glitchtip_get_issues, glitchtip_get_issue_events, glitchtip_error_summary
- System prompt updated with app error monitoring capability
- Scan instructions include GlitchTip checks (steps 6-8)
- Agent auto-checks for production bugs during every monitoring cycle
- Deep-dives into critical issues with stack traces via getIssueEvents
- Zero new deps — uses existing glitchtip.ts API client
SECURITY FIXES:
- inoreader.ts: OAuth client_secret moved to env var (was hardcoded)
- license-guard.ts: AES-GCM encryption replaces btoa() for license cache
- credentialStorage.ts: per-device generated salt replaces hardcoded string
- encryption.ts: HMAC key derived from password, not hardcoded
- remote-control.ts: random per-session HKDF salt (was zero bytes)
- CVE.tsx: dynamic user_id from auth session (was hardcoded UUID)

SHELL/PARTIAL FIXES:
- CloudSecurity: preview banner — marks as demo with sample data
- Missions: preview banner — tool execution is simulated
- Connectors: preview banner — integrations not yet active
- DetectionLab: honest label — 'pattern-based, AI coming soon'
- Tools.tsx: loadData() actually calls service, graceful error handling
- AgentBuilder: loadAgents() uncommented with try/catch fallback

UX:
- macOS download marked 'Coming Soon' (not yet tested)
- HardHat icon for preview banners (Construction doesn't exist in phosphor)
The grep catches 'service_role' in .map files (Supabase SDK type
definitions, not actual keys). Maps are stripped before audit and
never deployed to users.
app.isPackaged is always false when running Electron from source
(Docker, dev). The OR-based isDev check ignored NODE_ENV=production.

Now NODE_ENV=production short-circuits the check, so Docker containers
load dist/index.html instead of trying localhost:8081 dev server.

- electron/main.cjs: isForceProduction guard on both isDev checks
- docker/entrypoint.sh: export NODE_ENV=production before electron
Xvfb + Fluxbox positions the 1400x900 window off-screen.
When running from source in production mode (Docker), auto-maximize
so the TitleBar and full UI are visible through noVNC.
- Set app.name='crowbyte' so userData path is consistent (~/.config/crowbyte/)
  instead of ~/.config/Electron/ when running unpackaged
- Pre-seed crowbyte-config.json in entrypoint to skip onboarding wizard
- setFullScreen(true) for Docker/headless environments
- Add --start-maximized flag to electron CLI args
New support-agent.ts service with:
- RAG search over 35 doc chunks (docs-knowledge.json)
- Intent classification (docs/diagnostic/escalation/general)
- 6 diagnostic checks (Supabase, Auth, OpenClaw, Electron, Storage, ErrorReporter)
- OpenClaw AI chat with system prompt + RAG context
- Escalation to Supabase support_tickets + Discord webhook
- Push notification system via Supabase Realtime
- Ticket CRUD for user-facing ticket history

docs-knowledge.json: 35 chunks extracted from all doc sections (~70KB)
- fix: shell injection in memory bridge (exec → execFile)
- fix: /api/errors endpoints now require JWT auth
- fix: arg sanitization no longer skips --prefixed args
- fix: scan target format validation added
- fix: SSL verification configurable in Python agent
- feat: startup warnings for default credentials and missing JWT_SECRET
- feat: explicit CSP directives instead of disabled Helmet
- chore: noFallthroughCasesInSwitch enabled in tsconfig
Agent-Logs-Url: https://github.com/hlsitechio/crowbyte/sessions/95d303ec-05ae-4dbd-9f04-eebc2b9cc963

Co-authored-by: hlsitechio <68784598+hlsitechio@users.noreply.github.com>
Agent-Logs-Url: https://github.com/hlsitechio/crowbyte/sessions/dd46796a-8e66-4bea-b779-71a9c3b639ff

Co-authored-by: hlsitechio <68784598+hlsitechio@users.noreply.github.com>
@docs-page
Copy link
Copy Markdown

docs-page Bot commented Mar 30, 2026

To view this pull requests documentation preview, visit the following URL:

docs.page/hlsitechio/crowbyte~4

Documentation is deployed and generated using docs.page.

Copilot AI and others added 2 commits March 30, 2026 21:31
Agent-Logs-Url: https://github.com/hlsitechio/crowbyte/sessions/e8e6ffa0-ef54-4d1a-8319-6209c9663cf0

Co-authored-by: hlsitechio <68784598+hlsitechio@users.noreply.github.com>
Agent-Logs-Url: https://github.com/hlsitechio/crowbyte/sessions/e8e6ffa0-ef54-4d1a-8319-6209c9663cf0

Co-authored-by: hlsitechio <68784598+hlsitechio@users.noreply.github.com>
Copilot AI changed the title [WIP] Check for possible enhancements in features Add terminal transcript export to the desktop terminal Mar 30, 2026
Copilot AI requested a review from hlsitechio March 30, 2026 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants