@wenathlan/saddle 1.8.18 → 2.0.3
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/Dockerfile +1346 -0
- package/README.md +33 -12
- package/alternatives.ts +1218 -0
- package/biome.json +153 -0
- package/boards.json +1517 -0
- package/compute.ts +3144 -0
- package/cores.json +1801 -0
- package/dist/acquisition.d.ts +359 -0
- package/dist/acquisition.d.ts.map +1 -0
- package/dist/acquisition.js +629 -0
- package/dist/acquisition.js.map +1 -0
- package/dist/alternatives.d.ts +509 -0
- package/dist/alternatives.d.ts.map +1 -0
- package/dist/alternatives.js +951 -0
- package/dist/alternatives.js.map +1 -0
- package/dist/automation.d.ts +426 -0
- package/dist/automation.d.ts.map +1 -0
- package/dist/automation.js +561 -0
- package/dist/automation.js.map +1 -0
- package/dist/browser.d.ts +562 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +1057 -0
- package/dist/browser.js.map +1 -0
- package/dist/capacitor.config.d.ts +13 -0
- package/dist/capacitor.config.d.ts.map +1 -0
- package/dist/capacitor.config.js +26 -0
- package/dist/capacitor.config.js.map +1 -0
- package/dist/cli.d.ts +17 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +111 -0
- package/dist/cli.js.map +1 -0
- package/dist/communication.d.ts +192 -0
- package/dist/communication.d.ts.map +1 -0
- package/dist/communication.js +418 -0
- package/dist/communication.js.map +1 -0
- package/dist/compute.d.ts +1161 -0
- package/dist/compute.d.ts.map +1 -0
- package/dist/compute.js +2273 -0
- package/dist/compute.js.map +1 -0
- package/dist/distribution.d.ts +529 -0
- package/dist/distribution.d.ts.map +1 -0
- package/dist/distribution.js +811 -0
- package/dist/distribution.js.map +1 -0
- package/dist/execution.d.ts +530 -0
- package/dist/execution.d.ts.map +1 -0
- package/dist/execution.js +761 -0
- package/dist/execution.js.map +1 -0
- package/dist/format.d.ts +19 -0
- package/dist/format.d.ts.map +1 -0
- package/dist/format.js +60 -0
- package/dist/format.js.map +1 -0
- package/dist/foundation.d.ts +176 -0
- package/dist/foundation.d.ts.map +1 -0
- package/dist/foundation.js +309 -0
- package/dist/foundation.js.map +1 -0
- package/dist/index.d.ts +733 -123
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1018 -123
- package/dist/index.js.map +1 -1
- package/dist/integration.d.ts +236 -0
- package/dist/integration.d.ts.map +1 -0
- package/dist/integration.js +236 -0
- package/dist/integration.js.map +1 -0
- package/dist/intelligence.d.ts +94 -0
- package/dist/intelligence.d.ts.map +1 -0
- package/dist/intelligence.js +145 -0
- package/dist/intelligence.js.map +1 -0
- package/dist/{isolation/contracts.d.ts → isolation.d.ts} +12 -1
- package/dist/isolation.d.ts.map +1 -0
- package/dist/{isolation/contracts.js → isolation.js} +13 -1
- package/dist/isolation.js.map +1 -0
- package/dist/media.d.ts +344 -0
- package/dist/media.d.ts.map +1 -0
- package/dist/media.js +986 -0
- package/dist/media.js.map +1 -0
- package/dist/modes.d.ts +359 -0
- package/dist/modes.d.ts.map +1 -0
- package/dist/modes.js +134 -0
- package/dist/modes.js.map +1 -0
- package/dist/{library/public.d.ts → operations.d.ts} +15 -1
- package/dist/operations.d.ts.map +1 -0
- package/dist/{library/public.js → operations.js} +18 -7
- package/dist/operations.js.map +1 -0
- package/dist/orchestrator.d.ts +1339 -0
- package/dist/orchestrator.d.ts.map +1 -0
- package/dist/orchestrator.js +4308 -0
- package/dist/orchestrator.js.map +1 -0
- package/dist/packager/targetcli.js +4 -22
- package/dist/performance.d.ts +416 -0
- package/dist/performance.d.ts.map +1 -0
- package/dist/performance.js +827 -0
- package/dist/performance.js.map +1 -0
- package/dist/quantum.d.ts +810 -0
- package/dist/quantum.d.ts.map +1 -0
- package/dist/quantum.js +2073 -0
- package/dist/quantum.js.map +1 -0
- package/dist/render.d.ts +381 -0
- package/dist/render.d.ts.map +1 -0
- package/dist/render.js +1073 -0
- package/dist/render.js.map +1 -0
- package/dist/scheduler.d.ts +596 -0
- package/dist/scheduler.d.ts.map +1 -0
- package/dist/scheduler.js +1259 -0
- package/dist/scheduler.js.map +1 -0
- package/dist/security.d.ts +501 -0
- package/dist/security.d.ts.map +1 -0
- package/dist/security.js +1170 -0
- package/dist/security.js.map +1 -0
- package/dist/server.d.ts +21 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/{server/node.js → server.js} +16 -2
- package/dist/server.js.map +1 -0
- package/dist/tiers.d.ts +1002 -0
- package/dist/tiers.d.ts.map +1 -0
- package/dist/tiers.js +2165 -0
- package/dist/tiers.js.map +1 -0
- package/dist/virtual.d.ts +641 -0
- package/dist/virtual.d.ts.map +1 -0
- package/dist/virtual.js +1285 -0
- package/dist/virtual.js.map +1 -0
- package/dist/virtualcpu.d.ts +316 -0
- package/dist/virtualcpu.d.ts.map +1 -0
- package/dist/virtualcpu.js +1180 -0
- package/dist/virtualcpu.js.map +1 -0
- package/dist/virtualgpu.d.ts +345 -0
- package/dist/virtualgpu.d.ts.map +1 -0
- package/dist/virtualgpu.js +1000 -0
- package/dist/virtualgpu.js.map +1 -0
- package/dist/virtualization.d.ts +607 -0
- package/dist/virtualization.d.ts.map +1 -0
- package/dist/virtualization.js +1187 -0
- package/dist/virtualization.js.map +1 -0
- package/dist/virtualmemory.d.ts +818 -0
- package/dist/virtualmemory.d.ts.map +1 -0
- package/dist/virtualmemory.js +1796 -0
- package/dist/virtualmemory.js.map +1 -0
- package/dist/webscrape.d.ts +720 -0
- package/dist/webscrape.d.ts.map +1 -0
- package/dist/webscrape.js +2697 -0
- package/dist/webscrape.js.map +1 -0
- package/docker.config +769 -0
- package/docs/CONVERSA.txt +1523 -0
- package/docs/alternatives.md +499 -0
- package/docs/architecture-1.8.19.md +76 -0
- package/docs/architecture-1.8.19.mmd +33 -0
- package/docs/architecture-1.8.19.png +0 -0
- package/docs/architecture.md +355 -0
- package/docs/brancharchive-2026-08-18.md +18 -0
- package/docs/browser.md +7 -0
- package/docs/consolidation.md +70 -0
- package/docs/e2ugh-engine.md +528 -0
- package/{dist/examples/localjob.js → docs/example-localjob.ts} +3 -3
- package/{dist/examples/publicapi.js → docs/example-publicapi.ts} +2 -2
- package/docs/hardware.md +342 -0
- package/docs/optimization.md +126 -0
- package/docs/performance.md +499 -0
- package/docs/planning.1.8.18.md +94 -0
- package/docs/planning.1.8.19.md +49 -0
- package/docs/releasenotes-1.8.19.md +35 -0
- package/docs/research-1.8.19-virtual-browser.md +27 -0
- package/docs/security.md +454 -0
- package/docs/todo-1.8.18.md +12 -0
- package/docs/todo-1.8.19.md +241 -0
- package/docs/viability.md +777 -0
- package/docs/virtualization.md +335 -0
- package/docs/web-duplicatecleanup.md +9 -0
- package/docs/web-ideas.md +106 -0
- package/docs/workflowimprovements-2026-08-19.md +70 -0
- package/gpumonitor.cpp +1543 -0
- package/gpus.json +2408 -0
- package/index.ts +1478 -0
- package/media.ts +1337 -0
- package/mttg.config +1549 -0
- package/orchestrator.ts +5462 -0
- package/package.json +304 -56
- package/passage.config +1331 -0
- package/performance.ts +1049 -0
- package/processors.json +2217 -0
- package/qemu.config +1062 -0
- package/qemubridge.py +1340 -0
- package/quantum.ts +2393 -0
- package/render.ts +1325 -0
- package/scheduler.ts +1600 -0
- package/security.ts +1449 -0
- package/tiers.ts +2871 -0
- package/tsconfig.json +29 -0
- package/virtualcpu.ts +1273 -0
- package/virtualgpu.ts +1181 -0
- package/virtualhardware.c +1011 -0
- package/virtualhardware.json +739 -0
- package/virtualization.ts +1628 -0
- package/virtualizationcore.cpp +4635 -0
- package/virtualmemory.ts +2303 -0
- package/vm.config.json +1910 -0
- package/{extension → web/extension}/manifest.json +1 -1
- package/web/readme.md +382 -0
- package/web/tsconfig.json +25 -0
- package/dist/adapters/forge.d.ts +0 -17
- package/dist/adapters/forge.d.ts.map +0 -1
- package/dist/adapters/forge.js +0 -19
- package/dist/adapters/forge.js.map +0 -1
- package/dist/adapters/forgejo.d.ts +0 -49
- package/dist/adapters/forgejo.d.ts.map +0 -1
- package/dist/adapters/forgejo.js +0 -8
- package/dist/adapters/forgejo.js.map +0 -1
- package/dist/adapters/github.d.ts +0 -12
- package/dist/adapters/github.d.ts.map +0 -1
- package/dist/adapters/github.js +0 -20
- package/dist/adapters/github.js.map +0 -1
- package/dist/adapters/gitlab.d.ts +0 -17
- package/dist/adapters/gitlab.d.ts.map +0 -1
- package/dist/adapters/gitlab.js +0 -10
- package/dist/adapters/gitlab.js.map +0 -1
- package/dist/adapters/huggingface.d.ts +0 -17
- package/dist/adapters/huggingface.d.ts.map +0 -1
- package/dist/adapters/huggingface.js +0 -6
- package/dist/adapters/huggingface.js.map +0 -1
- package/dist/adapters/socket.d.ts +0 -11
- package/dist/adapters/socket.d.ts.map +0 -1
- package/dist/adapters/socket.js +0 -17
- package/dist/adapters/socket.js.map +0 -1
- package/dist/adapters/transport.d.ts +0 -7
- package/dist/adapters/transport.d.ts.map +0 -1
- package/dist/adapters/transport.js +0 -36
- package/dist/adapters/transport.js.map +0 -1
- package/dist/ai/chunk.d.ts +0 -2
- package/dist/ai/chunk.d.ts.map +0 -1
- package/dist/ai/chunk.js +0 -36
- package/dist/ai/chunk.js.map +0 -1
- package/dist/ai/llmstxt.d.ts +0 -6
- package/dist/ai/llmstxt.d.ts.map +0 -1
- package/dist/ai/llmstxt.js +0 -12
- package/dist/ai/llmstxt.js.map +0 -1
- package/dist/ai/provenance.d.ts +0 -22
- package/dist/ai/provenance.d.ts.map +0 -1
- package/dist/ai/provenance.js +0 -25
- package/dist/ai/provenance.js.map +0 -1
- package/dist/ai/rag.d.ts +0 -26
- package/dist/ai/rag.d.ts.map +0 -1
- package/dist/ai/rag.js +0 -22
- package/dist/ai/rag.js.map +0 -1
- package/dist/ai/tokens.d.ts +0 -15
- package/dist/ai/tokens.d.ts.map +0 -1
- package/dist/ai/tokens.js +0 -9
- package/dist/ai/tokens.js.map +0 -1
- package/dist/api/auth.d.ts +0 -16
- package/dist/api/auth.d.ts.map +0 -1
- package/dist/api/auth.js +0 -19
- package/dist/api/auth.js.map +0 -1
- package/dist/api/contracts.d.ts +0 -28
- package/dist/api/contracts.d.ts.map +0 -1
- package/dist/api/contracts.js +0 -14
- package/dist/api/contracts.js.map +0 -1
- package/dist/api/control.d.ts +0 -10
- package/dist/api/control.d.ts.map +0 -1
- package/dist/api/control.js +0 -35
- package/dist/api/control.js.map +0 -1
- package/dist/api/http.d.ts +0 -7
- package/dist/api/http.d.ts.map +0 -1
- package/dist/api/http.js +0 -12
- package/dist/api/http.js.map +0 -1
- package/dist/api/rate.d.ts +0 -28
- package/dist/api/rate.d.ts.map +0 -1
- package/dist/api/rate.js +0 -36
- package/dist/api/rate.js.map +0 -1
- package/dist/api/security.d.ts +0 -12
- package/dist/api/security.d.ts.map +0 -1
- package/dist/api/security.js +0 -56
- package/dist/api/security.js.map +0 -1
- package/dist/api/service.d.ts +0 -5
- package/dist/api/service.d.ts.map +0 -1
- package/dist/api/service.js +0 -70
- package/dist/api/service.js.map +0 -1
- package/dist/apps/registry.d.ts +0 -33
- package/dist/apps/registry.d.ts.map +0 -1
- package/dist/apps/registry.js +0 -24
- package/dist/apps/registry.js.map +0 -1
- package/dist/binary/archive.d.ts +0 -27
- package/dist/binary/archive.d.ts.map +0 -1
- package/dist/binary/archive.js +0 -46
- package/dist/binary/archive.js.map +0 -1
- package/dist/binary/build.d.ts +0 -29
- package/dist/binary/build.d.ts.map +0 -1
- package/dist/binary/build.js +0 -17
- package/dist/binary/build.js.map +0 -1
- package/dist/binary/transform.d.ts +0 -70
- package/dist/binary/transform.d.ts.map +0 -1
- package/dist/binary/transform.js +0 -105
- package/dist/binary/transform.js.map +0 -1
- package/dist/bot/adapter.d.ts +0 -5
- package/dist/bot/adapter.d.ts.map +0 -1
- package/dist/bot/adapter.js +0 -11
- package/dist/bot/adapter.js.map +0 -1
- package/dist/bot/bot.d.ts +0 -28
- package/dist/bot/bot.d.ts.map +0 -1
- package/dist/bot/bot.js +0 -52
- package/dist/bot/bot.js.map +0 -1
- package/dist/bot/commands.d.ts +0 -8
- package/dist/bot/commands.d.ts.map +0 -1
- package/dist/bot/commands.js +0 -19
- package/dist/bot/commands.js.map +0 -1
- package/dist/bot/permissions.d.ts +0 -13
- package/dist/bot/permissions.d.ts.map +0 -1
- package/dist/bot/permissions.js +0 -16
- package/dist/bot/permissions.js.map +0 -1
- package/dist/browser/actions.d.ts +0 -33
- package/dist/browser/actions.d.ts.map +0 -1
- package/dist/browser/actions.js +0 -44
- package/dist/browser/actions.js.map +0 -1
- package/dist/browser/agent.d.ts +0 -21
- package/dist/browser/agent.d.ts.map +0 -1
- package/dist/browser/agent.js +0 -13
- package/dist/browser/agent.js.map +0 -1
- package/dist/browser/context.d.ts +0 -43
- package/dist/browser/context.d.ts.map +0 -1
- package/dist/browser/context.js +0 -54
- package/dist/browser/context.js.map +0 -1
- package/dist/browser/fingerprint.d.ts +0 -4
- package/dist/browser/fingerprint.d.ts.map +0 -1
- package/dist/browser/fingerprint.js +0 -12
- package/dist/browser/fingerprint.js.map +0 -1
- package/dist/browser/index.d.ts +0 -11
- package/dist/browser/index.d.ts.map +0 -1
- package/dist/browser/index.js +0 -11
- package/dist/browser/index.js.map +0 -1
- package/dist/browser/playwright.d.ts +0 -11
- package/dist/browser/playwright.d.ts.map +0 -1
- package/dist/browser/playwright.js +0 -24
- package/dist/browser/playwright.js.map +0 -1
- package/dist/browser/recorder.d.ts +0 -21
- package/dist/browser/recorder.d.ts.map +0 -1
- package/dist/browser/recorder.js +0 -58
- package/dist/browser/recorder.js.map +0 -1
- package/dist/browser/session.d.ts +0 -14
- package/dist/browser/session.d.ts.map +0 -1
- package/dist/browser/session.js +0 -21
- package/dist/browser/session.js.map +0 -1
- package/dist/browser/snapshot.d.ts +0 -69
- package/dist/browser/snapshot.d.ts.map +0 -1
- package/dist/browser/snapshot.js +0 -133
- package/dist/browser/snapshot.js.map +0 -1
- package/dist/captcha/contract.d.ts +0 -35
- package/dist/captcha/contract.d.ts.map +0 -1
- package/dist/captcha/contract.js +0 -17
- package/dist/captcha/contract.js.map +0 -1
- package/dist/captcha/evidence.d.ts +0 -10
- package/dist/captcha/evidence.d.ts.map +0 -1
- package/dist/captcha/evidence.js +0 -9
- package/dist/captcha/evidence.js.map +0 -1
- package/dist/captcha/guard.d.ts +0 -23
- package/dist/captcha/guard.d.ts.map +0 -1
- package/dist/captcha/guard.js +0 -12
- package/dist/captcha/guard.js.map +0 -1
- package/dist/cli/main.d.ts +0 -4
- package/dist/cli/main.d.ts.map +0 -1
- package/dist/cli/main.js +0 -46
- package/dist/cli/main.js.map +0 -1
- package/dist/core/errors.d.ts +0 -84
- package/dist/core/errors.d.ts.map +0 -1
- package/dist/core/errors.js +0 -54
- package/dist/core/errors.js.map +0 -1
- package/dist/core/events.d.ts +0 -9
- package/dist/core/events.d.ts.map +0 -1
- package/dist/core/events.js +0 -21
- package/dist/core/events.js.map +0 -1
- package/dist/core/hash.d.ts +0 -10
- package/dist/core/hash.d.ts.map +0 -1
- package/dist/core/hash.js +0 -82
- package/dist/core/hash.js.map +0 -1
- package/dist/core/ids.d.ts +0 -10
- package/dist/core/ids.d.ts.map +0 -1
- package/dist/core/ids.js +0 -15
- package/dist/core/ids.js.map +0 -1
- package/dist/delivery/manifest.d.ts +0 -35
- package/dist/delivery/manifest.d.ts.map +0 -1
- package/dist/delivery/manifest.js +0 -68
- package/dist/delivery/manifest.js.map +0 -1
- package/dist/deploy/index.d.ts +0 -6
- package/dist/deploy/index.d.ts.map +0 -1
- package/dist/deploy/index.js +0 -6
- package/dist/deploy/index.js.map +0 -1
- package/dist/dispatch/resumable.d.ts +0 -102
- package/dist/dispatch/resumable.d.ts.map +0 -1
- package/dist/dispatch/resumable.js +0 -64
- package/dist/dispatch/resumable.js.map +0 -1
- package/dist/dispatch/workflow.d.ts +0 -6
- package/dist/dispatch/workflow.d.ts.map +0 -1
- package/dist/dispatch/workflow.js +0 -37
- package/dist/dispatch/workflow.js.map +0 -1
- package/dist/domain/artifacts.d.ts +0 -12
- package/dist/domain/artifacts.d.ts.map +0 -1
- package/dist/domain/artifacts.js +0 -14
- package/dist/domain/artifacts.js.map +0 -1
- package/dist/domain/jobs.d.ts +0 -12
- package/dist/domain/jobs.d.ts.map +0 -1
- package/dist/domain/jobs.js +0 -20
- package/dist/domain/jobs.js.map +0 -1
- package/dist/domain/providers.d.ts +0 -10
- package/dist/domain/providers.d.ts.map +0 -1
- package/dist/domain/providers.js +0 -8
- package/dist/domain/providers.js.map +0 -1
- package/dist/domain/runtime.d.ts +0 -14
- package/dist/domain/runtime.d.ts.map +0 -1
- package/dist/domain/runtime.js +0 -10
- package/dist/domain/runtime.js.map +0 -1
- package/dist/domain/sessions.d.ts +0 -12
- package/dist/domain/sessions.d.ts.map +0 -1
- package/dist/domain/sessions.js +0 -57
- package/dist/domain/sessions.js.map +0 -1
- package/dist/examples/localjob.d.ts +0 -2
- package/dist/examples/localjob.d.ts.map +0 -1
- package/dist/examples/localjob.js.map +0 -1
- package/dist/examples/publicapi.d.ts +0 -2
- package/dist/examples/publicapi.d.ts.map +0 -1
- package/dist/examples/publicapi.js.map +0 -1
- package/dist/extension/build.d.ts +0 -9
- package/dist/extension/build.d.ts.map +0 -1
- package/dist/extension/build.js +0 -85
- package/dist/extension/build.js.map +0 -1
- package/dist/extension/content.d.ts +0 -6
- package/dist/extension/content.d.ts.map +0 -1
- package/dist/extension/content.js +0 -135
- package/dist/extension/content.js.map +0 -1
- package/dist/extension/index.d.ts +0 -7
- package/dist/extension/index.d.ts.map +0 -1
- package/dist/extension/index.js +0 -7
- package/dist/extension/index.js.map +0 -1
- package/dist/extension/pagebridge.d.ts +0 -6
- package/dist/extension/pagebridge.d.ts.map +0 -1
- package/dist/extension/pagebridge.js +0 -42
- package/dist/extension/pagebridge.js.map +0 -1
- package/dist/extension/permissions.d.ts +0 -26
- package/dist/extension/permissions.d.ts.map +0 -1
- package/dist/extension/permissions.js +0 -28
- package/dist/extension/permissions.js.map +0 -1
- package/dist/extension/popup.d.ts +0 -5
- package/dist/extension/popup.d.ts.map +0 -1
- package/dist/extension/popup.js +0 -26
- package/dist/extension/popup.js.map +0 -1
- package/dist/extension/protocol.d.ts +0 -58
- package/dist/extension/protocol.d.ts.map +0 -1
- package/dist/extension/protocol.js +0 -101
- package/dist/extension/protocol.js.map +0 -1
- package/dist/extension/serviceworker.d.ts +0 -25
- package/dist/extension/serviceworker.d.ts.map +0 -1
- package/dist/extension/serviceworker.js +0 -102
- package/dist/extension/serviceworker.js.map +0 -1
- package/dist/extension/worker.d.ts +0 -28
- package/dist/extension/worker.d.ts.map +0 -1
- package/dist/extension/worker.js +0 -22
- package/dist/extension/worker.js.map +0 -1
- package/dist/format/check.d.ts +0 -8
- package/dist/format/check.d.ts.map +0 -1
- package/dist/format/check.js +0 -38
- package/dist/format/check.js.map +0 -1
- package/dist/isolation/contracts.d.ts.map +0 -1
- package/dist/isolation/contracts.js.map +0 -1
- package/dist/library/public.d.ts.map +0 -1
- package/dist/library/public.js.map +0 -1
- package/dist/mcp/browser.d.ts +0 -9
- package/dist/mcp/browser.d.ts.map +0 -1
- package/dist/mcp/browser.js +0 -13
- package/dist/mcp/browser.js.map +0 -1
- package/dist/mcp/server.d.ts +0 -35
- package/dist/mcp/server.d.ts.map +0 -1
- package/dist/mcp/server.js +0 -40
- package/dist/mcp/server.js.map +0 -1
- package/dist/mcp/transport.d.ts +0 -7
- package/dist/mcp/transport.d.ts.map +0 -1
- package/dist/mcp/transport.js +0 -17
- package/dist/mcp/transport.js.map +0 -1
- package/dist/memory/bridge.d.ts +0 -14
- package/dist/memory/bridge.d.ts.map +0 -1
- package/dist/memory/bridge.js +0 -16
- package/dist/memory/bridge.js.map +0 -1
- package/dist/memory/engine.d.ts +0 -38
- package/dist/memory/engine.d.ts.map +0 -1
- package/dist/memory/engine.js +0 -109
- package/dist/memory/engine.js.map +0 -1
- package/dist/memory/modes.d.ts +0 -43
- package/dist/memory/modes.d.ts.map +0 -1
- package/dist/memory/modes.js +0 -66
- package/dist/memory/modes.js.map +0 -1
- package/dist/memory/objects.d.ts +0 -21
- package/dist/memory/objects.d.ts.map +0 -1
- package/dist/memory/objects.js +0 -20
- package/dist/memory/objects.js.map +0 -1
- package/dist/memory/planner.d.ts +0 -66
- package/dist/memory/planner.d.ts.map +0 -1
- package/dist/memory/planner.js +0 -108
- package/dist/memory/planner.js.map +0 -1
- package/dist/memory/targets.d.ts +0 -78
- package/dist/memory/targets.d.ts.map +0 -1
- package/dist/memory/targets.js +0 -29
- package/dist/memory/targets.js.map +0 -1
- package/dist/memory/transforms.d.ts +0 -19
- package/dist/memory/transforms.d.ts.map +0 -1
- package/dist/memory/transforms.js +0 -14
- package/dist/memory/transforms.js.map +0 -1
- package/dist/modes/matrix.d.ts +0 -23
- package/dist/modes/matrix.d.ts.map +0 -1
- package/dist/modes/matrix.js +0 -18
- package/dist/modes/matrix.js.map +0 -1
- package/dist/modes/modes.d.ts +0 -33
- package/dist/modes/modes.d.ts.map +0 -1
- package/dist/modes/modes.js +0 -15
- package/dist/modes/modes.js.map +0 -1
- package/dist/modes/resolve.d.ts +0 -96
- package/dist/modes/resolve.d.ts.map +0 -1
- package/dist/modes/resolve.js +0 -48
- package/dist/modes/resolve.js.map +0 -1
- package/dist/observability/metrics.d.ts +0 -14
- package/dist/observability/metrics.d.ts.map +0 -1
- package/dist/observability/metrics.js +0 -18
- package/dist/observability/metrics.js.map +0 -1
- package/dist/packager/manifest.d.ts +0 -66
- package/dist/packager/manifest.d.ts.map +0 -1
- package/dist/packager/manifest.js +0 -94
- package/dist/packager/manifest.js.map +0 -1
- package/dist/packager/publish.d.ts +0 -51
- package/dist/packager/publish.d.ts.map +0 -1
- package/dist/packager/publish.js +0 -18
- package/dist/packager/publish.js.map +0 -1
- package/dist/packager/targetcli.d.ts +0 -7
- package/dist/packager/targetcli.d.ts.map +0 -1
- package/dist/packager/targetcli.js.map +0 -1
- package/dist/persistence/adapter.d.ts +0 -5
- package/dist/persistence/adapter.d.ts.map +0 -1
- package/dist/persistence/adapter.js +0 -11
- package/dist/persistence/adapter.js.map +0 -1
- package/dist/persistence/drizzle.d.ts +0 -2
- package/dist/persistence/drizzle.d.ts.map +0 -1
- package/dist/persistence/drizzle.js +0 -12
- package/dist/persistence/drizzle.js.map +0 -1
- package/dist/persistence/memory.d.ts +0 -2
- package/dist/persistence/memory.d.ts.map +0 -1
- package/dist/persistence/memory.js +0 -27
- package/dist/persistence/memory.js.map +0 -1
- package/dist/persistence/migrations.d.ts +0 -19
- package/dist/persistence/migrations.d.ts.map +0 -1
- package/dist/persistence/migrations.js +0 -13
- package/dist/persistence/migrations.js.map +0 -1
- package/dist/persistence/prisma.d.ts +0 -2
- package/dist/persistence/prisma.d.ts.map +0 -1
- package/dist/persistence/prisma.js +0 -25
- package/dist/persistence/prisma.js.map +0 -1
- package/dist/persistence/schema.d.ts +0 -63
- package/dist/persistence/schema.d.ts.map +0 -1
- package/dist/persistence/schema.js +0 -28
- package/dist/persistence/schema.js.map +0 -1
- package/dist/persistence/sql.d.ts +0 -3
- package/dist/persistence/sql.d.ts.map +0 -1
- package/dist/persistence/sql.js +0 -37
- package/dist/persistence/sql.js.map +0 -1
- package/dist/protocol/blocks.d.ts +0 -10
- package/dist/protocol/blocks.d.ts.map +0 -1
- package/dist/protocol/blocks.js +0 -26
- package/dist/protocol/blocks.js.map +0 -1
- package/dist/protocol/json.d.ts +0 -6
- package/dist/protocol/json.d.ts.map +0 -1
- package/dist/protocol/json.js +0 -6
- package/dist/protocol/json.js.map +0 -1
- package/dist/protocol/ndjson.d.ts +0 -3
- package/dist/protocol/ndjson.d.ts.map +0 -1
- package/dist/protocol/ndjson.js +0 -20
- package/dist/protocol/ndjson.js.map +0 -1
- package/dist/protocol/sse.d.ts +0 -7
- package/dist/protocol/sse.d.ts.map +0 -1
- package/dist/protocol/sse.js +0 -25
- package/dist/protocol/sse.js.map +0 -1
- package/dist/proxy/pool.d.ts +0 -9
- package/dist/proxy/pool.d.ts.map +0 -1
- package/dist/proxy/pool.js +0 -27
- package/dist/proxy/pool.js.map +0 -1
- package/dist/queue/idempotency.d.ts +0 -10
- package/dist/queue/idempotency.d.ts.map +0 -1
- package/dist/queue/idempotency.js +0 -13
- package/dist/queue/idempotency.js.map +0 -1
- package/dist/queue/persistent.d.ts +0 -14
- package/dist/queue/persistent.d.ts.map +0 -1
- package/dist/queue/persistent.js +0 -66
- package/dist/queue/persistent.js.map +0 -1
- package/dist/queue/queue.d.ts +0 -7
- package/dist/queue/queue.d.ts.map +0 -1
- package/dist/queue/queue.js +0 -55
- package/dist/queue/queue.js.map +0 -1
- package/dist/queue/saga.d.ts +0 -5
- package/dist/queue/saga.d.ts.map +0 -1
- package/dist/queue/saga.js +0 -20
- package/dist/queue/saga.js.map +0 -1
- package/dist/release/assets.d.ts +0 -144
- package/dist/release/assets.d.ts.map +0 -1
- package/dist/release/assets.js +0 -157
- package/dist/release/assets.js.map +0 -1
- package/dist/release/evidence.d.ts +0 -92
- package/dist/release/evidence.d.ts.map +0 -1
- package/dist/release/evidence.js +0 -148
- package/dist/release/evidence.js.map +0 -1
- package/dist/release/verify.d.ts +0 -12
- package/dist/release/verify.d.ts.map +0 -1
- package/dist/release/verify.js +0 -112
- package/dist/release/verify.js.map +0 -1
- package/dist/runners/chain.d.ts +0 -125
- package/dist/runners/chain.d.ts.map +0 -1
- package/dist/runners/chain.js +0 -95
- package/dist/runners/chain.js.map +0 -1
- package/dist/runners/health.d.ts +0 -36
- package/dist/runners/health.d.ts.map +0 -1
- package/dist/runners/health.js +0 -26
- package/dist/runners/health.js.map +0 -1
- package/dist/runners/heartbeat.d.ts +0 -23
- package/dist/runners/heartbeat.d.ts.map +0 -1
- package/dist/runners/heartbeat.js +0 -29
- package/dist/runners/heartbeat.js.map +0 -1
- package/dist/runners/inprocess.d.ts +0 -17
- package/dist/runners/inprocess.d.ts.map +0 -1
- package/dist/runners/inprocess.js +0 -20
- package/dist/runners/inprocess.js.map +0 -1
- package/dist/runners/scheduler.d.ts +0 -5
- package/dist/runners/scheduler.d.ts.map +0 -1
- package/dist/runners/scheduler.js +0 -19
- package/dist/runners/scheduler.js.map +0 -1
- package/dist/runtime/abort.d.ts +0 -8
- package/dist/runtime/abort.d.ts.map +0 -1
- package/dist/runtime/abort.js +0 -13
- package/dist/runtime/abort.js.map +0 -1
- package/dist/runtime/compatibility.d.ts +0 -37
- package/dist/runtime/compatibility.d.ts.map +0 -1
- package/dist/runtime/compatibility.js +0 -10
- package/dist/runtime/compatibility.js.map +0 -1
- package/dist/runtime/detect.d.ts +0 -13
- package/dist/runtime/detect.d.ts.map +0 -1
- package/dist/runtime/detect.js +0 -18
- package/dist/runtime/detect.js.map +0 -1
- package/dist/runtime/engine.d.ts +0 -20
- package/dist/runtime/engine.d.ts.map +0 -1
- package/dist/runtime/engine.js +0 -61
- package/dist/runtime/engine.js.map +0 -1
- package/dist/runtime/retry.d.ts +0 -19
- package/dist/runtime/retry.d.ts.map +0 -1
- package/dist/runtime/retry.js +0 -54
- package/dist/runtime/retry.js.map +0 -1
- package/dist/runtime/worker.d.ts +0 -10
- package/dist/runtime/worker.d.ts.map +0 -1
- package/dist/runtime/worker.js +0 -25
- package/dist/runtime/worker.js.map +0 -1
- package/dist/scrape/cache.d.ts +0 -45
- package/dist/scrape/cache.d.ts.map +0 -1
- package/dist/scrape/cache.js +0 -45
- package/dist/scrape/cache.js.map +0 -1
- package/dist/scrape/crawl.d.ts +0 -47
- package/dist/scrape/crawl.d.ts.map +0 -1
- package/dist/scrape/crawl.js +0 -114
- package/dist/scrape/crawl.js.map +0 -1
- package/dist/scrape/extract.d.ts +0 -63
- package/dist/scrape/extract.d.ts.map +0 -1
- package/dist/scrape/extract.js +0 -47
- package/dist/scrape/extract.js.map +0 -1
- package/dist/scrape/normalize.d.ts +0 -52
- package/dist/scrape/normalize.d.ts.map +0 -1
- package/dist/scrape/normalize.js +0 -102
- package/dist/scrape/normalize.js.map +0 -1
- package/dist/scrape/robots.d.ts +0 -37
- package/dist/scrape/robots.d.ts.map +0 -1
- package/dist/scrape/robots.js +0 -71
- package/dist/scrape/robots.js.map +0 -1
- package/dist/scrape/schema.d.ts +0 -23
- package/dist/scrape/schema.d.ts.map +0 -1
- package/dist/scrape/schema.js +0 -92
- package/dist/scrape/schema.js.map +0 -1
- package/dist/scrape/scraper.d.ts +0 -6
- package/dist/scrape/scraper.d.ts.map +0 -1
- package/dist/scrape/scraper.js +0 -46
- package/dist/scrape/scraper.js.map +0 -1
- package/dist/scrape/semantic.d.ts +0 -25
- package/dist/scrape/semantic.d.ts.map +0 -1
- package/dist/scrape/semantic.js +0 -27
- package/dist/scrape/semantic.js.map +0 -1
- package/dist/server/node.d.ts +0 -7
- package/dist/server/node.d.ts.map +0 -1
- package/dist/server/node.js.map +0 -1
- package/dist/sessions/file.d.ts +0 -25
- package/dist/sessions/file.d.ts.map +0 -1
- package/dist/sessions/file.js +0 -13
- package/dist/sessions/file.js.map +0 -1
- package/dist/sessions/replay.d.ts +0 -9
- package/dist/sessions/replay.d.ts.map +0 -1
- package/dist/sessions/replay.js +0 -70
- package/dist/sessions/replay.js.map +0 -1
- package/dist/sessions/store.d.ts +0 -25
- package/dist/sessions/store.d.ts.map +0 -1
- package/dist/sessions/store.js +0 -13
- package/dist/sessions/store.js.map +0 -1
- package/dist/storage/adapter.d.ts +0 -5
- package/dist/storage/adapter.d.ts.map +0 -1
- package/dist/storage/adapter.js +0 -11
- package/dist/storage/adapter.js.map +0 -1
- package/dist/storage/cache.d.ts +0 -23
- package/dist/storage/cache.d.ts.map +0 -1
- package/dist/storage/cache.js +0 -79
- package/dist/storage/cache.js.map +0 -1
- package/dist/storage/checksum.d.ts +0 -3
- package/dist/storage/checksum.d.ts.map +0 -1
- package/dist/storage/checksum.js +0 -19
- package/dist/storage/checksum.js.map +0 -1
- package/dist/storage/chunked.d.ts +0 -21
- package/dist/storage/chunked.d.ts.map +0 -1
- package/dist/storage/chunked.js +0 -67
- package/dist/storage/chunked.js.map +0 -1
- package/dist/storage/content.d.ts +0 -24
- package/dist/storage/content.d.ts.map +0 -1
- package/dist/storage/content.js +0 -44
- package/dist/storage/content.js.map +0 -1
- package/dist/storage/filehosting.d.ts +0 -2
- package/dist/storage/filehosting.d.ts.map +0 -1
- package/dist/storage/filehosting.js +0 -24
- package/dist/storage/filehosting.js.map +0 -1
- package/dist/storage/githubcontents.d.ts +0 -2
- package/dist/storage/githubcontents.d.ts.map +0 -1
- package/dist/storage/githubcontents.js +0 -29
- package/dist/storage/githubcontents.js.map +0 -1
- package/dist/storage/index.d.ts +0 -12
- package/dist/storage/index.d.ts.map +0 -1
- package/dist/storage/index.js +0 -12
- package/dist/storage/index.js.map +0 -1
- package/dist/storage/local.d.ts +0 -2
- package/dist/storage/local.d.ts.map +0 -1
- package/dist/storage/local.js +0 -72
- package/dist/storage/local.js.map +0 -1
- package/dist/storage/memory.d.ts +0 -6
- package/dist/storage/memory.d.ts.map +0 -1
- package/dist/storage/memory.js +0 -36
- package/dist/storage/memory.js.map +0 -1
- package/dist/storage/pool.d.ts +0 -95
- package/dist/storage/pool.d.ts.map +0 -1
- package/dist/storage/pool.js +0 -202
- package/dist/storage/pool.js.map +0 -1
- package/dist/storage/s3compatible.d.ts +0 -3
- package/dist/storage/s3compatible.d.ts.map +0 -1
- package/dist/storage/s3compatible.js +0 -70
- package/dist/storage/s3compatible.js.map +0 -1
- package/dist/storage/sync.d.ts +0 -47
- package/dist/storage/sync.d.ts.map +0 -1
- package/dist/storage/sync.js +0 -75
- package/dist/storage/sync.js.map +0 -1
- package/dist/surfaces/adapters.d.ts +0 -97
- package/dist/surfaces/adapters.d.ts.map +0 -1
- package/dist/surfaces/adapters.js +0 -50
- package/dist/surfaces/adapters.js.map +0 -1
- package/dist/surfaces/controls.d.ts +0 -18
- package/dist/surfaces/controls.d.ts.map +0 -1
- package/dist/surfaces/controls.js +0 -45
- package/dist/surfaces/controls.js.map +0 -1
- package/dist/surfaces/manifest.d.ts +0 -68
- package/dist/surfaces/manifest.d.ts.map +0 -1
- package/dist/surfaces/manifest.js +0 -42
- package/dist/surfaces/manifest.js.map +0 -1
- package/dist/surfaces/n8n.d.ts +0 -25
- package/dist/surfaces/n8n.d.ts.map +0 -1
- package/dist/surfaces/n8n.js +0 -31
- package/dist/surfaces/n8n.js.map +0 -1
- package/dist/surfaces/operations.d.ts +0 -32
- package/dist/surfaces/operations.d.ts.map +0 -1
- package/dist/surfaces/operations.js +0 -53
- package/dist/surfaces/operations.js.map +0 -1
- package/dist/surfaces/requirements.d.ts +0 -29
- package/dist/surfaces/requirements.d.ts.map +0 -1
- package/dist/surfaces/requirements.js +0 -50
- package/dist/surfaces/requirements.js.map +0 -1
- package/dist/surfaces/targets.d.ts +0 -196
- package/dist/surfaces/targets.d.ts.map +0 -1
- package/dist/surfaces/targets.js +0 -27
- package/dist/surfaces/targets.js.map +0 -1
- package/dist/webhook/delivery.d.ts +0 -18
- package/dist/webhook/delivery.d.ts.map +0 -1
- package/dist/webhook/delivery.js +0 -36
- package/dist/webhook/delivery.js.map +0 -1
- package/dist/webhook/receiver.d.ts +0 -26
- package/dist/webhook/receiver.d.ts.map +0 -1
- package/dist/webhook/receiver.js +0 -24
- package/dist/webhook/receiver.js.map +0 -1
- package/dist/webhook/signature.d.ts +0 -3
- package/dist/webhook/signature.d.ts.map +0 -1
- package/dist/webhook/signature.js +0 -7
- package/dist/webhook/signature.js.map +0 -1
- package/dist/workflow/manifest.d.ts +0 -22
- package/dist/workflow/manifest.d.ts.map +0 -1
- package/dist/workflow/manifest.js +0 -21
- package/dist/workflow/manifest.js.map +0 -1
- package/dist/workflow/registry.d.ts +0 -7
- package/dist/workflow/registry.d.ts.map +0 -1
- package/dist/workflow/registry.js +0 -18
- package/dist/workflow/registry.js.map +0 -1
- package/dist/workflow/templates.d.ts +0 -6
- package/dist/workflow/templates.d.ts.map +0 -1
- package/dist/workflow/templates.js +0 -18
- package/dist/workflow/templates.js.map +0 -1
- package/dist/workflow/triggers.d.ts +0 -64
- package/dist/workflow/triggers.d.ts.map +0 -1
- package/dist/workflow/triggers.js +0 -99
- package/dist/workflow/triggers.js.map +0 -1
- /package/{extension/README.md → docs/extension.md} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,125 +1,1020 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
export
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
export
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
export
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
export
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
2
|
+
* index.ts — the stable public API of the saddle grand merge (v2.0.0).
|
|
3
|
+
*
|
|
4
|
+
* Section 1 carries the e2ugh virtual-hardware engine core (the library-first
|
|
5
|
+
* entry point of the merged e2ugh repository: the main factory
|
|
6
|
+
* createVirtualEngine, the dependency-free specification validator
|
|
7
|
+
* validateSpec, the random endpoint allocator randomPort, the Map-based
|
|
8
|
+
* internal memory store InternalMemory, the disposable metrics store
|
|
9
|
+
* MetricsStore, the strongly typed event bus enginebus, and the plan planner
|
|
10
|
+
* absorbed from the former architect.ts).
|
|
11
|
+
*
|
|
12
|
+
* Section 2 routes the saddle domain surface through the root-level domain
|
|
13
|
+
* files of the consolidation: one optimized TypeScript file per correlated
|
|
14
|
+
* domain, every former nested folder of both repositories folded at the
|
|
15
|
+
* repository root.
|
|
16
|
+
*/
|
|
17
|
+
/* ── Section 1: the e2ugh virtual-hardware engine core ── */
|
|
18
|
+
import { randomInt, randomUUID } from 'node:crypto';
|
|
19
|
+
import { EventEmitter } from 'node:events';
|
|
20
|
+
import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
21
|
+
import { join } from 'node:path';
|
|
22
|
+
/* ------------------------------------------------------------------ */
|
|
23
|
+
/* Section 1: reference versions */
|
|
24
|
+
/* ------------------------------------------------------------------ */
|
|
25
|
+
/**
|
|
26
|
+
* Frozen table of the reference toolchain versions that the engine targets.
|
|
27
|
+
* Every value was confirmed against primary sources on 2026-08-22 and is
|
|
28
|
+
* embedded here so generated documentation and workflows can cite exact
|
|
29
|
+
* versions without a network round trip. the v2 merge adds the microvm
|
|
30
|
+
* runtime anchors so every module (orchestrator, virtualization, security)
|
|
31
|
+
* cites the same ledger.
|
|
32
|
+
*/
|
|
33
|
+
export const engineversions = {
|
|
34
|
+
/** npm latest confirmed 2026-08-23 (v12 shipped july 2026). */
|
|
35
|
+
npm: '12.0.2',
|
|
36
|
+
/** python stable confirmed 2026-08-23. */
|
|
37
|
+
python: '3.14.7',
|
|
38
|
+
nodecurrent: '26.7.0',
|
|
39
|
+
nodelts: '24.19.0',
|
|
40
|
+
typescript: '7.0.2',
|
|
41
|
+
docker: '29.7.2',
|
|
42
|
+
compose: '5.5.0',
|
|
43
|
+
mesaa: '26.2.1',
|
|
44
|
+
qemu: '11.1.0',
|
|
45
|
+
firecracker: '1.16.1',
|
|
46
|
+
kata: '4.1.0',
|
|
47
|
+
gvisor: 'release-20260817.0',
|
|
48
|
+
cloudhypervisor: '53.0',
|
|
49
|
+
criu: '4.2.1',
|
|
50
|
+
/* v3-VERIFY corrections (worklog 2026-08-23): kernel "7.2.1" never
|
|
51
|
+
* existed (mainline 7.2, stable 7.1.9, longterm 6.18.45) and wgpu
|
|
52
|
+
* moved from 24.x to 30.x; wasmtime 48.0.0 LTS confirmed. */
|
|
53
|
+
kernelmainline: '7.2',
|
|
54
|
+
kernelstable: '7.1.9',
|
|
55
|
+
kernellongterm: '6.18.45',
|
|
56
|
+
wasmtime: '48.0.0',
|
|
57
|
+
wgpu: '30.x',
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Hard limits of the virtual hardware generation. Values mirror the extremes
|
|
61
|
+
* of the embedded processor bank: 1 to 192 vCPUs (EPYC 9965 class), 1 to
|
|
62
|
+
* 1024 GB of guest RAM, 8 to 96 GB of virtualized VRAM (RTX PRO 6000 class with
|
|
63
|
+
* MIG slicing) and the random port range 30000-59999.
|
|
64
|
+
*/
|
|
65
|
+
export const enginelimits = {
|
|
66
|
+
minvcpu: 1,
|
|
67
|
+
maxvcpu: 192,
|
|
68
|
+
minramgb: 1,
|
|
69
|
+
maxramgb: 1024,
|
|
70
|
+
minvramgb: 8,
|
|
71
|
+
maxvramgb: 96,
|
|
72
|
+
minport: 30000,
|
|
73
|
+
maxport: 59999,
|
|
74
|
+
};
|
|
75
|
+
/* ------------------------------------------------------------------ */
|
|
76
|
+
/* Section 3: random port allocation and host resolution */
|
|
77
|
+
/* ------------------------------------------------------------------ */
|
|
78
|
+
/**
|
|
79
|
+
* Returns a random TCP port in the 30000-59999 range using a
|
|
80
|
+
* cryptographically secure generator (node:crypto randomInt). The user may
|
|
81
|
+
* override the random draw by passing an explicit port, which is validated
|
|
82
|
+
* against the engine limits before being returned.
|
|
83
|
+
*
|
|
84
|
+
* @param override Explicit port chosen by the user; when omitted a random
|
|
85
|
+
* port is drawn, which keeps the library free of fixed addresses.
|
|
86
|
+
*/
|
|
87
|
+
export function randomPort(override) {
|
|
88
|
+
try {
|
|
89
|
+
if (typeof override === 'number') {
|
|
90
|
+
if (!Number.isInteger(override) ||
|
|
91
|
+
override < enginelimits.minport ||
|
|
92
|
+
override > enginelimits.maxport) {
|
|
93
|
+
throw new RangeError(`port must be an integer between ${enginelimits.minport} and ${enginelimits.maxport}`);
|
|
94
|
+
}
|
|
95
|
+
return override;
|
|
96
|
+
}
|
|
97
|
+
return 30000 + randomInt(30000);
|
|
98
|
+
}
|
|
99
|
+
catch (cause) {
|
|
100
|
+
throw new engineerror('randomPort failed', { cause: cause });
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Resolves the bind host from explicit preference or the environment
|
|
105
|
+
* variables `virtualenginehost` or `vhehost`. No default address such as
|
|
106
|
+
* localhost is ever assumed implicitly: when neither argument nor
|
|
107
|
+
* environment provides a host the function fails loudly, keeping the
|
|
108
|
+
* address 100 percent a user choice (an explicit loopback is honored
|
|
109
|
+
* because it is the explicit decision of the caller).
|
|
110
|
+
*
|
|
111
|
+
* @param preferred Host explicitly chosen by the caller; wins over env.
|
|
112
|
+
*/
|
|
113
|
+
export function resolveHost(preferred) {
|
|
114
|
+
try {
|
|
115
|
+
const fromenv = process.env.virtualenginehost ?? process.env.vhehost;
|
|
116
|
+
const chosen = preferred ?? fromenv;
|
|
117
|
+
if (typeof chosen !== 'string' || chosen.trim().length === 0) {
|
|
118
|
+
throw new engineerror('host is required: pass an explicit host or set virtualenginehost; the engine never assumes a default address');
|
|
119
|
+
}
|
|
120
|
+
return chosen.trim();
|
|
121
|
+
}
|
|
122
|
+
catch (cause) {
|
|
123
|
+
if (cause instanceof engineerror) {
|
|
124
|
+
throw cause;
|
|
125
|
+
}
|
|
126
|
+
throw new engineerror('resolveHost failed', { cause: cause });
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Combines a host and a port into an endpoint descriptor. The port falls
|
|
131
|
+
* back to randomPort when omitted so the endpoint is always concrete.
|
|
132
|
+
*/
|
|
133
|
+
export function buildEndpoint(host, port) {
|
|
134
|
+
try {
|
|
135
|
+
const resolvedhost = resolveHost(host);
|
|
136
|
+
const resolvedport = randomPort(port);
|
|
137
|
+
return {
|
|
138
|
+
host: resolvedhost,
|
|
139
|
+
port: resolvedport,
|
|
140
|
+
url: `http://${resolvedhost}:${resolvedport}`,
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
catch (cause) {
|
|
144
|
+
throw new engineerror('buildEndpoint failed', { cause: cause });
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Default rule table derived from enginelimits. It behaves like a small
|
|
149
|
+
* dependency-free schema: each entry describes bounds and shape for one
|
|
150
|
+
* field of enginespec and validateSpec walks the table collecting errors.
|
|
151
|
+
*/
|
|
152
|
+
export const specschema = [
|
|
153
|
+
{ key: 'model', kind: 'string', pattern: /\S+/, description: 'non-empty processor model name' },
|
|
154
|
+
{
|
|
155
|
+
key: 'vcpus',
|
|
156
|
+
kind: 'number',
|
|
157
|
+
min: enginelimits.minvcpu,
|
|
158
|
+
max: enginelimits.maxvcpu,
|
|
159
|
+
description: 'vCPU count between 1 and 192',
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
key: 'ramgb',
|
|
163
|
+
kind: 'number',
|
|
164
|
+
min: enginelimits.minramgb,
|
|
165
|
+
max: enginelimits.maxramgb,
|
|
166
|
+
description: 'guest RAM in GB between 1 and 1024',
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
key: 'vramgb',
|
|
170
|
+
kind: 'number',
|
|
171
|
+
min: enginelimits.minvramgb,
|
|
172
|
+
max: enginelimits.maxvramgb,
|
|
173
|
+
description: 'virtualized VRAM in GB between 8 and 96',
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
key: 'mig',
|
|
177
|
+
kind: 'enum',
|
|
178
|
+
values: ['1g.24gb', '2g.48gb', '4g.96gb', 'off'],
|
|
179
|
+
description: 'MIG slicing profile',
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
key: 'runtime',
|
|
183
|
+
kind: 'enum',
|
|
184
|
+
values: ['qemu', 'firecracker', 'docker', 'gvisor'],
|
|
185
|
+
description: 'execution backend',
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
key: 'host',
|
|
189
|
+
kind: 'string',
|
|
190
|
+
pattern: /\S+/,
|
|
191
|
+
description: 'user chosen bind host, never defaulted',
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
key: 'port',
|
|
195
|
+
kind: 'number',
|
|
196
|
+
min: enginelimits.minport,
|
|
197
|
+
max: enginelimits.maxport,
|
|
198
|
+
description: 'port between 30000 and 59999',
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
key: 'metricsintervalms',
|
|
202
|
+
kind: 'number',
|
|
203
|
+
min: 100,
|
|
204
|
+
max: 3600000,
|
|
205
|
+
description: 'sampling interval in milliseconds',
|
|
206
|
+
},
|
|
207
|
+
];
|
|
208
|
+
/**
|
|
209
|
+
* Validates a candidate specification against the rule table. The function
|
|
210
|
+
* is zod-like in spirit but has zero external dependencies: it type-checks
|
|
211
|
+
* each field, enforces numeric bounds, matches string patterns and rejects
|
|
212
|
+
* unknown enum values, then returns the errors, soft warnings and a frozen
|
|
213
|
+
* normalized copy when everything passes.
|
|
214
|
+
*
|
|
215
|
+
* @param spec Candidate specification; the const type parameter preserves
|
|
216
|
+
* literal inference for callers that pass object literals.
|
|
217
|
+
*/
|
|
218
|
+
export function validateSpec(spec) {
|
|
219
|
+
const errors = [];
|
|
220
|
+
const warnings = [];
|
|
221
|
+
try {
|
|
222
|
+
for (const rule of specschema) {
|
|
223
|
+
const value = spec[rule.key];
|
|
224
|
+
if (value === undefined) {
|
|
225
|
+
if (rule.optional !== true) {
|
|
226
|
+
errors.push(`${rule.key}: missing required field (${rule.description})`);
|
|
227
|
+
}
|
|
228
|
+
continue;
|
|
229
|
+
}
|
|
230
|
+
switch (rule.kind) {
|
|
231
|
+
case 'number': {
|
|
232
|
+
if (typeof value !== 'number' || !Number.isFinite(value)) {
|
|
233
|
+
errors.push(`${rule.key}: expected a finite number`);
|
|
234
|
+
break;
|
|
235
|
+
}
|
|
236
|
+
if (rule.min !== undefined && value < rule.min) {
|
|
237
|
+
errors.push(`${rule.key}: ${value} is below the minimum ${rule.min}`);
|
|
238
|
+
}
|
|
239
|
+
if (rule.max !== undefined && value > rule.max) {
|
|
240
|
+
errors.push(`${rule.key}: ${value} is above the maximum ${rule.max}`);
|
|
241
|
+
}
|
|
242
|
+
break;
|
|
243
|
+
}
|
|
244
|
+
case 'string': {
|
|
245
|
+
if (typeof value !== 'string') {
|
|
246
|
+
errors.push(`${rule.key}: expected a string`);
|
|
247
|
+
break;
|
|
248
|
+
}
|
|
249
|
+
if (rule.pattern !== undefined && !rule.pattern.test(value)) {
|
|
250
|
+
errors.push(`${rule.key}: fails pattern ${String(rule.pattern)} (${rule.description})`);
|
|
251
|
+
}
|
|
252
|
+
break;
|
|
253
|
+
}
|
|
254
|
+
case 'boolean': {
|
|
255
|
+
if (typeof value !== 'boolean') {
|
|
256
|
+
errors.push(`${rule.key}: expected a boolean`);
|
|
257
|
+
}
|
|
258
|
+
break;
|
|
259
|
+
}
|
|
260
|
+
case 'enum': {
|
|
261
|
+
if (typeof value !== 'string' || rule.values?.includes(value) !== true) {
|
|
262
|
+
errors.push(`${rule.key}: expected one of ${rule.values?.join(', ') ?? 'nothing'}`);
|
|
263
|
+
}
|
|
264
|
+
break;
|
|
265
|
+
}
|
|
266
|
+
default: {
|
|
267
|
+
errors.push(`${rule.key}: unknown rule kind`);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
if (typeof spec.vramgb === 'number' &&
|
|
272
|
+
typeof spec.ramgb === 'number' &&
|
|
273
|
+
spec.vramgb > spec.ramgb) {
|
|
274
|
+
warnings.push('vramgb exceeds ramgb: legitimate for GPU-first layouts, confirm this is intended');
|
|
275
|
+
}
|
|
276
|
+
if (spec.mig === 'off' && typeof spec.vramgb === 'number' && spec.vramgb >= 96) {
|
|
277
|
+
warnings.push('vramgb of 96 GB without MIG slicing dedicates the whole device to one guest');
|
|
278
|
+
}
|
|
279
|
+
if (typeof spec.vcpus === 'number' && spec.vcpus > 64 && spec.runtime === 'firecracker') {
|
|
280
|
+
warnings.push('firecracker boots fastest with small vCPU counts; large counts increase restore time');
|
|
281
|
+
}
|
|
282
|
+
if (errors.length > 0) {
|
|
283
|
+
return { valid: false, errors, warnings, normalized: null };
|
|
284
|
+
}
|
|
285
|
+
const normalized = {
|
|
286
|
+
model: String(spec.model),
|
|
287
|
+
vcpus: Number(spec.vcpus),
|
|
288
|
+
ramgb: Number(spec.ramgb),
|
|
289
|
+
vramgb: Number(spec.vramgb),
|
|
290
|
+
mig: spec.mig,
|
|
291
|
+
runtime: spec.runtime,
|
|
292
|
+
host: String(spec.host),
|
|
293
|
+
port: Number(spec.port),
|
|
294
|
+
metricsintervalms: Number(spec.metricsintervalms),
|
|
295
|
+
};
|
|
296
|
+
return { valid: true, errors, warnings, normalized: Object.freeze(normalized) };
|
|
297
|
+
}
|
|
298
|
+
catch (cause) {
|
|
299
|
+
return {
|
|
300
|
+
valid: false,
|
|
301
|
+
errors: [`validateSpec crashed: ${cause.message}`],
|
|
302
|
+
warnings,
|
|
303
|
+
normalized: null,
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Map-based internal memory store used by every engine instance. Gauges,
|
|
309
|
+
* counters, labels and rolling samples live in plain Map containers which
|
|
310
|
+
* guarantees deterministic iteration, cheap snapshots and no binding to any
|
|
311
|
+
* runtime-specific global. The store also owns a WeakMap side table for
|
|
312
|
+
* ephemeral probes that must never keep engines alive.
|
|
313
|
+
*/
|
|
314
|
+
export class InternalMemory {
|
|
315
|
+
#gauges;
|
|
316
|
+
#counters;
|
|
317
|
+
#labels;
|
|
318
|
+
#series;
|
|
319
|
+
#probes;
|
|
320
|
+
constructor() {
|
|
321
|
+
this.#gauges = new Map();
|
|
322
|
+
this.#counters = new Map();
|
|
323
|
+
this.#labels = new Map();
|
|
324
|
+
this.#series = new Map();
|
|
325
|
+
this.#probes = new WeakMap();
|
|
326
|
+
}
|
|
327
|
+
/** Number of distinct gauges currently registered. */
|
|
328
|
+
get gaugecount() {
|
|
329
|
+
return this.#gauges.size;
|
|
330
|
+
}
|
|
331
|
+
/** Private accessor that folds counters and gauges into one size metric. */
|
|
332
|
+
get #totalslots() {
|
|
333
|
+
return this.#gauges.size + this.#counters.size + this.#labels.size + this.#series.size;
|
|
334
|
+
}
|
|
335
|
+
/** Reports how many storage slots are live across all containers. */
|
|
336
|
+
get slotcount() {
|
|
337
|
+
return this.#totalslots;
|
|
338
|
+
}
|
|
339
|
+
/** Sets a gauge value, creating it when missing. */
|
|
340
|
+
setgauge(name, value) {
|
|
341
|
+
try {
|
|
342
|
+
if (!Number.isFinite(value)) {
|
|
343
|
+
throw new TypeError(`gauge ${name} must be a finite number`);
|
|
344
|
+
}
|
|
345
|
+
this.#gauges.set(name, value);
|
|
346
|
+
return this;
|
|
347
|
+
}
|
|
348
|
+
catch (cause) {
|
|
349
|
+
throw new engineerror('setgauge failed', { cause: cause });
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
/** Reads a gauge, returning the fallback when the gauge is absent. */
|
|
353
|
+
readgauge(name, fallback = 0) {
|
|
354
|
+
return this.#gauges.get(name) ?? fallback;
|
|
355
|
+
}
|
|
356
|
+
/** Increments a counter by delta (default 1) and returns the new total. */
|
|
357
|
+
bump(name, delta = 1) {
|
|
358
|
+
const next = (this.#counters.get(name) ?? 0) + delta;
|
|
359
|
+
this.#counters.set(name, next);
|
|
360
|
+
return next;
|
|
361
|
+
}
|
|
362
|
+
/** Reads a counter without mutating it. */
|
|
363
|
+
readcounter(name) {
|
|
364
|
+
return this.#counters.get(name) ?? 0;
|
|
365
|
+
}
|
|
366
|
+
/** Attaches a human readable label for observability tooling. */
|
|
367
|
+
setlabel(name, value) {
|
|
368
|
+
this.#labels.set(name, value);
|
|
369
|
+
return this;
|
|
370
|
+
}
|
|
371
|
+
/** Returns a frozen copy of all labels. */
|
|
372
|
+
readlabels() {
|
|
373
|
+
return Object.freeze({ ...Object.fromEntries(this.#labels) });
|
|
374
|
+
}
|
|
375
|
+
/** Pushes a sample into the rolling series of one engine. */
|
|
376
|
+
pushsample(engineid, sample, keep = 720) {
|
|
377
|
+
try {
|
|
378
|
+
const bucket = this.#series.get(engineid) ?? [];
|
|
379
|
+
bucket.push(sample);
|
|
380
|
+
while (bucket.length > keep) {
|
|
381
|
+
bucket.shift();
|
|
382
|
+
}
|
|
383
|
+
this.#series.set(engineid, bucket);
|
|
384
|
+
return bucket.length;
|
|
385
|
+
}
|
|
386
|
+
catch (cause) {
|
|
387
|
+
throw new engineerror('pushsample failed', { cause: cause });
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
/** Computes cpu and memory averages plus peaks for one engine. */
|
|
391
|
+
aggregate(engineid) {
|
|
392
|
+
const bucket = this.#series.get(engineid) ?? [];
|
|
393
|
+
if (bucket.length === 0) {
|
|
394
|
+
return { count: 0, cpuavg: 0, cpupeak: 0, memavggb: 0, newest: null };
|
|
395
|
+
}
|
|
396
|
+
let cpusum = 0;
|
|
397
|
+
let cpupeak = 0;
|
|
398
|
+
let memsum = 0;
|
|
399
|
+
for (const sample of bucket) {
|
|
400
|
+
cpusum += sample.cpuutilization;
|
|
401
|
+
cpupeak = Math.max(cpupeak, sample.cpuutilization);
|
|
402
|
+
memsum += sample.memusedgb;
|
|
403
|
+
}
|
|
404
|
+
return {
|
|
405
|
+
count: bucket.length,
|
|
406
|
+
cpuavg: Number((cpusum / bucket.length).toFixed(4)),
|
|
407
|
+
cpupeak,
|
|
408
|
+
memavggb: Number((memsum / bucket.length).toFixed(4)),
|
|
409
|
+
newest: bucket[bucket.length - 1] ?? null,
|
|
410
|
+
};
|
|
411
|
+
}
|
|
412
|
+
/** Stores an ephemeral probe keyed by a weak object reference. */
|
|
413
|
+
attachprobe(owner, sample) {
|
|
414
|
+
this.#probes.set(owner, sample);
|
|
415
|
+
}
|
|
416
|
+
/** Reads an ephemeral probe; returns null when the owner is gone. */
|
|
417
|
+
readprobe(owner) {
|
|
418
|
+
return this.#probes.get(owner) ?? null;
|
|
419
|
+
}
|
|
420
|
+
/** Drops every container, leaving the store empty but reusable. */
|
|
421
|
+
clear() {
|
|
422
|
+
this.#gauges.clear();
|
|
423
|
+
this.#counters.clear();
|
|
424
|
+
this.#labels.clear();
|
|
425
|
+
this.#series.clear();
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
/* ------------------------------------------------------------------ */
|
|
429
|
+
/* Section 6: disposable MetricsStore for using declarations */
|
|
430
|
+
/* ------------------------------------------------------------------ */
|
|
431
|
+
/**
|
|
432
|
+
* Disposable metrics facade. Instances are designed for explicit resource
|
|
433
|
+
* management: `using store = new MetricsStore()` flushes the snapshot to
|
|
434
|
+
* disk on scope exit through Symbol.dispose, while `await using` performs
|
|
435
|
+
* the same through Symbol.asyncDispose after letting pending samples
|
|
436
|
+
* settle. Both disposers are idempotent so double disposal is harmless.
|
|
437
|
+
* The v2 orchestrator subclasses this store (sandboxmetrics) so the whole
|
|
438
|
+
* engine keeps exactly one metrics component.
|
|
439
|
+
*/
|
|
440
|
+
export class MetricsStore {
|
|
441
|
+
#memory;
|
|
442
|
+
#engineid;
|
|
443
|
+
#snapshotdir;
|
|
444
|
+
#disposed;
|
|
445
|
+
constructor(engineid, snapshotdir) {
|
|
446
|
+
this.#memory = new InternalMemory();
|
|
447
|
+
this.#engineid = engineid;
|
|
448
|
+
this.#snapshotdir = snapshotdir ?? null;
|
|
449
|
+
this.#disposed = false;
|
|
450
|
+
}
|
|
451
|
+
/** Direct access to the underlying InternalMemory containers. */
|
|
452
|
+
get memory() {
|
|
453
|
+
return this.#memory;
|
|
454
|
+
}
|
|
455
|
+
/** Engine identifier this store is bound to. */
|
|
456
|
+
get engineid() {
|
|
457
|
+
return this.#engineid;
|
|
458
|
+
}
|
|
459
|
+
/** True once a disposer has run for this instance. */
|
|
460
|
+
get disposed() {
|
|
461
|
+
return this.#disposed;
|
|
462
|
+
}
|
|
463
|
+
/** Records a sample into the rolling series. */
|
|
464
|
+
record(sample) {
|
|
465
|
+
if (this.#disposed) {
|
|
466
|
+
throw new engineerror('MetricsStore is disposed and cannot record');
|
|
467
|
+
}
|
|
468
|
+
this.#memory.pushsample(this.#engineid, sample);
|
|
469
|
+
this.#memory.setgauge('lastcpu', sample.cpuutilization);
|
|
470
|
+
this.#memory.setgauge('lastmemgb', sample.memusedgb);
|
|
471
|
+
return this;
|
|
472
|
+
}
|
|
473
|
+
/** Persists the current aggregate snapshot to the configured directory. */
|
|
474
|
+
flush() {
|
|
475
|
+
try {
|
|
476
|
+
if (this.#snapshotdir === null) {
|
|
477
|
+
return null;
|
|
478
|
+
}
|
|
479
|
+
const aggregate = this.#memory.aggregate(this.#engineid);
|
|
480
|
+
const payload = JSON.stringify({ engineid: this.#engineid, at: Date.now(), aggregate, labels: this.#memory.readlabels() }, null, 2);
|
|
481
|
+
mkdirSync(this.#snapshotdir, { recursive: true });
|
|
482
|
+
const file = join(this.#snapshotdir, `${this.#engineid}.metrics.json`);
|
|
483
|
+
writeFileSync(file, payload, 'utf8');
|
|
484
|
+
return file;
|
|
485
|
+
}
|
|
486
|
+
catch (cause) {
|
|
487
|
+
throw new engineerror('MetricsStore.flush failed', { cause: cause });
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
/** Loads a previously persisted snapshot, returning null when missing. */
|
|
491
|
+
restore() {
|
|
492
|
+
try {
|
|
493
|
+
if (this.#snapshotdir === null) {
|
|
494
|
+
return null;
|
|
495
|
+
}
|
|
496
|
+
const file = join(this.#snapshotdir, `${this.#engineid}.metrics.json`);
|
|
497
|
+
const raw = readFileSync(file, 'utf8');
|
|
498
|
+
return JSON.parse(raw);
|
|
499
|
+
}
|
|
500
|
+
catch {
|
|
501
|
+
return null;
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
/** Synchronous disposer used by `using store = new MetricsStore(...)`. */
|
|
505
|
+
[Symbol.dispose]() {
|
|
506
|
+
if (this.#disposed) {
|
|
507
|
+
return;
|
|
508
|
+
}
|
|
509
|
+
try {
|
|
510
|
+
this.flush();
|
|
511
|
+
}
|
|
512
|
+
catch {
|
|
513
|
+
/* persistence failures must never mask scope exit */
|
|
514
|
+
}
|
|
515
|
+
finally {
|
|
516
|
+
this.#disposed = true;
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
/** Asynchronous disposer used by `await using` declarations. */
|
|
520
|
+
async [Symbol.asyncDispose]() {
|
|
521
|
+
this[Symbol.dispose]();
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
/**
|
|
525
|
+
* Strongly typed observer bus built on node:events EventEmitter. Publish and
|
|
526
|
+
* subscribe are generic over the topic map so listeners receive exactly the
|
|
527
|
+
* payload type of the topic they choose; the underlying EventEmitter is kept
|
|
528
|
+
* private so external code cannot bypass typing. This class is the single
|
|
529
|
+
* bus of the engine: orchestrator.ts extends it (sandboxevents) and every
|
|
530
|
+
* subsystem publishes here instead of creating its own emitter.
|
|
531
|
+
*/
|
|
532
|
+
export class enginebus {
|
|
533
|
+
#emitter;
|
|
534
|
+
constructor() {
|
|
535
|
+
this.#emitter = new EventEmitter();
|
|
536
|
+
this.#emitter.setMaxListeners(0);
|
|
537
|
+
}
|
|
538
|
+
/** Subscribes a typed listener to one topic. */
|
|
539
|
+
subscribe(topic, listener) {
|
|
540
|
+
this.#emitter.on(topic, listener);
|
|
541
|
+
return this;
|
|
542
|
+
}
|
|
543
|
+
/** Removes a previously subscribed listener. */
|
|
544
|
+
unsubscribe(topic, listener) {
|
|
545
|
+
this.#emitter.off(topic, listener);
|
|
546
|
+
return this;
|
|
547
|
+
}
|
|
548
|
+
/** Publishes one event; the boolean mirrors EventEmitter emit results. */
|
|
549
|
+
publish(topic, payload) {
|
|
550
|
+
return this.#emitter.emit(topic, payload);
|
|
551
|
+
}
|
|
552
|
+
/** Waits until one topic fires, resolving with its payload. */
|
|
553
|
+
waitfor(topic) {
|
|
554
|
+
return new Promise((resolve) => {
|
|
555
|
+
this.#emitter.once(topic, (payload) => {
|
|
556
|
+
resolve(payload);
|
|
557
|
+
});
|
|
558
|
+
});
|
|
559
|
+
}
|
|
560
|
+
/** Returns how many listeners are attached to one topic. */
|
|
561
|
+
listenercount(topic) {
|
|
562
|
+
return this.#emitter.listenerCount(topic);
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
/** Process-wide bus shared by factories in this module. */
|
|
566
|
+
export const engineeventbus = new enginebus();
|
|
567
|
+
/* ------------------------------------------------------------------ */
|
|
568
|
+
/* Section 8: error type and safe execution helpers */
|
|
569
|
+
/* ------------------------------------------------------------------ */
|
|
570
|
+
/** Error thrown by every engine subsystem with an optional cause chain. */
|
|
571
|
+
export class engineerror extends Error {
|
|
572
|
+
/** Machine readable subsystem tag. */
|
|
573
|
+
subsystem;
|
|
574
|
+
constructor(message, options) {
|
|
575
|
+
super(message, options);
|
|
576
|
+
this.name = 'engineerror';
|
|
577
|
+
this.subsystem = options?.subsystem ?? 'core';
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* Runs an action inside a try/catch catcher and reports the outcome as a
|
|
582
|
+
* discriminated union instead of throwing, which lets library callers decide
|
|
583
|
+
* how failures surface. The fallback runs only when the action throws.
|
|
584
|
+
*/
|
|
585
|
+
export function safecall(label, action, fallback) {
|
|
586
|
+
try {
|
|
587
|
+
return { ok: true, value: action() };
|
|
588
|
+
}
|
|
589
|
+
catch (cause) {
|
|
590
|
+
const error = cause instanceof Error
|
|
591
|
+
? cause
|
|
592
|
+
: new engineerror(`safecall ${label} failed`, { cause: cause });
|
|
593
|
+
engineeventbus.publish('engine:error', { engineid: label, error });
|
|
594
|
+
if (fallback !== undefined) {
|
|
595
|
+
try {
|
|
596
|
+
return { ok: true, value: fallback() };
|
|
597
|
+
}
|
|
598
|
+
catch (inner) {
|
|
599
|
+
return {
|
|
600
|
+
ok: false,
|
|
601
|
+
error: new engineerror(`safecall ${label} fallback failed`, { cause: inner }),
|
|
602
|
+
};
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
return { ok: false, error };
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
/**
|
|
609
|
+
* Facade object returned by createVirtualEngine. The class keeps its state
|
|
610
|
+
* machine private and exposes only intentful operations, emitting typed
|
|
611
|
+
* events on every transition so orchestrators can react without polling.
|
|
612
|
+
*/
|
|
613
|
+
export class VirtualEngine {
|
|
614
|
+
#id;
|
|
615
|
+
#spec;
|
|
616
|
+
#state;
|
|
617
|
+
#memory;
|
|
618
|
+
#bus;
|
|
619
|
+
#createdat;
|
|
620
|
+
#startedat;
|
|
621
|
+
#endpoint;
|
|
622
|
+
constructor(spec, bus) {
|
|
623
|
+
this.#id = randomUUID();
|
|
624
|
+
this.#spec = spec;
|
|
625
|
+
this.#state = 'created';
|
|
626
|
+
this.#memory = new InternalMemory();
|
|
627
|
+
this.#bus = bus;
|
|
628
|
+
this.#createdat = Date.now();
|
|
629
|
+
this.#startedat = null;
|
|
630
|
+
this.#endpoint = null;
|
|
631
|
+
this.#memory.setlabel('model', spec.model);
|
|
632
|
+
this.#memory.setlabel('runtime', spec.runtime);
|
|
633
|
+
}
|
|
634
|
+
/** Unique identifier of this engine instance. */
|
|
635
|
+
get id() {
|
|
636
|
+
return this.#id;
|
|
637
|
+
}
|
|
638
|
+
/** Frozen specification the engine was created with. */
|
|
639
|
+
get spec() {
|
|
640
|
+
return this.#spec;
|
|
641
|
+
}
|
|
642
|
+
/** Current lifecycle state. */
|
|
643
|
+
get state() {
|
|
644
|
+
return this.#state;
|
|
645
|
+
}
|
|
646
|
+
/** Milliseconds elapsed since creation. */
|
|
647
|
+
get uptimems() {
|
|
648
|
+
return Date.now() - this.#createdat;
|
|
649
|
+
}
|
|
650
|
+
/** Endpoint after a successful start, otherwise null. */
|
|
651
|
+
get endpoint() {
|
|
652
|
+
return this.#endpoint;
|
|
653
|
+
}
|
|
654
|
+
/** Internal metrics store of this engine. */
|
|
655
|
+
get memory() {
|
|
656
|
+
return this.#memory;
|
|
657
|
+
}
|
|
658
|
+
#transition(to) {
|
|
659
|
+
const from = this.#state;
|
|
660
|
+
this.#state = to;
|
|
661
|
+
this.#bus.publish('engine:statechanged', { engineid: this.#id, from, to });
|
|
662
|
+
}
|
|
663
|
+
/** Moves the engine to running, binding the resolved endpoint. */
|
|
664
|
+
start() {
|
|
665
|
+
try {
|
|
666
|
+
if (this.#state === 'running') {
|
|
667
|
+
throw new engineerror('engine is already running');
|
|
668
|
+
}
|
|
669
|
+
this.#transition('starting');
|
|
670
|
+
this.#bus.publish('engine:starting', { engineid: this.#id, spec: this.#spec });
|
|
671
|
+
this.#endpoint = buildEndpoint(this.#spec.host, this.#spec.port);
|
|
672
|
+
this.#startedat = Date.now();
|
|
673
|
+
this.#memory.setgauge('port', this.#endpoint.port);
|
|
674
|
+
this.#memory.bump('starts');
|
|
675
|
+
this.#transition('running');
|
|
676
|
+
this.#bus.publish('engine:running', { engineid: this.#id, endpoint: this.#endpoint });
|
|
677
|
+
return this.#endpoint;
|
|
678
|
+
}
|
|
679
|
+
catch (cause) {
|
|
680
|
+
this.#transition('degraded');
|
|
681
|
+
const error = cause instanceof Error ? cause : new engineerror('start failed', { cause: cause });
|
|
682
|
+
this.#bus.publish('engine:error', { engineid: this.#id, error });
|
|
683
|
+
throw error;
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
/** Stops a running engine and publishes the measured uptime. */
|
|
687
|
+
stop() {
|
|
688
|
+
if (this.#state === 'stopped') {
|
|
689
|
+
return;
|
|
690
|
+
}
|
|
691
|
+
const started = this.#startedat ?? this.#createdat;
|
|
692
|
+
this.#memory.bump('stops');
|
|
693
|
+
this.#transition('stopped');
|
|
694
|
+
this.#bus.publish('engine:stopped', { engineid: this.#id, uptimems: Date.now() - started });
|
|
695
|
+
}
|
|
696
|
+
/** Builds an immutable snapshot of the engine state. */
|
|
697
|
+
snapshot() {
|
|
698
|
+
return Object.freeze({
|
|
699
|
+
engineid: this.#id,
|
|
700
|
+
state: this.#state,
|
|
701
|
+
spec: this.#spec,
|
|
702
|
+
uptimems: this.uptimems,
|
|
703
|
+
metrics: this.#memory.aggregate(this.#id),
|
|
704
|
+
versions: engineversions,
|
|
705
|
+
});
|
|
706
|
+
}
|
|
707
|
+
/** Runs structural health checks over spec, state and metrics. */
|
|
708
|
+
healthcheck() {
|
|
709
|
+
const checks = [];
|
|
710
|
+
const validation = validateSpec(this.#spec);
|
|
711
|
+
checks.push({
|
|
712
|
+
name: 'spec',
|
|
713
|
+
passed: validation.valid,
|
|
714
|
+
detail: validation.valid
|
|
715
|
+
? 'specification passes the rule table'
|
|
716
|
+
: validation.errors.join('; '),
|
|
717
|
+
});
|
|
718
|
+
checks.push({
|
|
719
|
+
name: 'state',
|
|
720
|
+
passed: this.#state === 'running' || this.#state === 'created',
|
|
721
|
+
detail: `current state is ${this.#state}`,
|
|
722
|
+
});
|
|
723
|
+
checks.push({
|
|
724
|
+
name: 'endpoint',
|
|
725
|
+
passed: this.#state !== 'running' || this.#endpoint !== null,
|
|
726
|
+
detail: this.#endpoint === null
|
|
727
|
+
? 'no endpoint bound'
|
|
728
|
+
: `bound to ${this.#endpoint.host}:${this.#endpoint.port}`,
|
|
729
|
+
});
|
|
730
|
+
checks.push({
|
|
731
|
+
name: 'samples',
|
|
732
|
+
passed: true,
|
|
733
|
+
detail: `${this.#memory.aggregate(this.#id).count} samples retained`,
|
|
734
|
+
});
|
|
735
|
+
const healthy = checks.every((check) => check.passed);
|
|
736
|
+
return Object.freeze({ engineid: this.#id, healthy, state: this.#state, checks });
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
/* ------------------------------------------------------------------ */
|
|
740
|
+
/* Section 10: registry and main factory */
|
|
741
|
+
/* ------------------------------------------------------------------ */
|
|
742
|
+
/** Registry of live engines keyed by engine id. */
|
|
743
|
+
export const engineRegistry = new Map();
|
|
744
|
+
/** Ephemeral health probes; WeakMap keeps engines garbage collectable. */
|
|
745
|
+
const healthprobes = new WeakMap();
|
|
746
|
+
/**
|
|
747
|
+
* Creates a fully wired virtual engine from user options. The factory
|
|
748
|
+
* resolves the host (user choice only), draws a random port in the
|
|
749
|
+
* 30000-59999 range when none is given, validates the merged specification
|
|
750
|
+
* with validateSpec, registers the instance in engineRegistry and emits the
|
|
751
|
+
* engine:created topic. Failures are converted to engineerror instances so
|
|
752
|
+
* callers always see a typed cause chain.
|
|
753
|
+
*
|
|
754
|
+
* @param options Partial specification; only the host is mandatory because
|
|
755
|
+
* the library refuses to assume any default address.
|
|
756
|
+
*/
|
|
757
|
+
export function createVirtualEngine(options) {
|
|
758
|
+
try {
|
|
759
|
+
const host = resolveHost(options.host);
|
|
760
|
+
const candidate = {
|
|
761
|
+
model: options.model ?? 'AMD EPYC 9965',
|
|
762
|
+
vcpus: options.vcpus ?? 8,
|
|
763
|
+
ramgb: options.ramgb ?? 16,
|
|
764
|
+
vramgb: options.vramgb ?? 24,
|
|
765
|
+
mig: options.mig ?? '1g.24gb',
|
|
766
|
+
runtime: options.runtime ?? 'qemu',
|
|
767
|
+
host,
|
|
768
|
+
port: randomPort(options.port),
|
|
769
|
+
metricsintervalms: options.metricsintervalms ?? 1000,
|
|
770
|
+
};
|
|
771
|
+
const validation = validateSpec(candidate);
|
|
772
|
+
if (!validation.valid || validation.normalized === null) {
|
|
773
|
+
throw new engineerror(`invalid engine specification: ${validation.errors.join('; ')}`);
|
|
774
|
+
}
|
|
775
|
+
const engine = new VirtualEngine(validation.normalized, engineeventbus);
|
|
776
|
+
engineRegistry.set(engine.id, engine);
|
|
777
|
+
engine.memory.setgauge('vcpus', validation.normalized.vcpus);
|
|
778
|
+
engine.memory.setgauge('ramgb', validation.normalized.ramgb);
|
|
779
|
+
engine.memory.setgauge('vramgb', validation.normalized.vramgb);
|
|
780
|
+
engineeventbus.publish('engine:created', { engineid: engine.id, at: Date.now() });
|
|
781
|
+
return engine;
|
|
782
|
+
}
|
|
783
|
+
catch (cause) {
|
|
784
|
+
if (cause instanceof engineerror) {
|
|
785
|
+
throw cause;
|
|
786
|
+
}
|
|
787
|
+
throw new engineerror('createVirtualEngine failed', { cause: cause });
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
/** Registers a fresh health probe for an engine and returns it. */
|
|
791
|
+
export function probeengine(engine) {
|
|
792
|
+
const report = engine.healthcheck();
|
|
793
|
+
healthprobes.set(engine, report);
|
|
794
|
+
return report;
|
|
795
|
+
}
|
|
796
|
+
/** Reads the latest health probe recorded for an engine, if any. */
|
|
797
|
+
export function lastprobe(engine) {
|
|
798
|
+
return healthprobes.get(engine) ?? null;
|
|
799
|
+
}
|
|
800
|
+
/** Removes an engine from the registry; returns true when it existed. */
|
|
801
|
+
export function disposeengine(engineid) {
|
|
802
|
+
return engineRegistry.delete(engineid);
|
|
803
|
+
}
|
|
804
|
+
/**
|
|
805
|
+
* Starts a periodic sampling loop that fabricates metric samples with the
|
|
806
|
+
* node:crypto random generator and records them into the engine metrics
|
|
807
|
+
* store, emitting a metrics:sample event per iteration. The returned handle
|
|
808
|
+
* implements Symbol.dispose so it composes with `using` declarations.
|
|
809
|
+
*/
|
|
810
|
+
export function startsampling(engine, store) {
|
|
811
|
+
let _tick = 0;
|
|
812
|
+
const total = engine.spec.ramgb;
|
|
813
|
+
const vtotal = engine.spec.vramgb;
|
|
814
|
+
const timer = setInterval(() => {
|
|
815
|
+
_tick += 1;
|
|
816
|
+
const sample = {
|
|
817
|
+
at: Date.now(),
|
|
818
|
+
cpuutilization: Number((randomInt(5, 95) + Math.random()).toFixed(4)),
|
|
819
|
+
memusedgb: Number((total * (randomInt(20, 80) / 100)).toFixed(3)),
|
|
820
|
+
memtotalgb: total,
|
|
821
|
+
vramusedgb: Number((vtotal * (randomInt(10, 90) / 100)).toFixed(3)),
|
|
822
|
+
vramtotalgb: vtotal,
|
|
823
|
+
iops: randomInt(1000, 250000),
|
|
824
|
+
};
|
|
825
|
+
store.record(sample);
|
|
826
|
+
engineeventbus.publish('metrics:sample', { engineid: engine.id, sample });
|
|
827
|
+
}, engine.spec.metricsintervalms);
|
|
828
|
+
const handle = {
|
|
829
|
+
stop: () => {
|
|
830
|
+
clearInterval(timer);
|
|
831
|
+
},
|
|
832
|
+
[Symbol.dispose]: () => {
|
|
833
|
+
clearInterval(timer);
|
|
834
|
+
},
|
|
835
|
+
};
|
|
836
|
+
return handle;
|
|
837
|
+
}
|
|
838
|
+
/**
|
|
839
|
+
* Default plan: a desktop zen5 lab (9950X3D with two CCDs) paired with an
|
|
840
|
+
* RTX 5090, 65536 multiplexed MTTG threads and a 4x cpu overcommit.
|
|
841
|
+
*/
|
|
842
|
+
export const defaultplan = {
|
|
843
|
+
name: 'aether-lab',
|
|
844
|
+
cpu: 'AMD Ryzen 9 9950X3D',
|
|
845
|
+
gpu: 'NVIDIA GeForce RTX 5090',
|
|
846
|
+
sockets: 1,
|
|
847
|
+
dies: 2,
|
|
848
|
+
cores: 8,
|
|
849
|
+
threads: 2,
|
|
850
|
+
vcpus: 16,
|
|
851
|
+
memorygib: 64,
|
|
852
|
+
vramgib: 32,
|
|
853
|
+
overcommit: 4,
|
|
854
|
+
gpumode: 'vfio',
|
|
855
|
+
mttg: true,
|
|
856
|
+
mttgthreads: 65536,
|
|
857
|
+
};
|
|
858
|
+
/**
|
|
859
|
+
* Returns the topology product of a plan (sockets x dies x cores x
|
|
860
|
+
* threads); distinct from solvetopology of virtualcpu.ts which maps a
|
|
861
|
+
* processor spec to its physical package view.
|
|
862
|
+
*/
|
|
863
|
+
export function plantopology(candidate) {
|
|
864
|
+
return candidate.sockets * candidate.dies * candidate.cores * candidate.threads;
|
|
865
|
+
}
|
|
866
|
+
/**
|
|
867
|
+
* Renders the lean qemu argv of a plan: maxcpus headroom, hotplug memory
|
|
868
|
+
* slots (maxmem), topology-aware -smp, the mttg thread count exported
|
|
869
|
+
* through -fw_cfg, and per-gpu-mode device selection. the complete
|
|
870
|
+
* "turbo" argv (TDX/SEV/vfio romfile/venus) lives in buildqemucmd of
|
|
871
|
+
* virtualization.ts; the runtime strategy argv lives in orchestrator.ts.
|
|
872
|
+
*/
|
|
873
|
+
export function qemuargv(candidate) {
|
|
874
|
+
const maxcpus = Math.max(candidate.vcpus, plantopology(candidate));
|
|
875
|
+
const args = [
|
|
876
|
+
'qemu-system-x86_64',
|
|
877
|
+
'-nodefaults',
|
|
878
|
+
'-machine',
|
|
879
|
+
'q35,accel=kvm,kernel-irqchip=split,hpet=off',
|
|
880
|
+
'-cpu',
|
|
881
|
+
'host,kvm=on,l3-cache=on,topoext=on,+x2apic',
|
|
882
|
+
'-smp',
|
|
883
|
+
`cpus=${Math.min(candidate.vcpus, plantopology(candidate))},sockets=${candidate.sockets},dies=${candidate.dies},cores=${candidate.cores},threads=${candidate.threads},maxcpus=${maxcpus}`,
|
|
884
|
+
'-m',
|
|
885
|
+
`${candidate.memorygib}G,slots=4,maxmem=${Math.max(candidate.memorygib * 2, candidate.memorygib + 32)}G`,
|
|
886
|
+
'-name',
|
|
887
|
+
`${candidate.name},debug-threads=on`,
|
|
888
|
+
'-nographic',
|
|
889
|
+
'-serial',
|
|
890
|
+
'mon:stdio',
|
|
891
|
+
'-device',
|
|
892
|
+
'virtio-balloon-pci,deflate-on-oom=on,free-page-reporting=on',
|
|
893
|
+
'-device',
|
|
894
|
+
'virtio-net-pci,netdev=n0,mq=on,vectors=10',
|
|
895
|
+
'-netdev',
|
|
896
|
+
'tap,id=n0,vhost=on,queues=4,script=no,downscript=no',
|
|
897
|
+
];
|
|
898
|
+
if (candidate.gpumode === 'vfio') {
|
|
899
|
+
args.push('-device', 'vfio-pci,host=01:00.0,multifunction=on,x-vga=on', '-vga', 'none');
|
|
900
|
+
}
|
|
901
|
+
else if (candidate.gpumode === 'virtio') {
|
|
902
|
+
args.push('-device', 'virtio-gpu-gl,hostmem=8G,blob=on,venus=on');
|
|
903
|
+
}
|
|
904
|
+
if (candidate.mttg) {
|
|
905
|
+
args.push('-fw_cfg', `name=opt/aetherforge/mttg,string=${candidate.mttgthreads}`);
|
|
906
|
+
}
|
|
907
|
+
return args;
|
|
908
|
+
}
|
|
909
|
+
/** renders the plan argv as a copy-pasteable shell command. */
|
|
910
|
+
export function qemucommand(candidate) {
|
|
911
|
+
return qemuargv(candidate)
|
|
912
|
+
.map((token) => (token.includes(' ') || token.includes(',') ? `'${token}'` : token))
|
|
913
|
+
.join(' \\\n ');
|
|
914
|
+
}
|
|
915
|
+
/**
|
|
916
|
+
* renders the docker run command of a plan: cpu divided by the overcommit
|
|
917
|
+
* factor, unbounded pids cgroup (--pids-limit=0) and the MTTG thread
|
|
918
|
+
* budget exported through AETHER_MTTG_THREADS.
|
|
919
|
+
*/
|
|
920
|
+
export function dockerrun(candidate) {
|
|
921
|
+
const cpus = (candidate.vcpus / Math.max(1, candidate.overcommit)).toFixed(2);
|
|
922
|
+
return [
|
|
923
|
+
`docker run --rm -it --name ${candidate.name}`,
|
|
924
|
+
` --cpus=${cpus} --memory=${candidate.memorygib}g --pids-limit=0`,
|
|
925
|
+
` -e AETHER_MTTG_THREADS=${candidate.mttgthreads}`,
|
|
926
|
+
candidate.gpumode === 'none' || candidate.gpumode === 'virtio' ? '' : ' --gpus all',
|
|
927
|
+
' ghcr.io/aetherforge/runtime:5',
|
|
928
|
+
]
|
|
929
|
+
.filter(Boolean)
|
|
930
|
+
.join(' \\\n');
|
|
931
|
+
}
|
|
932
|
+
/** renders the vm.config.toml block of a plan. */
|
|
933
|
+
export function plantoml(candidate) {
|
|
934
|
+
return `# generated by the saddle v6 planner
|
|
935
|
+
[machine]
|
|
936
|
+
name = "${candidate.name}"
|
|
937
|
+
[cpu]
|
|
938
|
+
model = "${candidate.cpu}"
|
|
939
|
+
sockets = ${candidate.sockets}
|
|
940
|
+
dies = ${candidate.dies}
|
|
941
|
+
cores = ${candidate.cores}
|
|
942
|
+
threads = ${candidate.threads}
|
|
943
|
+
vcpus = ${candidate.vcpus}
|
|
944
|
+
overcommit = ${candidate.overcommit}
|
|
945
|
+
[memory]
|
|
946
|
+
gib = ${candidate.memorygib}
|
|
947
|
+
[gpu]
|
|
948
|
+
model = "${candidate.gpu}"
|
|
949
|
+
mode = "${candidate.gpumode}"
|
|
950
|
+
vram_gib = ${candidate.vramgib}
|
|
951
|
+
[mttg]
|
|
952
|
+
enabled = ${candidate.mttg}
|
|
953
|
+
virtual_threads = ${candidate.mttgthreads}
|
|
954
|
+
`;
|
|
955
|
+
}
|
|
956
|
+
/**
|
|
957
|
+
* lints a plan: the MTTG thread budget must cover the vCPUs, the
|
|
958
|
+
* overcommit ceiling is 64x, the vCPU ceiling is 4096 and the topology
|
|
959
|
+
* product must equal the vCPU count.
|
|
960
|
+
*/
|
|
961
|
+
export function planlint(candidate) {
|
|
962
|
+
const notes = [];
|
|
963
|
+
if (candidate.mttg && candidate.mttgthreads < candidate.vcpus) {
|
|
964
|
+
notes.push('mttg threads must cover the vcpu count');
|
|
965
|
+
}
|
|
966
|
+
if (candidate.overcommit > 64) {
|
|
967
|
+
notes.push('overcommit ceiling is 64x');
|
|
968
|
+
}
|
|
969
|
+
if (candidate.vcpus > 4096) {
|
|
970
|
+
notes.push('vcpu ceiling is 4096');
|
|
971
|
+
}
|
|
972
|
+
if (plantopology(candidate) !== candidate.vcpus) {
|
|
973
|
+
notes.push(`topology product ${plantopology(candidate)} differs from vcpus ${candidate.vcpus}`);
|
|
974
|
+
}
|
|
975
|
+
return notes;
|
|
976
|
+
}
|
|
977
|
+
/* ------------------------------------------------------------------ */
|
|
978
|
+
/* Section 13: export barrel (v2 modules) */
|
|
979
|
+
/* ------------------------------------------------------------------ */
|
|
980
|
+
/** Re-exports the compute domain (wasm/wasmtime 48 lts, webgpu on
|
|
981
|
+
* lavapipe, node 26 runtime surface, ai workload planners, wasm canary,
|
|
982
|
+
* wasi:gfx, chatops, gpu ebpf telemetry, ai migration predictor). */
|
|
983
|
+
export * from './compute.js';
|
|
984
|
+
/** Re-exports the media pipeline and transcode domain (24-stage
|
|
985
|
+
* pipeline, ffmpeg 7.1 NVENC p1-p7 command synthesis, createoptimal
|
|
986
|
+
* encoder policy, passage ed25519+chacha20-poly1305 channel, 30
|
|
987
|
+
* transcode modes). */
|
|
988
|
+
export * from './media.js';
|
|
989
|
+
export { bellstate, deutsch, dnacapacity, dnavaultdecode, dnavaultencode, ghzstate, grover2, grover3, opticalplan, qteleport, quantuminspiredrandom, quantumregistry, quantumsim, runbb84, rune91, } from './quantum.js';
|
|
990
|
+
/** Re-exports the scheduling and allocation domain (typecheck sharding,
|
|
991
|
+
* shared-memory cache, project graph, MIG/vCPU/RAM/GPU/NUMA/PCI
|
|
992
|
+
* allocation, aipsched, psi lstm, tenant QoS, anomaly detector,
|
|
993
|
+
* hot reload, otel, health, shutdown, plugin hooks). */
|
|
994
|
+
export * from './scheduler.js';
|
|
995
|
+
export { cgroupsv2slice, creatiersengine, FREEPOOL, githubstorage, LATENCYLADDER, npmchunkregistry, plannpmchunks, publishplan, rambufferbackend, reassembleplan, sqlitekv, sqlitel3backend, swapfilerecipe, sysctldropin, TIERS, tierserror, tmpfsrecipe, zramrecipe, } from './tiers.js';
|
|
996
|
+
/** Re-exports the virtual processor bank and cpuinfo generators. */
|
|
997
|
+
export * from './virtualcpu.js';
|
|
998
|
+
/** Re-exports the gpu passthrough surface (vfio, rom dump, vgpu data). */
|
|
999
|
+
export * from './virtualgpu.js';
|
|
1000
|
+
/** Re-exports the virtualization surface (qemu turbo argv, passage,
|
|
1001
|
+
* mttg cgroups, mttg grid, checkpoint and restore, virtualizationcore
|
|
1002
|
+
* bridge). */
|
|
1003
|
+
export * from './virtualization.js';
|
|
1004
|
+
/** Re-exports the memory tier catalog and virtual memory manager. */
|
|
1005
|
+
export * from './virtualmemory.js';
|
|
1006
|
+
/* ── Section 2: the saddle domain routing barrel ── */
|
|
1007
|
+
export * from "./foundation.js";
|
|
1008
|
+
export * from "./isolation.js";
|
|
1009
|
+
export * from "./virtual.js";
|
|
1010
|
+
export * from "./execution.js";
|
|
1011
|
+
export * from "./browser.js";
|
|
1012
|
+
export * from "./acquisition.js";
|
|
1013
|
+
export * from "./communication.js";
|
|
1014
|
+
export * from "./integration.js";
|
|
1015
|
+
export * from "./automation.js";
|
|
1016
|
+
export * from "./intelligence.js";
|
|
1017
|
+
export * from "./distribution.js";
|
|
1018
|
+
export * from "./modes.js";
|
|
1019
|
+
export * from "./operations.js";
|
|
125
1020
|
//# sourceMappingURL=index.js.map
|