@hasna/coders 0.2.5 → 0.2.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/cli.mjs +7 -4
- package/dist/cli.mjs.map +3 -3
- package/dist/coders-mcp.mjs +12 -8
- package/dist/coders-mcp.mjs.map +3 -3
- package/package.json +1 -1
package/dist/coders-mcp.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -108750,7 +108750,7 @@ var init_cli = __esm({
|
|
|
108750
108750
|
"src/cli/index.ts"() {
|
|
108751
108751
|
"use strict";
|
|
108752
108752
|
VERSION = "0.1.2";
|
|
108753
|
-
BUILD_TIME = "2026-05-28T10:
|
|
108753
|
+
BUILD_TIME = "2026-05-28T10:09:00.587Z";
|
|
108754
108754
|
PACKAGE_NAME = "@hasna/coders";
|
|
108755
108755
|
ISSUES_URL = "https://github.com/hasnaxyz/open-coders/issues";
|
|
108756
108756
|
startupTimestamps = {};
|
|
@@ -108962,6 +108962,10 @@ __export(http_exports, {
|
|
|
108962
108962
|
startMcpHttpServer: () => startMcpHttpServer
|
|
108963
108963
|
});
|
|
108964
108964
|
import { createServer as createServer2 } from "node:http";
|
|
108965
|
+
async function defaultBuildServer() {
|
|
108966
|
+
const { buildServer: buildServer2 } = await Promise.resolve().then(() => (init_server4(), server_exports2));
|
|
108967
|
+
return buildServer2();
|
|
108968
|
+
}
|
|
108965
108969
|
function resolveMcpHttpPort(explicit) {
|
|
108966
108970
|
if (explicit != null && !Number.isNaN(explicit)) return explicit;
|
|
108967
108971
|
const env3 = process.env.MCP_HTTP_PORT;
|
|
@@ -108990,7 +108994,7 @@ async function readJsonBody(req) {
|
|
|
108990
108994
|
const text = Buffer.concat(chunks).toString("utf8");
|
|
108991
108995
|
return text ? JSON.parse(text) : void 0;
|
|
108992
108996
|
}
|
|
108993
|
-
async function handleStatelessMcpNode(req, res, getServer =
|
|
108997
|
+
async function handleStatelessMcpNode(req, res, getServer = defaultBuildServer) {
|
|
108994
108998
|
const server = await getServer();
|
|
108995
108999
|
const transport = new StreamableHTTPServerTransport({ sessionIdGenerator: void 0 });
|
|
108996
109000
|
await server.connect(transport);
|
|
@@ -109007,7 +109011,7 @@ function healthPayload(name = MCP_SERVICE_NAME) {
|
|
|
109007
109011
|
async function startMcpHttpServer(options2 = {}) {
|
|
109008
109012
|
const port = options2.port ?? resolveMcpHttpPort();
|
|
109009
109013
|
const host = "127.0.0.1";
|
|
109010
|
-
const getServer = options2.getServer ??
|
|
109014
|
+
const getServer = options2.getServer ?? defaultBuildServer;
|
|
109011
109015
|
const name = options2.name ?? MCP_SERVICE_NAME;
|
|
109012
109016
|
const httpServer = createServer2(async (req, res) => {
|
|
109013
109017
|
const url2 = new URL(req.url ?? "/", `http://${host}:${port}`);
|
|
@@ -109047,7 +109051,6 @@ var init_http = __esm({
|
|
|
109047
109051
|
"src/mcp/http.ts"() {
|
|
109048
109052
|
"use strict";
|
|
109049
109053
|
init_streamableHttp();
|
|
109050
|
-
init_server4();
|
|
109051
109054
|
DEFAULT_MCP_HTTP_PORT = 8805;
|
|
109052
109055
|
MCP_SERVICE_NAME = "coders";
|
|
109053
109056
|
}
|
|
@@ -109055,14 +109058,15 @@ var init_http = __esm({
|
|
|
109055
109058
|
|
|
109056
109059
|
// src/mcp/bin.ts
|
|
109057
109060
|
init_http();
|
|
109058
|
-
init_server4();
|
|
109059
109061
|
async function main2() {
|
|
109060
109062
|
const { http, port } = parseHttpArgv();
|
|
109061
109063
|
if (http) {
|
|
109062
|
-
|
|
109064
|
+
const { runMcpHttpServer: runMcpHttpServer2 } = await Promise.resolve().then(() => (init_http(), http_exports));
|
|
109065
|
+
await runMcpHttpServer2({ port: resolveMcpHttpPort(port) });
|
|
109063
109066
|
return;
|
|
109064
109067
|
}
|
|
109065
|
-
await
|
|
109068
|
+
const { runMcpServer: runMcpServer2 } = await Promise.resolve().then(() => (init_server4(), server_exports2));
|
|
109069
|
+
await runMcpServer2();
|
|
109066
109070
|
}
|
|
109067
109071
|
main2().catch((err) => {
|
|
109068
109072
|
console.error("coders-mcp failed to start:", err);
|