multisite-cms-mcp 1.7.5 → 1.7.6

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/dist/index.d.ts CHANGED
@@ -1,6 +1,3 @@
1
1
  #!/usr/bin/env node
2
- /**
3
- * Wait for any in-progress authentication to complete
4
- */
5
- export declare function waitForAuth(): Promise<void>;
2
+ export {};
6
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAiqBA;;GAEG;AACH,wBAAsB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAIjD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
package/dist/index.js CHANGED
@@ -34,7 +34,6 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  };
35
35
  })();
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
- exports.waitForAuth = waitForAuth;
38
37
  const index_js_1 = require("@modelcontextprotocol/sdk/server/index.js");
39
38
  const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
40
39
  const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
@@ -650,20 +649,11 @@ server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
650
649
  };
651
650
  }
652
651
  });
653
- // Track in-progress authentication
654
- let authInProgress = null;
655
- /**
656
- * Wait for any in-progress authentication to complete
657
- */
658
- async function waitForAuth() {
659
- if (authInProgress) {
660
- await authInProgress;
661
- }
662
- }
663
652
  async function main() {
664
653
  const transport = new stdio_js_1.StdioServerTransport();
665
654
  // Check authentication status (non-blocking)
666
655
  const { getValidCredentials } = await Promise.resolve().then(() => __importStar(require('./lib/credentials')));
656
+ const { setAuthInProgress } = await Promise.resolve().then(() => __importStar(require('./lib/auth-state')));
667
657
  const credentials = await getValidCredentials();
668
658
  if (!credentials) {
669
659
  // No valid credentials - start device flow in background
@@ -671,13 +661,14 @@ async function main() {
671
661
  console.error('FastMode MCP Server - Authentication Required');
672
662
  console.error('Starting authentication flow...');
673
663
  // Start auth in background but track it so tools can wait
674
- authInProgress = startDeviceFlow();
675
- authInProgress.then(result => {
664
+ const authPromise = startDeviceFlow();
665
+ setAuthInProgress(authPromise);
666
+ authPromise.then(result => {
676
667
  console.error(result);
677
- authInProgress = null;
668
+ setAuthInProgress(null);
678
669
  }).catch(err => {
679
670
  console.error('Authentication error:', err);
680
- authInProgress = null;
671
+ setAuthInProgress(null);
681
672
  });
682
673
  }
683
674
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"api-client.d.ts","sourceRoot":"","sources":["../../src/lib/api-client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED;;GAEG;AACH,wBAAgB,SAAS,IAAI,MAAM,CAElC;AAED;;GAEG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,SAAS,CAAC,CAgB5D;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,SAAS,CAKxC;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAE1C;AAED;;GAEG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,OAAO,CAAC,CAe5D;AAED;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,CAS/C;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAC;IAC3C,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,KAAK,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CA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13 +93,8 @@ function isAuthConfigured() {
93
93
  */
94
94
  async function needsAuthentication() {
95
95
  // Wait for any startup auth that might be in progress
96
- try {
97
- const { waitForAuth } = await Promise.resolve().then(() => __importStar(require('../index')));
98
- await waitForAuth();
99
- }
100
- catch {
101
- // Ignore if waitForAuth not available
102
- }
96
+ const { waitForAuth } = await Promise.resolve().then(() => __importStar(require('./auth-state')));
97
+ await waitForAuth();
103
98
  const credentials = await (0, credentials_1.getValidCredentials)();
104
99
  if (credentials)
105
100
  return false;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Shared authentication state
3
+ * Separate file to avoid circular dependencies
4
+ */
5
+ /**
6
+ * Set the in-progress auth promise
7
+ */
8
+ export declare function setAuthInProgress(promise: Promise<string> | null): void;
9
+ /**
10
+ * Wait for any in-progress authentication to complete
11
+ */
12
+ export declare function waitForAuth(): Promise<void>;
13
+ //# sourceMappingURL=auth-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-state.d.ts","sourceRoot":"","sources":["../../src/lib/auth-state.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,IAAI,GAAG,IAAI,CAEvE;AAED;;GAEG;AACH,wBAAsB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAIjD"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ /**
3
+ * Shared authentication state
4
+ * Separate file to avoid circular dependencies
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.setAuthInProgress = setAuthInProgress;
8
+ exports.waitForAuth = waitForAuth;
9
+ // Track in-progress authentication
10
+ let authInProgress = null;
11
+ /**
12
+ * Set the in-progress auth promise
13
+ */
14
+ function setAuthInProgress(promise) {
15
+ authInProgress = promise;
16
+ }
17
+ /**
18
+ * Wait for any in-progress authentication to complete
19
+ */
20
+ async function waitForAuth() {
21
+ if (authInProgress) {
22
+ await authInProgress;
23
+ }
24
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"device-flow.d.ts","sourceRoot":"","sources":["../../src/lib/device-flow.ts"],"names":[],"mappings":"AA0DA;;;GAGG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,MAAM,CAAC,CAqGvD;AA0ED;;;GAGG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC;IAAE,aAAa,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CA+BhG"}
1
+ {"version":3,"file":"device-flow.d.ts","sourceRoot":"","sources":["../../src/lib/device-flow.ts"],"names":[],"mappings":"AA0DA;;;GAGG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,MAAM,CAAC,CAqGvD;AA0ED;;;GAGG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC;IAAE,aAAa,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CA2BhG"}
@@ -223,14 +223,9 @@ async function pollForToken(apiUrl, deviceCode, interval, expiresAt) {
223
223
  async function ensureAuthenticated() {
224
224
  // Import here to avoid circular dependency
225
225
  const { getValidCredentials } = await Promise.resolve().then(() => __importStar(require('./credentials')));
226
+ const { waitForAuth } = await Promise.resolve().then(() => __importStar(require('./auth-state')));
226
227
  // Wait for any startup auth that might be in progress
227
- try {
228
- const { waitForAuth } = await Promise.resolve().then(() => __importStar(require('../index')));
229
- await waitForAuth();
230
- }
231
- catch {
232
- // Ignore if waitForAuth not available
233
- }
228
+ await waitForAuth();
234
229
  const credentials = await getValidCredentials();
235
230
  if (credentials) {
236
231
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "multisite-cms-mcp",
3
- "version": "1.7.5",
3
+ "version": "1.7.6",
4
4
  "description": "MCP server for Fast Mode CMS. Convert websites, validate packages, and deploy directly to Fast Mode. Includes authentication, project creation, schema sync, and one-click deployment.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {