@sensigo/realm-mcp 0.23.0 → 0.25.0
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.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/json-trace-buffer-store.d.ts +18 -2
- package/dist/json-trace-buffer-store.d.ts.map +1 -1
- package/dist/json-trace-buffer-store.js +126 -30
- package/dist/json-trace-buffer-store.js.map +1 -1
- package/dist/server.js +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ export type { RealmMcpServerOptions } from './server.js';
|
|
|
3
3
|
export { generateProtocol } from './protocol/generator.js';
|
|
4
4
|
export type { WorkflowProtocol, ProtocolStep } from './protocol/generator.js';
|
|
5
5
|
export { JsonTraceBufferStore } from './json-trace-buffer-store.js';
|
|
6
|
-
export declare const VERSION = "0.
|
|
6
|
+
export declare const VERSION = "0.25.0";
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -4,5 +4,5 @@ export { generateProtocol } from './protocol/generator.js';
|
|
|
4
4
|
// issue #107: exported so the operator run-purge CLI command (packages/cli) can construct one
|
|
5
5
|
// and register it as a PerRunArtifactStore alongside JsonFileStore/FailedAttemptStore.
|
|
6
6
|
export { JsonTraceBufferStore } from './json-trace-buffer-store.js';
|
|
7
|
-
export const VERSION = '0.
|
|
7
|
+
export const VERSION = '0.25.0';
|
|
8
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { type TraceBufferStore, type BufferedEntry, type AppendResult, type PerRunArtifactStore } from '@sensigo/realm';
|
|
1
|
+
import { type TraceBufferStore, type BufferedEntry, type AppendResult, type PerRunArtifactStore, type OrphanSweepableStore, type OrphanArtifact } from '@sensigo/realm';
|
|
2
2
|
import type { AgentTraceEntry } from '@sensigo/realm';
|
|
3
3
|
/**
|
|
4
4
|
* File-based TraceBufferStore that persists WAL entries to JSONL files on disk.
|
|
5
5
|
* WAL file path: <runsDir>/trace-buffer-<runId>-<base64url(stepId)>.jsonl
|
|
6
6
|
*/
|
|
7
|
-
export declare class JsonTraceBufferStore implements TraceBufferStore, PerRunArtifactStore {
|
|
7
|
+
export declare class JsonTraceBufferStore implements TraceBufferStore, PerRunArtifactStore, OrphanSweepableStore {
|
|
8
8
|
private readonly runsDir;
|
|
9
9
|
constructor(runsDir: string);
|
|
10
10
|
private walPath;
|
|
@@ -38,5 +38,21 @@ export declare class JsonTraceBufferStore implements TraceBufferStore, PerRunArt
|
|
|
38
38
|
* yields `{}` — never a throw.
|
|
39
39
|
*/
|
|
40
40
|
readAllForRun(runId: string): Promise<Record<string, unknown[]>>;
|
|
41
|
+
/**
|
|
42
|
+
* Returns every WAL file (across all steps, all runs) whose runId is NOT in `liveRunIds`
|
|
43
|
+
* (issue #163) — candidate orphans for `realm run gc`'s remediation sweep. Does not apply an
|
|
44
|
+
* age floor or delete anything — see `OrphanSweepableStore`'s own doc for why that's the
|
|
45
|
+
* caller's job.
|
|
46
|
+
*
|
|
47
|
+
* The runId parse is fixed-length, NOT delimiter-based: a WAL filename is
|
|
48
|
+
* `trace-buffer-<36-char UUID>-<base64url(stepId)>.jsonl`, and the base64url step segment
|
|
49
|
+
* legitimately contains `-`/`_` — splitting on `-` would silently misparse the runId the
|
|
50
|
+
* moment a step name's base64url encoding starts with one of those characters. Slicing by the
|
|
51
|
+
* UUID's known fixed length (36) is unambiguous regardless of what the step segment contains.
|
|
52
|
+
*
|
|
53
|
+
* FAIL-CLOSED: `ENOENT` on `runsDir` itself → `[]`. Any OTHER `readdir`/`stat` error THROWS —
|
|
54
|
+
* never fabricate an empty/partial list, which would make a live run's WAL look orphaned.
|
|
55
|
+
*/
|
|
56
|
+
listOrphans(liveRunIds: ReadonlySet<string>): Promise<OrphanArtifact[]>;
|
|
41
57
|
}
|
|
42
58
|
//# sourceMappingURL=json-trace-buffer-store.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-trace-buffer-store.d.ts","sourceRoot":"","sources":["../src/json-trace-buffer-store.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,mBAAmB,
|
|
1
|
+
{"version":3,"file":"json-trace-buffer-store.d.ts","sourceRoot":"","sources":["../src/json-trace-buffer-store.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EAUpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAkBtD;;;GAGG;AACH,qBAAa,oBACX,YAAW,gBAAgB,EAAE,mBAAmB,EAAE,oBAAoB;IAEtE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;gBAErB,OAAO,EAAE,MAAM;IAI3B,OAAO,CAAC,OAAO;YAKD,OAAO;IA6Bf,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,YAAY,CAAC;IA6ExF,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAQ7D,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAY1D;;;;;;;OAOG;IACG,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAmCnF;;;;;;;;;;;;;;;OAeG;IACG,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;IAiDtE;;;;;;;;;;;;;;OAcG;IACG,WAAW,CAAC,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;CAiC9E"}
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
// json-trace-buffer-store.ts — File-based TraceBufferStore using JSONL WAL files.
|
|
2
2
|
import { existsSync } from 'node:fs';
|
|
3
|
-
import {
|
|
3
|
+
import { appendFile, readdir } from 'node:fs/promises';
|
|
4
4
|
import { join } from 'node:path';
|
|
5
5
|
import lockfile from 'proper-lockfile';
|
|
6
|
-
import { normalizeEntryForBuffer, BUFFER_LIMIT_COUNT, BUFFER_LIMIT_BYTES, FINAL_LIMIT_ENTRIES, FINAL_LIMIT_BYTES, } from '@sensigo/realm';
|
|
6
|
+
import { normalizeEntryForBuffer, BUFFER_LIMIT_COUNT, BUFFER_LIMIT_BYTES, FINAL_LIMIT_ENTRIES, FINAL_LIMIT_BYTES, readIfExists, deleteIfExists, statIfExists, toArtifactDeleteFailedError, } from '@sensigo/realm';
|
|
7
7
|
import { WorkflowError } from '@sensigo/realm';
|
|
8
|
+
/** WAL filename shape: `trace-buffer-<runId>-<base64url(stepId)>.jsonl`. `runId` is a
|
|
9
|
+
* server-generated UUIDv4 — always exactly 36 characters (8-4-4-4-12 hex, RFC 4122 string
|
|
10
|
+
* form) — so it can be recovered by FIXED-LENGTH slicing rather than splitting on `-`, which
|
|
11
|
+
* would break the moment a base64url step segment itself contains `-` or `_` (both are valid
|
|
12
|
+
* base64url alphabet characters). See `listOrphans` below for where this matters (issue #163). */
|
|
13
|
+
const WAL_PREFIX = 'trace-buffer-';
|
|
14
|
+
const WAL_SUFFIX = '.jsonl';
|
|
15
|
+
const RUN_ID_LENGTH = 36;
|
|
8
16
|
/**
|
|
9
17
|
* File-based TraceBufferStore that persists WAL entries to JSONL files on disk.
|
|
10
18
|
* WAL file path: <runsDir>/trace-buffer-<runId>-<base64url(stepId)>.jsonl
|
|
@@ -19,23 +27,31 @@ export class JsonTraceBufferStore {
|
|
|
19
27
|
return join(this.runsDir, `trace-buffer-${runId}-${safeStepId}.jsonl`);
|
|
20
28
|
}
|
|
21
29
|
async readWal(walPath) {
|
|
22
|
-
|
|
30
|
+
// issue #183: readIfExists distinguishes absence (undefined → empty, the pre-existing
|
|
31
|
+
// behavior) from a genuine I/O failure (now propagates). The old whole-buffer catch treated
|
|
32
|
+
// BOTH a real I/O failure AND a single torn/partial line (e.g. a crash mid-appendFile — the
|
|
33
|
+
// abandoned-agent scenario) as "corrupted WAL, discard everything" — losing every earlier,
|
|
34
|
+
// perfectly good line to one partial write. Per-line parsing below (mirroring
|
|
35
|
+
// readAllForRun's discipline) skips only the bad line and keeps the rest.
|
|
36
|
+
const content = await readIfExists(walPath);
|
|
37
|
+
if (content === undefined) {
|
|
23
38
|
return { count: 0, bytes: 0, lines: [] };
|
|
24
39
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
// Treat corrupted WAL as empty.
|
|
37
|
-
return { count: 0, bytes: 0, lines: [] };
|
|
40
|
+
const lines = [];
|
|
41
|
+
for (const raw of content.split('\n')) {
|
|
42
|
+
const trimmed = raw.trim();
|
|
43
|
+
if (trimmed.length === 0)
|
|
44
|
+
continue;
|
|
45
|
+
try {
|
|
46
|
+
lines.push(JSON.parse(trimmed));
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
console.warn(`⚠ realm: skipping unparseable trace-buffer WAL line in '${walPath}'`);
|
|
50
|
+
}
|
|
38
51
|
}
|
|
52
|
+
const count = lines.reduce((acc, l) => acc + l.entries.length, 0);
|
|
53
|
+
const bytes = Buffer.byteLength(content);
|
|
54
|
+
return { count, bytes, lines };
|
|
39
55
|
}
|
|
40
56
|
async append(runId, stepId, entries) {
|
|
41
57
|
const walPath = this.walPath(runId, stepId);
|
|
@@ -108,8 +124,15 @@ export class JsonTraceBufferStore {
|
|
|
108
124
|
return lines.flatMap((line) => line.entries.map((entry) => ({ ...entry, _internalTs: line.ts })));
|
|
109
125
|
}
|
|
110
126
|
async delete(runId, stepId) {
|
|
127
|
+
// issue #183: this single-step cleanup is best-effort BY CONVENTION at every call site (all
|
|
128
|
+
// four callers — execution-loop.ts ×3, reclaim-step.ts ×1 — already wrap this call in their
|
|
129
|
+
// own try/catch that converts a failure into a warning, never treating success as load-bearing
|
|
130
|
+
// the way deleteAllForRun/purge do). Converting the raw unlink to deleteIfExists here doesn't
|
|
131
|
+
// change that contract (delete() can still fail — callers already expect and handle it); it
|
|
132
|
+
// just stops a real I/O error from being invisibly swallowed with NO signal at all, which the
|
|
133
|
+
// source-text guard (store-fs-guard.test.ts) also requires (no raw unlink in this file).
|
|
111
134
|
const walPath = this.walPath(runId, stepId);
|
|
112
|
-
await
|
|
135
|
+
await deleteIfExists(walPath);
|
|
113
136
|
}
|
|
114
137
|
/**
|
|
115
138
|
* Deletes every orphaned WAL file for `runId` (issue #107).
|
|
@@ -129,13 +152,32 @@ export class JsonTraceBufferStore {
|
|
|
129
152
|
try {
|
|
130
153
|
files = await readdir(this.runsDir);
|
|
131
154
|
}
|
|
132
|
-
catch {
|
|
133
|
-
|
|
155
|
+
catch (err) {
|
|
156
|
+
if (err.code === 'ENOENT') {
|
|
157
|
+
files = []; // runsDir itself absent → nothing to delete, success
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
throw toArtifactDeleteFailedError(runId, 'JsonTraceBufferStore', [], this.runsDir, err);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
// SORTED candidates — deterministic residue (which artifact fails first is reproducible
|
|
165
|
+
// across retries/tests, not dependent on readdir's unspecified ordering).
|
|
166
|
+
const matching = [...files].filter((f) => f.startsWith(prefix) && f.endsWith('.jsonl')).sort();
|
|
167
|
+
const deleted = [];
|
|
168
|
+
for (const file of matching) {
|
|
169
|
+
const path = join(this.runsDir, file);
|
|
170
|
+
try {
|
|
171
|
+
const didDelete = await deleteIfExists(path);
|
|
172
|
+
if (didDelete)
|
|
173
|
+
deleted.push(file);
|
|
174
|
+
}
|
|
175
|
+
catch (err) {
|
|
176
|
+
// Sequential stop-on-first-hard-error: don't attempt the remaining candidates once one
|
|
177
|
+
// has genuinely failed — report exactly what succeeded before the failure.
|
|
178
|
+
throw toArtifactDeleteFailedError(runId, 'JsonTraceBufferStore', deleted, file, err);
|
|
134
179
|
}
|
|
135
180
|
}
|
|
136
|
-
await Promise.all(files
|
|
137
|
-
.filter((f) => f.startsWith(prefix) && f.endsWith('.jsonl'))
|
|
138
|
-
.map((f) => unlink(join(this.runsDir, f)).catch(() => { })));
|
|
139
181
|
}
|
|
140
182
|
/**
|
|
141
183
|
* Reads every WAL file for `runId` across all steps — the read-only counterpart to
|
|
@@ -159,8 +201,11 @@ export class JsonTraceBufferStore {
|
|
|
159
201
|
try {
|
|
160
202
|
files = await readdir(this.runsDir);
|
|
161
203
|
}
|
|
162
|
-
catch {
|
|
163
|
-
|
|
204
|
+
catch (err) {
|
|
205
|
+
if (err.code === 'ENOENT') {
|
|
206
|
+
return {}; // runsDir itself absent → no WAL for anyone, not just this run
|
|
207
|
+
}
|
|
208
|
+
throw err;
|
|
164
209
|
}
|
|
165
210
|
const result = {};
|
|
166
211
|
const matching = files.filter((f) => f.startsWith(prefix) && f.endsWith('.jsonl'));
|
|
@@ -173,12 +218,12 @@ export class JsonTraceBufferStore {
|
|
|
173
218
|
catch {
|
|
174
219
|
continue; // malformed filename — skip this one file, not the whole export
|
|
175
220
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
continue;
|
|
221
|
+
// issue #183: readIfExists discriminates ENOENT (vanished between readdir and this read — a
|
|
222
|
+
// benign race, skip) from a genuine I/O failure (now throws, rather than being silently
|
|
223
|
+
// treated the same as the benign-vanished case).
|
|
224
|
+
const content = await readIfExists(join(this.runsDir, file));
|
|
225
|
+
if (content === undefined) {
|
|
226
|
+
continue;
|
|
182
227
|
}
|
|
183
228
|
const lines = [];
|
|
184
229
|
for (const raw of content.split('\n')) {
|
|
@@ -196,5 +241,56 @@ export class JsonTraceBufferStore {
|
|
|
196
241
|
}
|
|
197
242
|
return result;
|
|
198
243
|
}
|
|
244
|
+
/**
|
|
245
|
+
* Returns every WAL file (across all steps, all runs) whose runId is NOT in `liveRunIds`
|
|
246
|
+
* (issue #163) — candidate orphans for `realm run gc`'s remediation sweep. Does not apply an
|
|
247
|
+
* age floor or delete anything — see `OrphanSweepableStore`'s own doc for why that's the
|
|
248
|
+
* caller's job.
|
|
249
|
+
*
|
|
250
|
+
* The runId parse is fixed-length, NOT delimiter-based: a WAL filename is
|
|
251
|
+
* `trace-buffer-<36-char UUID>-<base64url(stepId)>.jsonl`, and the base64url step segment
|
|
252
|
+
* legitimately contains `-`/`_` — splitting on `-` would silently misparse the runId the
|
|
253
|
+
* moment a step name's base64url encoding starts with one of those characters. Slicing by the
|
|
254
|
+
* UUID's known fixed length (36) is unambiguous regardless of what the step segment contains.
|
|
255
|
+
*
|
|
256
|
+
* FAIL-CLOSED: `ENOENT` on `runsDir` itself → `[]`. Any OTHER `readdir`/`stat` error THROWS —
|
|
257
|
+
* never fabricate an empty/partial list, which would make a live run's WAL look orphaned.
|
|
258
|
+
*/
|
|
259
|
+
async listOrphans(liveRunIds) {
|
|
260
|
+
let entries;
|
|
261
|
+
try {
|
|
262
|
+
entries = await readdir(this.runsDir);
|
|
263
|
+
}
|
|
264
|
+
catch (err) {
|
|
265
|
+
if (err.code === 'ENOENT')
|
|
266
|
+
return [];
|
|
267
|
+
throw err;
|
|
268
|
+
}
|
|
269
|
+
const orphans = [];
|
|
270
|
+
for (const name of entries) {
|
|
271
|
+
if (!name.startsWith(WAL_PREFIX) || !name.endsWith(WAL_SUFFIX))
|
|
272
|
+
continue;
|
|
273
|
+
// Everything between the fixed prefix and suffix is "<uuid>-<b64url step>" — slice the
|
|
274
|
+
// UUID off by its KNOWN length, then require the very next character to be the '-'
|
|
275
|
+
// separator `walPath` always writes. A name that's too short, or missing that separator
|
|
276
|
+
// at exactly this position, is malformed (never produced by this store) — skip it rather
|
|
277
|
+
// than guess.
|
|
278
|
+
const afterPrefix = name.slice(WAL_PREFIX.length, -WAL_SUFFIX.length);
|
|
279
|
+
if (afterPrefix.length <= RUN_ID_LENGTH || afterPrefix[RUN_ID_LENGTH] !== '-')
|
|
280
|
+
continue;
|
|
281
|
+
const runId = afterPrefix.slice(0, RUN_ID_LENGTH);
|
|
282
|
+
if (liveRunIds.has(runId))
|
|
283
|
+
continue;
|
|
284
|
+
const path = join(this.runsDir, name);
|
|
285
|
+
// #183 discipline: statIfExists returns undefined only on ENOENT (a benign vanished-
|
|
286
|
+
// between-readdir-and-stat race — skip it); any other errno throws, aborting the WHOLE
|
|
287
|
+
// sweep (fail-closed) rather than silently omitting this one artifact.
|
|
288
|
+
const info = await statIfExists(path);
|
|
289
|
+
if (info === undefined)
|
|
290
|
+
continue;
|
|
291
|
+
orphans.push({ path, runId, mtimeMs: info.mtimeMs });
|
|
292
|
+
}
|
|
293
|
+
return orphans;
|
|
294
|
+
}
|
|
199
295
|
}
|
|
200
296
|
//# sourceMappingURL=json-trace-buffer-store.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-trace-buffer-store.js","sourceRoot":"","sources":["../src/json-trace-buffer-store.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"json-trace-buffer-store.js","sourceRoot":"","sources":["../src/json-trace-buffer-store.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,OAA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AAM,IAAI,IAAI,OAAO,EAAE,CAAC;YAC3B,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC;gBAAE,SAAS;YAEzE,uFAAuF;YACvF,mFAAmF;YACnF,wFAAwF;YACxF,yFAAyF;YACzF,cAAc;YACd,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;YACtE,IAAI,WAAW,CAAC,MAAM,IAAI,aAAa,IAAI,WAAW,CAAC,aAAa,CAAC,KAAK,GAAG;gBAAE,SAAS;YACxF,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC;YAClD,IAAI,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC;gBAAE,SAAS;YAEpC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YACtC,qFAAqF;YACrF,uFAAuF;YACvF,uEAAuE;YACvE,MAAM,IAAI,GAAG,MAAM,YAAY,CAAC,IAAI,CAAC,CAAC;YACtC,IAAI,IAAI,KAAK,SAAS;gBAAE,SAAS;YACjC,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;QACvD,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;CACF"}
|
package/dist/server.js
CHANGED
|
@@ -42,7 +42,7 @@ export { createDefaultRegistry };
|
|
|
42
42
|
export function createRealmMcpServer(options) {
|
|
43
43
|
const server = new McpServer({
|
|
44
44
|
name: 'realm',
|
|
45
|
-
version: '0.
|
|
45
|
+
version: '0.25.0',
|
|
46
46
|
});
|
|
47
47
|
// When no registry is provided, use the default registry that pre-registers built-in
|
|
48
48
|
// adapters. When a registry is provided, the caller is responsible for its contents.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sensigo/realm-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@modelcontextprotocol/sdk": "1.29.0",
|
|
49
|
-
"@sensigo/realm": "^0.
|
|
49
|
+
"@sensigo/realm": "^0.25.0",
|
|
50
50
|
"zod": "^3.25.7"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|