@koed-labs/server 0.10.3 → 1.0.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 (56) 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-273NMYXE.js +605 -0
  5. package/vendor/{chunk-VPC5NLZG.js → chunk-4DHYSJJT.js} +1 -1
  6. package/vendor/{chunk-HK2H3MVE.js → chunk-53ZFCDHP.js} +4 -0
  7. package/vendor/{chunk-YCDEMYY6.js → chunk-54UL4U2E.js} +261 -110
  8. package/vendor/{chunk-X6M525ZJ.js → chunk-64AST7WZ.js} +5 -5
  9. package/vendor/{chunk-JKOG52PE.js → chunk-7FSHVVTZ.js} +1 -1
  10. package/vendor/chunk-7HLNJ2BI.js +1669 -0
  11. package/vendor/chunk-ALJUSOF7.js +175 -0
  12. package/vendor/{chunk-A6WMU2GG.js → chunk-AOZ3LMTF.js} +5 -4
  13. package/vendor/{chunk-KUIWH33N.js → chunk-AVQCUFYQ.js} +1 -1
  14. package/vendor/{chunk-JJNLH5GA.js → chunk-BYN6KXNP.js} +21 -19
  15. package/vendor/{chunk-PY5LYLV7.js → chunk-DWWMBGHX.js} +26 -21
  16. package/vendor/chunk-E6YVGIEW.js +12518 -0
  17. package/vendor/{chunk-C3N4N5HR.js → chunk-EEBIYWTE.js} +26 -21
  18. package/vendor/{chunk-YOFI4PCH.js → chunk-F77ZTTNS.js} +7 -1
  19. package/vendor/{chunk-RVYJKKWA.js → chunk-F7AMEDDU.js} +5 -4
  20. package/vendor/{chunk-473OA62O.js → chunk-FSNLU46W.js} +218 -12497
  21. package/vendor/{chunk-2S3OGPUC.js → chunk-GY5GATZL.js} +2 -2
  22. package/vendor/chunk-ILQVLZ2I.js +50 -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-KG3RANR4.js +75 -0
  26. package/vendor/{chunk-YJ6XUZT6.js → chunk-KRBZZ6GS.js} +23 -16
  27. package/vendor/{chunk-AFLKCQHF.js → chunk-L4RD3TAZ.js} +2 -2
  28. package/vendor/{chunk-XNFVSVBS.js → chunk-LHUMBHG7.js} +1 -1
  29. package/vendor/{chunk-J2L726BC.js → chunk-NGV45YWB.js} +3 -3
  30. package/vendor/{chunk-A4NKL2PK.js → chunk-OG7G6DIR.js} +1 -1
  31. package/vendor/{chunk-DXTAWHY3.js → chunk-OZU6JFB4.js} +8 -7
  32. package/vendor/chunk-QV3WPU7A.js +8 -0
  33. package/vendor/{chunk-ZXX4ZNJY.js → chunk-S6HD3MDU.js} +3 -2
  34. package/vendor/{chunk-NEWIOOM6.js → chunk-SQZ2OSP6.js} +3 -2
  35. package/vendor/{chunk-G4IIVVJO.js → chunk-T6UB5PNX.js} +70 -2
  36. package/vendor/{chunk-SKVYP7NY.js → chunk-T7OGE5E5.js} +8 -8
  37. package/vendor/{chunk-GELDEJJ2.js → chunk-TIBYKMRW.js} +173 -51
  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-PT3AUPGE.js → chunk-UB6JCVQ3.js} +3 -1
  41. package/vendor/{chunk-NM5NXCVM.js → chunk-UCOHFZ77.js} +626 -996
  42. package/vendor/{chunk-2BWTLF7A.js → chunk-UIMUUIH7.js} +45 -21
  43. package/vendor/{chunk-HZJK5RWC.js → chunk-USHFSJT7.js} +695 -280
  44. package/vendor/chunk-VGL5AZN5.js +152 -0
  45. package/vendor/{chunk-TSRPHKAC.js → chunk-VLP72QWX.js} +16 -42
  46. package/vendor/chunk-W6632NOX.js +14 -0
  47. package/vendor/{chunk-YJWREXN6.js → chunk-WBMO7YCO.js} +1 -1
  48. package/vendor/chunk-XCO3RV3Z.js +11 -0
  49. package/vendor/chunk-XKXSC6YS.js +373 -0
  50. package/vendor/{chunk-YK4F4VY2.js → chunk-Y6GE52OP.js} +51 -30
  51. package/vendor/{chunk-UI5RLBKQ.js → chunk-YZLQZU5E.js} +17 -1
  52. package/vendor/chunk-ZKKWLLPU.js +18 -0
  53. package/vendor/cli.js +1 -1
  54. package/vendor/component-manifest-catalog.js +2 -1
  55. package/vendor/control-plane.js +11 -6
  56. package/vendor/chunk-2DA7EFZV.js +0 -924
