letify 2.12.3__tar.gz → 2.12.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {letify-2.12.3 → letify-2.12.4}/PKG-INFO +1 -1
- {letify-2.12.3 → letify-2.12.4}/docs/SPEC.md +12 -2
- {letify-2.12.3 → letify-2.12.4}/letify/__init__.py +1 -1
- {letify-2.12.3 → letify-2.12.4}/letify/install.py +11 -4
- {letify-2.12.3 → letify-2.12.4}/letify/providers/colab.py +6 -3
- {letify-2.12.3 → letify-2.12.4}/letify/providers/colab_files.py +2 -1
- {letify-2.12.3 → letify-2.12.4}/letify/providers/elice.py +2 -0
- {letify-2.12.3 → letify-2.12.4}/letify/providers/kaggle.py +7 -2
- {letify-2.12.3 → letify-2.12.4}/letify/runtime/bootstrap.py +1 -7
- {letify-2.12.3 → letify-2.12.4}/letify/store/backends/drive.py +4 -3
- {letify-2.12.3 → letify-2.12.4}/letify/store/backends/google_auth.py +2 -0
- {letify-2.12.3 → letify-2.12.4}/letify/store/backends/objects.py +5 -1
- {letify-2.12.3 → letify-2.12.4}/letify/store/pathdata.py +2 -1
- {letify-2.12.3 → letify-2.12.4}/letify/transport/linksignal.py +2 -11
- {letify-2.12.3 → letify-2.12.4}/letify/transport/portmap.py +7 -3
- letify-2.12.4/letify/useragent.py +23 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/Cargo.lock +3 -3
- {letify-2.12.3 → letify-2.12.4}/letify-core/Cargo.toml +1 -1
- {letify-2.12.3 → letify-2.12.4}/letify-ext/package-lock.json +2 -2
- {letify-2.12.3 → letify-2.12.4}/letify-ext/package.json +1 -1
- {letify-2.12.3 → letify-2.12.4}/pyproject.toml +1 -1
- {letify-2.12.3 → letify-2.12.4}/tests/test_drive_store.py +2 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_kaggle.py +18 -0
- letify-2.12.4/tests/test_user_agent.py +170 -0
- {letify-2.12.3 → letify-2.12.4}/.github/workflows/ci.yml +0 -0
- {letify-2.12.3 → letify-2.12.4}/.github/workflows/docs.yml +0 -0
- {letify-2.12.3 → letify-2.12.4}/.github/workflows/letify-link.yml +0 -0
- {letify-2.12.3 → letify-2.12.4}/.github/workflows/publish-crates.yml +0 -0
- {letify-2.12.3 → letify-2.12.4}/.github/workflows/publish.yml +0 -0
- {letify-2.12.3 → letify-2.12.4}/.github/workflows/reserve-crates.yml +0 -0
- {letify-2.12.3 → letify-2.12.4}/.gitignore +0 -0
- {letify-2.12.3 → letify-2.12.4}/.researchtree +0 -0
- {letify-2.12.3 → letify-2.12.4}/CLAUDE.md +0 -0
- {letify-2.12.3 → letify-2.12.4}/LICENSE +0 -0
- {letify-2.12.3 → letify-2.12.4}/PROJECT.md +0 -0
- {letify-2.12.3 → letify-2.12.4}/README.md +0 -0
- {letify-2.12.3 → letify-2.12.4}/docs/COMPONENT.md +0 -0
- {letify-2.12.3 → letify-2.12.4}/docs/INTENT.md +0 -0
- {letify-2.12.3 → letify-2.12.4}/docs/NETWORK.md +0 -0
- {letify-2.12.3 → letify-2.12.4}/docs/ROADMAP-3.0.md +0 -0
- {letify-2.12.3 → letify-2.12.4}/docs/guide/01-getting-started.md +0 -0
- {letify-2.12.3 → letify-2.12.4}/docs/guide/02-providers.md +0 -0
- {letify-2.12.3 → letify-2.12.4}/docs/guide/03-execution-modes.md +0 -0
- {letify-2.12.3 → letify-2.12.4}/docs/guide/04-environments-and-data.md +0 -0
- {letify-2.12.3 → letify-2.12.4}/docs/guide/05-concurrency.md +0 -0
- {letify-2.12.3 → letify-2.12.4}/docs/guide/06-cost.md +0 -0
- {letify-2.12.3 → letify-2.12.4}/docs/guide/07-troubleshooting.md +0 -0
- {letify-2.12.3 → letify-2.12.4}/docs/guide/08-releasing.md +0 -0
- {letify-2.12.3 → letify-2.12.4}/docs/guide/09-agent.md +0 -0
- {letify-2.12.3 → letify-2.12.4}/docs/guide/README.md +0 -0
- {letify-2.12.3 → letify-2.12.4}/docs/guide/ko/01-/354/213/234/354/236/221/355/225/230/352/270/260.md" +0 -0
- {letify-2.12.3 → letify-2.12.4}/docs/guide/ko/02-/355/224/204/353/241/234/353/260/224/354/235/264/353/215/224.md" +0 -0
- {letify-2.12.3 → letify-2.12.4}/docs/guide/ko/03-/354/213/244/355/226/211-/353/260/251/354/213/235.md" +0 -0
- {letify-2.12.3 → letify-2.12.4}/docs/guide/ko/04-/355/231/230/352/262/275/352/263/274-/353/215/260/354/235/264/355/204/260.md" +0 -0
- {letify-2.12.3 → letify-2.12.4}/docs/guide/ko/05-/353/217/231/354/213/234-/354/213/244/355/226/211.md" +0 -0
- {letify-2.12.3 → letify-2.12.4}/docs/guide/ko/06-/353/271/204/354/232/251.md" +0 -0
- {letify-2.12.3 → letify-2.12.4}/docs/guide/ko/07-/353/254/270/354/240/234-/355/225/264/352/262/260.md" +0 -0
- {letify-2.12.3 → letify-2.12.4}/docs/guide/ko/08-/353/246/264/353/246/254/354/212/244.md" +0 -0
- {letify-2.12.3 → letify-2.12.4}/docs/guide/ko/09-/354/227/220/354/235/264/354/240/204/355/212/270.md" +0 -0
- {letify-2.12.3 → letify-2.12.4}/docs/guide/ko/README.md +0 -0
- {letify-2.12.3 → letify-2.12.4}/docs/locales/README_ko.md +0 -0
- {letify-2.12.3 → letify-2.12.4}/docs/mkdocs.yml +0 -0
- {letify-2.12.3 → letify-2.12.4}/examples/README.md +0 -0
- {letify-2.12.3 → letify-2.12.4}/examples/nvfp4-lora/.letify.example +0 -0
- {letify-2.12.3 → letify-2.12.4}/examples/nvfp4-lora/00_smoke.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/examples/nvfp4-lora/01_sweep.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/examples/nvfp4-lora/02_resume.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/examples/nvfp4-lora/03_watch.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/examples/nvfp4-lora/README.md +0 -0
- {letify-2.12.3 → letify-2.12.4}/examples/nvfp4-lora/README_ko.md +0 -0
- {letify-2.12.3 → letify-2.12.4}/examples/nvfp4-lora/common.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/examples/nvfp4-lora/recipe.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/cli.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/config/__init__.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/config/inventory.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/config/login.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/config/schema.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/config/secrets.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/config/writer.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/declare/__init__.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/declare/cache.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/declare/env.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/declare/exit.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/declare/function.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/declare/instance.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/declare/reduce.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/declare/replicas.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/errors.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/launcher.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/paths.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/protocol/__init__.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/protocol/codec.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/protocol/driver.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/protocol/handle.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/protocol/wire.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/protocol/worker.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/providers/__init__.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/providers/base.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/providers/colab_keepalive.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/providers/kaggle_adapter.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/providers/local.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/providers/modal.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/providers/modal_adapter.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/providers/naming.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/providers/shell.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/providers/tunnel.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/providers/usage.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/remoting/__init__.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/remoting/device/__init__.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/remoting/device/client.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/remoting/device/cuda.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/remoting/device/executor.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/remoting/device/frames.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/remoting/device/guard.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/remoting/device/tensor.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/remoting/device/trace.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/remoting/device/value.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/render.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/runtime/__init__.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/runtime/broker.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/runtime/channel.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/runtime/control.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/runtime/lease.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/runtime/pool.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/runtime/reattach.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/runtime/session.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/runtime/takeover.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/runtime/telemetry.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/runtime/workers.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/store/__init__.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/store/backends/__init__.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/store/backends/filesystem.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/store/backends/layout.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/store/cas.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/store/handoff.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/store/sendorder.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/store/volume.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/stubs.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/tools.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/transport/__init__.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/transport/agent.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/transport/announce.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/transport/link.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/transport/linkagent.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/transport/linkchannel.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/transport/linkd.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/transport/linkmailbox.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/transport/linkpump.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/transport/linkshim.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/transport/linkupload.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/transport/linkwebsocket.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/transport/nat.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/transport/pipeline.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/transport/probe.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/transport/quic.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/transport/rendezvous.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/transport/setup.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/transport/sshopts.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify/transport/strategies.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/.gitignore +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/build.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify/Cargo.toml +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify/LICENSE +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify/README.md +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify/src/lib.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/Cargo.toml +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/examples/bench.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/src/acceptor.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/src/bin/letify-link.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/src/config.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/src/error.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/src/frame.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/src/handshake.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/src/hysteresis.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/src/identity.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/src/keys.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/src/lib.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/src/observe.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/src/paths.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/src/plan.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/src/policing.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/src/punch.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/src/record.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/src/relay.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/src/rendezvous.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/src/replay.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/src/session.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/src/sidecar.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/src/stream.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/src/stun.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/src/tcp.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/src/trace.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/src/udp.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/tests/acceptor.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/tests/api.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/tests/common/mod.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/tests/diag_sim.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/tests/fairness.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/tests/gauge.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/tests/handshake.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/tests/hysteresis.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/tests/keepalive.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/tests/mobile.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/tests/nat.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/tests/paths.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/tests/qad.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/tests/rekey.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/tests/relay.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/tests/relay_pairing.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/tests/rendezvous.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/tests/reorder.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/tests/replay.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/tests/resume.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/tests/revoke.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/tests/session.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/tests/sidecar.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/tests/startup.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/tests/subflows.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/tests/trace.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/tests/udp.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-link/tests/udp_bench.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-quic/Cargo.toml +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/letify-quic/src/main.rs +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-core/rust-toolchain.toml +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-ext/.vscodeignore +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-ext/LICENSE +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-ext/README.md +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-ext/media/icon.svg +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-ext/src/cli.ts +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-ext/src/extension.ts +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-ext/src/history.ts +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-ext/src/model.ts +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-ext/src/poll.ts +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-ext/src/render.ts +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-ext/test/cli.test.ts +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-ext/test/manifest.test.ts +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-ext/test/model.test.ts +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-ext/test/regressions.test.ts +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-ext/tsconfig.json +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-signal/README.md +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-signal/cloudflare.config.ts +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-signal/package-lock.json +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-signal/package.json +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-signal/src/auth.ts +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-signal/src/ed25519.ts +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-signal/src/handler.ts +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-signal/src/index.ts +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-signal/src/limiter.ts +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-signal/src/mailbox.ts +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-signal/src/objects.ts +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-signal/src/protocol.ts +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-signal/src/storage.ts +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-signal/test/auth.test.ts +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-signal/test/ed25519.test.ts +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-signal/test/helpers.ts +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-signal/test/interop.test.ts +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-signal/test/limiter.test.ts +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-signal/test/mailbox.test.ts +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-signal/test/objects.test.ts +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-signal/test/setup.ts +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-signal/test/worker.test.ts +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-signal/tsconfig.json +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify-signal/vitest.config.ts +0 -0
- {letify-2.12.3 → letify-2.12.4}/letify_providers.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/scripts/sync-main.sh +0 -0
- {letify-2.12.3 → letify-2.12.4}/scripts/version.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/conftest.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/fake_kaggle_adapter.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/fake_modal_adapter.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_cli.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_cli_output.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_colab_keepalive.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_config.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_core.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_data.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_data_in_place.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_data_streaming.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_declare.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_device.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_device_compile.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_distributed.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_drive_handoff.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_editor_sessions.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_elice.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_frames.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_install.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_kaggle_cookie.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_kaggle_link.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_link_agent.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_link_channel.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_link_command_channel.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_link_exec.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_link_log.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_link_mailbox_close.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_link_opt_in.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_link_signal.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_link_ssh_stream.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_link_upload.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_linkd.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_notebook.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_parallel_placement.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_paths.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_portmap.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_protocol.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_providers.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_punch_sockets.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_quic.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_remoting.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_render.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_run_control.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_run_reattach.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_run_takeover.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_runtime.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_shell_workers.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_ship.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_store.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_strategies.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_stubs.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_transport.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_tunnel_agent_login.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_tunnel_setup.py +0 -0
- {letify-2.12.3 → letify-2.12.4}/tests/test_version.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: letify
|
|
3
|
-
Version: 2.12.
|
|
3
|
+
Version: 2.12.4
|
|
4
4
|
Summary: Declarations that become infrastructure.
|
|
5
5
|
Project-URL: Homepage, https://github.com/DarkPyonix/letify
|
|
6
6
|
Project-URL: Documentation, https://github.com/DarkPyonix/letify/tree/main/docs
|
|
@@ -258,6 +258,15 @@ A provider is built from one entry in the configuration file and reached by attr
|
|
|
258
258
|
| `Elice` | ephemeral | yes | persistent | `filesystem` |
|
|
259
259
|
| `Kaggle` | ephemeral | no | persistent, in one cell of the session the user registered | `filesystem` |
|
|
260
260
|
|
|
261
|
+
### User-Agent <!-- id: user-agent -->
|
|
262
|
+
|
|
263
|
+
> Every HTTP request letify sends carries `User-Agent: letify/<version>`, and nothing else is ever sent in its place.
|
|
264
|
+
|
|
265
|
+
- **One rule for every client.** The rule covers each request letify makes with `urllib` or `http.client`: the provider APIs (Kaggle, Colab, Elice), the blob backends (Drive, GCS), the signalling service, the release and installer downloads, and the UPnP requests of the port mapper. `<version>` is `letify.__version__`. `letify/useragent.py` builds the string, and no module writes its own copy.
|
|
266
|
+
- **The value is letify's own name.** letify does not send a browser User-Agent and does not imitate another client, whatever a service answers.
|
|
267
|
+
- **A runtime sends it too.** The worker takes the request headers from the machine that drives it and sends them unchanged, so the headers of every pull and push the driver builds already carry the User-Agent. The uv installer download in the bootstrap script carries it the same way.
|
|
268
|
+
- **Why.** Services refuse the Python default `Python-urllib/<version>`: Cloudflare's Browser Integrity Check answers it with error 1010 (the signalling service), astral.sh with 403 (the uv installer), and kaggle.com with 404 and an empty body since 2026-11-08.
|
|
269
|
+
|
|
261
270
|
### Kaggle <!-- id: kaggle-provider -->
|
|
262
271
|
|
|
263
272
|
> A Kaggle account is declared with two required credentials: the browser session cookie of a logged-in kaggle.com tab, and an API token. The cookie is kept to the interactive session alone; everything else goes through the official Kaggle CLI, authenticated by the token, with no cookie fallback. It opens no tunnel, port forward or Tailcat link, so the kernel channel is its only link to a session, and that channel cannot carry a device stream, so it cannot serve `host="local"`.
|
|
@@ -274,6 +283,7 @@ Creating the notebook stays on the cookie side rather than moving to `kernels in
|
|
|
274
283
|
Not opening a link is a decision of this project, not a rule of Kaggle's. Two sources bear on it, and they say different things. Kaggle staff answered a request for SSH access with "You can't run docker inside Kaggle. We also don't support port forwarding.", which is a statement that the feature does not exist, not that reaching it is forbidden. The Acceptable Use Policy of June 22, 2025 forbids using the Services "to disable, interfere with or circumvent any aspect of the Services" and lists "tools for circumvention/obfuscation" among abusive uses. Whether hole punching to a machine that offers no inbound port is circumvention is not written anywhere, so treating it as circumvention is this project's reading rather than Kaggle's rule. letify takes the cautious side because the cost of being wrong falls on the user's account. The session has outbound network, so a link dialled out from the session to the local process is possible in principle; letify does not open one, and `host="local"` is refused for the throughput reason in Placements a provider cannot serve, not because Kaggle forbids it.
|
|
275
284
|
|
|
276
285
|
- No keep-alive request is ever sent, and accounts are never rotated.
|
|
286
|
+
- **User-Agent.** Every request to Kaggle carries `User-Agent: letify/<version>`, as the section "User-Agent" requires. Since 2026-11-08 kaggle.com has answered the Python default `Python-urllib/<version>` with HTTP 404 and an empty body, which login checks and session starts reported as `could not be checked: HTTP 404`.
|
|
277
287
|
- The accelerators are `CPU`, `T4` and `TPU_V3_8`, a fixed list read without a network call. `T4` declares two GPU cards through `Instance.devices=2`, and requests `NVIDIA_TESLA_T4`. The name stays `T4` to preserve existing declarations: the card count belongs to the instance shape.
|
|
278
288
|
- `P100` is not offered. Kaggle retired the Tesla P100 on 2026-09-15 and switches a notebook that asks for it to T4x2, so a request for it is answered with a different card and a different card count. A declaration states where a function runs, so letify refuses the name rather than letting the substitution through: `kaggle_<alias>.P100` raises `UnknownInstance` naming the retirement date and `T4`. Two live accounts asking for `P100` both received two T4s, which is what the substitution looks like from here.
|
|
279
289
|
- The card the session got is checked, because a retirement is not the only way Kaggle answers with something else. Before the environment is built, the session reads `Model:` from each `/proc/driver/nvidia/gpus/*/information` and compares the names and the count against the instance: `T4` expects two cards whose model contains `T4`. A mismatch raises `InsufficientDevices` naming what was asked for and what arrived. `nvidia-smi` is not used because a Kaggle image does not have it on `PATH`. The check runs before the environment so a wrong card costs seconds rather than the minutes a sync takes. The check also asks whether the driver works, by loading `libcuda.so.1` with `ctypes` and calling `cuInit(0)`, and a non-zero result refuses the session the same way a wrong card does, naming the code. That is the call CUDA initialization makes, so it answers the question rather than a proxy for it: a live Kaggle session listed both T4s in `/proc` and had `/dev/nvidiactl`, and the first `.cuda()` still raised `Found no NVIDIA driver on your system` after 30 GB of shards had been sent. `torch.cuda.is_available()` would answer too and cannot be used, because the check runs before the environment is built and there is no torch in the session yet; `ctypes` is in the standard library and needs neither. An account that accepts whatever card it is given sets `any_accelerator = true`, and then the mismatch is one line on standard error instead.
|
|
@@ -1775,7 +1785,7 @@ Two declarations cannot diverge from the local process. Before any session start
|
|
|
1775
1785
|
|
|
1776
1786
|
> The runtime uses the uv it has, and installs uv under the workspace root when it has none.
|
|
1777
1787
|
|
|
1778
|
-
The worker looks for `uv` on `PATH`, then at `<workspace root>/uv-bin/uv`. When neither exists it downloads `https://astral.sh/uv/install.sh` over HTTPS with the bootstrap interpreter's `urllib`, sending `User-Agent: letify/<version>`
|
|
1788
|
+
The worker looks for `uv` on `PATH`, then at `<workspace root>/uv-bin/uv`. When neither exists it downloads `https://astral.sh/uv/install.sh` over HTTPS with the bootstrap interpreter's `urllib`, sending `User-Agent: letify/<version>` as the section "User-Agent" requires, and runs it with `sh`, with `UV_INSTALL_DIR=<workspace root>/uv-bin` and `UV_NO_MODIFY_PATH=1`. That is the same as `curl -LsSf https://astral.sh/uv/install.sh | env UV_INSTALL_DIR="<workspace root>/uv-bin" UV_NO_MODIFY_PATH=1 sh`, and letify fetches the script itself so it does not need `curl` to reach astral.sh. The installer script does need one, though: it downloads the uv binary with `curl` or `wget`. So before running it, the worker checks that one of the two is on `PATH`, and when neither is it raises `uv cannot be installed on <runtime>: its installer needs curl or wget on PATH, and neither is present` rather than letting the installer fail with an unclear message. It writes only under the workspace root, so it needs no root and nothing outside the one directory an account may be restricted to. A failed download or a non-zero exit raises `EnvironmentFailure` saying `uv could not be installed on <runtime>` with the reason.
|
|
1779
1789
|
|
|
1780
1790
|
### uv cache <!-- id: uv-cache -->
|
|
1781
1791
|
|
|
@@ -2252,7 +2262,7 @@ The service is the auxiliary rendezvous of [Rendezvous trait](#link-rendezvous).
|
|
|
2252
2262
|
|
|
2253
2263
|
`<to>` and `<node>` are 64 lowercase hex characters. Sequence numbers count from 1 per mailbox and are never reused. Messages of one mailbox are delivered in sequence order, at least once: a message is deleted by an acknowledgement or by its TTL, never by being read, so a receiver that reconnects with the last `after` it had sees the rest again.
|
|
2254
2264
|
|
|
2255
|
-
**User-Agent.** Every request, the WebSocket handshake included, carries `User-Agent: letify/<version>`,
|
|
2265
|
+
**User-Agent.** Every request, the WebSocket handshake included, carries `User-Agent: letify/<version>`, as the section "User-Agent" requires. Cloudflare's Browser Integrity Check answers the Python default with 403 and error code 1010 before the request reaches the Worker.
|
|
2256
2266
|
|
|
2257
2267
|
**Connections.** `SignalClient` keeps the HTTPS connections it opened and sends the next request on an idle one, so a connect pays the TCP and TLS set-up once and not once per request. A connection serves one request at a time: a long poll holds its connection until it returns, so a send made meanwhile takes another idle connection or opens one, and at most 4 idle connections are kept (`MAX_IDLE`). A connection is returned to the idle list only after its reply was read to the end and the service did not say `Connection: close`. A request that fails on a reused connection before any reply byte arrives (the service or a middlebox closed it while idle) is sent once more on a new connection, signed again with a new nonce, and a failure on a new connection is not retried. The client uses `http.client` from the standard library. When the environment names a proxy for the service's host, it sends through `urllib` with a new connection per request, because `http.client` does not use a proxy. The WebSocket of `/ws/<node>` is its own connection and is not part of this list. The error texts do not change.
|
|
2258
2268
|
|
|
@@ -34,6 +34,7 @@ from pathlib import Path
|
|
|
34
34
|
from . import render
|
|
35
35
|
from .errors import LetifyError
|
|
36
36
|
from .transport.setup import TAILCAT_VERSION
|
|
37
|
+
from .useragent import user_agent, with_agent
|
|
37
38
|
|
|
38
39
|
#: Seconds to wait for a release server.
|
|
39
40
|
DOWNLOAD_TIMEOUT = 60.0
|
|
@@ -390,7 +391,9 @@ def _download(url: str, *, label: str | None = None, stream=None) -> bytes:
|
|
|
390
391
|
"""Fetch ``url``; with ``label``, report progress on ``stream`` (standard error)."""
|
|
391
392
|
_reachable(url)
|
|
392
393
|
try:
|
|
393
|
-
with urllib.request.urlopen(
|
|
394
|
+
with urllib.request.urlopen(
|
|
395
|
+
urllib.request.Request(url, headers=with_agent()), timeout=DOWNLOAD_TIMEOUT
|
|
396
|
+
) as response:
|
|
394
397
|
if label is None:
|
|
395
398
|
return response.read()
|
|
396
399
|
length = response.headers.get("Content-Length")
|
|
@@ -656,7 +659,8 @@ def remote_tailcat_source() -> str:
|
|
|
656
659
|
return (
|
|
657
660
|
inspect.getsource(_remote_tailcat)
|
|
658
661
|
+ f"\nbinary = _remote_tailcat({TAILCAT_VERSION!r}, "
|
|
659
|
-
+ f"{TAILCAT_RELEASE.format(version=TAILCAT_VERSION)!r}, {TAILCAT_SHA256!r}
|
|
662
|
+
+ f"{TAILCAT_RELEASE.format(version=TAILCAT_VERSION)!r}, {TAILCAT_SHA256!r}, "
|
|
663
|
+
+ f"{user_agent()!r})\n"
|
|
660
664
|
+ "import json\nprint('LETIFY-TAILCAT ' + json.dumps(binary))\n"
|
|
661
665
|
)
|
|
662
666
|
|
|
@@ -730,7 +734,7 @@ def _remote_quic(version):
|
|
|
730
734
|
return str(target)
|
|
731
735
|
|
|
732
736
|
|
|
733
|
-
def _remote_tailcat(version, release, pins):
|
|
737
|
+
def _remote_tailcat(version, release, pins, agent):
|
|
734
738
|
"""Install a verified Linux tailcat using only the runtime's standard library."""
|
|
735
739
|
import hashlib
|
|
736
740
|
import io
|
|
@@ -757,7 +761,10 @@ def _remote_tailcat(version, release, pins):
|
|
|
757
761
|
if verified.get("archive") != pins[asset] or verified.get("binary") != actual:
|
|
758
762
|
raise RuntimeError("tailcat cached binary SHA-256 mismatch; refused")
|
|
759
763
|
return str(binary)
|
|
760
|
-
with urllib.request.urlopen(
|
|
764
|
+
with urllib.request.urlopen(
|
|
765
|
+
urllib.request.Request(f"{release}/{asset}", headers={"User-Agent": agent}),
|
|
766
|
+
timeout=60,
|
|
767
|
+
) as response:
|
|
761
768
|
data = response.read()
|
|
762
769
|
actual = hashlib.sha256(data).hexdigest()
|
|
763
770
|
if actual != pins[asset]:
|
|
@@ -45,6 +45,7 @@ from .. import tools
|
|
|
45
45
|
from ..config.secrets import account_directory
|
|
46
46
|
from ..declare.instance import Instance
|
|
47
47
|
from ..errors import ProviderUnavailable, RuntimeFailure, RuntimeLost
|
|
48
|
+
from ..useragent import with_agent
|
|
48
49
|
from .shell import Shell
|
|
49
50
|
from .usage import Usage
|
|
50
51
|
|
|
@@ -116,7 +117,9 @@ def _access_token(stored: dict[str, Any]) -> str:
|
|
|
116
117
|
"grant_type": "refresh_token",
|
|
117
118
|
}
|
|
118
119
|
).encode()
|
|
119
|
-
request = urllib.request.Request(
|
|
120
|
+
request = urllib.request.Request(
|
|
121
|
+
str(stored["token_uri"]), data=form, method="POST", headers=with_agent()
|
|
122
|
+
)
|
|
120
123
|
with urllib.request.urlopen(request, timeout=USAGE_HTTP_TIMEOUT) as response:
|
|
121
124
|
return str(json.loads(response.read())["access_token"])
|
|
122
125
|
|
|
@@ -207,12 +210,12 @@ class Colab(Shell):
|
|
|
207
210
|
token = _access_token(stored)
|
|
208
211
|
request = urllib.request.Request(
|
|
209
212
|
CCU_INFO_URL,
|
|
210
|
-
headers={
|
|
213
|
+
headers=with_agent({
|
|
211
214
|
"Authorization": f"Bearer {token}",
|
|
212
215
|
"Accept": "application/json",
|
|
213
216
|
"X-Colab-Client-Agent": "colab-cli",
|
|
214
217
|
"X-Colab-Tunnel": "Google",
|
|
215
|
-
},
|
|
218
|
+
}),
|
|
216
219
|
)
|
|
217
220
|
with urllib.request.urlopen(request, timeout=USAGE_HTTP_TIMEOUT) as response:
|
|
218
221
|
text = response.read().decode(errors="replace")
|
|
@@ -24,6 +24,7 @@ from typing import Any
|
|
|
24
24
|
|
|
25
25
|
from ..config.secrets import account_directory
|
|
26
26
|
from ..errors import RuntimeFailure
|
|
27
|
+
from ..useragent import with_agent
|
|
27
28
|
|
|
28
29
|
#: Size of one upload part and one download range.
|
|
29
30
|
PART_BYTES = 32 * 1024 * 1024
|
|
@@ -89,7 +90,7 @@ class ContentsTransfer:
|
|
|
89
90
|
headers: dict[str, str] | None = None,
|
|
90
91
|
) -> bytes:
|
|
91
92
|
request = urllib.request.Request(address, data=body, method=method)
|
|
92
|
-
for key, value in {**self._auth_headers(), **(headers or {})}.items():
|
|
93
|
+
for key, value in with_agent({**self._auth_headers(), **(headers or {})}).items():
|
|
93
94
|
request.add_header(key, value)
|
|
94
95
|
try:
|
|
95
96
|
with urllib.request.urlopen(request, timeout=3600) as response:
|
|
@@ -44,6 +44,7 @@ from ..errors import (
|
|
|
44
44
|
UnsupportedMode,
|
|
45
45
|
)
|
|
46
46
|
from ..paths import accounts_label, tools_label
|
|
47
|
+
from ..useragent import user_agent
|
|
47
48
|
from .naming import normalize_gpu
|
|
48
49
|
from .shell import Shell
|
|
49
50
|
from .usage import Usage
|
|
@@ -152,6 +153,7 @@ def request(
|
|
|
152
153
|
url = f"{url}?{urllib.parse.urlencode(params)}"
|
|
153
154
|
data = None if json is None else _json.dumps(json).encode()
|
|
154
155
|
call = urllib.request.Request(url, data=data, method=method)
|
|
156
|
+
call.add_header("User-Agent", user_agent())
|
|
155
157
|
call.add_header("Authorization", f"Bearer {token}")
|
|
156
158
|
call.add_header("Accept", "application/json")
|
|
157
159
|
for name, value in (headers or {}).items():
|
|
@@ -52,6 +52,7 @@ from ..errors import (
|
|
|
52
52
|
from ..protocol import wire
|
|
53
53
|
from ..runtime.channel import Connection, FramedChannel, _drain, _Tail
|
|
54
54
|
from ..transport import sshopts
|
|
55
|
+
from ..useragent import user_agent, with_agent
|
|
55
56
|
from .base import Provider
|
|
56
57
|
from .usage import Usage
|
|
57
58
|
|
|
@@ -240,6 +241,7 @@ def cookie_headers(cookie: str) -> dict[str, str]:
|
|
|
240
241
|
jar = require_cookie_shape(cookie)
|
|
241
242
|
return {
|
|
242
243
|
"Content-Type": "application/json",
|
|
244
|
+
"User-Agent": user_agent(),
|
|
243
245
|
"cookie": cookie,
|
|
244
246
|
"x-xsrf-token": jar["XSRF-TOKEN"],
|
|
245
247
|
"x-kaggle-build-version": jar.get("build-hash", "1"),
|
|
@@ -365,7 +367,7 @@ def _call(cookie: str, path: str, body: dict[str, Any]) -> dict[str, Any]:
|
|
|
365
367
|
def _post(url: str, body: dict[str, Any], headers: dict[str, str]) -> dict[str, Any]:
|
|
366
368
|
request = urllib.request.Request(
|
|
367
369
|
url, data=json.dumps(body).encode(), method="POST",
|
|
368
|
-
headers={**headers, "Content-Type": "application/json"},
|
|
370
|
+
headers=with_agent({**headers, "Content-Type": "application/json"}),
|
|
369
371
|
)
|
|
370
372
|
with urlopen(request) as response:
|
|
371
373
|
return json.loads(response.read())
|
|
@@ -497,7 +499,9 @@ def jupyter_token(id_token: str, webtier: str, deadline: float) -> str:
|
|
|
497
499
|
url = FIRESTORE_BASE + urllib.parse.quote(
|
|
498
500
|
FIRESTORE_DOCUMENT.format(sid=webtier), safe="/()"
|
|
499
501
|
)
|
|
500
|
-
request = urllib.request.Request(
|
|
502
|
+
request = urllib.request.Request(
|
|
503
|
+
url, headers=with_agent({"Authorization": "Bearer " + id_token})
|
|
504
|
+
)
|
|
501
505
|
while True:
|
|
502
506
|
try:
|
|
503
507
|
with urlopen(request) as response:
|
|
@@ -947,6 +951,7 @@ class Session:
|
|
|
947
951
|
query = f"?{urllib.parse.urlencode({'token': self.token})}" if self.token else ""
|
|
948
952
|
data = json.dumps(body).encode() if body is not None else None
|
|
949
953
|
request = urllib.request.Request(f"{self.base}{path}{query}", data=data, method=method)
|
|
954
|
+
request.add_header("User-Agent", user_agent())
|
|
950
955
|
if self.token:
|
|
951
956
|
request.add_header("Authorization", f"token {self.token}")
|
|
952
957
|
if data is not None:
|
|
@@ -19,6 +19,7 @@ from pathlib import Path
|
|
|
19
19
|
from typing import TYPE_CHECKING
|
|
20
20
|
|
|
21
21
|
from ..errors import ConfigError, InterpreterMismatch
|
|
22
|
+
from ..useragent import user_agent
|
|
22
23
|
|
|
23
24
|
if TYPE_CHECKING:
|
|
24
25
|
from ..declare.env import Env
|
|
@@ -76,13 +77,6 @@ TAIL_LINES = 40
|
|
|
76
77
|
VERSION_SOURCE = "import sys\n__letify_value__ = '%d.%d' % sys.version_info[:2]\n"
|
|
77
78
|
|
|
78
79
|
|
|
79
|
-
def user_agent() -> str:
|
|
80
|
-
"""The User-Agent a runtime sends when it downloads the uv installer."""
|
|
81
|
-
from .. import __version__
|
|
82
|
-
|
|
83
|
-
return f"letify/{__version__}"
|
|
84
|
-
|
|
85
|
-
|
|
86
80
|
def local_python() -> str:
|
|
87
81
|
"""The major.minor of the interpreter running letify, such as ``"3.12"``."""
|
|
88
82
|
return f"{sys.version_info[0]}.{sys.version_info[1]}"
|
|
@@ -31,6 +31,7 @@ from collections.abc import Iterator
|
|
|
31
31
|
from typing import Any
|
|
32
32
|
|
|
33
33
|
from ...errors import ConfigError, ProviderUnavailable, RuntimeFailure
|
|
34
|
+
from ...useragent import with_agent
|
|
34
35
|
from ..cas import Backend
|
|
35
36
|
from .google_auth import TokenSource
|
|
36
37
|
|
|
@@ -265,10 +266,10 @@ class DriveBackend(Backend):
|
|
|
265
266
|
# -- HTTP ------------------------------------------------------------------
|
|
266
267
|
|
|
267
268
|
def _headers(self) -> dict[str, str]:
|
|
268
|
-
return {
|
|
269
|
+
return with_agent({
|
|
269
270
|
"Authorization": f"Bearer {self.tokens.token()}",
|
|
270
271
|
"x-goog-user-project": self.project,
|
|
271
|
-
}
|
|
272
|
+
})
|
|
272
273
|
|
|
273
274
|
def _call(
|
|
274
275
|
self,
|
|
@@ -416,7 +417,7 @@ class DriveBackend(Backend):
|
|
|
416
417
|
raise RuntimeFailure(f"Drive upload session for {digest} named no upload URL")
|
|
417
418
|
return {
|
|
418
419
|
"url": location,
|
|
419
|
-
"headers": {"x-goog-user-project": self.project},
|
|
420
|
+
"headers": with_agent({"x-goog-user-project": self.project}),
|
|
420
421
|
"piece": UPLOAD_PIECE,
|
|
421
422
|
}
|
|
422
423
|
|
|
@@ -24,6 +24,7 @@ import urllib.request
|
|
|
24
24
|
from pathlib import Path
|
|
25
25
|
|
|
26
26
|
from ...errors import ProviderUnavailable, RuntimeFailure
|
|
27
|
+
from ...useragent import user_agent
|
|
27
28
|
|
|
28
29
|
#: Where Google exchanges a refresh token when the credentials file names no other place.
|
|
29
30
|
DEFAULT_TOKEN_URI = "https://oauth2.googleapis.com/token"
|
|
@@ -109,6 +110,7 @@ class TokenSource:
|
|
|
109
110
|
).encode()
|
|
110
111
|
uri = str(info.get("token_uri") or DEFAULT_TOKEN_URI)
|
|
111
112
|
request = urllib.request.Request(uri, data=form, method="POST")
|
|
113
|
+
request.add_header("User-Agent", user_agent())
|
|
112
114
|
request.add_header("Content-Type", "application/x-www-form-urlencoded")
|
|
113
115
|
try:
|
|
114
116
|
with urllib.request.urlopen(request, timeout=60) as response:
|
|
@@ -21,6 +21,7 @@ from collections.abc import Iterator
|
|
|
21
21
|
from typing import Any
|
|
22
22
|
|
|
23
23
|
from ...errors import ConfigError, ProviderUnavailable, RuntimeFailure
|
|
24
|
+
from ...useragent import user_agent, with_agent
|
|
24
25
|
from ..cas import Backend
|
|
25
26
|
from .google_auth import TokenSource
|
|
26
27
|
from .layout import BLOB_PREFIX, blob_key, ref_key
|
|
@@ -93,6 +94,7 @@ class GCSBackend(Backend):
|
|
|
93
94
|
}
|
|
94
95
|
).encode()
|
|
95
96
|
request = urllib.request.Request(self.sts_endpoint, data=form, method="POST")
|
|
97
|
+
request.add_header("User-Agent", user_agent())
|
|
96
98
|
request.add_header("Content-Type", "application/x-www-form-urlencoded")
|
|
97
99
|
try:
|
|
98
100
|
with urllib.request.urlopen(request, timeout=60) as response:
|
|
@@ -111,7 +113,7 @@ class GCSBackend(Backend):
|
|
|
111
113
|
"""A Colab runtime is a Compute Engine VM, so it reads the bucket over Google's network."""
|
|
112
114
|
return {
|
|
113
115
|
"url": self.blob_url(digest),
|
|
114
|
-
"headers": {"Authorization": f"Bearer {self.read_token()}"},
|
|
116
|
+
"headers": with_agent({"Authorization": f"Bearer {self.read_token()}"}),
|
|
115
117
|
}
|
|
116
118
|
|
|
117
119
|
def _key(self, key: str) -> str:
|
|
@@ -133,6 +135,7 @@ class GCSBackend(Backend):
|
|
|
133
135
|
) -> bytes | None:
|
|
134
136
|
"""Send one request. A 404 answers None, any other failure raises."""
|
|
135
137
|
request = urllib.request.Request(url, data=data, method=method)
|
|
138
|
+
request.add_header("User-Agent", user_agent())
|
|
136
139
|
request.add_header("Authorization", f"Bearer {self.tokens.token()}")
|
|
137
140
|
if data is not None:
|
|
138
141
|
request.add_header("Content-Type", "application/octet-stream")
|
|
@@ -165,6 +168,7 @@ class GCSBackend(Backend):
|
|
|
165
168
|
with open(path, "rb") as handle:
|
|
166
169
|
body = _CountingReader(handle, progress)
|
|
167
170
|
request = urllib.request.Request(url, data=body, method="POST") # type: ignore[arg-type]
|
|
171
|
+
request.add_header("User-Agent", user_agent())
|
|
168
172
|
request.add_header("Authorization", f"Bearer {self.tokens.token()}")
|
|
169
173
|
request.add_header("Content-Type", "application/octet-stream")
|
|
170
174
|
request.add_header("Content-Length", str(size))
|
|
@@ -25,6 +25,7 @@ from pathlib import Path
|
|
|
25
25
|
from typing import TYPE_CHECKING, Any
|
|
26
26
|
|
|
27
27
|
from ..errors import ConfigError, ProtocolError, RemoteError, RuntimeFailure
|
|
28
|
+
from ..useragent import with_agent
|
|
28
29
|
|
|
29
30
|
if TYPE_CHECKING:
|
|
30
31
|
from ..providers.base import Provider
|
|
@@ -1026,7 +1027,7 @@ class Stream:
|
|
|
1026
1027
|
"op": "data_pull",
|
|
1027
1028
|
"dir": self.blobs,
|
|
1028
1029
|
"items": [[digest, bucket.blob_url(digest)]],
|
|
1029
|
-
"headers": {"Authorization": f"Bearer {self._token}"},
|
|
1030
|
+
"headers": with_agent({"Authorization": f"Bearer {self._token}"}),
|
|
1030
1031
|
},
|
|
1031
1032
|
)
|
|
1032
1033
|
if not uploaded:
|
|
@@ -29,6 +29,7 @@ from collections.abc import Callable, Iterable
|
|
|
29
29
|
from dataclasses import dataclass
|
|
30
30
|
from typing import Any, Protocol
|
|
31
31
|
|
|
32
|
+
from ..useragent import user_agent
|
|
32
33
|
from . import linkd, linkwebsocket
|
|
33
34
|
|
|
34
35
|
#: The service the owner operates.
|
|
@@ -95,16 +96,6 @@ class Incoming:
|
|
|
95
96
|
body: bytes
|
|
96
97
|
|
|
97
98
|
|
|
98
|
-
def _user_agent() -> str:
|
|
99
|
-
"""The User-Agent of every request. Spec "Signalling service" item 1, "User-Agent".
|
|
100
|
-
|
|
101
|
-
Cloudflare's Browser Integrity Check refuses the urllib default with error 1010.
|
|
102
|
-
"""
|
|
103
|
-
from .. import __version__
|
|
104
|
-
|
|
105
|
-
return f"letify/{__version__}"
|
|
106
|
-
|
|
107
|
-
|
|
108
99
|
def _proxied(url: str) -> bool:
|
|
109
100
|
"""Whether the environment sends a request for ``url`` through a proxy."""
|
|
110
101
|
parts = urllib.parse.urlsplit(url)
|
|
@@ -176,7 +167,7 @@ class SignalClient:
|
|
|
176
167
|
text = f"{method}\n{target}\n{stamp}\n{nonce}\n{hashlib.sha256(body).hexdigest()}"
|
|
177
168
|
signature = self.daemon.sign(REQUEST_DOMAIN, text.encode())
|
|
178
169
|
return {
|
|
179
|
-
"User-Agent":
|
|
170
|
+
"User-Agent": user_agent(),
|
|
180
171
|
"X-Letify-Node": signer_id or self.daemon.node_id,
|
|
181
172
|
"X-Letify-Time": stamp,
|
|
182
173
|
"X-Letify-Nonce": nonce,
|
|
@@ -18,6 +18,8 @@ import urllib.request
|
|
|
18
18
|
from dataclasses import dataclass
|
|
19
19
|
from pathlib import Path
|
|
20
20
|
|
|
21
|
+
from ..useragent import with_agent
|
|
22
|
+
|
|
21
23
|
#: Seconds a mapping is asked to live. One hour outlasts a session's setup and is short
|
|
22
24
|
#: enough that a mapping letify fails to release expires on its own.
|
|
23
25
|
LIFETIME = 3600
|
|
@@ -239,7 +241,9 @@ def _ssdp_location(timeout: float) -> str | None:
|
|
|
239
241
|
|
|
240
242
|
def _fetch(url: str, timeout: float) -> str | None:
|
|
241
243
|
try:
|
|
242
|
-
with urllib.request.urlopen(
|
|
244
|
+
with urllib.request.urlopen(
|
|
245
|
+
urllib.request.Request(url, headers=with_agent()), timeout=timeout
|
|
246
|
+
) as answer:
|
|
243
247
|
return answer.read(1 << 18).decode("latin-1")
|
|
244
248
|
except Exception:
|
|
245
249
|
return None
|
|
@@ -266,10 +270,10 @@ def _soap(url: str, service: str, action: str, body: str, timeout: float) -> str
|
|
|
266
270
|
request = urllib.request.Request(
|
|
267
271
|
url,
|
|
268
272
|
data=envelope,
|
|
269
|
-
headers={
|
|
273
|
+
headers=with_agent({
|
|
270
274
|
"Content-Type": 'text/xml; charset="utf-8"',
|
|
271
275
|
"SOAPAction": f'"{service}#{action}"',
|
|
272
|
-
},
|
|
276
|
+
}),
|
|
273
277
|
)
|
|
274
278
|
try:
|
|
275
279
|
with urllib.request.urlopen(request, timeout=timeout) as answer:
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"""The User-Agent letify names itself with. Owns the string; it sends no request itself.
|
|
2
|
+
|
|
3
|
+
Spec "User-Agent": every HTTP request letify sends carries ``User-Agent: letify/<version>``.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
from collections.abc import Mapping
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def user_agent() -> str:
|
|
12
|
+
"""The User-Agent of every request: ``letify/<version>``."""
|
|
13
|
+
from . import __version__
|
|
14
|
+
|
|
15
|
+
return f"letify/{__version__}"
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def with_agent(headers: Mapping[str, str] | None = None) -> dict[str, str]:
|
|
19
|
+
"""A copy of ``headers`` that carries the letify User-Agent, keeping any one already set."""
|
|
20
|
+
named = dict(headers or {})
|
|
21
|
+
if not any(key.lower() == "user-agent" for key in named):
|
|
22
|
+
named["User-Agent"] = user_agent()
|
|
23
|
+
return named
|
|
@@ -396,11 +396,11 @@ dependencies = [
|
|
|
396
396
|
|
|
397
397
|
[[package]]
|
|
398
398
|
name = "letify"
|
|
399
|
-
version = "2.12.
|
|
399
|
+
version = "2.12.4"
|
|
400
400
|
|
|
401
401
|
[[package]]
|
|
402
402
|
name = "letify-link"
|
|
403
|
-
version = "2.12.
|
|
403
|
+
version = "2.12.4"
|
|
404
404
|
dependencies = [
|
|
405
405
|
"ed25519-dalek",
|
|
406
406
|
"getrandom 0.2.17",
|
|
@@ -416,7 +416,7 @@ dependencies = [
|
|
|
416
416
|
|
|
417
417
|
[[package]]
|
|
418
418
|
name = "letify-quic"
|
|
419
|
-
version = "2.12.
|
|
419
|
+
version = "2.12.4"
|
|
420
420
|
dependencies = [
|
|
421
421
|
"quinn",
|
|
422
422
|
"rcgen",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "letify-status",
|
|
3
|
-
"version": "2.12.
|
|
3
|
+
"version": "2.12.4",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "letify-status",
|
|
9
|
-
"version": "2.12.
|
|
9
|
+
"version": "2.12.4",
|
|
10
10
|
"license": "SEE LICENSE IN LICENSE",
|
|
11
11
|
"devDependencies": {
|
|
12
12
|
"@types/node": "^18.19.0",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "letify-status",
|
|
3
3
|
"displayName": "letify Status",
|
|
4
4
|
"description": "letify quota and GPU activity in the status bar, read from the letify CLI.",
|
|
5
|
-
"version": "2.12.
|
|
5
|
+
"version": "2.12.4",
|
|
6
6
|
"publisher": "darkpyonix",
|
|
7
7
|
"license": "SEE LICENSE IN LICENSE",
|
|
8
8
|
"repository": {
|
|
@@ -18,6 +18,7 @@ from typing import Any
|
|
|
18
18
|
import pytest
|
|
19
19
|
from conftest import PreparingLocal, provider_of
|
|
20
20
|
|
|
21
|
+
import letify
|
|
21
22
|
from letify.declare.env import Env
|
|
22
23
|
from letify.declare.instance import Instance
|
|
23
24
|
from letify.errors import ConfigError
|
|
@@ -221,6 +222,7 @@ def test_pull_source_is_the_media_url_with_the_token_and_the_project(fake_drive)
|
|
|
221
222
|
assert source["headers"] == {
|
|
222
223
|
"Authorization": f"Bearer {fake_drive.token}",
|
|
223
224
|
"x-goog-user-project": fake_drive.project,
|
|
225
|
+
"User-Agent": f"letify/{letify.__version__}",
|
|
224
226
|
}
|
|
225
227
|
|
|
226
228
|
|
|
@@ -1793,3 +1793,21 @@ def test_a_server_error_during_the_cookie_check_names_its_status(monkeypatch) ->
|
|
|
1793
1793
|
monkeypatch.setattr(kaggle_module, "urlopen", fail)
|
|
1794
1794
|
with pytest.raises(ValueError, match="could not be checked: HTTP 503"):
|
|
1795
1795
|
kaggle_module.verify_cookie(make_cookie())
|
|
1796
|
+
|
|
1797
|
+
|
|
1798
|
+
def test_every_kaggle_request_names_letify_as_its_user_agent(fake_kaggle, monkeypatch) -> None:
|
|
1799
|
+
"""Spec "Kaggle", User-Agent: kaggle.com answers the urllib default with HTTP 404."""
|
|
1800
|
+
import letify
|
|
1801
|
+
from letify.providers import kaggle as kaggle_module
|
|
1802
|
+
|
|
1803
|
+
seen = []
|
|
1804
|
+
|
|
1805
|
+
def record(request, timeout=None):
|
|
1806
|
+
seen.append(request)
|
|
1807
|
+
return fake_kaggle.urlopen(request, timeout)
|
|
1808
|
+
|
|
1809
|
+
monkeypatch.setattr(kaggle_module, "urlopen", record)
|
|
1810
|
+
session_channel(fake_kaggle)
|
|
1811
|
+
assert seen
|
|
1812
|
+
expected = f"letify/{letify.__version__}"
|
|
1813
|
+
assert [r.full_url for r in seen if r.get_header("User-agent") != expected] == []
|