@insforge/mcp 1.2.6-memory.0 → 1.2.6-memory.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.
@@ -2270,110 +2270,107 @@ To: Your current project directory
2270
2270
  }
2271
2271
  })
2272
2272
  );
2273
- const memoryEnabled = process.env.MEMORY_ENABLED === "true";
2274
- if (memoryEnabled) {
2275
- registerTool(
2273
+ registerTool(
2274
+ "store-conversation",
2275
+ "Store a conversation with messages for semantic similarity search. Messages are embedded using pgvector for later retrieval.",
2276
+ {
2277
+ apiKey: z23.string().optional().describe("API key for authentication (optional if provided via --api_key)"),
2278
+ title: z23.string().optional().describe("Optional title for the conversation"),
2279
+ metadata: z23.record(z23.unknown()).optional().describe("Optional metadata to associate with the conversation"),
2280
+ messages: z23.array(
2281
+ z23.object({
2282
+ role: z23.enum(["user", "assistant", "system", "tool"]).describe("Message role"),
2283
+ content: z23.string().describe("Message content"),
2284
+ metadata: z23.record(z23.unknown()).optional().describe("Optional message metadata")
2285
+ })
2286
+ ).min(1).describe("Array of messages to store"),
2287
+ embeddingModel: z23.string().optional().describe("Embedding model to use (uses project default if not specified)")
2288
+ },
2289
+ withUsageTracking(
2276
2290
  "store-conversation",
2277
- "Store a conversation with messages for semantic similarity search. Messages are embedded using pgvector for later retrieval.",
2278
- {
2279
- apiKey: z23.string().optional().describe("API key for authentication (optional if provided via --api_key)"),
2280
- title: z23.string().optional().describe("Optional title for the conversation"),
2281
- metadata: z23.record(z23.unknown()).optional().describe("Optional metadata to associate with the conversation"),
2282
- messages: z23.array(
2283
- z23.object({
2284
- role: z23.enum(["user", "assistant", "system", "tool"]).describe("Message role"),
2285
- content: z23.string().describe("Message content"),
2286
- metadata: z23.record(z23.unknown()).optional().describe("Optional message metadata")
2287
- })
2288
- ).min(1).describe("Array of messages to store"),
2289
- embeddingModel: z23.string().optional().describe("Embedding model to use (uses project default if not specified)")
2290
- },
2291
- withUsageTracking(
2292
- "store-conversation",
2293
- async ({ apiKey, title, metadata, messages, embeddingModel }) => {
2294
- try {
2295
- const actualApiKey = getApiKey(apiKey);
2296
- const response = await fetch2(`${API_BASE_URL}/api/memory/conversations`, {
2297
- method: "POST",
2298
- headers: {
2299
- "x-api-key": actualApiKey,
2300
- "Content-Type": "application/json"
2301
- },
2302
- body: JSON.stringify({ title, metadata, messages, embeddingModel })
2303
- });
2304
- const result = await handleApiResponse(response);
2305
- return await addBackgroundContext({
2306
- content: [
2307
- {
2308
- type: "text",
2309
- text: formatSuccessMessage("Conversation stored successfully", result)
2310
- }
2311
- ]
2312
- });
2313
- } catch (error) {
2314
- const errMsg = error instanceof Error ? error.message : "Unknown error occurred";
2315
- return {
2316
- content: [
2317
- {
2318
- type: "text",
2319
- text: `Error storing conversation: ${errMsg}`
2320
- }
2321
- ],
2322
- isError: true
2323
- };
2324
- }
2291
+ async ({ apiKey, title, metadata, messages, embeddingModel }) => {
2292
+ try {
2293
+ const actualApiKey = getApiKey(apiKey);
2294
+ const response = await fetch2(`${API_BASE_URL}/api/memory/conversations`, {
2295
+ method: "POST",
2296
+ headers: {
2297
+ "x-api-key": actualApiKey,
2298
+ "Content-Type": "application/json"
2299
+ },
2300
+ body: JSON.stringify({ title, metadata, messages, embeddingModel })
2301
+ });
2302
+ const result = await handleApiResponse(response);
2303
+ return await addBackgroundContext({
2304
+ content: [
2305
+ {
2306
+ type: "text",
2307
+ text: formatSuccessMessage("Conversation stored successfully", result)
2308
+ }
2309
+ ]
2310
+ });
2311
+ } catch (error) {
2312
+ const errMsg = error instanceof Error ? error.message : "Unknown error occurred";
2313
+ return {
2314
+ content: [
2315
+ {
2316
+ type: "text",
2317
+ text: `Error storing conversation: ${errMsg}`
2318
+ }
2319
+ ],
2320
+ isError: true
2321
+ };
2325
2322
  }
2326
- )
2327
- );
2328
- registerTool(
2323
+ }
2324
+ )
2325
+ );
2326
+ registerTool(
2327
+ "search-conversations",
2328
+ "Search for conversations by semantic similarity using pgvector. Returns conversations ranked by relevance to the query.",
2329
+ {
2330
+ apiKey: z23.string().optional().describe("API key for authentication (optional if provided via --api_key)"),
2331
+ query: z23.string().describe("Search query to find similar conversations"),
2332
+ limit: z23.number().int().positive().max(100).optional().default(10).describe("Maximum number of results to return (default: 10)"),
2333
+ threshold: z23.number().min(0).max(1).optional().default(0).describe("Minimum similarity threshold 0-1 (default: 0)"),
2334
+ metadataFilter: z23.record(z23.unknown()).optional().describe("Filter conversations by metadata (JSONB containment)"),
2335
+ embeddingModel: z23.string().optional().describe("Embedding model for the query (uses project default if not specified)")
2336
+ },
2337
+ withUsageTracking(
2329
2338
  "search-conversations",
2330
- "Search for conversations by semantic similarity using pgvector. Returns conversations ranked by relevance to the query.",
2331
- {
2332
- apiKey: z23.string().optional().describe("API key for authentication (optional if provided via --api_key)"),
2333
- query: z23.string().describe("Search query to find similar conversations"),
2334
- limit: z23.number().int().positive().max(100).optional().default(10).describe("Maximum number of results to return (default: 10)"),
2335
- threshold: z23.number().min(0).max(1).optional().default(0).describe("Minimum similarity threshold 0-1 (default: 0)"),
2336
- metadataFilter: z23.record(z23.unknown()).optional().describe("Filter conversations by metadata (JSONB containment)"),
2337
- embeddingModel: z23.string().optional().describe("Embedding model for the query (uses project default if not specified)")
2338
- },
2339
- withUsageTracking(
2340
- "search-conversations",
2341
- async ({ apiKey, query, limit, threshold, metadataFilter, embeddingModel }) => {
2342
- try {
2343
- const actualApiKey = getApiKey(apiKey);
2344
- const response = await fetch2(`${API_BASE_URL}/api/memory/search`, {
2345
- method: "POST",
2346
- headers: {
2347
- "x-api-key": actualApiKey,
2348
- "Content-Type": "application/json"
2349
- },
2350
- body: JSON.stringify({ query, limit, threshold, metadataFilter, embeddingModel })
2351
- });
2352
- const result = await handleApiResponse(response);
2353
- return await addBackgroundContext({
2354
- content: [
2355
- {
2356
- type: "text",
2357
- text: formatSuccessMessage("Conversation search completed", result)
2358
- }
2359
- ]
2360
- });
2361
- } catch (error) {
2362
- const errMsg = error instanceof Error ? error.message : "Unknown error occurred";
2363
- return {
2364
- content: [
2365
- {
2366
- type: "text",
2367
- text: `Error searching conversations: ${errMsg}`
2368
- }
2369
- ],
2370
- isError: true
2371
- };
2372
- }
2339
+ async ({ apiKey, query, limit, threshold, metadataFilter, embeddingModel }) => {
2340
+ try {
2341
+ const actualApiKey = getApiKey(apiKey);
2342
+ const response = await fetch2(`${API_BASE_URL}/api/memory/search`, {
2343
+ method: "POST",
2344
+ headers: {
2345
+ "x-api-key": actualApiKey,
2346
+ "Content-Type": "application/json"
2347
+ },
2348
+ body: JSON.stringify({ query, limit, threshold, metadataFilter, embeddingModel })
2349
+ });
2350
+ const result = await handleApiResponse(response);
2351
+ return await addBackgroundContext({
2352
+ content: [
2353
+ {
2354
+ type: "text",
2355
+ text: formatSuccessMessage("Conversation search completed", result)
2356
+ }
2357
+ ]
2358
+ });
2359
+ } catch (error) {
2360
+ const errMsg = error instanceof Error ? error.message : "Unknown error occurred";
2361
+ return {
2362
+ content: [
2363
+ {
2364
+ type: "text",
2365
+ text: `Error searching conversations: ${errMsg}`
2366
+ }
2367
+ ],
2368
+ isError: true
2369
+ };
2373
2370
  }
2374
- )
2375
- );
2376
- }
2371
+ }
2372
+ )
2373
+ );
2377
2374
  return {
2378
2375
  apiKey: GLOBAL_API_KEY,
2379
2376
  apiBaseUrl: API_BASE_URL,
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  registerInsforgeTools
4
- } from "./chunk-742PFYYV.js";
4
+ } from "./chunk-4SZSV7IV.js";
5
5
 
6
6
  // src/http/server.ts
7
7
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  registerInsforgeTools
4
- } from "./chunk-742PFYYV.js";
4
+ } from "./chunk-4SZSV7IV.js";
5
5
 
6
6
  // src/stdio/index.ts
7
7
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insforge/mcp",
3
- "version": "1.2.6-memory.0",
3
+ "version": "1.2.6-memory.1",
4
4
  "description": "MCP (Model Context Protocol) server for Insforge backend-as-a-service",
5
5
  "mcpName": "io.github.InsForge/insforge-mcp",
6
6
  "type": "module",