@koed-labs/server 1.0.0 → 1.3.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 (44) hide show
  1. package/README.md +3 -3
  2. package/package.json +1 -1
  3. package/vendor/{chunk-W2HNI6AA.js → chunk-26D2DYEJ.js} +12 -2
  4. package/vendor/{chunk-S6HD3MDU.js → chunk-2XVGC6KN.js} +2 -2
  5. package/vendor/chunk-2YCDKSKW.js +45 -0
  6. package/vendor/{chunk-T7OGE5E5.js → chunk-4QETHLFK.js} +3 -3
  7. package/vendor/{chunk-E6YVGIEW.js → chunk-5ZYY6GLX.js} +728 -34
  8. package/vendor/{chunk-BYN6KXNP.js → chunk-AAAVAB5Q.js} +5 -5
  9. package/vendor/{chunk-UCOHFZ77.js → chunk-B25G2HFV.js} +2 -2
  10. package/vendor/{chunk-F77ZTTNS.js → chunk-BRPU557N.js} +3 -3
  11. package/vendor/{chunk-QV3WPU7A.js → chunk-BTBSSNAR.js} +1 -1
  12. package/vendor/{chunk-ILQVLZ2I.js → chunk-BYN4THYX.js} +5 -5
  13. package/vendor/{chunk-64AST7WZ.js → chunk-BYZDN2WK.js} +5 -2
  14. package/vendor/{chunk-XKXSC6YS.js → chunk-CLI4TFKY.js} +21 -13
  15. package/vendor/{chunk-W6632NOX.js → chunk-CZKIP3UJ.js} +4 -3
  16. package/vendor/{chunk-DWWMBGHX.js → chunk-DNHKSXD5.js} +19 -18
  17. package/vendor/{chunk-AOZ3LMTF.js → chunk-F7BTC7UR.js} +3 -2
  18. package/vendor/{chunk-USHFSJT7.js → chunk-FZAIOBQQ.js} +11 -9
  19. package/vendor/{chunk-NGV45YWB.js → chunk-GBQXRSSZ.js} +4 -4
  20. package/vendor/{chunk-7FSHVVTZ.js → chunk-HFGCZ76G.js} +7 -1
  21. package/vendor/{chunk-4DHYSJJT.js → chunk-HN2X7VA2.js} +1 -1
  22. package/vendor/{chunk-54UL4U2E.js → chunk-IHVJNZXT.js} +101 -33
  23. package/vendor/{chunk-EEBIYWTE.js → chunk-JHHI5KG6.js} +19 -18
  24. package/vendor/{chunk-TIBYKMRW.js → chunk-JLYGPZYP.js} +38 -45
  25. package/vendor/{chunk-XCO3RV3Z.js → chunk-K2KUQRHT.js} +1 -1
  26. package/vendor/{chunk-Y6GE52OP.js → chunk-KB3MFZD7.js} +20 -19
  27. package/vendor/{chunk-L4RD3TAZ.js → chunk-LLJV6XQ6.js} +14 -8
  28. package/vendor/{chunk-KG3RANR4.js → chunk-LVUQ5N23.js} +1 -1
  29. package/vendor/{chunk-KRBZZ6GS.js → chunk-O5NAIZP3.js} +9 -9
  30. package/vendor/{chunk-SQZ2OSP6.js → chunk-OFNOMEVX.js} +2 -2
  31. package/vendor/{chunk-273NMYXE.js → chunk-PAPGIBPA.js} +8 -7
  32. package/vendor/{chunk-VLP72QWX.js → chunk-PMDFTON3.js} +116 -64
  33. package/vendor/{chunk-GY5GATZL.js → chunk-RBD4HLDB.js} +7 -2
  34. package/vendor/{chunk-F7AMEDDU.js → chunk-SANHAZJM.js} +4 -4
  35. package/vendor/{chunk-WBMO7YCO.js → chunk-SQNSVJ3W.js} +1 -1
  36. package/vendor/{chunk-VGL5AZN5.js → chunk-TCL6KGG7.js} +1 -1
  37. package/vendor/{chunk-7NOQSX4T.js → chunk-UKBULNBO.js} +5 -3
  38. package/vendor/{chunk-OZU6JFB4.js → chunk-XSNPYCS5.js} +6 -5
  39. package/vendor/{chunk-LHUMBHG7.js → chunk-XYC3MIS6.js} +1 -1
  40. package/vendor/{chunk-UIMUUIH7.js → chunk-YHXEFDZV.js} +14 -14
  41. package/vendor/{chunk-7HLNJ2BI.js → chunk-YLFOTZFU.js} +1 -1
  42. package/vendor/{chunk-ALJUSOF7.js → chunk-YY7NMZGD.js} +79 -1
  43. package/vendor/component-manifest-catalog.js +1 -1
  44. package/vendor/control-plane.js +7 -4
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-IY2HRXOZ.js";
5
5
 
