@jieunmarslim/server-editable-slides 0.2.9 → 0.2.11
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/index.js +14 -14
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -375,18 +375,18 @@ async function runDoctor() {
|
|
|
375
375
|
}
|
|
376
376
|
}
|
|
377
377
|
|
|
378
|
-
//
|
|
378
|
+
// Run doctor diagnostics only when explicitly requested via command-line arguments.
|
|
379
|
+
// When spawned by MCP hosts (Antigravity, Cursor, Claude Desktop), always start the MCP server directly.
|
|
379
380
|
const args = process.argv.slice(2);
|
|
380
|
-
|
|
381
|
+
const isDoctor =
|
|
381
382
|
args.includes('doctor') ||
|
|
382
|
-
args.includes('auth') ||
|
|
383
383
|
args.includes('check') ||
|
|
384
384
|
args.includes('--check') ||
|
|
385
385
|
args.includes('--doctor') ||
|
|
386
386
|
args.includes('-h') ||
|
|
387
|
-
args.includes('--help')
|
|
388
|
-
|
|
389
|
-
) {
|
|
387
|
+
args.includes('--help');
|
|
388
|
+
|
|
389
|
+
if (isDoctor) {
|
|
390
390
|
runDoctor();
|
|
391
391
|
} else {
|
|
392
392
|
startMcpServer().catch((err) => {
|
|
@@ -517,19 +517,19 @@ async function assertEnvironmentOrExit() {
|
|
|
517
517
|
const project = getProject();
|
|
518
518
|
|
|
519
519
|
if (!account || !token) {
|
|
520
|
-
console.error('
|
|
520
|
+
console.error('error: Not authenticated. Please run: gcloud auth login --enable-gdrive-access');
|
|
521
521
|
process.exit(1);
|
|
522
522
|
}
|
|
523
523
|
|
|
524
524
|
// Verify Google Drive scope
|
|
525
525
|
const hasDrive = await checkDriveScope(token);
|
|
526
526
|
if (!hasDrive) {
|
|
527
|
-
console.error(
|
|
527
|
+
console.error('error: Google Drive scope missing. Please run: gcloud auth login --enable-gdrive-access');
|
|
528
528
|
process.exit(1);
|
|
529
529
|
}
|
|
530
530
|
|
|
531
531
|
if (!project) {
|
|
532
|
-
console.error('
|
|
532
|
+
console.error('error: No GCP project set. Please run: gcloud config set project <PROJECT_ID>');
|
|
533
533
|
process.exit(1);
|
|
534
534
|
}
|
|
535
535
|
|
|
@@ -542,7 +542,7 @@ async function assertEnvironmentOrExit() {
|
|
|
542
542
|
.toString()
|
|
543
543
|
.trim();
|
|
544
544
|
if (check !== project) {
|
|
545
|
-
throw new Error(
|
|
545
|
+
throw new Error('Project mismatch');
|
|
546
546
|
}
|
|
547
547
|
} catch (err) {
|
|
548
548
|
const stderr = err.stderr ? err.stderr.toString() : err.message;
|
|
@@ -550,11 +550,11 @@ async function assertEnvironmentOrExit() {
|
|
|
550
550
|
stderr.includes('does not have permission') ||
|
|
551
551
|
stderr.includes('caller does not have permission')
|
|
552
552
|
) {
|
|
553
|
-
console.error(`
|
|
553
|
+
console.error(`error: Account [${account}] lacks permission for project [${project}]. Run: gcloud config set project <PROJECT_ID>`);
|
|
554
554
|
} else if (stderr.includes('not found') || stderr.includes('404')) {
|
|
555
|
-
console.error(`
|
|
555
|
+
console.error(`error: Project [${project}] not found. Run: gcloud config set project <VALID_PROJECT_ID>`);
|
|
556
556
|
} else {
|
|
557
|
-
console.error(`
|
|
557
|
+
console.error(`error: Cannot access project [${project}] (${stderr.trim().split('\n')[0]}).`);
|
|
558
558
|
}
|
|
559
559
|
process.exit(1);
|
|
560
560
|
}
|
|
@@ -978,7 +978,7 @@ async function startMcpServer() {
|
|
|
978
978
|
|
|
979
979
|
const transport = new StdioServerTransport();
|
|
980
980
|
server.connect(transport).catch((err) => {
|
|
981
|
-
console.error(`
|
|
981
|
+
console.error(`error: ${err.message}`);
|
|
982
982
|
process.exit(1);
|
|
983
983
|
});
|
|
984
984
|
}
|