@hasna/economy 0.2.19 → 0.2.21
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/mcp/http.d.ts +1 -0
- package/dist/mcp/http.d.ts.map +1 -1
- package/dist/mcp/index.js +9 -9
- package/dist/mcp/server.d.ts +1 -1
- package/package.json +1 -1
package/dist/mcp/http.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DEFAULT_MCP_HTTP_PORT, MCP_NAME } from './server.js';
|
|
2
2
|
export { DEFAULT_MCP_HTTP_PORT, MCP_NAME };
|
|
3
3
|
export declare function isHttpMode(argv?: string[]): boolean;
|
|
4
|
+
export declare function isStdioMode(argv?: string[]): boolean;
|
|
4
5
|
export declare function resolveHttpPort(argv?: string[]): number;
|
|
5
6
|
export declare function handleMcpHttpRequest(req: Request): Promise<Response>;
|
|
6
7
|
export interface StartHttpServerOptions {
|
package/dist/mcp/http.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/mcp/http.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,qBAAqB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAE1E,OAAO,EAAE,qBAAqB,EAAE,QAAQ,EAAE,CAAA;AAE1C,wBAAgB,UAAU,CAAC,IAAI,GAAE,MAAM,EAA0B,GAAG,OAAO,CAE1E;AAED,wBAAgB,eAAe,CAAC,IAAI,GAAE,MAAM,EAA0B,GAAG,MAAM,CAa9E;AAUD,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAiB1E;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CAChC;AAED,wBAAgB,eAAe,CAAC,OAAO,GAAE,sBAA2B,GAAG,UAAU,CAAC,OAAO,GAAG,CAAC,KAAK,CAAC,CAclG"}
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/mcp/http.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,qBAAqB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAE1E,OAAO,EAAE,qBAAqB,EAAE,QAAQ,EAAE,CAAA;AAE1C,wBAAgB,UAAU,CAAC,IAAI,GAAE,MAAM,EAA0B,GAAG,OAAO,CAE1E;AAED,wBAAgB,WAAW,CAAC,IAAI,GAAE,MAAM,EAA0B,GAAG,OAAO,CAE3E;AAED,wBAAgB,eAAe,CAAC,IAAI,GAAE,MAAM,EAA0B,GAAG,MAAM,CAa9E;AAUD,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAiB1E;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CAChC;AAED,wBAAgB,eAAe,CAAC,OAAO,GAAE,sBAA2B,GAAG,UAAU,CAAC,OAAO,GAAG,CAAC,KAAK,CAAC,CAclG"}
|
package/dist/mcp/index.js
CHANGED
|
@@ -2898,7 +2898,7 @@ init_database();
|
|
|
2898
2898
|
init_pricing();
|
|
2899
2899
|
init_pricing();
|
|
2900
2900
|
var MCP_NAME = "economy";
|
|
2901
|
-
var DEFAULT_MCP_HTTP_PORT =
|
|
2901
|
+
var DEFAULT_MCP_HTTP_PORT = 8860;
|
|
2902
2902
|
function buildServer() {
|
|
2903
2903
|
const db = openDatabase();
|
|
2904
2904
|
ensurePricingSeeded(db);
|
|
@@ -3293,8 +3293,8 @@ current machine: ${getMachineId()}`);
|
|
|
3293
3293
|
|
|
3294
3294
|
// src/mcp/http.ts
|
|
3295
3295
|
import { WebStandardStreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js";
|
|
3296
|
-
function
|
|
3297
|
-
return argv.includes("--
|
|
3296
|
+
function isStdioMode(argv = process.argv.slice(2)) {
|
|
3297
|
+
return argv.includes("--stdio") || process.env["MCP_STDIO"] === "1";
|
|
3298
3298
|
}
|
|
3299
3299
|
function resolveHttpPort(argv = process.argv.slice(2)) {
|
|
3300
3300
|
for (let i = 0;i < argv.length; i++) {
|
|
@@ -3373,14 +3373,14 @@ if (args.includes("--version") || args.includes("-V")) {
|
|
|
3373
3373
|
process.exit(0);
|
|
3374
3374
|
}
|
|
3375
3375
|
async function main() {
|
|
3376
|
-
if (
|
|
3377
|
-
|
|
3378
|
-
|
|
3376
|
+
if (isStdioMode(args)) {
|
|
3377
|
+
const server = buildServer();
|
|
3378
|
+
const transport = new StdioServerTransport;
|
|
3379
|
+
await server.connect(transport);
|
|
3379
3380
|
return;
|
|
3380
3381
|
}
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
await server.connect(transport);
|
|
3382
|
+
startHttpServer({ port: resolveHttpPort(args) });
|
|
3383
|
+
await new Promise(() => {});
|
|
3384
3384
|
}
|
|
3385
3385
|
main().catch((error) => {
|
|
3386
3386
|
console.error("MCP server error:", error);
|
package/dist/mcp/server.d.ts
CHANGED
package/package.json
CHANGED