@agentikos/omega-os 0.2.0 → 0.19.5

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 (367) hide show
  1. package/README.md +33 -3
  2. package/bootstrap/lib/__pycache__/claude-code-settings.cpython-313.pyc +0 -0
  3. package/bootstrap/lib/__pycache__/llm-clis.cpython-313.pyc +0 -0
  4. package/bootstrap/lib/__pycache__/manifest-helpers.cpython-313.pyc +0 -0
  5. package/bootstrap/lib/claude-code-settings.py +176 -0
  6. package/bootstrap/lib/common.sh +457 -1
  7. package/bootstrap/lib/llm-clis.py +341 -0
  8. package/bootstrap/lib/manifest-helpers.py +384 -0
  9. package/bootstrap/lib/steps.sh +790 -21
  10. package/bootstrap/manifest.example.yaml +87 -1
  11. package/bootstrap/templates/aisb/CLAUDE.md +305 -0
  12. package/bootstrap/templates/aisb/architect.md +204 -0
  13. package/bootstrap/templates/aisb/checkers/CLAUDE.md +9 -0
  14. package/bootstrap/templates/aisb/checkers/checker-architect.md +151 -0
  15. package/bootstrap/templates/aisb/checkers/checker-common.md +171 -0
  16. package/bootstrap/templates/aisb/checkers/checker-construct.md +129 -0
  17. package/bootstrap/templates/aisb/checkers/checker-keymaker.md +204 -0
  18. package/bootstrap/templates/aisb/checkers/checker-link.md +205 -0
  19. package/bootstrap/templates/aisb/checkers/checker-merovingian.md +219 -0
  20. package/bootstrap/templates/aisb/checkers/checker-morpheus.md +211 -0
  21. package/bootstrap/templates/aisb/checkers/checker-neo.md +177 -0
  22. package/bootstrap/templates/aisb/checkers/checker-niobe.md +156 -0
  23. package/bootstrap/templates/aisb/checkers/checker-oracle.md +164 -0
  24. package/bootstrap/templates/aisb/checkers/checker-seraph.md +187 -0
  25. package/bootstrap/templates/aisb/checkers/checker-smith.md +195 -0
  26. package/bootstrap/templates/aisb/checkers/checker-zion.md +113 -0
  27. package/bootstrap/templates/aisb/construct.md +135 -0
  28. package/bootstrap/templates/aisb/keymaker.md +227 -0
  29. package/bootstrap/templates/aisb/link.md +170 -0
  30. package/bootstrap/templates/aisb/lmc-protocol.md +57 -0
  31. package/bootstrap/templates/aisb/merovingian.md +159 -0
  32. package/bootstrap/templates/aisb/morpheus.md +243 -0
  33. package/bootstrap/templates/aisb/neo.md +147 -0
  34. package/bootstrap/templates/aisb/niobe.md +197 -0
  35. package/bootstrap/templates/aisb/oracle.md +244 -0
  36. package/bootstrap/templates/aisb/protocols/handoff-templates.md +204 -0
  37. package/bootstrap/templates/aisb/protocols/shared-protocol.md +248 -0
  38. package/bootstrap/templates/aisb/pythia.md +153 -0
  39. package/bootstrap/templates/aisb/seraph.md +315 -0
  40. package/bootstrap/templates/aisb/smith.md +202 -0
  41. package/bootstrap/templates/aisb/zion.md +172 -0
  42. package/bootstrap/templates/autonomous/audit-patrol.yaml +41 -0
  43. package/bootstrap/templates/autonomous/smith-reflect.yaml +43 -0
  44. package/bootstrap/templates/autonomous/ssh-key-rotate.yaml +46 -0
  45. package/bootstrap/templates/autonomous/support-agent.yaml +38 -0
  46. package/docs/AUDITS.md +85 -0
  47. package/docs/GAP-ANALYSIS.md +214 -0
  48. package/docs/INSTALL.md +47 -9
  49. package/docs/MCP-AND-PLUGINS.md +31 -4
  50. package/docs/SIMULATION.md +171 -0
  51. package/docs/simulate.sh +211 -0
  52. package/install.sh +164 -17
  53. package/omega/Agentik_Engine/README.md +4 -2
  54. package/omega/Agentik_Engine/omega_engine/__init__.py +147 -1
  55. package/omega/Agentik_Engine/omega_engine/__pycache__/__init__.cpython-313.pyc +0 -0
  56. package/omega/Agentik_Engine/omega_engine/__pycache__/account.cpython-313.pyc +0 -0
  57. package/omega/Agentik_Engine/omega_engine/__pycache__/agent_messages.cpython-313.pyc +0 -0
  58. package/omega/Agentik_Engine/omega_engine/__pycache__/aisb_chat.cpython-313.pyc +0 -0
  59. package/omega/Agentik_Engine/omega_engine/__pycache__/audit.cpython-313.pyc +0 -0
  60. package/omega/Agentik_Engine/omega_engine/__pycache__/audit_arsenal.cpython-313.pyc +0 -0
  61. package/omega/Agentik_Engine/omega_engine/__pycache__/audit_diff.cpython-313.pyc +0 -0
  62. package/omega/Agentik_Engine/omega_engine/__pycache__/audit_gate.cpython-313.pyc +0 -0
  63. package/omega/Agentik_Engine/omega_engine/__pycache__/auto_update.cpython-313.pyc +0 -0
  64. package/omega/Agentik_Engine/omega_engine/__pycache__/autonomous.cpython-313.pyc +0 -0
  65. package/omega/Agentik_Engine/omega_engine/__pycache__/backup.cpython-313.pyc +0 -0
  66. package/omega/Agentik_Engine/omega_engine/__pycache__/barrier.cpython-313.pyc +0 -0
  67. package/omega/Agentik_Engine/omega_engine/__pycache__/bus.cpython-313.pyc +0 -0
  68. package/omega/Agentik_Engine/omega_engine/__pycache__/cadence.cpython-313.pyc +0 -0
  69. package/omega/Agentik_Engine/omega_engine/__pycache__/classifier.cpython-313.pyc +0 -0
  70. package/omega/Agentik_Engine/omega_engine/__pycache__/cleanup.cpython-313.pyc +0 -0
  71. package/omega/Agentik_Engine/omega_engine/__pycache__/cli.cpython-313.pyc +0 -0
  72. package/omega/Agentik_Engine/omega_engine/__pycache__/completions.cpython-313.pyc +0 -0
  73. package/omega/Agentik_Engine/omega_engine/__pycache__/costs.cpython-313.pyc +0 -0
  74. package/omega/Agentik_Engine/omega_engine/__pycache__/done_signal.cpython-313.pyc +0 -0
  75. package/omega/Agentik_Engine/omega_engine/__pycache__/envelope.cpython-313.pyc +0 -0
  76. package/omega/Agentik_Engine/omega_engine/__pycache__/events.cpython-313.pyc +0 -0
  77. package/omega/Agentik_Engine/omega_engine/__pycache__/executor.cpython-313.pyc +0 -0
  78. package/omega/Agentik_Engine/omega_engine/__pycache__/handoff.cpython-313.pyc +0 -0
  79. package/omega/Agentik_Engine/omega_engine/__pycache__/hermes.cpython-313.pyc +0 -0
  80. package/omega/Agentik_Engine/omega_engine/__pycache__/hermes_bootstrap.cpython-313.pyc +0 -0
  81. package/omega/Agentik_Engine/omega_engine/__pycache__/hermes_desktop.cpython-313.pyc +0 -0
  82. package/omega/Agentik_Engine/omega_engine/__pycache__/learning.cpython-313.pyc +0 -0
  83. package/omega/Agentik_Engine/omega_engine/__pycache__/managed_agent.cpython-313.pyc +0 -0
  84. package/omega/Agentik_Engine/omega_engine/__pycache__/memory.cpython-313.pyc +0 -0
  85. package/omega/Agentik_Engine/omega_engine/__pycache__/menu.cpython-313.pyc +0 -0
  86. package/omega/Agentik_Engine/omega_engine/__pycache__/mission.cpython-313.pyc +0 -0
  87. package/omega/Agentik_Engine/omega_engine/__pycache__/plan.cpython-313.pyc +0 -0
  88. package/omega/Agentik_Engine/omega_engine/__pycache__/progress.cpython-313.pyc +0 -0
  89. package/omega/Agentik_Engine/omega_engine/__pycache__/project.cpython-313.pyc +0 -0
  90. package/omega/Agentik_Engine/omega_engine/__pycache__/prompts.cpython-313.pyc +0 -0
  91. package/omega/Agentik_Engine/omega_engine/__pycache__/provider.cpython-313.pyc +0 -0
  92. package/omega/Agentik_Engine/omega_engine/__pycache__/prune.cpython-313.pyc +0 -0
  93. package/omega/Agentik_Engine/omega_engine/__pycache__/pursue.cpython-313.pyc +0 -0
  94. package/omega/Agentik_Engine/omega_engine/__pycache__/reducer.cpython-313.pyc +0 -0
  95. package/omega/Agentik_Engine/omega_engine/__pycache__/report.cpython-313.pyc +0 -0
  96. package/omega/Agentik_Engine/omega_engine/__pycache__/router.cpython-313.pyc +0 -0
  97. package/omega/Agentik_Engine/omega_engine/__pycache__/skill_routing.cpython-313.pyc +0 -0
  98. package/omega/Agentik_Engine/omega_engine/__pycache__/smoke.cpython-313.pyc +0 -0
  99. package/omega/Agentik_Engine/omega_engine/__pycache__/store.cpython-313.pyc +0 -0
  100. package/omega/Agentik_Engine/omega_engine/__pycache__/supervisor.cpython-313.pyc +0 -0
  101. package/omega/Agentik_Engine/omega_engine/__pycache__/sync.cpython-313.pyc +0 -0
  102. package/omega/Agentik_Engine/omega_engine/__pycache__/task.cpython-313.pyc +0 -0
  103. package/omega/Agentik_Engine/omega_engine/__pycache__/telegram.cpython-313.pyc +0 -0
  104. package/omega/Agentik_Engine/omega_engine/__pycache__/telegram_history.cpython-313.pyc +0 -0
  105. package/omega/Agentik_Engine/omega_engine/__pycache__/tmux.cpython-313.pyc +0 -0
  106. package/omega/Agentik_Engine/omega_engine/__pycache__/tools.cpython-313.pyc +0 -0
  107. package/omega/Agentik_Engine/omega_engine/__pycache__/understand_anything.cpython-313.pyc +0 -0
  108. package/omega/Agentik_Engine/omega_engine/__pycache__/updater.cpython-313.pyc +0 -0
  109. package/omega/Agentik_Engine/omega_engine/__pycache__/validate.cpython-313.pyc +0 -0
  110. package/omega/Agentik_Engine/omega_engine/__pycache__/vault.cpython-313.pyc +0 -0
  111. package/omega/Agentik_Engine/omega_engine/__pycache__/webhooks.cpython-313.pyc +0 -0
  112. package/omega/Agentik_Engine/omega_engine/__pycache__/worker.cpython-313.pyc +0 -0
  113. package/omega/Agentik_Engine/omega_engine/account.py +28 -31
  114. package/omega/Agentik_Engine/omega_engine/agent_messages.py +167 -0
  115. package/omega/Agentik_Engine/omega_engine/aisb_chat.py +128 -0
  116. package/omega/Agentik_Engine/omega_engine/audit_diff.py +99 -0
  117. package/omega/Agentik_Engine/omega_engine/audit_gate.py +149 -0
  118. package/omega/Agentik_Engine/omega_engine/audits/__init__.py +60 -0
  119. package/omega/Agentik_Engine/omega_engine/audits/__pycache__/__init__.cpython-313.pyc +0 -0
  120. package/omega/Agentik_Engine/omega_engine/audits/__pycache__/batcher.cpython-313.pyc +0 -0
  121. package/omega/Agentik_Engine/omega_engine/audits/__pycache__/dispatcher.cpython-313.pyc +0 -0
  122. package/omega/Agentik_Engine/omega_engine/audits/__pycache__/generator.cpython-313.pyc +0 -0
  123. package/omega/Agentik_Engine/omega_engine/audits/__pycache__/history.cpython-313.pyc +0 -0
  124. package/omega/Agentik_Engine/omega_engine/audits/__pycache__/pipeline.cpython-313.pyc +0 -0
  125. package/omega/Agentik_Engine/omega_engine/audits/batcher.py +218 -0
  126. package/omega/Agentik_Engine/omega_engine/audits/dispatcher.py +92 -0
  127. package/omega/Agentik_Engine/omega_engine/audits/generator.py +234 -0
  128. package/omega/Agentik_Engine/omega_engine/audits/history.py +168 -0
  129. package/omega/Agentik_Engine/omega_engine/audits/pipeline.py +198 -0
  130. package/omega/Agentik_Engine/omega_engine/auto_update.py +339 -0
  131. package/omega/Agentik_Engine/omega_engine/backup.py +215 -0
  132. package/omega/Agentik_Engine/omega_engine/cadence.py +158 -0
  133. package/omega/Agentik_Engine/omega_engine/classifier.py +215 -0
  134. package/omega/Agentik_Engine/omega_engine/cleanup.py +673 -0
  135. package/omega/Agentik_Engine/omega_engine/cli.py +4156 -86
  136. package/omega/Agentik_Engine/omega_engine/completions.py +260 -0
  137. package/omega/Agentik_Engine/omega_engine/costs.py +100 -0
  138. package/omega/Agentik_Engine/omega_engine/daemons/__pycache__/__init__.cpython-313.pyc +0 -0
  139. package/omega/Agentik_Engine/omega_engine/daemons/__pycache__/autonomous.cpython-313.pyc +0 -0
  140. package/omega/Agentik_Engine/omega_engine/daemons/__pycache__/engine.cpython-313.pyc +0 -0
  141. package/omega/Agentik_Engine/omega_engine/daemons/__pycache__/telegram.cpython-313.pyc +0 -0
  142. package/omega/Agentik_Engine/omega_engine/daemons/engine.py +53 -4
  143. package/omega/Agentik_Engine/omega_engine/daemons/telegram.py +101 -17
  144. package/omega/Agentik_Engine/omega_engine/done_signal.py +154 -0
  145. package/omega/Agentik_Engine/omega_engine/educators/__pycache__/__init__.cpython-313.pyc +0 -0
  146. package/omega/Agentik_Engine/omega_engine/educators/__pycache__/artifact.cpython-313.pyc +0 -0
  147. package/omega/Agentik_Engine/omega_engine/educators/__pycache__/automation.cpython-313.pyc +0 -0
  148. package/omega/Agentik_Engine/omega_engine/educators/__pycache__/base.cpython-313.pyc +0 -0
  149. package/omega/Agentik_Engine/omega_engine/educators/__pycache__/claudecode.cpython-313.pyc +0 -0
  150. package/omega/Agentik_Engine/omega_engine/educators/__pycache__/connection.cpython-313.pyc +0 -0
  151. package/omega/Agentik_Engine/omega_engine/educators/__pycache__/coworker.cpython-313.pyc +0 -0
  152. package/omega/Agentik_Engine/omega_engine/educators/__pycache__/loop.cpython-313.pyc +0 -0
  153. package/omega/Agentik_Engine/omega_engine/educators/__pycache__/prompt.cpython-313.pyc +0 -0
  154. package/omega/Agentik_Engine/omega_engine/educators/__pycache__/skill.cpython-313.pyc +0 -0
  155. package/omega/Agentik_Engine/omega_engine/envelope.py +219 -0
  156. package/omega/Agentik_Engine/omega_engine/executor.py +149 -10
  157. package/omega/Agentik_Engine/omega_engine/genesis/__init__.py +134 -0
  158. package/omega/Agentik_Engine/omega_engine/genesis/__pycache__/__init__.cpython-313.pyc +0 -0
  159. package/omega/Agentik_Engine/omega_engine/genesis/__pycache__/orchestrator.cpython-313.pyc +0 -0
  160. package/omega/Agentik_Engine/omega_engine/genesis/__pycache__/phases.cpython-313.pyc +0 -0
  161. package/omega/Agentik_Engine/omega_engine/genesis/__pycache__/stack.cpython-313.pyc +0 -0
  162. package/omega/Agentik_Engine/omega_engine/genesis/__pycache__/state.cpython-313.pyc +0 -0
  163. package/omega/Agentik_Engine/omega_engine/genesis/orchestrator.py +262 -0
  164. package/omega/Agentik_Engine/omega_engine/genesis/phases.py +950 -0
  165. package/omega/Agentik_Engine/omega_engine/genesis/stack.py +324 -0
  166. package/omega/Agentik_Engine/omega_engine/genesis/state.py +353 -0
  167. package/omega/Agentik_Engine/omega_engine/handoff.py +459 -0
  168. package/omega/Agentik_Engine/omega_engine/hermes.py +426 -0
  169. package/omega/Agentik_Engine/omega_engine/hermes_bootstrap.py +382 -0
  170. package/omega/Agentik_Engine/omega_engine/hermes_desktop.py +469 -0
  171. package/omega/Agentik_Engine/omega_engine/integrations/__init__.py +30 -0
  172. package/omega/Agentik_Engine/omega_engine/integrations/__pycache__/__init__.cpython-313.pyc +0 -0
  173. package/omega/Agentik_Engine/omega_engine/integrations/__pycache__/graphify.cpython-313.pyc +0 -0
  174. package/omega/Agentik_Engine/omega_engine/integrations/graphify.py +234 -0
  175. package/omega/Agentik_Engine/omega_engine/learning.py +268 -0
  176. package/omega/Agentik_Engine/omega_engine/managed_agent.py +467 -0
  177. package/omega/Agentik_Engine/omega_engine/memory.py +271 -0
  178. package/omega/Agentik_Engine/omega_engine/menu.py +1065 -0
  179. package/omega/Agentik_Engine/omega_engine/migrations/__init__.py +144 -0
  180. package/omega/Agentik_Engine/omega_engine/migrations/__pycache__/__init__.cpython-313.pyc +0 -0
  181. package/omega/Agentik_Engine/omega_engine/migrations/__pycache__/v0_14_0.cpython-313.pyc +0 -0
  182. package/omega/Agentik_Engine/omega_engine/migrations/v0_14_0.py +29 -0
  183. package/omega/Agentik_Engine/omega_engine/mission.py +16 -13
  184. package/omega/Agentik_Engine/omega_engine/plan.py +846 -0
  185. package/omega/Agentik_Engine/omega_engine/prompts.py +158 -0
  186. package/omega/Agentik_Engine/omega_engine/provider.py +161 -12
  187. package/omega/Agentik_Engine/omega_engine/prune.py +151 -0
  188. package/omega/Agentik_Engine/omega_engine/pursue.py +205 -0
  189. package/omega/Agentik_Engine/omega_engine/rag/__pycache__/__init__.cpython-313.pyc +0 -0
  190. package/omega/Agentik_Engine/omega_engine/rag/__pycache__/agentic.cpython-313.pyc +0 -0
  191. package/omega/Agentik_Engine/omega_engine/rag/__pycache__/base.cpython-313.pyc +0 -0
  192. package/omega/Agentik_Engine/omega_engine/rag/__pycache__/corrective.cpython-313.pyc +0 -0
  193. package/omega/Agentik_Engine/omega_engine/rag/__pycache__/graph.cpython-313.pyc +0 -0
  194. package/omega/Agentik_Engine/omega_engine/rag/__pycache__/hybrid.cpython-313.pyc +0 -0
  195. package/omega/Agentik_Engine/omega_engine/rag/__pycache__/multimodal.cpython-313.pyc +0 -0
  196. package/omega/Agentik_Engine/omega_engine/rag/__pycache__/router.cpython-313.pyc +0 -0
  197. package/omega/Agentik_Engine/omega_engine/router.py +28 -0
  198. package/omega/Agentik_Engine/omega_engine/skill_discovery/__init__.py +48 -0
  199. package/omega/Agentik_Engine/omega_engine/skill_discovery/__pycache__/__init__.cpython-313.pyc +0 -0
  200. package/omega/Agentik_Engine/omega_engine/skill_discovery/__pycache__/auditor.cpython-313.pyc +0 -0
  201. package/omega/Agentik_Engine/omega_engine/skill_discovery/__pycache__/finder.cpython-313.pyc +0 -0
  202. package/omega/Agentik_Engine/omega_engine/skill_discovery/__pycache__/installer.cpython-313.pyc +0 -0
  203. package/omega/Agentik_Engine/omega_engine/skill_discovery/__pycache__/marketplaces.cpython-313.pyc +0 -0
  204. package/omega/Agentik_Engine/omega_engine/skill_discovery/auditor.py +232 -0
  205. package/omega/Agentik_Engine/omega_engine/skill_discovery/finder.py +94 -0
  206. package/omega/Agentik_Engine/omega_engine/skill_discovery/installer.py +129 -0
  207. package/omega/Agentik_Engine/omega_engine/skill_discovery/marketplaces.py +80 -0
  208. package/omega/Agentik_Engine/omega_engine/skill_routing.py +388 -0
  209. package/omega/Agentik_Engine/omega_engine/smoke.py +81 -0
  210. package/omega/Agentik_Engine/omega_engine/store.py +88 -41
  211. package/omega/Agentik_Engine/omega_engine/sync.py +142 -1
  212. package/omega/Agentik_Engine/omega_engine/telegram_history.py +260 -0
  213. package/omega/Agentik_Engine/omega_engine/tmux.py +526 -0
  214. package/omega/Agentik_Engine/omega_engine/understand_anything.py +275 -0
  215. package/omega/Agentik_Engine/omega_engine/updater.py +70 -0
  216. package/omega/Agentik_Engine/omega_engine/validate.py +186 -0
  217. package/omega/Agentik_Engine/omega_engine/vault.py +342 -0
  218. package/omega/Agentik_Engine/omega_engine/webhooks.py +262 -0
  219. package/omega/Agentik_Engine/omega_engine/worker.py +526 -0
  220. package/omega/Agentik_Engine/pyproject.toml +1 -1
  221. package/omega/Agentik_Engine/tests/__pycache__/test_account.cpython-313-pytest-8.4.2.pyc +0 -0
  222. package/omega/Agentik_Engine/tests/__pycache__/test_account.cpython-313.pyc +0 -0
  223. package/omega/Agentik_Engine/tests/__pycache__/test_adversarial.cpython-313-pytest-8.4.2.pyc +0 -0
  224. package/omega/Agentik_Engine/tests/__pycache__/test_adversarial.cpython-313.pyc +0 -0
  225. package/omega/Agentik_Engine/tests/__pycache__/test_agents_envelope.cpython-313-pytest-8.4.2.pyc +0 -0
  226. package/omega/Agentik_Engine/tests/__pycache__/test_agents_envelope.cpython-313.pyc +0 -0
  227. package/omega/Agentik_Engine/tests/__pycache__/test_audit_arsenal.cpython-313-pytest-8.4.2.pyc +0 -0
  228. package/omega/Agentik_Engine/tests/__pycache__/test_audit_arsenal.cpython-313.pyc +0 -0
  229. package/omega/Agentik_Engine/tests/__pycache__/test_audits_pipeline.cpython-313-pytest-8.4.2.pyc +0 -0
  230. package/omega/Agentik_Engine/tests/__pycache__/test_audits_pipeline.cpython-313.pyc +0 -0
  231. package/omega/Agentik_Engine/tests/__pycache__/test_auto_update_and_migrations.cpython-313-pytest-8.4.2.pyc +0 -0
  232. package/omega/Agentik_Engine/tests/__pycache__/test_auto_update_and_migrations.cpython-313.pyc +0 -0
  233. package/omega/Agentik_Engine/tests/__pycache__/test_autonomous.cpython-313-pytest-8.4.2.pyc +0 -0
  234. package/omega/Agentik_Engine/tests/__pycache__/test_autonomous.cpython-313.pyc +0 -0
  235. package/omega/Agentik_Engine/tests/__pycache__/test_educators.cpython-313-pytest-8.4.2.pyc +0 -0
  236. package/omega/Agentik_Engine/tests/__pycache__/test_educators.cpython-313.pyc +0 -0
  237. package/omega/Agentik_Engine/tests/__pycache__/test_executor.cpython-313-pytest-8.4.2.pyc +0 -0
  238. package/omega/Agentik_Engine/tests/__pycache__/test_executor.cpython-313.pyc +0 -0
  239. package/omega/Agentik_Engine/tests/__pycache__/test_genesis_and_plan.cpython-313-pytest-8.4.2.pyc +0 -0
  240. package/omega/Agentik_Engine/tests/__pycache__/test_genesis_and_plan.cpython-313.pyc +0 -0
  241. package/omega/Agentik_Engine/tests/__pycache__/test_graphify.cpython-313-pytest-8.4.2.pyc +0 -0
  242. package/omega/Agentik_Engine/tests/__pycache__/test_graphify.cpython-313.pyc +0 -0
  243. package/omega/Agentik_Engine/tests/__pycache__/test_handoff.cpython-313-pytest-8.4.2.pyc +0 -0
  244. package/omega/Agentik_Engine/tests/__pycache__/test_handoff.cpython-313.pyc +0 -0
  245. package/omega/Agentik_Engine/tests/__pycache__/test_hermes_and_ua.cpython-313-pytest-8.4.2.pyc +0 -0
  246. package/omega/Agentik_Engine/tests/__pycache__/test_hermes_and_ua.cpython-313.pyc +0 -0
  247. package/omega/Agentik_Engine/tests/__pycache__/test_hermes_bootstrap_and_desktop.cpython-313-pytest-8.4.2.pyc +0 -0
  248. package/omega/Agentik_Engine/tests/__pycache__/test_hermes_bootstrap_and_desktop.cpython-313.pyc +0 -0
  249. package/omega/Agentik_Engine/tests/__pycache__/test_install_steps.cpython-313-pytest-8.4.2.pyc +0 -0
  250. package/omega/Agentik_Engine/tests/__pycache__/test_install_steps.cpython-313.pyc +0 -0
  251. package/omega/Agentik_Engine/tests/__pycache__/test_install_ux.cpython-313-pytest-8.4.2.pyc +0 -0
  252. package/omega/Agentik_Engine/tests/__pycache__/test_install_ux.cpython-313.pyc +0 -0
  253. package/omega/Agentik_Engine/tests/__pycache__/test_installer_wiring.cpython-313-pytest-8.4.2.pyc +0 -0
  254. package/omega/Agentik_Engine/tests/__pycache__/test_installer_wiring.cpython-313.pyc +0 -0
  255. package/omega/Agentik_Engine/tests/__pycache__/test_intelligence.cpython-313-pytest-8.4.2.pyc +0 -0
  256. package/omega/Agentik_Engine/tests/__pycache__/test_intelligence.cpython-313.pyc +0 -0
  257. package/omega/Agentik_Engine/tests/__pycache__/test_llm_clis_and_uninstall.cpython-313-pytest-8.4.2.pyc +0 -0
  258. package/omega/Agentik_Engine/tests/__pycache__/test_llm_clis_and_uninstall.cpython-313.pyc +0 -0
  259. package/omega/Agentik_Engine/tests/__pycache__/test_managed_agent.cpython-313-pytest-8.4.2.pyc +0 -0
  260. package/omega/Agentik_Engine/tests/__pycache__/test_managed_agent.cpython-313.pyc +0 -0
  261. package/omega/Agentik_Engine/tests/__pycache__/test_max_provider_and_menu.cpython-313-pytest-8.4.2.pyc +0 -0
  262. package/omega/Agentik_Engine/tests/__pycache__/test_max_provider_and_menu.cpython-313.pyc +0 -0
  263. package/omega/Agentik_Engine/tests/__pycache__/test_menu_coverage.cpython-313-pytest-8.4.2.pyc +0 -0
  264. package/omega/Agentik_Engine/tests/__pycache__/test_menu_coverage.cpython-313.pyc +0 -0
  265. package/omega/Agentik_Engine/tests/__pycache__/test_mission.cpython-313-pytest-8.4.2.pyc +0 -0
  266. package/omega/Agentik_Engine/tests/__pycache__/test_mission.cpython-313.pyc +0 -0
  267. package/omega/Agentik_Engine/tests/__pycache__/test_progress.cpython-313-pytest-8.4.2.pyc +0 -0
  268. package/omega/Agentik_Engine/tests/__pycache__/test_progress.cpython-313.pyc +0 -0
  269. package/omega/Agentik_Engine/tests/__pycache__/test_project.cpython-313-pytest-8.4.2.pyc +0 -0
  270. package/omega/Agentik_Engine/tests/__pycache__/test_project.cpython-313.pyc +0 -0
  271. package/omega/Agentik_Engine/tests/__pycache__/test_pursue_cadence.cpython-313-pytest-8.4.2.pyc +0 -0
  272. package/omega/Agentik_Engine/tests/__pycache__/test_pursue_cadence.cpython-313.pyc +0 -0
  273. package/omega/Agentik_Engine/tests/__pycache__/test_rag.cpython-313-pytest-8.4.2.pyc +0 -0
  274. package/omega/Agentik_Engine/tests/__pycache__/test_rag.cpython-313.pyc +0 -0
  275. package/omega/Agentik_Engine/tests/__pycache__/test_reducer.cpython-313-pytest-8.4.2.pyc +0 -0
  276. package/omega/Agentik_Engine/tests/__pycache__/test_reducer.cpython-313.pyc +0 -0
  277. package/omega/Agentik_Engine/tests/__pycache__/test_report.cpython-313-pytest-8.4.2.pyc +0 -0
  278. package/omega/Agentik_Engine/tests/__pycache__/test_report.cpython-313.pyc +0 -0
  279. package/omega/Agentik_Engine/tests/__pycache__/test_role_aliases_and_ssot.cpython-313-pytest-8.4.2.pyc +0 -0
  280. package/omega/Agentik_Engine/tests/__pycache__/test_role_aliases_and_ssot.cpython-313.pyc +0 -0
  281. package/omega/Agentik_Engine/tests/__pycache__/test_skill_discovery_and_gate.cpython-313-pytest-8.4.2.pyc +0 -0
  282. package/omega/Agentik_Engine/tests/__pycache__/test_skill_discovery_and_gate.cpython-313.pyc +0 -0
  283. package/omega/Agentik_Engine/tests/__pycache__/test_skill_power.cpython-313-pytest-8.4.2.pyc +0 -0
  284. package/omega/Agentik_Engine/tests/__pycache__/test_skill_power.cpython-313.pyc +0 -0
  285. package/omega/Agentik_Engine/tests/__pycache__/test_skill_routing.cpython-313-pytest-8.4.2.pyc +0 -0
  286. package/omega/Agentik_Engine/tests/__pycache__/test_skill_routing.cpython-313.pyc +0 -0
  287. package/omega/Agentik_Engine/tests/__pycache__/test_snapshot_partial.cpython-313-pytest-8.4.2.pyc +0 -0
  288. package/omega/Agentik_Engine/tests/__pycache__/test_snapshot_partial.cpython-313.pyc +0 -0
  289. package/omega/Agentik_Engine/tests/__pycache__/test_telegram_history.cpython-313-pytest-8.4.2.pyc +0 -0
  290. package/omega/Agentik_Engine/tests/__pycache__/test_telegram_history.cpython-313.pyc +0 -0
  291. package/omega/Agentik_Engine/tests/__pycache__/test_tmux_and_aisb_chat.cpython-313-pytest-8.4.2.pyc +0 -0
  292. package/omega/Agentik_Engine/tests/__pycache__/test_tmux_and_aisb_chat.cpython-313.pyc +0 -0
  293. package/omega/Agentik_Engine/tests/__pycache__/test_tools_and_sync.cpython-313-pytest-8.4.2.pyc +0 -0
  294. package/omega/Agentik_Engine/tests/__pycache__/test_tools_and_sync.cpython-313.pyc +0 -0
  295. package/omega/Agentik_Engine/tests/__pycache__/test_v06_features.cpython-313-pytest-8.4.2.pyc +0 -0
  296. package/omega/Agentik_Engine/tests/__pycache__/test_v06_features.cpython-313.pyc +0 -0
  297. package/omega/Agentik_Engine/tests/__pycache__/test_vault.cpython-313-pytest-8.4.2.pyc +0 -0
  298. package/omega/Agentik_Engine/tests/__pycache__/test_vault.cpython-313.pyc +0 -0
  299. package/omega/Agentik_Engine/tests/__pycache__/test_webhooks_and_readiness.cpython-313-pytest-8.4.2.pyc +0 -0
  300. package/omega/Agentik_Engine/tests/__pycache__/test_webhooks_and_readiness.cpython-313.pyc +0 -0
  301. package/omega/Agentik_Engine/tests/__pycache__/test_worker_and_cleanup.cpython-313-pytest-8.4.2.pyc +0 -0
  302. package/omega/Agentik_Engine/tests/__pycache__/test_worker_and_cleanup.cpython-313.pyc +0 -0
  303. package/omega/Agentik_Engine/tests/test_account.py +8 -3
  304. package/omega/Agentik_Engine/tests/test_adversarial.py +351 -0
  305. package/omega/Agentik_Engine/tests/test_agents_envelope.py +274 -0
  306. package/omega/Agentik_Engine/tests/test_audits_pipeline.py +348 -0
  307. package/omega/Agentik_Engine/tests/test_auto_update_and_migrations.py +394 -0
  308. package/omega/Agentik_Engine/tests/test_genesis_and_plan.py +573 -0
  309. package/omega/Agentik_Engine/tests/test_graphify.py +190 -0
  310. package/omega/Agentik_Engine/tests/test_handoff.py +311 -0
  311. package/omega/Agentik_Engine/tests/test_hermes_and_ua.py +387 -0
  312. package/omega/Agentik_Engine/tests/test_hermes_bootstrap_and_desktop.py +358 -0
  313. package/omega/Agentik_Engine/tests/test_install_steps.py +359 -0
  314. package/omega/Agentik_Engine/tests/test_install_ux.py +151 -0
  315. package/omega/Agentik_Engine/tests/test_installer_wiring.py +496 -0
  316. package/omega/Agentik_Engine/tests/test_intelligence.py +285 -0
  317. package/omega/Agentik_Engine/tests/test_llm_clis_and_uninstall.py +228 -0
  318. package/omega/Agentik_Engine/tests/test_managed_agent.py +363 -0
  319. package/omega/Agentik_Engine/tests/test_max_provider_and_menu.py +231 -0
  320. package/omega/Agentik_Engine/tests/test_menu_coverage.py +72 -0
  321. package/omega/Agentik_Engine/tests/test_pursue_cadence.py +217 -0
  322. package/omega/Agentik_Engine/tests/test_role_aliases_and_ssot.py +207 -0
  323. package/omega/Agentik_Engine/tests/test_skill_discovery_and_gate.py +337 -0
  324. package/omega/Agentik_Engine/tests/test_skill_power.py +259 -0
  325. package/omega/Agentik_Engine/tests/test_skill_routing.py +189 -0
  326. package/omega/Agentik_Engine/tests/test_telegram_history.py +209 -0
  327. package/omega/Agentik_Engine/tests/test_tmux_and_aisb_chat.py +223 -0
  328. package/omega/Agentik_Engine/tests/test_v06_features.py +370 -0
  329. package/omega/Agentik_Engine/tests/test_vault.py +173 -0
  330. package/omega/Agentik_Engine/tests/test_webhooks_and_readiness.py +277 -0
  331. package/omega/Agentik_Engine/tests/test_worker_and_cleanup.py +541 -0
  332. package/omega/Agentik_Extra/etc/secrets/.vault-key +3 -0
  333. package/omega/Agentik_Extra/etc/secrets/.vault-pub +1 -0
  334. package/omega/Agentik_Runtime/audits.db +0 -0
  335. package/omega/Agentik_SSOT/VERSION +1 -1
  336. package/omega/Agentik_SSOT/claude-plugins/claude-plugins.yaml +100 -0
  337. package/omega/Agentik_SSOT/docs/LAYERS.md +90 -0
  338. package/omega/Agentik_SSOT/docs/USER-JOURNEY.md +283 -0
  339. package/omega/Agentik_SSOT/marketplaces/design-discipline.yaml +86 -0
  340. package/omega/Agentik_SSOT/skills/a11yaudit/SKILL.md +161 -0
  341. package/omega/Agentik_SSOT/skills/apiaudit/SKILL.md +157 -0
  342. package/omega/Agentik_SSOT/skills/automationaudit/SKILL.md +161 -0
  343. package/omega/Agentik_SSOT/skills/cadence/SKILL.md +76 -0
  344. package/omega/Agentik_SSOT/skills/codeaudit/SKILL.md +153 -0
  345. package/omega/Agentik_SSOT/skills/copyaudit/SKILL.md +161 -0
  346. package/omega/Agentik_SSOT/skills/dataaudit/SKILL.md +157 -0
  347. package/omega/Agentik_SSOT/skills/debugaudit/SKILL.md +161 -0
  348. package/omega/Agentik_SSOT/skills/dispatch/SKILL.md +79 -0
  349. package/omega/Agentik_SSOT/skills/dxaudit/SKILL.md +161 -0
  350. package/omega/Agentik_SSOT/skills/featureaudit/SKILL.md +161 -0
  351. package/omega/Agentik_SSOT/skills/flowaudit/SKILL.md +165 -0
  352. package/omega/Agentik_SSOT/skills/genesis/SKILL.md +116 -0
  353. package/omega/Agentik_SSOT/skills/handoff/SKILL.md +117 -0
  354. package/omega/Agentik_SSOT/skills/logicaudit/SKILL.md +165 -0
  355. package/omega/Agentik_SSOT/skills/motionaudit/SKILL.md +165 -0
  356. package/omega/Agentik_SSOT/skills/perfaudit/SKILL.md +161 -0
  357. package/omega/Agentik_SSOT/skills/plan/SKILL.md +127 -0
  358. package/omega/Agentik_SSOT/skills/pursue/SKILL.md +68 -0
  359. package/omega/Agentik_SSOT/skills/rag-route.md +9 -0
  360. package/omega/Agentik_SSOT/skills/refontaudit/SKILL.md +165 -0
  361. package/omega/Agentik_SSOT/skills/retentionaudit/SKILL.md +165 -0
  362. package/omega/Agentik_SSOT/skills/secaudit/SKILL.md +157 -0
  363. package/omega/Agentik_SSOT/skills/seoaudit/SKILL.md +161 -0
  364. package/omega/Agentik_SSOT/skills/skill-auditor/SKILL.md +83 -0
  365. package/omega/Agentik_SSOT/skills/skill-finder/SKILL.md +116 -0
  366. package/omega/Agentik_SSOT/skills/uiuxaudit/SKILL.md +165 -0
  367. package/package.json +2 -2
