@koed-labs/server 0.10.3 → 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.
Files changed (54) hide show
  1. package/README.md +3 -3
  2. package/package.json +1 -1
  3. package/vendor/{chunk-A6WMU2GG.js → chunk-2XKSVKQA.js} +5 -4
  4. package/vendor/{chunk-VPC5NLZG.js → chunk-4OO6VAU3.js} +1 -1
  5. package/vendor/{chunk-HK2H3MVE.js → chunk-53ZFCDHP.js} +4 -0
  6. package/vendor/chunk-6KS67EQE.js +75 -0
  7. package/vendor/chunk-7EGSY3E4.js +8 -0
  8. package/vendor/{chunk-JKOG52PE.js → chunk-7FSHVVTZ.js} +1 -1
  9. package/vendor/chunk-ALJUSOF7.js +175 -0
  10. package/vendor/{chunk-KUIWH33N.js → chunk-AVQCUFYQ.js} +1 -1
  11. package/vendor/chunk-BGENSONI.js +18 -0
  12. package/vendor/{chunk-ZXX4ZNJY.js → chunk-BUIM2M4R.js} +3 -2
  13. package/vendor/{chunk-YK4F4VY2.js → chunk-C4V72GXC.js} +51 -30
  14. package/vendor/{chunk-JJNLH5GA.js → chunk-C5SNDPAP.js} +21 -19
  15. package/vendor/{chunk-J2L726BC.js → chunk-CHMH4LH5.js} +3 -3
  16. package/vendor/{chunk-2S3OGPUC.js → chunk-EA4QDDQA.js} +2 -2
  17. package/vendor/{chunk-HZJK5RWC.js → chunk-EDPNYIX5.js} +575 -215
  18. package/vendor/{chunk-NM5NXCVM.js → chunk-FN3HUUO2.js} +558 -988
  19. package/vendor/{chunk-473OA62O.js → chunk-FSNLU46W.js} +218 -12497
  20. package/vendor/{chunk-GELDEJJ2.js → chunk-FYYRFX4U.js} +133 -47
  21. package/vendor/{chunk-YOFI4PCH.js → chunk-GFASBPV2.js} +7 -1
  22. package/vendor/chunk-HC76426R.js +48 -0
  23. package/vendor/{chunk-QIIKMG3M.js → chunk-IY2HRXOZ.js} +1 -5
  24. package/vendor/{chunk-ZUGNCQZE.js → chunk-JYK6UL6D.js} +22 -8
  25. package/vendor/{chunk-2BWTLF7A.js → chunk-LRP66XEY.js} +45 -21
  26. package/vendor/{chunk-DXTAWHY3.js → chunk-NOU7RHYZ.js} +8 -7
  27. package/vendor/{chunk-C3N4N5HR.js → chunk-NVTMIAAF.js} +26 -21
  28. package/vendor/chunk-O7DW2VAV.js +14 -0
  29. package/vendor/{chunk-YJ6XUZT6.js → chunk-OCILJ737.js} +23 -16
  30. package/vendor/{chunk-TSRPHKAC.js → chunk-PL3LWC5C.js} +16 -42
  31. package/vendor/chunk-QRKHHWJJ.js +104 -0
  32. package/vendor/{chunk-YJWREXN6.js → chunk-RCR4XPE3.js} +1 -1
  33. package/vendor/{chunk-AFLKCQHF.js → chunk-SHLRINKO.js} +2 -2
  34. package/vendor/{chunk-NEWIOOM6.js → chunk-SNKWETM5.js} +3 -2
  35. package/vendor/{chunk-XNFVSVBS.js → chunk-SRKIBFOE.js} +1 -1
  36. package/vendor/{chunk-G4IIVVJO.js → chunk-T6UB5PNX.js} +70 -2
  37. package/vendor/{chunk-RVYJKKWA.js → chunk-TG26CZGQ.js} +5 -4
  38. package/vendor/{chunk-HFM6ROJL.js → chunk-TISYUUEJ.js} +1 -1
  39. package/vendor/{chunk-K2EIFEQF.js → chunk-TSAYTRX3.js} +1 -1
  40. package/vendor/chunk-TVYEB2GN.js +343 -0
  41. package/vendor/{chunk-PT3AUPGE.js → chunk-UB6JCVQ3.js} +3 -1
  42. package/vendor/chunk-VGIYSDNU.js +522 -0
  43. package/vendor/{chunk-X6M525ZJ.js → chunk-W2OJZZ6X.js} +5 -5
  44. package/vendor/{chunk-YCDEMYY6.js → chunk-WDFERJG3.js} +231 -99
  45. package/vendor/{chunk-SKVYP7NY.js → chunk-WPIEF4LY.js} +8 -8
  46. package/vendor/{chunk-UI5RLBKQ.js → chunk-YZLQZU5E.js} +17 -1
  47. package/vendor/{chunk-PY5LYLV7.js → chunk-Z5WCAUA6.js} +26 -21
  48. package/vendor/chunk-ZIOKV2X6.js +1589 -0
  49. package/vendor/chunk-ZOHNXUDY.js +12501 -0
  50. package/vendor/chunk-ZUDSZGVO.js +11 -0
  51. package/vendor/component-manifest-catalog.js +2 -1
  52. package/vendor/control-plane.js +11 -6
  53. package/vendor/chunk-2DA7EFZV.js +0 -924
  54. /package/vendor/{chunk-A4NKL2PK.js → chunk-V67IQB7H.js} +0 -0
