@wenathlan/saddle 2.0.154 → 2.0.159

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.
Files changed (314) hide show
  1. package/Dockerfile +167 -1334
  2. package/README.md +59 -60
  3. package/biome.jsonc +3 -3
  4. package/browser.ts +482 -0
  5. package/cli.ts +274 -0
  6. package/distribution.ts +731 -0
  7. package/docker.config +29 -8
  8. package/docs/{architecture.1.8.19.mmd → architecture1819.md} +6 -0
  9. package/docs/artifactavailability.md +2 -2
  10. package/docs/browser.md +18 -1
  11. package/docs/{containerplatforms.2.1.0.md → containerplatforms210.md} +1 -1
  12. package/docs/{documentmap.1.8.12.md → documentmap1812.md} +1 -1
  13. package/docs/extension.md +13 -2
  14. package/docs/features.md +5 -0
  15. package/docs/libraryapi.md +1 -1
  16. package/docs/{ninety.modalities.md → ninetymodalities.md} +87 -4
  17. package/docs/{planning.ninety.md → planningninety.md} +6 -6
  18. package/docs/{releasenotes.1.8.13.md → releasenotes1813.md} +2 -2
  19. package/docs/{releasenotes.1.8.14.md → releasenotes1814.md} +1 -1
  20. package/docs/{repo.synthesis.1.8.16.md → reposynthesis1816.md} +1 -1
  21. package/docs/todo.md +2 -2
  22. package/docs/{todo.1.8.15.md → todo1815.md} +1 -1
  23. package/docs/{todo.1.8.16.md → todo1816.md} +5 -5
  24. package/execution.ts +677 -0
  25. package/foundation.ts +314 -0
  26. package/index.ts +36 -34
  27. package/isolation.ts +84 -0
  28. package/modalityregistry.ts +189 -145
  29. package/modes.ts +170 -0
  30. package/mttg.config +1 -1
  31. package/orchestrator.ts +49 -15
  32. package/package.json +105 -89
  33. package/qemu.config +2 -2
  34. package/sandbox.ts +3279 -0
  35. package/scheduler.ts +1 -1
  36. package/server.ts +52 -0
  37. package/tsconfig.json +12 -13
  38. package/virtual.ts +7528 -0
  39. package/workloadlaw.ts +293 -0
  40. package/dist/App.d.ts +0 -5
  41. package/dist/App.js +0 -52
  42. package/dist/Sol/Sol.d.ts +0 -3
  43. package/dist/Sol/Sol.js +0 -46
  44. package/dist/Sol/agentbrowser/agentbrowser.d.ts +0 -9
  45. package/dist/Sol/agentbrowser/agentbrowser.js +0 -121
  46. package/dist/Sol/architecture/architecture.d.ts +0 -9
  47. package/dist/Sol/architecture/architecture.js +0 -93
  48. package/dist/Sol/compute/compute.d.ts +0 -9
  49. package/dist/Sol/compute/compute.js +0 -22
  50. package/dist/Sol/console/console.d.ts +0 -15
  51. package/dist/Sol/console/console.js +0 -292
  52. package/dist/Sol/dashboard/dashboard.d.ts +0 -10
  53. package/dist/Sol/dashboard/dashboard.js +0 -181
  54. package/dist/Sol/docs/docs.d.ts +0 -9
  55. package/dist/Sol/docs/docs.js +0 -28
  56. package/dist/Sol/home/home.d.ts +0 -35
  57. package/dist/Sol/home/home.js +0 -239
  58. package/dist/Sol/integrations/integrations.d.ts +0 -9
  59. package/dist/Sol/integrations/integrations.js +0 -83
  60. package/dist/Sol/intro/intro.d.ts +0 -7
  61. package/dist/Sol/intro/intro.js +0 -102
  62. package/dist/Sol/login/login.d.ts +0 -16
  63. package/dist/Sol/login/login.js +0 -49
  64. package/dist/Sol/notfound/notfound.d.ts +0 -9
  65. package/dist/Sol/notfound/notfound.js +0 -15
  66. package/dist/Sol/onboarding/onboarding.d.ts +0 -25
  67. package/dist/Sol/onboarding/onboarding.js +0 -60
  68. package/dist/Sol/playground/playground.d.ts +0 -9
  69. package/dist/Sol/playground/playground.js +0 -127
  70. package/dist/Sol/register/register.d.ts +0 -16
  71. package/dist/Sol/register/register.js +0 -193
  72. package/dist/Sol/shell/Shell.d.ts +0 -124
  73. package/dist/Sol/shell/Shell.js +0 -335
  74. package/dist/Sol/wingets/ComputeBootladder.d.ts +0 -6
  75. package/dist/Sol/wingets/ComputeBootladder.js +0 -71
  76. package/dist/Sol/wingets/ComputeModalitycatalog.d.ts +0 -7
  77. package/dist/Sol/wingets/ComputeModalitycatalog.js +0 -71
  78. package/dist/Sol/wingets/ConsoleApibadge.d.ts +0 -7
  79. package/dist/Sol/wingets/ConsoleApibadge.js +0 -5
  80. package/dist/Sol/wingets/ConsoleEdgelaw.d.ts +0 -6
  81. package/dist/Sol/wingets/ConsoleEdgelaw.js +0 -36
  82. package/dist/Sol/wingets/ConsoleEventstimeline.d.ts +0 -19
  83. package/dist/Sol/wingets/ConsoleEventstimeline.js +0 -12
  84. package/dist/Sol/wingets/ConsoleSnapshotcontrols.d.ts +0 -8
  85. package/dist/Sol/wingets/ConsoleSnapshotcontrols.js +0 -8
  86. package/dist/Sol/wingets/ConsoleSpecpanel.d.ts +0 -21
  87. package/dist/Sol/wingets/ConsoleSpecpanel.js +0 -75
  88. package/dist/Sol/wingets/ConsoleTerminal.d.ts +0 -22
  89. package/dist/Sol/wingets/ConsoleTerminal.js +0 -77
  90. package/dist/Sol/wingets/DashboardAccountpanel.d.ts +0 -18
  91. package/dist/Sol/wingets/DashboardAccountpanel.js +0 -65
  92. package/dist/Sol/wingets/DashboardAdminpanel.d.ts +0 -6
  93. package/dist/Sol/wingets/DashboardAdminpanel.js +0 -90
  94. package/dist/Sol/wingets/DashboardAuditlog.d.ts +0 -8
  95. package/dist/Sol/wingets/DashboardAuditlog.js +0 -50
  96. package/dist/Sol/wingets/DashboardCreatesandboxform.d.ts +0 -10
  97. package/dist/Sol/wingets/DashboardCreatesandboxform.js +0 -71
  98. package/dist/Sol/wingets/DashboardEventstimeline.d.ts +0 -8
  99. package/dist/Sol/wingets/DashboardEventstimeline.js +0 -83
  100. package/dist/Sol/wingets/DashboardGlobalsandboxestable.d.ts +0 -8
  101. package/dist/Sol/wingets/DashboardGlobalsandboxestable.js +0 -57
  102. package/dist/Sol/wingets/DashboardMeshnodestable.d.ts +0 -8
  103. package/dist/Sol/wingets/DashboardMeshnodestable.js +0 -103
  104. package/dist/Sol/wingets/DashboardSandboxlist.d.ts +0 -10
  105. package/dist/Sol/wingets/DashboardSandboxlist.js +0 -163
  106. package/dist/Sol/wingets/DashboardUserstable.d.ts +0 -8
  107. package/dist/Sol/wingets/DashboardUserstable.js +0 -78
  108. package/dist/Sol/wingets/HomeEntrygate.d.ts +0 -23
  109. package/dist/Sol/wingets/HomeEntrygate.js +0 -73
  110. package/dist/Sol/wingets/HomeMetricstrip.d.ts +0 -9
  111. package/dist/Sol/wingets/HomeMetricstrip.js +0 -4
  112. package/dist/Sol/wingets/HomeRuntimediagram.d.ts +0 -1
  113. package/dist/Sol/wingets/HomeRuntimediagram.js +0 -22
  114. package/dist/Sol/wingets/LoginForm.d.ts +0 -19
  115. package/dist/Sol/wingets/LoginForm.js +0 -141
  116. package/dist/Sol/wingets/RegisterPasswordconfirm.d.ts +0 -13
  117. package/dist/Sol/wingets/RegisterPasswordconfirm.js +0 -16
  118. package/dist/Sol/wingets/RegisterPasswordmeter.d.ts +0 -19
  119. package/dist/Sol/wingets/RegisterPasswordmeter.js +0 -65
  120. package/dist/Sol/wingets/RegisterUsernamerules.d.ts +0 -11
  121. package/dist/Sol/wingets/RegisterUsernamerules.js +0 -16
  122. package/dist/Sol/wingets/index.d.ts +0 -39
  123. package/dist/Sol/wingets/index.js +0 -39
  124. package/dist/alternatives.d.ts +0 -508
  125. package/dist/alternatives.js +0 -950
  126. package/dist/api.d.ts +0 -154
  127. package/dist/api.js +0 -174
  128. package/dist/auth.d.ts +0 -268
  129. package/dist/auth.js +0 -476
  130. package/dist/automation.d.ts +0 -425
  131. package/dist/automation.js +0 -566
  132. package/dist/browser.d.ts +0 -561
  133. package/dist/browser.js +0 -1058
  134. package/dist/capacitor.config.d.ts +0 -45
  135. package/dist/capacitor.config.js +0 -48
  136. package/dist/catalog.d.ts +0 -43
  137. package/dist/catalog.js +0 -44
  138. package/dist/cli.d.ts +0 -16
  139. package/dist/cli.js +0 -168
  140. package/dist/communication.d.ts +0 -181
  141. package/dist/communication.js +0 -376
  142. package/dist/compute.d.ts +0 -1160
  143. package/dist/compute.js +0 -2272
  144. package/dist/dashboardlib.d.ts +0 -58
  145. package/dist/dashboardlib.js +0 -161
  146. package/dist/db.d.ts +0 -569
  147. package/dist/db.js +0 -1080
  148. package/dist/distribution.d.ts +0 -528
  149. package/dist/distribution.js +0 -810
  150. package/dist/drizzle.config.d.ts +0 -20
  151. package/dist/drizzle.config.js +0 -18
  152. package/dist/edgelandes.d.ts +0 -70
  153. package/dist/edgelandes.host.d.ts +0 -26
  154. package/dist/edgelandes.host.js +0 -1089
  155. package/dist/edgelandes.inproc.d.ts +0 -27
  156. package/dist/edgelandes.inproc.js +0 -952
  157. package/dist/edgelandes.js +0 -1133
  158. package/dist/edgelandes.ninety.d.ts +0 -31
  159. package/dist/edgelandes.ninety.js +0 -174
  160. package/dist/edgelandes.virtual.d.ts +0 -25
  161. package/dist/edgelandes.virtual.js +0 -629
  162. package/dist/edgeplane.d.ts +0 -121
  163. package/dist/edgeplane.js +0 -341
  164. package/dist/examplelocaljob.d.ts +0 -1
  165. package/dist/examplelocaljob.js +0 -14
  166. package/dist/execution.d.ts +0 -529
  167. package/dist/execution.js +0 -760
  168. package/dist/family.d.ts +0 -16
  169. package/dist/family.js +0 -42
  170. package/dist/familyurl.d.ts +0 -21
  171. package/dist/familyurl.js +0 -24
  172. package/dist/format.d.ts +0 -18
  173. package/dist/format.js +0 -59
  174. package/dist/foundation.d.ts +0 -172
  175. package/dist/foundation.js +0 -312
  176. package/dist/index.d.ts +0 -735
  177. package/dist/index.js +0 -1020
  178. package/dist/integration.d.ts +0 -235
  179. package/dist/integration.js +0 -228
  180. package/dist/intelligence.d.ts +0 -93
  181. package/dist/intelligence.js +0 -144
  182. package/dist/isolation.d.ts +0 -128
  183. package/dist/isolation.js +0 -95
  184. package/dist/labels.d.ts +0 -665
  185. package/dist/labels.js +0 -707
  186. package/dist/localauth.d.ts +0 -127
  187. package/dist/localauth.js +0 -413
  188. package/dist/media.d.ts +0 -343
  189. package/dist/media.js +0 -985
  190. package/dist/mesh.d.ts +0 -177
  191. package/dist/mesh.js +0 -468
  192. package/dist/modalityregistry.d.ts +0 -109
  193. package/dist/modalityregistry.js +0 -1386
  194. package/dist/modes.d.ts +0 -358
  195. package/dist/modes.js +0 -133
  196. package/dist/onboardingstate.d.ts +0 -79
  197. package/dist/onboardingstate.js +0 -282
  198. package/dist/orchestrator.d.ts +0 -1338
  199. package/dist/orchestrator.js +0 -4310
  200. package/dist/packager/targetcli.js +0 -4
  201. package/dist/paths.d.ts +0 -2
  202. package/dist/paths.js +0 -14
  203. package/dist/performance.d.ts +0 -415
  204. package/dist/performance.js +0 -826
  205. package/dist/quantum.d.ts +0 -809
  206. package/dist/quantum.js +0 -2072
  207. package/dist/render.d.ts +0 -380
  208. package/dist/render.js +0 -1072
  209. package/dist/runall.d.ts +0 -2
  210. package/dist/runall.js +0 -39
  211. package/dist/runtimeprobe.d.ts +0 -4
  212. package/dist/runtimeprobe.js +0 -8
  213. package/dist/sandbox.d.ts +0 -355
  214. package/dist/sandbox.js +0 -1721
  215. package/dist/sandboxenvprofile.d.ts +0 -29
  216. package/dist/sandboxenvprofile.js +0 -89
  217. package/dist/sandboxprofile.d.ts +0 -137
  218. package/dist/sandboxprofile.js +0 -241
  219. package/dist/sandboxqueue.d.ts +0 -108
  220. package/dist/sandboxqueue.js +0 -201
  221. package/dist/sandboxquota.d.ts +0 -121
  222. package/dist/sandboxquota.js +0 -236
  223. package/dist/scheduler.d.ts +0 -595
  224. package/dist/scheduler.js +0 -1258
  225. package/dist/scriptlanes.d.ts +0 -182
  226. package/dist/scriptlanes.js +0 -660
  227. package/dist/scripts.buildengine.d.ts +0 -1
  228. package/dist/scripts.buildengine.js +0 -39
  229. package/dist/scripts.securitygate.d.ts +0 -1
  230. package/dist/scripts.securitygate.js +0 -68
  231. package/dist/scripts.validateflatnative.d.ts +0 -1
  232. package/dist/scripts.validateflatnative.js +0 -72
  233. package/dist/security.d.ts +0 -500
  234. package/dist/security.js +0 -1169
  235. package/dist/seedcatalog.d.ts +0 -13
  236. package/dist/seedcatalog.js +0 -46
  237. package/dist/server.d.ts +0 -20
  238. package/dist/server.js +0 -53
  239. package/dist/speccatalog.d.ts +0 -31
  240. package/dist/speccatalog.js +0 -163
  241. package/dist/tiers.d.ts +0 -1001
  242. package/dist/tiers.js +0 -2169
  243. package/dist/utils.d.ts +0 -2
  244. package/dist/utils.js +0 -5
  245. package/dist/vaulthandoff.d.ts +0 -141
  246. package/dist/vaulthandoff.js +0 -444
  247. package/dist/virtual.d.ts +0 -640
  248. package/dist/virtual.js +0 -1284
  249. package/dist/virtualcpu.d.ts +0 -315
  250. package/dist/virtualcpu.js +0 -1180
  251. package/dist/virtualgpu.d.ts +0 -344
  252. package/dist/virtualgpu.js +0 -1000
  253. package/dist/virtualization.d.ts +0 -606
  254. package/dist/virtualization.js +0 -1186
  255. package/dist/virtualmemory.d.ts +0 -817
  256. package/dist/virtualmemory.js +0 -1795
  257. package/dist/vite.config.d.ts +0 -3
  258. package/dist/vite.config.js +0 -48
  259. package/dist/vitest.config.d.ts +0 -2
  260. package/dist/vitest.config.js +0 -25
  261. package/dist/webserver.d.ts +0 -166
  262. package/dist/webserver.js +0 -2226
  263. package/dist/workloadlaw.d.ts +0 -133
  264. package/dist/workloadlaw.js +0 -193
  265. package/docs/.gitkeep +0 -0
  266. package/docs/architecture.1.8.19.md +0 -76
  267. package/docs/logs/examplesession.json +0 -54
  268. package/docs/repo.analysis.1.8.21.json +0 -2617
  269. package/docs/repo.candidates.1.8.21.jsonl +0 -666
  270. package/docs/repo.selected.1.8.21.json +0 -786
  271. package/manifest.json +0 -20
  272. package/media.ts +0 -1337
  273. package/virtualcpu.ts +0 -1274
  274. package/virtualgpu.ts +0 -1182
  275. package/virtualization.ts +0 -1628
  276. package/virtualmemory.ts +0 -2303
  277. /package/docs/{artifactresearch.1.8.9.md → artifactresearch189.md} +0 -0
  278. /package/docs/{batches.1816.to.1820.md → batches1816to1820.md} +0 -0
  279. /package/docs/{brancharchive.2026.08.18.md → brancharchive20260818.md} +0 -0
  280. /package/docs/{containerplatforms.1.8.17.md → containerplatforms1817.md} +0 -0
  281. /package/docs/{e2ugh.engine.md → e2ughengine.md} +0 -0
  282. /package/docs/{flatbuildresearch.1.8.11.md → flatbuildresearch1811.md} +0 -0
  283. /package/docs/{licenseaudit.1.8.12.md → licenseaudit1812.md} +0 -0
  284. /package/docs/{mobileconversionresearch.1.8.10.md → mobileconversionresearch1810.md} +0 -0
  285. /package/docs/{nativeidentityresearch.1.8.11.md → nativeidentityresearch1811.md} +0 -0
  286. /package/docs/{native.wrappers.md → nativewrappers.md} +0 -0
  287. /package/docs/{planning.1.8.18.md → planning1818.md} +0 -0
  288. /package/docs/{planning.1.8.19.md → planning1819.md} +0 -0
  289. /package/docs/{planning.engine.md → planningengine.md} +0 -0
  290. /package/docs/{releasenotes.1.8.12.md → releasenotes1812.md} +0 -0
  291. /package/docs/{releasenotes.1.8.15.md → releasenotes1815.md} +0 -0
  292. /package/docs/{releasenotes.1.8.16.md → releasenotes1816.md} +0 -0
  293. /package/docs/{releasenotes.1.8.17.md → releasenotes1817.md} +0 -0
  294. /package/docs/{releasenotes.1.8.18.md → releasenotes1818.md} +0 -0
  295. /package/docs/{releasenotes.1.8.19.md → releasenotes1819.md} +0 -0
  296. /package/docs/{reorganization.1.8.8.md → reorganization188.md} +0 -0
  297. /package/docs/{reorganization.1.8.9.md → reorganization189.md} +0 -0
  298. /package/docs/{repo.research.1.8.16.md → reporesearch1816.md} +0 -0
  299. /package/docs/{repo.research.1.8.21.md → reporesearch1821.md} +0 -0
  300. /package/docs/{repo.synthesis.1.8.21.md → reposynthesis1821.md} +0 -0
  301. /package/docs/{research.1.8.18.isolation.md → research1818isolation.md} +0 -0
  302. /package/docs/{research.1.8.19.virtual.browser.md → research1819virtualbrowser.md} +0 -0
  303. /package/docs/{scanningresearch.1.8.11.md → scanningresearch1811.md} +0 -0
  304. /package/docs/{securityaudit.1.8.7.md → securityaudit187.md} +0 -0
  305. /package/docs/{securityreferences.1.8.11.md → securityreferences1811.md} +0 -0
  306. /package/docs/{securityresearch.1.8.11.md → securityresearch1811.md} +0 -0
  307. /package/docs/{signingresearch.1.8.12.md → signingresearch1812.md} +0 -0
  308. /package/docs/{tauri.glib.risk.1.8.11.md → tauriglibrisk1811.md} +0 -0
  309. /package/docs/{todo.1.8.18.md → todo1818.md} +0 -0
  310. /package/docs/{todo.1.8.19.md → todo1819.md} +0 -0
  311. /package/docs/{toolchainresearch.1.8.9.md → toolchainresearch189.md} +0 -0
  312. /package/docs/{web.duplicatecleanup.md → webduplicatecleanup.md} +0 -0
  313. /package/docs/{web.ideas.md → webideas.md} +0 -0
  314. /package/docs/{workflowimprovements.2026.08.19.md → workflowimprovements20260819.md} +0 -0
