@kwonye/mcpx 0.1.106 → 0.1.107

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 (32) hide show
  1. package/dist/{chunk-hahs24dv.js → chunk-131c6axh.js} +3 -3
  2. package/dist/{chunk-a2gen8bn.js → chunk-2qbt2pxv.js} +51 -26
  3. package/dist/{chunk-h9kp47rp.js → chunk-3j4g9141.js} +6 -6
  4. package/dist/{chunk-wvzap0na.js → chunk-5r4vs8ct.js} +10 -10
  5. package/dist/{chunk-7rq88hb3.js → chunk-9bjabsqb.js} +4 -4
  6. package/dist/chunk-9jqdtz2y.js +26 -0
  7. package/dist/{chunk-jv0s0cp6.js → chunk-ad74zhbk.js} +3 -3
  8. package/dist/{chunk-27mq4agf.js → chunk-eqcsd1kw.js} +3 -3
  9. package/dist/{chunk-wztmp5b4.js → chunk-f7w0a9nn.js} +83 -20
  10. package/dist/{chunk-v041118a.js → chunk-h2ex6pmn.js} +9 -9
  11. package/dist/{chunk-chaj8a8b.js → chunk-jncje8g1.js} +19 -4
  12. package/dist/{chunk-yj7mpczw.js → chunk-kjd00ez5.js} +9 -9
  13. package/dist/{chunk-1v66g9d6.js → chunk-mazydv41.js} +2 -2
  14. package/dist/{chunk-xvqr1q9b.js → chunk-mkf7gc7q.js} +2 -2
  15. package/dist/{chunk-1mrkz29t.js → chunk-mztnw25b.js} +6 -6
  16. package/dist/{chunk-qf8bj9y7.js → chunk-n5ahyh0j.js} +5 -5
  17. package/dist/{chunk-4aafp444.js → chunk-naeqpnmf.js} +7 -7
  18. package/dist/{chunk-yr0txkw0.js → chunk-nx22h1y3.js} +12 -10
  19. package/dist/{chunk-8v13hqrp.js → chunk-qg1rbk0d.js} +2 -2
  20. package/dist/{chunk-4xym942z.js → chunk-r1aebtwm.js} +12 -12
  21. package/dist/{chunk-brxwa30j.js → chunk-rbra8ws6.js} +1 -1
  22. package/dist/{chunk-grkz21sq.js → chunk-vnka4jbe.js} +13 -3
  23. package/dist/{chunk-t20f49g3.js → chunk-z4j5q2x0.js} +1 -1
  24. package/dist/{chunk-nh6hhv29.js → chunk-z7ykm4da.js} +3 -3
  25. package/dist/{chunk-ew06e41w.js → chunk-zmf014br.js} +10 -10
  26. package/dist/cli.js +41 -41
  27. package/dist/core/control.d.ts +6 -0
  28. package/dist/core/file-state.d.ts +2 -0
  29. package/dist/core/index.js +14 -14
  30. package/dist/version.d.ts +1 -1
  31. package/package.json +1 -1
  32. package/dist/chunk-e96643mj.js +0 -26
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  lockOwnerAlive
3
- } from "./chunk-chaj8a8b.js";
3
+ } from "./chunk-jncje8g1.js";
4
4
  import {
5
5
  loadConfig,
6
6
  loadProjectConfig,
7
7
  saveConfig,
8
8
  saveProjectConfig
9
- } from "./chunk-brxwa30j.js";
9
+ } from "./chunk-rbra8ws6.js";
10
10
  import {
11
11
  findProjectConfigPath,
12
12
  getConfigPath
13
- } from "./chunk-grkz21sq.js";
13
+ } from "./chunk-vnka4jbe.js";
14
14
 
15
15
  // src/core/config-store.ts
16
16
  import fs from "node:fs";
@@ -14,7 +14,7 @@ import {
14
14
  rollbackOperation,
15
15
  saveOperation,
16
16
  synchronizeClients
17
- } from "./chunk-wztmp5b4.js";
17
+ } from "./chunk-f7w0a9nn.js";
18
18
  import {
19
19
  SecretsManager,
20
20
  addServer,
@@ -24,21 +24,21 @@ import {
24
24
  setServerEnabled,
25
25
  unregisterProject,
26
26
  updateServer
27
- } from "./chunk-8v13hqrp.js";
27
+ } from "./chunk-qg1rbk0d.js";
28
28
  import {
29
29
  mutateConfig
30
- } from "./chunk-hahs24dv.js";
30
+ } from "./chunk-131c6axh.js";
31
31
  import {
32
32
  processAlive
33
- } from "./chunk-chaj8a8b.js";
33
+ } from "./chunk-jncje8g1.js";
34
34
  import {
35
35
  listSkills
36
- } from "./chunk-7rq88hb3.js";
36
+ } from "./chunk-9bjabsqb.js";
37
37
  import {
38
38
  loadConfig,
39
39
  loadMergedConfig,
40
40
  parseCliAddCommand
41
- } from "./chunk-brxwa30j.js";
41
+ } from "./chunk-rbra8ws6.js";
42
42
  import {
43
43
  exports_external
44
44
  } from "./chunk-p7yzyt87.js";
