openajar 0.7.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- openajar/README.md +27 -0
- openajar/__init__.py +18 -0
- openajar/agenda/__init__.py +16 -0
- openajar/agenda/api.py +176 -0
- openajar/agenda/cli.py +233 -0
- openajar/agenda/firing.py +394 -0
- openajar/agenda/models.py +153 -0
- openajar/agenda/rules.py +128 -0
- openajar/agenda/service.py +759 -0
- openajar/agenda/store.py +190 -0
- openajar/agenda/timeline.py +200 -0
- openajar/agenda/tools.py +205 -0
- openajar/agents/__init__.py +11 -0
- openajar/agents/models.py +280 -0
- openajar/agents/ports.py +85 -0
- openajar/api/__init__.py +12 -0
- openajar/api/access.py +442 -0
- openajar/api/actors.py +65 -0
- openajar/api/app.py +666 -0
- openajar/api/auth.py +445 -0
- openajar/api/bridge.py +927 -0
- openajar/api/cli.py +30 -0
- openajar/api/errors.py +79 -0
- openajar/api/events.py +185 -0
- openajar/api/jsonable.py +40 -0
- openajar/api/lane_metrics.py +41 -0
- openajar/api/lanes_view.py +168 -0
- openajar/api/members.py +605 -0
- openajar/api/mounts.py +215 -0
- openajar/api/passkeys.py +418 -0
- openajar/api/realtime.py +588 -0
- openajar/api/route_ids.py +28 -0
- openajar/api/routes_activity.py +249 -0
- openajar/api/routes_approvals.py +505 -0
- openajar/api/routes_audit.py +202 -0
- openajar/api/routes_computers.py +408 -0
- openajar/api/routes_core.py +815 -0
- openajar/api/routes_devices.py +138 -0
- openajar/api/routes_files.py +138 -0
- openajar/api/routes_forms.py +123 -0
- openajar/api/routes_freeze.py +181 -0
- openajar/api/routes_login.py +204 -0
- openajar/api/routes_members.py +715 -0
- openajar/api/routes_memory.py +202 -0
- openajar/api/routes_meters.py +283 -0
- openajar/api/routes_ops.py +661 -0
- openajar/api/routes_overview.py +243 -0
- openajar/api/routes_profiles.py +260 -0
- openajar/api/routes_resources.py +96 -0
- openajar/api/routes_settings.py +434 -0
- openajar/api/routes_worker.py +143 -0
- openajar/api/routes_workflows.py +305 -0
- openajar/api/services.py +135 -0
- openajar/api/static.py +91 -0
- openajar/api/web/__init__.py +31 -0
- openajar/api/web/accounts.py +282 -0
- openajar/api/web/audit.py +35 -0
- openajar/api/web/base.py +284 -0
- openajar/api/web/billing.py +26 -0
- openajar/api/web/brains.py +135 -0
- openajar/api/web/brand.py +202 -0
- openajar/api/web/cardwords.py +319 -0
- openajar/api/web/codes.py +23 -0
- openajar/api/web/computers.py +158 -0
- openajar/api/web/decisions.py +583 -0
- openajar/api/web/email.py +420 -0
- openajar/api/web/environments.py +513 -0
- openajar/api/web/events.py +123 -0
- openajar/api/web/files.py +90 -0
- openajar/api/web/history.py +921 -0
- openajar/api/web/home.py +417 -0
- openajar/api/web/jobs.py +222 -0
- openajar/api/web/memory.py +128 -0
- openajar/api/web/people.py +608 -0
- openajar/api/web/retention.py +127 -0
- openajar/api/web/routines.py +385 -0
- openajar/api/web/schedules.py +117 -0
- openajar/api/web/session.py +118 -0
- openajar/api/web/site_apis.py +332 -0
- openajar/api/web/studio.py +411 -0
- openajar/api/web/surfaces.py +82 -0
- openajar/api/web/telling.py +150 -0
- openajar/api/web/topology.py +144 -0
- openajar/api/web/webhooks.py +116 -0
- openajar/api/web/workers.py +383 -0
- openajar/audit/__init__.py +1 -0
- openajar/audit/captures.py +204 -0
- openajar/audit/cli.py +573 -0
- openajar/audit/errors.py +19 -0
- openajar/audit/replay_page.py +380 -0
- openajar/audit/service.py +868 -0
- openajar/brains/README.md +356 -0
- openajar/brains/__init__.py +23 -0
- openajar/brains/adapters.py +212 -0
- openajar/brains/api.py +110 -0
- openajar/brains/attempts.py +550 -0
- openajar/brains/bundle.py +213 -0
- openajar/brains/chatcli.py +161 -0
- openajar/brains/cli.py +572 -0
- openajar/brains/cliprobe.py +199 -0
- openajar/brains/confine.py +484 -0
- openajar/brains/credentials.py +138 -0
- openajar/brains/deciding.py +385 -0
- openajar/brains/decisions.py +427 -0
- openajar/brains/form.py +117 -0
- openajar/brains/identity.py +216 -0
- openajar/brains/install_cli.sh +136 -0
- openajar/brains/launch.py +306 -0
- openajar/brains/models.py +463 -0
- openajar/brains/parsers.py +520 -0
- openajar/brains/ports.py +159 -0
- openajar/brains/router.py +260 -0
- openajar/brains/scheduling.py +171 -0
- openajar/brains/seats.py +149 -0
- openajar/brains/service.py +820 -0
- openajar/brains/settings.py +110 -0
- openajar/brains/shim.py +353 -0
- openajar/brains/store.py +226 -0
- openajar/brains/tools.py +221 -0
- openajar/brains/transcript.py +180 -0
- openajar/cli.py +186 -0
- openajar/cli_groups.py +472 -0
- openajar/client/README.md +205 -0
- openajar/client/__init__.py +14 -0
- openajar/client/__main__.py +5 -0
- openajar/client/bridge.py +379 -0
- openajar/client/call.py +219 -0
- openajar/client/choices.py +171 -0
- openajar/client/claude.py +346 -0
- openajar/client/cli.py +586 -0
- openajar/client/codex.py +200 -0
- openajar/client/credentials.py +224 -0
- openajar/client/errors.py +53 -0
- openajar/client/expose.py +270 -0
- openajar/client/install.py +388 -0
- openajar/client/mcp_http.py +220 -0
- openajar/client/ops.py +889 -0
- openajar/client/owner.py +174 -0
- openajar/client/ports.py +51 -0
- openajar/client/remote.py +146 -0
- openajar/client/run.py +499 -0
- openajar/client/run_cli.py +308 -0
- openajar/client/skills/openajar-environment/SKILL.md +111 -0
- openajar/client/skills/openajar-lanes/SKILL.md +119 -0
- openajar/client/skills/openajar-offload/SKILL.md +125 -0
- openajar/client/skills/openajar-studio/SKILL.md +175 -0
- openajar/client/skills.py +113 -0
- openajar/client/state.py +223 -0
- openajar/client/tokens.py +219 -0
- openajar/client/tunnel.py +314 -0
- openajar/commands/__init__.py +2 -0
- openajar/commands/base.py +355 -0
- openajar/commands/devices.py +145 -0
- openajar/commands/features.py +151 -0
- openajar/commands/lane_control.py +201 -0
- openajar/commands/lane_sites.py +538 -0
- openajar/commands/lanes.py +189 -0
- openajar/commands/members.py +195 -0
- openajar/commands/node.py +210 -0
- openajar/commands/proxy.py +359 -0
- openajar/commands/solver.py +193 -0
- openajar/controller/__init__.py +14 -0
- openajar/controller/app.py +262 -0
- openajar/controller/cli.py +491 -0
- openajar/controller/config.py +131 -0
- openajar/controller/connect.py +230 -0
- openajar/controller/grants.py +175 -0
- openajar/controller/guide.py +116 -0
- openajar/controller/hooks.py +53 -0
- openajar/controller/hub.py +854 -0
- openajar/controller/mcp.py +318 -0
- openajar/controller/routing.py +200 -0
- openajar/controller/static/api.js +39 -0
- openajar/controller/static/controller.js +155 -0
- openajar/controller/static/index.html +48 -0
- openajar/controller/static/login.html +18 -0
- openajar/controller/static/login.js +18 -0
- openajar/controller/static/style.css +38 -0
- openajar/controller/static/view.html +25 -0
- openajar/controller/static/view.js +49 -0
- openajar/controller/store.py +556 -0
- openajar/controller/up.py +89 -0
- openajar/controller/web.py +572 -0
- openajar/core/__init__.py +1 -0
- openajar/core/age.py +462 -0
- openajar/core/agent_names.py +82 -0
- openajar/core/aio.py +42 -0
- openajar/core/app_paths.py +14 -0
- openajar/core/cardfacts.py +46 -0
- openajar/core/catalog.py +435 -0
- openajar/core/ceiling.py +30 -0
- openajar/core/clock.py +78 -0
- openajar/core/config.py +333 -0
- openajar/core/config_report.py +214 -0
- openajar/core/driver.py +194 -0
- openajar/core/error_catalog.toml +1180 -0
- openajar/core/errors.py +166 -0
- openajar/core/fs.py +348 -0
- openajar/core/globs.py +278 -0
- openajar/core/http_errors.py +139 -0
- openajar/core/layout.py +283 -0
- openajar/core/live.py +238 -0
- openajar/core/locator.py +326 -0
- openajar/core/logs.py +360 -0
- openajar/core/migrate.py +321 -0
- openajar/core/models.py +547 -0
- openajar/core/pauses.py +82 -0
- openajar/core/presence.py +35 -0
- openajar/core/proc.py +83 -0
- openajar/core/progress.py +159 -0
- openajar/core/ratelimit.py +40 -0
- openajar/core/runtime.py +76 -0
- openajar/core/s3.py +262 -0
- openajar/core/signals.py +115 -0
- openajar/core/signing.py +83 -0
- openajar/core/sqlite.py +219 -0
- openajar/core/suggest.py +70 -0
- openajar/core/system.py +532 -0
- openajar/core/template.py +45 -0
- openajar/core/text.py +24 -0
- openajar/core/toolnames.py +152 -0
- openajar/core/tools.py +400 -0
- openajar/core/toolsets.py +141 -0
- openajar/core/webapp.py +94 -0
- openajar/core/zone.py +62 -0
- openajar/dev/__init__.py +8 -0
- openajar/dev/apidemo.py +35 -0
- openajar/dev/apifakes.py +447 -0
- openajar/dev/cli.py +128 -0
- openajar/dev/display.py +145 -0
- openajar/dev/fakecli.py +442 -0
- openajar/dev/golden.py +357 -0
- openajar/dev/health.py +115 -0
- openajar/dev/image.py +51 -0
- openajar/dev/lanes.py +980 -0
- openajar/dev/net.py +310 -0
- openajar/dev/node.py +276 -0
- openajar/dev/proxied.py +197 -0
- openajar/dev/slotnode.py +627 -0
- openajar/dev/tuidemo.py +885 -0
- openajar/dev/web.py +475 -0
- openajar/env/__init__.py +6 -0
- openajar/env/cli.py +432 -0
- openajar/env/execs.py +296 -0
- openajar/env/exposure.py +168 -0
- openajar/env/files.py +410 -0
- openajar/env/host.py +500 -0
- openajar/env/images.py +135 -0
- openajar/env/jobs.py +696 -0
- openajar/env/lane_jobs.py +197 -0
- openajar/env/lane_sync.py +230 -0
- openajar/env/lanes.py +368 -0
- openajar/env/manager.py +949 -0
- openajar/env/models.py +274 -0
- openajar/env/netproxy.py +387 -0
- openajar/env/oom.py +233 -0
- openajar/env/paths.py +139 -0
- openajar/env/presets.py +228 -0
- openajar/env/programs.py +140 -0
- openajar/env/pty.py +269 -0
- openajar/env/readhint.py +98 -0
- openajar/env/sandbox.py +327 -0
- openajar/env/seccomp.py +132 -0
- openajar/env/service.py +18 -0
- openajar/env/services.py +270 -0
- openajar/env/store.py +131 -0
- openajar/env/sync.py +353 -0
- openajar/env/testsummary.py +87 -0
- openajar/env/tools.py +829 -0
- openajar/environments/__init__.py +5 -0
- openajar/environments/activity.py +142 -0
- openajar/environments/api.py +202 -0
- openajar/environments/appsecrets.py +86 -0
- openajar/environments/bringup.py +601 -0
- openajar/environments/browser-requirements.txt +816 -0
- openajar/environments/browser.sh +47 -0
- openajar/environments/browserproxy.py +465 -0
- openajar/environments/caller.py +49 -0
- openajar/environments/checkpoint_scripts.py +199 -0
- openajar/environments/checkpoint_tools.py +104 -0
- openajar/environments/checkpoints.py +272 -0
- openajar/environments/cli.py +929 -0
- openajar/environments/comeback.py +265 -0
- openajar/environments/connect.py +459 -0
- openajar/environments/desklink.py +478 -0
- openajar/environments/desktop/config/gtk-3.0/bookmarks +1 -0
- openajar/environments/desktop/config/gtk-3.0/gtk.css +23 -0
- openajar/environments/desktop/config/gtk-3.0/settings.ini +15 -0
- openajar/environments/desktop/config/libfm/libfm.conf +26 -0
- openajar/environments/desktop/config/lxterminal/lxterminal.conf +50 -0
- openajar/environments/desktop/config/pcmanfm/default/pcmanfm.conf +26 -0
- openajar/environments/desktop/desk.py +886 -0
- openajar/environments/desktop/deskart.py +339 -0
- openajar/environments/desktop/deskterm.py +370 -0
- openajar/environments/desktop/icons/agent.svg +29 -0
- openajar/environments/desktop/icons/app-tile.svg +29 -0
- openajar/environments/desktop/icons/app.svg +32 -0
- openajar/environments/desktop/icons/browser.svg +33 -0
- openajar/environments/desktop/icons/files.svg +35 -0
- openajar/environments/desktop/icons/terminal.svg +33 -0
- openajar/environments/desktop/mark.svg +4 -0
- openajar/environments/desktop/openbox/close.xbm +4 -0
- openajar/environments/desktop/openbox/iconify.xbm +4 -0
- openajar/environments/desktop/openbox/max.xbm +4 -0
- openajar/environments/desktop/openbox/max_toggled.xbm +4 -0
- openajar/environments/desktop/openbox/menu.xml +7 -0
- openajar/environments/desktop/openbox/rc.xml +114 -0
- openajar/environments/desktop/openbox/themerc +113 -0
- openajar/environments/desktop/screen_ctl.py +847 -0
- openajar/environments/desktop/wallpaper-1920x1080.jpg +0 -0
- openajar/environments/desktop/wallpaper.svg +45 -0
- openajar/environments/desktop.sh +37 -0
- openajar/environments/downloads.py +345 -0
- openajar/environments/envfiles.py +530 -0
- openajar/environments/envfiles_cli.py +327 -0
- openajar/environments/envproxy.py +276 -0
- openajar/environments/errors.py +168 -0
- openajar/environments/exitplace.py +260 -0
- openajar/environments/exitplaces.json +1 -0
- openajar/environments/failures.py +111 -0
- openajar/environments/fleet.py +144 -0
- openajar/environments/form.py +112 -0
- openajar/environments/identity.py +77 -0
- openajar/environments/image/Dockerfile +46 -0
- openajar/environments/image/entrypoint.sh +94 -0
- openajar/environments/liveness.py +213 -0
- openajar/environments/logins.py +470 -0
- openajar/environments/logins_cli.py +257 -0
- openajar/environments/machine.py +333 -0
- openajar/environments/machineplace.py +116 -0
- openajar/environments/manager.py +950 -0
- openajar/environments/media.py +100 -0
- openajar/environments/models.py +338 -0
- openajar/environments/network.py +317 -0
- openajar/environments/networking.py +379 -0
- openajar/environments/pausing.py +316 -0
- openajar/environments/picking.py +422 -0
- openajar/environments/ports.py +320 -0
- openajar/environments/prepared.py +167 -0
- openajar/environments/prepared_cli.py +146 -0
- openajar/environments/preparing.py +586 -0
- openajar/environments/prepbuild.py +457 -0
- openajar/environments/probes.py +166 -0
- openajar/environments/proofs.py +307 -0
- openajar/environments/prproofs.py +244 -0
- openajar/environments/pulls.py +239 -0
- openajar/environments/recorder_ctl.py +249 -0
- openajar/environments/recording.py +354 -0
- openajar/environments/relink.py +217 -0
- openajar/environments/replay.py +435 -0
- openajar/environments/replay_cli.py +256 -0
- openajar/environments/replay_store.py +289 -0
- openajar/environments/repoconfig.py +200 -0
- openajar/environments/repos.py +122 -0
- openajar/environments/resume_cli.py +82 -0
- openajar/environments/routing.py +358 -0
- openajar/environments/saves.py +485 -0
- openajar/environments/saving.py +996 -0
- openajar/environments/screen.py +595 -0
- openajar/environments/scripts.py +209 -0
- openajar/environments/secrets_cli.py +135 -0
- openajar/environments/service.py +22 -0
- openajar/environments/setup.sh +70 -0
- openajar/environments/signins.py +239 -0
- openajar/environments/sizing.py +394 -0
- openajar/environments/sshaccess.py +440 -0
- openajar/environments/stills.py +207 -0
- openajar/environments/store.py +107 -0
- openajar/environments/swap.py +463 -0
- openajar/environments/thiscomputer.py +215 -0
- openajar/environments/timings.py +81 -0
- openajar/environments/tools.py +953 -0
- openajar/environments/tunnels.py +418 -0
- openajar/environments/updates.py +69 -0
- openajar/environments/uploads.py +417 -0
- openajar/environments/views.py +272 -0
- openajar/environments/vmbrowser.py +974 -0
- openajar/environments/vmbrowser_ctl.py +846 -0
- openajar/environments/vmharden.py +83 -0
- openajar/environments/vmkeys.py +160 -0
- openajar/environments/vmpin.py +401 -0
- openajar/environments/waking.py +139 -0
- openajar/environments/warmpool.py +328 -0
- openajar/environments/watching.py +110 -0
- openajar/events/README.md +133 -0
- openajar/events/__init__.py +15 -0
- openajar/events/dispatcher.py +545 -0
- openajar/events/frame.py +112 -0
- openajar/events/models.py +513 -0
- openajar/events/ports.py +30 -0
- openajar/events/service.py +484 -0
- openajar/events/sources.py +170 -0
- openajar/events/store.py +383 -0
- openajar/events/targets.py +302 -0
- openajar/events/tools.py +119 -0
- openajar/freeze/__init__.py +5 -0
- openajar/freeze/cli.py +266 -0
- openajar/freeze/service.py +858 -0
- openajar/freeze/tools.py +82 -0
- openajar/git/__init__.py +21 -0
- openajar/git/agent.py +184 -0
- openajar/git/cli.py +271 -0
- openajar/git/credentials.py +66 -0
- openajar/git/gateway.py +991 -0
- openajar/git/keys.py +236 -0
- openajar/git/login.py +147 -0
- openajar/git/remotes.py +219 -0
- openajar/git/service.py +354 -0
- openajar/git/tools.py +69 -0
- openajar/git/upstream.py +367 -0
- openajar/git/wire.py +298 -0
- openajar/keepalive/__init__.py +1 -0
- openajar/keepalive/cli.py +164 -0
- openajar/keepalive/migrations.py +62 -0
- openajar/keepalive/persona.py +135 -0
- openajar/keepalive/planner.py +252 -0
- openajar/keepalive/service.py +712 -0
- openajar/keepalive/sites.py +94 -0
- openajar/keepalive/store.py +215 -0
- openajar/keepalive/visit.py +388 -0
- openajar/lanebench_cli.py +149 -0
- openajar/local/__init__.py +13 -0
- openajar/local/cli.py +236 -0
- openajar/local/home.py +129 -0
- openajar/local/lanes.py +92 -0
- openajar/local/mcp_command.py +283 -0
- openajar/local/node.py +191 -0
- openajar/local/paths.py +43 -0
- openajar/local/register.py +124 -0
- openajar/local/service.py +545 -0
- openajar/local/wake.py +208 -0
- openajar/mcp/__init__.py +1 -0
- openajar/mcp/argerrors.py +125 -0
- openajar/mcp/callprogress.py +46 -0
- openajar/mcp/http.py +445 -0
- openajar/mcp/providers.py +163 -0
- openajar/mcp/reference.py +190 -0
- openajar/mcp/registry.py +945 -0
- openajar/mcp/reload.py +224 -0
- openajar/mcp/server.py +53 -0
- openajar/mcp/toolsets.py +259 -0
- openajar/memory/README.md +130 -0
- openajar/memory/__init__.py +27 -0
- openajar/memory/cli.py +402 -0
- openajar/memory/common.py +123 -0
- openajar/memory/errors.py +115 -0
- openajar/memory/markdown.py +60 -0
- openajar/memory/models.py +451 -0
- openajar/memory/pack.py +266 -0
- openajar/memory/portable.py +210 -0
- openajar/memory/ports.py +229 -0
- openajar/memory/reads.py +292 -0
- openajar/memory/scan.py +201 -0
- openajar/memory/service.py +479 -0
- openajar/memory/store.py +579 -0
- openajar/memory/tools.py +257 -0
- openajar/memory/writes.py +496 -0
- openajar/node/__init__.py +1 -0
- openajar/node/acting.py +378 -0
- openajar/node/agent_pointer.py +159 -0
- openajar/node/anchors.py +463 -0
- openajar/node/browser_output.py +265 -0
- openajar/node/camoufox/__init__.py +1 -0
- openajar/node/camoufox/config.py +193 -0
- openajar/node/camoufox/engine.py +697 -0
- openajar/node/camoufox/launch.py +77 -0
- openajar/node/camoufox/pages.py +344 -0
- openajar/node/camoufox/pin.py +259 -0
- openajar/node/camoufox/prefs.py +81 -0
- openajar/node/camoufox/procs.py +37 -0
- openajar/node/camoufox/session.py +166 -0
- openajar/node/camoufox/window.py +184 -0
- openajar/node/cardfacts.py +56 -0
- openajar/node/channel/__init__.py +13 -0
- openajar/node/channel/approvals.py +183 -0
- openajar/node/channel/ask_first.py +88 -0
- openajar/node/channel/bridge.py +229 -0
- openajar/node/channel/calls.py +263 -0
- openajar/node/channel/connection.py +77 -0
- openajar/node/channel/enroll.py +147 -0
- openajar/node/channel/files.py +166 -0
- openajar/node/channel/identity.py +87 -0
- openajar/node/channel/invoke.py +133 -0
- openajar/node/channel/logstream.py +451 -0
- openajar/node/channel/node.py +703 -0
- openajar/node/channel/node_streams.py +280 -0
- openajar/node/channel/outbox.py +151 -0
- openajar/node/channel/reports.py +501 -0
- openajar/node/channel/service.py +58 -0
- openajar/node/channel/signed.py +243 -0
- openajar/node/channel/standing.py +464 -0
- openajar/node/channel/store.py +182 -0
- openajar/node/channel/stream_messages.py +149 -0
- openajar/node/channel/streams.py +201 -0
- openajar/node/channel/usage.py +158 -0
- openajar/node/channel/wire.py +303 -0
- openajar/node/channel/workflows.py +132 -0
- openajar/node/checkbox.py +56 -0
- openajar/node/claims.py +462 -0
- openajar/node/commitgate.py +483 -0
- openajar/node/control_tools.py +203 -0
- openajar/node/daemon.py +611 -0
- openajar/node/deadlines.py +78 -0
- openajar/node/devices.py +662 -0
- openajar/node/devtools.py +734 -0
- openajar/node/devtools_tools.py +203 -0
- openajar/node/display.py +471 -0
- openajar/node/egress/__init__.py +330 -0
- openajar/node/egress/classify.py +194 -0
- openajar/node/egress/constants.py +60 -0
- openajar/node/egress/guard.py +960 -0
- openajar/node/egress/guard_flows.py +157 -0
- openajar/node/egress/guard_learn.py +406 -0
- openajar/node/egress/guard_login.py +70 -0
- openajar/node/egress/guard_prevent.py +381 -0
- openajar/node/egress/guard_records.py +319 -0
- openajar/node/egress/helpers.py +78 -0
- openajar/node/egress/learn.py +118 -0
- openajar/node/egress/learn_window.py +191 -0
- openajar/node/egress/page_js.py +142 -0
- openajar/node/egress/rules.py +325 -0
- openajar/node/egress/shapes.py +596 -0
- openajar/node/egress/sites.py +114 -0
- openajar/node/egress/suggested.py +51 -0
- openajar/node/egress/trace.py +56 -0
- openajar/node/egress/verdicts.py +370 -0
- openajar/node/expose/__init__.py +31 -0
- openajar/node/expose/api.py +102 -0
- openajar/node/expose/forward.py +129 -0
- openajar/node/expose/names.py +81 -0
- openajar/node/expose/relay.py +89 -0
- openajar/node/expose/route.py +243 -0
- openajar/node/expose/service.py +401 -0
- openajar/node/fields.py +366 -0
- openajar/node/files.py +971 -0
- openajar/node/fingerprint.py +133 -0
- openajar/node/flow_bodies.py +110 -0
- openajar/node/flow_driver.py +837 -0
- openajar/node/flow_lanes.py +104 -0
- openajar/node/flow_match.py +130 -0
- openajar/node/flow_recorder.py +229 -0
- openajar/node/flow_scripts.py +201 -0
- openajar/node/forms.py +290 -0
- openajar/node/gateshapes.py +553 -0
- openajar/node/handback.py +388 -0
- openajar/node/holds.py +73 -0
- openajar/node/human.py +931 -0
- openajar/node/human_fields.py +192 -0
- openajar/node/human_pace.py +121 -0
- openajar/node/interaction/__init__.py +322 -0
- openajar/node/interaction/actions.py +223 -0
- openajar/node/interaction/autocheck.py +51 -0
- openajar/node/interaction/checks.py +357 -0
- openajar/node/interaction/covered.py +221 -0
- openajar/node/interaction/dialogs.py +304 -0
- openajar/node/interaction/navigation.py +262 -0
- openajar/node/interaction/pages.py +222 -0
- openajar/node/interaction/readback.py +114 -0
- openajar/node/interaction/uploads.py +211 -0
- openajar/node/interaction/urls.py +106 -0
- openajar/node/interaction/waits.py +362 -0
- openajar/node/interfaces.py +274 -0
- openajar/node/interrupts.py +61 -0
- openajar/node/io_tools.py +422 -0
- openajar/node/lane_clipboard.py +112 -0
- openajar/node/lanefmt.py +553 -0
- openajar/node/lanes/__init__.py +259 -0
- openajar/node/lanes/access.py +658 -0
- openajar/node/lanes/base.py +145 -0
- openajar/node/lanes/control.py +722 -0
- openajar/node/lanes/frames.py +68 -0
- openajar/node/lanes/launch.py +476 -0
- openajar/node/lanes/manager.py +466 -0
- openajar/node/lanes/quarantine.py +388 -0
- openajar/node/lanes/resources.py +352 -0
- openajar/node/lanes/specs.py +368 -0
- openajar/node/lanes/watch.py +156 -0
- openajar/node/learned_rules.py +333 -0
- openajar/node/login_assist.py +915 -0
- openajar/node/login_form.py +193 -0
- openajar/node/login_page.py +424 -0
- openajar/node/memwatch.py +275 -0
- openajar/node/publish.py +768 -0
- openajar/node/routes.py +191 -0
- openajar/node/rulehealth.py +405 -0
- openajar/node/signed_out.py +99 -0
- openajar/node/sites.py +815 -0
- openajar/node/snapshot.py +912 -0
- openajar/node/solver/__init__.py +18 -0
- openajar/node/solver/ledger.py +114 -0
- openajar/node/solver/services.py +308 -0
- openajar/node/solver/settings.py +138 -0
- openajar/node/solver/steps.py +220 -0
- openajar/node/solver/widgets.py +273 -0
- openajar/node/store.py +367 -0
- openajar/node/tools/__init__.py +216 -0
- openajar/node/tools/browser.py +307 -0
- openajar/node/tools/challenge.py +81 -0
- openajar/node/tools/form_check.py +173 -0
- openajar/node/tools/guarding.py +130 -0
- openajar/node/tools/inputs.py +68 -0
- openajar/node/tools/lanes.py +316 -0
- openajar/node/tools/outline.py +215 -0
- openajar/node/tools/recipes.py +406 -0
- openajar/node/tools/session.py +203 -0
- openajar/node/tools/shots.py +89 -0
- openajar/node/tools/wait.py +186 -0
- openajar/node/typist.py +787 -0
- openajar/node/vault_tools.py +135 -0
- openajar/node/viewer/assets/fonts/GEIST-LICENSE.txt +93 -0
- openajar/node/viewer/assets/fonts/geist.woff2 +0 -0
- openajar/node/viewer/assets/login.css +122 -0
- openajar/node/viewer/assets/login.js +259 -0
- openajar/node/viewer/assets/mark.svg +29 -0
- openajar/node/viewer/assets/record.js +313 -0
- openajar/node/viewer/assets/vendor/novnc/AUTHORS +13 -0
- openajar/node/viewer/assets/vendor/novnc/LICENSE.txt +62 -0
- openajar/node/viewer/assets/vendor/novnc/VENDORED.md +15 -0
- openajar/node/viewer/assets/vendor/novnc/core/base64.js +104 -0
- openajar/node/viewer/assets/vendor/novnc/core/crypto/aes.js +178 -0
- openajar/node/viewer/assets/vendor/novnc/core/crypto/bigint.js +34 -0
- openajar/node/viewer/assets/vendor/novnc/core/crypto/crypto.js +90 -0
- openajar/node/viewer/assets/vendor/novnc/core/crypto/des.js +330 -0
- openajar/node/viewer/assets/vendor/novnc/core/crypto/dh.js +55 -0
- openajar/node/viewer/assets/vendor/novnc/core/crypto/md5.js +82 -0
- openajar/node/viewer/assets/vendor/novnc/core/crypto/rsa.js +132 -0
- openajar/node/viewer/assets/vendor/novnc/core/decoders/copyrect.js +27 -0
- openajar/node/viewer/assets/vendor/novnc/core/decoders/h264.js +321 -0
- openajar/node/viewer/assets/vendor/novnc/core/decoders/hextile.js +181 -0
- openajar/node/viewer/assets/vendor/novnc/core/decoders/jpeg.js +161 -0
- openajar/node/viewer/assets/vendor/novnc/core/decoders/raw.js +59 -0
- openajar/node/viewer/assets/vendor/novnc/core/decoders/rre.js +44 -0
- openajar/node/viewer/assets/vendor/novnc/core/decoders/tight.js +393 -0
- openajar/node/viewer/assets/vendor/novnc/core/decoders/tightpng.js +27 -0
- openajar/node/viewer/assets/vendor/novnc/core/decoders/zlib.js +51 -0
- openajar/node/viewer/assets/vendor/novnc/core/decoders/zrle.js +185 -0
- openajar/node/viewer/assets/vendor/novnc/core/deflator.js +84 -0
- openajar/node/viewer/assets/vendor/novnc/core/display.js +578 -0
- openajar/node/viewer/assets/vendor/novnc/core/encodings.js +54 -0
- openajar/node/viewer/assets/vendor/novnc/core/inflator.js +65 -0
- openajar/node/viewer/assets/vendor/novnc/core/input/domkeytable.js +311 -0
- openajar/node/viewer/assets/vendor/novnc/core/input/fixedkeys.js +129 -0
- openajar/node/viewer/assets/vendor/novnc/core/input/gesturehandler.js +567 -0
- openajar/node/viewer/assets/vendor/novnc/core/input/keyboard.js +294 -0
- openajar/node/viewer/assets/vendor/novnc/core/input/keysym.js +616 -0
- openajar/node/viewer/assets/vendor/novnc/core/input/keysymdef.js +688 -0
- openajar/node/viewer/assets/vendor/novnc/core/input/util.js +191 -0
- openajar/node/viewer/assets/vendor/novnc/core/input/vkeys.js +116 -0
- openajar/node/viewer/assets/vendor/novnc/core/input/xtscancodes.js +173 -0
- openajar/node/viewer/assets/vendor/novnc/core/ra2.js +312 -0
- openajar/node/viewer/assets/vendor/novnc/core/rfb.js +3411 -0
- openajar/node/viewer/assets/vendor/novnc/core/util/browser.js +233 -0
- openajar/node/viewer/assets/vendor/novnc/core/util/cursor.js +249 -0
- openajar/node/viewer/assets/vendor/novnc/core/util/element.js +32 -0
- openajar/node/viewer/assets/vendor/novnc/core/util/events.js +138 -0
- openajar/node/viewer/assets/vendor/novnc/core/util/eventtarget.js +35 -0
- openajar/node/viewer/assets/vendor/novnc/core/util/int.js +15 -0
- openajar/node/viewer/assets/vendor/novnc/core/util/logging.js +56 -0
- openajar/node/viewer/assets/vendor/novnc/core/util/strings.js +28 -0
- openajar/node/viewer/assets/vendor/novnc/core/websock.js +369 -0
- openajar/node/viewer/assets/vendor/novnc/vendor/pako/LICENSE +21 -0
- openajar/node/viewer/assets/vendor/novnc/vendor/pako/lib/utils/common.js +45 -0
- openajar/node/viewer/assets/vendor/novnc/vendor/pako/lib/zlib/adler32.js +27 -0
- openajar/node/viewer/assets/vendor/novnc/vendor/pako/lib/zlib/constants.js +47 -0
- openajar/node/viewer/assets/vendor/novnc/vendor/pako/lib/zlib/crc32.js +36 -0
- openajar/node/viewer/assets/vendor/novnc/vendor/pako/lib/zlib/deflate.js +1846 -0
- openajar/node/viewer/assets/vendor/novnc/vendor/pako/lib/zlib/gzheader.js +35 -0
- openajar/node/viewer/assets/vendor/novnc/vendor/pako/lib/zlib/inffast.js +324 -0
- openajar/node/viewer/assets/vendor/novnc/vendor/pako/lib/zlib/inflate.js +1527 -0
- openajar/node/viewer/assets/vendor/novnc/vendor/pako/lib/zlib/inftrees.js +322 -0
- openajar/node/viewer/assets/vendor/novnc/vendor/pako/lib/zlib/messages.js +11 -0
- openajar/node/viewer/assets/vendor/novnc/vendor/pako/lib/zlib/trees.js +1195 -0
- openajar/node/viewer/assets/vendor/novnc/vendor/pako/lib/zlib/zstream.js +24 -0
- openajar/node/viewer/assets/viewer.css +1010 -0
- openajar/node/viewer/assets/viewer.js +1292 -0
- openajar/node/viewer/page.html +181 -0
- openajar/node/viewer_actions.py +119 -0
- openajar/node/viewer_app.py +998 -0
- openajar/node/viewer_media.py +72 -0
- openajar/node/viewer_routes.py +247 -0
- openajar/node/viewer_saved.py +198 -0
- openajar/node/viewer_state.py +178 -0
- openajar/node/viewer_tokens.py +283 -0
- openajar/node/viewroutes.py +77 -0
- openajar/node/vnc_relay.py +449 -0
- openajar/node/xkeyboard.py +88 -0
- openajar/ops/__init__.py +20 -0
- openajar/ops/__main__.py +6 -0
- openajar/ops/backup/__init__.py +958 -0
- openajar/ops/cli.py +636 -0
- openajar/ops/cli_common.py +90 -0
- openajar/ops/control.py +195 -0
- openajar/ops/doctor.py +996 -0
- openajar/ops/doctor_web.py +30 -0
- openajar/ops/health.py +467 -0
- openajar/ops/lane_cli.py +464 -0
- openajar/ops/logs.py +220 -0
- openajar/ops/restart.py +158 -0
- openajar/ops/service.py +234 -0
- openajar/ops/service_user.py +570 -0
- openajar/ops/templates.py +149 -0
- openajar/ops/upgrade.py +324 -0
- openajar/pilot/README.md +178 -0
- openajar/pilot/__init__.py +12 -0
- openajar/pilot/anchor.py +651 -0
- openajar/pilot/cli.py +33 -0
- openajar/pilot/day.py +54 -0
- openajar/pilot/deciders.py +253 -0
- openajar/pilot/errors.py +37 -0
- openajar/pilot/grant.py +49 -0
- openajar/pilot/hands.py +82 -0
- openajar/pilot/loop.py +703 -0
- openajar/pilot/models.py +150 -0
- openajar/pilot/modes.py +28 -0
- openajar/pilot/page.py +359 -0
- openajar/pilot/questions.py +150 -0
- openajar/pilot/service.py +502 -0
- openajar/pilot/tools.py +151 -0
- openajar/pilot/trail.py +49 -0
- openajar/plugins/README.md +141 -0
- openajar/plugins/__init__.py +2 -0
- openajar/plugins/admin.py +140 -0
- openajar/plugins/cli.py +243 -0
- openajar/plugins/entries.py +72 -0
- openajar/plugins/errors.py +31 -0
- openajar/plugins/models.py +148 -0
- openajar/plugins/requirements.py +148 -0
- openajar/plugins/service.py +311 -0
- openajar/plugins/store.py +186 -0
- openajar/plugins/tools.py +47 -0
- openajar/policy/AUDIT-LOG.md +248 -0
- openajar/policy/ROUTING.md +752 -0
- openajar/policy/TOKENS.md +334 -0
- openajar/policy/__init__.py +39 -0
- openajar/policy/anchors.py +440 -0
- openajar/policy/approval_binding.py +157 -0
- openajar/policy/approval_models.py +371 -0
- openajar/policy/approvals.py +890 -0
- openajar/policy/ask_first.py +192 -0
- openajar/policy/audit_health.py +79 -0
- openajar/policy/auditlog.py +914 -0
- openajar/policy/authorize.py +521 -0
- openajar/policy/budgets.py +394 -0
- openajar/policy/capture_files.py +70 -0
- openajar/policy/cards.py +691 -0
- openajar/policy/ceiling.py +147 -0
- openajar/policy/cli.py +880 -0
- openajar/policy/confirm.py +418 -0
- openajar/policy/confirm_chat.py +328 -0
- openajar/policy/confirmation.py +493 -0
- openajar/policy/context.py +290 -0
- openajar/policy/errors.py +89 -0
- openajar/policy/explain.py +343 -0
- openajar/policy/freeze.py +384 -0
- openajar/policy/freeze_store.py +352 -0
- openajar/policy/grants.py +982 -0
- openajar/policy/issuers.py +370 -0
- openajar/policy/keys.py +298 -0
- openajar/policy/labels.py +107 -0
- openajar/policy/lane_pace.py +243 -0
- openajar/policy/ledger.py +176 -0
- openajar/policy/manifest.py +42 -0
- openajar/policy/members.py +285 -0
- openajar/policy/memory_port.py +157 -0
- openajar/policy/memory_rules.py +310 -0
- openajar/policy/meters.py +542 -0
- openajar/policy/notifier.py +965 -0
- openajar/policy/pace.py +572 -0
- openajar/policy/principals.py +214 -0
- openajar/policy/quiet_hours.py +189 -0
- openajar/policy/recipients.py +191 -0
- openajar/policy/redact.py +315 -0
- openajar/policy/redactor.py +85 -0
- openajar/policy/registry.py +697 -0
- openajar/policy/routing.py +290 -0
- openajar/policy/run_grants.py +190 -0
- openajar/policy/scope.py +115 -0
- openajar/policy/scrub.py +139 -0
- openajar/policy/service.py +364 -0
- openajar/policy/standing.py +345 -0
- openajar/policy/store.py +67 -0
- openajar/policy/taint.py +288 -0
- openajar/policy/telegram.py +884 -0
- openajar/policy/tokens.py +410 -0
- openajar/policy/tools.py +158 -0
- openajar/policy/trace_chain.py +297 -0
- openajar/policy/trace_models.py +85 -0
- openajar/policy/trace_writes.py +393 -0
- openajar/policy/traces.py +473 -0
- openajar/policy/util.py +120 -0
- openajar/policy/wrap.py +259 -0
- openajar/profiles/__init__.py +1 -0
- openajar/profiles/cli.py +229 -0
- openajar/profiles/context.py +270 -0
- openajar/profiles/errors.py +26 -0
- openajar/profiles/fields.py +52 -0
- openajar/profiles/learn.py +615 -0
- openajar/profiles/learner.py +396 -0
- openajar/profiles/mapping.py +193 -0
- openajar/profiles/migrations.py +108 -0
- openajar/profiles/models.py +490 -0
- openajar/profiles/screen.py +61 -0
- openajar/profiles/sections.py +693 -0
- openajar/profiles/service.py +554 -0
- openajar/profiles/store.py +269 -0
- openajar/profiles/sync.py +171 -0
- openajar/profiles/tools.py +367 -0
- openajar/py.typed +0 -0
- openajar/qr.py +304 -0
- openajar/runas.py +1043 -0
- openajar/runner/README.md +202 -0
- openajar/runner/__init__.py +9 -0
- openajar/runner/api.py +249 -0
- openajar/runner/approvals.py +349 -0
- openajar/runner/cli.py +462 -0
- openajar/runner/connector_steps.py +362 -0
- openajar/runner/connectors/__init__.py +22 -0
- openajar/runner/connectors/api.py +93 -0
- openajar/runner/connectors/cli.py +396 -0
- openajar/runner/connectors/compile.py +426 -0
- openajar/runner/connectors/health.py +223 -0
- openajar/runner/connectors/lint.py +457 -0
- openajar/runner/connectors/marks.py +174 -0
- openajar/runner/connectors/models.py +563 -0
- openajar/runner/connectors/outputs.py +116 -0
- openajar/runner/connectors/pace.py +81 -0
- openajar/runner/connectors/service.py +284 -0
- openajar/runner/connectors/signing.py +136 -0
- openajar/runner/connectors/steps.py +347 -0
- openajar/runner/connectors/surfaces.py +349 -0
- openajar/runner/connectors/taint.py +75 -0
- openajar/runner/connectors/tools.py +331 -0
- openajar/runner/connectors/verify.py +109 -0
- openajar/runner/dispatch.py +367 -0
- openajar/runner/execution.py +323 -0
- openajar/runner/executor.py +701 -0
- openajar/runner/fakes.py +715 -0
- openajar/runner/flowcli.py +333 -0
- openajar/runner/flowdoc.py +362 -0
- openajar/runner/flowfiles.py +262 -0
- openajar/runner/flows.py +437 -0
- openajar/runner/flowsync.py +227 -0
- openajar/runner/flowtest.py +501 -0
- openajar/runner/gate.py +219 -0
- openajar/runner/mail/__init__.py +16 -0
- openajar/runner/mail/api.py +290 -0
- openajar/runner/mail/cli.py +165 -0
- openajar/runner/mail/connect.py +346 -0
- openajar/runner/mail/cursor.py +163 -0
- openajar/runner/mail/discovery.py +413 -0
- openajar/runner/mail/form.py +181 -0
- openajar/runner/mail/message.py +263 -0
- openajar/runner/mail/net.py +181 -0
- openajar/runner/mail/outbox.py +142 -0
- openajar/runner/mail/providers.py +82 -0
- openajar/runner/mail/session.py +496 -0
- openajar/runner/mail/tools.py +220 -0
- openajar/runner/mail/wire.py +130 -0
- openajar/runner/memory_summary.py +107 -0
- openajar/runner/migrations.py +9 -0
- openajar/runner/models.py +91 -0
- openajar/runner/names.py +28 -0
- openajar/runner/owner.py +52 -0
- openajar/runner/proof.py +199 -0
- openajar/runner/readvalues.py +247 -0
- openajar/runner/recorder.py +341 -0
- openajar/runner/records.py +192 -0
- openajar/runner/run_rules.py +96 -0
- openajar/runner/runner.py +453 -0
- openajar/runner/schedules.py +945 -0
- openajar/runner/service.py +97 -0
- openajar/runner/signed_out.py +106 -0
- openajar/runner/siteapis/__init__.py +14 -0
- openajar/runner/siteapis/api.py +180 -0
- openajar/runner/siteapis/cache.py +213 -0
- openajar/runner/siteapis/cli.py +258 -0
- openajar/runner/siteapis/discover.py +787 -0
- openajar/runner/siteapis/http.py +863 -0
- openajar/runner/siteapis/http_cli.py +115 -0
- openajar/runner/siteapis/http_migrations.py +87 -0
- openajar/runner/siteapis/http_store.py +158 -0
- openajar/runner/siteapis/keys.py +472 -0
- openajar/runner/siteapis/migrations.py +33 -0
- openajar/runner/siteapis/models.py +432 -0
- openajar/runner/siteapis/openapi.py +270 -0
- openajar/runner/siteapis/problems.py +170 -0
- openajar/runner/siteapis/service.py +990 -0
- openajar/runner/siteapis/store.py +77 -0
- openajar/runner/siteapis/tools.py +161 -0
- openajar/runner/siteapis/usage.py +117 -0
- openajar/runner/steps.py +551 -0
- openajar/runner/store.py +457 -0
- openajar/runner/submit.py +289 -0
- openajar/runner/tools.py +579 -0
- openajar/runner/urlpattern.py +91 -0
- openajar/runner/util.py +193 -0
- openajar/runner/workflows/__init__.py +8 -0
- openajar/runner/workflows/addresses.py +52 -0
- openajar/runner/workflows/check.py +579 -0
- openajar/runner/workflows/cli.py +205 -0
- openajar/runner/workflows/engine.py +923 -0
- openajar/runner/workflows/leads.py +347 -0
- openajar/runner/workflows/mail.py +615 -0
- openajar/runner/workflows/mirror.py +72 -0
- openajar/runner/workflows/models.py +220 -0
- openajar/runner/workflows/replies.py +72 -0
- openajar/runner/workflows/sends.py +205 -0
- openajar/runner/workflows/service.py +812 -0
- openajar/runner/workflows/sitechange.py +429 -0
- openajar/runner/workflows/store.py +454 -0
- openajar/runner/workflows/templates.py +133 -0
- openajar/runner/workflows/tools.py +198 -0
- openajar/runner/workflows/views.py +345 -0
- openajar/setup/__init__.py +1 -0
- openajar/setup/cli.py +191 -0
- openajar/setup/morph.py +64 -0
- openajar/setup/steps.py +875 -0
- openajar/setup/web_cli.py +111 -0
- openajar/setup/webapp.py +259 -0
- openajar/setup/webstep.py +114 -0
- openajar/stealth/__init__.py +10 -0
- openajar/stealth/health.py +608 -0
- openajar/stealth/lanecheck.py +793 -0
- openajar/stealth/lanecookies.py +124 -0
- openajar/stealth/lanefacts.py +131 -0
- openajar/stealth/lanereport.py +139 -0
- openajar/stealth/lanerules.py +293 -0
- openajar/stealth/redteam/__init__.py +9 -0
- openajar/stealth/redteam/detectors.py +902 -0
- openajar/stealth/redteam/engine.py +100 -0
- openajar/stealth/redteam/gauntlet.py +383 -0
- openajar/stealth/redteam/runner.py +429 -0
- openajar/stealth/redteam/scenario.py +91 -0
- openajar/stealth/redteam/server.py +211 -0
- openajar/stealth/redteam/site/deep.html +166 -0
- openajar/stealth/redteam/site/feed.html +33 -0
- openajar/stealth/redteam/site/index.html +24 -0
- openajar/stealth/redteam/site/input.html +31 -0
- openajar/stealth/redteam/site/judges.html +21 -0
- openajar/stealth/redteam/site/sensor.js +152 -0
- openajar/stealth/redteam/site/signup.html +32 -0
- openajar/stealth/redteam/site/style.css +12 -0
- openajar/stealth/redteam/site/vendor/BOTD-LICENSE +21 -0
- openajar/stealth/redteam/site/vendor/botd.esm.js +811 -0
- openajar/stealth/redteam/stats.py +84 -0
- openajar/stealth/stealth.py +829 -0
- openajar/stealth/stealth_probe.html +348 -0
- openajar/stealth/stealthcheck.py +890 -0
- openajar/stealth/tools.py +63 -0
- openajar/studio/__init__.py +1 -0
- openajar/studio/browser/__init__.py +26 -0
- openajar/studio/browser/devices.py +87 -0
- openajar/studio/browser/engines.py +268 -0
- openajar/studio/browser/environment.py +57 -0
- openajar/studio/browser/errors.py +64 -0
- openajar/studio/browser/pool.py +657 -0
- openajar/studio/browser/service.py +61 -0
- openajar/studio/browser/settle.py +287 -0
- openajar/studio/browser/status.py +66 -0
- openajar/studio/capture/__init__.py +8 -0
- openajar/studio/capture/capture.py +89 -0
- openajar/studio/capture/manifest.py +228 -0
- openajar/studio/capture/screens.py +37 -0
- openajar/studio/checks/__init__.py +13 -0
- openajar/studio/checks/color.py +80 -0
- openajar/studio/checks/common.js +147 -0
- openajar/studio/checks/merge.py +94 -0
- openajar/studio/checks/page.js +1159 -0
- openajar/studio/checks/perf.js +154 -0
- openajar/studio/checks/pixels.js +113 -0
- openajar/studio/checks/registry.py +62 -0
- openajar/studio/checks/run.py +903 -0
- openajar/studio/checks/scripts.py +14 -0
- openajar/studio/checks/theme.js +147 -0
- openajar/studio/checks/theme.py +70 -0
- openajar/studio/cli.py +69 -0
- openajar/studio/contracts.py +349 -0
- openajar/studio/diff/__init__.py +13 -0
- openajar/studio/diff/diff.py +353 -0
- openajar/studio/diff/pixels.py +184 -0
- openajar/studio/diff/structure.py +479 -0
- openajar/studio/diff/words.py +228 -0
- openajar/studio/learn/__init__.py +15 -0
- openajar/studio/learn/cluster.py +241 -0
- openajar/studio/learn/draft.py +618 -0
- openajar/studio/learn/learn.py +205 -0
- openajar/studio/learn/read.py +272 -0
- openajar/studio/learn/tool.py +91 -0
- openajar/studio/local_cli.py +225 -0
- openajar/studio/migrations.py +5 -0
- openajar/studio/review.py +354 -0
- openajar/studio/runs.py +125 -0
- openajar/studio/shaping.py +335 -0
- openajar/studio/store/__init__.py +16 -0
- openajar/studio/store/migrations.py +54 -0
- openajar/studio/store/models.py +40 -0
- openajar/studio/store/store.py +406 -0
- openajar/studio/tokens/__init__.py +32 -0
- openajar/studio/tokens/check.py +535 -0
- openajar/studio/tokens/color.py +370 -0
- openajar/studio/tokens/export.py +128 -0
- openajar/studio/tokens/load.py +731 -0
- openajar/studio/tokens/match.py +324 -0
- openajar/studio/tokens/page.py +75 -0
- openajar/studio/tokens/page_js.py +512 -0
- openajar/studio/tokens/probe.py +336 -0
- openajar/studio/tokens/units.py +264 -0
- openajar/studio/tool_inputs.py +242 -0
- openajar/studio/tools.py +861 -0
- openajar/textreview/README.md +141 -0
- openajar/textreview/__init__.py +5 -0
- openajar/textreview/brain.py +99 -0
- openajar/textreview/bundle.py +157 -0
- openajar/textreview/cli.py +190 -0
- openajar/textreview/current.py +100 -0
- openajar/textreview/evidence.py +420 -0
- openajar/textreview/prompt.py +158 -0
- openajar/textreview/review.py +190 -0
- openajar/textreview/service.py +178 -0
- openajar/textreview/settings.py +63 -0
- openajar/textreview/validate.py +137 -0
- openajar/tui/__init__.py +10 -0
- openajar/tui/activity.py +169 -0
- openajar/tui/app.py +642 -0
- openajar/tui/brains.py +122 -0
- openajar/tui/cli.py +86 -0
- openajar/tui/client.py +358 -0
- openajar/tui/connect.py +124 -0
- openajar/tui/dash.tcss +252 -0
- openajar/tui/envs.py +109 -0
- openajar/tui/fmt.py +322 -0
- openajar/tui/lane.py +200 -0
- openajar/tui/modals.py +455 -0
- openajar/tui/models.py +344 -0
- openajar/tui/needs.py +302 -0
- openajar/tui/overview.py +269 -0
- openajar/tui/runs.py +188 -0
- openajar/tui/state.py +590 -0
- openajar/tui/sync.py +252 -0
- openajar/tui/views.py +195 -0
- openajar/tui/widgets.py +204 -0
- openajar/vault/__init__.py +11 -0
- openajar/vault/api.py +139 -0
- openajar/vault/catcher.py +296 -0
- openajar/vault/cli.py +478 -0
- openajar/vault/control.py +111 -0
- openajar/vault/crypto.py +213 -0
- openajar/vault/domains.py +210 -0
- openajar/vault/errors.py +135 -0
- openajar/vault/importers.py +313 -0
- openajar/vault/login.py +376 -0
- openajar/vault/models.py +343 -0
- openajar/vault/policy.py +365 -0
- openajar/vault/relay.py +286 -0
- openajar/vault/secret.py +57 -0
- openajar/vault/service.py +740 -0
- openajar/vault/steps.py +385 -0
- openajar/vault/store.py +606 -0
- openajar/vault/totp.py +107 -0
- openajar/vault/typist.py +88 -0
- openajar/vms/__init__.py +1 -0
- openajar/vms/capacity.py +234 -0
- openajar/vms/cli.py +268 -0
- openajar/vms/docker.py +416 -0
- openajar/vms/following.py +152 -0
- openajar/vms/hetzner.py +342 -0
- openajar/vms/keys.py +105 -0
- openajar/vms/manager.py +996 -0
- openajar/vms/models.py +204 -0
- openajar/vms/morph.py +429 -0
- openajar/vms/netwall.py +87 -0
- openajar/vms/pausing.py +195 -0
- openajar/vms/provider.py +320 -0
- openajar/vms/providers.py +45 -0
- openajar/vms/repos.py +289 -0
- openajar/vms/service.py +18 -0
- openajar/vms/ssh.py +377 -0
- openajar/vms/store.py +67 -0
- openajar/vms/tools.py +174 -0
- openajar/webbotauth/__init__.py +17 -0
- openajar/webbotauth/base.py +257 -0
- openajar/webbotauth/cli.py +287 -0
- openajar/webbotauth/keys.py +161 -0
- openajar/webbotauth/route.py +421 -0
- openajar/webbotauth/settings.py +205 -0
- openajar/webbotauth/sf.py +208 -0
- openajar/webbotauth/trace.py +64 -0
- openajar/webbotauth/verify.py +160 -0
- openajar/webhooks/__init__.py +5 -0
- openajar/webhooks/outbound.py +192 -0
- openajar/webhooks/service.py +363 -0
- openajar/webhooks/store.py +180 -0
- openajar/workspaces/__init__.py +8 -0
- openajar/workspaces/api.py +317 -0
- openajar/workspaces/cli.py +592 -0
- openajar/workspaces/errors.py +11 -0
- openajar/workspaces/form.py +148 -0
- openajar/workspaces/models.py +253 -0
- openajar/workspaces/planner.py +87 -0
- openajar/workspaces/rules.py +44 -0
- openajar/workspaces/service.py +576 -0
- openajar/workspaces/store.py +177 -0
- openajar/workspaces/templates.py +232 -0
- openajar/workspaces/tools.py +165 -0
- openajar/workspaces/transfer/__init__.py +7 -0
- openajar/workspaces/transfer/export.py +626 -0
- openajar/workspaces/transfer/format.py +85 -0
- openajar/workspaces/transfer/import_.py +925 -0
- openajar/workspaces/transfer/read.py +345 -0
- openajar/workspaces/transfer/sources.py +134 -0
- openajar-0.7.0.dist-info/METADATA +733 -0
- openajar-0.7.0.dist-info/RECORD +1116 -0
- openajar-0.7.0.dist-info/WHEEL +4 -0
- openajar-0.7.0.dist-info/entry_points.txt +3 -0
- openajar-0.7.0.dist-info/licenses/LICENSE +201 -0
- openajar-0.7.0.dist-info/licenses/NOTICE +7 -0
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
"""The two tunnels of an environment, carried by one ssh connection from the node to its VM:
|
|
2
|
+
|
|
3
|
+
- `-D <socket>` on the node: a SOCKS proxy whose connections leave from the VM, on a Unix socket in
|
|
4
|
+
a folder only the node's user can open. The environment's browser lane and studio's review
|
|
5
|
+
browser use it, with DNS through the tunnel and localhost not bypassed, so http://localhost:3000
|
|
6
|
+
in that browser is port 3000 on the VM.
|
|
7
|
+
- `-R 127.0.0.1:3129:127.0.0.1:<gateway port>` on the VM: the git gateway's listener for this VM
|
|
8
|
+
alone (openajar.git.service.vm_listener), so git on the VM clones and pushes the environment's
|
|
9
|
+
repository through the node (the credential never reaches the VM; its token works only here).
|
|
10
|
+
|
|
11
|
+
With the browser on the machine (environments.toml browser = "vm", openajar.environments.vmbrowser) the
|
|
12
|
+
same connection carries three more, each from a Unix socket in that folder:
|
|
13
|
+
|
|
14
|
+
- `-L <folder>/vnc:/run/agentos-browser/vnc.sock`: the machine's VNC server, for the live view (the node's
|
|
15
|
+
viewer relay opens it as it opens a local display's socket);
|
|
16
|
+
- `-L <folder>/browser:127.0.0.1:47613`: the browser server on the machine's loopback, which the node
|
|
17
|
+
drives with Playwright through a guard like the SOCKS one (`browser_port`);
|
|
18
|
+
- `-L <folder>/desk:/run/agentos-browser/desk.sock`: the desktop's helper (desktop/desk.py), which shows
|
|
19
|
+
the agent's commands in a terminal window and brings the window the agent uses to the front. Only the
|
|
20
|
+
node opens it (`desk_path`); nothing on this computer listens on TCP for it.
|
|
21
|
+
|
|
22
|
+
An environment with a closed network or app secrets (openajar.environments.networking) gets a third
|
|
23
|
+
connection with the node's ports for it, `-R 127.0.0.1:3130:...` (the allowlist proxy) and
|
|
24
|
+
`-R 127.0.0.1:3131:...` (the secret swap), so the machine's package downloads never wait behind the
|
|
25
|
+
browser or a push (`net_forwards`, set before `start`).
|
|
26
|
+
|
|
27
|
+
Browsers speak SOCKS over TCP only, so the node relays 127.0.0.1:<port> to that socket (`Guard`).
|
|
28
|
+
Who may use the port:
|
|
29
|
+
|
|
30
|
+
- Not a machine. Its own firewall refuses this computer's addresses (the docker provider), and a
|
|
31
|
+
cloud VM reaches the node only through this ssh connection.
|
|
32
|
+
- Not another user of this computer, on Linux: the guard looks up who opened each connection (the
|
|
33
|
+
socket's owner in /proc/net/tcp) and closes any that is not the node's own user. macOS has no
|
|
34
|
+
such lookup for TCP, so there another account on the same Mac could use the port.
|
|
35
|
+
|
|
36
|
+
The connection uses the VM's own key and pinned host key (openajar.vms.ssh), and forwards nothing
|
|
37
|
+
else: no agent, no X11, no other port. If it drops, the node starts it again (openajar.environments.relink):
|
|
38
|
+
the dead tunnel is stopped first, so its guards give up their ports and its folder its sockets, and the new
|
|
39
|
+
one takes the same ports. A `-R` the machine still holds for a session it has not seen end (this computer's
|
|
40
|
+
address changed, so the old connection never said goodbye, and sshd keeps it until TCP gives up, hours
|
|
41
|
+
later) fails the new connection; the node then ends the sshd sessions that listen on its own reverse ports
|
|
42
|
+
on the machine (`free_remote_command`) and tries once more.
|
|
43
|
+
"""
|
|
44
|
+
|
|
45
|
+
from __future__ import annotations
|
|
46
|
+
|
|
47
|
+
import asyncio
|
|
48
|
+
import contextlib
|
|
49
|
+
import logging
|
|
50
|
+
import os
|
|
51
|
+
import shutil
|
|
52
|
+
import socket
|
|
53
|
+
import sys
|
|
54
|
+
import tempfile
|
|
55
|
+
from collections.abc import Callable
|
|
56
|
+
from pathlib import Path
|
|
57
|
+
|
|
58
|
+
from openajar.env.models import RemoteHost
|
|
59
|
+
from openajar.vms.ssh import ssh_base
|
|
60
|
+
|
|
61
|
+
log = logging.getLogger("openajar.environments")
|
|
62
|
+
|
|
63
|
+
GATEWAY_PORT_ON_VM = 3129 # as inside an isolated lane (openajar.git.service.LANE_PORT)
|
|
64
|
+
VM_BROWSER_PORT = 47613 # the browser server on the machine's loopback (vmbrowser_ctl.py)
|
|
65
|
+
VM_VNC_SOCKET = "/run/agentos-browser/vnc.sock" # its VNC server (vmbrowser_ctl.py)
|
|
66
|
+
VM_DESK_SOCKET = "/run/agentos-browser/desk.sock" # its desktop's helper (desktop/desk.py), when the desktop runs
|
|
67
|
+
START_WAIT_S = 10.0
|
|
68
|
+
FREE_TIMEOUT_S = 20.0
|
|
69
|
+
REMOTE_TAKEN = "remote port forwarding failed" # ssh's words when the machine refused a -R (ExitOnForwardFailure)
|
|
70
|
+
RELAY_CHUNK = 65536
|
|
71
|
+
PROC_TCP = ("/proc/net/tcp", "/proc/net/tcp6")
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def free_port() -> int:
|
|
75
|
+
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
|
|
76
|
+
s.bind(("127.0.0.1", 0))
|
|
77
|
+
return int(s.getsockname()[1])
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def tunnel_argv(remote: RemoteHost, *, socks_path: str, gateway_port: int | None,
|
|
81
|
+
forwards: tuple[tuple[str, str], ...] = ()) -> list[str]:
|
|
82
|
+
"""ssh_base with forwarding allowed for exactly these (and each `-L local:remote` of `forwards`), and
|
|
83
|
+
no remote command."""
|
|
84
|
+
base = ssh_base(remote)
|
|
85
|
+
i = base.index("ClearAllForwardings=yes")
|
|
86
|
+
base = base[: i - 1] + base[i + 1:] # drop "-o ClearAllForwardings=yes"
|
|
87
|
+
target = base[-2:] # "-T", "user@host"
|
|
88
|
+
out = base[:-2] + ["-o", "ExitOnForwardFailure=yes", "-o", "StreamLocalBindUnlink=yes",
|
|
89
|
+
"-o", "StreamLocalBindMask=0177", "-N", "-D", socks_path]
|
|
90
|
+
if gateway_port:
|
|
91
|
+
out += ["-R", f"127.0.0.1:{GATEWAY_PORT_ON_VM}:127.0.0.1:{gateway_port}"]
|
|
92
|
+
for local, remote_end in forwards:
|
|
93
|
+
out += ["-L", f"{local}:{remote_end}"]
|
|
94
|
+
return out + target
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def git_tunnel_argv(remote: RemoteHost, *, gateway_port: int) -> list[str]:
|
|
98
|
+
"""The git gateway's `-R` alone, on an ssh connection of its own. On one connection with the browser
|
|
99
|
+
and its live view, a push from the VM waited behind a stuck browser's traffic (the 2026-11-15
|
|
100
|
+
test: a push took 123 s and a branch delete 107 s, both while the browser on the machine hung)."""
|
|
101
|
+
base = ssh_base(remote)
|
|
102
|
+
i = base.index("ClearAllForwardings=yes")
|
|
103
|
+
base = base[: i - 1] + base[i + 1:]
|
|
104
|
+
return base[:-2] + ["-o", "ExitOnForwardFailure=yes", "-N",
|
|
105
|
+
"-R", f"127.0.0.1:{GATEWAY_PORT_ON_VM}:127.0.0.1:{gateway_port}"] + base[-2:]
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def net_tunnel_argv(remote: RemoteHost, forwards: tuple[tuple[int, int], ...]) -> list[str]:
|
|
109
|
+
"""The network's `-R` forwards (port on the machine, port on this computer), on a connection of their own."""
|
|
110
|
+
base = ssh_base(remote)
|
|
111
|
+
i = base.index("ClearAllForwardings=yes")
|
|
112
|
+
base = base[: i - 1] + base[i + 1:]
|
|
113
|
+
out = base[:-2] + ["-o", "ExitOnForwardFailure=yes", "-N"]
|
|
114
|
+
for on_vm, here in forwards:
|
|
115
|
+
out += ["-R", f"127.0.0.1:{int(on_vm)}:127.0.0.1:{int(here)}"]
|
|
116
|
+
return out + base[-2:]
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
def free_remote_command(ports: tuple[int, ...]) -> str:
|
|
120
|
+
"""The command that ends the sshd sessions on the machine that listen on these loopback ports (the node's own
|
|
121
|
+
reverse ports: 3129 to 3132), so a new tunnel can take them. Only sshd's processes: a program of the agent's
|
|
122
|
+
that listens there is left alone, and the new -R then says so."""
|
|
123
|
+
which = " or ".join(f"sport = :{int(p)}" for p in sorted(set(ports)))
|
|
124
|
+
return (f"ss -Htlnp '( {which} )' | grep -oE '\"sshd(-session)?\",pid=[0-9]+' | grep -oE '[0-9]+$' "
|
|
125
|
+
"| sort -u | xargs -r kill")
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
class _RemoteTaken(OSError):
|
|
129
|
+
"""The machine refused one of the tunnel's -R forwards: something there listens on its port already."""
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
# ---------------------------------------------------------------- who opened a connection
|
|
133
|
+
|
|
134
|
+
def _hex_port(addr: str) -> int:
|
|
135
|
+
return int(addr.rsplit(":", 1)[1], 16)
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
def tcp_owner(table: str, *, local_port: int, remote_port: int) -> int | None:
|
|
139
|
+
"""The uid that owns the loopback TCP socket local_port -> remote_port, from the text of
|
|
140
|
+
/proc/net/tcp (or tcp6), else None. The client's side of a connection to our listener has
|
|
141
|
+
local = the peer's port and remote = our port."""
|
|
142
|
+
for line in table.splitlines()[1:]:
|
|
143
|
+
parts = line.split()
|
|
144
|
+
if len(parts) < 8:
|
|
145
|
+
continue
|
|
146
|
+
try:
|
|
147
|
+
if _hex_port(parts[1]) == local_port and _hex_port(parts[2]) == remote_port:
|
|
148
|
+
return int(parts[7])
|
|
149
|
+
except ValueError:
|
|
150
|
+
continue
|
|
151
|
+
return None
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
def peer_is_us(peer_port: int, our_port: int) -> bool:
|
|
155
|
+
"""Linux: is the other end of this loopback connection a socket of this process's user? Other
|
|
156
|
+
systems: no way to tell for TCP, so yes (see the module's docstring)."""
|
|
157
|
+
if not sys.platform.startswith("linux"):
|
|
158
|
+
return True
|
|
159
|
+
for path in PROC_TCP:
|
|
160
|
+
try:
|
|
161
|
+
text = Path(path).read_text()
|
|
162
|
+
except OSError:
|
|
163
|
+
continue
|
|
164
|
+
uid = tcp_owner(text, local_port=peer_port, remote_port=our_port)
|
|
165
|
+
if uid is not None:
|
|
166
|
+
return uid == os.getuid()
|
|
167
|
+
return False
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
class Guard:
|
|
171
|
+
"""127.0.0.1:<port> relayed to a Unix socket, for this computer's user only (`allow`)."""
|
|
172
|
+
|
|
173
|
+
def __init__(self, port: int, target: str, *, allow: Callable[[int, int], bool] = peer_is_us):
|
|
174
|
+
self.port = port
|
|
175
|
+
self.target = target
|
|
176
|
+
self.allow = allow
|
|
177
|
+
self.server: asyncio.Server | None = None
|
|
178
|
+
self.refused = 0
|
|
179
|
+
|
|
180
|
+
@property
|
|
181
|
+
def serving(self) -> bool:
|
|
182
|
+
return self.server is not None and self.server.is_serving()
|
|
183
|
+
|
|
184
|
+
async def start(self) -> None:
|
|
185
|
+
self.server = await asyncio.start_server(self._client, "127.0.0.1", self.port)
|
|
186
|
+
|
|
187
|
+
async def stop(self) -> None:
|
|
188
|
+
server, self.server = self.server, None
|
|
189
|
+
if server is not None:
|
|
190
|
+
server.close()
|
|
191
|
+
with contextlib.suppress(Exception):
|
|
192
|
+
await asyncio.wait_for(server.wait_closed(), timeout=2)
|
|
193
|
+
|
|
194
|
+
async def _client(self, reader: asyncio.StreamReader, writer: asyncio.StreamWriter) -> None:
|
|
195
|
+
peer = writer.get_extra_info("peername") or ("", 0)
|
|
196
|
+
if not self.allow(int(peer[1]), self.port):
|
|
197
|
+
self.refused += 1
|
|
198
|
+
log.warning("environment tunnel on port %s: refused a connection from another user", self.port)
|
|
199
|
+
writer.close()
|
|
200
|
+
return
|
|
201
|
+
try:
|
|
202
|
+
up_r, up_w = await asyncio.open_unix_connection(self.target)
|
|
203
|
+
except OSError:
|
|
204
|
+
writer.close()
|
|
205
|
+
return
|
|
206
|
+
try:
|
|
207
|
+
await asyncio.gather(_pipe(reader, up_w), _pipe(up_r, writer))
|
|
208
|
+
finally:
|
|
209
|
+
for w in (up_w, writer):
|
|
210
|
+
w.close()
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
async def _pipe(reader: asyncio.StreamReader, writer: asyncio.StreamWriter) -> None:
|
|
214
|
+
try:
|
|
215
|
+
while data := await reader.read(RELAY_CHUNK):
|
|
216
|
+
writer.write(data)
|
|
217
|
+
await writer.drain()
|
|
218
|
+
except (OSError, asyncio.IncompleteReadError):
|
|
219
|
+
pass
|
|
220
|
+
finally:
|
|
221
|
+
with contextlib.suppress(OSError, RuntimeError):
|
|
222
|
+
if writer.can_write_eof():
|
|
223
|
+
writer.write_eof()
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
async def _answers(path: str) -> bool:
|
|
227
|
+
try:
|
|
228
|
+
_, w = await asyncio.wait_for(asyncio.open_unix_connection(path), timeout=1.0)
|
|
229
|
+
except (OSError, TimeoutError):
|
|
230
|
+
return False
|
|
231
|
+
w.close()
|
|
232
|
+
with contextlib.suppress(Exception):
|
|
233
|
+
await w.wait_closed()
|
|
234
|
+
return True
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
class Tunnel:
|
|
238
|
+
"""One ssh process for SOCKS (and a "vm" browser's three forwards), another for the git gateway's
|
|
239
|
+
`-R`, and the guard in front of the SOCKS socket. `start` returns once the SOCKS port answers."""
|
|
240
|
+
|
|
241
|
+
def __init__(self, remote: RemoteHost, *, gateway_port: int | None, socks_port: int | None = None,
|
|
242
|
+
vm_browser: bool = False, browser_port: int | None = None, split_git: bool = True):
|
|
243
|
+
self.remote = remote
|
|
244
|
+
self.gateway_port = gateway_port
|
|
245
|
+
self.socks_port = socks_port or free_port()
|
|
246
|
+
# the browser on the machine (vm_browser): its live view and its server, forwarded too
|
|
247
|
+
self.vm_browser = vm_browser
|
|
248
|
+
self.browser_port = (browser_port or free_port()) if vm_browser else None
|
|
249
|
+
self.proc: asyncio.subprocess.Process | None = None
|
|
250
|
+
self.git_proc: asyncio.subprocess.Process | None = None # the gateway's -R, on its own connection
|
|
251
|
+
self.net_forwards: tuple[tuple[int, int], ...] = () # the network's -R (openajar.environments.networking)
|
|
252
|
+
self.net_proc: asyncio.subprocess.Process | None = None
|
|
253
|
+
self.split_git = split_git
|
|
254
|
+
self.guard: Guard | None = None
|
|
255
|
+
self.browser_guard: Guard | None = None
|
|
256
|
+
self.dir: str | None = None
|
|
257
|
+
self.last_error = ""
|
|
258
|
+
# called once when one of its ssh processes exits by itself (the link dropped), not on stop()
|
|
259
|
+
self.on_exit: Callable[[], None] | None = None
|
|
260
|
+
self._watch: asyncio.Task | None = None
|
|
261
|
+
# a -R the machine refused after start() returned (its -D answered first): the next tunnel frees it first
|
|
262
|
+
self.remote_taken = False
|
|
263
|
+
self.free_first = False
|
|
264
|
+
|
|
265
|
+
@property
|
|
266
|
+
def alive(self) -> bool:
|
|
267
|
+
up = self.proc is not None and self.proc.returncode is None and self.guard is not None and self.guard.serving
|
|
268
|
+
git = not self._git_apart() or (self.git_proc is not None and self.git_proc.returncode is None)
|
|
269
|
+
net = not self.net_forwards or (self.net_proc is not None and self.net_proc.returncode is None)
|
|
270
|
+
return up and git and net and (not self.vm_browser or (self.browser_guard is not None and self.browser_guard.serving))
|
|
271
|
+
|
|
272
|
+
def _git_apart(self) -> bool:
|
|
273
|
+
return bool(self.gateway_port) and self.split_git
|
|
274
|
+
|
|
275
|
+
@property
|
|
276
|
+
def socks_path(self) -> str | None:
|
|
277
|
+
"""The SOCKS proxy's Unix socket on this computer (openajar.environments.ports forwards through it)."""
|
|
278
|
+
return os.path.join(self.dir, "socks") if self.dir else None
|
|
279
|
+
|
|
280
|
+
@property
|
|
281
|
+
def desk_path(self) -> str | None:
|
|
282
|
+
"""The machine's desktop helper (desk.sock), as a Unix socket on this computer (vm_browser only)."""
|
|
283
|
+
return os.path.join(self.dir, "desk") if self.vm_browser and self.dir else None
|
|
284
|
+
|
|
285
|
+
@property
|
|
286
|
+
def vnc_path(self) -> str | None:
|
|
287
|
+
"""The machine's x11vnc, as a Unix socket on this computer (vm_browser only)."""
|
|
288
|
+
return os.path.join(self.dir, "vnc") if self.vm_browser and self.dir else None
|
|
289
|
+
|
|
290
|
+
def _forwards(self) -> tuple[tuple[str, str], ...]:
|
|
291
|
+
if not self.vm_browser or not self.dir:
|
|
292
|
+
return ()
|
|
293
|
+
return ((os.path.join(self.dir, "vnc"), VM_VNC_SOCKET),
|
|
294
|
+
(os.path.join(self.dir, "browser"), f"127.0.0.1:{VM_BROWSER_PORT}"),
|
|
295
|
+
(os.path.join(self.dir, "desk"), VM_DESK_SOCKET))
|
|
296
|
+
|
|
297
|
+
def _remote_ports(self) -> tuple[int, ...]:
|
|
298
|
+
return ((GATEWAY_PORT_ON_VM,) if self.gateway_port else ()) + tuple(on_vm for on_vm, _ in self.net_forwards)
|
|
299
|
+
|
|
300
|
+
async def start(self) -> None:
|
|
301
|
+
if self.alive:
|
|
302
|
+
return
|
|
303
|
+
if self.free_first:
|
|
304
|
+
await self._free_remote()
|
|
305
|
+
try:
|
|
306
|
+
await self._start_once()
|
|
307
|
+
except _RemoteTaken as e:
|
|
308
|
+
log.info("the tunnel to %s: the machine still holds a reverse port of an earlier connection (%s); "
|
|
309
|
+
"ending that session there and trying again", self.remote.host_alias, e)
|
|
310
|
+
await self._free_remote()
|
|
311
|
+
await self._start_once()
|
|
312
|
+
|
|
313
|
+
async def _free_remote(self) -> None:
|
|
314
|
+
ports = self._remote_ports()
|
|
315
|
+
if not ports:
|
|
316
|
+
return
|
|
317
|
+
proc = await self._ssh([*ssh_base(self.remote), free_remote_command(ports)])
|
|
318
|
+
try:
|
|
319
|
+
await asyncio.wait_for(proc.wait(), FREE_TIMEOUT_S)
|
|
320
|
+
except TimeoutError:
|
|
321
|
+
with contextlib.suppress(ProcessLookupError):
|
|
322
|
+
proc.kill()
|
|
323
|
+
await proc.wait()
|
|
324
|
+
|
|
325
|
+
async def _start_once(self) -> None:
|
|
326
|
+
await self.stop()
|
|
327
|
+
# a short path (a Unix socket's is at most 104 bytes on macOS), in a folder only we can open
|
|
328
|
+
self.dir = tempfile.mkdtemp(prefix="agentos-env-")
|
|
329
|
+
sock = os.path.join(self.dir, "socks")
|
|
330
|
+
argv = tunnel_argv(self.remote, socks_path=sock, gateway_port=None if self._git_apart() else self.gateway_port,
|
|
331
|
+
forwards=self._forwards())
|
|
332
|
+
self.proc = await self._ssh(argv)
|
|
333
|
+
if self._git_apart():
|
|
334
|
+
assert self.gateway_port is not None
|
|
335
|
+
self.git_proc = await self._ssh(git_tunnel_argv(self.remote, gateway_port=self.gateway_port))
|
|
336
|
+
if self.net_forwards:
|
|
337
|
+
self.net_proc = await self._ssh(net_tunnel_argv(self.remote, self.net_forwards))
|
|
338
|
+
loop = asyncio.get_running_loop()
|
|
339
|
+
deadline = loop.time() + START_WAIT_S
|
|
340
|
+
while loop.time() < deadline:
|
|
341
|
+
for proc in (self.proc, self.git_proc, self.net_proc):
|
|
342
|
+
if proc is not None and proc.returncode is not None:
|
|
343
|
+
err = (await proc.stderr.read()).decode(errors="replace").strip() if proc.stderr else ""
|
|
344
|
+
self.last_error = err[-300:] or f"ssh exited {proc.returncode}"
|
|
345
|
+
await self.stop()
|
|
346
|
+
kind = _RemoteTaken if REMOTE_TAKEN in err else OSError
|
|
347
|
+
raise kind(f"the tunnel to the environment's machine did not start: {self.last_error}")
|
|
348
|
+
if await _answers(sock):
|
|
349
|
+
self.guard = Guard(self.socks_port, sock)
|
|
350
|
+
if self.vm_browser and self.browser_port:
|
|
351
|
+
self.browser_guard = Guard(self.browser_port, os.path.join(self.dir, "browser"))
|
|
352
|
+
for guard in (self.guard, self.browser_guard):
|
|
353
|
+
if guard is None:
|
|
354
|
+
continue
|
|
355
|
+
try:
|
|
356
|
+
await guard.start()
|
|
357
|
+
except OSError as e:
|
|
358
|
+
await self.stop()
|
|
359
|
+
raise OSError(f"the tunnel's port {guard.port} on this computer is taken: {e}") from None
|
|
360
|
+
self._watch = asyncio.create_task(self._watch_exit(), name=f"tunnel-{self.remote.host_alias}")
|
|
361
|
+
return
|
|
362
|
+
await asyncio.sleep(0.2)
|
|
363
|
+
await self.stop()
|
|
364
|
+
raise OSError("the tunnel to the environment's machine did not answer within "
|
|
365
|
+
f"{START_WAIT_S:g} s")
|
|
366
|
+
|
|
367
|
+
async def _watch_exit(self) -> None:
|
|
368
|
+
"""Wait for any of its ssh processes to end; one that ends by itself is the link dropping (on_exit)."""
|
|
369
|
+
procs = [p for p in (self.proc, self.git_proc, self.net_proc) if p is not None]
|
|
370
|
+
waits = [asyncio.ensure_future(p.wait()) for p in procs]
|
|
371
|
+
try:
|
|
372
|
+
await asyncio.wait(waits, return_when=asyncio.FIRST_COMPLETED)
|
|
373
|
+
finally:
|
|
374
|
+
for w in waits:
|
|
375
|
+
w.cancel()
|
|
376
|
+
self._watch = None
|
|
377
|
+
for proc in procs:
|
|
378
|
+
if proc.returncode is not None and proc.stderr is not None:
|
|
379
|
+
with contextlib.suppress(Exception):
|
|
380
|
+
err = (await asyncio.wait_for(proc.stderr.read(), 2)).decode(errors="replace").strip()
|
|
381
|
+
self.last_error = err[-300:] or self.last_error
|
|
382
|
+
self.remote_taken = self.remote_taken or REMOTE_TAKEN in err
|
|
383
|
+
if self.on_exit is not None:
|
|
384
|
+
try:
|
|
385
|
+
self.on_exit()
|
|
386
|
+
except Exception:
|
|
387
|
+
log.exception("the tunnel's drop handler failed")
|
|
388
|
+
|
|
389
|
+
@staticmethod
|
|
390
|
+
async def _ssh(argv: list[str]) -> asyncio.subprocess.Process:
|
|
391
|
+
return await asyncio.create_subprocess_exec(
|
|
392
|
+
*argv, stdin=asyncio.subprocess.DEVNULL, stdout=asyncio.subprocess.DEVNULL,
|
|
393
|
+
stderr=asyncio.subprocess.PIPE, env={"PATH": "/usr/sbin:/usr/bin:/sbin:/bin", "LANG": "C.UTF-8"})
|
|
394
|
+
|
|
395
|
+
async def stop(self) -> None:
|
|
396
|
+
watch, self._watch = self._watch, None
|
|
397
|
+
if watch is not None and watch is not asyncio.current_task():
|
|
398
|
+
watch.cancel() # stopped on purpose: no drop to tell
|
|
399
|
+
for guard in (self.guard, self.browser_guard):
|
|
400
|
+
if guard is not None:
|
|
401
|
+
await guard.stop()
|
|
402
|
+
self.guard = self.browser_guard = None
|
|
403
|
+
procs = [p for p in (self.proc, self.git_proc, self.net_proc) if p is not None]
|
|
404
|
+
self.proc = self.git_proc = self.net_proc = None
|
|
405
|
+
for proc in procs:
|
|
406
|
+
if proc.returncode is not None:
|
|
407
|
+
continue
|
|
408
|
+
with contextlib.suppress(ProcessLookupError):
|
|
409
|
+
proc.terminate()
|
|
410
|
+
try:
|
|
411
|
+
await asyncio.wait_for(proc.wait(), timeout=5)
|
|
412
|
+
except TimeoutError:
|
|
413
|
+
with contextlib.suppress(ProcessLookupError):
|
|
414
|
+
proc.kill()
|
|
415
|
+
await proc.wait()
|
|
416
|
+
folder, self.dir = self.dir, None
|
|
417
|
+
if folder:
|
|
418
|
+
shutil.rmtree(folder, ignore_errors=True)
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"""Security updates of a keep "live" machine, at a quiet moment (a mixin of EnvironmentManager).
|
|
2
|
+
|
|
3
|
+
Environment machines never update on their own in a session (openajar.environments.machine.UPDATES_OFF
|
|
4
|
+
says why and what the policy is). A keep "live" machine lives for weeks, so the reaper looks after it:
|
|
5
|
+
when nobody used it for EnvSettings.upgrade_quiet_minutes and no job runs on it, the security updates
|
|
6
|
+
start there (machine.upgrade_script, at most once a day, in a session of their own, restarting nothing);
|
|
7
|
+
else it only asks how they stand. Either way the answer goes in the machine's notes (Machine.updates),
|
|
8
|
+
which environment() and the panel show: when they were applied, that they wait for a quiet moment, and
|
|
9
|
+
when a new kernel waits for a restart.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
from __future__ import annotations
|
|
13
|
+
|
|
14
|
+
import contextlib
|
|
15
|
+
import logging
|
|
16
|
+
from datetime import datetime, timedelta
|
|
17
|
+
|
|
18
|
+
from openajar.core.errors import OpenajarError
|
|
19
|
+
from openajar.environments import machine
|
|
20
|
+
from openajar.environments.models import Environment
|
|
21
|
+
|
|
22
|
+
log = logging.getLogger("openajar.environments")
|
|
23
|
+
|
|
24
|
+
ASK_EVERY = timedelta(minutes=60) # how often the reaper asks a live machine about its updates
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class Updates:
|
|
28
|
+
"""For EnvironmentManager (its _get, store, settings, _busy and _last_used)."""
|
|
29
|
+
|
|
30
|
+
async def quiet_upgrade(self, env: Environment, now: datetime) -> str | None:
|
|
31
|
+
"""For the reaper, on a ready keep "live" machine: start the security updates when it is quiet and
|
|
32
|
+
they are due, else ask how they stand; note the answer. Returns the note (None: not asked)."""
|
|
33
|
+
asked: dict[str, datetime] = self.__dict__.setdefault("_upgrades_asked", {})
|
|
34
|
+
if env.keep != "live" or env.state != "ready":
|
|
35
|
+
return None
|
|
36
|
+
last = asked.get(env.id)
|
|
37
|
+
if last is not None and now - last < ASK_EVERY:
|
|
38
|
+
return None
|
|
39
|
+
envs = self._get("envs")
|
|
40
|
+
if envs is None:
|
|
41
|
+
return None
|
|
42
|
+
asked[env.id] = now
|
|
43
|
+
quiet = (not self._busy(env)
|
|
44
|
+
and now - self._last_used(env) >= timedelta(minutes=self.settings.upgrade_quiet_minutes))
|
|
45
|
+
lane = env.terminal_lane
|
|
46
|
+
before = None
|
|
47
|
+
with contextlib.suppress(Exception):
|
|
48
|
+
before = envs.store.last_used(lane)
|
|
49
|
+
try:
|
|
50
|
+
from openajar.environments.activity import own
|
|
51
|
+
|
|
52
|
+
res = await envs.exec(lane, machine.upgrade_script(start=quiet), timeout_s=machine.UPGRADE_S, **own(envs))
|
|
53
|
+
except OpenajarError as e:
|
|
54
|
+
log.debug("environment %s: could not ask about its updates: %s", env.id, e)
|
|
55
|
+
return None
|
|
56
|
+
finally: # the node's own command is no use of the machine (sshaccess.ssh_seen does the same)
|
|
57
|
+
if before is not None:
|
|
58
|
+
with contextlib.suppress(Exception):
|
|
59
|
+
envs.store.touch(lane, at=before)
|
|
60
|
+
words = machine.updates_words(res.stdout or "", now)
|
|
61
|
+
if "upgrade: started" in (res.stdout or ""):
|
|
62
|
+
log.info("environment %s: security updates started at a quiet moment", env.id)
|
|
63
|
+
if words and words != env.machine.updates:
|
|
64
|
+
def noted(e: Environment) -> None:
|
|
65
|
+
e.machine.updates = words
|
|
66
|
+
|
|
67
|
+
with contextlib.suppress(Exception):
|
|
68
|
+
self.store.update(env.id, noted)
|
|
69
|
+
return words
|