@wenathlan/saddle 2.0.154 → 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.
- package/Dockerfile +112 -41
- package/README.md +58 -59
- package/browser.ts +482 -0
- package/cli.ts +274 -0
- package/distribution.ts +731 -0
- package/docker.config +29 -8
- package/docs/artifactavailability.md +2 -2
- package/docs/browser.md +18 -1
- package/docs/{containerplatforms.2.1.0.md → containerplatforms210.md} +1 -1
- package/docs/{documentmap.1.8.12.md → documentmap1812.md} +1 -1
- package/docs/extension.md +13 -2
- package/docs/libraryapi.md +1 -1
- package/docs/{ninety.modalities.md → ninetymodalities.md} +87 -4
- package/docs/{planning.ninety.md → planningninety.md} +6 -6
- package/docs/{releasenotes.1.8.13.md → releasenotes1813.md} +2 -2
- package/docs/{releasenotes.1.8.14.md → releasenotes1814.md} +1 -1
- package/docs/{repo.synthesis.1.8.16.md → reposynthesis1816.md} +1 -1
- package/docs/todo.md +2 -2
- package/docs/{todo.1.8.15.md → todo1815.md} +1 -1
- package/docs/{todo.1.8.16.md → todo1816.md} +5 -5
- package/execution.ts +677 -0
- package/foundation.ts +314 -0
- package/index.ts +35 -27
- package/isolation.ts +84 -0
- package/modes.ts +170 -0
- package/mttg.config +1 -1
- package/orchestrator.ts +49 -15
- package/package.json +90 -75
- package/qemu.config +2 -2
- package/sandbox.ts +2094 -0
- package/scheduler.ts +1 -1
- package/server.ts +52 -0
- package/tsconfig.json +11 -12
- package/virtual.ts +1105 -0
- package/virtualgpu.ts +1 -1
- package/virtualization.ts +1 -1
- package/workloadlaw.ts +293 -0
- package/dist/App.d.ts +0 -5
- package/dist/App.js +0 -52
- package/dist/Sol/Sol.d.ts +0 -3
- package/dist/Sol/Sol.js +0 -46
- package/dist/Sol/agentbrowser/agentbrowser.d.ts +0 -9
- package/dist/Sol/agentbrowser/agentbrowser.js +0 -121
- package/dist/Sol/architecture/architecture.d.ts +0 -9
- package/dist/Sol/architecture/architecture.js +0 -93
- package/dist/Sol/compute/compute.d.ts +0 -9
- package/dist/Sol/compute/compute.js +0 -22
- package/dist/Sol/console/console.d.ts +0 -15
- package/dist/Sol/console/console.js +0 -292
- package/dist/Sol/dashboard/dashboard.d.ts +0 -10
- package/dist/Sol/dashboard/dashboard.js +0 -181
- package/dist/Sol/docs/docs.d.ts +0 -9
- package/dist/Sol/docs/docs.js +0 -28
- package/dist/Sol/home/home.d.ts +0 -35
- package/dist/Sol/home/home.js +0 -239
- package/dist/Sol/integrations/integrations.d.ts +0 -9
- package/dist/Sol/integrations/integrations.js +0 -83
- package/dist/Sol/intro/intro.d.ts +0 -7
- package/dist/Sol/intro/intro.js +0 -102
- package/dist/Sol/login/login.d.ts +0 -16
- package/dist/Sol/login/login.js +0 -49
- package/dist/Sol/notfound/notfound.d.ts +0 -9
- package/dist/Sol/notfound/notfound.js +0 -15
- package/dist/Sol/onboarding/onboarding.d.ts +0 -25
- package/dist/Sol/onboarding/onboarding.js +0 -60
- package/dist/Sol/playground/playground.d.ts +0 -9
- package/dist/Sol/playground/playground.js +0 -127
- package/dist/Sol/register/register.d.ts +0 -16
- package/dist/Sol/register/register.js +0 -193
- package/dist/Sol/shell/Shell.d.ts +0 -124
- package/dist/Sol/shell/Shell.js +0 -335
- package/dist/Sol/wingets/ComputeBootladder.d.ts +0 -6
- package/dist/Sol/wingets/ComputeBootladder.js +0 -71
- package/dist/Sol/wingets/ComputeModalitycatalog.d.ts +0 -7
- package/dist/Sol/wingets/ComputeModalitycatalog.js +0 -71
- package/dist/Sol/wingets/ConsoleApibadge.d.ts +0 -7
- package/dist/Sol/wingets/ConsoleApibadge.js +0 -5
- package/dist/Sol/wingets/ConsoleEdgelaw.d.ts +0 -6
- package/dist/Sol/wingets/ConsoleEdgelaw.js +0 -36
- package/dist/Sol/wingets/ConsoleEventstimeline.d.ts +0 -19
- package/dist/Sol/wingets/ConsoleEventstimeline.js +0 -12
- package/dist/Sol/wingets/ConsoleSnapshotcontrols.d.ts +0 -8
- package/dist/Sol/wingets/ConsoleSnapshotcontrols.js +0 -8
- package/dist/Sol/wingets/ConsoleSpecpanel.d.ts +0 -21
- package/dist/Sol/wingets/ConsoleSpecpanel.js +0 -75
- package/dist/Sol/wingets/ConsoleTerminal.d.ts +0 -22
- package/dist/Sol/wingets/ConsoleTerminal.js +0 -77
- package/dist/Sol/wingets/DashboardAccountpanel.d.ts +0 -18
- package/dist/Sol/wingets/DashboardAccountpanel.js +0 -65
- package/dist/Sol/wingets/DashboardAdminpanel.d.ts +0 -6
- package/dist/Sol/wingets/DashboardAdminpanel.js +0 -90
- package/dist/Sol/wingets/DashboardAuditlog.d.ts +0 -8
- package/dist/Sol/wingets/DashboardAuditlog.js +0 -50
- package/dist/Sol/wingets/DashboardCreatesandboxform.d.ts +0 -10
- package/dist/Sol/wingets/DashboardCreatesandboxform.js +0 -71
- package/dist/Sol/wingets/DashboardEventstimeline.d.ts +0 -8
- package/dist/Sol/wingets/DashboardEventstimeline.js +0 -83
- package/dist/Sol/wingets/DashboardGlobalsandboxestable.d.ts +0 -8
- package/dist/Sol/wingets/DashboardGlobalsandboxestable.js +0 -57
- package/dist/Sol/wingets/DashboardMeshnodestable.d.ts +0 -8
- package/dist/Sol/wingets/DashboardMeshnodestable.js +0 -103
- package/dist/Sol/wingets/DashboardSandboxlist.d.ts +0 -10
- package/dist/Sol/wingets/DashboardSandboxlist.js +0 -163
- package/dist/Sol/wingets/DashboardUserstable.d.ts +0 -8
- package/dist/Sol/wingets/DashboardUserstable.js +0 -78
- package/dist/Sol/wingets/HomeEntrygate.d.ts +0 -23
- package/dist/Sol/wingets/HomeEntrygate.js +0 -73
- package/dist/Sol/wingets/HomeMetricstrip.d.ts +0 -9
- package/dist/Sol/wingets/HomeMetricstrip.js +0 -4
- package/dist/Sol/wingets/HomeRuntimediagram.d.ts +0 -1
- package/dist/Sol/wingets/HomeRuntimediagram.js +0 -22
- package/dist/Sol/wingets/LoginForm.d.ts +0 -19
- package/dist/Sol/wingets/LoginForm.js +0 -141
- package/dist/Sol/wingets/RegisterPasswordconfirm.d.ts +0 -13
- package/dist/Sol/wingets/RegisterPasswordconfirm.js +0 -16
- package/dist/Sol/wingets/RegisterPasswordmeter.d.ts +0 -19
- package/dist/Sol/wingets/RegisterPasswordmeter.js +0 -65
- package/dist/Sol/wingets/RegisterUsernamerules.d.ts +0 -11
- package/dist/Sol/wingets/RegisterUsernamerules.js +0 -16
- package/dist/Sol/wingets/index.d.ts +0 -39
- package/dist/Sol/wingets/index.js +0 -39
- package/dist/alternatives.d.ts +0 -508
- package/dist/alternatives.js +0 -950
- package/dist/api.d.ts +0 -154
- package/dist/api.js +0 -174
- package/dist/auth.d.ts +0 -268
- package/dist/auth.js +0 -476
- package/dist/automation.d.ts +0 -425
- package/dist/automation.js +0 -566
- package/dist/browser.d.ts +0 -561
- package/dist/browser.js +0 -1058
- package/dist/capacitor.config.d.ts +0 -45
- package/dist/capacitor.config.js +0 -48
- package/dist/catalog.d.ts +0 -43
- package/dist/catalog.js +0 -44
- package/dist/cli.d.ts +0 -16
- package/dist/cli.js +0 -168
- package/dist/communication.d.ts +0 -181
- package/dist/communication.js +0 -376
- package/dist/compute.d.ts +0 -1160
- package/dist/compute.js +0 -2272
- package/dist/dashboardlib.d.ts +0 -58
- package/dist/dashboardlib.js +0 -161
- package/dist/db.d.ts +0 -569
- package/dist/db.js +0 -1080
- package/dist/distribution.d.ts +0 -528
- package/dist/distribution.js +0 -810
- package/dist/drizzle.config.d.ts +0 -20
- package/dist/drizzle.config.js +0 -18
- package/dist/edgelandes.d.ts +0 -70
- package/dist/edgelandes.host.d.ts +0 -26
- package/dist/edgelandes.host.js +0 -1089
- package/dist/edgelandes.inproc.d.ts +0 -27
- package/dist/edgelandes.inproc.js +0 -952
- package/dist/edgelandes.js +0 -1133
- package/dist/edgelandes.ninety.d.ts +0 -31
- package/dist/edgelandes.ninety.js +0 -174
- package/dist/edgelandes.virtual.d.ts +0 -25
- package/dist/edgelandes.virtual.js +0 -629
- package/dist/edgeplane.d.ts +0 -121
- package/dist/edgeplane.js +0 -341
- package/dist/examplelocaljob.d.ts +0 -1
- package/dist/examplelocaljob.js +0 -14
- package/dist/execution.d.ts +0 -529
- package/dist/execution.js +0 -760
- package/dist/family.d.ts +0 -16
- package/dist/family.js +0 -42
- package/dist/familyurl.d.ts +0 -21
- package/dist/familyurl.js +0 -24
- package/dist/format.d.ts +0 -18
- package/dist/format.js +0 -59
- package/dist/foundation.d.ts +0 -172
- package/dist/foundation.js +0 -312
- package/dist/index.d.ts +0 -735
- package/dist/index.js +0 -1020
- package/dist/integration.d.ts +0 -235
- package/dist/integration.js +0 -228
- package/dist/intelligence.d.ts +0 -93
- package/dist/intelligence.js +0 -144
- package/dist/isolation.d.ts +0 -128
- package/dist/isolation.js +0 -95
- package/dist/labels.d.ts +0 -665
- package/dist/labels.js +0 -707
- package/dist/localauth.d.ts +0 -127
- package/dist/localauth.js +0 -413
- package/dist/media.d.ts +0 -343
- package/dist/media.js +0 -985
- package/dist/mesh.d.ts +0 -177
- package/dist/mesh.js +0 -468
- package/dist/modalityregistry.d.ts +0 -109
- package/dist/modalityregistry.js +0 -1386
- package/dist/modes.d.ts +0 -358
- package/dist/modes.js +0 -133
- package/dist/onboardingstate.d.ts +0 -79
- package/dist/onboardingstate.js +0 -282
- package/dist/orchestrator.d.ts +0 -1338
- package/dist/orchestrator.js +0 -4310
- package/dist/packager/targetcli.js +0 -4
- package/dist/paths.d.ts +0 -2
- package/dist/paths.js +0 -14
- package/dist/performance.d.ts +0 -415
- package/dist/performance.js +0 -826
- package/dist/quantum.d.ts +0 -809
- package/dist/quantum.js +0 -2072
- package/dist/render.d.ts +0 -380
- package/dist/render.js +0 -1072
- package/dist/runall.d.ts +0 -2
- package/dist/runall.js +0 -39
- package/dist/runtimeprobe.d.ts +0 -4
- package/dist/runtimeprobe.js +0 -8
- package/dist/sandbox.d.ts +0 -355
- package/dist/sandbox.js +0 -1721
- package/dist/sandboxenvprofile.d.ts +0 -29
- package/dist/sandboxenvprofile.js +0 -89
- package/dist/sandboxprofile.d.ts +0 -137
- package/dist/sandboxprofile.js +0 -241
- package/dist/sandboxqueue.d.ts +0 -108
- package/dist/sandboxqueue.js +0 -201
- package/dist/sandboxquota.d.ts +0 -121
- package/dist/sandboxquota.js +0 -236
- package/dist/scheduler.d.ts +0 -595
- package/dist/scheduler.js +0 -1258
- package/dist/scriptlanes.d.ts +0 -182
- package/dist/scriptlanes.js +0 -660
- package/dist/scripts.buildengine.d.ts +0 -1
- package/dist/scripts.buildengine.js +0 -39
- package/dist/scripts.securitygate.d.ts +0 -1
- package/dist/scripts.securitygate.js +0 -68
- package/dist/scripts.validateflatnative.d.ts +0 -1
- package/dist/scripts.validateflatnative.js +0 -72
- package/dist/security.d.ts +0 -500
- package/dist/security.js +0 -1169
- package/dist/seedcatalog.d.ts +0 -13
- package/dist/seedcatalog.js +0 -46
- package/dist/server.d.ts +0 -20
- package/dist/server.js +0 -53
- package/dist/speccatalog.d.ts +0 -31
- package/dist/speccatalog.js +0 -163
- package/dist/tiers.d.ts +0 -1001
- package/dist/tiers.js +0 -2169
- package/dist/utils.d.ts +0 -2
- package/dist/utils.js +0 -5
- package/dist/vaulthandoff.d.ts +0 -141
- package/dist/vaulthandoff.js +0 -444
- package/dist/virtual.d.ts +0 -640
- package/dist/virtual.js +0 -1284
- package/dist/virtualcpu.d.ts +0 -315
- package/dist/virtualcpu.js +0 -1180
- package/dist/virtualgpu.d.ts +0 -344
- package/dist/virtualgpu.js +0 -1000
- package/dist/virtualization.d.ts +0 -606
- package/dist/virtualization.js +0 -1186
- package/dist/virtualmemory.d.ts +0 -817
- package/dist/virtualmemory.js +0 -1795
- package/dist/vite.config.d.ts +0 -3
- package/dist/vite.config.js +0 -48
- package/dist/vitest.config.d.ts +0 -2
- package/dist/vitest.config.js +0 -25
- package/dist/webserver.d.ts +0 -166
- package/dist/webserver.js +0 -2226
- package/dist/workloadlaw.d.ts +0 -133
- package/dist/workloadlaw.js +0 -193
- package/manifest.json +0 -20
- package/media.ts +0 -1337
- /package/docs/{architecture.1.8.19.md → architecture1819.md} +0 -0
- /package/docs/{architecture.1.8.19.mmd → architecture1819.mmd} +0 -0
- /package/docs/{artifactresearch.1.8.9.md → artifactresearch189.md} +0 -0
- /package/docs/{batches.1816.to.1820.md → batches1816to1820.md} +0 -0
- /package/docs/{brancharchive.2026.08.18.md → brancharchive20260818.md} +0 -0
- /package/docs/{containerplatforms.1.8.17.md → containerplatforms1817.md} +0 -0
- /package/docs/{e2ugh.engine.md → e2ughengine.md} +0 -0
- /package/docs/{flatbuildresearch.1.8.11.md → flatbuildresearch1811.md} +0 -0
- /package/docs/{licenseaudit.1.8.12.md → licenseaudit1812.md} +0 -0
- /package/docs/{mobileconversionresearch.1.8.10.md → mobileconversionresearch1810.md} +0 -0
- /package/docs/{nativeidentityresearch.1.8.11.md → nativeidentityresearch1811.md} +0 -0
- /package/docs/{native.wrappers.md → nativewrappers.md} +0 -0
- /package/docs/{planning.1.8.18.md → planning1818.md} +0 -0
- /package/docs/{planning.1.8.19.md → planning1819.md} +0 -0
- /package/docs/{planning.engine.md → planningengine.md} +0 -0
- /package/docs/{releasenotes.1.8.12.md → releasenotes1812.md} +0 -0
- /package/docs/{releasenotes.1.8.15.md → releasenotes1815.md} +0 -0
- /package/docs/{releasenotes.1.8.16.md → releasenotes1816.md} +0 -0
- /package/docs/{releasenotes.1.8.17.md → releasenotes1817.md} +0 -0
- /package/docs/{releasenotes.1.8.18.md → releasenotes1818.md} +0 -0
- /package/docs/{releasenotes.1.8.19.md → releasenotes1819.md} +0 -0
- /package/docs/{reorganization.1.8.8.md → reorganization188.md} +0 -0
- /package/docs/{reorganization.1.8.9.md → reorganization189.md} +0 -0
- /package/docs/{repo.analysis.1.8.21.json → repoanalysis1821.json} +0 -0
- /package/docs/{repo.candidates.1.8.21.jsonl → repocandidates1821.jsonl} +0 -0
- /package/docs/{repo.research.1.8.16.md → reporesearch1816.md} +0 -0
- /package/docs/{repo.research.1.8.21.md → reporesearch1821.md} +0 -0
- /package/docs/{repo.selected.1.8.21.json → reposelected1821.json} +0 -0
- /package/docs/{repo.synthesis.1.8.21.md → reposynthesis1821.md} +0 -0
- /package/docs/{research.1.8.18.isolation.md → research1818isolation.md} +0 -0
- /package/docs/{research.1.8.19.virtual.browser.md → research1819virtualbrowser.md} +0 -0
- /package/docs/{scanningresearch.1.8.11.md → scanningresearch1811.md} +0 -0
- /package/docs/{securityaudit.1.8.7.md → securityaudit187.md} +0 -0
- /package/docs/{securityreferences.1.8.11.md → securityreferences1811.md} +0 -0
- /package/docs/{securityresearch.1.8.11.md → securityresearch1811.md} +0 -0
- /package/docs/{signingresearch.1.8.12.md → signingresearch1812.md} +0 -0
- /package/docs/{tauri.glib.risk.1.8.11.md → tauriglibrisk1811.md} +0 -0
- /package/docs/{todo.1.8.18.md → todo1818.md} +0 -0
- /package/docs/{todo.1.8.19.md → todo1819.md} +0 -0
- /package/docs/{toolchainresearch.1.8.9.md → toolchainresearch189.md} +0 -0
- /package/docs/{web.duplicatecleanup.md → webduplicatecleanup.md} +0 -0
- /package/docs/{web.ideas.md → webideas.md} +0 -0
- /package/docs/{workflowimprovements.2026.08.19.md → workflowimprovements20260819.md} +0 -0
package/dist/db.d.ts
DELETED
|
@@ -1,569 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* db.ts — node:sqlite data layer for the saddle web node (v7-BACK).
|
|
3
|
-
*
|
|
4
|
-
* the whole persistence surface of a node (main or clone) lives in this
|
|
5
|
-
* module: one sqlite database opened through the native node:sqlite
|
|
6
|
-
* DatabaseSync driver, the embedded migrations (executeschema), prepared
|
|
7
|
-
* statements memoized once per process and one small function api per
|
|
8
|
-
* table. the file is created with mode 0o600 right after open because it
|
|
9
|
-
* carries password hashes and session token hashes.
|
|
10
|
-
*
|
|
11
|
-
* contexts (13): dbopen, filemode, rowtypes, executeschema, users,
|
|
12
|
-
* sessions, nodes, sandboxes, sandboxfiles, events, audit, labels, counts.
|
|
13
|
-
*
|
|
14
|
-
* rules: lowercase identifiers, english jsdoc in third person, no emoji,
|
|
15
|
-
* try/catch on every fallible path with the standardized {code,message}
|
|
16
|
-
* error shape, node:* modules only, zero dependencies.
|
|
17
|
-
*/
|
|
18
|
-
import { DatabaseSync } from 'node:sqlite';
|
|
19
|
-
/** one users row: the password hash and salt never leave the server. */
|
|
20
|
-
export type UserRow = {
|
|
21
|
-
id: string;
|
|
22
|
-
username: string;
|
|
23
|
-
passwordhash: string;
|
|
24
|
-
salt: string;
|
|
25
|
-
role: string;
|
|
26
|
-
createdat: string;
|
|
27
|
-
lastlogin: string | null;
|
|
28
|
-
};
|
|
29
|
-
/** one sessions row (only the sha256 token hash is persisted). */
|
|
30
|
-
export type SessionRow = {
|
|
31
|
-
tokenhash: string;
|
|
32
|
-
userid: string;
|
|
33
|
-
createdat: string;
|
|
34
|
-
expiresat: string;
|
|
35
|
-
ip: string | null;
|
|
36
|
-
useragent: string | null;
|
|
37
|
-
};
|
|
38
|
-
/** one mesh registry nodes row. */
|
|
39
|
-
export type NodeRow = {
|
|
40
|
-
id: string;
|
|
41
|
-
url: string;
|
|
42
|
-
rolename: string | null;
|
|
43
|
-
region: string | null;
|
|
44
|
-
lastheartbeat: string | null;
|
|
45
|
-
status: string | null;
|
|
46
|
-
registeredat: string;
|
|
47
|
-
meta: string | null;
|
|
48
|
-
};
|
|
49
|
-
/** one sandboxes lifecycle row: the identity columns are always written
|
|
50
|
-
* non-null by createsandboxrecord; the usage counters and the optional
|
|
51
|
-
* per-sandbox quota stay nullable until their first stamp. */
|
|
52
|
-
export type SandboxRow = {
|
|
53
|
-
id: string;
|
|
54
|
-
userid: string | null;
|
|
55
|
-
model: string;
|
|
56
|
-
vcpus: number;
|
|
57
|
-
ramgb: number;
|
|
58
|
-
gpu: string;
|
|
59
|
-
state: string;
|
|
60
|
-
createdat: string;
|
|
61
|
-
expiresat: string | null;
|
|
62
|
-
files: number | null;
|
|
63
|
-
bytes: number | null;
|
|
64
|
-
quotabytes: number | null;
|
|
65
|
-
};
|
|
66
|
-
/** one sandboxfiles row projection (contents stay out of listfiles). */
|
|
67
|
-
export type SandboxFileRow = {
|
|
68
|
-
path: string;
|
|
69
|
-
size: number;
|
|
70
|
-
updatedat: string;
|
|
71
|
-
};
|
|
72
|
-
/** one stored workspace file document (content decoded from the blob cell). */
|
|
73
|
-
export type SandboxFileDoc = {
|
|
74
|
-
path: string;
|
|
75
|
-
content: string;
|
|
76
|
-
size: number;
|
|
77
|
-
updatedat: string;
|
|
78
|
-
};
|
|
79
|
-
/** the workspace usage counters of one sandbox. */
|
|
80
|
-
export type WorkspaceUsage = {
|
|
81
|
-
files: number;
|
|
82
|
-
bytes: number;
|
|
83
|
-
};
|
|
84
|
-
/** one events row: the payload stays the raw json text cell until the
|
|
85
|
-
* events poll parses it into the view document. */
|
|
86
|
-
export type EventRow = {
|
|
87
|
-
id: number;
|
|
88
|
-
topic: string | null;
|
|
89
|
-
payload: string | null;
|
|
90
|
-
nodeid: string | null;
|
|
91
|
-
createdat: string;
|
|
92
|
-
};
|
|
93
|
-
/** one audit row (register, login, logout, sandbox lifecycle, mesh
|
|
94
|
-
* registration). */
|
|
95
|
-
export type AuditRow = {
|
|
96
|
-
id: number;
|
|
97
|
-
userid: string | null;
|
|
98
|
-
action: string | null;
|
|
99
|
-
detail: string | null;
|
|
100
|
-
ip: string | null;
|
|
101
|
-
createdat: string;
|
|
102
|
-
};
|
|
103
|
-
/** one onboarding_states row (the entry-flow gates of a visitor). */
|
|
104
|
-
export type OnboardingStateRow = {
|
|
105
|
-
id: number;
|
|
106
|
-
visitor: string;
|
|
107
|
-
introseen: number;
|
|
108
|
-
onboardingseen: number;
|
|
109
|
-
updatedAt: string;
|
|
110
|
-
};
|
|
111
|
-
/** the boolean projection of the onboarding flags the gateway serves. */
|
|
112
|
-
export type OnboardingFlags = {
|
|
113
|
-
introseen: boolean;
|
|
114
|
-
onboardingseen: boolean;
|
|
115
|
-
};
|
|
116
|
-
/** one labels row: the interface copy store. the id is the page.widget.key
|
|
117
|
-
* path, the text rides the english source of truth (labels.ts), and the
|
|
118
|
-
* translated flag protects a runtime translation from the seed overwrite.
|
|
119
|
-
* the shape mirrors the browser seed rows in labels.ts one to one. */
|
|
120
|
-
export type LabelRow = {
|
|
121
|
-
id: string;
|
|
122
|
-
text: string;
|
|
123
|
-
revision: number;
|
|
124
|
-
updatedAt: string;
|
|
125
|
-
translated?: boolean;
|
|
126
|
-
};
|
|
127
|
-
/** the standardized database error: the machine readable code plus the
|
|
128
|
-
* non-enumerable internal and publicmessage properties set by dberror. */
|
|
129
|
-
export type DbError = Error & {
|
|
130
|
-
code: string;
|
|
131
|
-
internal?: string;
|
|
132
|
-
publicMessage?: string;
|
|
133
|
-
};
|
|
134
|
-
/** users row attributes accepted by createuser; the id and createdat are
|
|
135
|
-
* optional so the mesh forward path can pin the main node's values. */
|
|
136
|
-
export type UserFields = {
|
|
137
|
-
id?: string;
|
|
138
|
-
username: string;
|
|
139
|
-
passwordhash: string;
|
|
140
|
-
salt: string;
|
|
141
|
-
role?: string;
|
|
142
|
-
createdat?: string;
|
|
143
|
-
};
|
|
144
|
-
/** the stored user projection returned by createuser. */
|
|
145
|
-
export type UserProjection = {
|
|
146
|
-
id: string;
|
|
147
|
-
username: string;
|
|
148
|
-
role: string;
|
|
149
|
-
createdat: string;
|
|
150
|
-
};
|
|
151
|
-
/** sessions row attributes accepted by createsession. */
|
|
152
|
-
export type SessionFields = {
|
|
153
|
-
tokenhash: string;
|
|
154
|
-
userid: string;
|
|
155
|
-
expiresat: string;
|
|
156
|
-
ip?: string;
|
|
157
|
-
useragent?: string;
|
|
158
|
-
createdat?: string;
|
|
159
|
-
};
|
|
160
|
-
/** node announcement accepted by registernode. */
|
|
161
|
-
export type NodeAnnouncement = {
|
|
162
|
-
url: string;
|
|
163
|
-
rolename?: string;
|
|
164
|
-
region?: string;
|
|
165
|
-
meta?: string;
|
|
166
|
-
};
|
|
167
|
-
/** sandbox projection accepted by createsandboxrecord. */
|
|
168
|
-
export type SandboxRecordFields = {
|
|
169
|
-
id: string;
|
|
170
|
-
userid?: string;
|
|
171
|
-
model?: string;
|
|
172
|
-
vcpus?: number;
|
|
173
|
-
ramgb?: number;
|
|
174
|
-
gpu?: string;
|
|
175
|
-
state: string;
|
|
176
|
-
createdat?: string;
|
|
177
|
-
expiresat?: string;
|
|
178
|
-
quotabytes?: number | null;
|
|
179
|
-
};
|
|
180
|
-
/** event envelope accepted by addevent. */
|
|
181
|
-
export type EventFields = {
|
|
182
|
-
topic: string;
|
|
183
|
-
payload?: unknown;
|
|
184
|
-
nodeid?: string;
|
|
185
|
-
createdat?: string;
|
|
186
|
-
};
|
|
187
|
-
/** audit envelope accepted by addaudit. */
|
|
188
|
-
export type AuditFields = {
|
|
189
|
-
userid?: string | null;
|
|
190
|
-
action: string;
|
|
191
|
-
detail?: string;
|
|
192
|
-
ip?: string;
|
|
193
|
-
createdat?: string;
|
|
194
|
-
};
|
|
195
|
-
/** write receipt returned by writefile. */
|
|
196
|
-
export type WriteReceipt = {
|
|
197
|
-
path: string;
|
|
198
|
-
size: number;
|
|
199
|
-
updatedat: string;
|
|
200
|
-
};
|
|
201
|
-
/** the database file path resolved once at module load. */
|
|
202
|
-
export declare const dbpath: string;
|
|
203
|
-
/**
|
|
204
|
-
* resolves the per-sandbox workspace quota in bytes once per call: the
|
|
205
|
-
* saddle_sandbox_quota_bytes environment variable wins (any positive
|
|
206
|
-
* integer), otherwise the 16 mib default documented in the readme.
|
|
207
|
-
*
|
|
208
|
-
* @returns the quota in bytes.
|
|
209
|
-
*/
|
|
210
|
-
export declare function sandboxquota(): number;
|
|
211
|
-
/**
|
|
212
|
-
* creates one user row; the id is a fresh uuid unless the caller pins
|
|
213
|
-
* one (the mesh forward path caches the main node's user rows with
|
|
214
|
-
* their original ids so clone sessions resolve).
|
|
215
|
-
*
|
|
216
|
-
* @param fields the user attributes.
|
|
217
|
-
* @returns the stored user projection.
|
|
218
|
-
*/
|
|
219
|
-
export declare function createuser(fields: UserFields): UserProjection;
|
|
220
|
-
/**
|
|
221
|
-
* finds one user by username.
|
|
222
|
-
*
|
|
223
|
-
* @param username the exact username.
|
|
224
|
-
* @returns the full row or null when absent.
|
|
225
|
-
*/
|
|
226
|
-
export declare function finduserbyname(username: string): UserRow | null;
|
|
227
|
-
/**
|
|
228
|
-
* finds one user by id.
|
|
229
|
-
*
|
|
230
|
-
* @param id the user id.
|
|
231
|
-
* @returns the full row or null when absent.
|
|
232
|
-
*/
|
|
233
|
-
export declare function finduserbyid(id: string): UserRow | null;
|
|
234
|
-
/**
|
|
235
|
-
* lists every user ordered by creation time; the route layer projects
|
|
236
|
-
* out the password hash and salt columns.
|
|
237
|
-
*
|
|
238
|
-
* @returns the full user rows.
|
|
239
|
-
*/
|
|
240
|
-
export declare function listusers(): UserRow[];
|
|
241
|
-
/**
|
|
242
|
-
* stamps the last login column with the given timestamp.
|
|
243
|
-
*
|
|
244
|
-
* @param id the user id.
|
|
245
|
-
* @param isotime the iso timestamp.
|
|
246
|
-
* @returns void.
|
|
247
|
-
*/
|
|
248
|
-
export declare function updatelastlogin(id: string, isotime: string): void;
|
|
249
|
-
/**
|
|
250
|
-
* persists one session; only the sha256 token hash is stored, never the
|
|
251
|
-
* bearer token itself.
|
|
252
|
-
*
|
|
253
|
-
* @param fields the session attributes.
|
|
254
|
-
* @returns void.
|
|
255
|
-
*/
|
|
256
|
-
export declare function createsession(fields: SessionFields): void;
|
|
257
|
-
/**
|
|
258
|
-
* finds one session row by token hash; expiry is enforced by the caller
|
|
259
|
-
* (auth.ts) so clones can forward remote sessions verbatim.
|
|
260
|
-
*
|
|
261
|
-
* @param tokenhash the sha256 hex of the bearer token.
|
|
262
|
-
* @returns the session row or null.
|
|
263
|
-
*/
|
|
264
|
-
export declare function findsession(tokenhash: string): SessionRow | null;
|
|
265
|
-
/**
|
|
266
|
-
* deletes one session by token hash.
|
|
267
|
-
*
|
|
268
|
-
* @param tokenhash the sha256 hex of the bearer token.
|
|
269
|
-
* @returns true when a row was removed.
|
|
270
|
-
*/
|
|
271
|
-
export declare function deletesession(tokenhash: string): boolean;
|
|
272
|
-
/**
|
|
273
|
-
* removes every expired session (iso strings compare lexicographically).
|
|
274
|
-
* the main node schedules this sweep at boot.
|
|
275
|
-
*
|
|
276
|
-
* @returns the count of removed rows.
|
|
277
|
-
*/
|
|
278
|
-
export declare function cleansessions(): number;
|
|
279
|
-
/**
|
|
280
|
-
* registers or re-registers one node keyed by its url: an existing row
|
|
281
|
-
* for the same url is refreshed (new heartbeat, online status) instead
|
|
282
|
-
* of duplicated, so clones can re-register after a restart.
|
|
283
|
-
*
|
|
284
|
-
* @param fields the node announcement.
|
|
285
|
-
* @returns the registry row.
|
|
286
|
-
*/
|
|
287
|
-
export declare function registernode(fields: NodeAnnouncement): {
|
|
288
|
-
id: string;
|
|
289
|
-
url: string;
|
|
290
|
-
status: string;
|
|
291
|
-
};
|
|
292
|
-
/**
|
|
293
|
-
* stamps one node heartbeat.
|
|
294
|
-
*
|
|
295
|
-
* @param id the node id.
|
|
296
|
-
* @param isotime the heartbeat timestamp.
|
|
297
|
-
* @returns true when the node id exists.
|
|
298
|
-
*/
|
|
299
|
-
export declare function heartbeatnode(id: string, isotime: string): boolean;
|
|
300
|
-
/**
|
|
301
|
-
* lists every registered node ordered by registration time.
|
|
302
|
-
*
|
|
303
|
-
* @returns the node rows.
|
|
304
|
-
*/
|
|
305
|
-
export declare function listnodes(): NodeRow[];
|
|
306
|
-
/**
|
|
307
|
-
* persists one sandbox lifecycle row mirroring the in-memory record.
|
|
308
|
-
*
|
|
309
|
-
* @param fields the sandbox projection.
|
|
310
|
-
* @returns void.
|
|
311
|
-
*/
|
|
312
|
-
export declare function createsandboxrecord(fields: SandboxRecordFields): void;
|
|
313
|
-
/**
|
|
314
|
-
* updates the state column of one sandbox row (running, destroyed, ...).
|
|
315
|
-
*
|
|
316
|
-
* @param id the sandbox id.
|
|
317
|
-
* @param state the new state.
|
|
318
|
-
* @returns void.
|
|
319
|
-
*/
|
|
320
|
-
export declare function updatesandboxstate(id: string, state: string): void;
|
|
321
|
-
/**
|
|
322
|
-
* lists every sandbox row, newest first.
|
|
323
|
-
*
|
|
324
|
-
* @param limit the row cap.
|
|
325
|
-
* @returns the sandbox rows.
|
|
326
|
-
*/
|
|
327
|
-
export declare function listsandboxes(limit?: number): SandboxRow[];
|
|
328
|
-
/**
|
|
329
|
-
* lists the sandbox rows owned by one user, newest first.
|
|
330
|
-
*
|
|
331
|
-
* @param userid the owner id.
|
|
332
|
-
* @param limit the row cap.
|
|
333
|
-
* @returns the sandbox rows.
|
|
334
|
-
*/
|
|
335
|
-
export declare function listsandboxesbyuser(userid: string, limit?: number): SandboxRow[];
|
|
336
|
-
/**
|
|
337
|
-
* finds one sandbox row by id; the files surface resolves ownership
|
|
338
|
-
* through this lookup even when the in-memory record is gone (expired
|
|
339
|
-
* sandbox or restarted process).
|
|
340
|
-
*
|
|
341
|
-
* @param id the sandbox id.
|
|
342
|
-
* @returns the sandbox row or null.
|
|
343
|
-
*/
|
|
344
|
-
export declare function findsandboxbyid(id: string): SandboxRow | null;
|
|
345
|
-
/**
|
|
346
|
-
* stamps the workspace usage counters of one sandbox row.
|
|
347
|
-
*
|
|
348
|
-
* @param id the sandbox id.
|
|
349
|
-
* @param files the file count.
|
|
350
|
-
* @param bytes the total content bytes.
|
|
351
|
-
* @returns void.
|
|
352
|
-
*/
|
|
353
|
-
export declare function updatesandboxusage(id: string, files: number, bytes: number): void;
|
|
354
|
-
/**
|
|
355
|
-
* writes (or overwrites) one workspace file; the sandbox quota caps the
|
|
356
|
-
* summed size of every file of the sandbox and an over-quota write
|
|
357
|
-
* throws the standardized "quota exceeded" error without touching the
|
|
358
|
-
* stored rows.
|
|
359
|
-
*
|
|
360
|
-
* @param sandboxid the sandbox id.
|
|
361
|
-
* @param path the normalized absolute path.
|
|
362
|
-
* @param content the file text (null and undefined write as empty).
|
|
363
|
-
* @param customquota the optional per-sandbox quota in bytes, always
|
|
364
|
-
* capped by the node maximum.
|
|
365
|
-
* @returns the write receipt.
|
|
366
|
-
*/
|
|
367
|
-
export declare function writefile(sandboxid: string, path: string, content: string | null | undefined, customquota?: number): WriteReceipt;
|
|
368
|
-
/**
|
|
369
|
-
* reads one workspace file.
|
|
370
|
-
*
|
|
371
|
-
* @param sandboxid the sandbox id.
|
|
372
|
-
* @param path the normalized absolute path.
|
|
373
|
-
* @returns the file document or null when absent.
|
|
374
|
-
*/
|
|
375
|
-
export declare function readfile(sandboxid: string, path: string): SandboxFileDoc | null;
|
|
376
|
-
/**
|
|
377
|
-
* lists every workspace file of one sandbox ordered by path; contents
|
|
378
|
-
* stay out of the projection.
|
|
379
|
-
*
|
|
380
|
-
* @param sandboxid the sandbox id.
|
|
381
|
-
* @returns the file rows.
|
|
382
|
-
*/
|
|
383
|
-
export declare function listfiles(sandboxid: string): SandboxFileRow[];
|
|
384
|
-
/**
|
|
385
|
-
* deletes one workspace file.
|
|
386
|
-
*
|
|
387
|
-
* @param sandboxid the sandbox id.
|
|
388
|
-
* @param path the normalized absolute path.
|
|
389
|
-
* @returns true when a row was removed.
|
|
390
|
-
*/
|
|
391
|
-
export declare function deletefile(sandboxid: string, path: string): boolean;
|
|
392
|
-
/**
|
|
393
|
-
* removes every workspace file of one sandbox; the purge path of the
|
|
394
|
-
* delete endpoint calls this so a destroyed sandbox leaves nothing
|
|
395
|
-
* behind.
|
|
396
|
-
*
|
|
397
|
-
* @param sandboxid the sandbox id.
|
|
398
|
-
* @returns the count of removed rows.
|
|
399
|
-
*/
|
|
400
|
-
export declare function deletesandboxfiles(sandboxid: string): number;
|
|
401
|
-
/**
|
|
402
|
-
* sums the workspace usage of one sandbox.
|
|
403
|
-
*
|
|
404
|
-
* @param sandboxid the sandbox id.
|
|
405
|
-
* @returns the usage counters.
|
|
406
|
-
*/
|
|
407
|
-
export declare function sandboxusage(sandboxid: string): WorkspaceUsage;
|
|
408
|
-
/**
|
|
409
|
-
* appends one event row; the payload is stored as a json string.
|
|
410
|
-
*
|
|
411
|
-
* @param fields the event envelope.
|
|
412
|
-
* @returns the inserted event id.
|
|
413
|
-
*/
|
|
414
|
-
export declare function addevent(fields: EventFields): number;
|
|
415
|
-
/**
|
|
416
|
-
* lists the events with id greater than the cursor, oldest first, so
|
|
417
|
-
* the dashboard can poll /api/v1/events?since=<lastid>.
|
|
418
|
-
*
|
|
419
|
-
* @param since the exclusive id cursor.
|
|
420
|
-
* @param limit the row cap.
|
|
421
|
-
* @returns the event rows.
|
|
422
|
-
*/
|
|
423
|
-
export declare function listevents(since?: number, limit?: number): EventRow[];
|
|
424
|
-
/**
|
|
425
|
-
* appends one audit row (register, login, logout, sandbox lifecycle,
|
|
426
|
-
* mesh registration).
|
|
427
|
-
*
|
|
428
|
-
* @param fields the audit envelope.
|
|
429
|
-
* @returns the inserted audit id.
|
|
430
|
-
*/
|
|
431
|
-
export declare function addaudit(fields: AuditFields): number;
|
|
432
|
-
/**
|
|
433
|
-
* lists the audit trail, newest first.
|
|
434
|
-
*
|
|
435
|
-
* @param limit the row cap.
|
|
436
|
-
* @returns the audit rows.
|
|
437
|
-
*/
|
|
438
|
-
export declare function listaudit(limit?: number): AuditRow[];
|
|
439
|
-
/**
|
|
440
|
-
* reads the onboarding stage flags of one visitor (parameterized; null
|
|
441
|
-
* when the visitor never touched the flow). the platform gateway serves
|
|
442
|
-
* these over GET /api/v1/onboarding for the browser accessor
|
|
443
|
-
* onboardingstate.ts.
|
|
444
|
-
*
|
|
445
|
-
* @param visitor the stable visitor id.
|
|
446
|
-
* @returns the flags, or null when no row exists.
|
|
447
|
-
*/
|
|
448
|
-
export declare function getonboardingstate(visitor: string): OnboardingFlags | null;
|
|
449
|
-
/**
|
|
450
|
-
* marks one onboarding stage seen for a visitor — idempotent seen-wins
|
|
451
|
-
* upsert: the flags only ever move forward, so a replayed stage (or an
|
|
452
|
-
* out-of-order gateway write) never unsees an earlier one.
|
|
453
|
-
*
|
|
454
|
-
* @param visitor the stable visitor id.
|
|
455
|
-
* @param stage the stage being marked seen ("intro" or "onboarding"; the
|
|
456
|
-
* onboarding stage implies the intro — the flow order).
|
|
457
|
-
* @returns the flags as they stand after the write.
|
|
458
|
-
*/
|
|
459
|
-
export declare function setonboardingstage(visitor: string, stage: 'intro' | 'onboarding'): OnboardingFlags;
|
|
460
|
-
/**
|
|
461
|
-
* writes one label row (idempotent upsert; the caller owns the revision).
|
|
462
|
-
*
|
|
463
|
-
* @param id the page.widget.key path of the label.
|
|
464
|
-
* @param text the surface text.
|
|
465
|
-
* @param revision the manifest revision the text carries.
|
|
466
|
-
* @param translated true when the row carries a runtime translation.
|
|
467
|
-
* @returns the stored label projection.
|
|
468
|
-
*/
|
|
469
|
-
export declare function savelabel(id: string, text: string, revision: number, translated?: boolean): LabelRow;
|
|
470
|
-
/**
|
|
471
|
-
* reads one label row by its page.widget.key path.
|
|
472
|
-
*
|
|
473
|
-
* @param id the label id.
|
|
474
|
-
* @returns the row or null when absent.
|
|
475
|
-
*/
|
|
476
|
-
export declare function readlabel(id: string): LabelRow | null;
|
|
477
|
-
/**
|
|
478
|
-
* reads every label row of the store ordered by id.
|
|
479
|
-
*
|
|
480
|
-
* @returns the label rows.
|
|
481
|
-
*/
|
|
482
|
-
export declare function readalllabels(): LabelRow[];
|
|
483
|
-
/**
|
|
484
|
-
* ingests the english manifest of labels.ts into the labels table — the
|
|
485
|
-
* db-side twin of the browser seedlabels: idempotent, the changed rows
|
|
486
|
-
* refresh, and the translated rows stay protected from the overwrite.
|
|
487
|
-
*
|
|
488
|
-
* @returns the seeded and protected row counts.
|
|
489
|
-
*/
|
|
490
|
-
export declare function seedlabelrows(): Promise<{
|
|
491
|
-
seeded: number;
|
|
492
|
-
protected: number;
|
|
493
|
-
}>;
|
|
494
|
-
/**
|
|
495
|
-
* the overview counts consumed by get /api/v1/admin/overview.
|
|
496
|
-
*
|
|
497
|
-
* @returns the counts.
|
|
498
|
-
*/
|
|
499
|
-
export declare function counts(): {
|
|
500
|
-
users: number;
|
|
501
|
-
sessions: number;
|
|
502
|
-
nodes: number;
|
|
503
|
-
sandboxes: number;
|
|
504
|
-
events: number;
|
|
505
|
-
audit: number;
|
|
506
|
-
};
|
|
507
|
-
/**
|
|
508
|
-
* runs the cheapest possible query so /api/v1/health can report whether
|
|
509
|
-
* the database connection answers.
|
|
510
|
-
*
|
|
511
|
-
* @returns true when the round trip succeeds.
|
|
512
|
-
*/
|
|
513
|
-
export declare function healthcheck(): boolean;
|
|
514
|
-
/**
|
|
515
|
-
* applies the embedded schema migrations; exported for tools and tests
|
|
516
|
-
* that want to reset or verify the schema explicitly.
|
|
517
|
-
*
|
|
518
|
-
* @param target an optional database handle (defaults to the module
|
|
519
|
-
* connection).
|
|
520
|
-
* @returns void.
|
|
521
|
-
*/
|
|
522
|
-
export declare function executeschema(target?: DatabaseSync): void;
|
|
523
|
-
/** the store singleton: every api function plus close and dispose. */
|
|
524
|
-
declare const store: {
|
|
525
|
-
dbpath: string;
|
|
526
|
-
createuser: typeof createuser;
|
|
527
|
-
finduserbyname: typeof finduserbyname;
|
|
528
|
-
finduserbyid: typeof finduserbyid;
|
|
529
|
-
listusers: typeof listusers;
|
|
530
|
-
updatelastlogin: typeof updatelastlogin;
|
|
531
|
-
createsession: typeof createsession;
|
|
532
|
-
findsession: typeof findsession;
|
|
533
|
-
deletesession: typeof deletesession;
|
|
534
|
-
cleansessions: typeof cleansessions;
|
|
535
|
-
registernode: typeof registernode;
|
|
536
|
-
heartbeatnode: typeof heartbeatnode;
|
|
537
|
-
listnodes: typeof listnodes;
|
|
538
|
-
createsandboxrecord: typeof createsandboxrecord;
|
|
539
|
-
updatesandboxstate: typeof updatesandboxstate;
|
|
540
|
-
updatesandboxusage: typeof updatesandboxusage;
|
|
541
|
-
findsandboxbyid: typeof findsandboxbyid;
|
|
542
|
-
listsandboxes: typeof listsandboxes;
|
|
543
|
-
listsandboxesbyuser: typeof listsandboxesbyuser;
|
|
544
|
-
writefile: typeof writefile;
|
|
545
|
-
readfile: typeof readfile;
|
|
546
|
-
listfiles: typeof listfiles;
|
|
547
|
-
deletefile: typeof deletefile;
|
|
548
|
-
deletesandboxfiles: typeof deletesandboxfiles;
|
|
549
|
-
sandboxusage: typeof sandboxusage;
|
|
550
|
-
sandboxquota: typeof sandboxquota;
|
|
551
|
-
addevent: typeof addevent;
|
|
552
|
-
listevents: typeof listevents;
|
|
553
|
-
addaudit: typeof addaudit;
|
|
554
|
-
listaudit: typeof listaudit;
|
|
555
|
-
getonboardingstate: typeof getonboardingstate;
|
|
556
|
-
setonboardingstage: typeof setonboardingstage;
|
|
557
|
-
savelabel: typeof savelabel;
|
|
558
|
-
readlabel: typeof readlabel;
|
|
559
|
-
readalllabels: typeof readalllabels;
|
|
560
|
-
seedlabelrows: typeof seedlabelrows;
|
|
561
|
-
counts: typeof counts;
|
|
562
|
-
healthcheck: typeof healthcheck;
|
|
563
|
-
executeschema: typeof executeschema;
|
|
564
|
-
/** closes the connection (idempotent). */
|
|
565
|
-
close(): void;
|
|
566
|
-
/** explicit resource management: `using` support for node >= 24. */
|
|
567
|
-
[Symbol.dispose](): void;
|
|
568
|
-
};
|
|
569
|
-
export default store;
|