package/README.md CHANGED
@@ -9,7 +9,7 @@ Looking for the desktop client? Visit the [Koed GitHub repository](https://githu
9
9
  For a local Personal setup, install Node.js 24 and Homebrew first. Then install the Koed command-line tool:
10
10
 
11
11
  ```sh
12
- npm install --global @koed-labs/server@0.10.3
12
+ npm install --global @koed-labs/server@0.11.1
13
13
  ```
14
14
 
15
15
  ## 2. Set up your services
@@ -19,13 +19,13 @@ Install the Base component for your platform using the matching release URLs:
19
19
  **linux-x64**
20
20
 
21
21
  ```sh
22
- koed components install --component base --archive-url https://github.com/koed-labs/koed/releases/download/v0.10.3/koed-base-0.10.3-linux-x64.tar.gz --manifest-url https://github.com/koed-labs/koed/releases/download/v0.10.3/koed-base-0.10.3-linux-x64.tar.gz.manifest.json --json
22
+ koed components install --component base --archive-url https://github.com/koed-labs/koed/releases/download/v0.11.1/koed-base-0.11.1-linux-x64.tar.gz --manifest-url https://github.com/koed-labs/koed/releases/download/v0.11.1/koed-base-0.11.1-linux-x64.tar.gz.manifest.json --json
23
23
  ```
24
24
 
25
25
  **macos-arm64**
26
26
 
27
27
  ```sh
28
- koed components install --component base --archive-url https://github.com/koed-labs/koed/releases/download/v0.10.3/koed-base-0.10.3-macos-arm64.tar.gz --manifest-url https://github.com/koed-labs/koed/releases/download/v0.10.3/koed-base-0.10.3-macos-arm64.tar.gz.manifest.json --json
28
+ koed components install --component base --archive-url https://github.com/koed-labs/koed/releases/download/v0.11.1/koed-base-0.11.1-macos-arm64.tar.gz --manifest-url https://github.com/koed-labs/koed/releases/download/v0.11.1/koed-base-0.11.1-macos-arm64.tar.gz.manifest.json --json
29
29
  ```
30
30
 
31
31
  Then install the runtime and embedding model:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koed-labs/server",
3
- "version": "0.10.3",
3
+ "version": "0.11.1",
4
4
  "description": "Koed Self-Hosted control plane",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,10 +1,11 @@
1
1
  import { createRequire as createKoedRequire } from "node:module"; const require = createKoedRequire(import.meta.url);
2
2
  import {
3
3
  runApplicationSecretProvider
4
- } from "./chunk-2S3OGPUC.js";
5
- import "./chunk-K2EIFEQF.js";
6
- import "./chunk-UI5RLBKQ.js";
7
- import "./chunk-473OA62O.js";
4
+ } from "./chunk-EA4QDDQA.js";
5
+ import "./chunk-TSAYTRX3.js";
6
+ import "./chunk-YZLQZU5E.js";
7
+ import "./chunk-ZOHNXUDY.js";
8
+ import "./chunk-FSNLU46W.js";
8
9
  import "./chunk-BTS4ZTF3.js";
9
10
 
10
11
  // packages/koed-server/dist/cli-internal-operations.js
@@ -3,7 +3,7 @@ import {
3
3
  PINNED_PRIVACY_MODEL_FILES,
4
4
  PINNED_PRIVACY_MODEL_ID,
5
5
  PINNED_PRIVACY_MODEL_REVISION
6
- } from "./chunk-473OA62O.js";
6
+ } from "./chunk-ZOHNXUDY.js";
7
7
 
8
8
  // packages/koed-server/dist/privacy-model-runtime.js
9
9
  import { createHash, randomUUID } from "node:crypto";
@@ -1,4 +1,7 @@
1
1
  import { createRequire as createKoedRequire } from "node:module"; const require = createKoedRequire(import.meta.url);
2
+ import {
3
+ assertNoReleaseRuntime
4
+ } from "./chunk-YZLQZU5E.js";
2
5
  import "./chunk-BTS4ZTF3.js";
3
6
 
4
7
  // packages/koed-server/dist/runtime-homebrew.js
@@ -209,6 +212,7 @@ var linkRuntimePath = (source, target, koedHome, deps) => {
209
212
  deps.symlinkSync(source, resolvedTarget);
210
213
  };
