openpaw-ai 0.4.0__tar.gz

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 (244) hide show
  1. openpaw_ai-0.4.0/CHANGELOG.md +49 -0
  2. openpaw_ai-0.4.0/LICENSE +75 -0
  3. openpaw_ai-0.4.0/PKG-INFO +263 -0
  4. openpaw_ai-0.4.0/README.md +197 -0
  5. openpaw_ai-0.4.0/openpaw/__init__.py +9 -0
  6. openpaw_ai-0.4.0/openpaw/agent/__init__.py +20 -0
  7. openpaw_ai-0.4.0/openpaw/agent/builder.py +191 -0
  8. openpaw_ai-0.4.0/openpaw/agent/metrics.py +250 -0
  9. openpaw_ai-0.4.0/openpaw/agent/middleware/__init__.py +37 -0
  10. openpaw_ai-0.4.0/openpaw/agent/middleware/approval.py +113 -0
  11. openpaw_ai-0.4.0/openpaw/agent/middleware/llm_hooks.py +175 -0
  12. openpaw_ai-0.4.0/openpaw/agent/middleware/queue_aware.py +177 -0
  13. openpaw_ai-0.4.0/openpaw/agent/middleware/status_reminder.py +225 -0
  14. openpaw_ai-0.4.0/openpaw/agent/middleware/tool_timeout.py +93 -0
  15. openpaw_ai-0.4.0/openpaw/agent/model_factory.py +244 -0
  16. openpaw_ai-0.4.0/openpaw/agent/response_processor.py +90 -0
  17. openpaw_ai-0.4.0/openpaw/agent/runner.py +477 -0
  18. openpaw_ai-0.4.0/openpaw/agent/session_logger.py +169 -0
  19. openpaw_ai-0.4.0/openpaw/agent/tools/__init__.py +14 -0
  20. openpaw_ai-0.4.0/openpaw/agent/tools/file_read.py +332 -0
  21. openpaw_ai-0.4.0/openpaw/agent/tools/file_search/__init__.py +221 -0
  22. openpaw_ai-0.4.0/openpaw/agent/tools/file_search/formatter.py +53 -0
  23. openpaw_ai-0.4.0/openpaw/agent/tools/file_search/python_backend.py +224 -0
  24. openpaw_ai-0.4.0/openpaw/agent/tools/file_search/ripgrep_backend.py +168 -0
  25. openpaw_ai-0.4.0/openpaw/agent/tools/file_write.py +250 -0
  26. openpaw_ai-0.4.0/openpaw/agent/tools/filesystem.py +160 -0
  27. openpaw_ai-0.4.0/openpaw/agent/tools/helpers/__init__.py +5 -0
  28. openpaw_ai-0.4.0/openpaw/agent/tools/helpers/formatting.py +83 -0
  29. openpaw_ai-0.4.0/openpaw/agent/tools/sandbox.py +112 -0
  30. openpaw_ai-0.4.0/openpaw/builtins/__init__.py +26 -0
  31. openpaw_ai-0.4.0/openpaw/builtins/base.py +186 -0
  32. openpaw_ai-0.4.0/openpaw/builtins/loader.py +383 -0
  33. openpaw_ai-0.4.0/openpaw/builtins/processors/__init__.py +1 -0
  34. openpaw_ai-0.4.0/openpaw/builtins/processors/docling.py +488 -0
  35. openpaw_ai-0.4.0/openpaw/builtins/processors/file_persistence.py +308 -0
  36. openpaw_ai-0.4.0/openpaw/builtins/processors/timestamp.py +96 -0
  37. openpaw_ai-0.4.0/openpaw/builtins/processors/whisper.py +205 -0
  38. openpaw_ai-0.4.0/openpaw/builtins/profiles/__init__.py +3 -0
  39. openpaw_ai-0.4.0/openpaw/builtins/profiles/file-analyst.yaml +27 -0
  40. openpaw_ai-0.4.0/openpaw/builtins/profiles/researcher.yaml +30 -0
  41. openpaw_ai-0.4.0/openpaw/builtins/profiles/summarizer.yaml +25 -0
  42. openpaw_ai-0.4.0/openpaw/builtins/registry.py +296 -0
  43. openpaw_ai-0.4.0/openpaw/builtins/skills/__init__.py +3 -0
  44. openpaw_ai-0.4.0/openpaw/builtins/skills/channel-awareness/SKILL.md +53 -0
  45. openpaw_ai-0.4.0/openpaw/builtins/skills/team-management/SKILL.md +44 -0
  46. openpaw_ai-0.4.0/openpaw/builtins/skills/web-browsing/SKILL.md +98 -0
  47. openpaw_ai-0.4.0/openpaw/builtins/tools/__init__.py +1 -0
  48. openpaw_ai-0.4.0/openpaw/builtins/tools/_audio_context.py +30 -0
  49. openpaw_ai-0.4.0/openpaw/builtins/tools/_channel_context.py +73 -0
  50. openpaw_ai-0.4.0/openpaw/builtins/tools/acknowledge.py +134 -0
  51. openpaw_ai-0.4.0/openpaw/builtins/tools/brave_search.py +58 -0
  52. openpaw_ai-0.4.0/openpaw/builtins/tools/browser/__init__.py +116 -0
  53. openpaw_ai-0.4.0/openpaw/builtins/tools/browser/interaction.py +270 -0
  54. openpaw_ai-0.4.0/openpaw/builtins/tools/browser/lifecycle.py +174 -0
  55. openpaw_ai-0.4.0/openpaw/builtins/tools/browser/models.py +84 -0
  56. openpaw_ai-0.4.0/openpaw/builtins/tools/browser/navigation.py +170 -0
  57. openpaw_ai-0.4.0/openpaw/builtins/tools/browser/security.py +117 -0
  58. openpaw_ai-0.4.0/openpaw/builtins/tools/browser/session.py +264 -0
  59. openpaw_ai-0.4.0/openpaw/builtins/tools/browser/snapshot.py +169 -0
  60. openpaw_ai-0.4.0/openpaw/builtins/tools/browser/state.py +240 -0
  61. openpaw_ai-0.4.0/openpaw/builtins/tools/browser/tools.py +422 -0
  62. openpaw_ai-0.4.0/openpaw/builtins/tools/channel_history/__init__.py +113 -0
  63. openpaw_ai-0.4.0/openpaw/builtins/tools/channel_history/browser.py +190 -0
  64. openpaw_ai-0.4.0/openpaw/builtins/tools/channel_history/formatter.py +134 -0
  65. openpaw_ai-0.4.0/openpaw/builtins/tools/channel_history/models.py +41 -0
  66. openpaw_ai-0.4.0/openpaw/builtins/tools/channel_history/resolver.py +81 -0
  67. openpaw_ai-0.4.0/openpaw/builtins/tools/cron/__init__.py +138 -0
  68. openpaw_ai-0.4.0/openpaw/builtins/tools/cron/formatting.py +91 -0
  69. openpaw_ai-0.4.0/openpaw/builtins/tools/cron/models.py +59 -0
  70. openpaw_ai-0.4.0/openpaw/builtins/tools/cron/scheduler_bridge.py +59 -0
  71. openpaw_ai-0.4.0/openpaw/builtins/tools/cron/tools.py +284 -0
  72. openpaw_ai-0.4.0/openpaw/builtins/tools/cron_manager/__init__.py +175 -0
  73. openpaw_ai-0.4.0/openpaw/builtins/tools/cron_manager/models.py +81 -0
  74. openpaw_ai-0.4.0/openpaw/builtins/tools/cron_manager/persistence.py +99 -0
  75. openpaw_ai-0.4.0/openpaw/builtins/tools/cron_manager/scheduler_bridge.py +62 -0
  76. openpaw_ai-0.4.0/openpaw/builtins/tools/cron_manager/tools.py +330 -0
  77. openpaw_ai-0.4.0/openpaw/builtins/tools/cron_manager/validators.py +47 -0
  78. openpaw_ai-0.4.0/openpaw/builtins/tools/elevenlabs_tts.py +131 -0
  79. openpaw_ai-0.4.0/openpaw/builtins/tools/email/__init__.py +302 -0
  80. openpaw_ai-0.4.0/openpaw/builtins/tools/email/base.py +258 -0
  81. openpaw_ai-0.4.0/openpaw/builtins/tools/email/executor.py +298 -0
  82. openpaw_ai-0.4.0/openpaw/builtins/tools/email/gmail/__init__.py +221 -0
  83. openpaw_ai-0.4.0/openpaw/builtins/tools/email/gmail/attachments.py +67 -0
  84. openpaw_ai-0.4.0/openpaw/builtins/tools/email/gmail/base.py +70 -0
  85. openpaw_ai-0.4.0/openpaw/builtins/tools/email/gmail/compose.py +79 -0
  86. openpaw_ai-0.4.0/openpaw/builtins/tools/email/gmail/fetch.py +398 -0
  87. openpaw_ai-0.4.0/openpaw/builtins/tools/email/gmail/labels.py +68 -0
  88. openpaw_ai-0.4.0/openpaw/builtins/tools/email/models.py +99 -0
  89. openpaw_ai-0.4.0/openpaw/builtins/tools/followup.py +176 -0
  90. openpaw_ai-0.4.0/openpaw/builtins/tools/gpt_researcher.py +255 -0
  91. openpaw_ai-0.4.0/openpaw/builtins/tools/md2pdf/__init__.py +217 -0
  92. openpaw_ai-0.4.0/openpaw/builtins/tools/md2pdf/converter.py +163 -0
  93. openpaw_ai-0.4.0/openpaw/builtins/tools/md2pdf/mermaid.py +361 -0
  94. openpaw_ai-0.4.0/openpaw/builtins/tools/md2pdf/models.py +56 -0
  95. openpaw_ai-0.4.0/openpaw/builtins/tools/md2pdf_themes.py +1009 -0
  96. openpaw_ai-0.4.0/openpaw/builtins/tools/memory_search.py +192 -0
  97. openpaw_ai-0.4.0/openpaw/builtins/tools/plan.py +173 -0
  98. openpaw_ai-0.4.0/openpaw/builtins/tools/send_file.py +274 -0
  99. openpaw_ai-0.4.0/openpaw/builtins/tools/send_message.py +146 -0
  100. openpaw_ai-0.4.0/openpaw/builtins/tools/shell.py +232 -0
  101. openpaw_ai-0.4.0/openpaw/builtins/tools/spawn/__init__.py +185 -0
  102. openpaw_ai-0.4.0/openpaw/builtins/tools/spawn/formatters.py +64 -0
  103. openpaw_ai-0.4.0/openpaw/builtins/tools/spawn/models.py +62 -0
  104. openpaw_ai-0.4.0/openpaw/builtins/tools/spawn/tools.py +325 -0
  105. openpaw_ai-0.4.0/openpaw/builtins/tools/task/__init__.py +120 -0
  106. openpaw_ai-0.4.0/openpaw/builtins/tools/task/models.py +79 -0
  107. openpaw_ai-0.4.0/openpaw/builtins/tools/task/tools.py +444 -0
  108. openpaw_ai-0.4.0/openpaw/channels/__init__.py +15 -0
  109. openpaw_ai-0.4.0/openpaw/channels/base.py +231 -0
  110. openpaw_ai-0.4.0/openpaw/channels/commands/__init__.py +1 -0
  111. openpaw_ai-0.4.0/openpaw/channels/commands/base.py +82 -0
  112. openpaw_ai-0.4.0/openpaw/channels/commands/handlers/__init__.py +39 -0
  113. openpaw_ai-0.4.0/openpaw/channels/commands/handlers/compact.py +123 -0
  114. openpaw_ai-0.4.0/openpaw/channels/commands/handlers/help.py +51 -0
  115. openpaw_ai-0.4.0/openpaw/channels/commands/handlers/model.py +139 -0
  116. openpaw_ai-0.4.0/openpaw/channels/commands/handlers/new.py +86 -0
  117. openpaw_ai-0.4.0/openpaw/channels/commands/handlers/queue_mode.py +62 -0
  118. openpaw_ai-0.4.0/openpaw/channels/commands/handlers/start.py +42 -0
  119. openpaw_ai-0.4.0/openpaw/channels/commands/handlers/status.py +132 -0
  120. openpaw_ai-0.4.0/openpaw/channels/commands/router.py +77 -0
  121. openpaw_ai-0.4.0/openpaw/channels/discord/__init__.py +374 -0
  122. openpaw_ai-0.4.0/openpaw/channels/discord/approval_view.py +64 -0
  123. openpaw_ai-0.4.0/openpaw/channels/discord/attachments.py +59 -0
  124. openpaw_ai-0.4.0/openpaw/channels/discord/commands.py +111 -0
  125. openpaw_ai-0.4.0/openpaw/channels/discord/constants.py +7 -0
  126. openpaw_ai-0.4.0/openpaw/channels/discord/history.py +86 -0
  127. openpaw_ai-0.4.0/openpaw/channels/discord/outbound.py +125 -0
  128. openpaw_ai-0.4.0/openpaw/channels/factory.py +69 -0
  129. openpaw_ai-0.4.0/openpaw/channels/formatting.py +219 -0
  130. openpaw_ai-0.4.0/openpaw/channels/helpers/__init__.py +19 -0
  131. openpaw_ai-0.4.0/openpaw/channels/helpers/attachments.py +26 -0
  132. openpaw_ai-0.4.0/openpaw/channels/helpers/formatting.py +83 -0
  133. openpaw_ai-0.4.0/openpaw/channels/helpers/security.py +143 -0
  134. openpaw_ai-0.4.0/openpaw/channels/helpers/splitting.py +46 -0
  135. openpaw_ai-0.4.0/openpaw/channels/stdio.py +268 -0
  136. openpaw_ai-0.4.0/openpaw/channels/telegram/__init__.py +308 -0
  137. openpaw_ai-0.4.0/openpaw/channels/telegram/approval.py +47 -0
  138. openpaw_ai-0.4.0/openpaw/channels/telegram/attachments.py +208 -0
  139. openpaw_ai-0.4.0/openpaw/channels/telegram/constants.py +7 -0
  140. openpaw_ai-0.4.0/openpaw/channels/telegram/handlers.py +112 -0
  141. openpaw_ai-0.4.0/openpaw/channels/telegram/outbound.py +161 -0
  142. openpaw_ai-0.4.0/openpaw/cli.py +142 -0
  143. openpaw_ai-0.4.0/openpaw/cli_init/__init__.py +8 -0
  144. openpaw_ai-0.4.0/openpaw/cli_init/commands.py +137 -0
  145. openpaw_ai-0.4.0/openpaw/cli_init/scaffolder.py +186 -0
  146. openpaw_ai-0.4.0/openpaw/cli_init/templates.py +213 -0
  147. openpaw_ai-0.4.0/openpaw/core/__init__.py +11 -0
  148. openpaw_ai-0.4.0/openpaw/core/channel_context.py +136 -0
  149. openpaw_ai-0.4.0/openpaw/core/config/__init__.py +70 -0
  150. openpaw_ai-0.4.0/openpaw/core/config/loader.py +148 -0
  151. openpaw_ai-0.4.0/openpaw/core/config/models/__init__.py +103 -0
  152. openpaw_ai-0.4.0/openpaw/core/config/models/base.py +88 -0
  153. openpaw_ai-0.4.0/openpaw/core/config/models/builtin.py +231 -0
  154. openpaw_ai-0.4.0/openpaw/core/config/models/channel.py +68 -0
  155. openpaw_ai-0.4.0/openpaw/core/config/models/cron.py +68 -0
  156. openpaw_ai-0.4.0/openpaw/core/config/models/lifecycle.py +40 -0
  157. openpaw_ai-0.4.0/openpaw/core/config/models/memory.py +50 -0
  158. openpaw_ai-0.4.0/openpaw/core/config/models/security.py +50 -0
  159. openpaw_ai-0.4.0/openpaw/core/config/models/workspace.py +202 -0
  160. openpaw_ai-0.4.0/openpaw/core/config/providers.py +103 -0
  161. openpaw_ai-0.4.0/openpaw/core/logging.py +139 -0
  162. openpaw_ai-0.4.0/openpaw/core/paths.py +105 -0
  163. openpaw_ai-0.4.0/openpaw/core/prompts/__init__.py +52 -0
  164. openpaw_ai-0.4.0/openpaw/core/prompts/commands.py +39 -0
  165. openpaw_ai-0.4.0/openpaw/core/prompts/framework.py +438 -0
  166. openpaw_ai-0.4.0/openpaw/core/prompts/heartbeat.py +97 -0
  167. openpaw_ai-0.4.0/openpaw/core/prompts/processors.py +26 -0
  168. openpaw_ai-0.4.0/openpaw/core/prompts/system_events.py +185 -0
  169. openpaw_ai-0.4.0/openpaw/core/timezone.py +60 -0
  170. openpaw_ai-0.4.0/openpaw/core/utils.py +189 -0
  171. openpaw_ai-0.4.0/openpaw/core/workspace.py +354 -0
  172. openpaw_ai-0.4.0/openpaw/model/__init__.py +35 -0
  173. openpaw_ai-0.4.0/openpaw/model/channel.py +65 -0
  174. openpaw_ai-0.4.0/openpaw/model/cron.py +50 -0
  175. openpaw_ai-0.4.0/openpaw/model/message.py +74 -0
  176. openpaw_ai-0.4.0/openpaw/model/session.py +52 -0
  177. openpaw_ai-0.4.0/openpaw/model/skill.py +52 -0
  178. openpaw_ai-0.4.0/openpaw/model/spawn_profile.py +79 -0
  179. openpaw_ai-0.4.0/openpaw/model/subagent.py +175 -0
  180. openpaw_ai-0.4.0/openpaw/model/task.py +168 -0
  181. openpaw_ai-0.4.0/openpaw/runtime/__init__.py +31 -0
  182. openpaw_ai-0.4.0/openpaw/runtime/approval.py +182 -0
  183. openpaw_ai-0.4.0/openpaw/runtime/channel_logger.py +244 -0
  184. openpaw_ai-0.4.0/openpaw/runtime/orchestrator.py +103 -0
  185. openpaw_ai-0.4.0/openpaw/runtime/queue/__init__.py +9 -0
  186. openpaw_ai-0.4.0/openpaw/runtime/queue/lane.py +213 -0
  187. openpaw_ai-0.4.0/openpaw/runtime/queue/manager.py +310 -0
  188. openpaw_ai-0.4.0/openpaw/runtime/scheduling/__init__.py +24 -0
  189. openpaw_ai-0.4.0/openpaw/runtime/scheduling/cron.py +195 -0
  190. openpaw_ai-0.4.0/openpaw/runtime/scheduling/cron_executor.py +420 -0
  191. openpaw_ai-0.4.0/openpaw/runtime/scheduling/cron_job_manager.py +228 -0
  192. openpaw_ai-0.4.0/openpaw/runtime/scheduling/heartbeat.py +190 -0
  193. openpaw_ai-0.4.0/openpaw/runtime/scheduling/heartbeat_executor.py +405 -0
  194. openpaw_ai-0.4.0/openpaw/runtime/scheduling/heartbeat_preflight.py +127 -0
  195. openpaw_ai-0.4.0/openpaw/runtime/scheduling/heartbeat_prompt.py +45 -0
  196. openpaw_ai-0.4.0/openpaw/runtime/scheduling/loader.py +89 -0
  197. openpaw_ai-0.4.0/openpaw/runtime/session/__init__.py +9 -0
  198. openpaw_ai-0.4.0/openpaw/runtime/session/archiver.py +387 -0
  199. openpaw_ai-0.4.0/openpaw/runtime/session/manager.py +257 -0
  200. openpaw_ai-0.4.0/openpaw/runtime/session/pruner.py +218 -0
  201. openpaw_ai-0.4.0/openpaw/runtime/subagent/__init__.py +10 -0
  202. openpaw_ai-0.4.0/openpaw/runtime/subagent/executor.py +353 -0
  203. openpaw_ai-0.4.0/openpaw/runtime/subagent/filter.py +147 -0
  204. openpaw_ai-0.4.0/openpaw/runtime/subagent/formatter.py +42 -0
  205. openpaw_ai-0.4.0/openpaw/runtime/subagent/notifier.py +141 -0
  206. openpaw_ai-0.4.0/openpaw/runtime/subagent/profiler.py +244 -0
  207. openpaw_ai-0.4.0/openpaw/runtime/subagent/runner.py +456 -0
  208. openpaw_ai-0.4.0/openpaw/stores/__init__.py +29 -0
  209. openpaw_ai-0.4.0/openpaw/stores/cron.py +311 -0
  210. openpaw_ai-0.4.0/openpaw/stores/subagent.py +467 -0
  211. openpaw_ai-0.4.0/openpaw/stores/task.py +451 -0
  212. openpaw_ai-0.4.0/openpaw/stores/vector/__init__.py +27 -0
  213. openpaw_ai-0.4.0/openpaw/stores/vector/base.py +109 -0
  214. openpaw_ai-0.4.0/openpaw/stores/vector/embeddings.py +103 -0
  215. openpaw_ai-0.4.0/openpaw/stores/vector/factory.py +63 -0
  216. openpaw_ai-0.4.0/openpaw/stores/vector/indexer.py +179 -0
  217. openpaw_ai-0.4.0/openpaw/stores/vector/sqlite_vec.py +233 -0
  218. openpaw_ai-0.4.0/openpaw/workspace/__init__.py +6 -0
  219. openpaw_ai-0.4.0/openpaw/workspace/agent_factory.py +342 -0
  220. openpaw_ai-0.4.0/openpaw/workspace/connector.py +186 -0
  221. openpaw_ai-0.4.0/openpaw/workspace/initializer.py +428 -0
  222. openpaw_ai-0.4.0/openpaw/workspace/lifecycle.py +345 -0
  223. openpaw_ai-0.4.0/openpaw/workspace/lifecycle_notifier.py +65 -0
  224. openpaw_ai-0.4.0/openpaw/workspace/loader.py +199 -0
  225. openpaw_ai-0.4.0/openpaw/workspace/message_processor.py +400 -0
  226. openpaw_ai-0.4.0/openpaw/workspace/model_resolver.py +136 -0
  227. openpaw_ai-0.4.0/openpaw/workspace/processors/__init__.py +21 -0
  228. openpaw_ai-0.4.0/openpaw/workspace/processors/approval_handler.py +165 -0
  229. openpaw_ai-0.4.0/openpaw/workspace/processors/combiner.py +78 -0
  230. openpaw_ai-0.4.0/openpaw/workspace/processors/compactor.py +221 -0
  231. openpaw_ai-0.4.0/openpaw/workspace/processors/error_handler.py +94 -0
  232. openpaw_ai-0.4.0/openpaw/workspace/processors/followup_scheduler.py +133 -0
  233. openpaw_ai-0.4.0/openpaw/workspace/processors/interrupt_handler.py +56 -0
  234. openpaw_ai-0.4.0/openpaw/workspace/processors/response_handler.py +117 -0
  235. openpaw_ai-0.4.0/openpaw/workspace/processors/ttl_checker.py +142 -0
  236. openpaw_ai-0.4.0/openpaw/workspace/profile_loader.py +354 -0
  237. openpaw_ai-0.4.0/openpaw/workspace/profile_resolver.py +62 -0
  238. openpaw_ai-0.4.0/openpaw/workspace/roster.py +72 -0
  239. openpaw_ai-0.4.0/openpaw/workspace/runner.py +849 -0
  240. openpaw_ai-0.4.0/openpaw/workspace/skill_loader.py +264 -0
  241. openpaw_ai-0.4.0/openpaw/workspace/task_service.py +71 -0
  242. openpaw_ai-0.4.0/openpaw/workspace/tool_filter.py +81 -0
  243. openpaw_ai-0.4.0/openpaw/workspace/tool_loader.py +301 -0
  244. openpaw_ai-0.4.0/pyproject.toml +131 -0
