opencode-graphiti 0.1.4 → 0.1.5
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 +10 -17
- package/esm/deno.d.ts +47 -0
- package/esm/deno.d.ts.map +1 -0
- package/esm/deno.js +41 -0
- package/esm/src/services/client.d.ts.map +1 -1
- package/esm/src/services/client.js +9 -2
- package/package.json +24 -1
- package/script/deno.d.ts +47 -0
- package/script/deno.d.ts.map +1 -0
- package/script/deno.js +43 -0
- package/script/src/services/client.d.ts.map +1 -1
- package/script/src/services/client.js +12 -2
package/README.md
CHANGED
|
@@ -101,7 +101,7 @@ Create a config file at `~/.config/opencode/graphiti.jsonc`:
|
|
|
101
101
|
// Graphiti MCP server endpoint
|
|
102
102
|
"endpoint": "http://localhost:8000/mcp",
|
|
103
103
|
|
|
104
|
-
// Prefix for project group IDs (e.g. "
|
|
104
|
+
// Prefix for project group IDs (e.g. "opencode-my-project")
|
|
105
105
|
"groupIdPrefix": "opencode",
|
|
106
106
|
|
|
107
107
|
// Number of user messages between memory re-injections (0 = disabled)
|
|
@@ -118,8 +118,12 @@ values.
|
|
|
118
118
|
|
|
119
119
|
On the first user message in a session, the plugin searches Graphiti for facts
|
|
120
120
|
and entities relevant to the message content. Results are split into project and
|
|
121
|
-
user scopes (70% / 30% budget split), formatted
|
|
122
|
-
|
|
121
|
+
user scopes (70% / 30% budget split), formatted in XML-style `<memory>` blocks
|
|
122
|
+
with explicit de-emphasis instructions, and injected into the conversation.
|
|
123
|
+
|
|
124
|
+
Memory is injected via `output.message.system` (system-level instruction) when
|
|
125
|
+
available, which prevents memory from influencing session titles. If the system
|
|
126
|
+
field is unavailable, the plugin falls back to prepending synthetic parts.
|
|
123
127
|
|
|
124
128
|
The injection budget is calculated dynamically: 5% of the model's context limit
|
|
125
129
|
(resolved from the provider list) multiplied by 4 characters per token.
|
|
@@ -167,21 +171,10 @@ Each project gets a unique `group_id` derived from its directory name (e.g.
|
|
|
167
171
|
underscores (colons are not allowed). This ensures memories from different
|
|
168
172
|
projects stay isolated.
|
|
169
173
|
|
|
170
|
-
##
|
|
171
|
-
|
|
172
|
-
```bash
|
|
173
|
-
# Format
|
|
174
|
-
deno fmt
|
|
175
|
-
|
|
176
|
-
# Lint
|
|
177
|
-
deno lint
|
|
174
|
+
## Contributing
|
|
178
175
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
# Build
|
|
183
|
-
deno task build
|
|
184
|
-
```
|
|
176
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and release
|
|
177
|
+
process.
|
|
185
178
|
|
|
186
179
|
## License
|
|
187
180
|
|
package/esm/deno.d.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export let name: string;
|
|
3
|
+
export let description: string;
|
|
4
|
+
export let version: string;
|
|
5
|
+
export let license: string;
|
|
6
|
+
export namespace tasks {
|
|
7
|
+
let build: string;
|
|
8
|
+
namespace deploy {
|
|
9
|
+
let command: string;
|
|
10
|
+
let dependencies: string[];
|
|
11
|
+
}
|
|
12
|
+
let dev: string;
|
|
13
|
+
let check: string;
|
|
14
|
+
let lint: string;
|
|
15
|
+
let fmt: string;
|
|
16
|
+
}
|
|
17
|
+
export namespace lint_1 {
|
|
18
|
+
let exclude: string[];
|
|
19
|
+
namespace rules {
|
|
20
|
+
let exclude_1: string[];
|
|
21
|
+
export { exclude_1 as exclude };
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export { lint_1 as lint };
|
|
25
|
+
export namespace fmt_1 {
|
|
26
|
+
let exclude_2: string[];
|
|
27
|
+
export { exclude_2 as exclude };
|
|
28
|
+
}
|
|
29
|
+
export { fmt_1 as fmt };
|
|
30
|
+
export namespace compilerOptions {
|
|
31
|
+
let strict: boolean;
|
|
32
|
+
let lib: string[];
|
|
33
|
+
}
|
|
34
|
+
export let nodeModulesDir: string;
|
|
35
|
+
export let imports: {
|
|
36
|
+
"@modelcontextprotocol/sdk": string;
|
|
37
|
+
"@opencode-ai/plugin": string;
|
|
38
|
+
"@opencode-ai/sdk": string;
|
|
39
|
+
cosmiconfig: string;
|
|
40
|
+
zod: string;
|
|
41
|
+
};
|
|
42
|
+
export let exports: {
|
|
43
|
+
".": string;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export default _default;
|
|
47
|
+
//# sourceMappingURL=deno.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deno.d.ts","sourceRoot":"","sources":["../src/deno.js"],"names":[],"mappings":""}
|
package/esm/deno.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
"name": "opencode-graphiti",
|
|
3
|
+
"description": "OpenCode plugin for persistent memory via Graphiti knowledge graph",
|
|
4
|
+
"version": "0.0.0-development",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"tasks": {
|
|
7
|
+
"build": "deno run -A dnt.ts",
|
|
8
|
+
"deploy": {
|
|
9
|
+
"command": "cd dist/ && npm publish",
|
|
10
|
+
"dependencies": ["build"]
|
|
11
|
+
},
|
|
12
|
+
"dev": "deno run --allow-all src/index.ts",
|
|
13
|
+
"check": "deno check src/index.ts",
|
|
14
|
+
"lint": "deno lint",
|
|
15
|
+
"fmt": "deno fmt"
|
|
16
|
+
},
|
|
17
|
+
"lint": {
|
|
18
|
+
"exclude": ["dist/"],
|
|
19
|
+
"rules": {
|
|
20
|
+
"exclude": ["no-import-prefix"]
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"fmt": {
|
|
24
|
+
"exclude": ["dist/"]
|
|
25
|
+
},
|
|
26
|
+
"compilerOptions": {
|
|
27
|
+
"strict": true,
|
|
28
|
+
"lib": ["deno.ns", "dom", "esnext"]
|
|
29
|
+
},
|
|
30
|
+
"nodeModulesDir": "auto",
|
|
31
|
+
"imports": {
|
|
32
|
+
"@modelcontextprotocol/sdk": "npm:@modelcontextprotocol/sdk@^1.25.2",
|
|
33
|
+
"@opencode-ai/plugin": "npm:@opencode-ai/plugin@^1.1.53",
|
|
34
|
+
"@opencode-ai/sdk": "npm:@opencode-ai/sdk@^1.1.53",
|
|
35
|
+
"cosmiconfig": "npm:cosmiconfig@9.0.0",
|
|
36
|
+
"zod": "npm:zod@4.3.6"
|
|
37
|
+
},
|
|
38
|
+
"exports": {
|
|
39
|
+
".": "./mod.ts"
|
|
40
|
+
}
|
|
41
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/src/services/client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/src/services/client.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,YAAY,EAEZ,YAAY,EAEb,MAAM,mBAAmB,CAAC;AAG3B;;;GAGG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,SAAS,CAAgC;IACjD,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,QAAQ,CAAS;IAEzB;;OAEG;gBACS,QAAQ,EAAE,MAAM;IAS5B,oDAAoD;IACpD,OAAO,CAAC,wBAAwB;IAUhC;;;OAGG;IACG,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC;IAgBjC;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;YAOnB,QAAQ;IAkCtB,OAAO,CAAC,gBAAgB;YASV,SAAS;IAavB;;;OAGG;IACH,eAAe,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO;IAyBzC;;OAEG;IACG,UAAU,CAAC,MAAM,EAAE;QACvB,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;QACrC,iBAAiB,CAAC,EAAE,MAAM,CAAC;KAC5B,GAAG,OAAO,CAAC,IAAI,CAAC;IAWjB;;OAEG;IACG,WAAW,CAAC,MAAM,EAAE;QACxB,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAsB3B;;OAEG;IACG,WAAW,CAAC,MAAM,EAAE;QACxB,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAsB3B;;OAEG;IACG,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC;CAQpC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
2
2
|
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
|
|
3
|
+
import manifest from "../../deno.js";
|
|
3
4
|
import { logger } from "./logger.js";
|
|
4
5
|
/**
|
|
5
6
|
* Graphiti MCP client wrapper for connecting, querying,
|
|
@@ -35,12 +36,18 @@ export class GraphitiClient {
|
|
|
35
36
|
value: void 0
|
|
36
37
|
});
|
|
37
38
|
this.endpoint = endpoint;
|
|
38
|
-
this.client = new Client({
|
|
39
|
+
this.client = new Client({
|
|
40
|
+
name: manifest.name,
|
|
41
|
+
version: manifest.version,
|
|
42
|
+
});
|
|
39
43
|
this.transport = new StreamableHTTPClientTransport(new URL(endpoint));
|
|
40
44
|
}
|
|
41
45
|
/** Create a fresh MCP Client and Transport pair. */
|
|
42
46
|
createClientAndTransport() {
|
|
43
|
-
this.client = new Client({
|
|
47
|
+
this.client = new Client({
|
|
48
|
+
name: manifest.name,
|
|
49
|
+
version: manifest.version,
|
|
50
|
+
});
|
|
44
51
|
this.transport = new StreamableHTTPClientTransport(new URL(this.endpoint));
|
|
45
52
|
}
|
|
46
53
|
/**
|
package/package.json
CHANGED
|
@@ -1,10 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-graphiti",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "OpenCode plugin for persistent memory via Graphiti knowledge graph",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"opencode",
|
|
7
|
+
"graphiti",
|
|
8
|
+
"knowledge-graph",
|
|
9
|
+
"persistent-memory",
|
|
10
|
+
"plugin",
|
|
11
|
+
"mcp",
|
|
12
|
+
"ai",
|
|
13
|
+
"context"
|
|
14
|
+
],
|
|
15
|
+
"author": "Vicary A. <vicary.archangel@member.mensa.org>",
|
|
16
|
+
"homepage": "https://github.com/vicary/opencode-graphiti#readme",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/vicary/opencode-graphiti.git"
|
|
20
|
+
},
|
|
5
21
|
"license": "MIT",
|
|
22
|
+
"bugs": {
|
|
23
|
+
"url": "https://github.com/vicary/opencode-graphiti/issues"
|
|
24
|
+
},
|
|
6
25
|
"main": "./esm/mod.js",
|
|
7
26
|
"module": "./esm/mod.js",
|
|
27
|
+
"types": "./esm/mod.d.ts",
|
|
8
28
|
"exports": {
|
|
9
29
|
".": {
|
|
10
30
|
"import": "./esm/mod.js",
|
|
@@ -12,6 +32,9 @@
|
|
|
12
32
|
}
|
|
13
33
|
},
|
|
14
34
|
"scripts": {},
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">=20"
|
|
37
|
+
},
|
|
15
38
|
"opencode": {
|
|
16
39
|
"type": "plugin",
|
|
17
40
|
"hooks": [
|
package/script/deno.d.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export let name: string;
|
|
3
|
+
export let description: string;
|
|
4
|
+
export let version: string;
|
|
5
|
+
export let license: string;
|
|
6
|
+
export namespace tasks {
|
|
7
|
+
let build: string;
|
|
8
|
+
namespace deploy {
|
|
9
|
+
let command: string;
|
|
10
|
+
let dependencies: string[];
|
|
11
|
+
}
|
|
12
|
+
let dev: string;
|
|
13
|
+
let check: string;
|
|
14
|
+
let lint: string;
|
|
15
|
+
let fmt: string;
|
|
16
|
+
}
|
|
17
|
+
export namespace lint_1 {
|
|
18
|
+
let exclude: string[];
|
|
19
|
+
namespace rules {
|
|
20
|
+
let exclude_1: string[];
|
|
21
|
+
export { exclude_1 as exclude };
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export { lint_1 as lint };
|
|
25
|
+
export namespace fmt_1 {
|
|
26
|
+
let exclude_2: string[];
|
|
27
|
+
export { exclude_2 as exclude };
|
|
28
|
+
}
|
|
29
|
+
export { fmt_1 as fmt };
|
|
30
|
+
export namespace compilerOptions {
|
|
31
|
+
let strict: boolean;
|
|
32
|
+
let lib: string[];
|
|
33
|
+
}
|
|
34
|
+
export let nodeModulesDir: string;
|
|
35
|
+
export let imports: {
|
|
36
|
+
"@modelcontextprotocol/sdk": string;
|
|
37
|
+
"@opencode-ai/plugin": string;
|
|
38
|
+
"@opencode-ai/sdk": string;
|
|
39
|
+
cosmiconfig: string;
|
|
40
|
+
zod: string;
|
|
41
|
+
};
|
|
42
|
+
export let exports: {
|
|
43
|
+
".": string;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export default _default;
|
|
47
|
+
//# sourceMappingURL=deno.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deno.d.ts","sourceRoot":"","sources":["../src/deno.js"],"names":[],"mappings":""}
|
package/script/deno.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = {
|
|
4
|
+
"name": "opencode-graphiti",
|
|
5
|
+
"description": "OpenCode plugin for persistent memory via Graphiti knowledge graph",
|
|
6
|
+
"version": "0.0.0-development",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"tasks": {
|
|
9
|
+
"build": "deno run -A dnt.ts",
|
|
10
|
+
"deploy": {
|
|
11
|
+
"command": "cd dist/ && npm publish",
|
|
12
|
+
"dependencies": ["build"]
|
|
13
|
+
},
|
|
14
|
+
"dev": "deno run --allow-all src/index.ts",
|
|
15
|
+
"check": "deno check src/index.ts",
|
|
16
|
+
"lint": "deno lint",
|
|
17
|
+
"fmt": "deno fmt"
|
|
18
|
+
},
|
|
19
|
+
"lint": {
|
|
20
|
+
"exclude": ["dist/"],
|
|
21
|
+
"rules": {
|
|
22
|
+
"exclude": ["no-import-prefix"]
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"fmt": {
|
|
26
|
+
"exclude": ["dist/"]
|
|
27
|
+
},
|
|
28
|
+
"compilerOptions": {
|
|
29
|
+
"strict": true,
|
|
30
|
+
"lib": ["deno.ns", "dom", "esnext"]
|
|
31
|
+
},
|
|
32
|
+
"nodeModulesDir": "auto",
|
|
33
|
+
"imports": {
|
|
34
|
+
"@modelcontextprotocol/sdk": "npm:@modelcontextprotocol/sdk@^1.25.2",
|
|
35
|
+
"@opencode-ai/plugin": "npm:@opencode-ai/plugin@^1.1.53",
|
|
36
|
+
"@opencode-ai/sdk": "npm:@opencode-ai/sdk@^1.1.53",
|
|
37
|
+
"cosmiconfig": "npm:cosmiconfig@9.0.0",
|
|
38
|
+
"zod": "npm:zod@4.3.6"
|
|
39
|
+
},
|
|
40
|
+
"exports": {
|
|
41
|
+
".": "./mod.ts"
|
|
42
|
+
}
|
|
43
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/src/services/client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/src/services/client.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,YAAY,EA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pC"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.GraphitiClient = void 0;
|
|
4
7
|
const index_js_1 = require("@modelcontextprotocol/sdk/client/index.js");
|
|
5
8
|
const streamableHttp_js_1 = require("@modelcontextprotocol/sdk/client/streamableHttp.js");
|
|
9
|
+
const deno_js_1 = __importDefault(require("../../deno.js"));
|
|
6
10
|
const logger_js_1 = require("./logger.js");
|
|
7
11
|
/**
|
|
8
12
|
* Graphiti MCP client wrapper for connecting, querying,
|
|
@@ -38,12 +42,18 @@ class GraphitiClient {
|
|
|
38
42
|
value: void 0
|
|
39
43
|
});
|
|
40
44
|
this.endpoint = endpoint;
|
|
41
|
-
this.client = new index_js_1.Client({
|
|
45
|
+
this.client = new index_js_1.Client({
|
|
46
|
+
name: deno_js_1.default.name,
|
|
47
|
+
version: deno_js_1.default.version,
|
|
48
|
+
});
|
|
42
49
|
this.transport = new streamableHttp_js_1.StreamableHTTPClientTransport(new URL(endpoint));
|
|
43
50
|
}
|
|
44
51
|
/** Create a fresh MCP Client and Transport pair. */
|
|
45
52
|
createClientAndTransport() {
|
|
46
|
-
this.client = new index_js_1.Client({
|
|
53
|
+
this.client = new index_js_1.Client({
|
|
54
|
+
name: deno_js_1.default.name,
|
|
55
|
+
version: deno_js_1.default.version,
|
|
56
|
+
});
|
|
47
57
|
this.transport = new streamableHttp_js_1.StreamableHTTPClientTransport(new URL(this.endpoint));
|
|
48
58
|
}
|
|
49
59
|
/**
|