211
214
  var installHomebrewRuntime = (paths, environment = process.env, dependencies = {}) => {
215
+ assertNoReleaseRuntime(paths);
212
216
  const deps = {
213
217
  platform: dependencies.platform ?? process.platform,
214
218
  existsSync: dependencies.existsSync ?? existsSync,
@@ -0,0 +1,75 @@
1
+ import { createRequire as createKoedRequire } from "node:module"; const require = createKoedRequire(import.meta.url);
2
+ import {
3
+ aiClientConnectionRevision,
4
+ grantAiClientConnection,
5
+ revokeAiClientConnection
6
+ } from "./chunk-EDPNYIX5.js";
7
+
8
+ // packages/koed-server/dist/ai-client-authorization.js
9
+ var clientNames = {
10
+ codex: "Codex",
11
+ claude: "Claude Code",
12
+ pi: "Pi"
13
+ };
14
+ var failed = (result, error) => ({
15
+ ...result,
16
+ ok: false,
17
+ error
18
+ });
19
+ var noteAiClientConnectionRevision = (koedHome, client) => {
20
+ try {
21
+ return aiClientConnectionRevision(koedHome, client);
22
+ } catch {
23
+ revokeAiClientConnection(koedHome, client);
24
+ return aiClientConnectionRevision(koedHome, client);
25
+ }
26
+ };
27
+ var connectAiClientAfterSetup = async ({ client, koedHome, run, verify }) => {
28
+ const name = clientNames[client];
29
+ const revision = noteAiClientConnectionRevision(koedHome, client);
30
+ const result = await run();
31
+ if (!result.ok)
32
+ return result;
33
+ if (result.koedHome !== koedHome)
34
+ return failed(result, `${name} was set up for a different KOED_HOME; capture stays off.`);
35
+ let verified = false;
36
+ try {
37
+ verified = await verify(koedHome);
38
+ } catch {
39
+ verified = false;
40
+ }
41
+ if (!verified)
42
+ return failed(result, `Could not verify the ${name} integration for this KOED_HOME; capture stays off.`);
43
+ let granted = false;
44
+ try {
45
+ granted = grantAiClientConnection(koedHome, client, revision);
46
+ } catch (error) {
47
+ return failed(result, `${name} could not be connected; capture stays off. ${error instanceof Error ? error.message : String(error)}`);
48
+ }
49
+ return granted ? result : failed(result, `${name} changed while setup ran (for example, it was removed); capture stays off. Set it up again to connect it.`);
50
+ };
51
+ var disconnectAiClientThenRemove = ({ client, koedHome, remove }) => {
52
+ let revocationError = null;
53
+ try {
54
+ revokeAiClientConnection(koedHome, client);
55
+ } catch (error) {
56
+ revocationError = error instanceof Error ? error.message : String(error);
57
+ }
58
+ const result = remove();
59
+ if (revocationError !== null)
60
+ return failed(result, `${clientNames[client]} could not be disconnected; Koed may still read its conversations. ${revocationError}`);
61
+ return result;
62
+ };
63
+ var verifyAiClientIntegration = async (client, koedHome, environment, collectStatus, dependencies = {}) => {
64
+ const status = await collectStatus({ ...environment, KOED_HOME: koedHome }, { ...dependencies, revokeAiClientConnection: () => false });
65
+ const inspected = client === "codex" ? status.codex : client === "claude" ? status.claudeCode : status.pi;
66
+ const details = inspected?.details;
67
+ return status.koedHome === koedHome && inspected?.configured === true && (client !== "codex" || details?.configuredKoedHome === koedHome && typeof details.mcpAdapter === "string");
68
+ };
69
+
70
+ export {
71
+ noteAiClientConnectionRevision,
72
+ connectAiClientAfterSetup,
73
+ disconnectAiClientThenRemove,
74
+ verifyAiClientIntegration
75
+ };
@@ -0,0 +1,8 @@
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,7 +1,7 @@
1
1
  import { createRequire as createKoedRequire } from "node:module"; const require = createKoedRequire(import.meta.url);
2
2
  import {
3
3
  resolveKoedServerPaths
4
- } from "./chunk-K2EIFEQF.js";
4
+ } from "./chunk-TSAYTRX3.js";
5
5
 
6
6
  // packages/koed-server/dist/daemon-start.js
7
7
  import { spawn as nodeSpawn } from "node:child_process";
@@ -0,0 +1,175 @@
1
+ import { createRequire as createKoedRequire } from "node:module"; const require = createKoedRequire(import.meta.url);
2
+
3
+ // packages/koed-server/dist/config.js
4
+ import { existsSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
5
+ import { randomUUID } from "node:crypto";
6
+ import { dirname } from "node:path";
7
+ import { mkdirSync } from "node:fs";
8
+ var defaultKoedServerConfig = {
9
+ runtimeMode: "local-personal",
10
+ dependencyMode: "bundled-local",
11
+ codexTranscriptWatcherEnabled: true,
12
+ claudeTranscriptWatcherEnabled: true,
13
+ piTranscriptWatcherEnabled: true,
14
+ codexGlobalMemoryGuidanceEnabled: true,
15
+ hardwareAcceleration: "auto"
16
+ };
17
+ var trim = (value) => {
18
+ const trimmed = value?.trim();
19
+ return trimmed ? trimmed : void 0;
20
+ };
21
+ var runtimeMode = (value) => value === "local-personal" || value === "external" || value === "developer" ? value : void 0;
22
+ var dependencyMode = (value) => value === "external" || value === "bundled-local" ? value : void 0;
23
+ var codexTranscriptWatcherSetting = (value) => {
24
+ if (value === true || value === "true")
25
+ return true;
26
+ if (value === false || value === "false")
27
+ return false;
28
+ return void 0;
29
+ };
30
+ var claudeTranscriptWatcherSetting = codexTranscriptWatcherSetting;
31
+ var piTranscriptWatcherSetting = codexTranscriptWatcherSetting;
32
+ var booleanSetting = codexTranscriptWatcherSetting;
33
+ var hardwareAccelerationPreference = (value, source) => value === void 0 ? void 0 : value === "auto" || value === "cpu" ? value : (() => {
34
+ throw new Error(`${source} must be auto or cpu`);
35
+ })();
36
+ var readConfig = (paths, deps) => {
37
+ if (!deps.existsSync(paths.serverConfigPath)) {
38
+ return {};
39
+ }
40
+ try {
41
+ const parsed = JSON.parse(deps.readFileSync(paths.serverConfigPath, "utf8"));
42
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
43
+ throw new Error("expected a JSON object");
44
+ }
45
+ const record = parsed;
46
+ if (!deps.strict)
47
+ return record;
48
+ const stringFields = ["runtimeMode", "dependencyMode"];
49
+ const booleanFields = [
50
+ "codexTranscriptWatcherEnabled",
51
+ "claudeTranscriptWatcherEnabled",
52
+ "piTranscriptWatcherEnabled",
53
+ "codexGlobalMemoryGuidanceEnabled"
54
+ ];
55
+ for (const field of stringFields) {
56
+ if (record[field] !== void 0 && typeof record[field] !== "string") {
57
+ throw new Error(`${field} must be a string`);
58
+ }
59
+ }
60
+ if (record.runtimeMode !== void 0 && !runtimeMode(record.runtimeMode)) {
61
+ throw new Error("runtimeMode must be local-personal, external, or developer");
62
+ }
63
+ if (record.dependencyMode !== void 0 && !dependencyMode(record.dependencyMode)) {
64
+ throw new Error("dependencyMode must be bundled-local or external");
65
+ }
66
+ for (const field of booleanFields) {
67
+ if (record[field] !== void 0 && typeof record[field] !== "boolean") {
68
+ throw new Error(`${field} must be a boolean`);
69
+ }
70
+ }
71
+ if (record.hardwareAcceleration !== void 0) {
72
+ hardwareAccelerationPreference(record.hardwareAcceleration, "server.json hardwareAcceleration");
73
+ }
74
+ if (record.external !== void 0 && (!record.external || typeof record.external !== "object" || Array.isArray(record.external))) {
75
+ throw new Error("external must be an object");
76
+ }
77
+ if (record.external && typeof record.external === "object") {
78
+ const external = record.external;
79
+ const supportedExternalFields = [
80
+ "databaseUrl",
81
+ "redisUrl",
82
+ "embeddingServiceUrl",
83
+ "privacyServiceUrl"
84
+ ];
85
+ for (const [field, value] of Object.entries(external)) {
86
+ if (!supportedExternalFields.includes(field)) {
87
+ throw new Error(`external.${field} is not supported`);
88
+ }
89
+ if (value !== void 0 && typeof value !== "string") {
90
+ throw new Error(`external.${field} must be a string`);
91
+ }
92
+ }
93
+ }
94
+ return record;
95
+ } catch (error) {
96
+ if (!deps.strict)
97
+ return {};
98
+ const message = error instanceof Error ? error.message : String(error);
99
+ throw new Error(`Cannot read ${paths.serverConfigPath}: ${message}`, {
100
+ cause: error
101
+ });
102
+ }
103
+ };
104
+ var resolveKoedServerConfig = (paths, environment = process.env, deps = {}) => {
105
+ const file = readConfig(paths, {
106
+ existsSync: deps.existsSync ?? existsSync,
107
+ readFileSync: deps.readFileSync ?? readFileSync,
108
+ strict: deps.strict
109
+ });
110
+ if (deps.strict) {
111
+ if (environment.KOED_RUNTIME_MODE !== void 0 && !runtimeMode(environment.KOED_RUNTIME_MODE)) {
112
+ throw new Error("KOED_RUNTIME_MODE must be local-personal, external, or developer");
113
+ }
114
+ if (environment.KOED_DEPENDENCY_MODE !== void 0 && !dependencyMode(environment.KOED_DEPENDENCY_MODE)) {
115
+ throw new Error("KOED_DEPENDENCY_MODE must be bundled-local or external");
116
+ }
117
+ }
118
+ const resolvedRuntimeMode = runtimeMode(environment.KOED_RUNTIME_MODE) ?? runtimeMode(file.runtimeMode) ?? defaultKoedServerConfig.runtimeMode;
119
+ const resolvedTranscriptWatcherSetting = codexTranscriptWatcherSetting(environment.MEMORY_CODEX_TRANSCRIPT_WATCHER_ENABLED) ?? codexTranscriptWatcherSetting(file.codexTranscriptWatcherEnabled);
120
+ const resolvedClaudeTranscriptWatcherSetting = claudeTranscriptWatcherSetting(environment.MEMORY_CLAUDE_TRANSCRIPT_WATCHER_ENABLED) ?? claudeTranscriptWatcherSetting(file.claudeTranscriptWatcherEnabled);
121
+ const resolvedPiTranscriptWatcherSetting = piTranscriptWatcherSetting(environment.MEMORY_PI_TRANSCRIPT_WATCHER_ENABLED) ?? piTranscriptWatcherSetting(file.piTranscriptWatcherEnabled);
122
+ if (resolvedRuntimeMode === "external" && (resolvedTranscriptWatcherSetting === true || resolvedClaudeTranscriptWatcherSetting === true || resolvedPiTranscriptWatcherSetting === true)) {
123
+ throw new Error("Transcript Watchers cannot run in external runtime mode; run capture through a local-personal koed-server.");
124
+ }
125
+ return {
126
+ runtimeMode: resolvedRuntimeMode,
127
+ dependencyMode: dependencyMode(environment.KOED_DEPENDENCY_MODE) ?? dependencyMode(file.dependencyMode) ?? (resolvedRuntimeMode === "local-personal" ? "bundled-local" : "external"),
128
+ codexTranscriptWatcherEnabled: resolvedTranscriptWatcherSetting ?? resolvedRuntimeMode !== "external",
129
+ claudeTranscriptWatcherEnabled: resolvedClaudeTranscriptWatcherSetting ?? resolvedRuntimeMode !== "external",
130
+ piTranscriptWatcherEnabled: resolvedPiTranscriptWatcherSetting ?? resolvedRuntimeMode !== "external",
131
+ codexGlobalMemoryGuidanceEnabled: booleanSetting(environment.KOED_CODEX_GLOBAL_MEMORY_GUIDANCE_ENABLED) ?? booleanSetting(file.codexGlobalMemoryGuidanceEnabled) ?? defaultKoedServerConfig.codexGlobalMemoryGuidanceEnabled,
132
+ hardwareAcceleration: hardwareAccelerationPreference(environment.KOED_HARDWARE_ACCELERATION, "KOED_HARDWARE_ACCELERATION") ?? hardwareAccelerationPreference(file.hardwareAcceleration, "server.json hardwareAcceleration") ?? defaultKoedServerConfig.hardwareAcceleration,
133
+ external: {
134
+ databaseUrl: trim(environment.KOED_EXTERNAL_DATABASE_URL) ?? trim(environment.DATABASE_URL) ?? trim(file.external?.databaseUrl),
135
+ redisUrl: trim(environment.KOED_EXTERNAL_REDIS_URL) ?? trim(environment.REDIS_URL) ?? trim(file.external?.redisUrl),
136
+ embeddingServiceUrl: trim(environment.KOED_EXTERNAL_EMBEDDING_SERVICE_URL) ?? trim(environment.EMBEDDING_SERVICE_URL) ?? trim(file.external?.embeddingServiceUrl),
137
+ privacyServiceUrl: trim(environment.KOED_EXTERNAL_PRIVACY_SERVICE_URL) ?? trim(environment.PRIVACY_SERVICE_URL) ?? trim(file.external?.privacyServiceUrl)
138
+ }
139
+ };
140
+ };
141
+ var writeServerConfigAtomically = (paths, config, deps = {}) => {
142
+ mkdirSync(dirname(paths.serverConfigPath), { recursive: true, mode: 448 });
143
+ const temporary = `${paths.serverConfigPath}.${process.pid}.${randomUUID()}.tmp`;
144
+ try {
145
+ (deps.writeFileSync ?? writeFileSync)(temporary, `${JSON.stringify(config, null, 2)}
146
+ `, { mode: 384 });
147
+ (deps.renameSync ?? renameSync)(temporary, paths.serverConfigPath);
148
+ } catch (error) {
149
+ (deps.rmSync ?? rmSync)(temporary, { force: true });
150
+ throw error;
151
+ }
152
+ };
153
+ var writeCodexGlobalMemoryGuidancePreference = (paths, enabled, deps = {}) => {
154
+ const fileExists = deps.existsSync ?? existsSync;
155
+ const read = deps.readFileSync ?? readFileSync;
156
+ let existing = {};
157
+ if (fileExists(paths.serverConfigPath)) {
158
+ try {
159
+ const parsed = JSON.parse(read(paths.serverConfigPath, "utf8"));
160
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
161
+ throw new Error("expected a JSON object");
162
+ }
163
+ existing = parsed;
164
+ } catch (error) {
165
+ const message = error instanceof Error ? error.message : String(error);
166
+ throw new Error(`Cannot update Codex memory guidance preference because ${paths.serverConfigPath} is malformed: ${message}.`, { cause: error });
167
+ }
168
+ }
169
+ writeServerConfigAtomically(paths, { ...existing, codexGlobalMemoryGuidanceEnabled: enabled }, deps);
170
+ };
171
+
172
+ export {
173
+ resolveKoedServerConfig,
174
+ writeCodexGlobalMemoryGuidancePreference
175
+ };
@@ -5,7 +5,7 @@ import {
5
5
  localModelKinds,
6
6
  resolveLocalModelManifest,
7
7
  sha256File
8
- } from "./chunk-ZUGNCQZE.js";
8
+ } from "./chunk-JYK6UL6D.js";
9
9
  import "./chunk-BTS4ZTF3.js";
