purra-mem0 0.5.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/LICENSE +21 -0
- package/README.md +144 -0
- package/README.zh-CN.md +133 -0
- package/dist/context.d.ts +29 -0
- package/dist/context.js +69 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +6 -0
- package/dist/journal.d.ts +101 -0
- package/dist/journal.js +301 -0
- package/dist/memory.d.ts +213 -0
- package/dist/memory.js +841 -0
- package/dist/providers.d.ts +80 -0
- package/dist/providers.js +202 -0
- package/dist/workflow.d.ts +18 -0
- package/dist/workflow.js +60 -0
- package/package.json +47 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { Message, ModelTaskRunner, ModelTurn } from "purra";
|
|
2
|
+
import { Journal } from "./journal.js";
|
|
3
|
+
import type { Mem0Client } from "./memory.js";
|
|
4
|
+
/** Durable per-namespace envelope. Reservations are never refunded. */
|
|
5
|
+
export interface MemoryBudget {
|
|
6
|
+
readonly key: string;
|
|
7
|
+
readonly maxLlmCalls: number;
|
|
8
|
+
readonly maxEmbeddingCalls: number;
|
|
9
|
+
readonly maxInputChars: number;
|
|
10
|
+
readonly maxOutputTokens: number;
|
|
11
|
+
/** Per-call result sizing target. This does not reduce the Provider generation allowance. */
|
|
12
|
+
readonly resultCapacityTargetTokens: number;
|
|
13
|
+
}
|
|
14
|
+
export interface MemoryUsage {
|
|
15
|
+
readonly llmCalls: number;
|
|
16
|
+
readonly embeddingCalls: number;
|
|
17
|
+
readonly inputChars: number;
|
|
18
|
+
readonly reservedOutputTokens: number;
|
|
19
|
+
readonly reportedInputTokens: number;
|
|
20
|
+
readonly reportedOutputTokens: number;
|
|
21
|
+
readonly unreportedCalls: number;
|
|
22
|
+
readonly unsettledCalls: number;
|
|
23
|
+
}
|
|
24
|
+
export interface EmbeddingResult {
|
|
25
|
+
readonly vectors: readonly (readonly number[])[];
|
|
26
|
+
readonly inputTokens?: number;
|
|
27
|
+
}
|
|
28
|
+
/** Trusted callbacks: preserve the result-capacity target and disable hidden retries. */
|
|
29
|
+
export interface MemoryProviders {
|
|
30
|
+
readonly budget: MemoryBudget;
|
|
31
|
+
readonly complete: (messages: readonly Message[], resultCapacityTargetTokens: number, signal: AbortSignal) => Promise<ModelTurn>;
|
|
32
|
+
readonly embed: (texts: readonly string[], signal: AbortSignal) => Promise<EmbeddingResult>;
|
|
33
|
+
}
|
|
34
|
+
/** Use the real Run-injected runner. Background ingestion must not fabricate a Run. */
|
|
35
|
+
export declare function runModel(runner: ModelTaskRunner): MemoryProviders["complete"];
|
|
36
|
+
export declare function providerLimits(providers: MemoryProviders): Record<string, number>;
|
|
37
|
+
export declare function currentExecution(journal?: Journal): ProviderExecution | undefined;
|
|
38
|
+
export declare class ProviderExecution {
|
|
39
|
+
readonly providers: MemoryProviders;
|
|
40
|
+
readonly journal: Journal;
|
|
41
|
+
readonly dimensions: number;
|
|
42
|
+
readonly maxResults: number;
|
|
43
|
+
readonly maxInput: number;
|
|
44
|
+
readonly controller: AbortController;
|
|
45
|
+
readonly deadline: number;
|
|
46
|
+
operation: string | undefined;
|
|
47
|
+
error: string | undefined;
|
|
48
|
+
constructor(providers: MemoryProviders, journal: Journal, dimensions: number, timeoutMs: number, maxResults: number, maxInput: number);
|
|
49
|
+
stop(code: string): void;
|
|
50
|
+
check(): void;
|
|
51
|
+
run<T>(work: () => Promise<T>): Promise<T>;
|
|
52
|
+
invoke(kind: "llm", values: readonly Message[], extraction?: boolean): Promise<string>;
|
|
53
|
+
invoke(kind: "embedding", values: readonly string[]): Promise<number[][]>;
|
|
54
|
+
}
|
|
55
|
+
/** Host owns the SDK handle and its storage resources. */
|
|
56
|
+
export declare class ManagedMem0Client implements Mem0Client {
|
|
57
|
+
readonly sdk: Mem0Client;
|
|
58
|
+
readonly dimensions: number;
|
|
59
|
+
constructor(sdk: Mem0Client, dimensions: number);
|
|
60
|
+
add(...args: Parameters<Mem0Client["add"]>): Promise<unknown>;
|
|
61
|
+
get(...args: Parameters<Mem0Client["get"]>): Promise<unknown>;
|
|
62
|
+
getAll(...args: Parameters<Mem0Client["getAll"]>): Promise<unknown>;
|
|
63
|
+
search(...args: Parameters<Mem0Client["search"]>): Promise<unknown>;
|
|
64
|
+
update(...args: Parameters<Mem0Client["update"]>): Promise<unknown>;
|
|
65
|
+
delete(...args: Parameters<Mem0Client["delete"]>): Promise<unknown>;
|
|
66
|
+
history(...args: Parameters<Mem0Client["history"]>): Promise<unknown>;
|
|
67
|
+
}
|
|
68
|
+
export interface ManagedMem0Config {
|
|
69
|
+
readonly vectorStore: {
|
|
70
|
+
readonly provider: string;
|
|
71
|
+
readonly config: Record<string, unknown>;
|
|
72
|
+
};
|
|
73
|
+
readonly historyDbPath: string;
|
|
74
|
+
readonly customInstructions?: string;
|
|
75
|
+
}
|
|
76
|
+
/** Only storage/history/instructions are accepted; no unmetered reranker or graph provider. */
|
|
77
|
+
export declare function createManagedClient(options: {
|
|
78
|
+
config: ManagedMem0Config;
|
|
79
|
+
embeddingDims: number;
|
|
80
|
+
}): Promise<ManagedMem0Client>;
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
|
+
import { Journal, MemoryError } from "./journal.js";
|
|
3
|
+
/** Use the real Run-injected runner. Background ingestion must not fabricate a Run. */
|
|
4
|
+
export function runModel(runner) {
|
|
5
|
+
return async (messages, resultCapacityTargetTokens, signal) => (await runner.complete(messages, {
|
|
6
|
+
resultCapacityTargetTokens,
|
|
7
|
+
resultCapacitySource: "workflow_policy",
|
|
8
|
+
signal,
|
|
9
|
+
})).turn;
|
|
10
|
+
}
|
|
11
|
+
export function providerLimits(providers) {
|
|
12
|
+
if (typeof providers?.complete !== "function" || typeof providers?.embed !== "function")
|
|
13
|
+
throw new TypeError("invalid memory providers");
|
|
14
|
+
const b = providers.budget;
|
|
15
|
+
if (typeof b?.key !== "string" || !b.key.trim() || [...b.key].length > 512)
|
|
16
|
+
throw new TypeError("invalid budget key");
|
|
17
|
+
const limits = { max_llm_calls: b.maxLlmCalls, max_embedding_calls: b.maxEmbeddingCalls,
|
|
18
|
+
max_input_chars: b.maxInputChars, max_output_tokens: b.maxOutputTokens,
|
|
19
|
+
result_capacity_target_tokens: b.resultCapacityTargetTokens };
|
|
20
|
+
for (const [name, value] of Object.entries(limits)) {
|
|
21
|
+
if (!Number.isSafeInteger(value) || value < (name === "result_capacity_target_tokens" ? 1 : 0) || value > 2 ** 31 - 1)
|
|
22
|
+
throw new TypeError(`invalid ${name}`);
|
|
23
|
+
}
|
|
24
|
+
return limits;
|
|
25
|
+
}
|
|
26
|
+
const current = new AsyncLocalStorage();
|
|
27
|
+
export function currentExecution(journal) {
|
|
28
|
+
const value = current.getStore();
|
|
29
|
+
return journal === undefined || value?.journal === journal ? value : undefined;
|
|
30
|
+
}
|
|
31
|
+
function execution() {
|
|
32
|
+
const value = currentExecution();
|
|
33
|
+
if (!value)
|
|
34
|
+
throw new MemoryError("memory_provider_unbound");
|
|
35
|
+
return value;
|
|
36
|
+
}
|
|
37
|
+
export class ProviderExecution {
|
|
38
|
+
providers;
|
|
39
|
+
journal;
|
|
40
|
+
dimensions;
|
|
41
|
+
maxResults;
|
|
42
|
+
maxInput;
|
|
43
|
+
controller = new AbortController();
|
|
44
|
+
deadline;
|
|
45
|
+
operation;
|
|
46
|
+
error;
|
|
47
|
+
constructor(providers, journal, dimensions, timeoutMs, maxResults, maxInput) {
|
|
48
|
+
this.providers = providers;
|
|
49
|
+
this.journal = journal;
|
|
50
|
+
this.dimensions = dimensions;
|
|
51
|
+
this.maxResults = maxResults;
|
|
52
|
+
this.maxInput = maxInput;
|
|
53
|
+
this.deadline = performance.now() + timeoutMs;
|
|
54
|
+
}
|
|
55
|
+
stop(code) {
|
|
56
|
+
if (!this.error) {
|
|
57
|
+
this.error = code;
|
|
58
|
+
if (this.operation)
|
|
59
|
+
this.journal.providerError(this.operation, code);
|
|
60
|
+
}
|
|
61
|
+
this.controller.abort(new MemoryError(this.error));
|
|
62
|
+
}
|
|
63
|
+
check() {
|
|
64
|
+
if (performance.now() >= this.deadline)
|
|
65
|
+
this.stop("memory_timeout");
|
|
66
|
+
if (this.error)
|
|
67
|
+
throw new MemoryError(this.error);
|
|
68
|
+
}
|
|
69
|
+
run(work) {
|
|
70
|
+
return current.run(this, async () => {
|
|
71
|
+
try {
|
|
72
|
+
this.check();
|
|
73
|
+
const result = await work();
|
|
74
|
+
this.check(); // SDK fallback must not convert a swallowed denial to success.
|
|
75
|
+
return result;
|
|
76
|
+
}
|
|
77
|
+
catch (error) {
|
|
78
|
+
if (this.error)
|
|
79
|
+
throw new MemoryError(this.error);
|
|
80
|
+
throw error;
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
async invoke(kind, values, extraction = true) {
|
|
85
|
+
this.check();
|
|
86
|
+
const resultTarget = kind === "llm" ? this.providers.budget.resultCapacityTargetTokens : 0;
|
|
87
|
+
const chars = values.reduce((sum, value) => sum + [...(typeof value === "string" ? value : value.content)].length, 0);
|
|
88
|
+
let id;
|
|
89
|
+
try {
|
|
90
|
+
id = this.journal.admit(this.providers.budget.key, this.operation, kind, chars, resultTarget);
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
this.stop(error instanceof MemoryError ? error.code : "memory_provider_error");
|
|
94
|
+
throw new MemoryError(this.error);
|
|
95
|
+
}
|
|
96
|
+
let inputTokens = null;
|
|
97
|
+
let generationTokens = null;
|
|
98
|
+
try {
|
|
99
|
+
this.check();
|
|
100
|
+
let content;
|
|
101
|
+
if (kind === "llm") {
|
|
102
|
+
const result = await this.providers.complete(values, resultTarget, this.controller.signal);
|
|
103
|
+
if (result?.usage) {
|
|
104
|
+
if (!validTokens(result.usage.inputTokens) || (result.usage.generationTokens !== undefined && !validTokens(result.usage.generationTokens))) {
|
|
105
|
+
throw new MemoryError("memory_provider_contract");
|
|
106
|
+
}
|
|
107
|
+
inputTokens = result.usage.inputTokens;
|
|
108
|
+
generationTokens = result.usage.generationTokens ?? null;
|
|
109
|
+
}
|
|
110
|
+
const appliedGenerationLimit = result?.appliedGenerationLimit;
|
|
111
|
+
if (!Number.isSafeInteger(appliedGenerationLimit) || appliedGenerationLimit < resultTarget
|
|
112
|
+
|| result.finishReason !== "stop" || result.message?.role !== "assistant"
|
|
113
|
+
|| result.message.toolCalls?.length || typeof result.message.content !== "string"
|
|
114
|
+
|| (generationTokens !== null && generationTokens > appliedGenerationLimit)) {
|
|
115
|
+
throw new MemoryError("memory_provider_contract");
|
|
116
|
+
}
|
|
117
|
+
content = result.message.content;
|
|
118
|
+
if (extraction) {
|
|
119
|
+
let parsed;
|
|
120
|
+
try {
|
|
121
|
+
parsed = JSON.parse(content);
|
|
122
|
+
}
|
|
123
|
+
catch {
|
|
124
|
+
throw new MemoryError("memory_invalid_extraction");
|
|
125
|
+
}
|
|
126
|
+
if (!parsed || !Array.isArray(parsed.memory) || parsed.memory.length > this.maxResults)
|
|
127
|
+
throw new MemoryError("memory_invalid_extraction");
|
|
128
|
+
for (const item of parsed.memory) {
|
|
129
|
+
if (!item || typeof item.text !== "string" || !item.text.trim() || [...item.text].length > this.maxInput
|
|
130
|
+
|| (item.entities !== undefined && (!Array.isArray(item.entities) || item.entities.some(e => typeof e !== "string")))) {
|
|
131
|
+
throw new MemoryError("memory_invalid_extraction");
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
const result = await this.providers.embed(values, this.controller.signal);
|
|
138
|
+
if (result?.inputTokens !== undefined && !validTokens(result.inputTokens))
|
|
139
|
+
throw new MemoryError("memory_provider_contract");
|
|
140
|
+
inputTokens = result.inputTokens ?? null;
|
|
141
|
+
generationTokens = 0;
|
|
142
|
+
if (!Array.isArray(result.vectors) || result.vectors.length !== values.length || result.vectors.some(v => !Array.isArray(v) || v.length !== this.dimensions || v.some(x => typeof x !== "number" || !Number.isFinite(x)))) {
|
|
143
|
+
throw new MemoryError("memory_provider_contract");
|
|
144
|
+
}
|
|
145
|
+
content = result.vectors.map(v => [...v]);
|
|
146
|
+
}
|
|
147
|
+
this.check();
|
|
148
|
+
this.journal.settle(id, "complete", inputTokens, generationTokens);
|
|
149
|
+
return content;
|
|
150
|
+
}
|
|
151
|
+
catch (error) {
|
|
152
|
+
this.journal.settle(id, "failed", inputTokens, generationTokens);
|
|
153
|
+
this.stop(error instanceof MemoryError ? error.code : "memory_provider_error");
|
|
154
|
+
throw new MemoryError(this.error);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
function validTokens(value) { return Number.isSafeInteger(value) && value >= 0 && value <= 2 ** 31 - 1; }
|
|
159
|
+
/** Host owns the SDK handle and its storage resources. */
|
|
160
|
+
export class ManagedMem0Client {
|
|
161
|
+
sdk;
|
|
162
|
+
dimensions;
|
|
163
|
+
constructor(sdk, dimensions) {
|
|
164
|
+
this.sdk = sdk;
|
|
165
|
+
this.dimensions = dimensions;
|
|
166
|
+
}
|
|
167
|
+
add(...args) { return this.sdk.add(...args); }
|
|
168
|
+
get(...args) { return this.sdk.get(...args); }
|
|
169
|
+
getAll(...args) { return this.sdk.getAll(...args); }
|
|
170
|
+
search(...args) { return this.sdk.search(...args); }
|
|
171
|
+
update(...args) { return this.sdk.update(...args); }
|
|
172
|
+
delete(...args) { return this.sdk.delete(...args); }
|
|
173
|
+
history(...args) { return this.sdk.history(...args); }
|
|
174
|
+
}
|
|
175
|
+
/** Only storage/history/instructions are accepted; no unmetered reranker or graph provider. */
|
|
176
|
+
export async function createManagedClient(options) {
|
|
177
|
+
const { config, embeddingDims } = options;
|
|
178
|
+
if (!Number.isSafeInteger(embeddingDims) || embeddingDims < 1 || embeddingDims > 65_536)
|
|
179
|
+
throw new TypeError("invalid embeddingDims");
|
|
180
|
+
if (!config || Object.keys(config).some(k => !["vectorStore", "historyDbPath", "customInstructions"].includes(k)))
|
|
181
|
+
throw new TypeError("managed config accepts only storage/history/instructions");
|
|
182
|
+
if (!config.vectorStore || typeof config.historyDbPath !== "string" || !config.historyDbPath.trim())
|
|
183
|
+
throw new TypeError("explicit vectorStore and historyDbPath are required");
|
|
184
|
+
const { Memory } = await import("mem0ai/oss");
|
|
185
|
+
const sdk = new Memory({ ...config,
|
|
186
|
+
llm: { provider: "langchain", config: { model: { async invoke(messages) {
|
|
187
|
+
const roles = { human: "user", ai: "assistant", system: "system" };
|
|
188
|
+
const converted = messages.map(message => {
|
|
189
|
+
const role = roles[(message.type ?? message.getType?.())];
|
|
190
|
+
if (!role || typeof message.content !== "string")
|
|
191
|
+
throw new MemoryError("memory_provider_contract");
|
|
192
|
+
return { role, content: message.content };
|
|
193
|
+
});
|
|
194
|
+
return { content: await execution().invoke("llm", converted) };
|
|
195
|
+
} } } },
|
|
196
|
+
embedder: { provider: "langchain", config: { embeddingDims, model: {
|
|
197
|
+
async embedQuery(text) { return (await execution().invoke("embedding", [text]))[0]; },
|
|
198
|
+
async embedDocuments(texts) { return execution().invoke("embedding", texts); },
|
|
199
|
+
} } },
|
|
200
|
+
});
|
|
201
|
+
return new ManagedMem0Client(sdk, embeddingDims);
|
|
202
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Mem0Memory } from "./memory.js";
|
|
2
|
+
import type { MemoryOperation, MemoryRecord, MemoryResolution, MemoryReview } from "./memory.js";
|
|
3
|
+
export type MemoryDecisionPolicy = (candidate: MemoryRecord, review: MemoryReview) => Promise<MemoryResolution | undefined> | MemoryResolution | undefined;
|
|
4
|
+
export interface MemoryWorkflowResult {
|
|
5
|
+
readonly extraction: MemoryOperation;
|
|
6
|
+
readonly resolutions: readonly MemoryOperation[];
|
|
7
|
+
readonly pendingIds: readonly string[];
|
|
8
|
+
}
|
|
9
|
+
/** Reuse the journal on retry; authorization remains an explicit host policy. */
|
|
10
|
+
export declare class MemoryWorkflow {
|
|
11
|
+
#private;
|
|
12
|
+
constructor(memory: Mem0Memory, options?: {
|
|
13
|
+
policy?: MemoryDecisionPolicy;
|
|
14
|
+
policyRevision?: string;
|
|
15
|
+
reviewLimit?: number;
|
|
16
|
+
});
|
|
17
|
+
capture(messages: Parameters<Mem0Memory["extract"]>[0], options: Parameters<Mem0Memory["extract"]>[1]): Promise<MemoryWorkflowResult>;
|
|
18
|
+
}
|
package/dist/workflow.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { Mem0Memory, requiredText, positiveInteger } from "./memory.js";
|
|
3
|
+
function digest(value) { return createHash("sha256").update(value).digest("hex"); }
|
|
4
|
+
/** Reuse the journal on retry; authorization remains an explicit host policy. */
|
|
5
|
+
export class MemoryWorkflow {
|
|
6
|
+
#memory;
|
|
7
|
+
#policy;
|
|
8
|
+
#revision;
|
|
9
|
+
#limit;
|
|
10
|
+
constructor(memory, options = {}) {
|
|
11
|
+
this.#memory = memory;
|
|
12
|
+
this.#policy = options.policy;
|
|
13
|
+
if (this.#policy !== undefined && typeof this.#policy !== "function")
|
|
14
|
+
throw new TypeError("policy must be callable");
|
|
15
|
+
this.#revision = requiredText(options.policyRevision ?? "review-only", "policy revision", 512);
|
|
16
|
+
this.#limit = positiveInteger(options.reviewLimit ?? 8, "review limit", 32);
|
|
17
|
+
}
|
|
18
|
+
async capture(messages, options) {
|
|
19
|
+
const prefix = "workflow:" + digest(requiredText(options.key, "workflow key", 512));
|
|
20
|
+
const extraction = await this.#memory.extract(messages, { ...options, key: prefix + ":extract" });
|
|
21
|
+
const resolutions = [];
|
|
22
|
+
const pendingIds = [];
|
|
23
|
+
if (extraction.state === "complete")
|
|
24
|
+
for (const id of extraction.ids) {
|
|
25
|
+
const suffix = digest(this.#revision + "\0" + id);
|
|
26
|
+
const resolveKey = prefix + ":resolve:" + suffix;
|
|
27
|
+
const existing = this.#memory.operation(resolveKey);
|
|
28
|
+
if (existing) {
|
|
29
|
+
resolutions.push(existing);
|
|
30
|
+
if (existing.state !== "complete")
|
|
31
|
+
pendingIds.push(id);
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
const signal = options.signal === undefined ? {} : { signal: options.signal };
|
|
35
|
+
const record = await this.#memory.get(id, { includeInactive: true, ...signal });
|
|
36
|
+
if (!record || record.state !== "pending")
|
|
37
|
+
continue;
|
|
38
|
+
const reviewed = await this.#memory.review({ id, version: record.version }, {
|
|
39
|
+
key: prefix + ":review:" + suffix, limit: this.#limit, ...signal,
|
|
40
|
+
});
|
|
41
|
+
if (reviewed.state !== "complete" || !reviewed.review || !this.#policy) {
|
|
42
|
+
pendingIds.push(id);
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
const decision = await this.#policy(record, reviewed.review);
|
|
46
|
+
if (!decision) {
|
|
47
|
+
pendingIds.push(id);
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
if (decision.reviewKey !== reviewed.review.key || !decision.items.some(ref => ref.id === id && ref.version === record.version)) {
|
|
51
|
+
throw new TypeError("Workflow decision must include the candidate and its review key");
|
|
52
|
+
}
|
|
53
|
+
const resolved = await this.#memory.resolve(decision, { key: resolveKey, ...signal });
|
|
54
|
+
resolutions.push(resolved);
|
|
55
|
+
if (resolved.state !== "complete")
|
|
56
|
+
pendingIds.push(id);
|
|
57
|
+
}
|
|
58
|
+
return Object.freeze({ extraction, resolutions: Object.freeze(resolutions), pendingIds: Object.freeze(pendingIds) });
|
|
59
|
+
}
|
|
60
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "purra-mem0",
|
|
3
|
+
"version": "0.5.0",
|
|
4
|
+
"description": "Scoped Mem0 OSS memory integration for PurrA",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"engines": {
|
|
9
|
+
"node": ">=22.13.0"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist",
|
|
13
|
+
"README.md",
|
|
14
|
+
"LICENSE"
|
|
15
|
+
],
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"import": "./dist/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./package.json": "./package.json"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "tsc -p tsconfig.json",
|
|
25
|
+
"test": "node --test test/*.test.mjs",
|
|
26
|
+
"test:types": "tsc -p test/tsconfig.json",
|
|
27
|
+
"test:sdk": "tsc -p test/tsconfig.sdk.json && node scripts/check-sdk.mjs",
|
|
28
|
+
"check": "npm run build && npm test && npm run test:types",
|
|
29
|
+
"prepack": "npm run build"
|
|
30
|
+
},
|
|
31
|
+
"peerDependencies": {
|
|
32
|
+
"mem0ai": "3.1.7",
|
|
33
|
+
"purra": "0.5.0",
|
|
34
|
+
"@langchain/core": "1.1.47"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@langchain/core": "1.1.47",
|
|
38
|
+
"@types/node": "22.20.1",
|
|
39
|
+
"purra": "file:../../../typescript",
|
|
40
|
+
"typescript": "7.0.2"
|
|
41
|
+
},
|
|
42
|
+
"peerDependenciesMeta": {
|
|
43
|
+
"@langchain/core": {
|
|
44
|
+
"optional": true
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|