@modootoday/datalab-extension-mcp 1.11.5 → 1.12.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.
package/README.en.md CHANGED
@@ -58,13 +58,13 @@ Avoid sharing a screenshot or the copied setup. This one key is what goes into t
58
58
  One command finds **every** AI app on your computer and connects them automatically. Nothing to do per app.
59
59
 
60
60
  1. **Open a terminal** — on Windows type `cmd` in the search box → "Command Prompt"; on Mac press `⌘+Space` and type `Terminal`; on Linux open your terminal app (often `Ctrl+Alt+T`).
61
- 2. **Paste this command and press Enter.** The saved command names an exact bootstrap version. At startup and while idle, the connector checks the canonical release and promotes itself to the current secure, compatible version. Diagnostic environments can opt out with `--no-self-update`.
61
+ 2. **Paste this command and press Enter.** The helper installs this version of the connector on your computer (`npm install -g`) and registers that installed copy with your AI apps, so an app does not download the connector again each time it starts. Once connected, the connector checks the canonical release and installs a newer version for the next start. Diagnostic environments can opt out with `--no-self-update`.
62
62
 
63
63
  ```
64
- npx -y @modootoday/datalab-extension-mcp@1.11.5 install
64
+ npx -y @modootoday/datalab-extension-mcp@1.12.1 install
65
65
  ```
66
66
 
67
- Lines of English scrolling by is normal. This only downloads and runs the connector — it touches nothing else.
67
+ Lines of English scrolling by is normal. This installs the connector and adds only our entry to your AI apps' settings — it touches nothing else. Without permission for global npm installs, it falls back to having each app download and run the connector at start (a slower start).
68
68
 
69
69
  The helper runs in four chapters — `[1/4]` check the connection key, `[2/4]` find AI programs, `[3/4]` connect, `[4/4] 결과` (results).
70
70
 
@@ -151,10 +151,10 @@ diagnosis, Place reputation, Pumasi, photo/video production, and automatic tool
151
151
  discovery. Press Enter to keep the recommended set.
152
152
 
153
153
  ```
154
- npx -y @modootoday/datalab-extension-mcp@1.11.5 skills list
155
- npx -y @modootoday/datalab-extension-mcp@1.11.5 skills status
156
- npx -y @modootoday/datalab-extension-mcp@1.11.5 skills attach <name>
157
- npx -y @modootoday/datalab-extension-mcp@1.11.5 skills detach <name>
154
+ npx -y @modootoday/datalab-extension-mcp@1.12.1 skills list
155
+ npx -y @modootoday/datalab-extension-mcp@1.12.1 skills status
156
+ npx -y @modootoday/datalab-extension-mcp@1.12.1 skills attach <name>
157
+ npx -y @modootoday/datalab-extension-mcp@1.12.1 skills detach <name>
158
158
  ```
159
159
 
160
160
  - `list` shows everything in this version, name and description.
@@ -244,7 +244,7 @@ Exactly what it says. Open Chrome, keep the DataLab Tools side panel open, and i
244
244
 
245
245
  That's expected — **it's deliberate.**
246
246
 
247
- There are 213 tools. Sending all of them as a list runs into the cap each AI app
247
+ There are 218 tools. Sending all of them as a list runs into the cap each AI app
248
248
  sets: some quietly drop whatever doesn't fit, some refuse the connection outright.
249
249
  So only the discovery tools go in the list, and **the rest are selected from the
250
250
  user's intent and handed over as an answer.**
@@ -275,7 +275,7 @@ Start it again after a full quit and it picks the tools up. If they still aren't
275
275
  - **When the connection disappears** — run the very command you used at the start once more; it safely re-registers. (Some AI apps clean up their settings file and drop the connection.)
276
276
 
277
277
  ```
278
- npx -y @modootoday/datalab-extension-mcp@1.11.5 install
278
+ npx -y @modootoday/datalab-extension-mcp@1.12.1 install
279
279
  ```
280
280
 
281
281
  - **`'npx' is not recognized...`** — Node.js isn't installed. Follow "No Node.js?" in Step 2, then run the command again.
@@ -305,7 +305,7 @@ Start it again after a full quit and it picks the tools up. If they still aren't
305
305
  1. Run this in a terminal (it removes the entries registered in your AI apps).
306
306
 
307
307
  ```
308
- npx -y @modootoday/datalab-extension-mcp@1.11.5 uninstall
308
+ npx -y @modootoday/datalab-extension-mcp@1.12.1 uninstall
309
309
  ```
310
310
 
311
311
  2. Turn **MCP 연결** off in the extension settings. The panel is the bridge, so with it off a leftover config line can look nothing up.
package/README.md CHANGED
@@ -52,13 +52,13 @@ Claude 같은 AI 앱을 데이터랩툴즈에 연결해 주는 작은 무료 프
52
52
  명령 한 줄이면 컴퓨터에 있는 AI 앱을 **모두 자동으로** 찾아 연결해 줘요. 앱마다 따로 할 일은 없어요.
53
53
 
54
54
  1. **터미널을 열어요** — Windows는 검색창에 `cmd` → "명령 프롬프트", Mac은 `⌘+스페이스`로 `터미널`, Linux는 터미널 앱(보통 `Ctrl+Alt+T`)이에요.
55
- 2. **아래 명령을 붙여넣고 Enter를 눌러요.** 저장되는 명령은 정확한 시작 버전을 적습니다. 연결 프로그램은 시작할 때와 유휴 상태에서 정본 릴리스를 확인해 현재의 안전하고 호환되는 버전으로 승격합니다. 진단 환경에서는 `--no-self-update`로 승격을 끌 수 있어요.
55
+ 2. **아래 명령을 붙여넣고 Enter를 눌러요.** 도우미는 이 버전의 연결 프로그램을 이 컴퓨터에 설치(`npm install -g`)하고, AI 앱이 그 설치본을 바로 실행하도록 등록해요. 그래서 AI 앱이 시작할 때 연결 프로그램을 다시 내려받지 않아요. 연결이 열린 뒤 정본 릴리스를 확인해 새 버전이 있으면 설치해 두고, 다음 시작부터 그 버전을 써요. 진단 환경에서는 `--no-self-update`로 이 업데이트를 끌 수 있어요.
56
56
 
57
57
  ```
58
- npx -y @modootoday/datalab-extension-mcp@1.11.5 install
58
+ npx -y @modootoday/datalab-extension-mcp@1.12.1 install
59
59
  ```
60
60
 
