@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.
- package/dist/{chunk-742PFYYV.js → chunk-4SZSV7IV.js} +97 -100
- package/dist/http-server.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -2270,110 +2270,107 @@ To: Your current project directory
|
|
|
2270
2270
|
}
|
|
2271
2271
|
})
|
|
2272
2272
|
);
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
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
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
})
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
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
|
-
|
|
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
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
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,
|
package/dist/http-server.js
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED