@solidxai/solidctl 0.1.25 → 0.1.26-beta.1

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 ADDED
@@ -0,0 +1,89 @@
1
+ Business Source License 1.1
2
+
3
+ License text copyright (c) 2024 MariaDB plc, All Rights Reserved.
4
+ "Business Source License" is a trademark of MariaDB plc.
5
+
6
+ Parameters:
7
+
8
+ Licensor: Logicloop Ventures Limited
9
+ Licensed Work: SolidCTL (@solidxai/solidctl)
10
+ Additional Use Grant: Individuals and organizations with total annual revenue
11
+ (including funding) of less than $1,000,000 USD may use
12
+ the Licensed Work for any purpose, including commercial
13
+ production use. Organizations with total annual revenue
14
+ (including funding) of $1,000,000 USD or more must obtain
15
+ a commercial Enterprise License before using the Licensed
16
+ Work in production. Contact https://solidxai.com/contact
17
+ for licensing.
18
+
19
+ "Production use" means any use of the Licensed Work other
20
+ than development, debugging, evaluation, or testing.
21
+
22
+ Change Date: None
23
+ Change License: Apache 2.0
24
+
25
+ Notice:
26
+
27
+ In consideration of the right to use this License's text and the
28
+ "Business Source License" name and trademark, Licensor covenants to MariaDB,
29
+ and to all other recipients of the Licensed Work, that Licensor will:
30
+
31
+ 1. Specify as the Change License the Apache License, Version 2.0 or any
32
+ later version, or a license that is compatible with GPL Version 2.0 or
33
+ a later version, where "compatible" means that software provided under
34
+ the Change License can be included in a program with software provided
35
+ under GPL Version 2.0 or a later version. Licensor may specify
36
+ additional Change Licenses without limitation.
37
+
38
+ 2. Specify an additional grant of rights to use that does not impose any
39
+ additional restriction on the rights granted in this License, as the
40
+ Additional Use Grant.
41
+
42
+ 3. Not modify this License in any other way.
43
+
44
+ Terms
45
+
46
+ The Licensor hereby grants you the right to copy, modify, create derivative
47
+ works, redistribute, and make non-production use of the Licensed Work. The
48
+ Licensor may make an Additional Use Grant, above, permitting limited
49
+ production use.
50
+
51
+ Effective on the Change Date, or the fourth anniversary of the first
52
+ publicly available distribution of a specific version of the Licensed Work
53
+ under this License, whichever comes first, the Licensor hereby grants you
54
+ rights under the terms of the Change License, and the rights granted in the
55
+ paragraph above terminate.
56
+
57
+ If your use of the Licensed Work does not comply with the requirements
58
+ currently in effect as described in this License, you must purchase a
59
+ commercial license from the Licensor, its affiliated entities, or authorized
60
+ resellers, or you must refrain from using the Licensed Work.
61
+
62
+ All copies of the original and modified Licensed Work, and derivative works
63
+ of the Licensed Work, are subject to this License. This License applies
64
+ separately for each version of the Licensed Work and the Change Date may
65
+ vary for each version of the Licensed Work released by Licensor.
66
+
67
+ You must conspicuously display this License on each original or modified copy
68
+ of the Licensed Work. If you receive the Licensed Work in original or
69
+ modified form from a third party, the terms and conditions set forth in this
70
+ License apply to your use of that work.
71
+
72
+ Any use of the Licensed Work in violation of this License will automatically
73
+ terminate your rights under this License for the current and all other
74
+ versions of the Licensed Work.
75
+
76
+ This License does not grant you any right in any trademark or logo of
77
+ Licensor or its affiliates (provided that you may use a trademark or logo of
78
+ Licensor as expressly required by this License).
79
+
80
+ TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
81
+ AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
82
+ EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
83
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
84
+ TITLE.
85
+
86
+ For complete terms and conditions, see https://solidxai.com/terms.
87
+
88
+ For questions about licensing, contact support@solidxai.com or visit
89
+ https://solidxai.com/contact.
package/README.md CHANGED
@@ -5,8 +5,9 @@
5
5
  `solidctl` is the command-line interface that ties the SolidX ecosystem together. Whether you are starting a new project, upgrading core dependencies, or regenerating code after a model change using the command line, `solidctl` is the entry point.