61
- 영어 글자가 여러 줄 올라오는 건 정상이에요. 이 명령은 연결 프로그램을 다운로드해 실행할 뿐, 다른 건 건드리지 않아요.
61
+ 영어 글자가 여러 줄 올라오는 건 정상이에요. 이 명령은 연결 프로그램을 설치하고 AI 앱 설정에 우리 항목만 더할 뿐, 다른 건 건드리지 않아요. npm 전역 설치 권한이 없으면 예전처럼 AI 앱이 시작할 때마다 내려받아 실행하도록 연결해요(시작이 조금 느려요).
62
62
 
63
63
  도우미는 네 대목으로 진행돼요 — `[1/4] 연결 키 확인`, `[2/4] 연결할 AI 프로그램 찾기`, `[3/4] 연결하는 중`, `[4/4] 결과`.
64
64
 
@@ -137,10 +137,10 @@ Claude 같은 AI 앱을 데이터랩툴즈에 연결해 주는 작은 무료 프
137
137
  도움말을 번호로 여러 개 고를 수 있어요. Enter를 누르면 추천 구성만 설치됩니다.
138
138
 
139
139
  ```
140
- npx -y @modootoday/datalab-extension-mcp@1.11.5 skills list
141
- npx -y @modootoday/datalab-extension-mcp@1.11.5 skills status
142
- npx -y @modootoday/datalab-extension-mcp@1.11.5 skills attach <이름>
143
- npx -y @modootoday/datalab-extension-mcp@1.11.5 skills detach <이름>
140
+ npx -y @modootoday/datalab-extension-mcp@1.12.1 skills list
141
+ npx -y @modootoday/datalab-extension-mcp@1.12.1 skills status
142
+ npx -y @modootoday/datalab-extension-mcp@1.12.1 skills attach <이름>
143
+ npx -y @modootoday/datalab-extension-mcp@1.12.1 skills detach <이름>
144
144
  ```
145
145
 
146
146
  - `list` 는 이 버전에 들어 있는 전부를 이름과 설명으로 보여 줘요.
@@ -214,7 +214,7 @@ MCP 를 켜 두었지만 **네이버 페이지가 한 곳도 열려 있지 않
214
214
 
215
215
  정상이에요. **일부러 그렇게 보냅니다.**
216
216
 
217
- 전체 도구는 213개인데, 그걸 전부 목록으로 보내면 AI 앱마다 정해 둔 상한에 걸려요.
217
+ 전체 도구는 218개인데, 그걸 전부 목록으로 보내면 AI 앱마다 정해 둔 상한에 걸려요.
218
218
  어떤 앱은 넘치는 만큼 조용히 잘라내고, 어떤 앱은 아예 연결을 거부해요. 그래서 자주 쓰는
219
219
  탐색 도구만 목록에 올리고, 나머지는 **AI가 요청 의도를 찾아 답으로 건네받습니다.**
220
220
 
@@ -242,7 +242,7 @@ AI가 "그런 기능은 없다" 고 답하면, **"숨은 도구를 찾아보고
242
242
  - **연결이 사라졌을 때** — 처음 실행했던 그 명령을 한 번 더 실행하면 안전하게 다시 등록돼요. (일부 AI 앱이 설정 파일을 정리하며 연결을 지우기도 해요.)
243
243
 
244
244
  ```
245
- npx -y @modootoday/datalab-extension-mcp@1.11.5 install
245
+ npx -y @modootoday/datalab-extension-mcp@1.12.1 install
246
246
  ```
247
247
 
248
248
  - **`'npx'을(는) 내부 또는 외부 명령...`** — Node.js가 없는 거예요. 위 2단계의 "Node.js가 없다면"을 따라 설치한 뒤 다시 실행해요.
@@ -272,7 +272,7 @@ AI가 "그런 기능은 없다" 고 답하면, **"숨은 도구를 찾아보고
272
272
  1. 터미널에서 아래 명령을 실행해요(AI 앱에 등록된 설정을 지워 줘요).
273
273
 
274
274
  ```
275
- npx -y @modootoday/datalab-extension-mcp@1.11.5 uninstall
275
+ npx -y @modootoday/datalab-extension-mcp@1.12.1 uninstall
276
276
  ```
277
277
 
278
278
  2. 확장 설정에서 **MCP 연결을 꺼요.** 패널이 브릿지라, 꺼 두면 어딘가 설정 줄이 남아 있어도 AI 앱이 아무것도 조회할 수 없어요.
@@ -2,7 +2,7 @@ import {
2
2
  __export
3
3
  } from "./chunk-MLKGABMK.js";
4
4
 
5
- // ../mcp-server/dist/chunk-PCVVHMPP.js
5
+ // ../mcp-server/dist/chunk-2CASJT66.js
6
6
  import { createHash } from "crypto";
7
7
  import { createHash as createHash2, randomUUID } from "crypto";
8
8
  import { mkdir, readFile, readdir, rm, writeFile } from "fs/promises";
