@kahinmcp/kahin 0.1.3 → 0.1.4

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.
package/bin/kahin.mjs CHANGED
@@ -3,14 +3,19 @@
3
3
  // Kurulum: pnpm add -g @kahinmcp/kahin
4
4
 
5
5
  import { spawn } from "node:child_process";
6
- import { mkdirSync, existsSync, copyFileSync } from "node:fs";
6
+ import { mkdirSync, existsSync, copyFileSync, readdirSync } from "node:fs";
7
7
  import { homedir, tmpdir } from "node:os";
8
8
  import { dirname, join } from "node:path";
9
9
  import { fileURLToPath } from "node:url";
10
10
 
11
11
  const __dirname = dirname(fileURLToPath(import.meta.url));
12
- const KAHIN_VERSION = "0.1.2";
13
- const WHEEL = join(__dirname, "..", "wheel", `kahin-${KAHIN_VERSION}-py3-none-any.whl`);
12
+ const VENDOR = join(__dirname, "..", "lib", "vendor");
13
+ const wheelName = readdirSync(VENDOR).find((f) => f.startsWith("kahin-") && f.endsWith(".whl"));
14
+ if (!wheelName) {
15
+ process.stderr.write(`[kahin] Wheel bulunamadı: ${VENDOR}/kahin-*.whl\n`);
16
+ process.exit(1);
17
+ }
18
+ const WHEEL = join(VENDOR, wheelName);
14
19
  const HOME = process.env.KAHIN_HOME || join(homedir(), ".local", "share", "kahin");
15
20
  const VENV = join(HOME, "venv");
16
21
  const PY = process.platform === "win32" ? join(VENV, "Scripts", "python.exe") : join(VENV, "bin", "python");
@@ -31,12 +36,12 @@ async function setup() {
31
36
  process.exit(1);
32
37
  }
33
38
  mkdirSync(HOME, { recursive: true });
34
- const needsInstall = !existsSync(PY) || !existsSync(MARKER) || (await import("node:fs/promises")).readFile(MARKER, "utf8").catch(() => "") !== KAHIN_VERSION;
39
+ const needsInstall = !existsSync(PY) || !existsSync(MARKER) || (await import("node:fs/promises")).readFile(MARKER, "utf8").catch(() => "") !== wheelName;
35
40
  if (!needsInstall) return;
36
41
 
37
42
  process.stderr.write("[kahin] Python ortamı kuruluyor (ilk sefer) — ~30 sn...\n");
38
43
  const start = Date.now();
39
- const wheelCopy = join(HOME, `kahin-${KAHIN_VERSION}-py3-none-any.whl`);
44
+ const wheelCopy = join(HOME, wheelName);
40
45
  copyFileSync(WHEEL, wheelCopy);
41
46
  let code;
42
47
  if (process.env.UV && existsSync(process.env.UV)) {
@@ -54,7 +59,7 @@ async function setup() {
54
59
  process.stderr.write(`[kahin] Kurulum başarısız. Log: ${LOG} — elle kur: python3 -m venv ${VENV} && ${PY} -m pip install ${wheelCopy}\n`);
55
60
  process.exit(1);
56
61
  }
57
- (await import("node:fs/promises")).writeFile(MARKER, KAHIN_VERSION);
62
+ (await import("node:fs/promises")).writeFile(MARKER, wheelName);
58
63
  process.stderr.write(`[kahin] Hazır (${((Date.now() - start) / 1000).toFixed(0)} sn).\n`);
59
64
  }
60
65
 
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@kahinmcp/kahin",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Kahin — CDP ansiklopedisi + anti-detect browser otomasyon MCP sunucusu. Obscura ve Camoufox motorlarını kullanır, motor seçimini ajana bırakır.",
5
5
  "bin": {
6
6
  "kahin": "bin/kahin.mjs"
7
7
  },
8
8
  "files": [
9
9
  "bin",
10
- "wheel",
10
+ "lib/vendor",
11
11
  "LICENSE"
12
12
  ],
13
13
  "engines": {