package/modes.ts ADDED
@@ -0,0 +1,170 @@
1
+ /**
2
+ * modes.ts — target mode resolution and host-neutral deployment contracts.
3
+ *
4
+ * This file is the v2.0.0 grand-merge consolidation of the former nested
5
+ * folders of the repository (modes) into the single
6
+ * root-level domain file of the saddle family standard: one optimized
7
+ * TypeScript file per correlated domain, ordinal sections, JSDoc on every
8
+ * block, intra-domain imports dissolved, cross-domain imports rewritten to
9
+ * ./<domain>.js. Every capability of every source file is preserved here;
10
+ * the pure re-export barrels (none in this domain) folded their surface into this file directly.
11
+ */
12
+
13
+
14
+
15
+ /* ════════════════════════════════════════════════════════════════════ */
16
+ /* Section 1: modes/modes.ts — mode profiles describe paired operation surfaces without changing engine contracts. */
17
+ /* ════════════════════════════════════════════════════════════════════ */
18
+ /**
19
+ * mode profiles describe paired operation surfaces without changing engine contracts.
20
+ */
21
+ const names = ["computer", "library", "application", "browser", "desktop", "mobile", "extension", "cli", "binary", "internet", "physicalfile", "vectorfile", "visible", "headless"];
22
+
23
+ export function modeprofile(options = {}) {
24
+ const enabled = new Set(options.enabled ?? ["library", "cli", "binary"]);
25
+ return Object.fromEntries(names.map((name) => [name, { name, enabled: enabled.has(name), paired: Boolean(options.paired?.includes(name)) }]));
26
+ }
27
+
28
+ export function librarymode(factory) { return { name: "library", start: factory, stop: async () => undefined }; }
29
+ export function climode(run) { return { name: "cli", run }; }
30
+ export function binarymode(run) { return { name: "binary", run }; }
31
+ export function browsermode(adapter) { return { name: "browser", adapter }; }
32
+ export function headlessmode(adapter) { return { name: "headless", adapter }; }
33
+ export function computemode(adapter) { return { name: "computer", adapter }; }
34
+
35
+ /* ════════════════════════════════════════════════════════════════════ */
36
+ /* Section 2: modes/matrix.ts — mode matrix keeps supported execution choices in one grouped contract. */
37
+ /* ════════════════════════════════════════════════════════════════════ */
38
+ /**
39
+ * mode matrix keeps supported execution choices in one grouped contract.
40
+ */
41
+ export const modeaxes = Object.freeze({
42
+ execution: ["library", "application", "browser", "desktopapp", "mobileapp", "extension", "cli", "binary", "computer", "internet"],
43
+ runtime: ["node", "browser", "deno", "bun", "worker", "unknown"],
44
+ memory: ["internal", "external", "physical", "vectorized", "library"],
45
+ file: ["internal", "external", "physical", "vector"],
46
+ dependency: ["internal", "external", "dev"],
47
+ visibility: ["visible", "headless"],
48
+ pair: ["without", "with"]
49
+ });
50
+
51
+ export const operationmodes = Object.freeze(modeaxes.execution.flatMap((execution) => modeaxes.pair.map((pair) => `${execution}${pair}`)));
52
+
53
+ /** Returns true when the matrix contains the requested axis value. */
54
+ export function validatemode(axis, value) { return Boolean(modeaxes[axis]?.includes(value)); }
55
+
56
+ /** Returns a serializable snapshot for documentation and diagnostics. */
57
+ export function modecatalog() { return { axes: Object.fromEntries(Object.entries(modeaxes).map(([key, values]) => [key, [...values]])), operationmodes: [...operationmodes] }; }
58
+
59
+ /* ════════════════════════════════════════════════════════════════════ */
60
+ /* Section 3: modes/resolve.ts — mode resolver selects open defaults while preserving every caller choice. */
61
+ /* ════════════════════════════════════════════════════════════════════ */
62
+ /**
63
+ * mode resolver selects open defaults while preserving every caller choice.
64
+ */
65
+
66
+ /** Resolves an execution profile without starting a process or opening a socket. */
67
+ export function resolvemode(options = {}) {
68
+ const profile = {
69
+ execution: options.execution ?? "library",
70
+ runtime: options.runtime ?? "unknown",
71
+ memory: options.memory ?? "internal",
72
+ file: options.file ?? "internal",
73
+ dependency: options.dependency ?? "internal",
74
+ visibility: options.visibility ?? "headless",
75
+ pair: options.pair ?? "without"
76
+ };
77
+ for (const [axis, value] of Object.entries(profile)) if (!validatemode(axis, value)) throw new TypeError(`unsupported mode ${axis}:${value}`);
78
+ return { ...profile, capabilities: modecapabilities(profile) };
79
+ }
80
+
81
+ /** Returns stable capabilities for adapters and diagnostics. */
82
+ export function modecapabilities(profile) {
83
+ return {
84
+ library: profile.execution === "library" || profile.execution === "application",
85
+ browser: profile.execution === "browser" || profile.execution === "extension" || profile.runtime === "browser" || profile.runtime === "worker",
86
+ cli: profile.execution === "cli" || profile.execution === "binary",
87
+ physicalmemory: profile.memory === "physical",
88
+ vectorizedmemory: profile.memory === "vectorized",
89
+ externalmemory: profile.memory === "external",
90
+ externalfile: profile.file === "external",
91
+ externaldependency: profile.dependency === "external",
92
+ visible: profile.visibility === "visible"
93
+ };
94
+ }
95
+
96
+ /** Returns a stable cross-runtime capability report without starting infrastructure. */
97
+ export function capabilityreport(options = {}) {
98
+ const overrides = { runtime: options.runtime ?? "unknown", memory: options.memory ?? "internal", file: options.file ?? "internal", dependency: options.dependency ?? "internal", visibility: options.visibility ?? "headless", pair: options.pair ?? "without" };
99
+ const profiles = modeaxes.execution.map((execution) => {
100
+ const profile = resolvemode({ ...overrides, execution });
101
+ return { mode: execution, capabilities: profile.capabilities, profile };
102
+ });
103
+ return { version: 1, axes: Object.fromEntries(Object.entries(modeaxes).map(([key, values]) => [key, [...values]])), overrides, profiles, infrastructure: { host: "caller-owned", port: "caller-owned", credentials: "caller-owned", provider: "caller-owned" } };
104
+ }
105
+
106
+ /** Applies one profile to a caller supplied operation. */
107
+ export async function withmode(options, operation) { if (typeof operation !== "function") throw new TypeError("mode operation is required"); return operation(resolvemode(options)); }
108
+
109
+
110
+ /* ════════════════════════════════════════════════════════════════════ */
111
+ /* Section 4: modes/deploy.ts — deploy surface exposes artifact planning without performing provider mutations. */
112
+ /* ════════════════════════════════════════════════════════════════════ */
113
+ /**
114
+ * deploy surface exposes artifact planning without performing provider mutations.
115
+ */
116
+ export { publishplan, registrymanifest } from "./distribution.ts";
117
+ /* the packaging surface pair (surfacemanifest, surfacebundle) moved to
118
+ * devthink with the automation domain (the saddle ownership law, wave a,
119
+ * actions 108-112 — the deploy surface keeps the artifact planning pair
120
+ * the engine owns). */
121
+
122
+ /* ════════════════════════════════════════════════════════════════════ */
123
+ /* Section 5: modes/targets.ts — target profiles keep platform packaging open and describe capability boundaries. */
124
+ /* ════════════════════════════════════════════════════════════════════ */
125
+ /**
126
+ * target profiles keep platform packaging open and describe capability boundaries.
127
+ */
128
+ export const targetprofiles = Object.freeze({
129
+ application: { runtime: "caller", entry: "distpackage/index.js", capabilities: ["memory", "storage", "network"], formats: ["zip", "tarball"] },
130
+ computer: { runtime: "node", entry: "distpackage/index.js", capabilities: ["memory", "storage", "runner"], formats: ["node", "bun", "deno", "singlefile"] },
131
+ desktopapp: { runtime: "tauri", entry: "desktop/src-tauri", capabilities: ["memory", "file", "visible"], formats: ["appimage", "deb", "rpm", "snap", "flatpak", "dmg", "pkg", "exe", "msi", "msix"] },
132
+ mobileapp: { runtime: "capacitor", entry: "index.html", capabilities: ["memory", "network", "visible"], formats: ["apk", "aab", "ipa"] },
133
+ android: { runtime: "capacitor", entry: "android", capabilities: ["memory", "network", "visible"], formats: ["apk", "aab"] },
134
+ ios: { runtime: "capacitor", entry: "ios", capabilities: ["memory", "network", "visible"], formats: ["ipa"] },
135
+ cli: { runtime: "node", entry: "distpackage/cli/main.js", capabilities: ["memory", "storage", "network"], formats: ["node", "bun", "deno", "singlefile", "exe", "deb", "rpm"] },
136
+ binary: { runtime: "caller", entry: "distpackage/cli/main.js", capabilities: ["memory", "storage", "runner"], formats: ["sea", "singlefile", "wasm"] },
137
+ browser: { runtime: "tauri", entry: "desktop/src-tauri", capabilities: ["memory", "network", "visible"], formats: ["html", "pwa", "wasm", "appimage", "deb", "rpm", "dmg", "exe", "msi"] },
138
+ extension: { runtime: "browser", entry: "distpackage/extension/index.js", capabilities: ["browser", "network", "visible"], formats: ["crx", "xpi", "safariextz"] },
139
+ internet: { runtime: "caller", entry: "distpackage/index.js", capabilities: ["network", "webhook", "api"], formats: ["http", "websocket", "grpc", "rest"] },
140
+ web: { runtime: "browser", entry: "index.html", capabilities: ["network", "visible"], formats: ["html", "pwa", "ssg", "ssr", "wasm"] },
141
+ libreoffice: { runtime: "caller", entry: "distpackage/index.js", capabilities: ["file", "network"], formats: ["oxt", "zip"] },
142
+ mcp: { runtime: "caller", entry: "distpackage/adapters/mcpserver.js", capabilities: ["network", "api"], formats: ["stdio", "jsonrpc"] },
143
+ vsix: { runtime: "caller", entry: "distpackage/index.js", capabilities: ["network", "visible"], formats: ["vsix"] },
144
+ container: { runtime: "node", entry: "distpackage/index.js", capabilities: ["memory", "storage", "network"], formats: ["oci", "docker"] }
145
+ });
146
+
147
+ /** Creates a surface target with caller supplied entry and capabilities. */
148
+ export function targetmanifest(target, options = {}) { const profile = targetprofiles[target]; if (!profile) throw new TypeError(`unsupported target: ${target}`); return { target, runtime: options.runtime ?? profile.runtime, entry: options.entry ?? profile.entry, formats: options.formats ?? [...profile.formats], capabilities: options.capabilities ?? [...profile.capabilities], permissions: options.permissions ?? [], metadata: options.metadata ?? {} }; }
149
+
150
+ /** Returns all supported target profiles for documentation and tooling. */
151
+ export function targetcatalog() { return Object.fromEntries(Object.entries(targetprofiles).map(([key, value]) => [key, { ...value, capabilities: [...value.capabilities] }])); }
152
+
153
+
154
+ /* ════════════════════════════════════════════════════════════════════ */
155
+ /* Section 6: the runner-mode ladder — the runtime targets a run asks */
156
+ /* the engine for (wave 3, the engine ownership law: forge and foundry */
157
+ /* consumed the five targets as duplicated twin lists; the ladder */
158
+ /* answers from the saddle owner from this day on, and the apps import */
159
+ /* it through the published library specifier). Zero logic change to */
160
+ /* the lanes above — the section is additive and imports nothing. */
161
+ /* ════════════════════════════════════════════════════════════════════ */
162
+ /**
163
+ * the runner modes of the engine: the runtime targets a run asks for on
164
+ * the saddle boundary — the full virtual machine, the runner host, the
165
+ * node packages lane, the docker lane and the ghcr immutable lane.
166
+ */
167
+ export const runnermodes = ["full-virtual", "runner", "node-packages", "docker", "ghcr"] as const;
168
+
169
+ /** one runner mode of the engine (the runtime target a run asks for). */
170
+ export type RunnerMode = (typeof runnermodes)[number];
package/mttg.config CHANGED
@@ -2,7 +2,7 @@
2
2
  "meta": {
3
3
  "name": "mttg.config",
4
4
  "title": "saddle - MTTG Multi-Tenant Task Groups (cgroups v2 + tenants + transcode) with MTTCG (QEMU TCG) section",
5
- "version": "2.0.127",
5
+ "version": "2.0.154",
6
6
  "date": "2026-08-22",
7
7
  "language": "en",
8
8
  "conceptSeparation": "MTTG = Multi-Tenant Task Groups (cgroup v2 cpu.weight/cpuset/memory/io/pids/hugetlb/rdma + tenants + transcode pipelines). MTTCG = QEMU Multi-Threaded TCG (one host thread per vCPU under TCG). Both live here as DISTINCT sections; MTTCG accel flags also in qemu.config#mttcg.",
package/orchestrator.ts CHANGED
@@ -68,8 +68,8 @@ import { cpus, freemem, networkInterfaces, tmpdir, totalmem } from 'node:os';
68
68
  import path from 'node:path';
69
69
  import process from 'node:process';
70
70
  import { setTimeout as sleep } from 'node:timers/promises';
71
- import type { enginetopicname, enginetopics } from './index.js';
72
- import { enginebus, MetricsStore } from './index.js';
71
+ import type { enginetopicname, enginetopics } from './index.ts';
72
+ import { enginebus, MetricsStore } from './index.ts';
73
73
 
74
74
  /* ------------------------------------------------------------------ */
75
75
  /* context: runtime catalog (verified 2026-08-22) */
@@ -1279,8 +1279,12 @@ class firecrackerruntime extends runtimestrategy {
1279
1279
  * the class also absorbs spawnqemu from the Meta source: the vm plane
1280
1280
  * launches qemu with monitor and qmp unix sockets, a numa pin line,
1281
1281
  * vfio devices for every gpu assignment, extra args from qemu.config
1282
- * and, when the binary is absent (CI), a "sleep 3600" stand-in process
1283
- * so scheduling and lifecycle still exercise end to end.
1282
+ * and — the honest-boot law of the engine-real rung — when the qemu
1283
+ * binary is absent the spawn refuses with ERR_QEMU_ABSENT (the error
1284
+ * names the binary the host must carry) so a vm record never claims
1285
+ * running over a stand-in process: scheduling and lifecycle still
1286
+ * exercise end to end in CI through the argv builders and the create /
1287
+ * destroy planes, never through a faked boot.
1284
1288
  */
1285
1289
  class qemuruntime extends runtimestrategy {
1286
1290
  override readonly name: sandboxruntime = 'qemu';
@@ -1346,13 +1350,24 @@ class qemuruntime extends runtimestrategy {
1346
1350
 
1347
1351
  /**
1348
1352
  * builds the vm plane argv: strategy flags plus the name/uuid, dual
1349
- * unix sockets, virtio balloon, the per-numa bridge netdev, the numa
1350
- * pin line and one vfio-pci device per assigned gpu.
1353
+ * unix sockets, virtio balloon, the numa pin line and one vfio-pci
1354
+ * device per assigned gpu. the netdev answers the honest network law:
1355
+ * the per-numa bridge (br-vhe-N) rides when the interface exists on
1356
+ * the host (the privileged deployments the bridge plane owns), and a
1357
+ * host without the interface rides user-mode networking (slirp) — a
1358
+ * real qemu network mode that needs no privilege — so the argv a host
1359
+ * without the bridge answers is a bootable argv, never a bridge the
1360
+ * kernel would refuse.
1351
1361
  */
1352
1362
  buildvmcommand(vm: vmrecord, assignments: readonly gpuassignment[]): readonly string[] {
1353
1363
  const kvm = kvmavailable();
1354
1364
  const accel = vm.accel === 'kvm' && kvm ? 'kvm' : 'tcg,thread=multi,tb-size=1024';
1355
1365
  const sockets = this.socketsfor(vm.id);
1366
+ const bridgename = `br-vhe-${vm.numanode}`;
1367
+ const bridgeonhost = existsSync(`/sys/class/net/${bridgename}`);
1368
+ const netdev = bridgeonhost
1369
+ ? `bridge,br=${bridgename},id=net0`
1370
+ : 'user,id=net0';
1356
1371
  const args: string[] = [
1357
1372
  vm.qemubinary,
1358
1373
  '-machine',
@@ -1372,7 +1387,7 @@ class qemuruntime extends runtimestrategy {
1372
1387
  '-device',
1373
1388
  'virtio-balloon-pci,id=balloon0',
1374
1389
  '-netdev',
1375
- `bridge,br=br-vhe-${vm.numanode},id=net0`,
1390
+ netdev,
1376
1391
  '-device',
1377
1392
  'virtio-net-pci,netdev=net0',
1378
1393
  '-display',
@@ -1394,8 +1409,12 @@ class qemuruntime extends runtimestrategy {
1394
1409
 
1395
1410
  /**
1396
1411
  * spawns qemu for a vm record; when the binary does not exist the
1397
- * method spawns "sleep 3600" instead so CI environments without qemu
1398
- * still run the scheduling and lifecycle paths (spawnqemu merge).
1412
+ * method refuses with ERR_QEMU_ABSENT — the honest-boot law of the
1413
+ * engine-real rung: a host without the qemu binary never answers a
1414
+ * stand-in process, the vm record never claims running over a sleep
1415
+ * (startvm catches the refusal, marks the vm failed and publishes the
1416
+ * error, so CI exercises the argv builders and the create / destroy
1417
+ * planes instead of a faked boot).
1399
1418
  */
1400
1419
  async spawn(
1401
1420
  vm: vmrecord,
@@ -1404,14 +1423,23 @@ class qemuruntime extends runtimestrategy {
1404
1423
  ): Promise<qemuprocess> {
1405
1424
  try {
1406
1425
  const sockets = this.socketsfor(vm.id);
1407
- const argv = [...this.buildvmcommand(vm, assignments), '-daemonize'];
1426
+ // the socket seats must exist before the guest opens its servers —
1427
+ // qemu creates the socket files itself, never the parent directory
1428
+ mkdirSync(path.dirname(sockets.qmp), { recursive: true });
1429
+ // the foreground law of the honest-boot rung: the tracked child is
1430
+ // the process that lives as long as the vm — the daemonize flag
1431
+ // would fork the daemon and exit the parent at once (the vm would
1432
+ // read stopped over a live machine), so the spawn rides the
1433
+ // foreground argv the exit callback can own
1434
+ const argv = this.buildvmcommand(vm, assignments);
1408
1435
  const [bin, ...rest] = argv;
1409
- let child: ChildProcess;
1410
- if (existsSync(bin)) {
1411
- child = spawn(bin, rest, { stdio: 'ignore', detached: false });
1412
- } else {
1413
- child = spawn('sleep', ['3600'], { stdio: 'ignore', detached: false });
1436
+ if (!existsSync(bin)) {
1437
+ throw new orchestratorerror(
1438
+ `qemu spawn refused for ${vm.id}: the binary ${bin} is absent from the engine host (the honest-boot law — a vm never runs over a stand-in process)`,
1439
+ 'ERR_QEMU_ABSENT',
1440
+ );
1414
1441
  }
1442
+ const child: ChildProcess = spawn(bin, rest, { stdio: 'ignore', detached: false });
1415
1443
  const pid = child.pid ?? randomInt(1000, 11000);
1416
1444
  const processinfo: qemuprocess = {
1417
1445
  vmid: vm.id,
@@ -1426,6 +1454,12 @@ class qemuruntime extends runtimestrategy {
1426
1454
  });
1427
1455
  return processinfo;
1428
1456
  } catch (error) {
1457
+ // the honest-boot refusal rides through untouched — the code the
1458
+ // law answers (ERR_QEMU_ABSENT) is the code startvm and the vm
1459
+ // record read, never the generic spawn wrap
1460
+ if (error instanceof orchestratorerror) {
1461
+ throw error;
1462
+ }
1429
1463
  throw new orchestratorerror(
1430
1464
  `qemu spawn failed for ${vm.id}: ${errormessage(error)}`,
1431
1465
  'ERR_QEMU_SPAWN',