Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@ziro-agent/memory

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ziro-agent/memory - npm Package Compare versions

Comparing version
0.4.0
to
0.5.0
+53
dist/node.cjs
'use strict';
var crypto = require('crypto');
var promises = require('fs/promises');
var path = require('path');
// src/file-backed-working-memory.ts
function backingFilePath(baseDir, scope, key) {
const h = crypto.createHash("sha256").update(`${scope}\0${key}`).digest("hex").slice(0, 32);
return path.join(baseDir, `${scope}-${h}.working.md`);
}
var FileBackedWorkingMemory = class {
constructor(scope, key, baseDir) {
this.scope = scope;
this.key = key;
this.filePath = backingFilePath(baseDir, scope, key);
}
scope;
key;
filePath;
async read() {
try {
return await promises.readFile(this.filePath, "utf8");
} catch (e) {
const err = e;
if (err.code === "ENOENT") return "";
throw e;
}
}
async write(markdown) {
await promises.mkdir(path.dirname(this.filePath), { recursive: true });
await promises.writeFile(this.filePath, markdown, "utf8");
}
async append(markdown) {
let cur = await this.read();
if (cur.length > 0 && !cur.endsWith("\n")) cur += "\n";
cur += markdown;
await this.write(cur);
}
async clear() {
try {
await promises.unlink(this.filePath);
} catch (e) {
const err = e;
if (err.code === "ENOENT") return;
throw e;
}
}
};
exports.FileBackedWorkingMemory = FileBackedWorkingMemory;
//# sourceMappingURL=node.cjs.map
//# sourceMappingURL=node.cjs.map
{"version":3,"sources":["../src/file-backed-working-memory.ts"],"names":["createHash","join","readFile","mkdir","dirname","writeFile","unlink"],"mappings":";;;;;;;AASA,SAAS,eAAA,CAAgB,OAAA,EAAiB,KAAA,EAA2B,GAAA,EAAqB;AACxF,EAAA,MAAM,IAAIA,iBAAA,CAAW,QAAQ,CAAA,CAAE,MAAA,CAAO,GAAG,KAAK,CAAA,EAAA,EAAK,GAAG,CAAA,CAAE,EAAE,MAAA,CAAO,KAAK,CAAA,CAAE,KAAA,CAAM,GAAG,EAAE,CAAA;AACnF,EAAA,OAAOC,UAAK,OAAA,EAAS,CAAA,EAAG,KAAK,CAAA,CAAA,EAAI,CAAC,CAAA,WAAA,CAAa,CAAA;AACjD;AAMO,IAAM,0BAAN,MAAuD;AAAA,EAG5D,WAAA,CACW,KAAA,EACA,GAAA,EAET,OAAA,EACA;AAJS,IAAA,IAAA,CAAA,KAAA,GAAA,KAAA;AACA,IAAA,IAAA,CAAA,GAAA,GAAA,GAAA;AAIT,IAAA,IAAA,CAAK,QAAA,GAAW,eAAA,CAAgB,OAAA,EAAS,KAAA,EAAO,GAAG,CAAA;AAAA,EACrD;AAAA,EANW,KAAA;AAAA,EACA,GAAA;AAAA,EAJM,QAAA;AAAA,EAWjB,MAAM,IAAA,GAAwB;AAC5B,IAAA,IAAI;AACF,MAAA,OAAO,MAAMC,iBAAA,CAAS,IAAA,CAAK,QAAA,EAAU,MAAM,CAAA;AAAA,IAC7C,SAAS,CAAA,EAAG;AACV,MAAA,MAAM,GAAA,GAAM,CAAA;AACZ,MAAA,IAAI,GAAA,CAAI,IAAA,KAAS,QAAA,EAAU,OAAO,EAAA;AAClC,MAAA,MAAM,CAAA;AAAA,IACR;AAAA,EACF;AAAA,EAEA,MAAM,MAAM,QAAA,EAAiC;AAC3C,IAAA,MAAMC,cAAA,CAAMC,aAAQ,IAAA,CAAK,QAAQ,GAAG,EAAE,SAAA,EAAW,MAAM,CAAA;AACvD,IAAA,MAAMC,kBAAA,CAAU,IAAA,CAAK,QAAA,EAAU,QAAA,EAAU,MAAM,CAAA;AAAA,EACjD;AAAA,EAEA,MAAM,OAAO,QAAA,EAAiC;AAC5C,IAAA,IAAI,GAAA,GAAM,MAAM,IAAA,CAAK,IAAA,EAAK;AAC1B,IAAA,IAAI,GAAA,CAAI,SAAS,CAAA,IAAK,CAAC,IAAI,QAAA,CAAS,IAAI,GAAG,GAAA,IAAO,IAAA;AAClD,IAAA,GAAA,IAAO,QAAA;AACP,IAAA,MAAM,IAAA,CAAK,MAAM,GAAG,CAAA;AAAA,EACtB;AAAA,EAEA,MAAM,KAAA,GAAuB;AAC3B,IAAA,IAAI;AACF,MAAA,MAAMC,eAAA,CAAO,KAAK,QAAQ,CAAA;AAAA,IAC5B,SAAS,CAAA,EAAG;AACV,MAAA,MAAM,GAAA,GAAM,CAAA;AACZ,MAAA,IAAI,GAAA,CAAI,SAAS,QAAA,EAAU;AAC3B,MAAA,MAAM,CAAA;AAAA,IACR;AAAA,EACF;AACF","file":"node.cjs","sourcesContent":["/**\n * Durable working-memory tier (RFC 0011) — Node filesystem backing.\n */\n\nimport { createHash } from 'node:crypto';\nimport { mkdir, readFile, unlink, writeFile } from 'node:fs/promises';\nimport { dirname, join } from 'node:path';\nimport type { WorkingMemory, WorkingMemoryScope } from './working-memory.js';\n\nfunction backingFilePath(baseDir: string, scope: WorkingMemoryScope, key: string): string {\n const h = createHash('sha256').update(`${scope}\\0${key}`).digest('hex').slice(0, 32);\n return join(baseDir, `${scope}-${h}.working.md`);\n}\n\n/**\n * Persists working-memory markdown under `baseDir` (one file per `scope`+`key`).\n * Safe for arbitrary `key` strings (hashed into the filename).\n */\nexport class FileBackedWorkingMemory implements WorkingMemory {\n private readonly filePath: string;\n\n constructor(\n readonly scope: WorkingMemoryScope,\n readonly key: string,\n /** Directory to store `.working.md` files (created on first write). */\n baseDir: string,\n ) {\n this.filePath = backingFilePath(baseDir, scope, key);\n }\n\n async read(): Promise<string> {\n try {\n return await readFile(this.filePath, 'utf8');\n } catch (e) {\n const err = e as NodeJS.ErrnoException;\n if (err.code === 'ENOENT') return '';\n throw e;\n }\n }\n\n async write(markdown: string): Promise<void> {\n await mkdir(dirname(this.filePath), { recursive: true });\n await writeFile(this.filePath, markdown, 'utf8');\n }\n\n async append(markdown: string): Promise<void> {\n let cur = await this.read();\n if (cur.length > 0 && !cur.endsWith('\\n')) cur += '\\n';\n cur += markdown;\n await this.write(cur);\n }\n\n async clear(): Promise<void> {\n try {\n await unlink(this.filePath);\n } catch (e) {\n const err = e as NodeJS.ErrnoException;\n if (err.code === 'ENOENT') return;\n throw e;\n }\n }\n}\n"]}
import { W as WorkingMemory, a as WorkingMemoryScope } from './working-memory-CiY2b5_U.cjs';
import '@ziro-agent/core';
/**
* Durable working-memory tier (RFC 0011) — Node filesystem backing.
*/
/**
* Persists working-memory markdown under `baseDir` (one file per `scope`+`key`).
* Safe for arbitrary `key` strings (hashed into the filename).
*/
declare class FileBackedWorkingMemory implements WorkingMemory {
readonly scope: WorkingMemoryScope;
readonly key: string;
private readonly filePath;
constructor(scope: WorkingMemoryScope, key: string,
/** Directory to store `.working.md` files (created on first write). */
baseDir: string);
read(): Promise<string>;
write(markdown: string): Promise<void>;
append(markdown: string): Promise<void>;
clear(): Promise<void>;
}
export { FileBackedWorkingMemory };
import { W as WorkingMemory, a as WorkingMemoryScope } from './working-memory-CiY2b5_U.js';
import '@ziro-agent/core';
/**
* Durable working-memory tier (RFC 0011) — Node filesystem backing.
*/
/**
* Persists working-memory markdown under `baseDir` (one file per `scope`+`key`).
* Safe for arbitrary `key` strings (hashed into the filename).
*/
declare class FileBackedWorkingMemory implements WorkingMemory {
readonly scope: WorkingMemoryScope;
readonly key: string;
private readonly filePath;
constructor(scope: WorkingMemoryScope, key: string,
/** Directory to store `.working.md` files (created on first write). */
baseDir: string);
read(): Promise<string>;
write(markdown: string): Promise<void>;
append(markdown: string): Promise<void>;
clear(): Promise<void>;
}
export { FileBackedWorkingMemory };
import { createHash } from 'crypto';
import { readFile, mkdir, writeFile, unlink } from 'fs/promises';
import { dirname, join } from 'path';
// src/file-backed-working-memory.ts
function backingFilePath(baseDir, scope, key) {
const h = createHash("sha256").update(`${scope}\0${key}`).digest("hex").slice(0, 32);
return join(baseDir, `${scope}-${h}.working.md`);
}
var FileBackedWorkingMemory = class {
constructor(scope, key, baseDir) {
this.scope = scope;
this.key = key;
this.filePath = backingFilePath(baseDir, scope, key);
}
scope;
key;
filePath;
async read() {
try {
return await readFile(this.filePath, "utf8");
} catch (e) {
const err = e;
if (err.code === "ENOENT") return "";
throw e;
}
}
async write(markdown) {
await mkdir(dirname(this.filePath), { recursive: true });
await writeFile(this.filePath, markdown, "utf8");
}
async append(markdown) {
let cur = await this.read();
if (cur.length > 0 && !cur.endsWith("\n")) cur += "\n";
cur += markdown;
await this.write(cur);
}
async clear() {
try {
await unlink(this.filePath);
} catch (e) {
const err = e;
if (err.code === "ENOENT") return;
throw e;
}
}
};
export { FileBackedWorkingMemory };
//# sourceMappingURL=node.js.map
//# sourceMappingURL=node.js.map
{"version":3,"sources":["../src/file-backed-working-memory.ts"],"names":[],"mappings":";;;;;AASA,SAAS,eAAA,CAAgB,OAAA,EAAiB,KAAA,EAA2B,GAAA,EAAqB;AACxF,EAAA,MAAM,IAAI,UAAA,CAAW,QAAQ,CAAA,CAAE,MAAA,CAAO,GAAG,KAAK,CAAA,EAAA,EAAK,GAAG,CAAA,CAAE,EAAE,MAAA,CAAO,KAAK,CAAA,CAAE,KAAA,CAAM,GAAG,EAAE,CAAA;AACnF,EAAA,OAAO,KAAK,OAAA,EAAS,CAAA,EAAG,KAAK,CAAA,CAAA,EAAI,CAAC,CAAA,WAAA,CAAa,CAAA;AACjD;AAMO,IAAM,0BAAN,MAAuD;AAAA,EAG5D,WAAA,CACW,KAAA,EACA,GAAA,EAET,OAAA,EACA;AAJS,IAAA,IAAA,CAAA,KAAA,GAAA,KAAA;AACA,IAAA,IAAA,CAAA,GAAA,GAAA,GAAA;AAIT,IAAA,IAAA,CAAK,QAAA,GAAW,eAAA,CAAgB,OAAA,EAAS,KAAA,EAAO,GAAG,CAAA;AAAA,EACrD;AAAA,EANW,KAAA;AAAA,EACA,GAAA;AAAA,EAJM,QAAA;AAAA,EAWjB,MAAM,IAAA,GAAwB;AAC5B,IAAA,IAAI;AACF,MAAA,OAAO,MAAM,QAAA,CAAS,IAAA,CAAK,QAAA,EAAU,MAAM,CAAA;AAAA,IAC7C,SAAS,CAAA,EAAG;AACV,MAAA,MAAM,GAAA,GAAM,CAAA;AACZ,MAAA,IAAI,GAAA,CAAI,IAAA,KAAS,QAAA,EAAU,OAAO,EAAA;AAClC,MAAA,MAAM,CAAA;AAAA,IACR;AAAA,EACF;AAAA,EAEA,MAAM,MAAM,QAAA,EAAiC;AAC3C,IAAA,MAAM,KAAA,CAAM,QAAQ,IAAA,CAAK,QAAQ,GAAG,EAAE,SAAA,EAAW,MAAM,CAAA;AACvD,IAAA,MAAM,SAAA,CAAU,IAAA,CAAK,QAAA,EAAU,QAAA,EAAU,MAAM,CAAA;AAAA,EACjD;AAAA,EAEA,MAAM,OAAO,QAAA,EAAiC;AAC5C,IAAA,IAAI,GAAA,GAAM,MAAM,IAAA,CAAK,IAAA,EAAK;AAC1B,IAAA,IAAI,GAAA,CAAI,SAAS,CAAA,IAAK,CAAC,IAAI,QAAA,CAAS,IAAI,GAAG,GAAA,IAAO,IAAA;AAClD,IAAA,GAAA,IAAO,QAAA;AACP,IAAA,MAAM,IAAA,CAAK,MAAM,GAAG,CAAA;AAAA,EACtB;AAAA,EAEA,MAAM,KAAA,GAAuB;AAC3B,IAAA,IAAI;AACF,MAAA,MAAM,MAAA,CAAO,KAAK,QAAQ,CAAA;AAAA,IAC5B,SAAS,CAAA,EAAG;AACV,MAAA,MAAM,GAAA,GAAM,CAAA;AACZ,MAAA,IAAI,GAAA,CAAI,SAAS,QAAA,EAAU;AAC3B,MAAA,MAAM,CAAA;AAAA,IACR;AAAA,EACF;AACF","file":"node.js","sourcesContent":["/**\n * Durable working-memory tier (RFC 0011) — Node filesystem backing.\n */\n\nimport { createHash } from 'node:crypto';\nimport { mkdir, readFile, unlink, writeFile } from 'node:fs/promises';\nimport { dirname, join } from 'node:path';\nimport type { WorkingMemory, WorkingMemoryScope } from './working-memory.js';\n\nfunction backingFilePath(baseDir: string, scope: WorkingMemoryScope, key: string): string {\n const h = createHash('sha256').update(`${scope}\\0${key}`).digest('hex').slice(0, 32);\n return join(baseDir, `${scope}-${h}.working.md`);\n}\n\n/**\n * Persists working-memory markdown under `baseDir` (one file per `scope`+`key`).\n * Safe for arbitrary `key` strings (hashed into the filename).\n */\nexport class FileBackedWorkingMemory implements WorkingMemory {\n private readonly filePath: string;\n\n constructor(\n readonly scope: WorkingMemoryScope,\n readonly key: string,\n /** Directory to store `.working.md` files (created on first write). */\n baseDir: string,\n ) {\n this.filePath = backingFilePath(baseDir, scope, key);\n }\n\n async read(): Promise<string> {\n try {\n return await readFile(this.filePath, 'utf8');\n } catch (e) {\n const err = e as NodeJS.ErrnoException;\n if (err.code === 'ENOENT') return '';\n throw e;\n }\n }\n\n async write(markdown: string): Promise<void> {\n await mkdir(dirname(this.filePath), { recursive: true });\n await writeFile(this.filePath, markdown, 'utf8');\n }\n\n async append(markdown: string): Promise<void> {\n let cur = await this.read();\n if (cur.length > 0 && !cur.endsWith('\\n')) cur += '\\n';\n cur += markdown;\n await this.write(cur);\n }\n\n async clear(): Promise<void> {\n try {\n await unlink(this.filePath);\n } catch (e) {\n const err = e as NodeJS.ErrnoException;\n if (err.code === 'ENOENT') return;\n throw e;\n }\n }\n}\n"]}
import { ChatMessage } from '@ziro-agent/core';
/**
* Per-run / per-thread scratchpad (RFC 0011 — working memory tier, minimal v0.4 slice).
*/
type WorkingMemoryScope = 'resource' | 'thread';
interface WorkingMemory {
readonly scope: WorkingMemoryScope;
/** Namespace key (e.g. user id + resource id, or thread id). */
readonly key: string;
read(): Promise<string>;
write(markdown: string): Promise<void>;
append(markdown: string): Promise<void>;
clear(): Promise<void>;
}
/**
* Markdown-first working buffer kept in process memory. Not durable across
* restarts — pair with a `Checkpointer` for crash safety.
*/
declare class InMemoryWorkingMemory implements WorkingMemory {
readonly scope: WorkingMemoryScope;
readonly key: string;
private buf;
constructor(scope: WorkingMemoryScope, key: string);
read(): Promise<string>;
write(markdown: string): Promise<void>;
append(markdown: string): Promise<void>;
clear(): Promise<void>;
}
/**
* Appends `workingMarkdown` to the first `system` message, or prepends a new
* system message when none exists.
*/
declare function injectWorkingMemoryIntoMessages(messages: readonly ChatMessage[], workingMarkdown: string): ChatMessage[];
export { InMemoryWorkingMemory as I, type WorkingMemory as W, type WorkingMemoryScope as a, injectWorkingMemoryIntoMessages as i };
import { ChatMessage } from '@ziro-agent/core';
/**
* Per-run / per-thread scratchpad (RFC 0011 — working memory tier, minimal v0.4 slice).
*/
type WorkingMemoryScope = 'resource' | 'thread';
interface WorkingMemory {
readonly scope: WorkingMemoryScope;
/** Namespace key (e.g. user id + resource id, or thread id). */
readonly key: string;
read(): Promise<string>;
write(markdown: string): Promise<void>;
append(markdown: string): Promise<void>;
clear(): Promise<void>;
}
/**
* Markdown-first working buffer kept in process memory. Not durable across
* restarts — pair with a `Checkpointer` for crash safety.
*/
declare class InMemoryWorkingMemory implements WorkingMemory {
readonly scope: WorkingMemoryScope;
readonly key: string;
private buf;
constructor(scope: WorkingMemoryScope, key: string);
read(): Promise<string>;
write(markdown: string): Promise<void>;
append(markdown: string): Promise<void>;
clear(): Promise<void>;
}
/**
* Appends `workingMarkdown` to the first `system` message, or prepends a new
* system message when none exists.
*/
declare function injectWorkingMemoryIntoMessages(messages: readonly ChatMessage[], workingMarkdown: string): ChatMessage[];
export { InMemoryWorkingMemory as I, type WorkingMemory as W, type WorkingMemoryScope as a, injectWorkingMemoryIntoMessages as i };
+3
-35
import { ChatMessage } from '@ziro-agent/core';
import { V as VectorStore, S as SearchResult, E as EmbeddingModel, D as Document, M as Metadata, a as VectorQuery, b as SearchStrategy, c as EmbeddedDocument } from './types-CE3kkgEp.cjs';
export { R as RetrievedChunk, t as toRetrievedChunk } from './types-CE3kkgEp.cjs';
import { W as WorkingMemory } from './working-memory-CiY2b5_U.cjs';
export { I as InMemoryWorkingMemory, a as WorkingMemoryScope, i as injectWorkingMemoryIntoMessages } from './working-memory-CiY2b5_U.cjs';

