@koed-labs/server 0.11.1 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/README.md +3 -3
  2. package/bin/koed.js +1 -1
  3. package/package.json +2 -2
  4. package/vendor/chunk-2YCDKSKW.js +45 -0
  5. package/vendor/{chunk-TG26CZGQ.js → chunk-355BP3MF.js} +4 -4
  6. package/vendor/{chunk-RCR4XPE3.js → chunk-3VNLZCMB.js} +1 -1
  7. package/vendor/{chunk-NVTMIAAF.js → chunk-7YXEB2CR.js} +18 -17
  8. package/vendor/{chunk-SRKIBFOE.js → chunk-A2TMTAAS.js} +1 -1
  9. package/vendor/{chunk-PL3LWC5C.js → chunk-AJPFOTVX.js} +1 -1
  10. package/vendor/{chunk-O7DW2VAV.js → chunk-BDJR6CKS.js} +4 -3
  11. package/vendor/{chunk-Z5WCAUA6.js → chunk-BMHMNUNK.js} +18 -17
  12. package/vendor/{chunk-C5SNDPAP.js → chunk-CSDTMMRL.js} +4 -4
  13. package/vendor/{chunk-FYYRFX4U.js → chunk-CX73L6YS.js} +67 -38
  14. package/vendor/{chunk-VGIYSDNU.js → chunk-D4XZTNLU.js} +117 -33
  15. package/vendor/{chunk-W2OJZZ6X.js → chunk-DQ5SIGZZ.js} +4 -2
  16. package/vendor/{chunk-4OO6VAU3.js → chunk-G54Q5W6M.js} +1 -1
  17. package/vendor/{chunk-EA4QDDQA.js → chunk-GEIN6UIL.js} +7 -2
  18. package/vendor/{chunk-QRKHHWJJ.js → chunk-H7ETSD25.js} +51 -3
  19. package/vendor/{chunk-NOU7RHYZ.js → chunk-HG47LAWW.js} +5 -4
  20. package/vendor/{chunk-C4V72GXC.js → chunk-HXL36SED.js} +19 -18
  21. package/vendor/{chunk-FN3HUUO2.js → chunk-I5XO5FL4.js} +73 -13
  22. package/vendor/{chunk-TVYEB2GN.js → chunk-J7LW6JFY.js} +48 -10
  23. package/vendor/{chunk-OCILJ737.js → chunk-JG7OELJM.js} +9 -9
  24. package/vendor/{chunk-6KS67EQE.js → chunk-KBECHDUE.js} +1 -1
  25. package/vendor/{chunk-2XKSVKQA.js → chunk-KH4UBONI.js} +3 -2
  26. package/vendor/{chunk-ZIOKV2X6.js → chunk-MFPPURFE.js} +113 -33
  27. package/vendor/{chunk-GFASBPV2.js → chunk-MHFYPBCL.js} +3 -3
  28. package/vendor/{chunk-V67IQB7H.js → chunk-OG7G6DIR.js} +1 -1
  29. package/vendor/{chunk-WDFERJG3.js → chunk-TAQWNZVD.js} +109 -33
  30. package/vendor/{chunk-HC76426R.js → chunk-TMCW2P6G.js} +7 -5
  31. package/vendor/chunk-ULLAURFV.js +8 -0
  32. package/vendor/{chunk-WPIEF4LY.js → chunk-ULUSFNAE.js} +3 -3
  33. package/vendor/{chunk-ZOHNXUDY.js → chunk-VWB3VEOL.js} +493 -20
  34. package/vendor/{chunk-LRP66XEY.js → chunk-XPSPPLX5.js} +14 -14
  35. package/vendor/{chunk-SHLRINKO.js → chunk-XSOQ2U5H.js} +2 -2
  36. package/vendor/{chunk-EDPNYIX5.js → chunk-XTQYFCVY.js} +146 -89
  37. package/vendor/{chunk-CHMH4LH5.js → chunk-XW7AXRDI.js} +3 -3
  38. package/vendor/{chunk-SNKWETM5.js → chunk-Y5OJXAUF.js} +2 -2
  39. package/vendor/chunk-YDZEMIAH.js +11 -0
  40. package/vendor/{chunk-BUIM2M4R.js → chunk-YOMK7KMB.js} +2 -2
  41. package/vendor/{chunk-ALJUSOF7.js → chunk-YY7NMZGD.js} +79 -1
  42. package/vendor/{chunk-BGENSONI.js → chunk-ZKKWLLPU.js} +1 -1
  43. package/vendor/cli.js +1 -1
  44. package/vendor/component-manifest-catalog.js +1 -1
  45. package/vendor/control-plane.js +6 -4
  46. package/vendor/chunk-7EGSY3E4.js +0 -8
  47. package/vendor/chunk-ZUDSZGVO.js +0 -11
