connectonion 0.6.1__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 +95 -142
- connectonion/cli/browser_agent/element_finder.py +147 -0
- connectonion/cli/browser_agent/highlight_screenshot.py +182 -0
- connectonion/cli/browser_agent/prompt.md +188 -105
- connectonion/cli/browser_agent/prompts/element_matcher.md +59 -0
- connectonion/cli/browser_agent/prompts/form_filler.md +19 -0
- connectonion/cli/browser_agent/prompts/scroll_strategy.md +36 -0
- connectonion/cli/browser_agent/scripts/extract_elements.js +126 -0
- connectonion/cli/browser_agent/scroll.py +145 -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.1.dist-info → connectonion-0.6.3.dist-info}/METADATA +10 -3
- connectonion-0.6.3.dist-info/RECORD +469 -0
- connectonion/cli/browser_agent/scroll_strategies.py +0 -276
- connectonion/network/asgi.py +0 -407
- connectonion/network/host.py +0 -616
- connectonion/network/trust.py +0 -166
- connectonion-0.6.1.dist-info/RECORD +0 -123
- /connectonion/cli/{docs → co_ai/prompts/connectonion}/connectonion.md +0 -0
- {connectonion-0.6.1.dist-info → connectonion-0.6.3.dist-info}/WHEEL +0 -0
- {connectonion-0.6.1.dist-info → connectonion-0.6.3.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,571 @@
|
|
|
1
|
+
# Migration Strategy
|
|
2
|
+
|
|
3
|
+
Seamless transition from existing agent frameworks to ConnectOnion's behavior-based approach.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
Moving to ConnectOnion doesn't require abandoning your existing code. We provide progressive migration paths from popular frameworks, letting you adopt behavioral agents at your own pace.
|
|
8
|
+
|
|
9
|
+
## Migration Principles
|
|
10
|
+
|
|
11
|
+
1. **No Big Bang** - Gradual adoption, one agent at a time
|
|
12
|
+
2. **Preserve Investment** - Existing code continues to work
|
|
13
|
+
3. **Immediate Value** - Benefits from day one
|
|
14
|
+
4. **Easy Rollback** - Can revert if needed
|
|
15
|
+
|
|
16
|
+
## From OpenAI Function Calling
|
|
17
|
+
|
|
18
|
+
### Current Approach
|
|
19
|
+
```python
|
|
20
|
+
# Traditional OpenAI function calling
|
|
21
|
+
def get_weather(location: str, unit: str = "celsius"):
|
|
22
|
+
"""Get the current weather in a given location"""
|
|
23
|
+
# Implementation
|
|
24
|
+
return weather_data
|
|
25
|
+
|
|
26
|
+
functions = [
|
|
27
|
+
{
|
|
28
|
+
"name": "get_weather",
|
|
29
|
+
"description": "Get the current weather in a given location",
|
|
30
|
+
"parameters": {
|
|
31
|
+
"type": "object",
|
|
32
|
+
"properties": {
|
|
33
|
+
"location": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"description": "The city and state"
|
|
36
|
+
},
|
|
37
|
+
"unit": {"type": "string", "enum": ["celsius", "fahrenheit"]}
|
|
38
|
+
},
|
|
39
|
+
"required": ["location"]
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
|
|
44
|
+
response = openai.ChatCompletion.create(
|
|
45
|
+
model="gpt-3.5-turbo",
|
|
46
|
+
messages=messages,
|
|
47
|
+
functions=functions
|
|
48
|
+
)
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Migration Step 1: Wrap Existing Functions
|
|
52
|
+
```python
|
|
53
|
+
from connectonion import Agent
|
|
54
|
+
|
|
55
|
+
# Your existing function stays the same
|
|
56
|
+
def get_weather(location: str, unit: str = "celsius"):
|
|
57
|
+
"""Get the current weather in a given location"""
|
|
58
|
+
# Existing implementation unchanged
|
|
59
|
+
return weather_data
|
|
60
|
+
|
|
61
|
+
# Create agent with your function
|
|
62
|
+
weather_agent = Agent(
|
|
63
|
+
name="weather_service",
|
|
64
|
+
tools=[get_weather] # Auto-converts to behavioral agent
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
# Use it the same way
|
|
68
|
+
result = weather_agent.input("What's the weather in Paris?")
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Migration Step 2: Make Discoverable
|
|
72
|
+
```python
|
|
73
|
+
from connectonion import agent
|
|
74
|
+
|
|
75
|
+
# Add decorator to make discoverable
|
|
76
|
+
@agent(port=8001)
|
|
77
|
+
def get_weather(location: str, unit: str = "celsius"):
|
|
78
|
+
"""Get the current weather in a given location"""
|
|
79
|
+
# Same implementation
|
|
80
|
+
return weather_data
|
|
81
|
+
|
|
82
|
+
# Now other agents can discover and use it
|
|
83
|
+
weather = discover("weather information")
|
|
84
|
+
result = weather("Paris", "celsius")
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Migration Step 3: Remove OpenAI Dependency
|
|
88
|
+
```python
|
|
89
|
+
# Before: Tied to OpenAI
|
|
90
|
+
response = openai.ChatCompletion.create(...)
|
|
91
|
+
|
|
92
|
+
# After: Any LLM backend
|
|
93
|
+
agent = Agent(
|
|
94
|
+
name="assistant",
|
|
95
|
+
llm=YourPreferredLLM(), # Or defaults to OpenAI
|
|
96
|
+
tools=[...]
|
|
97
|
+
)
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## From LangChain
|
|
101
|
+
|
|
102
|
+
### Current Approach
|
|
103
|
+
```python
|
|
104
|
+
from langchain import LLMChain, PromptTemplate
|
|
105
|
+
from langchain.agents import Tool, AgentExecutor
|
|
106
|
+
|
|
107
|
+
# Complex chain setup
|
|
108
|
+
tools = [
|
|
109
|
+
Tool(
|
|
110
|
+
name="Search",
|
|
111
|
+
func=search.run,
|
|
112
|
+
description="Search for information"
|
|
113
|
+
),
|
|
114
|
+
Tool(
|
|
115
|
+
name="Calculator",
|
|
116
|
+
func=calculator.run,
|
|
117
|
+
description="Perform calculations"
|
|
118
|
+
)
|
|
119
|
+
]
|
|
120
|
+
|
|
121
|
+
agent = initialize_agent(
|
|
122
|
+
tools,
|
|
123
|
+
llm,
|
|
124
|
+
agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
result = agent.input("Search for Python tutorials and calculate 25 * 4")
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Migration Step 1: Convert Tools
|
|
131
|
+
```python
|
|
132
|
+
from connectonion import Agent
|
|
133
|
+
|
|
134
|
+
# Convert LangChain tools to functions
|
|
135
|
+
def search(query: str) -> str:
|
|
136
|
+
"""Search for information"""
|
|
137
|
+
return search_engine.run(query)
|
|
138
|
+
|
|
139
|
+
def calculate(expression: str) -> float:
|
|
140
|
+
"""Perform calculations"""
|
|
141
|
+
return calculator.run(expression)
|
|
142
|
+
|
|
143
|
+
# Create ConnectOnion agent
|
|
144
|
+
agent = Agent(
|
|
145
|
+
name="research_assistant",
|
|
146
|
+
tools=[search, calculate]
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
result = agent.input("Search for Python tutorials and calculate 25 * 4")
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Migration Step 2: Simplify Chains
|
|
153
|
+
```python
|
|
154
|
+
# Before: Complex chain orchestration
|
|
155
|
+
chain = LLMChain(
|
|
156
|
+
llm=llm,
|
|
157
|
+
prompt=prompt,
|
|
158
|
+
output_parser=parser
|
|
159
|
+
) | RunnablePassthrough() | another_chain
|
|
160
|
+
|
|
161
|
+
# After: Simple function composition
|
|
162
|
+
@agent
|
|
163
|
+
def research_chain(topic: str) -> str:
|
|
164
|
+
"""Research a topic comprehensively"""
|
|
165
|
+
|
|
166
|
+
# Each step is just a function call
|
|
167
|
+
search_results = search(topic)
|
|
168
|
+
summary = summarize(search_results)
|
|
169
|
+
analysis = analyze(summary)
|
|
170
|
+
|
|
171
|
+
return format_report(analysis)
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Migration Step 3: Distributed Chains
|
|
175
|
+
```python
|
|
176
|
+
# Before: Chains run in single process
|
|
177
|
+
chain = SequentialChain(chains=[chain1, chain2, chain3])
|
|
178
|
+
|
|
179
|
+
# After: Chains can run distributed
|
|
180
|
+
@agent
|
|
181
|
+
def distributed_pipeline(data: str) -> str:
|
|
182
|
+
"""Process data through distributed pipeline"""
|
|
183
|
+
|
|
184
|
+
# Each step can run on different machines
|
|
185
|
+
step1 = discover("preprocessing")
|
|
186
|
+
step2 = discover("analysis")
|
|
187
|
+
step3 = discover("reporting")
|
|
188
|
+
|
|
189
|
+
return step3(step2(step1(data)))
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
## From AutoGPT/BabyAGI
|
|
193
|
+
|
|
194
|
+
### Current Approach
|
|
195
|
+
```python
|
|
196
|
+
# Autonomous agent with complex orchestration
|
|
197
|
+
class AutonomousAgent:
|
|
198
|
+
def __init__(self):
|
|
199
|
+
self.memory = LongTermMemory()
|
|
200
|
+
self.tools = ToolRegistry()
|
|
201
|
+
self.planner = TaskPlanner()
|
|
202
|
+
|
|
203
|
+
def run(self, objective):
|
|
204
|
+
tasks = self.planner.decompose(objective)
|
|
205
|
+
for task in tasks:
|
|
206
|
+
tool = self.select_tool(task)
|
|
207
|
+
result = tool.execute(task)
|
|
208
|
+
self.memory.store(result)
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### Migration Step 1: Behavioral Decomposition
|
|
212
|
+
```python
|
|
213
|
+
from connectonion import agent
|
|
214
|
+
|
|
215
|
+
# Break into behavioral agents
|
|
216
|
+
@agent
|
|
217
|
+
def task_planner(objective: str) -> list:
|
|
218
|
+
"""Decompose objective into tasks"""
|
|
219
|
+
return task_list
|
|
220
|
+
|
|
221
|
+
@agent
|
|
222
|
+
def task_executor(task: str) -> str:
|
|
223
|
+
"""Execute a single task"""
|
|
224
|
+
tool = discover(task.required_capability)
|
|
225
|
+
return tool(task.parameters)
|
|
226
|
+
|
|
227
|
+
@agent
|
|
228
|
+
def autonomous_agent(objective: str) -> str:
|
|
229
|
+
"""Autonomous agent using behavioral composition"""
|
|
230
|
+
|
|
231
|
+
tasks = task_planner(objective)
|
|
232
|
+
results = []
|
|
233
|
+
|
|
234
|
+
for task in tasks:
|
|
235
|
+
result = task_executor(task)
|
|
236
|
+
results.append(result)
|
|
237
|
+
|
|
238
|
+
# Store in behavioral history automatically
|
|
239
|
+
# No explicit memory management needed
|
|
240
|
+
|
|
241
|
+
return synthesize_results(results)
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### Migration Step 2: Dynamic Tool Discovery
|
|
245
|
+
```python
|
|
246
|
+
# Before: Static tool registry
|
|
247
|
+
self.tools = {
|
|
248
|
+
"search": SearchTool(),
|
|
249
|
+
"calculate": CalculatorTool(),
|
|
250
|
+
# ... fixed set of tools
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
# After: Dynamic behavioral discovery
|
|
254
|
+
@agent
|
|
255
|
+
def adaptive_executor(task: str) -> str:
|
|
256
|
+
"""Execute task by discovering capable agents"""
|
|
257
|
+
|
|
258
|
+
# Understand what's needed
|
|
259
|
+
capability = extract_required_capability(task)
|
|
260
|
+
|
|
261
|
+
# Discover agents that can help
|
|
262
|
+
capable_agents = discover_all(capability)
|
|
263
|
+
|
|
264
|
+
# Try until success
|
|
265
|
+
for agent in capable_agents:
|
|
266
|
+
try:
|
|
267
|
+
return agent(task)
|
|
268
|
+
except:
|
|
269
|
+
continue # Natural failover
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
## From Custom Frameworks
|
|
273
|
+
|
|
274
|
+
### Step 1: Identify Core Functions
|
|
275
|
+
```python
|
|
276
|
+
# Your custom framework
|
|
277
|
+
class MyCustomAgent:
|
|
278
|
+
def process_text(self, text):
|
|
279
|
+
# Complex processing logic
|
|
280
|
+
return processed
|
|
281
|
+
|
|
282
|
+
def analyze_data(self, data):
|
|
283
|
+
# Analysis logic
|
|
284
|
+
return results
|
|
285
|
+
|
|
286
|
+
# Extract as standalone functions
|
|
287
|
+
def process_text(text: str) -> str:
|
|
288
|
+
"""Process text"""
|
|
289
|
+
# Same logic
|
|
290
|
+
return processed
|
|
291
|
+
|
|
292
|
+
def analyze_data(data: dict) -> dict:
|
|
293
|
+
"""Analyze data"""
|
|
294
|
+
# Same logic
|
|
295
|
+
return results
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
### Step 2: Add Behavioral Layer
|
|
299
|
+
```python
|
|
300
|
+
from connectonion import Agent
|
|
301
|
+
|
|
302
|
+
# Wrap in ConnectOnion agent
|
|
303
|
+
agent = Agent(
|
|
304
|
+
name="custom_processor",
|
|
305
|
+
tools=[process_text, analyze_data],
|
|
306
|
+
system_prompt="You are a specialized processor"
|
|
307
|
+
)
|
|
308
|
+
|
|
309
|
+
# Or make individual functions discoverable
|
|
310
|
+
@agent
|
|
311
|
+
def process_text(text: str) -> str:
|
|
312
|
+
"""Process text"""
|
|
313
|
+
return processed
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
### Step 3: Enable Discovery
|
|
317
|
+
```python
|
|
318
|
+
# Before: Hard-coded integrations
|
|
319
|
+
processor = MyCustomAgent()
|
|
320
|
+
analyzer = MyAnalyzer()
|
|
321
|
+
result = analyzer.analyze(processor.process(data))
|
|
322
|
+
|
|
323
|
+
# After: Dynamic discovery
|
|
324
|
+
processor = discover("text processing")
|
|
325
|
+
analyzer = discover("data analysis")
|
|
326
|
+
result = analyzer(processor(data))
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
## Hybrid Approach
|
|
330
|
+
|
|
331
|
+
### Running Both Systems
|
|
332
|
+
```python
|
|
333
|
+
# Use ConnectOnion alongside existing framework
|
|
334
|
+
class HybridSystem:
|
|
335
|
+
def __init__(self):
|
|
336
|
+
# Keep existing system
|
|
337
|
+
self.legacy_agent = LegacyAgent()
|
|
338
|
+
|
|
339
|
+
# Add ConnectOnion agents
|
|
340
|
+
self.behavior_agent = Agent(
|
|
341
|
+
name="enhancer",
|
|
342
|
+
tools=[self.enhance_results]
|
|
343
|
+
)
|
|
344
|
+
|
|
345
|
+
def process(self, request):
|
|
346
|
+
# Use legacy for main processing
|
|
347
|
+
result = self.legacy_agent.process(request)
|
|
348
|
+
|
|
349
|
+
# Enhance with behavioral agent
|
|
350
|
+
enhanced = self.behavior_agent.input(
|
|
351
|
+
f"Improve this result: {result}"
|
|
352
|
+
)
|
|
353
|
+
|
|
354
|
+
return enhanced
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
### Gradual Migration
|
|
358
|
+
```python
|
|
359
|
+
# Phase 1: New features use ConnectOnion
|
|
360
|
+
@agent
|
|
361
|
+
def new_feature(data: str) -> str:
|
|
362
|
+
"""New capability built with ConnectOnion"""
|
|
363
|
+
return process_new_way(data)
|
|
364
|
+
|
|
365
|
+
# Phase 2: Migrate high-value functions
|
|
366
|
+
@agent
|
|
367
|
+
def critical_function(params: dict) -> dict:
|
|
368
|
+
"""Migrated from legacy system"""
|
|
369
|
+
# Reuse existing logic
|
|
370
|
+
return legacy.critical_function(**params)
|
|
371
|
+
|
|
372
|
+
# Phase 3: Replace orchestration layer
|
|
373
|
+
@agent
|
|
374
|
+
def orchestrator(task: str) -> str:
|
|
375
|
+
"""New orchestrator using behavioral discovery"""
|
|
376
|
+
|
|
377
|
+
# Mix of legacy and new
|
|
378
|
+
if "legacy" in task:
|
|
379
|
+
return legacy_system.handle(task)
|
|
380
|
+
else:
|
|
381
|
+
handler = discover(task.type)
|
|
382
|
+
return handler(task)
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
## Migration Tools
|
|
386
|
+
|
|
387
|
+
### Automatic Conversion
|
|
388
|
+
```python
|
|
389
|
+
from connectonion.migrate import convert_langchain
|
|
390
|
+
|
|
391
|
+
# Convert LangChain agent
|
|
392
|
+
langchain_agent = create_langchain_agent(tools, llm)
|
|
393
|
+
connectonion_agent = convert_langchain(langchain_agent)
|
|
394
|
+
|
|
395
|
+
# Now works with behavioral discovery
|
|
396
|
+
result = connectonion_agent.input("Do something")
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
### Compatibility Wrappers
|
|
400
|
+
```python
|
|
401
|
+
from connectonion.compat import openai_function
|
|
402
|
+
|
|
403
|
+
# Make ConnectOnion agent work like OpenAI function
|
|
404
|
+
@agent
|
|
405
|
+
def my_agent_function(param: str) -> str:
|
|
406
|
+
"""My agent logic"""
|
|
407
|
+
return result
|
|
408
|
+
|
|
409
|
+
# Get OpenAI-compatible function definition
|
|
410
|
+
openai_func = openai_function(my_agent_function)
|
|
411
|
+
# Returns: {"name": "my_agent_function", "parameters": {...}}
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
### Testing During Migration
|
|
415
|
+
```python
|
|
416
|
+
import pytest
|
|
417
|
+
from connectonion.testing import behavior_test
|
|
418
|
+
|
|
419
|
+
@behavior_test
|
|
420
|
+
def test_migration_compatibility():
|
|
421
|
+
"""Ensure migrated function behaves identically"""
|
|
422
|
+
|
|
423
|
+
# Test legacy
|
|
424
|
+
legacy_result = legacy_function(test_input)
|
|
425
|
+
|
|
426
|
+
# Test migrated
|
|
427
|
+
migrated = convert_to_agent(legacy_function)
|
|
428
|
+
new_result = migrated(test_input)
|
|
429
|
+
|
|
430
|
+
assert new_result == legacy_result
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
## Common Patterns
|
|
434
|
+
|
|
435
|
+
### Pattern 1: Tool Registry → Discovery
|
|
436
|
+
```python
|
|
437
|
+
# Before
|
|
438
|
+
tools = ToolRegistry()
|
|
439
|
+
tools.register("search", SearchTool())
|
|
440
|
+
tool = tools.get("search")
|
|
441
|
+
|
|
442
|
+
# After
|
|
443
|
+
tool = discover("search") # Finds any search-capable agent
|
|
444
|
+
```
|
|
445
|
+
|
|
446
|
+
### Pattern 2: Fixed Pipeline → Dynamic Composition
|
|
447
|
+
```python
|
|
448
|
+
# Before
|
|
449
|
+
pipeline = [step1, step2, step3]
|
|
450
|
+
result = run_pipeline(data, pipeline)
|
|
451
|
+
|
|
452
|
+
# After
|
|
453
|
+
@agent
|
|
454
|
+
def dynamic_pipeline(data: str) -> str:
|
|
455
|
+
steps = discover_pipeline_for(data)
|
|
456
|
+
return compose(steps)(data)
|
|
457
|
+
```
|
|
458
|
+
|
|
459
|
+
### Pattern 3: Central Orchestrator → Peer-to-Peer
|
|
460
|
+
```python
|
|
461
|
+
# Before
|
|
462
|
+
orchestrator.assign_task(agent1, task1)
|
|
463
|
+
orchestrator.assign_task(agent2, task2)
|
|
464
|
+
results = orchestrator.collect_results()
|
|
465
|
+
|
|
466
|
+
# After
|
|
467
|
+
@agent
|
|
468
|
+
def peer_coordinator(tasks: list) -> list:
|
|
469
|
+
# Agents find each other
|
|
470
|
+
results = []
|
|
471
|
+
for task in tasks:
|
|
472
|
+
capable_peer = discover(task.requirement)
|
|
473
|
+
results.append(capable_peer(task))
|
|
474
|
+
return results
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
## Best Practices
|
|
478
|
+
|
|
479
|
+
### 1. Start Small
|
|
480
|
+
- Migrate one function at a time
|
|
481
|
+
- Test thoroughly before expanding
|
|
482
|
+
- Keep fallback to legacy system
|
|
483
|
+
|
|
484
|
+
### 2. Preserve Interfaces
|
|
485
|
+
- Keep same function signatures
|
|
486
|
+
- Return compatible data types
|
|
487
|
+
- Maintain error handling
|
|
488
|
+
|
|
489
|
+
### 3. Monitor Performance
|
|
490
|
+
```python
|
|
491
|
+
from connectonion.monitoring import migration_metrics
|
|
492
|
+
|
|
493
|
+
@migration_metrics
|
|
494
|
+
def migrated_function(data):
|
|
495
|
+
"""Track performance vs legacy"""
|
|
496
|
+
return new_implementation(data)
|
|
497
|
+
```
|
|
498
|
+
|
|
499
|
+
### 4. Document Behaviors
|
|
500
|
+
```python
|
|
501
|
+
@agent
|
|
502
|
+
def migrated_tool(query: str) -> str:
|
|
503
|
+
"""
|
|
504
|
+
Search tool migrated from LangChain.
|
|
505
|
+
|
|
506
|
+
Behavioral profile:
|
|
507
|
+
- Accepts: Natural language queries
|
|
508
|
+
- Returns: Relevant search results
|
|
509
|
+
- Avg response: 200ms
|
|
510
|
+
- Trust score: 0.95
|
|
511
|
+
"""
|
|
512
|
+
return search_implementation(query)
|
|
513
|
+
```
|
|
514
|
+
|
|
515
|
+
## Migration Timeline
|
|
516
|
+
|
|
517
|
+
### Week 1-2: Evaluation
|
|
518
|
+
- Identify high-value functions to migrate
|
|
519
|
+
- Set up ConnectOnion alongside existing system
|
|
520
|
+
- Create proof of concept with one function
|
|
521
|
+
|
|
522
|
+
### Week 3-4: Pilot
|
|
523
|
+
- Migrate 5-10 functions
|
|
524
|
+
- Set up behavioral discovery
|
|
525
|
+
- Run in parallel with legacy system
|
|
526
|
+
|
|
527
|
+
### Month 2: Expansion
|
|
528
|
+
- Migrate 25% of functions
|
|
529
|
+
- Enable agent-to-agent discovery
|
|
530
|
+
- Monitor behavioral metrics
|
|
531
|
+
|
|
532
|
+
### Month 3: Integration
|
|
533
|
+
- Migrate 50% of functions
|
|
534
|
+
- Replace orchestration layer
|
|
535
|
+
- Enable full behavioral routing
|
|
536
|
+
|
|
537
|
+
### Month 4+: Optimization
|
|
538
|
+
- Complete migration of suitable functions
|
|
539
|
+
- Optimize behavioral patterns
|
|
540
|
+
- Decommission legacy components
|
|
541
|
+
|
|
542
|
+
## Rollback Strategy
|
|
543
|
+
|
|
544
|
+
```python
|
|
545
|
+
from connectonion.migration import rollback_manager
|
|
546
|
+
|
|
547
|
+
# Enable rollback tracking
|
|
548
|
+
with rollback_manager() as rm:
|
|
549
|
+
# Migrate function
|
|
550
|
+
rm.track(old_function, new_function)
|
|
551
|
+
|
|
552
|
+
# If issues arise
|
|
553
|
+
if performance_degraded():
|
|
554
|
+
rm.rollback() # Reverts to old_function
|
|
555
|
+
```
|
|
556
|
+
|
|
557
|
+
## Success Metrics
|
|
558
|
+
|
|
559
|
+
Track these during migration:
|
|
560
|
+
|
|
561
|
+
1. **Function Coverage** - % of functions migrated
|
|
562
|
+
2. **Discovery Success** - % of discoveries that find suitable agents
|
|
563
|
+
3. **Performance Delta** - Response time comparison
|
|
564
|
+
4. **Error Rate** - Failures vs legacy system
|
|
565
|
+
5. **Developer Velocity** - Speed of adding new capabilities
|
|
566
|
+
|
|
567
|
+
## Conclusion
|
|
568
|
+
|
|
569
|
+
Migration to ConnectOnion is not a risky rewrite but a progressive enhancement. Start with one function, see the benefits of behavioral discovery, and expand at your own pace. Your existing code continues to work while gaining new superpowers.
|
|
570
|
+
|
|
571
|
+
The journey from identity-based to behavior-based agents begins with a single function.
|