@@ -59,36 +61,2 @@ /** Context passed to each {@link MemoryProcessor} step (RFC 0011). */

/**
* Per-run / per-thread scratchpad (RFC 0011 — working memory tier, minimal v0.4 slice).
*/
type WorkingMemoryScope = 'resource' | 'thread';
interface WorkingMemory {
readonly scope: WorkingMemoryScope;
/** Namespace key (e.g. user id + resource id, or thread id). */
readonly key: string;
read(): Promise<string>;
write(markdown: string): Promise<void>;
append(markdown: string): Promise<void>;
clear(): Promise<void>;
}
/**
* Markdown-first working buffer kept in process memory. Not durable across
* restarts — pair with a `Checkpointer` for crash safety.
*/
declare class InMemoryWorkingMemory implements WorkingMemory {
readonly scope: WorkingMemoryScope;
readonly key: string;
private buf;
constructor(scope: WorkingMemoryScope, key: string);
read(): Promise<string>;
write(markdown: string): Promise<void>;
append(markdown: string): Promise<void>;
clear(): Promise<void>;
}
/**
* Appends `workingMarkdown` to the first `system` message, or prepends a new
* system message when none exists.
*/
declare function injectWorkingMemoryIntoMessages(messages: readonly ChatMessage[], workingMarkdown: string): ChatMessage[];
/**
* Optional three-tier attachment for `createAgent({ memory })` (RFC 0011).

@@ -410,2 +378,2 @@ *

export { type AgentMemoryConfig, BM25Index, type ChunkOptions, type CitationEntry, type CohereRerankerOptions, type ConversationMemory, type ConversationMemoryContext, type ConversationSnapshotStore, DirConversationSnapshotStore, Document, type DocumentParseContext, type DocumentParser, EmbeddedDocument, EmbeddingModel, InMemoryWorkingMemory, type LoadedDocument, type MemoryProcessor, type MemoryProcessorContext, MemoryVectorStore, type MemoryVectorStoreOptions, Metadata, type OpenAIEmbeddingOptions, PersistingConversationMemory, type PersistingConversationMemoryOptions, type RerankDocument, type RerankerAdapter, type RetrieveOptions, SearchResult, SearchStrategy, SlidingWindowConversationMemory, type SnippetCompressorOptions, SummarizingConversationMemory, type SummarizingConversationMemoryOptions, type TextWithCitations, VectorQuery, VectorStore, type VoyageRerankerOptions, type WorkingMemory, type WorkingMemoryScope, buildTextWithCitations, chunkText, clearDocumentParserRegistry, composeMemoryProcessors, cosineSimilarity, createCohereReranker, createDroppedMessagesSnippetCompressor, createOpenAIEmbedder, createVoyageReranker, injectWorkingMemoryIntoMessages, loadDocument, normalize, passthroughReranker, reciprocalRankFusion, registerDocumentParser, retrieve, tokenize, trimNonSystemMessageCount };
export { type AgentMemoryConfig, BM25Index, type ChunkOptions, type CitationEntry, type CohereRerankerOptions, type ConversationMemory, type ConversationMemoryContext, type ConversationSnapshotStore, DirConversationSnapshotStore, Document, type DocumentParseContext, type DocumentParser, EmbeddedDocument, EmbeddingModel, type LoadedDocument, type MemoryProcessor, type MemoryProcessorContext, MemoryVectorStore, type MemoryVectorStoreOptions, Metadata, type OpenAIEmbeddingOptions, PersistingConversationMemory, type PersistingConversationMemoryOptions, type RerankDocument, type RerankerAdapter, type RetrieveOptions, SearchResult, SearchStrategy, SlidingWindowConversationMemory, type SnippetCompressorOptions, SummarizingConversationMemory, type SummarizingConversationMemoryOptions, type TextWithCitations, VectorQuery, VectorStore, type VoyageRerankerOptions, WorkingMemory, buildTextWithCitations, chunkText, clearDocumentParserRegistry, composeMemoryProcessors, cosineSimilarity, createCohereReranker, createDroppedMessagesSnippetCompressor, createOpenAIEmbedder, createVoyageReranker, loadDocument, normalize, passthroughReranker, reciprocalRankFusion, registerDocumentParser, retrieve, tokenize, trimNonSystemMessageCount };
import { ChatMessage } from '@ziro-agent/core';
import { V as VectorStore, S as SearchResult, E as EmbeddingModel, D as Document, M as Metadata, a as VectorQuery, b as SearchStrategy, c as EmbeddedDocument } from './types-CE3kkgEp.js';
export { R as RetrievedChunk, t as toRetrievedChunk } from './types-CE3kkgEp.js';
import { W as WorkingMemory } from './working-memory-CiY2b5_U.js';
export { I as InMemoryWorkingMemory, a as WorkingMemoryScope, i as injectWorkingMemoryIntoMessages } from './working-memory-CiY2b5_U.js';

@@ -59,36 +61,2 @@ /** Context passed to each {@link MemoryProcessor} step (RFC 0011). */