@@ -20076,6 +20076,7 @@ var TOOL_TIERS = Object.freeze({
20076
20076
  editor_read_structure: "read",
20077
20077
  editor_read_document: "read",
20078
20078
  editor_operation_status: "read",
20079
+ editor_list_saved_drafts: "read",
20079
20080
  // ── Post editor: writes ─────────────────────────────────────────
20080
20081
  //
20081
20082
  // Every injection is bracketed by a vendor autosave, plus a separate copy
@@ -20085,6 +20086,14 @@ var TOOL_TIERS = Object.freeze({
20085
20086
  // Only whole-body replacement is destructive: the others append, so the
20086
20087
  // autosave point still holds, while replacing the body overwrites it.
20087
20088
  editor_insert_draft: "write",
20089
+ // Saves to the vendor's temp list; the document itself is untouched.
20090
+ editor_save_draft: "write",
20091
+ // Refuses while changes since the last confirmed save would be lost.
20092
+ editor_new_post: "write",
20093
+ // Same protection: refuses while unsaved changes would be dropped.
20094
+ editor_open_saved_draft: "write",
20095
+ // Restyles existing text; the words stay as they are.
20096
+ editor_apply_styles: "write",
20088
20097
  // `write`, and it stays that way because it REFUSES an occupied body rather
20089
20098
  // than overwriting it. A replace fallback would make it destructive while its
20090
20099
  // confirm still reads as an append, so that fallback is a review-block.
@@ -22805,7 +22814,6 @@ function killPortOwner(port, platform = process.platform) {
22805
22814
  }
22806
22815
 
22807
22816
  // src/adapter.ts
22808
- import { spawnSync as spawnSync2 } from "child_process";
22809
22817
  import { randomUUID as randomUUID2 } from "crypto";
22810
22818
  import { Server } from "@modelcontextprotocol/sdk/server/index.js";
22811
22819
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
@@ -42908,6 +42916,7 @@ var TOOL_TIERS2 = Object.freeze({
42908
42916
  editor_read_structure: "read",
42909
42917
  editor_read_document: "read",
42910
42918
  editor_operation_status: "read",
42919
+ editor_list_saved_drafts: "read",
42911
42920
  // ── Post editor: writes ─────────────────────────────────────────
42912
42921
  //
42913
42922
  // Every injection is bracketed by a vendor autosave, plus a separate copy
@@ -42917,6 +42926,14 @@ var TOOL_TIERS2 = Object.freeze({
42917
42926
  // Only whole-body replacement is destructive: the others append, so the
42918
42927
  // autosave point still holds, while replacing the body overwrites it.
42919
42928
  editor_insert_draft: "write",
42929
+ // Saves to the vendor's temp list; the document itself is untouched.
42930
+ editor_save_draft: "write",
42931
+ // Refuses while changes since the last confirmed save would be lost.
42932
+ editor_new_post: "write",
42933
+ // Same protection: refuses while unsaved changes would be dropped.
42934
+ editor_open_saved_draft: "write",
42935
+ // Restyles existing text; the words stay as they are.
42936
+ editor_apply_styles: "write",
42920
42937
  // `write`, and it stays that way because it REFUSES an occupied body rather
42921
42938
  // than overwriting it. A replace fallback would make it destructive while its
42922
42939
  // confirm still reads as an append, so that fallback is a review-block.
@@ -43297,6 +43314,9 @@ function isTimeout(err) {
43297
43314
  if (!(err instanceof Error)) return false;
43298
43315
  return err.name === "TimeoutError" || err.name === "AbortError";
43299
43316
  }
43317
+ function startupMark(label, log) {
43318
+ log(`startup: ${label} at ${String(Math.round(performance.now()))}ms`);
43319
+ }
43300
43320
  function realSleep(ms) {
43301
43321
  return new Promise((resolve) => setTimeout(resolve, ms));
43302
43322
  }
@@ -43413,6 +43433,7 @@ async function ensureDaemonRunning(deps = {}) {
43413
43433
  };
43414
43434
  const spawnAndWait = async () => {
43415
43435
  spawn2(daemonEntry, ["serve"]);
43436
+ startupMark("connector service started", log);
43416
43437
  for (let i = 0; i < attempts; i += 1) {
43417
43438
  await sleep(intervalMs);
43418
43439
  const socket = await connect(host, port, PROBE_TIMEOUT_MS);
@@ -43479,6 +43500,16 @@ function createAdapterServer(deps = {}) {
43479
43500
  // re-fetch the catalog without a restart.
43480
43501
  { capabilities: { tools: { listChanged: true } } }
43481
43502
  );
43503
+ let daemonReady = deps.ready === void 0;
43504
+ let servedEarly = false;
43505
+ void deps.ready?.then(() => {
43506
+ daemonReady = true;
43507
+ startupMark("connector service ready", log);
43508
+ if (servedEarly) {
43509
+ void server.notification({ method: "notifications/tools/list_changed" }).catch(() => {
43510
+ });
43511
+ }
43512
+ });
43482
43513
  server.setRequestHandler(ListToolsRequestSchema, async () => {
43483
43514
  deps.onActivity?.(1);
43484
43515
  try {
@@ -43488,7 +43519,13 @@ function createAdapterServer(deps = {}) {
43488
43519
  }
43489
43520
  });
43490
43521
  async function handleToolList() {
43491
- await deps.ready;
43522
+ if (!daemonReady) {
43523
+ servedEarly = true;
43524
+ startupMark("tools/list answered from the fa\xE7ade", log);
43525
+ return {
43526
+ tools: [...staticDiscoveryCatalog2(), ...mediaToolDescriptors()]
43527
+ };
43528
+ }
43492
43529
  let resp;
43493
43530
  try {
43494
43531
  resp = await postMcp(fetchImpl, mcpUrl, "tools/list");
@@ -43654,26 +43691,80 @@ async function pushToolChanges(deps) {
43654
43691
  }
43655
43692
  }
43656
43693
  var SESSION_EXIT_GRACE_MS = 200;
43657
- async function selfUpdateAndRestart(selfVersion, log, deps = {}) {
43658
- if (!selfVersion) return false;
43694
+ function launchKindOf(entry) {
43695
+ if (!entry) return "other";
43696
+ const path = entry.replace(/\\/g, "/");
43697
+ if (path.includes("/_npx/")) return "npx";
43698
+ if (path.endsWith(`/node_modules/${PACKAGE_NAME}/dist/cli.js`)) {
43699
+ return "global";
43700
+ }
43701
+ return "other";
43702
+ }
43703
+ async function updateInstalledCopy(selfVersion, log, deps = {}) {
43704
+ const launch = deps.launch ?? launchKindOf(process.argv[1]);
43705
+ if (!selfVersion || launch === "other") return "none";
43659
43706
  const target = await (deps.resolve ?? canonicalVersion)();
43660
- if (!target || !isOlderVersion(selfVersion, target)) return false;
43661
- const args = deps.argv ?? process.argv.slice(2);
43662
- log(
43663
- `updating to the canonical connector ${target} (this build is ${selfVersion})`
43664
- );
43665
- const run = deps.spawn ?? spawnSync2;
43666
- const res = run("npx", ["-y", `${PACKAGE_NAME}@${target}`, ...args], {
43667
- stdio: "inherit",
43668
- shell: process.platform === "win32"
43669
- });
43670
- if (res.error) {
43671
- log(
43672
- `could not start ${target} (${res.error.message}); continuing as ${selfVersion}`
43707
+ const newer = target !== null && isOlderVersion(selfVersion, target) ? target : null;
43708
+ if (launch === "global" && newer === null) return "none";
43709
+ const version3 = newer ?? selfVersion;
43710
+ const install = deps.install ?? defaultInstall;
43711
+ if (!await install(version3)) {
43712
+ log(`could not install connector ${version3}; this build keeps serving`);
43713
+ return "failed";
43714
+ }
43715
+ if (launch === "global") {
43716
+ log(`connector ${version3} is installed; the next start uses it`);
43717
+ return "installed";
43718
+ }
43719
+ log(`connector ${version3} is installed; moving host entries onto it`);
43720
+ await (deps.relink ?? defaultRelink)(version3);
43721
+ return "migrated";
43722
+ }
43723
+ async function quietInstallerIo() {
43724
+ const installer = await import("./dist-H4FFG2Z2.js");
43725
+ const io = installer.createNodeIo();
43726
+ io.out = (line) => defaultLog(line);
43727
+ return { installer, io };
43728
+ }
43729
+ async function defaultInstall(version3) {
43730
+ const { installer, io } = await quietInstallerIo();
43731
+ const present = await installer.resolveGlobalLaunch(io, version3);
43732
+ if (present.ok) return true;
43733
+ const outcome = await installer.installGlobally(io, version3, {
43734
+ inheritStdio: false
43735
+ });
43736
+ return outcome.ok;
43737
+ }
43738
+ async function defaultRelink(version3) {
43739
+ const { installer, io } = await quietInstallerIo();
43740
+ const resolved = await installer.resolveGlobalLaunch(io, version3);
43741
+ if (!resolved.ok) {
43742
+ defaultLog(
43743
+ `relink skipped: installed copy not usable (${resolved.reason})`
43673
43744
  );
43674
- return false;
43745
+ return;
43746
+ }
43747
+ const env = process.env;
43748
+ const opts = {
43749
+ version: version3,
43750
+ token: env["DATALAB_MCP_TOKEN"]?.trim() ?? "",
43751
+ extensionId: env["DATALAB_MCP_EXTENSION_ID"]?.trim() ?? "",
43752
+ port: env["DATALAB_MCP_PORT"]?.trim() || void 0
43753
+ };
43754
+ if (installer.validateInstallOptions(opts) !== null) {
43755
+ defaultLog("relink skipped: the session's pairing values did not validate");
43756
+ return;
43757
+ }
43758
+ const results = await installer.relinkInstalledHosts(io, {
43759
+ ...opts,
43760
+ launch: resolved.launch
43761
+ });
43762
+ if (results.length === 0) {
43763
+ defaultLog("relink: no host entry used the package runner");
43764
+ }
43765
+ for (const r of results) {
43766
+ defaultLog(`relink ${r.hostId}: ${r.status} (${r.message})`);
43675
43767
  }
43676
- process.exit(res.status ?? 0);
43677
43768
  }
43678
43769
  function countRequests(flight, passthrough) {
43679
43770
  return (delta) => {
@@ -43682,15 +43773,9 @@ function countRequests(flight, passthrough) {
43682
43773
  };
43683
43774
  }
43684
43775
  async function runAdapter(deps = {}) {
43685
- if (deps.selfUpdate !== false) {
43686
- await selfUpdateAndRestart(deps.version, deps.log ?? (() => {
43687
- }), {
43688
- resolve: deps.canonical,
43689
- spawn: deps.spawnImpl
43690
- });
43691
- }
43692
43776
  const ensure = deps.ensure ?? ensureDaemonRunning;
43693
43777
  const log = deps.log ?? defaultLog;
43778
+ startupMark("adapter loaded", log);
43694
43779
  const ready = ensure({
43695
43780
  host: deps.host,
43696
43781
  port: deps.port,
@@ -43706,15 +43791,26 @@ async function runAdapter(deps = {}) {
43706
43791
  ready,
43707
43792
  onActivity: countRequests(flight, deps.onActivity)
43708
43793
  });
43709
- const watch = deps.selfUpdate === false ? null : setInterval(() => {
43710
- if (flight.count > 0) return;
43711
- void selfUpdateAndRestart(deps.version, deps.log ?? (() => {
43712
- }), {
43713
- resolve: deps.canonical,
43714
- spawn: deps.spawnImpl
43794
+ let updating = false;
43795
+ let watch = null;
43796
+ const checkForUpdate = () => {
43797
+ if (updating || flight.count > 0) return;
43798
+ updating = true;
43799
+ const run = deps.update ?? (() => updateInstalledCopy(deps.version, deps.log ?? defaultLog, {
43800
+ resolve: deps.canonical
43801
+ }));
43802
+ void run().then((outcome) => {
43803
+ if (outcome !== "none" && watch) clearInterval(watch);
43804
+ }).catch((err) => {
43805
+ log(`update check failed: ${describeError(err)}`);
43806
+ }).finally(() => {
43807
+ updating = false;
43715
43808
  });
43716
- }, watchMs);
43717
- watch?.unref?.();
43809
+ };
43810
+ if (deps.selfUpdate !== false) {
43811
+ watch = setInterval(checkForUpdate, watchMs);
43812
+ watch.unref?.();
43813
+ }
43718
43814
  let transport;
43719
43815
  if (deps.transport) {
43720
43816
  transport = deps.transport;
@@ -43722,6 +43818,8 @@ async function runAdapter(deps = {}) {
43722
43818
  transport = new StdioServerTransport();
43723
43819
  }
43724
43820
  await server.connect(transport);
43821
+ startupMark("transport connected", log);
43822
+ if (deps.selfUpdate !== false) checkForUpdate();
43725
43823
  const host = deps.host ?? DEFAULT_HOST;
43726
43824
  const port = deps.port ?? DEFAULT_PORT;
43727
43825
  const controller = new AbortController();
package/dist/cli.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  resolveConfig,
5
5
  runAdapter,
6
6
  runDaemon
7
- } from "./chunk-T2CKB454.js";
7
+ } from "./chunk-PTB3TF6U.js";
8
8
  import "./chunk-MLKGABMK.js";
9
9
 
10
10
  // src/cli.ts
@@ -16,7 +16,7 @@ function log(message) {
16
16
  `);
17
17
  }
18
18
  async function runInstaller(sub, argv) {
19
- const { createNodeIo, runInstall, runUninstall } = await import("./dist-ITPO7PMQ.js");
19
+ const { createNodeIo, runInstall, runUninstall } = await import("./dist-H4FFG2Z2.js");
20
20
  const opts = { version: VERSION };
21
21
  for (let i = 0; i < argv.length; i += 1) {
22
22
  const flag = argv[i];
@@ -62,7 +62,7 @@ async function main() {
62
62
  version: VERSION,
63
63
  host: env.ok ? env.config.host : void 0,
64
64
  port: env.ok ? env.config.port : void 0,
65
- // The host config pins an exact version, so without this a paired user
65
+ // The host config pins an exact install, so without this a paired user
66
66
  // never receives a release. `--no-self-update` keeps this build.
67
67
  selfUpdate: !process.argv.slice(2).includes("--no-self-update")
68
68
  });
@@ -78,7 +78,7 @@ async function main() {
78
78
  attachSkill,
79
79
  detachSkill,
80
80
  skillsPayloadRoot
81
- } = await import("./dist-ITPO7PMQ.js");
81
+ } = await import("./dist-H4FFG2Z2.js");
82
82
  const io = createNodeIo();
83
83
  const root = skillsPayloadRoot();
84
84
  const code = await runSkills(argv, {
@@ -35,6 +35,12 @@ var DEFAULT_EXTENSION_ID = "ldoknfkedngbdfgdkeicojmhnojgpdcb";
35
35
  function packageSpec(version) {
36
36
  return `${SERVER_PACKAGE}@${version}`;
37
37
  }
38
+ function launchArgv(opts) {
39
+ if (opts.launch !== void 0) {
40
+ return [opts.launch.node, opts.launch.cli];
41
+ }
42
+ return ["npx", "-y", packageSpec(opts.version)];
43
+ }
38
44
  function isCustomPort(port) {
39
45
  if (port === void 0 || port === "") {
40
46
  return false;
@@ -69,6 +75,13 @@ function buildUrlEntry(opts) {
69
75
  return { url: daemonMcpUrl(opts) };
70
76
  }
71
77
  function buildFileEntry(opts, platform) {
78
+ if (opts.launch !== void 0) {
79
+ return {
80
+ command: opts.launch.node,
81
+ args: [opts.launch.cli],
82
+ env: buildEnv(opts)
83
+ };
84
+ }
72
85
  const spec = packageSpec(opts.version);
73
86
  if (platform === "win32") {
74
87
  return {
@@ -133,11 +146,14 @@ var claudeCliHost = {
133
146
  for (const pair of envPairs(opts)) {
134
147
  args.push("--env", pair);
135
148
  }
136
- args.push("--", "npx", "-y", packageSpec(opts.version));
149
+ args.push("--", ...launchArgv(opts));
137
150
  return args;
138
151
  },
139
152
  buildRemoveArgs() {
140
153
  return ["mcp", "remove", SERVER_NAME, "--scope", "user"];
154
+ },
155
+ buildGetArgs() {
156
+ return ["mcp", "get", SERVER_NAME];
141
157
  }
142
158
  };
143
159
  var claudeInstallable = {
@@ -159,10 +175,11 @@ function jsonSnippet(topKey, opts, platform) {
159
175
  return JSON.stringify({ [topKey]: { [SERVER_NAME]: entry } }, null, 2);
160
176
  }
161
177
  function tomlSnippet(opts) {
178
+ const launch = opts.launch;
179
+ const head = launch === void 0 ? [`command = "npx"`, `args = ["-y", "${packageSpec(opts.version)}"]`] : [`command = '${launch.node}'`, `args = ['${launch.cli}']`];
162
180
  const lines = [
163
181
  `[mcp_servers.${SERVER_NAME}]`,
164
- `command = "npx"`,
165
- `args = ["-y", "${packageSpec(opts.version)}"]`,
182
+ ...head,
166
183
  "",
167
184
  `[mcp_servers.${SERVER_NAME}.env]`
168
185
  ];
@@ -336,11 +353,14 @@ var codexCliHost = {
336
353
  for (const pair of envPairs(opts)) {
337
354
  args.push("--env", pair);
338
355
  }
339
- args.push("--", "npx", "-y", packageSpec(opts.version));
356
+ args.push("--", ...launchArgv(opts));
340
357
  return args;
341
358
  },
342
359
  buildRemoveArgs() {
343
360
  return ["mcp", "remove", SERVER_NAME];
361
+ },
362
+ buildGetArgs() {
363
+ return ["mcp", "get", SERVER_NAME];
344
364
  }
345
365
  };
346
366
  var codexInstallable = {
@@ -455,7 +475,7 @@ var geminiCliHost = {
455
475
  for (const pair of envPairs(opts)) {
456
476
  args.push("-e", pair);
457
477
  }
458
- args.push(SERVER_NAME, "npx", "-y", packageSpec(opts.version));
478
+ args.push(SERVER_NAME, ...launchArgv(opts));
459
479
  return args;
460
480
  },
461
481
  buildRemoveArgs() {
@@ -561,7 +581,7 @@ function opencodeSnippet(opts) {
561
581
  mcp: {
562
582
  [SERVER_NAME]: {
563
583
  type: "local",
564
- command: ["npx", "-y", packageSpec(opts.version)],
584
+ command: launchArgv(opts),
565
585
  enabled: true,
566
586
  environment: buildEnv(opts)
567
587
  }
@@ -1193,6 +1213,13 @@ var UNINSTALL_DONE = "\uC815\uB9AC\uAC00 \uB05D\uB0AC\uC5B4\uC694.";
1193
1213
  var UNINSTALL_TOKEN_REMINDER = "\uC774 \uBE0C\uB77C\uC6B0\uC800\uC758 \uB85C\uCEEC \uC5F0\uACB0 \uC815\uBCF4\uB3C4 \uC9C0\uC6B0\uB824\uBA74 \uB370\uC774\uD130\uB7A9\uD234\uC988 \uD328\uB110\uC5D0\uC11C '\uC774 \uBE0C\uB77C\uC6B0\uC800 \uC5F0\uACB0 \uB044\uAE30'\uB97C \uB20C\uB7EC \uC8FC\uC138\uC694. \uC774 \uCEF4\uD4E8\uD130\uC758 \uB4F1\uB85D\uC740 \uB4F1\uB85D\uB41C \uBE0C\uB77C\uC6B0\uC800 \uBAA9\uB85D\uC5D0\uC11C \uBCC4\uB3C4\uB85C \uB0B4\uB9B4 \uC218 \uC788\uC5B4\uC694.";
1194
1214
  var PERMISSION_DENIED_HINT = "\uD30C\uC77C \uAD8C\uD55C \uB54C\uBB38\uC5D0 \uC124\uC815\uC744 \uC4F8 \uC218 \uC5C6\uC5C8\uC5B4\uC694. \uD30C\uC77C \uAD8C\uD55C\uC744 \uD655\uC778\uD55C \uB4A4 \uAC19\uC740 \uBA85\uB839\uC5B4\uB97C \uB2E4\uC2DC \uC2E4\uD589\uD574 \uC8FC\uC138\uC694.";
1195
1215
  var NO_HOSTS_DETECTED = "\uC5F0\uACB0\uD560 \uC218 \uC788\uB294 AI \uD504\uB85C\uADF8\uB7A8\uC744 \uCC3E\uC9C0 \uBABB\uD588\uC5B4\uC694.";
1216
+ var FALLBACK_TAIL = "\uADF8\uB798\uC11C AI \uC571\uC774 \uC2DC\uC791\uD560 \uB54C\uB9C8\uB2E4 \uB0B4\uB824\uBC1B\uC544 \uC2E4\uD589\uD558\uB3C4\uB85D \uC5F0\uACB0\uD574\uC694. \uC5F0\uACB0\uC740 \uB418\uC9C0\uB9CC \uC2DC\uC791\uC774 10\uCD08\uCBE4 \uB2A6\uC5B4\uC694.";
1217
+ var GLOBAL_INSTALL_FALLBACK = {
1218
+ unsupported: `\uC774 \uC2E4\uD589 \uD658\uACBD\uC5D0\uC11C\uB294 \uC5F0\uACB0 \uD504\uB85C\uADF8\uB7A8\uC744 \uC124\uCE58\uD560 \uC218 \uC5C6\uC5B4\uC694. ${FALLBACK_TAIL}`,
1219
+ "install-failed": `\uC5F0\uACB0 \uD504\uB85C\uADF8\uB7A8\uC744 \uC124\uCE58\uD558\uC9C0 \uBABB\uD588\uC5B4\uC694. npm \uC804\uC5ED \uC124\uCE58 \uAD8C\uD55C\uC774 \uC5C6\uC744 \uB54C \uC774\uB807\uAC8C \uB3FC\uC694. ${FALLBACK_TAIL}`,
1220
+ "not-found": `\uC124\uCE58\uD55C \uC5F0\uACB0 \uD504\uB85C\uADF8\uB7A8\uC744 \uCC3E\uC9C0 \uBABB\uD588\uC5B4\uC694. ${FALLBACK_TAIL}`,
1221
+ path: `\uC124\uCE58 \uACBD\uB85C\uC5D0 \uC4F8 \uC218 \uC5C6\uB294 \uAE00\uC790\uAC00 \uC788\uC5B4\uC694. ${FALLBACK_TAIL}`
1222
+ };
1196
1223
  var SUPPORTED_APPS_HEADER = "\uC9C0\uC6D0\uD558\uB294 \uD504\uB85C\uADF8\uB7A8\uACFC \uB2E4\uC6B4\uB85C\uB4DC \uC8FC\uC18C\uC608\uC694:";
1197
1224
  var AFTER_INSTALL_RETRY = "\uD504\uB85C\uADF8\uB7A8\uC744 \uC124\uCE58\uD55C \uB4A4 \uAC19\uC740 \uBA85\uB839\uC5B4\uB97C \uB2E4\uC2DC \uC2E4\uD589\uD574 \uC8FC\uC138\uC694.";
1198
1225
  var ALREADY_INSTALLED_HINT = "\uC774\uBBF8 \uC124\uCE58\uD588\uB294\uB370 \uBAA9\uB85D\uC5D0 \uC5C6\uB2E4\uBA74, \uC124\uC815 \uD30C\uC77C\uC774 \uC544\uC9C1 \uB9CC\uB4E4\uC5B4\uC9C0\uC9C0 \uC54A\uC558\uC744 \uC218 \uC788\uC5B4\uC694. \uC124\uC815 \uD30C\uC77C\uC740 \uD504\uB85C\uADF8\uB7A8\uC744 \uC124\uCE58\uD560 \uB54C\uAC00 \uC544\uB2C8\uB77C \uCC98\uC74C \uC4F8 \uB54C \uB9CC\uB4E4\uC5B4\uC838\uC694:\n - ChatGPT \uB370\uC2A4\uD06C\uD1B1: \uC124\uC815 \u2192 MCP \uC11C\uBC84 \u2192 \uC11C\uBC84 \uCD94\uAC00\uB97C \uD55C \uBC88 \uC2E4\uD589\n - VS Code: \uBA85\uB839 \uD314\uB808\uD2B8(Ctrl+Shift+P) \u2192 'MCP: Open User Configuration' \uC2E4\uD589\n\uADF8 \uB4A4 \uAC19\uC740 \uBA85\uB839\uC5B4\uB97C \uB2E4\uC2DC \uC2E4\uD589\uD558\uBA74 \uCC3E\uC744 \uC218 \uC788\uC5B4\uC694.";
@@ -1225,6 +1252,10 @@ var TOKEN_RE = /^[0-9a-f]{32,128}$/i;
1225
1252
  var EXTENSION_ID_RE = /^[a-p]{32}$/;
1226
1253
  var PORT_RE = /^\d{2,5}$/;
1227
1254
  var VERSION_RE = /^\d+\.\d+\.\d+$/;
1255
+ var LAUNCH_PATH_RE = /^(?:\/|[A-Za-z]:[\\/])[\p{L}\p{N} ._\-()\\/:@+~]*$/u;
1256
+ function isLaunchPath(path) {
1257
+ return path.length <= 400 && LAUNCH_PATH_RE.test(path);
1258
+ }
1228
1259
  var RETRY_HINT = "\uD328\uB110\uC5D0\uC11C \uBA85\uB839\uC5B4\uB97C \uB2E4\uC2DC \uBCF5\uC0AC\uD574\uC11C \uC2E4\uD589\uD574 \uC8FC\uC138\uC694.";
1229
1260
  var INVALID_TOKEN_MESSAGE = `\uC5F0\uACB0 \uD1A0\uD070 \uD615\uC2DD\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC544\uC694. ${RETRY_HINT}`;
1230
1261
  var INVALID_EXTENSION_ID_MESSAGE = `\uD655\uC7A5 \uD504\uB85C\uADF8\uB7A8 ID \uD615\uC2DD\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC544\uC694. ${RETRY_HINT}`;
@@ -1391,6 +1422,70 @@ async function reclaimPort(io, token, deps = {}) {
1391
1422
  if (!ended) return { kind: "failed" };
1392
1423
  return await gone() ? { kind: "forced" } : { kind: "failed" };
1393
1424
  }
1425
+ function globalPackageDir(io, root) {
1426
+ const [scope, name] = SERVER_PACKAGE.split("/");
1427
+ return joinPath(io, root, scope, name);
1428
+ }
1429
+ async function resolveGlobalLaunch(io, version) {
1430
+ if (io.execPath === void 0 || io.npmRootGlobal === void 0) {
1431
+ return { ok: false, reason: "unsupported" };
1432
+ }
1433
+ const root = await io.npmRootGlobal();
1434
+ if (root === "") return { ok: false, reason: "not-found" };
1435
+ const dir = globalPackageDir(io, root);
1436
+ let installed;
1437
+ try {
1438
+ installed = JSON.parse(
1439
+ await io.readFile(joinPath(io, dir, "package.json"))
1440
+ );
1441
+ } catch {
1442
+ return { ok: false, reason: "not-found" };
1443
+ }
1444
+ if (installed?.version !== version) {
1445
+ return { ok: false, reason: "not-found" };
1446
+ }
1447
+ const cli = joinPath(io, dir, "dist", "cli.js");
1448
+ if (!await io.exists(cli)) return { ok: false, reason: "not-found" };
1449
+ if (!isLaunchPath(io.execPath) || !isLaunchPath(cli)) {
1450
+ return { ok: false, reason: "path" };
1451
+ }
1452
+ return { ok: true, launch: { node: io.execPath, cli } };
1453
+ }
1454
+ async function installGlobally(io, version, opts) {
1455
+ if (!VERSION_RE.test(version)) return { ok: false, reason: "install-failed" };
1456
+ if (io.execPath === void 0 || io.npmRootGlobal === void 0) {
1457
+ return { ok: false, reason: "unsupported" };
1458
+ }
1459
+ let code = -1;
1460
+ try {
1461
+ const result = await io.spawn(
1462
+ "npm",
1463
+ ["install", "-g", packageSpec(version)],
1464
+ { shell: io.platform === "win32", inheritStdio: opts.inheritStdio }
1465
+ );
1466
+ code = result.code;
1467
+ } catch {
1468
+ code = -1;
1469
+ }
1470
+ if (code !== 0) return { ok: false, reason: "install-failed" };
1471
+ return resolveGlobalLaunch(io, version);
1472
+ }
1473
+ async function uninstallGlobally(io) {
1474
+ if (io.npmRootGlobal === void 0) return false;
1475
+ const root = await io.npmRootGlobal();
1476
+ if (root === "" || !await io.exists(globalPackageDir(io, root))) {
1477
+ return false;
1478
+ }
1479
+ try {
1480
+ const result = await io.spawn("npm", ["uninstall", "-g", SERVER_PACKAGE], {
1481
+ shell: io.platform === "win32",
1482
+ inheritStdio: true
1483
+ });
1484
+ return result.code === 0;
1485
+ } catch {
1486
+ return false;
1487
+ }
1488
+ }
1394
1489
  var BACKUP_KEEP = 3;
1395
1490
  function formatBackupTimestamp(date) {
1396
1491
  const pad = (n) => String(n).padStart(2, "0");
@@ -2233,6 +2328,22 @@ async function runInstall(opts, io) {
2233
2328
  }
2234
2329
  }
2235
2330
  printStep((line) => io.out(line), 4, 5, "\uC5F0\uACB0\uD558\uB294 \uC911");
2331
+ printBody(
2332
+ (line) => io.out(line),
2333
+ "\uC5F0\uACB0 \uD504\uB85C\uADF8\uB7A8\uC744 \uC774 \uCEF4\uD4E8\uD130\uC5D0 \uC124\uCE58\uD558\uB294 \uC911\uC774\uC5D0\uC694\u2026"
2334
+ );
2335
+ const installed = await installGlobally(io, entryOpts.version, {
2336
+ inheritStdio: true
2337
+ });
2338
+ if (installed.ok) {
2339
+ entryOpts.launch = installed.launch;
2340
+ printBody((line) => io.out(line), "\uC124\uCE58\uD588\uC5B4\uC694. AI \uC571\uC774 \uBC14\uB85C \uC2E4\uD589\uD574\uC694.");
2341
+ } else {
2342
+ printBody(
2343
+ (line) => io.out(line),
2344
+ GLOBAL_INSTALL_FALLBACK[installed.reason]
2345
+ );
2346
+ }
2236
2347
  const results = [];
2237
2348
  for (const d of detected) {
2238
2349
  try {
@@ -2391,6 +2502,9 @@ async function runUninstall(opts, io) {
2391
2502
  for (const result of results) {
2392
2503
  printResult(io, result);
2393
2504
  }
2505
+ if (await uninstallGlobally(io)) {
2506
+ io.out(" \uC774 \uCEF4\uD4E8\uD130\uC5D0 \uC124\uCE58\uD55C \uC5F0\uACB0 \uD504\uB85C\uADF8\uB7A8\uB3C4 \uC9C0\uC6E0\uC5B4\uC694.");
2507
+ }
2394
2508
  io.out("");
2395
2509
  io.out(UNINSTALL_DONE);
2396
2510
  io.out(UNINSTALL_TOKEN_REMINDER);
@@ -2400,6 +2514,93 @@ async function runUninstall(opts, io) {
2400
2514
  }
2401
2515
  return 0;
2402
2516
  }
2517
+ var RUNNER = /\bnpx(?:\.cmd)?\b/;
2518
+ function runsThroughRunner(entry) {
2519
+ if (!entry || typeof entry !== "object") return false;
2520
+ const { command, args } = entry;
2521
+ const argv = [command, ...Array.isArray(args) ? args : []];
2522
+ return argv.some((part) => typeof part === "string" && RUNNER.test(part));
2523
+ }
2524
+ async function readJson(io, path) {
2525
+ try {
2526
+ return JSON.parse(await io.readFile(path));
2527
+ } catch {
2528
+ return null;
2529
+ }
2530
+ }
2531
+ function ourTomlTable(raw) {
2532
+ const start = raw.indexOf(`[mcp_servers.${SERVER_NAME}]`);
2533
+ if (start === -1) return null;
2534
+ const rest = raw.slice(start + 1);
2535
+ const next = rest.search(/^\[(?!mcp_servers\.datalab[.\]])/m);
2536
+ return next === -1 ? rest : rest.slice(0, next);
2537
+ }
2538
+ async function relinkInstalledHosts(io, opts) {
2539
+ if (opts.launch === void 0) return [];
2540
+ const results = [];
2541
+ const shell = io.platform === "win32";
2542
+ for (const d of await detectHosts(io)) {
2543
+ try {
2544
+ if (d.tier === 1 && d.cli?.buildGetArgs !== void 0) {
2545
+ const got = await io.spawn(d.cli.bin, d.cli.buildGetArgs(), { shell });
2546
+ if (got.code !== 0) continue;
2547
+ await io.spawn(d.cli.bin, d.cli.buildRemoveArgs(), { shell });
2548
+ const added = await io.spawn(d.cli.bin, d.cli.buildAddArgs(opts), {
2549
+ shell
2550
+ });
2551
+ results.push({
2552
+ hostId: d.id,
2553
+ displayName: d.displayName,
2554
+ tier: 1,
2555
+ status: added.code === 0 ? "success" : "failed",
2556
+ message: added.code === 0 ? "relinked" : `exit ${added.code}`
2557
+ });
2558
+ } else if (d.tier === 2 && d.file?.entryKind === "stdio" && d.configPath) {
2559
+ const doc = await readJson(io, d.configPath);
2560
+ if (!runsThroughRunner(doc?.mcpServers?.[SERVER_NAME])) continue;
2561
+ const outcome = await upsertServerKey(
2562
+ io,
2563
+ d.configPath,
2564
+ buildEntryForHost(d.file, opts, io.platform)
2565
+ );
2566
+ results.push({
2567
+ hostId: d.id,
2568
+ displayName: d.displayName,
2569
+ tier: 2,
2570
+ status: outcome.ok ? "success" : "failed",
2571
+ message: outcome.ok ? "relinked" : outcome.reason ?? "failed"
2572
+ });
2573
+ } else if (d.tier === 3 && d.snippet?.tomlServerName !== void 0) {
2574
+ const path = d.snippet.detectedPath(io);
2575
+ if (path === null || !await io.exists(path)) continue;
2576
+ const table = ourTomlTable(await io.readFile(path));
2577
+ if (table === null || !RUNNER.test(table)) continue;
2578
+ const outcome = await upsertTomlServer(
2579
+ io,
2580
+ path,
2581
+ d.snippet.buildSnippet(opts, io.platform),
2582
+ d.snippet.tomlServerName
2583
+ );
2584
+ results.push({
2585
+ hostId: d.id,
2586
+ displayName: d.displayName,
2587
+ tier: 3,
2588
+ status: outcome.ok ? "success" : "failed",
2589
+ message: outcome.ok ? "relinked" : outcome.reason ?? "failed"
2590
+ });
2591
+ }
2592
+ } catch {
2593
+ results.push({
2594
+ hostId: d.id,
2595
+ displayName: d.displayName,
2596
+ tier: d.tier,
2597
+ status: "failed",
2598
+ message: "error"
2599
+ });
2600
+ }
2601
+ }
2602
+ return results;
2603
+ }
2403
2604
  function descriptionOf2(skillMd) {
2404
2605
  const fm = /^---\n([\s\S]*?)\n---/.exec(skillMd);
2405
2606
  const line = /^description:\s*(.*)$/m.exec(fm?.[1] ?? "");
@@ -2482,9 +2683,26 @@ async function detachSkill(io, payloadRoot, slug) {
2482
2683
  }
2483
2684
  return { kind: "moved", outcomes };
2484
2685
  }
2686
+ function quoteForCmd(arg) {
2687
+ return /[ ()]/.test(arg) ? `"${arg}"` : arg;
2688
+ }
2485
2689
  function createNodeIo() {
2486
2690
  return {
2487
2691
  platform: process.platform,
2692
+ execPath: process.execPath,
2693
+ npmRootGlobal() {
2694
+ return new Promise((resolve) => {
2695
+ const [command, args] = process.platform === "win32" ? ["cmd.exe", ["/d", "/s", "/c", "npm root -g"]] : ["npm", ["root", "-g"]];
2696
+ execFile(
2697
+ command,
2698
+ args,
2699
+ { windowsHide: true, timeout: 2e4 },
2700
+ (err, stdout) => {
2701
+ resolve(err ? "" : String(stdout ?? "").trim());
2702
+ }
2703
+ );
2704
+ });
2705
+ },
2488
2706
  fetch: globalThis.fetch,
2489
2707
  homedir() {
2490
2708
  return homedir();
@@ -2526,7 +2744,7 @@ function createNodeIo() {
2526
2744
  async spawn(command, args, opts) {
2527
2745
  return new Promise((resolve) => {
2528
2746
  const useShell = opts.shell === true;
2529
- const spawnCommand = useShell ? [command, ...args].join(" ") : command;
2747
+ const spawnCommand = useShell ? [command, ...args].map(quoteForCmd).join(" ") : command;
2530
2748
  const spawnArgs = useShell ? [] : args;
2531
2749
  const child = nodeSpawn(spawnCommand, spawnArgs, {
2532
2750
  shell: opts.shell,
@@ -2637,15 +2855,19 @@ export {
2637
2855
  detachSkill,
2638
2856
  detectHosts,
2639
2857
  formatBackupTimestamp,
2858
+ installGlobally,
2640
2859
  installQuestion,
2641
2860
  listSkills,
2642
2861
  packageSpec,
2643
2862
  printBanner,
2863
+ relinkInstalledHosts,
2644
2864
  removeServerKey,
2865
+ resolveGlobalLaunch,
2645
2866
  runInstall,
2646
2867
  runUninstall,
2647
2868
  skillStatus,
2648
2869
  skillsPayloadRoot,
2870
+ uninstallGlobally,
2649
2871
  uninstallQuestion,
2650
2872
  upsertServerKey,
2651
2873
  validateInstallOptions,
package/dist/index.d.ts CHANGED
@@ -1,17 +1,6 @@
1
- import { spawnSync } from 'node:child_process';
2
1
  import { Server } from '@modelcontextprotocol/sdk/server/index.js';
3
2
  import { Transport } from '@modelcontextprotocol/sdk/shared/transport.js';
4
3
 
5
- /**
6
- * The thin stdio adapter — a stdio-to-daemon proxy that owns nothing.
7
- *
8
- * An MCP host spawns this bin; it speaks MCP over stdio and forwards its two
9
- * methods to the background daemon over loopback HTTP. It binds no port and
10
- * holds no bridge, so many adapters (one per host) share one daemon. Every
11
- * edge — readiness probe, child spawn, HTTP fetch — is injectable, which is
12
- * what makes the proxy testable without a real socket or daemon.
13
- */
14
-
15
4
  /**
16
5
  * The version the operator currently publishes as canonical.
17
6
  *
@@ -124,8 +113,8 @@ interface RunAdapterDeps extends AdapterServerDeps {
124
113
  watchIntervalMs?: number;
125
114
  /** Injected in tests; defaults to asking the gateway. */
126
115
  canonical?: typeof canonicalVersion;
127
- /** Injected in tests; defaults to the real spawn. */
128
- spawnImpl?: typeof spawnSync;
116
+ /** Injected in tests; defaults to {@link updateInstalledCopy}. */
117
+ update?: () => Promise<UpdateOutcome>;
129
118
  /** Injected in tests; defaults to `ensureDaemonRunning`. */
130
119
  ensure?: (deps: EnsureRunningDeps) => Promise<void>;
131
120
  /** Injected in tests; defaults to a real stdio transport. */
@@ -139,6 +128,7 @@ interface RunAdapterDeps extends AdapterServerDeps {
139
128
  /** Injected in tests; defaults to process.exit. */
140
129
  exit?: (code: number) => void;
141
130
  }
131
+ type UpdateOutcome = "none" | "installed" | "migrated" | "failed";
142
132
  declare function runAdapter(deps?: RunAdapterDeps): Promise<void>;
143
133
  interface CliHandlers {
144
134
  install: (sub: "install" | "uninstall", argv: readonly string[]) => Promise<void>;
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  dispatchCli,
4
4
  ensureDaemonRunning,
5
5
  runAdapter
6
- } from "./chunk-T2CKB454.js";
6
+ } from "./chunk-PTB3TF6U.js";
7
7
  import "./chunk-MLKGABMK.js";
8
8
  export {
9
9
  createAdapterServer,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modootoday/datalab-extension-mcp",
3
- "version": "1.11.5",
3
+ "version": "1.12.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",