@spacelr/mcp 0.2.0 → 0.2.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/index.mjs +20 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1228,7 +1228,7 @@ function registerDatabaseTools(server, api) {
|
|
|
1228
1228
|
server.registerTool(
|
|
1229
1229
|
"database_collections_update_metadata",
|
|
1230
1230
|
{
|
|
1231
|
-
description: "Update a collection's realtime delivery mode, stream retention, write rate-limit override, or search filter requirements. `realtimeMode: 'stream'` switches the collection to Redis Streams for durable event replay (needed for chat, notifications, activity feeds). `realtimeMode: 'pubsub'` (default) is fire-and-forget, used for dashboards and list views. Exactly one of `streamRetention.maxLen` (approx. entry count) or `streamRetention.maxAgeMs` (retention age in ms) may be set. `writeThrottle` overrides the default per-collection write rate limit (10 writes / 10 s) \u2014 set `enabled: false` to disable entirely (e.g. audit logs), or override `limit` / `windowMs`. `searchConfig.requireFilter` declares top-level filter keys that callers MUST include in every `collection.search()` call to prevent unindexable full-scan regex queries \u2014 affects ALL callers immediately (no deprecation window). Response may include `warnings[]` if the project exceeds the 50-collection soft cap.",
|
|
1231
|
+
description: "Update a collection's realtime delivery mode, stream retention, write rate-limit override, or search filter requirements. `realtimeMode: 'stream'` switches the collection to Redis Streams for durable event replay (needed for chat, notifications, activity feeds). `realtimeMode: 'pubsub'` (default) is fire-and-forget, used for dashboards and list views. Exactly one of `streamRetention.maxLen` (approx. entry count) or `streamRetention.maxAgeMs` (retention age in ms) may be set. `writeThrottle` overrides the default per-collection write rate limit (10 writes / 10 s) \u2014 set `enabled: false` to disable entirely (e.g. audit logs), or override `limit` / `windowMs`. `searchConfig.requireFilter` declares top-level filter keys that callers MUST include in every `collection.search()` call to prevent unindexable full-scan regex queries \u2014 affects ALL callers immediately (no deprecation window). `coldTier` enables/disables archival of aged documents to object storage: set `enabled: true` with `expireField`, `expireAfterMs`, `bucketWindow` (day|week|month) and `segmentSizeBytes`; set `enabled: false` to turn it off. Enabling also triggers index creation on the collection. Response may include `warnings[]` if the project exceeds the 50-collection soft cap.",
|
|
1232
1232
|
inputSchema: {
|
|
1233
1233
|
projectId: z4.string(),
|
|
1234
1234
|
name: z4.string(),
|
|
@@ -1264,15 +1264,31 @@ function registerDatabaseTools(server, api) {
|
|
|
1264
1264
|
// have no observable effect today and may take on different
|
|
1265
1265
|
// semantics when enforcement ships. Add back once the feature
|
|
1266
1266
|
// is live.
|
|
1267
|
-
}).strict().optional()
|
|
1267
|
+
}).strict().optional(),
|
|
1268
|
+
coldTier: z4.object({
|
|
1269
|
+
enabled: z4.boolean().describe("Turn cold-tier archival on or off for this collection"),
|
|
1270
|
+
expireField: z4.string().optional().describe("Date/timestamp field that decides a document's age. Required when enabled."),
|
|
1271
|
+
expireAfterMs: z4.number().int().min(1).optional().describe("Archive documents older than this many ms (by expireField). Required when enabled."),
|
|
1272
|
+
partitionField: z4.string().nullable().optional().describe("Optional top-level field to partition segments by (e.g. tenant/room id). null = no partition."),
|
|
1273
|
+
bucketWindow: z4.enum(["day", "week", "month"]).optional().describe("Time window each segment spans. Required when enabled."),
|
|
1274
|
+
segmentSizeBytes: z4.number().int().min(1).optional().describe("Target uncompressed size of a segment before it is flushed. Required when enabled."),
|
|
1275
|
+
maxDocsPerSegment: z4.number().int().min(1).optional().describe("Optional hard cap on documents per segment."),
|
|
1276
|
+
historyPolicy: z4.enum(["full_history", "from_join_time", "from_key_epoch"]).optional().describe("Optional read-history policy for partitioned access.")
|
|
1277
|
+
}).refine(
|
|
1278
|
+
(c) => c.enabled !== true || c.expireField !== void 0 && c.expireAfterMs !== void 0 && c.bucketWindow !== void 0 && c.segmentSizeBytes !== void 0,
|
|
1279
|
+
{
|
|
1280
|
+
message: "When enabled is true, expireField, expireAfterMs, bucketWindow and segmentSizeBytes are all required"
|
|
1281
|
+
}
|
|
1282
|
+
).optional()
|
|
1268
1283
|
}
|
|
1269
1284
|
},
|
|
1270
|
-
async ({ projectId, name, realtimeMode, streamRetention, writeThrottle, searchConfig }) => {
|
|
1285
|
+
async ({ projectId, name, realtimeMode, streamRetention, writeThrottle, searchConfig, coldTier }) => {
|
|
1271
1286
|
try {
|
|
1272
1287
|
const body = {};
|
|
1273
1288
|
if (realtimeMode !== void 0) body.realtimeMode = realtimeMode;
|
|
1274
1289
|
if (streamRetention !== void 0) body.streamRetention = streamRetention;
|
|
1275
1290
|
if (writeThrottle !== void 0) body.writeThrottle = writeThrottle;
|
|
1291
|
+
if (coldTier !== void 0) body.coldTier = coldTier;
|
|
1276
1292
|
if (searchConfig !== void 0) {
|
|
1277
1293
|
const normalized = {};
|
|
1278
1294
|
if (searchConfig.requireFilter !== void 0) {
|
|
@@ -1285,7 +1301,7 @@ function registerDatabaseTools(server, api) {
|
|
|
1285
1301
|
content: [
|
|
1286
1302
|
{
|
|
1287
1303
|
type: "text",
|
|
1288
|
-
text: "At least one of realtimeMode, streamRetention, writeThrottle, or
|
|
1304
|
+
text: "At least one of realtimeMode, streamRetention, writeThrottle, searchConfig, or coldTier must be provided"
|
|
1289
1305
|
}
|
|
1290
1306
|
],
|
|
1291
1307
|
isError: true
|