6
6
  // packages/koed-server/dist/component-manifest-catalog-data.js
7
- var productionComponentManifestCatalog = validateManifestCatalog({ "schemaVersion": 2, "productVersion": "1.0.0", "entries": [{ "component": "base", "manifestSha256": "0cf17d418882012bbcc43df60e2856e88b477f01f970b588658d40f7542d42d3", "target": { "platform": "linux", "architecture": "x64", "libc": { "family": "glibc", "minimumVersion": "2.35" } } }, { "component": "base", "manifestSha256": "eda39274ee6e865716b2e7ae21bc77bdc23e9c6ccaf15342f1a084e1c11fae00", "target": { "platform": "macos", "architecture": "arm64" } }, { "component": "privacy", "variant": "cpu", "manifestSha256": "c5d623196ed957adf7eb9cc5b9a9b75e1e51a393b4878288a46bc40b13ef8602", "target": { "platform": "linux", "architecture": "x64", "libc": { "family": "glibc", "minimumVersion": "2.35" } } }, { "component": "privacy", "variant": "cuda", "manifestSha256": "7b487834eccc09a12d516c6da63db691214cac4d52c72484afe9461e11759bbf", "target": { "platform": "linux", "architecture": "x64", "libc": { "family": "glibc", "minimumVersion": "2.35" } } }, { "component": "privacy", "manifestSha256": "832b587bd1f17047519031d6a5e56e4406c2ac322bea4fdeff7f98fbc7d5a51f", "target": { "platform": "macos", "architecture": "arm64" } }] });
7
+ var productionComponentManifestCatalog = validateManifestCatalog({ "schemaVersion": 2, "productVersion": "1.3.0", "entries": [{ "component": "base", "manifestSha256": "563f4a853b25a35e7478cfab893c0193a96c70c343b6fe423fdc874b545c4172", "target": { "platform": "linux", "architecture": "x64", "libc": { "family": "glibc", "minimumVersion": "2.35" } } }, { "component": "base", "manifestSha256": "42e05336a7a53ad30daf2327530b9beeaab8f7838b6a8b73be2fdc309a286e3f", "target": { "platform": "macos", "architecture": "arm64" } }, { "component": "privacy", "variant": "cpu", "manifestSha256": "6f13d76568555ff4cdb6cb0345f1695dac7842669d5b826d9cdf4e5adf26dd52", "target": { "platform": "linux", "architecture": "x64", "libc": { "family": "glibc", "minimumVersion": "2.35" } } }, { "component": "privacy", "variant": "cuda", "manifestSha256": "0a73c905caa88d655bfd66451b9de15a0e45ec26f4f58ad295c25eb14b9c443b", "target": { "platform": "linux", "architecture": "x64", "libc": { "family": "glibc", "minimumVersion": "2.35" } } }, { "component": "privacy", "manifestSha256": "cda5e9951079a6917a7b43eba30a25eb056bbcdc0cb2b964d52c0a47367dee1b", "target": { "platform": "macos", "architecture": "arm64" } }] });
8
8
 
9
9
  export {
10
10
  productionComponentManifestCatalog
@@ -2,40 +2,41 @@ import { createRequire as createKoedRequire } from "node:module"; const require
2
2
  import {
3
3
  createCliServiceContext,
4
4
  printJson
5
- } from "./chunk-54UL4U2E.js";
6
- import "./chunk-L4RD3TAZ.js";
7
- import "./chunk-NGV45YWB.js";
8
- import "./chunk-GY5GATZL.js";
5
+ } from "./chunk-IHVJNZXT.js";
6
+ import "./chunk-LLJV6XQ6.js";
7
+ import "./chunk-GBQXRSSZ.js";
8
+ import "./chunk-RBD4HLDB.js";
9
+ import "./chunk-2YCDKSKW.js";
9
10
  import "./chunk-JYK6UL6D.js";
10
- import "./chunk-T7OGE5E5.js";
11
+ import "./chunk-4QETHLFK.js";
11
12
  import {
12
13
  connectAiClientAfterSetup,
13
14
  disconnectAiClientThenRemove,
14
15
  verifyAiClientIntegration
15
- } from "./chunk-KG3RANR4.js";
16
+ } from "./chunk-LVUQ5N23.js";
16
17
  import {
17
18
  evaluateAiClientReadiness
18
- } from "./chunk-USHFSJT7.js";
19
+ } from "./chunk-FZAIOBQQ.js";
19
20
  import "./chunk-QT24SAW6.js";
20
21
  import "./chunk-TISYUUEJ.js";
