@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,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The live progress of a clip: how long the whole job has left (encoding, the remaining steps and
|
|
3
|
+
* the VAE decode), a fraction that never goes back, the decode's tiles, and whether the steps or the
|
|
4
|
+
* tiles slowed down sharply (the sign of swapping or a stalled engine). One per job, fed the
|
|
5
|
+
* tracker's snapshot and the decode's tile pass at every emit; it keeps the step and tile marks, the
|
|
6
|
+
* phase it saw last, the fraction it reported and the sticky slowdown flag. Pure over the times it
|
|
7
|
+
* is given. The rules are the `video-generation/progress` spec of the `add-video-generation-estimate`
|
|
8
|
+
* change, ADR 2026-09-29-report-the-tiled-decode-and-tile-it-by-memory for the decode, and ADR
|
|
9
|
+
* 2026-09-30-keep-the-video-eta-past-its-forecast for a job that outruns its forecast.
|
|
10
|
+
*/
|
|
11
|
+
import type { ImageJobProgress, VideoJobProgress } from '../contracts/index.js';
|
|
12
|
+
import type { DecodeTiles } from './tracker.js';
|
|
13
|
+
import type { VideoForecast } from './video-estimate.js';
|
|
14
|
+
/**
|
|
15
|
+
* The step-time ratio (measured against forecast) the decode forecast is scaled by stays in here. Steps
|
|
16
|
+
* faster than forecast never shrink the decode: its own error runs the other way (ADR
|
|
17
|
+
* 2026-09-30-keep-the-video-eta-past-its-forecast), and a history multiplier raised by slow decodes
|
|
18
|
+
* would otherwise be divided back out of it.
|
|
19
|
+
*/
|
|
20
|
+
export declare const STEP_RATIO_RANGE: readonly [number, number];
|
|
21
|
+
/** Past its forecast, a stretch of the job is forecast at this many times as long, again and again. */
|
|
22
|
+
export declare const OVERRUN_GROWTH = 2;
|
|
23
|
+
/** Slowdown: the running step (or decode tile) took this many medians of the completed ones… */
|
|
24
|
+
export declare const SLOWDOWN_MEDIANS = 3;
|
|
25
|
+
/** …and at least this long, so a slow first step (graph build, weights paged in) never trips it. */
|
|
26
|
+
export declare const SLOWDOWN_FLOOR_MS = 20000;
|
|
27
|
+
/** Slowdown: a step past this many times the forecast's top of the range. */
|
|
28
|
+
export declare const SLOWDOWN_FORECAST_FACTOR = 3;
|
|
29
|
+
/** The fraction stays below 1 until the job is over. */
|
|
30
|
+
export declare const MAX_FRACTION = 0.99;
|
|
31
|
+
export interface VideoEtaOptions {
|
|
32
|
+
/** When the runner started the job; `elapsedMs` counts from here. */
|
|
33
|
+
startedAt: number;
|
|
34
|
+
/** The parts of the job's estimate; absent when there is none. */
|
|
35
|
+
forecast?: VideoForecast;
|
|
36
|
+
/** Whether the job's estimate has a range of seconds (it has none when memory is exceeded). */
|
|
37
|
+
estimated: boolean;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Seconds left of a stretch forecast at `forecast` seconds that has run for `spent`: the forecast's
|
|
41
|
+
* rest, and once that is spent, the rest of the forecast grown by `OVERRUN_GROWTH` until it is ahead
|
|
42
|
+
* again, so the countdown starts over instead of going blank. Null without a forecast.
|
|
43
|
+
*/
|
|
44
|
+
export declare function leftOf(forecast: number, spent: number): number | null;
|
|
45
|
+
export declare class VideoEta {
|
|
46
|
+
private readonly options;
|
|
47
|
+
private marks;
|
|
48
|
+
/** The decode's tile pass: its start (`step: 0`) and each tile finished (`step` = tiles done). */
|
|
49
|
+
private tileMarks;
|
|
50
|
+
private tileTotal;
|
|
51
|
+
private phase;
|
|
52
|
+
private phaseAt;
|
|
53
|
+
private reported;
|
|
54
|
+
private slow;
|
|
55
|
+
constructor(options: VideoEtaOptions);
|
|
56
|
+
/** The wire progress for `snapshot` at `now` (ms), with the decode's tile pass when there is one. */
|
|
57
|
+
progress(snapshot: ImageJobProgress, now: number, decodeTiles?: DecodeTiles): VideoJobProgress;
|
|
58
|
+
/** Record a phase change and a new step; a step count that went back is a new attempt. */
|
|
59
|
+
private observe;
|
|
60
|
+
/**
|
|
61
|
+
* Record the decode's tile pass: its start the first time it is seen, then every tile finished. A
|
|
62
|
+
* new pass (sd.cpp retrying a failed decode, or a later attempt's decode) starts over, and no pass
|
|
63
|
+
* (another phase, a decode in one graph) forgets the last one.
|
|
64
|
+
*/
|
|
65
|
+
private observeTiles;
|
|
66
|
+
/**
|
|
67
|
+
* The rest of a tiled decode at the measured pace per tile: the running tile's remainder and the
|
|
68
|
+
* tiles after it; a tile running past the pace stretches the pace, as a step does. Zero once every
|
|
69
|
+
* tile is done (the clip is being assembled and encoded); undefined before a tile finished.
|
|
70
|
+
*/
|
|
71
|
+
private tileEta;
|
|
72
|
+
/** Seconds per step since the first mark; undefined before two marks. */
|
|
73
|
+
private measuredStep;
|
|
74
|
+
/** The measured step against the forecast one, for scaling the decode. */
|
|
75
|
+
private ratio;
|
|
76
|
+
private eta;
|
|
77
|
+
/**
|
|
78
|
+
* The rest of the running step, the steps after it at the measured pace, and the decode forecast
|
|
79
|
+
* scaled by how the steps compare with theirs. A step running past the pace stretches the pace
|
|
80
|
+
* instead of freezing the countdown.
|
|
81
|
+
*/
|
|
82
|
+
private samplingEta;
|
|
83
|
+
private fraction;
|
|
84
|
+
private slowNow;
|
|
85
|
+
/**
|
|
86
|
+
* A tile of the decode running past three medians of the finished ones (at least two) and past the
|
|
87
|
+
* floor. Tiles have no forecast of their own to hold them against.
|
|
88
|
+
*/
|
|
89
|
+
private tileStalled;
|
|
90
|
+
}
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The live progress of a clip: how long the whole job has left (encoding, the remaining steps and
|
|
3
|
+
* the VAE decode), a fraction that never goes back, the decode's tiles, and whether the steps or the
|
|
4
|
+
* tiles slowed down sharply (the sign of swapping or a stalled engine). One per job, fed the
|
|
5
|
+
* tracker's snapshot and the decode's tile pass at every emit; it keeps the step and tile marks, the
|
|
6
|
+
* phase it saw last, the fraction it reported and the sticky slowdown flag. Pure over the times it
|
|
7
|
+
* is given. The rules are the `video-generation/progress` spec of the `add-video-generation-estimate`
|
|
8
|
+
* change, ADR 2026-09-29-report-the-tiled-decode-and-tile-it-by-memory for the decode, and ADR
|
|
9
|
+
* 2026-09-30-keep-the-video-eta-past-its-forecast for a job that outruns its forecast.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* The step-time ratio (measured against forecast) the decode forecast is scaled by stays in here. Steps
|
|
13
|
+
* faster than forecast never shrink the decode: its own error runs the other way (ADR
|
|
14
|
+
* 2026-09-30-keep-the-video-eta-past-its-forecast), and a history multiplier raised by slow decodes
|
|
15
|
+
* would otherwise be divided back out of it.
|
|
16
|
+
*/
|
|
17
|
+
export const STEP_RATIO_RANGE = [1, 20];
|
|
18
|
+
/** Past its forecast, a stretch of the job is forecast at this many times as long, again and again. */
|
|
19
|
+
export const OVERRUN_GROWTH = 2;
|
|
20
|
+
/** Slowdown: the running step (or decode tile) took this many medians of the completed ones… */
|
|
21
|
+
export const SLOWDOWN_MEDIANS = 3;
|
|
22
|
+
/** …and at least this long, so a slow first step (graph build, weights paged in) never trips it. */
|
|
23
|
+
export const SLOWDOWN_FLOOR_MS = 20_000;
|
|
24
|
+
/** Slowdown: a step past this many times the forecast's top of the range. */
|
|
25
|
+
export const SLOWDOWN_FORECAST_FACTOR = 3;
|
|
26
|
+
/** The fraction stays below 1 until the job is over. */
|
|
27
|
+
export const MAX_FRACTION = 0.99;
|
|
28
|
+
const clamp = (value, [min, max]) => Math.min(Math.max(value, min), max);
|
|
29
|
+
function median(values) {
|
|
30
|
+
const sorted = [...values].sort((a, b) => a - b);
|
|
31
|
+
const mid = Math.floor(sorted.length / 2);
|
|
32
|
+
return sorted.length % 2 === 1
|
|
33
|
+
? sorted[mid]
|
|
34
|
+
: (sorted[mid - 1] + sorted[mid]) / 2;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Seconds left of a stretch forecast at `forecast` seconds that has run for `spent`: the forecast's
|
|
38
|
+
* rest, and once that is spent, the rest of the forecast grown by `OVERRUN_GROWTH` until it is ahead
|
|
39
|
+
* again, so the countdown starts over instead of going blank. Null without a forecast.
|
|
40
|
+
*/
|
|
41
|
+
export function leftOf(forecast, spent) {
|
|
42
|
+
if (!(forecast > 0))
|
|
43
|
+
return null;
|
|
44
|
+
let horizon = forecast;
|
|
45
|
+
while (horizon <= spent)
|
|
46
|
+
horizon *= OVERRUN_GROWTH;
|
|
47
|
+
return horizon - spent;
|
|
48
|
+
}
|
|
49
|
+
/** The duration (ms) of every unit completed after the first mark, one entry per unit. */
|
|
50
|
+
function completedAfter(marks) {
|
|
51
|
+
const out = [];
|
|
52
|
+
for (let i = 1; i < marks.length; i++) {
|
|
53
|
+
const prev = marks[i - 1];
|
|
54
|
+
const mark = marks[i];
|
|
55
|
+
const units = mark.step - prev.step;
|
|
56
|
+
for (let u = 0; u < units; u++)
|
|
57
|
+
out.push((mark.at - prev.at) / units);
|
|
58
|
+
}
|
|
59
|
+
return out;
|
|
60
|
+
}
|
|
61
|
+
export class VideoEta {
|
|
62
|
+
options;
|
|
63
|
+
marks = [];
|
|
64
|
+
/** The decode's tile pass: its start (`step: 0`) and each tile finished (`step` = tiles done). */
|
|
65
|
+
tileMarks = [];
|
|
66
|
+
tileTotal;
|
|
67
|
+
phase;
|
|
68
|
+
phaseAt = 0;
|
|
69
|
+
reported = 0;
|
|
70
|
+
slow = false;
|
|
71
|
+
constructor(options) {
|
|
72
|
+
this.options = options;
|
|
73
|
+
}
|
|
74
|
+
/** The wire progress for `snapshot` at `now` (ms), with the decode's tile pass when there is one. */
|
|
75
|
+
progress(snapshot, now, decodeTiles) {
|
|
76
|
+
this.observe(snapshot, now);
|
|
77
|
+
this.observeTiles(decodeTiles, now);
|
|
78
|
+
const elapsedMs = Math.max(now - this.options.startedAt, 0);
|
|
79
|
+
const etaSeconds = this.eta(snapshot, now, elapsedMs);
|
|
80
|
+
this.slow ||= this.slowNow(snapshot, now);
|
|
81
|
+
return {
|
|
82
|
+
phase: snapshot.phase,
|
|
83
|
+
step: snapshot.step,
|
|
84
|
+
totalSteps: snapshot.totalSteps,
|
|
85
|
+
fraction: this.fraction(snapshot, elapsedMs, etaSeconds),
|
|
86
|
+
etaSeconds,
|
|
87
|
+
elapsedMs,
|
|
88
|
+
...(decodeTiles ? { decodeTiles: { done: decodeTiles.done, total: decodeTiles.total } } : {}),
|
|
89
|
+
slowdown: this.slow,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
/** Record a phase change and a new step; a step count that went back is a new attempt. */
|
|
93
|
+
observe(snapshot, now) {
|
|
94
|
+
if (snapshot.phase !== this.phase) {
|
|
95
|
+
this.phase = snapshot.phase;
|
|
96
|
+
this.phaseAt = now;
|
|
97
|
+
}
|
|
98
|
+
const last = this.marks[this.marks.length - 1];
|
|
99
|
+
if (last !== undefined && snapshot.step < last.step)
|
|
100
|
+
this.marks = [];
|
|
101
|
+
const latest = this.marks[this.marks.length - 1];
|
|
102
|
+
if (snapshot.step > 0 && (latest === undefined || snapshot.step > latest.step))
|
|
103
|
+
this.marks.push({ step: snapshot.step, at: now });
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Record the decode's tile pass: its start the first time it is seen, then every tile finished. A
|
|
107
|
+
* new pass (sd.cpp retrying a failed decode, or a later attempt's decode) starts over, and no pass
|
|
108
|
+
* (another phase, a decode in one graph) forgets the last one.
|
|
109
|
+
*/
|
|
110
|
+
observeTiles(tiles, now) {
|
|
111
|
+
if (!tiles) {
|
|
112
|
+
this.tileMarks = [];
|
|
113
|
+
this.tileTotal = undefined;
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
const last = this.tileMarks[this.tileMarks.length - 1];
|
|
117
|
+
if (last === undefined || tiles.total !== this.tileTotal || tiles.done < last.step) {
|
|
118
|
+
this.tileTotal = tiles.total;
|
|
119
|
+
this.tileMarks = [{ step: 0, at: now }];
|
|
120
|
+
}
|
|
121
|
+
const latest = this.tileMarks[this.tileMarks.length - 1];
|
|
122
|
+
if (tiles.done > latest.step)
|
|
123
|
+
this.tileMarks.push({ step: tiles.done, at: now });
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* The rest of a tiled decode at the measured pace per tile: the running tile's remainder and the
|
|
127
|
+
* tiles after it; a tile running past the pace stretches the pace, as a step does. Zero once every
|
|
128
|
+
* tile is done (the clip is being assembled and encoded); undefined before a tile finished.
|
|
129
|
+
*/
|
|
130
|
+
tileEta(now) {
|
|
131
|
+
const first = this.tileMarks[0];
|
|
132
|
+
const last = this.tileMarks[this.tileMarks.length - 1];
|
|
133
|
+
const total = this.tileTotal;
|
|
134
|
+
if (first === undefined || last === undefined || total === undefined)
|
|
135
|
+
return undefined;
|
|
136
|
+
if (last.step <= first.step || last.at <= first.at)
|
|
137
|
+
return undefined;
|
|
138
|
+
if (last.step >= total)
|
|
139
|
+
return 0;
|
|
140
|
+
const pace = (last.at - first.at) / 1000 / (last.step - first.step);
|
|
141
|
+
const inTile = (now - last.at) / 1000;
|
|
142
|
+
const after = Math.max(total - last.step - 1, 0);
|
|
143
|
+
if (inTile <= pace)
|
|
144
|
+
return pace - inTile + after * pace;
|
|
145
|
+
return after * ((now - first.at) / 1000 / (last.step - first.step + 1));
|
|
146
|
+
}
|
|
147
|
+
/** Seconds per step since the first mark; undefined before two marks. */
|
|
148
|
+
measuredStep() {
|
|
149
|
+
const first = this.marks[0];
|
|
150
|
+
const last = this.marks[this.marks.length - 1];
|
|
151
|
+
if (first === undefined || last === undefined || last.step <= first.step)
|
|
152
|
+
return undefined;
|
|
153
|
+
return (last.at - first.at) / 1000 / (last.step - first.step);
|
|
154
|
+
}
|
|
155
|
+
/** The measured step against the forecast one, for scaling the decode. */
|
|
156
|
+
ratio(measured) {
|
|
157
|
+
const forecast = this.options.forecast;
|
|
158
|
+
if (measured === undefined || forecast === undefined || forecast.stepSeconds <= 0)
|
|
159
|
+
return 1;
|
|
160
|
+
return clamp(measured / forecast.stepSeconds, STEP_RATIO_RANGE);
|
|
161
|
+
}
|
|
162
|
+
eta(snapshot, now, elapsedMs) {
|
|
163
|
+
const { forecast, estimated } = this.options;
|
|
164
|
+
const measured = this.measuredStep();
|
|
165
|
+
switch (snapshot.phase) {
|
|
166
|
+
case 'saving':
|
|
167
|
+
return null;
|
|
168
|
+
case 'decoding':
|
|
169
|
+
case 'postprocessing': {
|
|
170
|
+
const tiles = this.tileEta(now);
|
|
171
|
+
if (tiles !== undefined)
|
|
172
|
+
return tiles > 0 ? tiles : null;
|
|
173
|
+
if (!forecast)
|
|
174
|
+
return null;
|
|
175
|
+
return leftOf(forecast.decodeSeconds * this.ratio(measured), (now - this.phaseAt) / 1000);
|
|
176
|
+
}
|
|
177
|
+
case 'sampling':
|
|
178
|
+
if (measured !== undefined)
|
|
179
|
+
return this.samplingEta(snapshot, now, measured);
|
|
180
|
+
break;
|
|
181
|
+
case 'queued':
|
|
182
|
+
case 'encoding':
|
|
183
|
+
break;
|
|
184
|
+
}
|
|
185
|
+
// Before the first measured step: the estimate's middle, less the time already spent.
|
|
186
|
+
if (!forecast || !estimated)
|
|
187
|
+
return null;
|
|
188
|
+
return leftOf(forecast.totalSeconds, elapsedMs / 1000);
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* The rest of the running step, the steps after it at the measured pace, and the decode forecast
|
|
192
|
+
* scaled by how the steps compare with theirs. A step running past the pace stretches the pace
|
|
193
|
+
* instead of freezing the countdown.
|
|
194
|
+
*/
|
|
195
|
+
samplingEta(snapshot, now, measured) {
|
|
196
|
+
const first = this.marks[0];
|
|
197
|
+
const last = this.marks[this.marks.length - 1];
|
|
198
|
+
const inStep = (now - last.at) / 1000;
|
|
199
|
+
const after = Math.max(snapshot.totalSteps - last.step - 1, 0);
|
|
200
|
+
let sampling;
|
|
201
|
+
if (inStep <= measured)
|
|
202
|
+
sampling = measured - inStep + after * measured;
|
|
203
|
+
else
|
|
204
|
+
sampling = after * ((now - first.at) / 1000 / (last.step - first.step + 1));
|
|
205
|
+
const decode = this.options.forecast ? this.options.forecast.decodeSeconds * this.ratio(measured) : 0;
|
|
206
|
+
return sampling + decode;
|
|
207
|
+
}
|
|
208
|
+
fraction(snapshot, elapsedMs, etaSeconds) {
|
|
209
|
+
const elapsed = elapsedMs / 1000;
|
|
210
|
+
const byTime = etaSeconds !== null && elapsed + etaSeconds > 0 ? elapsed / (elapsed + etaSeconds) : undefined;
|
|
211
|
+
const next = Math.min(Math.max(this.reported, byTime ?? snapshot.fraction), MAX_FRACTION);
|
|
212
|
+
this.reported = next;
|
|
213
|
+
return next;
|
|
214
|
+
}
|
|
215
|
+
slowNow(snapshot, now) {
|
|
216
|
+
if (this.tileStalled(snapshot, now))
|
|
217
|
+
return true;
|
|
218
|
+
const completed = completedAfter(this.marks);
|
|
219
|
+
const last = this.marks[this.marks.length - 1];
|
|
220
|
+
const running = snapshot.phase === 'sampling' && last !== undefined && last.step < snapshot.totalSteps
|
|
221
|
+
? now - last.at
|
|
222
|
+
: 0;
|
|
223
|
+
if (completed.length >= 2 &&
|
|
224
|
+
running > SLOWDOWN_MEDIANS * median(completed) &&
|
|
225
|
+
running > SLOWDOWN_FLOOR_MS)
|
|
226
|
+
return true;
|
|
227
|
+
const forecast = this.options.forecast;
|
|
228
|
+
if (!forecast)
|
|
229
|
+
return false;
|
|
230
|
+
const slowest = Math.max(running, ...completed);
|
|
231
|
+
return slowest > SLOWDOWN_FORECAST_FACTOR * forecast.stepSecondsHigh * 1000;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* A tile of the decode running past three medians of the finished ones (at least two) and past the
|
|
235
|
+
* floor. Tiles have no forecast of their own to hold them against.
|
|
236
|
+
*/
|
|
237
|
+
tileStalled(snapshot, now) {
|
|
238
|
+
const last = this.tileMarks[this.tileMarks.length - 1];
|
|
239
|
+
if (snapshot.phase !== 'decoding' || last === undefined || this.tileTotal === undefined)
|
|
240
|
+
return false;
|
|
241
|
+
if (last.step >= this.tileTotal)
|
|
242
|
+
return false;
|
|
243
|
+
const completed = completedAfter(this.tileMarks);
|
|
244
|
+
const running = now - last.at;
|
|
245
|
+
return (completed.length >= 2 && running > SLOWDOWN_MEDIANS * median(completed) && running > SLOWDOWN_FLOOR_MS);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
//# sourceMappingURL=video-eta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"video-eta.js","sourceRoot":"","sources":["../../src/diffusion/video-eta.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAA8B,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;AAClE,uGAAuG;AACvG,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAA;AAC/B,gGAAgG;AAChG,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAA;AACjC,oGAAoG;AACpG,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAA;AACvC,6EAA6E;AAC7E,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAA;AACzC,wDAAwD;AACxD,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAA;AAgBhC,MAAM,KAAK,GAAG,CAA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AM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,SAAS,CAAC,CAAA;QAC/C,OAAO,OAAO,GAAG,wBAAwB,GAAG,QAAQ,CAAC,eAAe,GAAG,IAAI,CAAA;IAC7E,CAAC;IAED;;;OAGG;IACK,WAAW,CAAC,QAA0B,EAAE,GAAW;QACzD,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;QACtD,IAAI,QAAQ,CAAC,KAAK,KAAK,UAAU,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS;YAAE,OAAO,KAAK,CAAA;QACrG,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,SAAS;YAAE,OAAO,KAAK,CAAA;QAC7C,MAAM,SAAS,GAAG,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;QAChD,MAAM,OAAO,GAAG,GAAG,GAAG,IAAI,CAAC,EAAE,CAAA;QAC7B,OAAO,CACL,SAAS,CAAC,MAAM,IAAI,CAAC,IAAI,OAAO,GAAG,gBAAgB,GAAG,MAAM,CAAC,SAAS,CAAC,IAAI,OAAO,GAAG,iBAAiB,CACvG,CAAA;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This machine's own clips as a correction to the heuristic: how many times longer (or shorter) the
|
|
3
|
+
* last few clips of the same family, backend and offload took than the heuristic said. The
|
|
4
|
+
* multiplier scales the model, not seconds, so it carries over to another size or length.
|
|
5
|
+
* Selection and the multiplier are pure; `VideoHistory` caches the gallery's recipes between
|
|
6
|
+
* estimates.
|
|
7
|
+
*/
|
|
8
|
+
import type { VideoRecipe } from '../contracts/index.js';
|
|
9
|
+
import type { VideoEstimateInput, VideoHistoryMultiplier } from './video-estimate.js';
|
|
10
|
+
/** At most this many clips, the newest first. */
|
|
11
|
+
export declare const HISTORY_LIMIT = 5;
|
|
12
|
+
/** The multiplier never moves the heuristic further than this either way. */
|
|
13
|
+
export declare const HISTORY_MULTIPLIER_RANGE: readonly [number, number];
|
|
14
|
+
/**
|
|
15
|
+
* The request's inputs with a recipe's own size, length, steps and guidance, and the decode tiling
|
|
16
|
+
* this machine plans for that clip (the recipe does not record one; a clip made before the plan
|
|
17
|
+
* existed ran on the pixel-frame threshold instead).
|
|
18
|
+
*/
|
|
19
|
+
export declare function recipeInput(input: VideoEstimateInput, recipe: VideoRecipe): VideoEstimateInput;
|
|
20
|
+
/**
|
|
21
|
+
* The clips that speak for this request: the same family, backend and offload, not finished on the
|
|
22
|
+
* CPU fallback, and not a run whose own parameters exceed memory (a clip that swapped says nothing
|
|
23
|
+
* about the machine's speed). Newest first, at most `HISTORY_LIMIT`.
|
|
24
|
+
*/
|
|
25
|
+
export declare function historyRecipes(recipes: readonly VideoRecipe[], input: VideoEstimateInput): VideoRecipe[];
|
|
26
|
+
/**
|
|
27
|
+
* The median of `actual / heuristic` over the clips that speak for this request, for the sampling
|
|
28
|
+
* and for the decode apart, each within `HISTORY_MULTIPLIER_RANGE`; undefined when there are none.
|
|
29
|
+
* A clip that recorded its `decodeMs` calibrates the two separately: a single-graph decode on Metal
|
|
30
|
+
* can be most of a short clip's time and miss the table by far more than the steps do, so one ratio
|
|
31
|
+
* for both under-forecasts a few-step clip. An older clip has only its total, which stands for both.
|
|
32
|
+
*/
|
|
33
|
+
export declare function historyMultiplier(recipes: readonly VideoRecipe[], input: VideoEstimateInput): VideoHistoryMultiplier | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* The recipes of the video gallery, read once per folder and kept until a clip is added or removed.
|
|
36
|
+
* A failed read is not cached: the next estimate tries again.
|
|
37
|
+
*/
|
|
38
|
+
export declare class VideoHistory {
|
|
39
|
+
private readonly read;
|
|
40
|
+
private cached;
|
|
41
|
+
constructor(read: (dir: string) => Promise<VideoRecipe[]>);
|
|
42
|
+
recipes(dir: string): Promise<VideoRecipe[]>;
|
|
43
|
+
/** A clip was saved or deleted: the next estimate reads the gallery again. */
|
|
44
|
+
invalidate(): void;
|
|
45
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This machine's own clips as a correction to the heuristic: how many times longer (or shorter) the
|
|
3
|
+
* last few clips of the same family, backend and offload took than the heuristic said. The
|
|
4
|
+
* multiplier scales the model, not seconds, so it carries over to another size or length.
|
|
5
|
+
* Selection and the multiplier are pure; `VideoHistory` caches the gallery's recipes between
|
|
6
|
+
* estimates.
|
|
7
|
+
*/
|
|
8
|
+
import { estimateVideoMemory, heuristicParts, planDecodeTiling } from './video-estimate.js';
|
|
9
|
+
/** At most this many clips, the newest first. */
|
|
10
|
+
export const HISTORY_LIMIT = 5;
|
|
11
|
+
/** The multiplier never moves the heuristic further than this either way. */
|
|
12
|
+
export const HISTORY_MULTIPLIER_RANGE = [0.1, 10];
|
|
13
|
+
/**
|
|
14
|
+
* The request's inputs with a recipe's own size, length, steps and guidance, and the decode tiling
|
|
15
|
+
* this machine plans for that clip (the recipe does not record one; a clip made before the plan
|
|
16
|
+
* existed ran on the pixel-frame threshold instead).
|
|
17
|
+
*/
|
|
18
|
+
export function recipeInput(input, recipe) {
|
|
19
|
+
const { decodeTiling: _request, ...rest } = input;
|
|
20
|
+
const base = {
|
|
21
|
+
...rest,
|
|
22
|
+
width: recipe.width,
|
|
23
|
+
height: recipe.height,
|
|
24
|
+
frames: recipe.frames,
|
|
25
|
+
steps: recipe.steps,
|
|
26
|
+
cfgScale: recipe.cfgScale,
|
|
27
|
+
};
|
|
28
|
+
if (!input.decodeTiling)
|
|
29
|
+
return base;
|
|
30
|
+
const decodeTiling = planDecodeTiling(base);
|
|
31
|
+
return decodeTiling ? { ...base, decodeTiling } : base;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The clips that speak for this request: the same family, backend and offload, not finished on the
|
|
35
|
+
* CPU fallback, and not a run whose own parameters exceed memory (a clip that swapped says nothing
|
|
36
|
+
* about the machine's speed). Newest first, at most `HISTORY_LIMIT`.
|
|
37
|
+
*/
|
|
38
|
+
export function historyRecipes(recipes, input) {
|
|
39
|
+
return recipes
|
|
40
|
+
.filter((recipe) => recipe.model.family === input.family &&
|
|
41
|
+
recipe.engine.backend === input.backend &&
|
|
42
|
+
recipe.engine.offload === input.offload &&
|
|
43
|
+
!recipe.engine.cpuFallback &&
|
|
44
|
+
recipe.durationMs > 0 &&
|
|
45
|
+
estimateVideoMemory(recipeInput(input, recipe))?.verdict !== 'exceeds')
|
|
46
|
+
.sort((a, b) => b.createdAtMs - a.createdAtMs)
|
|
47
|
+
.slice(0, HISTORY_LIMIT);
|
|
48
|
+
}
|
|
49
|
+
function median(values) {
|
|
50
|
+
const sorted = [...values].sort((a, b) => a - b);
|
|
51
|
+
const mid = Math.floor(sorted.length / 2);
|
|
52
|
+
return sorted.length % 2 === 1
|
|
53
|
+
? sorted[mid]
|
|
54
|
+
: (sorted[mid - 1] + sorted[mid]) / 2;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The median of `actual / heuristic` over the clips that speak for this request, for the sampling
|
|
58
|
+
* and for the decode apart, each within `HISTORY_MULTIPLIER_RANGE`; undefined when there are none.
|
|
59
|
+
* A clip that recorded its `decodeMs` calibrates the two separately: a single-graph decode on Metal
|
|
60
|
+
* can be most of a short clip's time and miss the table by far more than the steps do, so one ratio
|
|
61
|
+
* for both under-forecasts a few-step clip. An older clip has only its total, which stands for both.
|
|
62
|
+
*/
|
|
63
|
+
export function historyMultiplier(recipes, input) {
|
|
64
|
+
const sampling = [];
|
|
65
|
+
const decode = [];
|
|
66
|
+
for (const recipe of historyRecipes(recipes, input)) {
|
|
67
|
+
const clip = recipeInput(input, recipe);
|
|
68
|
+
const parts = heuristicParts(clip);
|
|
69
|
+
const samplingSeconds = parts.encodeSeconds + Math.max(clip.steps, 1) * parts.stepSeconds;
|
|
70
|
+
const seconds = recipe.durationMs / 1000;
|
|
71
|
+
if (recipe.decodeMs !== undefined && samplingSeconds > 0 && parts.decodeSeconds > 0) {
|
|
72
|
+
const decodeSeconds = recipe.decodeMs / 1000;
|
|
73
|
+
sampling.push((seconds - decodeSeconds) / samplingSeconds);
|
|
74
|
+
decode.push(decodeSeconds / parts.decodeSeconds);
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
const predicted = samplingSeconds + parts.decodeSeconds;
|
|
78
|
+
if (predicted > 0) {
|
|
79
|
+
sampling.push(seconds / predicted);
|
|
80
|
+
decode.push(seconds / predicted);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
const [min, max] = HISTORY_MULTIPLIER_RANGE;
|
|
84
|
+
const calibrated = (ratios) => {
|
|
85
|
+
const finite = ratios.filter(Number.isFinite);
|
|
86
|
+
return finite.length === 0 ? undefined : Math.min(Math.max(median(finite), min), max);
|
|
87
|
+
};
|
|
88
|
+
const samplingK = calibrated(sampling);
|
|
89
|
+
const decodeK = calibrated(decode);
|
|
90
|
+
return samplingK === undefined || decodeK === undefined
|
|
91
|
+
? undefined
|
|
92
|
+
: { sampling: samplingK, decode: decodeK };
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* The recipes of the video gallery, read once per folder and kept until a clip is added or removed.
|
|
96
|
+
* A failed read is not cached: the next estimate tries again.
|
|
97
|
+
*/
|
|
98
|
+
export class VideoHistory {
|
|
99
|
+
read;
|
|
100
|
+
cached;
|
|
101
|
+
constructor(read) {
|
|
102
|
+
this.read = read;
|
|
103
|
+
}
|
|
104
|
+
recipes(dir) {
|
|
105
|
+
if (this.cached?.dir === dir)
|
|
106
|
+
return this.cached.recipes;
|
|
107
|
+
const recipes = this.read(dir);
|
|
108
|
+
const entry = { dir, recipes };
|
|
109
|
+
this.cached = entry;
|
|
110
|
+
recipes.catch(() => {
|
|
111
|
+
if (this.cached === entry)
|
|
112
|
+
this.cached = undefined;
|
|
113
|
+
});
|
|
114
|
+
return recipes;
|
|
115
|
+
}
|
|
116
|
+
/** A clip was saved or deleted: the next estimate reads the gallery again. */
|
|
117
|
+
invalidate() {
|
|
118
|
+
this.cached = undefined;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=video-history.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"video-history.js","sourceRoot":"","sources":["../../src/diffusion/video-history.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAG3F,iDAAiD;AACjD,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAA;AAC9B,6EAA6E;AAC7E,MAAM,CAAC,MAAM,wBAAwB,GAA8B,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;AAE5E;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,KAAyB,EAAE,MAAmB;IACxE,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAA;IACjD,MAAM,IAAI,GAAuB;QAC/B,GAAG,IAAI;QACP,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,QAAQ,EAAE,MAAM,CAAC,QAAQ;KAC1B,CAAA;IACD,IAAI,CAAC,KAAK,CAAC,YAAY;QAAE,OAAO,IAAI,CAAA;IACpC,MAAM,YAAY,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAA;IAC3C,OAAO,YAAY,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;AACxD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,OAA+B,EAAE,KAAyB;IACvF,OAAO,OAAO;SACX,MAAM,CACL,CAAC,MAAM,E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5
5
|
*/
|
|
6
|
-
import type { GalleryVideoItem,
|
|
7
|
-
import type { JobKind, SaveContext } from './job-kind.js';
|
|
6
|
+
import type { GalleryVideoItem, VideoGenerateRequest, VideoJob, VideoJobProgress } from '../contracts/index.js';
|
|
7
|
+
import type { JobKind, JobPlan, ProgressModel, SaveContext } from './job-kind.js';
|
|
8
8
|
import type { JobDeps } from './jobs.js';
|
|
9
|
-
import type {
|
|
9
|
+
import type { JobRecord } from './state.js';
|
|
10
|
+
import type { ResolvedInputs, ServerCapabilities, ServerSpec } from './types.js';
|
|
11
|
+
/** A clip's progress goes out at least once a second while it generates, whether or not a step landed. */
|
|
12
|
+
export declare const VIDEO_PROGRESS_HEARTBEAT_MS = 1000;
|
|
10
13
|
/** What a completed `vid_gen` job carries once decoded. */
|
|
11
14
|
export interface DecodedVideo {
|
|
12
15
|
bytes: Buffer;
|
|
@@ -26,8 +29,13 @@ export declare function saveVideoOutput(deps: JobDeps, ctx: SaveContext<VideoGen
|
|
|
26
29
|
items: GalleryVideoItem[];
|
|
27
30
|
bytes: Buffer[];
|
|
28
31
|
}>;
|
|
29
|
-
/** The
|
|
30
|
-
export declare function
|
|
32
|
+
/** The estimate and its forecast for a job about to start; a failure only costs the job its estimate. */
|
|
33
|
+
export declare function prepareVideoJob(deps: Pick<JobDeps, 'planVideo' | 'log'>, request: VideoGenerateRequest, spec: ServerSpec): Promise<JobPlan | undefined>;
|
|
34
|
+
/**
|
|
35
|
+
* The wire progress of a clip: the tracker's snapshot without the batch fields, with the ETA,
|
|
36
|
+
* fraction and slowdown of `VideoEta` over the whole job and the decode's tiles.
|
|
37
|
+
*/
|
|
38
|
+
export declare function videoProgressModel(record: JobRecord, startedAt: number): ProgressModel<VideoJobProgress>;
|
|
31
39
|
/** A build without libwebm cannot write the one container the app plays; say so before submitting. */
|
|
32
40
|
export declare function checkWebmSupport(capabilities: ServerCapabilities | undefined): void;
|
|
33
41
|
export declare const VIDEO_JOB_KIND: JobKind<VideoGenerateRequest, VideoJob, GalleryVideoItem, VideoJobProgress, DecodedVideo>;
|