@wenathlan/saddle 2.0.153 → 2.0.155

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 (307) hide show
  1. package/Dockerfile +139 -55
  2. package/README.md +58 -59
  3. package/browser.ts +482 -0
  4. package/cli.ts +274 -0
  5. package/distribution.ts +731 -0
  6. package/docker.config +29 -8
  7. package/docs/artifactavailability.md +2 -2
  8. package/docs/browser.md +18 -1
  9. package/docs/{containerplatforms.2.1.0.md → containerplatforms210.md} +1 -1
  10. package/docs/{documentmap.1.8.12.md → documentmap1812.md} +1 -1
  11. package/docs/extension.md +13 -2
  12. package/docs/libraryapi.md +1 -1
  13. package/docs/{ninety.modalities.md → ninetymodalities.md} +87 -4
  14. package/docs/{planning.ninety.md → planningninety.md} +6 -6
  15. package/docs/{releasenotes.1.8.13.md → releasenotes1813.md} +2 -2
  16. package/docs/{releasenotes.1.8.14.md → releasenotes1814.md} +1 -1
  17. package/docs/{repo.synthesis.1.8.16.md → reposynthesis1816.md} +1 -1
  18. package/docs/todo.md +2 -2
  19. package/docs/{todo.1.8.15.md → todo1815.md} +1 -1
  20. package/docs/{todo.1.8.16.md → todo1816.md} +5 -5
  21. package/execution.ts +677 -0
  22. package/foundation.ts +314 -0
  23. package/index.ts +35 -27
  24. package/isolation.ts +84 -0
  25. package/modes.ts +170 -0
  26. package/mttg.config +1 -1
  27. package/orchestrator.ts +49 -15
  28. package/package.json +90 -75
  29. package/qemu.config +2 -2
  30. package/sandbox.ts +2094 -0
  31. package/scheduler.ts +1 -1
  32. package/server.ts +52 -0
  33. package/tsconfig.json +11 -12
  34. package/virtual.ts +1105 -0
  35. package/virtualgpu.ts +1 -1
  36. package/virtualization.ts +1 -1
  37. package/workloadlaw.ts +293 -0
  38. package/dist/App.d.ts +0 -5
  39. package/dist/App.js +0 -52
  40. package/dist/Sol/Sol.d.ts +0 -3
  41. package/dist/Sol/Sol.js +0 -46
  42. package/dist/Sol/agentbrowser/agentbrowser.d.ts +0 -9
  43. package/dist/Sol/agentbrowser/agentbrowser.js +0 -121
  44. package/dist/Sol/architecture/architecture.d.ts +0 -9
  45. package/dist/Sol/architecture/architecture.js +0 -93
  46. package/dist/Sol/compute/compute.d.ts +0 -9
  47. package/dist/Sol/compute/compute.js +0 -22
  48. package/dist/Sol/console/console.d.ts +0 -15
  49. package/dist/Sol/console/console.js +0 -292
  50. package/dist/Sol/dashboard/dashboard.d.ts +0 -10
  51. package/dist/Sol/dashboard/dashboard.js +0 -181
  52. package/dist/Sol/docs/docs.d.ts +0 -9
  53. package/dist/Sol/docs/docs.js +0 -28
  54. package/dist/Sol/home/home.d.ts +0 -35
  55. package/dist/Sol/home/home.js +0 -239
  56. package/dist/Sol/integrations/integrations.d.ts +0 -9
  57. package/dist/Sol/integrations/integrations.js +0 -83
  58. package/dist/Sol/intro/intro.d.ts +0 -7
  59. package/dist/Sol/intro/intro.js +0 -102
  60. package/dist/Sol/login/login.d.ts +0 -16
  61. package/dist/Sol/login/login.js +0 -49
  62. package/dist/Sol/notfound/notfound.d.ts +0 -9
  63. package/dist/Sol/notfound/notfound.js +0 -15
  64. package/dist/Sol/onboarding/onboarding.d.ts +0 -25
  65. package/dist/Sol/onboarding/onboarding.js +0 -60
  66. package/dist/Sol/playground/playground.d.ts +0 -9
  67. package/dist/Sol/playground/playground.js +0 -127
  68. package/dist/Sol/register/register.d.ts +0 -16
  69. package/dist/Sol/register/register.js +0 -193
  70. package/dist/Sol/shell/Shell.d.ts +0 -124
  71. package/dist/Sol/shell/Shell.js +0 -335
  72. package/dist/Sol/wingets/ComputeBootladder.d.ts +0 -6
  73. package/dist/Sol/wingets/ComputeBootladder.js +0 -71
  74. package/dist/Sol/wingets/ComputeModalitycatalog.d.ts +0 -7
  75. package/dist/Sol/wingets/ComputeModalitycatalog.js +0 -71
  76. package/dist/Sol/wingets/ConsoleApibadge.d.ts +0 -7
  77. package/dist/Sol/wingets/ConsoleApibadge.js +0 -5
  78. package/dist/Sol/wingets/ConsoleEdgelaw.d.ts +0 -6
  79. package/dist/Sol/wingets/ConsoleEdgelaw.js +0 -36
  80. package/dist/Sol/wingets/ConsoleEventstimeline.d.ts +0 -19
  81. package/dist/Sol/wingets/ConsoleEventstimeline.js +0 -12
  82. package/dist/Sol/wingets/ConsoleSnapshotcontrols.d.ts +0 -8
  83. package/dist/Sol/wingets/ConsoleSnapshotcontrols.js +0 -8
  84. package/dist/Sol/wingets/ConsoleSpecpanel.d.ts +0 -21
  85. package/dist/Sol/wingets/ConsoleSpecpanel.js +0 -75
  86. package/dist/Sol/wingets/ConsoleTerminal.d.ts +0 -22
  87. package/dist/Sol/wingets/ConsoleTerminal.js +0 -77
  88. package/dist/Sol/wingets/DashboardAccountpanel.d.ts +0 -18
  89. package/dist/Sol/wingets/DashboardAccountpanel.js +0 -65
  90. package/dist/Sol/wingets/DashboardAdminpanel.d.ts +0 -6
  91. package/dist/Sol/wingets/DashboardAdminpanel.js +0 -90
  92. package/dist/Sol/wingets/DashboardAuditlog.d.ts +0 -8
  93. package/dist/Sol/wingets/DashboardAuditlog.js +0 -50
  94. package/dist/Sol/wingets/DashboardCreatesandboxform.d.ts +0 -10
  95. package/dist/Sol/wingets/DashboardCreatesandboxform.js +0 -71
  96. package/dist/Sol/wingets/DashboardEventstimeline.d.ts +0 -8
  97. package/dist/Sol/wingets/DashboardEventstimeline.js +0 -83
  98. package/dist/Sol/wingets/DashboardGlobalsandboxestable.d.ts +0 -8
  99. package/dist/Sol/wingets/DashboardGlobalsandboxestable.js +0 -57
  100. package/dist/Sol/wingets/DashboardMeshnodestable.d.ts +0 -8
  101. package/dist/Sol/wingets/DashboardMeshnodestable.js +0 -103
  102. package/dist/Sol/wingets/DashboardSandboxlist.d.ts +0 -10
  103. package/dist/Sol/wingets/DashboardSandboxlist.js +0 -163
  104. package/dist/Sol/wingets/DashboardUserstable.d.ts +0 -8
  105. package/dist/Sol/wingets/DashboardUserstable.js +0 -78
  106. package/dist/Sol/wingets/HomeEntrygate.d.ts +0 -23
  107. package/dist/Sol/wingets/HomeEntrygate.js +0 -73
  108. package/dist/Sol/wingets/HomeMetricstrip.d.ts +0 -9
  109. package/dist/Sol/wingets/HomeMetricstrip.js +0 -4
  110. package/dist/Sol/wingets/HomeRuntimediagram.d.ts +0 -1
  111. package/dist/Sol/wingets/HomeRuntimediagram.js +0 -22
  112. package/dist/Sol/wingets/LoginForm.d.ts +0 -19
  113. package/dist/Sol/wingets/LoginForm.js +0 -141
  114. package/dist/Sol/wingets/RegisterPasswordconfirm.d.ts +0 -13
  115. package/dist/Sol/wingets/RegisterPasswordconfirm.js +0 -16
  116. package/dist/Sol/wingets/RegisterPasswordmeter.d.ts +0 -19
  117. package/dist/Sol/wingets/RegisterPasswordmeter.js +0 -65
  118. package/dist/Sol/wingets/RegisterUsernamerules.d.ts +0 -11
  119. package/dist/Sol/wingets/RegisterUsernamerules.js +0 -16
  120. package/dist/Sol/wingets/index.d.ts +0 -39
  121. package/dist/Sol/wingets/index.js +0 -39
  122. package/dist/alternatives.d.ts +0 -508
  123. package/dist/alternatives.js +0 -950
  124. package/dist/api.d.ts +0 -154
  125. package/dist/api.js +0 -174
  126. package/dist/auth.d.ts +0 -268
  127. package/dist/auth.js +0 -476
  128. package/dist/automation.d.ts +0 -425
  129. package/dist/automation.js +0 -566
  130. package/dist/browser.d.ts +0 -561
  131. package/dist/browser.js +0 -1058
  132. package/dist/capacitor.config.d.ts +0 -45
  133. package/dist/capacitor.config.js +0 -48
  134. package/dist/catalog.d.ts +0 -43
  135. package/dist/catalog.js +0 -44
  136. package/dist/cli.d.ts +0 -16
  137. package/dist/cli.js +0 -168
  138. package/dist/communication.d.ts +0 -181
  139. package/dist/communication.js +0 -376
  140. package/dist/compute.d.ts +0 -1160
  141. package/dist/compute.js +0 -2272
  142. package/dist/dashboardlib.d.ts +0 -58
  143. package/dist/dashboardlib.js +0 -161
  144. package/dist/db.d.ts +0 -569
  145. package/dist/db.js +0 -1080
  146. package/dist/distribution.d.ts +0 -528
  147. package/dist/distribution.js +0 -810
  148. package/dist/drizzle.config.d.ts +0 -20
  149. package/dist/drizzle.config.js +0 -18
  150. package/dist/edgelandes.d.ts +0 -70
  151. package/dist/edgelandes.host.d.ts +0 -26
  152. package/dist/edgelandes.host.js +0 -1089
  153. package/dist/edgelandes.inproc.d.ts +0 -27
  154. package/dist/edgelandes.inproc.js +0 -952
  155. package/dist/edgelandes.js +0 -1133
  156. package/dist/edgelandes.ninety.d.ts +0 -31
  157. package/dist/edgelandes.ninety.js +0 -174
  158. package/dist/edgelandes.virtual.d.ts +0 -25
  159. package/dist/edgelandes.virtual.js +0 -629
  160. package/dist/edgeplane.d.ts +0 -114
  161. package/dist/edgeplane.js +0 -305
  162. package/dist/examplelocaljob.d.ts +0 -1
  163. package/dist/examplelocaljob.js +0 -14
  164. package/dist/execution.d.ts +0 -529
  165. package/dist/execution.js +0 -760
  166. package/dist/family.d.ts +0 -16
  167. package/dist/family.js +0 -42
  168. package/dist/familyurl.d.ts +0 -21
  169. package/dist/familyurl.js +0 -24
  170. package/dist/format.d.ts +0 -18
  171. package/dist/format.js +0 -59
  172. package/dist/foundation.d.ts +0 -172
  173. package/dist/foundation.js +0 -312
  174. package/dist/index.d.ts +0 -735
  175. package/dist/index.js +0 -1020
  176. package/dist/integration.d.ts +0 -235
  177. package/dist/integration.js +0 -228
  178. package/dist/intelligence.d.ts +0 -93
  179. package/dist/intelligence.js +0 -144
  180. package/dist/isolation.d.ts +0 -128
  181. package/dist/isolation.js +0 -95
  182. package/dist/labels.d.ts +0 -665
  183. package/dist/labels.js +0 -751
  184. package/dist/localauth.d.ts +0 -127
  185. package/dist/localauth.js +0 -413
  186. package/dist/media.d.ts +0 -343
  187. package/dist/media.js +0 -985
  188. package/dist/mesh.d.ts +0 -177
  189. package/dist/mesh.js +0 -468
  190. package/dist/modalityregistry.d.ts +0 -109
  191. package/dist/modalityregistry.js +0 -1386
  192. package/dist/modes.d.ts +0 -358
  193. package/dist/modes.js +0 -133
  194. package/dist/onboardingstate.d.ts +0 -79
  195. package/dist/onboardingstate.js +0 -282
  196. package/dist/orchestrator.d.ts +0 -1338
  197. package/dist/orchestrator.js +0 -4310
  198. package/dist/packager/targetcli.js +0 -4
  199. package/dist/paths.d.ts +0 -2
  200. package/dist/paths.js +0 -14
  201. package/dist/performance.d.ts +0 -415
  202. package/dist/performance.js +0 -826
  203. package/dist/quantum.d.ts +0 -809
  204. package/dist/quantum.js +0 -2072
  205. package/dist/render.d.ts +0 -380
  206. package/dist/render.js +0 -1072
  207. package/dist/runall.d.ts +0 -2
  208. package/dist/runall.js +0 -39
  209. package/dist/runtimeprobe.d.ts +0 -4
  210. package/dist/runtimeprobe.js +0 -8
  211. package/dist/sandbox.d.ts +0 -355
  212. package/dist/sandbox.js +0 -1721
  213. package/dist/sandboxenvprofile.d.ts +0 -29
  214. package/dist/sandboxenvprofile.js +0 -89
  215. package/dist/sandboxprofile.d.ts +0 -137
  216. package/dist/sandboxprofile.js +0 -241
  217. package/dist/sandboxqueue.d.ts +0 -108
  218. package/dist/sandboxqueue.js +0 -201
  219. package/dist/sandboxquota.d.ts +0 -121
  220. package/dist/sandboxquota.js +0 -236
  221. package/dist/scheduler.d.ts +0 -595
  222. package/dist/scheduler.js +0 -1258
  223. package/dist/scriptlanes.d.ts +0 -182
  224. package/dist/scriptlanes.js +0 -660
  225. package/dist/scripts.buildengine.d.ts +0 -1
  226. package/dist/scripts.buildengine.js +0 -39
  227. package/dist/scripts.securitygate.d.ts +0 -1
  228. package/dist/scripts.securitygate.js +0 -68
  229. package/dist/scripts.validateflatnative.d.ts +0 -1
  230. package/dist/scripts.validateflatnative.js +0 -72
  231. package/dist/security.d.ts +0 -500
  232. package/dist/security.js +0 -1169
  233. package/dist/seedcatalog.d.ts +0 -13
  234. package/dist/seedcatalog.js +0 -46
  235. package/dist/server.d.ts +0 -20
  236. package/dist/server.js +0 -53
  237. package/dist/speccatalog.d.ts +0 -31
  238. package/dist/speccatalog.js +0 -163
  239. package/dist/tiers.d.ts +0 -1001
  240. package/dist/tiers.js +0 -2169
  241. package/dist/utils.d.ts +0 -2
  242. package/dist/utils.js +0 -5
  243. package/dist/vaulthandoff.d.ts +0 -141
  244. package/dist/vaulthandoff.js +0 -444
  245. package/dist/virtual.d.ts +0 -640
  246. package/dist/virtual.js +0 -1284
  247. package/dist/virtualcpu.d.ts +0 -315
  248. package/dist/virtualcpu.js +0 -1180
  249. package/dist/virtualgpu.d.ts +0 -344
  250. package/dist/virtualgpu.js +0 -1000
  251. package/dist/virtualization.d.ts +0 -606
  252. package/dist/virtualization.js +0 -1186
  253. package/dist/virtualmemory.d.ts +0 -817
  254. package/dist/virtualmemory.js +0 -1795
  255. package/dist/vite.config.d.ts +0 -3
  256. package/dist/vite.config.js +0 -43
  257. package/dist/vitest.config.d.ts +0 -2
  258. package/dist/vitest.config.js +0 -25
  259. package/dist/webserver.d.ts +0 -166
  260. package/dist/webserver.js +0 -2226
  261. package/dist/workloadlaw.d.ts +0 -133
  262. package/dist/workloadlaw.js +0 -193
  263. package/manifest.json +0 -20
  264. package/media.ts +0 -1337
  265. /package/docs/{architecture.1.8.19.md → architecture1819.md} +0 -0
  266. /package/docs/{architecture.1.8.19.mmd → architecture1819.mmd} +0 -0
  267. /package/docs/{artifactresearch.1.8.9.md → artifactresearch189.md} +0 -0
  268. /package/docs/{batches.1816.to.1820.md → batches1816to1820.md} +0 -0
  269. /package/docs/{brancharchive.2026.08.18.md → brancharchive20260818.md} +0 -0
  270. /package/docs/{containerplatforms.1.8.17.md → containerplatforms1817.md} +0 -0
  271. /package/docs/{e2ugh.engine.md → e2ughengine.md} +0 -0
  272. /package/docs/{flatbuildresearch.1.8.11.md → flatbuildresearch1811.md} +0 -0
  273. /package/docs/{licenseaudit.1.8.12.md → licenseaudit1812.md} +0 -0
  274. /package/docs/{mobileconversionresearch.1.8.10.md → mobileconversionresearch1810.md} +0 -0
  275. /package/docs/{nativeidentityresearch.1.8.11.md → nativeidentityresearch1811.md} +0 -0
  276. /package/docs/{native.wrappers.md → nativewrappers.md} +0 -0
  277. /package/docs/{planning.1.8.18.md → planning1818.md} +0 -0
  278. /package/docs/{planning.1.8.19.md → planning1819.md} +0 -0
  279. /package/docs/{planning.engine.md → planningengine.md} +0 -0
  280. /package/docs/{releasenotes.1.8.12.md → releasenotes1812.md} +0 -0
  281. /package/docs/{releasenotes.1.8.15.md → releasenotes1815.md} +0 -0
  282. /package/docs/{releasenotes.1.8.16.md → releasenotes1816.md} +0 -0
  283. /package/docs/{releasenotes.1.8.17.md → releasenotes1817.md} +0 -0
  284. /package/docs/{releasenotes.1.8.18.md → releasenotes1818.md} +0 -0
  285. /package/docs/{releasenotes.1.8.19.md → releasenotes1819.md} +0 -0
  286. /package/docs/{reorganization.1.8.8.md → reorganization188.md} +0 -0
  287. /package/docs/{reorganization.1.8.9.md → reorganization189.md} +0 -0
  288. /package/docs/{repo.analysis.1.8.21.json → repoanalysis1821.json} +0 -0
  289. /package/docs/{repo.candidates.1.8.21.jsonl → repocandidates1821.jsonl} +0 -0
  290. /package/docs/{repo.research.1.8.16.md → reporesearch1816.md} +0 -0
  291. /package/docs/{repo.research.1.8.21.md → reporesearch1821.md} +0 -0
  292. /package/docs/{repo.selected.1.8.21.json → reposelected1821.json} +0 -0
  293. /package/docs/{repo.synthesis.1.8.21.md → reposynthesis1821.md} +0 -0
  294. /package/docs/{research.1.8.18.isolation.md → research1818isolation.md} +0 -0
  295. /package/docs/{research.1.8.19.virtual.browser.md → research1819virtualbrowser.md} +0 -0
  296. /package/docs/{scanningresearch.1.8.11.md → scanningresearch1811.md} +0 -0
  297. /package/docs/{securityaudit.1.8.7.md → securityaudit187.md} +0 -0
  298. /package/docs/{securityreferences.1.8.11.md → securityreferences1811.md} +0 -0
  299. /package/docs/{securityresearch.1.8.11.md → securityresearch1811.md} +0 -0
  300. /package/docs/{signingresearch.1.8.12.md → signingresearch1812.md} +0 -0
  301. /package/docs/{tauri.glib.risk.1.8.11.md → tauriglibrisk1811.md} +0 -0
  302. /package/docs/{todo.1.8.18.md → todo1818.md} +0 -0
  303. /package/docs/{todo.1.8.19.md → todo1819.md} +0 -0
  304. /package/docs/{toolchainresearch.1.8.9.md → toolchainresearch189.md} +0 -0
  305. /package/docs/{web.duplicatecleanup.md → webduplicatecleanup.md} +0 -0
  306. /package/docs/{web.ideas.md → webideas.md} +0 -0
  307. /package/docs/{workflowimprovements.2026.08.19.md → workflowimprovements20260819.md} +0 -0
