@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.
- package/Dockerfile +139 -55
- 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 -114
- package/dist/edgeplane.js +0 -305
- 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 -751
- 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 -43
- 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/api.d.ts
DELETED
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* shared api client for the React interface: one typed module replaces
|
|
3
|
-
* the three copies of apibase()/iscrossorigin()/apifetch() that lived
|
|
4
|
-
* inside login.js, register.js and dashboard.js. the api base resolves
|
|
5
|
-
* from the ?api= query string (persisted for convenience), the
|
|
6
|
-
* window.SADDLE_API global, the "saddle_api" localstorage key or
|
|
7
|
-
* same-origin; cross-origin targets switch to credentials: "include"
|
|
8
|
-
* so the saddlesession cookie still flows. json in, json out, family
|
|
9
|
-
* error handling.
|
|
10
|
-
*/
|
|
11
|
-
/** standardized error payload answered by every /api/v1 endpoint. */
|
|
12
|
-
export type ApiErrorBody = {
|
|
13
|
-
error: {
|
|
14
|
-
code: string;
|
|
15
|
-
message: string;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
/** health endpoint payload (/api/v1/health). */
|
|
19
|
-
export type HealthStatus = {
|
|
20
|
-
ok: boolean;
|
|
21
|
-
version: string;
|
|
22
|
-
uptime: number;
|
|
23
|
-
};
|
|
24
|
-
/** sandbox creation request carried by POST /api/v1/sandboxes. */
|
|
25
|
-
export type SandboxSpecPayload = {
|
|
26
|
-
model: string;
|
|
27
|
-
vcpus: number;
|
|
28
|
-
ramgb: number;
|
|
29
|
-
gpu: string;
|
|
30
|
-
mig: string;
|
|
31
|
-
quotamb?: number;
|
|
32
|
-
};
|
|
33
|
-
/** sandbox creation response. */
|
|
34
|
-
export type SandboxCreated = {
|
|
35
|
-
id: string;
|
|
36
|
-
state: string;
|
|
37
|
-
};
|
|
38
|
-
/** exec response shared by the api and the local engine dispatcher. */
|
|
39
|
-
export type ExecResult = {
|
|
40
|
-
output: string;
|
|
41
|
-
exitCode: number;
|
|
42
|
-
};
|
|
43
|
-
/** session payload answered by the auth endpoints (/api/v1/auth/*). */
|
|
44
|
-
export type ApiSession = {
|
|
45
|
-
user: string;
|
|
46
|
-
role: "admin" | "user";
|
|
47
|
-
issuedat: string;
|
|
48
|
-
expiresat: string;
|
|
49
|
-
};
|
|
50
|
-
declare global {
|
|
51
|
-
interface Window {
|
|
52
|
-
/** optional api base override for static-edge deployments. */
|
|
53
|
-
SADDLE_API?: string;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* resolves the api base: ?api= wins (and persists), then the window
|
|
58
|
-
* global, then localstorage, then same origin ("").
|
|
59
|
-
*
|
|
60
|
-
* @returns the trimmed api base ("" means same-origin).
|
|
61
|
-
*/
|
|
62
|
-
export declare function apibase(): string;
|
|
63
|
-
/**
|
|
64
|
-
* checks whether the api base points at a different origin.
|
|
65
|
-
*
|
|
66
|
-
* @param base the resolved api base ("" means same-origin).
|
|
67
|
-
* @returns true when the target is cross-origin.
|
|
68
|
-
*/
|
|
69
|
-
export declare function iscrossorigin(base: string): boolean;
|
|
70
|
-
/**
|
|
71
|
-
* fetch wrapper: json in, json out, credentials follow the origin.
|
|
72
|
-
* sets the content-type automatically whenever a body is present and
|
|
73
|
-
* switches to credentials: "include" for cross-origin bases so the
|
|
74
|
-
* session cookie still reaches the api.
|
|
75
|
-
*
|
|
76
|
-
* @param path the api path (must start with "/").
|
|
77
|
-
* @param init the fetch init; body must already be a json string.
|
|
78
|
-
* @returns the raw response for ok/status handling by the caller.
|
|
79
|
-
*/
|
|
80
|
-
export declare function apifetch(path: string, init?: RequestInit): Promise<Response>;
|
|
81
|
-
/**
|
|
82
|
-
* probes the api health endpoint with a short timeout.
|
|
83
|
-
*
|
|
84
|
-
* @param base the api base to probe ("" means same-origin).
|
|
85
|
-
* @param timeoutms abort budget in milliseconds.
|
|
86
|
-
* @returns the health payload when the api answers ok, null otherwise.
|
|
87
|
-
*/
|
|
88
|
-
export declare function fetchhealth(base: string, timeoutms?: number): Promise<HealthStatus | null>;
|
|
89
|
-
/**
|
|
90
|
-
* reads the {error:{code,message}} payload the family endpoints answer
|
|
91
|
-
* with; returns null when the body is not a recognizable error object.
|
|
92
|
-
*
|
|
93
|
-
* @param response a non-ok api response.
|
|
94
|
-
* @returns the error message when present, null otherwise.
|
|
95
|
-
*/
|
|
96
|
-
export declare function apierrormessage(response: Response): Promise<string | null>;
|
|
97
|
-
/**
|
|
98
|
-
* human label for the resolved api base, used by the auth pages status
|
|
99
|
-
* line ("api: same origin" or the cross-origin target with credentials).
|
|
100
|
-
*
|
|
101
|
-
* @returns the status line text.
|
|
102
|
-
*/
|
|
103
|
-
export declare function apistatustext(): string;
|
|
104
|
-
/** one modality record of the compute plan (the modalities endpoint). */
|
|
105
|
-
export type ModalityRecord = {
|
|
106
|
-
id: string;
|
|
107
|
-
label: string;
|
|
108
|
-
family: string;
|
|
109
|
-
isolation: string;
|
|
110
|
-
state: "live" | "host" | "planned";
|
|
111
|
-
drivers: string[];
|
|
112
|
-
hardening: string[];
|
|
113
|
-
boot: "hot" | "warm" | "cold";
|
|
114
|
-
bootms: number;
|
|
115
|
-
gpu: boolean;
|
|
116
|
-
network: boolean;
|
|
117
|
-
mime: string;
|
|
118
|
-
};
|
|
119
|
-
/** the modality plan payload answered by the modalities endpoint. */
|
|
120
|
-
export type ModalityPlan = {
|
|
121
|
-
plancount: number;
|
|
122
|
-
live: number;
|
|
123
|
-
host: number;
|
|
124
|
-
planned: number;
|
|
125
|
-
records: ModalityRecord[];
|
|
126
|
-
};
|
|
127
|
-
/** one edge lane of the sandbox modality surface (the edge lanes endpoint). */
|
|
128
|
-
export type EdgeLane = {
|
|
129
|
-
modality: string;
|
|
130
|
-
kind: "live" | "host";
|
|
131
|
-
runtime: string;
|
|
132
|
-
probed: boolean;
|
|
133
|
-
present: boolean;
|
|
134
|
-
};
|
|
135
|
-
/**
|
|
136
|
-
* fetches the compute modality plan with a short timeout: the counts and
|
|
137
|
-
* the records the compute face renders. the surface never invents rows —
|
|
138
|
-
* when the engine does not answer the caller renders the honest line.
|
|
139
|
-
*
|
|
140
|
-
* @param base the api base to query ("" means same-origin).
|
|
141
|
-
* @param timeoutms abort budget in milliseconds.
|
|
142
|
-
* @returns the plan payload when the api answers ok, null otherwise.
|
|
143
|
-
*/
|
|
144
|
-
export declare function fetchmodalities(base?: string, timeoutms?: number): Promise<ModalityPlan | null>;
|
|
145
|
-
/**
|
|
146
|
-
* fetches the edge lane table with a short timeout: one row per live or
|
|
147
|
-
* host modality with its runtime and probe outcome; null when the engine
|
|
148
|
-
* does not answer.
|
|
149
|
-
*
|
|
150
|
-
* @param base the api base to query ("" means same-origin).
|
|
151
|
-
* @param timeoutms abort budget in milliseconds.
|
|
152
|
-
* @returns the lane list when the api answers ok, null otherwise.
|
|
153
|
-
*/
|
|
154
|
-
export declare function fetchedgelanes(base?: string, timeoutms?: number): Promise<EdgeLane[]>;
|
package/dist/api.js
DELETED
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* shared api client for the React interface: one typed module replaces
|
|
3
|
-
* the three copies of apibase()/iscrossorigin()/apifetch() that lived
|
|
4
|
-
* inside login.js, register.js and dashboard.js. the api base resolves
|
|
5
|
-
* from the ?api= query string (persisted for convenience), the
|
|
6
|
-
* window.SADDLE_API global, the "saddle_api" localstorage key or
|
|
7
|
-
* same-origin; cross-origin targets switch to credentials: "include"
|
|
8
|
-
* so the saddlesession cookie still flows. json in, json out, family
|
|
9
|
-
* error handling.
|
|
10
|
-
*/
|
|
11
|
-
/** localstorage key carrying the persisted api base override. */
|
|
12
|
-
const apistoragekey = "saddle_api";
|
|
13
|
-
/**
|
|
14
|
-
* resolves the api base: ?api= wins (and persists), then the window
|
|
15
|
-
* global, then localstorage, then same origin ("").
|
|
16
|
-
*
|
|
17
|
-
* @returns the trimmed api base ("" means same-origin).
|
|
18
|
-
*/
|
|
19
|
-
export function apibase() {
|
|
20
|
-
try {
|
|
21
|
-
const fromquery = new URLSearchParams(window.location.search).get("api");
|
|
22
|
-
if (fromquery !== null && fromquery.trim() !== "") {
|
|
23
|
-
const trimmed = fromquery.trim().replace(/\/+$/, "");
|
|
24
|
-
window.localStorage.setItem(apistoragekey, trimmed);
|
|
25
|
-
return trimmed;
|
|
26
|
-
}
|
|
27
|
-
const preset = window.SADDLE_API || window.localStorage.getItem(apistoragekey) || "";
|
|
28
|
-
return String(preset).trim().replace(/\/+$/, "");
|
|
29
|
-
}
|
|
30
|
-
catch {
|
|
31
|
-
return "";
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* checks whether the api base points at a different origin.
|
|
36
|
-
*
|
|
37
|
-
* @param base the resolved api base ("" means same-origin).
|
|
38
|
-
* @returns true when the target is cross-origin.
|
|
39
|
-
*/
|
|
40
|
-
export function iscrossorigin(base) {
|
|
41
|
-
if (base === "")
|
|
42
|
-
return false;
|
|
43
|
-
try {
|
|
44
|
-
return new URL(base, window.location.href).origin !== window.location.origin;
|
|
45
|
-
}
|
|
46
|
-
catch {
|
|
47
|
-
return false;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* fetch wrapper: json in, json out, credentials follow the origin.
|
|
52
|
-
* sets the content-type automatically whenever a body is present and
|
|
53
|
-
* switches to credentials: "include" for cross-origin bases so the
|
|
54
|
-
* session cookie still reaches the api.
|
|
55
|
-
*
|
|
56
|
-
* @param path the api path (must start with "/").
|
|
57
|
-
* @param init the fetch init; body must already be a json string.
|
|
58
|
-
* @returns the raw response for ok/status handling by the caller.
|
|
59
|
-
*/
|
|
60
|
-
export async function apifetch(path, init = {}) {
|
|
61
|
-
const base = apibase();
|
|
62
|
-
const headers = new Headers(init.headers);
|
|
63
|
-
if (init.body !== undefined && !headers.has("content-type")) {
|
|
64
|
-
headers.set("content-type", "application/json");
|
|
65
|
-
}
|
|
66
|
-
const credentials = iscrossorigin(base) ? "include" : "same-origin";
|
|
67
|
-
return fetch(`${base}${path}`, { ...init, headers, credentials });
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* probes the api health endpoint with a short timeout.
|
|
71
|
-
*
|
|
72
|
-
* @param base the api base to probe ("" means same-origin).
|
|
73
|
-
* @param timeoutms abort budget in milliseconds.
|
|
74
|
-
* @returns the health payload when the api answers ok, null otherwise.
|
|
75
|
-
*/
|
|
76
|
-
export async function fetchhealth(base, timeoutms = 1500) {
|
|
77
|
-
try {
|
|
78
|
-
const url = `${base ? base.replace(/\/+$/, "") : ""}/api/v1/health`;
|
|
79
|
-
const controller = new AbortController();
|
|
80
|
-
const timer = setTimeout(() => controller.abort(), timeoutms);
|
|
81
|
-
const response = await fetch(url, { signal: controller.signal });
|
|
82
|
-
clearTimeout(timer);
|
|
83
|
-
if (!response.ok)
|
|
84
|
-
return null;
|
|
85
|
-
const body = (await response.json());
|
|
86
|
-
return body && body.ok === true ? body : null;
|
|
87
|
-
}
|
|
88
|
-
catch {
|
|
89
|
-
return null;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* reads the {error:{code,message}} payload the family endpoints answer
|
|
94
|
-
* with; returns null when the body is not a recognizable error object.
|
|
95
|
-
*
|
|
96
|
-
* @param response a non-ok api response.
|
|
97
|
-
* @returns the error message when present, null otherwise.
|
|
98
|
-
*/
|
|
99
|
-
export async function apierrormessage(response) {
|
|
100
|
-
try {
|
|
101
|
-
const payload = (await response.json());
|
|
102
|
-
if (payload?.error && typeof payload.error.message === "string") {
|
|
103
|
-
return payload.error.message;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
catch {
|
|
107
|
-
/* keep null: the generic message stays */
|
|
108
|
-
}
|
|
109
|
-
return null;
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* human label for the resolved api base, used by the auth pages status
|
|
113
|
-
* line ("api: same origin" or the cross-origin target with credentials).
|
|
114
|
-
*
|
|
115
|
-
* @returns the status line text.
|
|
116
|
-
*/
|
|
117
|
-
export function apistatustext() {
|
|
118
|
-
const base = apibase();
|
|
119
|
-
return base === "" ? "api: same origin" : `api: ${base} (cross-origin, credentials: include)`;
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* fetches the compute modality plan with a short timeout: the counts and
|
|
123
|
-
* the records the compute face renders. the surface never invents rows —
|
|
124
|
-
* when the engine does not answer the caller renders the honest line.
|
|
125
|
-
*
|
|
126
|
-
* @param base the api base to query ("" means same-origin).
|
|
127
|
-
* @param timeoutms abort budget in milliseconds.
|
|
128
|
-
* @returns the plan payload when the api answers ok, null otherwise.
|
|
129
|
-
*/
|
|
130
|
-
export async function fetchmodalities(base = apibase(), timeoutms = 3000) {
|
|
131
|
-
try {
|
|
132
|
-
const url = `${base ? base.replace(/\/+$/, "") : ""}/api/v1/modalities`;
|
|
133
|
-
const controller = new AbortController();
|
|
134
|
-
const timer = setTimeout(() => controller.abort(), timeoutms);
|
|
135
|
-
const response = await fetch(url, { signal: controller.signal });
|
|
136
|
-
clearTimeout(timer);
|
|
137
|
-
if (!response.ok)
|
|
138
|
-
return null;
|
|
139
|
-
const body = (await response.json());
|
|
140
|
-
if (body === null || !Array.isArray(body.records))
|
|
141
|
-
return null;
|
|
142
|
-
return body;
|
|
143
|
-
}
|
|
144
|
-
catch {
|
|
145
|
-
return null;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* fetches the edge lane table with a short timeout: one row per live or
|
|
150
|
-
* host modality with its runtime and probe outcome; null when the engine
|
|
151
|
-
* does not answer.
|
|
152
|
-
*
|
|
153
|
-
* @param base the api base to query ("" means same-origin).
|
|
154
|
-
* @param timeoutms abort budget in milliseconds.
|
|
155
|
-
* @returns the lane list when the api answers ok, null otherwise.
|
|
156
|
-
*/
|
|
157
|
-
export async function fetchedgelanes(base = apibase(), timeoutms = 3000) {
|
|
158
|
-
try {
|
|
159
|
-
const url = `${base ? base.replace(/\/+$/, "") : ""}/api/v1/edge/lanes`;
|
|
160
|
-
const controller = new AbortController();
|
|
161
|
-
const timer = setTimeout(() => controller.abort(), timeoutms);
|
|
162
|
-
const response = await fetch(url, { signal: controller.signal });
|
|
163
|
-
clearTimeout(timer);
|
|
164
|
-
if (!response.ok)
|
|
165
|
-
return null;
|
|
166
|
-
const body = (await response.json());
|
|
167
|
-
if (body === null || !Array.isArray(body.lanes))
|
|
168
|
-
return null;
|
|
169
|
-
return body.lanes;
|
|
170
|
-
}
|
|
171
|
-
catch {
|
|
172
|
-
return null;
|
|
173
|
-
}
|
|
174
|
-
}
|
package/dist/auth.d.ts
DELETED
|
@@ -1,268 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* auth.ts — security layer for the saddle web node (v7-BACK).
|
|
3
|
-
*
|
|
4
|
-
* everything that touches credentials and sessions lives here: scrypt
|
|
5
|
-
* password hashing (n=16384, r=8, p=1) with timing-safe verification,
|
|
6
|
-
* opaque base64url session tokens stored only as sha256 hashes, the
|
|
7
|
-
* saddlesession cookie builder, the in-memory ip rate limiter, and the
|
|
8
|
-
* requireauth/requireadmin request guards. the bootstrap rule is part
|
|
9
|
-
* of the contract: the first user registered on a node with zero users
|
|
10
|
-
* is granted role admin (see createsession caller in server.ts), so a
|
|
11
|
-
* fresh main or standalone node always has one operator.
|
|
12
|
-
*
|
|
13
|
-
* contexts (9): passwordhashing, sessiontokens, sessionstore, cookies,
|
|
14
|
-
* ratelimiter, requestguards, usernamepolicy, timingequalizer,
|
|
15
|
-
* bootstrap.
|
|
16
|
-
*
|
|
17
|
-
* rules: lowercase identifiers, english jsdoc in third person, no emoji,
|
|
18
|
-
* try/catch on every fallible path, node:* modules only, zero
|
|
19
|
-
* dependencies, no hardcoded localhost anywhere.
|
|
20
|
-
*/
|
|
21
|
-
import type { IncomingMessage } from 'node:http';
|
|
22
|
-
/** the request context of one session mint plus an optional ttl override. */
|
|
23
|
-
export type SessionContext = {
|
|
24
|
-
ip?: string;
|
|
25
|
-
useragent?: string;
|
|
26
|
-
ttlms?: number;
|
|
27
|
-
};
|
|
28
|
-
/** the minted session values handed to the register/login routes. */
|
|
29
|
-
export type SessionMaterial = {
|
|
30
|
-
token: string;
|
|
31
|
-
tokenhash: string;
|
|
32
|
-
expiresat: string;
|
|
33
|
-
};
|
|
34
|
-
/** a session minted by the main node and relayed to the clone. */
|
|
35
|
-
export type ForwardedSession = {
|
|
36
|
-
token: string;
|
|
37
|
-
userid: string;
|
|
38
|
-
expiresat: string;
|
|
39
|
-
ip?: string;
|
|
40
|
-
useragent?: string;
|
|
41
|
-
};
|
|
42
|
-
/** the authenticated user projection resolved by requireauth. */
|
|
43
|
-
export type SessionUser = {
|
|
44
|
-
id: string;
|
|
45
|
-
username: string;
|
|
46
|
-
role: string;
|
|
47
|
-
expiresat: string;
|
|
48
|
-
};
|
|
49
|
-
/** the success arm of a policy validation. */
|
|
50
|
-
export type ValidationOk = {
|
|
51
|
-
ok: true;
|
|
52
|
-
};
|
|
53
|
-
/** the failure arm of a policy validation. */
|
|
54
|
-
export type ValidationError = {
|
|
55
|
-
ok: false;
|
|
56
|
-
code: string;
|
|
57
|
-
message: string;
|
|
58
|
-
};
|
|
59
|
-
/** the outcome of a username or password policy check. */
|
|
60
|
-
export type ValidationOutcome = ValidationOk | ValidationError;
|
|
61
|
-
/** one in-memory rate limit bucket. */
|
|
62
|
-
export type RateBucket = {
|
|
63
|
-
count: number;
|
|
64
|
-
resetat: number;
|
|
65
|
-
};
|
|
66
|
-
/** the verdict of the in-memory rate limiter. */
|
|
67
|
-
export type RateVerdict = {
|
|
68
|
-
allowed: boolean;
|
|
69
|
-
retryafter: number;
|
|
70
|
-
};
|
|
71
|
-
/** one pinned rate limit window. */
|
|
72
|
-
export type RateWindow = {
|
|
73
|
-
limit: number;
|
|
74
|
-
windowms: number;
|
|
75
|
-
};
|
|
76
|
-
/** the augmented request shape requireauth injects the resolved user and
|
|
77
|
-
* the raw token on; the augmentation below carries the two optional
|
|
78
|
-
* properties onto every node:http incoming message in the project. */
|
|
79
|
-
export type AuthedRequest = IncomingMessage & {
|
|
80
|
-
user?: SessionUser;
|
|
81
|
-
sessiontoken?: string;
|
|
82
|
-
};
|
|
83
|
-
declare module 'node:http' {
|
|
84
|
-
interface IncomingMessage {
|
|
85
|
-
user?: SessionUser;
|
|
86
|
-
sessiontoken?: string;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* hashes one password with scrypt and a fresh 32-byte random salt.
|
|
91
|
-
*
|
|
92
|
-
* @param password the plaintext password (8-128 chars,
|
|
93
|
-
* enforced by the route layer).
|
|
94
|
-
* @returns the hex digest and the hex salt, both ready for the users row.
|
|
95
|
-
*/
|
|
96
|
-
export declare function hashpassword(password: string): {
|
|
97
|
-
passwordhash: string;
|
|
98
|
-
salt: string;
|
|
99
|
-
};
|
|
100
|
-
/**
|
|
101
|
-
* verifies one password against a stored hash and salt using
|
|
102
|
-
* timingSafeEqual; any input or encoding failure resolves to false so
|
|
103
|
-
* callers never leak the failure reason.
|
|
104
|
-
*
|
|
105
|
-
* @param password the plaintext candidate.
|
|
106
|
-
* @param passwordhash the stored hex digest.
|
|
107
|
-
* @param salt the stored hex salt.
|
|
108
|
-
* @returns true when the password matches.
|
|
109
|
-
*/
|
|
110
|
-
export declare function verifypassword(password: string, passwordhash: string, salt: string): boolean;
|
|
111
|
-
/**
|
|
112
|
-
* burns one scrypt round against the dummy pair so a login for an
|
|
113
|
-
* unknown username costs the same time as a login for a real one.
|
|
114
|
-
*
|
|
115
|
-
* @returns always false.
|
|
116
|
-
*/
|
|
117
|
-
declare function burndummy(): boolean;
|
|
118
|
-
/**
|
|
119
|
-
* mints one opaque session token: 32 random bytes in base64url.
|
|
120
|
-
*
|
|
121
|
-
* @returns the bearer/cookie token.
|
|
122
|
-
*/
|
|
123
|
-
export declare function sessiontoken(): string;
|
|
124
|
-
/**
|
|
125
|
-
* derives the sha256 hex digest stored in the sessions table; the raw
|
|
126
|
-
* token never touches the database.
|
|
127
|
-
*
|
|
128
|
-
* @param token the raw session token.
|
|
129
|
-
* @returns the hex token hash.
|
|
130
|
-
*/
|
|
131
|
-
export declare function tokenhash(token: string): string;
|
|
132
|
-
/**
|
|
133
|
-
* creates one session row for a user and returns the token material.
|
|
134
|
-
*
|
|
135
|
-
* @param userid the user id.
|
|
136
|
-
* @param context the request context and an optional ttl override.
|
|
137
|
-
* @returns the minted session values.
|
|
138
|
-
*/
|
|
139
|
-
export declare function createsession(userid: string, context?: SessionContext): SessionMaterial;
|
|
140
|
-
/**
|
|
141
|
-
* caches one session minted elsewhere (the mesh main node) into the
|
|
142
|
-
* local sessions table with the remote userid.
|
|
143
|
-
*
|
|
144
|
-
* @param fields the forwarded session.
|
|
145
|
-
* @returns void.
|
|
146
|
-
*/
|
|
147
|
-
export declare function cachesession(fields: ForwardedSession): void;
|
|
148
|
-
/**
|
|
149
|
-
* resolves the user behind one raw token: hash lookup, expiry check and
|
|
150
|
-
* user projection in one call.
|
|
151
|
-
*
|
|
152
|
-
* @param token the raw session token.
|
|
153
|
-
* @returns the user or null when the session is
|
|
154
|
-
* missing, expired or orphaned.
|
|
155
|
-
*/
|
|
156
|
-
export declare function getsessionuser(token: string): SessionUser | null;
|
|
157
|
-
/**
|
|
158
|
-
* destroys one session by raw token.
|
|
159
|
-
*
|
|
160
|
-
* @param token the raw session token.
|
|
161
|
-
* @returns true when a session row was removed.
|
|
162
|
-
*/
|
|
163
|
-
export declare function destroysession(token: string): boolean;
|
|
164
|
-
/** the session cookie name shared by every node in the mesh. */
|
|
165
|
-
export declare const cookiename = "saddlesession";
|
|
166
|
-
/**
|
|
167
|
-
* builds the set-cookie value for one session token: HttpOnly,
|
|
168
|
-
* SameSite=Strict, Path=/, Max-Age=86400 and Secure whenever the
|
|
169
|
-
* request arrived through https (directly or via x-forwarded-proto).
|
|
170
|
-
*
|
|
171
|
-
* @param token the raw session token.
|
|
172
|
-
* @param req the incoming request, used only to detect https.
|
|
173
|
-
* @returns the set-cookie header value.
|
|
174
|
-
*/
|
|
175
|
-
export declare function cookiefor(token: string, req?: IncomingMessage): string;
|
|
176
|
-
/**
|
|
177
|
-
* builds the expiring set-cookie value used by logout.
|
|
178
|
-
*
|
|
179
|
-
* @returns the set-cookie header value clearing the cookie.
|
|
180
|
-
*/
|
|
181
|
-
export declare function cookieclear(): string;
|
|
182
|
-
/**
|
|
183
|
-
* extracts the session token from the saddlesession cookie or the
|
|
184
|
-
* Authorization: Bearer header of one request.
|
|
185
|
-
*
|
|
186
|
-
* @param req the incoming request.
|
|
187
|
-
* @returns the raw token or null.
|
|
188
|
-
*/
|
|
189
|
-
export declare function extracttoken(req: IncomingMessage): string | null;
|
|
190
|
-
/**
|
|
191
|
-
* the auth guard: reads the cookie or bearer token, resolves the
|
|
192
|
-
* session and injects req.user = {id, username, role, expiresat}.
|
|
193
|
-
*
|
|
194
|
-
* @param req the incoming request.
|
|
195
|
-
* @returns the injected user or null when
|
|
196
|
-
* unauthenticated.
|
|
197
|
-
*/
|
|
198
|
-
export declare function requireauth(req: IncomingMessage): SessionUser | null;
|
|
199
|
-
/**
|
|
200
|
-
* the admin guard: requireauth plus the admin role check.
|
|
201
|
-
*
|
|
202
|
-
* @param req the incoming request.
|
|
203
|
-
* @returns the admin user or null.
|
|
204
|
-
*/
|
|
205
|
-
export declare function requireadmin(req: IncomingMessage): SessionUser | null;
|
|
206
|
-
/**
|
|
207
|
-
* validates one username candidate against the v7 policy; the candidate
|
|
208
|
-
* is coerced defensively so route layers can pass raw json fields.
|
|
209
|
-
*
|
|
210
|
-
* @param username the candidate.
|
|
211
|
-
* @returns the validation outcome.
|
|
212
|
-
*/
|
|
213
|
-
export declare function validateusername(username: unknown): ValidationOutcome;
|
|
214
|
-
/**
|
|
215
|
-
* validates one password candidate against the v7 policy (8-128 chars);
|
|
216
|
-
* the candidate is coerced defensively so route layers can pass raw json
|
|
217
|
-
* fields.
|
|
218
|
-
*
|
|
219
|
-
* @param password the candidate.
|
|
220
|
-
* @returns the validation outcome.
|
|
221
|
-
*/
|
|
222
|
-
export declare function validatepassword(password: unknown): ValidationOutcome;
|
|
223
|
-
/**
|
|
224
|
-
* the in-memory rate limiter with lazy sweeping: every hit refreshes
|
|
225
|
-
* its own window and, once the map grows past the sweep limit, expired
|
|
226
|
-
* buckets from other keys are dropped.
|
|
227
|
-
*
|
|
228
|
-
* @param bucketkey the bucket key (e.g. `login:10.0.0.1`).
|
|
229
|
-
* @param limit the allowed hits per window.
|
|
230
|
-
* @param windowms the window length in milliseconds.
|
|
231
|
-
* @returns the verdict plus the retry-after seconds for 429 responses.
|
|
232
|
-
*/
|
|
233
|
-
export declare function ratelimit(bucketkey: string, limit: number, windowms: number): RateVerdict;
|
|
234
|
-
/** the two pinned buckets from the v7 contract. */
|
|
235
|
-
export declare const ratelimits: {
|
|
236
|
-
register: RateWindow;
|
|
237
|
-
login: RateWindow;
|
|
238
|
-
};
|
|
239
|
-
/**
|
|
240
|
-
* the ONLY admin usernames: the CODEOWNERS allowlist (iakadion,
|
|
241
|
-
* inathlan, aasblor and nasblor). the web admin surface mirrors the
|
|
242
|
-
* repository CODEOWNERS file - the two files are the same contract.
|
|
243
|
-
*/
|
|
244
|
-
export declare const adminusernames: string[];
|
|
245
|
-
/**
|
|
246
|
-
* resolves the role for a new registration: only the CODEOWNERS
|
|
247
|
-
* usernames are admins; every other account (including the very first
|
|
248
|
-
* registration) is a plain user. the seeded admins below guarantee the
|
|
249
|
-
* allowlist accounts exist before anyone registers.
|
|
250
|
-
*
|
|
251
|
-
* @param username the requested username.
|
|
252
|
-
* @returns the role for the new row.
|
|
253
|
-
*/
|
|
254
|
-
export declare function bootstraprole(username?: string): 'admin' | 'user';
|
|
255
|
-
/**
|
|
256
|
-
* creates the CODEOWNERS admin accounts with the resolved bootstrap
|
|
257
|
-
* password (the env pin, or the per-boot mint) when the database does not
|
|
258
|
-
* carry them yet. idempotent: an admin the operator re-registered with a
|
|
259
|
-
* rotated password is never overwritten. runs on every node boot so a
|
|
260
|
-
* wiped database never locks the admin surface out. when the password was
|
|
261
|
-
* minted for this boot, the one-time secret is written to the operator
|
|
262
|
-
* console exactly once - only for the rows that actually landed.
|
|
263
|
-
*
|
|
264
|
-
* @returns the admin usernames that were created.
|
|
265
|
-
*/
|
|
266
|
-
export declare function seedadmins(): string[];
|
|
267
|
-
/** burn dummy re-exported for tests that assert timing equality. */
|
|
268
|
-
export { burndummy };
|