@@ -1,10 +1,67 @@
1
1
  import { createRequire as createKoedRequire } from "node:module"; const require = createKoedRequire(import.meta.url);
2
+ import {
3
+ external_exports
4
+ } from "./chunk-FSNLU46W.js";
5
+
6
+ // packages/koed-server/dist/performance-schema.js
7
+ var resourceOverridesSchema = external_exports.object({
8
+ backgroundNice: external_exports.number().int().min(0).max(19).optional(),
9
+ embeddingThreads: external_exports.number().int().positive().max(65536).optional(),
10
+ transcriptPollMs: external_exports.number().int().min(1).max(6e4).optional()
11
+ }).strict();
12
+ var performanceChoiceSchema = external_exports.object({
13
+ profile: external_exports.enum(["low", "balanced", "full"]),
14
+ overrides: resourceOverridesSchema,
15
+ expectedRevision: external_exports.string().regex(/^[a-f0-9]{64}$/)
16
+ }).strict();
2
17
 
3
18
  // packages/koed-server/dist/config.js
4
19
  import { existsSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
5
20
  import { randomUUID } from "node:crypto";
6
21
  import { dirname } from "node:path";
7
22
  import { mkdirSync } from "node:fs";
23
+
24
+ // packages/koed-server/dist/resource-profile.js
25
+ import { cpus } from "node:os";
26
+
27
+ // packages/shared/dist/resource-profiles.js
28
+ var resourceProfileValues = (profile, cpuCount) => ({
29
+ backgroundNice: profile === "low" ? 19 : profile === "full" ? 0 : 10,
30
+ embeddingThreads: Math.max(1, Math.floor(cpuCount / (profile === "low" ? 4 : profile === "balanced" ? 2 : 1))),
31
+ transcriptPollMs: profile === "low" ? 15e3 : 1e3
32
+ });
33
+
34
+ // packages/koed-server/dist/resource-profile.js
35
+ var resourceProfiles = [
36
+ "low",
37
+ "balanced",
38
+ "full"
39
+ ];
40
+ var DEFAULT_RESOURCE_PROFILE = "balanced";
41
+ var isResourceProfile = (value) => typeof value === "string" && resourceProfiles.includes(value);
42
+ var resourceVariables = {
43
+ backgroundNice: ["KOED_BACKGROUND_NICE"],
44
+ embeddingThreads: ["EMBEDDING_LLAMA_N_THREADS", "LLAMA_N_THREADS"],
45
+ transcriptPollMs: ["MEMORY_CODEX_TRANSCRIPT_POLL_MS"]
46
+ };
47
+ var resourceKeys = Object.keys(resourceVariables);
48
+ var applyResourceProfile = (environment, profile, options = {}) => {
49
+ const isExplicit = (key) => resourceVariables[key].some((name) => Boolean(environment[name]?.trim() || options.explicit?.[name]?.trim()));
50
+ const cpuCount = Math.max(1, options.cpuCount ?? (cpus().length || 1));
51
+ const values = profile === "balanced" ? {} : resourceProfileValues(profile, cpuCount);
52
+ const overrides = options.overrides ?? {};
53
+ const output = { ...environment };
54
+ for (const key of resourceKeys) {
55
+ if (isExplicit(key))
56
+ continue;
57
+ const value = overrides[key] ?? values[key];
58
+ if (value !== void 0)
59
+ output[resourceVariables[key][0]] = String(value);
60
+ }
61
+ return output;
62
+ };
63
+
64
+ // packages/koed-server/dist/config.js
8
65
  var defaultKoedServerConfig = {
9
66
  runtimeMode: "local-personal",
10
67
  dependencyMode: "bundled-local",
@@ -12,7 +69,8 @@ var defaultKoedServerConfig = {
12
69
  claudeTranscriptWatcherEnabled: true,
13
70
  piTranscriptWatcherEnabled: true,
14
71
  codexGlobalMemoryGuidanceEnabled: true,
15
- hardwareAcceleration: "auto"
72
+ hardwareAcceleration: "auto",
73
+ resourceProfile: DEFAULT_RESOURCE_PROFILE
16
74
  };
17
75
  var trim = (value) => {
18
76
  const trimmed = value?.trim();
@@ -33,6 +91,20 @@ var booleanSetting = codexTranscriptWatcherSetting;
33
91
  var hardwareAccelerationPreference = (value, source) => value === void 0 ? void 0 : value === "auto" || value === "cpu" ? value : (() => {
34
92
  throw new Error(`${source} must be auto or cpu`);
35
93
  })();
94
+ var resourceProfilePreference = (value, source) => value === void 0 || value === "" ? void 0 : isResourceProfile(value) ? value : (() => {
95
+ throw new Error(`${source} must be low, balanced, or full`);
96
+ })();
97
+ var lenientResourceOverrides = (value) => {
98
+ if (!value || typeof value !== "object" || Array.isArray(value))
99
+ return {};
100
+ const overrides = {};
101
+ for (const key of Object.keys(resourceOverridesSchema.shape)) {
102
+ const parsed = resourceOverridesSchema.shape[key].safeParse(value[key]);
103
+ if (parsed.success && parsed.data !== void 0)
104
+ overrides[key] = parsed.data;
105
+ }
106
+ return overrides;
107
+ };
36
108
  var readConfig = (paths, deps) => {
37
109
  if (!deps.existsSync(paths.serverConfigPath)) {
38
110
  return {};
@@ -71,6 +143,8 @@ var readConfig = (paths, deps) => {
71
143
  if (record.hardwareAcceleration !== void 0) {
72
144
  hardwareAccelerationPreference(record.hardwareAcceleration, "server.json hardwareAcceleration");
73
145
  }
146
+ resourceOverridesSchema.parse(record.resourceOverrides ?? {});
147
+ resourceProfilePreference(record.resourceProfile, "server.json resourceProfile");
74
148
  if (record.external !== void 0 && (!record.external || typeof record.external !== "object" || Array.isArray(record.external))) {
75
149
  throw new Error("external must be an object");
76
150
  }
@@ -130,6 +204,8 @@ var resolveKoedServerConfig = (paths, environment = process.env, deps = {}) => {
130
204
  piTranscriptWatcherEnabled: resolvedPiTranscriptWatcherSetting ?? resolvedRuntimeMode !== "external",
131
205
  codexGlobalMemoryGuidanceEnabled: booleanSetting(environment.KOED_CODEX_GLOBAL_MEMORY_GUIDANCE_ENABLED) ?? booleanSetting(file.codexGlobalMemoryGuidanceEnabled) ?? defaultKoedServerConfig.codexGlobalMemoryGuidanceEnabled,
132
206
  hardwareAcceleration: hardwareAccelerationPreference(environment.KOED_HARDWARE_ACCELERATION, "KOED_HARDWARE_ACCELERATION") ?? hardwareAccelerationPreference(file.hardwareAcceleration, "server.json hardwareAcceleration") ?? defaultKoedServerConfig.hardwareAcceleration,
207
+ resourceOverrides: deps.strict ? resourceOverridesSchema.parse(file.resourceOverrides ?? {}) : lenientResourceOverrides(file.resourceOverrides),
208
+ resourceProfile: resourceProfilePreference(trim(environment.KOED_RESOURCE_PROFILE), "KOED_RESOURCE_PROFILE") ?? (deps.strict ? resourceProfilePreference(file.resourceProfile, "server.json resourceProfile") : isResourceProfile(file.resourceProfile) ? file.resourceProfile : void 0) ?? defaultKoedServerConfig.resourceProfile,
133
209
  external: {
134
210
  databaseUrl: trim(environment.KOED_EXTERNAL_DATABASE_URL) ?? trim(environment.DATABASE_URL) ?? trim(file.external?.databaseUrl),
135
211
  redisUrl: trim(environment.KOED_EXTERNAL_REDIS_URL) ?? trim(environment.REDIS_URL) ?? trim(file.external?.redisUrl),
@@ -170,6 +246,8 @@ var writeCodexGlobalMemoryGuidancePreference = (paths, enabled, deps = {}) => {
170
246
  };
171
247
 
172
248
  export {
249
+ resourceProfileValues,
250
+ applyResourceProfile,
173
251
  resolveKoedServerConfig,
174
252
  writeCodexGlobalMemoryGuidancePreference
175
253
  };
@@ -6,7 +6,7 @@ import {
6
6
  resolveKoedAppRuntimeForExecution,
7
7
  resolveKoedControlPlaneVersion,
8
8
  resolveKoedRuntimeOwner
9
- } from "./chunk-V67IQB7H.js";
9
+ } from "./chunk-OG7G6DIR.js";
10
10
  import "./chunk-BTS4ZTF3.js";
11
11
  export {
12
12
  assertKoedAppRuntimeAvailable,
package/vendor/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- if (Number(process.versions.node.split(".")[0]) !== 24) { console.error(`@koed-labs/server requires Node.js >=24 <25; found ${process.versions.node}.`); process.exit(1); }
2
+ if (Number(process.versions.node.split(".")[0]) < 24 || Number(process.versions.node.split(".")[0]) >= 27) { console.error(`@koed-labs/server requires Node.js >=24 <27; found ${process.versions.node}.`); process.exit(1); }
3
3
  const { runKoedServerCli, shouldExitPackagedSupervisor } = await import("./control-plane.js");
4
4
  const args = process.argv.slice(2);
5
5
  const exitCode = await runKoedServerCli(args);
@@ -1,7 +1,7 @@
1
1
  import { createRequire as createKoedRequire } from "node:module"; const require = createKoedRequire(import.meta.url);
2
2
  import {
3
3
  productionComponentManifestCatalog
4
- } from "./chunk-ZUDSZGVO.js";
4
+ } from "./chunk-YDZEMIAH.js";
5
5
  import "./chunk-IY2HRXOZ.js";
6
6
  import "./chunk-BTS4ZTF3.js";
7
7
  export {
@@ -3,20 +3,22 @@ import {
3
3
  isKoedServerCliEntrypoint,
4
4
  runKoedServerCli,
5
5
  shouldExitPackagedSupervisor
6
- } from "./chunk-FYYRFX4U.js";
6
+ } from "./chunk-CX73L6YS.js";
7
7
  import {
8
8
  startKoedServerDaemon
9
9
  } from "./chunk-7FSHVVTZ.js";
10
10
  import "./chunk-TSAYTRX3.js";
11
11
  import "./chunk-YZLQZU5E.js";
12
- import "./chunk-V67IQB7H.js";
12
+ import "./chunk-OG7G6DIR.js";
13
13
  import {
14
14
  productionComponentManifestCatalog
15
- } from "./chunk-ZUDSZGVO.js";
15
+ } from "./chunk-YDZEMIAH.js";
16
16
  import {
17
17
  productionNativeRuntimeCatalog
18
- } from "./chunk-7EGSY3E4.js";
18
+ } from "./chunk-ULLAURFV.js";
19
19
  import "./chunk-IY2HRXOZ.js";
20
+ import "./chunk-VWB3VEOL.js";
21
+ import "./chunk-FSNLU46W.js";
20
22
  import "./chunk-BTS4ZTF3.js";
21
23
  export {
22
24
  isKoedServerCliEntrypoint,
@@ -1,8 +0,0 @@
1
- import { createRequire as createKoedRequire } from "node:module"; const require = createKoedRequire(import.meta.url);
2
-
3
- // packages/koed-server/dist/native-runtime-catalog-data.mjs
4
- var productionNativeRuntimeCatalog = { "schemaVersion": 1, "minimumCoreVersion": "0.10.3", "core": { "recipeId": "3772839512c2caebac0f9d27b4d2da2bb345ac713dce414019068bcef2e008a5", "runtimeVersion": "0.11.1", "url": "https://github.com/koed-labs/koed/releases/download/v0.11.1/koed-native-core-3772839512c2caebac0f9d27b4d2da2bb345ac713dce414019068bcef2e008a5-linux-x64.tar.gz", "sha256": "eba95ee796f67c3d8f2468e2bb98a313a92f6180144e255a9b127d7783b7b8a7", "manifestSha256": "56da4b6e4870782dda6892e48dbef64226910d2862cfaf23585a71e0651418b6", "target": { "platform": "linux", "architecture": "x64", "libc": { "family": "glibc", "minimumVersion": "2.35" } }, "archiveBytes": 23988984, "expandedBytes": 56990680, "contracts": { "layout": 1, "embedding": 1, "postgres": 1 }, "components": { "postgres": { "major": 17, "version": "17.6" }, "pgvector": { "version": "0.8.3" }, "llamaCpp": { "version": "b10514", "revision": "7221e24f579efbb5fd2a2ced1fffaef1aff2fe0d" } } }, "cuda": { "recipeId": "5fc63b4396c94d35c3f9c30c1ca592e178357cbf1717dac10216c2de37dfda70", "runtimeVersion": "0.11.1", "url": "https://github.com/koed-labs/koed/releases/download/v0.11.1/koed-native-cuda-5fc63b4396c94d35c3f9c30c1ca592e178357cbf1717dac10216c2de37dfda70-linux-x64.tar.gz", "sha256": "da8423ddc84ce0e95b7857a799b2d542dbc188c154cbf6869aaa165dbdc02a86", "manifestSha256": "c4a0bfc9f908d7774009ee6d45e34a54393d23b53ca9b567da73f72e8225cb3e", "target": { "platform": "linux", "architecture": "x64", "libc": { "family": "glibc", "minimumVersion": "2.35" } }, "archiveBytes": 711229069, "expandedBytes": 1467863069, "contracts": { "layout": 1, "embedding": 1 }, "llamaCpp": { "version": "b10514", "revision": "7221e24f579efbb5fd2a2ced1fffaef1aff2fe0d" }, "cuda": { "toolkitVersion": "12.4", "minimumDriverLinux": "550.54.14", "architectures": [75, 80, 86, 89, 90] } } };
5
-
6
- export {
7
- productionNativeRuntimeCatalog
8
- };
@@ -1,11 +0,0 @@
1
- import { createRequire as createKoedRequire } from "node:module"; const require = createKoedRequire(import.meta.url);
2
- import {
3
- validateManifestCatalog
4
- } from "./chunk-IY2HRXOZ.js";
5
-
6
- // packages/koed-server/dist/component-manifest-catalog-data.js
7
- var productionComponentManifestCatalog = validateManifestCatalog({ "schemaVersion": 2, "productVersion": "0.11.1", "entries": [{ "component": "base", "manifestSha256": "0b52721f86a781aed5d220ff15155dc1ba66cee6e9a1d0a08f0737d7dd4a341b", "target": { "platform": "linux", "architecture": "x64", "libc": { "family": "glibc", "minimumVersion": "2.35" } } }, { "component": "base", "manifestSha256": "16227b97790718bbc133746a6d18dc61e50d98eed3ff23ceaf4fd938f470e208", "target": { "platform": "macos", "architecture": "arm64" } }, { "component": "privacy", "variant": "cpu", "manifestSha256": "f2f0b951faefba2e8e6d756d27e7c352bad626011e07b617d2ed0bf5e3a4eea9", "target": { "platform": "linux", "architecture": "x64", "libc": { "family": "glibc", "minimumVersion": "2.35" } } }, { "component": "privacy", "variant": "cuda", "manifestSha256": "61178106c0b86eb4afb90b4cb27ceffaee25240224ca6820e3acb94394e6803a", "target": { "platform": "linux", "architecture": "x64", "libc": { "family": "glibc", "minimumVersion": "2.35" } } }, { "component": "privacy", "manifestSha256": "2fe30669f016e2934357f1a37f79fd2e03a91fbfe8a4b02769531d5a6c8cbc49", "target": { "platform": "macos", "architecture": "arm64" } }] });
8
-
9
- export {
10
- productionComponentManifestCatalog
11
- };