@atomic-chat/core 0.5.1 → 0.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -0
- package/dist/app-daemon.js +20 -67
- package/dist/app-daemon.js.map +1 -1
- package/dist/backend/advisor/advisor.d.ts +132 -0
- package/dist/backend/advisor/advisor.js +537 -0
- package/dist/backend/advisor/advisor.js.map +1 -0
- package/dist/backend/advisor/index.d.ts +6 -0
- package/dist/backend/advisor/index.js +7 -0
- package/dist/backend/advisor/index.js.map +1 -0
- package/dist/backend/advisor/policy.d.ts +81 -0
- package/dist/backend/advisor/policy.js +154 -0
- package/dist/backend/advisor/policy.js.map +1 -0
- package/dist/backend/catalog/archive.d.ts +21 -7
- package/dist/backend/catalog/archive.js +57 -17
- package/dist/backend/catalog/archive.js.map +1 -1
- package/dist/backend/catalog/bundled-manifest-baseline.js +42 -26
- package/dist/backend/catalog/bundled-manifest-baseline.js.map +1 -1
- package/dist/backend/catalog/cuda-family.d.ts +12 -2
- package/dist/backend/catalog/cuda-family.js +30 -7
- package/dist/backend/catalog/cuda-family.js.map +1 -1
- package/dist/backend/catalog/index.d.ts +5 -0
- package/dist/backend/catalog/index.js +5 -0
- package/dist/backend/catalog/index.js.map +1 -1
- package/dist/backend/catalog/manifest.d.ts +5 -3
- package/dist/backend/catalog/manifest.js +12 -9
- package/dist/backend/catalog/manifest.js.map +1 -1
- package/dist/backend/catalog/migrate.d.ts +8 -6
- package/dist/backend/catalog/migrate.js +26 -15
- package/dist/backend/catalog/migrate.js.map +1 -1
- package/dist/backend/catalog/prism-catalog.d.ts +42 -0
- package/dist/backend/catalog/prism-catalog.js +101 -0
- package/dist/backend/catalog/prism-catalog.js.map +1 -0
- package/dist/backend/catalog/prism-manifest-baseline.d.ts +2 -0
- package/dist/backend/catalog/prism-manifest-baseline.js +11 -0
- package/dist/backend/catalog/prism-manifest-baseline.js.map +1 -0
- package/dist/backend/catalog/prism-manifest-baseline.json +134 -0
- package/dist/backend/catalog/prism-manifest.d.ts +90 -0
- package/dist/backend/catalog/prism-manifest.js +171 -0
- package/dist/backend/catalog/prism-manifest.js.map +1 -0
- package/dist/backend/catalog/turboquant-catalog.d.ts +60 -0
- package/dist/backend/catalog/turboquant-catalog.js +162 -0
- package/dist/backend/catalog/turboquant-catalog.js.map +1 -0
- package/dist/backend/catalog/turboquant-index.d.ts +104 -0
- package/dist/backend/catalog/turboquant-index.js +260 -0
- package/dist/backend/catalog/turboquant-index.js.map +1 -0
- package/dist/backend/index.d.ts +1 -0
- package/dist/backend/index.js +1 -0
- package/dist/backend/index.js.map +1 -1
- package/dist/backend/install/runtime-backend.d.ts +6 -6
- package/dist/backend/install/runtime-backend.js +23 -20
- package/dist/backend/install/runtime-backend.js.map +1 -1
- package/dist/backend/install/service.d.ts +106 -5
- package/dist/backend/install/service.js +247 -21
- package/dist/backend/install/service.js.map +1 -1
- package/dist/backend/installed/bundled.d.ts +19 -0
- package/dist/backend/installed/bundled.js +45 -0
- package/dist/backend/installed/bundled.js.map +1 -0
- package/dist/backend/installed/index.d.ts +1 -0
- package/dist/backend/installed/index.js +1 -0
- package/dist/backend/installed/index.js.map +1 -1
- package/dist/backend/installed/installed.js +3 -0
- package/dist/backend/installed/installed.js.map +1 -1
- package/dist/backend/optimal/optimal-cache.d.ts +27 -8
- package/dist/backend/optimal/optimal-cache.js +38 -19
- package/dist/backend/optimal/optimal-cache.js.map +1 -1
- package/dist/backend/optimal/optimal-store.js +1 -1
- package/dist/backend/optimal/optimal-store.js.map +1 -1
- package/dist/backend/select/categories.d.ts +2 -1
- package/dist/backend/select/categories.js +8 -1
- package/dist/backend/select/categories.js.map +1 -1
- package/dist/backend/select/features.d.ts +13 -5
- package/dist/backend/select/features.js +36 -6
- package/dist/backend/select/features.js.map +1 -1
- package/dist/backend/select/index.d.ts +2 -0
- package/dist/backend/select/index.js +2 -0
- package/dist/backend/select/index.js.map +1 -1
- package/dist/backend/select/prism.d.ts +54 -0
- package/dist/backend/select/prism.js +212 -0
- package/dist/backend/select/prism.js.map +1 -0
- package/dist/backend/select/recovery.d.ts +4 -2
- package/dist/backend/select/recovery.js +17 -5
- package/dist/backend/select/recovery.js.map +1 -1
- package/dist/backend/select/tiers.d.ts +20 -11
- package/dist/backend/select/tiers.js +49 -11
- package/dist/backend/select/tiers.js.map +1 -1
- package/dist/backend/select/turboquant-tiers.d.ts +45 -0
- package/dist/backend/select/turboquant-tiers.js +114 -0
- package/dist/backend/select/turboquant-tiers.js.map +1 -0
- package/dist/backend/types.d.ts +6 -69
- package/dist/cli/commands/backends.d.ts +10 -0
- package/dist/cli/commands/backends.js +142 -0
- package/dist/cli/commands/backends.js.map +1 -0
- package/dist/cli/commands/hardware.d.ts +13 -0
- package/dist/cli/commands/hardware.js +71 -0
- package/dist/cli/commands/hardware.js.map +1 -0
- package/dist/cli/commands/host-step.d.ts +28 -0
- package/dist/cli/commands/host-step.js +67 -0
- package/dist/cli/commands/host-step.js.map +1 -0
- package/dist/cli/commands/index.d.ts +4 -1
- package/dist/cli/commands/index.js +4 -1
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/serve.js +4 -4
- package/dist/cli/commands/serve.js.map +1 -1
- package/dist/cli/commands/shared.d.ts +6 -1
- package/dist/cli/commands/shared.js +7 -0
- package/dist/cli/commands/shared.js.map +1 -1
- package/dist/cli/io.d.ts +11 -0
- package/dist/cli/io.js +28 -3
- package/dist/cli/io.js.map +1 -1
- package/dist/cli/launch.js +2 -2
- package/dist/cli/launch.js.map +1 -1
- package/dist/cli/main.d.ts +1 -1
- package/dist/cli/main.js +11 -1
- package/dist/cli/main.js.map +1 -1
- package/dist/client/control-client.d.ts +128 -7
- package/dist/client/control-client.js +211 -12
- package/dist/client/control-client.js.map +1 -1
- package/dist/cloud/registry.js +9 -1
- package/dist/cloud/registry.js.map +1 -1
- package/dist/config/paths.d.ts +137 -0
- package/dist/config/paths.js +163 -0
- package/dist/config/paths.js.map +1 -1
- package/dist/contracts/backend-advisor.d.ts +225 -0
- package/dist/contracts/backend-advisor.js +14 -0
- package/dist/contracts/backend-advisor.js.map +1 -0
- package/dist/contracts/control-api.d.ts +7 -1
- package/dist/contracts/control-api.js +7 -1
- package/dist/contracts/control-api.js.map +1 -1
- package/dist/contracts/decision.d.ts +394 -0
- package/dist/contracts/decision.js +69 -0
- package/dist/contracts/decision.js.map +1 -0
- package/dist/contracts/diffusion.d.ts +62 -9
- package/dist/contracts/embedding.d.ts +103 -0
- package/dist/contracts/embedding.js +24 -0
- package/dist/contracts/embedding.js.map +1 -0
- package/dist/contracts/engine-builds.d.ts +108 -0
- package/dist/contracts/engine-builds.js +11 -0
- package/dist/contracts/engine-builds.js.map +1 -0
- package/dist/contracts/engines.d.ts +157 -0
- package/dist/contracts/engines.js +50 -0
- package/dist/contracts/engines.js.map +1 -0
- package/dist/contracts/environment.d.ts +774 -0
- package/dist/contracts/environment.js +116 -0
- package/dist/contracts/environment.js.map +1 -0
- package/dist/contracts/errors.d.ts +43 -2
- package/dist/contracts/errors.js +41 -0
- package/dist/contracts/errors.js.map +1 -1
- package/dist/contracts/events.d.ts +82 -4
- package/dist/contracts/hardware.d.ts +79 -6
- package/dist/contracts/hardware.js +9 -5
- package/dist/contracts/hardware.js.map +1 -1
- package/dist/contracts/index.d.ts +8 -0
- package/dist/contracts/index.js +8 -0
- package/dist/contracts/index.js.map +1 -1
- package/dist/contracts/model-compatibility.d.ts +97 -0
- package/dist/contracts/model-compatibility.js +6 -0
- package/dist/contracts/model-compatibility.js.map +1 -0
- package/dist/contracts/model-setup.d.ts +115 -0
- package/dist/contracts/model-setup.js +33 -0
- package/dist/contracts/model-setup.js.map +1 -0
- package/dist/contracts/model-yml.d.ts +14 -0
- package/dist/contracts/model-yml.js +1 -0
- package/dist/contracts/model-yml.js.map +1 -1
- package/dist/contracts/session.d.ts +45 -2
- package/dist/contracts/session.js +14 -1
- package/dist/contracts/session.js.map +1 -1
- package/dist/contracts/settings.d.ts +44 -1
- package/dist/contracts/settings.js.map +1 -1
- package/dist/core/atomic-core.d.ts +44 -5
- package/dist/core/atomic-core.js +24 -0
- package/dist/core/atomic-core.js.map +1 -1
- package/dist/core/create.js +517 -23
- package/dist/core/create.js.map +1 -1
- package/dist/core/gpu/index.d.ts +6 -0
- package/dist/core/gpu/index.js +7 -0
- package/dist/core/gpu/index.js.map +1 -0
- package/dist/core/gpu/policy.d.ts +68 -0
- package/dist/core/gpu/policy.js +99 -0
- package/dist/core/gpu/policy.js.map +1 -0
- package/dist/core/gpu/residency.d.ts +44 -0
- package/dist/core/gpu/residency.js +101 -0
- package/dist/core/gpu/residency.js.map +1 -0
- package/dist/core/gpu-residency.d.ts +39 -0
- package/dist/core/gpu-residency.js +32 -0
- package/dist/core/gpu-residency.js.map +1 -0
- package/dist/core/index.d.ts +1 -1
- package/dist/core/managed-engines.d.ts +207 -0
- package/dist/core/managed-engines.js +579 -0
- package/dist/core/managed-engines.js.map +1 -0
- package/dist/core/managed-environment.d.ts +72 -0
- package/dist/core/managed-environment.js +218 -0
- package/dist/core/managed-environment.js.map +1 -0
- package/dist/core/model-setup/index.d.ts +4 -0
- package/dist/core/model-setup/index.js +5 -0
- package/dist/core/model-setup/index.js.map +1 -0
- package/dist/core/model-setup/plan.d.ts +56 -0
- package/dist/core/model-setup/plan.js +158 -0
- package/dist/core/model-setup/plan.js.map +1 -0
- package/dist/core/model-setup/service.d.ts +92 -0
- package/dist/core/model-setup/service.js +329 -0
- package/dist/core/model-setup/service.js.map +1 -0
- package/dist/core/model-setup/store.d.ts +29 -0
- package/dist/core/model-setup/store.js +116 -0
- package/dist/core/model-setup/store.js.map +1 -0
- package/dist/core/model-setup/wiring.d.ts +59 -0
- package/dist/core/model-setup/wiring.js +132 -0
- package/dist/core/model-setup/wiring.js.map +1 -0
- package/dist/core/prism.d.ts +36 -0
- package/dist/core/prism.js +42 -0
- package/dist/core/prism.js.map +1 -0
- package/dist/core/public-server.d.ts +7 -0
- package/dist/core/public-server.js +2 -0
- package/dist/core/public-server.js.map +1 -1
- package/dist/core/sessions.d.ts +6 -1
- package/dist/core/sessions.js +18 -14
- package/dist/core/sessions.js.map +1 -1
- package/dist/core/types.d.ts +27 -1
- package/dist/core/types.js.map +1 -1
- package/dist/decision/args.d.ts +110 -0
- package/dist/decision/args.js +126 -0
- package/dist/decision/args.js.map +1 -0
- package/dist/decision/backoff.d.ts +25 -0
- package/dist/decision/backoff.js +33 -0
- package/dist/decision/backoff.js.map +1 -0
- package/dist/decision/engine-candidates.d.ts +52 -0
- package/dist/decision/engine-candidates.js +138 -0
- package/dist/decision/engine-candidates.js.map +1 -0
- package/dist/decision/engine-fallback.d.ts +41 -0
- package/dist/decision/engine-fallback.js +57 -0
- package/dist/decision/engine-fallback.js.map +1 -0
- package/dist/decision/engine-version.d.ts +27 -0
- package/dist/decision/engine-version.js +54 -0
- package/dist/decision/engine-version.js.map +1 -0
- package/dist/decision/engine.d.ts +114 -0
- package/dist/decision/engine.js +253 -0
- package/dist/decision/engine.js.map +1 -0
- package/dist/decision/http.d.ts +36 -0
- package/dist/decision/http.js +73 -0
- package/dist/decision/http.js.map +1 -0
- package/dist/decision/index.d.ts +20 -0
- package/dist/decision/index.js +21 -0
- package/dist/decision/index.js.map +1 -0
- package/dist/decision/model-facts.d.ts +32 -0
- package/dist/decision/model-facts.js +40 -0
- package/dist/decision/model-facts.js.map +1 -0
- package/dist/decision/outcome.d.ts +35 -0
- package/dist/decision/outcome.js +105 -0
- package/dist/decision/outcome.js.map +1 -0
- package/dist/decision/process.d.ts +67 -0
- package/dist/decision/process.js +133 -0
- package/dist/decision/process.js.map +1 -0
- package/dist/decision/readiness.d.ts +74 -0
- package/dist/decision/readiness.js +165 -0
- package/dist/decision/readiness.js.map +1 -0
- package/dist/decision/request.d.ts +11 -0
- package/dist/decision/request.js +56 -0
- package/dist/decision/request.js.map +1 -0
- package/dist/decision/service.d.ts +202 -0
- package/dist/decision/service.js +711 -0
- package/dist/decision/service.js.map +1 -0
- package/dist/decision/upstream-version.d.ts +23 -0
- package/dist/decision/upstream-version.js +34 -0
- package/dist/decision/upstream-version.js.map +1 -0
- package/dist/decision/wiring.d.ts +67 -0
- package/dist/decision/wiring.js +101 -0
- package/dist/decision/wiring.js.map +1 -0
- package/dist/diffusion/args.d.ts +4 -2
- package/dist/diffusion/args.js +10 -3
- package/dist/diffusion/args.js.map +1 -1
- package/dist/diffusion/image-job.js +1 -1
- package/dist/diffusion/image-job.js.map +1 -1
- package/dist/diffusion/install.d.ts +35 -11
- package/dist/diffusion/install.js +74 -49
- package/dist/diffusion/install.js.map +1 -1
- package/dist/diffusion/job-kind.d.ts +33 -7
- package/dist/diffusion/jobs.d.ts +6 -1
- package/dist/diffusion/jobs.js +60 -18
- package/dist/diffusion/jobs.js.map +1 -1
- package/dist/diffusion/parse.d.ts +1 -2
- package/dist/diffusion/parse.js +1 -13
- package/dist/diffusion/parse.js.map +1 -1
- package/dist/diffusion/progress.js +3 -0
- package/dist/diffusion/progress.js.map +1 -1
- package/dist/diffusion/server-process.d.ts +6 -0
- package/dist/diffusion/server-process.js +3 -2
- package/dist/diffusion/server-process.js.map +1 -1
- package/dist/diffusion/service.d.ts +52 -6
- package/dist/diffusion/service.js +215 -40
- package/dist/diffusion/service.js.map +1 -1
- package/dist/diffusion/session.d.ts +27 -3
- package/dist/diffusion/session.js +108 -17
- package/dist/diffusion/session.js.map +1 -1
- package/dist/diffusion/state.d.ts +19 -1
- package/dist/diffusion/state.js +10 -0
- package/dist/diffusion/state.js.map +1 -1
- package/dist/diffusion/tracker.d.ts +15 -1
- package/dist/diffusion/tracker.js +32 -6
- package/dist/diffusion/tracker.js.map +1 -1
- package/dist/diffusion/types.d.ts +7 -0
- package/dist/diffusion/types.js +11 -0
- package/dist/diffusion/types.js.map +1 -1
- package/dist/diffusion/video-estimate.d.ts +214 -0
- package/dist/diffusion/video-estimate.js +402 -0
- package/dist/diffusion/video-estimate.js.map +1 -0
- package/dist/diffusion/video-eta.d.ts +90 -0
- package/dist/diffusion/video-eta.js +248 -0
- package/dist/diffusion/video-eta.js.map +1 -0
- package/dist/diffusion/video-history.d.ts +45 -0
- package/dist/diffusion/video-history.js +121 -0
- package/dist/diffusion/video-history.js.map +1 -0
- package/dist/diffusion/video-job.d.ts +13 -5
- package/dist/diffusion/video-job.js +42 -15
- package/dist/diffusion/video-job.js.map +1 -1
- package/dist/diffusion/video-recipe.js +3 -0
- package/dist/diffusion/video-recipe.js.map +1 -1
- package/dist/diffusion/video-tiling.d.ts +54 -0
- package/dist/diffusion/video-tiling.js +70 -0
- package/dist/diffusion/video-tiling.js.map +1 -0
- package/dist/diffusion/wiring.d.ts +14 -1
- package/dist/diffusion/wiring.js +7 -0
- package/dist/diffusion/wiring.js.map +1 -1
- package/dist/downloads/protocol.d.ts +3 -8
- package/dist/downloads/protocol.js.map +1 -1
- package/dist/embedding/args.d.ts +39 -0
- package/dist/embedding/args.js +46 -0
- package/dist/embedding/args.js.map +1 -0
- package/dist/embedding/engine.d.ts +50 -0
- package/dist/embedding/engine.js +100 -0
- package/dist/embedding/engine.js.map +1 -0
- package/dist/embedding/ffmpeg.d.ts +18 -0
- package/dist/embedding/ffmpeg.js +63 -0
- package/dist/embedding/ffmpeg.js.map +1 -0
- package/dist/embedding/index.d.ts +16 -0
- package/dist/embedding/index.js +17 -0
- package/dist/embedding/index.js.map +1 -0
- package/dist/embedding/model-facts.d.ts +51 -0
- package/dist/embedding/model-facts.js +84 -0
- package/dist/embedding/model-facts.js.map +1 -0
- package/dist/embedding/process.d.ts +66 -0
- package/dist/embedding/process.js +131 -0
- package/dist/embedding/process.js.map +1 -0
- package/dist/embedding/readiness.d.ts +56 -0
- package/dist/embedding/readiness.js +114 -0
- package/dist/embedding/readiness.js.map +1 -0
- package/dist/embedding/request.d.ts +43 -0
- package/dist/embedding/request.js +285 -0
- package/dist/embedding/request.js.map +1 -0
- package/dist/embedding/service.d.ts +152 -0
- package/dist/embedding/service.js +602 -0
- package/dist/embedding/service.js.map +1 -0
- package/dist/embedding/wiring.d.ts +51 -0
- package/dist/embedding/wiring.js +79 -0
- package/dist/embedding/wiring.js.map +1 -0
- package/dist/engine-builds/builds.d.ts +54 -0
- package/dist/engine-builds/builds.js +151 -0
- package/dist/engine-builds/builds.js.map +1 -0
- package/dist/engine-builds/index.d.ts +10 -0
- package/dist/engine-builds/index.js +11 -0
- package/dist/engine-builds/index.js.map +1 -0
- package/dist/engine-builds/install.d.ts +42 -0
- package/dist/engine-builds/install.js +100 -0
- package/dist/engine-builds/install.js.map +1 -0
- package/dist/engine-builds/manifest.d.ts +121 -0
- package/dist/engine-builds/manifest.js +254 -0
- package/dist/engine-builds/manifest.js.map +1 -0
- package/dist/engine-builds/order.d.ts +24 -0
- package/dist/engine-builds/order.js +44 -0
- package/dist/engine-builds/order.js.map +1 -0
- package/dist/engine-builds/select.d.ts +123 -0
- package/dist/engine-builds/select.js +223 -0
- package/dist/engine-builds/select.js.map +1 -0
- package/dist/engine-builds/service.d.ts +123 -0
- package/dist/engine-builds/service.js +392 -0
- package/dist/engine-builds/service.js.map +1 -0
- package/dist/engines/descriptor-order.d.ts +28 -0
- package/dist/engines/descriptor-order.js +60 -0
- package/dist/engines/descriptor-order.js.map +1 -0
- package/dist/engines/engine-build.d.ts +23 -0
- package/dist/engines/engine-build.js +58 -0
- package/dist/engines/engine-build.js.map +1 -0
- package/dist/engines/index.d.ts +10 -0
- package/dist/engines/index.js +11 -0
- package/dist/engines/index.js.map +1 -0
- package/dist/engines/llamacpp.d.ts +71 -0
- package/dist/engines/llamacpp.js +176 -0
- package/dist/engines/llamacpp.js.map +1 -0
- package/dist/engines/managed.d.ts +49 -0
- package/dist/engines/managed.js +88 -0
- package/dist/engines/managed.js.map +1 -0
- package/dist/engines/service.d.ts +46 -0
- package/dist/engines/service.js +61 -0
- package/dist/engines/service.js.map +1 -0
- package/dist/engines/versions.d.ts +65 -0
- package/dist/engines/versions.js +259 -0
- package/dist/engines/versions.js.map +1 -0
- package/dist/hardware/cpu-flags.d.ts +44 -0
- package/dist/hardware/cpu-flags.js +206 -0
- package/dist/hardware/cpu-flags.js.map +1 -0
- package/dist/hardware/drm-sysfs.d.ts +51 -0
- package/dist/hardware/drm-sysfs.js +67 -0
- package/dist/hardware/drm-sysfs.js.map +1 -0
- package/dist/hardware/facts.d.ts +42 -0
- package/dist/hardware/facts.js +92 -0
- package/dist/hardware/facts.js.map +1 -0
- package/dist/hardware/index.d.ts +19 -3
- package/dist/hardware/index.js +19 -3
- package/dist/hardware/index.js.map +1 -1
- package/dist/hardware/merge.d.ts +55 -0
- package/dist/hardware/merge.js +141 -0
- package/dist/hardware/merge.js.map +1 -0
- package/dist/hardware/nvidia-smi.d.ts +43 -0
- package/dist/hardware/nvidia-smi.js +118 -0
- package/dist/hardware/nvidia-smi.js.map +1 -0
- package/dist/hardware/probe-common.d.ts +72 -0
- package/dist/hardware/probe-common.js +106 -0
- package/dist/hardware/probe-common.js.map +1 -0
- package/dist/hardware/probe-darwin.d.ts +20 -0
- package/dist/hardware/probe-darwin.js +76 -0
- package/dist/hardware/probe-darwin.js.map +1 -0
- package/dist/hardware/probe-linux.d.ts +9 -0
- package/dist/hardware/probe-linux.js +133 -0
- package/dist/hardware/probe-linux.js.map +1 -0
- package/dist/hardware/probe-windows.d.ts +7 -0
- package/dist/hardware/probe-windows.js +50 -0
- package/dist/hardware/probe-windows.js.map +1 -0
- package/dist/hardware/probe.d.ts +16 -0
- package/dist/hardware/probe.js +65 -0
- package/dist/hardware/probe.js.map +1 -0
- package/dist/hardware/service.d.ts +60 -0
- package/dist/hardware/service.js +114 -0
- package/dist/hardware/service.js.map +1 -0
- package/dist/hardware/vulkan.d.ts +47 -0
- package/dist/hardware/vulkan.js +148 -0
- package/dist/hardware/vulkan.js.map +1 -0
- package/dist/hardware/windows-video.d.ts +97 -0
- package/dist/hardware/windows-video.js +214 -0
- package/dist/hardware/windows-video.js.map +1 -0
- package/dist/host/app-daemon.d.ts +47 -0
- package/dist/host/app-daemon.js +146 -0
- package/dist/host/app-daemon.js.map +1 -0
- package/dist/host/index.d.ts +5 -3
- package/dist/host/index.js +5 -3
- package/dist/host/index.js.map +1 -1
- package/dist/host/log-file.d.ts +74 -0
- package/dist/host/log-file.js +214 -0
- package/dist/host/log-file.js.map +1 -0
- package/dist/host/recipes/enable-wsl.d.ts +63 -0
- package/dist/host/recipes/enable-wsl.js +73 -0
- package/dist/host/recipes/enable-wsl.js.map +1 -0
- package/dist/host/recipes/executor-io-windows.d.ts +69 -0
- package/dist/host/recipes/executor-io-windows.js +235 -0
- package/dist/host/recipes/executor-io-windows.js.map +1 -0
- package/dist/host/recipes/executor-io.d.ts +80 -0
- package/dist/host/recipes/executor-io.js +211 -0
- package/dist/host/recipes/executor-io.js.map +1 -0
- package/dist/host/recipes/executor.d.ts +81 -0
- package/dist/host/recipes/executor.js +678 -0
- package/dist/host/recipes/executor.js.map +1 -0
- package/dist/host/recipes/guest-executor.d.ts +29 -0
- package/dist/host/recipes/guest-executor.js +76 -0
- package/dist/host/recipes/guest-executor.js.map +1 -0
- package/dist/host/recipes/index.d.ts +16 -0
- package/dist/host/recipes/index.js +17 -0
- package/dist/host/recipes/index.js.map +1 -0
- package/dist/host/recipes/install-container-runtime.d.ts +389 -0
- package/dist/host/recipes/install-container-runtime.js +796 -0
- package/dist/host/recipes/install-container-runtime.js.map +1 -0
- package/dist/host/recipes/openpgp.d.ts +23 -0
- package/dist/host/recipes/openpgp.js +153 -0
- package/dist/host/recipes/openpgp.js.map +1 -0
- package/dist/host/recipes/request-file.d.ts +96 -0
- package/dist/host/recipes/request-file.js +103 -0
- package/dist/host/recipes/request-file.js.map +1 -0
- package/dist/lock/process-journal.d.ts +5 -2
- package/dist/lock/process-journal.js.map +1 -1
- package/dist/models/capabilities.d.ts +7 -0
- package/dist/models/capabilities.js +17 -1
- package/dist/models/capabilities.js.map +1 -1
- package/dist/models/compatibility/index.d.ts +10 -0
- package/dist/models/compatibility/index.js +11 -0
- package/dist/models/compatibility/index.js.map +1 -0
- package/dist/models/compatibility/inspect.d.ts +19 -0
- package/dist/models/compatibility/inspect.js +59 -0
- package/dist/models/compatibility/inspect.js.map +1 -0
- package/dist/models/compatibility/resolve.d.ts +59 -0
- package/dist/models/compatibility/resolve.js +219 -0
- package/dist/models/compatibility/resolve.js.map +1 -0
- package/dist/models/compatibility/rules-baseline.d.ts +2 -0
- package/dist/models/compatibility/rules-baseline.js +10 -0
- package/dist/models/compatibility/rules-baseline.js.map +1 -0
- package/dist/models/compatibility/rules-baseline.json +292 -0
- package/dist/models/compatibility/rules-service.d.ts +36 -0
- package/dist/models/compatibility/rules-service.js +109 -0
- package/dist/models/compatibility/rules-service.js.map +1 -0
- package/dist/models/compatibility/rules.d.ts +81 -0
- package/dist/models/compatibility/rules.js +164 -0
- package/dist/models/compatibility/rules.js.map +1 -0
- package/dist/models/compatibility/service.d.ts +59 -0
- package/dist/models/compatibility/service.js +137 -0
- package/dist/models/compatibility/service.js.map +1 -0
- package/dist/models/decision-checkpoint.d.ts +22 -0
- package/dist/models/decision-checkpoint.js +33 -0
- package/dist/models/decision-checkpoint.js.map +1 -0
- package/dist/models/gguf/classify.d.ts +27 -1
- package/dist/models/gguf/classify.js +78 -2
- package/dist/models/gguf/classify.js.map +1 -1
- package/dist/models/gguf/index.d.ts +1 -0
- package/dist/models/gguf/index.js +1 -0
- package/dist/models/gguf/index.js.map +1 -1
- package/dist/models/gguf/tensors.d.ts +56 -0
- package/dist/models/gguf/tensors.js +236 -0
- package/dist/models/gguf/tensors.js.map +1 -0
- package/dist/models/index.d.ts +2 -0
- package/dist/models/index.js +2 -0
- package/dist/models/index.js.map +1 -1
- package/dist/router/resolve.d.ts +7 -1
- package/dist/router/resolve.js +14 -1
- package/dist/router/resolve.js.map +1 -1
- package/dist/runtime/container/argv.d.ts +88 -0
- package/dist/runtime/container/argv.js +406 -0
- package/dist/runtime/container/argv.js.map +1 -0
- package/dist/runtime/container/docker-binary.d.ts +4 -0
- package/dist/runtime/container/docker-binary.js +34 -0
- package/dist/runtime/container/docker-binary.js.map +1 -0
- package/dist/runtime/container/env.d.ts +17 -0
- package/dist/runtime/container/env.js +52 -0
- package/dist/runtime/container/env.js.map +1 -0
- package/dist/runtime/container/exec.d.ts +27 -0
- package/dist/runtime/container/exec.js +79 -0
- package/dist/runtime/container/exec.js.map +1 -0
- package/dist/runtime/container/execution-journal.d.ts +55 -0
- package/dist/runtime/container/execution-journal.js +167 -0
- package/dist/runtime/container/execution-journal.js.map +1 -0
- package/dist/runtime/container/heartbeat.d.ts +47 -0
- package/dist/runtime/container/heartbeat.js +78 -0
- package/dist/runtime/container/heartbeat.js.map +1 -0
- package/dist/runtime/container/index.d.ts +30 -0
- package/dist/runtime/container/index.js +31 -0
- package/dist/runtime/container/index.js.map +1 -0
- package/dist/runtime/container/operations.d.ts +40 -0
- package/dist/runtime/container/operations.js +233 -0
- package/dist/runtime/container/operations.js.map +1 -0
- package/dist/runtime/container/pull.d.ts +48 -0
- package/dist/runtime/container/pull.js +280 -0
- package/dist/runtime/container/pull.js.map +1 -0
- package/dist/runtime/container/reconcile.d.ts +34 -0
- package/dist/runtime/container/reconcile.js +79 -0
- package/dist/runtime/container/reconcile.js.map +1 -0
- package/dist/runtime/container/types.d.ts +124 -0
- package/dist/runtime/container/types.js +2 -0
- package/dist/runtime/container/types.js.map +1 -0
- package/dist/runtime/container/watchdog.d.ts +114 -0
- package/dist/runtime/container/watchdog.js +418 -0
- package/dist/runtime/container/watchdog.js.map +1 -0
- package/dist/runtime/container/wiring.d.ts +78 -0
- package/dist/runtime/container/wiring.js +92 -0
- package/dist/runtime/container/wiring.js.map +1 -0
- package/dist/runtime/container/wsl-exec.d.ts +13 -0
- package/dist/runtime/container/wsl-exec.js +18 -0
- package/dist/runtime/container/wsl-exec.js.map +1 -0
- package/dist/runtime/environment/cached-document.d.ts +128 -0
- package/dist/runtime/environment/cached-document.js +218 -0
- package/dist/runtime/environment/cached-document.js.map +1 -0
- package/dist/runtime/environment/canonical-json.d.ts +78 -0
- package/dist/runtime/environment/canonical-json.js +86 -0
- package/dist/runtime/environment/canonical-json.js.map +1 -0
- package/dist/runtime/environment/descriptor-provider.d.ts +121 -0
- package/dist/runtime/environment/descriptor-provider.js +159 -0
- package/dist/runtime/environment/descriptor-provider.js.map +1 -0
- package/dist/runtime/environment/descriptor.d.ts +35 -0
- package/dist/runtime/environment/descriptor.js +239 -0
- package/dist/runtime/environment/descriptor.js.map +1 -0
- package/dist/runtime/environment/diagnostics.d.ts +50 -0
- package/dist/runtime/environment/diagnostics.js +114 -0
- package/dist/runtime/environment/diagnostics.js.map +1 -0
- package/dist/runtime/environment/document-fields.d.ts +39 -0
- package/dist/runtime/environment/document-fields.js +96 -0
- package/dist/runtime/environment/document-fields.js.map +1 -0
- package/dist/runtime/environment/environment-manifest-provider.d.ts +65 -0
- package/dist/runtime/environment/environment-manifest-provider.js +89 -0
- package/dist/runtime/environment/environment-manifest-provider.js.map +1 -0
- package/dist/runtime/environment/environment-manifest.d.ts +35 -0
- package/dist/runtime/environment/environment-manifest.js +131 -0
- package/dist/runtime/environment/environment-manifest.js.map +1 -0
- package/dist/runtime/environment/guest-host.d.ts +43 -0
- package/dist/runtime/environment/guest-host.js +88 -0
- package/dist/runtime/environment/guest-host.js.map +1 -0
- package/dist/runtime/environment/host-exec.d.ts +38 -0
- package/dist/runtime/environment/host-exec.js +145 -0
- package/dist/runtime/environment/host-exec.js.map +1 -0
- package/dist/runtime/environment/host-step-failure.d.ts +33 -0
- package/dist/runtime/environment/host-step-failure.js +34 -0
- package/dist/runtime/environment/host-step-failure.js.map +1 -0
- package/dist/runtime/environment/index.d.ts +56 -0
- package/dist/runtime/environment/index.js +57 -0
- package/dist/runtime/environment/index.js.map +1 -0
- package/dist/runtime/environment/installations.d.ts +25 -0
- package/dist/runtime/environment/installations.js +70 -0
- package/dist/runtime/environment/installations.js.map +1 -0
- package/dist/runtime/environment/inventory.d.ts +42 -0
- package/dist/runtime/environment/inventory.js +57 -0
- package/dist/runtime/environment/inventory.js.map +1 -0
- package/dist/runtime/environment/linux-blockers.d.ts +130 -0
- package/dist/runtime/environment/linux-blockers.js +251 -0
- package/dist/runtime/environment/linux-blockers.js.map +1 -0
- package/dist/runtime/environment/linux-docker-facts.d.ts +200 -0
- package/dist/runtime/environment/linux-docker-facts.js +342 -0
- package/dist/runtime/environment/linux-docker-facts.js.map +1 -0
- package/dist/runtime/environment/linux-docker-network.d.ts +80 -0
- package/dist/runtime/environment/linux-docker-network.js +195 -0
- package/dist/runtime/environment/linux-docker-network.js.map +1 -0
- package/dist/runtime/environment/linux-host.d.ts +22 -0
- package/dist/runtime/environment/linux-host.js +98 -0
- package/dist/runtime/environment/linux-host.js.map +1 -0
- package/dist/runtime/environment/linux-plan.d.ts +126 -0
- package/dist/runtime/environment/linux-plan.js +392 -0
- package/dist/runtime/environment/linux-plan.js.map +1 -0
- package/dist/runtime/environment/linux-probe.d.ts +245 -0
- package/dist/runtime/environment/linux-probe.js +315 -0
- package/dist/runtime/environment/linux-probe.js.map +1 -0
- package/dist/runtime/environment/linux-provisioner.d.ts +102 -0
- package/dist/runtime/environment/linux-provisioner.js +734 -0
- package/dist/runtime/environment/linux-provisioner.js.map +1 -0
- package/dist/runtime/environment/provisioner-descriptors.d.ts +17 -0
- package/dist/runtime/environment/provisioner-descriptors.js +62 -0
- package/dist/runtime/environment/provisioner-descriptors.js.map +1 -0
- package/dist/runtime/environment/recovery.d.ts +74 -0
- package/dist/runtime/environment/recovery.js +121 -0
- package/dist/runtime/environment/recovery.js.map +1 -0
- package/dist/runtime/environment/rootfs-download.d.ts +2 -0
- package/dist/runtime/environment/rootfs-download.js +47 -0
- package/dist/runtime/environment/rootfs-download.js.map +1 -0
- package/dist/runtime/environment/service.d.ts +280 -0
- package/dist/runtime/environment/service.js +776 -0
- package/dist/runtime/environment/service.js.map +1 -0
- package/dist/runtime/environment/state.d.ts +163 -0
- package/dist/runtime/environment/state.js +479 -0
- package/dist/runtime/environment/state.js.map +1 -0
- package/dist/runtime/environment/store-models.d.ts +19 -0
- package/dist/runtime/environment/store-models.js +30 -0
- package/dist/runtime/environment/store-models.js.map +1 -0
- package/dist/runtime/environment/store.d.ts +210 -0
- package/dist/runtime/environment/store.js +438 -0
- package/dist/runtime/environment/store.js.map +1 -0
- package/dist/runtime/environment/windows-environment-record.d.ts +48 -0
- package/dist/runtime/environment/windows-environment-record.js +89 -0
- package/dist/runtime/environment/windows-environment-record.js.map +1 -0
- package/dist/runtime/environment/windows-forwarding.d.ts +27 -0
- package/dist/runtime/environment/windows-forwarding.js +84 -0
- package/dist/runtime/environment/windows-forwarding.js.map +1 -0
- package/dist/runtime/environment/windows-guest-setup.d.ts +48 -0
- package/dist/runtime/environment/windows-guest-setup.js +157 -0
- package/dist/runtime/environment/windows-guest-setup.js.map +1 -0
- package/dist/runtime/environment/windows-host.d.ts +46 -0
- package/dist/runtime/environment/windows-host.js +163 -0
- package/dist/runtime/environment/windows-host.js.map +1 -0
- package/dist/runtime/environment/windows-plan.d.ts +78 -0
- package/dist/runtime/environment/windows-plan.js +216 -0
- package/dist/runtime/environment/windows-plan.js.map +1 -0
- package/dist/runtime/environment/windows-probe.d.ts +135 -0
- package/dist/runtime/environment/windows-probe.js +261 -0
- package/dist/runtime/environment/windows-probe.js.map +1 -0
- package/dist/runtime/environment/windows-provisioner.d.ts +113 -0
- package/dist/runtime/environment/windows-provisioner.js +782 -0
- package/dist/runtime/environment/windows-provisioner.js.map +1 -0
- package/dist/runtime/environment/wiring.d.ts +117 -0
- package/dist/runtime/environment/wiring.js +354 -0
- package/dist/runtime/environment/wiring.js.map +1 -0
- package/dist/runtime/foundation-models/runtime.d.ts +8 -0
- package/dist/runtime/foundation-models/runtime.js +5 -2
- package/dist/runtime/foundation-models/runtime.js.map +1 -1
- package/dist/runtime/llamacpp/args.d.ts +10 -1
- package/dist/runtime/llamacpp/args.js +43 -7
- package/dist/runtime/llamacpp/args.js.map +1 -1
- package/dist/runtime/llamacpp/fit-margin.d.ts +46 -0
- package/dist/runtime/llamacpp/fit-margin.js +47 -0
- package/dist/runtime/llamacpp/fit-margin.js.map +1 -0
- package/dist/runtime/llamacpp/index.d.ts +1 -0
- package/dist/runtime/llamacpp/index.js +1 -0
- package/dist/runtime/llamacpp/index.js.map +1 -1
- package/dist/runtime/llamacpp/load-plan.d.ts +23 -1
- package/dist/runtime/llamacpp/load-plan.js +82 -1
- package/dist/runtime/llamacpp/load-plan.js.map +1 -1
- package/dist/runtime/llamacpp/policy.d.ts +16 -0
- package/dist/runtime/llamacpp/policy.js +20 -0
- package/dist/runtime/llamacpp/policy.js.map +1 -1
- package/dist/runtime/llamacpp/probe.d.ts +21 -1
- package/dist/runtime/llamacpp/probe.js +32 -6
- package/dist/runtime/llamacpp/probe.js.map +1 -1
- package/dist/runtime/llamacpp/runtime.d.ts +56 -1
- package/dist/runtime/llamacpp/runtime.js +142 -15
- package/dist/runtime/llamacpp/runtime.js.map +1 -1
- package/dist/runtime/managed-engines/index.d.ts +8 -0
- package/dist/runtime/managed-engines/index.js +9 -0
- package/dist/runtime/managed-engines/index.js.map +1 -0
- package/dist/runtime/managed-engines/runtime.d.ts +140 -0
- package/dist/runtime/managed-engines/runtime.js +402 -0
- package/dist/runtime/managed-engines/runtime.js.map +1 -0
- package/dist/runtime/managed-engines/spec.d.ts +70 -0
- package/dist/runtime/managed-engines/spec.js +39 -0
- package/dist/runtime/managed-engines/spec.js.map +1 -0
- package/dist/runtime/managed-models/check.d.ts +50 -0
- package/dist/runtime/managed-models/check.js +157 -0
- package/dist/runtime/managed-models/check.js.map +1 -0
- package/dist/runtime/managed-models/compatibility.d.ts +256 -0
- package/dist/runtime/managed-models/compatibility.js +594 -0
- package/dist/runtime/managed-models/compatibility.js.map +1 -0
- package/dist/runtime/managed-models/delete.d.ts +15 -0
- package/dist/runtime/managed-models/delete.js +60 -0
- package/dist/runtime/managed-models/delete.js.map +1 -0
- package/dist/runtime/managed-models/guest-files.d.ts +8 -0
- package/dist/runtime/managed-models/guest-files.js +49 -0
- package/dist/runtime/managed-models/guest-files.js.map +1 -0
- package/dist/runtime/managed-models/index.d.ts +17 -0
- package/dist/runtime/managed-models/index.js +18 -0
- package/dist/runtime/managed-models/index.js.map +1 -0
- package/dist/runtime/managed-models/location.d.ts +22 -0
- package/dist/runtime/managed-models/location.js +53 -0
- package/dist/runtime/managed-models/location.js.map +1 -0
- package/dist/runtime/managed-models/migrate.d.ts +30 -0
- package/dist/runtime/managed-models/migrate.js +119 -0
- package/dist/runtime/managed-models/migrate.js.map +1 -0
- package/dist/runtime/managed-models/model-dir.d.ts +36 -0
- package/dist/runtime/managed-models/model-dir.js +136 -0
- package/dist/runtime/managed-models/model-dir.js.map +1 -0
- package/dist/runtime/managed-models/quant-format.d.ts +71 -0
- package/dist/runtime/managed-models/quant-format.js +299 -0
- package/dist/runtime/managed-models/quant-format.js.map +1 -0
- package/dist/runtime/managed-models/registry.d.ts +26 -0
- package/dist/runtime/managed-models/registry.js +66 -0
- package/dist/runtime/managed-models/registry.js.map +1 -0
- package/dist/runtime/managed-text/adapter.d.ts +266 -0
- package/dist/runtime/managed-text/adapter.js +96 -0
- package/dist/runtime/managed-text/adapter.js.map +1 -0
- package/dist/runtime/managed-text/backend-target.d.ts +3 -0
- package/dist/runtime/managed-text/backend-target.js +52 -0
- package/dist/runtime/managed-text/backend-target.js.map +1 -0
- package/dist/runtime/managed-text/deployment.d.ts +14 -0
- package/dist/runtime/managed-text/deployment.js +32 -0
- package/dist/runtime/managed-text/deployment.js.map +1 -0
- package/dist/runtime/managed-text/engine-cache.d.ts +15 -0
- package/dist/runtime/managed-text/engine-cache.js +64 -0
- package/dist/runtime/managed-text/engine-cache.js.map +1 -0
- package/dist/runtime/managed-text/gateway.d.ts +158 -0
- package/dist/runtime/managed-text/gateway.js +535 -0
- package/dist/runtime/managed-text/gateway.js.map +1 -0
- package/dist/runtime/managed-text/generation-defaults.d.ts +23 -0
- package/dist/runtime/managed-text/generation-defaults.js +51 -0
- package/dist/runtime/managed-text/generation-defaults.js.map +1 -0
- package/dist/runtime/managed-text/index.d.ts +26 -0
- package/dist/runtime/managed-text/index.js +27 -0
- package/dist/runtime/managed-text/index.js.map +1 -0
- package/dist/runtime/managed-text/lifecycle.d.ts +276 -0
- package/dist/runtime/managed-text/lifecycle.js +859 -0
- package/dist/runtime/managed-text/lifecycle.js.map +1 -0
- package/dist/runtime/managed-text/load-policy.d.ts +47 -0
- package/dist/runtime/managed-text/load-policy.js +111 -0
- package/dist/runtime/managed-text/load-policy.js.map +1 -0
- package/dist/runtime/managed-text/mount-source.d.ts +14 -0
- package/dist/runtime/managed-text/mount-source.js +18 -0
- package/dist/runtime/managed-text/mount-source.js.map +1 -0
- package/dist/runtime/managed-text/readiness.d.ts +13 -0
- package/dist/runtime/managed-text/readiness.js +24 -0
- package/dist/runtime/managed-text/readiness.js.map +1 -0
- package/dist/runtime/managed-text/request-rules.d.ts +18 -0
- package/dist/runtime/managed-text/request-rules.js +62 -0
- package/dist/runtime/managed-text/request-rules.js.map +1 -0
- package/dist/runtime/managed-text/types.d.ts +88 -0
- package/dist/runtime/managed-text/types.js +12 -0
- package/dist/runtime/managed-text/types.js.map +1 -0
- package/dist/runtime/managed-text/wsl-deployment.d.ts +24 -0
- package/dist/runtime/managed-text/wsl-deployment.js +70 -0
- package/dist/runtime/managed-text/wsl-deployment.js.map +1 -0
- package/dist/runtime/mlx/errors.d.ts +6 -1
- package/dist/runtime/mlx/errors.js +7 -2
- package/dist/runtime/mlx/errors.js.map +1 -1
- package/dist/runtime/mlx/runtime.d.ts +36 -1
- package/dist/runtime/mlx/runtime.js +85 -4
- package/dist/runtime/mlx/runtime.js.map +1 -1
- package/dist/runtime/shared/backend-output.d.ts +23 -0
- package/dist/runtime/shared/backend-output.js +32 -0
- package/dist/runtime/shared/backend-output.js.map +1 -0
- package/dist/runtime/shared/bounded-output.d.ts +24 -0
- package/dist/runtime/shared/bounded-output.js +63 -0
- package/dist/runtime/shared/bounded-output.js.map +1 -0
- package/dist/runtime/shared/external-sessions.js +9 -1
- package/dist/runtime/shared/external-sessions.js.map +1 -1
- package/dist/runtime/shared/gpu-occupancy.d.ts +60 -0
- package/dist/runtime/shared/gpu-occupancy.js +10 -0
- package/dist/runtime/shared/gpu-occupancy.js.map +1 -0
- package/dist/runtime/shared/index.d.ts +4 -0
- package/dist/runtime/shared/index.js +4 -0
- package/dist/runtime/shared/index.js.map +1 -1
- package/dist/runtime/shared/local-runtime.d.ts +35 -0
- package/dist/runtime/shared/ports.d.ts +6 -0
- package/dist/runtime/shared/ports.js +12 -1
- package/dist/runtime/shared/ports.js.map +1 -1
- package/dist/runtime/shared/process.d.ts +11 -0
- package/dist/runtime/shared/process.js +20 -0
- package/dist/runtime/shared/process.js.map +1 -1
- package/dist/runtime/shared/redact-args.d.ts +7 -0
- package/dist/runtime/shared/redact-args.js +26 -0
- package/dist/runtime/shared/redact-args.js.map +1 -0
- package/dist/runtime/shared/sidecar.d.ts +15 -0
- package/dist/runtime/shared/sidecar.js +43 -8
- package/dist/runtime/shared/sidecar.js.map +1 -1
- package/dist/runtime/tensorrt-llm/adapter.d.ts +250 -0
- package/dist/runtime/tensorrt-llm/adapter.js +1011 -0
- package/dist/runtime/tensorrt-llm/adapter.js.map +1 -0
- package/dist/runtime/tensorrt-llm/check.d.ts +12 -0
- package/dist/runtime/tensorrt-llm/check.js +21 -0
- package/dist/runtime/tensorrt-llm/check.js.map +1 -0
- package/dist/runtime/tensorrt-llm/compatibility.d.ts +100 -0
- package/dist/runtime/tensorrt-llm/compatibility.js +181 -0
- package/dist/runtime/tensorrt-llm/compatibility.js.map +1 -0
- package/dist/runtime/tensorrt-llm/engine.d.ts +3 -0
- package/dist/runtime/tensorrt-llm/engine.js +24 -0
- package/dist/runtime/tensorrt-llm/engine.js.map +1 -0
- package/dist/runtime/tensorrt-llm/host-facts.d.ts +55 -0
- package/dist/runtime/tensorrt-llm/host-facts.js +87 -0
- package/dist/runtime/tensorrt-llm/host-facts.js.map +1 -0
- package/dist/runtime/tensorrt-llm/index.d.ts +30 -0
- package/dist/runtime/tensorrt-llm/index.js +31 -0
- package/dist/runtime/tensorrt-llm/index.js.map +1 -0
- package/dist/runtime/tensorrt-llm/installation.d.ts +23 -0
- package/dist/runtime/tensorrt-llm/installation.js +53 -0
- package/dist/runtime/tensorrt-llm/installation.js.map +1 -0
- package/dist/runtime/tensorrt-llm/kv-cache.d.ts +25 -0
- package/dist/runtime/tensorrt-llm/kv-cache.js +28 -0
- package/dist/runtime/tensorrt-llm/kv-cache.js.map +1 -0
- package/dist/runtime/tensorrt-llm/prelaunch.d.ts +20 -0
- package/dist/runtime/tensorrt-llm/prelaunch.js +168 -0
- package/dist/runtime/tensorrt-llm/prelaunch.js.map +1 -0
- package/dist/runtime/tensorrt-llm/route-policy.d.ts +19 -0
- package/dist/runtime/tensorrt-llm/route-policy.js +17 -0
- package/dist/runtime/tensorrt-llm/route-policy.js.map +1 -0
- package/dist/runtime/tensorrt-llm/settings.d.ts +7 -0
- package/dist/runtime/tensorrt-llm/settings.js +48 -0
- package/dist/runtime/tensorrt-llm/settings.js.map +1 -0
- package/dist/runtime/vllm/adapter.d.ts +46 -0
- package/dist/runtime/vllm/adapter.js +425 -0
- package/dist/runtime/vllm/adapter.js.map +1 -0
- package/dist/runtime/vllm/engine.d.ts +16 -0
- package/dist/runtime/vllm/engine.js +37 -0
- package/dist/runtime/vllm/engine.js.map +1 -0
- package/dist/runtime/vllm/index.d.ts +11 -0
- package/dist/runtime/vllm/index.js +12 -0
- package/dist/runtime/vllm/index.js.map +1 -0
- package/dist/runtime/vllm/memory.d.ts +69 -0
- package/dist/runtime/vllm/memory.js +123 -0
- package/dist/runtime/vllm/memory.js.map +1 -0
- package/dist/runtime/vllm/settings.d.ts +52 -0
- package/dist/runtime/vllm/settings.js +151 -0
- package/dist/runtime/vllm/settings.js.map +1 -0
- package/dist/runtime/wsl/guest-paths.d.ts +33 -0
- package/dist/runtime/wsl/guest-paths.js +83 -0
- package/dist/runtime/wsl/guest-paths.js.map +1 -0
- package/dist/runtime/wsl/guest-scope.d.ts +14 -0
- package/dist/runtime/wsl/guest-scope.js +98 -0
- package/dist/runtime/wsl/guest-scope.js.map +1 -0
- package/dist/runtime/wsl/index.d.ts +12 -0
- package/dist/runtime/wsl/index.js +13 -0
- package/dist/runtime/wsl/index.js.map +1 -0
- package/dist/runtime/wsl/keeper.d.ts +29 -0
- package/dist/runtime/wsl/keeper.js +48 -0
- package/dist/runtime/wsl/keeper.js.map +1 -0
- package/dist/runtime/wsl/transport.d.ts +106 -0
- package/dist/runtime/wsl/transport.js +181 -0
- package/dist/runtime/wsl/transport.js.map +1 -0
- package/dist/server/control/index.d.ts +1 -1
- package/dist/server/control/router.js +15 -0
- package/dist/server/control/router.js.map +1 -1
- package/dist/server/control/routes/backends.js +26 -0
- package/dist/server/control/routes/backends.js.map +1 -1
- package/dist/server/control/routes/decision.d.ts +10 -0
- package/dist/server/control/routes/decision.js +43 -0
- package/dist/server/control/routes/decision.js.map +1 -0
- package/dist/server/control/routes/diffusion-video.js +4 -0
- package/dist/server/control/routes/diffusion-video.js.map +1 -1
- package/dist/server/control/routes/diffusion.d.ts +1 -1
- package/dist/server/control/routes/diffusion.js +4 -9
- package/dist/server/control/routes/diffusion.js.map +1 -1
- package/dist/server/control/routes/embedding.d.ts +9 -0
- package/dist/server/control/routes/embedding.js +43 -0
- package/dist/server/control/routes/embedding.js.map +1 -0
- package/dist/server/control/routes/engine-builds.d.ts +14 -0
- package/dist/server/control/routes/engine-builds.js +82 -0
- package/dist/server/control/routes/engine-builds.js.map +1 -0
- package/dist/server/control/routes/engines.d.ts +17 -0
- package/dist/server/control/routes/engines.js +152 -0
- package/dist/server/control/routes/engines.js.map +1 -0
- package/dist/server/control/routes/environments.d.ts +16 -0
- package/dist/server/control/routes/environments.js +207 -0
- package/dist/server/control/routes/environments.js.map +1 -0
- package/dist/server/control/routes/hardware.d.ts +1 -1
- package/dist/server/control/routes/hardware.js +11 -6
- package/dist/server/control/routes/hardware.js.map +1 -1
- package/dist/server/control/routes/model-setups.d.ts +11 -0
- package/dist/server/control/routes/model-setups.js +55 -0
- package/dist/server/control/routes/model-setups.js.map +1 -0
- package/dist/server/control/routes/models.d.ts +3 -2
- package/dist/server/control/routes/models.js +45 -2
- package/dist/server/control/routes/models.js.map +1 -1
- package/dist/server/control/types.d.ts +167 -9
- package/dist/server/control/types.js.map +1 -1
- package/dist/server/http.d.ts +9 -1
- package/dist/server/http.js +51 -1
- package/dist/server/http.js.map +1 -1
- package/dist/server/public/decision-preview.d.ts +17 -0
- package/dist/server/public/decision-preview.js +119 -0
- package/dist/server/public/decision-preview.js.map +1 -0
- package/dist/server/public/decision.d.ts +32 -0
- package/dist/server/public/decision.js +135 -0
- package/dist/server/public/decision.js.map +1 -0
- package/dist/server/public/embedding.d.ts +31 -0
- package/dist/server/public/embedding.js +126 -0
- package/dist/server/public/embedding.js.map +1 -0
- package/dist/server/public/errors.d.ts +2 -1
- package/dist/server/public/errors.js +5 -2
- package/dist/server/public/errors.js.map +1 -1
- package/dist/server/public/forward.js +75 -3
- package/dist/server/public/forward.js.map +1 -1
- package/dist/server/public/gates.d.ts +13 -0
- package/dist/server/public/gates.js +37 -14
- package/dist/server/public/gates.js.map +1 -1
- package/dist/server/public/index.d.ts +5 -2
- package/dist/server/public/index.js +14 -1
- package/dist/server/public/index.js.map +1 -1
- package/dist/server/public/listing.d.ts +13 -2
- package/dist/server/public/listing.js +33 -9
- package/dist/server/public/listing.js.map +1 -1
- package/dist/server/public/policy.d.ts +9 -0
- package/dist/server/public/policy.js +68 -0
- package/dist/server/public/policy.js.map +1 -0
- package/dist/server/public/responses.js +10 -0
- package/dist/server/public/responses.js.map +1 -1
- package/dist/server/public/trace.d.ts +2 -2
- package/dist/server/public/trace.js +6 -2
- package/dist/server/public/trace.js.map +1 -1
- package/dist/server/public/types.d.ts +84 -1
- package/dist/settings/decision.d.ts +15 -0
- package/dist/settings/decision.js +88 -0
- package/dist/settings/decision.js.map +1 -0
- package/dist/settings/embedding.d.ts +12 -0
- package/dist/settings/embedding.js +82 -0
- package/dist/settings/embedding.js.map +1 -0
- package/dist/settings/index.d.ts +2 -0
- package/dist/settings/index.js +2 -0
- package/dist/settings/index.js.map +1 -1
- package/dist/settings/schema/atomic-prism.json +433 -0
- package/dist/settings/schema/tensorrt-llm.json +253 -0
- package/dist/settings/schema/vllm.json +273 -0
- package/dist/settings/schema.js +58 -0
- package/dist/settings/schema.js.map +1 -1
- package/dist/settings/store.d.ts +13 -2
- package/dist/settings/store.js +44 -0
- package/dist/settings/store.js.map +1 -1
- package/dist/util/index.d.ts +1 -0
- package/dist/util/index.js +1 -0
- package/dist/util/index.js.map +1 -1
- package/dist/util/result.d.ts +19 -0
- package/dist/util/result.js +15 -0
- package/dist/util/result.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +1 -1
- package/src/settings/schema/atomic-prism.json +433 -0
- package/src/settings/schema/tensorrt-llm.json +253 -0
- package/src/settings/schema/vllm.json +273 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../../src/runtime/environment/store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC9F,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAQ1E,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAC3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAC3D,OAAO,EAAE,eAAe,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0F;AAC1F,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,WAAmB,EAAU,EAAE,CAAC,GAAG,eAAe,CAAC,WAAW,CAAC,OAAO,CAAA"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Windows environment's own record (change `add-tensorrt-llm-windows`, design D9): which WSL
|
|
3
|
+
* distribution Atomic Chat imported, where its disk lives, and which environment manifest it was
|
|
4
|
+
* imported by. One file, `environment.json` in the shared managed root (`ManagedSharedPaths
|
|
5
|
+
* .environmentFile`), so the app's core and the CLI's core agree on one distribution per Windows user.
|
|
6
|
+
*
|
|
7
|
+
* Ownership is exactly this record: a distribution is "ours" only when its registered name equals the
|
|
8
|
+
* one recorded here (spec "Собственный дистрибутив импортируется от имени пользователя и только
|
|
9
|
+
* он"). A distribution with the same name and no record is someone else's — never used, never
|
|
10
|
+
* touched. The manifest id pins the environment (spec "Окружение Windows закрепляет свой
|
|
11
|
+
* манифест"): while this record exists, a newer manifest in conf changes nothing about it.
|
|
12
|
+
*
|
|
13
|
+
* Written atomically (temp file + rename) and only by the operation that imported the distribution;
|
|
14
|
+
* removed only by the removal of the environment.
|
|
15
|
+
*/
|
|
16
|
+
export interface WindowsEnvironmentRecord {
|
|
17
|
+
schema_version: 1;
|
|
18
|
+
executor: 'wsl-docker';
|
|
19
|
+
distribution: {
|
|
20
|
+
/** The name it is registered under (`wsl --list`). */
|
|
21
|
+
name: string;
|
|
22
|
+
/** The Windows directory its `ext4.vhdx` lives in. */
|
|
23
|
+
path: string;
|
|
24
|
+
};
|
|
25
|
+
/** The Windows environment manifest it was imported by. */
|
|
26
|
+
manifest_id: string;
|
|
27
|
+
imported_at: string;
|
|
28
|
+
/** Written into the guest at the import (`/etc/atomic-chat/owner`): a second check that it is ours (D9). */
|
|
29
|
+
marker: string;
|
|
30
|
+
}
|
|
31
|
+
export interface WindowsEnvironmentRecordFs {
|
|
32
|
+
readFile(path: string): Promise<string>;
|
|
33
|
+
writeFile(path: string, text: string): Promise<void>;
|
|
34
|
+
rename(from: string, to: string): Promise<void>;
|
|
35
|
+
mkdir(path: string): Promise<void>;
|
|
36
|
+
rm(path: string): Promise<void>;
|
|
37
|
+
}
|
|
38
|
+
/** Validate a record read back from disk; anything else is refused rather than half-trusted. */
|
|
39
|
+
export declare function parseWindowsEnvironmentRecord(input: unknown): WindowsEnvironmentRecord;
|
|
40
|
+
export declare class WindowsEnvironmentRecordStore {
|
|
41
|
+
private readonly path;
|
|
42
|
+
private readonly fs;
|
|
43
|
+
constructor(path: string, fs?: WindowsEnvironmentRecordFs);
|
|
44
|
+
/** The record, or null when there is none. A record that does not parse is an error, not "none". */
|
|
45
|
+
read(): Promise<WindowsEnvironmentRecord | null>;
|
|
46
|
+
write(record: WindowsEnvironmentRecord): Promise<void>;
|
|
47
|
+
remove(): Promise<void>;
|
|
48
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Windows environment's own record (change `add-tensorrt-llm-windows`, design D9): which WSL
|
|
3
|
+
* distribution Atomic Chat imported, where its disk lives, and which environment manifest it was
|
|
4
|
+
* imported by. One file, `environment.json` in the shared managed root (`ManagedSharedPaths
|
|
5
|
+
* .environmentFile`), so the app's core and the CLI's core agree on one distribution per Windows user.
|
|
6
|
+
*
|
|
7
|
+
* Ownership is exactly this record: a distribution is "ours" only when its registered name equals the
|
|
8
|
+
* one recorded here (spec "Собственный дистрибутив импортируется от имени пользователя и только
|
|
9
|
+
* он"). A distribution with the same name and no record is someone else's — never used, never
|
|
10
|
+
* touched. The manifest id pins the environment (spec "Окружение Windows закрепляет свой
|
|
11
|
+
* манифест"): while this record exists, a newer manifest in conf changes nothing about it.
|
|
12
|
+
*
|
|
13
|
+
* Written atomically (temp file + rename) and only by the operation that imported the distribution;
|
|
14
|
+
* removed only by the removal of the environment.
|
|
15
|
+
*/
|
|
16
|
+
import { mkdir, readFile, rename, rm, writeFile } from 'node:fs/promises';
|
|
17
|
+
import { dirname } from 'node:path';
|
|
18
|
+
import { AtomicCoreError } from '../../contracts/index.js';
|
|
19
|
+
import { WINDOWS_MANIFEST_ID } from './environment-manifest.js';
|
|
20
|
+
const nodeFs = {
|
|
21
|
+
readFile: (path) => readFile(path, 'utf8'),
|
|
22
|
+
writeFile: (path, text) => writeFile(path, text, 'utf8'),
|
|
23
|
+
rename,
|
|
24
|
+
mkdir: async (path) => {
|
|
25
|
+
await mkdir(path, { recursive: true });
|
|
26
|
+
},
|
|
27
|
+
rm: (path) => rm(path, { force: true }),
|
|
28
|
+
};
|
|
29
|
+
const invalid = (why) => new AtomicCoreError('MANAGED_METADATA_INVALID', `Invalid Windows environment record: ${why}`);
|
|
30
|
+
/** Validate a record read back from disk; anything else is refused rather than half-trusted. */
|
|
31
|
+
export function parseWindowsEnvironmentRecord(input) {
|
|
32
|
+
const raw = input;
|
|
33
|
+
const distribution = raw?.distribution;
|
|
34
|
+
if (raw === null || typeof raw !== 'object' || raw.schema_version !== 1)
|
|
35
|
+
throw invalid('schema_version is not 1');
|
|
36
|
+
if (raw.executor !== 'wsl-docker')
|
|
37
|
+
throw invalid('executor is not wsl-docker');
|
|
38
|
+
if (typeof distribution?.name !== 'string' || distribution.name === '')
|
|
39
|
+
throw invalid('no distribution name');
|
|
40
|
+
if (typeof distribution.path !== 'string' || distribution.path === '')
|
|
41
|
+
throw invalid('no distribution path');
|
|
42
|
+
// The manifest's own id rule, so a Windows on Arm environment (`windows-arm64-r<N>`) reads back too.
|
|
43
|
+
if (typeof raw.manifest_id !== 'string' || !WINDOWS_MANIFEST_ID.test(raw.manifest_id)) {
|
|
44
|
+
throw invalid('manifest_id is not a Windows manifest id');
|
|
45
|
+
}
|
|
46
|
+
if (typeof raw.imported_at !== 'string')
|
|
47
|
+
throw invalid('no imported_at');
|
|
48
|
+
if (typeof raw.marker !== 'string' || !/^[A-Za-z0-9-]{8,64}$/.test(raw.marker))
|
|
49
|
+
throw invalid('no marker');
|
|
50
|
+
return {
|
|
51
|
+
schema_version: 1,
|
|
52
|
+
executor: 'wsl-docker',
|
|
53
|
+
distribution: { name: distribution.name, path: distribution.path },
|
|
54
|
+
manifest_id: raw.manifest_id,
|
|
55
|
+
imported_at: raw.imported_at,
|
|
56
|
+
marker: raw.marker,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export class WindowsEnvironmentRecordStore {
|
|
60
|
+
path;
|
|
61
|
+
fs;
|
|
62
|
+
constructor(path, fs = nodeFs) {
|
|
63
|
+
this.path = path;
|
|
64
|
+
this.fs = fs;
|
|
65
|
+
}
|
|
66
|
+
/** The record, or null when there is none. A record that does not parse is an error, not "none". */
|
|
67
|
+
async read() {
|
|
68
|
+
let text;
|
|
69
|
+
try {
|
|
70
|
+
text = await this.fs.readFile(this.path);
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
if (error.code === 'ENOENT')
|
|
74
|
+
return null;
|
|
75
|
+
throw error;
|
|
76
|
+
}
|
|
77
|
+
return parseWindowsEnvironmentRecord(JSON.parse(text));
|
|
78
|
+
}
|
|
79
|
+
async write(record) {
|
|
80
|
+
await this.fs.mkdir(dirname(this.path));
|
|
81
|
+
const temp = `${this.path}.tmp`;
|
|
82
|
+
await this.fs.writeFile(temp, `${JSON.stringify(record, null, 2)}\n`);
|
|
83
|
+
await this.fs.rename(temp, this.path);
|
|
84
|
+
}
|
|
85
|
+
async remove() {
|
|
86
|
+
await this.fs.rm(this.path);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=windows-environment-record.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"windows-environment-record.js","sourceRoot":"","sources":["../../../src/runtime/environment/windows-environment-record.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACzE,OAAO,EAAE,OAAO,E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,CAAC,CAAA;QAC1C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAK,KAA+B,CAAC,IAAI,KAAK,QAAQ;gBAAE,OAAO,IAAI,CAAA;YACnE,MAAM,KAAK,CAAA;QACb,CAAC;QACD,OAAO,6BAA6B,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAY,CAAC,CAAA;IACnE,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,MAAgC;QAC1C,MAAM,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;QACvC,MAAM,IAAI,GAAG,GAAG,IAAI,CAAC,IAAI,MAAM,CAAA;QAC/B,MAAM,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAA;QACrE,MAAM,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAA;IACvC,CAAC;IAED,KAAK,CAAC,MAAM;QACV,MAAM,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC7B,CAAC;CACF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WSL's localhost forwarding, checked rather than assumed (change `add-tensorrt-llm-windows`, task
|
|
3
|
+
* 2.7, design D7; spec "Проброс localhost проверяется, а не предполагается"). A model container
|
|
4
|
+
* publishes its port on the guest's `127.0.0.1`, and Windows reaches it on its own `127.0.0.1` only
|
|
5
|
+
* through WSL's forwarding — on by default in NAT mode, off with `localhostForwarding=false` in the
|
|
6
|
+
* user's `.wslconfig`, and unreliable for Docker's ports in some `mirrored` setups. Core never edits
|
|
7
|
+
* `.wslconfig` (it is global to every distribution the user has); it explains what to change.
|
|
8
|
+
*
|
|
9
|
+
* `checkLocalhostForwarding` is the install's check (`verifying`): a short-lived listener in the guest
|
|
10
|
+
* on a random high port, confirmed from inside first, then from Windows. Only "inside yes, outside no"
|
|
11
|
+
* is a forwarding failure; a listener that never came up is a failure of its own.
|
|
12
|
+
*/
|
|
13
|
+
import { AtomicCoreError } from '../../contracts/index.js';
|
|
14
|
+
import type { WslDistributionTransport } from '../wsl/index.js';
|
|
15
|
+
import type { WslConfigFacts } from './windows-probe.js';
|
|
16
|
+
/** `MANAGED_PREREQUISITE_BLOCKED` / `wsl-localhost-forwarding`, with what to change in `.wslconfig`. */
|
|
17
|
+
export declare function localhostForwardingError(config: WslConfigFacts): AtomicCoreError;
|
|
18
|
+
export interface ForwardingCheckDeps {
|
|
19
|
+
transport: WslDistributionTransport;
|
|
20
|
+
fetch: typeof fetch;
|
|
21
|
+
sleep: (ms: number, signal: AbortSignal) => Promise<void>;
|
|
22
|
+
wslconfig: WslConfigFacts;
|
|
23
|
+
/** The guest port to listen on; a random high one by default. */
|
|
24
|
+
port?: () => number;
|
|
25
|
+
signal: AbortSignal;
|
|
26
|
+
}
|
|
27
|
+
export declare function checkLocalhostForwarding(deps: ForwardingCheckDeps): Promise<void>;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WSL's localhost forwarding, checked rather than assumed (change `add-tensorrt-llm-windows`, task
|
|
3
|
+
* 2.7, design D7; spec "Проброс localhost проверяется, а не предполагается"). A model container
|
|
4
|
+
* publishes its port on the guest's `127.0.0.1`, and Windows reaches it on its own `127.0.0.1` only
|
|
5
|
+
* through WSL's forwarding — on by default in NAT mode, off with `localhostForwarding=false` in the
|
|
6
|
+
* user's `.wslconfig`, and unreliable for Docker's ports in some `mirrored` setups. Core never edits
|
|
7
|
+
* `.wslconfig` (it is global to every distribution the user has); it explains what to change.
|
|
8
|
+
*
|
|
9
|
+
* `checkLocalhostForwarding` is the install's check (`verifying`): a short-lived listener in the guest
|
|
10
|
+
* on a random high port, confirmed from inside first, then from Windows. Only "inside yes, outside no"
|
|
11
|
+
* is a forwarding failure; a listener that never came up is a failure of its own.
|
|
12
|
+
*/
|
|
13
|
+
import { AtomicCoreError } from '../../contracts/index.js';
|
|
14
|
+
const SHUTDOWN = 'Then run wsl --shutdown in a terminal and check again.';
|
|
15
|
+
/** `MANAGED_PREREQUISITE_BLOCKED` / `wsl-localhost-forwarding`, with what to change in `.wslconfig`. */
|
|
16
|
+
export function localhostForwardingError(config) {
|
|
17
|
+
const lead = 'Windows cannot reach the TensorRT-LLM engine: it answers inside the Atomic Chat WSL distribution, but WSL does not forward its port to this computer’s 127.0.0.1.';
|
|
18
|
+
const fix = config.localhost_forwarding === false
|
|
19
|
+
? `Your %UserProfile%\\.wslconfig turns this off: in its [wsl2] section, set localhostForwarding=true (or remove that line). ${SHUTDOWN}`
|
|
20
|
+
: config.networking_mode === 'mirrored'
|
|
21
|
+
? `WSL runs in mirrored networking mode (networkingMode=mirrored in %UserProfile%\\.wslconfig), where forwarding of ports that Docker publishes can fail. Try networkingMode=nat in its [wsl2] section. ${SHUTDOWN}`
|
|
22
|
+
: `Check %UserProfile%\\.wslconfig: in its [wsl2] section, localhostForwarding must not be false. ${SHUTDOWN}`;
|
|
23
|
+
return new AtomicCoreError('MANAGED_PREREQUISITE_BLOCKED', `${lead} ${fix}`, 'wsl-localhost-forwarding');
|
|
24
|
+
}
|
|
25
|
+
const ATTEMPTS = 20;
|
|
26
|
+
const INTERVAL_MS = 500;
|
|
27
|
+
const LISTENER_SECONDS = 120;
|
|
28
|
+
const randomPort = () => 20_000 + Math.floor(Math.random() * 40_000);
|
|
29
|
+
export async function checkLocalhostForwarding(deps) {
|
|
30
|
+
const port = (deps.port ?? randomPort)();
|
|
31
|
+
const stop = new AbortController();
|
|
32
|
+
const abort = () => stop.abort();
|
|
33
|
+
deps.signal.addEventListener('abort', abort, { once: true });
|
|
34
|
+
// `timeout` bounds it even if this core dies before stopping it; python3 is part of the Ubuntu rootfs.
|
|
35
|
+
const listener = deps.transport.exec([
|
|
36
|
+
'timeout',
|
|
37
|
+
String(LISTENER_SECONDS),
|
|
38
|
+
'python3',
|
|
39
|
+
'-m',
|
|
40
|
+
'http.server',
|
|
41
|
+
'--bind',
|
|
42
|
+
'127.0.0.1',
|
|
43
|
+
String(port),
|
|
44
|
+
], { user: 'root', signal: stop.signal, timeoutMs: (LISTENER_SECONDS + 10) * 1000 });
|
|
45
|
+
try {
|
|
46
|
+
let inside = false;
|
|
47
|
+
for (let attempt = 0; attempt < ATTEMPTS && !inside; attempt += 1) {
|
|
48
|
+
const answer = await deps.transport.exec([
|
|
49
|
+
'curl',
|
|
50
|
+
'--silent',
|
|
51
|
+
'--output',
|
|
52
|
+
'/dev/null',
|
|
53
|
+
'--write-out',
|
|
54
|
+
'%{http_code}',
|
|
55
|
+
`http://127.0.0.1:${port}/`,
|
|
56
|
+
], { user: 'root', signal: deps.signal });
|
|
57
|
+
inside = answer.code === 0 && answer.stdout.trim() === '200';
|
|
58
|
+
if (!inside)
|
|
59
|
+
await deps.sleep(INTERVAL_MS, deps.signal);
|
|
60
|
+
}
|
|
61
|
+
if (!inside) {
|
|
62
|
+
throw new AtomicCoreError('IO_ERROR', 'A test listener could not be started in the Atomic Chat distribution to check WSL’s localhost forwarding.', `port ${port}`);
|
|
63
|
+
}
|
|
64
|
+
for (let attempt = 0; attempt < ATTEMPTS; attempt += 1) {
|
|
65
|
+
const reached = await deps
|
|
66
|
+
.fetch(`http://127.0.0.1:${port}/`, { signal: deps.signal })
|
|
67
|
+
.then(async (response) => {
|
|
68
|
+
await response.body?.cancel().catch(() => undefined);
|
|
69
|
+
return response.ok;
|
|
70
|
+
})
|
|
71
|
+
.catch(() => false);
|
|
72
|
+
if (reached)
|
|
73
|
+
return;
|
|
74
|
+
await deps.sleep(INTERVAL_MS, deps.signal);
|
|
75
|
+
}
|
|
76
|
+
throw localhostForwardingError(deps.wslconfig);
|
|
77
|
+
}
|
|
78
|
+
finally {
|
|
79
|
+
deps.signal.removeEventListener('abort', abort);
|
|
80
|
+
stop.abort();
|
|
81
|
+
await listener.catch(() => undefined);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=windows-forwarding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"windows-forwarding.js","sourceRoot":"","sources":["../../../src/runtime/environment/windows-forwarding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAI1D,MAAM,QAAQ,GAAG,wDAAwD,CAAA;AAEzE,wGAAwG;AACxG,MAAM,UAAU,wBAAwB,CAAC,MAAsB;IAC7D,MAAM,IAAI,GACR,mKAAmK,CAAA;IACrK,MAAM,GAAG,GACP,MAAM,CAAC,oBAAoB,KAAK,KAAK;QACnC,CAAC,CAAC,6HAA6H,QAAQ,EAAE;QACzI,CAAC,CAAC,MAAM,CAAC,eAAe,KAAK,UAAU;YACrC,CAAC,CAAC,wMAAwM,QAAQ,EAAE;YACpN,CAAC,CAAC,kGAAkG,QAAQ,EAAE,CAAA;IACpH,OAAO,IAAI,eAAe,CAAC,8BAA8B,EAAE,GAAG,IAAI,IAAI,GAAG,EAAE,EAAE,0BAA0B,CAAC,CAAA;AAC1G,CAAC;AAYD,MAAM,QAAQ,GAAG,EAAE,CAAA;AACnB,MAAM,WAAW,GAAG,GAAG,CAAA;AACvB,MAAM,gBAAgB,GAAG,GAAG,CAAA;AAE5B,MAAM,UAAU,GAAG,GAAW,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC,CAAA;AAE5E,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,IAAyB;IACtE,MAAM,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,UAAU,CAAC,EAAE,CAAA;IACxC,MAAM,IAAI,GAAG,IAAI,eAAe,EAAE,CAAA;IAClC,MAAM,KAAK,GAAG,G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ACV,2GAA2G,EAC3G,QAAQ,IAAI,EAAE,CACf,CAAA;QACH,CAAC;QACD,KAAK,IAAI,OAAO,GAAG,CAAC,EAAE,OAAO,GAAG,QAAQ,EAAE,OAAO,IAAI,CAAC,EAAE,CAAC;YACvD,MAAM,OAAO,GAAG,MAAM,IAAI;iBACvB,KAAK,CAAC,oBAAoB,IAAI,GAAG,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;iBAC3D,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;gBACvB,MAAM,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAA;gBACpD,OAAO,QAAQ,CAAC,EAAE,CAAA;YACpB,CAAC,CAAC;iBACD,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAA;YACrB,IAAI,OAAO;gBAAE,OAAM;YACnB,MAAM,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;QAC5C,CAAC;QACD,MAAM,wBAAwB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;IAChD,CAAC;YAAS,CAAC;QACT,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;QAC/C,IAAI,CAAC,KAAK,EAAE,CAAA;QACZ,MAAM,QAAQ,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAA;IACvC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Making Atomic Chat's own WSL distribution (change `add-tensorrt-llm-windows`, task 2.5, design D9):
|
|
3
|
+
* importing the verified rootfs as the user who runs the app, leaving their default distribution as it
|
|
4
|
+
* was, and preparing the guest — a non-root default user (uid 1000), `/etc/wsl.conf` with systemd and
|
|
5
|
+
* without the Windows `PATH`, and the ownership marker — then restarting it so systemd is PID 1.
|
|
6
|
+
*
|
|
7
|
+
* Everything runs through the WSL transport, never elevated (design D2), and never touches another
|
|
8
|
+
* distribution: `--import` and `--set-default` name only what the caller passes, and every command in a
|
|
9
|
+
* guest names Atomic Chat's own. Each step checks before it acts, so a setup interrupted half-way
|
|
10
|
+
* resumes by running the same steps again.
|
|
11
|
+
*/
|
|
12
|
+
import type { Wsl, WslDistributionTransport } from '../wsl/index.js';
|
|
13
|
+
/** The account the guest's files and the model container belong to (design D5). */
|
|
14
|
+
export declare const GUEST_USER_UID = 1000;
|
|
15
|
+
/** Its name when the rootfs has no uid 1000 yet. */
|
|
16
|
+
export declare const GUEST_USER_NAME = "atomic";
|
|
17
|
+
/** Where the import records that this distribution is Atomic Chat's. */
|
|
18
|
+
export declare const GUEST_OWNER_MARKER = "/etc/atomic-chat/owner";
|
|
19
|
+
/**
|
|
20
|
+
* `wsl --import <name> <dir> <file> --version 2`; when that refuses the `.wsl` file, the same file
|
|
21
|
+
* through `wsl --install --from-file … --name … --location … --no-launch` (design D9: whether `--import`
|
|
22
|
+
* takes the `.wsl` format directly is a live-acceptance question). Confirmed by `--list` afterwards.
|
|
23
|
+
*/
|
|
24
|
+
export declare function importDistribution(wsl: Wsl, target: {
|
|
25
|
+
name: string;
|
|
26
|
+
path: string;
|
|
27
|
+
rootfs: string;
|
|
28
|
+
}, signal: AbortSignal): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Put the user's default distribution back if the import took it. With no default before, there is
|
|
31
|
+
* nothing to restore: the user had none of their own to keep.
|
|
32
|
+
*/
|
|
33
|
+
export declare function restoreDefaultDistribution(wsl: Wsl, previous: string | null, signal: AbortSignal): Promise<void>;
|
|
34
|
+
/** `/etc/wsl.conf` as Atomic Chat's guest needs it. */
|
|
35
|
+
export declare function guestWslConf(user: string): string;
|
|
36
|
+
export interface GuestSetupDeps {
|
|
37
|
+
wsl: Wsl;
|
|
38
|
+
sleep: (ms: number, signal: AbortSignal) => Promise<void>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The guest's own setup, idempotent: the uid-1000 user (reused when the rootfs already has one), the
|
|
42
|
+
* ownership marker (a different one already there means this is not our distribution), `/etc/wsl.conf`
|
|
43
|
+
* — and, when that file changed, a restart of the distribution and a wait until systemd runs.
|
|
44
|
+
*/
|
|
45
|
+
export declare function setupGuest(deps: GuestSetupDeps, transport: WslDistributionTransport, marker: string, signal: AbortSignal): Promise<{
|
|
46
|
+
user: string;
|
|
47
|
+
restarted: boolean;
|
|
48
|
+
}>;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Making Atomic Chat's own WSL distribution (change `add-tensorrt-llm-windows`, task 2.5, design D9):
|
|
3
|
+
* importing the verified rootfs as the user who runs the app, leaving their default distribution as it
|
|
4
|
+
* was, and preparing the guest — a non-root default user (uid 1000), `/etc/wsl.conf` with systemd and
|
|
5
|
+
* without the Windows `PATH`, and the ownership marker — then restarting it so systemd is PID 1.
|
|
6
|
+
*
|
|
7
|
+
* Everything runs through the WSL transport, never elevated (design D2), and never touches another
|
|
8
|
+
* distribution: `--import` and `--set-default` name only what the caller passes, and every command in a
|
|
9
|
+
* guest names Atomic Chat's own. Each step checks before it acts, so a setup interrupted half-way
|
|
10
|
+
* resumes by running the same steps again.
|
|
11
|
+
*/
|
|
12
|
+
import { AtomicCoreError } from '../../contracts/index.js';
|
|
13
|
+
import { GUEST_ROOT } from './guest-host.js';
|
|
14
|
+
import { parseWslDistributions } from './windows-probe.js';
|
|
15
|
+
/** The account the guest's files and the model container belong to (design D5). */
|
|
16
|
+
export const GUEST_USER_UID = 1000;
|
|
17
|
+
/** Its name when the rootfs has no uid 1000 yet. */
|
|
18
|
+
export const GUEST_USER_NAME = 'atomic';
|
|
19
|
+
/** Where the import records that this distribution is Atomic Chat's. */
|
|
20
|
+
export const GUEST_OWNER_MARKER = '/etc/atomic-chat/owner';
|
|
21
|
+
const IMPORT_TIMEOUT_MS = 30 * 60_000;
|
|
22
|
+
const GUEST_TIMEOUT_MS = 120_000;
|
|
23
|
+
/** How long a restarted guest may take to bring systemd up. */
|
|
24
|
+
const SYSTEMD_WAIT_ATTEMPTS = 60;
|
|
25
|
+
const SYSTEMD_WAIT_MS = 1_000;
|
|
26
|
+
const failed = (message, details) => new AtomicCoreError('MANAGED_PREREQUISITE_BLOCKED', message, details);
|
|
27
|
+
const said = (output) => `${output.stdout.trim()}\n${output.stderr.trim()}`.trim().slice(-2000);
|
|
28
|
+
/**
|
|
29
|
+
* `wsl --import <name> <dir> <file> --version 2`; when that refuses the `.wsl` file, the same file
|
|
30
|
+
* through `wsl --install --from-file … --name … --location … --no-launch` (design D9: whether `--import`
|
|
31
|
+
* takes the `.wsl` format directly is a live-acceptance question). Confirmed by `--list` afterwards.
|
|
32
|
+
*/
|
|
33
|
+
export async function importDistribution(wsl, target, signal) {
|
|
34
|
+
const imported = await wsl.command(['--import', target.name, target.path, target.rootfs, '--version', '2'], {
|
|
35
|
+
timeoutMs: IMPORT_TIMEOUT_MS,
|
|
36
|
+
signal,
|
|
37
|
+
});
|
|
38
|
+
if (imported.code !== 0) {
|
|
39
|
+
const installed = await wsl.command([
|
|
40
|
+
'--install',
|
|
41
|
+
'--from-file',
|
|
42
|
+
target.rootfs,
|
|
43
|
+
'--name',
|
|
44
|
+
target.name,
|
|
45
|
+
'--location',
|
|
46
|
+
target.path,
|
|
47
|
+
'--no-launch',
|
|
48
|
+
], { timeoutMs: IMPORT_TIMEOUT_MS, signal });
|
|
49
|
+
if (installed.code !== 0) {
|
|
50
|
+
throw failed(`WSL could not import the Atomic Chat distribution "${target.name}".`, `wsl --import: ${said(imported)}\nwsl --install --from-file: ${said(installed)}`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
const listed = parseWslDistributions(await wsl.command(['--list', '--verbose'], { signal }));
|
|
54
|
+
if (!listed.some((entry) => entry.name === target.name)) {
|
|
55
|
+
throw failed(`WSL reported the import of "${target.name}" as done, but does not list it.`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Put the user's default distribution back if the import took it. With no default before, there is
|
|
60
|
+
* nothing to restore: the user had none of their own to keep.
|
|
61
|
+
*/
|
|
62
|
+
export async function restoreDefaultDistribution(wsl, previous, signal) {
|
|
63
|
+
if (previous === null)
|
|
64
|
+
return;
|
|
65
|
+
const listed = parseWslDistributions(await wsl.command(['--list', '--verbose'], { signal }));
|
|
66
|
+
if (listed.find((entry) => entry.is_default)?.name === previous)
|
|
67
|
+
return;
|
|
68
|
+
const restored = await wsl.command(['--set-default', previous], { signal });
|
|
69
|
+
if (restored.code !== 0) {
|
|
70
|
+
throw failed(`Your default WSL distribution "${previous}" could not be set back.`, said(restored));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/** `/etc/wsl.conf` as Atomic Chat's guest needs it. */
|
|
74
|
+
export function guestWslConf(user) {
|
|
75
|
+
return [
|
|
76
|
+
'[boot]',
|
|
77
|
+
'systemd=true',
|
|
78
|
+
'',
|
|
79
|
+
'[user]',
|
|
80
|
+
`default=${user}`,
|
|
81
|
+
'',
|
|
82
|
+
'[interop]',
|
|
83
|
+
'appendWindowsPath=false',
|
|
84
|
+
'',
|
|
85
|
+
].join('\n');
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* The guest's own setup, idempotent: the uid-1000 user (reused when the rootfs already has one), the
|
|
89
|
+
* ownership marker (a different one already there means this is not our distribution), `/etc/wsl.conf`
|
|
90
|
+
* — and, when that file changed, a restart of the distribution and a wait until systemd runs.
|
|
91
|
+
*/
|
|
92
|
+
export async function setupGuest(deps, transport, marker, signal) {
|
|
93
|
+
const run = (argv, input) => transport.exec(argv, {
|
|
94
|
+
user: GUEST_ROOT,
|
|
95
|
+
timeoutMs: GUEST_TIMEOUT_MS,
|
|
96
|
+
signal,
|
|
97
|
+
...(input === undefined ? {} : { input }),
|
|
98
|
+
});
|
|
99
|
+
const must = async (argv, what, input) => {
|
|
100
|
+
const output = await run(argv, input);
|
|
101
|
+
if (output.code !== 0)
|
|
102
|
+
throw failed(`Preparing the Atomic Chat distribution failed: ${what}.`, said(output));
|
|
103
|
+
return output;
|
|
104
|
+
};
|
|
105
|
+
const readGuestFile = async (path) => {
|
|
106
|
+
const exists = await run(['test', '-e', path]);
|
|
107
|
+
if (exists.code !== 0)
|
|
108
|
+
return null;
|
|
109
|
+
return (await must(['cat', '--', path], `reading ${path}`)).stdout;
|
|
110
|
+
};
|
|
111
|
+
const writeGuestFile = async (path, text) => {
|
|
112
|
+
const directory = path.slice(0, path.lastIndexOf('/'));
|
|
113
|
+
await must(['mkdir', '-p', directory], `creating ${directory}`);
|
|
114
|
+
await must(['tee', `${path}.tmp`], `writing ${path}`, text);
|
|
115
|
+
await must(['chmod', '0644', `${path}.tmp`], `setting the mode of ${path}`);
|
|
116
|
+
await must(['mv', '-f', `${path}.tmp`, path], `writing ${path}`);
|
|
117
|
+
};
|
|
118
|
+
const existing = await run(['getent', 'passwd', String(GUEST_USER_UID)]);
|
|
119
|
+
let user;
|
|
120
|
+
if (existing.code === 0 && existing.stdout.includes(':')) {
|
|
121
|
+
user = existing.stdout.split(':')[0];
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
await must([
|
|
125
|
+
'useradd',
|
|
126
|
+
'--create-home',
|
|
127
|
+
'--uid',
|
|
128
|
+
String(GUEST_USER_UID),
|
|
129
|
+
'--user-group',
|
|
130
|
+
'--shell',
|
|
131
|
+
'/bin/bash',
|
|
132
|
+
GUEST_USER_NAME,
|
|
133
|
+
], `creating the user ${GUEST_USER_NAME}`);
|
|
134
|
+
user = GUEST_USER_NAME;
|
|
135
|
+
}
|
|
136
|
+
const owner = await readGuestFile(GUEST_OWNER_MARKER);
|
|
137
|
+
if (owner !== null && owner.trim() !== marker) {
|
|
138
|
+
throw new AtomicCoreError('MANAGED_PREREQUISITE_BLOCKED', `The WSL distribution "${transport.name}" carries another installation's marker; Atomic Chat will not use it.`, 'foreign-distribution');
|
|
139
|
+
}
|
|
140
|
+
if (owner === null)
|
|
141
|
+
await writeGuestFile(GUEST_OWNER_MARKER, `${marker}\n`);
|
|
142
|
+
const wanted = guestWslConf(user);
|
|
143
|
+
if ((await readGuestFile('/etc/wsl.conf')) === wanted)
|
|
144
|
+
return { user, restarted: false };
|
|
145
|
+
await writeGuestFile('/etc/wsl.conf', wanted);
|
|
146
|
+
// wsl.conf applies at the next start of the distribution: stop it, and the next command boots it.
|
|
147
|
+
const terminated = await deps.wsl.command(['--terminate', transport.name], { signal });
|
|
148
|
+
if (terminated.code !== 0)
|
|
149
|
+
throw failed(`The distribution "${transport.name}" could not be restarted.`, said(terminated));
|
|
150
|
+
for (let attempt = 0; attempt < SYSTEMD_WAIT_ATTEMPTS; attempt += 1) {
|
|
151
|
+
if ((await run(['test', '-e', '/run/systemd/system'])).code === 0)
|
|
152
|
+
return { user, restarted: true };
|
|
153
|
+
await deps.sleep(SYSTEMD_WAIT_MS, signal);
|
|
154
|
+
}
|
|
155
|
+
throw failed(`systemd did not start in the distribution "${transport.name}" after its restart.`);
|
|
156
|
+
}
|
|
157
|
+
//# sourceMappingURL=windows-guest-setup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"windows-guest-setup.js","sourceRoot":"","sources":["../../../src/runtime/environment/windows-guest-setup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAE1D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAE1D,mFAAmF;AACnF,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAA;AAClC,oDAAoD;AACpD,MAAM,CAAC,MAAM,eAAe,GAAG,QAAQ,CAAA;AACvC,wEAAwE;AACxE,MAAM,CAAC,MAAM,kBAAkB,GAAG,wBAAwB,CAAA;AAE1D,MAAM,i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AC,KAAK,CAAC,eAAe,EAAE,MAAM,CAAC,CAAA;IAC3C,CAAC;IACD,MAAM,MAAM,CAAC,8CAA8C,SAAS,CAAC,IAAI,sBAAsB,CAAC,CAAA;AAClG,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Windows machine as the Windows provisioner reaches it (change `add-tensorrt-llm-windows`,
|
|
3
|
+
* task 2.3): the read-only probe's dependencies (`WindowsProbeDeps`), where the user's own
|
|
4
|
+
* distribution directory lives (`%LOCALAPPDATA%`), and the two disk facts the plan and the snapshot
|
|
5
|
+
* show — free space on that directory's volume, and how big the distribution's `ext4.vhdx` has grown.
|
|
6
|
+
* `windows-probe.ts` and `windows-plan.ts` stay pure; this is where the real machine comes in.
|
|
7
|
+
*/
|
|
8
|
+
import { type Wsl } from '../wsl/index.js';
|
|
9
|
+
import { type HostExec } from './host-exec.js';
|
|
10
|
+
import type { WindowsProbeDeps } from './windows-probe.js';
|
|
11
|
+
/** The fixed name Atomic Chat registers its own distribution under (design D9). */
|
|
12
|
+
export declare const ATOMIC_CHAT_DISTRIBUTION = "AtomicChat";
|
|
13
|
+
export interface WindowsHost {
|
|
14
|
+
probeDeps: WindowsProbeDeps;
|
|
15
|
+
/** `%LOCALAPPDATA%` of the user running the core. */
|
|
16
|
+
localAppData: string;
|
|
17
|
+
/** Free bytes on the volume holding `path`, read at its nearest existing ancestor; null when unread. */
|
|
18
|
+
freeDiskBytes(path: string): Promise<number | null>;
|
|
19
|
+
/** A file's size in bytes; null when it is not there or cannot be read. */
|
|
20
|
+
fileSize(path: string): Promise<number | null>;
|
|
21
|
+
}
|
|
22
|
+
/** Where Atomic Chat's own distribution lives: `%LOCALAPPDATA%\AtomicChat\wsl\<name>`. */
|
|
23
|
+
export declare function distributionDirectory(localAppData: string, name?: string): string;
|
|
24
|
+
/** The disk image WSL keeps a distribution in, inside its directory. */
|
|
25
|
+
export declare function distributionDisk(directory: string): string;
|
|
26
|
+
/** Free space at the nearest ancestor of `path` that exists: the distribution's directory may not yet. */
|
|
27
|
+
export declare function freeBytesAtNearest(path: string): Promise<number | null>;
|
|
28
|
+
/** The real machine. `wsl` and `exec` are injectable so a test can run it without spawning anything. */
|
|
29
|
+
export declare function realWindowsHost(env: Record<string, string | undefined>, wsl?: Wsl, exec?: HostExec): WindowsHost;
|
|
30
|
+
/**
|
|
31
|
+
* Test hook only, the same kind as `ATOMIC_MANAGED_TEST_HOST`: production never sets it. It names a
|
|
32
|
+
* folder standing in for a whole Windows machine with WSL, so the compiled core's e2e suite drives the
|
|
33
|
+
* Windows managed path on any OS:
|
|
34
|
+
*
|
|
35
|
+
* - `windows.json` — the machine (`os.machine()`, `os.release()`, elevated or not, firmware
|
|
36
|
+
* virtualization, the NVIDIA driver and cards, `.wslconfig`'s text, the volume's free space, the
|
|
37
|
+
* distribution disk's size), read again at every call so a test can change it mid-run (a restart);
|
|
38
|
+
* - `wsl-command.json` — the argv `wsl.exe` is: a Node executable and `test/helpers/fake-wsl.mjs` with
|
|
39
|
+
* its state folder;
|
|
40
|
+
* - `local-app-data/` — `%LOCALAPPDATA%`;
|
|
41
|
+
* - `guest-fs/` — the guests' file systems, standing in for `\\wsl.localhost`.
|
|
42
|
+
*/
|
|
43
|
+
export declare const MANAGED_TEST_WINDOWS_ENV = "ATOMIC_MANAGED_TEST_WINDOWS";
|
|
44
|
+
export declare function managedTestWindowsDir(env: Record<string, string | undefined>): string | null;
|
|
45
|
+
/** The machine a test describes in `dir` (see `MANAGED_TEST_WINDOWS_ENV`). */
|
|
46
|
+
export declare function testWindowsHost(dir: string): WindowsHost;
|