10
10
  export {
11
11
  collectLocalModelStatus,
@@ -0,0 +1,18 @@
1
+ import { createRequire as createKoedRequire } from "node:module"; const require = createKoedRequire(import.meta.url);
2
+ import {
3
+ assertKoedAppRuntimeAvailable,
4
+ resolveKoedAppRuntime,
5
+ resolveKoedAppRuntimeExecution,
6
+ resolveKoedAppRuntimeForExecution,
7
+ resolveKoedControlPlaneVersion,
8
+ resolveKoedRuntimeOwner
9
+ } from "./chunk-V67IQB7H.js";
10
+ import "./chunk-BTS4ZTF3.js";
11
+ export {
12
+ assertKoedAppRuntimeAvailable,
13
+ resolveKoedAppRuntime,
14
+ resolveKoedAppRuntimeExecution,
15
+ resolveKoedAppRuntimeForExecution,
16
+ resolveKoedControlPlaneVersion,
17
+ resolveKoedRuntimeOwner
18
+ };
@@ -7,8 +7,9 @@ import {
7
7
  installPrivacyModel,
8
8
  materializePrivacyModelCacheEntry,
9
9
  resolvePrivacyModelPaths
10
- } from "./chunk-VPC5NLZG.js";
11
- import "./chunk-473OA62O.js";
10
+ } from "./chunk-4OO6VAU3.js";
11
+ import "./chunk-ZOHNXUDY.js";
12
+ import "./chunk-FSNLU46W.js";
12
13
  import "./chunk-BTS4ZTF3.js";
