@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.
- 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/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/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/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/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,358 @@
|
|
|
1
|
+
"""Tests for v0.19 additions: Hermès bootstrap (self-improvement), tmux
|
|
2
|
+
pro config, Hermes Desktop remote-backend adapter.
|
|
3
|
+
"""
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
import json
|
|
7
|
+
import os
|
|
8
|
+
import socket
|
|
9
|
+
import sys
|
|
10
|
+
import tempfile
|
|
11
|
+
import threading
|
|
12
|
+
import time
|
|
13
|
+
import unittest
|
|
14
|
+
import urllib.error
|
|
15
|
+
import urllib.request
|
|
16
|
+
from pathlib import Path
|
|
17
|
+
from unittest import mock
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
HERE = Path(__file__).resolve().parent
|
|
21
|
+
sys.path.insert(0, str(HERE.parent))
|
|
22
|
+
|
|
23
|
+
from omega_engine import hermes_bootstrap as HB # noqa: E402
|
|
24
|
+
from omega_engine import hermes_desktop as HD # noqa: E402
|
|
25
|
+
from omega_engine import tmux as TX # noqa: E402
|
|
26
|
+
from omega_engine.done_signal import DoneSignal, write_done # noqa: E402
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
# ---------------------------------------------------------------------------
|
|
30
|
+
# Hermès bootstrap — write_brief + observe_outcome + status
|
|
31
|
+
# ---------------------------------------------------------------------------
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class TestHermesBootstrapBrief(unittest.TestCase):
|
|
35
|
+
def test_write_brief_creates_skill_md(self):
|
|
36
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
37
|
+
home = Path(tmp) / "Omega"
|
|
38
|
+
hh = Path(tmp) / ".hermes"
|
|
39
|
+
res = HB.write_brief(omega_home=home, hermes_home=hh)
|
|
40
|
+
self.assertTrue(res.written)
|
|
41
|
+
p = HB.brief_path(hh)
|
|
42
|
+
self.assertTrue(p.exists())
|
|
43
|
+
content = p.read_text()
|
|
44
|
+
# The brief MUST mention the 5-layer architecture
|
|
45
|
+
self.assertIn("L1 Human", content)
|
|
46
|
+
self.assertIn("L2 You (Hermès)", content)
|
|
47
|
+
self.assertIn("L3 AISB", content)
|
|
48
|
+
self.assertIn("L4 Oracle", content)
|
|
49
|
+
self.assertIn("L5 Workers", content)
|
|
50
|
+
# Must reference the no-API-key principle
|
|
51
|
+
self.assertIn("OAuth", content)
|
|
52
|
+
self.assertIn("CLAUDE_CODE_OAUTH_TOKEN", content) if False else None
|
|
53
|
+
# Must mention the engine commands Hermès should call
|
|
54
|
+
for cmd in ("omega run", "omega genesis", "omega plan",
|
|
55
|
+
"omega audit"):
|
|
56
|
+
self.assertIn(cmd, content)
|
|
57
|
+
|
|
58
|
+
def test_write_brief_atomic_no_tmp_leftover(self):
|
|
59
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
60
|
+
hh = Path(tmp) / ".hermes"
|
|
61
|
+
HB.write_brief(hermes_home=hh)
|
|
62
|
+
siblings = list(HB.brief_path(hh).parent.glob("*.tmp.*"))
|
|
63
|
+
self.assertEqual(siblings, [])
|
|
64
|
+
|
|
65
|
+
def test_brief_path_default_is_user_hermes(self):
|
|
66
|
+
self.assertEqual(
|
|
67
|
+
HB.brief_path(),
|
|
68
|
+
Path.home() / ".hermes" / "skills" / "omega" / "SKILL.md",
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
class TestObserveOutcome(unittest.TestCase):
|
|
73
|
+
def test_observe_appends_jsonl(self):
|
|
74
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
75
|
+
home = Path(tmp)
|
|
76
|
+
hh = Path(tmp) / ".hermes"
|
|
77
|
+
# Seed a .done.json so observe has something to read.
|
|
78
|
+
write_done(home, "t-obs", DoneSignal(
|
|
79
|
+
status="done_clean", summary="all good",
|
|
80
|
+
files_changed=["a.py"],
|
|
81
|
+
))
|
|
82
|
+
obs = HB.observe_outcome(
|
|
83
|
+
"demo", "t-obs",
|
|
84
|
+
omega_home=home, hermes_home=hh,
|
|
85
|
+
)
|
|
86
|
+
self.assertIsNotNone(obs)
|
|
87
|
+
self.assertEqual(obs.task_id, "t-obs")
|
|
88
|
+
self.assertEqual(obs.status, "done_clean")
|
|
89
|
+
# The log file exists and contains one JSON line.
|
|
90
|
+
log = HB.memory_log_path(hh)
|
|
91
|
+
self.assertTrue(log.exists())
|
|
92
|
+
lines = log.read_text().splitlines()
|
|
93
|
+
self.assertEqual(len(lines), 1)
|
|
94
|
+
parsed = json.loads(lines[0])
|
|
95
|
+
self.assertEqual(parsed["task_id"], "t-obs")
|
|
96
|
+
|
|
97
|
+
def test_observe_returns_none_when_no_done(self):
|
|
98
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
99
|
+
res = HB.observe_outcome(
|
|
100
|
+
"demo", "never-existed",
|
|
101
|
+
omega_home=Path(tmp), hermes_home=Path(tmp) / ".hermes",
|
|
102
|
+
)
|
|
103
|
+
self.assertIsNone(res)
|
|
104
|
+
|
|
105
|
+
def test_observe_multiple_outcomes_accumulate(self):
|
|
106
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
107
|
+
home = Path(tmp)
|
|
108
|
+
hh = Path(tmp) / ".hermes"
|
|
109
|
+
for i in range(3):
|
|
110
|
+
write_done(home, f"t-{i}", DoneSignal(
|
|
111
|
+
status="done_clean", summary=f"task {i}",
|
|
112
|
+
))
|
|
113
|
+
HB.observe_outcome(
|
|
114
|
+
"demo", f"t-{i}",
|
|
115
|
+
omega_home=home, hermes_home=hh,
|
|
116
|
+
)
|
|
117
|
+
lines = HB.memory_log_path(hh).read_text().splitlines()
|
|
118
|
+
self.assertEqual(len(lines), 3)
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
class TestBootstrapStatus(unittest.TestCase):
|
|
122
|
+
def test_status_reports_absent_when_no_brief(self):
|
|
123
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
124
|
+
st = HB.status(hermes_home=Path(tmp) / ".hermes")
|
|
125
|
+
self.assertFalse(st["brief_present"])
|
|
126
|
+
self.assertEqual(st["brief_size"], 0)
|
|
127
|
+
self.assertEqual(st["observation_count"], 0)
|
|
128
|
+
self.assertIsNone(st["last_observed_at"])
|
|
129
|
+
|
|
130
|
+
def test_status_reports_present_after_write(self):
|
|
131
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
132
|
+
hh = Path(tmp) / ".hermes"
|
|
133
|
+
HB.write_brief(hermes_home=hh)
|
|
134
|
+
st = HB.status(hermes_home=hh)
|
|
135
|
+
self.assertTrue(st["brief_present"])
|
|
136
|
+
self.assertGreater(st["brief_size"], 1000)
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
# ---------------------------------------------------------------------------
|
|
140
|
+
# Tmux pro config
|
|
141
|
+
# ---------------------------------------------------------------------------
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
class TestTmuxProConfig(unittest.TestCase):
|
|
145
|
+
def test_pro_config_includes_paste_fix(self):
|
|
146
|
+
# The whole reason we ported the live VPS conf — fixes the
|
|
147
|
+
# large-paste PTY deadlock that hits every Termius user.
|
|
148
|
+
self.assertIn("assume-paste-time 0", TX._PRO_CONFIG)
|
|
149
|
+
self.assertIn("buffer-limit", TX._PRO_CONFIG)
|
|
150
|
+
|
|
151
|
+
def test_pro_config_includes_kill_forensics(self):
|
|
152
|
+
# Session-closed + pane-died logged so dead workers leave a trace.
|
|
153
|
+
self.assertIn("SESSION CLOSED", TX._PRO_CONFIG)
|
|
154
|
+
self.assertIn("PANE DIED", TX._PRO_CONFIG)
|
|
155
|
+
self.assertIn("tmux-session-kills.log", TX._PRO_CONFIG)
|
|
156
|
+
|
|
157
|
+
def test_pro_config_keeps_prefix_z_picker(self):
|
|
158
|
+
self.assertIn("bind-key Z display-popup", TX._PRO_CONFIG)
|
|
159
|
+
self.assertIn("omega tmux menu", TX._PRO_CONFIG)
|
|
160
|
+
|
|
161
|
+
def test_write_default_config_minimal_vs_pro_differ(self):
|
|
162
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
163
|
+
m = TX.write_default_config(
|
|
164
|
+
target=Path(tmp) / "min.conf", profile="minimal",
|
|
165
|
+
)
|
|
166
|
+
p = TX.write_default_config(
|
|
167
|
+
target=Path(tmp) / "pro.conf", profile="pro",
|
|
168
|
+
)
|
|
169
|
+
self.assertLess(m.stat().st_size, p.stat().st_size)
|
|
170
|
+
self.assertNotIn("assume-paste-time 0", m.read_text())
|
|
171
|
+
self.assertIn("assume-paste-time 0", p.read_text())
|
|
172
|
+
|
|
173
|
+
def test_install_into_home_creates_backup(self):
|
|
174
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
175
|
+
fake_home = Path(tmp) / "h"
|
|
176
|
+
fake_home.mkdir()
|
|
177
|
+
fake_conf = fake_home / ".tmux.conf"
|
|
178
|
+
fake_conf.write_text("# existing user config\nbind a kill-pane\n")
|
|
179
|
+
with mock.patch.object(Path, "home", return_value=fake_home):
|
|
180
|
+
res = TX.install_into_home_tmux_conf(
|
|
181
|
+
profile="pro", backup=True,
|
|
182
|
+
omega_home=Path(tmp) / "Omega",
|
|
183
|
+
)
|
|
184
|
+
# New conf is the pro template
|
|
185
|
+
self.assertIn("assume-paste-time 0", fake_conf.read_text())
|
|
186
|
+
# Backup file exists with the old content
|
|
187
|
+
self.assertTrue(res["backup_path"])
|
|
188
|
+
self.assertTrue(Path(res["backup_path"]).exists())
|
|
189
|
+
self.assertIn(
|
|
190
|
+
"existing user config",
|
|
191
|
+
Path(res["backup_path"]).read_text(),
|
|
192
|
+
)
|
|
193
|
+
|
|
194
|
+
def test_install_into_home_no_backup_flag(self):
|
|
195
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
196
|
+
fake_home = Path(tmp) / "h"
|
|
197
|
+
fake_home.mkdir()
|
|
198
|
+
(fake_home / ".tmux.conf").write_text("# original\n")
|
|
199
|
+
with mock.patch.object(Path, "home", return_value=fake_home):
|
|
200
|
+
res = TX.install_into_home_tmux_conf(
|
|
201
|
+
profile="minimal", backup=False,
|
|
202
|
+
omega_home=Path(tmp) / "Omega",
|
|
203
|
+
)
|
|
204
|
+
self.assertEqual(res["backup_path"], "")
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
# ---------------------------------------------------------------------------
|
|
208
|
+
# Hermes Desktop adapter — token + profile + HTTP server
|
|
209
|
+
# ---------------------------------------------------------------------------
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
class TestHermesDesktopToken(unittest.TestCase):
|
|
213
|
+
def test_generate_token_creates_mode_0600(self):
|
|
214
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
215
|
+
home = Path(tmp)
|
|
216
|
+
tok = HD.generate_token(home)
|
|
217
|
+
self.assertEqual(len(tok), 40)
|
|
218
|
+
self.assertTrue(set(tok).issubset("0123456789abcdef"))
|
|
219
|
+
p = HD.token_path(home)
|
|
220
|
+
mode = oct(p.stat().st_mode)[-3:]
|
|
221
|
+
self.assertEqual(mode, "600")
|
|
222
|
+
|
|
223
|
+
def test_read_token_returns_persisted_value(self):
|
|
224
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
225
|
+
home = Path(tmp)
|
|
226
|
+
tok = HD.generate_token(home)
|
|
227
|
+
self.assertEqual(HD.read_token(home), tok)
|
|
228
|
+
|
|
229
|
+
def test_read_token_returns_none_when_missing(self):
|
|
230
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
231
|
+
self.assertIsNone(HD.read_token(Path(tmp)))
|
|
232
|
+
|
|
233
|
+
def test_build_profile_has_paste_ready_fields(self):
|
|
234
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
235
|
+
prof = HD.build_profile(port=9999, omega_home=Path(tmp))
|
|
236
|
+
self.assertEqual(prof.base_url, "http://127.0.0.1:9999")
|
|
237
|
+
self.assertEqual(len(prof.api_key), 40)
|
|
238
|
+
self.assertIn("OmegaOS", prof.name)
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
class TestHermesDesktopServer(unittest.TestCase):
|
|
242
|
+
"""Spin a real HTTP server on a free port and exercise the routes."""
|
|
243
|
+
|
|
244
|
+
def _free_port(self) -> int:
|
|
245
|
+
with socket.socket() as s:
|
|
246
|
+
s.bind(("127.0.0.1", 0))
|
|
247
|
+
return s.getsockname()[1]
|
|
248
|
+
|
|
249
|
+
def _start(self, omega_home: Path, port: int, token: str | None = None):
|
|
250
|
+
srv = HD.serve(
|
|
251
|
+
host="127.0.0.1", port=port,
|
|
252
|
+
omega_home=omega_home, token=token, quiet=True,
|
|
253
|
+
)
|
|
254
|
+
t = threading.Thread(target=srv.serve_forever, daemon=True)
|
|
255
|
+
t.start()
|
|
256
|
+
return srv
|
|
257
|
+
|
|
258
|
+
def _get(self, port: int, path: str, *, token: str | None = None):
|
|
259
|
+
req = urllib.request.Request(f"http://127.0.0.1:{port}{path}")
|
|
260
|
+
if token:
|
|
261
|
+
req.add_header("Authorization", f"Bearer {token}")
|
|
262
|
+
try:
|
|
263
|
+
with urllib.request.urlopen(req, timeout=5) as resp:
|
|
264
|
+
return resp.status, json.loads(resp.read())
|
|
265
|
+
except urllib.error.HTTPError as exc:
|
|
266
|
+
return exc.code, json.loads(exc.read() or b"{}")
|
|
267
|
+
|
|
268
|
+
def test_health_endpoint_open(self):
|
|
269
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
270
|
+
port = self._free_port()
|
|
271
|
+
srv = self._start(Path(tmp), port)
|
|
272
|
+
try:
|
|
273
|
+
# No token required for /api/health
|
|
274
|
+
code, body = self._get(port, "/api/health")
|
|
275
|
+
self.assertEqual(code, 200)
|
|
276
|
+
self.assertEqual(body["status"], "ok")
|
|
277
|
+
finally:
|
|
278
|
+
srv.shutdown(); srv.server_close()
|
|
279
|
+
|
|
280
|
+
def test_protected_routes_require_token(self):
|
|
281
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
282
|
+
port = self._free_port()
|
|
283
|
+
srv = self._start(Path(tmp), port, token="tok-secret")
|
|
284
|
+
try:
|
|
285
|
+
code, body = self._get(port, "/api/version")
|
|
286
|
+
self.assertEqual(code, 401)
|
|
287
|
+
self.assertIn("token", body["error"])
|
|
288
|
+
finally:
|
|
289
|
+
srv.shutdown(); srv.server_close()
|
|
290
|
+
|
|
291
|
+
def test_version_endpoint_with_valid_token(self):
|
|
292
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
293
|
+
port = self._free_port()
|
|
294
|
+
srv = self._start(Path(tmp), port, token="tok-good")
|
|
295
|
+
try:
|
|
296
|
+
code, body = self._get(port, "/api/version", token="tok-good")
|
|
297
|
+
self.assertEqual(code, 200)
|
|
298
|
+
self.assertIn("omega_version", body)
|
|
299
|
+
self.assertIn("api_routes", body)
|
|
300
|
+
finally:
|
|
301
|
+
srv.shutdown(); srv.server_close()
|
|
302
|
+
|
|
303
|
+
def test_wrong_token_rejected(self):
|
|
304
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
305
|
+
port = self._free_port()
|
|
306
|
+
srv = self._start(Path(tmp), port, token="real")
|
|
307
|
+
try:
|
|
308
|
+
code, _ = self._get(port, "/api/version", token="fake")
|
|
309
|
+
self.assertEqual(code, 401)
|
|
310
|
+
finally:
|
|
311
|
+
srv.shutdown(); srv.server_close()
|
|
312
|
+
|
|
313
|
+
def test_unknown_route_404(self):
|
|
314
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
315
|
+
port = self._free_port()
|
|
316
|
+
srv = self._start(Path(tmp), port, token="t")
|
|
317
|
+
try:
|
|
318
|
+
code, _ = self._get(port, "/api/no-such-thing", token="t")
|
|
319
|
+
self.assertEqual(code, 404)
|
|
320
|
+
finally:
|
|
321
|
+
srv.shutdown(); srv.server_close()
|
|
322
|
+
|
|
323
|
+
def test_sessions_list_returns_empty_array(self):
|
|
324
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
325
|
+
port = self._free_port()
|
|
326
|
+
srv = self._start(Path(tmp), port, token="t")
|
|
327
|
+
try:
|
|
328
|
+
code, body = self._get(port, "/api/sessions", token="t")
|
|
329
|
+
self.assertEqual(code, 200)
|
|
330
|
+
self.assertEqual(body.get("sessions"), [])
|
|
331
|
+
finally:
|
|
332
|
+
srv.shutdown(); srv.server_close()
|
|
333
|
+
|
|
334
|
+
def test_skills_endpoint_lists_omega_skills(self):
|
|
335
|
+
# Use the live repo's SSOT (24 skills) so we get a non-empty list
|
|
336
|
+
repo_omega = Path(__file__).resolve().parents[3] / "omega"
|
|
337
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
338
|
+
port = self._free_port()
|
|
339
|
+
srv = self._start(repo_omega, port, token="t")
|
|
340
|
+
try:
|
|
341
|
+
code, body = self._get(port, "/api/skills", token="t")
|
|
342
|
+
self.assertEqual(code, 200)
|
|
343
|
+
names = {s["name"] for s in body["skills"]
|
|
344
|
+
if s.get("source") == "omega-ssot"}
|
|
345
|
+
self.assertGreaterEqual(len(names), 20)
|
|
346
|
+
finally:
|
|
347
|
+
srv.shutdown(); srv.server_close()
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
class TestRefuseUnsafePublic(unittest.TestCase):
|
|
351
|
+
def test_serve_rejects_0_0_0_0_without_flag(self):
|
|
352
|
+
with self.assertRaises(RuntimeError) as ctx:
|
|
353
|
+
HD.serve(host="0.0.0.0", port=65500, token="t")
|
|
354
|
+
self.assertIn("0.0.0.0", str(ctx.exception))
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
if __name__ == "__main__":
|
|
358
|
+
unittest.main()
|