@@ -0,0 +1,49 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.4.0] - 2026-05-29
9
+
10
+ ### Added
11
+
12
+ - **Structural refactor** — Layered architecture with clear stability contract: `model` (pure data) → `core` (config, prompts, utilities) → `agent` (runner, tools, middleware) → `workspace` (loader, runner, lifecycle) → `runtime` (orchestrator, queue, scheduling, subagents) → `channels` (external adapters).
13
+ - **Multi-channel support** — Run multiple channels (Telegram, Discord) simultaneously in a single workspace. Each channel is isolated with its own session keys, activation filters, and trigger keywords.
14
+ - **Workspace isolation** — Every workspace gets its own channels, queue, agent runner, and cron scheduler. No state leakage between workspaces.
15
+ - **Cron & heartbeat scheduling** — APScheduler-based cron jobs from YAML definitions; proactive heartbeat check-ins with active-hours support, HEARTBEAT_OK suppression, and task summary injection.
16
+ - **Sub-agent spawning** — Background concurrent workers via `spawn_agent` with isolated contexts, tool filtering, and session-scoped lifecycle tracking. Supports spawn profiles (`agent/team/*.yaml`) for specialized personas.
17
+ - **Browser automation** — Playwright-based web browsing with accessibility tree navigation, domain allowlists/blocklists, cookie persistence, and screenshot/download support.
18
+ - **Email integration** — Gmail send/receive via service account + domain-wide delegation. Supports search, reply, attachments, and recipient policy enforcement.
19
+ - **GPT-Researcher builtin** — Deep research via WebSocket with streaming progress and report generation.
20
+ - **Dynamic & persistent scheduling** — Agents can schedule one-time (`schedule_at`) or recurring (`schedule_every`) tasks at runtime, or create persistent YAML cron jobs via `cron_manager`.
21
+ - **Queue-aware middleware** — Steer and interrupt modes let agents respond to new user messages mid-execution without losing context.
22
+ - **Approval gates** — Human-in-the-loop authorization for dangerous tools with configurable timeout and default action.
23
+ - **Token usage tracking** — Per-invocation metrics logged to JSONL for cost monitoring and `/status` queries.
24
+ - **Runtime model switching** — Live provider/model switching via `/model` command without restart.
25
+ - **Auto-compact** — Automatic conversation compaction when context window utilization exceeds a threshold.
26
+ - **Session TTL** — Lazy conversation auto-reset after inactivity in group channels.
27
+ - **Checkpoint pruning** — Automatic cleanup of orphaned conversation checkpoints on startup.
28
+ - **Provider catalog** — Define provider connection details once in global config and reference by name from workspaces.
29
+ - **Skills system** — Reusable knowledge patterns via `SKILL.md` files with progressive disclosure (summary vs full injection).
30
+ - **Framework skills** — Bundled reference skills for team management, web browsing, and channel awareness.
31
+ - **Status reminder middleware** — Automatic nudges for agents to update users after long silent tool chains.
32
+ - **Session logging** — JSONL session logs for heartbeat, cron, and sub-agent runs readable by the main agent.
33
+ - **Channel history & logs** — On-demand context fetch and persistent JSONL channel logging for group awareness.
34
+ - **File persistence & enrichment** — Universal upload handling with Whisper transcription and Docling document conversion.
35
+ - **Trusted Publishing support** — CI/CD workflows configured for PEP 740 Trusted Publishing to PyPI.
36
+ - **Pre-commit hooks** — Ruff, mypy, and version sync checks.
37
+
38
+ ### Changed
39
+
40
+ - CLI now supports single workspace, multiple workspaces, or wildcard `--all`.
41
+ - Configuration deep-merges workspace `agent.yaml` over global `config.yaml`.
42
+ - Error sanitization prevents internal details from leaking to channel users.
43
+
44
+ ### Fixed
45
+
46
+ - Various race conditions in approval gate resolution and sub-agent cancellation.
47
+ - Path traversal protection hardened across filesystem tools and inbound processors.
48
+
49
+ [0.4.0]: https://github.com/johnsosoka/openpaw/releases/tag/v0.4.0
@@ -0,0 +1,75 @@
1
+ # PolyForm Noncommercial License 1.0.0
2
+
3
+ <https://polyformproject.org/licenses/noncommercial/1.0.0>
4
+
5
+ Copyright (c) 2025-2026 John Sosoka
6
+
7
+ ## Acceptance
8
+
9
+ In order to get any license under these terms, you must agree to them as both strict obligations and conditions to all your licenses.
10
+
11
+ ## Copyright License
12
+
13
+ The licensor grants you a copyright license for the software to do everything you might do with the software that would otherwise infringe the licensor's copyright in it for any permitted purpose. However, you may only distribute the software according to [Distribution License](#distribution-license) and make changes or new works based on the software according to [Changes and New Works License](#changes-and-new-works-license).
14
+
15
+ ## Distribution License
16
+
17
+ The licensor grants you an additional copyright license to distribute copies of the software. Your license to distribute covers distributing the software with changes and new works permitted by [Changes and New Works License](#changes-and-new-works-license).
18
+
19
+ ## Notices
20
+
21
+ You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms or the URL for them above, as well as copies of any plain-text lines beginning with `Required Notice:` that the licensor provided with the software. For example:
22
+
23
+ > Required Notice: Copyright John Sosoka (https://johnsosoka.com)
24
+
25
+ ## Changes and New Works License
26
+
27
+ The licensor grants you an additional copyright license to make changes and new works based on the software for any permitted purpose.
28
+
29
+ ## Patent License
30
+
31
+ The licensor grants you a patent license for the software that covers patent claims the licensor can license, or becomes able to license, that you would infringe by using the software.
32
+
33
+ ## Noncommercial Purposes
34
+
35
+ Any noncommercial purpose is a permitted purpose.
36
+
37
+ ## Personal Uses
38
+
39
+ Personal use for research, experiment, and testing for the benefit of public knowledge, personal study, private entertainment, hobby projects, amateur pursuits, or religious observance, without any anticipated commercial application, is use for a permitted purpose.
40
+
41
+ ## Noncommercial Organizations
42
+
43
+ Use by any charitable organization, educational institution, public research organization, public safety or health organization, environmental protection organization, or government institution is use for a permitted purpose regardless of the source of funding or obligations resulting from the funding.
44
+
45
+ ## Fair Use
46
+
47
+ You may have "fair use" rights for the software under the law. These terms do not limit them.
48
+
49
+ ## No Other Rights
50
+
51
+ These terms do not allow you to sublicense or transfer any of your licenses to anyone else, or prevent the licensor from granting licenses to anyone else. These terms do not imply any other licenses.
52
+
53
+ ## Patent Defense
54
+
55
+ If you make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
56
+
57
+ ## Violations
58
+
59
+ The first time you are notified in writing that you have violated any of these terms, or done anything with the software not covered by your licenses, your licenses can nonetheless continue if you come into full compliance with these terms, and take practical steps to correct past violations, within 32 days of receiving notice. Otherwise, all your licenses end immediately.
60
+
61
+ ## No Liability
62
+
63
+ ***As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.***
64
+
65
+ ## Definitions
66
+
67
+ The **licensor** is the individual or entity offering these terms, and the **software** is the software the licensor makes available under these terms.
68
+
69
+ **You** refers to the individual or entity agreeing to these terms.
70
+
71
+ **Your company** is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. **Control** means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
72
+
73
+ **Your licenses** are all the licenses granted to you for the software under these terms.
74
+
75
+ **Use** means anything you do with the software requiring one of your licenses.
@@ -0,0 +1,263 @@
1
+ Metadata-Version: 2.4
2
+ Name: openpaw-ai
3
+ Version: 0.4.0
4
+ Summary: OpenPaw - Multi-Channel AI Agent Framework with LangGraph
5
+ License: PolyForm Noncommercial 1.0.0
6
+ License-File: LICENSE
7
+ Keywords: ai,agent,langgraph,telegram,discord,bot
8
+ Author: John Sosoka
9
+ Requires-Python: >=3.11,<4.0
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: Other/Proprietary License
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
18
+ Classifier: Topic :: Communications :: Chat
19
+ Classifier: Framework :: AsyncIO
20
+ Provides-Extra: all-builtins
21
+ Provides-Extra: email
22
+ Provides-Extra: memory
23
+ Provides-Extra: researcher
24
+ Provides-Extra: voice
25
+ Provides-Extra: web
26
+ Requires-Dist: apscheduler (>=3.10.0,<4.0.0)
27
+ Requires-Dist: discord.py (>=2.6.0,<3.0.0)
28
+ Requires-Dist: docling (>=2.72.0,<3.0.0)
29
+ Requires-Dist: easyocr (>=1.7.2,<2.0.0)
30
+ Requires-Dist: elevenlabs (>=1.0.0) ; extra == "all-builtins"
31
+ Requires-Dist: elevenlabs (>=1.0.0) ; extra == "voice"
32
+ Requires-Dist: google-api-python-client (>=2.0.0) ; extra == "all-builtins"
33
+ Requires-Dist: google-api-python-client (>=2.0.0) ; extra == "email"
34
+ Requires-Dist: google-auth (>=2.0.0) ; extra == "all-builtins"
35
+ Requires-Dist: google-auth (>=2.0.0) ; extra == "email"
36
+ Requires-Dist: httpx (>=0.27.0) ; extra == "all-builtins"
37
+ Requires-Dist: httpx (>=0.27.0) ; extra == "researcher"
38
+ Requires-Dist: langchain (>=1.2.8,<2.0.0)
39
+ Requires-Dist: langchain-anthropic (>=1.3.1,<2.0.0)
40
+ Requires-Dist: langchain-aws (>=1.0.0,<2.0.0)
41
+ Requires-Dist: langchain-community (>=0.4.0) ; extra == "all-builtins"
42
+ Requires-Dist: langchain-community (>=0.4.0) ; extra == "web"
43
+ Requires-Dist: langchain-fireworks (>=1.0.0,<2.0.0)
44
+ Requires-Dist: langchain-openai (>=1.1.7,<2.0.0)
45
+ Requires-Dist: langchain-xai (>=1.2.2,<2.0.0)
46
+ Requires-Dist: langgraph (>=1.0.7,<2.0.0)
47
+ Requires-Dist: langgraph-checkpoint-sqlite (>=2.0.0,<4.0.0)
48
+ Requires-Dist: openai (>=1.0.0) ; extra == "all-builtins"
49
+ Requires-Dist: openai (>=1.0.0) ; extra == "voice"
50
+ Requires-Dist: opencv-python-headless (>=4.13.0.92,<5.0.0.0)
51
+ Requires-Dist: playwright (>=1.58.0,<2.0.0)
52
+ Requires-Dist: pydantic (>=2.12.5,<3.0.0)
53
+ Requires-Dist: python-dotenv (>=1.2.1,<2.0.0)
54
+ Requires-Dist: python-telegram-bot[job-queue] (>=22.6,<23.0)
55
+ Requires-Dist: pyyaml (>=6.0.3,<7.0.0)
56
+ Requires-Dist: sqlite-vec (>=0.1.6) ; extra == "all-builtins"
57
+ Requires-Dist: sqlite-vec (>=0.1.6) ; extra == "memory"
58
+ Requires-Dist: websockets (>=12.0) ; extra == "all-builtins"
59
+ Requires-Dist: websockets (>=12.0) ; extra == "researcher"
60
+ Project-URL: Documentation, https://johnsosoka.github.io/OpenPaw/
61
+ Project-URL: Homepage, https://johnsosoka.github.io/OpenPaw/
62
+ Project-URL: Issues, https://github.com/johnsosoka/OpenPaw/issues
63
+ Project-URL: Repository, https://github.com/johnsosoka/OpenPaw
64
+ Description-Content-Type: text/markdown
65
+
66
+ <div align="center">
67
+ <img src="docs/assets/images/logo.png" alt="OpenPaw" width="400">
68
+ <p><strong>A Friendly <a href="https://langchain-ai.github.io/langgraph/">LangChain/LangGraph</a> Multi-Agent Runner</strong></p>
69
+ <p>
70
+ <a href="https://github.com/johnsosoka/OpenPaw/actions/workflows/ci.yml"><img src="https://github.com/johnsosoka/OpenPaw/actions/workflows/ci.yml/badge.svg?branch=main" alt="CI"></a>
71
+ <a href="https://github.com/johnsosoka/OpenPaw/actions/workflows/docs.yml"><img src="https://github.com/johnsosoka/OpenPaw/actions/workflows/docs.yml/badge.svg?branch=main" alt="Docs"></a>
72
+ <img src="https://github.com/johnsosoka/OpenPaw/actions/workflows/ai-code-review.yml/badge.svg" alt="AI Code Review">
73
+ <img src="https://img.shields.io/badge/python-3.11%2B-blue" alt="Python 3.11+">
74
+ <img src="https://img.shields.io/badge/license-PolyForm%20Noncommercial-green" alt="License">
75
+ </p>
76
+ </div>
77
+
78
+ ---
79
+
80
+ > **Pre-1.0 Release (0.4.0)** — OpenPaw is actively developed. The API may evolve as we work towards a stable 1.0.0 release. Contributions and feedback are welcome.
81
+
82
+ OpenPaw gives each agent its own workspace -- personality files, custom tools, scheduled tasks -- then gets out of the way. It handles the orchestration so you can focus on what your agents actually do.
83
+
84
+ Agents can ingest documents, browse the web, search the internet, and manage their own files -- making them well-suited for research, information processing, and long-running autonomous workflows. Give them a schedule and they'll check in on their own.
85
+
86
+ > **[Read the full documentation](https://johnsosoka.github.io/OpenPaw/)**
87
+
88
+ ## Highlights
89
+
90
+ **First Class Document processing** -- Docling OCR/ICR turns scanned PDFs, DOCX, and PPTX into markdown automatically. Whisper transcribes voice messages on arrival.
91
+
92
+ **Drop-in custom tools** -- Write a `@tool` function, put it in `agent/tools/`, restart. Your agent picks it up with zero wiring.
93
+
94
+ **Multi-agent spawning** -- Agents spin up background workers for parallel tasks with full lifecycle tracking and result collection.
95
+
96
+ **Dynamic tool assignment** -- Spawned sub-agents can be given a tailored tool loadout via allow/deny lists, so each worker gets only the capabilities it needs.
97
+
98
+ **Cron scheduling and heartbeats** -- Recurring jobs, one-shot timers, proactive check-ins. Agents can even self-schedule follow-ups at runtime.
99
+
100
+ **Browser automation** -- Playwright-driven web interaction via accessibility tree. Agents reference page elements by number, not CSS selectors.
101
+
102
+ **Email integration** -- Send and receive email via Gmail with safe-by-default recipient policies. Read inbox, search, reply with threading, and manage attachments.
103
+
104
+ **Deep research** -- Integrate with a self-hosted GPT-Researcher instance for multi-source research reports with citations. Agents submit queries via WebSocket and receive comprehensive markdown reports.
105
+
106
+ **Approval gates** -- Human-in-the-loop authorization for dangerous operations, with configurable timeouts and channel-native UI.
107
+
108
+ **Multi-channel support** -- Connect agents to Telegram, Discord, or both simultaneously. Trigger-based activation lets agents respond to @mentions, keyword triggers, or both in group chats. On-demand context fetch gives agents awareness of recent channel history when triggered.
109
+
110
+ **Session management** -- Conversations auto-reset after inactivity (default 3 hours). Auto-compact rotates context when the window fills. Persistent channel logs give agents searchable message history.
111
+
112
+ **Workspace isolation** -- Each agent gets its own SOUL.md personality, tools directory, conversation history, channels, and sandboxed filesystem.
113
+
114
+ **Multi-provider LLM support** -- Anthropic, OpenAI, AWS Bedrock, xAI, and any OpenAI-compatible endpoint. Switch models at runtime with `/model`.
115
+
116
+ **Memory and observability** -- Vector search for semantic recall, conversation archiving to markdown and JSON, and session logs for every cron, heartbeat, and sub-agent run. Full visibility into what your agents are doing and thinking.
117
+
118
+ ## Quick Start
119
+
120
+ ### 1. Install
121
+
122
+ ```bash
123
+ pip install openpaw-ai
124
+ ```
125
+
126
+ For development from source:
127
+
128
+ ```bash
129
+ git clone https://github.com/johnsosoka/OpenPaw.git
130
+ cd OpenPaw
131
+ poetry install
132
+ ```
133
+
134
+ ### 2. Scaffold a workspace
135
+
136
+ ```bash
137
+ poetry run openpaw init my_agent \
138
+ --model anthropic:claude-sonnet-4-20250514 \
139
+ --channel telegram
140
+ ```
141
+
142
+ ### 3. Configure
143
+
144
+ ```bash
145
+ cp config.example.yaml config.yaml
146
+ ```
147
+
148
+ Add your API keys to `agent_workspaces/my_agent/config/.env`:
149
+
150
+ ```bash
151
+ ANTHROPIC_API_KEY=your-key-here
152
+ TELEGRAM_BOT_TOKEN=your-token-here
153
+ ```
154
+
155
+ ### 4. Run
156
+
157
+ ```bash
158
+ poetry run openpaw -c config.yaml -w my_agent
159
+ ```
160
+
161
+ ## CLI Commands
162
+
163
+ | Command | Description |
164
+ |---------|-------------|
165
+ | `openpaw init <name>` | Scaffold a new agent workspace |
166
+ | `openpaw init <name> --model <provider:model>` | Scaffold with a pre-configured model |
167
+ | `openpaw init <name> --channel telegram` | Scaffold with channel pre-configured (`telegram` or `discord`) |
168
+ | `openpaw list` | List available workspaces |
169
+ | `openpaw -c config.yaml -w <name>` | Run a single workspace |
170
+ | `openpaw -c config.yaml -w name1,name2` | Run multiple workspaces |
171
+ | `openpaw -c config.yaml --all` | Run all discovered workspaces |
172
+ | `openpaw -c config.yaml -w <name> -v` | Run with verbose logging |
173
+
174
+ All commands should be prefixed with `poetry run` when running from the project directory.
175
+
176
+ ## Agent Workspace Structure
177
+
178
+ Each workspace lives under `agent_workspaces/<name>/` and is organized into five directories:
179
+
180
+ ```
181
+ agent_workspaces/my_agent/
182
+ ├── agent/ # Identity and extensions
183
+ │ ├── AGENT.md # Capabilities and behavior guidelines
184
+ │ ├── USER.md # User context and preferences
185
+ │ ├── SOUL.md # Core personality and values
186
+ │ ├── HEARTBEAT.md # Session state scratchpad (agent-writable)
187
+ │ ├── skills/ # Skill directories (SKILL.md format)
188
+ │ ├── team/ # Spawn profiles (sub-agent personas)
189
+ │ └── tools/ # Custom LangChain @tool functions
190
+ ├── config/ # Configuration (write-protected)
191
+ │ ├── agent.yaml # Per-workspace settings (model, channel, queue)
192
+ │ ├── .env # API keys and secrets
193
+ │ └── crons/ # Scheduled task definitions
194
+ ├── .openpaw/ # Framework internals (write-protected)
195
+ │ ├── conversations.db # AsyncSqliteSaver checkpoint database
196
+ │ ├── sessions.json # Session/conversation thread state
197
+ │ ├── token_usage.jsonl # Token usage metrics (append-only)
198
+ │ └── subagents.yaml # Sub-agent requests and results
199
+ ├── memory/ # Archived conversations and session logs
200
+ │ ├── conversations/ # Conversation exports (markdown + JSON)
201
+ │ └── logs/ # Session logs and channel history
202
+ │ ├── channel/ # Persistent channel message logs (JSONL)
203
+ │ └── sessions/ # Heartbeat, cron, and sub-agent session logs
204
+ └── workspace/ # Agent work area (default write target)
205
+ ├── downloads/ # Browser-downloaded files
206
+ └── screenshots/ # Browser screenshots
207
+ ```
208
+
209
+ The `openpaw init` command scaffolds this structure with starter templates. Customize the identity files in `agent/` to shape your agent's personality and purpose. Configure model, channel, and queue behavior in `config/agent.yaml`.
210
+
211
+ The `data/` and `config/` directories are write-protected from agent filesystem tools. Write operations default to the `workspace/` directory unless an explicit path is provided.
212
+
213
+ ## In-Chat Commands
214
+
215
+ Once running, agents respond to framework commands in chat:
216
+
217
+ | Command | Description |
218
+ |---------|-------------|
219
+ | `/help` | List available commands |
220
+ | `/status` | Show model, context usage, tasks, and token usage |
221
+ | `/new` | Archive conversation and start fresh |
222
+ | `/compact` | Summarize, archive, and continue with summary |
223
+ | `/model <provider:model>` | Switch LLM model at runtime |
224
+
225
+ ## Documentation
226
+
227
+ - [Getting Started](docs/getting-started.md) -- Installation, first workspace, and troubleshooting
228
+ - [Concepts](docs/concepts.md) -- How workspaces, scheduling, queues, and tools fit together
229
+ - [Configuration](docs/configuration.md) -- Global and per-workspace configuration reference
230
+ - [Workspaces](docs/workspaces.md) -- Workspace structure, identity files, and custom tools
231
+ - [Scheduling](docs/scheduling.md) -- Cron jobs, heartbeats, and dynamic scheduling
232
+ - [Built-ins](docs/builtins.md) -- Web search, browser automation, email, voice, sub-agents, and more
233
+ - [Channels](docs/channels.md) -- Channel adapters and access control
234
+ - [Queue System](docs/queue-system.md) -- Queue modes and message handling
235
+ - [Architecture](docs/architecture.md) -- System design, data flows, and architectural decisions
236
+
237
+ ## Contributing
238
+
239
+ Development follows a GitFlow branching model:
240
+
241
+ - **`main`** -- Stable releases only. Protected branch, requires CI to pass.
242
+ - **`develop`** -- Integration branch. Feature and bugfix PRs target `develop`.
243
+ - **Feature branches** -- Branch from `develop` as `feature/`, `bugfix/`, `docs/`, or `chore/`.
244
+
245
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for the full development guide.
246
+
247
+ ## AI Code Review
248
+
249
+ All pull requests are automatically reviewed by GPT-4o via [ai-code-review](https://github.com/AleksandrFurmenkovOfficial/ai-code-review). The AI checks for code quality, security issues, performance concerns, and maintainability.
250
+
251
+ Reviews run on every PR open and update. Results are posted as inline comments on the pull request.
252
+
253
+ ## Prerequisites
254
+
255
+ - Python 3.11+
256
+ - [Poetry 2.0+](https://python-poetry.org/docs/#installation)
257
+ - At least one channel bot token: [Telegram](https://core.telegram.org/bots#botfather) or [Discord](https://discord.com/developers/applications)
258
+ - At least one model provider API key (Anthropic, OpenAI, or AWS credentials for Bedrock)
259
+
260
+ ## License
261
+
262
+ [PolyForm Noncommercial 1.0.0](LICENSE)
263
+
@@ -0,0 +1,197 @@
1
+ <div align="center">
2
+ <img src="docs/assets/images/logo.png" alt="OpenPaw" width="400">
3
+ <p><strong>A Friendly <a href="https://langchain-ai.github.io/langgraph/">LangChain/LangGraph</a> Multi-Agent Runner</strong></p>
4
+ <p>
5
+ <a href="https://github.com/johnsosoka/OpenPaw/actions/workflows/ci.yml"><img src="https://github.com/johnsosoka/OpenPaw/actions/workflows/ci.yml/badge.svg?branch=main" alt="CI"></a>
6
+ <a href="https://github.com/johnsosoka/OpenPaw/actions/workflows/docs.yml"><img src="https://github.com/johnsosoka/OpenPaw/actions/workflows/docs.yml/badge.svg?branch=main" alt="Docs"></a>
7
+ <img src="https://github.com/johnsosoka/OpenPaw/actions/workflows/ai-code-review.yml/badge.svg" alt="AI Code Review">
8
+ <img src="https://img.shields.io/badge/python-3.11%2B-blue" alt="Python 3.11+">
9
+ <img src="https://img.shields.io/badge/license-PolyForm%20Noncommercial-green" alt="License">
10
+ </p>
11
+ </div>
12
+
13
+ ---
14
+
15
+ > **Pre-1.0 Release (0.4.0)** — OpenPaw is actively developed. The API may evolve as we work towards a stable 1.0.0 release. Contributions and feedback are welcome.
16
+
17
+ OpenPaw gives each agent its own workspace -- personality files, custom tools, scheduled tasks -- then gets out of the way. It handles the orchestration so you can focus on what your agents actually do.
18
+
19
+ Agents can ingest documents, browse the web, search the internet, and manage their own files -- making them well-suited for research, information processing, and long-running autonomous workflows. Give them a schedule and they'll check in on their own.
20
+
21
+ > **[Read the full documentation](https://johnsosoka.github.io/OpenPaw/)**
22
+
23
+ ## Highlights
24
+
25
+ **First Class Document processing** -- Docling OCR/ICR turns scanned PDFs, DOCX, and PPTX into markdown automatically. Whisper transcribes voice messages on arrival.
26
+
27
+ **Drop-in custom tools** -- Write a `@tool` function, put it in `agent/tools/`, restart. Your agent picks it up with zero wiring.
28
+
29
+ **Multi-agent spawning** -- Agents spin up background workers for parallel tasks with full lifecycle tracking and result collection.
30
+
31
+ **Dynamic tool assignment** -- Spawned sub-agents can be given a tailored tool loadout via allow/deny lists, so each worker gets only the capabilities it needs.
32
+
33
+ **Cron scheduling and heartbeats** -- Recurring jobs, one-shot timers, proactive check-ins. Agents can even self-schedule follow-ups at runtime.
34
+
35
+ **Browser automation** -- Playwright-driven web interaction via accessibility tree. Agents reference page elements by number, not CSS selectors.
36
+
37
+ **Email integration** -- Send and receive email via Gmail with safe-by-default recipient policies. Read inbox, search, reply with threading, and manage attachments.
38
+
39
+ **Deep research** -- Integrate with a self-hosted GPT-Researcher instance for multi-source research reports with citations. Agents submit queries via WebSocket and receive comprehensive markdown reports.
40
+
41
+ **Approval gates** -- Human-in-the-loop authorization for dangerous operations, with configurable timeouts and channel-native UI.
42
+
43
+ **Multi-channel support** -- Connect agents to Telegram, Discord, or both simultaneously. Trigger-based activation lets agents respond to @mentions, keyword triggers, or both in group chats. On-demand context fetch gives agents awareness of recent channel history when triggered.
44
+
45
+ **Session management** -- Conversations auto-reset after inactivity (default 3 hours). Auto-compact rotates context when the window fills. Persistent channel logs give agents searchable message history.
46
+
47
+ **Workspace isolation** -- Each agent gets its own SOUL.md personality, tools directory, conversation history, channels, and sandboxed filesystem.
48
+
49
+ **Multi-provider LLM support** -- Anthropic, OpenAI, AWS Bedrock, xAI, and any OpenAI-compatible endpoint. Switch models at runtime with `/model`.
50
+
51
+ **Memory and observability** -- Vector search for semantic recall, conversation archiving to markdown and JSON, and session logs for every cron, heartbeat, and sub-agent run. Full visibility into what your agents are doing and thinking.
52
+
53
+ ## Quick Start
54
+
55
+ ### 1. Install
56
+
57
+ ```bash
58
+ pip install openpaw-ai
59
+ ```
60
+
61
+ For development from source:
62
+
63
+ ```bash
64
+ git clone https://github.com/johnsosoka/OpenPaw.git
65
+ cd OpenPaw
66
+ poetry install
67
+ ```
68
+
69
+ ### 2. Scaffold a workspace
70
+
71
+ ```bash
72
+ poetry run openpaw init my_agent \
73
+ --model anthropic:claude-sonnet-4-20250514 \
74
+ --channel telegram
75
+ ```
76
+
77
+ ### 3. Configure
78
+
79
+ ```bash
80
+ cp config.example.yaml config.yaml
81
+ ```
82
+
83
+ Add your API keys to `agent_workspaces/my_agent/config/.env`:
84
+
85
+ ```bash
86
+ ANTHROPIC_API_KEY=your-key-here
87
+ TELEGRAM_BOT_TOKEN=your-token-here
88
+ ```
89
+
90
+ ### 4. Run
91
+
92
+ ```bash
93
+ poetry run openpaw -c config.yaml -w my_agent
94
+ ```
95
+
96
+ ## CLI Commands
97
+
98
+ | Command | Description |
99
+ |---------|-------------|
100
+ | `openpaw init <name>` | Scaffold a new agent workspace |
101
+ | `openpaw init <name> --model <provider:model>` | Scaffold with a pre-configured model |
102
+ | `openpaw init <name> --channel telegram` | Scaffold with channel pre-configured (`telegram` or `discord`) |
103
+ | `openpaw list` | List available workspaces |
104
+ | `openpaw -c config.yaml -w <name>` | Run a single workspace |
105
+ | `openpaw -c config.yaml -w name1,name2` | Run multiple workspaces |
106
+ | `openpaw -c config.yaml --all` | Run all discovered workspaces |
107
+ | `openpaw -c config.yaml -w <name> -v` | Run with verbose logging |
108
+
109
+ All commands should be prefixed with `poetry run` when running from the project directory.
110
+
111
+ ## Agent Workspace Structure
112
+
113
+ Each workspace lives under `agent_workspaces/<name>/` and is organized into five directories:
114
+
115
+ ```
116
+ agent_workspaces/my_agent/
117
+ ├── agent/ # Identity and extensions
118
+ │ ├── AGENT.md # Capabilities and behavior guidelines
119
+ │ ├── USER.md # User context and preferences
120
+ │ ├── SOUL.md # Core personality and values
121
+ │ ├── HEARTBEAT.md # Session state scratchpad (agent-writable)
122
+ │ ├── skills/ # Skill directories (SKILL.md format)
123
+ │ ├── team/ # Spawn profiles (sub-agent personas)
124
+ │ └── tools/ # Custom LangChain @tool functions
125
+ ├── config/ # Configuration (write-protected)
126
+ │ ├── agent.yaml # Per-workspace settings (model, channel, queue)
127
+ │ ├── .env # API keys and secrets
128
+ │ └── crons/ # Scheduled task definitions
129
+ ├── .openpaw/ # Framework internals (write-protected)
130
+ │ ├── conversations.db # AsyncSqliteSaver checkpoint database
131
+ │ ├── sessions.json # Session/conversation thread state
132
+ │ ├── token_usage.jsonl # Token usage metrics (append-only)
133
+ │ └── subagents.yaml # Sub-agent requests and results
134
+ ├── memory/ # Archived conversations and session logs
135
+ │ ├── conversations/ # Conversation exports (markdown + JSON)
136
+ │ └── logs/ # Session logs and channel history
137
+ │ ├── channel/ # Persistent channel message logs (JSONL)
138
+ │ └── sessions/ # Heartbeat, cron, and sub-agent session logs
139
+ └── workspace/ # Agent work area (default write target)
140
+ ├── downloads/ # Browser-downloaded files
141
+ └── screenshots/ # Browser screenshots
142
+ ```
143
+
144
+ The `openpaw init` command scaffolds this structure with starter templates. Customize the identity files in `agent/` to shape your agent's personality and purpose. Configure model, channel, and queue behavior in `config/agent.yaml`.
145
+
146
+ The `data/` and `config/` directories are write-protected from agent filesystem tools. Write operations default to the `workspace/` directory unless an explicit path is provided.
147
+
148
+ ## In-Chat Commands
149
+
150
+ Once running, agents respond to framework commands in chat:
151
+
152
+ | Command | Description |
153
+ |---------|-------------|
154
+ | `/help` | List available commands |
155
+ | `/status` | Show model, context usage, tasks, and token usage |
156
+ | `/new` | Archive conversation and start fresh |
157
+ | `/compact` | Summarize, archive, and continue with summary |
158
+ | `/model <provider:model>` | Switch LLM model at runtime |
159
+
160
+ ## Documentation
161
+
162
+ - [Getting Started](docs/getting-started.md) -- Installation, first workspace, and troubleshooting
163
+ - [Concepts](docs/concepts.md) -- How workspaces, scheduling, queues, and tools fit together
164
+ - [Configuration](docs/configuration.md) -- Global and per-workspace configuration reference
165
+ - [Workspaces](docs/workspaces.md) -- Workspace structure, identity files, and custom tools
166
+ - [Scheduling](docs/scheduling.md) -- Cron jobs, heartbeats, and dynamic scheduling
167
+ - [Built-ins](docs/builtins.md) -- Web search, browser automation, email, voice, sub-agents, and more
168
+ - [Channels](docs/channels.md) -- Channel adapters and access control
169
+ - [Queue System](docs/queue-system.md) -- Queue modes and message handling
170
+ - [Architecture](docs/architecture.md) -- System design, data flows, and architectural decisions
171
+
172
+ ## Contributing
173
+
174
+ Development follows a GitFlow branching model:
175
+
176
+ - **`main`** -- Stable releases only. Protected branch, requires CI to pass.
177
+ - **`develop`** -- Integration branch. Feature and bugfix PRs target `develop`.
178
+ - **Feature branches** -- Branch from `develop` as `feature/`, `bugfix/`, `docs/`, or `chore/`.
179
+
180
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for the full development guide.
181
+
182
+ ## AI Code Review
183
+
184
+ All pull requests are automatically reviewed by GPT-4o via [ai-code-review](https://github.com/AleksandrFurmenkovOfficial/ai-code-review). The AI checks for code quality, security issues, performance concerns, and maintainability.
185
+
186
+ Reviews run on every PR open and update. Results are posted as inline comments on the pull request.
187
+
188
+ ## Prerequisites
189
+
190
+ - Python 3.11+
191
+ - [Poetry 2.0+](https://python-poetry.org/docs/#installation)
192
+ - At least one channel bot token: [Telegram](https://core.telegram.org/bots#botfather) or [Discord](https://discord.com/developers/applications)
193
+ - At least one model provider API key (Anthropic, OpenAI, or AWS credentials for Bedrock)
194
+
195
+ ## License
196
+
197
+ [PolyForm Noncommercial 1.0.0](LICENSE)
@@ -0,0 +1,9 @@
1
+ """OpenPaw - Multi-Channel AI Agent Framework built on LangGraph.
2
+
3
+ Each agent runs in an isolated workspace with its own identity, tools,
4
+ conversation history, and scheduled tasks. Supports Telegram, Discord, and
5
+ stdio channels out of the box.
6
+ """
7
+
8
+ __version__ = "0.4.0"
9
+ __all__ = ["__version__"]
@@ -0,0 +1,20 @@
1
+ """Agent execution and lifecycle management.
2
+
3
+ This package consolidates agent-related functionality:
4
+ - AgentRunner: LangGraph agent with workspace integration
5
+ - Metrics: Token usage tracking and logging
6
+ - Middleware: Tool execution middleware (queue-aware, approval, LLM hooks)
7
+ - Tools: Sandboxed filesystem tools for workspace access
8
+ """
9
+
10
+ from openpaw.agent.metrics import InvocationMetrics, TokenUsageLogger, TokenUsageReader
11
+ from openpaw.agent.response_processor import ResponseProcessor
12
+ from openpaw.agent.runner import AgentRunner
13
+
14
+ __all__ = [
15
+ "AgentRunner",
16
+ "InvocationMetrics",
17
+ "ResponseProcessor",
18
+ "TokenUsageLogger",
19
+ "TokenUsageReader",
20
+ ]