13
14
  export {
14
15
  PRIVACY_MODEL_FILES,
@@ -2,38 +2,55 @@ import { createRequire as createKoedRequire } from "node:module"; const require
2
2
  import {
3
3
  createCliServiceContext,
4
4
  printJson
5
- } from "./chunk-YCDEMYY6.js";
5
+ } from "./chunk-WDFERJG3.js";
6
+ import "./chunk-SHLRINKO.js";
7
+ import "./chunk-CHMH4LH5.js";
8
+ import "./chunk-EA4QDDQA.js";
9
+ import "./chunk-JYK6UL6D.js";
10
+ import "./chunk-WPIEF4LY.js";
11
+ import {
12
+ connectAiClientAfterSetup,
13
+ disconnectAiClientThenRemove,
14
+ verifyAiClientIntegration
15
+ } from "./chunk-6KS67EQE.js";
6
16
  import {
7
17
  evaluateAiClientReadiness
8
- } from "./chunk-HZJK5RWC.js";
18
+ } from "./chunk-EDPNYIX5.js";
9
19
  import "./chunk-QT24SAW6.js";
10
- import "./chunk-SKVYP7NY.js";
11
- import "./chunk-HFM6ROJL.js";
12
- import "./chunk-AFLKCQHF.js";
13
- import "./chunk-NM5NXCVM.js";
14
- import "./chunk-G4IIVVJO.js";
15
- import "./chunk-JKOG52PE.js";
16
- import "./chunk-A4NKL2PK.js";
17
- import "./chunk-QIIKMG3M.js";
18
- import "./chunk-2DA7EFZV.js";
19
- import "./chunk-VPC5NLZG.js";
20
- import "./chunk-YJWREXN6.js";
21
- import "./chunk-J2L726BC.js";
22
- import "./chunk-2S3OGPUC.js";
23
- import "./chunk-XNFVSVBS.js";
24
- import "./chunk-7NXKPDF3.js";
25
- import "./chunk-K2EIFEQF.js";
26
- import "./chunk-UI5RLBKQ.js";
20
+ import "./chunk-TISYUUEJ.js";
21
+ import "./chunk-ALJUSOF7.js";
22
+ import "./chunk-SRKIBFOE.js";
23
+ import "./chunk-7FSHVVTZ.js";
24
+ import "./chunk-TSAYTRX3.js";
25
+ import "./chunk-YZLQZU5E.js";
27
26
  import "./chunk-W2HNI6AA.js";
