nexus-agents 2.0.0
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/LICENSE +27 -0
- package/dist/chunk-3VJOPTVX.js +13142 -0
- package/dist/chunk-3VJOPTVX.js.map +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +86 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +8526 -0
- package/dist/index.js +551 -0
- package/dist/index.js.map +1 -0
- package/dist/workflows/templates/bug-fix.yaml +109 -0
- package/dist/workflows/templates/code-review.yaml +84 -0
- package/dist/workflows/templates/documentation-update.yaml +91 -0
- package/dist/workflows/templates/feature-implementation.yaml +124 -0
- package/package.json +71 -0
- package/src/workflows/templates/bug-fix.yaml +109 -0
- package/src/workflows/templates/code-review.yaml +84 -0
- package/src/workflows/templates/documentation-update.yaml +91 -0
- package/src/workflows/templates/feature-implementation.yaml +124 -0
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
VERSION,
|
|
4
|
+
closeServer,
|
|
5
|
+
createLogger,
|
|
6
|
+
registerTools,
|
|
7
|
+
startStdioServer
|
|
8
|
+
} from "./chunk-3VJOPTVX.js";
|
|
9
|
+
|
|
10
|
+
// src/cli.ts
|
|
11
|
+
var EXIT_CODES = {
|
|
12
|
+
SUCCESS: 0,
|
|
13
|
+
SERVER_START_FAILED: 1,
|
|
14
|
+
SHUTDOWN_ERROR: 2
|
|
15
|
+
};
|
|
16
|
+
function setupShutdownHandlers(cleanup, logger) {
|
|
17
|
+
let isShuttingDown = false;
|
|
18
|
+
const handleShutdown = async (signal) => {
|
|
19
|
+
if (isShuttingDown) {
|
|
20
|
+
logger.debug("Shutdown already in progress, ignoring signal", { signal });
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
isShuttingDown = true;
|
|
24
|
+
logger.info("Received shutdown signal", { signal });
|
|
25
|
+
try {
|
|
26
|
+
await cleanup();
|
|
27
|
+
logger.info("Shutdown complete");
|
|
28
|
+
process.exit(EXIT_CODES.SUCCESS);
|
|
29
|
+
} catch (error) {
|
|
30
|
+
logger.error(
|
|
31
|
+
"Error during shutdown",
|
|
32
|
+
error instanceof Error ? error : new Error(String(error))
|
|
33
|
+
);
|
|
34
|
+
process.exit(EXIT_CODES.SHUTDOWN_ERROR);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
process.on("SIGINT", () => void handleShutdown("SIGINT"));
|
|
38
|
+
process.on("SIGTERM", () => void handleShutdown("SIGTERM"));
|
|
39
|
+
process.on("uncaughtException", (error) => {
|
|
40
|
+
logger.error("Uncaught exception", error);
|
|
41
|
+
process.exit(EXIT_CODES.SERVER_START_FAILED);
|
|
42
|
+
});
|
|
43
|
+
process.on("unhandledRejection", (reason) => {
|
|
44
|
+
const error = reason instanceof Error ? reason : new Error(String(reason));
|
|
45
|
+
logger.error("Unhandled rejection", error);
|
|
46
|
+
process.exit(EXIT_CODES.SERVER_START_FAILED);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
async function main() {
|
|
50
|
+
const logger = createLogger({ component: "cli" });
|
|
51
|
+
logger.info("Starting Nexus Agents", {
|
|
52
|
+
version: VERSION,
|
|
53
|
+
nodeVersion: process.version,
|
|
54
|
+
platform: process.platform
|
|
55
|
+
});
|
|
56
|
+
const serverResult = await startStdioServer({
|
|
57
|
+
name: "nexus-agents",
|
|
58
|
+
version: VERSION,
|
|
59
|
+
logger
|
|
60
|
+
});
|
|
61
|
+
if (!serverResult.ok) {
|
|
62
|
+
logger.error("Failed to start MCP server", new Error(serverResult.error.message));
|
|
63
|
+
process.exit(EXIT_CODES.SERVER_START_FAILED);
|
|
64
|
+
}
|
|
65
|
+
const { server, logger: serverLogger } = serverResult.value;
|
|
66
|
+
const toolInfra = registerTools(server, { logger: serverLogger });
|
|
67
|
+
logger.info("MCP server started successfully", {
|
|
68
|
+
availableTools: toolInfra.tools
|
|
69
|
+
});
|
|
70
|
+
setupShutdownHandlers(async () => {
|
|
71
|
+
const closeResult = await closeServer(server, serverLogger);
|
|
72
|
+
if (!closeResult.ok) {
|
|
73
|
+
throw new Error(closeResult.error.message);
|
|
74
|
+
}
|
|
75
|
+
}, logger);
|
|
76
|
+
logger.debug("Server running, waiting for requests...");
|
|
77
|
+
}
|
|
78
|
+
main().catch((error) => {
|
|
79
|
+
const logger = createLogger({ component: "cli" });
|
|
80
|
+
logger.error(
|
|
81
|
+
"Fatal error during startup",
|
|
82
|
+
error instanceof Error ? error : new Error(String(error))
|
|
83
|
+
);
|
|
84
|
+
process.exit(EXIT_CODES.SERVER_START_FAILED);
|
|
85
|
+
});
|
|
86
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\n/**\n * nexus-agents CLI\n *\n * CLI entry point for Nexus Agents MCP server.\n * Starts the server with stdio transport for communication with Claude.\n *\n * (Source: MCP Protocol 2025-11-25)\n */\n\nimport { startStdioServer, closeServer, registerTools } from './mcp/index.js';\nimport { createLogger, type ILogger } from './core/index.js';\nimport { VERSION } from './index.js';\n\n/**\n * Exit codes for the CLI.\n */\nconst EXIT_CODES = {\n SUCCESS: 0,\n SERVER_START_FAILED: 1,\n SHUTDOWN_ERROR: 2,\n} as const;\n\n/**\n * Sets up graceful shutdown handlers.\n *\n * @param cleanup - Async cleanup function to call on shutdown\n * @param logger - Logger instance\n */\nfunction setupShutdownHandlers(cleanup: () => Promise<void>, logger: ILogger): void {\n let isShuttingDown = false;\n\n const handleShutdown = async (signal: string): Promise<void> => {\n if (isShuttingDown) {\n logger.debug('Shutdown already in progress, ignoring signal', { signal });\n return;\n }\n\n isShuttingDown = true;\n logger.info('Received shutdown signal', { signal });\n\n try {\n await cleanup();\n logger.info('Shutdown complete');\n process.exit(EXIT_CODES.SUCCESS);\n } catch (error) {\n logger.error(\n 'Error during shutdown',\n error instanceof Error ? error : new Error(String(error))\n );\n process.exit(EXIT_CODES.SHUTDOWN_ERROR);\n }\n };\n\n process.on('SIGINT', () => void handleShutdown('SIGINT'));\n process.on('SIGTERM', () => void handleShutdown('SIGTERM'));\n\n // Handle uncaught errors\n process.on('uncaughtException', (error: Error) => {\n logger.error('Uncaught exception', error);\n process.exit(EXIT_CODES.SERVER_START_FAILED);\n });\n\n process.on('unhandledRejection', (reason: unknown) => {\n const error = reason instanceof Error ? reason : new Error(String(reason));\n logger.error('Unhandled rejection', error);\n process.exit(EXIT_CODES.SERVER_START_FAILED);\n });\n}\n\n/**\n * Main entry point for the Nexus Agents CLI.\n * Starts the MCP server with stdio transport.\n */\nasync function main(): Promise<void> {\n const logger = createLogger({ component: 'cli' });\n\n logger.info('Starting Nexus Agents', {\n version: VERSION,\n nodeVersion: process.version,\n platform: process.platform,\n });\n\n // Start the MCP server with stdio transport\n const serverResult = await startStdioServer({\n name: 'nexus-agents',\n version: VERSION,\n logger,\n });\n\n if (!serverResult.ok) {\n logger.error('Failed to start MCP server', new Error(serverResult.error.message));\n process.exit(EXIT_CODES.SERVER_START_FAILED);\n }\n\n const { server, logger: serverLogger } = serverResult.value;\n\n // Initialize tool registration infrastructure\n // Note: Individual tools (orchestrate, create_expert, run_workflow) are\n // registered separately with their specific dependencies (TechLead, factories, etc.)\n const toolInfra = registerTools(server, { logger: serverLogger });\n\n logger.info('MCP server started successfully', {\n availableTools: toolInfra.tools,\n });\n\n // Setup graceful shutdown\n setupShutdownHandlers(async () => {\n const closeResult = await closeServer(server, serverLogger);\n if (!closeResult.ok) {\n throw new Error(closeResult.error.message);\n }\n }, logger);\n\n // Keep process alive - stdio transport handles communication\n logger.debug('Server running, waiting for requests...');\n}\n\n// Run main if this is the entry point\nmain().catch((error: unknown) => {\n const logger = createLogger({ component: 'cli' });\n logger.error(\n 'Fatal error during startup',\n error instanceof Error ? error : new Error(String(error))\n );\n process.exit(EXIT_CODES.SERVER_START_FAILED);\n});\n"],"mappings":";;;;;;;;;;AAiBA,IAAM,aAAa;AAAA,EACjB,SAAS;AAAA,EACT,qBAAqB;AAAA,EACrB,gBAAgB;AAClB;AAQA,SAAS,sBAAsB,SAA8B,QAAuB;AAClF,MAAI,iBAAiB;AAErB,QAAM,iBAAiB,OAAO,WAAkC;AAC9D,QAAI,gBAAgB;AAClB,aAAO,MAAM,iDAAiD,EAAE,OAAO,CAAC;AACxE;AAAA,IACF;AAEA,qBAAiB;AACjB,WAAO,KAAK,4BAA4B,EAAE,OAAO,CAAC;AAElD,QAAI;AACF,YAAM,QAAQ;AACd,aAAO,KAAK,mBAAmB;AAC/B,cAAQ,KAAK,WAAW,OAAO;AAAA,IACjC,SAAS,OAAO;AACd,aAAO;AAAA,QACL;AAAA,QACA,iBAAiB,QAAQ,QAAQ,IAAI,MAAM,OAAO,KAAK,CAAC;AAAA,MAC1D;AACA,cAAQ,KAAK,WAAW,cAAc;AAAA,IACxC;AAAA,EACF;AAEA,UAAQ,GAAG,UAAU,MAAM,KAAK,eAAe,QAAQ,CAAC;AACxD,UAAQ,GAAG,WAAW,MAAM,KAAK,eAAe,SAAS,CAAC;AAG1D,UAAQ,GAAG,qBAAqB,CAAC,UAAiB;AAChD,WAAO,MAAM,sBAAsB,KAAK;AACxC,YAAQ,KAAK,WAAW,mBAAmB;AAAA,EAC7C,CAAC;AAED,UAAQ,GAAG,sBAAsB,CAAC,WAAoB;AACpD,UAAM,QAAQ,kBAAkB,QAAQ,SAAS,IAAI,MAAM,OAAO,MAAM,CAAC;AACzE,WAAO,MAAM,uBAAuB,KAAK;AACzC,YAAQ,KAAK,WAAW,mBAAmB;AAAA,EAC7C,CAAC;AACH;AAMA,eAAe,OAAsB;AACnC,QAAM,SAAS,aAAa,EAAE,WAAW,MAAM,CAAC;AAEhD,SAAO,KAAK,yBA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