@agentikos/omega-os 0.2.0 → 0.19.6
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.
- package/README.md +33 -3
- package/bootstrap/lib/__pycache__/claude-code-settings.cpython-313.pyc +0 -0
- package/bootstrap/lib/__pycache__/llm-clis.cpython-313.pyc +0 -0
- package/bootstrap/lib/__pycache__/manifest-helpers.cpython-313.pyc +0 -0
- package/bootstrap/lib/claude-code-settings.py +176 -0
- package/bootstrap/lib/common.sh +457 -1
- package/bootstrap/lib/llm-clis.py +341 -0
- package/bootstrap/lib/manifest-helpers.py +384 -0
- package/bootstrap/lib/steps.sh +790 -21
- package/bootstrap/manifest.example.yaml +87 -1
- package/bootstrap/templates/aisb/CLAUDE.md +305 -0
- package/bootstrap/templates/aisb/architect.md +204 -0
- package/bootstrap/templates/aisb/checkers/CLAUDE.md +9 -0
- package/bootstrap/templates/aisb/checkers/checker-architect.md +151 -0
- package/bootstrap/templates/aisb/checkers/checker-common.md +171 -0
- package/bootstrap/templates/aisb/checkers/checker-construct.md +129 -0
- package/bootstrap/templates/aisb/checkers/checker-keymaker.md +204 -0
- package/bootstrap/templates/aisb/checkers/checker-link.md +205 -0
- package/bootstrap/templates/aisb/checkers/checker-merovingian.md +219 -0
- package/bootstrap/templates/aisb/checkers/checker-morpheus.md +211 -0
- package/bootstrap/templates/aisb/checkers/checker-neo.md +177 -0
- package/bootstrap/templates/aisb/checkers/checker-niobe.md +156 -0
- package/bootstrap/templates/aisb/checkers/checker-oracle.md +164 -0
- package/bootstrap/templates/aisb/checkers/checker-seraph.md +187 -0
- package/bootstrap/templates/aisb/checkers/checker-smith.md +195 -0
- package/bootstrap/templates/aisb/checkers/checker-zion.md +113 -0
- package/bootstrap/templates/aisb/construct.md +135 -0
- package/bootstrap/templates/aisb/keymaker.md +227 -0
- package/bootstrap/templates/aisb/link.md +170 -0
- package/bootstrap/templates/aisb/lmc-protocol.md +57 -0
- package/bootstrap/templates/aisb/merovingian.md +159 -0
- package/bootstrap/templates/aisb/morpheus.md +243 -0
- package/bootstrap/templates/aisb/neo.md +147 -0
- package/bootstrap/templates/aisb/niobe.md +197 -0
- package/bootstrap/templates/aisb/oracle.md +244 -0
- package/bootstrap/templates/aisb/protocols/handoff-templates.md +204 -0
- package/bootstrap/templates/aisb/protocols/shared-protocol.md +248 -0
- package/bootstrap/templates/aisb/pythia.md +153 -0
- package/bootstrap/templates/aisb/seraph.md +315 -0
- package/bootstrap/templates/aisb/smith.md +202 -0
- package/bootstrap/templates/aisb/zion.md +172 -0
- package/bootstrap/templates/autonomous/audit-patrol.yaml +41 -0
- package/bootstrap/templates/autonomous/smith-reflect.yaml +43 -0
- package/bootstrap/templates/autonomous/ssh-key-rotate.yaml +46 -0
- package/bootstrap/templates/autonomous/support-agent.yaml +38 -0
- package/docs/AUDITS.md +85 -0
- package/docs/GAP-ANALYSIS.md +214 -0
- package/docs/INSTALL.md +47 -9
- package/docs/MCP-AND-PLUGINS.md +31 -4
- package/docs/SIMULATION.md +171 -0
- package/docs/simulate.sh +211 -0
- package/install.sh +164 -17
- package/omega/Agentik_Engine/README.md +4 -2
- package/omega/Agentik_Engine/omega_engine/__init__.py +147 -1
- package/omega/Agentik_Engine/omega_engine/__pycache__/__init__.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/account.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/agent_messages.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/aisb_chat.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/audit.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/audit_arsenal.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/audit_diff.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/audit_gate.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/auto_update.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/autonomous.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/backup.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/barrier.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/bus.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/cadence.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/classifier.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/cleanup.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/cli.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/completions.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/costs.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/done_signal.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/envelope.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/events.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/executor.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/handoff.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/hermes.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/hermes_bootstrap.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/hermes_desktop.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/learning.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/managed_agent.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/memory.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/menu.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/mission.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/plan.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/progress.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/project.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/prompts.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/provider.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/prune.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/pursue.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/reducer.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/report.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/router.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/skill_routing.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/smoke.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/store.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/supervisor.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/sync.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/task.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/telegram.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/telegram_history.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/tmux.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/tools.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/understand_anything.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/updater.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/validate.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/vault.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/webhooks.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/__pycache__/worker.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/account.py +28 -31
- package/omega/Agentik_Engine/omega_engine/agent_messages.py +167 -0
- package/omega/Agentik_Engine/omega_engine/aisb_chat.py +128 -0
- package/omega/Agentik_Engine/omega_engine/audit_diff.py +99 -0
- package/omega/Agentik_Engine/omega_engine/audit_gate.py +149 -0
- package/omega/Agentik_Engine/omega_engine/audits/__init__.py +60 -0
- package/omega/Agentik_Engine/omega_engine/audits/__pycache__/__init__.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/audits/__pycache__/batcher.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/audits/__pycache__/dispatcher.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/audits/__pycache__/generator.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/audits/__pycache__/history.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/audits/__pycache__/pipeline.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/audits/batcher.py +218 -0
- package/omega/Agentik_Engine/omega_engine/audits/dispatcher.py +92 -0
- package/omega/Agentik_Engine/omega_engine/audits/generator.py +234 -0
- package/omega/Agentik_Engine/omega_engine/audits/history.py +168 -0
- package/omega/Agentik_Engine/omega_engine/audits/pipeline.py +198 -0
- package/omega/Agentik_Engine/omega_engine/auto_update.py +339 -0
- package/omega/Agentik_Engine/omega_engine/backup.py +215 -0
- package/omega/Agentik_Engine/omega_engine/cadence.py +158 -0
- package/omega/Agentik_Engine/omega_engine/classifier.py +215 -0
- package/omega/Agentik_Engine/omega_engine/cleanup.py +673 -0
- package/omega/Agentik_Engine/omega_engine/cli.py +4156 -86
- package/omega/Agentik_Engine/omega_engine/completions.py +260 -0
- package/omega/Agentik_Engine/omega_engine/costs.py +100 -0
- package/omega/Agentik_Engine/omega_engine/daemons/__pycache__/__init__.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/daemons/__pycache__/autonomous.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/daemons/__pycache__/engine.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/daemons/__pycache__/telegram.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/daemons/engine.py +53 -4
- package/omega/Agentik_Engine/omega_engine/daemons/telegram.py +101 -17
- package/omega/Agentik_Engine/omega_engine/done_signal.py +154 -0
- package/omega/Agentik_Engine/omega_engine/educators/__pycache__/__init__.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/educators/__pycache__/artifact.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/educators/__pycache__/automation.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/educators/__pycache__/base.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/educators/__pycache__/claudecode.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/educators/__pycache__/connection.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/educators/__pycache__/coworker.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/educators/__pycache__/loop.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/educators/__pycache__/prompt.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/educators/__pycache__/skill.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/envelope.py +219 -0
- package/omega/Agentik_Engine/omega_engine/executor.py +149 -10
- package/omega/Agentik_Engine/omega_engine/genesis/__init__.py +134 -0
- package/omega/Agentik_Engine/omega_engine/genesis/__pycache__/__init__.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/genesis/__pycache__/orchestrator.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/genesis/__pycache__/phases.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/genesis/__pycache__/stack.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/genesis/__pycache__/state.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/genesis/orchestrator.py +262 -0
- package/omega/Agentik_Engine/omega_engine/genesis/phases.py +950 -0
- package/omega/Agentik_Engine/omega_engine/genesis/stack.py +324 -0
- package/omega/Agentik_Engine/omega_engine/genesis/state.py +353 -0
- package/omega/Agentik_Engine/omega_engine/handoff.py +459 -0
- package/omega/Agentik_Engine/omega_engine/hermes.py +426 -0
- package/omega/Agentik_Engine/omega_engine/hermes_bootstrap.py +382 -0
- package/omega/Agentik_Engine/omega_engine/hermes_desktop.py +469 -0
- package/omega/Agentik_Engine/omega_engine/integrations/__init__.py +30 -0
- package/omega/Agentik_Engine/omega_engine/integrations/__pycache__/__init__.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/integrations/__pycache__/graphify.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/integrations/graphify.py +234 -0
- package/omega/Agentik_Engine/omega_engine/learning.py +268 -0
- package/omega/Agentik_Engine/omega_engine/managed_agent.py +467 -0
- package/omega/Agentik_Engine/omega_engine/memory.py +271 -0
- package/omega/Agentik_Engine/omega_engine/menu.py +1065 -0
- package/omega/Agentik_Engine/omega_engine/migrations/__init__.py +144 -0
- package/omega/Agentik_Engine/omega_engine/migrations/__pycache__/__init__.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/migrations/__pycache__/v0_14_0.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/migrations/v0_14_0.py +29 -0
- package/omega/Agentik_Engine/omega_engine/mission.py +16 -13
- package/omega/Agentik_Engine/omega_engine/plan.py +846 -0
- package/omega/Agentik_Engine/omega_engine/prompts.py +158 -0
- package/omega/Agentik_Engine/omega_engine/provider.py +161 -12
- package/omega/Agentik_Engine/omega_engine/prune.py +151 -0
- package/omega/Agentik_Engine/omega_engine/pursue.py +205 -0
- package/omega/Agentik_Engine/omega_engine/rag/__pycache__/__init__.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/rag/__pycache__/agentic.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/rag/__pycache__/base.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/rag/__pycache__/corrective.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/rag/__pycache__/graph.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/rag/__pycache__/hybrid.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/rag/__pycache__/multimodal.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/rag/__pycache__/router.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/router.py +28 -0
- package/omega/Agentik_Engine/omega_engine/skill_discovery/__init__.py +48 -0
- package/omega/Agentik_Engine/omega_engine/skill_discovery/__pycache__/__init__.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/skill_discovery/__pycache__/auditor.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/skill_discovery/__pycache__/finder.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/skill_discovery/__pycache__/installer.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/skill_discovery/__pycache__/marketplaces.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/omega_engine/skill_discovery/auditor.py +232 -0
- package/omega/Agentik_Engine/omega_engine/skill_discovery/finder.py +94 -0
- package/omega/Agentik_Engine/omega_engine/skill_discovery/installer.py +129 -0
- package/omega/Agentik_Engine/omega_engine/skill_discovery/marketplaces.py +80 -0
- package/omega/Agentik_Engine/omega_engine/skill_routing.py +388 -0
- package/omega/Agentik_Engine/omega_engine/smoke.py +81 -0
- package/omega/Agentik_Engine/omega_engine/store.py +88 -41
- package/omega/Agentik_Engine/omega_engine/sync.py +142 -1
- package/omega/Agentik_Engine/omega_engine/telegram_history.py +260 -0
- package/omega/Agentik_Engine/omega_engine/tmux.py +526 -0
- package/omega/Agentik_Engine/omega_engine/understand_anything.py +275 -0
- package/omega/Agentik_Engine/omega_engine/updater.py +70 -0
- package/omega/Agentik_Engine/omega_engine/validate.py +186 -0
- package/omega/Agentik_Engine/omega_engine/vault.py +342 -0
- package/omega/Agentik_Engine/omega_engine/webhooks.py +262 -0
- package/omega/Agentik_Engine/omega_engine/worker.py +526 -0
- package/omega/Agentik_Engine/pyproject.toml +1 -1
- package/omega/Agentik_Engine/tests/__pycache__/test_account.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_account.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_adversarial.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_adversarial.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_agents_envelope.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_agents_envelope.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_audit_arsenal.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_audit_arsenal.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_audits_pipeline.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_audits_pipeline.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_auto_update_and_migrations.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_auto_update_and_migrations.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_autonomous.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_autonomous.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_educators.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_educators.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_executor.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_executor.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_genesis_and_plan.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_genesis_and_plan.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_graphify.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_graphify.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_handoff.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_handoff.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_hermes_and_ua.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_hermes_and_ua.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_hermes_bootstrap_and_desktop.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_hermes_bootstrap_and_desktop.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_install_steps.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_install_steps.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_install_ux.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_install_ux.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_installer_wiring.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_installer_wiring.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_intelligence.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_intelligence.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_llm_clis_and_uninstall.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_llm_clis_and_uninstall.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_managed_agent.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_managed_agent.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_max_provider_and_menu.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_max_provider_and_menu.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_menu_coverage.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_menu_coverage.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_mission.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_mission.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_progress.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_progress.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_project.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_project.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_pursue_cadence.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_pursue_cadence.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_rag.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_rag.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_reducer.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_reducer.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_report.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_report.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_role_aliases_and_ssot.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_role_aliases_and_ssot.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_skill_discovery_and_gate.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_skill_discovery_and_gate.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_skill_power.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_skill_power.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_skill_routing.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_skill_routing.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_snapshot_partial.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_snapshot_partial.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_telegram_history.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_telegram_history.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_tmux_and_aisb_chat.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_tmux_and_aisb_chat.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_tools_and_sync.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_tools_and_sync.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_v06_features.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_v06_features.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_vault.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_vault.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_webhooks_and_readiness.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_webhooks_and_readiness.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_worker_and_cleanup.cpython-313-pytest-8.4.2.pyc +0 -0
- package/omega/Agentik_Engine/tests/__pycache__/test_worker_and_cleanup.cpython-313.pyc +0 -0
- package/omega/Agentik_Engine/tests/test_account.py +8 -3
- package/omega/Agentik_Engine/tests/test_adversarial.py +351 -0
- package/omega/Agentik_Engine/tests/test_agents_envelope.py +274 -0
- package/omega/Agentik_Engine/tests/test_audits_pipeline.py +348 -0
- package/omega/Agentik_Engine/tests/test_auto_update_and_migrations.py +394 -0
- package/omega/Agentik_Engine/tests/test_genesis_and_plan.py +573 -0
- package/omega/Agentik_Engine/tests/test_graphify.py +190 -0
- package/omega/Agentik_Engine/tests/test_handoff.py +311 -0
- package/omega/Agentik_Engine/tests/test_hermes_and_ua.py +387 -0
- package/omega/Agentik_Engine/tests/test_hermes_bootstrap_and_desktop.py +358 -0
- package/omega/Agentik_Engine/tests/test_install_steps.py +359 -0
- package/omega/Agentik_Engine/tests/test_install_ux.py +151 -0
- package/omega/Agentik_Engine/tests/test_installer_wiring.py +496 -0
- package/omega/Agentik_Engine/tests/test_intelligence.py +285 -0
- package/omega/Agentik_Engine/tests/test_llm_clis_and_uninstall.py +228 -0
- package/omega/Agentik_Engine/tests/test_managed_agent.py +363 -0
- package/omega/Agentik_Engine/tests/test_max_provider_and_menu.py +231 -0
- package/omega/Agentik_Engine/tests/test_menu_coverage.py +72 -0
- package/omega/Agentik_Engine/tests/test_pursue_cadence.py +217 -0
- package/omega/Agentik_Engine/tests/test_role_aliases_and_ssot.py +207 -0
- package/omega/Agentik_Engine/tests/test_skill_discovery_and_gate.py +337 -0
- package/omega/Agentik_Engine/tests/test_skill_power.py +259 -0
- package/omega/Agentik_Engine/tests/test_skill_routing.py +189 -0
- package/omega/Agentik_Engine/tests/test_telegram_history.py +209 -0
- package/omega/Agentik_Engine/tests/test_tmux_and_aisb_chat.py +223 -0
- package/omega/Agentik_Engine/tests/test_v06_features.py +370 -0
- package/omega/Agentik_Engine/tests/test_vault.py +173 -0
- package/omega/Agentik_Engine/tests/test_webhooks_and_readiness.py +277 -0
- package/omega/Agentik_Engine/tests/test_worker_and_cleanup.py +541 -0
- package/omega/Agentik_Extra/etc/secrets/.vault-key +3 -0
- package/omega/Agentik_Extra/etc/secrets/.vault-pub +1 -0
- package/omega/Agentik_Runtime/audits.db +0 -0
- package/omega/Agentik_SSOT/VERSION +1 -1
- package/omega/Agentik_SSOT/claude-plugins/claude-plugins.yaml +100 -0
- package/omega/Agentik_SSOT/docs/LAYERS.md +90 -0
- package/omega/Agentik_SSOT/docs/USER-JOURNEY.md +283 -0
- package/omega/Agentik_SSOT/docs/quality-arsenal/ARSENAL-INTERCONNECTIONS.md +283 -0
- package/omega/Agentik_SSOT/docs/quality-arsenal/ARSENAL-ORCHESTRATION-PLAYBOOK.md +364 -0
- package/omega/Agentik_SSOT/docs/quality-arsenal/AUDIT-VERIFICATION-CONTRACT.md +272 -0
- package/omega/Agentik_SSOT/docs/quality-arsenal/QUALITY-ARSENAL-PREAMBLE.md +462 -0
- package/omega/Agentik_SSOT/marketplaces/design-discipline.yaml +86 -0
- package/omega/Agentik_SSOT/skills/a11yaudit/SKILL.md +161 -0
- package/omega/Agentik_SSOT/skills/apiaudit/SKILL.md +157 -0
- package/omega/Agentik_SSOT/skills/audit-orchestrator.md +212 -0
- package/omega/Agentik_SSOT/skills/audit-pilot.md +466 -0
- package/omega/Agentik_SSOT/skills/audit-tracker.md +147 -0
- package/omega/Agentik_SSOT/skills/automationaudit/SKILL.md +161 -0
- package/omega/Agentik_SSOT/skills/cadence/SKILL.md +76 -0
- package/omega/Agentik_SSOT/skills/codeaudit/SKILL.md +153 -0
- package/omega/Agentik_SSOT/skills/copyaudit/SKILL.md +161 -0
- package/omega/Agentik_SSOT/skills/dataaudit/SKILL.md +157 -0
- package/omega/Agentik_SSOT/skills/debugaudit/SKILL.md +161 -0
- package/omega/Agentik_SSOT/skills/dispatch/SKILL.md +79 -0
- package/omega/Agentik_SSOT/skills/dxaudit/SKILL.md +161 -0
- package/omega/Agentik_SSOT/skills/featureaudit/SKILL.md +161 -0
- package/omega/Agentik_SSOT/skills/flowaudit/SKILL.md +165 -0
- package/omega/Agentik_SSOT/skills/genesis/SKILL.md +116 -0
- package/omega/Agentik_SSOT/skills/handoff/SKILL.md +117 -0
- package/omega/Agentik_SSOT/skills/logicaudit/SKILL.md +165 -0
- package/omega/Agentik_SSOT/skills/motionaudit/SKILL.md +165 -0
- package/omega/Agentik_SSOT/skills/newcmd.md +300 -0
- package/omega/Agentik_SSOT/skills/perfaudit/SKILL.md +161 -0
- package/omega/Agentik_SSOT/skills/plan/SKILL.md +127 -0
- package/omega/Agentik_SSOT/skills/pursue/SKILL.md +68 -0
- package/omega/Agentik_SSOT/skills/quality-arsenal.md +180 -0
- package/omega/Agentik_SSOT/skills/rag-route.md +9 -0
- package/omega/Agentik_SSOT/skills/refontaudit/SKILL.md +165 -0
- package/omega/Agentik_SSOT/skills/retentionaudit/SKILL.md +165 -0
- package/omega/Agentik_SSOT/skills/secaudit/SKILL.md +157 -0
- package/omega/Agentik_SSOT/skills/seoaudit/SKILL.md +161 -0
- package/omega/Agentik_SSOT/skills/skill-auditor/SKILL.md +83 -0
- package/omega/Agentik_SSOT/skills/skill-finder/SKILL.md +116 -0
- package/omega/Agentik_SSOT/skills/uiuxaudit/SKILL.md +165 -0
- package/package.json +2 -2
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
"""Tests for the Hermes + Understand-Anything bridges.
|
|
2
|
+
|
|
3
|
+
Both modules shell out to external binaries we cannot assume are present
|
|
4
|
+
on the test host (``hermes``, ``claude``). We mock subprocess at the
|
|
5
|
+
boundary so we exercise the real arg construction, env injection, error
|
|
6
|
+
handling, and result parsing without ever running the upstream tools.
|
|
7
|
+
|
|
8
|
+
The Claude credentials read is exercised against a tempfile so we don't
|
|
9
|
+
touch ~/.claude on the dev workstation.
|
|
10
|
+
"""
|
|
11
|
+
from __future__ import annotations
|
|
12
|
+
|
|
13
|
+
import json
|
|
14
|
+
import os
|
|
15
|
+
import subprocess
|
|
16
|
+
import sys
|
|
17
|
+
import tempfile
|
|
18
|
+
import time
|
|
19
|
+
import unittest
|
|
20
|
+
from pathlib import Path
|
|
21
|
+
from unittest import mock
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
HERE = Path(__file__).resolve().parent
|
|
25
|
+
sys.path.insert(0, str(HERE.parent))
|
|
26
|
+
|
|
27
|
+
from omega_engine import hermes as H # noqa: E402
|
|
28
|
+
from omega_engine import understand_anything as UA # noqa: E402
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
# ---------------------------------------------------------------------------
|
|
32
|
+
# Helpers — synthesize a realistic ~/.claude/.credentials.json
|
|
33
|
+
# ---------------------------------------------------------------------------
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def _fake_creds(path: Path, *, token: str = "tk-AAAA-BBBB",
|
|
37
|
+
expires_at_ms: int | None = None,
|
|
38
|
+
sub: str = "max") -> Path:
|
|
39
|
+
payload = {
|
|
40
|
+
"claudeAiOauth": {
|
|
41
|
+
"accessToken": token,
|
|
42
|
+
"refreshToken": "rt-CCCC",
|
|
43
|
+
"expiresAt": expires_at_ms if expires_at_ms is not None
|
|
44
|
+
else int((time.time() + 3600) * 1000),
|
|
45
|
+
"scopes": ["user:profile", "user:inference"],
|
|
46
|
+
"subscriptionType": sub,
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
path.write_text(json.dumps(payload))
|
|
50
|
+
return path
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
# ---------------------------------------------------------------------------
|
|
54
|
+
# Hermes — OAuth token plumbing
|
|
55
|
+
# ---------------------------------------------------------------------------
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
class TestClaudeOAuthRead(unittest.TestCase):
|
|
59
|
+
def test_token_extracted_from_creds_file(self):
|
|
60
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
61
|
+
p = _fake_creds(Path(tmp) / "creds.json", token="tk-LIVE-12345")
|
|
62
|
+
self.assertEqual(H.claude_oauth_token(p), "tk-LIVE-12345")
|
|
63
|
+
|
|
64
|
+
def test_missing_file_raises_friendly_error(self):
|
|
65
|
+
with self.assertRaises(H.HermesError) as ctx:
|
|
66
|
+
H.claude_oauth_token(Path("/nope/does/not/exist.json"))
|
|
67
|
+
self.assertIn("Claude credentials not found", str(ctx.exception))
|
|
68
|
+
|
|
69
|
+
def test_malformed_json_raises(self):
|
|
70
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
71
|
+
p = Path(tmp) / "bad.json"
|
|
72
|
+
p.write_text("{not valid json")
|
|
73
|
+
with self.assertRaises(H.HermesError) as ctx:
|
|
74
|
+
H.claude_oauth_token(p)
|
|
75
|
+
self.assertIn("failed to parse", str(ctx.exception))
|
|
76
|
+
|
|
77
|
+
def test_missing_access_token_raises(self):
|
|
78
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
79
|
+
p = Path(tmp) / "empty.json"
|
|
80
|
+
p.write_text(json.dumps({"claudeAiOauth": {"foo": "bar"}}))
|
|
81
|
+
with self.assertRaises(H.HermesError) as ctx:
|
|
82
|
+
H.claude_oauth_token(p)
|
|
83
|
+
self.assertIn("no claudeAiOauth.accessToken", str(ctx.exception))
|
|
84
|
+
|
|
85
|
+
def test_token_expires_at_reads_ms_epoch(self):
|
|
86
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
87
|
+
ts = int((time.time() + 7200) * 1000)
|
|
88
|
+
p = _fake_creds(Path(tmp) / "c.json", expires_at_ms=ts)
|
|
89
|
+
self.assertEqual(H.token_expires_at(p), ts)
|
|
90
|
+
|
|
91
|
+
def test_subscription_type_reads_string(self):
|
|
92
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
93
|
+
p = _fake_creds(Path(tmp) / "c.json", sub="max")
|
|
94
|
+
self.assertEqual(H.subscription_type(p), "max")
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
class TestBuildEnv(unittest.TestCase):
|
|
98
|
+
def test_env_includes_oauth_token_and_defaults(self):
|
|
99
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
100
|
+
p = _fake_creds(Path(tmp) / "c.json", token="tk-Z")
|
|
101
|
+
env = H.build_env(creds_path=p)
|
|
102
|
+
self.assertEqual(env["CLAUDE_CODE_OAUTH_TOKEN"], "tk-Z")
|
|
103
|
+
self.assertEqual(env["HERMES_PROVIDER"], "anthropic")
|
|
104
|
+
self.assertEqual(env["HERMES_MODEL"], "claude-opus-4-7")
|
|
105
|
+
|
|
106
|
+
def test_env_extra_overrides_default(self):
|
|
107
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
108
|
+
p = _fake_creds(Path(tmp) / "c.json")
|
|
109
|
+
env = H.build_env(creds_path=p,
|
|
110
|
+
extra={"HERMES_MODEL": "claude-sonnet-4-7"})
|
|
111
|
+
self.assertEqual(env["HERMES_MODEL"], "claude-sonnet-4-7")
|
|
112
|
+
|
|
113
|
+
def test_env_missing_token_propagates_error(self):
|
|
114
|
+
with self.assertRaises(H.HermesError):
|
|
115
|
+
H.build_env(creds_path=Path("/no/such/file"))
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
# ---------------------------------------------------------------------------
|
|
119
|
+
# Hermes — install (mocked subprocess)
|
|
120
|
+
# ---------------------------------------------------------------------------
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
class TestInstall(unittest.TestCase):
|
|
124
|
+
def test_skip_when_already_installed_and_not_yes(self):
|
|
125
|
+
with mock.patch("omega_engine.hermes.shutil.which",
|
|
126
|
+
return_value="/usr/local/bin/hermes"):
|
|
127
|
+
res = H.install(yes=False)
|
|
128
|
+
self.assertTrue(res.ok)
|
|
129
|
+
self.assertEqual(res.method, "skipped-already-installed")
|
|
130
|
+
|
|
131
|
+
def test_dry_run_emits_curl_command(self):
|
|
132
|
+
with mock.patch("omega_engine.hermes.shutil.which", return_value=None):
|
|
133
|
+
res = H.install(dry_run=True)
|
|
134
|
+
self.assertTrue(res.ok)
|
|
135
|
+
self.assertIn("curl -fsSL", res.detail)
|
|
136
|
+
self.assertIn("install.sh", res.detail)
|
|
137
|
+
self.assertIn("--skip-browser", res.detail)
|
|
138
|
+
self.assertIn("--skip-setup", res.detail)
|
|
139
|
+
|
|
140
|
+
def test_install_success_returns_ok(self):
|
|
141
|
+
completed = subprocess.CompletedProcess(
|
|
142
|
+
args=["bash", "-c", "..."], returncode=0,
|
|
143
|
+
stdout="✓ Hermes installed", stderr="",
|
|
144
|
+
)
|
|
145
|
+
with mock.patch("omega_engine.hermes.shutil.which", side_effect=[
|
|
146
|
+
None, "/usr/local/bin/hermes"]):
|
|
147
|
+
with mock.patch("omega_engine.hermes.subprocess.run",
|
|
148
|
+
return_value=completed):
|
|
149
|
+
res = H.install(yes=False)
|
|
150
|
+
self.assertTrue(res.ok)
|
|
151
|
+
self.assertEqual(res.method, "curl-pipe")
|
|
152
|
+
|
|
153
|
+
def test_install_failure_propagates_tail(self):
|
|
154
|
+
completed = subprocess.CompletedProcess(
|
|
155
|
+
args=["bash", "-c", "..."], returncode=1,
|
|
156
|
+
stdout="", stderr="error: missing python3",
|
|
157
|
+
)
|
|
158
|
+
with mock.patch("omega_engine.hermes.shutil.which", return_value=None):
|
|
159
|
+
with mock.patch("omega_engine.hermes.subprocess.run",
|
|
160
|
+
return_value=completed):
|
|
161
|
+
res = H.install(yes=False)
|
|
162
|
+
self.assertFalse(res.ok)
|
|
163
|
+
self.assertIn("missing python3", res.error)
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
# ---------------------------------------------------------------------------
|
|
167
|
+
# Hermes — link
|
|
168
|
+
# ---------------------------------------------------------------------------
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
class TestLink(unittest.TestCase):
|
|
172
|
+
def test_link_writes_omega_env_file(self):
|
|
173
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
174
|
+
creds = _fake_creds(Path(tmp) / "c.json", token="tk-LINK")
|
|
175
|
+
home = Path(tmp) / "hermes_home"
|
|
176
|
+
with mock.patch.dict(os.environ, {"HERMES_HOME": str(home)}):
|
|
177
|
+
with mock.patch("omega_engine.hermes._CLAUDE_CREDS", creds):
|
|
178
|
+
res = H.link()
|
|
179
|
+
self.assertTrue(res.ok, res.error)
|
|
180
|
+
cfg = home / "omega.env"
|
|
181
|
+
self.assertTrue(cfg.exists())
|
|
182
|
+
content = cfg.read_text()
|
|
183
|
+
self.assertIn("HERMES_PROVIDER='anthropic'", content)
|
|
184
|
+
self.assertIn("HERMES_MODEL='claude-opus-4-7'", content)
|
|
185
|
+
# Token literal must NOT be in the file — we want the live read.
|
|
186
|
+
self.assertNotIn("tk-LINK", content)
|
|
187
|
+
# mode 0600
|
|
188
|
+
mode = oct(cfg.stat().st_mode)[-3:]
|
|
189
|
+
self.assertEqual(mode, "600")
|
|
190
|
+
|
|
191
|
+
def test_link_dry_run_writes_nothing(self):
|
|
192
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
193
|
+
creds = _fake_creds(Path(tmp) / "c.json")
|
|
194
|
+
home = Path(tmp) / "hermes_home"
|
|
195
|
+
with mock.patch.dict(os.environ, {"HERMES_HOME": str(home)}):
|
|
196
|
+
with mock.patch("omega_engine.hermes._CLAUDE_CREDS", creds):
|
|
197
|
+
res = H.link(dry_run=True)
|
|
198
|
+
self.assertTrue(res.ok)
|
|
199
|
+
self.assertFalse((home / "omega.env").exists())
|
|
200
|
+
|
|
201
|
+
def test_link_returns_friendly_error_without_token(self):
|
|
202
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
203
|
+
missing = Path(tmp) / "absent.json"
|
|
204
|
+
with mock.patch("omega_engine.hermes._CLAUDE_CREDS", missing):
|
|
205
|
+
res = H.link()
|
|
206
|
+
self.assertFalse(res.ok)
|
|
207
|
+
self.assertIn("Claude credentials", res.error)
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
# ---------------------------------------------------------------------------
|
|
211
|
+
# Hermes — status + ask
|
|
212
|
+
# ---------------------------------------------------------------------------
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
class TestStatus(unittest.TestCase):
|
|
216
|
+
def test_status_reports_not_installed_when_missing(self):
|
|
217
|
+
with mock.patch("omega_engine.hermes.shutil.which", return_value=None):
|
|
218
|
+
with mock.patch("omega_engine.hermes._CLAUDE_CREDS",
|
|
219
|
+
Path("/nope")):
|
|
220
|
+
st = H.status()
|
|
221
|
+
self.assertFalse(st.installed)
|
|
222
|
+
self.assertFalse(st.oauth_token_present)
|
|
223
|
+
|
|
224
|
+
def test_status_with_token_present_but_no_binary(self):
|
|
225
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
226
|
+
creds = _fake_creds(Path(tmp) / "c.json")
|
|
227
|
+
with mock.patch("omega_engine.hermes.shutil.which",
|
|
228
|
+
return_value=None):
|
|
229
|
+
with mock.patch("omega_engine.hermes._CLAUDE_CREDS", creds):
|
|
230
|
+
st = H.status()
|
|
231
|
+
self.assertFalse(st.installed)
|
|
232
|
+
self.assertTrue(st.oauth_token_present)
|
|
233
|
+
self.assertEqual(st.oauth_subscription, "max")
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
class TestAsk(unittest.TestCase):
|
|
237
|
+
def test_ask_without_install_raises(self):
|
|
238
|
+
with mock.patch("omega_engine.hermes.shutil.which", return_value=None):
|
|
239
|
+
with self.assertRaises(H.HermesError):
|
|
240
|
+
H.ask("hello")
|
|
241
|
+
|
|
242
|
+
def test_ask_invokes_hermes_with_injected_env(self):
|
|
243
|
+
captured = {}
|
|
244
|
+
|
|
245
|
+
def fake_run(cmd, **kw):
|
|
246
|
+
captured["cmd"] = cmd
|
|
247
|
+
captured["env"] = kw.get("env", {})
|
|
248
|
+
return subprocess.CompletedProcess(
|
|
249
|
+
args=cmd, returncode=0,
|
|
250
|
+
stdout="hello back", stderr="",
|
|
251
|
+
)
|
|
252
|
+
|
|
253
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
254
|
+
creds = _fake_creds(Path(tmp) / "c.json", token="tk-ASK")
|
|
255
|
+
with mock.patch("omega_engine.hermes.shutil.which",
|
|
256
|
+
return_value="/usr/local/bin/hermes"):
|
|
257
|
+
with mock.patch("omega_engine.hermes._CLAUDE_CREDS", creds):
|
|
258
|
+
with mock.patch("omega_engine.hermes.subprocess.run",
|
|
259
|
+
side_effect=fake_run):
|
|
260
|
+
rc, out, err = H.ask("hello")
|
|
261
|
+
self.assertEqual(rc, 0)
|
|
262
|
+
self.assertEqual(out, "hello back")
|
|
263
|
+
self.assertEqual(captured["cmd"], ["hermes", "hello"])
|
|
264
|
+
self.assertEqual(captured["env"]["CLAUDE_CODE_OAUTH_TOKEN"], "tk-ASK")
|
|
265
|
+
self.assertEqual(captured["env"]["HERMES_PROVIDER"], "anthropic")
|
|
266
|
+
|
|
267
|
+
def test_ask_empty_prompt_rejected(self):
|
|
268
|
+
with mock.patch("omega_engine.hermes.shutil.which",
|
|
269
|
+
return_value="/usr/local/bin/hermes"):
|
|
270
|
+
with self.assertRaises(H.HermesError):
|
|
271
|
+
H.ask(" ")
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
# ---------------------------------------------------------------------------
|
|
275
|
+
# Understand-Anything — install + run + consume
|
|
276
|
+
# ---------------------------------------------------------------------------
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
class TestUAInstall(unittest.TestCase):
|
|
280
|
+
def test_install_dry_run(self):
|
|
281
|
+
with mock.patch("omega_engine.understand_anything.shutil.which",
|
|
282
|
+
return_value="/usr/local/bin/claude"):
|
|
283
|
+
res = UA.install_plugin(dry_run=True)
|
|
284
|
+
self.assertTrue(res.ok)
|
|
285
|
+
self.assertIn("/plugin marketplace add Lum1104/Understand-Anything",
|
|
286
|
+
res.detail)
|
|
287
|
+
self.assertIn("/plugin install understand-anything", res.detail)
|
|
288
|
+
|
|
289
|
+
def test_install_without_claude_fails(self):
|
|
290
|
+
with mock.patch("omega_engine.understand_anything.shutil.which",
|
|
291
|
+
return_value=None):
|
|
292
|
+
res = UA.install_plugin()
|
|
293
|
+
self.assertFalse(res.ok)
|
|
294
|
+
self.assertIn("not on PATH", res.error)
|
|
295
|
+
|
|
296
|
+
def test_install_invokes_claude_p_with_two_slash_commands(self):
|
|
297
|
+
captured = {}
|
|
298
|
+
|
|
299
|
+
def fake_run(cmd, **kw):
|
|
300
|
+
captured["cmd"] = cmd
|
|
301
|
+
return subprocess.CompletedProcess(
|
|
302
|
+
args=cmd, returncode=0,
|
|
303
|
+
stdout="ok", stderr="",
|
|
304
|
+
)
|
|
305
|
+
|
|
306
|
+
with mock.patch("omega_engine.understand_anything.shutil.which",
|
|
307
|
+
return_value="/usr/local/bin/claude"):
|
|
308
|
+
with mock.patch(
|
|
309
|
+
"omega_engine.understand_anything.subprocess.run",
|
|
310
|
+
side_effect=fake_run,
|
|
311
|
+
):
|
|
312
|
+
res = UA.install_plugin()
|
|
313
|
+
self.assertTrue(res.ok)
|
|
314
|
+
# We pass the bare command name (PATH resolves it), not the
|
|
315
|
+
# absolute path returned by shutil.which.
|
|
316
|
+
self.assertEqual(captured["cmd"][0], "claude")
|
|
317
|
+
self.assertIn("-p", captured["cmd"])
|
|
318
|
+
idx = captured["cmd"].index("-p")
|
|
319
|
+
prompt = captured["cmd"][idx + 1]
|
|
320
|
+
self.assertIn("/plugin marketplace add", prompt)
|
|
321
|
+
self.assertIn("/plugin install understand-anything", prompt)
|
|
322
|
+
self.assertIn("--dangerously-skip-permissions", captured["cmd"])
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
class TestUAConsume(unittest.TestCase):
|
|
326
|
+
def test_consume_produces_normalized_graph(self):
|
|
327
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
328
|
+
project = Path(tmp) / "myproj"
|
|
329
|
+
(project / ".understand-anything").mkdir(parents=True)
|
|
330
|
+
(project / ".understand-anything" / "knowledge-graph.json").write_text(
|
|
331
|
+
json.dumps({
|
|
332
|
+
"nodes": [{"id": "n1"}, {"id": "n2"}, {"id": "n3"}],
|
|
333
|
+
"edges": [{"from": "n1", "to": "n2"}],
|
|
334
|
+
})
|
|
335
|
+
)
|
|
336
|
+
home = Path(tmp) / "Omega"
|
|
337
|
+
info = UA.consume_graph(project, omega_home=home)
|
|
338
|
+
self.assertEqual(info["nodes"], 3)
|
|
339
|
+
self.assertEqual(info["edges"], 1)
|
|
340
|
+
# Written file under Agentik_Runtime/memory/ — check INSIDE
|
|
341
|
+
# the with-block before tempdir is torn down.
|
|
342
|
+
out = Path(info["written_to"])
|
|
343
|
+
self.assertTrue(out.exists())
|
|
344
|
+
data = json.loads(out.read_text())
|
|
345
|
+
self.assertEqual(data["format"], "understand-anything")
|
|
346
|
+
self.assertEqual(len(data["nodes"]), 3)
|
|
347
|
+
|
|
348
|
+
def test_consume_missing_graph_raises(self):
|
|
349
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
350
|
+
with self.assertRaises(UA.UnderstandAnythingError):
|
|
351
|
+
UA.consume_graph(Path(tmp))
|
|
352
|
+
|
|
353
|
+
def test_consume_supports_links_alias(self):
|
|
354
|
+
# Some graphify variants use "links" instead of "edges"
|
|
355
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
356
|
+
project = Path(tmp) / "myproj"
|
|
357
|
+
(project / ".understand-anything").mkdir(parents=True)
|
|
358
|
+
(project / ".understand-anything" / "knowledge-graph.json").write_text(
|
|
359
|
+
json.dumps({
|
|
360
|
+
"nodes": [{"id": "a"}],
|
|
361
|
+
"links": [{"source": "a", "target": "b"}],
|
|
362
|
+
})
|
|
363
|
+
)
|
|
364
|
+
home = Path(tmp) / "Omega"
|
|
365
|
+
info = UA.consume_graph(project, omega_home=home)
|
|
366
|
+
self.assertEqual(info["edges"], 1)
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
class TestUARun(unittest.TestCase):
|
|
370
|
+
def test_run_requires_existing_project(self):
|
|
371
|
+
res = UA.run("/nope/no/such/dir")
|
|
372
|
+
self.assertFalse(res.ok)
|
|
373
|
+
self.assertIn("not a directory", res.error)
|
|
374
|
+
|
|
375
|
+
def test_run_requires_claude_cli(self):
|
|
376
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
377
|
+
with mock.patch(
|
|
378
|
+
"omega_engine.understand_anything.shutil.which",
|
|
379
|
+
return_value=None,
|
|
380
|
+
):
|
|
381
|
+
res = UA.run(tmp)
|
|
382
|
+
self.assertFalse(res.ok)
|
|
383
|
+
self.assertIn("not on PATH", res.error)
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
if __name__ == "__main__":
|
|
387
|
+
unittest.main()
|