28
- import "./chunk-473OA62O.js";
29
- import "./chunk-ZUGNCQZE.js";
27
+ import "./chunk-V67IQB7H.js";
28
+ import "./chunk-FN3HUUO2.js";
29
+ import "./chunk-T6UB5PNX.js";
30
+ import "./chunk-7NXKPDF3.js";
31
+ import "./chunk-ZUDSZGVO.js";
32
+ import "./chunk-ZIOKV2X6.js";
33
+ import "./chunk-QRKHHWJJ.js";
34
+ import "./chunk-7EGSY3E4.js";
35
+ import "./chunk-IY2HRXOZ.js";
36
+ import "./chunk-4OO6VAU3.js";
37
+ import "./chunk-RCR4XPE3.js";
38
+ import "./chunk-ZOHNXUDY.js";
39
+ import "./chunk-FSNLU46W.js";
30
40
  import "./chunk-BTS4ZTF3.js";
31
41
 
32
42
  // packages/koed-server/dist/cli-integration-operations.js
33
43
  var runIntegrationCommand = async (command, options, dependencies) => {
34
- const { collectStatus, setupCoreIntegration, setup, setupClaudeIntegration, setupPiIntegration, removeClaudeIntegration, removePiIntegration, removeCodexIntegrationFn, repairCodex, stdout, stderr } = createCliServiceContext(dependencies);
44
+ const { collectStatus, setupCoreIntegration, setup, setupClaudeIntegration, setupPiIntegration, removeClaudeIntegration, removePiIntegration, removeCodexIntegrationFn, repairCodex, resolvePaths, stdout, stderr } = createCliServiceContext(dependencies);
35
45
  const subcommand = options.client;
36
46
  const wantsJson = options.json;
47
+ const koedHome = () => resolvePaths(process.env).koedHome;
48
+ const connectAfter = (client, run) => connectAiClientAfterSetup({
49
+ client,
50
+ koedHome: koedHome(),
51
+ run,
52
+ verify: (home) => verifyAiClientIntegration(client, home, process.env, collectStatus)
53
+ });
37
54
  try {
38
55
  if (command === "setup" && subcommand === "core") {
39
56
  const result = await setupCoreIntegration();
@@ -58,7 +75,7 @@ var runIntegrationCommand = async (command, options, dependencies) => {
58
75
  if (deferredRecall || blockingRecall) {
59
76
  stderr.write("Legacy recall flags are deprecated; select delivery_mode on memory_answer instead.\n");
60
77
  }
61
- const result = await setup({
78
+ const result = await connectAfter("codex", () => setup({
62
79
  environment: {
63
80
  ...process.env,
64
81
  ...withoutGuidance || withGuidance ? {
@@ -66,7 +83,7 @@ var runIntegrationCommand = async (command, options, dependencies) => {
66
83
  } : {},
67
84
  ...deferredRecall || blockingRecall ? { KOED_CODEX_STOP_DELIVERY: deferredRecall ? "1" : "0" } : {}
68
85
  }
69
- });
86
+ }));
70
87
  if (wantsJson) {
71
88
  printJson(stdout, result);
72
89
  } else {
@@ -76,7 +93,7 @@ var runIntegrationCommand = async (command, options, dependencies) => {
76
93
  return result.ok ? 0 : 1;
77
94
  }
78
95
  if (command === "setup" && subcommand === "pi") {
79
- const result = await setupPiIntegration();
96
+ const result = await connectAfter("pi", () => setupPiIntegration());
80
97
  if (wantsJson) {
81
98
  printJson(stdout, result);
82
99
  } else {
@@ -86,7 +103,7 @@ var runIntegrationCommand = async (command, options, dependencies) => {
86
103
  return result.ok ? 0 : 1;
87
104
  }
88
105
  if (command === "setup" && subcommand === "claude") {
89
- const result = await (options.backgroundRecall ? setupClaudeIntegration(void 0, void 0, {
106
+ const result = await connectAfter("claude", () => options.backgroundRecall ? setupClaudeIntegration(void 0, void 0, {
90
107
  backgroundRecall: true
91
108
  }) : setupClaudeIntegration());
92
109
  if (wantsJson) {
@@ -101,7 +118,7 @@ var runIntegrationCommand = async (command, options, dependencies) => {
101
118
  return result.ok ? 0 : 1;
102
119
  }
103
120
  if (command === "repair" && subcommand === "codex") {
104
- const result = await repairCodex();
121
+ const result = await connectAfter("codex", () => repairCodex());
105
122
  if (wantsJson) {
106
123
  printJson(stdout, result);
107
124
  } else {
@@ -136,7 +153,7 @@ var runIntegrationCommand = async (command, options, dependencies) => {
136
153
  return result.ok ? 0 : 1;
137
154
  }
138
155
  if (command === "repair" && subcommand) {
139
- const result = subcommand === "codex" ? await repairCodex() : subcommand === "claude" ? await setupClaudeIntegration() : subcommand === "pi" ? await setupPiIntegration() : null;
156
+ const result = subcommand === "codex" ? await connectAfter("codex", () => repairCodex()) : subcommand === "claude" ? await connectAfter("claude", () => setupClaudeIntegration()) : subcommand === "pi" ? await connectAfter("pi", () => setupPiIntegration()) : null;
140
157
  if (!result)
141
158
  throw new Error("repair client must be codex, claude, or pi.");
142
159
  if (wantsJson)
@@ -147,9 +164,13 @@ var runIntegrationCommand = async (command, options, dependencies) => {
147
164
  return result.ok ? 0 : 1;
148
165
  }
149
166
  if (command === "remove" && subcommand) {
150
- const result = subcommand === "codex" ? removeCodexIntegrationFn() : subcommand === "claude" ? removeClaudeIntegration() : subcommand === "pi" ? removePiIntegration() : null;
151
- if (!result)
167
+ if (subcommand !== "codex" && subcommand !== "claude" && subcommand !== "pi")
152
168
  throw new Error("remove client must be codex, claude, or pi.");
169
+ const result = disconnectAiClientThenRemove({
170
+ client: subcommand,
171
+ koedHome: koedHome(),
172
+ remove: () => subcommand === "codex" ? removeCodexIntegrationFn() : subcommand === "claude" ? removeClaudeIntegration() : removePiIntegration()
173
+ });
153
174
  if (wantsJson)
154
175
  printJson(stdout, result);
155
176
  else
@@ -1,21 +1,31 @@
1
1
  import { createRequire as createKoedRequire } from "node:module"; const require = createKoedRequire(import.meta.url);
2
+ import {
3
+ removeProjectTeamWorkspaceLinksForBackend,
4
+ removeProjectTeamWorkspaceLinksForMismatchedBinding
5
+ } from "./chunk-6JRWGOQG.js";
2
6
  import {
3
7
  disconnectUpstreamBackendEnrollment,
4
8
  getUpstreamEnrollmentStatus,
5
9
  readUpstreamEnrollmentBinding,
6
10
  startUpstreamEnrollment
7
- } from "./chunk-SKVYP7NY.js";
11
+ } from "./chunk-WPIEF4LY.js";
8
12
  import {
9
13
  applyPersistedLocalPorts
10
- } from "./chunk-HFM6ROJL.js";
14
+ } from "./chunk-TISYUUEJ.js";
15
+ import "./chunk-SRKIBFOE.js";
11
16
  import {
12
- removeProjectTeamWorkspaceLinksForBackend,
13
- removeProjectTeamWorkspaceLinksForMismatchedBinding
14
- } from "./chunk-6JRWGOQG.js";
17
+ resolveKoedServerPaths
18
+ } from "./chunk-TSAYTRX3.js";
19
+ import "./chunk-YZLQZU5E.js";
20
+ import {
21
+ loadRepoEnv,
22
+ resolveApiUrl
23
+ } from "./chunk-W2HNI6AA.js";
15
24
  import {
16
25
  applyActiveRuntimeUrls,
17
26
  readActiveRuntimeState
18
- } from "./chunk-G4IIVVJO.js";
27
+ } from "./chunk-T6UB5PNX.js";
28
+ import "./chunk-7NXKPDF3.js";
19
29
  import {
20
30
  beginUpstreamDisconnectCleanup,
21
31
  completeUpstreamDisconnectCleanup,
@@ -30,17 +40,7 @@ import {
30
40
  updateUpstreamBackendRoutePolicy,
31
41
  updateUpstreamDisconnectCleanup,
32
42
  upstreamDisconnectCleanupPending
33
- } from "./chunk-YJWREXN6.js";
34
- import "./chunk-XNFVSVBS.js";
35
- import "./chunk-7NXKPDF3.js";
36
- import {
37
- resolveKoedServerPaths
38
- } from "./chunk-K2EIFEQF.js";
39
- import "./chunk-UI5RLBKQ.js";
40
- import {
41
- loadRepoEnv,
42
- resolveApiUrl
43
- } from "./chunk-W2HNI6AA.js";
43
+ } from "./chunk-RCR4XPE3.js";
44
44
  import {
45
45
  COLLABORATION_CONTRACT_VERSION,
46
46
  COLLABORATION_RECONNECT_BACKOFF_CAP_MS,
@@ -66,7 +66,6 @@ import {
66
66
  collaborationSnapshotSchema,
67
67
  collaborationSubscriptionSchema,
68
68
  deleteCollaborationPendingSend,
69
- external_exports,
70
69
  isTeamCollaborationSelection,
71
70
  listCollaborationPendingSends,
72
71
  readBoundedJsonObject,
@@ -74,7 +73,10 @@ import {
74
73
  readLocalEdgeClientCredentialAuthorization,
75
74
  storeCollaborationPendingSend,
76
75
  updateCollaborationPendingSendState
77
- } from "./chunk-473OA62O.js";
76
+ } from "./chunk-ZOHNXUDY.js";
77
+ import {
78
+ external_exports
79
+ } from "./chunk-FSNLU46W.js";
78
80
  import "./chunk-BTS4ZTF3.js";
79
81
 
80
82
  // packages/koed-server/dist/desktop-collaboration-broker.js
@@ -1,10 +1,10 @@
1
1
  import { createRequire as createKoedRequire } from "node:module"; const require = createKoedRequire(import.meta.url);
2
2
  import {
3
3
  runApplicationSecretProvider
4
- } from "./chunk-2S3OGPUC.js";
4
+ } from "./chunk-EA4QDDQA.js";
5
5
  import {
6
6
  ensureDeviceIdentity
7
- } from "./chunk-XNFVSVBS.js";
7
+ } from "./chunk-SRKIBFOE.js";
8
8
  import {
9
9
  loadRepoEnv,
10
10
  resolveApiUrl
@@ -27,7 +27,7 @@ import {
27
27
  signPdsRecord,
28
28
  validatePdsGroupStatement,
29
29
  validatePdsKeyBundle
30
- } from "./chunk-473OA62O.js";
30
+ } from "./chunk-ZOHNXUDY.js";
31
31
 
32
32
  // packages/koed-server/dist/personal-sync.js
33
33
  import { createCipheriv as createCipheriv2, createDecipheriv as createDecipheriv2, createHash as createHash2, generateKeyPairSync, randomBytes as randomBytes2, randomUUID as randomUUID2, scryptSync, sign } from "node:crypto";
@@ -1,10 +1,10 @@
1
1
  import { createRequire as createKoedRequire } from "node:module"; const require = createKoedRequire(import.meta.url);
2
2
  import {
3
3
  resolveKoedHome
4
- } from "./chunk-K2EIFEQF.js";
4
+ } from "./chunk-TSAYTRX3.js";
5
5
  import {
6
6
  createPdsApplicationSecretStore
7
- } from "./chunk-473OA62O.js";
7
+ } from "./chunk-ZOHNXUDY.js";
8
8
 
9
9
  // packages/koed-server/dist/application-secret-provider.js
10
10
  import { existsSync } from "node:fs";