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.
Files changed (413) hide show
  1. connectonion/__init__.py +46 -9
  2. connectonion/cli/__init__.py +11 -1
  3. connectonion/cli/browser_agent/__init__.py +11 -1
  4. connectonion/cli/browser_agent/browser.py +95 -142
  5. connectonion/cli/browser_agent/element_finder.py +147 -0
  6. connectonion/cli/browser_agent/highlight_screenshot.py +182 -0
  7. connectonion/cli/browser_agent/prompt.md +188 -105
  8. connectonion/cli/browser_agent/prompts/element_matcher.md +59 -0
  9. connectonion/cli/browser_agent/prompts/form_filler.md +19 -0
  10. connectonion/cli/browser_agent/prompts/scroll_strategy.md +36 -0
  11. connectonion/cli/browser_agent/scripts/extract_elements.js +126 -0
  12. connectonion/cli/browser_agent/scroll.py +145 -0
  13. connectonion/cli/co_ai/__init__.py +6 -0
  14. connectonion/cli/co_ai/agent.py +87 -0
  15. connectonion/cli/co_ai/agents/__init__.py +5 -0
  16. connectonion/cli/co_ai/agents/registry.py +57 -0
  17. connectonion/cli/co_ai/commands/__init__.py +45 -0
  18. connectonion/cli/co_ai/commands/compact.py +173 -0
  19. connectonion/cli/co_ai/commands/cost.py +77 -0
  20. connectonion/cli/co_ai/commands/export.py +60 -0
  21. connectonion/cli/co_ai/commands/help.py +80 -0
  22. connectonion/cli/co_ai/commands/init.py +101 -0
  23. connectonion/cli/co_ai/commands/sessions.py +55 -0
  24. connectonion/cli/co_ai/commands/tasks.py +63 -0
  25. connectonion/cli/co_ai/commands/undo.py +103 -0
  26. connectonion/cli/co_ai/context.py +127 -0
  27. connectonion/cli/co_ai/main.py +52 -0
  28. connectonion/cli/co_ai/plugins/__init__.py +6 -0
  29. connectonion/cli/co_ai/plugins/reminder.py +76 -0
  30. connectonion/cli/co_ai/plugins/shell_approval.py +105 -0
  31. connectonion/cli/co_ai/prompts/agents/explore.md +79 -0
  32. connectonion/cli/co_ai/prompts/agents/plan.md +60 -0
  33. connectonion/cli/co_ai/prompts/assembler.py +303 -0
  34. connectonion/cli/{docs/co-vibecoding-principles-docs-contexts-all-in-one.md → co_ai/prompts/connectonion/README.md} +26 -0
  35. connectonion/cli/co_ai/prompts/connectonion/api.md +457 -0
  36. connectonion/cli/co_ai/prompts/connectonion/cli/README.md +805 -0
  37. connectonion/cli/co_ai/prompts/connectonion/cli/auth.md +46 -0
  38. connectonion/cli/co_ai/prompts/connectonion/cli/browser.md +235 -0
  39. connectonion/cli/co_ai/prompts/connectonion/cli/copy.md +184 -0
  40. connectonion/cli/co_ai/prompts/connectonion/cli/create.md +335 -0
  41. connectonion/cli/co_ai/prompts/connectonion/cli/init.md +431 -0
  42. connectonion/cli/co_ai/prompts/connectonion/co-directory-structure.md +214 -0
  43. connectonion/cli/co_ai/prompts/connectonion/concepts/agent.md +1078 -0
  44. connectonion/cli/co_ai/prompts/connectonion/concepts/events.md +816 -0
  45. connectonion/cli/co_ai/prompts/connectonion/concepts/llm_do.md +256 -0
  46. connectonion/cli/co_ai/prompts/connectonion/concepts/max_iterations.md +362 -0
  47. connectonion/cli/co_ai/prompts/connectonion/concepts/models.md +641 -0
  48. connectonion/cli/co_ai/prompts/connectonion/concepts/plugins.md +100 -0
  49. connectonion/cli/co_ai/prompts/connectonion/concepts/prompts.md +122 -0
  50. connectonion/cli/co_ai/prompts/connectonion/concepts/tools.md +512 -0
  51. connectonion/cli/co_ai/prompts/connectonion/concepts/transcribe.md +156 -0
  52. connectonion/cli/co_ai/prompts/connectonion/concepts/trust.md +291 -0
  53. connectonion/cli/co_ai/prompts/connectonion/debug/README.md +18 -0
  54. connectonion/cli/co_ai/prompts/connectonion/debug/auto_debug.md +1026 -0
  55. connectonion/cli/co_ai/prompts/connectonion/debug/console.md +129 -0
  56. connectonion/cli/co_ai/prompts/connectonion/debug/eval-format.md +178 -0
  57. connectonion/cli/co_ai/prompts/connectonion/debug/eval.md +230 -0
  58. connectonion/cli/co_ai/prompts/connectonion/debug/exceptions.md +307 -0
  59. connectonion/cli/co_ai/prompts/connectonion/debug/log.md +117 -0
  60. connectonion/cli/co_ai/prompts/connectonion/debug/xray.md +215 -0
  61. connectonion/cli/co_ai/prompts/connectonion/design-decisions/001-choosing-input-method.md +202 -0
  62. connectonion/cli/co_ai/prompts/connectonion/design-decisions/002-choosing-llm-function-name.md +202 -0
  63. connectonion/cli/co_ai/prompts/connectonion/design-decisions/003-choosing-trust-keyword.md +141 -0
  64. connectonion/cli/co_ai/prompts/connectonion/design-decisions/004-cli-create-flow.md +117 -0
  65. connectonion/cli/co_ai/prompts/connectonion/design-decisions/005-designing-agent-network-protocol.md +503 -0
  66. connectonion/cli/co_ai/prompts/connectonion/design-decisions/006-agent-address-format.md +305 -0
  67. connectonion/cli/co_ai/prompts/connectonion/design-decisions/007-authentication-backend-design.md +240 -0
  68. connectonion/cli/co_ai/prompts/connectonion/design-decisions/008-naming-is-hard.md +228 -0
  69. connectonion/cli/co_ai/prompts/connectonion/design-decisions/009-why-connect-function.md +167 -0
  70. connectonion/cli/co_ai/prompts/connectonion/design-decisions/010-cli-ux-progressive-disclosure.md +176 -0
  71. connectonion/cli/co_ai/prompts/connectonion/design-decisions/011-global-config-identity-management.md +357 -0
  72. connectonion/cli/co_ai/prompts/connectonion/design-decisions/012-tool-execution-separation.md +259 -0
  73. connectonion/cli/co_ai/prompts/connectonion/design-decisions/013-debug-and-logging-design.md +253 -0
  74. connectonion/cli/co_ai/prompts/connectonion/design-decisions/014-hook-system-design.md +510 -0
  75. connectonion/cli/co_ai/prompts/connectonion/design-decisions/015-interactive-auto-debug-design.md +837 -0
  76. connectonion/cli/co_ai/prompts/connectonion/design-decisions/016-why-no-zero-knowledge-proofs.md +358 -0
  77. connectonion/cli/co_ai/prompts/connectonion/design-decisions/017-session-logging-and-eval-format.md +120 -0
  78. connectonion/cli/co_ai/prompts/connectonion/design-decisions/018-event-api-naming.md +274 -0
  79. connectonion/cli/co_ai/prompts/connectonion/design-decisions/019-agent-lifecycle-design.md +655 -0
  80. connectonion/cli/co_ai/prompts/connectonion/design-decisions/020-trust-system-and-network-architecture.md +503 -0
  81. connectonion/cli/co_ai/prompts/connectonion/design-decisions/021-task-storage-jsonl-design.md +496 -0
  82. connectonion/cli/co_ai/prompts/connectonion/design-decisions/022-raw-asgi-implementation.md +273 -0
  83. connectonion/cli/co_ai/prompts/connectonion/examples/agent_reasoning.md +62 -0
  84. connectonion/cli/co_ai/prompts/connectonion/examples/atomic_tools.md +24 -0
  85. connectonion/cli/co_ai/prompts/connectonion/examples/load_guide.md +18 -0
  86. connectonion/cli/co_ai/prompts/connectonion/examples.md +0 -0
  87. connectonion/cli/co_ai/prompts/connectonion/hook-system-options.md +364 -0
  88. connectonion/cli/co_ai/prompts/connectonion/index.md +162 -0
  89. connectonion/cli/co_ai/prompts/connectonion/integrations/README.md +12 -0
  90. connectonion/cli/co_ai/prompts/connectonion/integrations/auth.md +450 -0
  91. connectonion/cli/co_ai/prompts/connectonion/integrations/google.md +431 -0
  92. connectonion/cli/co_ai/prompts/connectonion/integrations/microsoft.md +370 -0
  93. connectonion/cli/co_ai/prompts/connectonion/network/README.md +14 -0
  94. connectonion/cli/co_ai/prompts/connectonion/network/connect.md +543 -0
  95. connectonion/cli/co_ai/prompts/connectonion/network/connection.md +538 -0
  96. connectonion/cli/co_ai/prompts/connectonion/network/deploy.md +123 -0
  97. connectonion/cli/co_ai/prompts/connectonion/network/host.md +1049 -0
  98. connectonion/cli/co_ai/prompts/connectonion/network/protocol/agent-relay-protocol.md +495 -0
  99. connectonion/cli/co_ai/prompts/connectonion/network/protocol/announce-message.md +115 -0
  100. connectonion/cli/co_ai/prompts/connectonion/principles.md +124 -0
  101. connectonion/cli/co_ai/prompts/connectonion/quickstart.md +261 -0
  102. connectonion/cli/co_ai/prompts/connectonion/roadmap.md +81 -0
  103. connectonion/cli/co_ai/prompts/connectonion/templates/README.md +77 -0
  104. connectonion/cli/co_ai/prompts/connectonion/templates/meta-agent.md +152 -0
  105. connectonion/cli/co_ai/prompts/connectonion/templates/minimal.md +105 -0
  106. connectonion/cli/co_ai/prompts/connectonion/templates/playwright.md +130 -0
  107. connectonion/cli/co_ai/prompts/connectonion/templates/web-research.md +144 -0
  108. connectonion/cli/co_ai/prompts/connectonion/tui/README.md +95 -0
  109. connectonion/cli/co_ai/prompts/connectonion/tui/chat.md +181 -0
  110. connectonion/cli/co_ai/prompts/connectonion/tui/divider.md +63 -0
  111. connectonion/cli/co_ai/prompts/connectonion/tui/dropdown.md +83 -0
  112. connectonion/cli/co_ai/prompts/connectonion/tui/footer.md +44 -0
  113. connectonion/cli/co_ai/prompts/connectonion/tui/fuzzy.md +68 -0
  114. connectonion/cli/co_ai/prompts/connectonion/tui/input.md +84 -0
  115. connectonion/cli/co_ai/prompts/connectonion/tui/keys.md +77 -0
  116. connectonion/cli/co_ai/prompts/connectonion/tui/pick.md +71 -0
  117. connectonion/cli/co_ai/prompts/connectonion/tui/providers.md +89 -0
  118. connectonion/cli/co_ai/prompts/connectonion/tui/status_bar.md +67 -0
  119. connectonion/cli/co_ai/prompts/connectonion/useful_plugins/README.md +156 -0
  120. connectonion/cli/co_ai/prompts/connectonion/useful_plugins/calendar_plugin.md +68 -0
  121. connectonion/cli/co_ai/prompts/connectonion/useful_plugins/eval.md +89 -0
  122. connectonion/cli/co_ai/prompts/connectonion/useful_plugins/gmail_plugin.md +68 -0
  123. connectonion/cli/co_ai/prompts/connectonion/useful_plugins/image_result_formatter.md +74 -0
  124. connectonion/cli/co_ai/prompts/connectonion/useful_plugins/re_act.md +86 -0
  125. connectonion/cli/co_ai/prompts/connectonion/useful_plugins/shell_approval.md +69 -0
  126. connectonion/cli/co_ai/prompts/connectonion/useful_tools/README.md +81 -0
  127. connectonion/cli/co_ai/prompts/connectonion/useful_tools/diff_writer.md +138 -0
  128. connectonion/cli/co_ai/prompts/connectonion/useful_tools/get_emails.md +499 -0
  129. connectonion/cli/co_ai/prompts/connectonion/useful_tools/gmail.md +135 -0
  130. connectonion/cli/co_ai/prompts/connectonion/useful_tools/google_calendar.md +106 -0
  131. connectonion/cli/co_ai/prompts/connectonion/useful_tools/memory.md +486 -0
  132. connectonion/cli/co_ai/prompts/connectonion/useful_tools/microsoft_calendar.md +106 -0
  133. connectonion/cli/co_ai/prompts/connectonion/useful_tools/outlook.md +120 -0
  134. connectonion/cli/co_ai/prompts/connectonion/useful_tools/send_email.md +403 -0
  135. connectonion/cli/co_ai/prompts/connectonion/useful_tools/shell.md +95 -0
  136. connectonion/cli/co_ai/prompts/connectonion/useful_tools/slash_command.md +96 -0
  137. connectonion/cli/co_ai/prompts/connectonion/useful_tools/terminal.md +97 -0
  138. connectonion/cli/co_ai/prompts/connectonion/useful_tools/todo_list.md +252 -0
  139. connectonion/cli/co_ai/prompts/connectonion/useful_tools/web_fetch.md +130 -0
  140. connectonion/cli/co_ai/prompts/connectonion/vibe-coding-guide.md +97 -0
  141. connectonion/cli/co_ai/prompts/connectonion/windows-support.md +258 -0
  142. connectonion/cli/co_ai/prompts/main.md +247 -0
  143. connectonion/cli/co_ai/prompts/reminders/plan_mode.md +34 -0
  144. connectonion/cli/co_ai/prompts/summarization.md +55 -0
  145. connectonion/cli/co_ai/prompts/tools/ask_user.md +61 -0
  146. connectonion/cli/co_ai/prompts/tools/background.md +57 -0
  147. connectonion/cli/co_ai/prompts/tools/edit.md +90 -0
  148. connectonion/cli/co_ai/prompts/tools/glob.md +52 -0
  149. connectonion/cli/co_ai/prompts/tools/grep.md +55 -0
  150. connectonion/cli/co_ai/prompts/tools/plan_mode.md +80 -0
  151. connectonion/cli/co_ai/prompts/tools/read.md +40 -0
  152. connectonion/cli/co_ai/prompts/tools/shell.md +67 -0
  153. connectonion/cli/co_ai/prompts/tools/task.md +51 -0
  154. connectonion/cli/co_ai/prompts/tools/todo.md +139 -0
  155. connectonion/cli/co_ai/prompts/tools/write.md +47 -0
  156. connectonion/cli/co_ai/prompts/workflow.md +89 -0
  157. connectonion/cli/co_ai/reminders.py +159 -0
  158. connectonion/cli/co_ai/sessions.py +110 -0
  159. connectonion/cli/co_ai/skills/__init__.py +37 -0
  160. connectonion/cli/co_ai/skills/builtin/commit/SKILL.md +63 -0
  161. connectonion/cli/co_ai/skills/builtin/review-pr/SKILL.md +76 -0
  162. connectonion/cli/co_ai/skills/loader.py +166 -0
  163. connectonion/cli/co_ai/skills/tool.py +46 -0
  164. connectonion/cli/co_ai/tools/__init__.py +92 -0
  165. connectonion/cli/co_ai/tools/ask_user.py +35 -0
  166. connectonion/cli/co_ai/tools/background.py +201 -0
  167. connectonion/cli/co_ai/tools/diff_writer.py +291 -0
  168. connectonion/cli/co_ai/tools/edit.py +89 -0
  169. connectonion/cli/co_ai/tools/glob.py +84 -0
  170. connectonion/cli/co_ai/tools/grep.py +158 -0
  171. connectonion/cli/co_ai/tools/load_guide.py +23 -0
  172. connectonion/cli/co_ai/tools/multi_edit.py +116 -0
  173. connectonion/cli/co_ai/tools/plan_mode.py +172 -0
  174. connectonion/cli/co_ai/tools/read.py +67 -0
  175. connectonion/cli/co_ai/tools/task.py +59 -0
  176. connectonion/cli/co_ai/tools/todo_list.py +159 -0
  177. connectonion/cli/co_ai/tools/write.py +126 -0
  178. connectonion/cli/commands/__init__.py +11 -1
  179. connectonion/cli/commands/ai_commands.py +34 -0
  180. connectonion/cli/commands/copy_commands.py +55 -6
  181. connectonion/cli/commands/create.py +20 -17
  182. connectonion/cli/commands/init.py +19 -22
  183. connectonion/cli/commands/project_cmd_lib.py +15 -0
  184. connectonion/cli/main.py +11 -0
  185. connectonion/console.py +15 -1
  186. connectonion/core/__init__.py +10 -1
  187. connectonion/core/agent.py +37 -16
  188. connectonion/core/exceptions.py +74 -0
  189. connectonion/core/llm.py +54 -6
  190. connectonion/core/tool_executor.py +32 -31
  191. connectonion/core/tool_factory.py +47 -10
  192. connectonion/debug/__init__.py +10 -1
  193. connectonion/debug/debug_explainer/__init__.py +10 -1
  194. connectonion/debug/execution_analyzer/__init__.py +10 -1
  195. connectonion/debug/execution_analyzer/execution_analysis.py +5 -2
  196. connectonion/debug/runtime_inspector/__init__.py +10 -1
  197. connectonion/docs/.package-ignore +6 -0
  198. connectonion/docs/README.md +2036 -0
  199. connectonion/docs/api.md +457 -0
  200. connectonion/docs/archive/001-ai-agent-is-just-prompt-plus-function.md +249 -0
  201. connectonion/docs/archive/README.md +53 -0
  202. connectonion/docs/archive/archive/consolidation-plan.md +72 -0
  203. connectonion/docs/archive/archive/core-principles-extracted.md +239 -0
  204. connectonion/docs/archive/archive/master-principles.md +222 -0
  205. connectonion/docs/archive/archive/principles.md +293 -0
  206. connectonion/docs/archive/archive/simplicity-principles.md +221 -0
  207. connectonion/docs/archive/attack-defense-insights.md +410 -0
  208. connectonion/docs/archive/business-model.md +305 -0
  209. connectonion/docs/archive/core-principles-unified.md +190 -0
  210. connectonion/docs/archive/discussion-journey.md +178 -0
  211. connectonion/docs/archive/economic-analysis.md +323 -0
  212. connectonion/docs/archive/features/01-share-and-find.md +256 -0
  213. connectonion/docs/archive/features/02-agent-authentication.md +93 -0
  214. connectonion/docs/archive/features/03-test-before-trust.md +71 -0
  215. connectonion/docs/archive/features/06-reliability-and-offline.md +197 -0
  216. connectonion/docs/archive/features/README.md +46 -0
  217. connectonion/docs/archive/features-roadmap.md +247 -0
  218. connectonion/docs/archive/mcp-comparison-insights.md +215 -0
  219. connectonion/docs/archive/migration-strategy.md +571 -0
  220. connectonion/docs/archive/mini-whitepaper.md +293 -0
  221. connectonion/docs/archive/network-protocol.md +394 -0
  222. connectonion/docs/archive/semantic-revolution.md +367 -0
  223. connectonion/docs/archive/technical-architecture.md +453 -0
  224. connectonion/docs/archive/the-semantic-insight.md +207 -0
  225. connectonion/docs/archive/threat-model.md +164 -0
  226. connectonion/docs/cli/README.md +805 -0
  227. connectonion/docs/cli/auth.md +46 -0
  228. connectonion/docs/cli/browser.md +235 -0
  229. connectonion/docs/cli/copy.md +232 -0
  230. connectonion/docs/cli/create.md +335 -0
  231. connectonion/docs/cli/init.md +431 -0
  232. connectonion/docs/co-directory-structure.md +214 -0
  233. connectonion/docs/concepts/agent.md +1078 -0
  234. connectonion/docs/concepts/events.md +699 -0
  235. connectonion/docs/concepts/llm_do.md +256 -0
  236. connectonion/docs/concepts/max_iterations.md +362 -0
  237. connectonion/docs/concepts/models.md +641 -0
  238. connectonion/docs/concepts/plugins.md +100 -0
  239. connectonion/docs/concepts/prompts.md +122 -0
  240. connectonion/docs/concepts/session.md +428 -0
  241. connectonion/docs/concepts/tools.md +512 -0
  242. connectonion/docs/concepts/transcribe.md +156 -0
  243. connectonion/docs/concepts/trust.md +291 -0
  244. connectonion/docs/connectonion.md +1256 -0
  245. connectonion/docs/debug/README.md +18 -0
  246. connectonion/docs/debug/auto_debug.md +1026 -0
  247. connectonion/docs/debug/console.md +129 -0
  248. connectonion/docs/debug/eval-format.md +178 -0
  249. connectonion/docs/debug/eval.md +230 -0
  250. connectonion/docs/debug/exceptions.md +307 -0
  251. connectonion/docs/debug/log.md +117 -0
  252. connectonion/docs/debug/xray.md +215 -0
  253. connectonion/docs/design-decisions/001-choosing-input-method.md +202 -0
  254. connectonion/docs/design-decisions/002-choosing-llm-function-name.md +202 -0
  255. connectonion/docs/design-decisions/003-choosing-trust-keyword.md +141 -0
  256. connectonion/docs/design-decisions/004-cli-create-flow.md +117 -0
  257. connectonion/docs/design-decisions/005-designing-agent-network-protocol.md +503 -0
  258. connectonion/docs/design-decisions/006-agent-address-format.md +305 -0
  259. connectonion/docs/design-decisions/007-authentication-backend-design.md +240 -0
  260. connectonion/docs/design-decisions/008-naming-is-hard.md +228 -0
  261. connectonion/docs/design-decisions/009-why-connect-function.md +167 -0
  262. connectonion/docs/design-decisions/010-cli-ux-progressive-disclosure.md +176 -0
  263. connectonion/docs/design-decisions/011-global-config-identity-management.md +357 -0
  264. connectonion/docs/design-decisions/012-tool-execution-separation.md +259 -0
  265. connectonion/docs/design-decisions/013-debug-and-logging-design.md +253 -0
  266. connectonion/docs/design-decisions/014-hook-system-design.md +510 -0
  267. connectonion/docs/design-decisions/015-interactive-auto-debug-design.md +837 -0
  268. connectonion/docs/design-decisions/016-why-no-zero-knowledge-proofs.md +358 -0
  269. connectonion/docs/design-decisions/017-session-logging-and-eval-format.md +120 -0
  270. connectonion/docs/design-decisions/018-event-api-naming.md +274 -0
  271. connectonion/docs/design-decisions/019-agent-lifecycle-design.md +655 -0
  272. connectonion/docs/design-decisions/020-trust-system-and-network-architecture.md +503 -0
  273. connectonion/docs/design-decisions/021-task-storage-jsonl-design.md +496 -0
  274. connectonion/docs/design-decisions/022-raw-asgi-implementation.md +273 -0
  275. connectonion/docs/examples.md +0 -0
  276. connectonion/docs/hook-system-options.md +364 -0
  277. connectonion/docs/integrations/README.md +12 -0
  278. connectonion/docs/integrations/auth.md +450 -0
  279. connectonion/docs/integrations/google.md +431 -0
  280. connectonion/docs/integrations/microsoft.md +370 -0
  281. connectonion/docs/network/README.md +14 -0
  282. connectonion/docs/network/connect.md +629 -0
  283. connectonion/docs/network/deploy.md +124 -0
  284. connectonion/docs/network/host.md +1087 -0
  285. connectonion/docs/network/io.md +538 -0
  286. connectonion/docs/network/protocol/agent-relay-protocol.md +495 -0
  287. connectonion/docs/network/protocol/announce-message.md +115 -0
  288. connectonion/docs/principles.md +124 -0
  289. connectonion/docs/quickstart.md +261 -0
  290. connectonion/docs/roadmap.md +81 -0
  291. connectonion/docs/templates/README.md +77 -0
  292. connectonion/docs/templates/meta-agent.md +152 -0
  293. connectonion/docs/templates/minimal.md +105 -0
  294. connectonion/docs/templates/playwright.md +130 -0
  295. connectonion/docs/templates/web-research.md +144 -0
  296. connectonion/docs/tui/README.md +95 -0
  297. connectonion/docs/tui/chat.md +181 -0
  298. connectonion/docs/tui/divider.md +63 -0
  299. connectonion/docs/tui/dropdown.md +83 -0
  300. connectonion/docs/tui/footer.md +44 -0
  301. connectonion/docs/tui/fuzzy.md +68 -0
  302. connectonion/docs/tui/input.md +84 -0
  303. connectonion/docs/tui/keys.md +77 -0
  304. connectonion/docs/tui/pick.md +71 -0
  305. connectonion/docs/tui/providers.md +89 -0
  306. connectonion/docs/tui/status_bar.md +67 -0
  307. connectonion/docs/useful_plugins/README.md +160 -0
  308. connectonion/docs/useful_plugins/calendar_plugin.md +68 -0
  309. connectonion/docs/useful_plugins/eval.md +89 -0
  310. connectonion/docs/useful_plugins/gmail_plugin.md +68 -0
  311. connectonion/docs/useful_plugins/image_result_formatter.md +74 -0
  312. connectonion/docs/useful_plugins/re_act.md +86 -0
  313. connectonion/docs/useful_plugins/shell_approval.md +69 -0
  314. connectonion/docs/useful_plugins/system_reminder.md +210 -0
  315. connectonion/docs/useful_prompts/README.md +127 -0
  316. connectonion/docs/useful_prompts/coding_agent.md +214 -0
  317. connectonion/docs/useful_tools/README.md +81 -0
  318. connectonion/docs/useful_tools/ask_user.md +103 -0
  319. connectonion/docs/useful_tools/diff_writer.md +158 -0
  320. connectonion/docs/useful_tools/get_emails.md +519 -0
  321. connectonion/docs/useful_tools/gmail.md +155 -0
  322. connectonion/docs/useful_tools/google_calendar.md +126 -0
  323. connectonion/docs/useful_tools/memory.md +506 -0
  324. connectonion/docs/useful_tools/microsoft_calendar.md +126 -0
  325. connectonion/docs/useful_tools/outlook.md +140 -0
  326. connectonion/docs/useful_tools/send_email.md +423 -0
  327. connectonion/docs/useful_tools/shell.md +115 -0
  328. connectonion/docs/useful_tools/slash_command.md +116 -0
  329. connectonion/docs/useful_tools/terminal.md +115 -0
  330. connectonion/docs/useful_tools/todo_list.md +272 -0
  331. connectonion/docs/useful_tools/web_fetch.md +150 -0
  332. connectonion/docs/vibe-coding-guide.md +97 -0
  333. connectonion/docs/windows-support.md +258 -0
  334. connectonion/logger.py +3 -3
  335. connectonion/network/__init__.py +19 -6
  336. connectonion/network/asgi/__init__.py +81 -0
  337. connectonion/network/asgi/http.py +205 -0
  338. connectonion/network/asgi/websocket.py +217 -0
  339. connectonion/network/connect.py +232 -185
  340. connectonion/network/host/__init__.py +59 -0
  341. connectonion/network/host/auth.py +191 -0
  342. connectonion/network/host/routes.py +135 -0
  343. connectonion/network/host/server.py +289 -0
  344. connectonion/network/host/session.py +78 -0
  345. connectonion/network/io/__init__.py +21 -0
  346. connectonion/network/{connection.py → io/base.py} +17 -42
  347. connectonion/network/io/websocket.py +55 -0
  348. connectonion/network/relay.py +37 -16
  349. connectonion/network/trust/__init__.py +30 -0
  350. connectonion/network/trust/factory.py +138 -0
  351. connectonion/network/{trust_agents.py → trust/prompts.py} +3 -3
  352. connectonion/network/{trust_functions.py → trust/tools.py} +2 -2
  353. connectonion/prompt_files/__init__.py +11 -1
  354. connectonion/prompt_files/react_acknowledge.md +26 -0
  355. connectonion/prompts.py +10 -1
  356. connectonion/tui/chat.py +10 -1
  357. connectonion/tui/divider.py +10 -1
  358. connectonion/tui/dropdown.py +10 -1
  359. connectonion/tui/footer.py +8 -0
  360. connectonion/tui/fuzzy.py +11 -1
  361. connectonion/tui/input.py +118 -70
  362. connectonion/tui/keys.py +133 -6
  363. connectonion/tui/providers.py +11 -1
  364. connectonion/tui/status_bar.py +10 -1
  365. connectonion/useful_events_handlers/__init__.py +8 -0
  366. connectonion/useful_events_handlers/reflect.py +19 -4
  367. connectonion/useful_plugins/__init__.py +2 -1
  368. connectonion/useful_plugins/eval.py +2 -2
  369. connectonion/useful_plugins/gmail_plugin.py +3 -3
  370. connectonion/useful_plugins/image_result_formatter.py +3 -3
  371. connectonion/useful_plugins/re_act.py +114 -28
  372. connectonion/useful_plugins/shell_approval.py +2 -2
  373. connectonion/useful_plugins/system_reminder.py +103 -0
  374. connectonion/useful_plugins/ui_stream.py +18 -133
  375. connectonion/useful_prompts/README.md +61 -0
  376. connectonion/useful_prompts/__init__.py +45 -0
  377. connectonion/useful_prompts/coding_agent/README.md +106 -0
  378. connectonion/useful_prompts/coding_agent/assembler.py +123 -0
  379. connectonion/useful_prompts/coding_agent/prompts/main.md +227 -0
  380. connectonion/useful_prompts/coding_agent/prompts/tools/ask_user.md +61 -0
  381. connectonion/useful_prompts/coding_agent/prompts/tools/background.md +57 -0
  382. connectonion/useful_prompts/coding_agent/prompts/tools/edit.md +90 -0
  383. connectonion/useful_prompts/coding_agent/prompts/tools/glob.md +52 -0
  384. connectonion/useful_prompts/coding_agent/prompts/tools/grep.md +55 -0
  385. connectonion/useful_prompts/coding_agent/prompts/tools/plan_mode.md +80 -0
  386. connectonion/useful_prompts/coding_agent/prompts/tools/read.md +40 -0
  387. connectonion/useful_prompts/coding_agent/prompts/tools/shell.md +67 -0
  388. connectonion/useful_prompts/coding_agent/prompts/tools/task.md +51 -0
  389. connectonion/useful_prompts/coding_agent/prompts/tools/todo.md +139 -0
  390. connectonion/useful_prompts/coding_agent/prompts/tools/write.md +48 -0
  391. connectonion/useful_prompts/system-reminders/security-warning.md +14 -0
  392. connectonion/useful_prompts/system-reminders/test-reminder.md +11 -0
  393. connectonion/useful_tools/__init__.py +31 -4
  394. connectonion/useful_tools/ask_user.py +35 -0
  395. connectonion/useful_tools/bash.py +69 -0
  396. connectonion/useful_tools/diff_writer.py +186 -94
  397. connectonion/useful_tools/edit.py +102 -0
  398. connectonion/useful_tools/glob_files.py +97 -0
  399. connectonion/useful_tools/grep_files.py +171 -0
  400. connectonion/useful_tools/multi_edit.py +116 -0
  401. connectonion/useful_tools/read_file.py +73 -0
  402. connectonion/useful_tools/shell.py +50 -45
  403. connectonion/useful_tools/write_file.py +129 -0
  404. {connectonion-0.6.1.dist-info → connectonion-0.6.3.dist-info}/METADATA +10 -3
  405. connectonion-0.6.3.dist-info/RECORD +469 -0
  406. connectonion/cli/browser_agent/scroll_strategies.py +0 -276
  407. connectonion/network/asgi.py +0 -407
  408. connectonion/network/host.py +0 -616
  409. connectonion/network/trust.py +0 -166
  410. connectonion-0.6.1.dist-info/RECORD +0 -123
  411. /connectonion/cli/{docs → co_ai/prompts/connectonion}/connectonion.md +0 -0
  412. {connectonion-0.6.1.dist-info → connectonion-0.6.3.dist-info}/WHEEL +0 -0
  413. {connectonion-0.6.1.dist-info → connectonion-0.6.3.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,1026 @@
1
+ # Interactive Debugging for AI Agents
2
+
3
+ **Debug your agents like you debug code** - pause at breakpoints, inspect state, modify variables, and explore "what if" scenarios.
4
+
5
+ > **Most Important:** Use arrow keys to navigate menus, or press `c` to continue. That's all you need to know to start!
6
+
7
+ ## Feature Status (Updated Oct 20, 2025)
8
+
9
+ | Feature | Status | Notes |
10
+ |---------|--------|-------|
11
+ | Continue execution | ✅ Available (v0.3.2) | Press `c` or Enter |
12
+ | Edit variables (Python REPL) | ✅ Available (v0.3.2) | Press `e` for full Python shell |
13
+ | Stop debugging | ✅ Available (v0.3.2) | Press `q` to exit |
14
+ | Source code display | ✅ Available (v0.3.2) | Shows actual function with line numbers |
15
+ | Next action preview | ✅ Available (v0.3.2) | See what LLM plans next |
16
+ | **Ask AI for help** | 🚧 Coming by Nov 2 | Context-aware debugging assistance |
17
+ | **View execution trace** | 🚧 Coming by Nov 2 | Full timeline visualization |
18
+ | **Toggle step mode** | 🚧 Coming by Nov 2 | Pause at every tool |
19
+ | **Universal commands** | 🚧 Coming by Nov 2 | `/menu`, `/continue`, `?` |
20
+
21
+ **Current version:** v0.3.2
22
+ **Next release:** v0.4.0 (targeting Nov 2, 2025)
23
+
24
+ ## Quick Start
25
+
26
+ ```python
27
+ from connectonion import Agent, xray
28
+
29
+ @xray # Tools with @xray become breakpoints
30
+ def search_emails(query: str):
31
+ return api.search(query)
32
+
33
+ def send_email(to: str, body: str):
34
+ return api.send(to, body)
35
+
36
+ agent = Agent(
37
+ name="email_assistant",
38
+ tools=[search_emails, send_email]
39
+ )
40
+
41
+ # Launch interactive debug session
42
+ agent.auto_debug()
43
+ ```
44
+
45
+ **What happens:**
46
+
47
+ ```
48
+ 🔍 Interactive Debug Session Started
49
+ Agent: email_assistant | Tools: 2
50
+
51
+ 💡 Quick Tips:
52
+ - Tools with @xray will pause for inspection
53
+ - Use arrow keys to navigate menus
54
+ - Press '?' anytime for help
55
+
56
+ Type your message to the agent:
57
+ > Send email to John
58
+
59
+ ────────────────────────────────────────────────────
60
+
61
+ Iteration 1/10
62
+ → LLM Request (co/gemini-2.5-pro)
63
+ ← LLM Response (234ms): 2 tool calls
64
+
65
+ → Tool: search_emails({"query": "John"})
66
+ ← Result (123ms): Found 1 email from john@company.com
67
+
68
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
69
+ @xray BREAKPOINT: search_emails
70
+
71
+ Local Variables:
72
+ query = "John"
73
+ result = "Found 1 email from john@company.com"
74
+ tool_args = {"query": "John"}
75
+
76
+ Context:
77
+ User: "Send email to John"
78
+ Iteration: 1/10
79
+ Tools executed: []
80
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
81
+
82
+ What do you want to do?
83
+ → Continue execution 🚀 [c or Enter]
84
+ Edit values 🔍 [e]
85
+ Quit debugging 🚫 [q]
86
+
87
+ 💡 Coming soon (by Nov 2): Ask AI [a], View trace [v], Step mode [s]
88
+ >
89
+ ```
90
+
91
+ **Press `c` or use arrow to select "Continue":**
92
+
93
+ ```
94
+ > c
95
+
96
+ → Tool: send_email(to="john@company.com", body="Following up...")
97
+ ← Result (187ms): Email sent successfully
98
+
99
+ ✓ Task complete (1.5s)
100
+
101
+ Type your message to the agent:
102
+ >
103
+ ```
104
+
105
+ ---
106
+
107
+ `★ Insight ─────────────────────────────────────`
108
+ **Why this design works:**
109
+ 1. **Always show tips** - Learn by doing, no documentation lookup needed
110
+ 2. **Multiple input methods** - Arrow keys (beginner) or shortcuts (power user)
111
+ 3. **Universal commands** - `/menu`, `/continue`, `?` work everywhere
112
+ 4. **Clear mode indicators** - Always know if you're in AI, Python, or menu mode
113
+ `─────────────────────────────────────────────────`
114
+
115
+ ---
116
+
117
+ ## The Interactive Menu
118
+
119
+ At every `@xray` breakpoint, you see this menu:
120
+
121
+ ```
122
+ What do you want to do?
123
+ → Continue execution 🚀 [c or Enter]
124
+ Edit values 🔍 [e]
125
+ Quit debugging 🚫 [q]
126
+
127
+ 💡 Coming soon (by Nov 2): Ask AI [a], View trace [v], Step mode [s]
128
+ >
129
+ ```
130
+
131
+ ### Two Ways to Select
132
+
133
+ **Method 1: Arrow Keys** (Beginner-friendly)
134
+ - Use `↑` and `↓` to highlight option
135
+ - Press `Enter` to select
136
+
137
+ **Method 2: Shortcuts** (Power user) - ✅ Available now
138
+ - Type `c` for Continue
139
+ - Type `e` for Edit
140
+ - Type `q` for Quit
141
+
142
+ **🚧 Coming by Nov 2:**
143
+ - Type `a` for Ask AI
144
+ - Type `v` for View trace
145
+ - Type `s` for Step mode
146
+
147
+ Both methods do exactly the same thing - use whichever feels natural!
148
+
149
+ ---
150
+
151
+ ## Continue Execution ✅
152
+
153
+ The most common action - just press `c` or `Enter`:
154
+
155
+ ```
156
+ What do you want to do?
157
+ → Continue execution [Enter or c]
158
+ ...
159
+
160
+ > c
161
+
162
+ → Execution resumes...
163
+ → Tool: send_email(...)
164
+ ✓ Complete
165
+ ```
166
+
167
+ **Continue works from anywhere:**
168
+ - From menu: `c` or `Enter`
169
+ - From AI mode: `/continue`
170
+ - From Python mode: `/continue` or `Ctrl+D`
171
+
172
+ ---
173
+
174
+ ## Ask AI for Help 🚧
175
+
176
+ **Coming by Nov 2, 2025**
177
+
178
+ Get context-aware help from AI about what's happening:
179
+
180
+ ```
181
+ > a
182
+
183
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
184
+ AI Help Mode - Ask questions about execution
185
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
186
+
187
+ ai> why did it only find 1 email?
188
+
189
+ 🤖 AI: The search used query="John" which is a broad search term.
190
+ The API might be limiting results, or there's actually only 1 email
191
+ from someone named John in the database.
192
+
193
+ You can check the tool's implementation or test with a modified
194
+ result to see how the agent handles multiple emails.
195
+
196
+ ai> how can I test with more emails?
197
+
198
+ 🤖 AI: You can switch to Python mode and modify the result variable:
199
+
200
+ 1. Type '/menu' to go back to the menu
201
+ 2. Select 'Edit variables (Python)'
202
+ 3. Set: result = ["email1@ex.com", "email2@ex.com", "email3@ex.com"]
203
+ 4. Continue execution to see how the agent handles multiple results
204
+
205
+ ai> what should the query have been?
206
+
207
+ 🤖 AI: Based on your input "Send email to John", the query "John"
208
+ is reasonable. If you want more specific results, the agent could
209
+ have used additional context like "urgent John" or "recent John"
210
+ to narrow down the search.
211
+
212
+ ai>
213
+
214
+ 💡 Tip: '/menu' = back to menu | '/continue' = resume execution | '?' = help
215
+ ```
216
+
217
+ **AI knows everything:**
218
+ - Your agent's code and behavior
219
+ - Current execution state
220
+ - All variables and results
221
+ - Previous tool calls
222
+ - User's original request
223
+
224
+ **Ask questions like:**
225
+ - `why did this happen?`
226
+ - `is this the right result?`
227
+ - `how can I test edge cases?`
228
+ - `what should I do next?`
229
+
230
+ **Getting back:**
231
+ - Type `/menu` → Return to breakpoint menu
232
+ - Type `/continue` → Resume execution immediately
233
+ - Type `?` → Show help
234
+
235
+ ---
236
+
237
+ ## Edit Variables (Python) ✅
238
+
239
+ Modify variables to test "what if" scenarios:
240
+
241
+ ```
242
+ > e
243
+
244
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
245
+ Python Editor - Modify variables to test scenarios
246
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
247
+
248
+ Available variables: query, result, tool_args
249
+
250
+ >>> result
251
+ 'Found 1 email from john@company.com'
252
+
253
+ >>> # Test: What if we found 3 emails?
254
+ >>> result = ["email1@ex.com", "email2@ex.com", "email3@ex.com"]
255
+
256
+ >>> result
257
+ ['email1@ex.com', 'email2@ex.com', 'email3@ex.com']
258
+
259
+ >>> # Test: What if we found no emails?
260
+ >>> result = []
261
+
262
+ >>> result
263
+ []
264
+
265
+ >>>
266
+
267
+ 💡 Tip: '/menu' = back to menu | '/continue' or Ctrl+D = resume | '?' = help
268
+ ```
269
+
270
+ **This is a full Python REPL:**
271
+ - View variables: `>>> result`
272
+ - Modify data: `>>> result = new_value`
273
+ - Execute code: `>>> len(result)`
274
+ - Multi-line: Just keep typing
275
+
276
+ **Test scenarios:**
277
+ ```python
278
+ >>> # Empty results
279
+ >>> result = []
280
+
281
+ >>> # Large dataset
282
+ >>> result = [f"email{i}@example.com" for i in range(100)]
283
+
284
+ >>> # Error case
285
+ >>> result = {"error": "API timeout", "status": 500}
286
+
287
+ >>> # Edge case
288
+ >>> result = "unusual@格式.com" # Unicode email
289
+ ```
290
+
291
+ **Getting back:**
292
+ - Type `/menu` → Return to breakpoint menu
293
+ - Type `/continue` → Resume with modified variables
294
+ - Press `Ctrl+D` → Resume with modified variables
295
+ - Type `?` → Show help
296
+
297
+ ---
298
+
299
+ ## View Execution Trace 🚧
300
+
301
+ **Coming by Nov 2, 2025**
302
+
303
+ See the full execution history:
304
+
305
+ ```
306
+ > v
307
+
308
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
309
+ Execution Trace
310
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
311
+
312
+ Timeline:
313
+ [0] user_input: "Send email to John"
314
+ [1] llm_call: 234ms → 2 tool calls requested
315
+ [2] tool: search_emails ✓ 123ms ← YOU ARE HERE
316
+ [3] (pending) tool: send_email
317
+
318
+ Conversation Messages:
319
+ [0] system: "You are an email assistant..."
320
+ [1] user: "Send email to John"
321
+ [2] assistant: [tool_calls: search_emails, send_email]
322
+ [3] tool: "Found 1 email from john@company.com" ← CURRENT
323
+ [4] (pending) tool: send_email
324
+
325
+ Agent State:
326
+ Name: email_assistant
327
+ Model: co/gemini-2.5-pro
328
+ Iteration: 1/10
329
+ Tools available: [search_emails, send_email]
330
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
331
+
332
+ Press Enter to return to menu...
333
+ ```
334
+
335
+ **Shows:**
336
+ - Timeline of all events
337
+ - Conversation history
338
+ - Current position
339
+ - Pending operations
340
+ - Agent configuration
341
+
342
+ ---
343
+
344
+ ## Toggle Step Mode 🚧
345
+
346
+ **Coming by Nov 2, 2025**
347
+
348
+ Pause at **EVERY tool**, not just `@xray` tools:
349
+
350
+ ```
351
+ > s
352
+
353
+ ✓ Step mode enabled - will pause at EVERY tool
354
+
355
+ What do you want to do?
356
+ → Continue execution [Step Mode: ON]
357
+ Ask AI for help [a]
358
+ Edit variables (Python) [e]
359
+ View execution trace [v]
360
+ Toggle step mode [s] ← Toggle off
361
+ Stop debugging [q]
362
+
363
+ 💡 Use ↑↓ arrows and Enter, or type shortcuts
364
+ >
365
+ ```
366
+
367
+ **What happens in step mode:**
368
+
369
+ ```
370
+ > c
371
+
372
+ → Tool: validate_input(...) [No @xray, but pauses anyway!]
373
+ ← Result: Valid
374
+
375
+ [BREAKPOINT - Menu appears]
376
+
377
+ > c
378
+
379
+ → Tool: fetch_data(...)
380
+ ← Result: 50 records
381
+
382
+ [BREAKPOINT - Menu appears]
383
+
384
+ > c
385
+
386
+ → Tool: transform_data(...)
387
+ ← Result: Transformed
388
+
389
+ [BREAKPOINT - Menu appears]
390
+
391
+ > s [Toggle step mode OFF]
392
+
393
+ ✓ Step mode disabled - only pausing at @xray tools
394
+
395
+ > c
396
+
397
+ → Tool: save_result(...)
398
+ → Tool: send_notification(...)
399
+ → Tool: log_activity(...)
400
+ ✓ Complete (no more pauses)
401
+ ```
402
+
403
+ **Use step mode when:**
404
+ - Debugging complex multi-tool workflows
405
+ - Understanding unfamiliar agent behavior
406
+ - Tracing execution step-by-step
407
+ - Finding which tool causes problems
408
+
409
+ ---
410
+
411
+ ## Universal Commands 🚧
412
+
413
+ **Coming by Nov 2, 2025**
414
+
415
+ These commands work **everywhere** (menu, AI mode, Python mode):
416
+
417
+ | Command | What It Does |
418
+ |---------|--------------|
419
+ | `/menu` | Return to breakpoint menu |
420
+ | `/continue` | Resume execution immediately |
421
+ | `?` or `/help` | Show help |
422
+ | `/quit` | Exit debug session |
423
+
424
+ **Example in AI mode:**
425
+ ```
426
+ ai> asking questions...
427
+
428
+ ai> /continue
429
+
430
+ → Resuming execution...
431
+ ✓ Complete
432
+ ```
433
+
434
+ **Example in Python mode:**
435
+ ```
436
+ >>> result = modified_value
437
+
438
+ >>> /continue
439
+
440
+ → Resuming with modified variables...
441
+ ✓ Complete
442
+ ```
443
+
444
+ **Always there when you need them!**
445
+
446
+ ---
447
+
448
+ ## Complete User Journey Example
449
+
450
+ Let's walk through a full debugging session:
451
+
452
+ ```python
453
+ @xray
454
+ def search_products(query: str):
455
+ return api.search(query)
456
+
457
+ def filter_results(products: list, criteria: dict):
458
+ return [p for p in products if matches(p, criteria)]
459
+
460
+ def rank_by_popularity(products: list):
461
+ return sorted(products, key=lambda p: p['sales'], reverse=True)
462
+
463
+ agent = Agent(
464
+ name="shop_assistant",
465
+ tools=[search_products, filter_results, rank_by_popularity]
466
+ )
467
+
468
+ agent.auto_debug()
469
+ ```
470
+
471
+ **Session:**
472
+
473
+ ```
474
+ Type your message to the agent:
475
+ > Find popular purple shoes under $100
476
+
477
+ ────────────────────────────────────────────────────
478
+
479
+ → Tool: search_products({"query": "purple shoes"})
480
+ ← Result: Found 15 products
481
+
482
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
483
+ @xray BREAKPOINT: search_products
484
+
485
+ Local Variables:
486
+ query = "purple shoes"
487
+ result = [15 product objects]
488
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
489
+
490
+ What do you want to do?
491
+ → Continue execution 🚀 [c or Enter]
492
+ Edit values 🔍 [e]
493
+ Quit debugging 🚫 [q]
494
+
495
+ 💡 Coming soon (by Nov 2): Ask AI [a], View trace [v], Step mode [s]
496
+ > a [Select "Ask AI"]
497
+
498
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
499
+ AI Help Mode - Ask questions about execution
500
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
501
+
502
+ ai> what if no products were found?
503
+
504
+ 🤖 AI: Good question! If search_products returned an empty list,
505
+ the filter_results and rank_by_popularity tools would also receive
506
+ empty lists. You can test this scenario by modifying the result
507
+ in Python mode.
508
+
509
+ ai> /menu
510
+
511
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
512
+ @xray BREAKPOINT: search_products
513
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
514
+
515
+ What do you want to do?
516
+ → Continue execution
517
+ Ask AI for help
518
+ Edit variables (Python)
519
+ ...
520
+
521
+ > e [Select "Edit variables"]
522
+
523
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
524
+ Python Editor - Modify variables to test scenarios
525
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
526
+
527
+ >>> result = [] [Test empty result]
528
+
529
+ >>> /continue
530
+
531
+ → Resuming with modified variables...
532
+
533
+ → Tool: filter_results({"products": [], "criteria": {"price": {"max": 100}}})
534
+ ← Result: []
535
+
536
+ → Tool: rank_by_popularity({"products": []})
537
+ ← Result: []
538
+
539
+ Agent: "Sorry, no purple shoes under $100 are available."
540
+
541
+ ✓ Task complete
542
+
543
+ [Success! We tested the empty result scenario and confirmed the agent handles it correctly]
544
+ ```
545
+
546
+ ---
547
+
548
+ `★ Insight ─────────────────────────────────────`
549
+ **Complete workflow:**
550
+ 1. **Hit breakpoint** → See state automatically
551
+ 2. **Ask AI** → Understand what's happening
552
+ 3. **Edit variables** → Test edge cases
553
+ 4. **Continue** → See results
554
+ 5. **Iterate** → Build confidence in agent behavior
555
+
556
+ **No context switching to docs, no memorizing commands - tips guide you through!**
557
+ `─────────────────────────────────────────────────`
558
+
559
+ ---
560
+
561
+ ## Real-World Examples
562
+
563
+ ### Example 1: Debugging Wrong Email Recipient
564
+
565
+ ```python
566
+ @xray
567
+ def find_contact(name: str):
568
+ return contacts_db.search(name)[0] # Bug: returns first match
569
+
570
+ @xray
571
+ def send_email(to: str, message: str):
572
+ return email_api.send(to, message)
573
+
574
+ agent = Agent("email_bot", tools=[find_contact, send_email])
575
+ agent.auto_debug()
576
+ ```
577
+
578
+ **Session:**
579
+
580
+ ```
581
+ > Send birthday wishes to Mike
582
+
583
+ → Tool: find_contact({"name": "Mike"})
584
+ ← Result: mike.jones@old-company.com
585
+
586
+ [BREAKPOINT]
587
+
588
+ > a
589
+
590
+ ai> is this the right email address?
591
+
592
+ 🤖 AI: The result shows "old-company.com" which might be outdated.
593
+ The find_contact tool returns the first match, but there could be
594
+ multiple Mikes in the database. You should verify this is the
595
+ correct person before sending.
596
+
597
+ ai> how can I use the correct email?
598
+
599
+ 🤖 AI: You can modify the result in Python mode to test with the
600
+ correct email, then fix the find_contact tool to use better matching
601
+ logic (like most recent contact, or prompt user to choose).
602
+
603
+ ai> /menu
604
+
605
+ > e
606
+
607
+ >>> result = "mike.anderson@current-company.com"
608
+
609
+ >>> /continue
610
+
611
+ → Tool: send_email(to="mike.anderson@current-company.com", ...)
612
+ ✓ Email sent to correct person!
613
+
614
+ [After debugging, you fix find_contact to return most recent contact]
615
+ ```
616
+
617
+ ---
618
+
619
+ ### Example 2: Testing Edge Cases with Step Mode
620
+
621
+ ```python
622
+ agent = Agent("data_processor", tools=[
623
+ load_file,
624
+ parse_data,
625
+ validate_schema,
626
+ transform_data,
627
+ save_results
628
+ ])
629
+
630
+ agent.auto_debug()
631
+ ```
632
+
633
+ **Session:**
634
+
635
+ ```
636
+ > Process users.csv
637
+
638
+ → Tool: load_file({"path": "users.csv"})
639
+ ← Result: Loaded 1000 rows
640
+
641
+ [BREAKPOINT]
642
+
643
+ > s [Enable step mode to see ALL tools]
644
+
645
+ ✓ Step mode enabled
646
+
647
+ > c
648
+
649
+ → Tool: parse_data({"rows": 1000})
650
+ ← Result: Parsed 1000 records
651
+
652
+ [BREAKPOINT - Step mode pauses here even without @xray]
653
+
654
+ > e
655
+
656
+ >>> # Test: What if parsing found corrupt data?
657
+ >>> result = {"valid": 800, "corrupt": 200, "data": [...]}
658
+
659
+ >>> /continue
660
+
661
+ → Tool: validate_schema({"valid": 800, "corrupt": 200})
662
+ ← Result: Validation failed - 200 corrupt records
663
+
664
+ [BREAKPOINT]
665
+
666
+ > a
667
+
668
+ ai> should the agent stop or continue with valid records?
669
+
670
+ 🤖 AI: The validate_schema tool failed, so the agent should either:
671
+ 1. Stop and report the error
672
+ 2. Continue with only the 800 valid records
673
+ 3. Attempt to fix the corrupt records
674
+
675
+ Check your error handling logic in the agent's system prompt.
676
+
677
+ ai> /continue
678
+
679
+ → Tool: transform_data(...)
680
+ ✓ Agent handled error gracefully!
681
+
682
+ [After debugging, you improve error handling in system prompt]
683
+ ```
684
+
685
+ ---
686
+
687
+ ### Example 3: Prompt Engineering
688
+
689
+ ```python
690
+ agent = Agent(
691
+ name="support_bot",
692
+ system_prompt="Help customers with their orders.",
693
+ tools=[check_order, cancel_order, refund_order]
694
+ )
695
+
696
+ agent.auto_debug()
697
+ ```
698
+
699
+ **Session:**
700
+
701
+ ```
702
+ > Cancel my order and refund me
703
+
704
+ → Tool: cancel_order({"order_id": "auto-detected"})
705
+ ← Result: Order cancelled
706
+
707
+ [BREAKPOINT]
708
+
709
+ > a
710
+
711
+ ai> should the agent verify the order exists first?
712
+
713
+ 🤖 AI: Yes! The agent should use check_order BEFORE cancelling
714
+ to verify:
715
+ 1. Order exists
716
+ 2. Order status allows cancellation
717
+ 3. Order belongs to the user
718
+
719
+ Then after cancelling, check_order again to verify success before
720
+ processing refund.
721
+
722
+ ai> what should I add to the system prompt?
723
+
724
+ 🤖 AI: Add this to your system_prompt:
725
+
726
+ "When handling order operations:
727
+ 1. Always use check_order first to verify order exists and status
728
+ 2. After making changes, verify success with check_order again
729
+ 3. Only proceed to next step after confirming previous step succeeded"
730
+
731
+ ai> /continue
732
+
733
+ → Tool: refund_order(...)
734
+ ← Result: Refund processed
735
+
736
+ ✓ Complete
737
+
738
+ [Exit session, update system_prompt with the improvement]
739
+ ```
740
+
741
+ ---
742
+
743
+ ## Best Practices
744
+
745
+ ### 1. Strategic `@xray` Placement
746
+
747
+ ```python
748
+ @xray # ✅ External API calls
749
+ def fetch_user_data(user_id: str):
750
+ return api.get(f"/users/{user_id}")
751
+
752
+ @xray # ✅ Database operations
753
+ def save_order(order: dict):
754
+ return db.insert("orders", order)
755
+
756
+ def format_date(date: str): # ❌ Simple utility - no need
757
+ return datetime.parse(date)
758
+
759
+ @xray # ✅ Complex business logic
760
+ def calculate_price(items: list, discounts: dict):
761
+ # 50 lines of pricing logic
762
+ return total
763
+ ```
764
+
765
+ **Add `@xray` to:**
766
+ - API calls
767
+ - Database operations
768
+ - Complex logic
769
+ - Tools that often fail
770
+ - Tools with important business logic
771
+
772
+ **Skip `@xray` for:**
773
+ - Simple utilities
774
+ - Format converters
775
+ - Pure functions with no side effects
776
+
777
+ **Or use step mode to see everything!**
778
+
779
+ ---
780
+
781
+ ### 2. Use AI to Understand
782
+
783
+ Before modifying anything, ask AI:
784
+
785
+ ```
786
+ ai> what is this tool doing?
787
+ ai> why did it return this result?
788
+ ai> is this the expected behavior?
789
+ ai> what edge cases should I test?
790
+ ```
791
+
792
+ **AI has full context** - it knows your code, execution state, and history.
793
+
794
+ ---
795
+
796
+ ### 3. Test Edge Cases in Python Mode
797
+
798
+ ```python
799
+ >>> # Empty results
800
+ >>> result = []
801
+
802
+ >>> # Large dataset
803
+ >>> result = [item for item in range(10000)]
804
+
805
+ >>> # Error responses
806
+ >>> result = {"error": "API timeout", "retry_after": 60}
807
+
808
+ >>> # Malformed data
809
+ >>> result = "unexpected string instead of list"
810
+
811
+ >>> # Unicode/special characters
812
+ >>> result = {"name": "用户名", "emoji": "🎉"}
813
+ ```
814
+
815
+ **Time-travel debugging** - change one variable, see entire agent behavior change.
816
+
817
+ ---
818
+
819
+ ### 4. Step Mode for Complex Workflows
820
+
821
+ ```python
822
+ # Normal: Only @xray breakpoints
823
+ agent.auto_debug()
824
+
825
+ # Deep dive: See every tool
826
+ agent.auto_debug(step=True)
827
+
828
+ # Or toggle during session
829
+ > s [Enable step mode]
830
+ > s [Disable step mode]
831
+ ```
832
+
833
+ **Use step mode when:**
834
+ - You don't know which tool is causing problems
835
+ - Understanding a complex workflow
836
+ - Tracing data flow through multiple tools
837
+ - Learning how an unfamiliar agent works
838
+
839
+ ---
840
+
841
+ ### 5. Always Check Trace Before Editing
842
+
843
+ ```
844
+ > v [View execution trace]
845
+
846
+ [See full context]
847
+
848
+ > [Enter to go back]
849
+
850
+ > e [Now edit with full understanding]
851
+ ```
852
+
853
+ **Understand before you modify!**
854
+
855
+ ---
856
+
857
+ ## Command Reference
858
+
859
+ ### Menu Options (v0.3.2)
860
+
861
+ | Option | Shortcut | Status | Description |
862
+ |--------|----------|--------|-------------|
863
+ | Continue execution | `c` or `Enter` | ✅ Available | Resume agent execution |
864
+ | Edit variables (Python) | `e` | ✅ Available | Enter Python REPL to modify state |
865
+ | Stop debugging | `q` | ✅ Available | Exit debug session |
866
+ | **Ask AI for help** | `a` | 🚧 Nov 2 | Enter AI mode for questions |
867
+ | **View execution trace** | `v` | 🚧 Nov 2 | Show full execution history |
868
+ | **Toggle step mode** | `s` | 🚧 Nov 2 | Pause at ALL tools (not just @xray) |
869
+
870
+ ### Universal Commands 🚧 (Coming by Nov 2)
871
+
872
+ | Command | Description |
873
+ |---------|-------------|
874
+ | `/menu` | Return to breakpoint menu |
875
+ | `/continue` | Resume execution immediately |
876
+ | `?` or `/help` | Show help |
877
+ | `/quit` | Exit debug session |
878
+
879
+ ### AI Mode Commands 🚧 (Coming by Nov 2)
880
+
881
+ | Input | What Happens |
882
+ |-------|--------------|
883
+ | Natural question | AI answers with full context |
884
+ | `/menu` | Back to menu |
885
+ | `/continue` | Resume execution |
886
+ | `?` | Show help |
887
+
888
+ ### Python Mode Commands ✅ (Available in v0.3.2)
889
+
890
+ | Input | What Happens |
891
+ |-------|--------------|
892
+ | Python code | Execute in current scope |
893
+ | Exit REPL | Press `Ctrl+D` to continue execution |
894
+
895
+ ---
896
+
897
+ ## When to Use
898
+
899
+ ### ✅ Perfect For
900
+
901
+ - **Development** - Building and testing agents
902
+ - **Debugging** - Finding why agents behave unexpectedly
903
+ - **Learning** - Understanding how agents make decisions
904
+ - **Testing edge cases** - Exploring "what if" scenarios
905
+ - **Prompt engineering** - Discovering what instructions work best
906
+ - **Exploring behavior** - Seeing tool execution in detail
907
+
908
+ ### ❌ Not For
909
+
910
+ - **Production** - Requires human interaction
911
+ - **Automated tests** - Use assertions instead
912
+ - **Simple scripts** - Overkill for basic tasks
913
+ - **CI/CD pipelines** - Not non-interactive
914
+
915
+ ### 🤝 Use Together With
916
+
917
+ - **Unit tests** - Tests verify expected behavior automatically
918
+ - **Logging** - Logs record what happened for post-mortem
919
+ - **`@xray` decorator** - Visibility into tool execution
920
+ - **Step mode** - Deep visibility when needed
921
+ - **Type hints** - Better variable inspection
922
+
923
+ ---
924
+
925
+ ## FAQ
926
+
927
+ **Q: How do I continue execution?**
928
+ A: Three ways:
929
+ - From menu: Press `c` or `Enter`
930
+ - From AI/Python mode: Type `/continue` or press `Ctrl+D` (Python only)
931
+ - From anywhere: Type `/continue`
932
+
933
+ **Q: How do I go back to the menu?**
934
+ A: Type `/menu` from any mode (AI or Python)
935
+
936
+ **Q: What's the difference between `@xray` and step mode?**
937
+ A:
938
+ - **`@xray` breakpoints** - Pause only at marked tools (selective)
939
+ - **Step mode** - Pause at EVERY tool (comprehensive)
940
+
941
+ Toggle step mode with `s` in the menu.
942
+
943
+ **Q: How do I ask AI for help?**
944
+ A: Press `a` in the menu, then ask questions naturally:
945
+ ```
946
+ ai> why did this happen?
947
+ ai> what should I do?
948
+ ai> how can I test this?
949
+ ```
950
+
951
+ **Q: How do I modify variables?**
952
+ A: Press `e` in the menu, then use Python:
953
+ ```
954
+ >>> result = new_value
955
+ >>> /continue
956
+ ```
957
+
958
+ **Q: Can I switch between AI and Python modes?**
959
+ A: Yes! Use `/menu` to go back, then select the other mode.
960
+
961
+ **Q: What if I forget the commands?**
962
+ A: Tips are always shown at the bottom of each mode. Or press `?` for help.
963
+
964
+ **Q: Works in Jupyter notebooks?**
965
+ A: Yes! Works in any Python environment with terminal support.
966
+
967
+ **Q: Can I still use `agent.input()` directly?**
968
+ A: Yes - `.auto_debug()` is optional. Use it only when you need interactive debugging.
969
+
970
+ **Q: Is this slow?**
971
+ A: No - execution speed is the same. Pausing only happens at breakpoints.
972
+
973
+ **Q: Production usage?**
974
+ A: No - this is a development tool only. Don't use in production.
975
+
976
+ **Q: What if I have no `@xray` tools?**
977
+ A: The session automatically enables step mode (pauses at all tools).
978
+
979
+ **Q: Can I script or automate debugging?**
980
+ A: Not currently - this is an interactive tool. For automation, use unit tests with assertions.
981
+
982
+ ---
983
+
984
+ ## Keyboard Shortcuts Summary (v0.3.2)
985
+
986
+ ### Menu Navigation ✅
987
+ - `↑` `↓` - Move selection
988
+ - `Enter` - Select highlighted option
989
+ - `c` - Continue ✅
990
+ - `e` - Edit Python ✅
991
+ - `q` - Quit ✅
992
+
993
+ **🚧 Coming by Nov 2:**
994
+ - `a` - Ask AI
995
+ - `v` - View trace
996
+ - `s` - Step mode
997
+
998
+ ### Python Mode ✅
999
+ - Type Python code
1000
+ - `Ctrl+D` - Resume execution
1001
+
1002
+ ---
1003
+
1004
+ `★ Insight ─────────────────────────────────────`
1005
+ **Design principles:**
1006
+ 1. **Always show tips** - Zero documentation lookup needed
1007
+ 2. **Multiple paths** - Arrow keys OR shortcuts, both work
1008
+ 3. **Universal commands** - `/menu`, `/continue`, `?` work everywhere
1009
+ 4. **Clear modes** - Always know where you are (menu, AI, Python)
1010
+ 5. **No dead ends** - Always a way to continue or go back
1011
+ `─────────────────────────────────────────────────`
1012
+
1013
+ ---
1014
+
1015
+ ## See Also
1016
+
1017
+ - [Getting Started](quickstart.md) - ConnectOnion basics
1018
+ - [`@xray` Decorator](xray.md) - Tool visibility and context
1019
+ - [Tools Guide](concepts/tools.md) - Creating tools
1020
+ - [Examples](examples.md#debugging) - More debugging examples
1021
+
1022
+ ---
1023
+
1024
+ **Ready to debug?** Just call `agent.auto_debug()` and explore! 🔍
1025
+
1026
+ The tips will guide you through - no memorization needed.