@@ -1,21 +0,0 @@
1
- /** the sandbox specification selection held by the console page. */
2
- export type SandboxSpecSelection = {
3
- model: string;
4
- quotamb: number;
5
- vcpus: number;
6
- ramgb: number;
7
- gpu: string;
8
- mig: string;
9
- };
10
- type SpecPanelProps = {
11
- spec: SandboxSpecSelection;
12
- onChange: (patch: Partial<SandboxSpecSelection>) => void;
13
- disabled: boolean;
14
- };
15
- /**
16
- * the sandbox specification panel: every control keeps the 44px touch
17
- * target of the absorbed static page and disables while a sandbox is
18
- * booting or running.
19
- */
20
- export default function SpecPanel({ spec, onChange, disabled }: SpecPanelProps): import("react").JSX.Element;
21
- export {};
@@ -1,75 +0,0 @@
1
- import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- // Spec panel: faithful absorption of the console.html spec controls — cpu
3
- // model, workspace quota, vcpus slider, ram slider + exact numeric field,
4
- // gpu model and mig profile, each with the live catalog hints.
5
- import { useEffect, useRef, useState } from 'react';
6
- import { label, labelfill } from '../../labels.ts';
7
- import { cpudata, gpudata } from '../../sandbox.ts';
8
- /** workspace quota options in MiB (16 selected by default). */
9
- const quotaoptions = [4, 16, 64, 256];
10
- /** the mig slicing profile values of the 96 gb-class virtual device. */
11
- const migvalues = ['off', '1g.24gb', '2g.48gb', '4g.96gb'];
12
- /** the mig profile labels of the store, keyed by the profile value. */
13
- const miglabels = {
14
- off: 'console.spec.migOff',
15
- '1g.24gb': 'console.spec.mig1g',
16
- '2g.48gb': 'console.spec.mig2g',
17
- '4g.96gb': 'console.spec.mig4g',
18
- };
19
- /** the mig profile options: the value stays data, the label rides the store. */
20
- function migoptions() {
21
- return migvalues.map((value) => ({ value, label: label(miglabels[value]) }));
22
- }
23
- /** ram ceiling shared by the slider and the exact numeric field. */
24
- const ramceiling = 18432;
25
- /**
26
- * the sandbox specification panel: every control keeps the 44px touch
27
- * target of the absorbed static page and disables while a sandbox is
28
- * booting or running.
29
- */
30
- export default function SpecPanel({ spec, onChange, disabled }) {
31
- const ramnumref = useRef(null);
32
- const [ramdraft, setRamdraft] = useState(String(spec.ramgb));
33
- /** the numeric field follows the slider unless the operator is typing. */
34
- useEffect(() => {
35
- if (document.activeElement !== ramnumref.current) {
36
- setRamdraft(String(spec.ramgb));
37
- }
38
- }, [spec.ramgb]);
39
- /** the exact ram field clamps to the 1..18432 gb plan range. */
40
- const onramnuminput = (raw) => {
41
- setRamdraft(raw);
42
- const clamped = Math.max(1, Math.min(ramceiling, Number(raw) || 1));
43
- onChange({ ramgb: clamped });
44
- };
45
- const cpu = cpudata.find((entry) => entry.model === spec.model);
46
- const gpu = gpudata.find((entry) => entry.id === spec.gpu);
47
- const cpuhint = cpu
48
- ? labelfill('console.spec.cpuHint', {
49
- arch: cpu.microarch,
50
- memory: cpu.memorytype,
51
- max: String(cpu.maxmemorygb),
52
- watts: String(cpu.tdpwatts),
53
- })
54
- : '';
55
- const gpuhint = gpu
56
- ? labelfill('console.spec.gpuHint', {
57
- arch: gpu.arch,
58
- bandwidth: String(gpu.bandwidthgbs),
59
- mig: gpu.mig ? label('console.spec.migSupported') : label('console.spec.migEmulated'),
60
- })
61
- : '';
62
- return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "spec-field", children: [_jsx("label", { htmlFor: "cpusel", children: label('console.spec.cpuLabel') }), _jsx("select", { className: "spec-select", id: "cpusel", disabled: disabled, "aria-label": label('console.spec.cpuAria'), value: spec.model, onChange: (event) => onChange({ model: event.target.value }), children: cpudata.map((entry) => (_jsx("option", { value: entry.model, children: labelfill('console.spec.cpuOption', {
63
- model: entry.model,
64
- cores: String(entry.cores),
65
- threads: String(entry.threads),
66
- }) }, entry.model))) }), _jsxs("div", { className: "spec-field", children: [_jsx("label", { htmlFor: "quotasel", children: label('console.spec.quotaLabel') }), _jsx("select", { className: "spec-select", id: "quotasel", disabled: disabled, "aria-label": label('console.spec.quotaAria'), value: String(spec.quotamb), onChange: (event) => onChange({ quotamb: Number(event.target.value) }), children: quotaoptions.map((quota) => (_jsx("option", { value: String(quota), children: labelfill('console.spec.quotaOption', { quota: String(quota) }) }, quota))) })] }), _jsx("p", { className: "spec-hint", children: cpuhint })] }), _jsxs("div", { className: "spec-field", children: [_jsxs("label", { htmlFor: "vcpurange", children: [label('console.spec.vcpusLabel'), " ", _jsx("span", { className: "spec-val", children: spec.vcpus })] }), _jsx("input", { className: "spec-range", id: "vcpurange", type: "range", min: 1, max: 192, value: spec.vcpus, disabled: disabled, "aria-label": label('console.spec.vcpusAria'), style: {
67
- '--r3-meter': `${Math.max(2, Math.min(100, (spec.vcpus / 192) * 100))}%`,
68
- }, onChange: (event) => onChange({ vcpus: Number(event.target.value) }) })] }), _jsxs("div", { className: "spec-field", children: [_jsxs("label", { htmlFor: "ramrange", children: [label('console.spec.ramLabel'), " ", _jsx("span", { className: "spec-val", children: spec.ramgb })] }), _jsx("input", { className: "spec-range", id: "ramrange", type: "range", min: 1, max: ramceiling, value: spec.ramgb, disabled: disabled, "aria-label": label('console.spec.ramAria'), style: {
69
- '--r3-meter': `${Math.max(2, Math.min(100, (spec.ramgb / ramceiling) * 100))}%`,
70
- }, onChange: (event) => onChange({ ramgb: Number(event.target.value) }) }), _jsx("label", { htmlFor: "ramnum", children: label('console.spec.ramExactLabel') }), _jsx("input", { ref: ramnumref, className: "spec-select spec-number", id: "ramnum", type: "number", min: 1, max: ramceiling, value: ramdraft, disabled: disabled, "aria-label": label('console.spec.ramExactAria'), onChange: (event) => onramnuminput(event.target.value) })] }), _jsxs("div", { className: "spec-field", children: [_jsx("label", { htmlFor: "gpusel", children: label('console.spec.gpuLabel') }), _jsx("select", { className: "spec-select", id: "gpusel", disabled: disabled, "aria-label": label('console.spec.gpuAria'), value: spec.gpu, onChange: (event) => onChange({ gpu: event.target.value }), children: gpudata.map((entry) => (_jsx("option", { value: entry.id, children: labelfill('console.spec.gpuOption', {
71
- name: entry.name,
72
- memtype: entry.memtype,
73
- gb: String(entry.vrammib / 1024),
74
- }) }, entry.id))) }), _jsx("p", { className: "spec-hint", children: gpuhint })] }), _jsxs("div", { className: "spec-field", children: [_jsx("label", { htmlFor: "migsel", children: label('console.spec.migLabel') }), _jsx("select", { className: "spec-select", id: "migsel", disabled: disabled, "aria-label": label('console.spec.migAria'), value: spec.mig, onChange: (event) => onChange({ mig: event.target.value }), children: migoptions().map((option) => (_jsx("option", { value: option.value, children: option.label }, option.value))) })] })] }));
75
- }
@@ -1,22 +0,0 @@
1
- /** one rendered output row; cls mirrors the static page row classes. */
2
- export type TerminalRow = {
3
- id: number;
4
- text: string;
5
- cls: string;
6
- };
7
- /** the terminal lifecycle label shown in the bar. */
8
- export type TerminalState = 'halted' | 'booting' | 'running' | 'stopped';
9
- type TerminalProps = {
10
- rows: TerminalRow[];
11
- prompt: string;
12
- state: TerminalState;
13
- enabled: boolean;
14
- oncommand: (command: string) => void;
15
- };
16
- /**
17
- * the virtual container terminal: a dark log pane (role=log, polite
18
- * aria-live), a command input with history browsing and tab completion,
19
- * and the lifecycle label in the bar.
20
- */
21
- export default function Terminal({ rows, prompt, state, enabled, oncommand }: TerminalProps): import("react").JSX.Element;
22
- export {};
@@ -1,77 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- // Terminal: faithful absorption of the console.html terminal — animated boot
3
- // output (rows appended by the console page), command history with the arrow
4
- // keys, tab completion over the sandbox command list, the live prompt and
5
- // the focus-on-click output pane.
6
- import { useEffect, useRef, useState } from 'react';
7
- import { label } from '../../labels.ts';
8
- import { commands } from '../../sandbox.ts';
9
- /** the lifecycle state tokens answer their store labels (data stays data,
10
- * the rendered words ride the label store). */
11
- const statelabels = {
12
- halted: 'console.terminal.state.halted',
13
- booting: 'console.terminal.state.booting',
14
- running: 'console.terminal.state.running',
15
- stopped: 'console.terminal.state.stopped',
16
- };
17
- /**
18
- * the virtual container terminal: a dark log pane (role=log, polite
19
- * aria-live), a command input with history browsing and tab completion,
20
- * and the lifecycle label in the bar.
21
- */
22
- export default function Terminal({ rows, prompt, state, enabled, oncommand }) {
23
- const outref = useRef(null);
24
- const inputref = useRef(null);
25
- const [value, setValue] = useState('');
26
- const historyref = useRef([]);
27
- const historyindex = useRef(-1);
28
- /** keep the output pinned to the newest row, like scrollterm(). */
29
- useEffect(() => {
30
- const out = outref.current;
31
- if (out)
32
- out.scrollTop = out.scrollHeight;
33
- }, [rows]);
34
- /** focus the command input once the sandbox is running. */
35
- useEffect(() => {
36
- if (enabled)
37
- inputref.current?.focus();
38
- }, [enabled]);
39
- const onsubmit = (event) => {
40
- event.preventDefault();
41
- if (!enabled)
42
- return;
43
- const trimmed = value.trim();
44
- setValue('');
45
- if (trimmed.length === 0)
46
- return;
47
- historyref.current.push(trimmed);
48
- historyindex.current = historyref.current.length;
49
- oncommand(trimmed);
50
- };
51
- const onkeydown = (event) => {
52
- if (event.key === 'ArrowUp') {
53
- event.preventDefault();
54
- if (historyref.current.length === 0)
55
- return;
56
- historyindex.current = Math.max(0, historyindex.current - 1);
57
- setValue(historyref.current[historyindex.current] ?? '');
58
- }
59
- else if (event.key === 'ArrowDown') {
60
- event.preventDefault();
61
- if (historyref.current.length === 0)
62
- return;
63
- historyindex.current = Math.min(historyref.current.length, historyindex.current + 1);
64
- setValue(historyref.current[historyindex.current] ?? '');
65
- }
66
- else if (event.key === 'Tab') {
67
- event.preventDefault();
68
- const prefix = value.trim();
69
- if (prefix.length === 0)
70
- return;
71
- const match = commands.find((entry) => entry.startsWith(prefix));
72
- if (match !== undefined)
73
- setValue(match);
74
- }
75
- };
76
- return (_jsxs("section", { className: "term", "data-state": state, "aria-labelledby": "termtitle", children: [_jsxs("div", { className: "term-bar", children: [_jsx("span", { id: "termtitle", children: label('console.terminal.title') }), _jsx("span", { className: "term-state", "aria-live": "polite", children: label(statelabels[state]) })] }), _jsx("pre", { className: "term-out", role: "log", "aria-live": "polite", "aria-label": label('console.terminal.outputAria'), ref: outref, onClick: () => inputref.current?.focus(), children: rows.map((row) => (_jsxs("span", { className: row.cls === '' ? undefined : row.cls, children: [row.text, '\n'] }, row.id))) }), _jsxs("form", { className: enabled ? 'term-in' : 'term-in off', onSubmit: onsubmit, children: [_jsx("label", { className: "term-prompt", htmlFor: "termin", children: prompt }), _jsx("input", { id: "termin", ref: inputref, className: "term-input", autoComplete: "off", spellCheck: false, "aria-label": label('console.terminal.inputAria'), disabled: !enabled, value: value, onChange: (event) => setValue(event.target.value), onKeyDown: onkeydown })] })] }));
77
- }
@@ -1,18 +0,0 @@
1
- import type { SessionUser } from '../../dashboardlib.ts';
2
- /** the local browser session normalized at boot (defensive read). */
3
- export type LocalSessionView = {
4
- user: string;
5
- role: string;
6
- issuedat: number;
7
- expiresat: number;
8
- };
9
- type AccountPanelProps = {
10
- /** "api" renders the /auth/me account; "local" the browser session. */
11
- mode: 'api' | 'local';
12
- /** the normalized account (api mode; null while the session boots). */
13
- user: SessionUser | null;
14
- /** the normalized local session (local mode). */
15
- local: LocalSessionView | null;
16
- };
17
- export default function AccountPanel({ mode, user, local }: AccountPanelProps): import("react").JSX.Element;
18
- export {};
@@ -1,65 +0,0 @@
1
- import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- // Signal & Ledger: the account panel absorbed from dashboard.js — dl of
3
- // session fields (api) or the browser-local account (static edge),
4
- // with the backup/restore keyfile covering a full storage wipe. the widget
5
- // owns its states: the loading skeleton before the session lands, the busy
6
- // flag on the backup controls and the inline status line instead of a
7
- // browser dialog.
8
- import { useRef, useState } from 'react';
9
- import { fmtdate } from '../../dashboardlib.ts';
10
- import { label, labelfill } from '../../labels.ts';
11
- import { adminusers, exportaccounts, importaccounts } from '../../localauth.ts';
12
- export default function AccountPanel({ mode, user, local }) {
13
- const fileref = useRef(null);
14
- const [busy, setbusy] = useState(false);
15
- const [status, setstatus] = useState('');
16
- /** downloads the accounts keyfile (salt + hash only, never passwords). */
17
- async function backup() {
18
- setbusy(true);
19
- setstatus('');
20
- try {
21
- const count = await exportaccounts();
22
- setstatus(count > 0
23
- ? labelfill('dashboard.account.backupDone', { count: String(count) })
24
- : label('dashboard.account.backupEmpty'));
25
- }
26
- catch {
27
- setstatus(label('dashboard.account.backupFailed'));
28
- }
29
- setbusy(false);
30
- }
31
- /** imports accounts from the chosen keyfile (merge, never overwrite). */
32
- async function restore(file) {
33
- setbusy(true);
34
- setstatus('');
35
- try {
36
- const imported = await importaccounts(file);
37
- setstatus(imported > 0
38
- ? labelfill('dashboard.account.restoreDone', { count: String(imported) })
39
- : label('dashboard.account.restoreEmpty'));
40
- window.location.reload();
41
- }
42
- catch (error) {
43
- const message = error instanceof Error && error.message ? error.message : label('dashboard.account.importFailed');
44
- setstatus(message);
45
- setbusy(false);
46
- }
47
- }
48
- if (mode === 'local' && local !== null) {
49
- const isadmin = local.role === 'admin';
50
- return (_jsxs("div", { children: [_jsxs("dl", { className: "dash-kv", children: [_jsx("dt", { children: label('dashboard.account.username') }), _jsx("dd", { children: local.user }), _jsx("dt", { children: label('dashboard.account.role') }), _jsx("dd", { children: isadmin
51
- ? labelfill('dashboard.account.adminRole', { list: adminusers.join(', ') })
52
- : local.role }), _jsx("dt", { children: label('dashboard.account.mode') }), _jsx("dd", { children: label('dashboard.account.modeLocal') }), _jsx("dt", { children: label('dashboard.account.signedIn') }), _jsx("dd", { children: fmtdate(new Date(local.issuedat).toISOString()) }), _jsx("dt", { children: label('dashboard.account.expires') }), _jsx("dd", { children: fmtdate(new Date(local.expiresat).toISOString()) })] }), _jsxs("div", { className: "dash-actions", children: [_jsx("button", { type: "button", className: "dash-btn", disabled: busy, onClick: () => void backup(), children: label('dashboard.account.backup') }), _jsx("button", { type: "button", className: "dash-btn", disabled: busy, onClick: () => {
53
- fileref.current?.click();
54
- }, children: label('dashboard.account.restore') })] }), status !== '' && (_jsx("p", { className: "dash-statusnote", role: "status", "aria-live": "polite", children: status })), _jsx("input", { ref: fileref, type: "file", accept: "application/json,.json", hidden: true, onChange: (event) => {
55
- const file = event.target.files?.[0];
56
- if (file !== undefined) {
57
- void restore(file);
58
- }
59
- } })] }));
60
- }
61
- /* api mode: the account is null only while the session bootstrap runs —
62
- the skeleton is the honest load, never a invented field */
63
- const account = user;
64
- return (_jsxs("dl", { className: "dash-kv", children: [_jsx("dt", { children: label('dashboard.account.username') }), _jsx("dd", { children: account === null ? _jsx("span", { className: "dash-skeleton" }) : account.username }), _jsx("dt", { children: label('dashboard.account.role') }), _jsx("dd", { children: account === null ? _jsx("span", { className: "dash-skeleton" }) : account.role }), _jsx("dt", { children: label('dashboard.account.created') }), _jsx("dd", { children: account === null ? _jsx("span", { className: "dash-skeleton" }) : fmtdate(account.createdat) }), _jsx("dt", { children: label('dashboard.account.lastLogin') }), _jsx("dd", { children: account === null ? _jsx("span", { className: "dash-skeleton" }) : fmtdate(account.lastloginat) }), account?.id !== null && account?.id !== undefined && (_jsxs(_Fragment, { children: [_jsx("dt", { children: label('dashboard.account.id') }), _jsx("dd", { children: String(account.id) })] }))] }));
65
- }
@@ -1,6 +0,0 @@
1
- type AdminPanelProps = {
2
- /** "api" reads the admin surface; "local" the browser-local overview. */
3
- mode: 'api' | 'local';
4
- };
5
- export default function AdminPanel({ mode }: AdminPanelProps): import("react").JSX.Element;
6
- export {};
@@ -1,90 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- // Signal & Ledger: the admin view absorbed from dashboard.js — overview
3
- // cards with global refresh, mesh nodes, users, global sandboxes and
4
- // audit; on the static edge, the browser's own overview.
5
- import { useEffect, useState } from 'react';
6
- import { apiresult, fmtuptime, pick, readlocalsandboxes } from '../../dashboardlib.ts';
7
- import { label } from '../../labels.ts';
8
- import { available } from '../../localauth.ts';
9
- import AuditLog from './DashboardAuditlog.tsx';
10
- import GlobalSandboxesTable from './DashboardGlobalsandboxestable.tsx';
11
- import MeshNodesTable from './DashboardMeshnodestable.tsx';
12
- import UsersTable from './DashboardUserstable.tsx';
13
- /** the honest failure state: every counter names its absence. */
14
- function unavailableoverview() {
15
- const na = label('dashboard.admin.na');
16
- return { users: na, nodes: na, sandboxes: na, sessions: na, events: na, uptime: na };
17
- }
18
- /** the browser-local overview of the static edge admin. */
19
- function localoverview() {
20
- let accounts = 0;
21
- try {
22
- const raw = window.localStorage.getItem('saddle_local_users');
23
- const parsed = raw ? JSON.parse(raw) : {};
24
- if (parsed !== null && typeof parsed === 'object') {
25
- accounts = Object.keys(parsed).length;
26
- }
27
- }
28
- catch {
29
- /* no registry in this browser */
30
- }
31
- const localboxes = available() ? readlocalsandboxes().length : 0;
32
- return {
33
- users: String(accounts),
34
- nodes: label('dashboard.admin.localNodes'),
35
- sandboxes: String(localboxes),
36
- sessions: label('dashboard.admin.localSessions'),
37
- events: label('dashboard.admin.na'),
38
- uptime: label('dashboard.admin.na'),
39
- };
40
- }
41
- export default function AdminPanel({ mode }) {
42
- /* null while the overview loads: the cards render the honest skeleton */
43
- const [overview, setoverview] = useState(null);
44
- const [reloadkey, setreloadkey] = useState(0);
45
- useEffect(() => {
46
- if (mode === 'local') {
47
- setoverview(localoverview());
48
- return;
49
- }
50
- let stopped = false;
51
- (async () => {
52
- try {
53
- const result = await apiresult('/api/v1/admin/overview');
54
- if (stopped) {
55
- return;
56
- }
57
- if (!result.ok || result.body === null || typeof result.body !== 'object') {
58
- setoverview(unavailableoverview());
59
- return;
60
- }
61
- const body = result.body;
62
- const counts = body.counts !== null && typeof body.counts === 'object'
63
- ? body.counts
64
- : body.overview !== null && typeof body.overview === 'object'
65
- ? body.overview
66
- : body;
67
- setoverview({
68
- users: String(pick(counts, ['users', 'userCount', 'totalUsers', 'usercount'], label('dashboard.admin.na'))),
69
- nodes: String(pick(counts, ['nodes', 'nodeCount', 'totalNodes', 'nodecount'], label('dashboard.admin.na'))),
70
- sandboxes: String(pick(counts, ['sandboxes', 'sandboxCount', 'totalSandboxes'], label('dashboard.admin.na'))),
71
- sessions: String(pick(counts, ['sessions', 'sessionCount', 'totalSessions'], label('dashboard.admin.na'))),
72
- events: String(pick(counts, ['events', 'eventCount', 'totalEvents'], label('dashboard.admin.na'))),
73
- uptime: fmtuptime(pick(counts, ['uptime', 'uptimeSeconds', 'uptime_seconds'], 0)),
74
- });
75
- }
76
- catch {
77
- if (!stopped) {
78
- setoverview(unavailableoverview());
79
- }
80
- }
81
- })();
82
- return () => {
83
- stopped = true;
84
- };
85
- }, [mode, reloadkey]);
86
- return (_jsxs("div", { children: [_jsxs("section", { className: "dash-panel", "aria-labelledby": "overtitle", children: [_jsx("h2", { id: "overtitle", children: label('dashboard.admin.overview') }), _jsxs("div", { className: "dash-cards", children: [_jsxs("div", { className: "dash-card", children: [_jsx("div", { className: "k", children: label('dashboard.card.users') }), _jsx("div", { className: "v", children: overview === null ? _jsx("span", { className: "dash-skeleton" }) : overview.users })] }), _jsxs("div", { className: "dash-card", children: [_jsx("div", { className: "k", children: label('dashboard.card.nodes') }), _jsx("div", { className: "v", children: overview === null ? _jsx("span", { className: "dash-skeleton" }) : overview.nodes })] }), _jsxs("div", { className: "dash-card", children: [_jsx("div", { className: "k", children: label('dashboard.card.sandboxes') }), _jsx("div", { className: "v", children: overview === null ? _jsx("span", { className: "dash-skeleton" }) : overview.sandboxes })] }), _jsxs("div", { className: "dash-card", children: [_jsx("div", { className: "k", children: label('dashboard.card.sessions') }), _jsx("div", { className: "v", children: overview === null ? _jsx("span", { className: "dash-skeleton" }) : overview.sessions })] }), _jsxs("div", { className: "dash-card", children: [_jsx("div", { className: "k", children: label('dashboard.card.events') }), _jsx("div", { className: "v", children: overview === null ? _jsx("span", { className: "dash-skeleton" }) : overview.events })] }), _jsxs("div", { className: "dash-card", children: [_jsx("div", { className: "k", children: label('dashboard.card.uptime') }), _jsx("div", { className: "v", children: overview === null ? _jsx("span", { className: "dash-skeleton" }) : overview.uptime })] })] }), _jsx("div", { className: "dash-actions", children: _jsx("button", { type: "button", className: "button", "aria-label": label('dashboard.admin.refreshAria'), "aria-busy": overview === null ? 'true' : undefined, onClick: () => {
87
- setoverview(null);
88
- setreloadkey((key) => key + 1);
89
- }, children: label('dashboard.admin.refresh') }) })] }), _jsxs("section", { className: "dash-panel", "aria-labelledby": "nodestitle", children: [_jsx("h2", { id: "nodestitle", children: label('dashboard.admin.nodes') }), _jsx(MeshNodesTable, { mode: mode, reloadkey: reloadkey })] }), _jsxs("section", { className: "dash-panel", "aria-labelledby": "userstitle", children: [_jsx("h2", { id: "userstitle", children: label('dashboard.admin.users') }), _jsx(UsersTable, { mode: mode, reloadkey: reloadkey })] }), _jsxs("section", { className: "dash-panel", "aria-labelledby": "boxestitle", children: [_jsx("h2", { id: "boxestitle", children: label('dashboard.admin.sandboxes') }), _jsx(GlobalSandboxesTable, { mode: mode, reloadkey: reloadkey })] }), _jsxs("section", { className: "dash-panel", "aria-labelledby": "audittitle", children: [_jsx("h2", { id: "audittitle", children: label('dashboard.admin.audit') }), _jsx(AuditLog, { mode: mode, reloadkey: reloadkey })] })] }));
90
- }
@@ -1,8 +0,0 @@
1
- type AuditLogProps = {
2
- /** "api" lists /api/v1/admin/audit; "local" shows the static note. */
3
- mode: 'api' | 'local';
4
- /** bumped by the admin refresh-all action. */
5
- reloadkey: number;
6
- };
7
- export default function AuditLog({ mode, reloadkey }: AuditLogProps): import("react").JSX.Element;
8
- export {};
@@ -1,50 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- // Signal & Ledger: the audit log absorbed from dashboard.js — action,
3
- // user, ip and instant of the entries the main node registers; on the
4
- // static edge, the honest note.
5
- import { useEffect, useState } from 'react';
6
- import { apiresult, asarray, fmtdate, pick } from '../../dashboardlib.ts';
7
- import { label, labelfill } from '../../labels.ts';
8
- export default function AuditLog({ mode, reloadkey }) {
9
- const [items, setitems] = useState([]);
10
- const [error, seterror] = useState('');
11
- useEffect(() => {
12
- if (mode !== 'api') {
13
- return undefined;
14
- }
15
- let stopped = false;
16
- (async () => {
17
- try {
18
- const result = await apiresult('/api/v1/admin/audit');
19
- if (stopped) {
20
- return;
21
- }
22
- if (!result.ok) {
23
- seterror(labelfill('dashboard.audit.unavailable', { status: String(result.status) }));
24
- return;
25
- }
26
- seterror('');
27
- setitems(asarray(result.body, ['entries', 'audit', 'items', 'data', 'list', 'logs']));
28
- }
29
- catch {
30
- if (!stopped) {
31
- seterror(label('dashboard.audit.unreachable'));
32
- }
33
- }
34
- })();
35
- return () => {
36
- stopped = true;
37
- };
38
- }, [mode, reloadkey]);
39
- if (mode === 'local') {
40
- return _jsx("p", { className: "dash-empty", children: label('dashboard.audit.localNote') });
41
- }
42
- return (_jsxs("div", { children: [_jsx("div", { className: "dash-tablescroll",
43
- // biome-ignore lint/a11y/noNoninteractiveTabindex: deliberate wcag scrollable-region pattern: the tabIndex keeps the overflowing table keyboard-scrollable; the rows are display data and the interactive cells (none here) use real buttons
44
- tabIndex: 0, role: "region", "aria-label": label('dashboard.audit.tableAria'), children: _jsxs("table", { children: [items.length === 0 && error === '' && (_jsx("caption", { className: "dash-empty", children: label('dashboard.audit.empty') })), _jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { scope: "col", children: label('dashboard.audit.colAction') }), _jsx("th", { scope: "col", children: label('dashboard.audit.colUser') }), _jsx("th", { scope: "col", children: label('dashboard.audit.colIp') }), _jsx("th", { scope: "col", children: label('dashboard.audit.colWhen') })] }) }), _jsx("tbody", { children: items.map((entry) => {
45
- const action = String(pick(entry, ['action', 'type', 'event'], '?'));
46
- const username = String(pick(entry, ['username', 'actor', 'by', 'user', 'userid', 'user_id'], '-'));
47
- const ip = String(pick(entry, ['ip', 'sourceIp', 'address'], '-'));
48
- return (_jsxs("tr", { children: [_jsx("td", { children: action }), _jsx("td", { children: username }), _jsx("td", { className: "wrapcell", children: ip }), _jsx("td", { children: fmtdate(pick(entry, ['at', 'ts', 'time', 'createdAt', 'when'], null)) })] }, `${action}|${username}|${ip}`));
49
- }) })] }) }), error !== '' && _jsx("p", { className: "dash-panelerror", children: error })] }));
50
- }
@@ -1,10 +0,0 @@
1
- type CreateSandboxFormProps = {
2
- /** "api" posts /api/v1/sandboxes; "local" drives the browser engine shelf. */
3
- mode: 'api' | 'local';
4
- /** fires after a successful creation so the list reloads. */
5
- oncreated: () => void;
6
- /** the refresh action beside the submit button. */
7
- onrefresh: () => void;
8
- };
9
- export default function CreateSandboxForm({ mode, oncreated, onrefresh }: CreateSandboxFormProps): import("react").JSX.Element;
10
- export {};
@@ -1,71 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- // Signal & Ledger: the creation form absorbed from dashboard.js —
3
- // engine catalogs (sandbox.ts) with static fallback, spec posted to the
4
- // api or materialized in the local engine (static mode).
5
- import { useState } from 'react';
6
- import { apiresult, errormessage, fallbackcpus, fallbackgpus, readlocalsandboxes, writelocalsandboxes, } from '../../dashboardlib.ts';
7
- import { label, labelfill } from '../../labels.ts';
8
- import { cpudata, createSandboxState, gpudata } from '../../sandbox.ts';
9
- /** the spec fields of one creation request (model from the reviewed catalog). */
10
- function catalogs() {
11
- const cpumodels = Array.isArray(cpudata) && cpudata.length > 0 ? cpudata.map((cpu) => cpu.model) : fallbackcpus;
12
- const gpuids = Array.isArray(gpudata) && gpudata.length > 0 ? gpudata.map((gpu) => gpu.id) : fallbackgpus;
13
- return { cpumodels, gpuids };
14
- }
15
- export default function CreateSandboxForm({ mode, oncreated, onrefresh }) {
16
- const { cpumodels, gpuids } = catalogs();
17
- const [model, setmodel] = useState(cpumodels[0] ?? fallbackcpus[0]);
18
- const [vcpus, setvcpus] = useState(8);
19
- const [ramgb, setramgb] = useState(32);
20
- const [gpu, setgpu] = useState(gpuids[0] ?? fallbackgpus[0]);
21
- const [mig, setmig] = useState('off');
22
- const [busy, setbusy] = useState(false);
23
- const [error, seterror] = useState('');
24
- async function submit(event) {
25
- event.preventDefault();
26
- seterror('');
27
- const spec = { model, vcpus: Number(vcpus) || 8, ramgb: Number(ramgb) || 32, gpu, mig };
28
- if (mode === 'local') {
29
- /* the browser-pure engine port drives the shelf: the same
30
- * createSandboxState the console runs, no server involved.
31
- * the record is a stored spec — nothing executes here —
32
- * so the honest state chip reads 'created', never
33
- * 'running'. */
34
- const state = createSandboxState(spec);
35
- const list = readlocalsandboxes();
36
- list.unshift({
37
- id: state.id,
38
- spec: {
39
- model: state.model,
40
- vcpus: state.vcpus,
41
- ramgb: state.ramgb,
42
- gpu: state.gpu,
43
- mig: state.mig,
44
- },
45
- createdat: new Date().toISOString(),
46
- state: 'created',
47
- });
48
- writelocalsandboxes(list);
49
- oncreated();
50
- return;
51
- }
52
- setbusy(true);
53
- try {
54
- const result = await apiresult('/api/v1/sandboxes', {
55
- method: 'POST',
56
- body: JSON.stringify(spec),
57
- });
58
- if (result.ok) {
59
- oncreated();
60
- }
61
- else {
62
- seterror(errormessage(result, labelfill('dashboard.create.failedStatus', { status: String(result.status) })));
63
- }
64
- }
65
- catch {
66
- seterror(label('dashboard.create.unreachable'));
67
- }
68
- setbusy(false);
69
- }
70
- return (_jsxs("form", { noValidate: true, "aria-label": label('dashboard.create.formAria'), onSubmit: submit, children: [_jsxs("div", { className: "dash-formrow", children: [_jsxs("div", { className: "dash-field", children: [_jsx("label", { htmlFor: "newmodel", children: label('dashboard.create.cpuLabel') }), _jsx("select", { id: "newmodel", "aria-label": label('dashboard.create.cpuAria'), value: model, onChange: (event) => setmodel(event.target.value), children: cpumodels.map((entry) => (_jsx("option", { value: entry, children: entry }, entry))) })] }), _jsxs("div", { className: "dash-field", children: [_jsx("label", { htmlFor: "newvcpus", children: label('dashboard.create.vcpusLabel') }), _jsx("input", { type: "number", id: "newvcpus", min: 1, max: 192, value: vcpus, "aria-label": label('dashboard.create.vcpusAria'), onChange: (event) => setvcpus(Number(event.target.value)) })] }), _jsxs("div", { className: "dash-field", children: [_jsx("label", { htmlFor: "newram", children: label('dashboard.create.ramLabel') }), _jsx("input", { type: "number", id: "newram", min: 1, max: 1024, value: ramgb, "aria-label": label('dashboard.create.ramAria'), onChange: (event) => setramgb(Number(event.target.value)) })] }), _jsxs("div", { className: "dash-field", children: [_jsx("label", { htmlFor: "newgpu", children: label('dashboard.create.gpuLabel') }), _jsx("select", { id: "newgpu", "aria-label": label('dashboard.create.gpuAria'), value: gpu, onChange: (event) => setgpu(event.target.value), children: gpuids.map((entry) => (_jsx("option", { value: entry, children: entry }, entry))) })] }), _jsxs("div", { className: "dash-field", children: [_jsx("label", { htmlFor: "newmig", children: label('dashboard.create.migLabel') }), _jsxs("select", { id: "newmig", "aria-label": label('dashboard.create.migAria'), value: mig, onChange: (event) => setmig(event.target.value), children: [_jsx("option", { value: "off", children: "off" }), _jsx("option", { value: "1g.24gb", children: "1g.24gb" }), _jsx("option", { value: "2g.48gb", children: "2g.48gb" }), _jsx("option", { value: "4g.96gb", children: "4g.96gb" })] })] })] }), error !== '' && (_jsx("p", { className: "dash-panelerror", role: "alert", children: error })), _jsxs("div", { className: "dash-actions", children: [_jsx("button", { type: "submit", className: "primary", disabled: busy, "aria-busy": busy ? 'true' : undefined, "aria-label": label('dashboard.create.submitAria'), children: label('dashboard.create.submit') }), _jsx("button", { type: "button", className: "button", "aria-label": label('dashboard.create.refreshAria'), onClick: onrefresh, children: label('dashboard.create.refresh') })] })] }));
71
- }
@@ -1,8 +0,0 @@
1
- type EventsTimelineProps = {
2
- /** "api" polls the bus; "local" shows the static-edge note. */
3
- mode: 'api' | 'local';
4
- /** false while the session bootstrap runs (avoids a premature 401). */
5
- ready: boolean;
6
- };
7
- export default function EventsTimeline({ mode, ready }: EventsTimelineProps): import("react").JSX.Element;
8
- export {};
@@ -1,83 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- // Signal & Ledger: the bus event timeline absorbed from
3
- // dashboard.js — poll of /api/v1/events?since= every 10 s with cursor,
4
- // prepend and a 50-entry cap; on the static edge it becomes the honest note.
5
- import { useEffect, useRef, useState } from 'react';
6
- import { apiresult, asarray, fmtdate, pick } from '../../dashboardlib.ts';
7
- import { label } from '../../labels.ts';
8
- /** classifies one topic into the timeline color kinds. */
9
- function kindfor(topic) {
10
- if (/exec/i.test(topic)) {
11
- return 'exec';
12
- }
13
- if (/mesh|node|ping/i.test(topic)) {
14
- return 'mesh';
15
- }
16
- return 'lifecycle';
17
- }
18
- /** projects one bus event into a rendered entry (defensive). */
19
- function toentry(record, index) {
20
- const topic = String(pick(record, ['topic', 'type', 'event', 'name'], 'event'));
21
- const detail = pick(record, ['detail', 'data', 'message', 'payload'], '');
22
- const at = pick(record, ['at', 'ts', 'time', 'createdAt', 'created_at', 'when'], null);
23
- return {
24
- key: `${String(pick(record, ['id', 'seq'], index))}-${index}`,
25
- kind: kindfor(topic),
26
- time: fmtdate(at),
27
- topic,
28
- detail: typeof detail === 'string' ? detail : JSON.stringify(detail),
29
- };
30
- }
31
- export default function EventsTimeline({ mode, ready }) {
32
- const [entries, setentries] = useState([]);
33
- const cursorref = useRef('');
34
- useEffect(() => {
35
- if (mode !== 'api' || !ready) {
36
- return undefined;
37
- }
38
- let stopped = false;
39
- const tick = async () => {
40
- if (document.visibilityState !== 'visible') {
41
- return;
42
- }
43
- try {
44
- const query = cursorref.current === '' ? '' : `?since=${encodeURIComponent(cursorref.current)}`;
45
- const result = await apiresult(`/api/v1/events${query}`);
46
- if (stopped || !result.ok) {
47
- return;
48
- }
49
- const items = asarray(result.body, ['events', 'items', 'data', 'list']);
50
- const lastid = pick(result.body, ['lastid', 'lastId'], null);
51
- if (lastid !== null && lastid !== undefined) {
52
- cursorref.current = String(lastid);
53
- }
54
- if (items.length === 0) {
55
- return;
56
- }
57
- const projected = items.map((item, index) => {
58
- const next = pick(item, ['id', 'seq'], null);
59
- if (next !== null && next !== undefined) {
60
- cursorref.current = String(next);
61
- }
62
- return toentry(item, index);
63
- });
64
- setentries((previous) => [...projected, ...previous].slice(0, 50));
65
- }
66
- catch {
67
- /* the next poll retries silently */
68
- }
69
- };
70
- void tick();
71
- const timer = setInterval(() => {
72
- void tick();
73
- }, 10000);
74
- return () => {
75
- stopped = true;
76
- clearInterval(timer);
77
- };
78
- }, [mode, ready]);
79
- if (mode === 'local') {
80
- return (_jsx("ol", { className: "dash-timeline", role: "log", "aria-live": "polite", "aria-label": label('dashboard.events.aria'), children: _jsx("li", { className: "dash-empty", children: _jsx("span", { children: label('dashboard.events.localNote') }) }) }));
81
- }
82
- return (_jsxs("div", { children: [_jsxs("ol", { className: "dash-timeline", role: "log", "aria-live": "polite", "aria-label": label('dashboard.events.aria'), children: [entries.length === 0 && _jsx("li", { className: "dash-empty", children: label('dashboard.events.empty') }), entries.map((entry) => (_jsxs("li", { className: entry.kind, children: [_jsxs("span", { className: "time", children: [entry.time, " "] }), _jsx("span", { className: "topic", children: entry.topic }), _jsx("span", { className: "detail", children: entry.detail })] }, entry.key)))] }), _jsx("p", { className: "dash-statusnote", children: label('dashboard.events.pollNote') })] }));
83
- }