@hasna/mementos 0.1.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.
@@ -0,0 +1,5 @@
1
+ import type { MementosConfig } from "../types";
2
+ export declare const DEFAULT_CONFIG: MementosConfig;
3
+ export declare function loadConfig(): MementosConfig;
4
+ export declare function getDbPath(): string;
5
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAA+B,MAAM,UAAU,CAAC;AAM5E,eAAO,MAAM,cAAc,EAAE,cAqB5B,CAAC;AA4DF,wBAAgB,UAAU,IAAI,cAAc,CAwC3C;AAgDD,wBAAgB,SAAS,IAAI,MAAM,CA+BlC"}
@@ -0,0 +1,31 @@
1
+ import { Database } from "bun:sqlite";
2
+ import type { MemoryCategory, MementosConfig } from "../types/index.js";
3
+ export interface InjectionOptions {
4
+ agent_id?: string;
5
+ project_id?: string;
6
+ session_id?: string;
7
+ max_tokens?: number;
8
+ categories?: MemoryCategory[];
9
+ min_importance?: number;
10
+ db?: Database;
11
+ }
12
+ export declare class MemoryInjector {
13
+ private config;
14
+ private injectedIds;
15
+ constructor(config?: MementosConfig);
16
+ /**
17
+ * Get formatted injection context suitable for system prompt insertion.
18
+ * Selects memories by scope visibility, importance, and category.
19
+ * Token-budget aware.
20
+ */
21
+ getInjectionContext(options?: InjectionOptions): string;
22
+ /**
23
+ * Reset the deduplication window (call between refresh intervals)
24
+ */
25
+ resetDedup(): void;
26
+ /**
27
+ * Get count of memories injected so far in this session
28
+ */
29
+ getInjectedCount(): number;
30
+ }
31
+ //# sourceMappingURL=injector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"injector.d.ts","sourceRoot":"","sources":["../../src/lib/injector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAU,cAAc,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAQhF,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,cAAc,EAAE,CAAC;IAC9B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,EAAE,CAAC,EAAE,QAAQ,CAAC;CACf;AAED,qBAAa,cAAc;IACzB,OAAO,CAAC,MAAM,CAAiB;IAC/B,OAAO,CAAC,WAAW,CAA0B;gBAEjC,MAAM,CAAC,EAAE,cAAc;IAInC;;;;OAIG;IACH,mBAAmB,CAAC,OAAO,GAAE,gBAAqB,GAAG,MAAM;IAkG3D;;OAEG;IACH,UAAU,IAAI,IAAI;IAIlB;;OAEG;IACH,gBAAgB,IAAI,MAAM;CAG3B"}
@@ -0,0 +1,10 @@
1
+ import type { Database } from "bun:sqlite";
2
+ import type { MementosConfig } from "../types/index.js";
3
+ export declare function enforceQuotas(config: MementosConfig, db?: Database): number;
4
+ export declare function archiveStale(staleDays: number, db?: Database): number;
5
+ export declare function runCleanup(config: MementosConfig, db?: Database): {
6
+ expired: number;
7
+ evicted: number;
8
+ archived: number;
9
+ };
10
+ //# sourceMappingURL=retention.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retention.d.ts","sourceRoot":"","sources":["../../src/lib/retention.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAe,MAAM,mBAAmB,CAAC;AAQrE,wBAAgB,aAAa,CAAC,MAAM,EAAE,cAAc,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,MAAM,CAuC3E;AAMD,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,MAAM,CAsBrE;AAMD,wBAAgB,UAAU,CACxB,MAAM,EAAE,cAAc,EACtB,EAAE,CAAC,EAAE,QAAQ,GACZ;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAQxD"}
@@ -0,0 +1,11 @@
1
+ import { Database } from "bun:sqlite";
2
+ import type { MemoryFilter, MemorySearchResult } from "../types/index.js";
3
+ /**
4
+ * Search memories by query string with relevance scoring.
5
+ *
6
+ * Searches across key, value, summary, and tags. Results are scored,
7
+ * weighted by importance, filtered, and sorted by score DESC then
8
+ * importance DESC.
9
+ */
10
+ export declare function searchMemories(query: string, filter?: MemoryFilter, db?: Database): MemorySearchResult[];
11
+ //# sourceMappingURL=search.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/lib/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAyB,MAAM,YAAY,CAAC;AAC7D,OAAO,KAAK,EAAU,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAuFlF;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,YAAY,EACrB,EAAE,CAAC,EAAE,QAAQ,GACZ,kBAAkB,EAAE,CAqItB"}
@@ -0,0 +1,10 @@
1
+ import { Database } from "bun:sqlite";
2
+ import type { ConflictResolution, SyncDirection, SyncResult } from "../types/index.js";
3
+ export declare function syncMemories(agentName: string, direction?: SyncDirection, options?: {
4
+ agent_id?: string;
5
+ project_id?: string;
6
+ conflict_resolution?: ConflictResolution;
7
+ db?: Database;
8
+ }): SyncResult;
9
+ export declare const defaultSyncAgents: string[];
10
+ //# sourceMappingURL=sync.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../src/lib/sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAItC,OAAO,KAAK,EACV,kBAAkB,EAElB,aAAa,EACb,UAAU,EACX,MAAM,mBAAmB,CAAC;AA6K3B,wBAAgB,YAAY,CAC1B,SAAS,EAAE,MAAM,EACjB,SAAS,GAAE,aAAsB,EACjC,OAAO,GAAE;IACP,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mBAAmB,CAAC,EAAE,kBAAkB,CAAC;IACzC,EAAE,CAAC,EAAE,QAAQ,CAAC;CACV,GACL,UAAU,CAgCZ;AAED,eAAO,MAAM,iBAAiB,UAAgC,CAAC"}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env bun
2
+ export {};
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":""}