@remnic/hermes-provider 1.0.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 +188 -0
- package/dist/index.js +229 -0
- package/dist/index.js.map +1 -0
- package/package.json +35 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @remnic/hermes-provider
|
|
3
|
+
*
|
|
4
|
+
* Typed HTTP client for the Remnic memory API.
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* const client = new HermesClient({ baseUrl: "http://127.0.0.1:4318", authToken: "secret" });
|
|
8
|
+
* const health = await client.health();
|
|
9
|
+
* const memories = await client.recall("what did I work on last week?");
|
|
10
|
+
*/
|
|
11
|
+
interface HermesClientOptions {
|
|
12
|
+
/** Base URL of the Engram HTTP server (e.g. "http://127.0.0.1:4318") */
|
|
13
|
+
baseUrl: string;
|
|
14
|
+
/** Bearer token for authentication */
|
|
15
|
+
authToken: string;
|
|
16
|
+
/** Default namespace for requests (optional) */
|
|
17
|
+
namespace?: string;
|
|
18
|
+
/** Default session key (optional) */
|
|
19
|
+
sessionKey?: string;
|
|
20
|
+
/** Max retries for server errors (default: 3) */
|
|
21
|
+
maxRetries?: number;
|
|
22
|
+
/** Base delay in ms between retries (default: 100) */
|
|
23
|
+
retryBaseDelayMs?: number;
|
|
24
|
+
/** Request timeout in ms (default: 5000) */
|
|
25
|
+
timeoutMs?: number;
|
|
26
|
+
}
|
|
27
|
+
interface EngramAccessHealthResponse {
|
|
28
|
+
ok: boolean;
|
|
29
|
+
memoryDir: string;
|
|
30
|
+
namespacesEnabled: boolean;
|
|
31
|
+
defaultNamespace: string;
|
|
32
|
+
searchBackend: string;
|
|
33
|
+
qmdEnabled: boolean;
|
|
34
|
+
nativeKnowledgeEnabled: boolean;
|
|
35
|
+
projectionAvailable: boolean;
|
|
36
|
+
}
|
|
37
|
+
interface EngramAccessRecallResponse {
|
|
38
|
+
context?: string;
|
|
39
|
+
results?: Array<{
|
|
40
|
+
id: string;
|
|
41
|
+
content: string;
|
|
42
|
+
score?: number;
|
|
43
|
+
category?: string;
|
|
44
|
+
}>;
|
|
45
|
+
count?: number;
|
|
46
|
+
traceId?: string;
|
|
47
|
+
plannerMode?: string;
|
|
48
|
+
fallbackUsed?: boolean;
|
|
49
|
+
sourcesUsed?: string[];
|
|
50
|
+
budgetsApplied?: Record<string, unknown>;
|
|
51
|
+
latencyMs?: number;
|
|
52
|
+
}
|
|
53
|
+
interface EngramAccessObserveResponse {
|
|
54
|
+
accepted: number;
|
|
55
|
+
sessionKey: string;
|
|
56
|
+
namespace?: string;
|
|
57
|
+
lcmArchived?: boolean;
|
|
58
|
+
extractionQueued?: boolean;
|
|
59
|
+
}
|
|
60
|
+
interface EngramAccessWriteResponse {
|
|
61
|
+
memoryId?: string;
|
|
62
|
+
status: string;
|
|
63
|
+
dryRun?: boolean;
|
|
64
|
+
idempotencyReplay?: boolean;
|
|
65
|
+
path?: string;
|
|
66
|
+
duplicateOf?: string;
|
|
67
|
+
idempotencyKey?: string;
|
|
68
|
+
}
|
|
69
|
+
interface EngramAccessEntityListResponse {
|
|
70
|
+
entities: Array<{
|
|
71
|
+
name: string;
|
|
72
|
+
type: string;
|
|
73
|
+
factCount?: number;
|
|
74
|
+
}>;
|
|
75
|
+
total: number;
|
|
76
|
+
}
|
|
77
|
+
interface EngramAccessEntityGetResponse {
|
|
78
|
+
found: boolean;
|
|
79
|
+
entity?: {
|
|
80
|
+
name: string;
|
|
81
|
+
type: string;
|
|
82
|
+
observations?: string[];
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
interface EngramAccessMemoryBrowseResponse {
|
|
86
|
+
memories: Array<Record<string, unknown>>;
|
|
87
|
+
total: number;
|
|
88
|
+
}
|
|
89
|
+
interface EngramAccessMemoryGetResponse {
|
|
90
|
+
found: boolean;
|
|
91
|
+
memory?: Record<string, unknown>;
|
|
92
|
+
}
|
|
93
|
+
interface EngramAccessLcmSearchResponse {
|
|
94
|
+
query: string;
|
|
95
|
+
namespace?: string;
|
|
96
|
+
results: Array<{
|
|
97
|
+
sessionId?: string;
|
|
98
|
+
content?: string;
|
|
99
|
+
turnIndex?: number;
|
|
100
|
+
}>;
|
|
101
|
+
count: number;
|
|
102
|
+
lcmEnabled: boolean;
|
|
103
|
+
}
|
|
104
|
+
interface RecallOptions {
|
|
105
|
+
sessionKey?: string;
|
|
106
|
+
namespace?: string;
|
|
107
|
+
topK?: number;
|
|
108
|
+
mode?: "auto" | "no_recall" | "minimal" | "full" | "graph_mode";
|
|
109
|
+
includeDebug?: boolean;
|
|
110
|
+
}
|
|
111
|
+
interface ObserveOptions {
|
|
112
|
+
namespace?: string;
|
|
113
|
+
skipExtraction?: boolean;
|
|
114
|
+
}
|
|
115
|
+
interface MemoryStoreRequest {
|
|
116
|
+
content: string;
|
|
117
|
+
category?: string;
|
|
118
|
+
confidence?: number;
|
|
119
|
+
tags?: string[];
|
|
120
|
+
entityRef?: string;
|
|
121
|
+
ttl?: string;
|
|
122
|
+
sourceReason?: string;
|
|
123
|
+
sessionKey?: string;
|
|
124
|
+
namespace?: string;
|
|
125
|
+
idempotencyKey?: string;
|
|
126
|
+
dryRun?: boolean;
|
|
127
|
+
schemaVersion?: number;
|
|
128
|
+
}
|
|
129
|
+
declare class HermesError extends Error {
|
|
130
|
+
readonly status: number;
|
|
131
|
+
readonly code: string;
|
|
132
|
+
readonly details?: Array<{
|
|
133
|
+
field: string;
|
|
134
|
+
message: string;
|
|
135
|
+
}> | undefined;
|
|
136
|
+
constructor(status: number, code: string, message: string, details?: Array<{
|
|
137
|
+
field: string;
|
|
138
|
+
message: string;
|
|
139
|
+
}> | undefined);
|
|
140
|
+
}
|
|
141
|
+
declare class HermesClient {
|
|
142
|
+
private readonly baseUrl;
|
|
143
|
+
private readonly authToken;
|
|
144
|
+
private readonly defaultNamespace?;
|
|
145
|
+
private readonly defaultSessionKey?;
|
|
146
|
+
private readonly maxRetries;
|
|
147
|
+
private readonly retryBaseDelayMs;
|
|
148
|
+
private readonly timeoutMs;
|
|
149
|
+
constructor(options: HermesClientOptions);
|
|
150
|
+
health(): Promise<EngramAccessHealthResponse>;
|
|
151
|
+
recall(query: string, options?: RecallOptions): Promise<EngramAccessRecallResponse>;
|
|
152
|
+
observe(sessionKey: string, messages: Array<{
|
|
153
|
+
role: "user" | "assistant";
|
|
154
|
+
content: string;
|
|
155
|
+
}>, options?: ObserveOptions): Promise<EngramAccessObserveResponse>;
|
|
156
|
+
store(request: MemoryStoreRequest): Promise<EngramAccessWriteResponse>;
|
|
157
|
+
submitSuggestion(request: MemoryStoreRequest): Promise<EngramAccessWriteResponse>;
|
|
158
|
+
getEntities(options?: {
|
|
159
|
+
namespace?: string;
|
|
160
|
+
query?: string;
|
|
161
|
+
limit?: number;
|
|
162
|
+
offset?: number;
|
|
163
|
+
}): Promise<EngramAccessEntityListResponse>;
|
|
164
|
+
getEntity(name: string, options?: {
|
|
165
|
+
namespace?: string;
|
|
166
|
+
}): Promise<EngramAccessEntityGetResponse>;
|
|
167
|
+
getMemories(options?: {
|
|
168
|
+
query?: string;
|
|
169
|
+
status?: string;
|
|
170
|
+
category?: string;
|
|
171
|
+
namespace?: string;
|
|
172
|
+
sort?: string;
|
|
173
|
+
limit?: number;
|
|
174
|
+
offset?: number;
|
|
175
|
+
}): Promise<EngramAccessMemoryBrowseResponse>;
|
|
176
|
+
getMemory(id: string, options?: {
|
|
177
|
+
namespace?: string;
|
|
178
|
+
}): Promise<EngramAccessMemoryGetResponse>;
|
|
179
|
+
lcmSearch(query: string, options?: {
|
|
180
|
+
sessionKey?: string;
|
|
181
|
+
namespace?: string;
|
|
182
|
+
limit?: number;
|
|
183
|
+
}): Promise<EngramAccessLcmSearchResponse>;
|
|
184
|
+
private queryString;
|
|
185
|
+
private request;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export { type EngramAccessEntityGetResponse, type EngramAccessEntityListResponse, type EngramAccessHealthResponse, type EngramAccessLcmSearchResponse, type EngramAccessMemoryBrowseResponse, type EngramAccessMemoryGetResponse, type EngramAccessObserveResponse, type EngramAccessRecallResponse, type EngramAccessWriteResponse, HermesClient, type HermesClientOptions, HermesError, type MemoryStoreRequest, type ObserveOptions, type RecallOptions };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
// openclaw-engram: Local-first memory plugin
|
|
2
|
+
|
|
3
|
+
// src/index.ts
|
|
4
|
+
var HermesError = class extends Error {
|
|
5
|
+
constructor(status, code, message, details) {
|
|
6
|
+
super(message);
|
|
7
|
+
this.status = status;
|
|
8
|
+
this.code = code;
|
|
9
|
+
this.details = details;
|
|
10
|
+
}
|
|
11
|
+
status;
|
|
12
|
+
code;
|
|
13
|
+
details;
|
|
14
|
+
};
|
|
15
|
+
var HermesClient = class {
|
|
16
|
+
baseUrl;
|
|
17
|
+
authToken;
|
|
18
|
+
defaultNamespace;
|
|
19
|
+
defaultSessionKey;
|
|
20
|
+
maxRetries;
|
|
21
|
+
retryBaseDelayMs;
|
|
22
|
+
timeoutMs;
|
|
23
|
+
constructor(options) {
|
|
24
|
+
this.baseUrl = options.baseUrl.endsWith("/") ? options.baseUrl.slice(0, -1) : options.baseUrl;
|
|
25
|
+
this.authToken = options.authToken;
|
|
26
|
+
this.defaultNamespace = options.namespace;
|
|
27
|
+
this.defaultSessionKey = options.sessionKey;
|
|
28
|
+
this.maxRetries = options.maxRetries ?? 3;
|
|
29
|
+
this.retryBaseDelayMs = options.retryBaseDelayMs ?? 100;
|
|
30
|
+
this.timeoutMs = options.timeoutMs ?? 5e3;
|
|
31
|
+
}
|
|
32
|
+
// -----------------------------------------------------------------------
|
|
33
|
+
// Core methods
|
|
34
|
+
// -----------------------------------------------------------------------
|
|
35
|
+
async health() {
|
|
36
|
+
return this.request("GET", "/engram/v1/health");
|
|
37
|
+
}
|
|
38
|
+
async recall(query, options) {
|
|
39
|
+
const body = {
|
|
40
|
+
query
|
|
41
|
+
};
|
|
42
|
+
const sk = options?.sessionKey ?? this.defaultSessionKey;
|
|
43
|
+
if (sk) body.sessionKey = sk;
|
|
44
|
+
const ns = options?.namespace ?? this.defaultNamespace;
|
|
45
|
+
if (ns) body.namespace = ns;
|
|
46
|
+
if (options?.topK !== void 0) body.topK = options.topK;
|
|
47
|
+
if (options?.mode) body.mode = options.mode;
|
|
48
|
+
if (options?.includeDebug !== void 0) body.includeDebug = options.includeDebug;
|
|
49
|
+
return this.request("POST", "/engram/v1/recall", body, { noRetry: true });
|
|
50
|
+
}
|
|
51
|
+
async observe(sessionKey, messages, options) {
|
|
52
|
+
const body = {
|
|
53
|
+
sessionKey,
|
|
54
|
+
messages,
|
|
55
|
+
namespace: options?.namespace ?? this.defaultNamespace,
|
|
56
|
+
skipExtraction: options?.skipExtraction ?? false
|
|
57
|
+
};
|
|
58
|
+
return this.request("POST", "/engram/v1/observe", body, { noRetry: true });
|
|
59
|
+
}
|
|
60
|
+
async store(request) {
|
|
61
|
+
const body = {
|
|
62
|
+
...request,
|
|
63
|
+
namespace: request.namespace ?? this.defaultNamespace,
|
|
64
|
+
sessionKey: request.sessionKey ?? this.defaultSessionKey
|
|
65
|
+
};
|
|
66
|
+
return this.request("POST", "/engram/v1/memories", body, { noRetry: true });
|
|
67
|
+
}
|
|
68
|
+
async submitSuggestion(request) {
|
|
69
|
+
const body = {
|
|
70
|
+
...request,
|
|
71
|
+
namespace: request.namespace ?? this.defaultNamespace,
|
|
72
|
+
sessionKey: request.sessionKey ?? this.defaultSessionKey
|
|
73
|
+
};
|
|
74
|
+
return this.request("POST", "/engram/v1/suggestions", body, { noRetry: true });
|
|
75
|
+
}
|
|
76
|
+
// -----------------------------------------------------------------------
|
|
77
|
+
// Browse / read methods
|
|
78
|
+
// -----------------------------------------------------------------------
|
|
79
|
+
async getEntities(options) {
|
|
80
|
+
const params = {
|
|
81
|
+
namespace: options?.namespace ?? this.defaultNamespace
|
|
82
|
+
};
|
|
83
|
+
if (options?.query) params.q = options.query;
|
|
84
|
+
if (options?.limit !== void 0) params.limit = options.limit;
|
|
85
|
+
if (options?.offset !== void 0) params.offset = options.offset;
|
|
86
|
+
return this.request(
|
|
87
|
+
"GET",
|
|
88
|
+
`/engram/v1/entities${this.queryString(params)}`
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
async getEntity(name, options) {
|
|
92
|
+
try {
|
|
93
|
+
return await this.request(
|
|
94
|
+
"GET",
|
|
95
|
+
`/engram/v1/entities/${encodeURIComponent(name)}${this.queryString({ namespace: options?.namespace ?? this.defaultNamespace })}`
|
|
96
|
+
);
|
|
97
|
+
} catch (err) {
|
|
98
|
+
if (err instanceof HermesError && err.status === 404) {
|
|
99
|
+
return { found: false };
|
|
100
|
+
}
|
|
101
|
+
throw err;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
async getMemories(options) {
|
|
105
|
+
const params = {
|
|
106
|
+
namespace: options?.namespace ?? this.defaultNamespace
|
|
107
|
+
};
|
|
108
|
+
if (options?.query) params.q = options.query;
|
|
109
|
+
if (options?.status) params.status = options.status;
|
|
110
|
+
if (options?.category) params.category = options.category;
|
|
111
|
+
if (options?.sort) params.sort = options.sort;
|
|
112
|
+
if (options?.limit !== void 0) params.limit = options.limit;
|
|
113
|
+
if (options?.offset !== void 0) params.offset = options.offset;
|
|
114
|
+
return this.request(
|
|
115
|
+
"GET",
|
|
116
|
+
`/engram/v1/memories${this.queryString(params)}`
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
async getMemory(id, options) {
|
|
120
|
+
try {
|
|
121
|
+
return await this.request(
|
|
122
|
+
"GET",
|
|
123
|
+
`/engram/v1/memories/${encodeURIComponent(id)}${this.queryString({ namespace: options?.namespace ?? this.defaultNamespace })}`
|
|
124
|
+
);
|
|
125
|
+
} catch (err) {
|
|
126
|
+
if (err instanceof HermesError && err.status === 404) {
|
|
127
|
+
return { found: false };
|
|
128
|
+
}
|
|
129
|
+
throw err;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
async lcmSearch(query, options) {
|
|
133
|
+
const body = {
|
|
134
|
+
query,
|
|
135
|
+
sessionKey: options?.sessionKey ?? this.defaultSessionKey,
|
|
136
|
+
namespace: options?.namespace ?? this.defaultNamespace,
|
|
137
|
+
...options?.limit !== void 0 ? { limit: options.limit } : {}
|
|
138
|
+
};
|
|
139
|
+
return this.request("POST", "/engram/v1/lcm/search", body);
|
|
140
|
+
}
|
|
141
|
+
// -----------------------------------------------------------------------
|
|
142
|
+
// Internal helpers
|
|
143
|
+
// -----------------------------------------------------------------------
|
|
144
|
+
queryString(params) {
|
|
145
|
+
if (!params) return "";
|
|
146
|
+
const parts = [];
|
|
147
|
+
for (const [key, value] of Object.entries(params)) {
|
|
148
|
+
if (value !== void 0 && value !== null && value !== "") {
|
|
149
|
+
parts.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
return parts.length > 0 ? `?${parts.join("&")}` : "";
|
|
153
|
+
}
|
|
154
|
+
async request(method, path, body, options) {
|
|
155
|
+
const isMutating = options?.noRetry === true;
|
|
156
|
+
const maxAttempts = isMutating ? 1 : this.maxRetries + 1;
|
|
157
|
+
let lastError = null;
|
|
158
|
+
let lastRateLimitError = null;
|
|
159
|
+
for (let attempt = 0; attempt < maxAttempts; attempt++) {
|
|
160
|
+
if (attempt > 0) {
|
|
161
|
+
const delay = this.retryBaseDelayMs * Math.pow(2, attempt - 1);
|
|
162
|
+
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
163
|
+
}
|
|
164
|
+
let timeout;
|
|
165
|
+
try {
|
|
166
|
+
const url = `${this.baseUrl}${path}`;
|
|
167
|
+
const controller = new AbortController();
|
|
168
|
+
timeout = setTimeout(() => controller.abort(), this.timeoutMs);
|
|
169
|
+
const headers = {
|
|
170
|
+
"Authorization": `Bearer ${this.authToken}`,
|
|
171
|
+
"Content-Type": "application/json"
|
|
172
|
+
};
|
|
173
|
+
const response = await fetch(url, {
|
|
174
|
+
method,
|
|
175
|
+
headers,
|
|
176
|
+
body: body ? JSON.stringify(body) : void 0,
|
|
177
|
+
signal: controller.signal
|
|
178
|
+
});
|
|
179
|
+
clearTimeout(timeout);
|
|
180
|
+
timeout = void 0;
|
|
181
|
+
if (response.ok) {
|
|
182
|
+
if (response.status === 204) return {};
|
|
183
|
+
return await response.json();
|
|
184
|
+
}
|
|
185
|
+
if (response.status === 429) {
|
|
186
|
+
const retryAfter = response.headers.get("retry-after");
|
|
187
|
+
let waitMs = this.retryBaseDelayMs * 4;
|
|
188
|
+
if (retryAfter) {
|
|
189
|
+
const parsed = parseInt(retryAfter, 10);
|
|
190
|
+
if (Number.isFinite(parsed) && parsed > 0) {
|
|
191
|
+
waitMs = parsed * 1e3;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
const errorBody = await response.json().catch(() => ({ error: "rate_limited", code: "rate_limited" }));
|
|
195
|
+
lastRateLimitError = new HermesError(429, errorBody.code ?? "rate_limited", errorBody.error);
|
|
196
|
+
await new Promise((resolve) => setTimeout(resolve, waitMs));
|
|
197
|
+
continue;
|
|
198
|
+
}
|
|
199
|
+
if (response.status >= 400 && response.status < 500) {
|
|
200
|
+
const error = await response.json();
|
|
201
|
+
throw new HermesError(
|
|
202
|
+
response.status,
|
|
203
|
+
error.code ?? `http_${response.status}`,
|
|
204
|
+
error.error,
|
|
205
|
+
error.details
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
lastError = new Error(`HTTP ${response.status}`);
|
|
209
|
+
continue;
|
|
210
|
+
} catch (err) {
|
|
211
|
+
if (timeout !== void 0) clearTimeout(timeout);
|
|
212
|
+
if (err instanceof HermesError) throw err;
|
|
213
|
+
if (err instanceof DOMException && err.name === "AbortError") {
|
|
214
|
+
lastError = new Error(`request timed out after ${this.timeoutMs}ms`);
|
|
215
|
+
continue;
|
|
216
|
+
}
|
|
217
|
+
lastError = err;
|
|
218
|
+
continue;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
if (lastRateLimitError) throw lastRateLimitError;
|
|
222
|
+
throw lastError ?? new Error("request failed after retries");
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
export {
|
|
226
|
+
HermesClient,
|
|
227
|
+
HermesError
|
|
228
|
+
};
|
|
229
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @remnic/hermes-provider\n *\n * Typed HTTP client for the Remnic memory API.\n *\n * Usage:\n * const client = new HermesClient({ baseUrl: \"http://127.0.0.1:4318\", authToken: \"secret\" });\n * const health = await client.health();\n * const memories = await client.recall(\"what did I work on last week?\");\n */\n\n// ---------------------------------------------------------------------------\n// Configuration\n// ---------------------------------------------------------------------------\n\nexport interface HermesClientOptions {\n /** Base URL of the Engram HTTP server (e.g. \"http://127.0.0.1:4318\") */\n baseUrl: string;\n /** Bearer token for authentication */\n authToken: string;\n /** Default namespace for requests (optional) */\n namespace?: string;\n /** Default session key (optional) */\n sessionKey?: string;\n /** Max retries for server errors (default: 3) */\n maxRetries?: number;\n /** Base delay in ms between retries (default: 100) */\n retryBaseDelayMs?: number;\n /** Request timeout in ms (default: 5000) */\n timeoutMs?: number;\n}\n\n// ---------------------------------------------------------------------------\n// Response types\n// ---------------------------------------------------------------------------\n\nexport interface EngramAccessHealthResponse {\n ok: boolean;\n memoryDir: string;\n namespacesEnabled: boolean;\n defaultNamespace: string;\n searchBackend: string;\n qmdEnabled: boolean;\n nativeKnowledgeEnabled: boolean;\n projectionAvailable: boolean;\n}\n\nexport interface EngramAccessRecallResponse {\n context?: string;\n results?: Array<{ id: string; content: string; score?: number; category?: string }>;\n count?: number;\n traceId?: string;\n plannerMode?: string;\n fallbackUsed?: boolean;\n sourcesUsed?: string[];\n budgetsApplied?: Record<string, unknown>;\n latencyMs?: number;\n}\n\nexport interface EngramAccessObserveResponse {\n accepted: number;\n sessionKey: string;\n namespace?: string;\n lcmArchived?: boolean;\n extractionQueued?: boolean;\n}\n\nexport interface EngramAccessWriteResponse {\n memoryId?: string;\n status: string;\n dryRun?: boolean;\n idempotencyReplay?: boolean;\n path?: string;\n duplicateOf?: string;\n idempotencyKey?: string;\n}\n\nexport interface EngramAccessEntityListResponse {\n entities: Array<{ name: string; type: string; factCount?: number }>;\n total: number;\n}\n\nexport interface EngramAccessEntityGetResponse {\n found: boolean;\n entity?: { name: string; type: string; observations?: string[] };\n}\n\nexport interface EngramAccessMemoryBrowseResponse {\n memories: Array<Record<string, unknown>>;\n total: number;\n}\n\nexport interface EngramAccessMemoryGetResponse {\n found: boolean;\n memory?: Record<string, unknown>;\n}\n\nexport interface EngramAccessLcmSearchResponse {\n query: string;\n namespace?: string;\n results: Array<{ sessionId?: string; content?: string; turnIndex?: number }>;\n count: number;\n lcmEnabled: boolean;\n}\n\nexport interface RecallOptions {\n sessionKey?: string;\n namespace?: string;\n topK?: number;\n mode?: \"auto\" | \"no_recall\" | \"minimal\" | \"full\" | \"graph_mode\";\n includeDebug?: boolean;\n}\n\nexport interface ObserveOptions {\n namespace?: string;\n skipExtraction?: boolean;\n}\n\nexport interface MemoryStoreRequest {\n content: string;\n category?: string;\n confidence?: number;\n tags?: string[];\n entityRef?: string;\n ttl?: string;\n sourceReason?: string;\n sessionKey?: string;\n namespace?: string;\n idempotencyKey?: string;\n dryRun?: boolean;\n schemaVersion?: number;\n}\n\n// ---------------------------------------------------------------------------\n// Error types\n// ---------------------------------------------------------------------------\n\nexport class HermesError extends Error {\n constructor(\n readonly status: number,\n readonly code: string,\n message: string,\n readonly details?: Array<{ field: string; message: string }>,\n ) {\n super(message);\n }\n}\n\n// ---------------------------------------------------------------------------\n// Client\n// ---------------------------------------------------------------------------\n\nexport class HermesClient {\n private readonly baseUrl: string;\n private readonly authToken: string;\n private readonly defaultNamespace?: string;\n private readonly defaultSessionKey?: string;\n private readonly maxRetries: number;\n private readonly retryBaseDelayMs: number;\n private readonly timeoutMs: number;\n\n constructor(options: HermesClientOptions) {\n this.baseUrl = options.baseUrl.endsWith(\"/\") ? options.baseUrl.slice(0, -1) : options.baseUrl;\n this.authToken = options.authToken;\n this.defaultNamespace = options.namespace;\n this.defaultSessionKey = options.sessionKey;\n this.maxRetries = options.maxRetries ?? 3;\n this.retryBaseDelayMs = options.retryBaseDelayMs ?? 100;\n this.timeoutMs = options.timeoutMs ?? 5000;\n }\n\n // -----------------------------------------------------------------------\n // Core methods\n // -----------------------------------------------------------------------\n\n async health(): Promise<EngramAccessHealthResponse> {\n return this.request<EngramAccessHealthResponse>(\"GET\", \"/engram/v1/health\");\n }\n\n async recall(query: string, options?: RecallOptions): Promise<EngramAccessRecallResponse> {\n const body: Record<string, unknown> = {\n query,\n };\n const sk = options?.sessionKey ?? this.defaultSessionKey;\n if (sk) body.sessionKey = sk;\n const ns = options?.namespace ?? this.defaultNamespace;\n if (ns) body.namespace = ns;\n if (options?.topK !== undefined) body.topK = options.topK;\n if (options?.mode) body.mode = options.mode;\n if (options?.includeDebug !== undefined) body.includeDebug = options.includeDebug;\n return this.request<EngramAccessRecallResponse>(\"POST\", \"/engram/v1/recall\", body, { noRetry: true });\n }\n\n async observe(\n sessionKey: string,\n messages: Array<{ role: \"user\" | \"assistant\"; content: string }>,\n options?: ObserveOptions,\n ): Promise<EngramAccessObserveResponse> {\n const body: Record<string, unknown> = {\n sessionKey,\n messages,\n namespace: options?.namespace ?? this.defaultNamespace,\n skipExtraction: options?.skipExtraction ?? false,\n };\n return this.request<EngramAccessObserveResponse>(\"POST\", \"/engram/v1/observe\", body, { noRetry: true });\n }\n\n async store(request: MemoryStoreRequest): Promise<EngramAccessWriteResponse> {\n const body: Record<string, unknown> = {\n ...request,\n namespace: request.namespace ?? this.defaultNamespace,\n sessionKey: request.sessionKey ?? this.defaultSessionKey,\n };\n return this.request<EngramAccessWriteResponse>(\"POST\", \"/engram/v1/memories\", body, { noRetry: true });\n }\n\n async submitSuggestion(request: MemoryStoreRequest): Promise<EngramAccessWriteResponse> {\n const body: Record<string, unknown> = {\n ...request,\n namespace: request.namespace ?? this.defaultNamespace,\n sessionKey: request.sessionKey ?? this.defaultSessionKey,\n };\n return this.request<EngramAccessWriteResponse>(\"POST\", \"/engram/v1/suggestions\", body, { noRetry: true });\n }\n\n // -----------------------------------------------------------------------\n // Browse / read methods\n // -----------------------------------------------------------------------\n\n async getEntities(options?: {\n namespace?: string;\n query?: string;\n limit?: number;\n offset?: number;\n }): Promise<EngramAccessEntityListResponse> {\n const params: Record<string, unknown> = {\n namespace: options?.namespace ?? this.defaultNamespace,\n };\n if (options?.query) params.q = options.query;\n if (options?.limit !== undefined) params.limit = options.limit;\n if (options?.offset !== undefined) params.offset = options.offset;\n return this.request<EngramAccessEntityListResponse>(\n \"GET\",\n `/engram/v1/entities${this.queryString(params)}`,\n );\n }\n\n async getEntity(name: string, options?: { namespace?: string }): Promise<EngramAccessEntityGetResponse> {\n try {\n return await this.request<EngramAccessEntityGetResponse>(\n \"GET\",\n `/engram/v1/entities/${encodeURIComponent(name)}${this.queryString({ namespace: options?.namespace ?? this.defaultNamespace })}`,\n );\n } catch (err) {\n // 404 is a valid \"not found\" response for entity lookups\n if (err instanceof HermesError && err.status === 404) {\n return { found: false };\n }\n throw err;\n }\n }\n\n async getMemories(options?: {\n query?: string;\n status?: string;\n category?: string;\n namespace?: string;\n sort?: string;\n limit?: number;\n offset?: number;\n }): Promise<EngramAccessMemoryBrowseResponse> {\n const params: Record<string, unknown> = {\n namespace: options?.namespace ?? this.defaultNamespace,\n };\n // The HTTP API uses `q` for the search query parameter\n if (options?.query) params.q = options.query;\n if (options?.status) params.status = options.status;\n if (options?.category) params.category = options.category;\n if (options?.sort) params.sort = options.sort;\n if (options?.limit !== undefined) params.limit = options.limit;\n if (options?.offset !== undefined) params.offset = options.offset;\n return this.request<EngramAccessMemoryBrowseResponse>(\n \"GET\",\n `/engram/v1/memories${this.queryString(params)}`,\n );\n }\n\n async getMemory(id: string, options?: { namespace?: string }): Promise<EngramAccessMemoryGetResponse> {\n try {\n return await this.request<EngramAccessMemoryGetResponse>(\n \"GET\",\n `/engram/v1/memories/${encodeURIComponent(id)}${this.queryString({ namespace: options?.namespace ?? this.defaultNamespace })}`,\n );\n } catch (err) {\n // 404 is a valid \"not found\" response, not an error\n if (err instanceof HermesError && err.status === 404) {\n return { found: false };\n }\n throw err;\n }\n }\n\n async lcmSearch(\n query: string,\n options?: { sessionKey?: string; namespace?: string; limit?: number },\n ): Promise<EngramAccessLcmSearchResponse> {\n const body: Record<string, unknown> = {\n query,\n sessionKey: options?.sessionKey ?? this.defaultSessionKey,\n namespace: options?.namespace ?? this.defaultNamespace,\n ...(options?.limit !== undefined ? { limit: options.limit } : {}),\n };\n return this.request<EngramAccessLcmSearchResponse>(\"POST\", \"/engram/v1/lcm/search\", body);\n }\n\n // -----------------------------------------------------------------------\n // Internal helpers\n // -----------------------------------------------------------------------\n\n private queryString(params?: Record<string, unknown>): string {\n if (!params) return \"\";\n const parts: string[] = [];\n for (const [key, value] of Object.entries(params)) {\n if (value !== undefined && value !== null && value !== \"\") {\n parts.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);\n }\n }\n return parts.length > 0 ? `?${parts.join(\"&\")}` : \"\";\n }\n\n private async request<T>(method: string, path: string, body?: Record<string, unknown>, options?: { noRetry?: boolean }): Promise<T> {\n // Skip retries for state-mutating writes to prevent duplicate side effects.\n // Read-only POST endpoints (recall, lcm/search) are safe to retry.\n const isMutating = options?.noRetry === true;\n const maxAttempts = isMutating ? 1 : this.maxRetries + 1;\n let lastError: Error | null = null;\n let lastRateLimitError: HermesError | null = null;\n\n for (let attempt = 0; attempt < maxAttempts; attempt++) {\n if (attempt > 0) {\n const delay = this.retryBaseDelayMs * Math.pow(2, attempt - 1);\n await new Promise((resolve) => setTimeout(resolve, delay));\n }\n\n let timeout: ReturnType<typeof setTimeout> | undefined;\n try {\n const url = `${this.baseUrl}${path}`;\n const controller = new AbortController();\n timeout = setTimeout(() => controller.abort(), this.timeoutMs);\n\n const headers: Record<string, string> = {\n \"Authorization\": `Bearer ${this.authToken}`,\n \"Content-Type\": \"application/json\",\n };\n\n const response = await fetch(url, {\n method,\n headers,\n body: body ? JSON.stringify(body) : undefined,\n signal: controller.signal,\n });\n\n clearTimeout(timeout);\n timeout = undefined;\n\n // Success responses\n if (response.ok) {\n if (response.status === 204) return {} as T;\n return (await response.json()) as T;\n }\n\n // Rate-limited — back off and retry\n if (response.status === 429) {\n const retryAfter = response.headers.get(\"retry-after\");\n let waitMs = this.retryBaseDelayMs * 4;\n if (retryAfter) {\n const parsed = parseInt(retryAfter, 10);\n // Only use numeric seconds form; date-form Retry-After is ignored\n // (isNaN catches NaN from date-form headers like \"Fri, 04 Apr 2026\")\n if (Number.isFinite(parsed) && parsed > 0) {\n waitMs = parsed * 1000;\n }\n }\n const errorBody = await response.json().catch(() => ({ error: \"rate_limited\", code: \"rate_limited\" })) as { error: string; code?: string };\n lastRateLimitError = new HermesError(429, errorBody.code ?? \"rate_limited\", errorBody.error);\n await new Promise((resolve) => setTimeout(resolve, waitMs));\n continue;\n }\n\n // Client errors — do not retry\n if (response.status >= 400 && response.status < 500) {\n const error = (await response.json()) as {\n error: string;\n code?: string;\n details?: Array<{ field: string; message: string }>;\n };\n throw new HermesError(\n response.status,\n error.code ?? `http_${response.status}`,\n error.error,\n error.details,\n );\n }\n\n // Server error — retry\n lastError = new Error(`HTTP ${response.status}`);\n continue;\n } catch (err) {\n if (timeout !== undefined) clearTimeout(timeout);\n if (err instanceof HermesError) throw err;\n if (err instanceof DOMException && err.name === \"AbortError\") {\n lastError = new Error(`request timed out after ${this.timeoutMs}ms`);\n continue;\n }\n lastError = err as Error;\n continue;\n }\n }\n\n // If we exhausted retries due to rate limiting, throw the preserved 429 error\n if (lastRateLimitError) throw lastRateLimitError;\n throw lastError ?? new Error(\"request failed after retries\");\n }\n}\n"],"mappings":";;;AAyIO,IAAM,cAAN,cAA0B,MAAM;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TTP client for the Remnic memory API",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": ["dist"],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "tsup src/index.ts --format esm --dts",
|
|
17
|
+
"prepublishOnly": "npm run build"
|
|
18
|
+
},
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public",
|
|
21
|
+
"provenance": true
|
|
22
|
+
},
|
|
23
|
+
"peerDependencies": {},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"tsup": "^8.0.0",
|
|
26
|
+
"typescript": "^5.7.0"
|
|
27
|
+
},
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "https://github.com/joshuaswarren/remnic.git",
|
|
32
|
+
"directory": "packages/hermes-provider"
|
|
33
|
+
},
|
|
34
|
+
"keywords": ["remnic", "memory", "ai", "agent", "openclaw"]
|
|
35
|
+
}
|