@halo-sdk/memory 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/README.md ADDED
@@ -0,0 +1,26 @@
1
+ # @halo-sdk/memory
2
+
3
+ Cache-aware long-term memory for Halo AI SDK.
4
+
5
+ Memory lives in a single cache segment placed before the volatile history tail, so it sits _inside_ the prefix cache and stays byte-stable — and the cache stays warm — until an explicit write. `remember()` is append-only (keeps the existing cached prefix valid); `forget()` / `clear()` rebuild the block as a deliberate, attributable cache miss.
6
+
7
+ ## Usage
8
+
9
+ ```ts
10
+ import { Halo } from "@halo-sdk/core";
11
+ import { MemoryStore } from "@halo-sdk/memory";
12
+
13
+ const memory = new MemoryStore();
14
+ memory.remember("The user prefers TypeScript.");
15
+ memory.remember("The user is in UTC+8.");
16
+
17
+ const agent = halo.agent({
18
+ /* ... */
19
+ });
20
+ agent.setContextSegments([memory.segment]);
21
+
22
+ // later
23
+ memory.recall(); // ["The user prefers TypeScript.", "The user is in UTC+8."]
24
+ ```
25
+
26
+ Each entry is its own message, so appends extend the block without touching earlier entries — the prefix up to the previous tail stays cached.
package/dist/index.cjs ADDED
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ MemoryStore: () => MemoryStore
24
+ });
25
+ module.exports = __toCommonJS(index_exports);
26
+ var import_core = require("@halo-sdk/core");
27
+ var MemoryStore = class {
28
+ segment;
29
+ _format;
30
+ _role;
31
+ _entries = [];
32
+ constructor(opts) {
33
+ this._format = opts?.format ?? ((e) => `- ${e.text}`);
34
+ this._role = opts?.role ?? "user";
35
+ this.segment = new import_core.StableContext({
36
+ id: opts?.segmentId ?? "memory",
37
+ kind: "memory",
38
+ messages: []
39
+ });
40
+ if (opts?.entries?.length) {
41
+ this._entries = [...opts.entries];
42
+ this._rebuild();
43
+ }
44
+ }
45
+ /** All current entries, in insertion order. */
46
+ get entries() {
47
+ return this._entries;
48
+ }
49
+ /**
50
+ * Append a fact. Append-only growth keeps the already-cached prefix valid —
51
+ * only the new tail of the memory block is uncached on the next turn.
52
+ */
53
+ remember(text, opts) {
54
+ const entry = {
55
+ id: opts?.id ?? `mem_${this._entries.length + 1}`,
56
+ text,
57
+ metadata: opts?.metadata
58
+ };
59
+ this._entries.push(entry);
60
+ this.segment.append([this._toMessage(entry)]);
61
+ return entry;
62
+ }
63
+ /** Remove an entry by id. Rebuilds the block (attributable cache miss). Returns true if removed. */
64
+ forget(id) {
65
+ const next = this._entries.filter((e) => e.id !== id);
66
+ if (next.length === this._entries.length) return false;
67
+ this._entries = next;
68
+ this._rebuild();
69
+ return true;
70
+ }
71
+ /** Remove all entries. Rebuilds the (now empty) block. */
72
+ clear() {
73
+ this._entries = [];
74
+ this.segment.setMessages([]);
75
+ }
76
+ /** Recall all remembered facts as plain strings. */
77
+ recall() {
78
+ return this._entries.map((e) => e.text);
79
+ }
80
+ _rebuild() {
81
+ this.segment.setMessages(this._entries.map((e) => this._toMessage(e)));
82
+ }
83
+ _toMessage(entry) {
84
+ return { role: this._role, content: this._format(entry), discardable: false };
85
+ }
86
+ };
87
+ // Annotate the CommonJS export names for ESM import in node:
88
+ 0 && (module.exports = {
89
+ MemoryStore
90
+ });
91
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { StableContext, type CacheSegment, type ChatMessage } from \"@halo-sdk/core\";\n\n/** A single remembered fact with an id and optional metadata. */\nexport interface MemoryEntry {\n id: string;\n text: string;\n metadata?: Record<string, unknown>;\n}\n\nexport interface MemoryStoreOptions {\n /** Segment id (for cache miss attribution). Default \"memory\". */\n segmentId?: string;\n /** Initial entries. */\n entries?: MemoryEntry[];\n /** Format an entry into a context message line. Default: `- text`. */\n format?: (entry: MemoryEntry) => string;\n /** Role used for the synthesized memory message. Default \"user\". */\n role?: \"system\" | \"user\" | \"assistant\";\n}\n\n/**\n * Cache-aware long-term memory.\n *\n * Memory lives in a single {@link CacheSegment} placed before the volatile\n * history tail, so it sits *inside* the prefix cache. It stays byte-stable —\n * and the cache stays warm — until an explicit write. {@link remember} is\n * append-only (keeps the existing cached prefix valid); {@link forget} /\n * {@link clear} rebuild the block (a deliberate, attributable cache miss).\n *\n * Each entry is its own message so that appends extend the block without\n * touching earlier entries — the prefix up to the previous tail stays cached.\n */\nexport class MemoryStore {\n readonly segment: StableContext;\n\n private readonly _format: (entry: MemoryEntry) => string;\n private readonly _role: \"system\" | \"user\" | \"assistant\";\n private _entries: MemoryEntry[] = [];\n\n constructor(opts?: MemoryStoreOptions) {\n this._format = opts?.format ?? ((e) => `- ${e.text}`);\n this._role = opts?.role ?? \"user\";\n this.segment = new StableContext({\n id: opts?.segmentId ?? \"memory\",\n kind: \"memory\",\n messages: [],\n });\n if (opts?.entries?.length) {\n this._entries = [...opts.entries];\n this._rebuild();\n }\n }\n\n /** All current entries, in insertion order. */\n get entries(): readonly MemoryEntry[] {\n return this._entries;\n }\n\n /**\n * Append a fact. Append-only growth keeps the already-cached prefix valid —\n * only the new tail of the memory block is uncached on the next turn.\n */\n remember(text: string, opts?: { id?: string; metadata?: Record<string, unknown> }): MemoryEntry {\n const entry: MemoryEntry = {\n id: opts?.id ?? `mem_${this._entries.length + 1}`,\n text,\n metadata: opts?.metadata,\n };\n this._entries.push(entry);\n this.segment.append([this._toMessage(entry)]);\n return entry;\n }\n\n /** Remove an entry by id. Rebuilds the block (attributable cache miss). Returns true if removed. */\n forget(id: string): boolean {\n const next = this._entries.filter((e) => e.id !== id);\n if (next.length === this._entries.length) return false;\n this._entries = next;\n this._rebuild();\n return true;\n }\n\n /** Remove all entries. Rebuilds the (now empty) block. */\n clear(): void {\n this._entries = [];\n this.segment.setMessages([]);\n }\n\n /** Recall all remembered facts as plain strings. */\n recall(): string[] {\n return this._entries.map((e) => e.text);\n }\n\n private _rebuild(): void {\n this.segment.setMessages(this._entries.map((e) => this._toMessage(e)));\n }\n\n private _toMessage(entry: MemoryEntry): ChatMessage {\n return { role: this._role, content: this._format(entry), discardable: false };\n }\n}\n\nexport type { CacheSegment };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAmE;AAgC5D,IAAM,cAAN,MAAkB;AAAA,EACd;AAAA,EAEQ;AAAA,EACA;AAAA,EACT,WAA0B,CAAC;AAAA,EAEnC,YAAY,MAA2B;AACrC,SAAK,UAAU,MAAM,WAAW,CAAC,MAAM,KAAK,EAAE,IAAI;AAClD,SAAK,QAAQ,MAAM,QAAQ;AAC3B,SAAK,UAAU,IAAI,0BAAc;AAAA,MAC/B,IAAI,MAAM,aAAa;AAAA,MACvB,MAAM;AAAA,MACN,UAAU,CAAC;AAAA,IACb,CAAC;AACD,QAAI,MAAM,SAAS,QAAQ;AACzB,WAAK,WAAW,CAAC,GAAG,KAAK,OAAO;AAChC,WAAK,SAAS;AAAA,IAChB;AAAA,EACF;AAAA;AAAA,EAGA,IAAI,UAAkC;AACpC,WAAO,KAAK;AAAA,EACd;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,SAAS,MAAc,MAAyE;AAC9F,UAAM,QAAqB;AAAA,MACzB,IAAI,MAAM,MAAM,OAAO,KAAK,SAAS,SAAS,CAAC;AAAA,MAC/C;AAAA,MACA,UAAU,MAAM;AAAA,IAClB;AACA,SAAK,SAAS,KAAK,KAAK;AACxB,SAAK,QAAQ,OAAO,CAAC,KAAK,WAAW,KAAK,CAAC,CAAC;AAC5C,WAAO;AAAA,EACT;AAAA;AAAA,EAGA,OAAO,IAAqB;AAC1B,UAAM,OAAO,KAAK,SAAS,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE;AACpD,QAAI,KAAK,WAAW,KAAK,SAAS,OAAQ,QAAO;AACjD,SAAK,WAAW;AAChB,SAAK,SAAS;AACd,WAAO;AAAA,EACT;AAAA;AAAA,EAGA,QAAc;AACZ,SAAK,WAAW,CAAC;AACjB,SAAK,QAAQ,YAAY,CAAC,CAAC;AAAA,EAC7B;AAAA;AAAA,EAGA,SAAmB;AACjB,WAAO,KAAK,SAAS,IAAI,CAAC,MAAM,EAAE,IAAI;AAAA,EACxC;AAAA,EAEQ,WAAiB;AACvB,SAAK,QAAQ,YAAY,KAAK,SAAS,IAAI,CAAC,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC;AAAA,EACvE;AAAA,EAEQ,WAAW,OAAiC;AAClD,WAAO,EAAE,MAAM,KAAK,OAAO,SAAS,KAAK,QAAQ,KAAK,GAAG,aAAa,MAAM;AAAA,EAC9E;AACF;","names":[]}
@@ -0,0 +1,56 @@
1
+ import { StableContext, type CacheSegment } from "@halo-sdk/core";
2
+ /** A single remembered fact with an id and optional metadata. */
3
+ export interface MemoryEntry {
4
+ id: string;
5
+ text: string;
6
+ metadata?: Record<string, unknown>;
7
+ }
8
+ export interface MemoryStoreOptions {
9
+ /** Segment id (for cache miss attribution). Default "memory". */
10
+ segmentId?: string;
11
+ /** Initial entries. */
12
+ entries?: MemoryEntry[];
13
+ /** Format an entry into a context message line. Default: `- text`. */
14
+ format?: (entry: MemoryEntry) => string;
15
+ /** Role used for the synthesized memory message. Default "user". */
16
+ role?: "system" | "user" | "assistant";
17
+ }
18
+ /**
19
+ * Cache-aware long-term memory.
20
+ *
21
+ * Memory lives in a single {@link CacheSegment} placed before the volatile
22
+ * history tail, so it sits *inside* the prefix cache. It stays byte-stable —
23
+ * and the cache stays warm — until an explicit write. {@link remember} is
24
+ * append-only (keeps the existing cached prefix valid); {@link forget} /
25
+ * {@link clear} rebuild the block (a deliberate, attributable cache miss).
26
+ *
27
+ * Each entry is its own message so that appends extend the block without
28
+ * touching earlier entries — the prefix up to the previous tail stays cached.
29
+ */
30
+ export declare class MemoryStore {
31
+ readonly segment: StableContext;
32
+ private readonly _format;
33
+ private readonly _role;
34
+ private _entries;
35
+ constructor(opts?: MemoryStoreOptions);
36
+ /** All current entries, in insertion order. */
37
+ get entries(): readonly MemoryEntry[];
38
+ /**
39
+ * Append a fact. Append-only growth keeps the already-cached prefix valid —
40
+ * only the new tail of the memory block is uncached on the next turn.
41
+ */
42
+ remember(text: string, opts?: {
43
+ id?: string;
44
+ metadata?: Record<string, unknown>;
45
+ }): MemoryEntry;
46
+ /** Remove an entry by id. Rebuilds the block (attributable cache miss). Returns true if removed. */
47
+ forget(id: string): boolean;
48
+ /** Remove all entries. Rebuilds the (now empty) block. */
49
+ clear(): void;
50
+ /** Recall all remembered facts as plain strings. */
51
+ recall(): string[];
52
+ private _rebuild;
53
+ private _toMessage;
54
+ }
55
+ export type { CacheSegment };
56
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,KAAK,YAAY,EAAoB,MAAM,gBAAgB,CAAC;AAEpF,iEAAiE;AACjE,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,MAAM,WAAW,kBAAkB;IACjC,iEAAiE;IACjE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uBAAuB;IACvB,OAAO,CAAC,EAAE,WAAW,EAAE,CAAC;IACxB,sEAAsE;IACtE,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,MAAM,CAAC;IACxC,oEAAoE;IACpE,IAAI,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAC;CACxC;AAED;;;;;;;;;;;GAWG;AACH,qBAAa,WAAW;IACtB,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC;IAEhC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAiC;IACzD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAkC;IACxD,OAAO,CAAC,QAAQ,CAAqB;gBAEzB,IAAI,CAAC,EAAE,kBAAkB;IAcrC,+CAA+C;IAC/C,IAAI,OAAO,IAAI,SAAS,WAAW,EAAE,CAEpC;IAED;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,GAAG,WAAW;IAW/F,oGAAoG;IACpG,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAQ3B,0DAA0D;IAC1D,KAAK,IAAI,IAAI;IAKb,oDAAoD;IACpD,MAAM,IAAI,MAAM,EAAE;IAIlB,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,UAAU;CAGnB;AAED,YAAY,EAAE,YAAY,EAAE,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,66 @@
1
+ // src/index.ts
2
+ import { StableContext } from "@halo-sdk/core";
3
+ var MemoryStore = class {
4
+ segment;
5
+ _format;
6
+ _role;
7
+ _entries = [];
8
+ constructor(opts) {
9
+ this._format = opts?.format ?? ((e) => `- ${e.text}`);
10
+ this._role = opts?.role ?? "user";
11
+ this.segment = new StableContext({
12
+ id: opts?.segmentId ?? "memory",
13
+ kind: "memory",
14
+ messages: []
15
+ });
16
+ if (opts?.entries?.length) {
17
+ this._entries = [...opts.entries];
18
+ this._rebuild();
19
+ }
20
+ }
21
+ /** All current entries, in insertion order. */
22
+ get entries() {
23
+ return this._entries;
24
+ }
25
+ /**
26
+ * Append a fact. Append-only growth keeps the already-cached prefix valid —
27
+ * only the new tail of the memory block is uncached on the next turn.
28
+ */
29
+ remember(text, opts) {
30
+ const entry = {
31
+ id: opts?.id ?? `mem_${this._entries.length + 1}`,
32
+ text,
33
+ metadata: opts?.metadata
34
+ };
35
+ this._entries.push(entry);
36
+ this.segment.append([this._toMessage(entry)]);
37
+ return entry;
38
+ }
39
+ /** Remove an entry by id. Rebuilds the block (attributable cache miss). Returns true if removed. */
40
+ forget(id) {
41
+ const next = this._entries.filter((e) => e.id !== id);
42
+ if (next.length === this._entries.length) return false;
43
+ this._entries = next;
44
+ this._rebuild();
45
+ return true;
46
+ }
47
+ /** Remove all entries. Rebuilds the (now empty) block. */
48
+ clear() {
49
+ this._entries = [];
50
+ this.segment.setMessages([]);
51
+ }
52
+ /** Recall all remembered facts as plain strings. */
53
+ recall() {
54
+ return this._entries.map((e) => e.text);
55
+ }
56
+ _rebuild() {
57
+ this.segment.setMessages(this._entries.map((e) => this._toMessage(e)));
58
+ }
59
+ _toMessage(entry) {
60
+ return { role: this._role, content: this._format(entry), discardable: false };
61
+ }
62
+ };
63
+ export {
64
+ MemoryStore
65
+ };
66
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { StableContext, type CacheSegment, type ChatMessage } from \"@halo-sdk/core\";\n\n/** A single remembered fact with an id and optional metadata. */\nexport interface MemoryEntry {\n id: string;\n text: string;\n metadata?: Record<string, unknown>;\n}\n\nexport interface MemoryStoreOptions {\n /** Segment id (for cache miss attribution). Default \"memory\". */\n segmentId?: string;\n /** Initial entries. */\n entries?: MemoryEntry[];\n /** Format an entry into a context message line. Default: `- text`. */\n format?: (entry: MemoryEntry) => string;\n /** Role used for the synthesized memory message. Default \"user\". */\n role?: \"system\" | \"user\" | \"assistant\";\n}\n\n/**\n * Cache-aware long-term memory.\n *\n * Memory lives in a single {@link CacheSegment} placed before the volatile\n * history tail, so it sits *inside* the prefix cache. It stays byte-stable —\n * and the cache stays warm — until an explicit write. {@link remember} is\n * append-only (keeps the existing cached prefix valid); {@link forget} /\n * {@link clear} rebuild the block (a deliberate, attributable cache miss).\n *\n * Each entry is its own message so that appends extend the block without\n * touching earlier entries — the prefix up to the previous tail stays cached.\n */\nexport class MemoryStore {\n readonly segment: StableContext;\n\n private readonly _format: (entry: MemoryEntry) => string;\n private readonly _role: \"system\" | \"user\" | \"assistant\";\n private _entries: MemoryEntry[] = [];\n\n constructor(opts?: MemoryStoreOptions) {\n this._format = opts?.format ?? ((e) => `- ${e.text}`);\n this._role = opts?.role ?? \"user\";\n this.segment = new StableContext({\n id: opts?.segmentId ?? \"memory\",\n kind: \"memory\",\n messages: [],\n });\n if (opts?.entries?.length) {\n this._entries = [...opts.entries];\n this._rebuild();\n }\n }\n\n /** All current entries, in insertion order. */\n get entries(): readonly MemoryEntry[] {\n return this._entries;\n }\n\n /**\n * Append a fact. Append-only growth keeps the already-cached prefix valid —\n * only the new tail of the memory block is uncached on the next turn.\n */\n remember(text: string, opts?: { id?: string; metadata?: Record<string, unknown> }): MemoryEntry {\n const entry: MemoryEntry = {\n id: opts?.id ?? `mem_${this._entries.length + 1}`,\n text,\n metadata: opts?.metadata,\n };\n this._entries.push(entry);\n this.segment.append([this._toMessage(entry)]);\n return entry;\n }\n\n /** Remove an entry by id. Rebuilds the block (attributable cache miss). Returns true if removed. */\n forget(id: string): boolean {\n const next = this._entries.filter((e) => e.id !== id);\n if (next.length === this._entries.length) return false;\n this._entries = next;\n this._rebuild();\n return true;\n }\n\n /** Remove all entries. Rebuilds the (now empty) block. */\n clear(): void {\n this._entries = [];\n this.segment.setMessages([]);\n }\n\n /** Recall all remembered facts as plain strings. */\n recall(): string[] {\n return this._entries.map((e) => e.text);\n }\n\n private _rebuild(): void {\n this.segment.setMessages(this._entries.map((e) => this._toMessage(e)));\n }\n\n private _toMessage(entry: MemoryEntry): ChatMessage {\n return { role: this._role, content: this._format(entry), discardable: false };\n }\n}\n\nexport type { CacheSegment };\n"],"mappings":";AAAA,SAAS,qBAA0D;AAgC5D,IAAM,cAAN,MAAkB;AAAA,EACd;AAAA,EAEQ;AAAA,EACA;AAAA,EACT,WAA0B,CAAC;AAAA,EAEnC,YAAY,MAA2B;AACrC,SAAK,UAAU,MAAM,WAAW,CAAC,MAAM,KAAK,EAAE,IAAI;AAClD,SAAK,QAAQ,MAAM,QAAQ;AAC3B,SAAK,UAAU,IAAI,cAAc;AAAA,MAC/B,IAAI,MAAM,aAAa;AAAA,MACvB,MAAM;AAAA,MACN,UAAU,CAAC;AAAA,IACb,CAAC;AACD,QAAI,MAAM,SAAS,QAAQ;AACzB,WAAK,WAAW,CAAC,GAAG,KAAK,OAAO;AAChC,WAAK,SAAS;AAAA,IAChB;AAAA,EACF;AAAA;AAAA,EAGA,IAAI,UAAkC;AACpC,WAAO,KAAK;AAAA,EACd;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,SAAS,MAAc,MAAyE;AAC9F,UAAM,QAAqB;AAAA,MACzB,IAAI,MAAM,MAAM,OAAO,KAAK,SAAS,SAAS,CAAC;AAAA,MAC/C;AAAA,MACA,UAAU,MAAM;AAAA,IAClB;AACA,SAAK,SAAS,KAAK,KAAK;AACxB,SAAK,QAAQ,OAAO,CAAC,KAAK,WAAW,KAAK,CAAC,CAAC;AAC5C,WAAO;AAAA,EACT;AAAA;AAAA,EAGA,OAAO,IAAqB;AAC1B,UAAM,OAAO,KAAK,SAAS,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE;AACpD,QAAI,KAAK,WAAW,KAAK,SAAS,OAAQ,QAAO;AACjD,SAAK,WAAW;AAChB,SAAK,SAAS;AACd,WAAO;AAAA,EACT;AAAA;AAAA,EAGA,QAAc;AACZ,SAAK,WAAW,CAAC;AACjB,SAAK,QAAQ,YAAY,CAAC,CAAC;AAAA,EAC7B;AAAA;AAAA,EAGA,SAAmB;AACjB,WAAO,KAAK,SAAS,IAAI,CAAC,MAAM,EAAE,IAAI;AAAA,EACxC;AAAA,EAEQ,WAAiB;AACvB,SAAK,QAAQ,YAAY,KAAK,SAAS,IAAI,CAAC,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC;AAAA,EACvE;AAAA,EAEQ,WAAW,OAAiC;AAClD,WAAO,EAAE,MAAM,KAAK,OAAO,SAAS,KAAK,QAAQ,KAAK,GAAG,aAAa,MAAM;AAAA,EAC9E;AACF;","names":[]}
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "@halo-sdk/memory",
3
+ "version": "1.0.0",
4
+ "description": "Cache-aware long-term memory for Halo AI SDK — an append-only memory segment that stays inside the prefix cache until an explicit write",
5
+ "keywords": [
6
+ "agent",
7
+ "ai",
8
+ "llm",
9
+ "memory",
10
+ "prefix-cache"
11
+ ],
12
+ "license": "MIT",
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "https://github.com/halo-sdk/halo-ai",
16
+ "directory": "packages/memory"
17
+ },
18
+ "files": [
19
+ "dist"
20
+ ],
21
+ "type": "module",
22
+ "main": "./dist/index.js",
23
+ "types": "./dist/index.d.ts",
24
+ "exports": {
25
+ ".": {
26
+ "types": "./dist/index.d.ts",
27
+ "import": "./dist/index.js",
28
+ "require": "./dist/index.cjs"
29
+ }
30
+ },
31
+ "publishConfig": {
32
+ "access": "public"
33
+ },
34
+ "devDependencies": {
35
+ "typescript": "^5.8.0",
36
+ "vitest": "^3.0.0",
37
+ "@halo-sdk/core": "1.1.0"
38
+ },
39
+ "peerDependencies": {
40
+ "@halo-sdk/core": ">=1.1.0"
41
+ },
42
+ "scripts": {
43
+ "build": "tsc --build --emitDeclarationOnly && tsup",
44
+ "dev": "tsup --watch",
45
+ "clean": "del-cli dist *.tsbuildinfo",
46
+ "publint": "publint",
47
+ "test": "vitest run",
48
+ "test:watch": "vitest"
49
+ }
50
+ }