connectonion 0.6.2__py3-none-any.whl → 0.6.3__py3-none-any.whl
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.
- connectonion/__init__.py +46 -9
- connectonion/cli/__init__.py +11 -1
- connectonion/cli/browser_agent/__init__.py +11 -1
- connectonion/cli/browser_agent/browser.py +13 -3
- connectonion/cli/browser_agent/element_finder.py +8 -0
- connectonion/cli/browser_agent/highlight_screenshot.py +9 -1
- connectonion/cli/browser_agent/scroll.py +8 -0
- connectonion/cli/co_ai/__init__.py +6 -0
- connectonion/cli/co_ai/agent.py +87 -0
- connectonion/cli/co_ai/agents/__init__.py +5 -0
- connectonion/cli/co_ai/agents/registry.py +57 -0
- connectonion/cli/co_ai/commands/__init__.py +45 -0
- connectonion/cli/co_ai/commands/compact.py +173 -0
- connectonion/cli/co_ai/commands/cost.py +77 -0
- connectonion/cli/co_ai/commands/export.py +60 -0
- connectonion/cli/co_ai/commands/help.py +80 -0
- connectonion/cli/co_ai/commands/init.py +101 -0
- connectonion/cli/co_ai/commands/sessions.py +55 -0
- connectonion/cli/co_ai/commands/tasks.py +63 -0
- connectonion/cli/co_ai/commands/undo.py +103 -0
- connectonion/cli/co_ai/context.py +127 -0
- connectonion/cli/co_ai/main.py +52 -0
- connectonion/cli/co_ai/plugins/__init__.py +6 -0
- connectonion/cli/co_ai/plugins/reminder.py +76 -0
- connectonion/cli/co_ai/plugins/shell_approval.py +105 -0
- connectonion/cli/co_ai/prompts/agents/explore.md +79 -0
- connectonion/cli/co_ai/prompts/agents/plan.md +60 -0
- connectonion/cli/co_ai/prompts/assembler.py +303 -0
- connectonion/cli/{docs/co-vibecoding-principles-docs-contexts-all-in-one.md → co_ai/prompts/connectonion/README.md} +26 -0
- connectonion/cli/co_ai/prompts/connectonion/api.md +457 -0
- connectonion/cli/co_ai/prompts/connectonion/cli/README.md +805 -0
- connectonion/cli/co_ai/prompts/connectonion/cli/auth.md +46 -0
- connectonion/cli/co_ai/prompts/connectonion/cli/browser.md +235 -0
- connectonion/cli/co_ai/prompts/connectonion/cli/copy.md +184 -0
- connectonion/cli/co_ai/prompts/connectonion/cli/create.md +335 -0
- connectonion/cli/co_ai/prompts/connectonion/cli/init.md +431 -0
- connectonion/cli/co_ai/prompts/connectonion/co-directory-structure.md +214 -0
- connectonion/cli/co_ai/prompts/connectonion/concepts/agent.md +1078 -0
- connectonion/cli/co_ai/prompts/connectonion/concepts/events.md +816 -0
- connectonion/cli/co_ai/prompts/connectonion/concepts/llm_do.md +256 -0
- connectonion/cli/co_ai/prompts/connectonion/concepts/max_iterations.md +362 -0
- connectonion/cli/co_ai/prompts/connectonion/concepts/models.md +641 -0
- connectonion/cli/co_ai/prompts/connectonion/concepts/plugins.md +100 -0
- connectonion/cli/co_ai/prompts/connectonion/concepts/prompts.md +122 -0
- connectonion/cli/co_ai/prompts/connectonion/concepts/tools.md +512 -0
- connectonion/cli/co_ai/prompts/connectonion/concepts/transcribe.md +156 -0
- connectonion/cli/co_ai/prompts/connectonion/concepts/trust.md +291 -0
- connectonion/cli/co_ai/prompts/connectonion/debug/README.md +18 -0
- connectonion/cli/co_ai/prompts/connectonion/debug/auto_debug.md +1026 -0
- connectonion/cli/co_ai/prompts/connectonion/debug/console.md +129 -0
- connectonion/cli/co_ai/prompts/connectonion/debug/eval-format.md +178 -0
- connectonion/cli/co_ai/prompts/connectonion/debug/eval.md +230 -0
- connectonion/cli/co_ai/prompts/connectonion/debug/exceptions.md +307 -0
- connectonion/cli/co_ai/prompts/connectonion/debug/log.md +117 -0
- connectonion/cli/co_ai/prompts/connectonion/debug/xray.md +215 -0
- connectonion/cli/co_ai/prompts/connectonion/design-decisions/001-choosing-input-method.md +202 -0
- connectonion/cli/co_ai/prompts/connectonion/design-decisions/002-choosing-llm-function-name.md +202 -0
- connectonion/cli/co_ai/prompts/connectonion/design-decisions/003-choosing-trust-keyword.md +141 -0
- connectonion/cli/co_ai/prompts/connectonion/design-decisions/004-cli-create-flow.md +117 -0
- connectonion/cli/co_ai/prompts/connectonion/design-decisions/005-designing-agent-network-protocol.md +503 -0
- connectonion/cli/co_ai/prompts/connectonion/design-decisions/006-agent-address-format.md +305 -0
- connectonion/cli/co_ai/prompts/connectonion/design-decisions/007-authentication-backend-design.md +240 -0
- connectonion/cli/co_ai/prompts/connectonion/design-decisions/008-naming-is-hard.md +228 -0
- connectonion/cli/co_ai/prompts/connectonion/design-decisions/009-why-connect-function.md +167 -0
- connectonion/cli/co_ai/prompts/connectonion/design-decisions/010-cli-ux-progressive-disclosure.md +176 -0
- connectonion/cli/co_ai/prompts/connectonion/design-decisions/011-global-config-identity-management.md +357 -0
- connectonion/cli/co_ai/prompts/connectonion/design-decisions/012-tool-execution-separation.md +259 -0
- connectonion/cli/co_ai/prompts/connectonion/design-decisions/013-debug-and-logging-design.md +253 -0
- connectonion/cli/co_ai/prompts/connectonion/design-decisions/014-hook-system-design.md +510 -0
- connectonion/cli/co_ai/prompts/connectonion/design-decisions/015-interactive-auto-debug-design.md +837 -0
- connectonion/cli/co_ai/prompts/connectonion/design-decisions/016-why-no-zero-knowledge-proofs.md +358 -0
- connectonion/cli/co_ai/prompts/connectonion/design-decisions/017-session-logging-and-eval-format.md +120 -0
- connectonion/cli/co_ai/prompts/connectonion/design-decisions/018-event-api-naming.md +274 -0
- connectonion/cli/co_ai/prompts/connectonion/design-decisions/019-agent-lifecycle-design.md +655 -0
- connectonion/cli/co_ai/prompts/connectonion/design-decisions/020-trust-system-and-network-architecture.md +503 -0
- connectonion/cli/co_ai/prompts/connectonion/design-decisions/021-task-storage-jsonl-design.md +496 -0
- connectonion/cli/co_ai/prompts/connectonion/design-decisions/022-raw-asgi-implementation.md +273 -0
- connectonion/cli/co_ai/prompts/connectonion/examples/agent_reasoning.md +62 -0
- connectonion/cli/co_ai/prompts/connectonion/examples/atomic_tools.md +24 -0
- connectonion/cli/co_ai/prompts/connectonion/examples/load_guide.md +18 -0
- connectonion/cli/co_ai/prompts/connectonion/examples.md +0 -0
- connectonion/cli/co_ai/prompts/connectonion/hook-system-options.md +364 -0
- connectonion/cli/co_ai/prompts/connectonion/index.md +162 -0
- connectonion/cli/co_ai/prompts/connectonion/integrations/README.md +12 -0
- connectonion/cli/co_ai/prompts/connectonion/integrations/auth.md +450 -0
- connectonion/cli/co_ai/prompts/connectonion/integrations/google.md +431 -0
- connectonion/cli/co_ai/prompts/connectonion/integrations/microsoft.md +370 -0
- connectonion/cli/co_ai/prompts/connectonion/network/README.md +14 -0
- connectonion/cli/co_ai/prompts/connectonion/network/connect.md +543 -0
- connectonion/cli/co_ai/prompts/connectonion/network/connection.md +538 -0
- connectonion/cli/co_ai/prompts/connectonion/network/deploy.md +123 -0
- connectonion/cli/co_ai/prompts/connectonion/network/host.md +1049 -0
- connectonion/cli/co_ai/prompts/connectonion/network/protocol/agent-relay-protocol.md +495 -0
- connectonion/cli/co_ai/prompts/connectonion/network/protocol/announce-message.md +115 -0
- connectonion/cli/co_ai/prompts/connectonion/principles.md +124 -0
- connectonion/cli/co_ai/prompts/connectonion/quickstart.md +261 -0
- connectonion/cli/co_ai/prompts/connectonion/roadmap.md +81 -0
- connectonion/cli/co_ai/prompts/connectonion/templates/README.md +77 -0
- connectonion/cli/co_ai/prompts/connectonion/templates/meta-agent.md +152 -0
- connectonion/cli/co_ai/prompts/connectonion/templates/minimal.md +105 -0
- connectonion/cli/co_ai/prompts/connectonion/templates/playwright.md +130 -0
- connectonion/cli/co_ai/prompts/connectonion/templates/web-research.md +144 -0
- connectonion/cli/co_ai/prompts/connectonion/tui/README.md +95 -0
- connectonion/cli/co_ai/prompts/connectonion/tui/chat.md +181 -0
- connectonion/cli/co_ai/prompts/connectonion/tui/divider.md +63 -0
- connectonion/cli/co_ai/prompts/connectonion/tui/dropdown.md +83 -0
- connectonion/cli/co_ai/prompts/connectonion/tui/footer.md +44 -0
- connectonion/cli/co_ai/prompts/connectonion/tui/fuzzy.md +68 -0
- connectonion/cli/co_ai/prompts/connectonion/tui/input.md +84 -0
- connectonion/cli/co_ai/prompts/connectonion/tui/keys.md +77 -0
- connectonion/cli/co_ai/prompts/connectonion/tui/pick.md +71 -0
- connectonion/cli/co_ai/prompts/connectonion/tui/providers.md +89 -0
- connectonion/cli/co_ai/prompts/connectonion/tui/status_bar.md +67 -0
- connectonion/cli/co_ai/prompts/connectonion/useful_plugins/README.md +156 -0
- connectonion/cli/co_ai/prompts/connectonion/useful_plugins/calendar_plugin.md +68 -0
- connectonion/cli/co_ai/prompts/connectonion/useful_plugins/eval.md +89 -0
- connectonion/cli/co_ai/prompts/connectonion/useful_plugins/gmail_plugin.md +68 -0
- connectonion/cli/co_ai/prompts/connectonion/useful_plugins/image_result_formatter.md +74 -0
- connectonion/cli/co_ai/prompts/connectonion/useful_plugins/re_act.md +86 -0
- connectonion/cli/co_ai/prompts/connectonion/useful_plugins/shell_approval.md +69 -0
- connectonion/cli/co_ai/prompts/connectonion/useful_tools/README.md +81 -0
- connectonion/cli/co_ai/prompts/connectonion/useful_tools/diff_writer.md +138 -0
- connectonion/cli/co_ai/prompts/connectonion/useful_tools/get_emails.md +499 -0
- connectonion/cli/co_ai/prompts/connectonion/useful_tools/gmail.md +135 -0
- connectonion/cli/co_ai/prompts/connectonion/useful_tools/google_calendar.md +106 -0
- connectonion/cli/co_ai/prompts/connectonion/useful_tools/memory.md +486 -0
- connectonion/cli/co_ai/prompts/connectonion/useful_tools/microsoft_calendar.md +106 -0
- connectonion/cli/co_ai/prompts/connectonion/useful_tools/outlook.md +120 -0
- connectonion/cli/co_ai/prompts/connectonion/useful_tools/send_email.md +403 -0
- connectonion/cli/co_ai/prompts/connectonion/useful_tools/shell.md +95 -0
- connectonion/cli/co_ai/prompts/connectonion/useful_tools/slash_command.md +96 -0
- connectonion/cli/co_ai/prompts/connectonion/useful_tools/terminal.md +97 -0
- connectonion/cli/co_ai/prompts/connectonion/useful_tools/todo_list.md +252 -0
- connectonion/cli/co_ai/prompts/connectonion/useful_tools/web_fetch.md +130 -0
- connectonion/cli/co_ai/prompts/connectonion/vibe-coding-guide.md +97 -0
- connectonion/cli/co_ai/prompts/connectonion/windows-support.md +258 -0
- connectonion/cli/co_ai/prompts/main.md +247 -0
- connectonion/cli/co_ai/prompts/reminders/plan_mode.md +34 -0
- connectonion/cli/co_ai/prompts/summarization.md +55 -0
- connectonion/cli/co_ai/prompts/tools/ask_user.md +61 -0
- connectonion/cli/co_ai/prompts/tools/background.md +57 -0
- connectonion/cli/co_ai/prompts/tools/edit.md +90 -0
- connectonion/cli/co_ai/prompts/tools/glob.md +52 -0
- connectonion/cli/co_ai/prompts/tools/grep.md +55 -0
- connectonion/cli/co_ai/prompts/tools/plan_mode.md +80 -0
- connectonion/cli/co_ai/prompts/tools/read.md +40 -0
- connectonion/cli/co_ai/prompts/tools/shell.md +67 -0
- connectonion/cli/co_ai/prompts/tools/task.md +51 -0
- connectonion/cli/co_ai/prompts/tools/todo.md +139 -0
- connectonion/cli/co_ai/prompts/tools/write.md +47 -0
- connectonion/cli/co_ai/prompts/workflow.md +89 -0
- connectonion/cli/co_ai/reminders.py +159 -0
- connectonion/cli/co_ai/sessions.py +110 -0
- connectonion/cli/co_ai/skills/__init__.py +37 -0
- connectonion/cli/co_ai/skills/builtin/commit/SKILL.md +63 -0
- connectonion/cli/co_ai/skills/builtin/review-pr/SKILL.md +76 -0
- connectonion/cli/co_ai/skills/loader.py +166 -0
- connectonion/cli/co_ai/skills/tool.py +46 -0
- connectonion/cli/co_ai/tools/__init__.py +92 -0
- connectonion/cli/co_ai/tools/ask_user.py +35 -0
- connectonion/cli/co_ai/tools/background.py +201 -0
- connectonion/cli/co_ai/tools/diff_writer.py +291 -0
- connectonion/cli/co_ai/tools/edit.py +89 -0
- connectonion/cli/co_ai/tools/glob.py +84 -0
- connectonion/cli/co_ai/tools/grep.py +158 -0
- connectonion/cli/co_ai/tools/load_guide.py +23 -0
- connectonion/cli/co_ai/tools/multi_edit.py +116 -0
- connectonion/cli/co_ai/tools/plan_mode.py +172 -0
- connectonion/cli/co_ai/tools/read.py +67 -0
- connectonion/cli/co_ai/tools/task.py +59 -0
- connectonion/cli/co_ai/tools/todo_list.py +159 -0
- connectonion/cli/co_ai/tools/write.py +126 -0
- connectonion/cli/commands/__init__.py +11 -1
- connectonion/cli/commands/ai_commands.py +34 -0
- connectonion/cli/commands/copy_commands.py +55 -6
- connectonion/cli/commands/create.py +20 -17
- connectonion/cli/commands/init.py +19 -22
- connectonion/cli/commands/project_cmd_lib.py +15 -0
- connectonion/cli/main.py +11 -0
- connectonion/console.py +15 -1
- connectonion/core/__init__.py +10 -1
- connectonion/core/agent.py +37 -16
- connectonion/core/exceptions.py +74 -0
- connectonion/core/llm.py +54 -6
- connectonion/core/tool_executor.py +32 -31
- connectonion/core/tool_factory.py +47 -10
- connectonion/debug/__init__.py +10 -1
- connectonion/debug/debug_explainer/__init__.py +10 -1
- connectonion/debug/execution_analyzer/__init__.py +10 -1
- connectonion/debug/execution_analyzer/execution_analysis.py +5 -2
- connectonion/debug/runtime_inspector/__init__.py +10 -1
- connectonion/docs/.package-ignore +6 -0
- connectonion/docs/README.md +2036 -0
- connectonion/docs/api.md +457 -0
- connectonion/docs/archive/001-ai-agent-is-just-prompt-plus-function.md +249 -0
- connectonion/docs/archive/README.md +53 -0
- connectonion/docs/archive/archive/consolidation-plan.md +72 -0
- connectonion/docs/archive/archive/core-principles-extracted.md +239 -0
- connectonion/docs/archive/archive/master-principles.md +222 -0
- connectonion/docs/archive/archive/principles.md +293 -0
- connectonion/docs/archive/archive/simplicity-principles.md +221 -0
- connectonion/docs/archive/attack-defense-insights.md +410 -0
- connectonion/docs/archive/business-model.md +305 -0
- connectonion/docs/archive/core-principles-unified.md +190 -0
- connectonion/docs/archive/discussion-journey.md +178 -0
- connectonion/docs/archive/economic-analysis.md +323 -0
- connectonion/docs/archive/features/01-share-and-find.md +256 -0
- connectonion/docs/archive/features/02-agent-authentication.md +93 -0
- connectonion/docs/archive/features/03-test-before-trust.md +71 -0
- connectonion/docs/archive/features/06-reliability-and-offline.md +197 -0
- connectonion/docs/archive/features/README.md +46 -0
- connectonion/docs/archive/features-roadmap.md +247 -0
- connectonion/docs/archive/mcp-comparison-insights.md +215 -0
- connectonion/docs/archive/migration-strategy.md +571 -0
- connectonion/docs/archive/mini-whitepaper.md +293 -0
- connectonion/docs/archive/network-protocol.md +394 -0
- connectonion/docs/archive/semantic-revolution.md +367 -0
- connectonion/docs/archive/technical-architecture.md +453 -0
- connectonion/docs/archive/the-semantic-insight.md +207 -0
- connectonion/docs/archive/threat-model.md +164 -0
- connectonion/docs/cli/README.md +805 -0
- connectonion/docs/cli/auth.md +46 -0
- connectonion/docs/cli/browser.md +235 -0
- connectonion/docs/cli/copy.md +232 -0
- connectonion/docs/cli/create.md +335 -0
- connectonion/docs/cli/init.md +431 -0
- connectonion/docs/co-directory-structure.md +214 -0
- connectonion/docs/concepts/agent.md +1078 -0
- connectonion/docs/concepts/events.md +699 -0
- connectonion/docs/concepts/llm_do.md +256 -0
- connectonion/docs/concepts/max_iterations.md +362 -0
- connectonion/docs/concepts/models.md +641 -0
- connectonion/docs/concepts/plugins.md +100 -0
- connectonion/docs/concepts/prompts.md +122 -0
- connectonion/docs/concepts/session.md +428 -0
- connectonion/docs/concepts/tools.md +512 -0
- connectonion/docs/concepts/transcribe.md +156 -0
- connectonion/docs/concepts/trust.md +291 -0
- connectonion/docs/connectonion.md +1256 -0
- connectonion/docs/debug/README.md +18 -0
- connectonion/docs/debug/auto_debug.md +1026 -0
- connectonion/docs/debug/console.md +129 -0
- connectonion/docs/debug/eval-format.md +178 -0
- connectonion/docs/debug/eval.md +230 -0
- connectonion/docs/debug/exceptions.md +307 -0
- connectonion/docs/debug/log.md +117 -0
- connectonion/docs/debug/xray.md +215 -0
- connectonion/docs/design-decisions/001-choosing-input-method.md +202 -0
- connectonion/docs/design-decisions/002-choosing-llm-function-name.md +202 -0
- connectonion/docs/design-decisions/003-choosing-trust-keyword.md +141 -0
- connectonion/docs/design-decisions/004-cli-create-flow.md +117 -0
- connectonion/docs/design-decisions/005-designing-agent-network-protocol.md +503 -0
- connectonion/docs/design-decisions/006-agent-address-format.md +305 -0
- connectonion/docs/design-decisions/007-authentication-backend-design.md +240 -0
- connectonion/docs/design-decisions/008-naming-is-hard.md +228 -0
- connectonion/docs/design-decisions/009-why-connect-function.md +167 -0
- connectonion/docs/design-decisions/010-cli-ux-progressive-disclosure.md +176 -0
- connectonion/docs/design-decisions/011-global-config-identity-management.md +357 -0
- connectonion/docs/design-decisions/012-tool-execution-separation.md +259 -0
- connectonion/docs/design-decisions/013-debug-and-logging-design.md +253 -0
- connectonion/docs/design-decisions/014-hook-system-design.md +510 -0
- connectonion/docs/design-decisions/015-interactive-auto-debug-design.md +837 -0
- connectonion/docs/design-decisions/016-why-no-zero-knowledge-proofs.md +358 -0
- connectonion/docs/design-decisions/017-session-logging-and-eval-format.md +120 -0
- connectonion/docs/design-decisions/018-event-api-naming.md +274 -0
- connectonion/docs/design-decisions/019-agent-lifecycle-design.md +655 -0
- connectonion/docs/design-decisions/020-trust-system-and-network-architecture.md +503 -0
- connectonion/docs/design-decisions/021-task-storage-jsonl-design.md +496 -0
- connectonion/docs/design-decisions/022-raw-asgi-implementation.md +273 -0
- connectonion/docs/examples.md +0 -0
- connectonion/docs/hook-system-options.md +364 -0
- connectonion/docs/integrations/README.md +12 -0
- connectonion/docs/integrations/auth.md +450 -0
- connectonion/docs/integrations/google.md +431 -0
- connectonion/docs/integrations/microsoft.md +370 -0
- connectonion/docs/network/README.md +14 -0
- connectonion/docs/network/connect.md +629 -0
- connectonion/docs/network/deploy.md +124 -0
- connectonion/docs/network/host.md +1087 -0
- connectonion/docs/network/io.md +538 -0
- connectonion/docs/network/protocol/agent-relay-protocol.md +495 -0
- connectonion/docs/network/protocol/announce-message.md +115 -0
- connectonion/docs/principles.md +124 -0
- connectonion/docs/quickstart.md +261 -0
- connectonion/docs/roadmap.md +81 -0
- connectonion/docs/templates/README.md +77 -0
- connectonion/docs/templates/meta-agent.md +152 -0
- connectonion/docs/templates/minimal.md +105 -0
- connectonion/docs/templates/playwright.md +130 -0
- connectonion/docs/templates/web-research.md +144 -0
- connectonion/docs/tui/README.md +95 -0
- connectonion/docs/tui/chat.md +181 -0
- connectonion/docs/tui/divider.md +63 -0
- connectonion/docs/tui/dropdown.md +83 -0
- connectonion/docs/tui/footer.md +44 -0
- connectonion/docs/tui/fuzzy.md +68 -0
- connectonion/docs/tui/input.md +84 -0
- connectonion/docs/tui/keys.md +77 -0
- connectonion/docs/tui/pick.md +71 -0
- connectonion/docs/tui/providers.md +89 -0
- connectonion/docs/tui/status_bar.md +67 -0
- connectonion/docs/useful_plugins/README.md +160 -0
- connectonion/docs/useful_plugins/calendar_plugin.md +68 -0
- connectonion/docs/useful_plugins/eval.md +89 -0
- connectonion/docs/useful_plugins/gmail_plugin.md +68 -0
- connectonion/docs/useful_plugins/image_result_formatter.md +74 -0
- connectonion/docs/useful_plugins/re_act.md +86 -0
- connectonion/docs/useful_plugins/shell_approval.md +69 -0
- connectonion/docs/useful_plugins/system_reminder.md +210 -0
- connectonion/docs/useful_prompts/README.md +127 -0
- connectonion/docs/useful_prompts/coding_agent.md +214 -0
- connectonion/docs/useful_tools/README.md +81 -0
- connectonion/docs/useful_tools/ask_user.md +103 -0
- connectonion/docs/useful_tools/diff_writer.md +158 -0
- connectonion/docs/useful_tools/get_emails.md +519 -0
- connectonion/docs/useful_tools/gmail.md +155 -0
- connectonion/docs/useful_tools/google_calendar.md +126 -0
- connectonion/docs/useful_tools/memory.md +506 -0
- connectonion/docs/useful_tools/microsoft_calendar.md +126 -0
- connectonion/docs/useful_tools/outlook.md +140 -0
- connectonion/docs/useful_tools/send_email.md +423 -0
- connectonion/docs/useful_tools/shell.md +115 -0
- connectonion/docs/useful_tools/slash_command.md +116 -0
- connectonion/docs/useful_tools/terminal.md +115 -0
- connectonion/docs/useful_tools/todo_list.md +272 -0
- connectonion/docs/useful_tools/web_fetch.md +150 -0
- connectonion/docs/vibe-coding-guide.md +97 -0
- connectonion/docs/windows-support.md +258 -0
- connectonion/logger.py +3 -3
- connectonion/network/__init__.py +19 -6
- connectonion/network/asgi/__init__.py +81 -0
- connectonion/network/asgi/http.py +205 -0
- connectonion/network/asgi/websocket.py +217 -0
- connectonion/network/connect.py +232 -185
- connectonion/network/host/__init__.py +59 -0
- connectonion/network/host/auth.py +191 -0
- connectonion/network/host/routes.py +135 -0
- connectonion/network/host/server.py +289 -0
- connectonion/network/host/session.py +78 -0
- connectonion/network/io/__init__.py +21 -0
- connectonion/network/{connection.py → io/base.py} +17 -42
- connectonion/network/io/websocket.py +55 -0
- connectonion/network/relay.py +37 -16
- connectonion/network/trust/__init__.py +30 -0
- connectonion/network/trust/factory.py +138 -0
- connectonion/network/{trust_agents.py → trust/prompts.py} +3 -3
- connectonion/network/{trust_functions.py → trust/tools.py} +2 -2
- connectonion/prompt_files/__init__.py +11 -1
- connectonion/prompt_files/react_acknowledge.md +26 -0
- connectonion/prompts.py +10 -1
- connectonion/tui/chat.py +10 -1
- connectonion/tui/divider.py +10 -1
- connectonion/tui/dropdown.py +10 -1
- connectonion/tui/footer.py +8 -0
- connectonion/tui/fuzzy.py +11 -1
- connectonion/tui/input.py +118 -70
- connectonion/tui/keys.py +133 -6
- connectonion/tui/providers.py +11 -1
- connectonion/tui/status_bar.py +10 -1
- connectonion/useful_events_handlers/__init__.py +8 -0
- connectonion/useful_events_handlers/reflect.py +19 -4
- connectonion/useful_plugins/__init__.py +2 -1
- connectonion/useful_plugins/eval.py +2 -2
- connectonion/useful_plugins/gmail_plugin.py +3 -3
- connectonion/useful_plugins/image_result_formatter.py +3 -3
- connectonion/useful_plugins/re_act.py +114 -28
- connectonion/useful_plugins/shell_approval.py +2 -2
- connectonion/useful_plugins/system_reminder.py +103 -0
- connectonion/useful_plugins/ui_stream.py +18 -133
- connectonion/useful_prompts/README.md +61 -0
- connectonion/useful_prompts/__init__.py +45 -0
- connectonion/useful_prompts/coding_agent/README.md +106 -0
- connectonion/useful_prompts/coding_agent/assembler.py +123 -0
- connectonion/useful_prompts/coding_agent/prompts/main.md +227 -0
- connectonion/useful_prompts/coding_agent/prompts/tools/ask_user.md +61 -0
- connectonion/useful_prompts/coding_agent/prompts/tools/background.md +57 -0
- connectonion/useful_prompts/coding_agent/prompts/tools/edit.md +90 -0
- connectonion/useful_prompts/coding_agent/prompts/tools/glob.md +52 -0
- connectonion/useful_prompts/coding_agent/prompts/tools/grep.md +55 -0
- connectonion/useful_prompts/coding_agent/prompts/tools/plan_mode.md +80 -0
- connectonion/useful_prompts/coding_agent/prompts/tools/read.md +40 -0
- connectonion/useful_prompts/coding_agent/prompts/tools/shell.md +67 -0
- connectonion/useful_prompts/coding_agent/prompts/tools/task.md +51 -0
- connectonion/useful_prompts/coding_agent/prompts/tools/todo.md +139 -0
- connectonion/useful_prompts/coding_agent/prompts/tools/write.md +48 -0
- connectonion/useful_prompts/system-reminders/security-warning.md +14 -0
- connectonion/useful_prompts/system-reminders/test-reminder.md +11 -0
- connectonion/useful_tools/__init__.py +31 -4
- connectonion/useful_tools/ask_user.py +35 -0
- connectonion/useful_tools/bash.py +69 -0
- connectonion/useful_tools/diff_writer.py +186 -94
- connectonion/useful_tools/edit.py +102 -0
- connectonion/useful_tools/glob_files.py +97 -0
- connectonion/useful_tools/grep_files.py +171 -0
- connectonion/useful_tools/multi_edit.py +116 -0
- connectonion/useful_tools/read_file.py +73 -0
- connectonion/useful_tools/shell.py +50 -45
- connectonion/useful_tools/write_file.py +129 -0
- {connectonion-0.6.2.dist-info → connectonion-0.6.3.dist-info}/METADATA +10 -3
- connectonion-0.6.3.dist-info/RECORD +469 -0
- connectonion/network/asgi.py +0 -407
- connectonion/network/host.py +0 -616
- connectonion/network/trust.py +0 -166
- connectonion-0.6.2.dist-info/RECORD +0 -129
- /connectonion/cli/{docs → co_ai/prompts/connectonion}/connectonion.md +0 -0
- {connectonion-0.6.2.dist-info → connectonion-0.6.3.dist-info}/WHEEL +0 -0
- {connectonion-0.6.2.dist-info → connectonion-0.6.3.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"""Read file tool."""
|
|
2
|
+
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
from typing import Optional
|
|
5
|
+
|
|
6
|
+
from connectonion.cli.co_ai.reminders import inject_reminder, should_show_security_reminder
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def read_file(
|
|
10
|
+
path: str,
|
|
11
|
+
offset: Optional[int] = None,
|
|
12
|
+
limit: Optional[int] = None,
|
|
13
|
+
) -> str:
|
|
14
|
+
"""
|
|
15
|
+
Read and return the contents of a file with line numbers.
|
|
16
|
+
|
|
17
|
+
Args:
|
|
18
|
+
path: Path to the file to read
|
|
19
|
+
offset: Line number to start from (1-indexed, default: 1)
|
|
20
|
+
limit: Number of lines to read (default: 2000)
|
|
21
|
+
|
|
22
|
+
Returns:
|
|
23
|
+
File contents with line numbers
|
|
24
|
+
|
|
25
|
+
Examples:
|
|
26
|
+
read_file("app.py") # Read entire file
|
|
27
|
+
read_file("large.log", offset=100) # Start from line 100
|
|
28
|
+
read_file("data.csv", limit=50) # First 50 lines
|
|
29
|
+
"""
|
|
30
|
+
file_path = Path(path)
|
|
31
|
+
|
|
32
|
+
if not file_path.exists():
|
|
33
|
+
return f"Error: File '{path}' does not exist"
|
|
34
|
+
|
|
35
|
+
if not file_path.is_file():
|
|
36
|
+
return f"Error: '{path}' is not a file"
|
|
37
|
+
|
|
38
|
+
content = file_path.read_text(encoding="utf-8", errors="replace")
|
|
39
|
+
lines = content.splitlines()
|
|
40
|
+
|
|
41
|
+
total_lines = len(lines)
|
|
42
|
+
|
|
43
|
+
# Apply offset and limit
|
|
44
|
+
start = (offset - 1) if offset and offset > 0 else 0
|
|
45
|
+
end = (start + limit) if limit else len(lines)
|
|
46
|
+
|
|
47
|
+
selected_lines = lines[start:end]
|
|
48
|
+
|
|
49
|
+
# Format with line numbers
|
|
50
|
+
result_lines = []
|
|
51
|
+
for i, line in enumerate(selected_lines, start=start + 1):
|
|
52
|
+
# Truncate very long lines
|
|
53
|
+
if len(line) > 500:
|
|
54
|
+
line = line[:500] + "..."
|
|
55
|
+
result_lines.append(f"{i:>6}\t{line}")
|
|
56
|
+
|
|
57
|
+
result = "\n".join(result_lines)
|
|
58
|
+
|
|
59
|
+
# Add info about truncation
|
|
60
|
+
if end < total_lines:
|
|
61
|
+
result += f"\n\n... ({total_lines - end} more lines)"
|
|
62
|
+
|
|
63
|
+
# Inject security reminder for sensitive files
|
|
64
|
+
if should_show_security_reminder(path):
|
|
65
|
+
result = inject_reminder(result, "security")
|
|
66
|
+
|
|
67
|
+
return result
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"""Task tool for delegating to sub-agents."""
|
|
2
|
+
|
|
3
|
+
from typing import Literal
|
|
4
|
+
|
|
5
|
+
from rich.console import Console
|
|
6
|
+
from rich.text import Text
|
|
7
|
+
|
|
8
|
+
from connectonion.cli.co_ai.agents.registry import get_subagent, SUBAGENTS
|
|
9
|
+
|
|
10
|
+
console = Console()
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def task(
|
|
14
|
+
prompt: str,
|
|
15
|
+
agent_type: Literal["explore", "plan"] = "explore",
|
|
16
|
+
) -> str:
|
|
17
|
+
"""
|
|
18
|
+
Delegate a task to a specialized sub-agent.
|
|
19
|
+
|
|
20
|
+
Use this when you need to:
|
|
21
|
+
- Explore the codebase (find files, search code, understand structure)
|
|
22
|
+
- Plan an implementation (design approach, identify files to change)
|
|
23
|
+
|
|
24
|
+
Args:
|
|
25
|
+
prompt: The task description for the sub-agent
|
|
26
|
+
agent_type: Type of sub-agent to use
|
|
27
|
+
- "explore": Fast codebase exploration (find files, search code)
|
|
28
|
+
- "plan": Design implementation plans
|
|
29
|
+
|
|
30
|
+
Returns:
|
|
31
|
+
Sub-agent's response
|
|
32
|
+
|
|
33
|
+
Examples:
|
|
34
|
+
task("Find all files that handle user authentication", agent_type="explore")
|
|
35
|
+
task("Design a plan to add dark mode support", agent_type="plan")
|
|
36
|
+
task("What is the project structure?", agent_type="explore")
|
|
37
|
+
"""
|
|
38
|
+
if agent_type not in SUBAGENTS:
|
|
39
|
+
available = ", ".join(SUBAGENTS.keys())
|
|
40
|
+
return f"Error: Unknown agent type '{agent_type}'. Available: {available}"
|
|
41
|
+
|
|
42
|
+
subagent = get_subagent(agent_type)
|
|
43
|
+
if subagent is None:
|
|
44
|
+
return f"Error: Failed to create {agent_type} agent"
|
|
45
|
+
|
|
46
|
+
# Show task start
|
|
47
|
+
short_prompt = prompt[:50] + "..." if len(prompt) > 50 else prompt
|
|
48
|
+
text = Text()
|
|
49
|
+
text.append(" ▶ ", style="blue")
|
|
50
|
+
text.append(f"Task ({agent_type})", style="bold blue")
|
|
51
|
+
text.append(f" {short_prompt}", style="dim")
|
|
52
|
+
console.print(text)
|
|
53
|
+
|
|
54
|
+
result = subagent.input(prompt)
|
|
55
|
+
|
|
56
|
+
# Show task complete
|
|
57
|
+
console.print(Text(" ◀ Task completed", style="blue"))
|
|
58
|
+
|
|
59
|
+
return result
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Purpose: Web-friendly todo tracking tool that emits updates via io
|
|
3
|
+
LLM-Note:
|
|
4
|
+
Dependencies: imports from [typing, dataclasses] | imported by [co_ai.tools.__init__]
|
|
5
|
+
Data flow: Agent calls TodoList methods -> updates internal list -> emits todo_update via io -> returns status string
|
|
6
|
+
State/Effects: maintains in-memory list of TodoItem objects | sends updates via io | no console output
|
|
7
|
+
Integration: exposes TodoList class with add(content, active_form), start(content), complete(content), remove(content), list(), update(todos), clear()
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from typing import List, Literal, Optional
|
|
11
|
+
from dataclasses import dataclass
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@dataclass
|
|
15
|
+
class TodoItem:
|
|
16
|
+
"""A single todo item."""
|
|
17
|
+
content: str
|
|
18
|
+
status: Literal["pending", "in_progress", "completed"]
|
|
19
|
+
active_form: str
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class TodoList:
|
|
23
|
+
"""Task tracking tool for agents (web-first)."""
|
|
24
|
+
|
|
25
|
+
def __init__(self):
|
|
26
|
+
self._todos: List[TodoItem] = []
|
|
27
|
+
self.io = None
|
|
28
|
+
|
|
29
|
+
def add(self, content: str, active_form: str) -> str:
|
|
30
|
+
"""Add a new todo item."""
|
|
31
|
+
if self._find(content):
|
|
32
|
+
return f"Todo already exists: {content}"
|
|
33
|
+
|
|
34
|
+
self._todos.append(TodoItem(
|
|
35
|
+
content=content,
|
|
36
|
+
status="pending",
|
|
37
|
+
active_form=active_form
|
|
38
|
+
))
|
|
39
|
+
self._emit()
|
|
40
|
+
return f"Added: {content}"
|
|
41
|
+
|
|
42
|
+
def start(self, content: str) -> str:
|
|
43
|
+
"""Mark a todo as in_progress."""
|
|
44
|
+
item = self._find(content)
|
|
45
|
+
if not item:
|
|
46
|
+
return f"Todo not found: {content}"
|
|
47
|
+
|
|
48
|
+
if item.status == "completed":
|
|
49
|
+
return f"Cannot start completed todo: {content}"
|
|
50
|
+
|
|
51
|
+
in_progress = [t for t in self._todos if t.status == "in_progress"]
|
|
52
|
+
if in_progress and in_progress[0].content != content:
|
|
53
|
+
return f"Another task is in progress: {in_progress[0].content}. Complete it first."
|
|
54
|
+
|
|
55
|
+
item.status = "in_progress"
|
|
56
|
+
self._emit()
|
|
57
|
+
return f"Started: {item.active_form}"
|
|
58
|
+
|
|
59
|
+
def complete(self, content: str) -> str:
|
|
60
|
+
"""Mark a todo as completed."""
|
|
61
|
+
item = self._find(content)
|
|
62
|
+
if not item:
|
|
63
|
+
return f"Todo not found: {content}"
|
|
64
|
+
|
|
65
|
+
item.status = "completed"
|
|
66
|
+
self._emit()
|
|
67
|
+
return f"Completed: {content}"
|
|
68
|
+
|
|
69
|
+
def remove(self, content: str) -> str:
|
|
70
|
+
"""Remove a todo from the list."""
|
|
71
|
+
item = self._find(content)
|
|
72
|
+
if not item:
|
|
73
|
+
return f"Todo not found: {content}"
|
|
74
|
+
|
|
75
|
+
self._todos.remove(item)
|
|
76
|
+
self._emit()
|
|
77
|
+
return f"Removed: {content}"
|
|
78
|
+
|
|
79
|
+
def list(self) -> str:
|
|
80
|
+
"""Get all todos as formatted text."""
|
|
81
|
+
if not self._todos:
|
|
82
|
+
return "No todos"
|
|
83
|
+
|
|
84
|
+
lines = []
|
|
85
|
+
for item in self._todos:
|
|
86
|
+
status_icon = self._status_icon(item.status)
|
|
87
|
+
lines.append(f"{status_icon} {item.content}")
|
|
88
|
+
|
|
89
|
+
return "\n".join(lines)
|
|
90
|
+
|
|
91
|
+
def update(self, todos: List[dict]) -> str:
|
|
92
|
+
"""Replace entire todo list (for bulk updates)."""
|
|
93
|
+
self._todos = []
|
|
94
|
+
for t in todos:
|
|
95
|
+
self._todos.append(TodoItem(
|
|
96
|
+
content=t["content"],
|
|
97
|
+
status=t["status"],
|
|
98
|
+
active_form=t.get("active_form", t["content"] + "...")
|
|
99
|
+
))
|
|
100
|
+
self._emit()
|
|
101
|
+
return f"Updated {len(self._todos)} todos"
|
|
102
|
+
|
|
103
|
+
def clear(self) -> str:
|
|
104
|
+
"""Clear all todos."""
|
|
105
|
+
count = len(self._todos)
|
|
106
|
+
self._todos = []
|
|
107
|
+
self._emit()
|
|
108
|
+
return f"Cleared {count} todos"
|
|
109
|
+
|
|
110
|
+
def _find(self, content: str) -> Optional[TodoItem]:
|
|
111
|
+
"""Find todo by content."""
|
|
112
|
+
for item in self._todos:
|
|
113
|
+
if item.content == content:
|
|
114
|
+
return item
|
|
115
|
+
return None
|
|
116
|
+
|
|
117
|
+
def _status_icon(self, status: str) -> str:
|
|
118
|
+
"""Get icon for status (ASCII)."""
|
|
119
|
+
return {
|
|
120
|
+
"pending": "[ ]",
|
|
121
|
+
"in_progress": "[>]",
|
|
122
|
+
"completed": "[x]"
|
|
123
|
+
}.get(status, "[ ]")
|
|
124
|
+
|
|
125
|
+
def _emit(self) -> None:
|
|
126
|
+
"""Emit todo updates to io (best-effort)."""
|
|
127
|
+
if not self.io:
|
|
128
|
+
return
|
|
129
|
+
|
|
130
|
+
payload = {
|
|
131
|
+
"type": "todo_update",
|
|
132
|
+
"todos": [
|
|
133
|
+
{
|
|
134
|
+
"content": t.content,
|
|
135
|
+
"status": t.status,
|
|
136
|
+
"active_form": t.active_form
|
|
137
|
+
}
|
|
138
|
+
for t in self._todos
|
|
139
|
+
],
|
|
140
|
+
"progress": self.progress,
|
|
141
|
+
"current_task": self.current_task,
|
|
142
|
+
}
|
|
143
|
+
self.io.send(payload)
|
|
144
|
+
|
|
145
|
+
@property
|
|
146
|
+
def progress(self) -> float:
|
|
147
|
+
"""Get progress as percentage (0.0 to 1.0)."""
|
|
148
|
+
if not self._todos:
|
|
149
|
+
return 1.0
|
|
150
|
+
completed = sum(1 for t in self._todos if t.status == "completed")
|
|
151
|
+
return completed / len(self._todos)
|
|
152
|
+
|
|
153
|
+
@property
|
|
154
|
+
def current_task(self) -> Optional[str]:
|
|
155
|
+
"""Get the currently in_progress task."""
|
|
156
|
+
for item in self._todos:
|
|
157
|
+
if item.status == "in_progress":
|
|
158
|
+
return item.active_form
|
|
159
|
+
return None
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Purpose: Write file tool with Claude Code-style approval (web mode)
|
|
3
|
+
LLM-Note:
|
|
4
|
+
Dependencies: imports from [.diff_writer] | imported by [co_ai.tools.__init__]
|
|
5
|
+
Data flow: Agent calls write(path, content) -> DiffWriter handles approval via io -> writes file
|
|
6
|
+
State/Effects: writes file to filesystem | sends events via io for approval
|
|
7
|
+
Integration: exposes write(path, content) function and Write class | used as agent tool
|
|
8
|
+
|
|
9
|
+
This is a wrapper around DiffWriter for simpler function-based usage.
|
|
10
|
+
For class-based usage with mode control, use DiffWriter directly.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from pathlib import Path
|
|
14
|
+
from typing import Optional
|
|
15
|
+
|
|
16
|
+
from .diff_writer import DiffWriter, MODE_NORMAL, MODE_AUTO, MODE_PLAN
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
# Global writer instance for function-based API
|
|
20
|
+
_writer: Optional[DiffWriter] = None
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def _get_writer() -> DiffWriter:
|
|
24
|
+
"""Get or create the global writer instance."""
|
|
25
|
+
global _writer
|
|
26
|
+
if _writer is None:
|
|
27
|
+
_writer = DiffWriter(mode=MODE_AUTO) # Default to auto for function API
|
|
28
|
+
return _writer
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def write(path: str, content: str) -> str:
|
|
32
|
+
"""
|
|
33
|
+
Write content to a file (full overwrite).
|
|
34
|
+
|
|
35
|
+
For new files or when replacing most of the content.
|
|
36
|
+
Use edit() for small, targeted changes instead.
|
|
37
|
+
|
|
38
|
+
Args:
|
|
39
|
+
path: File path to write to
|
|
40
|
+
content: Complete file content
|
|
41
|
+
|
|
42
|
+
Returns:
|
|
43
|
+
Success message or error description
|
|
44
|
+
|
|
45
|
+
Examples:
|
|
46
|
+
write("new_file.py", "print('hello')")
|
|
47
|
+
write("config.json", '{"debug": true}')
|
|
48
|
+
"""
|
|
49
|
+
writer = _get_writer()
|
|
50
|
+
return writer.write(path, content)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class Write:
|
|
54
|
+
"""File writer with Claude Code-style permission modes (web mode).
|
|
55
|
+
|
|
56
|
+
Use this class when you need mode control (normal/auto/plan).
|
|
57
|
+
For simple writes, use the write() function instead.
|
|
58
|
+
|
|
59
|
+
Usage:
|
|
60
|
+
writer = Write(mode="normal") # Prompt for every write
|
|
61
|
+
writer = Write(mode="auto") # Auto-approve all writes
|
|
62
|
+
writer = Write(mode="plan") # Read-only, preview only
|
|
63
|
+
"""
|
|
64
|
+
|
|
65
|
+
def __init__(self, mode: str = MODE_NORMAL):
|
|
66
|
+
"""Initialize Write tool.
|
|
67
|
+
|
|
68
|
+
Args:
|
|
69
|
+
mode: Permission mode - "normal" (prompt), "auto" (auto-approve), "plan" (read-only)
|
|
70
|
+
"""
|
|
71
|
+
self._writer = DiffWriter(mode=mode)
|
|
72
|
+
|
|
73
|
+
@property
|
|
74
|
+
def io(self):
|
|
75
|
+
"""IO channel for web mode."""
|
|
76
|
+
return self._writer.io
|
|
77
|
+
|
|
78
|
+
@io.setter
|
|
79
|
+
def io(self, value):
|
|
80
|
+
"""Set IO channel."""
|
|
81
|
+
self._writer.io = value
|
|
82
|
+
|
|
83
|
+
@property
|
|
84
|
+
def mode(self):
|
|
85
|
+
"""Current permission mode."""
|
|
86
|
+
return self._writer.mode
|
|
87
|
+
|
|
88
|
+
@mode.setter
|
|
89
|
+
def mode(self, value):
|
|
90
|
+
"""Set permission mode."""
|
|
91
|
+
self._writer.mode = value
|
|
92
|
+
|
|
93
|
+
def write(self, path: str, content: str) -> str:
|
|
94
|
+
"""Write content to a file with approval.
|
|
95
|
+
|
|
96
|
+
Args:
|
|
97
|
+
path: File path to write to
|
|
98
|
+
content: Complete file content
|
|
99
|
+
|
|
100
|
+
Returns:
|
|
101
|
+
Success message, rejection with feedback, or plan mode preview
|
|
102
|
+
"""
|
|
103
|
+
return self._writer.write(path, content)
|
|
104
|
+
|
|
105
|
+
def diff(self, path: str, content: str) -> str:
|
|
106
|
+
"""Show diff without writing (preview mode).
|
|
107
|
+
|
|
108
|
+
Args:
|
|
109
|
+
path: File path to compare against
|
|
110
|
+
content: New content to compare
|
|
111
|
+
|
|
112
|
+
Returns:
|
|
113
|
+
Diff string in unified format
|
|
114
|
+
"""
|
|
115
|
+
return self._writer.diff(path, content)
|
|
116
|
+
|
|
117
|
+
def read(self, path: str) -> str:
|
|
118
|
+
"""Read file contents.
|
|
119
|
+
|
|
120
|
+
Args:
|
|
121
|
+
path: File path to read
|
|
122
|
+
|
|
123
|
+
Returns:
|
|
124
|
+
File contents or error message
|
|
125
|
+
"""
|
|
126
|
+
return self._writer.read(path)
|
|
@@ -1 +1,11 @@
|
|
|
1
|
-
"""
|
|
1
|
+
"""
|
|
2
|
+
Purpose: CLI command modules namespace
|
|
3
|
+
LLM-Note:
|
|
4
|
+
Dependencies: none | imported by [cli/main.py] | no direct tests
|
|
5
|
+
Data flow: no exports (commands imported directly from submodules)
|
|
6
|
+
State/Effects: no state
|
|
7
|
+
Integration: namespace package for auth_commands, browser_commands, create, deploy_commands, doctor_commands, eval_commands, init, status_commands, etc.
|
|
8
|
+
Performance: trivial
|
|
9
|
+
Errors: none
|
|
10
|
+
Command modules for ConnectOnion CLI.
|
|
11
|
+
"""
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Purpose: AI coding agent CLI command
|
|
3
|
+
LLM-Note:
|
|
4
|
+
Dependencies: imports from [cli/co_ai/main.py] | imported by [cli/main.py] | no direct tests
|
|
5
|
+
Data flow: CLI args → start_server(port, model, max_iterations) → co_ai.main.start_server()
|
|
6
|
+
Integration: exposes handle_ai() | called from main.py as 'co ai' command
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from rich.console import Console
|
|
10
|
+
|
|
11
|
+
console = Console()
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def handle_ai(
|
|
15
|
+
port: int = 8000,
|
|
16
|
+
model: str = "co/claude-opus-4-5",
|
|
17
|
+
max_iterations: int = 20,
|
|
18
|
+
):
|
|
19
|
+
"""Start AI coding agent web server.
|
|
20
|
+
|
|
21
|
+
Args:
|
|
22
|
+
port: Port to run server on
|
|
23
|
+
model: LLM model to use
|
|
24
|
+
max_iterations: Max tool calling iterations
|
|
25
|
+
|
|
26
|
+
Examples:
|
|
27
|
+
co ai # Start on port 8000
|
|
28
|
+
co ai --port 3001 # Custom port
|
|
29
|
+
co ai --model co/gpt-5 # Different model
|
|
30
|
+
"""
|
|
31
|
+
from ..co_ai.main import start_server
|
|
32
|
+
|
|
33
|
+
console.print(f"[green]Starting AI coding agent on port {port}...[/]")
|
|
34
|
+
start_server(port=port, model=model, max_iterations=max_iterations)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"""
|
|
2
|
-
Purpose: CLI command to copy built-in tools and
|
|
2
|
+
Purpose: CLI command to copy built-in tools, plugins, and prompts to user's project for customization
|
|
3
3
|
LLM-Note:
|
|
4
4
|
Dependencies: imports from [shutil, pathlib, typing, rich] | imported by [cli/main.py via handle_copy()]
|
|
5
|
-
Data flow: user runs `co copy <name>` → looks up name in TOOLS/PLUGINS registry → finds source via module.__file__ → copies to ./tools
|
|
6
|
-
State/Effects: creates tools
|
|
5
|
+
Data flow: user runs `co copy <name>` → looks up name in TOOLS/PLUGINS/PROMPTS registry → finds source via module.__file__ → copies to ./tools/, ./plugins/, or ./prompts/
|
|
6
|
+
State/Effects: creates tools/, plugins/, or prompts/ directory if needed | copies files/directories from installed package to user's project
|
|
7
7
|
Integration: exposes handle_copy() for CLI | uses Python import system to find installed package location (cross-platform)
|
|
8
8
|
"""
|
|
9
9
|
|
|
@@ -17,6 +17,7 @@ console = Console()
|
|
|
17
17
|
|
|
18
18
|
# Registry of copyable tools
|
|
19
19
|
TOOLS = {
|
|
20
|
+
"ask_user": "ask_user.py",
|
|
20
21
|
"gmail": "gmail.py",
|
|
21
22
|
"outlook": "outlook.py",
|
|
22
23
|
"google_calendar": "google_calendar.py",
|
|
@@ -37,6 +38,12 @@ PLUGINS = {
|
|
|
37
38
|
"shell_approval": "shell_approval.py",
|
|
38
39
|
"gmail_plugin": "gmail_plugin.py",
|
|
39
40
|
"calendar_plugin": "calendar_plugin.py",
|
|
41
|
+
"system_reminder": "system_reminder.py",
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
# Plugins that also need prompts copied
|
|
45
|
+
PLUGIN_PROMPTS = {
|
|
46
|
+
"system_reminder": "system-reminders",
|
|
40
47
|
}
|
|
41
48
|
|
|
42
49
|
# Registry of copyable TUI components
|
|
@@ -51,6 +58,11 @@ TUI = {
|
|
|
51
58
|
"keys": "keys.py",
|
|
52
59
|
}
|
|
53
60
|
|
|
61
|
+
# Registry of copyable prompt templates (directories)
|
|
62
|
+
PROMPTS = {
|
|
63
|
+
"coding_agent": "coding_agent",
|
|
64
|
+
}
|
|
65
|
+
|
|
54
66
|
|
|
55
67
|
def handle_copy(
|
|
56
68
|
names: List[str],
|
|
@@ -58,7 +70,7 @@ def handle_copy(
|
|
|
58
70
|
path: Optional[str] = None,
|
|
59
71
|
force: bool = False
|
|
60
72
|
):
|
|
61
|
-
"""Copy built-in tools and
|
|
73
|
+
"""Copy built-in tools, plugins, and prompts to user's project."""
|
|
62
74
|
|
|
63
75
|
# Show list if requested or no names provided
|
|
64
76
|
if list_all or not names:
|
|
@@ -69,10 +81,12 @@ def handle_copy(
|
|
|
69
81
|
import connectonion.useful_tools as tools_module
|
|
70
82
|
import connectonion.useful_plugins as plugins_module
|
|
71
83
|
import connectonion.tui as tui_module
|
|
84
|
+
import connectonion.useful_prompts as prompts_module
|
|
72
85
|
|
|
73
86
|
useful_tools_dir = Path(tools_module.__file__).parent
|
|
74
87
|
useful_plugins_dir = Path(plugins_module.__file__).parent
|
|
75
88
|
tui_dir = Path(tui_module.__file__).parent
|
|
89
|
+
useful_prompts_dir = Path(prompts_module.__file__).parent
|
|
76
90
|
|
|
77
91
|
current_dir = Path.cwd()
|
|
78
92
|
|
|
@@ -91,12 +105,24 @@ def handle_copy(
|
|
|
91
105
|
dest_dir = Path(path) if path else current_dir / "plugins"
|
|
92
106
|
copy_file(source, dest_dir, force)
|
|
93
107
|
|
|
108
|
+
# Also copy associated prompts if any
|
|
109
|
+
if name_lower in PLUGIN_PROMPTS:
|
|
110
|
+
prompt_source = useful_prompts_dir / PLUGIN_PROMPTS[name_lower]
|
|
111
|
+
prompt_dest = Path(path) if path else current_dir / "prompts"
|
|
112
|
+
copy_directory(prompt_source, prompt_dest, force)
|
|
113
|
+
|
|
94
114
|
# Check if it's a TUI component
|
|
95
115
|
elif name_lower in TUI:
|
|
96
116
|
source = tui_dir / TUI[name_lower]
|
|
97
117
|
dest_dir = Path(path) if path else current_dir / "tui"
|
|
98
118
|
copy_file(source, dest_dir, force)
|
|
99
119
|
|
|
120
|
+
# Check if it's a prompt template
|
|
121
|
+
elif name_lower in PROMPTS:
|
|
122
|
+
source = useful_prompts_dir / PROMPTS[name_lower]
|
|
123
|
+
dest_dir = Path(path) if path else current_dir / "prompts"
|
|
124
|
+
copy_directory(source, dest_dir, force)
|
|
125
|
+
|
|
100
126
|
else:
|
|
101
127
|
console.print(f"[red]Unknown: {name}[/red]")
|
|
102
128
|
console.print("Use [cyan]co copy --list[/cyan] to see available items")
|
|
@@ -119,12 +145,31 @@ def copy_file(source: Path, dest_dir: Path, force: bool):
|
|
|
119
145
|
console.print(f"[green]✓ Copied: {dest}[/green]")
|
|
120
146
|
|
|
121
147
|
|
|
148
|
+
def copy_directory(source: Path, dest_dir: Path, force: bool):
|
|
149
|
+
"""Copy an entire directory to destination."""
|
|
150
|
+
if not source.exists():
|
|
151
|
+
console.print(f"[red]Source not found: {source}[/red]")
|
|
152
|
+
return
|
|
153
|
+
|
|
154
|
+
dest_dir.mkdir(parents=True, exist_ok=True)
|
|
155
|
+
dest = dest_dir / source.name
|
|
156
|
+
|
|
157
|
+
if dest.exists():
|
|
158
|
+
if not force:
|
|
159
|
+
console.print(f"[yellow]Skipped: {dest} (exists, use --force)[/yellow]")
|
|
160
|
+
return
|
|
161
|
+
shutil.rmtree(dest)
|
|
162
|
+
|
|
163
|
+
shutil.copytree(source, dest)
|
|
164
|
+
console.print(f"[green]✓ Copied: {dest}/[/green]")
|
|
165
|
+
|
|
166
|
+
|
|
122
167
|
def show_available_items():
|
|
123
|
-
"""Display available tools, plugins, and TUI components."""
|
|
168
|
+
"""Display available tools, plugins, prompts, and TUI components."""
|
|
124
169
|
table = Table(title="Available Items to Copy")
|
|
125
170
|
table.add_column("Name", style="cyan")
|
|
126
171
|
table.add_column("Type", style="green")
|
|
127
|
-
table.add_column("
|
|
172
|
+
table.add_column("Path")
|
|
128
173
|
|
|
129
174
|
for name, file in sorted(TOOLS.items()):
|
|
130
175
|
table.add_row(name, "tool", file)
|
|
@@ -132,8 +177,12 @@ def show_available_items():
|
|
|
132
177
|
for name, file in sorted(PLUGINS.items()):
|
|
133
178
|
table.add_row(name, "plugin", file)
|
|
134
179
|
|
|
180
|
+
for name, dir_name in sorted(PROMPTS.items()):
|
|
181
|
+
table.add_row(name, "prompt", f"{dir_name}/")
|
|
182
|
+
|
|
135
183
|
for name, file in sorted(TUI.items()):
|
|
136
184
|
table.add_row(name, "tui", file)
|
|
137
185
|
|
|
138
186
|
console.print(table)
|
|
139
187
|
console.print("\n[dim]Usage: co copy <name> [--path ./custom/][/dim]")
|
|
188
|
+
console.print("[dim]Prompts are copied as directories to ./prompts/<name>/[/dim]")
|
|
@@ -35,7 +35,8 @@ from .project_cmd_lib import (
|
|
|
35
35
|
get_template_info,
|
|
36
36
|
generate_custom_template_with_name,
|
|
37
37
|
show_progress,
|
|
38
|
-
configure_env_for_provider
|
|
38
|
+
configure_env_for_provider,
|
|
39
|
+
get_docs_source,
|
|
39
40
|
)
|
|
40
41
|
|
|
41
42
|
console = Console()
|
|
@@ -358,26 +359,28 @@ def handle_create(name: Optional[str], ai: Optional[bool], key: Optional[str],
|
|
|
358
359
|
if not co_dir.exists():
|
|
359
360
|
co_dir.mkdir(exist_ok=True)
|
|
360
361
|
|
|
361
|
-
# Create docs directory
|
|
362
|
+
# Create docs directory and copy ALL documentation (always overwrite for latest version)
|
|
362
363
|
docs_dir = co_dir / "docs"
|
|
364
|
+
if docs_dir.exists():
|
|
365
|
+
shutil.rmtree(docs_dir)
|
|
363
366
|
docs_dir.mkdir(exist_ok=True)
|
|
364
367
|
|
|
365
|
-
#
|
|
366
|
-
|
|
368
|
+
# Get docs source (works in both dev and installed package)
|
|
369
|
+
docs_source = get_docs_source()
|
|
367
370
|
|
|
368
|
-
# Copy
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
files_created.append("co
|
|
371
|
+
# Copy ALL docs to .co/docs/
|
|
372
|
+
if docs_source.exists() and docs_source.is_dir():
|
|
373
|
+
for item in docs_source.iterdir():
|
|
374
|
+
if item.name.startswith('.') or item.name == 'archive':
|
|
375
|
+
continue
|
|
376
|
+
dest = docs_dir / item.name
|
|
377
|
+
if item.is_dir():
|
|
378
|
+
shutil.copytree(item, dest, dirs_exist_ok=True)
|
|
379
|
+
else:
|
|
380
|
+
shutil.copy2(item, dest)
|
|
381
|
+
files_created.append(".co/docs/ (full documentation)")
|
|
379
382
|
else:
|
|
380
|
-
console.print(f"[yellow]⚠️ Warning:
|
|
383
|
+
console.print(f"[yellow]⚠️ Warning: Documentation not found at {docs_source}[/yellow]")
|
|
381
384
|
|
|
382
385
|
# Create config.toml (simplified - agent metadata now in .env)
|
|
383
386
|
config = {
|
|
@@ -500,7 +503,7 @@ todo.md
|
|
|
500
503
|
|
|
501
504
|
# Vibe Coding hint - clean formatting with proper spacing
|
|
502
505
|
console.print("[bold yellow]💡 Vibe Coding:[/bold yellow] Use Claude/Cursor/Codex with")
|
|
503
|
-
console.print(f" [cyan]co
|
|
506
|
+
console.print(f" [cyan].co/docs/[/cyan] for full documentation")
|
|
504
507
|
console.print()
|
|
505
508
|
|
|
506
509
|
# Resources - clean format with arrows for better alignment
|