cconnect 2.2.1__tar.gz → 2.2.4__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.2.1 → cconnect-2.2.4}/PKG-INFO +1 -1
- {cconnect-2.2.1 → cconnect-2.2.4}/cconnect.egg-info/PKG-INFO +1 -1
- {cconnect-2.2.1 → cconnect-2.2.4}/cconnect.egg-info/SOURCES.txt +1 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/databases/engines.json +13 -1
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packages.py +3 -2
- cconnect-2.2.4/core/packs/cconnect-extras/backgrounds/doodles.json +8 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/pack.json +1 -1
- {cconnect-2.2.1 → cconnect-2.2.4}/core/release.py +1 -1
- {cconnect-2.2.1 → cconnect-2.2.4}/mcps/__init__.py +1 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/mcps/databases.py +9 -6
- {cconnect-2.2.1 → cconnect-2.2.4}/routers/chat.py +2 -1
- {cconnect-2.2.1 → cconnect-2.2.4}/routers/databases.py +11 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/routers/projects.py +7 -1
- {cconnect-2.2.1 → cconnect-2.2.4}/routers/sessions.py +11 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/chat_list.py +12 -7
- {cconnect-2.2.1 → cconnect-2.2.4}/services/cli_settings.py +36 -4
- {cconnect-2.2.1 → cconnect-2.2.4}/services/database_data.py +158 -14
- {cconnect-2.2.1 → cconnect-2.2.4}/services/database_engines.py +7 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/git_ops.py +5 -1
- {cconnect-2.2.1 → cconnect-2.2.4}/services/project_watch.py +62 -34
- {cconnect-2.2.1 → cconnect-2.2.4}/services/repo.py +11 -2
- {cconnect-2.2.1 → cconnect-2.2.4}/services/sessions.py +32 -11
- {cconnect-2.2.1 → cconnect-2.2.4}/services/system_monitor.py +10 -1
- {cconnect-2.2.1 → cconnect-2.2.4}/cconnect.egg-info/dependency_links.txt +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/cconnect.egg-info/entry_points.txt +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/cconnect.egg-info/requires.txt +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/cconnect.egg-info/top_level.txt +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/__init__.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/access.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/app.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/capture/manifest.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/capture/offscreen.html +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/capture/offscreen.js +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/capture/worker.js +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/cli.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/cli_manager.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/config.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/db.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/display.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/migrations/env.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/migrations/script.py.mako +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/migrations/versions/20261107_7d5d3c3df2d8_baseline.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/migrations/versions/20261107_ba9d242701ac_trash_timestamps.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/migrations/versions/20261107_e27b5df5f03a_server_state.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/migrations/versions/20261108_4c1f0a9e2b7d_mcp_catalogs.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/models.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/builtin.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect/accents.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect/pack.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect/terminal/black.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect/themes/cconnect-dark.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect/themes/cconnect-light.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/backgrounds/cyberpunk.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/backgrounds/darkwave.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/terminal/campbell.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/terminal/catppuccin-latte.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/terminal/catppuccin-mocha.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/terminal/claude-dark.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/terminal/claude-light.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/terminal/dark-plus.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/terminal/dracula.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/terminal/github-dark-hc.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/terminal/github-dark.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/terminal/github-dimmed.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/terminal/github-light-hc.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/terminal/github-light.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/terminal/gruvbox-dark.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/terminal/light-plus.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/terminal/monokai.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/terminal/nord.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/terminal/one-dark.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/terminal/one-half-dark.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/terminal/one-half-light.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/terminal/rose-pine.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/terminal/solarized-dark.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/terminal/solarized-light.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/terminal/tango-dark.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/terminal/tango-light.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/terminal/tokyo-night.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/terminal/ubuntu.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/terminal/vscode-dark-modern.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/terminal/vscode-hc-dark.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/terminal/vscode-hc-light.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/terminal/vscode-light-modern.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/themes/ayu-dark.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/themes/ayu-light.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/themes/ayu-mirage.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/themes/catppuccin-latte.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/themes/catppuccin-mocha.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/themes/claude-dark.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/themes/claude-light.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/themes/dracula.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/themes/everforest-dark.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/themes/everforest-light.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/themes/github-dark-hc.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/themes/github-dark.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/themes/github-dimmed.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/themes/github-light-hc.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/themes/github-light.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/themes/gruvbox-dark.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/themes/kanagawa.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/themes/monokai.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/themes/nord.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/themes/one-dark.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/themes/rose-pine.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/themes/solarized-dark.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/themes/solarized-light.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/themes/tokyo-night.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/themes/ubuntu-dark.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/themes/ubuntu-light.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/themes/vscode-dark-modern.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/themes/vscode-dark-plus.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/themes/vscode-light-modern.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/cconnect-extras/themes/vscode-light-plus.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/packs/schema.json +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/paths.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/process_job.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/process_tree.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/prompts/BLOCKS.md +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/prompts/BROWSER.md +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/prompts/CCONNECT.md +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/prompts/COMMIT.md +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/prompts/INSTALL.md +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/prompts/MODS.md +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/prompts/SUGGESTIONS.md +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/prompts/TOOLS.md +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/rate_limit.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/responses.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/scripts/browse.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/scripts/mcp_bridge.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/scripts/page_frame.js +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/scripts/page_icon.js +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/sdk.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/settings_defs.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/slugs.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/core/ws.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/mcps/browser.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/mcps/check_progress.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/mcps/components.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/mcps/definition.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/mcps/delegate.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/mcps/media.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/mcps/packs.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/mcps/session.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/mcps/shared_files.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/mcps/terminal.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/middleware/__init__.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/middleware/error_handler.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/middleware/public_auth.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/middleware/security.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/pyproject.toml +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/routers/__init__.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/routers/accounts.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/routers/agents.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/routers/browser.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/routers/capabilities.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/routers/claude.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/routers/cli.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/routers/git.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/routers/health.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/routers/list.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/routers/network.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/routers/packs.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/routers/pages.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/routers/settings.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/routers/shared.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/routers/system.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/routers/terminal.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/schemas/__init__.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/schemas/accounts.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/schemas/chat.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/schemas/chat_events.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/schemas/contract.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/schemas/network.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/__init__.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/accounts.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/acp_events.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/acp_peer.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/agent_connections.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/agent_mcp.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/agent_registry.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/agent_sessions.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/agents.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/api_errors.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/attachments.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/blocks.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/browser.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/categories.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/claude_assets.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/claude_manage.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/claude_runtime.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/claude_status.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/cli_info.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/cli_login.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/control_requests.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/database_tunnels.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/databases.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/delegate_runner.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/delegate_runs.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/delegates.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/diffs.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/directories.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/directory_watch.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/elicitation.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/event_rows.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/files.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/git.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/hook_events.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/live_sessions.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/mcp_lazy.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/memory_pressure.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/mods.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/network.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/pack_format.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/packs.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/pages.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/persistent_sessions.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/processes.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/project_files.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/projects.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/prompt_cache.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/providers.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/questions.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/rewind.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/settings_store.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/shared.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/shared_links.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/shared_watch.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/speedtest.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/system_watch.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/terminal.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/todos.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/tool_calls.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/tool_props.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/trash.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/usage.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/services/visibility.py +0 -0
- {cconnect-2.2.1 → cconnect-2.2.4}/setup.cfg +0 -0
|
@@ -43,6 +43,7 @@ core/packs/cconnect/pack.json
|
|
|
43
43
|
core/packs/cconnect-extras/pack.json
|
|
44
44
|
core/packs/cconnect-extras/backgrounds/cyberpunk.json
|
|
45
45
|
core/packs/cconnect-extras/backgrounds/darkwave.json
|
|
46
|
+
core/packs/cconnect-extras/backgrounds/doodles.json
|
|
46
47
|
core/packs/cconnect-extras/terminal/campbell.json
|
|
47
48
|
core/packs/cconnect-extras/terminal/catppuccin-latte.json
|
|
48
49
|
core/packs/cconnect-extras/terminal/catppuccin-mocha.json
|
|
@@ -19,6 +19,11 @@
|
|
|
19
19
|
"primary_key": null,
|
|
20
20
|
"columns": null,
|
|
21
21
|
"binary": "X'{hex}'",
|
|
22
|
+
"quote": "\"",
|
|
23
|
+
"auto_increment": "",
|
|
24
|
+
"identity_sync": "",
|
|
25
|
+
"identity_insert_on": "",
|
|
26
|
+
"identity_insert_off": "",
|
|
22
27
|
"hidden_schemas": ["information_schema", "INFORMATION_SCHEMA"],
|
|
23
28
|
"options": [],
|
|
24
29
|
"extensions": [],
|
|
@@ -55,6 +60,8 @@
|
|
|
55
60
|
"read_only": ["SET TRANSACTION READ ONLY"],
|
|
56
61
|
"timeout": "SET LOCAL statement_timeout = {milliseconds}",
|
|
57
62
|
"binary": "decode('{hex}', 'hex')",
|
|
63
|
+
"auto_increment": "GENERATED BY DEFAULT AS IDENTITY",
|
|
64
|
+
"identity_sync": "SELECT setval(pg_get_serial_sequence('{table}', '{column}'), COALESCE((SELECT max({column}) FROM {table}), 0) + 1, false);",
|
|
58
65
|
"hidden_schemas": ["information_schema", "pg_catalog", "pg_toast"],
|
|
59
66
|
"returning": "cte"
|
|
60
67
|
},
|
|
@@ -69,6 +76,8 @@
|
|
|
69
76
|
"connect_timeout": "connect_timeout",
|
|
70
77
|
"read_only": ["SET TRANSACTION READ ONLY"],
|
|
71
78
|
"timeout": "SET SESSION max_execution_time = {milliseconds}",
|
|
79
|
+
"quote": "`",
|
|
80
|
+
"auto_increment": "AUTO_INCREMENT",
|
|
72
81
|
"hidden_schemas": ["information_schema", "mysql", "performance_schema", "sys"]
|
|
73
82
|
},
|
|
74
83
|
{
|
|
@@ -89,6 +98,9 @@
|
|
|
89
98
|
"sqlglot": "tsql",
|
|
90
99
|
"connect_timeout": "login_timeout",
|
|
91
100
|
"binary": "0x{hex}",
|
|
101
|
+
"auto_increment": "IDENTITY(1,1)",
|
|
102
|
+
"identity_insert_on": "SET IDENTITY_INSERT {table} ON;",
|
|
103
|
+
"identity_insert_off": "SET IDENTITY_INSERT {table} OFF;",
|
|
92
104
|
"hidden_schemas": ["INFORMATION_SCHEMA", "sys", "guest"]
|
|
93
105
|
},
|
|
94
106
|
{
|
|
@@ -126,7 +138,7 @@
|
|
|
126
138
|
{"id": "aurora_dsql", "extends": "postgresql", "label": "Amazon Aurora DSQL", "dialect": "auroradsql+psycopg", "packages": ["aurora-dsql-sqlalchemy", "psycopg[binary]"], "distributions": ["aurora-dsql-sqlalchemy", "psycopg"], "returning": null},
|
|
127
139
|
{"id": "athena", "label": "Amazon Athena", "dialect": "awsathena+rest", "packages": ["pyathena[sqlalchemy]"], "distributions": ["pyathena"], "port": 443, "sqlglot": "athena", "options": ["s3_staging_dir", "work_group"]},
|
|
128
140
|
{"id": "dynamodb", "label": "Amazon DynamoDB", "dialect": "dynamodb", "packages": ["pydynamodb"], "distributions": ["pydynamodb"], "port": 443, "options": ["region_name"]},
|
|
129
|
-
{"id": "redshift", "extends": "postgresql", "label": "Amazon Redshift", "home": "dev", "dialect": "redshift+psycopg2", "packages": ["sqlalchemy-redshift", "psycopg2-binary"], "distributions": ["sqlalchemy-redshift", "psycopg2-binary"], "port": 5439, "sqlglot": "redshift", "timeout": null, "returning": null},
|
|
141
|
+
{"id": "redshift", "extends": "postgresql", "label": "Amazon Redshift", "home": "dev", "dialect": "redshift+psycopg2", "packages": ["sqlalchemy-redshift", "psycopg2-binary"], "distributions": ["sqlalchemy-redshift", "psycopg2-binary"], "port": 5439, "sqlglot": "redshift", "timeout": null, "auto_increment": "IDENTITY(1,1)", "identity_sync": "", "returning": null},
|
|
130
142
|
{"id": "drill", "label": "Apache Drill", "dialect": "drill+sadrill", "packages": ["sqlalchemy-drill"], "distributions": ["sqlalchemy-drill"], "port": 8047, "sqlglot": "drill"},
|
|
131
143
|
{"id": "druid", "label": "Apache Druid", "dialect": "druid", "packages": ["pydruid[sqlalchemy]"], "distributions": ["pydruid"], "port": 8082, "sqlglot": "druid"},
|
|
132
144
|
{"id": "hive", "label": "Apache Hive", "dialect": "hive", "packages": ["pyhive[hive_pure_sasl]"], "distributions": ["pyhive"], "port": 10000, "sqlglot": "hive"},
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import shutil
|
|
4
4
|
import subprocess
|
|
5
5
|
import sys
|
|
6
|
+
from itertools import chain
|
|
6
7
|
from pathlib import Path
|
|
7
8
|
|
|
8
9
|
NO_WINDOW = getattr(subprocess, "CREATE_NO_WINDOW", 0)
|
|
@@ -29,10 +30,10 @@ def uninstall_command(*distributions: str) -> list[str]:
|
|
|
29
30
|
return [sys.executable, "-m", "pip", "uninstall", "-y", *distributions]
|
|
30
31
|
|
|
31
32
|
|
|
32
|
-
def upgrade_command(distribution: str) -> list[str]:
|
|
33
|
+
def upgrade_command(distribution: str, kept: list[str] = ()) -> list[str]:
|
|
33
34
|
uv = uv_tool()
|
|
34
35
|
if uv:
|
|
35
|
-
return [uv, "tool", "upgrade", distribution]
|
|
36
|
+
return [uv, "tool", "install", "--upgrade", distribution, *chain.from_iterable(("--with", item) for item in kept)]
|
|
36
37
|
return [sys.executable, "-m", "pip", "install", "--upgrade", distribution]
|
|
37
38
|
|
|
38
39
|
|
|
@@ -69,6 +69,7 @@ def _discover(context: dict) -> list[tuple[Any, Any]]:
|
|
|
69
69
|
def _probe(capabilities: Iterable[str]) -> dict:
|
|
70
70
|
return {
|
|
71
71
|
"request_compact": lambda *_args: None,
|
|
72
|
+
"reload": lambda *_args: None,
|
|
72
73
|
"session_info": lambda: {},
|
|
73
74
|
"emit": lambda *_args, **_kwargs: None,
|
|
74
75
|
"ask_user": lambda *_args, **_kwargs: None,
|
|
@@ -105,7 +105,8 @@ DB_MANAGE = Definition(
|
|
|
105
105
|
" a connection and update changes the fields given; remove deletes the connection, never the database; test"
|
|
106
106
|
" connects without saving. install and uninstall put an engine's driver on the server or take it off. open"
|
|
107
107
|
" opens a SQLite or DuckDB file as a connection for this session. export writes a table or a query to the"
|
|
108
|
-
" shared folder as CSV, or a table as SQL
|
|
108
|
+
" shared folder as CSV, or a table, a schema or the whole database as SQL with its structure and rows, and"
|
|
109
|
+
" shows the file to the user.",
|
|
109
110
|
{
|
|
110
111
|
"type": "object",
|
|
111
112
|
"properties": {
|
|
@@ -141,10 +142,10 @@ DB_MANAGE = Definition(
|
|
|
141
142
|
},
|
|
142
143
|
"description": "add and update: an SSH tunnel through another machine, with the server's ssh client.",
|
|
143
144
|
},
|
|
144
|
-
"schema": {"type": "string", "description": "export: the table's
|
|
145
|
-
"table": {"type": "string", "description": "export: the table to write."},
|
|
145
|
+
"schema": {"type": "string", "description": "export: the schema to write, or the table's; the default one when left out."},
|
|
146
|
+
"table": {"type": "string", "description": "export: the table to write. Without table and sql, the schema or the whole database is written."},
|
|
146
147
|
"sql": {"type": "string", "description": "export: a query that reads, written instead of a table."},
|
|
147
|
-
"format": {"type": "string", "enum": list(database_data.TABLE_FORMATS), "description": "export: csv
|
|
148
|
+
"format": {"type": "string", "enum": list(database_data.TABLE_FORMATS), "description": "export: csv or sql for a table, csv when left out; a schema or a database is always sql."},
|
|
148
149
|
},
|
|
149
150
|
"required": ["action"],
|
|
150
151
|
},
|
|
@@ -499,10 +500,12 @@ def _export_file(args: dict, folder: Path) -> str:
|
|
|
499
500
|
scope = _scope(args)
|
|
500
501
|
if args.get("sql"):
|
|
501
502
|
written = database_data.export_query(scope, args["sql"], folder)
|
|
502
|
-
|
|
503
|
+
elif args.get("table"):
|
|
503
504
|
written = database_data.export_table(
|
|
504
|
-
scope, args.get("schema") or None, args
|
|
505
|
+
scope, args.get("schema") or None, args["table"], None, False, "", args.get("format") or database_data.CSV, folder,
|
|
505
506
|
)
|
|
507
|
+
else:
|
|
508
|
+
written = database_data.export_dump(scope, args.get("schema") or None, folder=folder)
|
|
506
509
|
return Path(written).name
|
|
507
510
|
|
|
508
511
|
|
|
@@ -543,7 +543,8 @@ async def chat_ws(ws: WebSocket):
|
|
|
543
543
|
|
|
544
544
|
elif mtype == "set_generation":
|
|
545
545
|
if session is not None:
|
|
546
|
-
|
|
546
|
+
settled = session.state.session_id is not None or session.running or session.resident_alive
|
|
547
|
+
if msg.cwd is not None and not settled:
|
|
547
548
|
session.state.cwd = msg.cwd or DEFAULT_CWD
|
|
548
549
|
if msg.model is not None:
|
|
549
550
|
session.state.model = msg.model
|
|
@@ -86,6 +86,10 @@ class TableExport(Browse):
|
|
|
86
86
|
format: Literal[database_data.CSV, database_data.SQL] = database_data.CSV
|
|
87
87
|
|
|
88
88
|
|
|
89
|
+
class SchemaExport(Scoped):
|
|
90
|
+
schema_name: Optional[str] = Field(None, alias="schema")
|
|
91
|
+
|
|
92
|
+
|
|
89
93
|
def _failed(exc: Exception) -> Response:
|
|
90
94
|
if isinstance(exc, databases.DatabaseError) and exc.reason == database_data.WRITES:
|
|
91
95
|
return api_response(status=403)
|
|
@@ -236,3 +240,10 @@ async def export_table(connection_id: str, body: TableExport, x_security_key: st
|
|
|
236
240
|
@router.post("/databases/{connection_id}/export/query")
|
|
237
241
|
async def export_query(connection_id: str, body: Statement, x_security_key: str = Header("")):
|
|
238
242
|
return await _reading(connection_id, x_security_key, lambda: {"path": database_data.export_query(databases.Scope(connection_id, body.database), body.sql)})
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
@router.post("/databases/{connection_id}/export/dump")
|
|
246
|
+
async def export_dump(connection_id: str, body: SchemaExport, x_security_key: str = Header("")):
|
|
247
|
+
return await _reading(
|
|
248
|
+
connection_id, x_security_key, lambda: {"path": database_data.export_dump(databases.Scope(connection_id, body.database), body.schema_name)},
|
|
249
|
+
)
|
|
@@ -66,7 +66,13 @@ async def projects_ws(ws: WebSocket):
|
|
|
66
66
|
while True:
|
|
67
67
|
msg = await ws.receive_json()
|
|
68
68
|
if msg.get("type") == "watch":
|
|
69
|
-
|
|
69
|
+
folders = msg.get("folders")
|
|
70
|
+
await asyncio.to_thread(
|
|
71
|
+
project_watch.hub.watch,
|
|
72
|
+
queue,
|
|
73
|
+
str(msg.get("project_key") or ""),
|
|
74
|
+
frozenset(map(str, folders)) if isinstance(folders, list) else frozenset(),
|
|
75
|
+
)
|
|
70
76
|
except WebSocketDisconnect:
|
|
71
77
|
pass
|
|
72
78
|
except Exception as exc:
|
|
@@ -292,6 +292,7 @@ def _session_cwd(project: str, session_id: str) -> str:
|
|
|
292
292
|
|
|
293
293
|
@router.get("/sessions/{session_id}/checkpoints")
|
|
294
294
|
def get_session_checkpoints(session_id: str, project: str, until: str | None = None):
|
|
295
|
+
project = sessions_service.newest_project_key(session_id, project)
|
|
295
296
|
try:
|
|
296
297
|
return api_response(data=sessions_service.list_checkpoints(project, session_id, until))
|
|
297
298
|
except ValueError as exc:
|
|
@@ -319,6 +320,13 @@ async def rewind_session(session_id: str, body: RewindBody):
|
|
|
319
320
|
return api_response(data=result)
|
|
320
321
|
|
|
321
322
|
|
|
323
|
+
@router.delete("/sessions/{session_id}/rewind")
|
|
324
|
+
def cancel_rewind(session_id: str):
|
|
325
|
+
rewind_service.clear_pending(session_id)
|
|
326
|
+
chat_list.hub.refresh_session(session_id)
|
|
327
|
+
return api_response(message="rewind cancelled")
|
|
328
|
+
|
|
329
|
+
|
|
322
330
|
@router.get("/sessions/{session_id}/images/{message_uuid}/{index}")
|
|
323
331
|
def get_session_image(request: Request, session_id: str, message_uuid: str, index: int, project: str, trashed: bool = False):
|
|
324
332
|
try:
|
|
@@ -354,6 +362,8 @@ def get_session_messages(
|
|
|
354
362
|
):
|
|
355
363
|
if limit < 1 or limit > 500:
|
|
356
364
|
raise HTTPException(status_code=400, detail="invalid limit")
|
|
365
|
+
if not trashed:
|
|
366
|
+
project = sessions_service.newest_project_key(session_id, project)
|
|
357
367
|
try:
|
|
358
368
|
items, earlier = sessions_service.session_segment(project, session_id, {
|
|
359
369
|
"simple": simple,
|
|
@@ -380,6 +390,7 @@ def get_session_messages(
|
|
|
380
390
|
"start_index": start,
|
|
381
391
|
"has_more": start > 0,
|
|
382
392
|
"earlier": earlier,
|
|
393
|
+
"project": project,
|
|
383
394
|
"context_tokens": sessions_service.context_tokens_in(tail),
|
|
384
395
|
"cache": prompt_cache.from_entries(tail),
|
|
385
396
|
"request_bytes": weight[0],
|
|
@@ -64,7 +64,7 @@ class ChatListHub:
|
|
|
64
64
|
self._resident: set[str] = set()
|
|
65
65
|
self._hidden: set[str] = set()
|
|
66
66
|
self._projects: dict[str, dict] = {}
|
|
67
|
-
self._sig_cache: dict[str, tuple] = {}
|
|
67
|
+
self._sig_cache: dict[tuple[str, str], tuple] = {}
|
|
68
68
|
self._folders: dict[str, Folder] = {}
|
|
69
69
|
self._followers: set[Callable[[set[str]], None]] = set()
|
|
70
70
|
self._subscribers: set[asyncio.Queue] = set()
|
|
@@ -223,9 +223,9 @@ class ChatListHub:
|
|
|
223
223
|
def _poll_loop(self):
|
|
224
224
|
while not self._stop.wait(_POLL_SECONDS):
|
|
225
225
|
with self._scanning:
|
|
226
|
-
before = {
|
|
226
|
+
before = {key: cached[0] for key, cached in self._sig_cache.items()}
|
|
227
227
|
self._rescan(True, None)
|
|
228
|
-
written = {
|
|
228
|
+
written = {key[1] for key, cached in self._sig_cache.items() if before.get(key) != cached[0]}
|
|
229
229
|
self._tell_followers(written)
|
|
230
230
|
|
|
231
231
|
def _tell_followers(self, written: set[str]):
|
|
@@ -242,7 +242,7 @@ class ChatListHub:
|
|
|
242
242
|
return False, None
|
|
243
243
|
sid = file.stem
|
|
244
244
|
sig = (st.st_mtime, st.st_size)
|
|
245
|
-
cached = self._sig_cache.get(sid)
|
|
245
|
+
cached = self._sig_cache.get((pkey, sid))
|
|
246
246
|
if cached is not None and cached[0] == sig:
|
|
247
247
|
return True, cached[1]
|
|
248
248
|
cwd, preview, title, color, entrypoint, has_content = sessions_service._session_meta(file)
|
|
@@ -259,7 +259,7 @@ class ChatListHub:
|
|
|
259
259
|
"title": title,
|
|
260
260
|
"color": color,
|
|
261
261
|
}
|
|
262
|
-
self._sig_cache[sid] = (sig, meta)
|
|
262
|
+
self._sig_cache[(pkey, sid)] = (sig, meta)
|
|
263
263
|
return True, meta
|
|
264
264
|
|
|
265
265
|
def _scan_folder(self, directory: Path, live: set[str], known: Optional[Folder], names: Optional[set[str]]) -> Folder:
|
|
@@ -314,12 +314,17 @@ class ChatListHub:
|
|
|
314
314
|
else:
|
|
315
315
|
folders[pkey] = self._scan_folder(directory, live, known, touched.get(pkey) if touched else None)
|
|
316
316
|
self._folders = folders
|
|
317
|
-
seen = {sid for _project, _listed, found in folders.
|
|
317
|
+
seen = {(pkey, sid) for pkey, (_project, _listed, found) in folders.items() for sid in found}
|
|
318
|
+
newest: dict[str, dict] = {}
|
|
318
319
|
for pkey, (project, listed, _found) in folders.items():
|
|
319
320
|
if project is not None:
|
|
320
321
|
projects[pkey] = dict(project)
|
|
321
322
|
for sid, meta in listed.items():
|
|
322
|
-
|
|
323
|
+
known = newest.get(sid)
|
|
324
|
+
if known is None or meta["last_active"] > known["last_active"]:
|
|
325
|
+
newest[sid] = meta
|
|
326
|
+
for sid, meta in newest.items():
|
|
327
|
+
sessions[sid] = self._with_activity(sid, sessions_service.with_pinned(sid, meta))
|
|
323
328
|
if len(self._sig_cache) > len(seen):
|
|
324
329
|
self._sig_cache = {k: v for k, v in self._sig_cache.items() if k in seen}
|
|
325
330
|
for key, meta in projects_service.snapshot().items():
|
|
@@ -5,11 +5,14 @@ from __future__ import annotations
|
|
|
5
5
|
import json
|
|
6
6
|
from dataclasses import dataclass
|
|
7
7
|
from pathlib import Path
|
|
8
|
-
from typing import Any, Optional
|
|
8
|
+
from typing import Any, Callable, Optional
|
|
9
9
|
|
|
10
10
|
from services import files
|
|
11
11
|
|
|
12
12
|
_SETTINGS_FILE = "settings.json"
|
|
13
|
+
_ATTRIBUTION = "attribution"
|
|
14
|
+
_ATTRIBUTION_PARTS = ("commit", "pr")
|
|
15
|
+
_LEGACY_ATTRIBUTION = "includeCoAuthoredBy"
|
|
13
16
|
|
|
14
17
|
MAX_SAFE_INTEGER = 9007199254740991
|
|
15
18
|
|
|
@@ -23,6 +26,31 @@ class CliSettingDef:
|
|
|
23
26
|
minimum: Optional[int] = None
|
|
24
27
|
maximum: Optional[int] = None
|
|
25
28
|
unset_by: Any = None
|
|
29
|
+
read: Optional[Callable[[dict], Any]] = None
|
|
30
|
+
write: Optional[Callable[[dict, Any], None]] = None
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def _attributed(data: dict) -> Optional[bool]:
|
|
34
|
+
"""Whether commits carry the trailer: the CLI hides it with empty commit and pr texts."""
|
|
35
|
+
stored = data.get(_ATTRIBUTION)
|
|
36
|
+
if isinstance(stored, dict):
|
|
37
|
+
return any(stored.get(part) != "" for part in _ATTRIBUTION_PARTS)
|
|
38
|
+
if isinstance(stored, bool):
|
|
39
|
+
return stored
|
|
40
|
+
legacy = data.get(_LEGACY_ATTRIBUTION)
|
|
41
|
+
return legacy if isinstance(legacy, bool) else None
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def _attribute(data: dict, enabled: Optional[bool]) -> None:
|
|
45
|
+
stored = data.get(_ATTRIBUTION)
|
|
46
|
+
kept = {key: value for key, value in stored.items() if key not in _ATTRIBUTION_PARTS} if isinstance(stored, dict) else {}
|
|
47
|
+
data.pop(_LEGACY_ATTRIBUTION, None)
|
|
48
|
+
if enabled is False:
|
|
49
|
+
data[_ATTRIBUTION] = {**kept, **dict.fromkeys(_ATTRIBUTION_PARTS, "")}
|
|
50
|
+
elif kept:
|
|
51
|
+
data[_ATTRIBUTION] = kept
|
|
52
|
+
else:
|
|
53
|
+
data.pop(_ATTRIBUTION, None)
|
|
26
54
|
|
|
27
55
|
|
|
28
56
|
SETTINGS: dict[str, CliSettingDef] = {
|
|
@@ -67,11 +95,13 @@ SETTINGS: dict[str, CliSettingDef] = {
|
|
|
67
95
|
description="Let a session started here be taken over from claude.ai",
|
|
68
96
|
),
|
|
69
97
|
"co_authored": CliSettingDef(
|
|
70
|
-
json_key=
|
|
98
|
+
json_key=_ATTRIBUTION,
|
|
71
99
|
default=True,
|
|
72
100
|
type=bool,
|
|
73
101
|
description="Add the Co-Authored-By trailer to the commits and pull requests Claude writes",
|
|
74
102
|
unset_by=True,
|
|
103
|
+
read=_attributed,
|
|
104
|
+
write=_attribute,
|
|
75
105
|
),
|
|
76
106
|
"session_upload": CliSettingDef(
|
|
77
107
|
json_key="autoUploadSessions",
|
|
@@ -153,7 +183,7 @@ def _valid(value: Any, expected: type) -> bool:
|
|
|
153
183
|
|
|
154
184
|
def _stored(key: str) -> Any:
|
|
155
185
|
defn = SETTINGS[key]
|
|
156
|
-
value = lookup(_read(), defn.json_key)
|
|
186
|
+
value = defn.read(_read()) if defn.read else lookup(_read(), defn.json_key)
|
|
157
187
|
return value if _valid(value, defn.type) else None
|
|
158
188
|
|
|
159
189
|
|
|
@@ -217,7 +247,9 @@ def set(key: str, value: Any) -> None:
|
|
|
217
247
|
if defn.maximum is not None and value > defn.maximum:
|
|
218
248
|
raise ValueError(f"{key} must be at most {defn.maximum}")
|
|
219
249
|
data = _read()
|
|
220
|
-
if
|
|
250
|
+
if defn.write:
|
|
251
|
+
defn.write(data, None if blank else value)
|
|
252
|
+
elif not blank:
|
|
221
253
|
assign(data, defn.json_key, value)
|
|
222
254
|
elif value is None or _valid(lookup(data, defn.json_key), defn.type):
|
|
223
255
|
discard(data, defn.json_key)
|
|
@@ -738,16 +738,161 @@ def _renderer(column: Any, engine: Engine, binary: str) -> Callable[[Any], str]:
|
|
|
738
738
|
return render
|
|
739
739
|
|
|
740
740
|
|
|
741
|
-
def
|
|
742
|
-
|
|
741
|
+
def _quoted(engine: Engine, schema: Optional[str], name: str) -> str:
|
|
742
|
+
quote = engine.dialect.identifier_preparer.quote
|
|
743
|
+
return ".".join(quote(part) for part in (schema, name) if part)
|
|
744
|
+
|
|
745
|
+
|
|
746
|
+
def _names(engine: Engine, names: list[str]) -> str:
|
|
743
747
|
quote = engine.dialect.identifier_preparer.quote
|
|
744
|
-
|
|
745
|
-
|
|
748
|
+
return ", ".join(quote(name) for name in names)
|
|
749
|
+
|
|
750
|
+
|
|
751
|
+
def _optional(read: Callable[[], Any], fallback: Any = None) -> Any:
|
|
752
|
+
try:
|
|
753
|
+
return read()
|
|
754
|
+
except (NotImplementedError, SQLAlchemyError):
|
|
755
|
+
return fallback
|
|
756
|
+
|
|
757
|
+
|
|
758
|
+
def _insert_lines(handle: Any, engine: Engine, entry: dict, reflected: Table, source: Any) -> None:
|
|
759
|
+
binary = database_engines.spec_of(entry)["binary"]
|
|
760
|
+
name = _quoted(engine, reflected.schema, reflected.name)
|
|
761
|
+
columns = _names(engine, [column.name for column in reflected.columns])
|
|
746
762
|
renderers = [_renderer(column, engine, binary) for column in reflected.columns]
|
|
747
|
-
|
|
748
|
-
for
|
|
749
|
-
|
|
750
|
-
|
|
763
|
+
for row in source:
|
|
764
|
+
values = ", ".join(render(value) for render, value in zip(renderers, row))
|
|
765
|
+
handle.write(f"INSERT INTO {name} ({columns}) VALUES ({values});\n")
|
|
766
|
+
|
|
767
|
+
|
|
768
|
+
def _default_ddl(default: str) -> str:
|
|
769
|
+
expression = default.strip()
|
|
770
|
+
if "(" in expression and not (expression.startswith("(") and expression.endswith(")")):
|
|
771
|
+
return f"({expression})"
|
|
772
|
+
return expression
|
|
773
|
+
|
|
774
|
+
|
|
775
|
+
def _column_ddl(engine: Engine, column: dict, auto_increment: str) -> str:
|
|
776
|
+
parts = [_names(engine, [column["name"]])]
|
|
777
|
+
if column["type"]:
|
|
778
|
+
parts.append(column["type"])
|
|
779
|
+
if not column["nullable"]:
|
|
780
|
+
parts.append("NOT NULL")
|
|
781
|
+
if column["auto"] and auto_increment:
|
|
782
|
+
parts.append(auto_increment)
|
|
783
|
+
elif column["default"] is not None:
|
|
784
|
+
parts.append(f"DEFAULT {_default_ddl(column['default'])}")
|
|
785
|
+
return " ".join(parts)
|
|
786
|
+
|
|
787
|
+
|
|
788
|
+
def _table_ddl(engine: Engine, item: dict, connection: Connection, schema: Optional[str], name: str) -> tuple[list[str], list[str]]:
|
|
789
|
+
inspector = inspect(connection)
|
|
790
|
+
primary = _optional(lambda: _primary(connection, item, schema, name), [])
|
|
791
|
+
columns = [_column(column, primary) for column in _columns(connection, item, schema, name)]
|
|
792
|
+
lines = [_column_ddl(engine, column, item["auto_increment"]) for column in columns]
|
|
793
|
+
if primary:
|
|
794
|
+
lines.append(f"PRIMARY KEY ({_names(engine, primary)})")
|
|
795
|
+
for key in (_foreign(found) for found in _optional(lambda: inspector.get_foreign_keys(name, schema=schema), [])):
|
|
796
|
+
if key["columns"] and key["table"] and key["referred"]:
|
|
797
|
+
referred = _quoted(engine, key["schema"], key["table"])
|
|
798
|
+
lines.append(f"FOREIGN KEY ({_names(engine, key['columns'])}) REFERENCES {referred} ({_names(engine, key['referred'])})")
|
|
799
|
+
target = _quoted(engine, schema, name)
|
|
800
|
+
statements = ["CREATE TABLE " + target + " (\n " + ",\n ".join(lines) + "\n);"]
|
|
801
|
+
for index in (_index(found) for found in _optional(lambda: inspector.get_indexes(name, schema=schema), [])):
|
|
802
|
+
if index["name"] and index["columns"] and index["columns"] != primary:
|
|
803
|
+
unique = "UNIQUE " if index["unique"] else ""
|
|
804
|
+
statements.append(f"CREATE {unique}INDEX {_names(engine, [index['name']])} ON {target} ({_names(engine, index['columns'])});")
|
|
805
|
+
return statements, [column["name"] for column in columns if column["auto"]]
|
|
806
|
+
|
|
807
|
+
|
|
808
|
+
def _identity_lines(item: dict, key: str, table: str, columns: list[str]) -> list[str]:
|
|
809
|
+
template = item[key]
|
|
810
|
+
if not template or not columns:
|
|
811
|
+
return []
|
|
812
|
+
return [template.format(table=table, column=column) for column in columns]
|
|
813
|
+
|
|
814
|
+
|
|
815
|
+
def _view_ddl(engine: Engine, connection: Connection, schema: Optional[str], name: str) -> Optional[str]:
|
|
816
|
+
definition = _optional(lambda: inspect(connection).get_view_definition(name, schema=schema))
|
|
817
|
+
if not definition:
|
|
818
|
+
return None
|
|
819
|
+
body = str(definition).strip().rstrip(";")
|
|
820
|
+
if re.match(r"(?is)\s*create\s", body):
|
|
821
|
+
return f"{body};"
|
|
822
|
+
return f"CREATE VIEW {_quoted(engine, schema, name)} AS {body};"
|
|
823
|
+
|
|
824
|
+
|
|
825
|
+
def _dependency_order(connection: Connection, schema: Optional[str], names: list[str]) -> list[str]:
|
|
826
|
+
inspector = inspect(connection)
|
|
827
|
+
needs = {
|
|
828
|
+
name: {
|
|
829
|
+
str(key.get("referred_table"))
|
|
830
|
+
for key in _optional(lambda: inspector.get_foreign_keys(name, schema=schema), [])
|
|
831
|
+
if key.get("referred_table") in names and key.get("referred_table") != name
|
|
832
|
+
}
|
|
833
|
+
for name in names
|
|
834
|
+
}
|
|
835
|
+
ordered: list[str] = []
|
|
836
|
+
while needs:
|
|
837
|
+
ready = sorted(name for name, wanted in needs.items() if wanted <= set(ordered)) or sorted(needs)
|
|
838
|
+
ordered.extend(ready)
|
|
839
|
+
for name in ready:
|
|
840
|
+
del needs[name]
|
|
841
|
+
return ordered
|
|
842
|
+
|
|
843
|
+
|
|
844
|
+
def _catalog(connection: Connection, scope: databases.Scope, schema: Optional[str]) -> tuple[list[str], list[str]]:
|
|
845
|
+
inspector = inspect(connection)
|
|
846
|
+
tables = sorted(inspector.get_table_names(schema=schema))
|
|
847
|
+
views = sorted({*inspector.get_view_names(schema=schema), *_materialized(scope, schema)})
|
|
848
|
+
return tables, views
|
|
849
|
+
|
|
850
|
+
|
|
851
|
+
def _dump_schemas(scope: databases.Scope, schema: Optional[str], name: Optional[str]) -> list[Optional[str]]:
|
|
852
|
+
listed = schemas(scope)
|
|
853
|
+
if listed["databases"] is not None:
|
|
854
|
+
raise databases.DatabaseError(INVALID)
|
|
855
|
+
chosen = [schema] if schema or name else (listed["schemas"] or [None])
|
|
856
|
+
return [None if place in (None, listed["default"]) else place for place in chosen]
|
|
857
|
+
|
|
858
|
+
|
|
859
|
+
def export_dump(
|
|
860
|
+
scope: databases.Scope,
|
|
861
|
+
schema: Optional[str] = None,
|
|
862
|
+
name: Optional[str] = None,
|
|
863
|
+
sort: Optional[str] = None,
|
|
864
|
+
descending: bool = False,
|
|
865
|
+
where: str = "",
|
|
866
|
+
folder: Optional[Path] = None,
|
|
867
|
+
) -> str:
|
|
868
|
+
engine, entry = databases.engine_for(scope)
|
|
869
|
+
item = database_engines.spec_of(entry)
|
|
870
|
+
places = _dump_schemas(scope, schema, name)
|
|
871
|
+
target = _export_file(entry, name or schema or scope.database or entry["name"], SQL, folder)
|
|
872
|
+
with _reading(scope, EXPORT_SECONDS) as connection, target.open("w", encoding="utf-8", newline="\n") as handle:
|
|
873
|
+
for place in places:
|
|
874
|
+
tables, views = _catalog(connection, scope, place)
|
|
875
|
+
if name:
|
|
876
|
+
tables, views = ([] if name in views else [name]), ([name] if name in views else [])
|
|
877
|
+
elif place:
|
|
878
|
+
handle.write(f"CREATE SCHEMA {_names(engine, [place])};\n\n")
|
|
879
|
+
for table in _dependency_order(connection, place, tables):
|
|
880
|
+
statements, auto = _table_ddl(engine, item, connection, place, table)
|
|
881
|
+
qualified = _quoted(engine, place, table)
|
|
882
|
+
for statement in statements + _identity_lines(item, "identity_insert_on", qualified, auto[:1]):
|
|
883
|
+
handle.write(f"{statement}\n")
|
|
884
|
+
reflected = _reflect(scope, connection, place, table)
|
|
885
|
+
selected = _ordered(_filtered(scope, reflected, where), reflected, sort, descending)
|
|
886
|
+
result = connection.execution_options(stream_results=True).execute(selected)
|
|
887
|
+
_insert_lines(handle, engine, entry, reflected, result)
|
|
888
|
+
for statement in _identity_lines(item, "identity_insert_off", qualified, auto[:1]) + _identity_lines(item, "identity_sync", qualified, auto):
|
|
889
|
+
handle.write(f"{statement}\n")
|
|
890
|
+
handle.write("\n")
|
|
891
|
+
for view in views:
|
|
892
|
+
statement = _view_ddl(engine, connection, place, view)
|
|
893
|
+
if statement:
|
|
894
|
+
handle.write(f"{statement}\n\n")
|
|
895
|
+
return _relative(target)
|
|
751
896
|
|
|
752
897
|
|
|
753
898
|
def export_table(
|
|
@@ -762,16 +907,15 @@ def export_table(
|
|
|
762
907
|
) -> str:
|
|
763
908
|
if format not in TABLE_FORMATS:
|
|
764
909
|
raise databases.DatabaseError(INVALID, format)
|
|
765
|
-
|
|
766
|
-
|
|
910
|
+
if format == SQL:
|
|
911
|
+
return export_dump(scope, schema, name, sort, descending, where, folder)
|
|
912
|
+
entry = databases.require(scope.connection)
|
|
913
|
+
target = _export_file(entry, name, CSV, folder)
|
|
767
914
|
with _reading(scope, EXPORT_SECONDS) as connection:
|
|
768
915
|
reflected = _reflect(scope, connection, schema, name)
|
|
769
916
|
selected = _ordered(_filtered(scope, reflected, where), reflected, sort, descending)
|
|
770
917
|
result = connection.execution_options(stream_results=True).execute(selected)
|
|
771
|
-
|
|
772
|
-
_write_csv(target, list(result.keys()), result)
|
|
773
|
-
else:
|
|
774
|
-
_write_inserts(target, engine, entry, reflected, result)
|
|
918
|
+
_write_csv(target, list(result.keys()), result)
|
|
775
919
|
return _relative(target)
|
|
776
920
|
|
|
777
921
|
|
|
@@ -133,6 +133,7 @@ def listed() -> list[dict]:
|
|
|
133
133
|
"port": item["port"],
|
|
134
134
|
"packages": item["packages"],
|
|
135
135
|
"options": item["options"],
|
|
136
|
+
"quote": item["quote"],
|
|
136
137
|
"installed": installed(engine),
|
|
137
138
|
}
|
|
138
139
|
for engine, item in ENGINES.items()
|
|
@@ -164,6 +165,12 @@ def install(engine: str) -> None:
|
|
|
164
165
|
install_packages(spec(engine)["packages"])
|
|
165
166
|
|
|
166
167
|
|
|
168
|
+
def kept_packages(entries: list[dict]) -> list[str]:
|
|
169
|
+
catalog = {name for engine, item in ENGINES.items() if item["packages"] and installed(engine) for name in item["packages"]}
|
|
170
|
+
custom = {name for entry in entries if entry.get("url") and _loadable(entry["url"]) for name in entry["packages"]}
|
|
171
|
+
return sorted(catalog | custom)
|
|
172
|
+
|
|
173
|
+
|
|
167
174
|
def driver_of(engine: str) -> list[str]:
|
|
168
175
|
wanted = spec(engine)["packages"]
|
|
169
176
|
return [other for other, item in ENGINES.items() if wanted and item["packages"] == wanted]
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"""Git operations the commit panel performs, on top of the single git runner."""
|
|
2
2
|
|
|
3
3
|
import re
|
|
4
|
+
import subprocess
|
|
4
5
|
import threading
|
|
5
6
|
from pathlib import Path
|
|
6
7
|
from typing import Optional
|
|
@@ -30,7 +31,10 @@ def lock_for(repo: Path) -> threading.Lock:
|
|
|
30
31
|
|
|
31
32
|
|
|
32
33
|
def _read(repo: Path, *args: str, timeout: int = _TIMEOUT) -> Optional[str]:
|
|
33
|
-
|
|
34
|
+
try:
|
|
35
|
+
result = git.run(repo, *args, timeout=timeout)
|
|
36
|
+
except (OSError, subprocess.SubprocessError):
|
|
37
|
+
return None
|
|
34
38
|
return result.stdout.strip() if result.returncode == 0 else None
|
|
35
39
|
|
|
36
40
|
|