@hasna/contacts 0.6.12 → 0.6.14

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.
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>Open Contacts</title>
7
+ <script type="module" crossorigin src="/assets/index-opnZdkVD.js"></script>
8
+ <link rel="stylesheet" crossorigin href="/assets/index-0l6aQb1t.css">
9
+ </head>
10
+ <body>
11
+ <div id="root"></div>
12
+ </body>
13
+ </html>
package/dist/mcp/index.js CHANGED
@@ -11430,12 +11430,10 @@ var init_events = __esm(() => {
11430
11430
 
11431
11431
  // src/mcp/index.ts
11432
11432
  init_dist();
11433
- import { Server } from "@modelcontextprotocol/sdk/server/index.js";
11433
+ import { readFileSync as readFileSync6 } from "fs";
11434
+ import { join as join10 } from "path";
11435
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
11434
11436
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
11435
- import {
11436
- CallToolRequestSchema,
11437
- ListToolsRequestSchema
11438
- } from "@modelcontextprotocol/sdk/types.js";
11439
11437
 
11440
11438
  // src/lib/connector.ts
11441
11439
  import { join as join5 } from "path";
@@ -17882,24 +17880,29 @@ var allHandlers = {
17882
17880
  };
17883
17881
 
17884
17882
  // src/mcp/index.ts
17885
- var server = new Server({ name: "contacts", version: "0.1.0" }, { capabilities: { tools: {} } });
17886
- server.setRequestHandler(ListToolsRequestSchema, async () => ({
17887
- tools: TOOL_DEFINITIONS
17888
- }));
17889
- server.setRequestHandler(CallToolRequestSchema, async (request) => {
17890
- const { name, arguments: args } = request.params;
17891
- const a = args ?? {};
17883
+ function getServerVersion() {
17892
17884
  try {
17893
- const handler = allHandlers[name];
17894
- if (!handler) {
17895
- return { content: [{ type: "text", text: `Unknown tool: ${name}` }], isError: true };
17896
- }
17897
- return await handler(a);
17898
- } catch (err) {
17899
- const msg = err instanceof ConnectorNotInstalledError || err instanceof ConnectorAuthError ? err.message : `Error: ${err instanceof Error ? err.message : String(err)}`;
17900
- return { content: [{ type: "text", text: msg }], isError: true };
17885
+ const packageJsonPath = join10(import.meta.dir, "..", "..", "package.json");
17886
+ const pkg = JSON.parse(readFileSync6(packageJsonPath, "utf8"));
17887
+ return pkg.version ?? "0.0.0";
17888
+ } catch {
17889
+ return "0.0.0";
17901
17890
  }
17902
- });
17891
+ }
17892
+ var server = new McpServer({ name: "contacts", version: getServerVersion() });
17893
+ for (const tool of TOOL_DEFINITIONS) {
17894
+ const handler = allHandlers[tool.name];
17895
+ if (!handler)
17896
+ continue;
17897
+ server.tool(tool.name, tool.description ?? "", tool.inputSchema ?? { type: "object", properties: {} }, async (args) => {
17898
+ try {
17899
+ return await handler(args);
17900
+ } catch (err) {
17901
+ const msg = err instanceof ConnectorNotInstalledError || err instanceof ConnectorAuthError ? err.message : `Error: ${err instanceof Error ? err.message : String(err)}`;
17902
+ return { content: [{ type: "text", text: msg }], isError: true };
17903
+ }
17904
+ });
17905
+ }
17903
17906
  async function main() {
17904
17907
  const transport = new StdioServerTransport;
17905
17908
  registerCloudTools(server, "contacts");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/contacts",
3
- "version": "0.6.12",
3
+ "version": "0.6.14",
4
4
  "description": "Contact management for AI coding agents — CLI + MCP + Web",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -74,4 +74,4 @@
74
74
  "@types/react": "^18.3.18",
75
75
  "typescript": "^5.7.3"
76
76
  }
77
- }
77
+ }