@@ -0,0 +1,275 @@
1
+ """Understand-Anything bridge — register the Claude Code plugin + consume its graph.
2
+
3
+ Understand-Anything is a popular Claude Code plugin (27k+ stars) that
4
+ analyses a codebase with a multi-agent pipeline and produces an
5
+ interactive knowledge graph at
6
+ ``.understand-anything/knowledge-graph.json``.
7
+
8
+ It overlaps with OmegaOS's existing graphify integration, but the output
9
+ shape is different (it's much richer — file/function/class/dependency
10
+ nodes, business-domain layer, persona-adaptive views, language-concept
11
+ overlays).
12
+
13
+ This bridge gives operators a one-command path to:
14
+
15
+ 1. Install the plugin into Claude Code via the marketplace (uses the
16
+ same OAuth as everything else — no API key, no separate auth).
17
+ 2. After ``/understand`` runs in Claude Code, consume the resulting
18
+ ``.understand-anything/knowledge-graph.json`` into OmegaOS's
19
+ ``GraphRetriever`` (same path we use for graphify) so Oracle /
20
+ workers can answer "where in the code is X?" via Graph RAG.
21
+
22
+ What this module does NOT do
23
+ ----------------------------
24
+
25
+ * Run the analysis pipeline itself — that's Claude Code's job via the
26
+ plugin. We trigger it (``/understand``) and consume the artefact.
27
+ * Replace graphify — both can coexist; ``omega graph`` already
28
+ consumes whichever JSON the operator points at.
29
+ """
30
+ from __future__ import annotations
31
+
32
+ import json
33
+ import shutil
34
+ import subprocess
35
+ import time
36
+ from dataclasses import dataclass
37
+ from pathlib import Path
38
+ from typing import Any
39
+
40
+
41
+ _PLUGIN_MARKETPLACE = "Lum1104/Understand-Anything"
42
+ _PLUGIN_NAME = "understand-anything"
43
+ _OUTPUT_FILE = "knowledge-graph.json"
44
+ _OUTPUT_DIR = ".understand-anything"
45
+
46
+
47
+ # ---------------------------------------------------------------------------
48
+ # Errors
49
+ # ---------------------------------------------------------------------------
50
+
51
+
52
+ class UnderstandAnythingError(RuntimeError):
53
+ pass
54
+
55
+
56
+ # ---------------------------------------------------------------------------
57
+ # Plugin install (via `claude` CLI's plugin system)
58
+ # ---------------------------------------------------------------------------
59
+
60
+
61
+ @dataclass
62
+ class InstallResult:
63
+ ok: bool
64
+ method: str
65
+ detail: str = ""
66
+ error: str = ""
67
+
68
+
69
+ def is_plugin_installed(home_claude: str | Path | None = None) -> bool:
70
+ """True iff the plugin dir already exists under ~/.claude/plugins/."""
71
+ base = Path(home_claude) if home_claude else Path.home() / ".claude"
72
+ # Claude Code stores marketplaces under plugins/marketplaces/<owner>-<repo>/
73
+ p = base / "plugins" / "marketplaces"
74
+ if not p.is_dir():
75
+ return False
76
+ # Best-effort match — different versions of Claude Code use slightly
77
+ # different dir naming conventions.
78
+ for child in p.iterdir():
79
+ n = child.name.lower()
80
+ if "understand-anything" in n or "lum1104" in n:
81
+ return True
82
+ return False
83
+
84
+
85
+ def install_plugin(
86
+ *,
87
+ claude_cmd: str = "claude",
88
+ timeout_s: int = 120,
89
+ dry_run: bool = False,
90
+ ) -> InstallResult:
91
+ """Install the Understand-Anything plugin into Claude Code.
92
+
93
+ Mirrors the upstream instructions::
94
+
95
+ /plugin marketplace add Lum1104/Understand-Anything
96
+ /plugin install understand-anything
97
+
98
+ We invoke them via ``claude -p`` so the existing Max OAuth is the
99
+ auth — no API key, no marketplace login.
100
+ """
101
+ if shutil.which(claude_cmd) is None:
102
+ return InstallResult(
103
+ ok=False, method="skip",
104
+ error=f"`{claude_cmd}` not on PATH — install Claude Code first",
105
+ )
106
+ if dry_run:
107
+ return InstallResult(
108
+ ok=True, method="dry-run",
109
+ detail=(
110
+ f"would run: {claude_cmd} -p "
111
+ f"'/plugin marketplace add {_PLUGIN_MARKETPLACE} && "
112
+ f"/plugin install {_PLUGIN_NAME}'"
113
+ ),
114
+ )
115
+ # Two slash commands, one session.
116
+ prompt = (
117
+ f"/plugin marketplace add {_PLUGIN_MARKETPLACE}\n"
118
+ f"/plugin install {_PLUGIN_NAME}"
119
+ )
120
+ try:
121
+ proc = subprocess.run(
122
+ [claude_cmd, "-p", prompt, "--dangerously-skip-permissions"],
123
+ check=False, capture_output=True, text=True, timeout=timeout_s,
124
+ )
125
+ except subprocess.TimeoutExpired:
126
+ return InstallResult(
127
+ ok=False, method="claude-p",
128
+ error=f"`claude -p` timed out after {timeout_s}s",
129
+ )
130
+ if proc.returncode != 0:
131
+ tail = (proc.stdout + "\n" + proc.stderr).strip()[-400:]
132
+ return InstallResult(
133
+ ok=False, method="claude-p",
134
+ error=f"claude exited {proc.returncode}\n{tail}",
135
+ )
136
+ return InstallResult(
137
+ ok=True, method="claude-p",
138
+ detail=f"installed {_PLUGIN_NAME} from {_PLUGIN_MARKETPLACE}",
139
+ )
140
+
141
+
142
+ # ---------------------------------------------------------------------------
143
+ # Trigger an analysis run + consume the output
144
+ # ---------------------------------------------------------------------------
145
+
146
+
147
+ @dataclass
148
+ class RunResult:
149
+ ok: bool
150
+ output_path: str = ""
151
+ nodes: int = 0
152
+ edges: int = 0
153
+ error: str = ""
154
+ elapsed_s: float = 0.0
155
+
156
+
157
+ def run(
158
+ project_path: str | Path,
159
+ *,
160
+ claude_cmd: str = "claude",
161
+ language: str | None = None,
162
+ timeout_s: int = 1800,
163
+ ) -> RunResult:
164
+ """Trigger ``/understand`` in the given project directory.
165
+
166
+ Returns a RunResult pointing at the produced
167
+ ``.understand-anything/knowledge-graph.json`` and a node/edge count.
168
+ """
169
+ start = time.time()
170
+ project = Path(project_path).resolve()
171
+ if not project.is_dir():
172
+ return RunResult(ok=False, error=f"not a directory: {project}")
173
+ if shutil.which(claude_cmd) is None:
174
+ return RunResult(
175
+ ok=False,
176
+ error=f"`{claude_cmd}` not on PATH — install Claude Code first",
177
+ )
178
+ prompt = "/understand"
179
+ if language:
180
+ prompt += f" --language {language}"
181
+ try:
182
+ proc = subprocess.run(
183
+ [claude_cmd, "-p", prompt, "--add-dir", str(project),
184
+ "--dangerously-skip-permissions"],
185
+ check=False, capture_output=True, text=True, timeout=timeout_s,
186
+ cwd=str(project),
187
+ )
188
+ except subprocess.TimeoutExpired:
189
+ return RunResult(
190
+ ok=False, elapsed_s=round(time.time() - start, 2),
191
+ error=f"claude -p /understand timed out after {timeout_s}s",
192
+ )
193
+ if proc.returncode != 0:
194
+ tail = (proc.stdout + "\n" + proc.stderr).strip()[-400:]
195
+ return RunResult(
196
+ ok=False, elapsed_s=round(time.time() - start, 2),
197
+ error=f"claude exited {proc.returncode}\n{tail}",
198
+ )
199
+ out = project / _OUTPUT_DIR / _OUTPUT_FILE
200
+ if not out.exists():
201
+ return RunResult(
202
+ ok=False, elapsed_s=round(time.time() - start, 2),
203
+ error=f"expected output not found at {out}",
204
+ )
205
+ nodes, edges = _count_graph(out)
206
+ return RunResult(
207
+ ok=True, output_path=str(out),
208
+ nodes=nodes, edges=edges,
209
+ elapsed_s=round(time.time() - start, 2),
210
+ )
211
+
212
+
213
+ def _count_graph(path: Path) -> tuple[int, int]:
214
+ try:
215
+ data = json.loads(path.read_text())
216
+ except (OSError, json.JSONDecodeError):
217
+ return 0, 0
218
+ if not isinstance(data, dict):
219
+ return 0, 0
220
+ n = len(data.get("nodes") or [])
221
+ e = len(data.get("edges") or data.get("links") or [])
222
+ return n, e
223
+
224
+
225
+ # ---------------------------------------------------------------------------
226
+ # Consume the produced graph into GraphRetriever
227
+ # ---------------------------------------------------------------------------
228
+
229
+
230
+ def consume_graph(
231
+ project_path: str | Path,
232
+ *,
233
+ omega_home: str | Path | None = None,
234
+ ) -> dict[str, Any]:
235
+ """Merge the knowledge-graph.json into OmegaOS's GraphRetriever.
236
+
237
+ Format adapter: Understand-Anything emits ``{nodes: [{id, type, …}],
238
+ edges: [{from, to, kind, …}]}``; we map that onto the engine's
239
+ ``GraphRetriever`` interface (which already powers the graphify
240
+ consumer at ``omega graph <path>``).
241
+
242
+ Returns ``{nodes, edges, written_to}``.
243
+ """
244
+ import os as _os
245
+ project = Path(project_path).resolve()
246
+ out = project / _OUTPUT_DIR / _OUTPUT_FILE
247
+ if not out.exists():
248
+ raise UnderstandAnythingError(
249
+ f"no graph at {out} — run `omega ua run {project}` first"
250
+ )
251
+ try:
252
+ data = json.loads(out.read_text())
253
+ except (OSError, json.JSONDecodeError) as exc:
254
+ raise UnderstandAnythingError(f"unreadable graph at {out}: {exc}") from exc
255
+
256
+ nodes = data.get("nodes") or []
257
+ edges = data.get("edges") or data.get("links") or []
258
+
259
+ # Project into the engine's memory dir.
260
+ home = Path(omega_home or _os.environ.get(
261
+ "OMEGA_HOME", str(Path.home() / "Omega")
262
+ ))
263
+ mem = home / "Agentik_Runtime" / "memory"
264
+ mem.mkdir(parents=True, exist_ok=True)
265
+ dest = mem / "understand-anything.graph.json"
266
+ # Normalised shape — same as graphify's output, so GraphRetriever
267
+ # can consume it via the existing ``omega graph`` pipeline.
268
+ normalised = {
269
+ "format": "understand-anything",
270
+ "source_project": str(project),
271
+ "nodes": nodes,
272
+ "edges": edges,
273
+ }
274
+ dest.write_text(json.dumps(normalised, indent=2))
275
+ return {"nodes": len(nodes), "edges": len(edges), "written_to": str(dest)}
@@ -0,0 +1,70 @@
1
+ """Update checker — is a newer @agentikos/omega-os out?
2
+
3
+ Queries the npm registry for the latest published version, compares
4
+ against the running version. Pure-stdlib HTTP (no requests).
5
+
6
+ CLI surface:
7
+
8
+ * ``omega update --check`` — print current + latest, exit 0
9
+ * ``omega update --apply`` — re-run install.sh --force (delegates
10
+ to ``omega upgrade`` which already
11
+ handles that path)
12
+ """
13
+ from __future__ import annotations
14
+
15
+ import json
16
+ import urllib.error
17
+ import urllib.request
18
+ from dataclasses import dataclass
19
+
20
+
21
+ _REGISTRY = "https://registry.npmjs.org/@agentikos%2Fomega-os"
22
+
23
+
24
+ @dataclass
25
+ class UpdateInfo:
26
+ current: str
27
+ latest: str
28
+ is_outdated: bool
29
+ error: str = ""
30
+
31
+
32
+ def _parse_semver(v: str) -> tuple[int, int, int]:
33
+ """Best-effort semver parse. Non-numeric components → 0."""
34
+ parts = v.split("-")[0].split(".")[:3]
35
+ out: list[int] = []
36
+ for p in parts:
37
+ try:
38
+ out.append(int(p))
39
+ except ValueError:
40
+ out.append(0)
41
+ while len(out) < 3:
42
+ out.append(0)
43
+ return out[0], out[1], out[2]
44
+
45
+
46
+ def check_for_updates(current: str, *, timeout: int = 10) -> UpdateInfo:
47
+ """Compare ``current`` against the npm registry."""
48
+ try:
49
+ req = urllib.request.Request(
50
+ _REGISTRY,
51
+ headers={"Accept": "application/json"},
52
+ )
53
+ with urllib.request.urlopen(req, timeout=timeout) as resp: # noqa: S310
54
+ data = json.loads(resp.read().decode("utf-8"))
55
+ except urllib.error.HTTPError as exc:
56
+ return UpdateInfo(
57
+ current=current, latest="?", is_outdated=False,
58
+ error=f"HTTP {exc.code}: {exc.reason}",
59
+ )
60
+ except Exception as exc: # noqa: BLE001
61
+ return UpdateInfo(
62
+ current=current, latest="?", is_outdated=False,
63
+ error=f"network: {exc}"[:200],
64
+ )
65
+
66
+ latest = (data.get("dist-tags") or {}).get("latest", "?")
67
+ return UpdateInfo(
68
+ current=current, latest=latest,
69
+ is_outdated=_parse_semver(current) < _parse_semver(latest),
70
+ )
@@ -0,0 +1,186 @@
1
+ """Validate provider credentials at install time + on demand.
2
+
3
+ The install used to write provider config + credentials to the vault and
4
+ then say "ok". The first mission would discover the key was wrong/expired
5
+ and fail. This module closes the gap: ``omega validate providers`` does a
6
+ 1-token round-trip against each configured provider's real API.
7
+
8
+ For each provider we know how to validate:
9
+
10
+ * **claude** ``/v1/messages`` with max_tokens=1
11
+ * **glm** ``/api/paas/v4/chat/completions`` with max_tokens=1
12
+ * **openai** ``/v1/chat/completions`` with max_tokens=1
13
+ * **deepseek** ``/v1/chat/completions`` with max_tokens=1
14
+
15
+ Each provider's adapter already knows its endpoint + auth shape — we
16
+ reuse it. A 200 OK is a pass; anything else is a fail with the API's
17
+ error string surfaced.
18
+ """
19
+ from __future__ import annotations
20
+
21
+ import os
22
+ from dataclasses import dataclass
23
+ from pathlib import Path
24
+ from typing import Any
25
+
26
+ import yaml
27
+
28
+
29
+ @dataclass
30
+ class ValidationResult:
31
+ provider: str
32
+ ok: bool
33
+ detail: str
34
+ elapsed_ms: int = 0
35
+
36
+
37
+ def _read_router_config(omega_home: str | Path) -> list[dict[str, Any]]:
38
+ p = (Path(omega_home) / "Agentik_SSOT" / "providers" / "router.yaml")
39
+ if not p.exists():
40
+ return []
41
+ data = yaml.safe_load(p.read_text()) or {}
42
+ return list(data.get("providers") or [])
43
+
44
+
45
+ def _read_secret(omega_home: str | Path, secret_ref: str) -> str:
46
+ if not secret_ref:
47
+ return ""
48
+ if env := os.environ.get(secret_ref):
49
+ return env
50
+ try:
51
+ from omega_engine.vault import vault_read
52
+ return vault_read(omega_home, secret_ref) or ""
53
+ except Exception: # noqa: BLE001
54
+ return ""
55
+
56
+
57
+ def _validate_claude(api_key: str) -> ValidationResult:
58
+ """1-token call against Anthropic /v1/messages."""
59
+ if not api_key:
60
+ return ValidationResult("claude", False, "no API key in env or vault")
61
+ import json
62
+ import time
63
+ import urllib.error
64
+ import urllib.request
65
+ start = time.time()
66
+ body = json.dumps({
67
+ "model": "claude-haiku-4-5",
68
+ "max_tokens": 1,
69
+ "messages": [{"role": "user", "content": "x"}],
70
+ }).encode()
71
+ req = urllib.request.Request(
72
+ "https://api.anthropic.com/v1/messages",
73
+ data=body, method="POST",
74
+ headers={
75
+ "Content-Type": "application/json",
76
+ "x-api-key": api_key,
77
+ "anthropic-version": "2023-06-01",
78
+ },
79
+ )
80
+ try:
81
+ with urllib.request.urlopen(req, timeout=15) as resp: # noqa: S310
82
+ resp.read()
83
+ return ValidationResult(
84
+ "claude", True, "ok", int((time.time() - start) * 1000),
85
+ )
86
+ except urllib.error.HTTPError as exc:
87
+ detail = exc.read().decode("utf-8", errors="replace")[:300] if exc.fp else ""
88
+ return ValidationResult(
89
+ "claude", False, f"HTTP {exc.code}: {detail or exc.reason}",
90
+ int((time.time() - start) * 1000),
91
+ )
92
+ except Exception as exc: # noqa: BLE001
93
+ return ValidationResult(
94
+ "claude", False, f"network error: {exc}"[:200],
95
+ int((time.time() - start) * 1000),
96
+ )
97
+
98
+
99
+ def _validate_openai_compat(
100
+ provider: str, api_key: str, base_url: str, model: str,
101
+ ) -> ValidationResult:
102
+ """1-token call against any OpenAI-compatible /chat/completions."""
103
+ if not api_key:
104
+ return ValidationResult(provider, False, "no API key in env or vault")
105
+ import json
106
+ import time
107
+ import urllib.error
108
+ import urllib.request
109
+ start = time.time()
110
+ body = json.dumps({
111
+ "model": model,
112
+ "max_tokens": 1,
113
+ "messages": [{"role": "user", "content": "x"}],
114
+ }).encode()
115
+ req = urllib.request.Request(
116
+ f"{base_url.rstrip('/')}/chat/completions",
117
+ data=body, method="POST",
118
+ headers={
119
+ "Content-Type": "application/json",
120
+ "Authorization": f"Bearer {api_key}",
121
+ },
122
+ )
123
+ try:
124
+ with urllib.request.urlopen(req, timeout=15) as resp: # noqa: S310
125
+ resp.read()
126
+ return ValidationResult(
127
+ provider, True, "ok", int((time.time() - start) * 1000),
128
+ )
129
+ except urllib.error.HTTPError as exc:
130
+ detail = exc.read().decode("utf-8", errors="replace")[:300] if exc.fp else ""
131
+ return ValidationResult(
132
+ provider, False, f"HTTP {exc.code}: {detail or exc.reason}",
133
+ int((time.time() - start) * 1000),
134
+ )
135
+ except Exception as exc: # noqa: BLE001
136
+ return ValidationResult(
137
+ provider, False, f"network error: {exc}"[:200],
138
+ int((time.time() - start) * 1000),
139
+ )
140
+
141
+
142
+ def validate_one(
143
+ omega_home: str | Path, provider_id: str,
144
+ *, secret_ref: str | None = None,
145
+ ) -> ValidationResult:
146
+ """Validate one provider by id. Reads secret from env or vault."""
147
+ secret_ref = (
148
+ secret_ref or f"{provider_id.upper()}_API_KEY"
149
+ )
150
+ key = _read_secret(omega_home, secret_ref)
151
+ pid = provider_id.lower()
152
+ if pid == "claude":
153
+ return _validate_claude(key)
154
+ if pid == "glm":
155
+ return _validate_openai_compat(
156
+ "glm", key,
157
+ "https://open.bigmodel.cn/api/paas/v4",
158
+ "glm-4-flash",
159
+ )
160
+ if pid == "openai":
161
+ return _validate_openai_compat(
162
+ "openai", key, "https://api.openai.com/v1", "gpt-4o-mini",
163
+ )
164
+ if pid == "deepseek":
165
+ return _validate_openai_compat(
166
+ "deepseek", key, "https://api.deepseek.com/v1", "deepseek-chat",
167
+ )
168
+ return ValidationResult(
169
+ provider_id, False,
170
+ f"no validator known for provider {provider_id!r}",
171
+ )
172
+
173
+
174
+ def validate_all(omega_home: str | Path) -> list[ValidationResult]:
175
+ """Validate every provider in ``router.yaml``."""
176
+ out: list[ValidationResult] = []
177
+ for cfg in _read_router_config(omega_home):
178
+ if not bool(cfg.get("enabled", True)):
179
+ continue
180
+ pid = str(cfg.get("id", "")).strip()
181
+ if not pid:
182
+ continue
183
+ out.append(validate_one(
184
+ omega_home, pid, secret_ref=cfg.get("secret_ref"),
185
+ ))
186
+ return out