@@ -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-54UL4U2E.js";
6
+ import "./chunk-L4RD3TAZ.js";
7
+ import "./chunk-NGV45YWB.js";
8
+ import "./chunk-GY5GATZL.js";
9
+ import "./chunk-JYK6UL6D.js";
10
+ import "./chunk-T7OGE5E5.js";
11
+ import {
12
+ connectAiClientAfterSetup,
13
+ disconnectAiClientThenRemove,
14
+ verifyAiClientIntegration
15
+ } from "./chunk-KG3RANR4.js";
6
16
  import {
7
17
  evaluateAiClientReadiness
8
- } from "./chunk-HZJK5RWC.js";
18
+ } from "./chunk-USHFSJT7.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-LHUMBHG7.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-OG7G6DIR.js";
28
+ import "./chunk-UCOHFZ77.js";
29
+ import "./chunk-T6UB5PNX.js";
30
+ import "./chunk-7NXKPDF3.js";
31
+ import "./chunk-XCO3RV3Z.js";
32
+ import "./chunk-7HLNJ2BI.js";
33
+ import "./chunk-VGL5AZN5.js";
34
+ import "./chunk-QV3WPU7A.js";
35
+ import "./chunk-IY2HRXOZ.js";
36
+ import "./chunk-4DHYSJJT.js";
37
+ import "./chunk-WBMO7YCO.js";
38
+ import "./chunk-E6YVGIEW.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,6 +1,7 @@
1
1
  import { createRequire as createKoedRequire } from "node:module"; const require = createKoedRequire(import.meta.url);
2
2
 
3
3
  // packages/koed-server/dist/runtime-artifact-source.js
4
+ import { lstatSync, readlinkSync } from "node:fs";
4
5
  import { resolve } from "node:path";
5
6
  var runtimeProcess = process;
6
7
  var trimRuntimeValue = (value) => {
@@ -21,10 +22,25 @@ var resolvePackagedKoedRuntimeRoot = (environment = process.env) => {
21
22
  const resourcesPath = resolvePackagedResourcesPath(environment);
22
23
  return resourcesPath ? resolve(resourcesPath, "koed-runtime") : void 0;
23
24
  };
25
+ function hasReleaseRuntime(paths) {
26
+ const runtime = resolve(paths.koedHome, "runtime");
27
+ if (lstatSync(resolve(runtime, "native"), { throwIfNoEntry: false }))
28
+ return true;
29
+ return ["postgres", "llama.cpp"].some((name) => {
30
+ const path = resolve(runtime, name);
31
+ return lstatSync(path, { throwIfNoEntry: false })?.isSymbolicLink() && readlinkSync(path) === `native/current/${name}`;
32
+ });
33
+ }
34
+ function assertNoReleaseRuntime(paths) {
35
+ if (hasReleaseRuntime(paths))
36
+ throw new Error("The release provider owns this runtime. Use koed runtime install --provider release --dependency-mode bundled-local or a fresh KOED_HOME.");
37
+ }
24
38
 
25
39
  export {
26
40
  isPackagedRuntimeMode,
27
41
  canUseSourceCheckoutFallback,
28
42
  resolvePackagedResourcesPath,
29
- resolvePackagedKoedRuntimeRoot
43
+ resolvePackagedKoedRuntimeRoot,
44
+ hasReleaseRuntime,
45
+ assertNoReleaseRuntime
30
46
  };
@@ -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-OG7G6DIR.js";
10
+ import "./chunk-BTS4ZTF3.js";
11
+ export {
12
+ assertKoedAppRuntimeAvailable,
13
+ resolveKoedAppRuntime,
14
+ resolveKoedAppRuntimeExecution,
15
+ resolveKoedAppRuntimeForExecution,
16
+ resolveKoedControlPlaneVersion,
17
+ resolveKoedRuntimeOwner
18
+ };
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,8 @@
1
1
  import { createRequire as createKoedRequire } from "node:module"; const require = createKoedRequire(import.meta.url);
2
2
  import {
3
3
  productionComponentManifestCatalog
4
- } from "./chunk-QIIKMG3M.js";
4
+ } from "./chunk-XCO3RV3Z.js";
5
+ import "./chunk-IY2HRXOZ.js";
5
6
  import "./chunk-BTS4ZTF3.js";
6
7
  export {
7
8
  productionComponentManifestCatalog
@@ -3,20 +3,25 @@ import {
3
3
  isKoedServerCliEntrypoint,
4
4
  runKoedServerCli,
5
5
  shouldExitPackagedSupervisor
6
- } from "./chunk-GELDEJJ2.js";
6
+ } from "./chunk-TIBYKMRW.js";
7
7
  import {
8
8
  startKoedServerDaemon
9
- } from "./chunk-JKOG52PE.js";
10
- import "./chunk-A4NKL2PK.js";
9
+ } from "./chunk-7FSHVVTZ.js";
10
+ import "./chunk-TSAYTRX3.js";
11
+ import "./chunk-YZLQZU5E.js";
12
+ import "./chunk-OG7G6DIR.js";
11
13
  import {
12
14
  productionComponentManifestCatalog
13
- } from "./chunk-QIIKMG3M.js";
14
- import "./chunk-K2EIFEQF.js";
15
- import "./chunk-UI5RLBKQ.js";
15
+ } from "./chunk-XCO3RV3Z.js";
16
+ import {
17
+ productionNativeRuntimeCatalog
18
+ } from "./chunk-QV3WPU7A.js";
19
+ import "./chunk-IY2HRXOZ.js";
16
20
  import "./chunk-BTS4ZTF3.js";
17
21
  export {
18
22
  isKoedServerCliEntrypoint,
19
23
  productionComponentManifestCatalog,
24
+ productionNativeRuntimeCatalog,
20
25
  runKoedServerCli,
21
26
  shouldExitPackagedSupervisor,
22
27
  startKoedServerDaemon