21
- import "./chunk-ALJUSOF7.js";
22
- import "./chunk-LHUMBHG7.js";
23
- import "./chunk-7FSHVVTZ.js";
22
+ import "./chunk-YY7NMZGD.js";
23
+ import "./chunk-XYC3MIS6.js";
24
+ import "./chunk-HFGCZ76G.js";
24
25
  import "./chunk-TSAYTRX3.js";
25
26
  import "./chunk-YZLQZU5E.js";
26
- import "./chunk-W2HNI6AA.js";
27
+ import "./chunk-26D2DYEJ.js";
27
28
  import "./chunk-OG7G6DIR.js";
28
- import "./chunk-UCOHFZ77.js";
29
+ import "./chunk-B25G2HFV.js";
29
30
  import "./chunk-T6UB5PNX.js";
30
31
  import "./chunk-7NXKPDF3.js";
31
- import "./chunk-XCO3RV3Z.js";
32
- import "./chunk-7HLNJ2BI.js";
33
- import "./chunk-VGL5AZN5.js";
34
- import "./chunk-QV3WPU7A.js";
32
+ import "./chunk-K2KUQRHT.js";
33
+ import "./chunk-YLFOTZFU.js";
34
+ import "./chunk-TCL6KGG7.js";
35
+ import "./chunk-BTBSSNAR.js";
35
36
  import "./chunk-IY2HRXOZ.js";
36
- import "./chunk-4DHYSJJT.js";
37
- import "./chunk-WBMO7YCO.js";
38
- import "./chunk-E6YVGIEW.js";
37
+ import "./chunk-HN2X7VA2.js";
38
+ import "./chunk-SQNSVJ3W.js";
39
+ import "./chunk-5ZYY6GLX.js";
39
40
  import "./chunk-FSNLU46W.js";
40
41
  import "./chunk-BTS4ZTF3.js";
41
42
 
@@ -1,35 +1,41 @@
1
1
  import { createRequire as createKoedRequire } from "node:module"; const require = createKoedRequire(import.meta.url);
2
2
  import {
3
3
  resolveKoedServerConfig
4
- } from "./chunk-ALJUSOF7.js";
4
+ } from "./chunk-YY7NMZGD.js";
5
5
  import {
6
6
  parseEnvFile
7
- } from "./chunk-W2HNI6AA.js";
7
+ } from "./chunk-26D2DYEJ.js";
8
8
  import {
9
9
  resolveTeamCollaborationEnabled
10
- } from "./chunk-E6YVGIEW.js";
10
+ } from "./chunk-5ZYY6GLX.js";
11
11
 
12
12
  // packages/koed-server/dist/effective-runtime-config.js
13
13
  import { existsSync, readFileSync } from "node:fs";
14
14
  import { resolve } from "node:path";
