cconnect 2.1.2__tar.gz → 2.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cconnect-2.1.2 → cconnect-2.2.0}/PKG-INFO +11 -3
- {cconnect-2.1.2 → cconnect-2.2.0}/cconnect.egg-info/PKG-INFO +11 -3
- {cconnect-2.1.2 → cconnect-2.2.0}/cconnect.egg-info/SOURCES.txt +36 -4
- {cconnect-2.1.2 → cconnect-2.2.0}/cconnect.egg-info/requires.txt +9 -1
- {cconnect-2.1.2 → cconnect-2.2.0}/core/access.py +9 -1
- {cconnect-2.1.2 → cconnect-2.2.0}/core/app.py +7 -8
- cconnect-2.2.0/core/capture/manifest.json +9 -0
- cconnect-2.2.0/core/capture/offscreen.html +5 -0
- cconnect-2.2.0/core/capture/offscreen.js +139 -0
- cconnect-2.2.0/core/capture/worker.js +21 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/cli.py +14 -99
- {cconnect-2.1.2 → cconnect-2.2.0}/core/cli_manager.py +37 -7
- {cconnect-2.1.2 → cconnect-2.2.0}/core/config.py +5 -0
- cconnect-2.2.0/core/databases/engines.json +172 -0
- cconnect-2.2.0/core/db.py +85 -0
- cconnect-2.2.0/core/migrations/env.py +17 -0
- cconnect-2.2.0/core/migrations/script.py.mako +24 -0
- cconnect-2.2.0/core/migrations/versions/20261107_7d5d3c3df2d8_baseline.py +89 -0
- cconnect-2.2.0/core/migrations/versions/20261107_ba9d242701ac_trash_timestamps.py +46 -0
- cconnect-2.2.0/core/migrations/versions/20261107_e27b5df5f03a_server_state.py +136 -0
- cconnect-2.2.0/core/migrations/versions/20261108_4c1f0a9e2b7d_mcp_catalogs.py +33 -0
- cconnect-2.2.0/core/models.py +430 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packages.py +10 -3
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect/themes/cconnect-dark.json +1 -1
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect/themes/cconnect-light.json +3 -3
- cconnect-2.2.0/core/packs/cconnect-extras/themes/ayu-dark.json +39 -0
- cconnect-2.2.0/core/packs/cconnect-extras/themes/ayu-light.json +39 -0
- cconnect-2.2.0/core/packs/cconnect-extras/themes/ayu-mirage.json +39 -0
- cconnect-2.2.0/core/packs/cconnect-extras/themes/everforest-dark.json +39 -0
- cconnect-2.2.0/core/packs/cconnect-extras/themes/everforest-light.json +39 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/themes/github-dark-hc.json +1 -1
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/themes/github-light-hc.json +1 -1
- cconnect-2.2.0/core/packs/cconnect-extras/themes/kanagawa.json +39 -0
- cconnect-2.2.0/core/packs/cconnect-extras/themes/monokai.json +39 -0
- cconnect-2.2.0/core/packs/cconnect-extras/themes/ubuntu-dark.json +39 -0
- cconnect-2.2.0/core/packs/cconnect-extras/themes/ubuntu-light.json +39 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/schema.json +14 -2
- {cconnect-2.1.2 → cconnect-2.2.0}/core/paths.py +3 -9
- cconnect-2.2.0/core/process_tree.py +30 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/prompts/MODS.md +4 -2
- cconnect-2.2.0/core/prompts/TOOLS.md +6 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/release.py +3 -3
- {cconnect-2.1.2 → cconnect-2.2.0}/core/responses.py +32 -3
- cconnect-2.2.0/core/scripts/page_frame.js +39 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/sdk.py +18 -5
- {cconnect-2.1.2 → cconnect-2.2.0}/core/settings_defs.py +3 -1
- {cconnect-2.1.2 → cconnect-2.2.0}/core/slugs.py +7 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/ws.py +37 -0
- cconnect-2.2.0/mcps/__init__.py +150 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/mcps/browser.py +35 -42
- {cconnect-2.1.2 → cconnect-2.2.0}/mcps/check_progress.py +29 -47
- {cconnect-2.1.2 → cconnect-2.2.0}/mcps/components.py +104 -80
- cconnect-2.2.0/mcps/databases.py +584 -0
- cconnect-2.2.0/mcps/definition.py +20 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/mcps/delegate.py +34 -36
- {cconnect-2.1.2 → cconnect-2.2.0}/mcps/packs.py +28 -29
- {cconnect-2.1.2 → cconnect-2.2.0}/mcps/session.py +90 -84
- {cconnect-2.1.2 → cconnect-2.2.0}/mcps/shared_files.py +32 -34
- {cconnect-2.1.2 → cconnect-2.2.0}/mcps/terminal.py +62 -70
- {cconnect-2.1.2 → cconnect-2.2.0}/middleware/public_auth.py +19 -13
- cconnect-2.2.0/middleware/security.py +78 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/pyproject.toml +11 -3
- {cconnect-2.1.2 → cconnect-2.2.0}/routers/accounts.py +19 -9
- {cconnect-2.1.2 → cconnect-2.2.0}/routers/browser.py +57 -7
- {cconnect-2.1.2 → cconnect-2.2.0}/routers/capabilities.py +8 -2
- {cconnect-2.1.2 → cconnect-2.2.0}/routers/chat.py +126 -169
- {cconnect-2.1.2 → cconnect-2.2.0}/routers/claude.py +53 -6
- cconnect-2.2.0/routers/databases.py +238 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/routers/health.py +7 -1
- {cconnect-2.1.2 → cconnect-2.2.0}/routers/network.py +3 -3
- {cconnect-2.1.2 → cconnect-2.2.0}/routers/packs.py +8 -3
- {cconnect-2.1.2 → cconnect-2.2.0}/routers/pages.py +3 -1
- {cconnect-2.1.2 → cconnect-2.2.0}/routers/sessions.py +31 -24
- {cconnect-2.1.2 → cconnect-2.2.0}/routers/shared.py +25 -3
- {cconnect-2.1.2 → cconnect-2.2.0}/schemas/accounts.py +4 -1
- {cconnect-2.1.2 → cconnect-2.2.0}/schemas/chat.py +83 -4
- cconnect-2.2.0/schemas/chat_events.py +658 -0
- cconnect-2.2.0/schemas/contract.py +36 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/services/accounts.py +158 -204
- {cconnect-2.1.2 → cconnect-2.2.0}/services/acp_events.py +6 -2
- {cconnect-2.1.2 → cconnect-2.2.0}/services/agent_sessions.py +42 -51
- {cconnect-2.1.2 → cconnect-2.2.0}/services/agents.py +26 -44
- cconnect-2.2.0/services/attachments.py +112 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/services/browser.py +431 -63
- {cconnect-2.1.2 → cconnect-2.2.0}/services/chat_list.py +136 -66
- {cconnect-2.1.2 → cconnect-2.2.0}/services/claude_assets.py +229 -29
- {cconnect-2.1.2 → cconnect-2.2.0}/services/claude_manage.py +33 -37
- {cconnect-2.1.2 → cconnect-2.2.0}/services/claude_runtime.py +161 -104
- {cconnect-2.1.2 → cconnect-2.2.0}/services/claude_status.py +2 -20
- {cconnect-2.1.2 → cconnect-2.2.0}/services/cli_info.py +144 -61
- cconnect-2.2.0/services/cli_login.py +242 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/services/cli_settings.py +5 -23
- cconnect-2.2.0/services/database_data.py +790 -0
- cconnect-2.2.0/services/database_engines.py +207 -0
- cconnect-2.2.0/services/database_tunnels.py +116 -0
- cconnect-2.2.0/services/databases.py +376 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/services/delegate_runner.py +1 -1
- cconnect-2.2.0/services/delegate_runs.py +75 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/services/delegates.py +7 -25
- {cconnect-2.1.2 → cconnect-2.2.0}/services/directories.py +3 -1
- {cconnect-2.1.2 → cconnect-2.2.0}/services/directory_watch.py +22 -2
- {cconnect-2.1.2 → cconnect-2.2.0}/services/event_rows.py +15 -3
- {cconnect-2.1.2 → cconnect-2.2.0}/services/files.py +3 -2
- cconnect-2.2.0/services/git.py +49 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/services/git_ops.py +2 -4
- cconnect-2.2.0/services/hook_events.py +98 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/services/live_sessions.py +156 -22
- cconnect-2.2.0/services/mcp_lazy.py +660 -0
- cconnect-2.2.0/services/memory_pressure.py +99 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/services/network.py +168 -46
- {cconnect-2.1.2 → cconnect-2.2.0}/services/pack_format.py +12 -12
- {cconnect-2.1.2 → cconnect-2.2.0}/services/pages.py +12 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/services/persistent_sessions.py +11 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/services/project_files.py +2 -2
- {cconnect-2.1.2 → cconnect-2.2.0}/services/project_watch.py +18 -6
- {cconnect-2.1.2 → cconnect-2.2.0}/services/repo.py +4 -10
- {cconnect-2.1.2 → cconnect-2.2.0}/services/rewind.py +16 -27
- {cconnect-2.1.2 → cconnect-2.2.0}/services/sessions.py +288 -105
- {cconnect-2.1.2 → cconnect-2.2.0}/services/settings_store.py +1 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/services/shared.py +37 -34
- cconnect-2.2.0/services/speedtest.py +239 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/services/system_monitor.py +20 -6
- {cconnect-2.1.2 → cconnect-2.2.0}/services/system_watch.py +34 -25
- {cconnect-2.1.2 → cconnect-2.2.0}/services/terminal.py +2 -3
- cconnect-2.2.0/services/todos.py +49 -0
- cconnect-2.2.0/services/tool_calls.py +158 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/services/tool_props.py +1 -1
- {cconnect-2.1.2 → cconnect-2.2.0}/services/trash.py +4 -4
- {cconnect-2.1.2 → cconnect-2.2.0}/services/usage.py +22 -12
- {cconnect-2.1.2 → cconnect-2.2.0}/services/visibility.py +13 -3
- cconnect-2.1.2/core/data_migration.py +0 -145
- cconnect-2.1.2/core/db.py +0 -66
- cconnect-2.1.2/core/models.py +0 -133
- cconnect-2.1.2/core/packs/cconnect-extras/themes/vscode-hc-dark.json +0 -39
- cconnect-2.1.2/core/packs/cconnect-extras/themes/vscode-hc-light.json +0 -39
- cconnect-2.1.2/mcps/__init__.py +0 -88
- cconnect-2.1.2/middleware/security.py +0 -44
- cconnect-2.1.2/services/account_login.py +0 -158
- cconnect-2.1.2/services/attachments.py +0 -59
- cconnect-2.1.2/services/delegate_runs.py +0 -67
- cconnect-2.1.2/services/git.py +0 -26
- cconnect-2.1.2/services/speedtest.py +0 -104
- cconnect-2.1.2/services/todos.py +0 -63
- cconnect-2.1.2/services/tool_calls.py +0 -96
- {cconnect-2.1.2 → cconnect-2.2.0}/cconnect.egg-info/dependency_links.txt +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/cconnect.egg-info/entry_points.txt +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/cconnect.egg-info/top_level.txt +0 -0
- {cconnect-2.1.2/services → cconnect-2.2.0/core}/__init__.py +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/display.py +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/builtin.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect/accents.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect/pack.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect/terminal/black.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/backgrounds/cyberpunk.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/backgrounds/darkwave.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/pack.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/terminal/campbell.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/terminal/catppuccin-latte.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/terminal/catppuccin-mocha.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/terminal/claude-dark.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/terminal/claude-light.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/terminal/dark-plus.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/terminal/dracula.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/terminal/github-dark-hc.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/terminal/github-dark.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/terminal/github-dimmed.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/terminal/github-light-hc.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/terminal/github-light.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/terminal/gruvbox-dark.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/terminal/light-plus.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/terminal/monokai.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/terminal/nord.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/terminal/one-dark.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/terminal/one-half-dark.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/terminal/one-half-light.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/terminal/rose-pine.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/terminal/solarized-dark.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/terminal/solarized-light.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/terminal/tango-dark.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/terminal/tango-light.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/terminal/tokyo-night.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/terminal/ubuntu.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/terminal/vscode-dark-modern.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/terminal/vscode-hc-dark.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/terminal/vscode-hc-light.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/terminal/vscode-light-modern.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/themes/catppuccin-latte.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/themes/catppuccin-mocha.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/themes/claude-dark.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/themes/claude-light.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/themes/dracula.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/themes/github-dark.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/themes/github-dimmed.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/themes/github-light.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/themes/gruvbox-dark.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/themes/nord.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/themes/one-dark.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/themes/rose-pine.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/themes/solarized-dark.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/themes/solarized-light.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/themes/tokyo-night.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/themes/vscode-dark-modern.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/themes/vscode-dark-plus.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/themes/vscode-light-modern.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/packs/cconnect-extras/themes/vscode-light-plus.json +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/process_job.py +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/prompts/BLOCKS.md +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/prompts/BROWSER.md +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/prompts/CCONNECT.md +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/prompts/COMMIT.md +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/prompts/INSTALL.md +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/prompts/SUGGESTIONS.md +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/rate_limit.py +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/scripts/browse.py +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/scripts/mcp_bridge.py +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/core/scripts/page_icon.js +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/mcps/media.py +0 -0
- {cconnect-2.1.2/schemas → cconnect-2.2.0/middleware}/__init__.py +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/middleware/error_handler.py +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/routers/__init__.py +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/routers/agents.py +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/routers/cli.py +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/routers/git.py +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/routers/list.py +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/routers/projects.py +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/routers/settings.py +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/routers/system.py +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/routers/terminal.py +0 -0
- {cconnect-2.1.2/middleware → cconnect-2.2.0/schemas}/__init__.py +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/schemas/network.py +0 -0
- {cconnect-2.1.2/core → cconnect-2.2.0/services}/__init__.py +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/services/acp_peer.py +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/services/agent_connections.py +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/services/agent_mcp.py +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/services/agent_registry.py +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/services/api_errors.py +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/services/blocks.py +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/services/categories.py +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/services/control_requests.py +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/services/diffs.py +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/services/elicitation.py +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/services/mods.py +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/services/packs.py +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/services/processes.py +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/services/projects.py +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/services/prompt_cache.py +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/services/providers.py +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/services/questions.py +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/services/shared_links.py +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/services/shared_watch.py +0 -0
- {cconnect-2.1.2 → cconnect-2.2.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cconnect
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.2.0
|
|
4
4
|
Summary: Remote bridge between the CConnect client and Claude Code
|
|
5
5
|
Author: jahirtrap
|
|
6
6
|
License-Expression: MIT
|
|
@@ -12,24 +12,32 @@ Classifier: Intended Audience :: Developers
|
|
|
12
12
|
Classifier: Operating System :: OS Independent
|
|
13
13
|
Classifier: Programming Language :: Python :: 3
|
|
14
14
|
Classifier: Topic :: Software Development
|
|
15
|
-
Requires-Python: >=3.11
|
|
15
|
+
Requires-Python: >=3.11.4
|
|
16
16
|
Description-Content-Type: text/markdown
|
|
17
17
|
Requires-Dist: fastapi>=0.136.0
|
|
18
18
|
Requires-Dist: uvicorn[standard]>=0.45.0
|
|
19
19
|
Requires-Dist: pydantic>=2.13.3
|
|
20
20
|
Requires-Dist: loguru>=0.7.3
|
|
21
21
|
Requires-Dist: orjson>=3.12.0
|
|
22
|
-
Requires-Dist: python-dotenv>=1.
|
|
22
|
+
Requires-Dist: python-dotenv>=1.2.4
|
|
23
23
|
Requires-Dist: slowapi>=0.1.9
|
|
24
24
|
Requires-Dist: httpx>=0.28.0
|
|
25
|
+
Requires-Dist: websockets>=13.0
|
|
25
26
|
Requires-Dist: claude-agent-sdk>=0.2.167
|
|
27
|
+
Requires-Dist: mcp<3,>=2
|
|
26
28
|
Requires-Dist: qrcode>=7.4.2
|
|
27
29
|
Requires-Dist: sqlalchemy>=2.0.0
|
|
30
|
+
Requires-Dist: alembic>=1.20.1
|
|
31
|
+
Requires-Dist: sqlglot>=30.30.0
|
|
28
32
|
Requires-Dist: pillow>=10.0.0
|
|
29
33
|
Requires-Dist: psutil>=5.9.0
|
|
34
|
+
Requires-Dist: pyyaml>=6.0.3
|
|
35
|
+
Requires-Dist: packaging>=26.3
|
|
30
36
|
Requires-Dist: nvidia-ml-py>=12.0.0
|
|
31
37
|
Requires-Dist: py7zr>=1.0.0
|
|
38
|
+
Requires-Dist: py7zz>=1.5.0
|
|
32
39
|
Requires-Dist: rarfile>=4.2
|
|
40
|
+
Requires-Dist: av>=18.1
|
|
33
41
|
Requires-Dist: watchfiles>=1.2.0
|
|
34
42
|
Requires-Dist: pywinpty>=2.0.13; sys_platform == "win32"
|
|
35
43
|
Requires-Dist: ptyprocess>=0.7.0; sys_platform != "win32"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cconnect
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.2.0
|
|
4
4
|
Summary: Remote bridge between the CConnect client and Claude Code
|
|
5
5
|
Author: jahirtrap
|
|
6
6
|
License-Expression: MIT
|
|
@@ -12,24 +12,32 @@ Classifier: Intended Audience :: Developers
|
|
|
12
12
|
Classifier: Operating System :: OS Independent
|
|
13
13
|
Classifier: Programming Language :: Python :: 3
|
|
14
14
|
Classifier: Topic :: Software Development
|
|
15
|
-
Requires-Python: >=3.11
|
|
15
|
+
Requires-Python: >=3.11.4
|
|
16
16
|
Description-Content-Type: text/markdown
|
|
17
17
|
Requires-Dist: fastapi>=0.136.0
|
|
18
18
|
Requires-Dist: uvicorn[standard]>=0.45.0
|
|
19
19
|
Requires-Dist: pydantic>=2.13.3
|
|
20
20
|
Requires-Dist: loguru>=0.7.3
|
|
21
21
|
Requires-Dist: orjson>=3.12.0
|
|
22
|
-
Requires-Dist: python-dotenv>=1.
|
|
22
|
+
Requires-Dist: python-dotenv>=1.2.4
|
|
23
23
|
Requires-Dist: slowapi>=0.1.9
|
|
24
24
|
Requires-Dist: httpx>=0.28.0
|
|
25
|
+
Requires-Dist: websockets>=13.0
|
|
25
26
|
Requires-Dist: claude-agent-sdk>=0.2.167
|
|
27
|
+
Requires-Dist: mcp<3,>=2
|
|
26
28
|
Requires-Dist: qrcode>=7.4.2
|
|
27
29
|
Requires-Dist: sqlalchemy>=2.0.0
|
|
30
|
+
Requires-Dist: alembic>=1.20.1
|
|
31
|
+
Requires-Dist: sqlglot>=30.30.0
|
|
28
32
|
Requires-Dist: pillow>=10.0.0
|
|
29
33
|
Requires-Dist: psutil>=5.9.0
|
|
34
|
+
Requires-Dist: pyyaml>=6.0.3
|
|
35
|
+
Requires-Dist: packaging>=26.3
|
|
30
36
|
Requires-Dist: nvidia-ml-py>=12.0.0
|
|
31
37
|
Requires-Dist: py7zr>=1.0.0
|
|
38
|
+
Requires-Dist: py7zz>=1.5.0
|
|
32
39
|
Requires-Dist: rarfile>=4.2
|
|
40
|
+
Requires-Dist: av>=18.1
|
|
33
41
|
Requires-Dist: watchfiles>=1.2.0
|
|
34
42
|
Requires-Dist: pywinpty>=2.0.13; sys_platform == "win32"
|
|
35
43
|
Requires-Dist: ptyprocess>=0.7.0; sys_platform != "win32"
|
|
@@ -11,13 +11,13 @@ core/app.py
|
|
|
11
11
|
core/cli.py
|
|
12
12
|
core/cli_manager.py
|
|
13
13
|
core/config.py
|
|
14
|
-
core/data_migration.py
|
|
15
14
|
core/db.py
|
|
16
15
|
core/display.py
|
|
17
16
|
core/models.py
|
|
18
17
|
core/packages.py
|
|
19
18
|
core/paths.py
|
|
20
19
|
core/process_job.py
|
|
20
|
+
core/process_tree.py
|
|
21
21
|
core/rate_limit.py
|
|
22
22
|
core/release.py
|
|
23
23
|
core/responses.py
|
|
@@ -25,6 +25,17 @@ core/sdk.py
|
|
|
25
25
|
core/settings_defs.py
|
|
26
26
|
core/slugs.py
|
|
27
27
|
core/ws.py
|
|
28
|
+
core/capture/manifest.json
|
|
29
|
+
core/capture/offscreen.html
|
|
30
|
+
core/capture/offscreen.js
|
|
31
|
+
core/capture/worker.js
|
|
32
|
+
core/databases/engines.json
|
|
33
|
+
core/migrations/env.py
|
|
34
|
+
core/migrations/script.py.mako
|
|
35
|
+
core/migrations/versions/20261107_7d5d3c3df2d8_baseline.py
|
|
36
|
+
core/migrations/versions/20261107_ba9d242701ac_trash_timestamps.py
|
|
37
|
+
core/migrations/versions/20261107_e27b5df5f03a_server_state.py
|
|
38
|
+
core/migrations/versions/20261108_4c1f0a9e2b7d_mcp_catalogs.py
|
|
28
39
|
core/packs/builtin.json
|
|
29
40
|
core/packs/schema.json
|
|
30
41
|
core/packs/cconnect/accents.json
|
|
@@ -62,27 +73,34 @@ core/packs/cconnect-extras/terminal/vscode-dark-modern.json
|
|
|
62
73
|
core/packs/cconnect-extras/terminal/vscode-hc-dark.json
|
|
63
74
|
core/packs/cconnect-extras/terminal/vscode-hc-light.json
|
|
64
75
|
core/packs/cconnect-extras/terminal/vscode-light-modern.json
|
|
76
|
+
core/packs/cconnect-extras/themes/ayu-dark.json
|
|
77
|
+
core/packs/cconnect-extras/themes/ayu-light.json
|
|
78
|
+
core/packs/cconnect-extras/themes/ayu-mirage.json
|
|
65
79
|
core/packs/cconnect-extras/themes/catppuccin-latte.json
|
|
66
80
|
core/packs/cconnect-extras/themes/catppuccin-mocha.json
|
|
67
81
|
core/packs/cconnect-extras/themes/claude-dark.json
|
|
68
82
|
core/packs/cconnect-extras/themes/claude-light.json
|
|
69
83
|
core/packs/cconnect-extras/themes/dracula.json
|
|
84
|
+
core/packs/cconnect-extras/themes/everforest-dark.json
|
|
85
|
+
core/packs/cconnect-extras/themes/everforest-light.json
|
|
70
86
|
core/packs/cconnect-extras/themes/github-dark-hc.json
|
|
71
87
|
core/packs/cconnect-extras/themes/github-dark.json
|
|
72
88
|
core/packs/cconnect-extras/themes/github-dimmed.json
|
|
73
89
|
core/packs/cconnect-extras/themes/github-light-hc.json
|
|
74
90
|
core/packs/cconnect-extras/themes/github-light.json
|
|
75
91
|
core/packs/cconnect-extras/themes/gruvbox-dark.json
|
|
92
|
+
core/packs/cconnect-extras/themes/kanagawa.json
|
|
93
|
+
core/packs/cconnect-extras/themes/monokai.json
|
|
76
94
|
core/packs/cconnect-extras/themes/nord.json
|
|
77
95
|
core/packs/cconnect-extras/themes/one-dark.json
|
|
78
96
|
core/packs/cconnect-extras/themes/rose-pine.json
|
|
79
97
|
core/packs/cconnect-extras/themes/solarized-dark.json
|
|
80
98
|
core/packs/cconnect-extras/themes/solarized-light.json
|
|
81
99
|
core/packs/cconnect-extras/themes/tokyo-night.json
|
|
100
|
+
core/packs/cconnect-extras/themes/ubuntu-dark.json
|
|
101
|
+
core/packs/cconnect-extras/themes/ubuntu-light.json
|
|
82
102
|
core/packs/cconnect-extras/themes/vscode-dark-modern.json
|
|
83
103
|
core/packs/cconnect-extras/themes/vscode-dark-plus.json
|
|
84
|
-
core/packs/cconnect-extras/themes/vscode-hc-dark.json
|
|
85
|
-
core/packs/cconnect-extras/themes/vscode-hc-light.json
|
|
86
104
|
core/packs/cconnect-extras/themes/vscode-light-modern.json
|
|
87
105
|
core/packs/cconnect-extras/themes/vscode-light-plus.json
|
|
88
106
|
core/packs/cconnect/terminal/black.json
|
|
@@ -95,13 +113,17 @@ core/prompts/COMMIT.md
|
|
|
95
113
|
core/prompts/INSTALL.md
|
|
96
114
|
core/prompts/MODS.md
|
|
97
115
|
core/prompts/SUGGESTIONS.md
|
|
116
|
+
core/prompts/TOOLS.md
|
|
98
117
|
core/scripts/browse.py
|
|
99
118
|
core/scripts/mcp_bridge.py
|
|
119
|
+
core/scripts/page_frame.js
|
|
100
120
|
core/scripts/page_icon.js
|
|
101
121
|
mcps/__init__.py
|
|
102
122
|
mcps/browser.py
|
|
103
123
|
mcps/check_progress.py
|
|
104
124
|
mcps/components.py
|
|
125
|
+
mcps/databases.py
|
|
126
|
+
mcps/definition.py
|
|
105
127
|
mcps/delegate.py
|
|
106
128
|
mcps/media.py
|
|
107
129
|
mcps/packs.py
|
|
@@ -120,6 +142,7 @@ routers/capabilities.py
|
|
|
120
142
|
routers/chat.py
|
|
121
143
|
routers/claude.py
|
|
122
144
|
routers/cli.py
|
|
145
|
+
routers/databases.py
|
|
123
146
|
routers/git.py
|
|
124
147
|
routers/health.py
|
|
125
148
|
routers/list.py
|
|
@@ -135,9 +158,10 @@ routers/terminal.py
|
|
|
135
158
|
schemas/__init__.py
|
|
136
159
|
schemas/accounts.py
|
|
137
160
|
schemas/chat.py
|
|
161
|
+
schemas/chat_events.py
|
|
162
|
+
schemas/contract.py
|
|
138
163
|
schemas/network.py
|
|
139
164
|
services/__init__.py
|
|
140
|
-
services/account_login.py
|
|
141
165
|
services/accounts.py
|
|
142
166
|
services/acp_events.py
|
|
143
167
|
services/acp_peer.py
|
|
@@ -157,8 +181,13 @@ services/claude_manage.py
|
|
|
157
181
|
services/claude_runtime.py
|
|
158
182
|
services/claude_status.py
|
|
159
183
|
services/cli_info.py
|
|
184
|
+
services/cli_login.py
|
|
160
185
|
services/cli_settings.py
|
|
161
186
|
services/control_requests.py
|
|
187
|
+
services/database_data.py
|
|
188
|
+
services/database_engines.py
|
|
189
|
+
services/database_tunnels.py
|
|
190
|
+
services/databases.py
|
|
162
191
|
services/delegate_runner.py
|
|
163
192
|
services/delegate_runs.py
|
|
164
193
|
services/delegates.py
|
|
@@ -170,7 +199,10 @@ services/event_rows.py
|
|
|
170
199
|
services/files.py
|
|
171
200
|
services/git.py
|
|
172
201
|
services/git_ops.py
|
|
202
|
+
services/hook_events.py
|
|
173
203
|
services/live_sessions.py
|
|
204
|
+
services/mcp_lazy.py
|
|
205
|
+
services/memory_pressure.py
|
|
174
206
|
services/mods.py
|
|
175
207
|
services/network.py
|
|
176
208
|
services/pack_format.py
|
|
@@ -3,17 +3,25 @@ uvicorn[standard]>=0.45.0
|
|
|
3
3
|
pydantic>=2.13.3
|
|
4
4
|
loguru>=0.7.3
|
|
5
5
|
orjson>=3.12.0
|
|
6
|
-
python-dotenv>=1.
|
|
6
|
+
python-dotenv>=1.2.4
|
|
7
7
|
slowapi>=0.1.9
|
|
8
8
|
httpx>=0.28.0
|
|
9
|
+
websockets>=13.0
|
|
9
10
|
claude-agent-sdk>=0.2.167
|
|
11
|
+
mcp<3,>=2
|
|
10
12
|
qrcode>=7.4.2
|
|
11
13
|
sqlalchemy>=2.0.0
|
|
14
|
+
alembic>=1.20.1
|
|
15
|
+
sqlglot>=30.30.0
|
|
12
16
|
pillow>=10.0.0
|
|
13
17
|
psutil>=5.9.0
|
|
18
|
+
pyyaml>=6.0.3
|
|
19
|
+
packaging>=26.3
|
|
14
20
|
nvidia-ml-py>=12.0.0
|
|
15
21
|
py7zr>=1.0.0
|
|
22
|
+
py7zz>=1.5.0
|
|
16
23
|
rarfile>=4.2
|
|
24
|
+
av>=18.1
|
|
17
25
|
watchfiles>=1.2.0
|
|
18
26
|
|
|
19
27
|
[:sys_platform != "win32"]
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
"""The security key gating what belongs to the machine itself: shells and
|
|
1
|
+
"""The security key gating what belongs to the machine itself: shells, ignored files and database connections."""
|
|
2
2
|
|
|
3
3
|
import hmac
|
|
4
|
+
from typing import Optional
|
|
4
5
|
|
|
5
6
|
from core.config import PUBLIC_ACCESS_TOKEN, SECURITY_KEY
|
|
6
7
|
|
|
7
8
|
KEY_HEADER = "X-Security-Key"
|
|
9
|
+
KEYED_CAPABILITIES = ("terminal", "databases")
|
|
8
10
|
|
|
9
11
|
|
|
10
12
|
def gated() -> bool:
|
|
@@ -15,3 +17,9 @@ def key_matches(candidate: str) -> bool:
|
|
|
15
17
|
if not gated():
|
|
16
18
|
return True
|
|
17
19
|
return bool(SECURITY_KEY) and hmac.compare_digest(candidate or "", SECURITY_KEY)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def authorize(capabilities: list[str], key: Optional[str]) -> list[str]:
|
|
23
|
+
if key_matches(key or ""):
|
|
24
|
+
return list(capabilities)
|
|
25
|
+
return [item for item in capabilities if item not in KEYED_CAPABILITIES]
|
|
@@ -12,13 +12,13 @@ from fastapi.middleware.cors import CORSMiddleware
|
|
|
12
12
|
from fastapi.middleware.gzip import GZipMiddleware
|
|
13
13
|
from slowapi.errors import RateLimitExceeded
|
|
14
14
|
|
|
15
|
-
from core import
|
|
15
|
+
from core import paths
|
|
16
16
|
from core.config import PORT
|
|
17
17
|
from core.db import init_db
|
|
18
18
|
from core.rate_limit import limiter
|
|
19
19
|
from core.responses import api_response
|
|
20
20
|
from core.sdk import ensure_sdk_installed, ensure_subscription_auth
|
|
21
|
-
from services import agent_mcp,
|
|
21
|
+
from services import agent_mcp, mcp_lazy, settings_store, system_monitor
|
|
22
22
|
from middleware.error_handler import register_error_handlers
|
|
23
23
|
from middleware.public_auth import register_public_auth_middleware
|
|
24
24
|
from middleware.security import register_security_middleware
|
|
@@ -27,15 +27,10 @@ import routers as routers_pkg
|
|
|
27
27
|
|
|
28
28
|
@asynccontextmanager
|
|
29
29
|
async def lifespan(app: FastAPI):
|
|
30
|
-
data_migration.migrate()
|
|
31
30
|
init_db()
|
|
32
31
|
settings_store.load()
|
|
33
|
-
cli_settings.migrate()
|
|
34
|
-
from services import delegates
|
|
35
|
-
delegates.migrate()
|
|
36
32
|
from services import accounts
|
|
37
33
|
await asyncio.to_thread(accounts.purge_forgotten)
|
|
38
|
-
await asyncio.to_thread(accounts.link_all_shared_dirs)
|
|
39
34
|
paths.RUNTIME_FILE.write_text(f"PORT={PORT}\nPID={os.getpid()}\n", encoding="utf-8")
|
|
40
35
|
system_monitor.setup_log_capture()
|
|
41
36
|
ensure_subscription_auth()
|
|
@@ -51,6 +46,8 @@ async def lifespan(app: FastAPI):
|
|
|
51
46
|
await system_watch.hub.start()
|
|
52
47
|
from services import network
|
|
53
48
|
await network.watchdog.start()
|
|
49
|
+
from services import live_sessions, memory_pressure
|
|
50
|
+
memory_pressure.watch(live_sessions.registry.relieve)
|
|
54
51
|
yield
|
|
55
52
|
chat_list.hub.stop()
|
|
56
53
|
shared_watch.hub.stop()
|
|
@@ -58,8 +55,9 @@ async def lifespan(app: FastAPI):
|
|
|
58
55
|
project_watch.hub.stop()
|
|
59
56
|
system_watch.hub.stop()
|
|
60
57
|
network.watchdog.stop()
|
|
61
|
-
from services import live_sessions
|
|
58
|
+
from services import databases, live_sessions
|
|
62
59
|
await live_sessions.close_processes()
|
|
60
|
+
await asyncio.to_thread(databases.close_all)
|
|
63
61
|
paths.RUNTIME_FILE.unlink(missing_ok=True)
|
|
64
62
|
|
|
65
63
|
|
|
@@ -100,6 +98,7 @@ for module_info in pkgutil.iter_modules(routers_pkg.__path__):
|
|
|
100
98
|
app.include_router(module.router, prefix="/api")
|
|
101
99
|
|
|
102
100
|
app.mount(agent_mcp.PATH, agent_mcp.asgi)
|
|
101
|
+
app.mount(mcp_lazy.PATH, mcp_lazy.asgi)
|
|
103
102
|
|
|
104
103
|
|
|
105
104
|
@app.api_route(
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"manifest_version": 3,
|
|
3
|
+
"name": "CConnect",
|
|
4
|
+
"description": "Streams the active tab to the CConnect app.",
|
|
5
|
+
"version": "1.0",
|
|
6
|
+
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA7v/ygmzXCAXShPly9x1lkHurdKU24PUkLUROHI1J2Zp0wobWMjHGbpaoclA+xYI8+loAYXPMPDJ/AwhadP7xQqYcarvrfvj0X7gSAvay359F1LznQJFVTOTssy593VmZNeXcC2S12cnKMmpC5bMt8X5afLs5rRLU9zDqG8Po8aD3mNgqc5wewnn64OJDIX4/wjF7/iz3JtCWgdn1dpWJYHfIwQEfDXN2zshLPd/F3xa4/RZcrAUTlA37lLnkBDzTzbvk0S5NZxDxaoHpnkdJfPs7jx5w1jWab0HNwksWvmrfhyyb/ioZLrCg7+KOnGzjkHp+nxGXvVivzZjSXUaSfQIDAQAB",
|
|
7
|
+
"permissions": ["tabCapture", "offscreen", "tabs"],
|
|
8
|
+
"background": { "service_worker": "worker.js" }
|
|
9
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
const CODEC = "vp09.00.10.08";
|
|
2
|
+
const KEY = 1;
|
|
3
|
+
const DELTA = 2;
|
|
4
|
+
const HEADER = 9;
|
|
5
|
+
const QUEUE_LIMIT = 2;
|
|
6
|
+
const FEED_BACKLOG = 8 * 1024 * 1024;
|
|
7
|
+
const STILL_MS = 200;
|
|
8
|
+
const FRAME_RATE = 60;
|
|
9
|
+
|
|
10
|
+
let session = null;
|
|
11
|
+
|
|
12
|
+
const frameOptions = (key, quantizer) => ({ keyFrame: key, vp9: { quantizer } });
|
|
13
|
+
|
|
14
|
+
const send = (current, chunk) => {
|
|
15
|
+
if (current.socket.readyState !== WebSocket.OPEN) return;
|
|
16
|
+
if (current.socket.bufferedAmount > FEED_BACKLOG) {
|
|
17
|
+
current.wantKey = true;
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const buffer = new ArrayBuffer(HEADER + chunk.byteLength);
|
|
21
|
+
const view = new DataView(buffer);
|
|
22
|
+
view.setUint8(0, chunk.type === "key" ? KEY : DELTA);
|
|
23
|
+
view.setFloat64(1, chunk.timestamp);
|
|
24
|
+
chunk.copyTo(new Uint8Array(buffer, HEADER));
|
|
25
|
+
current.socket.send(buffer);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const keyNow = (current) => {
|
|
29
|
+
if (!current.held || current.encoder.state !== "configured" || current.encoder.encodeQueueSize) {
|
|
30
|
+
current.wantKey = true;
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
current.wantKey = false;
|
|
34
|
+
current.encoder.encode(current.held, frameOptions(true, current.dirty ? current.motion : current.still));
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const refine = (current) => {
|
|
38
|
+
current.timer = null;
|
|
39
|
+
if (!current.held || !current.dirty || current.encoder.state !== "configured" || current.encoder.encodeQueueSize) return;
|
|
40
|
+
current.dirty = false;
|
|
41
|
+
current.encoder.encode(current.held, frameOptions(false, current.still));
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const pump = async (current, reader) => {
|
|
45
|
+
while (session === current) {
|
|
46
|
+
const { value: frame, done } = await reader.read();
|
|
47
|
+
if (done || session !== current) {
|
|
48
|
+
frame?.close();
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
current.held?.close();
|
|
52
|
+
current.held = frame.clone();
|
|
53
|
+
if (current.timer !== null) clearTimeout(current.timer);
|
|
54
|
+
current.timer = setTimeout(() => refine(current), STILL_MS);
|
|
55
|
+
if (current.encoder.encodeQueueSize > QUEUE_LIMIT) {
|
|
56
|
+
frame.close();
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
const key = current.wantKey;
|
|
60
|
+
current.wantKey = false;
|
|
61
|
+
current.dirty = true;
|
|
62
|
+
current.encoder.encode(frame, frameOptions(key, current.motion));
|
|
63
|
+
frame.close();
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const stop = () => {
|
|
68
|
+
const current = session;
|
|
69
|
+
session = null;
|
|
70
|
+
if (!current) return;
|
|
71
|
+
if (current.timer !== null) clearTimeout(current.timer);
|
|
72
|
+
current.held?.close();
|
|
73
|
+
if (current.encoder.state !== "closed") current.encoder.close();
|
|
74
|
+
current.stream.getTracks().forEach((track) => track.stop());
|
|
75
|
+
if (current.socket.readyState <= WebSocket.OPEN) current.socket.close();
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const capture = async ({ streamId, width, height, feed, motion, still }) => {
|
|
79
|
+
stop();
|
|
80
|
+
const stream = await navigator.mediaDevices.getUserMedia({
|
|
81
|
+
audio: false,
|
|
82
|
+
video: {
|
|
83
|
+
mandatory: {
|
|
84
|
+
chromeMediaSource: "tab",
|
|
85
|
+
chromeMediaSourceId: streamId,
|
|
86
|
+
minWidth: width,
|
|
87
|
+
maxWidth: width,
|
|
88
|
+
minHeight: height,
|
|
89
|
+
maxHeight: height,
|
|
90
|
+
maxFrameRate: FRAME_RATE,
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
const track = stream.getVideoTracks()[0];
|
|
95
|
+
const settings = track.getSettings();
|
|
96
|
+
const socket = new WebSocket(feed);
|
|
97
|
+
socket.binaryType = "arraybuffer";
|
|
98
|
+
await new Promise((done, fail) => {
|
|
99
|
+
socket.addEventListener("open", done, { once: true });
|
|
100
|
+
socket.addEventListener("error", () => fail(new Error("feed refused")), { once: true });
|
|
101
|
+
});
|
|
102
|
+
const current = { stream, socket, encoder: null, held: null, timer: null, wantKey: true, dirty: false, motion, still };
|
|
103
|
+
session = current;
|
|
104
|
+
socket.onmessage = (event) => {
|
|
105
|
+
if (event.data === "key") keyNow(current);
|
|
106
|
+
};
|
|
107
|
+
socket.onclose = () => {
|
|
108
|
+
if (session === current) stop();
|
|
109
|
+
};
|
|
110
|
+
current.encoder = new VideoEncoder({
|
|
111
|
+
output: (chunk) => send(current, chunk),
|
|
112
|
+
error: () => {
|
|
113
|
+
if (session === current) stop();
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
current.encoder.configure({
|
|
117
|
+
codec: CODEC,
|
|
118
|
+
width: settings.width,
|
|
119
|
+
height: settings.height,
|
|
120
|
+
framerate: FRAME_RATE,
|
|
121
|
+
latencyMode: "realtime",
|
|
122
|
+
bitrateMode: "quantizer",
|
|
123
|
+
});
|
|
124
|
+
socket.send(JSON.stringify({ type: "stream", codec: CODEC, width: settings.width, height: settings.height }));
|
|
125
|
+
void pump(current, new MediaStreamTrackProcessor({ track }).readable.getReader());
|
|
126
|
+
return { width: settings.width, height: settings.height };
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
chrome.runtime.onMessage.addListener((message, _sender, respond) => {
|
|
130
|
+
if (message.op === "capture") {
|
|
131
|
+
capture(message).then(respond, (error) => respond({ error: String(error) }));
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
134
|
+
if (message.op === "stop") {
|
|
135
|
+
stop();
|
|
136
|
+
respond({});
|
|
137
|
+
}
|
|
138
|
+
return false;
|
|
139
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const OFFSCREEN = "offscreen.html";
|
|
2
|
+
|
|
3
|
+
const offscreenOpen = async () => {
|
|
4
|
+
const contexts = await chrome.runtime.getContexts({ contextTypes: ["OFFSCREEN_DOCUMENT"] });
|
|
5
|
+
if (contexts.length) return true;
|
|
6
|
+
await chrome.offscreen.createDocument({ url: OFFSCREEN, reasons: ["USER_MEDIA"], justification: "Streams the active tab to the CConnect app" });
|
|
7
|
+
return true;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
globalThis.__capture = async (options) => {
|
|
11
|
+
const [tab] = await chrome.tabs.query({ active: true, lastFocusedWindow: true });
|
|
12
|
+
if (!tab) throw new Error("no active tab");
|
|
13
|
+
const streamId = await chrome.tabCapture.getMediaStreamId({ targetTabId: tab.id });
|
|
14
|
+
await offscreenOpen();
|
|
15
|
+
return chrome.runtime.sendMessage({ op: "capture", streamId, ...options });
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
globalThis.__stop = async () => {
|
|
19
|
+
const contexts = await chrome.runtime.getContexts({ contextTypes: ["OFFSCREEN_DOCUMENT"] });
|
|
20
|
+
if (contexts.length) await chrome.runtime.sendMessage({ op: "stop" });
|
|
21
|
+
};
|