/**
* Per-run / per-thread scratchpad (RFC 0011 — working memory tier, minimal v0.4 slice).
*/
type WorkingMemoryScope = 'resource' | 'thread';
interface WorkingMemory {
readonly scope: WorkingMemoryScope;
/** Namespace key (e.g. user id + resource id, or thread id). */
readonly key: string;
read(): Promise<string>;
write(markdown: string): Promise<void>;
append(markdown: string): Promise<void>;
clear(): Promise<void>;
}
/**
* Markdown-first working buffer kept in process memory. Not durable across
* restarts — pair with a `Checkpointer` for crash safety.
*/
declare class InMemoryWorkingMemory implements WorkingMemory {
readonly scope: WorkingMemoryScope;
readonly key: string;
private buf;
constructor(scope: WorkingMemoryScope, key: string);
read(): Promise<string>;
write(markdown: string): Promise<void>;
append(markdown: string): Promise<void>;
clear(): Promise<void>;
}
/**
* Appends `workingMarkdown` to the first `system` message, or prepends a new
* system message when none exists.
*/
declare function injectWorkingMemoryIntoMessages(messages: readonly ChatMessage[], workingMarkdown: string): ChatMessage[];
/**
* Optional three-tier attachment for `createAgent({ memory })` (RFC 0011).

@@ -410,2 +378,2 @@ *

export { type AgentMemoryConfig, BM25Index, type ChunkOptions, type CitationEntry, type CohereRerankerOptions, type ConversationMemory, type ConversationMemoryContext, type ConversationSnapshotStore, DirConversationSnapshotStore, Document, type DocumentParseContext, type DocumentParser, EmbeddedDocument, EmbeddingModel, InMemoryWorkingMemory, type LoadedDocument, type MemoryProcessor, type MemoryProcessorContext, MemoryVectorStore, type MemoryVectorStoreOptions, Metadata, type OpenAIEmbeddingOptions, PersistingConversationMemory, type PersistingConversationMemoryOptions, type RerankDocument, type RerankerAdapter, type RetrieveOptions, SearchResult, SearchStrategy, SlidingWindowConversationMemory, type SnippetCompressorOptions, SummarizingConversationMemory, type SummarizingConversationMemoryOptions, type TextWithCitations, VectorQuery, VectorStore, type VoyageRerankerOptions, type WorkingMemory, type WorkingMemoryScope, buildTextWithCitations, chunkText, clearDocumentParserRegistry, composeMemoryProcessors, cosineSimilarity, createCohereReranker, createDroppedMessagesSnippetCompressor, createOpenAIEmbedder, createVoyageReranker, injectWorkingMemoryIntoMessages, loadDocument, normalize, passthroughReranker, reciprocalRankFusion, registerDocumentParser, retrieve, tokenize, trimNonSystemMessageCount };
export { type AgentMemoryConfig, BM25Index, type ChunkOptions, type CitationEntry, type CohereRerankerOptions, type ConversationMemory, type ConversationMemoryContext, type ConversationSnapshotStore, DirConversationSnapshotStore, Document, type DocumentParseContext, type DocumentParser, EmbeddedDocument, EmbeddingModel, type LoadedDocument, type MemoryProcessor, type MemoryProcessorContext, MemoryVectorStore, type MemoryVectorStoreOptions, Metadata, type OpenAIEmbeddingOptions, PersistingConversationMemory, type PersistingConversationMemoryOptions, type RerankDocument, type RerankerAdapter, type RetrieveOptions, SearchResult, SearchStrategy, SlidingWindowConversationMemory, type SnippetCompressorOptions, SummarizingConversationMemory, type SummarizingConversationMemoryOptions, type TextWithCitations, VectorQuery, VectorStore, type VoyageRerankerOptions, WorkingMemory, buildTextWithCitations, chunkText, clearDocumentParserRegistry, composeMemoryProcessors, cosineSimilarity, createCohereReranker, createDroppedMessagesSnippetCompressor, createOpenAIEmbedder, createVoyageReranker, loadDocument, normalize, passthroughReranker, reciprocalRankFusion, registerDocumentParser, retrieve, tokenize, trimNonSystemMessageCount };
{
"name": "@ziro-agent/memory",
"version": "0.4.0",
"version": "0.5.0",
"description": "Vector store interfaces, in-memory & pgvector adapters, chunking and embedding helpers for ZiroAgent SDK.",

@@ -53,2 +53,12 @@ "license": "Apache-2.0",

},
"./node": {
"import": {
"types": "./dist/node.d.ts",
"default": "./dist/node.js"
},
"require": {
"types": "./dist/node.d.cts",
"default": "./dist/node.cjs"
}
},
"./package.json": "./package.json"

@@ -55,0 +65,0 @@ },