@pairsystems/goodmem-mcp 0.1.11 → 0.1.12
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/README.md +3 -3
- package/dist/index.js +35 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -134,7 +134,7 @@ Inspect the built-in model registry. Shows what fields will be auto-inferred for
|
|
|
134
134
|
| `goodmem_embedders_update` | Update embedder configuration |
|
|
135
135
|
| `goodmem_embedders_delete` | Delete an embedder |
|
|
136
136
|
|
|
137
|
-
**Create parameters**: `display_name` (required), `model_identifier` (required), `credentials` (required for SaaS providers), `provider_type`, `endpoint_url`, `dimensionality` — last three auto-inferred from `model_identifier` for
|
|
137
|
+
**Create parameters**: `display_name` (required), `model_identifier` (required), `credentials` (required for SaaS providers), `provider_type`, `endpoint_url`, `dimensionality` — last three auto-inferred from `model_identifier` for known models.
|
|
138
138
|
|
|
139
139
|
### LLMs
|
|
140
140
|
|
|
@@ -146,7 +146,7 @@ Inspect the built-in model registry. Shows what fields will be auto-inferred for
|
|
|
146
146
|
| `goodmem_llms_update` | Update LLM configuration |
|
|
147
147
|
| `goodmem_llms_delete` | Delete an LLM |
|
|
148
148
|
|
|
149
|
-
**Create parameters**: `display_name` (required), `model_identifier` (required), `credentials` (required for SaaS providers) — `provider_type`, `endpoint_url`, `max_context_length` auto-inferred for
|
|
149
|
+
**Create parameters**: `display_name` (required), `model_identifier` (required), `credentials` (required for SaaS providers) — `provider_type`, `endpoint_url`, `max_context_length` auto-inferred for known models.
|
|
150
150
|
|
|
151
151
|
### Rerankers
|
|
152
152
|
|
|
@@ -158,7 +158,7 @@ Inspect the built-in model registry. Shows what fields will be auto-inferred for
|
|
|
158
158
|
| `goodmem_rerankers_update` | Update reranker configuration |
|
|
159
159
|
| `goodmem_rerankers_delete` | Delete a reranker |
|
|
160
160
|
|
|
161
|
-
**Create parameters**: `display_name` (required), `model_identifier` (required), `credentials` (required for SaaS providers) — `provider_type` and `endpoint_url` auto-inferred for
|
|
161
|
+
**Create parameters**: `display_name` (required), `model_identifier` (required), `credentials` (required for SaaS providers) — `provider_type` and `endpoint_url` auto-inferred for known models.
|
|
162
162
|
|
|
163
163
|
### Spaces
|
|
164
164
|
|
package/dist/index.js
CHANGED
|
@@ -21050,7 +21050,14 @@ async function callApiNdjson(method, path, body, query, timeoutSec) {
|
|
|
21050
21050
|
throw new Error(`GoodMem API error ${resp.status}: ${text2}`);
|
|
21051
21051
|
}
|
|
21052
21052
|
const text = await resp.text();
|
|
21053
|
-
|
|
21053
|
+
const lines = text.split("\n").map((line) => line.trim()).filter(Boolean);
|
|
21054
|
+
return lines.map((line, i) => {
|
|
21055
|
+
try {
|
|
21056
|
+
return JSON.parse(line);
|
|
21057
|
+
} catch (e) {
|
|
21058
|
+
throw new Error(`NDJSON parse error on line ${i + 1}: ${e instanceof Error ? e.message : String(e)}`);
|
|
21059
|
+
}
|
|
21060
|
+
});
|
|
21054
21061
|
}
|
|
21055
21062
|
var MODEL_REGISTRY = {
|
|
21056
21063
|
"embedders": {
|
|
@@ -21885,6 +21892,9 @@ function checkCredentialRequired(args) {
|
|
|
21885
21892
|
throw new Error(`Provider '${provider}' at '${endpointUrl}' requires credentials. Pass credentials: { kind: "CREDENTIAL_KIND_API_KEY", apiKey: { inlineSecret: "your-key-here" } }`);
|
|
21886
21893
|
}
|
|
21887
21894
|
}
|
|
21895
|
+
function camelToSnake(s) {
|
|
21896
|
+
return s.replace(/([A-Z]+)([A-Z][a-z]{2,})/g, "$1_$2").replace(/([a-z0-9])([A-Z])/g, "$1_$2").toLowerCase();
|
|
21897
|
+
}
|
|
21888
21898
|
function autoInferFromRegistry(registryType, args) {
|
|
21889
21899
|
const result = { ...args };
|
|
21890
21900
|
const modelId = result.model_identifier;
|
|
@@ -21892,9 +21902,6 @@ function autoInferFromRegistry(registryType, args) {
|
|
|
21892
21902
|
return result;
|
|
21893
21903
|
const registry2 = MODEL_REGISTRY[registryType] ?? {};
|
|
21894
21904
|
const entry = registry2[modelId];
|
|
21895
|
-
function camelToSnake(s) {
|
|
21896
|
-
return s.replace(/([A-Z]+)([A-Z][a-z]{2,})/g, "$1_$2").replace(/([a-z0-9])([A-Z])/g, "$1_$2").toLowerCase();
|
|
21897
|
-
}
|
|
21898
21905
|
if (entry) {
|
|
21899
21906
|
for (const [key, value] of Object.entries(entry)) {
|
|
21900
21907
|
const snakeKey = camelToSnake(key);
|
|
@@ -21920,7 +21927,7 @@ function autoInferFromRegistry(registryType, args) {
|
|
|
21920
21927
|
}
|
|
21921
21928
|
var server = new McpServer({
|
|
21922
21929
|
name: "goodmem",
|
|
21923
|
-
version: "0.1.
|
|
21930
|
+
version: "0.1.12"
|
|
21924
21931
|
});
|
|
21925
21932
|
server.tool("goodmem_configure", "Configure GoodMem server connection. Call this before using other GoodMem tools if GOODMEM_BASE_URL and GOODMEM_API_KEY environment variables are not set. Session credentials override environment variables.", {
|
|
21926
21933
|
base_url: external_exports.string().describe("GoodMem server URL (e.g., https://your-server.example.com)"),
|
|
@@ -21961,11 +21968,23 @@ server.tool("goodmem_lookup_model", "Look up a model in the registry to see its
|
|
|
21961
21968
|
const registry2 = MODEL_REGISTRY[registryKey] ?? {};
|
|
21962
21969
|
const entry = registry2[args.model_identifier];
|
|
21963
21970
|
if (entry) {
|
|
21971
|
+
const snakeEntry = {};
|
|
21972
|
+
for (const [k, v] of Object.entries(entry)) {
|
|
21973
|
+
if (k === "dimensions") {
|
|
21974
|
+
const dims = v;
|
|
21975
|
+
if (dims?.default !== void 0) {
|
|
21976
|
+
snakeEntry.dimensionality = dims.default;
|
|
21977
|
+
}
|
|
21978
|
+
} else {
|
|
21979
|
+
snakeEntry[camelToSnake(k)] = v;
|
|
21980
|
+
}
|
|
21981
|
+
}
|
|
21982
|
+
const providerType = entry.providerType;
|
|
21964
21983
|
return { content: [{ type: "text", text: JSON.stringify({
|
|
21965
21984
|
model_identifier: args.model_identifier,
|
|
21966
21985
|
type: label,
|
|
21967
|
-
...
|
|
21968
|
-
|
|
21986
|
+
...snakeEntry,
|
|
21987
|
+
endpoint_url: providerType ? PROVIDER_ENDPOINTS[providerType] : void 0
|
|
21969
21988
|
}, null, 2) }] };
|
|
21970
21989
|
}
|
|
21971
21990
|
}
|
|
@@ -21975,7 +21994,7 @@ ${allModels.join("\n")}` }] };
|
|
|
21975
21994
|
});
|
|
21976
21995
|
server.tool("goodmem_client_info", "Return the MCP client package version and the goodmem server commit it was built against. No server connection required.", {}, async () => {
|
|
21977
21996
|
return { content: [{ type: "text", text: JSON.stringify({
|
|
21978
|
-
mcpVersion: "0.1.
|
|
21997
|
+
mcpVersion: "0.1.12",
|
|
21979
21998
|
basedOnGoodmemCommit: BASED_ON_GOODMEM_COMMIT
|
|
21980
21999
|
}, null, 2) }] };
|
|
21981
22000
|
});
|
|
@@ -22454,7 +22473,7 @@ function registerTools() {
|
|
|
22454
22473
|
}).passthrough().describe("Chunking strategy for this memory (if not provided, uses space default)").optional(),
|
|
22455
22474
|
extractPageImages: external_exports.boolean().describe("Optional hint to extract page images for eligible document types (for example, PDFs)").optional(),
|
|
22456
22475
|
fileField: external_exports.string().describe("Optional multipart file field name to bind binary content; required when multiple files are uploaded in a batch multipart request.").optional()
|
|
22457
|
-
}).passthrough()).describe("Array of memory creation requests.")
|
|
22476
|
+
}).passthrough()).min(1).describe("Array of memory creation requests.")
|
|
22458
22477
|
}, async (args) => {
|
|
22459
22478
|
const body = {};
|
|
22460
22479
|
if (args.requests !== void 0)
|
|
@@ -22647,6 +22666,10 @@ function registerTools() {
|
|
|
22647
22666
|
name: external_exports.string().describe("Fully qualified factory class name of the post-processor to apply."),
|
|
22648
22667
|
config: external_exports.any().describe("Configuration parameters for the post-processor. Fields depend on the selected processor; see the linked documentation for the built-in ChatPostProcessor schema.").optional()
|
|
22649
22668
|
}).passthrough().describe("Optional post-processor configuration to transform retrieval results.").optional(),
|
|
22669
|
+
logging: external_exports.object({
|
|
22670
|
+
enabled: external_exports.boolean().describe("Opts this request in to durable server-side request logging."),
|
|
22671
|
+
callerAttributes: external_exports.any().describe("Optional flat scalar attributes attached to the persisted log row. Supported value types are string, integer, floating-point, and boolean.").optional()
|
|
22672
|
+
}).passthrough().describe("Optional durable request logging block for POST retrieve requests. Supply logging.enabled=true to opt in, and optionally attach flat scalar logging.callerAttributes for persisted experiment or tracing metadata.").optional(),
|
|
22650
22673
|
timeout_sec: external_exports.number().int().describe("Maximum seconds to wait for the streaming response (default: 200).").optional()
|
|
22651
22674
|
}, async (args) => {
|
|
22652
22675
|
const body = {};
|
|
@@ -22666,6 +22689,8 @@ function registerTools() {
|
|
|
22666
22689
|
body["hnsw"] = args.hnsw;
|
|
22667
22690
|
if (args.post_processor !== void 0)
|
|
22668
22691
|
body["postProcessor"] = args.post_processor;
|
|
22692
|
+
if (args.logging !== void 0)
|
|
22693
|
+
body["logging"] = args.logging;
|
|
22669
22694
|
const result = await callApiNdjson("POST", `/v1/memories:retrieve`, body, void 0, args.timeout_sec);
|
|
22670
22695
|
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
22671
22696
|
});
|
|
@@ -22847,7 +22872,7 @@ function registerTools() {
|
|
|
22847
22872
|
space_embedders: external_exports.array(external_exports.object({
|
|
22848
22873
|
embedderId: external_exports.string().describe("The UUID for the embedder to associate with the space."),
|
|
22849
22874
|
defaultRetrievalWeight: external_exports.number().describe("Relative weight for this embedder used by default during retrieval. If omitted, defaults to 1.0; values need not sum to 1 and can be overridden per request.").optional()
|
|
22850
|
-
}).passthrough()).describe("List of embedder configurations to associate with this space. At least one embedder configuration is required. Each specifies an embedder ID and a relative default retrieval weight used when no per-request overrides are provided."),
|
|
22875
|
+
}).passthrough()).min(1).describe("List of embedder configurations to associate with this space. At least one embedder configuration is required. Each specifies an embedder ID and a relative default retrieval weight used when no per-request overrides are provided."),
|
|
22851
22876
|
public_read: external_exports.boolean().describe("Indicates if the space and its memories can be read by unauthenticated users or users other than the owner. Defaults to false.").optional(),
|
|
22852
22877
|
owner_id: external_exports.string().describe("Optional owner ID. If not provided, derived from the authentication context. Requires CREATE_SPACE_ANY permission if specified.").optional(),
|
|
22853
22878
|
default_chunking_config: external_exports.object({
|