15
15
  function resolveEffectiveRuntimeConfig(paths, environment, execution) {
16
- const envPath = environment.KOED_ENV_PATH?.trim() ? resolve(environment.KOED_ENV_PATH) : execution === "source" ? resolve(paths.repoRoot, ".env") : void 0;
16
+ const selectedPath = environment.KOED_ENV_PATH?.trim();
17
+ const explicitEnvPath = selectedPath ? resolve(selectedPath) : void 0;
18
+ const envPath = explicitEnvPath ?? (execution === "source" ? resolve(paths.repoRoot, ".env") : void 0);
17
19
  let fileEnvironment = {};
18
20
  if (envPath) {
19
21
  if (!existsSync(envPath)) {
20
- if (environment.KOED_ENV_PATH?.trim()) {
22
+ if (explicitEnvPath) {
21
23
  throw new Error(`Explicit environment file does not exist: ${envPath}`);
22
24
  }
23
25
  } else {
24
26
  fileEnvironment = parseEnvFile(readFileSync(envPath, "utf8"), {
25
- strict: Boolean(environment.KOED_ENV_PATH?.trim()),
27
+ strict: Boolean(explicitEnvPath),
26
28
  source: envPath
27
29
  });
28
30
  }
29
31
  }
30
- const effectiveEnvironment = { ...fileEnvironment, ...environment };
32
+ const effectiveEnvironment = {
33
+ ...fileEnvironment,
34
+ ...environment,
35
+ ...explicitEnvPath ? { KOED_ENV_PATH: explicitEnvPath } : {}
36
+ };
31
37
  const config = resolveKoedServerConfig(paths, effectiveEnvironment, {
32
- strict: execution === "packaged" || Boolean(environment.KOED_ENV_PATH?.trim())
38
+ strict: execution === "packaged" || Boolean(explicitEnvPath)
33
39
  });
34
40
  return {
35
41
  config,
@@ -3,7 +3,7 @@ import {
3
3
  aiClientConnectionRevision,
4
4
  grantAiClientConnection,
5
5
  revokeAiClientConnection
6
- } from "./chunk-USHFSJT7.js";
6
+ } from "./chunk-FZAIOBQQ.js";
7
7
 
8
8
  // packages/koed-server/dist/ai-client-authorization.js
9
9
  var clientNames = {
@@ -2,13 +2,13 @@ import { createRequire as createKoedRequire } from "node:module"; const require
2
2
  import {
3
3
  calculateRuntimeRequirements,
4
4
  resolveEffectiveRuntimeConfig
5
- } from "./chunk-L4RD3TAZ.js";
6
- import "./chunk-ALJUSOF7.js";
5
+ } from "./chunk-LLJV6XQ6.js";
6
+ import "./chunk-YY7NMZGD.js";
7
7
  import {
8
8
  resolveKoedServerPaths
9
9
  } from "./chunk-TSAYTRX3.js";
10
10
  import "./chunk-YZLQZU5E.js";
11
- import "./chunk-W2HNI6AA.js";
11
+ import "./chunk-26D2DYEJ.js";
12
12
  import {
13
13
  resolveKoedAppRuntimeExecution,
14
14
  resolveKoedControlPlaneVersion,
@@ -28,19 +28,19 @@ import {
28
28
  resolveComponentManifestPinTarget,
29
29
  stageComponent,
30
30
  stageGeneration
31
- } from "./chunk-UCOHFZ77.js";
31
+ } from "./chunk-B25G2HFV.js";
32
32
  import "./chunk-T6UB5PNX.js";
33
33
  import "./chunk-7NXKPDF3.js";
34
34
  import {
35
35
  productionComponentManifestCatalog
36
- } from "./chunk-XCO3RV3Z.js";
37
- import "./chunk-7HLNJ2BI.js";
38
- import "./chunk-VGL5AZN5.js";
39
- import "./chunk-QV3WPU7A.js";
36
+ } from "./chunk-K2KUQRHT.js";
37
+ import "./chunk-YLFOTZFU.js";
38
+ import "./chunk-TCL6KGG7.js";
39
+ import "./chunk-BTBSSNAR.js";
40
40
  import {
41
41
  validateManifestCatalog
42
42
  } from "./chunk-IY2HRXOZ.js";
43
- import "./chunk-E6YVGIEW.js";
43
+ import "./chunk-5ZYY6GLX.js";
44
44
  import "./chunk-FSNLU46W.js";
45
45
  import "./chunk-BTS4ZTF3.js";
46
46
 
@@ -12,10 +12,10 @@ import {
12
12
  updateUpstreamBackendRoutePolicy,
13
13
  upstreamBackendAdvertisesCapability,
14
14
  upstreamBackendSupportsTeamMemoryAnswerTasks
15
- } from "./chunk-WBMO7YCO.js";
15
+ } from "./chunk-SQNSVJ3W.js";
16
16
  import {
17
17
  isTeamMemoryAnswerTaskCapability
18
- } from "./chunk-E6YVGIEW.js";
18
+ } from "./chunk-5ZYY6GLX.js";
19
19
  import "./chunk-FSNLU46W.js";
20
20
  import "./chunk-BTS4ZTF3.js";
21
21
  export {
@@ -3,11 +3,12 @@ import {
3
3
  checkCudaHost,
4
4
  nativeCommand,
5
5
  validateStagedCuda
6
- } from "./chunk-XKXSC6YS.js";
6
+ } from "./chunk-CLI4TFKY.js";
7
+ import "./chunk-2YCDKSKW.js";
7
8
  import "./chunk-JYK6UL6D.js";
8
9
  import {
9
10
  resolveKoedServerConfig
10
- } from "./chunk-ALJUSOF7.js";
11
+ } from "./chunk-YY7NMZGD.js";
11
12
  import {
12
13
  resolveKoedRuntimeOwner
13
14
  } from "./chunk-OG7G6DIR.js";
@@ -17,10 +18,10 @@ import {
17
18
  renameAtomically,
18
19
  resolveDesktopRuntimeOwner,
19
20
  withStoppedRuntime
20
- } from "./chunk-UCOHFZ77.js";
21
+ } from "./chunk-B25G2HFV.js";
21
22
  import "./chunk-T6UB5PNX.js";
22
23
  import "./chunk-7NXKPDF3.js";
