@lunora/mcp 1.0.0-alpha.16 → 1.0.0-alpha.18

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.md CHANGED
@@ -103,3 +103,9 @@ Unless required by applicable law or agreed to in writing, software distributed
103
103
  under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
104
104
  CONDITIONS OF ANY KIND, either express or implied. See the License for the
105
105
  specific language governing permissions and limitations under the License.
106
+
107
+ <!-- DEPENDENCIES -->
108
+ <!-- /DEPENDENCIES -->
109
+
110
+ <!-- TYPE_DEPENDENCIES -->
111
+ <!-- /TYPE_DEPENDENCIES -->
package/dist/bin.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { connectStdio } from './packem_shared/connectStdio-nl-Tt_T1.mjs';
2
+ import { connectStdio } from './packem_shared/connectStdio-mHv2dT3u.mjs';
3
3
 
4
4
  const ENABLED_ENV_VALUES = /* @__PURE__ */ new Set(["1", "on", "true", "yes"]);
5
5
  const isEnvEnabled = (value) => value !== void 0 && ENABLED_ENV_VALUES.has(value.trim().toLowerCase());
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export { connectStdio, createLunoraMcpServer } from './packem_shared/connectStdio-nl-Tt_T1.mjs';
2
- export { READ_ONLY_TOOL_DEFINITIONS, WRITE_TOOL_DEFINITIONS, callTool, toolDefinitions } from './packem_shared/READ_ONLY_TOOL_DEFINITIONS-DV2VkuuU.mjs';
1
+ export { connectStdio, createLunoraMcpServer } from './packem_shared/connectStdio-mHv2dT3u.mjs';
2
+ export { READ_ONLY_TOOL_DEFINITIONS, WRITE_TOOL_DEFINITIONS, callTool, toolDefinitions } from './packem_shared/READ_ONLY_TOOL_DEFINITIONS-B5x61zt4.mjs';
@@ -1,3 +1,5 @@
1
+ import { LunoraError } from '@lunora/errors';
2
+
1
3
  const RUN_INPUT_SCHEMA = {
2
4
  properties: {
3
5
  args: { description: "Arguments object passed to the function", type: "object" },
@@ -60,7 +62,7 @@ const toolDefinitions = (allowWrites) => (
60
62
  const readFunctionPath = (input) => {
61
63
  const { functionPath } = input;
62
64
  if (typeof functionPath !== "string" || functionPath.length === 0) {
63
- throw new Error('"functionPath" is required and must be a non-empty string');
65
+ throw new LunoraError("INTERNAL", '"functionPath" is required and must be a non-empty string');
64
66
  }
65
67
  return functionPath;
66
68
  };
@@ -83,10 +85,10 @@ const assertRunnable = async (client, functionPath, expectedKind) => {
83
85
  const functions = await client.listFunctions();
84
86
  const descriptor = functions.find((function_) => function_.path === functionPath);
85
87
  if (descriptor === void 0) {
86
- throw new Error(`function not found or not public: ${functionPath}`);
88
+ throw new LunoraError("NOT_FOUND", `function not found or not public: ${functionPath}`);
87
89
  }
88
90
  if (descriptor.kind !== expectedKind) {
89
- throw new Error(`function ${functionPath} is a ${descriptor.kind}, not a ${expectedKind}`);
91
+ throw new LunoraError("BAD_REQUEST", `function ${functionPath} is a ${descriptor.kind}, not a ${expectedKind}`);
90
92
  }
91
93
  };
92
94
  const callTool = async (client, name, input, allowWrites = false) => {
@@ -2,10 +2,11 @@ import { readFileSync } from 'node:fs';
2
2
  import { dirname, join } from 'node:path';
3
3
  import { fileURLToPath } from 'node:url';
4
4
  import { LunoraClient } from '@lunora/client';
5
+ import { LunoraError } from '@lunora/errors';
5
6
  import { Server } from '@modelcontextprotocol/sdk/server/index.js';
6
7
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
7
8
  import { ListToolsRequestSchema, CallToolRequestSchema } from '@modelcontextprotocol/sdk/types.js';
8
- import { toolDefinitions, callTool } from './READ_ONLY_TOOL_DEFINITIONS-DV2VkuuU.mjs';
9
+ import { toolDefinitions, callTool } from './READ_ONLY_TOOL_DEFINITIONS-B5x61zt4.mjs';
9
10
 
10
11
  const resolveVersion = () => {
11
12
  try {
@@ -35,7 +36,7 @@ const resolveClient = (options) => {
35
36
  return options.client;
36
37
  }
37
38
  if (options.url === void 0) {
38
- throw new Error("createLunoraMcpServer requires either a `client` or a `url`");
39
+ throw new LunoraError("INTERNAL", "createLunoraMcpServer requires either a `client` or a `url`");
39
40
  }
40
41
  const client = new LunoraClient({ fetch: options.fetch, url: options.url });
41
42
  if (options.token !== void 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/mcp",
3
- "version": "1.0.0-alpha.16",
3
+ "version": "1.0.0-alpha.18",
4
4
  "description": "Model Context Protocol server exposing a Lunora deployment to AI agents",
5
5
  "keywords": [
6
6
  "ai-agents",
@@ -49,7 +49,8 @@
49
49
  "access": "public"
50
50
  },
51
51
  "dependencies": {
52
- "@lunora/client": "1.0.0-alpha.16",
52
+ "@lunora/client": "1.0.0-alpha.18",
53
+ "@lunora/errors": "1.0.0-alpha.1",
53
54
  "@modelcontextprotocol/sdk": "^1.29.0"
54
55
  },
55
56
  "engines": {