@koed-labs/server 0.0.0-stage → 0.11.1
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/LICENSE +201 -0
- package/README.md +64 -2
- package/bin/koed.js +7 -0
- package/package.json +26 -4
- package/third-party-notices.json +92 -0
- package/vendor/chunk-2XKSVKQA.js +49 -0
- package/vendor/chunk-4OO6VAU3.js +259 -0
- package/vendor/chunk-53ZFCDHP.js +332 -0
- package/vendor/chunk-6JRWGOQG.js +236 -0
- package/vendor/chunk-6KS67EQE.js +75 -0
- package/vendor/chunk-7EGSY3E4.js +8 -0
- package/vendor/chunk-7FSHVVTZ.js +128 -0
- package/vendor/chunk-7NOQSX4T.js +14 -0
- package/vendor/chunk-7NXKPDF3.js +1586 -0
- package/vendor/chunk-ALJUSOF7.js +175 -0
- package/vendor/chunk-AVQCUFYQ.js +16 -0
- package/vendor/chunk-BGENSONI.js +18 -0
- package/vendor/chunk-BTS4ZTF3.js +43 -0
- package/vendor/chunk-BUIM2M4R.js +22 -0
- package/vendor/chunk-C4V72GXC.js +194 -0
- package/vendor/chunk-C5SNDPAP.js +2472 -0
- package/vendor/chunk-CHMH4LH5.js +2497 -0
- package/vendor/chunk-EA4QDDQA.js +58 -0
- package/vendor/chunk-EDPNYIX5.js +5448 -0
- package/vendor/chunk-FN3HUUO2.js +1974 -0
- package/vendor/chunk-FSNLU46W.js +14548 -0
- package/vendor/chunk-FYYRFX4U.js +4423 -0
- package/vendor/chunk-GFASBPV2.js +42 -0
- package/vendor/chunk-HC76426R.js +48 -0
- package/vendor/chunk-IY2HRXOZ.js +99 -0
- package/vendor/chunk-JBGD4JLR.js +3779 -0
- package/vendor/chunk-JYK6UL6D.js +261 -0
- package/vendor/chunk-LRP66XEY.js +13907 -0
- package/vendor/chunk-NOU7RHYZ.js +26 -0
- package/vendor/chunk-NVTMIAAF.js +113 -0
- package/vendor/chunk-O7DW2VAV.js +14 -0
- package/vendor/chunk-OCILJ737.js +299 -0
- package/vendor/chunk-PL3LWC5C.js +754 -0
- package/vendor/chunk-QRKHHWJJ.js +104 -0
- package/vendor/chunk-QT24SAW6.js +110 -0
- package/vendor/chunk-RCR4XPE3.js +26020 -0
- package/vendor/chunk-SHLRINKO.js +73 -0
- package/vendor/chunk-SNKWETM5.js +35 -0
- package/vendor/chunk-SRKIBFOE.js +242 -0
- package/vendor/chunk-T6UB5PNX.js +124 -0
- package/vendor/chunk-TG26CZGQ.js +23 -0
- package/vendor/chunk-TISYUUEJ.js +188 -0
- package/vendor/chunk-TSAYTRX3.js +89 -0
- package/vendor/chunk-TVYEB2GN.js +343 -0
- package/vendor/chunk-UB6JCVQ3.js +461 -0
- package/vendor/chunk-V67IQB7H.js +153 -0
- package/vendor/chunk-VGIYSDNU.js +522 -0
- package/vendor/chunk-W2HNI6AA.js +75 -0
- package/vendor/chunk-W2OJZZ6X.js +20 -0
- package/vendor/chunk-WDFERJG3.js +2208 -0
- package/vendor/chunk-WPIEF4LY.js +1647 -0
- package/vendor/chunk-XIZVLPHZ.js +18 -0
- package/vendor/chunk-YZLQZU5E.js +46 -0
- package/vendor/chunk-Z5WCAUA6.js +148 -0
- package/vendor/chunk-ZIOKV2X6.js +1589 -0
- package/vendor/chunk-ZOHNXUDY.js +12501 -0
- package/vendor/chunk-ZUDSZGVO.js +11 -0
- package/vendor/cli.js +7 -0
- package/vendor/component-manifest-catalog.js +9 -0
- package/vendor/control-plane.js +28 -0
- package/vendor/package.json +1 -0
- package/vendor/privacy-service-bootstrap.js +6 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { createRequire as createKoedRequire } from "node:module"; const require = createKoedRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
activateServerPackage,
|
|
4
|
+
assertPackageMigrationCompatible,
|
|
5
|
+
cleanupServerPackages,
|
|
6
|
+
collectServerPackageStatus,
|
|
7
|
+
extractNativeArchive,
|
|
8
|
+
extractVerifiedPackageArchive,
|
|
9
|
+
installServerPackage,
|
|
10
|
+
isVersionDowngrade,
|
|
11
|
+
packageExtractionLimits,
|
|
12
|
+
packageProvenanceSchemaVersion,
|
|
13
|
+
requiredPackageRuntimeFiles,
|
|
14
|
+
sha256File,
|
|
15
|
+
standalonePackageId,
|
|
16
|
+
standalonePackageKind,
|
|
17
|
+
standalonePackageSchemaVersion,
|
|
18
|
+
validateServerPackageRoot
|
|
19
|
+
} from "./chunk-ZIOKV2X6.js";
|
|
20
|
+
import "./chunk-QRKHHWJJ.js";
|
|
21
|
+
import "./chunk-7EGSY3E4.js";
|
|
22
|
+
import "./chunk-IY2HRXOZ.js";
|
|
23
|
+
import "./chunk-FSNLU46W.js";
|
|
24
|
+
import "./chunk-BTS4ZTF3.js";
|
|
25
|
+
export {
|
|
26
|
+
activateServerPackage,
|
|
27
|
+
assertPackageMigrationCompatible,
|
|
28
|
+
cleanupServerPackages,
|
|
29
|
+
collectServerPackageStatus,
|
|
30
|
+
extractNativeArchive,
|
|
31
|
+
extractVerifiedPackageArchive,
|
|
32
|
+
installServerPackage,
|
|
33
|
+
isVersionDowngrade,
|
|
34
|
+
packageExtractionLimits,
|
|
35
|
+
packageProvenanceSchemaVersion,
|
|
36
|
+
requiredPackageRuntimeFiles,
|
|
37
|
+
sha256File,
|
|
38
|
+
standalonePackageId,
|
|
39
|
+
standalonePackageKind,
|
|
40
|
+
standalonePackageSchemaVersion,
|
|
41
|
+
validateServerPackageRoot
|
|
42
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { createRequire as createKoedRequire } from "node:module"; const require = createKoedRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
activateGeneration,
|
|
4
|
+
assertDirectoryChain,
|
|
5
|
+
cleanupGenerations,
|
|
6
|
+
pinDesktopBundleGenerationForStart,
|
|
7
|
+
pinGenerationForStart,
|
|
8
|
+
readCurrentDesktopGeneration,
|
|
9
|
+
readCurrentDesktopGenerationOrderingEvidence,
|
|
10
|
+
readCurrentGeneration,
|
|
11
|
+
readCurrentGenerationForOwner,
|
|
12
|
+
readCurrentGenerationOrderingEvidence,
|
|
13
|
+
readCurrentRuntimeOwner,
|
|
14
|
+
readDesktopBundleGeneration,
|
|
15
|
+
readDesktopGenerationForCapability,
|
|
16
|
+
stageDesktopBundleForRecovery,
|
|
17
|
+
withLifecycleLock,
|
|
18
|
+
withSourceNativeStartLock,
|
|
19
|
+
withStoppedRuntime
|
|
20
|
+
} from "./chunk-FN3HUUO2.js";
|
|
21
|
+
import "./chunk-T6UB5PNX.js";
|
|
22
|
+
import "./chunk-7NXKPDF3.js";
|
|
23
|
+
import "./chunk-ZUDSZGVO.js";
|
|
24
|
+
import "./chunk-ZIOKV2X6.js";
|
|
25
|
+
import "./chunk-QRKHHWJJ.js";
|
|
26
|
+
import "./chunk-7EGSY3E4.js";
|
|
27
|
+
import "./chunk-IY2HRXOZ.js";
|
|
28
|
+
import "./chunk-FSNLU46W.js";
|
|
29
|
+
import "./chunk-BTS4ZTF3.js";
|
|
30
|
+
export {
|
|
31
|
+
activateGeneration,
|
|
32
|
+
assertDirectoryChain,
|
|
33
|
+
cleanupGenerations,
|
|
34
|
+
pinDesktopBundleGenerationForStart,
|
|
35
|
+
pinGenerationForStart,
|
|
36
|
+
readCurrentDesktopGeneration,
|
|
37
|
+
readCurrentDesktopGenerationOrderingEvidence,
|
|
38
|
+
readCurrentGeneration,
|
|
39
|
+
readCurrentGenerationForOwner,
|
|
40
|
+
readCurrentGenerationOrderingEvidence,
|
|
41
|
+
readCurrentRuntimeOwner,
|
|
42
|
+
readDesktopBundleGeneration,
|
|
43
|
+
readDesktopGenerationForCapability,
|
|
44
|
+
stageDesktopBundleForRecovery,
|
|
45
|
+
withLifecycleLock,
|
|
46
|
+
withSourceNativeStartLock,
|
|
47
|
+
withStoppedRuntime
|
|
48
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { createRequire as createKoedRequire } from "node:module"; const require = createKoedRequire(import.meta.url);
|
|
2
|
+
|
|
3
|
+
// packages/koed-server/dist/component-manifest-catalog.js
|
|
4
|
+
var record = (value, keys) => {
|
|
5
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
6
|
+
throw new Error("Invalid component pin catalog record.");
|
|
7
|
+
const result = value;
|
|
8
|
+
if (Object.keys(result).length !== keys.length || keys.some((key) => !Object.hasOwn(result, key)))
|
|
9
|
+
throw new Error("Invalid component pin catalog fields.");
|
|
10
|
+
return result;
|
|
11
|
+
};
|
|
12
|
+
var validVersion = (value) => typeof value === "string" && /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(value);
|
|
13
|
+
var manifestPinKey = ({ component, target, variant }) => JSON.stringify([
|
|
14
|
+
component,
|
|
15
|
+
target.platform,
|
|
16
|
+
target.architecture,
|
|
17
|
+
target.libc?.family ?? null,
|
|
18
|
+
target.libc?.minimumVersion ?? null,
|
|
19
|
+
...variant === void 0 ? [] : [variant]
|
|
20
|
+
]);
|
|
21
|
+
function validateEntry(value) {
|
|
22
|
+
const entry = record(value, [
|
|
23
|
+
"component",
|
|
24
|
+
"target",
|
|
25
|
+
"manifestSha256",
|
|
26
|
+
...value && typeof value === "object" && Object.hasOwn(value, "variant") ? ["variant"] : []
|
|
27
|
+
]);
|
|
28
|
+
if (entry.component !== "base" && entry.component !== "privacy" || typeof entry.manifestSha256 !== "string" || !/^[a-f0-9]{64}$/.test(entry.manifestSha256))
|
|
29
|
+
throw new Error("Invalid component pin catalog entry.");
|
|
30
|
+
if (Object.hasOwn(entry, "variant") && (entry.component !== "privacy" || !["cpu", "cuda"].includes(String(entry.variant))))
|
|
31
|
+
throw new Error("Invalid component pin variant.");
|
|
32
|
+
const rawTarget = entry.target;
|
|
33
|
+
const target = record(rawTarget, rawTarget && Object.hasOwn(rawTarget, "libc") ? ["platform", "architecture", "libc"] : ["platform", "architecture"]);
|
|
34
|
+
if (target.platform !== "linux" && target.platform !== "macos" || target.architecture !== "arm64" && target.architecture !== "x64")
|
|
35
|
+
throw new Error("Invalid component pin target.");
|
|
36
|
+
if (entry.variant !== void 0 && (target.platform !== "linux" || target.architecture !== "x64"))
|
|
37
|
+
throw new Error("Invalid component pin variant target.");
|
|
38
|
+
let libc;
|
|
39
|
+
if (Object.hasOwn(target, "libc")) {
|
|
40
|
+
const value2 = record(target.libc, ["family", "minimumVersion"]);
|
|
41
|
+
if (target.platform !== "linux" || value2.family !== "glibc" || typeof value2.minimumVersion !== "string" || !/^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)(?:\.(?:0|[1-9]\d*))?$/.test(value2.minimumVersion))
|
|
42
|
+
throw new Error("Invalid component pin libc target.");
|
|
43
|
+
libc = Object.freeze({
|
|
44
|
+
family: "glibc",
|
|
45
|
+
minimumVersion: value2.minimumVersion
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
return Object.freeze({
|
|
49
|
+
component: entry.component,
|
|
50
|
+
...entry.variant === void 0 ? {} : { variant: entry.variant },
|
|
51
|
+
manifestSha256: entry.manifestSha256,
|
|
52
|
+
target: Object.freeze({
|
|
53
|
+
platform: target.platform,
|
|
54
|
+
architecture: target.architecture,
|
|
55
|
+
...libc ? { libc } : {}
|
|
56
|
+
})
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function validateManifestCatalog(value) {
|
|
60
|
+
const input = record(value, ["schemaVersion", "productVersion", "entries"]);
|
|
61
|
+
if (input.schemaVersion !== 1 && input.schemaVersion !== 2 || !validVersion(input.productVersion) || !Array.isArray(input.entries) || input.entries.length === 0)
|
|
62
|
+
throw new Error("Invalid component pin catalog identity or entries.");
|
|
63
|
+
const entries = input.entries.map(validateEntry);
|
|
64
|
+
const identities = new Set(entries.map(manifestPinKey));
|
|
65
|
+
if (identities.size !== entries.length)
|
|
66
|
+
throw new Error("Duplicate component pin catalog identity.");
|
|
67
|
+
const variants = entries.filter((entry) => entry.variant !== void 0);
|
|
68
|
+
if (input.schemaVersion === 1 && variants.length)
|
|
69
|
+
throw new Error("Legacy component catalog cannot authenticate variants.");
|
|
70
|
+
if (input.schemaVersion === 2) {
|
|
71
|
+
if (variants.length === 0)
|
|
72
|
+
throw new Error("Privacy variant catalog is incomplete.");
|
|
73
|
+
for (const entry of entries.filter((entry2) => entry2.component === "privacy" && entry2.target.platform === "linux")) {
|
|
74
|
+
if (entry.variant === void 0 || !["cpu", "cuda"].every((variant) => entries.some((other) => other.component === "privacy" && other.variant === variant && manifestPinKey({ ...other, variant: void 0 }) === manifestPinKey({ ...entry, variant: void 0 }))))
|
|
75
|
+
throw new Error("Privacy variant catalog is incomplete or ambiguous.");
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return Object.freeze({
|
|
79
|
+
schemaVersion: input.schemaVersion,
|
|
80
|
+
productVersion: input.productVersion,
|
|
81
|
+
entries: Object.freeze(entries)
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
function lookupManifestPin(catalog, identity) {
|
|
85
|
+
if (!catalog)
|
|
86
|
+
throw new Error("Component manifest pin catalog is unavailable; use a trusted versioned control plane.");
|
|
87
|
+
if (catalog.productVersion !== identity.productVersion)
|
|
88
|
+
throw new Error("Component pin catalog version mismatch.");
|
|
89
|
+
const key = manifestPinKey(identity);
|
|
90
|
+
const entry = catalog.entries.find((entry2) => manifestPinKey(entry2) === key);
|
|
91
|
+
if (!entry)
|
|
92
|
+
throw new Error("Required component manifest pin is missing from this control plane.");
|
|
93
|
+
return entry.manifestSha256;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export {
|
|
97
|
+
validateManifestCatalog,
|
|
98
|
+
lookupManifestPin
|
|
99
|
+
};
|