@@ -46,7 +46,7 @@ import {
46
46
  getConfigPath,
47
47
  getRuntimeDir,
48
48
  sha256
49
- } from "./chunk-grkz21sq.js";
49
+ } from "./chunk-vnka4jbe.js";
50
50
  import {
51
51
  __require
52
52
  } from "./chunk-wj4tjacg.js";
@@ -204,8 +204,8 @@ async function syncManaged(targets) {
204
204
  }
205
205
  async function managementCommand(method, raw) {
206
206
  if (method === "status") {
207
- const { buildStatusReport } = await import("./chunk-e96643mj.js");
208
- const { loadManagedIndex } = await import("./chunk-xvqr1q9b.js");
207
+ const { buildStatusReport } = await import("./chunk-9jqdtz2y.js");
208
+ const { loadManagedIndex } = await import("./chunk-mkf7gc7q.js");
209
209
  return buildStatusReport(loadMergedConfig(), loadManagedIndex());
210
210
  }
211
211
  if (method === "auth.configure") {
@@ -297,7 +297,7 @@ async function managementCommand(method, raw) {
297
297
  return { success: true, sync: await syncManaged() };
298
298
  }
299
299
  if (method.startsWith("skill.")) {
300
- const skills = await import("./chunk-27mq4agf.js");
300
+ const skills = await import("./chunk-eqcsd1kw.js");
301
301
  const action = method.slice(6);
302
302
  const [id, value] = exports_external.tuple([string, string.optional()]).parse(raw);
303
303
  let result;
@@ -337,7 +337,7 @@ async function managementCommand(method, raw) {
337
337
  return { ...result, sync };
338
338
  }
339
339
  if (method.startsWith("plugin.")) {
340
- const plugins = await import("./chunk-v041118a.js");
340
+ const plugins = await import("./chunk-h2ex6pmn.js");
341
341
  const [name, extra, value, project] = exports_external.tuple([string.optional(), exports_external.unknown().optional(), exports_external.unknown().optional(), exports_external.unknown().optional()]).parse(raw);
342
342
  const action = method.slice(7);
343
343
  const options = exports_external.object({ name: string.optional(), enabled: exports_external.boolean().optional(), components: exports_external.record(exports_external.string(), exports_external.boolean()).optional(), approvals: exports_external.record(exports_external.string(), exports_external.boolean()).optional() });
@@ -387,7 +387,7 @@ async function managementCommand(method, raw) {
387
387
  return { name, success: true };
388
388
  }
389
389
  if (method.startsWith("marketplace.")) {
390
- const marketplaces = await import("./chunk-ew06e41w.js");
390
+ const marketplaces = await import("./chunk-zmf014br.js");
391
391
  const [name, extra] = exports_external.tuple([string, exports_external.unknown().optional()]).parse(raw);
392
392
  switch (method.slice(12)) {
393
393
  case "add":
@@ -405,7 +405,7 @@ async function managementCommand(method, raw) {
405
405
  }
406
406
  if (method === "share.import") {
407
407
  const [directory, options] = exports_external.tuple([string, exports_external.object({ locked: exports_external.boolean().optional(), dryRun: exports_external.boolean().optional(), inputs: exports_external.record(exports_external.string(), exports_external.string()).optional() }).optional()]).parse(raw);
408
- const { importEnvironment } = await import("./chunk-h9kp47rp.js");
408
+ const { importEnvironment } = await import("./chunk-3j4g9141.js");
409
409
  const result = await importEnvironment(directory, options);
410
410
  if (!options?.dryRun)
411
411
  await syncManaged();
@@ -425,6 +425,15 @@ function controlSocketPath() {
425
425
  const normal = path.join(getRuntimeDir(), "control.sock");
426
426
  return Buffer.byteLength(normal) < 96 ? normal : path.join(os.tmpdir(), `mcpx-${process.getuid?.() ?? "user"}-${sha256(getConfigPath()).slice(0, 12)}.sock`);
427
427
  }
428
+ function windowsControlPort() {
429
+ const hash = sha256(`${os.userInfo().username}:${getConfigPath()}`);
430
+ return 49152 + Number.parseInt(hash.slice(0, 4), 16) % 16384;
431
+ }
432
+ function controlConnectOptions() {
433
+ if (process.platform === "win32")
434
+ return { host: "127.0.0.1", port: windowsControlPort() };
435
+ return { socketPath: controlSocketPath() };
436
+ }
428
437
  function controlKey() {
429
438
  const file = path.join(getRuntimeDir(), "control.key");
430
439
  fs.mkdirSync(getRuntimeDir(), { recursive: true, mode: 448 });
@@ -465,19 +474,31 @@ function coordinate(work) {
465
474
  return next;
466
475
  }
467
476
  async function startControlServer() {
468
- const socketPath = controlSocketPath();
477
+ const connect = controlConnectOptions();
469
478
  controlKey();
470
- if (process.platform !== "win32" && fs.existsSync(socketPath)) {
471
- if (!fs.lstatSync(socketPath).isSocket())
479
+ if ("socketPath" in connect && fs.existsSync(connect.socketPath)) {
480
+ if (!fs.lstatSync(connect.socketPath).isSocket())
472
481
  throw new Error("Control socket path is occupied by a non-socket file.");
473
482
  try {
474
483
  await controlRequest("snapshot");
475
484
  throw new Error("Another mcpx control service is already running");
476
485
  } catch (error) {
486
+ if (error.message === "Another mcpx control service is already running")
487
+ throw error;
477
488
  if (!["ENOENT", "ECONNREFUSED", "FailedToOpenSocket"].includes(error.code ?? ""))
478
489
  throw error;
479
490
  }
480
- fs.unlinkSync(socketPath);
491
+ fs.unlinkSync(connect.socketPath);
492
+ } else if (!("socketPath" in connect)) {
493
+ try {
494
+ await controlRequest("snapshot");
495
+ throw new Error("Another mcpx control service is already running");
496
+ } catch (error) {
497
+ if (error.message === "Another mcpx control service is already running")
498
+ throw error;
499
+ if (!["ENOENT", "ECONNREFUSED", "ECONNRESET", "FailedToOpenSocket"].includes(error.code ?? ""))
500
+ throw error;
501
+ }
481
502
  }
482
503
  const clients = new Set;
483
504
  const leases = new Map;
@@ -597,12 +618,16 @@ async function startControlServer() {
597
618
  operationEvents.on("change", notify);
598
619
  await new Promise((resolve, reject) => {
599
620
  server.once("error", reject);
600
- server.listen(socketPath, () => {
621
+ const ready = () => {
601
622
  server.removeListener("error", reject);
602
- if (process.platform !== "win32")
603
- fs.chmodSync(socketPath, 384);
623
+ if ("socketPath" in connect)
624
+ fs.chmodSync(connect.socketPath, 384);
604
625
  resolve();
605
- });
626
+ };
627
+ if ("socketPath" in connect)
628
+ server.listen(connect.socketPath, ready);
629
+ else
630
+ server.listen(connect.port, connect.host, ready);
606
631
  });
607
632
  markInterruptedOperations();
608
633
  compileRuntimeSnapshot();
@@ -650,7 +675,7 @@ function controlRequest(method, args = []) {
650
675
  while (supplied.length && supplied.at(-1) === undefined)
651
676
  supplied.pop();
652
677
  const body = JSON.stringify({ version: CONTROL_VERSION, method, args: supplied });
653
- const request = http.request({ socketPath: controlSocketPath(), path: "/v1/command", method: "POST", headers: { authorization: `Bearer ${controlKey()}`, "content-type": "application/json", "content-length": Buffer.byteLength(body) } }, (response) => {
678
+ const request = http.request({ ...controlConnectOptions(), path: "/v1/command", method: "POST", headers: { authorization: `Bearer ${controlKey()}`, "content-type": "application/json", "content-length": Buffer.byteLength(body) } }, (response) => {
654
679
  let data = "";
655
680
  response.on("data", (chunk) => {
656
681
  data += chunk;
@@ -679,7 +704,7 @@ async function ensureControlService(cliPath) {
679
704
  if (!["ENOENT", "ECONNREFUSED", "FailedToOpenSocket"].includes(error.code ?? ""))
680
705
  throw error;
681
706
  }
682
- const { startDaemon } = await import("./chunk-4xym942z.js");
707
+ const { startDaemon } = await import("./chunk-r1aebtwm.js");
683
708
  await startDaemon(loadConfig(), cliPath, new SecretsManager);
684
709
  for (let attempt = 0;attempt < 50; attempt++) {
685
710
  try {
@@ -693,7 +718,7 @@ async function ensureControlService(cliPath) {
693
718
  }
694
719
  function subscribeControlEvents(listener, onError) {
695
720
  let closed = false;
696
- const request = http.get({ socketPath: controlSocketPath(), path: "/v1/events", headers: { authorization: `Bearer ${controlKey()}` } }, (response) => {
721
+ const request = http.get({ ...controlConnectOptions(), path: "/v1/events", headers: { authorization: `Bearer ${controlKey()}` } }, (response) => {
697
722
  response.on("end", () => {
698
723
  if (!closed)
699
724
  onError?.(new Error("Local service disconnected"));
@@ -725,6 +750,6 @@ function subscribeControlEvents(listener, onError) {
725
750
  };
726
751
  }
727
752
 
728
- export { runtimeConfig, probeHttpAuthRequirement, getManagementSnapshot, CONTROL_VERSION, controlSocketPath, coordinate, startControlServer, controlRequest, ensureControlService, subscribeControlEvents };
753
+ export { runtimeConfig, probeHttpAuthRequirement, getManagementSnapshot, CONTROL_VERSION, controlSocketPath, controlConnectOptions, coordinate, startControlServer, controlRequest, ensureControlService, subscribeControlEvents };
729
754
 
730
- //# debugId=32A461FC6536AB7664756E2164756E21
755
+ //# debugId=6597F39B3D5F88AD64756E2164756E21
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  exportEnvironment,
3
3
  importEnvironment
4
- } from "./chunk-qf8bj9y7.js";
5
- import"./chunk-hahs24dv.js";
6
- import"./chunk-chaj8a8b.js";
7
- import"./chunk-7rq88hb3.js";
8
- import"./chunk-brxwa30j.js";
4
+ } from "./chunk-n5ahyh0j.js";
5
+ import"./chunk-131c6axh.js";
6
+ import"./chunk-jncje8g1.js";
7
+ import"./chunk-9bjabsqb.js";
8
+ import"./chunk-rbra8ws6.js";
9
9
  import"./chunk-p7yzyt87.js";
10
- import"./chunk-grkz21sq.js";
10
+ import"./chunk-vnka4jbe.js";
11
11
  import"./chunk-bjw71y54.js";
12
12
  import"./chunk-wj4tjacg.js";
13
13
  export {
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  refreshAutoUpdateMarketplaces
3
- } from "./chunk-1mrkz29t.js";
3
+ } from "./chunk-mztnw25b.js";
4
4
  import {
5
5
  PostHog,
6
6
  capture,
7
7
  captureException
8
- } from "./chunk-4aafp444.js";
8
+ } from "./chunk-naeqpnmf.js";
9
9
  import {
10
10
  controlRequest,
11
11
  runtimeConfig,
12
12
  startControlServer
13
- } from "./chunk-a2gen8bn.js";
13
+ } from "./chunk-2qbt2pxv.js";
14
14
  import {
15
15
  APP_VERSION,
16
16
  AnnotationsSchema,
@@ -216,21 +216,21 @@ import {
216
216
  readServedSkill,
217
217
  resolveConsumer,
218
218
  synchronizeClients
219
- } from "./chunk-wztmp5b4.js";
219
+ } from "./chunk-f7w0a9nn.js";
220
220
  import {
221
221
  UpstreamError,
222
222
  classifyUpstreamError,
223
223
  ensureGatewayToken
224
- } from "./chunk-8v13hqrp.js";
224
+ } from "./chunk-qg1rbk0d.js";
225
225
  import {
226
226
  mutateConfig
227
- } from "./chunk-hahs24dv.js";
227
+ } from "./chunk-131c6axh.js";
228
228
  import {
229
229
  lockOwnerAlive
230
- } from "./chunk-chaj8a8b.js";
230
+ } from "./chunk-jncje8g1.js";
231
231
  import {
232
232
  loadConfig
233
- } from "./chunk-brxwa30j.js";
233
+ } from "./chunk-rbra8ws6.js";
234
234
  import {
235
235
  _enum,
236
236
  _null,
@@ -267,7 +267,7 @@ import {
267
267
  getTelemetryPath,
268
268
  getUpdateLockPath,
269
269
  getUpdatesDir
270
- } from "./chunk-grkz21sq.js";
270
+ } from "./chunk-vnka4jbe.js";
271
271
  import {
272
272
  isServerEnabled
273
273
  } from "./chunk-bjw71y54.js";
@@ -17795,7 +17795,7 @@ function startMarketplaceAutoUpdater() {
17795
17795
  let stopped = false;
17796
17796
  const run = () => {
17797
17797
  if (!stopped)
17798
- import("./chunk-yr0txkw0.js").then(({ coordinate }) => coordinate(() => runMarketplaceAutoUpdate())).catch(() => {
17798
+ import("./chunk-nx22h1y3.js").then(({ coordinate }) => coordinate(() => runMarketplaceAutoUpdate())).catch(() => {
17799
17799
  return;
17800
17800
  });
17801
17801
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  loadConfig
3
- } from "./chunk-brxwa30j.js";
3
+ } from "./chunk-rbra8ws6.js";
4
4
  import {
5
5
  exports_external
6
6
  } from "./chunk-p7yzyt87.js";
@@ -10,7 +10,7 @@ import {
10
10
  getSkillPackagesRoot,
11
11
  getSkillStatePath,
12
12
  getSkillsDir
13
- } from "./chunk-grkz21sq.js";
13
+ } from "./chunk-vnka4jbe.js";
14
14
 
15
15
  // src/core/skills.ts
16
16
  import fs2 from "node:fs";
@@ -62,7 +62,7 @@ function parseSource(source) {
62
62
  original: source
63
63
  };
64
64
  }
65
- if (source.startsWith("/") || source.startsWith("./") || source.startsWith("../") || source === "." || source === "..") {
65
+ if (source.startsWith("/") || source.startsWith("./") || source.startsWith("../") || source === "." || source === ".." || source.startsWith("\\\\") || /^[a-zA-Z]:[\\/]/.test(source)) {
66
66
  return {
67
67
  type: "local",
68
68
  original: source
@@ -560,4 +560,4 @@ function rollbackSkill(id) {
560
560
 
561
561
  export { validateSkillId, normalizePluginName, parseSource, PluginCache, validateSkillPackage, listSkills, getSkill, saveSkill, deleteSkill, customizeSkill, installSkillFromSource, pinSkill, unpinSkill, updateSkill, rollbackSkill };
562
562
 
563
- //# debugId=43A9FAB87FA4420064756E2164756E21
563
+ //# debugId=084E7E8E5D80E04C64756E2164756E21
@@ -0,0 +1,26 @@
1
+ import {
2
+ STATUS_CLIENTS,
3
+ buildStatusReport
4
+ } from "./chunk-z7ykm4da.js";
5
+ import"./chunk-0xt563m1.js";
6
+ import"./chunk-5r4vs8ct.js";
7
+ import"./chunk-mztnw25b.js";
8
+ import"./chunk-naeqpnmf.js";
9
+ import"./chunk-2qbt2pxv.js";
10
+ import"./chunk-f7w0a9nn.js";
11
+ import"./chunk-qg1rbk0d.js";
12
+ import"./chunk-z4j5q2x0.js";
13
+ import"./chunk-131c6axh.js";
14
+ import"./chunk-jncje8g1.js";
15
+ import"./chunk-9bjabsqb.js";
16
+ import"./chunk-rbra8ws6.js";
17
+ import"./chunk-p7yzyt87.js";
18
+ import"./chunk-vnka4jbe.js";
19
+ import"./chunk-bjw71y54.js";
20
+ import"./chunk-wj4tjacg.js";
21
+ export {
22
+ STATUS_CLIENTS,
23
+ buildStatusReport
24
+ };
25
+
26
+ //# debugId=770606CBE047940064756E2164756E21
@@ -10,10 +10,10 @@ import {
10
10
  unregisterProject,
11
11
  updateServer,
12
12
  validateServerName
13
- } from "./chunk-8v13hqrp.js";
14
- import"./chunk-chaj8a8b.js";
13
+ } from "./chunk-qg1rbk0d.js";
14
+ import"./chunk-jncje8g1.js";
15
15
  import"./chunk-p7yzyt87.js";
16
- import"./chunk-grkz21sq.js";
16
+ import"./chunk-vnka4jbe.js";
17
17
  import"./chunk-bjw71y54.js";
18
18
  import"./chunk-wj4tjacg.js";
19
19
  export {
@@ -10,10 +10,10 @@ import {
10
10
  unpinSkill,
11
11
  updateSkill,
12
12
  validateSkillPackage
13
- } from "./chunk-7rq88hb3.js";
14
- import"./chunk-brxwa30j.js";
13
+ } from "./chunk-9bjabsqb.js";
14
+ import"./chunk-rbra8ws6.js";
15
15
  import"./chunk-p7yzyt87.js";
16
- import"./chunk-grkz21sq.js";
16
+ import"./chunk-vnka4jbe.js";
17
17
  import"./chunk-bjw71y54.js";
18
18
  import"./chunk-wj4tjacg.js";
19
19
  export {
@@ -3,26 +3,27 @@ import {
3
3
  UpstreamError,
4
4
  ensureGatewayToken,
5
5
  withManagedIndexLock
6
- } from "./chunk-8v13hqrp.js";
6
+ } from "./chunk-qg1rbk0d.js";
7
7
  import {
8
8
  loadManagedIndex,
9
9
  saveManagedIndex
10
- } from "./chunk-t20f49g3.js";
10
+ } from "./chunk-z4j5q2x0.js";
11
11
  import {
12
12
  mutateConfig
13
- } from "./chunk-hahs24dv.js";
13
+ } from "./chunk-131c6axh.js";
14
14
  import {
15
+ normalizeLinkContent,
15
16
  pathFingerprint
16
- } from "./chunk-chaj8a8b.js";
17
+ } from "./chunk-jncje8g1.js";
17
18
  import {
18
19
  listSkills,
19
20
  validateSkillId,
20
21
  validateSkillPackage
21
- } from "./chunk-7rq88hb3.js";
22
+ } from "./chunk-9bjabsqb.js";
22
23
  import {
23
24
  loadConfig,
24
25
  saveConfig
25
- } from "./chunk-brxwa30j.js";
26
+ } from "./chunk-rbra8ws6.js";
26
27
  import {
27
28
  NEVER,
28
29
  ZodIssueCode,
@@ -64,7 +65,7 @@ import {
64
65
  readJsonStrict,
65
66
  sha256,
66
67
  writeJsonAtomic
67
- } from "./chunk-grkz21sq.js";
68
+ } from "./chunk-vnka4jbe.js";
68
69
  import {
69
70
  isServerEnabled
70
71
  } from "./chunk-bjw71y54.js";
@@ -11737,7 +11738,7 @@ function synchronizationTargets(config, targets) {
11737
11738
  }
11738
11739
 
11739
11740
  // src/version.ts
11740
- var APP_VERSION = "0.1.106";
11741
+ var APP_VERSION = "0.1.107";
11741
11742
 
11742
11743
  // src/core/spawn-env.ts
11743
11744
  import os from "node:os";
@@ -11749,13 +11750,17 @@ function existingNvmCurrentBin() {
11749
11750
  return fs12.existsSync(current) ? current : null;
11750
11751
  }
11751
11752
  function buildEnrichedPath(current = process.env.PATH ?? "") {
11752
- const candidates = [
11753
- ...current.split(":"),
11753
+ const delimiter = path17.delimiter;
11754
+ const extras = process.platform === "win32" ? [path17.join(os.homedir(), ".bun", "bin")] : [
11754
11755
  "/opt/homebrew/bin",
11755
11756
  "/usr/local/bin",
11756
11757
  path17.join(os.homedir(), ".bun", "bin"),
11757
11758
  path17.join(os.homedir(), ".local", "bin"),
11758
11759
  existingNvmCurrentBin()
11760
+ ];
11761
+ const candidates = [
11762
+ ...current.split(delimiter),
11763
+ ...extras
11759
11764
  ].filter((entry) => Boolean(entry));
11760
11765
  const seen = new Set;
11761
11766
  const entries = [];
@@ -11766,7 +11771,7 @@ function buildEnrichedPath(current = process.env.PATH ?? "") {
11766
11771
  seen.add(candidate);
11767
11772
  entries.push(candidate);
11768
11773
  }
11769
- return entries.join(":");
11774
+ return entries.join(delimiter);
11770
11775
  }
11771
11776
 
11772
11777
  // src/core/oauth.ts
@@ -28832,7 +28837,7 @@ function snapshot(target) {
28832
28837
  throw error;
28833
28838
  }
28834
28839
  if (stat.isSymbolicLink())
28835
- return { kind: "link", content: fs15.readlinkSync(target) };
28840
+ return { kind: "link", content: readLink(target) };
28836
28841
  if (!stat.isDirectory())
28837
28842
  return { kind: "file", content: fs15.readFileSync(target).toString("base64"), mode: stat.mode & 511 };
28838
28843
  const files = {};
@@ -28843,7 +28848,7 @@ function snapshot(target) {
28843
28848
  const full = path19.join(dir, name);
28844
28849
  const info = fs15.lstatSync(full);
28845
28850
  if (info.isSymbolicLink())
28846
- files[relative] = { kind: "link", content: fs15.readlinkSync(full) };
28851
+ files[relative] = { kind: "link", content: readLink(full) };
28847
28852
  else if (info.isDirectory()) {
28848
28853
  files[relative] = { kind: "directory", mode: info.mode & 511 };
28849
28854
  walk(full, relative);
@@ -28859,8 +28864,64 @@ function snapshot(target) {
28859
28864
  walk(target);
28860
28865
  return { kind: "directory", files, mode: stat.mode & 511 };
28861
28866
  }
28867
+ function snapshotForHash(value) {
28868
+ if (process.platform !== "win32")
28869
+ return value;
28870
+ const strip = (entry) => {
28871
+ const { mode: _mode, ...rest } = entry;
28872
+ return rest;
28873
+ };
28874
+ const stripped = strip(value);
28875
+ if (!value.files)
28876
+ return stripped;
28877
+ return { ...stripped, files: Object.fromEntries(Object.entries(value.files).map(([name, entry]) => [name, strip(entry)])) };
28878
+ }
28879
+ function readLink(linkPath) {
28880
+ return normalizeLinkContent(linkPath, fs15.readlinkSync(linkPath));
28881
+ }
28882
+ function placeLink(linkPath, content) {
28883
+ if (process.platform !== "win32") {
28884
+ fs15.symlinkSync(content, linkPath);
28885
+ return;
28886
+ }
28887
+ const absolute = path19.resolve(path19.dirname(linkPath), content);
28888
+ try {
28889
+ fs15.symlinkSync(absolute, linkPath, "junction");
28890
+ } catch (error) {
28891
+ const code = error.code;
28892
+ if (code !== "EINVAL" && code !== "ENOTDIR" && code !== "ENOENT")
28893
+ throw error;
28894
+ fs15.symlinkSync(content, linkPath, "file");
28895
+ }
28896
+ }
28897
+ function removeLink(target) {
28898
+ try {
28899
+ fs15.unlinkSync(target);
28900
+ } catch (error) {
28901
+ const code = error.code;
28902
+ if (code === "ENOENT")
28903
+ return;
28904
+ if (code !== "EPERM" && code !== "EISDIR")
28905
+ throw error;
28906
+ fs15.rmdirSync(target);
28907
+ }
28908
+ }
28909
+ function removeSnapshotTarget(target) {
28910
+ let stat;
28911
+ try {
28912
+ stat = fs15.lstatSync(target);
28913
+ } catch (error) {
28914
+ if (error.code === "ENOENT")
28915
+ return;
28916
+ throw error;
28917
+ }
28918
+ if (stat.isSymbolicLink())
28919
+ removeLink(target);
28920
+ else
28921
+ fs15.rmSync(target, { recursive: true, force: true });
28922
+ }
28862
28923
  function snapshotHash(value) {
28863
- return sha256(JSON.stringify(value));
28924
+ return sha256(JSON.stringify(snapshotForHash(value)));
28864
28925
  }
28865
28926
  function textSnapshot(content) {
28866
28927
  return { kind: "file", content: Buffer.from(content).toString("base64"), mode: 384 };
@@ -28870,7 +28931,7 @@ function snapshotText(value) {
28870
28931
  }
28871
28932
  function writeSnapshot(target, state) {
28872
28933
  if (state.kind === "missing") {
28873
- fs15.rmSync(target, { recursive: true, force: true });
28934
+ removeSnapshotTarget(target);
28874
28935
  return;
28875
28936
  }
28876
28937
  fs15.mkdirSync(path19.dirname(target), { recursive: true });
@@ -28879,7 +28940,7 @@ function writeSnapshot(target, state) {
28879
28940
  if (state.kind === "file")
28880
28941
  fs15.writeFileSync(temp, Buffer.from(state.content, "base64"), { mode: state.mode ?? 384 });
28881
28942
  else if (state.kind === "link")
28882
- fs15.symlinkSync(state.content, temp, process.platform === "win32" ? "junction" : undefined);
28943
+ placeLink(temp, state.content);
28883
28944
  else {
28884
28945
  fs15.mkdirSync(temp, { mode: state.mode ?? 448 });
28885
28946
  for (const [relative, entry] of Object.entries(state.files ?? {})) {
@@ -28890,17 +28951,19 @@ function writeSnapshot(target, state) {
28890
28951
  if (entry.kind === "directory")
28891
28952
  fs15.mkdirSync(dest, { recursive: true, mode: entry.mode ?? 448 });
28892
28953
  else if (entry.kind === "link")
28893
- fs15.symlinkSync(entry.content, dest);
28954
+ placeLink(dest, entry.content);
28894
28955
  else
28895
28956
  fs15.writeFileSync(dest, Buffer.from(entry.content, "base64"), { mode: entry.mode ?? 384 });
28896
28957
  }
28897
28958
  }
28898
28959
  const existing = snapshot(target);
28899
- if (existing.kind === "directory" || state.kind === "directory" && existing.kind !== "missing")
28960
+ if (existing.kind === "link")
28961
+ removeLink(target);
28962
+ else if (existing.kind === "directory" || state.kind === "directory" && existing.kind !== "missing")
28900
28963
  fs15.rmSync(target, { recursive: true, force: true });
28901
28964
  fs15.renameSync(temp, target);
28902
28965
  } finally {
28903
- fs15.rmSync(temp, { recursive: true, force: true });
28966
+ removeSnapshotTarget(temp);
28904
28967
  }
28905
28968
  }
28906
28969
  function saveOperation(operation) {
@@ -30476,4 +30539,4 @@ function getOAuthCredentialStatus(serverName, spec, secrets) {
30476
30539
 
30477
30540
  export { prunePluginProjections, pruneAllPluginProjections, syncPluginsToClient, localCliCommand, registerHarness, getAdapters, installationAdapters, listHarnesses, synchronizationTargets, listServedSkills, getServedSkill, readServedSkill, readNativeDocument, nativeServers, LATEST_PROTOCOL_VERSION, DEFAULT_NEGOTIATED_PROTOCOL_VERSION, SUPPORTED_PROTOCOL_VERSIONS, PROTOCOL_VERSION_META_KEY, CLIENT_INFO_META_KEY, SERVER_INFO_META_KEY, CLIENT_CAPABILITIES_META_KEY, SUBSCRIPTION_ID_META_KEY, LOG_LEVEL_META_KEY, JSONValueSchema, JSONObjectSchema, JSONArraySchema, ProgressTokenSchema, CursorSchema, TaskMetadataSchema, RelatedTaskMetadataSchema, RequestMetaSchema, BaseRequestParamsSchema, TaskAugmentedRequestParamsSchema, RequestSchema, NotificationsParamsSchema, NotificationSchema, ResultMetaObjectSchema, ResultSchema, RequestIdSchema, JSONRPCRequestSchema, JSONRPCNotificationSchema, JSONRPCResultResponseSchema, JSONRPCErrorResponseSchema, JSONRPCMessageSchema, JSONRPCResponseSchema, EmptyResultSchema, CancelledNotificationParamsSchema, CancelledNotificationSchema, IconSchema, IconsSchema, BaseMetadataSchema, ImplementationSchema, ClientTasksCapabilitySchema, ServerTasksCapabilitySchema, ClientCapabilitiesSchema, InitializeRequestParamsSchema, InitializeRequestSchema, ServerCapabilitiesSchema, InitializeResultSchema, InitializedNotificationSchema, DiscoverRequestSchema, DiscoverResultSchema, PingRequestSchema, ProgressSchema, ProgressNotificationParamsSchema, ProgressNotificationSchema, PaginatedRequestParamsSchema, PaginatedRequestSchema, PaginatedResultSchema, ResourceContentsSchema, TextResourceContentsSchema, BlobResourceContentsSchema, RoleSchema, AnnotationsSchema, ResourceSchema, ResourceTemplateSchema, ListResourcesRequestSchema, ListResourcesResultSchema, ListResourceTemplatesRequestSchema, ListResourceTemplatesResultSchema, ResourceRequestParamsSchema, ReadResourceRequestParamsSchema, ReadResourceRequestSchema, ReadResourceResultSchema, ResourceListChangedNotificationSchema, SubscribeRequestParamsSchema, SubscribeRequestSchema, UnsubscribeRequestParamsSchema, UnsubscribeRequestSchema, SubscriptionFilterSchema, SubscriptionsListenRequestParamsSchema, SubscriptionsListenRequestSchema, SubscriptionsAcknowledgedNotificationParamsSchema, SubscriptionsAcknowledgedNotificationSchema, SubscriptionsListenResultMetaSchema, SubscriptionsListenResultSchema, ResourceUpdatedNotificationParamsSchema, ResourceUpdatedNotificationSchema, PromptArgumentSchema, PromptSchema, ListPromptsRequestSchema, ListPromptsResultSchema, GetPromptRequestParamsSchema, GetPromptRequestSchema, TextContentSchema, ImageContentSchema, AudioContentSchema, ToolUseContentSchema, EmbeddedResourceSchema, ResourceLinkSchema, ContentBlockSchema, PromptMessageSchema, GetPromptResultSchema, PromptListChangedNotificationSchema, ToolAnnotationsSchema, ToolExecutionSchema, ToolSchema, ListToolsRequestSchema, ListToolsResultSchema, CallToolResultSchema, CompatibilityCallToolResultSchema, CallToolRequestParamsSchema, CallToolRequestSchema, ToolListChangedNotificationSchema, ListChangedOptionsBaseSchema, LoggingLevelSchema, SetLevelRequestParamsSchema, SetLevelRequestSchema, LoggingMessageNotificationParamsSchema, LoggingMessageNotificationSchema, ModelHintSchema, ModelPreferencesSchema, ToolChoiceSchema, ToolResultContentSchema, SamplingContentSchema, SamplingMessageContentBlockSchema, SamplingMessageSchema, CreateMessageRequestParamsSchema, CreateMessageRequestSchema, CreateMessageResultSchema, CreateMessageResultWithToolsSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema, UntitledSingleSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema, LegacyTitledEnumSchemaSchema, SingleSelectEnumSchemaSchema, UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema, MultiSelectEnumSchemaSchema, EnumSchemaSchema, PrimitiveSchemaDefinitionSchema, ElicitRequestFormParamsSchema, ElicitRequestURLParamsSchema, ElicitRequestParamsSchema, ElicitRequestSchema, ElicitationCompleteNotificationParamsSchema, ElicitationCompleteNotificationSchema, ElicitResultSchema, ResourceTemplateReferenceSchema, PromptReferenceSchema, CompleteRequestParamsSchema, CompleteRequestSchema, CompleteResultSchema, RootSchema, ListRootsRequestSchema, ListRootsResultSchema, RootsListChangedNotificationSchema, TaskCreationParamsSchema, TaskStatusSchema, TaskSchema, CreateTaskResultSchema, TaskStatusNotificationParamsSchema, TaskStatusNotificationSchema, GetTaskRequestSchema, GetTaskResultSchema, GetTaskPayloadRequestSchema, GetTaskPayloadResultSchema, ListTasksRequestSchema, ListTasksResultSchema, CancelTaskRequestSchema, CancelTaskResultSchema, ClientRequestSchema, ClientNotificationSchema, ClientResultSchema, ServerRequestSchema, ServerNotificationSchema, ServerResultSchema, OAuthProtectedResourceMetadataSchema, OAuthMetadataSchema, OpenIdProviderMetadataSchema, OpenIdProviderDiscoveryMetadataSchema, OAuthTokensSchema, IdJagTokenExchangeResponseSchema, OAuthErrorResponseSchema, OAuthClientMetadataSchema, OAuthClientInformationSchema, OAuthClientInformationFullSchema, OAuthClientRegistrationErrorSchema, OAuthTokenRevocationRequestSchema, SdkHttpError, Client, StreamableHTTPClientTransport, getDefaultEnvironment, StdioClientTransport, MCP_V2_PROTOCOL_VERSION, mcpV2Meta, mcpV2Headers, APP_VERSION, buildEnrichedPath, isOAuthReference, oauthReferenceServerName, __resetOAuthSupportCache, probeOAuthSupport, OAUTH_LOGIN_TIMEOUT_MS, OAuthCancelledError, OAuthLoginInProgressError, runOAuthLogin, getOAuthAccessToken, oauthSecretNames, clearOAuthCredentials, getOAuthCredentialStatus, resolveConsumer, operationEvents, saveOperation, listOperations, rollbackOperation, markInterruptedOperations, adoptionPlanSchema, protectServerSecrets, planAdoption, applyAdoption, synchronizeClients, getGatewayUrl, getGatewayInternalUrl, syncAllClients, persistSyncState };
30478
30541
 
30479
- //# debugId=87604DFA09DD512164756E2164756E21
30542
+ //# debugId=B165349C88804CA664756E2164756E21
@@ -18,16 +18,16 @@ import {
18
18
  uninstallPlugin,
19
19
  unpinPlugin,
20
20
  updatePlugin
21
- } from "./chunk-4aafp444.js";
22
- import"./chunk-wztmp5b4.js";
23
- import"./chunk-8v13hqrp.js";
24
- import"./chunk-t20f49g3.js";
25
- import"./chunk-hahs24dv.js";
26
- import"./chunk-chaj8a8b.js";
27
- import"./chunk-7rq88hb3.js";
28
- import"./chunk-brxwa30j.js";
21
+ } from "./chunk-naeqpnmf.js";
22
+ import"./chunk-f7w0a9nn.js";
23
+ import"./chunk-qg1rbk0d.js";
24
+ import"./chunk-z4j5q2x0.js";
25
+ import"./chunk-131c6axh.js";
26
+ import"./chunk-jncje8g1.js";
27
+ import"./chunk-9bjabsqb.js";
28
+ import"./chunk-rbra8ws6.js";
29
29
  import"./chunk-p7yzyt87.js";
30
- import"./chunk-grkz21sq.js";
30
+ import"./chunk-vnka4jbe.js";
31
31
  import"./chunk-bjw71y54.js";
32
32
  import"./chunk-wj4tjacg.js";
33
33
  export {