6
6
 
7
7
  [![npm version](https://img.shields.io/npm/v/@solidxai/solidctl)](https://www.npmjs.com/package/@solidxai/solidctl)
8
- [![License: BSL-1.1](https://img.shields.io/badge/License-BSL--1.1-blue.svg)](https://opensource.org/licenses/BSL-1.1)
8
+ [![License: BSL-1.1](https://img.shields.io/badge/License-BSL--1.1-blue.svg)](https://mariadb.com/bsl11/)
9
9
  [![Documentation](https://img.shields.io/badge/docs-solidxai.com-blue)](https://docs.solidxai.com/docs)
10
+ [![Discord](https://img.shields.io/badge/discord-online-brightgreen.svg)](https://discord.gg/ATQW4CEksA)
10
11
 
11
12
  ---
12
13
 
@@ -210,6 +211,7 @@ my-solid-app/
210
211
  |---|---|
211
212
  | Website | [solidxai.com](https://solidxai.com) |
212
213
  | Documentation | [docs.solidxai.com](https://docs.solidxai.com/docs) |
214
+ | Discord | [discord.gg/ATQW4CEksA](https://discord.gg/ATQW4CEksA) |
213
215
  | Support | support@solidxai.com |
214
216
 
215
217
  ---
@@ -1,40 +1,89 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.registerMcpCommand = registerMcpCommand;
4
7
  const child_process_1 = require("child_process");
8
+ const path_1 = __importDefault(require("path"));
9
+ const dotenv_1 = require("dotenv");
5
10
  const helper_1 = require("../helper");
11
+ function resolveDatabaseUrl() {
12
+ if (process.env.DATABASE_URL)
13
+ return process.env.DATABASE_URL;
14
+ const host = process.env.DEFAULT_DATABASE_HOST;
15
+ const port = process.env.DEFAULT_DATABASE_PORT;
16
+ const user = process.env.DEFAULT_DATABASE_USER;
17
+ const password = process.env.DEFAULT_DATABASE_PASSWORD;
18
+ const name = process.env.DEFAULT_DATABASE_NAME;
19
+ if (host && port && user && name) {
20
+ return `postgresql://${user}${password ? ':' + password : ''}@${host}:${port}/${name}`;
21
+ }
22
+ return undefined;
23
+ }
24
+ function buildBridgedEnv() {
25
+ const projectRoot = process.cwd();
26
+ (0, dotenv_1.config)({ path: path_1.default.join(projectRoot, 'solid-api', '.env') });
27
+ const databaseUrl = resolveDatabaseUrl();
28
+ return {
29
+ ...process.env,
30
+ SOLIDX_PROJECT_ROOT: projectRoot,
31
+ ...(databaseUrl ? { DATABASE_URL: databaseUrl } : {}),
32
+ ...(process.env.BASE_URL ? { BASE_URL: process.env.BASE_URL } : {}),
33
+ ...(process.env.APP_ENCRYPTION_KEY ? { APP_ENCRYPTION_KEY: process.env.APP_ENCRYPTION_KEY } : {}),
34
+ };
35
+ }
36
+ function printBridgeSummary(env) {
37
+ const bridgedKeys = ['DATABASE_URL', 'SOLIDX_PROJECT_ROOT', 'BASE_URL', 'APP_ENCRYPTION_KEY'];
38
+ const bridged = bridgedKeys.filter((k) => env[k]);
39
+ const missing = bridgedKeys.filter((k) => !env[k]);
40
+ console.log(`✔ Bridged env: ${bridged.join(', ') || 'none'}`);
41
+ if (missing.length)
42
+ console.warn(`⚠ Missing env: ${missing.join(', ')}`);
43
+ }
6
44
  function registerMcpCommand(program) {
7
- program
45
+ const mcp = program
8
46
  .command('mcp')
9
- .description('Used to run the SolidX MCP server')
10
- .helpOption(false)
11
- .allowUnknownOption(true)
12
- .allowExcessArguments(true)
13
- .action((_options, command) => {
47
+ .description('SolidX MCP Server (Streamable HTTP) for remote clients (Cursor, Codex, cloud desktops)');
48
+ mcp
49
+ .command('start')
50
+ .description('Start the MCP server using Streamable HTTP transport')
51
+ .option('-p, --port <port>', 'Port number', '9000')
52
+ .option('-H, --host <host>', 'Host to bind', '0.0.0.0')
53
+ .option('-l, --log-level <level>', 'Logging level', 'INFO')
54
+ .option('--mount-path <path>', 'Path under which to mount the MCP app', '/mcp')
55
+ .action((options) => {
14
56
  (0, helper_1.validateProjectRoot)();
15
- const projectRoot = process.cwd();
16
- const solidApiDir = `${projectRoot}/solid-api`;
17
- const rawArgs = command.parent ? command.parent.rawArgs : process.argv;
18
- const mcpIndex = rawArgs.lastIndexOf('mcp');
19
- const passthroughArgs = mcpIndex >= 0 ? rawArgs.slice(mcpIndex + 1) : [];
20
- const args = ['mcp', ...passthroughArgs];
21
- console.log('▶ Running solid mcp');
22
- const solidCommand = process.platform === 'win32' ? 'solid.cmd' : 'solid';
23
- const result = (0, child_process_1.spawnSync)(solidCommand, args, {
24
- cwd: solidApiDir,
57
+ const env = buildBridgedEnv();
58
+ if (!env.DATABASE_URL) {
59
+ console.error('❌ DATABASE_URL is required for MCP mode.\n' +
60
+ ' It is needed to validate API keys and write audit logs.\n' +
61
+ ' Set it in your solid-api/.env or environment.');
62
+ process.exit(1);
63
+ }
64
+ printBridgeSummary(env);
65
+ console.log(`▶ Starting SolidX MCP Server on ${options.host}:${options.port}`);
66
+ const agentCommand = process.platform === 'win32' ? 'solidx-agent.cmd' : 'solidx-agent';
67
+ const result = (0, child_process_1.spawnSync)(agentCommand, [
68
+ 'mcp-remote',
69
+ '--host', options.host,
70
+ '--port', options.port,
71
+ '--log-level', options.logLevel,
72
+ '--mount-path', options.mountPath,
73
+ ], {
74
+ cwd: env.SOLIDX_PROJECT_ROOT,
25
75
  stdio: 'inherit',
26
- env: process.env,
27
- shell: process.platform === 'win32' ? true : false,
76
+ env,
77
+ shell: process.platform === 'win32',
28
78
  });
29
79
  if (result.error) {
30
- console.error('❌ Failed to run solid mcp:', result.error.message);
80
+ console.error('❌ Failed to start MCP server:', result.error.message);
31
81
  process.exit(1);
32
82
  }
33
83
  if (result.status !== 0) {
34
- console.error('❌ solid mcp exited with code', result.status);
84
+ console.error('❌ MCP server exited with code', result.status);
35
85
  process.exit(result.status ?? 1);
36
86
  }
37
- console.log('✔ solid mcp completed');
38
87
  });
39
88
  }
40
89
  //# sourceMappingURL=mcp.command.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mcp.command.js","sourceRoot":"","sources":["../../src/commands/mcp.command.ts"],"names":[],"mappings":";;AAIA,gDAsCC;AAzCD,iDAA0C;AAC1C,sCAAgD;AAEhD,SAAgB,kBAAkB,CAAC,OAAgB;IACjD,OAAO;SACJ,OAAO,CAAC,KAAK,CAAC;SACd,WAAW,CAAC,mCAAmC,CAAC;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