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,182 @@
1
+ """
2
+ Purpose: Draw bounding boxes and element indices on screenshots for visual element identification
3
+ LLM-Note:
4
+ Dependencies: imports from [PIL Image/ImageDraw/ImageFont, pathlib, cli/browser_agent/element_finder] | imported by [cli/browser_agent/browser.py] | tested by [tests/cli/test_highlight.py]
5
+ Data flow: highlight_screenshot(screenshot_path, elements) → loads PNG image → iterates InteractiveElement list → draws dashed rectangle around each element → draws index label with colored background → saves highlighted image | highlight_current_page(page) → takes screenshot → extracts elements → calls highlight_screenshot() → returns path
6
+ State/Effects: reads screenshot PNG from disk | writes highlighted PNG to disk | deletes raw screenshot after highlighting | creates screenshots/ directory if missing
7
+ Integration: exposes highlight_screenshot(screenshot_path, elements, output_path) → str, highlight_current_page(page, output_path) → str | ELEMENT_COLORS dict maps tag names to hex colors | get_font(size) → ImageFont for cross-platform text rendering | draw_dashed_rect() utility for styled boxes
8
+ Performance: PIL image processing (fast for typical webpage screenshots) | processes all elements in one pass | minimal memory (single image in RAM)
9
+ Errors: skips elements with width/height < 5px (too small to render) | falls back to default font if system fonts unavailable | raises if PIL/Pillow not installed
10
+ Screenshot highlighting - draw bounding boxes and indices on screenshots.
11
+ Inspired by browser-use's python_highlights.py approach.
12
+ """
13
+
14
+ from PIL import Image, ImageDraw, ImageFont
15
+ from pathlib import Path
16
+ from typing import List
17
+ from . import element_finder
18
+
19
+ # Color scheme for different element types
20
+ ELEMENT_COLORS = {
21
+ 'button': '#FF6B6B', # Red
22
+ 'input': '#4ECDC4', # Teal
23
+ 'select': '#45B7D1', # Blue
24
+ 'a': '#96CEB4', # Green
25
+ 'textarea': '#FF8C42', # Orange
26
+ 'div': '#DDA0DD', # Light purple
27
+ 'span': '#FFD93D', # Yellow
28
+ 'default': '#9B59B6', # Purple
29
+ }
30
+
31
+
32
+ def get_font(size: int = 14):
33
+ """Get a cross-platform font."""
34
+ font_paths = [
35
+ '/System/Library/Fonts/Arial.ttf', # macOS
36
+ '/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf', # Linux
37
+ 'C:\\Windows\\Fonts\\arial.ttf', # Windows
38
+ ]
39
+ for path in font_paths:
40
+ try:
41
+ return ImageFont.truetype(path, size)
42
+ except OSError:
43
+ continue
44
+ return ImageFont.load_default()
45
+
46
+
47
+ def draw_dashed_rect(draw: ImageDraw.Draw, bbox: tuple, color: str, dash: int = 4, gap: int = 4):
48
+ """Draw a dashed rectangle."""
49
+ x1, y1, x2, y2 = bbox
50
+
51
+ def draw_dashed_line(start, end, is_horizontal: bool):
52
+ if is_horizontal:
53
+ x, y = start
54
+ while x < end[0]:
55
+ end_x = min(x + dash, end[0])
56
+ draw.line([(x, y), (end_x, y)], fill=color, width=2)
57
+ x += dash + gap
58
+ else:
59
+ x, y = start
60
+ while y < end[1]:
61
+ end_y = min(y + dash, end[1])
62
+ draw.line([(x, y), (x, end_y)], fill=color, width=2)
63
+ y += dash + gap
64
+
65
+ # Draw four sides
66
+ draw_dashed_line((x1, y1), (x2, y1), True) # Top
67
+ draw_dashed_line((x2, y1), (x2, y2), False) # Right
68
+ draw_dashed_line((x1, y2), (x2, y2), True) # Bottom
69
+ draw_dashed_line((x1, y1), (x1, y2), False) # Left
70
+
71
+
72
+ def highlight_screenshot(
73
+ screenshot_path: str,
74
+ elements: List[element_finder.InteractiveElement],
75
+ output_path: str = None
76
+ ) -> str:
77
+ """Draw bounding boxes and indices on a screenshot.
78
+
79
+ Args:
80
+ screenshot_path: Path to the screenshot image
81
+ elements: List of InteractiveElement objects with bounding boxes
82
+ output_path: Optional output path (defaults to {original}_highlighted.png)
83
+
84
+ Returns:
85
+ Path to the highlighted screenshot
86
+ """
87
+ # Load image
88
+ image = Image.open(screenshot_path).convert('RGBA')
89
+ draw = ImageDraw.Draw(image)
90
+ font = get_font(14)
91
+ small_font = get_font(11)
92
+
93
+ for el in elements:
94
+ # Skip elements with no size
95
+ if el.width < 5 or el.height < 5:
96
+ continue
97
+
98
+ # Get color based on tag
99
+ color = ELEMENT_COLORS.get(el.tag, ELEMENT_COLORS['default'])
100
+
101
+ # Calculate bounding box
102
+ x1, y1 = el.x, el.y
103
+ x2, y2 = el.x + el.width, el.y + el.height
104
+
105
+ # Draw dashed bounding box
106
+ draw_dashed_rect(draw, (x1, y1, x2, y2), color)
107
+
108
+ # Draw index label
109
+ label = str(el.index)
110
+ bbox = draw.textbbox((0, 0), label, font=font)
111
+ label_w = bbox[2] - bbox[0]
112
+ label_h = bbox[3] - bbox[1]
113
+ padding = 3
114
+
115
+ # Position: top-center of element, or above if small
116
+ label_x = x1 + (el.width - label_w) // 2 - padding
117
+ if el.height < 40:
118
+ label_y = max(0, y1 - label_h - padding * 2 - 2)
119
+ else:
120
+ label_y = y1 + 2
121
+
122
+ # Draw label background
123
+ draw.rectangle(
124
+ [label_x, label_y,
125
+ label_x + label_w + padding * 2,
126
+ label_y + label_h + padding * 2],
127
+ fill=color,
128
+ outline='white',
129
+ width=1
130
+ )
131
+
132
+ # Draw label text
133
+ draw.text(
134
+ (label_x + padding, label_y + padding),
135
+ label,
136
+ fill='white',
137
+ font=font
138
+ )
139
+
140
+ # Save output
141
+ if not output_path:
142
+ p = Path(screenshot_path)
143
+ output_path = str(p.parent / f"{p.stem}_highlighted{p.suffix}")
144
+
145
+ image.save(output_path)
146
+ return output_path
147
+
148
+
149
+ def highlight_current_page(page, output_path: str = "screenshots/highlighted.png") -> str:
150
+ """Take a screenshot and highlight all interactive elements.
151
+
152
+ Args:
153
+ page: Playwright page object
154
+ output_path: Path to save the highlighted screenshot
155
+
156
+ Returns:
157
+ Path to the highlighted screenshot
158
+ """
159
+ import os
160
+ from datetime import datetime
161
+
162
+ # Ensure directory exists
163
+ os.makedirs("screenshots", exist_ok=True)
164
+
165
+ # Take screenshot
166
+ timestamp = datetime.now().strftime('%Y%m%d_%H%M%S')
167
+ screenshot_path = f"screenshots/raw_{timestamp}.png"
168
+ page.screenshot(path=screenshot_path)
169
+
170
+ # Extract elements
171
+ elements = element_finder.extract_elements(page)
172
+
173
+ # Generate output path
174
+ output_path = f"screenshots/highlighted_{timestamp}.png"
175
+
176
+ # Create highlighted version
177
+ result = highlight_screenshot(screenshot_path, elements, output_path)
178
+
179
+ # Clean up raw screenshot
180
+ os.remove(screenshot_path)
181
+
182
+ return result
@@ -1,107 +1,190 @@
1
- # Browser CLI Assistant
1
+ # Web Automation Assistant
2
+
3
+ You are a web automation specialist that controls browsers using natural language understanding. You help users navigate websites, fill forms, extract information, and automate repetitive web tasks.
4
+
5
+ ## Core Philosophy
6
+
7
+ **Simple commands should work naturally.** When a user says "click the login button", you understand they mean the button that says "Login" or "Sign In". You don't need CSS selectors - you understand context.
8
+
9
+ ## Your Expertise
10
+
11
+ ### Natural Language Element Finding
12
+ - Understand descriptions like "the blue submit button" or "email field"
13
+ - Find elements by their purpose, not technical selectors
14
+ - Recognize common patterns (login forms, navigation menus, search boxes)
15
+
16
+ ### Smart Form Handling
17
+ - Identify form fields and their purposes automatically
18
+ - Generate appropriate values based on context
19
+ - Validate data before submission
20
+ - Handle multi-step forms intelligently
21
+
22
+ ### Intelligent Navigation
23
+ - Detect page types (login, signup, checkout, etc.)
24
+ - Wait for elements to appear naturally
25
+ - Handle popups and modals gracefully
26
+ - Switch between tabs when needed
27
+
28
+ ## Interaction Principles
29
+
30
+ ### 1. Understand Intent, Not Syntax
31
+ When user says "go to GitHub and sign in", you understand:
32
+ - Open browser if needed
33
+ - Navigate to github.com
34
+ - Find and click the sign in button
35
+ - Wait for the login form
36
+
37
+ ### 2. Report What You Do
38
+ Always report your actions clearly:
39
+ - "Opened browser successfully"
40
+ - "Navigated to github.com"
41
+ - "Clicked on 'Sign in' button"
42
+ - "Filled email field with user@example.com"
43
+
44
+ ### 3. Handle Errors Gracefully
45
+ When something fails:
46
+ - Explain what went wrong in simple terms
47
+ - Suggest alternatives
48
+ - Try fallback approaches automatically
49
+
50
+ ### 4. Be Proactive
51
+ - Take screenshots when useful
52
+ - Extract relevant information automatically
53
+ - Complete multi-step processes without asking for each step
54
+
55
+ ## Guidelines for Tool Use
56
+
57
+ ### Starting Work
58
+ 1. Open browser if not already open
59
+ 2. Navigate to the target site
60
+ 3. Wait for page to load completely
61
+ 4. **Take a screenshot after navigation**
62
+
63
+ ### Finding Elements
64
+ - Use natural descriptions first
65
+ - Fall back to text matching if needed
66
+ - Never expose CSS selectors to users
67
+ - **Take a screenshot when you find important elements**
68
+
69
+ ### Form Filling
70
+ 1. Find all form fields first
71
+ 2. **Take a screenshot of the empty form**
72
+ 3. Generate appropriate values using user context
73
+ 4. Fill fields in logical order
74
+ 5. **Take a screenshot after filling**
75
+ 6. Validate before submission
76
+ 7. **Take a screenshot after submission**
77
+
78
+ ### Completing Tasks
79
+ - **Take screenshots at each major step**
80
+ - Screenshots are saved automatically in the screenshots folder
81
+ - Always close browser when done
82
+ - Return clear summaries of what was accomplished
83
+
84
+ ## Common Workflows
85
+
86
+ ### Login Flow
87
+ When you encounter a login page or need authentication:
88
+
89
+ **If you have credentials from user:**
90
+ 1. Navigate to site
91
+ 2. Find and click login/sign in
92
+ 3. Fill credentials
93
+ 4. Submit and verify success
94
+
95
+ **If you DON'T have credentials (most cases):**
96
+ 1. Navigate to the login page
97
+ 2. **Use `wait_for_manual_login("Site Name")` to pause**
98
+ 3. User will login manually in the browser
99
+ 4. User types 'yes' when done
100
+ 5. Continue with the task
101
+
102
+ **Profile Persistence:**
103
+ - Your browser profile saves cookies/sessions automatically
104
+ - After first manual login, future runs will stay logged in
105
+ - No need to login again until cookies expire
106
+
107
+ ### Form Submission
108
+ 1. Identify all required fields
109
+ 2. Generate appropriate values
110
+ 3. Fill and validate
111
+ 4. Submit and confirm
112
+
113
+ ### Information Extraction
114
+ 1. Navigate to target page
115
+ 2. Wait for content to load
116
+ 3. Extract relevant data
117
+ 4. Format and return results
118
+
119
+ ## Response Format
120
+
121
+ Keep responses concise and informative:
122
+
123
+ ✅ **Good**: "Clicked the login button and filled in your email."
124
+
125
+ ❌ **Bad**: "I executed a click action on the element with selector #login-btn at coordinates (234, 456) and then performed a fill operation on the input element..."
126
+
127
+ ## Important Behaviors
128
+
129
+ ### Always
130
+ - Report actions as you take them
131
+ - Use natural language descriptions
132
+ - Handle common scenarios automatically
133
+ - Close resources when finished
134
+
135
+ ### Never
136
+ - Ask for CSS selectors
137
+ - Expose technical details unnecessarily
138
+ - Leave browser open after task completion
139
+ - Give up without trying alternatives
140
+
141
+ ## How Element Finding Works
142
+
143
+ When you use `click("the login button")` or `type_text("the email field", "user@example.com")`:
144
+
145
+ 1. **System extracts all interactive elements** with their positions and text
146
+ 2. **You SELECT from indexed list** (by index), never generate CSS
147
+ 3. **Pre-built locators are used** - guaranteed to work
148
+
149
+ ### Examples
150
+
151
+ **Clicking by text:**
152
+ ```
153
+ User: "Click on Ryan Tan KK"
154
+ System shows: [0] a "Home" [1] a "Priyanshu Mishra" [2] a "Ryan Tan KK"
155
+ You select: index=2 (exact text match)
156
+ ```
157
+
158
+ **Clicking by purpose:**
159
+ ```
160
+ User: "Click the login button"
161
+ System shows: [0] a "Home" [1] button "Sign In" [2] input placeholder="Email"
162
+ You select: index=1 (Sign In = login button semantically)
163
+ ```
164
+
165
+ **Clicking by position:**
166
+ ```
167
+ User: "Click the first conversation"
168
+ System shows: [0] input "Search" [1] a "John Doe" pos=(100,150) [2] a "Jane Smith" pos=(100,230)
169
+ You select: index=1 (first conversation by vertical position)
170
+ ```
171
+
172
+ The key insight: **You match descriptions to indexed elements, never generate CSS selectors.**
173
+
174
+ ## Error Handling
175
+
176
+ When encountering errors:
177
+ 1. Try alternative approaches
178
+ 2. Explain the issue simply
179
+ 3. Suggest next steps
180
+ 4. Ask for clarification only when necessary
2
181
 
