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,105 @@
|
|
|
1
|
+
# Minimal Template
|
|
2
|
+
|
|
3
|
+
The simplest starting point for learning ConnectOnion.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
co create my-bot --template minimal
|
|
9
|
+
cd my-bot
|
|
10
|
+
python agent.py
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## What You Get
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
my-bot/
|
|
17
|
+
├── agent.py # Agent with calculator tool
|
|
18
|
+
├── .env # API keys
|
|
19
|
+
├── .co/
|
|
20
|
+
│ └── docs/ # ConnectOnion documentation
|
|
21
|
+
└── README.md # Project docs
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Tools Included
|
|
25
|
+
|
|
26
|
+
| Tool | Description |
|
|
27
|
+
|------|-------------|
|
|
28
|
+
| `calculator(expression)` | Evaluate math expressions |
|
|
29
|
+
|
|
30
|
+
## Example Usage
|
|
31
|
+
|
|
32
|
+
```python
|
|
33
|
+
from connectonion import Agent
|
|
34
|
+
|
|
35
|
+
def calculator(expression: str) -> float:
|
|
36
|
+
"""Evaluate a math expression."""
|
|
37
|
+
return eval(expression)
|
|
38
|
+
|
|
39
|
+
agent = Agent("assistant", tools=[calculator])
|
|
40
|
+
result = agent.input("What is 25 * 4?")
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Interactive mode:
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
You: What is 15% of 200?
|
|
47
|
+
Agent: 15% of 200 is 30.0
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Use Cases
|
|
51
|
+
|
|
52
|
+
- Learning ConnectOnion basics
|
|
53
|
+
- Quick prototyping
|
|
54
|
+
- Template for custom agents
|
|
55
|
+
- Understanding tool calling
|
|
56
|
+
|
|
57
|
+
## Dependencies
|
|
58
|
+
|
|
59
|
+
- `connectonion`
|
|
60
|
+
- `python-dotenv`
|
|
61
|
+
|
|
62
|
+
## Customization
|
|
63
|
+
|
|
64
|
+
### Add More Tools
|
|
65
|
+
|
|
66
|
+
```python
|
|
67
|
+
def search(query: str) -> str:
|
|
68
|
+
"""Search for information."""
|
|
69
|
+
return f"Results for: {query}"
|
|
70
|
+
|
|
71
|
+
agent = Agent(
|
|
72
|
+
"assistant",
|
|
73
|
+
tools=[calculator, search]
|
|
74
|
+
)
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Add System Prompt
|
|
78
|
+
|
|
79
|
+
Create `prompt.md`:
|
|
80
|
+
|
|
81
|
+
```markdown
|
|
82
|
+
# Assistant
|
|
83
|
+
|
|
84
|
+
You are a helpful assistant with calculation abilities.
|
|
85
|
+
|
|
86
|
+
## Guidelines
|
|
87
|
+
- Show your work
|
|
88
|
+
- Be precise with numbers
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Then reference it:
|
|
92
|
+
|
|
93
|
+
```python
|
|
94
|
+
agent = Agent(
|
|
95
|
+
"assistant",
|
|
96
|
+
system_prompt="prompt.md",
|
|
97
|
+
tools=[calculator]
|
|
98
|
+
)
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Next Steps
|
|
102
|
+
|
|
103
|
+
- [Tools](../concepts/tools.md) - Add custom tools
|
|
104
|
+
- [Prompts](../concepts/prompts.md) - Customize personality
|
|
105
|
+
- [Events](../concepts/events.md) - Add lifecycle hooks
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# Playwright Template
|
|
2
|
+
|
|
3
|
+
Browser automation agent with full web control capabilities.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
co create browser-bot --template playwright
|
|
9
|
+
cd browser-bot
|
|
10
|
+
pip install playwright
|
|
11
|
+
playwright install chromium
|
|
12
|
+
python agent.py
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## What You Get
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
browser-bot/
|
|
19
|
+
├── agent.py # BrowserAutomation class with 11 tools
|
|
20
|
+
├── prompt.md # Browser automation system prompt
|
|
21
|
+
├── requirements.txt # playwright, connectonion, python-dotenv
|
|
22
|
+
├── .env # API keys
|
|
23
|
+
├── .co/
|
|
24
|
+
│ └── docs/ # ConnectOnion documentation
|
|
25
|
+
└── README.md # Project docs
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Tools Included
|
|
29
|
+
|
|
30
|
+
| Tool | Description |
|
|
31
|
+
|------|-------------|
|
|
32
|
+
| `start_browser(headless)` | Launch browser instance |
|
|
33
|
+
| `navigate(url, wait_until)` | Navigate to URL |
|
|
34
|
+
| `take_screenshot(filename, full_page)` | Capture screenshots |
|
|
35
|
+
| `scrape_content(selector)` | Extract text with CSS selectors |
|
|
36
|
+
| `fill_form(form_data)` | Fill form fields |
|
|
37
|
+
| `click(selector)` | Click elements |
|
|
38
|
+
| `extract_links(filter_pattern)` | Get all links from page |
|
|
39
|
+
| `wait_for_element(selector, timeout)` | Wait for DOM elements |
|
|
40
|
+
| `execute_javascript(script)` | Run custom JavaScript |
|
|
41
|
+
| `get_page_info()` | Get URL, title, viewport |
|
|
42
|
+
| `get_session_info()` | Get browser state |
|
|
43
|
+
|
|
44
|
+
## Example Usage
|
|
45
|
+
|
|
46
|
+
```python
|
|
47
|
+
# Scrape a webpage
|
|
48
|
+
result = agent.input("Go to example.com and extract the main heading")
|
|
49
|
+
|
|
50
|
+
# Fill a form
|
|
51
|
+
result = agent.input('Fill the contact form with name "John" and email "john@example.com"')
|
|
52
|
+
|
|
53
|
+
# Take screenshots
|
|
54
|
+
result = agent.input("Take a full-page screenshot of the documentation site")
|
|
55
|
+
|
|
56
|
+
# Extract links
|
|
57
|
+
result = agent.input("Get all PDF links from the downloads page")
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Interactive mode:
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
You: Go to hacker news and get the top 5 stories
|
|
64
|
+
Agent: I'll navigate to Hacker News and extract the top stories...
|
|
65
|
+
[Takes screenshot, scrapes content]
|
|
66
|
+
Here are the top 5 stories:
|
|
67
|
+
1. ...
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Use Cases
|
|
71
|
+
|
|
72
|
+
- Web scraping and data extraction
|
|
73
|
+
- Form automation
|
|
74
|
+
- Visual testing and screenshots
|
|
75
|
+
- Link crawling
|
|
76
|
+
- Dynamic content handling
|
|
77
|
+
- Browser-based testing
|
|
78
|
+
|
|
79
|
+
## Dependencies
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
connectonion
|
|
83
|
+
playwright
|
|
84
|
+
python-dotenv
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
After installing, run:
|
|
88
|
+
```bash
|
|
89
|
+
playwright install chromium
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Customization
|
|
93
|
+
|
|
94
|
+
### Add Custom Selectors
|
|
95
|
+
|
|
96
|
+
```python
|
|
97
|
+
# The agent uses CSS selectors
|
|
98
|
+
result = agent.input("Click the button with class 'submit-btn'")
|
|
99
|
+
result = agent.input("Extract text from #main-content")
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Headless vs Visible Browser
|
|
103
|
+
|
|
104
|
+
```python
|
|
105
|
+
# Default is headless (no window)
|
|
106
|
+
result = agent.input("Start browser in headless mode")
|
|
107
|
+
|
|
108
|
+
# Or visible for debugging
|
|
109
|
+
result = agent.input("Start browser with headless=false")
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Wait Strategies
|
|
113
|
+
|
|
114
|
+
The `navigate` tool supports wait strategies:
|
|
115
|
+
- `load` - Wait for page load
|
|
116
|
+
- `domcontentloaded` - Wait for DOM ready
|
|
117
|
+
- `networkidle` - Wait for network to be idle
|
|
118
|
+
|
|
119
|
+
## Tips
|
|
120
|
+
|
|
121
|
+
- Browser maintains state across commands (stateful)
|
|
122
|
+
- Screenshots are saved to current directory
|
|
123
|
+
- Use CSS selectors for precise element targeting
|
|
124
|
+
- Agent tracks visited URLs and screenshots
|
|
125
|
+
|
|
126
|
+
## Next Steps
|
|
127
|
+
|
|
128
|
+
- [Playwright Docs](https://playwright.dev/python/) - Full Playwright API
|
|
129
|
+
- [Tools](../concepts/tools.md) - Add custom tools
|
|
130
|
+
- [XRay Debugging](../debug/xray.md) - Debug tool execution
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
# Web Research Template
|
|
2
|
+
|
|
3
|
+
Research and data extraction agent for gathering and analyzing web content.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
co create researcher --template web-research
|
|
9
|
+
cd researcher
|
|
10
|
+
pip install requests
|
|
11
|
+
python agent.py
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## What You Get
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
researcher/
|
|
18
|
+
├── agent.py # Research agent with 4 tools
|
|
19
|
+
├── .env # API keys
|
|
20
|
+
├── .co/
|
|
21
|
+
│ └── docs/ # ConnectOnion documentation
|
|
22
|
+
└── README.md # Project docs
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Tools Included
|
|
26
|
+
|
|
27
|
+
| Tool | Description |
|
|
28
|
+
|------|-------------|
|
|
29
|
+
| `search_web(query)` | Web search (needs API integration) |
|
|
30
|
+
| `extract_data(url, data_type)` | Fetch content from URLs |
|
|
31
|
+
| `analyze_data(data, analysis_type)` | LLM-powered content analysis |
|
|
32
|
+
| `save_research(topic, findings, filename)` | Save findings to JSON |
|
|
33
|
+
|
|
34
|
+
## Example Usage
|
|
35
|
+
|
|
36
|
+
```python
|
|
37
|
+
# Extract content from URL
|
|
38
|
+
result = agent.input("Extract the main content from https://example.com")
|
|
39
|
+
|
|
40
|
+
# Analyze content
|
|
41
|
+
result = agent.input("Analyze this article and summarize the key points")
|
|
42
|
+
|
|
43
|
+
# Save research
|
|
44
|
+
result = agent.input("Save our findings about AI trends to a file")
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Interactive mode:
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
You: Get the content from this blog post and summarize it
|
|
51
|
+
Agent: [Fetches URL content]
|
|
52
|
+
[Analyzes with LLM]
|
|
53
|
+
Here's a summary of the article...
|
|
54
|
+
|
|
55
|
+
You: Save this research to ai-trends.json
|
|
56
|
+
Agent: Research saved to ai-trends.json with timestamp
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Use Cases
|
|
60
|
+
|
|
61
|
+
- Web content extraction
|
|
62
|
+
- Research documentation
|
|
63
|
+
- Content analysis and summarization
|
|
64
|
+
- Data gathering projects
|
|
65
|
+
- Knowledge base building
|
|
66
|
+
|
|
67
|
+
## Dependencies
|
|
68
|
+
|
|
69
|
+
- `connectonion`
|
|
70
|
+
- `requests`
|
|
71
|
+
- `python-dotenv`
|
|
72
|
+
|
|
73
|
+
## Customization
|
|
74
|
+
|
|
75
|
+
### Add Real Search API
|
|
76
|
+
|
|
77
|
+
The `search_web` tool is a placeholder. Integrate with search APIs:
|
|
78
|
+
|
|
79
|
+
```python
|
|
80
|
+
import requests
|
|
81
|
+
|
|
82
|
+
def search_web(query: str) -> str:
|
|
83
|
+
"""Search the web using Google Custom Search."""
|
|
84
|
+
api_key = os.getenv("GOOGLE_API_KEY")
|
|
85
|
+
cx = os.getenv("GOOGLE_CX")
|
|
86
|
+
|
|
87
|
+
response = requests.get(
|
|
88
|
+
"https://www.googleapis.com/customsearch/v1",
|
|
89
|
+
params={"key": api_key, "cx": cx, "q": query}
|
|
90
|
+
)
|
|
91
|
+
return response.json()
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Other search API options:
|
|
95
|
+
- Google Custom Search
|
|
96
|
+
- Bing Search API
|
|
97
|
+
- SerpAPI
|
|
98
|
+
- Tavily
|
|
99
|
+
|
|
100
|
+
### Add More Analysis Types
|
|
101
|
+
|
|
102
|
+
```python
|
|
103
|
+
def analyze_data(data: str, analysis_type: str = "summary") -> str:
|
|
104
|
+
"""Analyze data with different strategies."""
|
|
105
|
+
prompts = {
|
|
106
|
+
"summary": "Summarize this content:",
|
|
107
|
+
"sentiment": "Analyze the sentiment:",
|
|
108
|
+
"entities": "Extract key entities:",
|
|
109
|
+
"facts": "List key facts:",
|
|
110
|
+
}
|
|
111
|
+
prompt = prompts.get(analysis_type, prompts["summary"])
|
|
112
|
+
return llm_do(f"{prompt}\n\n{data}")
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Structured Output
|
|
116
|
+
|
|
117
|
+
```python
|
|
118
|
+
from typing import Dict, List
|
|
119
|
+
|
|
120
|
+
def save_research(topic: str, findings: str, filename: str = None) -> Dict:
|
|
121
|
+
"""Save research with structured metadata."""
|
|
122
|
+
research = {
|
|
123
|
+
"topic": topic,
|
|
124
|
+
"findings": findings,
|
|
125
|
+
"timestamp": datetime.now().isoformat(),
|
|
126
|
+
"sources": [], # Add source tracking
|
|
127
|
+
"tags": [], # Add categorization
|
|
128
|
+
}
|
|
129
|
+
# Save to JSON
|
|
130
|
+
return research
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Tips
|
|
134
|
+
|
|
135
|
+
- Add error handling for failed HTTP requests
|
|
136
|
+
- Implement rate limiting for API calls
|
|
137
|
+
- Cache results to avoid duplicate requests
|
|
138
|
+
- Track sources for citation
|
|
139
|
+
|
|
140
|
+
## Next Steps
|
|
141
|
+
|
|
142
|
+
- [Tools](../concepts/tools.md) - Add custom tools
|
|
143
|
+
- [llm_do](../concepts/llm_do.md) - One-shot LLM calls
|
|
144
|
+
- [Playwright Template](playwright.md) - For dynamic content
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# TUI Components
|
|
2
|
+
|
|
3
|
+
Terminal UI components for interactive agent interfaces.
|
|
4
|
+
|
|
5
|
+
## Quick Reference
|
|
6
|
+
|
|
7
|
+
| Component | Purpose | Import |
|
|
8
|
+
|-----------|---------|--------|
|
|
9
|
+
| [Chat](chat.md) | Full chat interface with agent | `from connectonion.tui import Chat` |
|
|
10
|
+
| [Input](input.md) | Text input with autocomplete | `from connectonion.tui import Input` |
|
|
11
|
+
| [pick](pick.md) | Single-select menu | `from connectonion.tui import pick` |
|
|
12
|
+
| [Dropdown](dropdown.md) | Dropdown menus | `from connectonion.tui import Dropdown` |
|
|
13
|
+
| [StatusBar](status_bar.md) | Powerline-style status | `from connectonion.tui import StatusBar` |
|
|
14
|
+
| [Footer](footer.md) | Footer with help text | `from connectonion.tui import Footer` |
|
|
15
|
+
| [Divider](divider.md) | Visual dividers | `from connectonion.tui import Divider` |
|
|
16
|
+
| [fuzzy](fuzzy.md) | Fuzzy matching | `from connectonion.tui import fuzzy_match` |
|
|
17
|
+
| [keys](keys.md) | Keyboard input | `from connectonion.tui import getch` |
|
|
18
|
+
| [providers](providers.md) | Autocomplete data sources | `from connectonion.tui import FileProvider` |
|
|
19
|
+
|
|
20
|
+
## Quick Start
|
|
21
|
+
|
|
22
|
+
```python
|
|
23
|
+
from connectonion import Agent
|
|
24
|
+
from connectonion.tui import Chat
|
|
25
|
+
|
|
26
|
+
# Create agent
|
|
27
|
+
agent = Agent("assistant", tools=[...])
|
|
28
|
+
|
|
29
|
+
# Launch chat interface
|
|
30
|
+
chat = Chat(
|
|
31
|
+
agent=agent,
|
|
32
|
+
title="My Assistant",
|
|
33
|
+
welcome="Hello! How can I help?",
|
|
34
|
+
hints=["/ commands", "Enter send", "Ctrl+D quit"],
|
|
35
|
+
)
|
|
36
|
+
chat.run()
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Customizing Components
|
|
40
|
+
|
|
41
|
+
Need to modify a TUI component? Copy it to your project:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# Copy Chat interface to ./tui/
|
|
45
|
+
co copy chat
|
|
46
|
+
|
|
47
|
+
# Copy other components
|
|
48
|
+
co copy chat fuzzy dropdown
|
|
49
|
+
|
|
50
|
+
# See all available
|
|
51
|
+
co copy --list
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Then import from your local copy:
|
|
55
|
+
|
|
56
|
+
```python
|
|
57
|
+
# Before (from package)
|
|
58
|
+
from connectonion.tui import Chat
|
|
59
|
+
|
|
60
|
+
# After (from your copy)
|
|
61
|
+
from tui.chat import Chat # Customize freely!
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Chat Features
|
|
65
|
+
|
|
66
|
+
The `Chat` component includes:
|
|
67
|
+
- **Status bar** - Agent name, status, model, tokens, cost
|
|
68
|
+
- **Message history** - Scrollable conversation
|
|
69
|
+
- **Thinking indicator** - Shows LLM thinking and tool calls
|
|
70
|
+
- **Autocomplete** - Trigger-based (/, @) command completion
|
|
71
|
+
- **Input locking** - Prevents multiple submissions
|
|
72
|
+
|
|
73
|
+
### Thinking Indicator
|
|
74
|
+
|
|
75
|
+
Shows real-time progress:
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
⠹ Thinking... 5s (usually 3-10s) # During LLM call
|
|
79
|
+
|
|
80
|
+
⠹ Search emails in inbox # During tool call
|
|
81
|
+
└─ search_emails("aaron")
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Architecture
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
User Input → TUI Component → Terminal (Rich/Textual) → User
|
|
88
|
+
↑ ↓
|
|
89
|
+
└──── Keyboard Events ────────┘
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Components use:
|
|
93
|
+
- **Textual** for full interactive apps (Chat)
|
|
94
|
+
- **Rich** for simple terminal rendering
|
|
95
|
+
- **Raw mode** for keyboard capture
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
# Chat
|
|
2
|
+
|
|
3
|
+
Full-featured terminal chat interface for AI agents.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
```python
|
|
8
|
+
from connectonion import Agent
|
|
9
|
+
from connectonion.tui import Chat
|
|
10
|
+
|
|
11
|
+
agent = Agent("assistant", tools=[search, analyze])
|
|
12
|
+
|
|
13
|
+
chat = Chat(agent=agent)
|
|
14
|
+
chat.run()
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pip install connectonion[tui]
|
|
21
|
+
# or
|
|
22
|
+
pip install textual textual-autocomplete
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Parameters
|
|
26
|
+
|
|
27
|
+
| Parameter | Type | Description |
|
|
28
|
+
|-----------|------|-------------|
|
|
29
|
+
| `agent` | Agent | ConnectOnion agent instance |
|
|
30
|
+
| `handler` | Callable | Custom message handler (alternative to agent) |
|
|
31
|
+
| `title` | str | Window title |
|
|
32
|
+
| `welcome` | str | Welcome message (markdown supported) |
|
|
33
|
+
| `hints` | list[str] | Footer hints like `["/ commands", "Enter send"]` |
|
|
34
|
+
| `triggers` | dict | Autocomplete triggers (see below) |
|
|
35
|
+
| `on_error` | Callable | Custom error handler |
|
|
36
|
+
|
|
37
|
+
## Autocomplete Triggers
|
|
38
|
+
|
|
39
|
+
Add command or mention autocomplete:
|
|
40
|
+
|
|
41
|
+
```python
|
|
42
|
+
from connectonion.tui import Chat, CommandItem
|
|
43
|
+
from textual_autocomplete import DropdownItem
|
|
44
|
+
|
|
45
|
+
chat = Chat(
|
|
46
|
+
agent=agent,
|
|
47
|
+
triggers={
|
|
48
|
+
"/": [
|
|
49
|
+
CommandItem(main="/help", prefix="?", id="/help"),
|
|
50
|
+
CommandItem(main="/clear", prefix="⌫", id="/clear"),
|
|
51
|
+
CommandItem(main="/quit", prefix="→", id="/quit"),
|
|
52
|
+
],
|
|
53
|
+
"@": [
|
|
54
|
+
DropdownItem(main="John", id="@john@example.com"),
|
|
55
|
+
DropdownItem(main="Jane", id="@jane@example.com"),
|
|
56
|
+
],
|
|
57
|
+
}
|
|
58
|
+
)
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Custom Commands
|
|
62
|
+
|
|
63
|
+
Register slash command handlers:
|
|
64
|
+
|
|
65
|
+
```python
|
|
66
|
+
chat = Chat(agent=agent)
|
|
67
|
+
|
|
68
|
+
@chat.command("/help")
|
|
69
|
+
def show_help(text):
|
|
70
|
+
return "Available commands: /help, /clear, /quit"
|
|
71
|
+
|
|
72
|
+
@chat.command("/clear")
|
|
73
|
+
def clear_chat(text):
|
|
74
|
+
# Clear logic
|
|
75
|
+
return "Chat cleared"
|
|
76
|
+
|
|
77
|
+
chat.run()
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Status Bar
|
|
81
|
+
|
|
82
|
+
Shows real-time information:
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
🤖 Assistant ◐ Thinking (1/10) co/gpt-4 1,234 tok $0.0012
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
- **Left**: Agent name
|
|
89
|
+
- **Center**: Current status with iteration
|
|
90
|
+
- **Right**: Model, token count, cost
|
|
91
|
+
|
|
92
|
+
## Thinking Indicator
|
|
93
|
+
|
|
94
|
+
Visual feedback during processing:
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
⠹ Thinking... 5s (usually 3-10s)
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
During tool execution:
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
⠹ Search emails in inbox
|
|
104
|
+
└─ search_emails("aaron")
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Shows:
|
|
108
|
+
- Description (what's happening)
|
|
109
|
+
- Function call (technical detail)
|
|
110
|
+
|
|
111
|
+
## Customizing
|
|
112
|
+
|
|
113
|
+
Copy and modify:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
co copy chat
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Then edit `./tui/chat.py`:
|
|
120
|
+
|
|
121
|
+
```python
|
|
122
|
+
from tui.chat import Chat, ThinkingIndicator
|
|
123
|
+
|
|
124
|
+
# Customize ThinkingIndicator
|
|
125
|
+
class MyThinkingIndicator(ThinkingIndicator):
|
|
126
|
+
frames = ["◐", "◓", "◑", "◒"] # Custom spinner
|
|
127
|
+
|
|
128
|
+
# Use in your Chat subclass
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Example: Gmail Agent
|
|
132
|
+
|
|
133
|
+
```python
|
|
134
|
+
from connectonion import Agent
|
|
135
|
+
from connectonion.tui import Chat, CommandItem
|
|
136
|
+
from connectonion.useful_tools import Gmail
|
|
137
|
+
|
|
138
|
+
gmail = Gmail()
|
|
139
|
+
agent = Agent("gmail-agent", tools=[gmail])
|
|
140
|
+
|
|
141
|
+
chat = Chat(
|
|
142
|
+
agent=agent,
|
|
143
|
+
title="Gmail Agent",
|
|
144
|
+
welcome="**Gmail Assistant**\n\nI can search, read, and send emails.",
|
|
145
|
+
hints=["/ commands", "@ mentions", "Enter send"],
|
|
146
|
+
triggers={
|
|
147
|
+
"/": [
|
|
148
|
+
CommandItem(main="/inbox", prefix="📥", id="/inbox"),
|
|
149
|
+
CommandItem(main="/sent", prefix="📤", id="/sent"),
|
|
150
|
+
CommandItem(main="/compose", prefix="✏️", id="/compose"),
|
|
151
|
+
]
|
|
152
|
+
}
|
|
153
|
+
)
|
|
154
|
+
|
|
155
|
+
chat.run()
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Widgets
|
|
159
|
+
|
|
160
|
+
Chat includes these widgets (all exported):
|
|
161
|
+
|
|
162
|
+
| Widget | Purpose |
|
|
163
|
+
|--------|---------|
|
|
164
|
+
| `ChatStatusBar` | Top status bar |
|
|
165
|
+
| `HintsFooter` | Bottom hints |
|
|
166
|
+
| `WelcomeMessage` | Initial welcome |
|
|
167
|
+
| `UserMessage` | User message bubble |
|
|
168
|
+
| `AssistantMessage` | Agent response |
|
|
169
|
+
| `ThinkingIndicator` | Processing animation |
|
|
170
|
+
| `TriggerAutoComplete` | Trigger-based autocomplete |
|
|
171
|
+
|
|
172
|
+
Import individually:
|
|
173
|
+
|
|
174
|
+
```python
|
|
175
|
+
from connectonion.tui import (
|
|
176
|
+
Chat,
|
|
177
|
+
ChatStatusBar,
|
|
178
|
+
ThinkingIndicator,
|
|
179
|
+
TriggerAutoComplete,
|
|
180
|
+
)
|
|
181
|
+
```
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Divider
|
|
2
|
+
|
|
3
|
+
Simple horizontal line separator.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
```python
|
|
8
|
+
from connectonion.tui import Divider
|
|
9
|
+
from rich.console import Console
|
|
10
|
+
|
|
11
|
+
console = Console()
|
|
12
|
+
|
|
13
|
+
divider = Divider()
|
|
14
|
+
console.print(divider.render())
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Output
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
────────────────────────────────────────
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Configuration
|
|
24
|
+
|
|
25
|
+
```python
|
|
26
|
+
# Custom width
|
|
27
|
+
divider = Divider(width=20)
|
|
28
|
+
|
|
29
|
+
# Custom character
|
|
30
|
+
divider = Divider(char="═")
|
|
31
|
+
|
|
32
|
+
# Custom style
|
|
33
|
+
divider = Divider(style="bold cyan")
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## API
|
|
37
|
+
|
|
38
|
+
```python
|
|
39
|
+
Divider(
|
|
40
|
+
width: int = 40,
|
|
41
|
+
char: str = "─",
|
|
42
|
+
style: str = "dim",
|
|
43
|
+
)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Methods
|
|
47
|
+
|
|
48
|
+
```python
|
|
49
|
+
divider.render() -> Text # Returns Rich Text object
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Usage Example
|
|
53
|
+
|
|
54
|
+
```python
|
|
55
|
+
from connectonion.tui import Divider, StatusBar
|
|
56
|
+
from rich.console import Console
|
|
57
|
+
|
|
58
|
+
console = Console()
|
|
59
|
+
|
|
60
|
+
console.print(Divider().render())
|
|
61
|
+
console.print(StatusBar([("🤖", "gpt-4", "magenta")]).render())
|
|
62
|
+
console.print(Divider().render())
|
|
63
|
+
```
|