@agentage/server-memory 0.7.0 → 0.9.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/README.md +16 -0
- package/dist/bin/server-memory.js +33 -4
- package/dist/bin/server-memory.js.map +1 -1
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -32,6 +32,22 @@ import { createMemoryServer, loadLocalServer } from '@agentage/server-memory';
|
|
|
32
32
|
// await server.connect(new StreamableHTTPServerTransport(...));
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
+
## Telemetry (optional, off by default)
|
|
36
|
+
|
|
37
|
+
Nothing is collected and nothing extra is installed: `@agentage/observability` is **not** a
|
|
38
|
+
dependency, because `npx @agentage/server-memory` should stay a small cold start. Install the kit
|
|
39
|
+
alongside and the bin picks it up on its own - traces and one wide event per tool call:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npm i -g @agentage/observability # or just use the agentage CLI, which ships with it
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Absent, the server behaves exactly as before (`AGENTAGE_DEBUG=1` prints one stderr line saying the
|
|
46
|
+
kit was not found). Present, it is still inert until `OTEL_EXPORTER_OTLP_ENDPOINT` names a
|
|
47
|
+
collector; `OTEL_SERVICE_NAME` defaults to `agentage-server-memory`. Either way **stdout carries
|
|
48
|
+
only JSON-RPC** - every kit line goes to stderr, which `test/observability.test.ts` asserts in both
|
|
49
|
+
directions.
|
|
50
|
+
|
|
35
51
|
## Develop
|
|
36
52
|
|
|
37
53
|
```bash
|
|
@@ -6,16 +6,45 @@
|
|
|
6
6
|
// memory-core server to a StdioServerTransport.
|
|
7
7
|
//
|
|
8
8
|
// stdout is the JSON-RPC wire; all diagnostics MUST go to stderr.
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
const reason = (err) => (err instanceof Error ? err.message : String(err));
|
|
10
|
+
// Optional observability. @agentage/observability is deliberately NOT a dependency: this package is
|
|
11
|
+
// run through `npx`, and the kit would triple a cold start's install. Installed alongside (global,
|
|
12
|
+
// or via the agentage CLI) its bootstrap adds tool spans, wide events and crash capture; absent, it
|
|
13
|
+
// is a silent skip. Either way stdout stays the JSON-RPC wire - the kit logs to stderr only, and
|
|
14
|
+
// stays inert until OTEL_EXPORTER_OTLP_ENDPOINT names a collector.
|
|
15
|
+
const startObservability = async () => {
|
|
16
|
+
// The kit (1.0.0) announces an enabled tracer with one console.log, which on this process would
|
|
17
|
+
// land mid-handshake on the JSON-RPC wire. Divert stdout to stderr while it boots; drop this once
|
|
18
|
+
// the kit writes that line to stderr itself.
|
|
19
|
+
const stdoutWrite = process.stdout.write;
|
|
20
|
+
process.stdout.write = process.stderr.write.bind(process.stderr);
|
|
21
|
+
try {
|
|
22
|
+
if (!process.env.OTEL_SERVICE_NAME)
|
|
23
|
+
process.env.OTEL_SERVICE_NAME = 'agentage-server-memory';
|
|
24
|
+
await import('@agentage/observability/bootstrap');
|
|
25
|
+
}
|
|
26
|
+
catch (err) {
|
|
27
|
+
if (process.env.AGENTAGE_DEBUG) {
|
|
28
|
+
process.stderr.write(`[server-memory] observability off: ${reason(err)}\n`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
finally {
|
|
32
|
+
process.stdout.write = stdoutWrite;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
// Loaded behind the bootstrap, not at the top: the kit instruments MCP tool registration through
|
|
36
|
+
// module hooks, which only see a module imported after they are registered.
|
|
37
|
+
await startObservability();
|
|
38
|
+
const { StdioServerTransport } = await import('@modelcontextprotocol/sdk/server/stdio.js');
|
|
39
|
+
const { loadLocalServer } = await import('../server/local-server.js');
|
|
11
40
|
const main = async () => {
|
|
12
41
|
const server = await loadLocalServer();
|
|
13
42
|
await server.connect(new StdioServerTransport());
|
|
14
43
|
// The transport keeps the process alive until the client disconnects (stdin EOF).
|
|
15
44
|
};
|
|
16
45
|
main().catch((err) => {
|
|
17
|
-
|
|
18
|
-
process.stderr.write(`[server-memory] fatal: ${message}\n`);
|
|
46
|
+
process.stderr.write(`[server-memory] fatal: ${reason(err)}\n`);
|
|
19
47
|
process.exit(1);
|
|
20
48
|
});
|
|
49
|
+
export {};
|
|
21
50
|
//# sourceMappingURL=server-memory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-memory.js","sourceRoot":"","sources":["../../src/bin/server-memory.ts"],"names":[],"mappings":";AACA,kFAAkF;AAClF,qEAAqE;AACrE,qFAAqF;AACrF,sFAAsF;AACtF,gDAAgD;AAChD,EAAE;AACF,kEAAkE;AAElE,
|
|
1
|
+
{"version":3,"file":"server-memory.js","sourceRoot":"","sources":["../../src/bin/server-memory.ts"],"names":[],"mappings":";AACA,kFAAkF;AAClF,qEAAqE;AACrE,qFAAqF;AACrF,sFAAsF;AACtF,gDAAgD;AAChD,EAAE;AACF,kEAAkE;AAElE,MAAM,MAAM,GAAG,CAAC,GAAY,EAAU,EAAE,CAAC,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AAE5F,oGAAoG;AACpG,mGAAmG;AACnG,oGAAoG;AACpG,iGAAiG;AACjG,mEAAmE;AACnE,MAAM,kBAAkB,GAAG,KAAK,IAAmB,EAAE;IACnD,gGAAgG;IAChG,kGAAkG;IAClG,6CAA6C;IAC7C,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC;IACzC,OAAO,CAAC,MAAM,CAAC,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAgC,CAAC;IAChG,IAAI,CAAC;QACH,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB;YAAE,OAAO,CAAC,GAAG,CAAC,iBAAiB,GAAG,wBAAwB,CAAC;QAC7F,MAAM,MAAM,CAAC,mCAAmC,CAAC,CAAC;IACpD,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,CAAC;YAC/B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,sCAAsC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC9E,CAAC;IACH,CAAC;YAAS,CAAC;QACT,OAAO,CAAC,MAAM,CAAC,KAAK,GAAG,WAAW,CAAC;IACrC,CAAC;AACH,CAAC,CAAC;AAEF,iGAAiG;AACjG,4EAA4E;AAC5E,MAAM,kBAAkB,EAAE,CAAC;AAC3B,MAAM,EAAE,oBAAoB,EAAE,GAAG,MAAM,MAAM,CAAC,2CAA2C,CAAC,CAAC;AAC3F,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,MAAM,CAAC,2BAA2B,CAAC,CAAC;AAEtE,MAAM,IAAI,GAAG,KAAK,IAAmB,EAAE;IACrC,MAAM,MAAM,GAAG,MAAM,eAAe,EAAE,CAAC;IACvC,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,oBAAoB,EAAE,CAAC,CAAC;IACjD,kFAAkF;AACpF,CAAC,CAAC;AAEF,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;IAC5B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,0BAA0B,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAChE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentage/server-memory",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "The agentage Memory MCP server: exposes your local vaults as the frozen 6 memory__* tools over stdio. The open, cross-vendor counterpart to @modelcontextprotocol/server-memory.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -46,6 +46,8 @@
|
|
|
46
46
|
"zod": "^4.4.3"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
+
"@agentage/observability": "^1.2.0",
|
|
50
|
+
"@opentelemetry/api": "^1.9.1",
|
|
49
51
|
"@types/node": "^26.1.2",
|
|
50
52
|
"@typescript-eslint/eslint-plugin": "^8.18.0",
|
|
51
53
|
"@typescript-eslint/parser": "^8.18.0",
|