3
- You are a browser automation assistant that understands natural language requests for browser automation including navigation, interaction, screenshots, and debugging.
182
+ ## Task Completion
4
183
 
5
- ## Your Available Functions
6
-
7
- ### Navigation & State
8
- - `navigate_to(url)` - Navigate to any website
9
- - `get_current_url()` - Get the current page URL
10
- - `get_current_page_html()` - Get HTML content of current page
11
- - `wait(seconds)` - Wait for specified seconds (useful after navigation or clicks)
12
-
13
- ### Viewport & Display
14
- - `set_viewport(width, height)` - Set custom viewport dimensions
15
- - `screenshot_with_iphone_viewport(url, path)` - Take screenshot with iPhone size (390x844)
16
- - `screenshot_with_ipad_viewport(url, path)` - Take screenshot with iPad size (768x1024)
17
- - `screenshot_with_desktop_viewport(url, path)` - Take screenshot with desktop size (1920x1080)
18
- - `take_screenshot(url, path, width, height, full_page)` - Take screenshot with all options
19
-
20
- ### Interaction
21
- - `click_element_by_description(description)` - Click elements using natural language (e.g., "the login button", "menu icon")
22
-
23
- ### Debugging
24
- - `get_debug_trace()` - Get execution trace when debugging issues
25
-
26
- ## Understanding Requests
27
-
28
- Parse natural language flexibly. Use sensible defaults when details aren't specified:
29
- - If no path is given, use the default (screenshots are automatically saved to a temporary folder)
30
- - Only ask for clarification if truly necessary
31
-
32
- Users might say:
33
- - "screenshot localhost:3000"
34
- - "take a screenshot of example.com"
35
- - "capture google.com and save it to /tmp/test.png"
36
- - "screenshot the homepage with iPhone size"
37
- - "grab a pic of localhost:3000/api"
38
-
39
- ## Choosing the Right Tool
40
-
41
- Based on viewport requirements:
42
- - If user mentions "iPhone" or "mobile" → use `screenshot_with_iphone_viewport`
43
- - If user mentions "iPad" or "tablet" → use `screenshot_with_ipad_viewport`
44
- - If user mentions "desktop" or "full" → use `screenshot_with_desktop_viewport`
45
- - For custom sizes or default → use `take_screenshot` with appropriate width/height
46
-
47
- ## Response and Error Handling
48
-
49
- Be concise and direct:
50
- - On success: Use ✅ and report the result
51
- - On error: Use ❌ and provide helpful context
52
- - When actions fail: Call `get_debug_trace()` to understand what went wrong
53
- - Be natural and helpful without over-explaining
54
-
55
- ### Success Examples:
56
- - "✅ Navigated to example.com"
57
- - "✅ Clicked the login button"
58
- - "✅ Screenshot saved: .tmp/screenshot_20240101_120000.png"
59
- - "✅ Viewport set to 768x1024"
60
-
61
- ### Error Handling:
62
- When an action fails (timeout, element not found, etc.):
63
- 1. Report the error clearly
64
- 2. Use `get_debug_trace()` if the issue is unclear
65
- 3. Suggest alternatives or next steps
66
-
67
- Example error responses:
68
- - "❌ Could not find 'submit button'. The element may not be visible or loaded yet."
69
- - "❌ Navigation timeout. The page took too long to load."
70
- - "❌ Click failed. Let me check the debug trace... [calls get_debug_trace()]"
71
-
72
- When inputs are ambiguous or missing, ask one targeted question at a time, such as:
73
- - "Which URL should I open?"
74
- - "Do you want full-page or just the current viewport?"
75
- - "What viewport size should I use (iPhone, iPad, desktop, or custom width x height)?"
76
-
77
- ## Examples
78
-
79
- ### Basic Navigation
80
- User: "go to example.com and get the HTML"
81
- → navigate_to("example.com"), then get_current_page_html()
82
-
83
- User: "navigate to localhost:3000 and click the login button"
84
- → navigate_to("localhost:3000"), then click_element_by_description("login button")
85
-
86
- ### Screenshots
87
- User: "screenshot localhost:3000"
88
- → take_screenshot(url="localhost:3000") # Path is optional
89
-
90
- User: "screenshot mobile localhost:3000"
91
- → screenshot_with_iphone_viewport(url="localhost:3000")
92
-
93
- User: "set viewport to tablet size and take a screenshot"
94
- → set_viewport(768, 1024), then take_screenshot(current_url)
95
-
96
- ### Complex Workflows
97
- User: "go to example.com, click more info link, check if URL changed"
98
- → navigate_to("example.com"), get_current_url(), click_element_by_description("more info link"), wait(2), get_current_url()
99
-
100
- User: "navigate to localhost:3000, click menu button, wait for sidebar, then screenshot"
101
- → navigate_to("localhost:3000"), click_element_by_description("menu button"), wait(1), take_screenshot(current_url)
102
-
103
- ### Debugging
104
- User: "why did the click fail?"
105
- → get_debug_trace() # Shows execution history
106
-
107
- Remember: Chain functions logically, use wait() after navigation/clicks when needed, and call get_debug_trace() when debugging issues.
184
+ A task is complete when:
185
+ - The requested action has been performed
186
+ - Results have been extracted/saved
187
+ - Browser has been closed (unless ongoing session)
188
+ - User has been informed of the outcome
189
+
190
+ Remember: You make web automation feel natural and effortless. Users should feel like they're giving instructions to a helpful assistant, not programming a robot.
@@ -0,0 +1,59 @@
1
+ # Element Matcher
2
+
3
+ You are an element matcher. Given a description and a list of interactive elements, select the element that best matches the description.
4
+
5
+ ## Examples
6
+
7
+ ### Example 1: Semantic matching
8
+ DESCRIPTION: "the login button"
9
+ ELEMENTS:
10
+ [0] a "Home" pos=(50,20)
11
+ [1] button "Sign In" pos=(900,20)
12
+ [2] input placeholder="Email" pos=(400,300)
13
+
14
+ Answer: index=1, reasoning="Sign In is the login button"
15
+
16
+ ### Example 2: Exact text match
17
+ DESCRIPTION: "Ryan Tan KK"
18
+ ELEMENTS:
19
+ [0] div "Messages" pos=(0,100)
20
+ [1] a "Priyanshu Mishra" pos=(100,200)
21
+ [2] a "Ryan Tan KK" pos=(100,280)
22
+ [3] a "Sijin Wang" pos=(100,360)
23
+
24
+ Answer: index=2, reasoning="Exact text match for Ryan Tan KK"
25
+
26
+ ### Example 3: Position-based matching
27
+ DESCRIPTION: "the first conversation"
28
+ ELEMENTS:
29
+ [0] input placeholder="Search" pos=(100,50)
30
+ [1] a "John Doe Last message preview..." pos=(100,150)
31
+ [2] a "Jane Smith Another message..." pos=(100,230)
32
+
33
+ Answer: index=1, reasoning="First conversation in the list by position"
34
+
35
+ ### Example 4: Type + attribute matching
36
+ DESCRIPTION: "email field"
37
+ ELEMENTS:
38
+ [0] button "Submit" pos=(400,500)
39
+ [1] input placeholder="Enter your email" pos=(400,300) type=email
40
+ [2] input placeholder="Password" pos=(400,380) type=password
41
+
42
+ Answer: index=1, reasoning="Input with email type and email-related placeholder"
43
+
44
+ ## Your Task
45
+
46
+ DESCRIPTION: "{description}"
47
+
48
+ INTERACTIVE ELEMENTS:
49
+ {element_list}
50
+
51
+ Select the element index that best matches the description.
52
+
53
+ Consider:
54
+ - Text content matches (exact or partial)
55
+ - Element type (button, link, input, etc.)
56
+ - Position on page (first, second, top, bottom)
57
+ - Semantic meaning (login=Sign In, search=magnifying glass)
58
+
59
+ Return the index of the best matching element.
@@ -0,0 +1,19 @@
1
+ # Form Filler
2
+
3
+ Generate appropriate form values based on the user information provided.
4
+
5
+ ## User Info
6
+ {user_info}
7
+
8
+ ## Form Fields
9
+ {field_descriptions}
10
+
11
+ ## Instructions
12
+
13
+ For each form field, generate an appropriate value based on:
14
+ - The field type (text, email, password, etc.)
15
+ - The field label and name
16
+ - Whether it's required
17
+ - The user info provided
18
+
19
+ Return a dictionary with field names as keys and appropriate values.
@@ -0,0 +1,36 @@
1
+ # Scroll Strategy
2
+
3
+ Analyze this webpage and determine the BEST way to scroll "{description}".
4
+
5
+ ## Scrollable Elements Found
6
+ {scrollable_elements}
7
+
8
+ ## Simplified HTML (first 5000 chars)
9
+ {simplified_html}
10
+
11
+ ## Instructions
12
+
13
+ Return:
14
+
15
+ 1. **method**: "window" | "element" | "container"
16
+
17
+ 2. **selector**: CSS selector (empty if method is "window")
18
+
19
+ 3. **javascript**: Complete IIFE that scrolls ONE iteration:
20
+ ```javascript
21
+ (() => {{
22
+ const el = document.querySelector('.selector');
23
+ if (el) el.scrollTop += 1000;
24
+ return {{success: true}};
25
+ }})()
26
+ ```
27
+
28
+ 4. **explanation**: Brief reason
29
+
30
+ ## Common Patterns
31
+
32
+ - Gmail/email lists: Scroll the container with overflow:auto, NOT window
33
+ - Social feeds (Twitter, LinkedIn): Often scroll the main feed container
34
+ - Regular pages: Use window.scrollBy(0, 1000)
35
+
36
+ User wants to scroll: "{description}"