chore: add a2a server bin (#10592)

This commit is contained in:
Adam Weidman
2025-10-10 01:47:18 +02:00
committed by GitHub
parent f0ce673142
commit 5674ba110b
3 changed files with 18 additions and 11 deletions
+3
View File
@@ -17612,6 +17612,9 @@
"uuid": "^11.1.0",
"winston": "^3.17.0"
},
"bin": {
"gemini-cli-a2a-server": "dist/a2a-server.mjs"
},
"devDependencies": {
"@types/express": "^5.0.3",
"@types/fs-extra": "^11.0.4",
+5 -2
View File
@@ -9,10 +9,13 @@
"directory": "packages/a2a-server"
},
"type": "module",
"main": "dist/server.js",
"main": "dist/index.js",
"bin": {
"gemini-cli-a2a-server": "dist/a2a-server.mjs"
},
"scripts": {
"start": "node dist/src/http/server.js",
"build": "node ../../scripts/build_package.js",
"start": "node dist/src/http/server.js",
"lint": "eslint . --ext .ts,.tsx",
"format": "prettier --write .",
"test": "vitest run",
+10 -9
View File
@@ -1,3 +1,5 @@
#!/usr/bin/env node
/**
* @license
* Copyright 2025 Google LLC
@@ -10,22 +12,21 @@ import * as path from 'node:path';
import { logger } from '../utils/logger.js';
import { main } from './app.js';
// Check if the module is the main script being run. path.resolve() creates a
// canonical, absolute path, which avoids cross-platform issues.
// Check if the module is the main script being run
const isMainModule =
path.resolve(process.argv[1]) ===
path.resolve(url.fileURLToPath(import.meta.url));
process.on('uncaughtException', (error) => {
logger.error('Unhandled exception:', error);
process.exit(1);
});
path.basename(process.argv[1]) ===
path.basename(url.fileURLToPath(import.meta.url));
if (
import.meta.url.startsWith('file:') &&
isMainModule &&
process.env['NODE_ENV'] !== 'test'
) {
process.on('uncaughtException', (error) => {
logger.error('Unhandled exception:', error);
process.exit(1);
});
main().catch((error) => {
logger.error('[CoreAgent] Unhandled error in main:', error);
process.exit(1);