@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,418 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The watchdog entrypoint for a `tensorrt-llm` model container (openspec change
|
|
3
|
+
* `add-tensorrt-llm-linux`, task 2.9, spec `tensorrt-llm-runtime` ▸ "Watchdog гарантирует
|
|
4
|
+
* освобождение GPU"). Docker gives it PID 1 in place of `trtllm-serve`: it starts the engine, then
|
|
5
|
+
* polls a heartbeat file the core keeps touching (see `heartbeat.ts`) from outside the container.
|
|
6
|
+
* If that file stops changing, the core is presumed dead (crashed, killed, machine slept) and the
|
|
7
|
+
* engine is torn down so the GPU is freed even though nothing asked for that on purpose. The
|
|
8
|
+
* requirement is explicit that this cannot be turned off by a setting: there is no config path that
|
|
9
|
+
* skips the poll loop, only the timing knobs below.
|
|
10
|
+
*
|
|
11
|
+
* For the script to actually be able to do this, the executor (task 2.8/2.12) MUST run it as the
|
|
12
|
+
* container's PID 1 — directly, or under `--init` — and MUST NOT run the container with
|
|
13
|
+
* `--pid=host`: a watchdog that is not PID 1 does not own the process tree Docker tears down when
|
|
14
|
+
* the container exits, and `trtllm-serve`'s own worker processes would then survive the watchdog's
|
|
15
|
+
* own exit instead of dying with it.
|
|
16
|
+
*
|
|
17
|
+
* The script is embedded as a plain POSIX `/bin/sh` string rather than loaded from a file at
|
|
18
|
+
* runtime, because the core must stay runtime-agnostic (no `import.meta.url`-relative loading) and
|
|
19
|
+
* because the container never gets write access to it — `writeWatchdogScript` below is the only way
|
|
20
|
+
* it reaches disk, mode `0555`, for the executor to bind-mount read-only next to the model.
|
|
21
|
+
*
|
|
22
|
+
* Docker argv/mount wiring, the executor that invokes this, and the lifecycle that runs the
|
|
23
|
+
* heartbeat ticker against a real container are out of scope here (tasks 2.8, 2.11, 2.12); this
|
|
24
|
+
* module only provides the script text, the function that writes it to a given path, and
|
|
25
|
+
* `watchdogEnv`, the one place that turns the timing constants into the env vars the script reads —
|
|
26
|
+
* callers should use it rather than building that env object by hand, so a future change to a
|
|
27
|
+
* default only has to happen here.
|
|
28
|
+
*/
|
|
29
|
+
import { randomBytes } from 'node:crypto';
|
|
30
|
+
import { chmod, lstat, mkdir, readFile, rename, rm, writeFile } from 'node:fs/promises';
|
|
31
|
+
import { basename, dirname, join } from 'node:path';
|
|
32
|
+
import { AtomicCoreError } from '../../contracts/index.js';
|
|
33
|
+
// ── Timing constants ─────────────────────────────────────────────────────────────────────────────
|
|
34
|
+
//
|
|
35
|
+
// Placeholders (design.md "Open Questions" ▸ "Точные значения heartbeat-интервала, лимита
|
|
36
|
+
// watchdog... измеряются в live-тесте core"): task 2.19 measures real values against real hardware
|
|
37
|
+
// and updates these. They are deliberately generous relative to a plausible heartbeat write cost so
|
|
38
|
+
// a slow disk does not trip the watchdog on its own. This is the one place all three live — the
|
|
39
|
+
// heartbeat ticker (`heartbeat.ts`), the watchdog script and `watchdogEnv` below all agree with each
|
|
40
|
+
// other only because everything reads from here; nothing else in the codebase should redeclare them.
|
|
41
|
+
/** How often the core touches the heartbeat file. */
|
|
42
|
+
export const DEFAULT_HEARTBEAT_INTERVAL_SECS = 5;
|
|
43
|
+
/** How long the heartbeat file may go unchanged before the watchdog kills the engine. */
|
|
44
|
+
export const DEFAULT_WATCHDOG_STALE_LIMIT_SECS = 30;
|
|
45
|
+
/** How often the watchdog polls the heartbeat file. */
|
|
46
|
+
export const DEFAULT_WATCHDOG_POLL_INTERVAL_SECS = DEFAULT_HEARTBEAT_INTERVAL_SECS;
|
|
47
|
+
/** TERM→KILL grace the watchdog gives the engine once it has decided to stop it. */
|
|
48
|
+
export const DEFAULT_WATCHDOG_KILL_GRACE_SECS = 10;
|
|
49
|
+
// ── Script configuration surface ─────────────────────────────────────────────────────────────────
|
|
50
|
+
//
|
|
51
|
+
// The script's own argv is reserved entirely for the engine command Docker passes as CMD (it must
|
|
52
|
+
// follow a literal "--" and is forwarded as "$@", never built into or eval'd as a shell string), so
|
|
53
|
+
// the watchdog's own settings travel as env vars instead.
|
|
54
|
+
export const WATCHDOG_ENV_VARS = {
|
|
55
|
+
heartbeatFile: 'ATOMIC_WATCHDOG_HEARTBEAT_FILE',
|
|
56
|
+
staleLimitSecs: 'ATOMIC_WATCHDOG_STALE_LIMIT_SECS',
|
|
57
|
+
pollIntervalSecs: 'ATOMIC_WATCHDOG_POLL_INTERVAL_SECS',
|
|
58
|
+
killGraceSecs: 'ATOMIC_WATCHDOG_KILL_GRACE_SECS',
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Builds the `ATOMIC_WATCHDOG_*` env vars the script needs, filling in the timing constants above
|
|
62
|
+
* for anything the caller does not override. This is the single place that turns those constants
|
|
63
|
+
* into the wire form the script reads — the executor/lifecycle MUST build the container's env
|
|
64
|
+
* through this function rather than re-deriving `ATOMIC_WATCHDOG_POLL_INTERVAL_SECS` and friends
|
|
65
|
+
* itself, so the three timing knobs never drift out of sync with the ticker's own default interval.
|
|
66
|
+
*/
|
|
67
|
+
export function watchdogEnv(options) {
|
|
68
|
+
return {
|
|
69
|
+
[WATCHDOG_ENV_VARS.heartbeatFile]: options.heartbeatFile,
|
|
70
|
+
[WATCHDOG_ENV_VARS.staleLimitSecs]: String(options.staleLimitSecs ?? DEFAULT_WATCHDOG_STALE_LIMIT_SECS),
|
|
71
|
+
[WATCHDOG_ENV_VARS.pollIntervalSecs]: String(options.pollIntervalSecs ?? DEFAULT_WATCHDOG_POLL_INTERVAL_SECS),
|
|
72
|
+
[WATCHDOG_ENV_VARS.killGraceSecs]: String(options.killGraceSecs ?? DEFAULT_WATCHDOG_KILL_GRACE_SECS),
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
/** The script's own config was missing or malformed (missing env var, missing `--` separator, a
|
|
76
|
+
* timing value that is not a positive integer). */
|
|
77
|
+
export const WATCHDOG_EXIT_CODE_CONFIG_ERROR = 96;
|
|
78
|
+
/** The heartbeat observation (an mtime, or "missing") held unchanged for the stale threshold. */
|
|
79
|
+
export const WATCHDOG_EXIT_CODE_STALE_HEARTBEAT = 97;
|
|
80
|
+
/** Suggested filename for `writeWatchdogScript`'s target; the executor decides the actual path. */
|
|
81
|
+
export const WATCHDOG_SCRIPT_FILENAME = 'atomic-watchdog-entrypoint.sh';
|
|
82
|
+
/** Mode the script is written with: readable and executable, never writable, not even by owner. */
|
|
83
|
+
export const WATCHDOG_SCRIPT_MODE = 0o555;
|
|
84
|
+
// ── The script itself ────────────────────────────────────────────────────────────────────────────
|
|
85
|
+
//
|
|
86
|
+
// Built from an array of lines (not a template literal) so the shell's own "${...}" syntax never
|
|
87
|
+
// collides with JavaScript's — nothing here needs interpolation from TypeScript.
|
|
88
|
+
//
|
|
89
|
+
// Notes on choices that are not obvious from the text:
|
|
90
|
+
//
|
|
91
|
+
// - `set -u` only, not `-e`: shells disagree on whether `set -e` fires when a command substitution
|
|
92
|
+
// used in a plain assignment (`x=$(cmd)`) fails, so every failure this script cares about is
|
|
93
|
+
// checked explicitly instead.
|
|
94
|
+
//
|
|
95
|
+
// - Staleness is judged by whether the heartbeat *observation* — its mtime, or the literal
|
|
96
|
+
// "missing" — has stayed the same for `THRESHOLD` consecutive polls counted from script start,
|
|
97
|
+
// never by comparing that mtime against the current wall clock. A wall-clock "now - mtime >=
|
|
98
|
+
// limit" check has three real failure modes this avoids: an unwritable heartbeat directory made
|
|
99
|
+
// the tolerant create's own redirection fail in a way that used to abort the whole shell before
|
|
100
|
+
// the engine even started (a `: > file` redirection failure is a *special builtin* error, which
|
|
101
|
+
// POSIX allows a non-interactive shell to treat as fatal); a leftover heartbeat file from a
|
|
102
|
+
// previous run has an mtime old enough to look already-stale on the very first poll; and a host
|
|
103
|
+
// clock that jumps (NTP step, VM pause/resume) desyncs "now" from the mtime it is compared against
|
|
104
|
+
// in either direction. Comparing consecutive observations to each other sidesteps all three: the
|
|
105
|
+
// file being created late, missing outright, or already old are just more values that either stay
|
|
106
|
+
// the same (and eventually trip the threshold) or change (and reset the count), independent of
|
|
107
|
+
// what time it is. The baseline (`PREV_OBSERVATION`) is read exactly once, right after the
|
|
108
|
+
// tolerant create, and `UNCHANGED_POLLS` starts at 0 and is reset to 0 (not 1) on every change —
|
|
109
|
+
// the poll that first observes a value establishes the baseline, it does not itself count as one
|
|
110
|
+
// confirmed-unchanged poll, or `STALE_LIMIT_SECS <= POLL_INTERVAL_SECS` would kill a heartbeat
|
|
111
|
+
// that was changing on every single poll (findings-2.9-r2 item 1).
|
|
112
|
+
//
|
|
113
|
+
// - `THRESHOLD = ceil((STALE_LIMIT_SECS + 1) / POLL_INTERVAL_SECS)`, not `ceil(STALE_LIMIT_SECS /
|
|
114
|
+
// POLL_INTERVAL_SECS)`. Plain `ceil(limit/poll)` polls after the baseline is *usually* enough, but
|
|
115
|
+
// mtime's whole-second resolution can make it up to a second short: a write at, say, X.9s records
|
|
116
|
+
// mtime X, and a later poll landing at exactly X+limit can already show that same integer second
|
|
117
|
+
// as its own most recent write if that write also happened to floor to X — so a plain
|
|
118
|
+
// `ceil(limit/poll)` can fire as early as `limit - 1` real seconds after the true last write when
|
|
119
|
+
// `poll` evenly divides `limit`. Padding the numerator by one whole second absorbs that one-second
|
|
120
|
+
// floor error, so the kill is never earlier than `STALE_LIMIT_SECS` after the last real write —
|
|
121
|
+
// only, in the worst case, up to `POLL_INTERVAL_SECS` later than the old formula would have fired
|
|
122
|
+
// (findings-2.9-r3 item 3; a smaller, residual version of the round-2 off-by-one's own symptom —
|
|
123
|
+
// that one could fire a full poll interval early in the general case and is fixed separately
|
|
124
|
+
// above; this is the up-to-one-second error that remains from mtime's own rounding even once the
|
|
125
|
+
// poll counting itself is exactly right).
|
|
126
|
+
//
|
|
127
|
+
// - A heartbeat file that already exists when the script starts is left alone, not truncated: the
|
|
128
|
+
// tolerant create only runs when nothing is there yet. Its age never mattered to the loop above,
|
|
129
|
+
// only whether it keeps changing from here on, so there was never a correctness reason to touch
|
|
130
|
+
// it — and leaving it alone is what makes "a genuinely leftover file" something a test can set up
|
|
131
|
+
// and then verify was not clobbered.
|
|
132
|
+
//
|
|
133
|
+
// - mtime is read with `stat -c %Y` (GNU coreutils — the actual runtime is the NGC Ubuntu base
|
|
134
|
+
// image) falling back to `stat -f %m` (BSD/macOS `stat`), so the exact same file also runs under
|
|
135
|
+
// the `/bin/sh` on a macOS development machine, which is what the test suite for this script does
|
|
136
|
+
// (no container involved). Both forms report mtime with whole-second resolution only, which
|
|
137
|
+
// matters for how small `ATOMIC_WATCHDOG_POLL_INTERVAL_SECS` can safely be: two polls one second
|
|
138
|
+
// apart can land on either side of the *same* integer second under ordinary scheduling jitter
|
|
139
|
+
// even while the file is genuinely being rewritten several times a second, reading as a false
|
|
140
|
+
// "unchanged" observation. `DEFAULT_WATCHDOG_POLL_INTERVAL_SECS` (5s, matching the heartbeat
|
|
141
|
+
// ticker's own default interval) gives ample margin; a caller that overrides it much smaller than
|
|
142
|
+
// that should keep `STALE_LIMIT_SECS` large enough, relative to the poll interval, that one
|
|
143
|
+
// aliased poll cannot look like a full stale window on its own.
|
|
144
|
+
//
|
|
145
|
+
// - The poll sleep is backgrounded and `wait`-ed (`sleep "$N" & wait $!`) rather than run in the
|
|
146
|
+
// foreground, and traps are installed before the engine ever starts: a foreground `sleep` blocks
|
|
147
|
+
// a POSIX shell from running a trap until that sleep itself returns, so `docker stop`'s TERM
|
|
148
|
+
// could sit unhandled for up to one whole poll interval; `wait` is interruptible immediately.
|
|
149
|
+
// Traps go in before `"$@" &` because this script is the container's PID 1, and PID 1 gets no
|
|
150
|
+
// signal at all for anything it has not explicitly trapped — a window with the engine running and
|
|
151
|
+
// no trap installed yet would make `docker stop` silently do nothing during it.
|
|
152
|
+
//
|
|
153
|
+
// - INT is forwarded as TERM, not as INT: a command started with `&` when job control is off (the
|
|
154
|
+
// normal state for a non-interactive script) has SIGINT ignored for it by the shell as part of
|
|
155
|
+
// POSIX's rules for asynchronous lists, so sending the engine a literal INT can be a silent
|
|
156
|
+
// no-op. TERM has no such carve-out, so both signals converge on it.
|
|
157
|
+
//
|
|
158
|
+
// - Both the stale-heartbeat path and TERM/INT forwarding go through the same `terminate_engine`:
|
|
159
|
+
// TERM, then poll for exit, escalating to KILL once `KILL_GRACE_SECS` has passed with the engine
|
|
160
|
+
// still alive. Forwarding a stop signal is not allowed to hang forever on an engine that never
|
|
161
|
+
// reacts. The poll itself is a short `sleep 0.25 & wait $!` (backgrounded/`wait`-ed, for the same
|
|
162
|
+
// reason as the main loop's poll sleep) rather than a full second, so an engine that dies right
|
|
163
|
+
// after TERM is noticed promptly — `kill -0` cannot tell a genuinely running process from a
|
|
164
|
+
// not-yet-reaped zombie, so without frequent re-checking, the *first* check after sending TERM
|
|
165
|
+
// would still see the (zombie) pid as present and commit to a full second's wait before checking
|
|
166
|
+
// again (findings-2.9-r3 item 7).
|
|
167
|
+
//
|
|
168
|
+
// - `terminate_engine` guards against re-entry with `STOPPING`: a second TERM/INT arriving while a
|
|
169
|
+
// shutdown is already in progress (`docker stop` repeating itself, or a TERM landing during the
|
|
170
|
+
// stale path's own grace wait) does not restart the grace clock, and — as of this round — does not
|
|
171
|
+
// even shorten it. `GRACE_DEADLINE` is a wall-clock deadline (`date +%s` plus `KILL_GRACE_SECS`
|
|
172
|
+
// plus one, seconds since the epoch) taken once, the first time `STOPPING` flips to 1, and never touched
|
|
173
|
+
// again; the initial signal is likewise sent only once. Two rounds of the same bug, both from
|
|
174
|
+
// treating the grace period as a count of loop iterations instead of an actual span of time:
|
|
175
|
+
// counting *polls* let a trap firing again *during* the interrupted call's own `wait` restart
|
|
176
|
+
// `terminate_engine` from its top on every signal, so a TERM repeating faster than `KILL_GRACE_SECS`
|
|
177
|
+
// could postpone the KILL indefinitely (findings-2.9-r2 item 2); the first fix for that counted
|
|
178
|
+
// *elapsed polls* instead of restarting them, which stopped the postponement but introduced the
|
|
179
|
+
// opposite problem — each interrupted poll still advanced the count by a full nominal second
|
|
180
|
+
// regardless of how little real time had actually elapsed, so ten TERMs 100ms apart could cut a
|
|
181
|
+
// 10s grace period down to close to 1s (findings-2.9-r3 item 2). A wall-clock deadline is immune to
|
|
182
|
+
// both: however many times the wait gets interrupted and re-entered, "is it past the deadline yet"
|
|
183
|
+
// gives the same answer it would have without any interruptions at all. `STOP_EXIT_CODE` exists for
|
|
184
|
+
// the same re-entry: if the stale path is what is tearing the engine down, its trap invocation
|
|
185
|
+
// (should one fire mid-shutdown) must still `exit 97`, not whatever status the interrupted `wait`
|
|
186
|
+
// happened to leave in `$?` — the stale branch sets it before calling `terminate_engine`, and the
|
|
187
|
+
// TERM/INT trap falls back to `$?` only when nothing set it. The `+ 1` (final review M-10):
|
|
188
|
+
// `date +%s` floors, so a deadline of `now + KILL_GRACE_SECS` taken at X.9 s fired at X+G, only
|
|
189
|
+
// G-0.9 s later — the real grace landed anywhere in (G-1, G]. Adding one second makes it
|
|
190
|
+
// (G, G+1]: never shorter than the grace an engine was promised, at most a second longer.
|
|
191
|
+
//
|
|
192
|
+
// - `date +%s` and a fractional `sleep 0.25` are not POSIX, but both shells this script runs under
|
|
193
|
+
// support them: GNU coreutils in the NGC Ubuntu base image, and BSD `date`/`sleep` on the macOS
|
|
194
|
+
// machines its tests run on. A base image without them would need this revisited.
|
|
195
|
+
//
|
|
196
|
+
// - `terminate_engine` resolves the pid to act on as `${ENGINE_PID:-$!}` (with `set +u`/`set -u`
|
|
197
|
+
// bracketing it, since `$!` is unset — not just empty — before any job has ever been backgrounded,
|
|
198
|
+
// and referencing an unset special parameter under `set -u` is itself fatal on at least one real
|
|
199
|
+
// `/bin/sh`). A TERM/INT landing in the gap between `"$@" &` starting the engine and the very next
|
|
200
|
+
// statement assigning `ENGINE_PID=$!` would otherwise see `ENGINE_PID` still empty and return
|
|
201
|
+
// early as if there were nothing to stop — exiting 0 with the engine alive and orphaned
|
|
202
|
+
// (findings-2.9-r2 item 3). `$!` — the shell's own record of the most recently started background
|
|
203
|
+
// job — still resolves correctly in exactly that gap, because it is set by `&` itself, before the
|
|
204
|
+
// next statement ever runs.
|
|
205
|
+
//
|
|
206
|
+
// - A missing heartbeat file is just another observation value, not a special case: the file is
|
|
207
|
+
// still created tolerantly at startup (wrapped in a subshell, `( : > "$F" ) 2>/dev/null || true`,
|
|
208
|
+
// so a failure there cannot take the special-builtin-abort path down with it), but nothing past
|
|
209
|
+
// that point depends on it having worked.
|
|
210
|
+
//
|
|
211
|
+
// - The main loop re-checks `kill -0 "$ENGINE_PID"` immediately before acting on a stale reading, not
|
|
212
|
+
// only at the top of the loop: the poll sleep can span the exact moment the engine exits on its
|
|
213
|
+
// own, and without this second check a poll that turned out stale *and* found the engine already
|
|
214
|
+
// gone would still report the stale-heartbeat exit code (97) instead of the engine's own — hiding
|
|
215
|
+
// what actually happened (a crash, an OOM kill) behind a code that means something else entirely
|
|
216
|
+
// (findings-2.9-r3 item 6).
|
|
217
|
+
//
|
|
218
|
+
// - "$@" is always quoted and only ever used to start a background process, never passed to `eval`
|
|
219
|
+
// or a shell -c string, so nothing in the engine's own argv can be interpreted as shell syntax.
|
|
220
|
+
const WATCHDOG_SCRIPT_LINES = [
|
|
221
|
+
'#!/bin/sh',
|
|
222
|
+
'# atomic-chat-core watchdog entrypoint (openspec change add-tensorrt-llm-linux, task 2.9).',
|
|
223
|
+
'# Generated by src/runtime/container/watchdog.ts — do not edit the mounted copy by hand.',
|
|
224
|
+
'#',
|
|
225
|
+
'# Starts the engine command given after "--" in the background, then kills it and exits if the',
|
|
226
|
+
'# heartbeat file the core touches from outside the container stops changing. Configuration is env',
|
|
227
|
+
'# vars (see watchdogEnv() in watchdog.ts); the script argv is reserved for the engine command.',
|
|
228
|
+
"# Must run as the container's PID 1 (directly or under --init); the container must not use",
|
|
229
|
+
"# --pid=host, or the engine's own workers will outlive this script's exit.",
|
|
230
|
+
'',
|
|
231
|
+
'set -u',
|
|
232
|
+
'',
|
|
233
|
+
'WATCHDOG_EXIT_CONFIG_ERROR=96',
|
|
234
|
+
'WATCHDOG_EXIT_STALE_HEARTBEAT=97',
|
|
235
|
+
'',
|
|
236
|
+
'fail() {',
|
|
237
|
+
' echo "atomic-watchdog: $1" >&2',
|
|
238
|
+
' exit "$WATCHDOG_EXIT_CONFIG_ERROR"',
|
|
239
|
+
'}',
|
|
240
|
+
'',
|
|
241
|
+
'[ -n "${ATOMIC_WATCHDOG_HEARTBEAT_FILE:-}" ] || fail "ATOMIC_WATCHDOG_HEARTBEAT_FILE is required"',
|
|
242
|
+
'[ -n "${ATOMIC_WATCHDOG_STALE_LIMIT_SECS:-}" ] || fail "ATOMIC_WATCHDOG_STALE_LIMIT_SECS is required"',
|
|
243
|
+
'[ -n "${ATOMIC_WATCHDOG_POLL_INTERVAL_SECS:-}" ] || fail "ATOMIC_WATCHDOG_POLL_INTERVAL_SECS is required"',
|
|
244
|
+
'[ -n "${ATOMIC_WATCHDOG_KILL_GRACE_SECS:-}" ] || fail "ATOMIC_WATCHDOG_KILL_GRACE_SECS is required"',
|
|
245
|
+
'',
|
|
246
|
+
'HEARTBEAT_FILE=$ATOMIC_WATCHDOG_HEARTBEAT_FILE',
|
|
247
|
+
'STALE_LIMIT_SECS=$ATOMIC_WATCHDOG_STALE_LIMIT_SECS',
|
|
248
|
+
'POLL_INTERVAL_SECS=$ATOMIC_WATCHDOG_POLL_INTERVAL_SECS',
|
|
249
|
+
'KILL_GRACE_SECS=$ATOMIC_WATCHDOG_KILL_GRACE_SECS',
|
|
250
|
+
'',
|
|
251
|
+
'# A malformed timing value must not silently disable the watchdog (a non-integer',
|
|
252
|
+
'# STALE_LIMIT_SECS would make the arithmetic below fail with "Illegal number" only once it is',
|
|
253
|
+
'# first used, and a zero POLL_INTERVAL_SECS would turn the poll loop into a busy loop). A leading',
|
|
254
|
+
'# zero is rejected too, not just tolerated as decimal: "08"/"09" are not valid octal digits and',
|
|
255
|
+
'# abort arithmetic evaluation outright, and "010" is silently octal 8, not decimal ten — neither',
|
|
256
|
+
'# is a value anyone setting this env var meant to produce.',
|
|
257
|
+
'validate_positive_int() {',
|
|
258
|
+
' case $2 in',
|
|
259
|
+
" ''|*[!0-9]*|0|0[0-9]*) fail \"$1 must be a positive integer with no leading zero (got '$2')\" ;;",
|
|
260
|
+
' esac',
|
|
261
|
+
' [ "$2" -gt 0 ] 2>/dev/null || fail "$1 must be a positive integer with no leading zero (got \'$2\')"',
|
|
262
|
+
'}',
|
|
263
|
+
'validate_positive_int ATOMIC_WATCHDOG_STALE_LIMIT_SECS "$STALE_LIMIT_SECS"',
|
|
264
|
+
'validate_positive_int ATOMIC_WATCHDOG_POLL_INTERVAL_SECS "$POLL_INTERVAL_SECS"',
|
|
265
|
+
'validate_positive_int ATOMIC_WATCHDOG_KILL_GRACE_SECS "$KILL_GRACE_SECS"',
|
|
266
|
+
'',
|
|
267
|
+
'[ "${1:-}" = "--" ] || fail "expected -- before the engine command"',
|
|
268
|
+
'shift',
|
|
269
|
+
'',
|
|
270
|
+
'# Consecutive-unchanged-polls threshold. +1 on the limit (equivalently: ceil((limit+1)/poll))',
|
|
271
|
+
"# pads out one whole second of slack for mtime's own whole-second rounding, so a kill can never",
|
|
272
|
+
'# land earlier than STALE_LIMIT_SECS after the true last write, only possibly a bit later.',
|
|
273
|
+
"# PREV_OBSERVATION is seeded once, right below (after the tolerant create), from the heartbeat's",
|
|
274
|
+
'# actual state; UNCHANGED_POLLS then counts polls whose observation matched the one before it,',
|
|
275
|
+
'# starting from 0 — the poll that establishes the baseline is not itself counted as unchanged.',
|
|
276
|
+
'THRESHOLD=$(( (STALE_LIMIT_SECS + POLL_INTERVAL_SECS) / POLL_INTERVAL_SECS ))',
|
|
277
|
+
'',
|
|
278
|
+
'# Only if nothing is there yet: a genuinely leftover file from a previous run is left alone. Best-',
|
|
279
|
+
'# effort either way — staleness is judged by the observation loop below, not by this having worked.',
|
|
280
|
+
'if [ ! -e "$HEARTBEAT_FILE" ]; then',
|
|
281
|
+
' ( : > "$HEARTBEAT_FILE" ) 2>/dev/null || true',
|
|
282
|
+
'fi',
|
|
283
|
+
'',
|
|
284
|
+
'heartbeat_observation() {',
|
|
285
|
+
' m=$(stat -c %Y "$1" 2>/dev/null) && { echo "$m"; return 0; }',
|
|
286
|
+
' m=$(stat -f %m "$1" 2>/dev/null) && { echo "$m"; return 0; }',
|
|
287
|
+
' echo missing',
|
|
288
|
+
'}',
|
|
289
|
+
'',
|
|
290
|
+
'PREV_OBSERVATION=$(heartbeat_observation "$HEARTBEAT_FILE")',
|
|
291
|
+
'UNCHANGED_POLLS=0',
|
|
292
|
+
'',
|
|
293
|
+
'ENGINE_PID=',
|
|
294
|
+
'STOPPING=0',
|
|
295
|
+
'GRACE_DEADLINE=',
|
|
296
|
+
'STOP_EXIT_CODE=',
|
|
297
|
+
'',
|
|
298
|
+
'terminate_engine() {',
|
|
299
|
+
' set +u',
|
|
300
|
+
' pid=${ENGINE_PID:-$!}',
|
|
301
|
+
' set -u',
|
|
302
|
+
' [ -n "$pid" ] || return 0',
|
|
303
|
+
' if [ "$STOPPING" -eq 0 ]; then',
|
|
304
|
+
' STOPPING=1',
|
|
305
|
+
' kill -"$1" "$pid" 2>/dev/null || true',
|
|
306
|
+
' GRACE_DEADLINE=$(( $(date +%s) + KILL_GRACE_SECS + 1 ))',
|
|
307
|
+
' fi',
|
|
308
|
+
' while kill -0 "$pid" 2>/dev/null; do',
|
|
309
|
+
' if [ "$(date +%s)" -ge "$GRACE_DEADLINE" ]; then',
|
|
310
|
+
' kill -KILL "$pid" 2>/dev/null || true',
|
|
311
|
+
' break',
|
|
312
|
+
' fi',
|
|
313
|
+
' sleep 0.25 & wait $!',
|
|
314
|
+
' done',
|
|
315
|
+
' wait "$pid" 2>/dev/null',
|
|
316
|
+
'}',
|
|
317
|
+
'',
|
|
318
|
+
'trap \'terminate_engine TERM; exit "${STOP_EXIT_CODE:-$?}"\' TERM',
|
|
319
|
+
'trap \'terminate_engine TERM; exit "${STOP_EXIT_CODE:-$?}"\' INT',
|
|
320
|
+
'',
|
|
321
|
+
'"$@" &',
|
|
322
|
+
'ENGINE_PID=$!',
|
|
323
|
+
'',
|
|
324
|
+
'while true; do',
|
|
325
|
+
' if ! kill -0 "$ENGINE_PID" 2>/dev/null; then',
|
|
326
|
+
' wait "$ENGINE_PID"',
|
|
327
|
+
' exit $?',
|
|
328
|
+
' fi',
|
|
329
|
+
'',
|
|
330
|
+
' sleep "$POLL_INTERVAL_SECS" & wait $!',
|
|
331
|
+
'',
|
|
332
|
+
' OBSERVATION=$(heartbeat_observation "$HEARTBEAT_FILE")',
|
|
333
|
+
' if [ "$OBSERVATION" = "$PREV_OBSERVATION" ]; then',
|
|
334
|
+
' UNCHANGED_POLLS=$((UNCHANGED_POLLS + 1))',
|
|
335
|
+
' else',
|
|
336
|
+
' UNCHANGED_POLLS=0',
|
|
337
|
+
' PREV_OBSERVATION=$OBSERVATION',
|
|
338
|
+
' fi',
|
|
339
|
+
'',
|
|
340
|
+
' if [ "$UNCHANGED_POLLS" -ge "$THRESHOLD" ]; then',
|
|
341
|
+
' # The engine may have exited on its own during the sleep just above, in the same poll that',
|
|
342
|
+
' # also turned out stale; its own exit status is what happened and takes priority over 97.',
|
|
343
|
+
' if ! kill -0 "$ENGINE_PID" 2>/dev/null; then',
|
|
344
|
+
' wait "$ENGINE_PID"',
|
|
345
|
+
' exit $?',
|
|
346
|
+
' fi',
|
|
347
|
+
' echo "atomic-watchdog: heartbeat unchanged for $UNCHANGED_POLLS/$THRESHOLD polls; stopping the engine" >&2',
|
|
348
|
+
' STOP_EXIT_CODE=$WATCHDOG_EXIT_STALE_HEARTBEAT',
|
|
349
|
+
' terminate_engine TERM',
|
|
350
|
+
' exit "$WATCHDOG_EXIT_STALE_HEARTBEAT"',
|
|
351
|
+
' fi',
|
|
352
|
+
'done',
|
|
353
|
+
'',
|
|
354
|
+
];
|
|
355
|
+
/** The watchdog entrypoint script text, ready to write to disk verbatim. */
|
|
356
|
+
export const WATCHDOG_SCRIPT = WATCHDOG_SCRIPT_LINES.join('\n');
|
|
357
|
+
const NODE_FS = { mkdir, writeFile, chmod, rename, rm, lstat, readFile };
|
|
358
|
+
/**
|
|
359
|
+
* Whether `path` is already exactly what `writeWatchdogScript` would produce: a regular file (not a
|
|
360
|
+
* symlink, not a directory or anything else), mode `0555` exactly, holding `WATCHDOG_SCRIPT`
|
|
361
|
+
* verbatim. Content alone is not enough — a symlink that happens to point at identical content, or a
|
|
362
|
+
* regular file with the right content but the wrong mode (e.g. still `0644` from some other writer),
|
|
363
|
+
* both need to be replaced, not left alone.
|
|
364
|
+
*/
|
|
365
|
+
async function isCurrent(fs, path, host) {
|
|
366
|
+
const info = await fs.lstat(path).catch(() => undefined);
|
|
367
|
+
if (info === undefined || !info.isFile())
|
|
368
|
+
return false;
|
|
369
|
+
// Windows keeps no POSIX mode: a 0555 file reads back as 0444, so the mode can never match there
|
|
370
|
+
// and only the content says whether the script is current.
|
|
371
|
+
if (host !== 'win32' && (info.mode & 0o777) !== WATCHDOG_SCRIPT_MODE)
|
|
372
|
+
return false;
|
|
373
|
+
const content = await fs.readFile(path, 'utf8').catch(() => undefined);
|
|
374
|
+
return content === WATCHDOG_SCRIPT;
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* Writes the watchdog entrypoint script to `path`, atomically and idempotently.
|
|
378
|
+
*
|
|
379
|
+
* A second call on a path that already holds the current script at the right mode (the common case:
|
|
380
|
+
* the executor calls this on every container start, not only the first) is a no-op — worth checking,
|
|
381
|
+
* since the file is `0555` and a second `writeFile` straight at that path would fail `EACCES`. When
|
|
382
|
+
* it is not already current, the script is written to a temp file in the same directory (created
|
|
383
|
+
* exclusively, so two writers never interleave into the same temp name), locked to `0555`, then
|
|
384
|
+
* `rename`d over the target: a rename replaces whatever is at the destination — including a symlink
|
|
385
|
+
* itself, not whatever it points at — in one atomic step, so a container that is mid-read of the old
|
|
386
|
+
* script never sees a half-written file, and nothing already running with the old copy open loses it
|
|
387
|
+
* out from under itself. If `chmod` or `rename` fails partway through, the abandoned temp file is
|
|
388
|
+
* removed rather than left behind for the next call (or a directory listing) to trip over.
|
|
389
|
+
*
|
|
390
|
+
* The executor (task 2.8/2.12) bind-mounts the result into the model container read-only and passes
|
|
391
|
+
* it as the container's entrypoint; this function has no opinion on where `path` lives — that is the
|
|
392
|
+
* core's per-scope data directory, chosen by the caller.
|
|
393
|
+
*/
|
|
394
|
+
export async function writeWatchdogScript(path, fs = NODE_FS, host = process.platform) {
|
|
395
|
+
if (await isCurrent(fs, path, host))
|
|
396
|
+
return path;
|
|
397
|
+
let tempPath;
|
|
398
|
+
try {
|
|
399
|
+
const dir = dirname(path);
|
|
400
|
+
await fs.mkdir(dir, { recursive: true });
|
|
401
|
+
tempPath = join(dir, `.${basename(path)}.tmp-${randomBytes(6).toString('hex')}`);
|
|
402
|
+
await fs.writeFile(tempPath, WATCHDOG_SCRIPT, { flag: 'wx' });
|
|
403
|
+
await fs.chmod(tempPath, WATCHDOG_SCRIPT_MODE);
|
|
404
|
+
// On Windows the 0555 of an earlier write is the read-only attribute, and NTFS refuses to rename
|
|
405
|
+
// over a read-only file (EPERM): the second write after a restart failed. Made writable first, the
|
|
406
|
+
// replacement stays one rename.
|
|
407
|
+
if (host === 'win32')
|
|
408
|
+
await fs.chmod(path, 0o644).catch(() => { });
|
|
409
|
+
await fs.rename(tempPath, path);
|
|
410
|
+
}
|
|
411
|
+
catch (error) {
|
|
412
|
+
if (tempPath !== undefined)
|
|
413
|
+
await fs.rm(tempPath).catch(() => { });
|
|
414
|
+
throw new AtomicCoreError('IO_ERROR', 'Cannot write the watchdog entrypoint script.', error instanceof Error ? error.message : String(error));
|
|
415
|
+
}
|
|
416
|
+
return path;
|
|
417
|
+
}
|
|
418
|
+
//# sourceMappingURL=watchdog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watchdog.js","sourceRoot":"","sources":["../../../src/runtime/container/watchdog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACvF,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAE1D,oGAAoG;AACpG,EAAE;AACF,0FAA0F;AAC1F,mGAAmG;AACnG,oGAAoG;AACpG,gGAAgG;AAChG,qGAAqG;AACrG,qGAAqG;AAErG,qDAAqD;AACrD,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAA;AAChD,yFAAyF;AACzF,MAAM,CAAC,MAAM,iCAAiC,GAAG,EAAE,CAAA;AACnD,uDAAuD;AACvD,MAAM,CAAC,MAAM,mCAAmC,GAAG,+BAA+B,CAAA;AAClF,oFAAoF;AACpF,MAAM,CAAC,MAAM,gCAAgC,GAAG,EAAE,CAAA;AAElD,oGAAoG;AACpG,EAAE;AACF,kGAA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C7D,MAAM,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,oBAAoB,CAAC,CAAA;QAC9C,iGAAiG;QACjG,mGAAmG;QACnG,gCAAgC;QAChC,IAAI,IAAI,KAAK,OAAO;YAAE,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAA;QACjE,MAAM,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;IACjC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,QAAQ,KAAK,SAAS;YAAE,MAAM,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAA;QACjE,MAAM,IAAI,eAAe,CACvB,UAAU,EACV,8CAA8C,EAC9C,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CACvD,CAAA;IACH,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core startup's half of the Docker executor (task 2.12; task 2.10 review carry-forward): on Linux,
|
|
3
|
+
* with a docker CLI in a system directory, build the one `DockerExec` this core uses — the absolute
|
|
4
|
+
* binary, the core-owned empty `DOCKER_CONFIG` — open this scope's execution journal, and reconcile
|
|
5
|
+
* it before the first load can be served (spec `tensorrt-llm-runtime`, "Восстановление контейнеров
|
|
6
|
+
* после перезапуска core"). `core/create.ts` calls this; the managed-text provider (task 2.14) keeps
|
|
7
|
+
* the returned executor and journal for its lifecycle.
|
|
8
|
+
*/
|
|
9
|
+
import type { DataLayout } from '../../config/index.js';
|
|
10
|
+
import { ExecutionJournal } from './execution-journal.js';
|
|
11
|
+
import type { ExecutionReconcileResult, ReconcileLogger } from './reconcile.js';
|
|
12
|
+
import type { DockerExec } from './types.js';
|
|
13
|
+
import type { WslDistributionTransport } from '../wsl/index.js';
|
|
14
|
+
export interface WireManagedContainersOptions {
|
|
15
|
+
/** Injected, never `process.platform` read here. */
|
|
16
|
+
platform: NodeJS.Platform;
|
|
17
|
+
layout: DataLayout;
|
|
18
|
+
instanceId: string;
|
|
19
|
+
log: ReconcileLogger;
|
|
20
|
+
/** The docker CLI to run; `undefined` resolves it from the system directories, `null` means none. */
|
|
21
|
+
dockerPath?: string | null;
|
|
22
|
+
/** The Docker Engine API socket image pulls stream from. Default `DOCKER_SOCKET_PATH`; a test seam. */
|
|
23
|
+
dockerSocketPath?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Deadline of each `docker inspect`/`docker rm` the startup reconcile makes. Default
|
|
26
|
+
* `RECONCILE_CALL_TIMEOUT_MS`. Not the stop's: `stopContainer` gives its own call `--time` plus 5 s.
|
|
27
|
+
*/
|
|
28
|
+
reconcileCallTimeoutMs?: number;
|
|
29
|
+
/** Past this, reconcile starts no further record. Default `RECONCILE_BUDGET_MS`. */
|
|
30
|
+
reconcileBudgetMs?: number;
|
|
31
|
+
/**
|
|
32
|
+
* Windows (change `add-tensorrt-llm-windows`): Atomic Chat's WSL distribution, or null before it is
|
|
33
|
+
* imported. Docker runs there, as the guest's root through `wsl.exe` (`guestDockerExec`).
|
|
34
|
+
*/
|
|
35
|
+
guest?: () => Promise<WslDistributionTransport | null>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Startup must not wait on a hung daemon (task 2.12 review round 1, item 5): each `docker inspect` and
|
|
39
|
+
* `docker rm` of the reconcile gets this short deadline instead of the executor's usual 30 s. The stop
|
|
40
|
+
* is bounded separately: `docker stop --time RECONCILE_STARTUP_STOP_TIMEOUT_SECONDS`, whose own call
|
|
41
|
+
* deadline `stopContainer` sets to that plus 5 s. That shorter `--time` also halves the grace a
|
|
42
|
+
* leftover engine gets between SIGTERM and SIGKILL (5 s instead of an unload's 10 s).
|
|
43
|
+
*/
|
|
44
|
+
export declare const RECONCILE_CALL_TIMEOUT_MS = 10000;
|
|
45
|
+
export declare const RECONCILE_STARTUP_STOP_TIMEOUT_SECONDS = 5;
|
|
46
|
+
/**
|
|
47
|
+
* No record is started after this. Worst case, startup waits this long plus one record's three calls
|
|
48
|
+
* (inspect, stop, rm) at `RECONCILE_CALL_TIMEOUT_MS` each; anything left is reconciled next startup.
|
|
49
|
+
*/
|
|
50
|
+
export declare const RECONCILE_BUDGET_MS = 20000;
|
|
51
|
+
export interface ManagedContainers {
|
|
52
|
+
exec: DockerExec;
|
|
53
|
+
journal: ExecutionJournal;
|
|
54
|
+
dockerPath: string;
|
|
55
|
+
/** Where `pullImage` reaches the Engine API (the system socket outside tests). */
|
|
56
|
+
socketPath: string;
|
|
57
|
+
reconciled: ExecutionReconcileResult;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* `null` off Linux and Windows, when no docker CLI is installed, or on Windows before Atomic Chat's
|
|
61
|
+
* WSL distribution exists: there is nothing to run a container with.
|
|
62
|
+
*/
|
|
63
|
+
export declare function wireManagedContainers(options: WireManagedContainersOptions): Promise<ManagedContainers | null>;
|
|
64
|
+
/**
|
|
65
|
+
* The one Docker executor of this core, wired lazily (task 2.6; carry-forward from 2.8/2.12: keep
|
|
66
|
+
* the startup handle, never construct a second). Core startup resolves it once, which reconciles
|
|
67
|
+
* the execution journal as before. On a machine with no docker CLI at startup it stays null — until
|
|
68
|
+
* the setup's privileged step installs Docker, when the next caller wires it then. Every caller —
|
|
69
|
+
* the environment setup, and the managed-text provider (task 2.14) — goes through the same handle,
|
|
70
|
+
* so there is only ever one executor and one journal per core.
|
|
71
|
+
*/
|
|
72
|
+
export interface ManagedContainersHandle {
|
|
73
|
+
/** What has been wired so far, without trying again. */
|
|
74
|
+
current(): ManagedContainers | null;
|
|
75
|
+
/** The executor, wiring it on first use and retrying after a start that found no docker CLI. */
|
|
76
|
+
resolve(): Promise<ManagedContainers | null>;
|
|
77
|
+
}
|
|
78
|
+
export declare function createManagedContainersHandle(options: WireManagedContainersOptions, wire?: (options: WireManagedContainersOptions) => Promise<ManagedContainers | null>): ManagedContainersHandle;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { DOCKER_SOCKET_PATH } from './argv.js';
|
|
2
|
+
import { resolveDockerBinary } from './docker-binary.js';
|
|
3
|
+
import { createDockerExec } from './exec.js';
|
|
4
|
+
import { ExecutionJournal } from './execution-journal.js';
|
|
5
|
+
import { reconcileExecutions } from './reconcile.js';
|
|
6
|
+
import { GUEST_DOCKER_BINARY, guestDockerExec } from './wsl-exec.js';
|
|
7
|
+
/**
|
|
8
|
+
* Startup must not wait on a hung daemon (task 2.12 review round 1, item 5): each `docker inspect` and
|
|
9
|
+
* `docker rm` of the reconcile gets this short deadline instead of the executor's usual 30 s. The stop
|
|
10
|
+
* is bounded separately: `docker stop --time RECONCILE_STARTUP_STOP_TIMEOUT_SECONDS`, whose own call
|
|
11
|
+
* deadline `stopContainer` sets to that plus 5 s. That shorter `--time` also halves the grace a
|
|
12
|
+
* leftover engine gets between SIGTERM and SIGKILL (5 s instead of an unload's 10 s).
|
|
13
|
+
*/
|
|
14
|
+
export const RECONCILE_CALL_TIMEOUT_MS = 10_000;
|
|
15
|
+
export const RECONCILE_STARTUP_STOP_TIMEOUT_SECONDS = 5;
|
|
16
|
+
/**
|
|
17
|
+
* No record is started after this. Worst case, startup waits this long plus one record's three calls
|
|
18
|
+
* (inspect, stop, rm) at `RECONCILE_CALL_TIMEOUT_MS` each; anything left is reconciled next startup.
|
|
19
|
+
*/
|
|
20
|
+
export const RECONCILE_BUDGET_MS = 20_000;
|
|
21
|
+
/**
|
|
22
|
+
* `null` off Linux and Windows, when no docker CLI is installed, or on Windows before Atomic Chat's
|
|
23
|
+
* WSL distribution exists: there is nothing to run a container with.
|
|
24
|
+
*/
|
|
25
|
+
export async function wireManagedContainers(options) {
|
|
26
|
+
let dockerPath;
|
|
27
|
+
let exec;
|
|
28
|
+
let reconcileExec;
|
|
29
|
+
const reconcileTimeout = options.reconcileCallTimeoutMs ?? RECONCILE_CALL_TIMEOUT_MS;
|
|
30
|
+
if (options.platform === 'win32' && options.guest !== undefined) {
|
|
31
|
+
const transport = await options.guest();
|
|
32
|
+
if (transport === null)
|
|
33
|
+
return null;
|
|
34
|
+
dockerPath = GUEST_DOCKER_BINARY;
|
|
35
|
+
exec = guestDockerExec(transport);
|
|
36
|
+
const guest = exec;
|
|
37
|
+
reconcileExec = (args, call) => guest(args, { timeoutMs: call?.timeoutMs ?? reconcileTimeout });
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
if (options.platform !== 'linux')
|
|
41
|
+
return null;
|
|
42
|
+
const resolved = options.dockerPath === undefined ? await resolveDockerBinary() : options.dockerPath;
|
|
43
|
+
if (resolved === null)
|
|
44
|
+
return null;
|
|
45
|
+
dockerPath = resolved;
|
|
46
|
+
exec = createDockerExec({ dockerPath, dockerConfigDir: options.layout.managed.dockerConfigDir });
|
|
47
|
+
reconcileExec = createDockerExec({
|
|
48
|
+
dockerPath,
|
|
49
|
+
dockerConfigDir: options.layout.managed.dockerConfigDir,
|
|
50
|
+
timeoutMs: reconcileTimeout,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
const journal = await ExecutionJournal.open(options.layout);
|
|
54
|
+
const budget = new AbortController();
|
|
55
|
+
const timer = setTimeout(() => budget.abort(), options.reconcileBudgetMs ?? RECONCILE_BUDGET_MS);
|
|
56
|
+
timer.unref?.();
|
|
57
|
+
try {
|
|
58
|
+
const reconciled = await reconcileExecutions(journal, options.instanceId, reconcileExec, options.log, RECONCILE_STARTUP_STOP_TIMEOUT_SECONDS, budget.signal);
|
|
59
|
+
return {
|
|
60
|
+
exec,
|
|
61
|
+
journal,
|
|
62
|
+
dockerPath,
|
|
63
|
+
socketPath: options.dockerSocketPath ?? DOCKER_SOCKET_PATH,
|
|
64
|
+
reconciled,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
finally {
|
|
68
|
+
clearTimeout(timer);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
export function createManagedContainersHandle(options, wire = wireManagedContainers) {
|
|
72
|
+
let wired = null;
|
|
73
|
+
let inFlight = null;
|
|
74
|
+
return {
|
|
75
|
+
current: () => wired,
|
|
76
|
+
resolve: () => {
|
|
77
|
+
if (wired !== null)
|
|
78
|
+
return Promise.resolve(wired);
|
|
79
|
+
// Two callers at once share one attempt: two attempts would open the journal twice.
|
|
80
|
+
inFlight ??= wire(options)
|
|
81
|
+
.then((result) => {
|
|
82
|
+
wired = result;
|
|
83
|
+
return result;
|
|
84
|
+
})
|
|
85
|
+
.finally(() => {
|
|
86
|
+
inFlight = null;
|
|
87
|
+
});
|
|
88
|
+
return inFlight;
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=wiring.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wiring.js","sourceRoot":"","sources":["../../../src/runtime/container/wiring.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAGpD,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AA2BpE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAA;AAC/C,MAAM,CAAC,MAAM,sCAAsC,GAAG,CAAC,CAAA;AACvD;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAA;AAWzC;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB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jB,CAAC,CAAC,CAAA;YACJ,OAAO,QAAQ,CAAA;QACjB,CAAC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Docker executor's two host-side seams, pointed into Atomic Chat's WSL distribution (change
|
|
3
|
+
* `add-tensorrt-llm-windows`, task 2.6, design D3/D5): every docker argv `argv.ts` builds runs as the
|
|
4
|
+
* guest's root through `wsl.exe --exec` — the guest's own `/usr/bin/docker` on its system socket, no
|
|
5
|
+
* shell, no `docker` group — and every mount source is `realpath`-ed in the guest's filesystem, where
|
|
6
|
+
* Docker will actually bind it, rather than on Windows, where the path does not exist.
|
|
7
|
+
*/
|
|
8
|
+
import type { WslDistributionTransport } from '../wsl/index.js';
|
|
9
|
+
import type { DockerExec, Realpath } from './types.js';
|
|
10
|
+
/** The docker CLI the guest recipe installs. */
|
|
11
|
+
export declare const GUEST_DOCKER_BINARY = "/usr/bin/docker";
|
|
12
|
+
export declare function guestDockerExec(transport: WslDistributionTransport): DockerExec;
|
|
13
|
+
export declare function guestRealpath(transport: WslDistributionTransport): Realpath;
|