connectonion 0.6.2__py3-none-any.whl → 0.6.4__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 +5 -0
- connectonion/cli/co_ai/plugins/system_reminder.py +154 -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/summarization.md +55 -0
- connectonion/cli/co_ai/prompts/system-reminders/agent.md +23 -0
- connectonion/cli/co_ai/prompts/system-reminders/plan_mode.md +13 -0
- connectonion/cli/co_ai/prompts/system-reminders/security.md +14 -0
- connectonion/cli/co_ai/prompts/system-reminders/simplicity.md +14 -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/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 +169 -0
- connectonion/cli/co_ai/tools/read.py +61 -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 +101 -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_plugins/tool_approval.md +139 -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 +3 -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/tool_approval.py +233 -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.4.dist-info}/METADATA +10 -3
- connectonion-0.6.4.dist-info/RECORD +472 -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.4.dist-info}/WHEEL +0 -0
- {connectonion-0.6.2.dist-info → connectonion-0.6.4.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,503 @@
|
|
|
1
|
+
# The Architecture of Trust: Designing ConnectOnion's Network Layer
|
|
2
|
+
|
|
3
|
+
*December 2025*
|
|
4
|
+
|
|
5
|
+
Every complex system we build eventually teaches us the same lesson: we should have made it simpler. This is the story of how we designed ConnectOnion's trust and network architecture—the wrong turns, the breakthroughs, and what we learned about building systems that are both powerful and usable.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Part I: The Problem
|
|
10
|
+
|
|
11
|
+
We had a trust system that couldn't enforce anything.
|
|
12
|
+
|
|
13
|
+
Three levels—`open`, `careful`, `strict`. Whitelists stored in `~/.connectonion/trusted.txt`. Trust agents that could verify capabilities. Natural language policies. It looked sophisticated.
|
|
14
|
+
|
|
15
|
+
But when an agent passed verification, it got full access. There was no sandbox. No resource limits. No actual enforcement. Our trust system asked "who should I trust?" but never answered "what happens when trust is violated?"
|
|
16
|
+
|
|
17
|
+
Meanwhile, our threat model identified three high-priority attacks:
|
|
18
|
+
|
|
19
|
+
1. **Capability Fraud**: Agents claiming they use GPT-4 but actually using GPT-3.5
|
|
20
|
+
2. **Data Harvesting**: "Free" services that collect and sell your data
|
|
21
|
+
3. **Cost Manipulation**: Malicious tasks that drain your token budget
|
|
22
|
+
|
|
23
|
+
All three require enforcement, not just verification. We needed to add teeth.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Part II: Trust Is Not One Thing
|
|
28
|
+
|
|
29
|
+
The first insight came from mapping out who asks what, when:
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
OUTBOUND TRUST (you're sending a task)
|
|
33
|
+
├── Question: "Should I send my data to this agent?"
|
|
34
|
+
├── Concerns: Data leakage, overcharging, capability fraud
|
|
35
|
+
└── Example: Sending confidential documents for translation
|
|
36
|
+
|
|
37
|
+
INBOUND TRUST (you're receiving a task)
|
|
38
|
+
├── Question: "Should I accept this task? With what limits?"
|
|
39
|
+
├── Concerns: Resource drain, prompt injection, abuse
|
|
40
|
+
└── Example: Unknown agent asking you to process large data
|
|
41
|
+
|
|
42
|
+
EXECUTION TRUST (you're running a task)
|
|
43
|
+
├── Question: "What can this code actually do on my machine?"
|
|
44
|
+
├── Concerns: System access, network calls, file operations
|
|
45
|
+
└── Example: Running a tool that might make external API calls
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Each direction has different risks and needs different policies. An inbound policy might say "reject large tasks from strangers." An outbound policy might say "don't send financial data to unverified agents." An execution policy might say "no network access for this task."
|
|
49
|
+
|
|
50
|
+
We initially designed three separate trust agents. Then four, when we added a Communication Agent for routing. Each was elegant in isolation. Together, they were a nightmare to explain.
|
|
51
|
+
|
|
52
|
+
**Lesson learned**: Comprehensiveness is the enemy of usability. Users don't want to understand four agents to use one feature.
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Part III: Where Should Trust Decisions Happen?
|
|
57
|
+
|
|
58
|
+
We debated three architectures:
|
|
59
|
+
|
|
60
|
+
**Centralized (Server-Client)**
|
|
61
|
+
```
|
|
62
|
+
┌─────────────────┐
|
|
63
|
+
│ Trust Server │ ← Central authority
|
|
64
|
+
└────────┬────────┘
|
|
65
|
+
│
|
|
66
|
+
┌────┴────┐
|
|
67
|
+
▼ ▼
|
|
68
|
+
Agent A Agent B ← Agents query server
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
A server maintains global reputation. Revocation is instant. Cold start is easy—the server bootstraps new agents.
|
|
72
|
+
|
|
73
|
+
But: single point of failure. Privacy concerns (server sees all queries). Doesn't work offline. Creates dependency.
|
|
74
|
+
|
|
75
|
+
**Decentralized (Client-Side Only)**
|
|
76
|
+
```
|
|
77
|
+
┌─────────────┐ ┌─────────────┐
|
|
78
|
+
│ Agent A │ │ Agent B │
|
|
79
|
+
│ │ │ │
|
|
80
|
+
│ whitelist │ │ whitelist │
|
|
81
|
+
│ blacklist │ │ blacklist │
|
|
82
|
+
│ contacts │ │ contacts │
|
|
83
|
+
└─────────────┘ └─────────────┘
|
|
84
|
+
↑ ↑
|
|
85
|
+
└── No connection ──────┘
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Full privacy. Works offline. No dependencies.
|
|
89
|
+
|
|
90
|
+
But: cold start problem. When you know no one, how do you start? No shared learning across the network.
|
|
91
|
+
|
|
92
|
+
**Peer-to-Peer (Behavioral)**
|
|
93
|
+
```
|
|
94
|
+
┌─────────────┐ ◄──── 47 successful tasks ────► ┌─────────────┐
|
|
95
|
+
│ Agent A │ │ Agent B │
|
|
96
|
+
│ │ ◄──── Trust: 0.95 ───────────── │ │
|
|
97
|
+
│ contacts: │ │ contacts: │
|
|
98
|
+
│ B: trusted │ │ A: trusted │
|
|
99
|
+
└─────────────┘ └─────────────┘
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Trust emerges from behavior. No central authority. Natural and organic.
|
|
103
|
+
|
|
104
|
+
But: slow to build. Sybil attacks (fake identities gaming the system). Cold start still unsolved.
|
|
105
|
+
|
|
106
|
+
**The resolution**: these aren't mutually exclusive.
|
|
107
|
+
|
|
108
|
+
```python
|
|
109
|
+
# Trust resolution order (first match wins)
|
|
110
|
+
def resolve_trust(peer):
|
|
111
|
+
# 1. Local rules (highest priority - user explicit)
|
|
112
|
+
if peer in local_blacklist: return REJECT
|
|
113
|
+
if peer in local_whitelist: return ACCEPT
|
|
114
|
+
|
|
115
|
+
# 2. Behavioral history (P2P)
|
|
116
|
+
contact = contacts.get(peer)
|
|
117
|
+
if contact and contact.reliability > 0.8:
|
|
118
|
+
return TRUST_CAREFUL
|
|
119
|
+
|
|
120
|
+
# 3. Same network detection
|
|
121
|
+
if is_localhost(peer) or is_same_lan(peer):
|
|
122
|
+
return TRUST_CAREFUL
|
|
123
|
+
|
|
124
|
+
# 4. Server fallback (optional, for cold start)
|
|
125
|
+
if trust_server:
|
|
126
|
+
info = trust_server.query(peer)
|
|
127
|
+
if info: return info.trust_level
|
|
128
|
+
|
|
129
|
+
# 5. Default: treat as stranger
|
|
130
|
+
return TRUST_STRICT
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
**Local always works.** Server accelerates but isn't required. P2P accumulates naturally over time. New users get help from the server; experienced users rely on their own contacts.
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## Part IV: Hard Limits vs Soft Policy
|
|
138
|
+
|
|
139
|
+
The critical question: what MUST be code versus what CAN be prompt?
|
|
140
|
+
|
|
141
|
+
| Aspect | Must Be Code | Can Be Prompt |
|
|
142
|
+
|--------|-------------|---------------|
|
|
143
|
+
| Max tokens | ✅ LLM might ignore | |
|
|
144
|
+
| Timeout | ✅ Can't trust LLM to stop | |
|
|
145
|
+
| Rate limiting | ✅ Security-critical | |
|
|
146
|
+
| Blacklist enforcement | ✅ Must be absolute | |
|
|
147
|
+
| "Is this appropriate?" | | ✅ Needs judgment |
|
|
148
|
+
| "Which limit to apply?" | | ✅ Context-dependent |
|
|
149
|
+
| "Priority?" | | ✅ Subjective |
|
|
150
|
+
|
|
151
|
+
You cannot ask an LLM to enforce a 1000-token limit. It might comply, might not, might misunderstand. Security properties require deterministic code.
|
|
152
|
+
|
|
153
|
+
But you CAN ask an LLM: "Given this sender's reputation and task complexity, should the limit be 1000 or 10000 tokens?"
|
|
154
|
+
|
|
155
|
+
This led to our key insight: **soft policy invokes hard limits.**
|
|
156
|
+
|
|
157
|
+
```python
|
|
158
|
+
# Hard limits are functions
|
|
159
|
+
def set_max_tokens(n: int) -> str:
|
|
160
|
+
"""Set token budget for this task."""
|
|
161
|
+
_limits["max_tokens"] = n
|
|
162
|
+
return f"Max tokens set to {n}"
|
|
163
|
+
|
|
164
|
+
def set_timeout(seconds: int) -> str:
|
|
165
|
+
"""Set time limit for this task."""
|
|
166
|
+
_limits["timeout"] = seconds
|
|
167
|
+
return f"Timeout set to {seconds}s"
|
|
168
|
+
|
|
169
|
+
# Soft policy is a prompt that calls these functions
|
|
170
|
+
TRUST_POLICY = """
|
|
171
|
+
You decide resource limits for incoming tasks.
|
|
172
|
+
|
|
173
|
+
For unknown senders: set_max_tokens(1000), set_timeout(10)
|
|
174
|
+
For known contacts with good history: set_max_tokens(10000), set_timeout(60)
|
|
175
|
+
For whitelisted agents: set_max_tokens(50000), set_timeout(300)
|
|
176
|
+
|
|
177
|
+
Always end with accept() or reject().
|
|
178
|
+
"""
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
The prompt reasons. The code enforces. Neither alone is sufficient.
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Part V: The Trust Agent Trap
|
|
186
|
+
|
|
187
|
+
We designed a unified trust agent with these tools:
|
|
188
|
+
|
|
189
|
+
```python
|
|
190
|
+
trust_tools = [
|
|
191
|
+
check_reputation, # Query contact history
|
|
192
|
+
check_whitelist, # Check explicit allow list
|
|
193
|
+
check_blacklist, # Check explicit deny list
|
|
194
|
+
set_max_tokens, # Set token budget
|
|
195
|
+
set_timeout, # Set time limit
|
|
196
|
+
set_allowed_tools, # Restrict available tools
|
|
197
|
+
accept, # Approve the task
|
|
198
|
+
reject, # Deny the task
|
|
199
|
+
]
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
The policy prompt would reason about the context and call appropriate functions. Elegant, flexible, powerful.
|
|
203
|
+
|
|
204
|
+
Also: overkill for 90% of users.
|
|
205
|
+
|
|
206
|
+
Most users don't need sophisticated multi-factor trust decisions. They need:
|
|
207
|
+
|
|
208
|
+
```python
|
|
209
|
+
host(agent) # Just work
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
This is where progressive disclosure became our guiding principle:
|
|
213
|
+
|
|
214
|
+
```python
|
|
215
|
+
# Level 0: Beginner (just works)
|
|
216
|
+
host(agent)
|
|
217
|
+
|
|
218
|
+
# Level 1: Basic control
|
|
219
|
+
host(agent, trust="strict")
|
|
220
|
+
host(agent, port=9000)
|
|
221
|
+
|
|
222
|
+
# Level 2: Simple rules (code-enforced)
|
|
223
|
+
host(agent, blacklist=["bad_actor_xyz"])
|
|
224
|
+
host(agent, whitelist=["partner_abc"])
|
|
225
|
+
|
|
226
|
+
# Level 3: Custom policy (LLM-interpreted)
|
|
227
|
+
host(agent, trust_policy="Only accept from known contacts. Reject tasks over 1000 tokens.")
|
|
228
|
+
|
|
229
|
+
# Level 4: Full control (custom trust agent)
|
|
230
|
+
my_trust = Agent("trust", MY_POLICY, tools=trust_tools)
|
|
231
|
+
host(agent, trust_agent=my_trust)
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
Most users stay at Level 0 or 1. Some never leave Level 0. The complexity exists for those who need it, invisible to those who don't.
|
|
235
|
+
|
|
236
|
+
**Progressive disclosure isn't just UI—it's architecture.** Design systems where the simple path is genuinely simple, not just hiding complexity behind defaults.
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## Part VI: Should Network Code Live in Agent?
|
|
241
|
+
|
|
242
|
+
We had `agent.serve()` as a method on the Agent class. It seemed natural.
|
|
243
|
+
|
|
244
|
+
But the Agent class was growing:
|
|
245
|
+
- LLM integration
|
|
246
|
+
- Tool execution
|
|
247
|
+
- Message history
|
|
248
|
+
- Event system
|
|
249
|
+
- Trust handling
|
|
250
|
+
- And now network serving?
|
|
251
|
+
|
|
252
|
+
Each feature added methods, state, complexity. The class was becoming a god object.
|
|
253
|
+
|
|
254
|
+
We asked: what IS an Agent, essentially?
|
|
255
|
+
|
|
256
|
+
```python
|
|
257
|
+
# An agent is a decision maker
|
|
258
|
+
class Agent:
|
|
259
|
+
def input(self, prompt: str) -> str:
|
|
260
|
+
"""Receive input, reason with tools, return output."""
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
That's the core job. Receive input. Make decisions. Return output.
|
|
264
|
+
|
|
265
|
+
Does an Agent need to know about TCP? About WebSocket handshakes? About relay servers and NAT traversal?
|
|
266
|
+
|
|
267
|
+
No. Those are implementation details of a different concern.
|
|
268
|
+
|
|
269
|
+
**The Agent decides. The network executes.**
|
|
270
|
+
|
|
271
|
+
```python
|
|
272
|
+
# agent.py - Decision maker
|
|
273
|
+
class Agent:
|
|
274
|
+
def input(self, prompt): ... # Core: make decisions
|
|
275
|
+
|
|
276
|
+
# network.py - Executor
|
|
277
|
+
def host(agent): ... # Make agent available
|
|
278
|
+
def ask(peer, task): ... # Request from another agent
|
|
279
|
+
def find(capability): ... # Discover agents
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
The Agent doesn't know HOW it's hosted. The network module doesn't know HOW decisions are made. Each does one job well.
|
|
283
|
+
|
|
284
|
+
Benefits:
|
|
285
|
+
- Test agents without networks
|
|
286
|
+
- Test networks without agents
|
|
287
|
+
- Same agent works locally or networked
|
|
288
|
+
- Clear mental model
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
## Part VII: Functions Over Classes
|
|
293
|
+
|
|
294
|
+
Once network operations were separate, we needed to decide their form.
|
|
295
|
+
|
|
296
|
+
Option A: NetworkManager class
|
|
297
|
+
```python
|
|
298
|
+
manager = NetworkManager(agent, trust_config, network_config)
|
|
299
|
+
manager.serve(port=8000)
|
|
300
|
+
manager.connect("peer_xyz")
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
Option B: Plain functions
|
|
304
|
+
```python
|
|
305
|
+
host(agent)
|
|
306
|
+
ask("peer_xyz", "do something")
|
|
307
|
+
find("can translate Japanese")
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
We chose functions. Here's why:
|
|
311
|
+
|
|
312
|
+
**Classes accumulate state.** Each method might depend on internal state set by previous methods. Order matters. Interactions are implicit.
|
|
313
|
+
|
|
314
|
+
**Functions are explicit.** Everything needed is in the parameters. No hidden state. No implicit order.
|
|
315
|
+
|
|
316
|
+
**Classes invite configuration.** You add a config object, then config options, then config validation, then config migration...
|
|
317
|
+
|
|
318
|
+
**Functions invite simplicity.** Pass what you need. Get what you want. Done.
|
|
319
|
+
|
|
320
|
+
```python
|
|
321
|
+
# The entire network API
|
|
322
|
+
from connectonion.network import host, ask, find
|
|
323
|
+
|
|
324
|
+
host(agent) # Make available
|
|
325
|
+
result = ask("peer", "translate X") # Request from peer
|
|
326
|
+
agents = find("translation") # Discover by capability
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
Three functions. That's it.
|
|
330
|
+
|
|
331
|
+
---
|
|
332
|
+
|
|
333
|
+
## Part VIII: Naming the Host Function
|
|
334
|
+
|
|
335
|
+
What do you call a function that makes an agent available on the network?
|
|
336
|
+
|
|
337
|
+
| Candidate | Problem |
|
|
338
|
+
|-----------|---------|
|
|
339
|
+
| `serve(agent)` | Who serves what? Ambiguous subject |
|
|
340
|
+
| `listen(agent)` | Listen to what? Usually expects port |
|
|
341
|
+
| `run(agent)` | Run locally? On network? Too vague |
|
|
342
|
+
| `start(agent)` | Start what? Too generic |
|
|
343
|
+
| `launch(agent)` | Implies one-time, not ongoing |
|
|
344
|
+
| `publish(agent)` | Sounds like one-time action |
|
|
345
|
+
| `expose(agent)` | Less familiar term |
|
|
346
|
+
|
|
347
|
+
We applied the sentence test:
|
|
348
|
+
|
|
349
|
+
- "I **host** my agent on the network" ✅ Natural
|
|
350
|
+
- "I **serve** my agent on the network" ❓ Awkward
|
|
351
|
+
- "I **launch** my agent on the network" ⚠️ Sounds one-time
|
|
352
|
+
|
|
353
|
+
And the pair test (with `ask` for requesting):
|
|
354
|
+
|
|
355
|
+
- `host` / `ask`: "I host, you ask" ✅ Symmetric, clear
|
|
356
|
+
- `serve` / `request`: "I serve, you request" ⚠️ But serve(agent) is still weird
|
|
357
|
+
- `launch` / `ask`: "I launched, you ask" ⚠️ Tense mismatch
|
|
358
|
+
|
|
359
|
+
`host` won because:
|
|
360
|
+
1. **Clear subject**: YOU host the AGENT
|
|
361
|
+
2. **Familiar metaphor**: web hosting, hosting a party
|
|
362
|
+
3. **Implies continuity**: hosting is ongoing, not one-time
|
|
363
|
+
4. **Natural pair**: host/ask is symmetric
|
|
364
|
+
|
|
365
|
+
**Good names eliminate documentation.** If users need docs to understand what a function does, the name failed.
|
|
366
|
+
|
|
367
|
+
---
|
|
368
|
+
|
|
369
|
+
## Part IX: The Final Architecture
|
|
370
|
+
|
|
371
|
+
After all the exploration, wrong turns, and simplification, here's what we built:
|
|
372
|
+
|
|
373
|
+
### The Network API (Three Functions)
|
|
374
|
+
|
|
375
|
+
```python
|
|
376
|
+
from connectonion.network import host, ask, find
|
|
377
|
+
|
|
378
|
+
# Make your agent available
|
|
379
|
+
host(agent)
|
|
380
|
+
|
|
381
|
+
# Ask another agent
|
|
382
|
+
result = ask("translator_xyz", "translate: hello world")
|
|
383
|
+
|
|
384
|
+
# Find agents by capability
|
|
385
|
+
translators = find("can translate Japanese to English")
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
### The Host Function (Progressive Disclosure)
|
|
389
|
+
|
|
390
|
+
```python
|
|
391
|
+
def host(
|
|
392
|
+
agent: Agent,
|
|
393
|
+
|
|
394
|
+
# Level 1: Basic
|
|
395
|
+
trust: str = "careful", # "open" | "careful" | "strict"
|
|
396
|
+
port: int = 8000,
|
|
397
|
+
|
|
398
|
+
# Level 2: Rules
|
|
399
|
+
blacklist: list = None, # Always reject these
|
|
400
|
+
whitelist: list = None, # Always accept these
|
|
401
|
+
|
|
402
|
+
# Level 3: Policy
|
|
403
|
+
trust_policy: str = None, # Natural language policy
|
|
404
|
+
|
|
405
|
+
# Level 4: Full control
|
|
406
|
+
trust_agent: Agent = None, # Custom trust agent
|
|
407
|
+
):
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
### The Trust Flow
|
|
411
|
+
|
|
412
|
+
```
|
|
413
|
+
Task arrives
|
|
414
|
+
│
|
|
415
|
+
▼
|
|
416
|
+
┌─────────────────────┐
|
|
417
|
+
│ Blacklist check │──── In blacklist? ──► REJECT
|
|
418
|
+
│ (code-enforced) │
|
|
419
|
+
└─────────────────────┘
|
|
420
|
+
│ not in blacklist
|
|
421
|
+
▼
|
|
422
|
+
┌─────────────────────┐
|
|
423
|
+
│ Whitelist check │──── In whitelist? ──► ACCEPT (open limits)
|
|
424
|
+
│ (code-enforced) │
|
|
425
|
+
└─────────────────────┘
|
|
426
|
+
│ not in whitelist
|
|
427
|
+
▼
|
|
428
|
+
┌─────────────────────┐
|
|
429
|
+
│ Trust agent/policy │──── Has trust_agent? ──► Agent decides
|
|
430
|
+
│ (if configured) │──── Has trust_policy? ──► LLM decides
|
|
431
|
+
└─────────────────────┘
|
|
432
|
+
│ no custom config
|
|
433
|
+
▼
|
|
434
|
+
┌─────────────────────┐
|
|
435
|
+
│ Default limits │──── Apply limits from trust level
|
|
436
|
+
│ (code-enforced) │
|
|
437
|
+
└─────────────────────┘
|
|
438
|
+
│
|
|
439
|
+
▼
|
|
440
|
+
Execute with limits
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
### Trust Levels (Predefined Limits)
|
|
444
|
+
|
|
445
|
+
```python
|
|
446
|
+
TRUST_LIMITS = {
|
|
447
|
+
"open": {
|
|
448
|
+
"max_tokens": None, # Unlimited
|
|
449
|
+
"timeout": None, # No timeout
|
|
450
|
+
"max_iterations": None,
|
|
451
|
+
},
|
|
452
|
+
"careful": {
|
|
453
|
+
"max_tokens": 10000,
|
|
454
|
+
"timeout": 60,
|
|
455
|
+
"max_iterations": 10,
|
|
456
|
+
},
|
|
457
|
+
"strict": {
|
|
458
|
+
"max_tokens": 1000,
|
|
459
|
+
"timeout": 10,
|
|
460
|
+
"max_iterations": 3,
|
|
461
|
+
},
|
|
462
|
+
}
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
---
|
|
466
|
+
|
|
467
|
+
## Part X: Principles We Discovered
|
|
468
|
+
|
|
469
|
+
### 1. Local First, Server Optional
|
|
470
|
+
Local mode must always work. Server accelerates but never gates functionality.
|
|
471
|
+
|
|
472
|
+
### 2. Hard Limits in Code, Soft Policy in Prompts
|
|
473
|
+
Security-critical properties are code-enforced. Context-dependent judgments can use LLM reasoning.
|
|
474
|
+
|
|
475
|
+
### 3. Progressive Disclosure Is Architecture
|
|
476
|
+
Design systems where `host(agent)` genuinely works—not as a facade hiding complexity, but as a complete solution for simple cases.
|
|
477
|
+
|
|
478
|
+
### 4. Agent Decides, Module Executes
|
|
479
|
+
Keep the Agent class focused on decisions. Network, storage, and other concerns belong in separate modules.
|
|
480
|
+
|
|
481
|
+
### 5. Functions Over Classes
|
|
482
|
+
When unsure, use a function. Classes are for state that truly lives over time, not for grouping related operations.
|
|
483
|
+
|
|
484
|
+
### 6. Names That Need No Documentation
|
|
485
|
+
If you have to explain what a function does, rename it until you don't.
|
|
486
|
+
|
|
487
|
+
---
|
|
488
|
+
|
|
489
|
+
## Conclusion
|
|
490
|
+
|
|
491
|
+
We started with grand ambitions: multiple specialized trust agents, layered verification systems, sophisticated policy engines.
|
|
492
|
+
|
|
493
|
+
We ended with three functions: `host()`, `ask()`, `find()`.
|
|
494
|
+
|
|
495
|
+
The journey taught us that complexity is easy. Anyone can add features, options, and flexibility. The hard part is removing them—finding what's essential and letting go of the rest.
|
|
496
|
+
|
|
497
|
+
A beginner writes `host(agent)` and it works. An expert configures custom trust agents with specialized tools. Both use the same API, both get what they need, neither suffers for the other.
|
|
498
|
+
|
|
499
|
+
That's what "keep simple things simple, make complicated things possible" actually means in practice.
|
|
500
|
+
|
|
501
|
+
---
|
|
502
|
+
|
|
503
|
+
*The best architecture is invisible. It does its job, stays out of your way, and lets you focus on what actually matters. If you're thinking about the architecture while using it, it's not done yet.*
|