@hasna/brains 0.0.25 → 0.0.26

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.
@@ -3,6 +3,7 @@ export declare const DEFAULT_MCP_HTTP_PORT = 8802;
3
3
  export declare const MCP_HTTP_HOST = "127.0.0.1";
4
4
  export declare const MCP_SERVICE_NAME = "brains";
5
5
  export declare function isHttpMode(args: string[]): boolean;
6
+ export declare function isStdioMode(args: string[]): boolean;
6
7
  export declare function resolveMcpHttpPort(args: string[]): number;
7
8
  export declare function healthPayload(name?: string): {
8
9
  status: string;
@@ -1 +1 @@
1
- {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/mcp/http.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAExE,eAAO,MAAM,qBAAqB,OAAO,CAAC;AAC1C,eAAO,MAAM,aAAa,cAAc,CAAC;AACzC,eAAO,MAAM,gBAAgB,WAAW,CAAC;AAEzC,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAElD;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAQzD;AAED,wBAAgB,aAAa,CAAC,IAAI,GAAE,MAAyB,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAE/F;AAED,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,OAAO,EACZ,WAAW,EAAE,MAAM,MAAM,GACxB,OAAO,CAAC,QAAQ,CAAC,CAOnB;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,MAAM,CAAC;CAC3B,GAAG,UAAU,CAAC,OAAO,GAAG,CAAC,KAAK,CAAC,CAoB/B"}
1
+ {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/mcp/http.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAExE,eAAO,MAAM,qBAAqB,OAAO,CAAC;AAC1C,eAAO,MAAM,aAAa,cAAc,CAAC;AACzC,eAAO,MAAM,gBAAgB,WAAW,CAAC;AAEzC,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAElD;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAEnD;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAQzD;AAED,wBAAgB,aAAa,CAAC,IAAI,GAAE,MAAyB,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAE/F;AAED,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,OAAO,EACZ,WAAW,EAAE,MAAM,MAAM,GACxB,OAAO,CAAC,QAAQ,CAAC,CAOnB;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,MAAM,CAAC;CAC3B,GAAG,UAAU,CAAC,OAAO,GAAG,CAAC,KAAK,CAAC,CAoB/B"}
package/dist/mcp/index.js CHANGED
@@ -24124,8 +24124,8 @@ import { WebStandardStreamableHTTPServerTransport } from "@modelcontextprotocol/
24124
24124
  var DEFAULT_MCP_HTTP_PORT = 8802;
24125
24125
  var MCP_HTTP_HOST = "127.0.0.1";
24126
24126
  var MCP_SERVICE_NAME = "brains";
24127
- function isHttpMode(args) {
24128
- return args.includes("--http") || process.env.MCP_HTTP === "1";
24127
+ function isStdioMode(args) {
24128
+ return args.includes("--stdio") || process.env.MCP_STDIO === "1";
24129
24129
  }
24130
24130
  function resolveMcpHttpPort(args) {
24131
24131
  const portIdx = args.indexOf("--port");
@@ -24659,23 +24659,23 @@ async function main() {
24659
24659
  return;
24660
24660
  }
24661
24661
  const args = process.argv.slice(2);
24662
- if (isHttpMode(args)) {
24663
- const handle = startMcpHttpServer({
24664
- name: "brains",
24665
- port: resolveMcpHttpPort(args),
24666
- buildServer
24667
- });
24668
- process.on("SIGINT", () => {
24669
- handle.stop();
24670
- process.exit(0);
24671
- });
24672
- process.on("SIGTERM", () => {
24673
- handle.stop();
24674
- process.exit(0);
24675
- });
24662
+ if (isStdioMode(args)) {
24663
+ await startMcpServer();
24676
24664
  return;
24677
24665
  }
24678
- await startMcpServer();
24666
+ const handle = startMcpHttpServer({
24667
+ name: "brains",
24668
+ port: resolveMcpHttpPort(args),
24669
+ buildServer
24670
+ });
24671
+ process.on("SIGINT", () => {
24672
+ handle.stop();
24673
+ process.exit(0);
24674
+ });
24675
+ process.on("SIGTERM", () => {
24676
+ handle.stop();
24677
+ process.exit(0);
24678
+ });
24679
24679
  }
24680
24680
  if (import.meta.main) {
24681
24681
  main().catch((error) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/brains",
3
- "version": "0.0.25",
3
+ "version": "0.0.26",
4
4
  "description": "Fine-tuned model tracker and trainer — wraps OpenAI + Thinker Labs, gathers training data from todos/mementos/conversations/sessions",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",