opencode-graphiti 0.2.3 → 0.2.4-canary.8a5f9e8.20260411124004
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/esm/_dnt.polyfills.d.ts +99 -0
- package/esm/_dnt.polyfills.d.ts.map +1 -1
- package/esm/_dnt.polyfills.js +127 -1
- package/esm/src/config.d.ts.map +1 -1
- package/esm/src/config.js +1 -2
- package/esm/src/handlers/compacting.d.ts.map +1 -1
- package/esm/src/handlers/compacting.js +1 -1
- package/esm/src/index.d.ts.map +1 -1
- package/esm/src/index.js +53 -11
- package/esm/src/services/connection-manager.d.ts.map +1 -1
- package/esm/src/services/connection-manager.js +1 -3
- package/esm/src/services/session-mcp-runtime.d.ts +7 -1
- package/esm/src/services/session-mcp-runtime.d.ts.map +1 -1
- package/esm/src/services/session-mcp-runtime.js +143 -12
- package/esm/src/services/session-mcp-types.d.ts +81 -2
- package/esm/src/services/session-mcp-types.d.ts.map +1 -1
- package/esm/src/services/session-mcp-types.js +34 -0
- package/esm/src/services/session-notes.d.ts +57 -0
- package/esm/src/services/session-notes.d.ts.map +1 -0
- package/esm/src/services/session-notes.js +234 -0
- package/esm/src/session.d.ts +7 -1
- package/esm/src/session.d.ts.map +1 -1
- package/esm/src/session.js +24 -8
- package/package.json +2 -1
- package/script/_dnt.polyfills.d.ts +99 -0
- package/script/_dnt.polyfills.d.ts.map +1 -1
- package/script/_dnt.polyfills.js +128 -0
- package/script/src/config.d.ts.map +1 -1
- package/script/src/config.js +1 -2
- package/script/src/handlers/compacting.d.ts.map +1 -1
- package/script/src/handlers/compacting.js +1 -1
- package/script/src/index.d.ts.map +1 -1
- package/script/src/index.js +52 -10
- package/script/src/services/connection-manager.d.ts.map +1 -1
- package/script/src/services/connection-manager.js +1 -3
- package/script/src/services/session-mcp-runtime.d.ts +7 -1
- package/script/src/services/session-mcp-runtime.d.ts.map +1 -1
- package/script/src/services/session-mcp-runtime.js +144 -13
- package/script/src/services/session-mcp-types.d.ts +81 -2
- package/script/src/services/session-mcp-types.d.ts.map +1 -1
- package/script/src/services/session-mcp-types.js +34 -0
- package/script/src/services/session-notes.d.ts +57 -0
- package/script/src/services/session-notes.d.ts.map +1 -0
- package/script/src/services/session-notes.js +239 -0
- package/script/src/session.d.ts +7 -1
- package/script/src/session.d.ts.map +1 -1
- package/script/src/session.js +24 -8
package/esm/_dnt.polyfills.d.ts
CHANGED
|
@@ -64,4 +64,103 @@ declare global {
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
export {};
|
|
67
|
+
/**
|
|
68
|
+
* Based on [import-meta-ponyfill](https://github.com/gaubee/import-meta-ponyfill),
|
|
69
|
+
* but instead of using npm to install additional dependencies,
|
|
70
|
+
* this approach manually consolidates cjs/mjs/d.ts into a single file.
|
|
71
|
+
*
|
|
72
|
+
* Note that this code might be imported multiple times
|
|
73
|
+
* (for example, both dnt.test.polyfills.ts and dnt.polyfills.ts contain this code;
|
|
74
|
+
* or Node.js might dynamically clear the cache and then force a require).
|
|
75
|
+
* Therefore, it's important to avoid redundant writes to global objects.
|
|
76
|
+
* Additionally, consider that commonjs is used alongside esm,
|
|
77
|
+
* so the two ponyfill functions are stored independently in two separate global objects.
|
|
78
|
+
*/
|
|
79
|
+
import { createRequire } from "node:module";
|
|
80
|
+
import { type URL } from "node:url";
|
|
81
|
+
declare global {
|
|
82
|
+
interface ImportMeta {
|
|
83
|
+
/** A string representation of the fully qualified module URL. When the
|
|
84
|
+
* module is loaded locally, the value will be a file URL (e.g.
|
|
85
|
+
* `file:///path/module.ts`).
|
|
86
|
+
*
|
|
87
|
+
* You can also parse the string as a URL to determine more information about
|
|
88
|
+
* how the current module was loaded. For example to determine if a module was
|
|
89
|
+
* local or not:
|
|
90
|
+
*
|
|
91
|
+
* ```ts
|
|
92
|
+
* const url = new URL(import.meta.url);
|
|
93
|
+
* if (url.protocol === "file:") {
|
|
94
|
+
* console.log("this module was loaded locally");
|
|
95
|
+
* }
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
url: string;
|
|
99
|
+
/**
|
|
100
|
+
* A function that returns resolved specifier as if it would be imported
|
|
101
|
+
* using `import(specifier)`.
|
|
102
|
+
*
|
|
103
|
+
* ```ts
|
|
104
|
+
* console.log(import.meta.resolve("./foo.js"));
|
|
105
|
+
* // file:///dev/foo.js
|
|
106
|
+
* ```
|
|
107
|
+
*
|
|
108
|
+
* @param specifier The module specifier to resolve relative to `parent`.
|
|
109
|
+
* @param parent The absolute parent module URL to resolve from.
|
|
110
|
+
* @returns The absolute (`file:`) URL string for the resolved module.
|
|
111
|
+
*/
|
|
112
|
+
resolve(specifier: string, parent?: string | URL | undefined): string;
|
|
113
|
+
/** A flag that indicates if the current module is the main module that was
|
|
114
|
+
* called when starting the program under Deno.
|
|
115
|
+
*
|
|
116
|
+
* ```ts
|
|
117
|
+
* if (import.meta.main) {
|
|
118
|
+
* // this was loaded as the main module, maybe do some bootstrapping
|
|
119
|
+
* }
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
122
|
+
main: boolean;
|
|
123
|
+
/** The absolute path of the current module.
|
|
124
|
+
*
|
|
125
|
+
* This property is only provided for local modules (ie. using `file://` URLs).
|
|
126
|
+
*
|
|
127
|
+
* Example:
|
|
128
|
+
* ```
|
|
129
|
+
* // Unix
|
|
130
|
+
* console.log(import.meta.filename); // /home/alice/my_module.ts
|
|
131
|
+
*
|
|
132
|
+
* // Windows
|
|
133
|
+
* console.log(import.meta.filename); // C:\alice\my_module.ts
|
|
134
|
+
* ```
|
|
135
|
+
*/
|
|
136
|
+
filename: string;
|
|
137
|
+
/** The absolute path of the directory containing the current module.
|
|
138
|
+
*
|
|
139
|
+
* This property is only provided for local modules (ie. using `file://` URLs).
|
|
140
|
+
*
|
|
141
|
+
* * Example:
|
|
142
|
+
* ```
|
|
143
|
+
* // Unix
|
|
144
|
+
* console.log(import.meta.dirname); // /home/alice
|
|
145
|
+
*
|
|
146
|
+
* // Windows
|
|
147
|
+
* console.log(import.meta.dirname); // C:\alice
|
|
148
|
+
* ```
|
|
149
|
+
*/
|
|
150
|
+
dirname: string;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
type NodeRequest = ReturnType<typeof createRequire>;
|
|
154
|
+
type NodeModule = NonNullable<NodeRequest["main"]>;
|
|
155
|
+
interface ImportMetaPonyfillCommonjs {
|
|
156
|
+
(require: NodeRequest, module: NodeModule): ImportMeta;
|
|
157
|
+
}
|
|
158
|
+
interface ImportMetaPonyfillEsmodule {
|
|
159
|
+
(importMeta: ImportMeta): ImportMeta;
|
|
160
|
+
}
|
|
161
|
+
interface ImportMetaPonyfill extends ImportMetaPonyfillCommonjs, ImportMetaPonyfillEsmodule {
|
|
162
|
+
}
|
|
163
|
+
export declare let import_meta_ponyfill_commonjs: ImportMetaPonyfillCommonjs;
|
|
164
|
+
export declare let import_meta_ponyfill_esmodule: ImportMetaPonyfillEsmodule;
|
|
165
|
+
export declare let import_meta_ponyfill: ImportMetaPonyfill;
|
|
67
166
|
//# sourceMappingURL=_dnt.polyfills.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_dnt.polyfills.d.ts","sourceRoot":"","sources":["../src/_dnt.polyfills.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,KAAK;QACb,KAAK,CAAC,EAAE,OAAO,CAAC;KACjB;CACF;AAED,OAAO,EAAE,CAAC;AAEV,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,KAAK,CAAC,CAAC;QACf;;;;;;;;WAQG;QACH,QAAQ,CAAC,CAAC,SAAS,CAAC,EAClB,SAAS,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC,EACxE,OAAO,CAAC,EAAE,GAAG,GACZ,CAAC,GAAG,SAAS,CAAC;QACjB,QAAQ,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UAAU,CAAC;CACtC;AACD,UAAU,kBACR,SAAQ,0BAA0B,EAAE,0BAA0B;CAC/D;AAiBD,eAAO,IAAI,6BAA6B,EA2BnC,0BAA0B,CAAC;AAMhC,eAAO,IAAI,6BAA6B,EA4DnC,0BAA0B,CAAC;AAMhC,eAAO,IAAI,oBAAoB,EAoB1B,kBAAkB,CAAC"}
|
package/esm/_dnt.polyfills.js
CHANGED
|
@@ -48,4 +48,130 @@ if (!Object.hasOwn) {
|
|
|
48
48
|
writable: true,
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
|
-
|
|
51
|
+
/**
|
|
52
|
+
* Based on [import-meta-ponyfill](https://github.com/gaubee/import-meta-ponyfill),
|
|
53
|
+
* but instead of using npm to install additional dependencies,
|
|
54
|
+
* this approach manually consolidates cjs/mjs/d.ts into a single file.
|
|
55
|
+
*
|
|
56
|
+
* Note that this code might be imported multiple times
|
|
57
|
+
* (for example, both dnt.test.polyfills.ts and dnt.polyfills.ts contain this code;
|
|
58
|
+
* or Node.js might dynamically clear the cache and then force a require).
|
|
59
|
+
* Therefore, it's important to avoid redundant writes to global objects.
|
|
60
|
+
* Additionally, consider that commonjs is used alongside esm,
|
|
61
|
+
* so the two ponyfill functions are stored independently in two separate global objects.
|
|
62
|
+
*/
|
|
63
|
+
//@ts-ignore
|
|
64
|
+
import { createRequire } from "node:module";
|
|
65
|
+
//@ts-ignore
|
|
66
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
67
|
+
//@ts-ignore
|
|
68
|
+
import { dirname } from "node:path";
|
|
69
|
+
const defineGlobalPonyfill = (symbolFor, fn) => {
|
|
70
|
+
if (!Reflect.has(globalThis, Symbol.for(symbolFor))) {
|
|
71
|
+
Object.defineProperty(globalThis, Symbol.for(symbolFor), {
|
|
72
|
+
configurable: true,
|
|
73
|
+
get() {
|
|
74
|
+
return fn;
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
export let import_meta_ponyfill_commonjs = (Reflect.get(globalThis, Symbol.for("import-meta-ponyfill-commonjs")) ??
|
|
80
|
+
(() => {
|
|
81
|
+
const moduleImportMetaWM = new WeakMap();
|
|
82
|
+
return (require, module) => {
|
|
83
|
+
let importMetaCache = moduleImportMetaWM.get(module);
|
|
84
|
+
if (importMetaCache == null) {
|
|
85
|
+
const importMeta = Object.assign(Object.create(null), {
|
|
86
|
+
url: pathToFileURL(module.filename).href,
|
|
87
|
+
main: require.main == module,
|
|
88
|
+
resolve: (specifier, parentURL = importMeta.url) => {
|
|
89
|
+
return pathToFileURL((importMeta.url === parentURL
|
|
90
|
+
? require
|
|
91
|
+
: createRequire(parentURL))
|
|
92
|
+
.resolve(specifier)).href;
|
|
93
|
+
},
|
|
94
|
+
filename: module.filename,
|
|
95
|
+
dirname: module.path,
|
|
96
|
+
});
|
|
97
|
+
moduleImportMetaWM.set(module, importMeta);
|
|
98
|
+
importMetaCache = importMeta;
|
|
99
|
+
}
|
|
100
|
+
return importMetaCache;
|
|
101
|
+
};
|
|
102
|
+
})());
|
|
103
|
+
defineGlobalPonyfill("import-meta-ponyfill-commonjs", import_meta_ponyfill_commonjs);
|
|
104
|
+
export let import_meta_ponyfill_esmodule = (Reflect.get(globalThis, Symbol.for("import-meta-ponyfill-esmodule")) ??
|
|
105
|
+
((importMeta) => {
|
|
106
|
+
const resolveFunStr = String(importMeta.resolve);
|
|
107
|
+
const shimWs = new WeakSet();
|
|
108
|
+
//@ts-ignore
|
|
109
|
+
const mainUrl = ("file:///" + process.argv[1].replace(/\\/g, "/"))
|
|
110
|
+
.replace(/\/{3,}/, "///");
|
|
111
|
+
const commonShim = (importMeta) => {
|
|
112
|
+
if (typeof importMeta.main !== "boolean") {
|
|
113
|
+
importMeta.main = importMeta.url === mainUrl;
|
|
114
|
+
}
|
|
115
|
+
if (typeof importMeta.filename !== "string") {
|
|
116
|
+
importMeta.filename = fileURLToPath(importMeta.url);
|
|
117
|
+
importMeta.dirname = dirname(importMeta.filename);
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
if (
|
|
121
|
+
// v16.2.0+, v14.18.0+: Add support for WHATWG URL object to parentURL parameter.
|
|
122
|
+
resolveFunStr === "undefined" ||
|
|
123
|
+
// v20.0.0+, v18.19.0+"" This API now returns a string synchronously instead of a Promise.
|
|
124
|
+
resolveFunStr.startsWith("async")
|
|
125
|
+
// enable by --experimental-import-meta-resolve flag
|
|
126
|
+
) {
|
|
127
|
+
import_meta_ponyfill_esmodule = (importMeta) => {
|
|
128
|
+
if (!shimWs.has(importMeta)) {
|
|
129
|
+
shimWs.add(importMeta);
|
|
130
|
+
const importMetaUrlRequire = {
|
|
131
|
+
url: importMeta.url,
|
|
132
|
+
require: createRequire(importMeta.url),
|
|
133
|
+
};
|
|
134
|
+
importMeta.resolve = function resolve(specifier, parentURL = importMeta.url) {
|
|
135
|
+
return pathToFileURL((importMetaUrlRequire.url === parentURL
|
|
136
|
+
? importMetaUrlRequire.require
|
|
137
|
+
: createRequire(parentURL)).resolve(specifier)).href;
|
|
138
|
+
};
|
|
139
|
+
commonShim(importMeta);
|
|
140
|
+
}
|
|
141
|
+
return importMeta;
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
/// native support
|
|
146
|
+
import_meta_ponyfill_esmodule = (importMeta) => {
|
|
147
|
+
if (!shimWs.has(importMeta)) {
|
|
148
|
+
shimWs.add(importMeta);
|
|
149
|
+
commonShim(importMeta);
|
|
150
|
+
}
|
|
151
|
+
return importMeta;
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
return import_meta_ponyfill_esmodule(importMeta);
|
|
155
|
+
}));
|
|
156
|
+
defineGlobalPonyfill("import-meta-ponyfill-esmodule", import_meta_ponyfill_esmodule);
|
|
157
|
+
export let import_meta_ponyfill = ((...args) => {
|
|
158
|
+
const _MODULE = (() => {
|
|
159
|
+
if (typeof require === "function" && typeof module === "object") {
|
|
160
|
+
return "commonjs";
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
// eval("typeof import.meta");
|
|
164
|
+
return "esmodule";
|
|
165
|
+
}
|
|
166
|
+
})();
|
|
167
|
+
if (_MODULE === "commonjs") {
|
|
168
|
+
//@ts-ignore
|
|
169
|
+
import_meta_ponyfill = (r, m) => import_meta_ponyfill_commonjs(r, m);
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
//@ts-ignore
|
|
173
|
+
import_meta_ponyfill = (im) => import_meta_ponyfill_esmodule(im);
|
|
174
|
+
}
|
|
175
|
+
//@ts-ignore
|
|
176
|
+
return import_meta_ponyfill(...args);
|
|
177
|
+
});
|
package/esm/src/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/src/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/src/config.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,cAAc,EAAqB,MAAM,kBAAkB,CAAC;AAkB1E,KAAK,gBAAgB,GAAG;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAAC;AAEnD,KAAK,mBAAmB,GACpB,uBAAuB,GACvB,yBAAyB,GACzB,kBAAkB,GAClB,gBAAgB,CAAC;AAErB,qBAAa,eAAgB,SAAQ,KAAK;IACxC,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAC;gBAGjC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAC;QAAC,IAAI,EAAE,mBAAmB,CAAA;KAAE;CAiB1D;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,gBAAgB,CAAC;IACxC,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,CAAC;CAC1C;AAED,KAAK,qBAAqB,GAAG,MAAM,qBAAqB,CAAC;AAkSzD,eAAO,MAAM,kCAAkC,GAC7C,SAAS,qBAAqB,KAC7B,IAEF,CAAC;AAEF,eAAO,MAAM,oCAAoC,QAAO,IAEvD,CAAC;AAEF,eAAO,MAAM,kCAAkC,GAC7C,UAAU,OAAO,mBAAmB,KACnC,IAEF,CAAC;AAEF,eAAO,MAAM,oCAAoC,QAAO,IAEvD,CAAC;AA4FF,wBAAgB,UAAU,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,cAAc,CAoD7D"}
|
package/esm/src/config.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import os from "node:os";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import { join } from "node:path";
|
|
4
|
-
import process from "node:process";
|
|
5
4
|
import { redactEndpointUserInfo } from "./services/endpoint-redaction.js";
|
|
6
5
|
import { notifyPluginWarning } from "./services/opencode-warning.js";
|
|
7
6
|
const DEFAULT_CONFIG = {
|
|
@@ -43,7 +42,7 @@ export class ConfigLoadError extends Error {
|
|
|
43
42
|
}
|
|
44
43
|
}
|
|
45
44
|
}
|
|
46
|
-
const nodeRequire = createRequire(
|
|
45
|
+
const nodeRequire = createRequire(globalThis[Symbol.for("import-meta-ponyfill-esmodule")](import.meta).url);
|
|
47
46
|
const isRecord = (value) => !!value && typeof value === "object" && !Array.isArray(value);
|
|
48
47
|
const readString = (value, key) => typeof value[key] === "string" ? value[key] : undefined;
|
|
49
48
|
const readTrimmedString = (value, key) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compacting.d.ts","sourceRoot":"","sources":["../../../src/src/handlers/compacting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD,KAAK,cAAc,GAAG,WAAW,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAC,CAAC;AAI5E,MAAM,WAAW,qBAAqB;IACpC,cAAc,EAAE,cAAc,CAAC;CAChC;AAED,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,qBAAqB,GAC1B,cAAc,
|
|
1
|
+
{"version":3,"file":"compacting.d.ts","sourceRoot":"","sources":["../../../src/src/handlers/compacting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD,KAAK,cAAc,GAAG,WAAW,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAC,CAAC;AAI5E,MAAM,WAAW,qBAAqB;IACpC,cAAc,EAAE,cAAc,CAAC;CAChC;AAED,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,qBAAqB,GAC1B,cAAc,CAqChB"}
|
|
@@ -9,7 +9,7 @@ export function createCompactingHandler(deps) {
|
|
|
9
9
|
if (!state?.isMain)
|
|
10
10
|
return;
|
|
11
11
|
sessionManager.markResolvedSessionActive(sessionID, canonicalSessionId);
|
|
12
|
-
const prepared = await sessionManager.prepareInjection(canonicalSessionId);
|
|
12
|
+
const prepared = await sessionManager.prepareInjection(canonicalSessionId, undefined, { forCompaction: true });
|
|
13
13
|
if (!prepared?.envelope)
|
|
14
14
|
return;
|
|
15
15
|
output.context.push(prepared.envelope);
|
package/esm/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAS,MAAM,EAAe,MAAM,qBAAqB,CAAC;AAuFtE,eAAO,MAAM,gCAAgC,GAC3C,WAAW,OAAO,EAClB,UAAU,MAAM,KACf,IAOF,CAAC;AAEF,eAAO,MAAM,6BAA6B,GACxC,WAAW,OAAO,EAClB,UAAU,MAAM,KACf,IAOF,CAAC;AAgCF,eAAO,MAAM,QAAQ,EAAE,MAmStB,CAAC"}
|
package/esm/src/index.js
CHANGED
|
@@ -16,10 +16,11 @@ import { RedisCacheService } from "./services/redis-cache.js";
|
|
|
16
16
|
import { RedisClient } from "./services/redis-client.js";
|
|
17
17
|
import { RedisEventsService } from "./services/redis-events.js";
|
|
18
18
|
import { logger } from "./services/logger.js";
|
|
19
|
+
import { SessionNotesService } from "./services/session-notes.js";
|
|
19
20
|
import { RedisSnapshotService } from "./services/redis-snapshot.js";
|
|
20
21
|
import { registerRuntimeTeardown } from "./services/runtime-teardown.js";
|
|
21
22
|
import { createSessionExecutor } from "./services/session-executor.js";
|
|
22
|
-
import { createSessionMcpRuntime } from "./services/session-mcp-runtime.js";
|
|
23
|
+
import { createSessionMcpRuntime, SESSION_SEARCH_STRENGTHENED_DESCRIPTION, } from "./services/session-mcp-runtime.js";
|
|
23
24
|
import { ToolGuidanceCache } from "./services/tool-guidance-cache.js";
|
|
24
25
|
import { ToolRoutingOutcomeCache } from "./services/tool-routing-outcome-cache.js";
|
|
25
26
|
import { makeGroupId, makeUserGroupId } from "./utils.js";
|
|
@@ -49,6 +50,7 @@ const defaultGraphitiDependencies = {
|
|
|
49
50
|
RedisEventsService,
|
|
50
51
|
RedisSnapshotService,
|
|
51
52
|
RedisCacheService,
|
|
53
|
+
SessionNotesService,
|
|
52
54
|
BatchDrainService,
|
|
53
55
|
GraphitiAsyncService,
|
|
54
56
|
createSessionExecutor,
|
|
@@ -137,6 +139,9 @@ export const graphiti = (input, dependencies = defaultGraphitiDependencies) => {
|
|
|
137
139
|
ttlSeconds: config.redis.cacheTtlSeconds,
|
|
138
140
|
driftThreshold: config.graphiti.driftThreshold,
|
|
139
141
|
});
|
|
142
|
+
const notesService = new dependencies.SessionNotesService(redisClient, {
|
|
143
|
+
sessionTtlSeconds: config.redis.sessionTtlSeconds,
|
|
144
|
+
});
|
|
140
145
|
const batchDrain = new dependencies.BatchDrainService(redisClient, redisEvents, {
|
|
141
146
|
batchSize: config.redis.batchSize,
|
|
142
147
|
batchMaxBytes: config.redis.batchMaxBytes,
|
|
@@ -153,6 +158,7 @@ export const graphiti = (input, dependencies = defaultGraphitiDependencies) => {
|
|
|
153
158
|
const sessionMcpRuntime = dependencies.createSessionMcpRuntime({
|
|
154
159
|
redisClient,
|
|
155
160
|
graphitiCache: redisCache,
|
|
161
|
+
notesService,
|
|
156
162
|
sessionTtlSeconds: config.redis.sessionTtlSeconds,
|
|
157
163
|
groupId: defaultGroupId,
|
|
158
164
|
sessionExecutor,
|
|
@@ -164,11 +170,23 @@ export const graphiti = (input, dependencies = defaultGraphitiDependencies) => {
|
|
|
164
170
|
});
|
|
165
171
|
const sessionManager = new dependencies.SessionManager(defaultGroupId, defaultUserGroupId, input.client, redisEvents, redisSnapshot, redisCache, {
|
|
166
172
|
idleRetentionMs: config.redis.sessionTtlSeconds * 1000,
|
|
173
|
+
notesService,
|
|
167
174
|
runtimeStateMigrator: sessionMcpRuntime,
|
|
168
175
|
});
|
|
169
176
|
sessionMcpRuntime.setSessionCanonicalizer(sessionManager);
|
|
170
177
|
const toolGuidanceCache = new dependencies.ToolGuidanceCache();
|
|
171
178
|
const toolRoutingOutcomes = new dependencies.ToolRoutingOutcomeCache();
|
|
179
|
+
const sessionBiasState = new Map();
|
|
180
|
+
const chatHandler = dependencies.createChatHandler({
|
|
181
|
+
sessionManager,
|
|
182
|
+
redisEvents,
|
|
183
|
+
graphitiAsync,
|
|
184
|
+
drainTriggerSize: config.redis.batchSize,
|
|
185
|
+
});
|
|
186
|
+
const compactingHandler = dependencies
|
|
187
|
+
.createCompactingHandler({
|
|
188
|
+
sessionManager,
|
|
189
|
+
});
|
|
172
190
|
startupTeardown = dependencies.registerRuntimeTeardown([
|
|
173
191
|
{
|
|
174
192
|
name: "graphiti-drain-flush",
|
|
@@ -204,21 +222,45 @@ export const graphiti = (input, dependencies = defaultGraphitiDependencies) => {
|
|
|
204
222
|
sdkClient: input.client,
|
|
205
223
|
directory: input.directory,
|
|
206
224
|
}),
|
|
207
|
-
"chat.message":
|
|
208
|
-
sessionManager
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
225
|
+
"chat.message": async (hookInput, output) => {
|
|
226
|
+
const canonicalSessionId = sessionManager.getCachedCanonicalSessionId(hookInput.sessionID) ??
|
|
227
|
+
await sessionManager.resolveCanonicalSessionId(hookInput.sessionID);
|
|
228
|
+
if (canonicalSessionId && !sessionBiasState.has(canonicalSessionId)) {
|
|
229
|
+
const priorEvents = await redisEvents.getRecentSessionEvents(canonicalSessionId, 1, false);
|
|
230
|
+
if (priorEvents.length === 0) {
|
|
231
|
+
sessionBiasState.set(canonicalSessionId, "new-session");
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
await chatHandler(hookInput, output);
|
|
235
|
+
},
|
|
236
|
+
"experimental.session.compacting": async (hookInput, output) => {
|
|
237
|
+
const canonicalSessionId = sessionManager.getCachedCanonicalSessionId(hookInput.sessionID) ??
|
|
238
|
+
await sessionManager.resolveCanonicalSessionId(hookInput.sessionID);
|
|
239
|
+
if (canonicalSessionId) {
|
|
240
|
+
sessionBiasState.set(canonicalSessionId, "post-compaction");
|
|
241
|
+
}
|
|
242
|
+
await compactingHandler(hookInput, output);
|
|
243
|
+
},
|
|
217
244
|
"experimental.chat.messages.transform": dependencies
|
|
218
245
|
.createMessagesHandler({
|
|
219
246
|
sessionManager,
|
|
220
247
|
}),
|
|
221
248
|
tool: sessionMcpRuntime.tools,
|
|
249
|
+
"tool.definition": (hookInput, output) => {
|
|
250
|
+
if (hookInput.toolID !== "session_search")
|
|
251
|
+
return Promise.resolve();
|
|
252
|
+
let anyBiased = false;
|
|
253
|
+
for (const [sessionId, state] of sessionBiasState) {
|
|
254
|
+
if (state === "normal")
|
|
255
|
+
continue;
|
|
256
|
+
anyBiased = true;
|
|
257
|
+
sessionBiasState.delete(sessionId);
|
|
258
|
+
}
|
|
259
|
+
if (anyBiased) {
|
|
260
|
+
output.description = SESSION_SEARCH_STRENGTHENED_DESCRIPTION;
|
|
261
|
+
}
|
|
262
|
+
return Promise.resolve();
|
|
263
|
+
},
|
|
222
264
|
"tool.execute.before": dependencies.createToolBeforeHandler({
|
|
223
265
|
sessionCanonicalizer: sessionManager,
|
|
224
266
|
guidanceThrottle: toolGuidanceCache,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection-manager.d.ts","sourceRoot":"","sources":["../../../src/src/services/connection-manager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"connection-manager.d.ts","sourceRoot":"","sources":["../../../src/src/services/connection-manager.ts"],"names":[],"mappings":"AAyDA,MAAM,MAAM,uBAAuB,GAC/B,YAAY,GACZ,WAAW,GACX,SAAS,GACT,SAAS,GACT,SAAS,CAAC;AAEd,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,GAAG,MAAM,CAAC;AAE1D,qBAAa,oBAAqB,SAAQ,KAAK;IAI3C,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS;IAHnD,QAAQ,CAAC,IAAI,aAAa;gBAGf,KAAK,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,EACjD,OAAO,CAAC,EAAE,MAAM;CAYnB;AAED,qBAAa,yBAA0B,SAAQ,KAAK;IAClD,QAAQ,CAAC,IAAI,mBAAmB;gBAG9B,OAAO,SAA4D;CAKtE;AAED,qBAAa,2BAA4B,SAAQ,KAAK;IACpD,QAAQ,CAAC,IAAI,qBAAqB;gBAEtB,OAAO,SAA+B;CAInD;AAED,qBAAa,sBAAuB,SAAQ,KAAK;IAC/C,QAAQ,CAAC,IAAI,uBAAuB;gBAExB,OAAO,SAA+B;CAInD;AAED,qBAAa,2BAA4B,SAAQ,KAAK;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AAU,CAAmC;IACrD,OAAO,CAAC,cAAc,CAAiC;IACvD,OAAO,CAAC,cAAc,CAA4B;IAClD,OAAO,CAAC,eAAe,CAAwB;IAC/C,OAAO,CAAC,YAAY,CAAuC;IAC3D,OAAO,CAAC,gBAAgB,CAAS;IACjC,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,WAAW,CAA8B;IACjD,OAAO,CAAC,wBAAwB,CAA8B;gBAElD,OAAO,EAAE,gCAAgC;IAoBrD,QAAQ,IAAI,uBAAuB;IAInC,KAAK,IAAI,IAAI;IAcP,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAgDrB,KAAK,CAAC,SAAS,SAAwB,GAAG,OAAO,CAAC,OAAO,CAAC;IAwB1D,QAAQ,CACZ,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,UAAU,SAAyB,GAClC,OAAO,CAAC,OAAO,CAAC;IA0Bb,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC;YAerB,gBAAgB;YAoDhB,kCAAkC;YA0ElC,uCAAuC;IAyBrD,OAAO,CAAC,sBAAsB;YAIhB,uBAAuB;IASrC,OAAO,CAAC,sBAAsB;IAwC9B,OAAO,CAAC,mBAAmB;IAQ3B,OAAO,CAAC,cAAc;YAyCR,iBAAiB;IAgC/B,OAAO,CAAC,oBAAoB;IAQ5B,OAAO,CAAC,iBAAiB;IAOzB,OAAO,CAAC,gBAAgB;IAUxB,OAAO,CAAC,iBAAiB;IA6BzB,OAAO,CAAC,oBAAoB;IAO5B,OAAO,CAAC,mBAAmB;CAO5B"}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
|
-
import { join } from "node:path";
|
|
3
2
|
import { pathToFileURL } from "node:url";
|
|
4
|
-
import process from "node:process";
|
|
5
3
|
import manifest from "../../deno.js";
|
|
6
4
|
import { isAbortError } from "../utils.js";
|
|
7
5
|
import { redactEndpointUserInfo } from "./endpoint-redaction.js";
|
|
8
6
|
import { logger } from "./logger.js";
|
|
9
|
-
const nodeRequire = createRequire(
|
|
7
|
+
const nodeRequire = createRequire(globalThis[Symbol.for("import-meta-ponyfill-esmodule")](import.meta).url);
|
|
10
8
|
let mcpRuntimeModulesPromise = null;
|
|
11
9
|
const importResolvedModule = async (specifier) => {
|
|
12
10
|
const resolvedPath = nodeRequire.resolve(specifier);
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import { type ToolContext, type ToolDefinition } from "@opencode-ai/plugin";
|
|
2
|
-
import
|
|
2
|
+
import { RedisClient } from "./redis-client.js";
|
|
3
3
|
import type { RedisCacheService } from "./redis-cache.js";
|
|
4
4
|
import { createSessionCorpusService } from "./session-corpus.js";
|
|
5
5
|
import { createSessionExecutor, type SessionExecutor } from "./session-executor.js";
|
|
6
6
|
import { type SessionMcpRequestMap, type SessionMcpResponseMap, type SessionMcpToolName } from "./session-mcp-types.js";
|
|
7
|
+
import { SessionNotesService } from "./session-notes.js";
|
|
7
8
|
import type { RuntimeRootSessionValidator } from "../session.js";
|
|
8
9
|
export declare const SESSION_MCP_RESPONSE_BUDGET_BYTES: number;
|
|
10
|
+
export declare const SESSION_NOTES_WRITE_DESCRIPTION: string;
|
|
11
|
+
export declare const SESSION_NOTES_READ_DESCRIPTION: string;
|
|
12
|
+
export declare const SESSION_SEARCH_BASELINE_DESCRIPTION: string;
|
|
13
|
+
export declare const SESSION_SEARCH_STRENGTHENED_DESCRIPTION: string;
|
|
9
14
|
type SessionMcpHandler<TToolName extends SessionMcpToolName> = (request: SessionMcpRequestMap[TToolName], context: ToolContext) => Promise<SessionMcpResponseMap[TToolName]>;
|
|
10
15
|
type SessionMcpHandlerMap = {
|
|
11
16
|
[K in SessionMcpToolName]: SessionMcpHandler<K>;
|
|
@@ -14,6 +19,7 @@ type SessionMcpRuntimeOptions = {
|
|
|
14
19
|
handlers?: Partial<SessionMcpHandlerMap>;
|
|
15
20
|
redisClient?: RedisClient;
|
|
16
21
|
graphitiCache?: RedisCacheService | object;
|
|
22
|
+
notesService?: SessionNotesService;
|
|
17
23
|
sessionTtlSeconds?: number;
|
|
18
24
|
groupId?: string;
|
|
19
25
|
createSessionCorpusService?: typeof createSessionCorpusService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-mcp-runtime.d.ts","sourceRoot":"","sources":["../../../src/src/services/session-mcp-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,cAAc,EACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,
|
|
1
|
+
{"version":3,"file":"session-mcp-runtime.d.ts","sourceRoot":"","sources":["../../../src/src/services/session-mcp-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,cAAc,EACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EACL,0BAA0B,EAE3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,qBAAqB,EAIrB,KAAK,eAAe,EACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAEL,KAAK,oBAAoB,EAEzB,KAAK,qBAAqB,EAE1B,KAAK,kBAAkB,EACxB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAIjE,eAAO,MAAM,iCAAiC,QAAW,CAAC;AAG1D,eAAO,MAAM,+BAA+B,QAmChC,CAAC;AAEb,eAAO,MAAM,8BAA8B,QAW/B,CAAC;AAEb,eAAO,MAAM,mCAAmC,QAiBpC,CAAC;AAEb,eAAO,MAAM,uCAAuC,QAuBxC,CAAC;AAu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