23
- import "./chunk-XCO3RV3Z.js";
24
+ import "./chunk-K2KUQRHT.js";
24
25
  import {
25
26
  canonicalArtifactJson,
26
27
  extractNativeArchive,
@@ -30,7 +31,7 @@ import {
30
31
  readNativeMetadata,
31
32
  syncNativeDirectory,
32
33
  verifyNativePayload
33
- } from "./chunk-7HLNJ2BI.js";
34
+ } from "./chunk-YLFOTZFU.js";
34
35
  import {
35
36
  compareNativeVersions,
36
37
  compatibleCuda,
@@ -38,8 +39,8 @@ import {
38
39
  nativeKind,
39
40
  selectNativeRuntimeCatalog,
40
41
  validateNativeRuntimeCatalog
41
- } from "./chunk-VGL5AZN5.js";
42
- import "./chunk-QV3WPU7A.js";
42
+ } from "./chunk-TCL6KGG7.js";
43
+ import "./chunk-BTBSSNAR.js";
43
44
  import "./chunk-IY2HRXOZ.js";
44
45
  import "./chunk-FSNLU46W.js";
45
46
  import "./chunk-BTS4ZTF3.js";
@@ -8,7 +8,7 @@ import {
8
8
  import {
9
9
  loadRepoEnv,
10
10
  resolveApiUrl
11
- } from "./chunk-W2HNI6AA.js";
11
+ } from "./chunk-26D2DYEJ.js";
12
12
  import {
13
13
  readActiveRuntimeState,
14
14
  withFileLock
@@ -26,7 +26,7 @@ import {
26
26
  repositoryChangeInputSchema,
27
27
  repositoryIdentityMatches,
28
28
  repositoryIdentitySchema
29
- } from "./chunk-E6YVGIEW.js";
29
+ } from "./chunk-5ZYY6GLX.js";
30
30
  import {
31
31
  external_exports
32
32
  } from "./chunk-FSNLU46W.js";
@@ -42,6 +42,51 @@ import path, { dirname as dirname2, relative, resolve as resolve2 } from "node:p
42
42
  import { execFile } from "node:child_process";
43
43
  import { statSync } from "node:fs";
44
44
  import { dirname, resolve } from "node:path";
45
+ var parseGitProjectRemotes = (output) => {
46
+ let ambiguous = false;
47
+ const remotes = /* @__PURE__ */ new Map();
48
+ for (const line of output?.split("\n") ?? []) {
49
+ const match = line.match(/^(\S+)\s+(\S+)\s+\((fetch|push)\)$/);
50
+ if (!match) {
51
+ ambiguous = true;
52
+ continue;
53
+ }
54
+ const [, name, url] = match;
55
+ remotes.set(`${name}
56
+ ${url}`, normalizeGitRemoteUrl(url, name));
57
+ }
58
+ return {
59
+ ambiguous,
60
+ remotes: [...remotes.values()].sort((a, b) => `${a.name}:${a.fingerprint}`.localeCompare(`${b.name}:${b.fingerprint}`))
61
+ };
62
+ };
63
+ var readSelectedGitRemoteUrls = async (name, read) => {
64
+ const [fetch, push] = await Promise.all([
65
+ read(["remote", "get-url", "--all", "--", name]),
66
+ read(["remote", "get-url", "--push", "--all", "--", name])
67
+ ]);
68
+ return { name, fetch, push };
69
+ };
70
+ var runGitProjectCommand = (execute, cwd, args) => new Promise((done) => {
71
+ const finish = (error, stdout, stderr) => {
72
+ done({
73
+ value: error ? null : String(stdout).trim() || null,
74
+ failed: Boolean(error),
75
+ nonGit: Boolean(error) && /not a git repository/i.test(typeof stderr === "string" ? stderr : "")
76
+ });
77
+ };
78
+ try {
79
+ execute("git", ["-C", cwd, ...args], {
80
+ timeout: 5e3,
81
+ maxBuffer: 1024 * 1024,
82
+ killSignal: "SIGKILL",
83
+ encoding: "utf8"
84
+ }, finish);
85
+ } catch (error) {
86
+ finish(error instanceof Error ? error : new Error("Git execution failed"), "");
87
+ }
88
+ });
89
+ var readGitProjectCommand = async (execute, cwd, args) => (await runGitProjectCommand(execute, cwd, args)).value;
45
90
  var createGitProjectProbe = (deps = {}) => {
46
91
  const execute = deps.execFile ?? execFile;
47
92
  const stat = deps.statSync ?? statSync;
@@ -63,24 +108,7 @@ var createGitProjectProbe = (deps = {}) => {
63
108
  return [file, null];
64
109
  }
65
110
  }));
66
- const command = (cwd, args) => new Promise((done) => {
67
- const finish = (error, stdout, stderr) => {
68
- done({
69
- value: error ? null : String(stdout).trim() || null,
70
- failed: Boolean(error),
71
- nonGit: Boolean(error) && /not a git repository/i.test(typeof stderr === "string" ? stderr : "")
72
- });
73
- };
74
- try {
75
- execute("git", ["-C", cwd, ...args], {
76
- timeout: 5e3,
77
- maxBuffer: 1024 * 1024,
78
- encoding: "utf8"
79
- }, finish);
80
- } catch (error) {
81
- finish(error instanceof Error ? error : new Error("Git execution failed"), "");
82
- }
83
- });
111
+ const command = (cwd, args) => runGitProjectCommand(execute, cwd, args);
84
112
  return async (input) => {
85
113
  const cwd = resolve(input.cwd);
86
114
  const key = JSON.stringify([
@@ -124,20 +152,10 @@ var createGitProjectProbe = (deps = {}) => {
124
152
  }
125
153
  return observation.value;
126
154
  };
127
- const rawRemotes = await read(["remote", "-v"]);
128
- const remotes = /* @__PURE__ */ new Map();
129
- for (const line of rawRemotes?.split("\n") ?? []) {
130
- const match = line.match(/^(\S+)\s+(\S+)\s+\((fetch|push)\)$/);
131
- if (!match) {
132
- if (result.failedCommands.length === 0)
133
- result.status = "ambiguous";
134
- continue;
135
- }
136
- const [, name, url] = match;
137
- remotes.set(`${name}
138
- ${url}`, normalizeGitRemoteUrl(url, name));
139
- }
140
- result.remotes = [...remotes.values()].sort((a, b) => `${a.name}:${a.fingerprint}`.localeCompare(`${b.name}:${b.fingerprint}`));
155
+ const { ambiguous, remotes } = parseGitProjectRemotes(await read(["remote", "-v"]));
156
+ if (ambiguous && result.failedCommands.length === 0)
157
+ result.status = "ambiguous";
158
+ result.remotes = remotes;
141
159
  result.branch = await read(["branch", "--show-current"]);
142
160
  result.headCommit = await read(["rev-parse", "HEAD"]);
143
161
  const commonDir = await read(["rev-parse", "--git-common-dir"]);
@@ -183,6 +201,50 @@ ${url}`, normalizeGitRemoteUrl(url, name));
183
201
  var probeGitProject = createGitProjectProbe();
184
202
 
185
203
  // packages/koed-server/dist/repository-identity.js
204
+ var selectNamedRemote = (remotes, remoteName, reason) => {
205
+ const candidates = remotes.filter((remote2) => remote2.name === remoteName);
206
+ const remote = candidates[0];
207
+ if (!remote)
208
+ return { state: "unresolved", reason: "selection_missing", remoteName };
209
+ if (new Set(candidates.map((entry) => entry.fingerprint)).size !== 1)
210
+ return { state: "unresolved", reason: "selection_conflict", remoteName };
211
+ if (!isPortableGitRemote(remote))
212
+ return {
213
+ state: "unresolved",
214
+ reason: "selection_not_portable",
215
+ remoteName
216
+ };
217
+ return { state: "selected", remote, reason };
218
+ };
219
+ var resolveRepositoryRemote = (input) => {
220
+ const { observation, localSelection, associatedSelection } = input;
221
+ const { remotes } = observation;
222
+ if (localSelection !== void 0)
223
+ return selectNamedRemote(remotes, localSelection, "local_selection");
224
+ if (associatedSelection) {
225
+ const { selection } = associatedSelection;
226
+ if (selection.state === "conflict")
227
+ return { state: "unresolved", reason: "selection_conflict" };
228
+ const remote = remotes.find((entry) => isPortableGitRemote(entry) && entry.fingerprint === selection.anchorFingerprint);
229
+ return remote ? selectNamedRemote(remotes, remote.name, "replicated_selection") : { state: "unresolved", reason: "replicated_anchor_missing" };
230
+ }
231
+ if (observation.status !== "non_git") {
232
+ for (const name of ["upstream", "origin"]) {
233
+ if (remotes.some((remote) => remote.name === name && isPortableGitRemote(remote)))
234
+ return selectNamedRemote(remotes, name, name);
235
+ }
236
+ }
237
+ return { state: "none" };
238
+ };
239
+ var validateSelectedRepositoryRemote = (remote, urls) => {
240
+ if (urls?.name !== remote.name || !urls.fetch || !urls.push)
241
+ return "probe_failed";
242
+ const remotes = [
243
+ remote,
244
+ ...[urls.fetch, urls.push].flatMap((output) => output.split("\n").map((url) => normalizeGitRemoteUrl(url, remote.name)))
245
+ ];
246
+ return selectNamedRemote(remotes, remote.name, "local_selection").state === "selected" ? null : "selection_conflict";
247
+ };
186
248
  var resolveRepositoryIdentity = (input) => {
187
249
  const { observation, deviceSalt, checkoutId } = input;
188
250
  const base = {
@@ -206,35 +268,23 @@ var resolveRepositoryIdentity = (input) => {
206
268
  return unresolved("probe_ambiguous");
207
269
  if (!checkoutId)
208
270
  return unresolved("checkout_unavailable");
209
- const selected = (remoteName, reason) => {
210
- const candidates = observation.remotes.filter((remote2) => remote2.name === remoteName);
211
- if (!candidates.length)
212
- return unresolved("selection_missing", remoteName);
213
- const keys = new Set(candidates.map((remote2) => remote2.fingerprint));
214
- if (keys.size !== 1)
215
- return unresolved("selection_conflict", remoteName);
216
- const remote = candidates[0];
217
- if (!isPortableGitRemote(remote))
218
- return unresolved("selection_not_portable", remoteName);
271
+ const selection = resolveRepositoryRemote(input);
272
+ if (selection.state === "unresolved")
273
+ return unresolved(selection.reason, selection.remoteName);
274
+ if (selection.state === "selected") {
275
+ if (input.selectedRemoteUrls !== void 0) {
276
+ const failure = validateSelectedRepositoryRemote(selection.remote, input.selectedRemoteUrls);
277
+ if (failure)
278
+ return unresolved(failure, selection.remote.name);
279
+ }
219
280
  return {
220
281
  ...base,
221
282
  kind: "portable_repository",
222
- key: remote.fingerprint,
223
- reason,
224
- selectedRemote: remoteName,
225
- anchorDisplay: remote.display
283
+ key: selection.remote.fingerprint,
284
+ reason: selection.reason,
285
+ selectedRemote: selection.remote.name,
286
+ anchorDisplay: selection.remote.display
226
287
  };
227
- };
228
- if (input.localSelection !== void 0)
229
- return selected(input.localSelection, "local_selection");
230
- if (input.associatedSelection) {
231
- const { selection } = input.associatedSelection;
232
- if (selection.state === "conflict")
233
- return unresolved("selection_conflict");
234
- const remote = observation.remotes.find((entry) => isPortableGitRemote(entry) && entry.fingerprint === selection.anchorFingerprint);
235
- if (!remote)
236
- return unresolved("replicated_anchor_missing");
237
- return selected(remote.name, "replicated_selection");
238
288
  }
239
289
  if (observation.status === "non_git") {
240
290
  return {
@@ -245,11 +295,6 @@ ${checkoutId}`).slice(12)}`,
245
295
  reason: "non_git"
246
296
  };
247
297
  }
248
- for (const remoteName of ["upstream", "origin"]) {
249
- const remotes = observation.remotes.filter((remote) => remote.name === remoteName);
250
- if (remotes.some(isPortableGitRemote))
251
- return selected(remoteName, remoteName);
252
- }
253
298
  if (!observation.commonDir || !input.commonDirMarker)
254
299
  return unresolved("probe_failed");
255
300
  return {
@@ -498,6 +543,12 @@ var discoverProjectMetadata = async (paths, input, depsInput = {}) => {
498
543
  checkoutId: observedCheckout.id
499
544
  });
500
545
  }
546
+ const pendingSelection = resolveRepositoryRemote({
547
+ observation,
548
+ localSelection: observedCheckout?.selectedRemote,
549
+ associatedSelection
550
+ });
551
+ const selectedRemoteUrls = gitRoot && pendingSelection.state === "selected" ? await readSelectedGitRemoteUrls(pendingSelection.remote.name, (args) => readGitProjectCommand(deps.execFile, gitRoot, args)) : null;
501
552
  return updateStore(paths, deps, (store) => {
502
553
  const checkout = store.checkouts.find((entry) => entry.id === observedCheckout?.id);
503
554
  if (store.deviceSaltId !== initial.deviceSaltId || observedCheckout && !checkout)
@@ -520,6 +571,7 @@ var discoverProjectMetadata = async (paths, input, depsInput = {}) => {
520
571
  checkoutId: checkout?.id ?? null,
521
572
  localSelection: checkout?.selectedRemote,
522
573
  associatedSelection,
574
+ selectedRemoteUrls,
523
575
  commonDirMarker: (() => {
524
576
  try {
525
577
  const stat = deps.statSync(observation.commonDir);
@@ -1,10 +1,13 @@
1
1
  import { createRequire as createKoedRequire } from "node:module"; const require = createKoedRequire(import.meta.url);
2
+ import {
3
+ privateNodeLauncher
4
+ } from "./chunk-2YCDKSKW.js";
2
5
  import {
3
6
  resolveKoedHome
4
7
  } from "./chunk-TSAYTRX3.js";
5
8
  import {
6
9
  createPdsApplicationSecretStore
7
- } from "./chunk-E6YVGIEW.js";
10
+ } from "./chunk-5ZYY6GLX.js";
8
11
 
9
12
  // packages/koed-server/dist/application-secret-provider.js
10
13
  import { existsSync } from "node:fs";
@@ -24,7 +27,9 @@ var bundledPdsSecretProviderEnvironment = (environment) => {
24
27
  return {
25
28
  ...environment,
26
29
  PDS_SECRET_PROVIDER: "headless",
27
- PDS_SECRET_PROVIDER_COMMAND: process.execPath,
30
+ // Providers run with a restricted environment, so use the private Node
31
+ // launcher that supplies its own library path.
32
+ PDS_SECRET_PROVIDER_COMMAND: privateNodeLauncher(),
28
33
  PDS_SECRET_PROVIDER_COMMAND_ARGS_JSON: JSON.stringify([
29
34
  bundledCliPath(),
30
35
  "secret-provider"
@@ -6,11 +6,11 @@ import {
6
6
  invalidateUpstreamEnrollmentReferences,
7
7
  readUpstreamEnrollmentBinding,
8
8
  startUpstreamEnrollment
9
- } from "./chunk-T7OGE5E5.js";
10
- import "./chunk-LHUMBHG7.js";
9
+ } from "./chunk-4QETHLFK.js";
10
+ import "./chunk-XYC3MIS6.js";
11
11
  import "./chunk-7NXKPDF3.js";
12
- import "./chunk-WBMO7YCO.js";
13
- import "./chunk-E6YVGIEW.js";
12
+ import "./chunk-SQNSVJ3W.js";
13
+ import "./chunk-5ZYY6GLX.js";
14
14
  import "./chunk-FSNLU46W.js";
15
15
  import "./chunk-BTS4ZTF3.js";
16
16
  export {
@@ -2,7 +2,7 @@ import { createRequire as createKoedRequire } from "node:module"; const require
2
2
  import {
3
3
  assertSecureHttpTransport,
4
4
  isTeamMemoryAnswerTaskCapability
5
- } from "./chunk-E6YVGIEW.js";
5
+ } from "./chunk-5ZYY6GLX.js";
6
6
  import {
7
7
  __commonJS,
8
8
  __require,
@@ -1,7 +1,7 @@
1
1
  import { createRequire as createKoedRequire } from "node:module"; const require = createKoedRequire(import.meta.url);
2
2
  import {
3
3
  productionNativeRuntimeCatalog
4
- } from "./chunk-QV3WPU7A.js";
4
+ } from "./chunk-BTBSSNAR.js";
5
5
  import {
6
6
  external_exports
7
7
  } from "./chunk-FSNLU46W.js";
@@ -3,12 +3,14 @@ import {
3
3
  environmentWithRepoEnv,
4
4
  loadRepoEnv,
5
5
  parseEnvFile,
6
- resolveApiUrl
7
- } from "./chunk-W2HNI6AA.js";
6
+ resolveApiUrl,
7
+ withAbsoluteEnvPath
8
+ } from "./chunk-26D2DYEJ.js";
8
9
  import "./chunk-BTS4ZTF3.js";
9
10
  export {
10
11
  environmentWithRepoEnv,
11
12
  loadRepoEnv,
12
13
  parseEnvFile,
13
- resolveApiUrl
14
+ resolveApiUrl,
15
+ withAbsoluteEnvPath
14
16
  };
@@ -6,14 +6,15 @@ import {
6
6
  personalSyncProviderEnvironment,
7
7
  redeemPairingLink,
8
8
  runPersonalSyncCommand
9
- } from "./chunk-NGV45YWB.js";
10
- import "./chunk-GY5GATZL.js";
11
- import "./chunk-LHUMBHG7.js";
9
+ } from "./chunk-GBQXRSSZ.js";
10
+ import "./chunk-RBD4HLDB.js";
11
+ import "./chunk-2YCDKSKW.js";
12
+ import "./chunk-XYC3MIS6.js";
12
13
  import "./chunk-TSAYTRX3.js";
13
14
  import "./chunk-YZLQZU5E.js";
14
- import "./chunk-W2HNI6AA.js";
15
+ import "./chunk-26D2DYEJ.js";
15
16
  import "./chunk-7NXKPDF3.js";
16
- import "./chunk-E6YVGIEW.js";
17
+ import "./chunk-5ZYY6GLX.js";
17
18
  import "./chunk-FSNLU46W.js";
18
19
  import "./chunk-BTS4ZTF3.js";
19
20
  export {
@@ -9,7 +9,7 @@ import {
9
9
  hostProofReferenceFor,
10
10
  inspectDeviceIdentity,
11
11
  serializeHostProof
12
- } from "./chunk-E6YVGIEW.js";
12
+ } from "./chunk-5ZYY6GLX.js";
13
13
  import {
14
14
  __toESM
15
15
  } from "./chunk-BTS4ZTF3.js";