@membank/core 0.12.1 → 0.14.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/client.cjs +3 -1
- package/dist/client.d.cts +16 -1
- package/dist/client.d.mts +16 -1
- package/dist/client.mjs +4 -1
- package/dist/index.cjs +110 -33
- package/dist/index.d.cts +122 -3
- package/dist/index.d.mts +122 -3
- package/dist/index.mjs +110 -33
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -103,6 +103,22 @@ declare function createActivityLogger(db: DatabaseManager): ActivityLogger;
|
|
|
103
103
|
//#region src/config/loader.d.ts
|
|
104
104
|
declare function isSynthesisEnabled(): boolean;
|
|
105
105
|
//#endregion
|
|
106
|
+
//#region src/memory/domain/memory-version.d.ts
|
|
107
|
+
type MemoryVersion = {
|
|
108
|
+
version: number;
|
|
109
|
+
content: string;
|
|
110
|
+
createdAt: string;
|
|
111
|
+
};
|
|
112
|
+
//#endregion
|
|
113
|
+
//#region src/synthesis/domain/synthesis-version.d.ts
|
|
114
|
+
type SynthesisVersion = {
|
|
115
|
+
version: number;
|
|
116
|
+
content: string;
|
|
117
|
+
sourceMemoryHash: string;
|
|
118
|
+
synthesizedAt: string;
|
|
119
|
+
createdAt: string;
|
|
120
|
+
};
|
|
121
|
+
//#endregion
|
|
106
122
|
//#region src/schemas.d.ts
|
|
107
123
|
declare const MEMORY_TYPE_VALUES: readonly ["correction", "preference", "decision", "learning", "fact"];
|
|
108
124
|
declare const MemoryTypeSchema: z.ZodEnum<{
|
|
@@ -339,6 +355,24 @@ declare const MemoryRowSchema: z.ZodObject<{
|
|
|
339
355
|
updated_at: z.ZodString;
|
|
340
356
|
}, z.core.$strip>;
|
|
341
357
|
type MemoryRow = z.infer<typeof MemoryRowSchema>;
|
|
358
|
+
declare const MemoryVersionRowSchema: z.ZodObject<{
|
|
359
|
+
id: z.ZodNumber;
|
|
360
|
+
memory_id: z.ZodString;
|
|
361
|
+
version: z.ZodNumber;
|
|
362
|
+
content: z.ZodString;
|
|
363
|
+
created_at: z.ZodString;
|
|
364
|
+
}, z.core.$strip>;
|
|
365
|
+
type MemoryVersionRow = z.infer<typeof MemoryVersionRowSchema>;
|
|
366
|
+
declare const SynthesisVersionRowSchema: z.ZodObject<{
|
|
367
|
+
id: z.ZodNumber;
|
|
368
|
+
scope: z.ZodString;
|
|
369
|
+
version: z.ZodNumber;
|
|
370
|
+
content: z.ZodString;
|
|
371
|
+
source_memory_hash: z.ZodString;
|
|
372
|
+
synthesized_at: z.ZodString;
|
|
373
|
+
created_at: z.ZodString;
|
|
374
|
+
}, z.core.$strip>;
|
|
375
|
+
type SynthesisVersionRow = z.infer<typeof SynthesisVersionRowSchema>;
|
|
342
376
|
declare const ProjectRowSchema: z.ZodObject<{
|
|
343
377
|
id: z.ZodString;
|
|
344
378
|
name: z.ZodString;
|
|
@@ -394,6 +428,26 @@ interface StatsResult {
|
|
|
394
428
|
needsReview: number;
|
|
395
429
|
pinBudgetChars: number;
|
|
396
430
|
}
|
|
431
|
+
interface ReviewQueueStats {
|
|
432
|
+
pairs: number;
|
|
433
|
+
clusters: number;
|
|
434
|
+
byBand: {
|
|
435
|
+
high: number;
|
|
436
|
+
mid: number;
|
|
437
|
+
low: number;
|
|
438
|
+
};
|
|
439
|
+
byType: Partial<Record<MemoryType, number>>;
|
|
440
|
+
}
|
|
441
|
+
interface BulkOpResult {
|
|
442
|
+
id: string;
|
|
443
|
+
status: "ok" | "error";
|
|
444
|
+
error?: string;
|
|
445
|
+
}
|
|
446
|
+
interface MergeMemoriesOpts {
|
|
447
|
+
keepId: string;
|
|
448
|
+
dropIds: string[];
|
|
449
|
+
mergedContent: string;
|
|
450
|
+
}
|
|
397
451
|
interface MemoryExportRecord {
|
|
398
452
|
id: string;
|
|
399
453
|
content: string;
|
|
@@ -426,6 +480,7 @@ interface CreateReviewEventOpts {
|
|
|
426
480
|
}
|
|
427
481
|
interface MemoryRepository {
|
|
428
482
|
findById(id: string): Memory | undefined;
|
|
483
|
+
findManyById(ids: string[]): Memory[];
|
|
429
484
|
findSimilar(embedding: Float32Array, type: MemoryType, projectHash?: string): SimilarMemoryResult[];
|
|
430
485
|
list(opts?: {
|
|
431
486
|
type?: MemoryType;
|
|
@@ -435,12 +490,22 @@ interface MemoryRepository {
|
|
|
435
490
|
}): Memory[];
|
|
436
491
|
listPinnedGlobal(): Memory[];
|
|
437
492
|
listPinnedForProject(projectHash: string): Memory[];
|
|
438
|
-
listFlagged(
|
|
493
|
+
listFlagged(opts?: {
|
|
494
|
+
projectHash?: string;
|
|
495
|
+
limit?: number;
|
|
496
|
+
minSimilarity?: number;
|
|
497
|
+
maxSimilarity?: number;
|
|
498
|
+
}): Memory[];
|
|
499
|
+
listReviewEdges(projectHash?: string): Array<{
|
|
500
|
+
memoryId: string;
|
|
501
|
+
conflictingMemoryId: string;
|
|
502
|
+
}>;
|
|
439
503
|
listReviewEvents(memoryId: string, opts?: {
|
|
440
504
|
unresolvedOnly?: boolean;
|
|
441
505
|
}): ReviewEvent[];
|
|
442
506
|
getPinnedCharCount(projectHash?: string): number;
|
|
443
507
|
stats(projectHash?: string): StatsResult;
|
|
508
|
+
reviewQueueStats(projectHash?: string): Omit<ReviewQueueStats, "clusters">;
|
|
444
509
|
create(opts: CreateMemoryOpts): Memory;
|
|
445
510
|
overwrite(id: string, content: string, embedding: Float32Array): Memory;
|
|
446
511
|
update(id: string, patch: MemoryPatch, embedding?: Float32Array): Memory;
|
|
@@ -451,6 +516,8 @@ interface MemoryRepository {
|
|
|
451
516
|
incrementAccessCount(id: string): void;
|
|
452
517
|
exportAll(): MemoryExportRecord[];
|
|
453
518
|
importAll(records: MemoryExportRecord[]): void;
|
|
519
|
+
listVersions(memoryId: string): MemoryVersion[];
|
|
520
|
+
getVersion(memoryId: string, version: number): MemoryVersion | undefined;
|
|
454
521
|
}
|
|
455
522
|
interface Embedder {
|
|
456
523
|
embed(text: string): Promise<Float32Array>;
|
|
@@ -560,12 +627,46 @@ interface TranscriptReaderOptions {
|
|
|
560
627
|
}
|
|
561
628
|
declare function createClaudeCodeTranscriptReader(opts?: TranscriptReaderOptions): TranscriptReader;
|
|
562
629
|
//#endregion
|
|
630
|
+
//#region src/memory/application/cluster-flagged.d.ts
|
|
631
|
+
interface FlagCluster {
|
|
632
|
+
clusterId: string;
|
|
633
|
+
memoryIds: string[];
|
|
634
|
+
}
|
|
635
|
+
declare function clusterFlagged(edges: Array<{
|
|
636
|
+
memoryId: string;
|
|
637
|
+
conflictingMemoryId: string;
|
|
638
|
+
}>): FlagCluster[];
|
|
639
|
+
//#endregion
|
|
640
|
+
//#region src/memory/application/delete-many.d.ts
|
|
641
|
+
declare function deleteManyMemories(ids: string[], repo: MemoryRepository, activityLogger?: ActivityLogger): Promise<BulkOpResult[]>;
|
|
642
|
+
//#endregion
|
|
563
643
|
//#region src/memory/application/delete-memory.d.ts
|
|
564
644
|
declare function deleteMemory(id: string, repo: MemoryRepository, activityLogger?: ActivityLogger): Promise<void>;
|
|
565
645
|
//#endregion
|
|
646
|
+
//#region src/memory/application/merge-memories.d.ts
|
|
647
|
+
interface MergeMemoriesResult {
|
|
648
|
+
kept: Memory;
|
|
649
|
+
dropped: string[];
|
|
650
|
+
}
|
|
651
|
+
declare function mergeMemories(opts: MergeMemoriesOpts, deps: {
|
|
652
|
+
repo: MemoryRepository;
|
|
653
|
+
embedder: Embedder;
|
|
654
|
+
activityLogger?: ActivityLogger;
|
|
655
|
+
}): Promise<MergeMemoriesResult>;
|
|
656
|
+
//#endregion
|
|
566
657
|
//#region src/memory/application/resolve-review.d.ts
|
|
567
658
|
declare function resolveReview(memoryId: string, repo: MemoryRepository): void;
|
|
568
659
|
//#endregion
|
|
660
|
+
//#region src/memory/application/resolve-review-many.d.ts
|
|
661
|
+
declare function resolveReviewMany(ids: string[], repo: MemoryRepository): BulkOpResult[];
|
|
662
|
+
//#endregion
|
|
663
|
+
//#region src/memory/application/revert-memory.d.ts
|
|
664
|
+
declare function revertMemory(id: string, version: number, deps: {
|
|
665
|
+
repo: MemoryRepository;
|
|
666
|
+
embedder: Embedder;
|
|
667
|
+
activityLogger?: ActivityLogger;
|
|
668
|
+
}): Promise<Memory>;
|
|
669
|
+
//#endregion
|
|
569
670
|
//#region src/memory/application/save-memory.d.ts
|
|
570
671
|
declare function saveMemory(opts: SaveOptions, deps: {
|
|
571
672
|
repo: MemoryRepository;
|
|
@@ -605,6 +706,7 @@ declare class SqliteMemoryRepository implements MemoryRepository {
|
|
|
605
706
|
create(opts: CreateMemoryOpts): Memory;
|
|
606
707
|
overwrite(id: string, content: string, embedding: Float32Array): Memory;
|
|
607
708
|
findById(id: string): Memory | undefined;
|
|
709
|
+
findManyById(ids: string[]): Memory[];
|
|
608
710
|
update(id: string, patch: MemoryPatch, embedding?: Float32Array): Memory;
|
|
609
711
|
delete(id: string): void;
|
|
610
712
|
list(opts?: {
|
|
@@ -615,7 +717,16 @@ declare class SqliteMemoryRepository implements MemoryRepository {
|
|
|
615
717
|
}): Memory[];
|
|
616
718
|
listPinnedGlobal(): Memory[];
|
|
617
719
|
listPinnedForProject(projectHash: string): Memory[];
|
|
618
|
-
listFlagged(
|
|
720
|
+
listFlagged(opts?: {
|
|
721
|
+
projectHash?: string;
|
|
722
|
+
limit?: number;
|
|
723
|
+
minSimilarity?: number;
|
|
724
|
+
maxSimilarity?: number;
|
|
725
|
+
}): Memory[];
|
|
726
|
+
listReviewEdges(projectHash?: string): Array<{
|
|
727
|
+
memoryId: string;
|
|
728
|
+
conflictingMemoryId: string;
|
|
729
|
+
}>;
|
|
619
730
|
listReviewEvents(memoryId: string, opts?: {
|
|
620
731
|
unresolvedOnly?: boolean;
|
|
621
732
|
}): ReviewEvent[];
|
|
@@ -623,10 +734,13 @@ declare class SqliteMemoryRepository implements MemoryRepository {
|
|
|
623
734
|
resolveReviewEvents(memoryId: string): void;
|
|
624
735
|
getPinnedCharCount(projectHash?: string): number;
|
|
625
736
|
stats(projectHash?: string): StatsResult;
|
|
737
|
+
reviewQueueStats(projectHash?: string): Omit<ReviewQueueStats, "clusters">;
|
|
626
738
|
setPin(id: string, pinned: boolean): Memory;
|
|
627
739
|
incrementAccessCount(id: string): void;
|
|
628
740
|
exportAll(): MemoryExportRecord[];
|
|
629
741
|
importAll(records: MemoryExportRecord[]): void;
|
|
742
|
+
listVersions(memoryId: string): MemoryVersion[];
|
|
743
|
+
getVersion(memoryId: string, version: number): MemoryVersion | undefined;
|
|
630
744
|
}
|
|
631
745
|
declare function createMemoryRepository(db: DatabaseManager, projects: ProjectRepository): MemoryRepository;
|
|
632
746
|
//#endregion
|
|
@@ -733,6 +847,8 @@ interface SynthesisRepository {
|
|
|
733
847
|
saveSynthesis(scope: string, content: string, sourceHash: string): Synthesis;
|
|
734
848
|
getSynthesis(scope: string): Synthesis | undefined;
|
|
735
849
|
listAll(): Synthesis[];
|
|
850
|
+
listVersions(scope: string): SynthesisVersion[];
|
|
851
|
+
getVersion(scope: string, version: number): SynthesisVersion | undefined;
|
|
736
852
|
markInFlight(scope: string): void;
|
|
737
853
|
clearInFlight(scope: string): void;
|
|
738
854
|
clearStaleInFlight(thresholdMs: number): void;
|
|
@@ -751,6 +867,9 @@ declare class SynthesisEngine {
|
|
|
751
867
|
markDirty(scope: string): void;
|
|
752
868
|
}
|
|
753
869
|
//#endregion
|
|
870
|
+
//#region src/synthesis/application/revert-synthesis.d.ts
|
|
871
|
+
declare function revertSynthesis(scope: string, version: number, repo: SynthesisRepository): Synthesis;
|
|
872
|
+
//#endregion
|
|
754
873
|
//#region src/synthesis/application/run-synthesis.d.ts
|
|
755
874
|
declare function runSynthesis(scope: string, deps: {
|
|
756
875
|
synthRepo: SynthesisRepository;
|
|
@@ -763,5 +882,5 @@ declare function createSynthesisAgentRunner(tools: SynthesisTools, config: Synth
|
|
|
763
882
|
//#region src/synthesis/infrastructure/sqlite-synthesis-repository.d.ts
|
|
764
883
|
declare function createSynthesisRepository(db: DatabaseManager): SynthesisRepository;
|
|
765
884
|
//#endregion
|
|
766
|
-
export { ACTIVITY_EVENT_TYPE_VALUES, type ActivityEvent, type ActivityEventInput, type ActivityEventType, ActivityEventTypeSchema, type ActivityLogger, type ActivityRepository, type AgentRunner, type CreateMemoryOpts, type CreateReviewEventOpts, DatabaseError, DatabaseManager, type DownloadProgress, type DownloadResult, type Embedder, EmbeddingService, type ExtractionAgentRunner, type ExtractionConfig, type ExtractionRunRecord, type ExtractionRunRepository, type ExtractionTools, GLOBAL_PROJECT_ID, GLOBAL_PROJECT_NAME, GLOBAL_SCOPE_HASH, type ListEventsFilter, MEMORY_TYPE_VALUES, MIGRATIONS, MODEL_NAME, MembankError, type Memory, type MemoryExportRecord, type MemoryPatch, MemoryPatchSchema, type MemoryRepository, type MemoryRow, MemoryRowSchema, MemorySchema, type MemoryType, MemoryTypeSchema, MigrationMeta, ModelDownloadError, ModelDownloader, PIN_BUDGET_THRESHOLD, type ProgressCallback, Project, type ProjectRepository, ProjectRow, ProjectRowSchema, ProjectSchema, type Querier, type QueryAdapter, QueryEngine, QueryOptions, QueryOptionsSchema, RETENTION_DAYS, type ReviewEvent, type ReviewEventRow, ReviewEventRowSchema, ReviewEventSchema, ReviewReason, ReviewReasonSchema, type RunExtractionInput, type RunExtractionResult, type SaveOptions, SaveOptionsSchema, ScopeToProjectsResult, type ScoredMemory, SessionContext, SessionContextBuilder, SessionContextSchema, type SimilarMemoryResult, SqliteMemoryRepository, type StatsResult, Synthesis, type SynthesisConfig, SynthesisEngine, type SynthesisRepository, SynthesisSchema, type SynthesisTools, TagsJsonSchema, type TranscriptReader, createActivityLogger, createActivityRepository, createClaudeCodeTranscriptReader, createExtractionAgentRunner, createExtractionRunRepository, createMemoryRepository, createProjectRepository, createSynthesisAgentRunner, createSynthesisRepository, deleteMemory, getSessionContext, isOverBudget, isSynthesisEnabled, listEvents, listMemoryTypes, logEvent, noopActivityLogger, queryMemories, resolveProject, resolveReview, resolveScope, rowToMemory, rowToProject, runExtraction, runScopeToProjectsMigration, runSynthesis, saveMemory, updateMemory };
|
|
885
|
+
export { ACTIVITY_EVENT_TYPE_VALUES, type ActivityEvent, type ActivityEventInput, type ActivityEventType, ActivityEventTypeSchema, type ActivityLogger, type ActivityRepository, type AgentRunner, type BulkOpResult, type CreateMemoryOpts, type CreateReviewEventOpts, DatabaseError, DatabaseManager, type DownloadProgress, type DownloadResult, type Embedder, EmbeddingService, type ExtractionAgentRunner, type ExtractionConfig, type ExtractionRunRecord, type ExtractionRunRepository, type ExtractionTools, type FlagCluster, GLOBAL_PROJECT_ID, GLOBAL_PROJECT_NAME, GLOBAL_SCOPE_HASH, type ListEventsFilter, MEMORY_TYPE_VALUES, MIGRATIONS, MODEL_NAME, MembankError, type Memory, type MemoryExportRecord, type MemoryPatch, MemoryPatchSchema, type MemoryRepository, type MemoryRow, MemoryRowSchema, MemorySchema, type MemoryType, MemoryTypeSchema, type MemoryVersion, MemoryVersionRow, MemoryVersionRowSchema, type MergeMemoriesOpts, type MergeMemoriesResult, MigrationMeta, ModelDownloadError, ModelDownloader, PIN_BUDGET_THRESHOLD, type ProgressCallback, Project, type ProjectRepository, ProjectRow, ProjectRowSchema, ProjectSchema, type Querier, type QueryAdapter, QueryEngine, QueryOptions, QueryOptionsSchema, RETENTION_DAYS, type ReviewEvent, type ReviewEventRow, ReviewEventRowSchema, ReviewEventSchema, type ReviewQueueStats, ReviewReason, ReviewReasonSchema, type RunExtractionInput, type RunExtractionResult, type SaveOptions, SaveOptionsSchema, ScopeToProjectsResult, type ScoredMemory, SessionContext, SessionContextBuilder, SessionContextSchema, type SimilarMemoryResult, SqliteMemoryRepository, type StatsResult, Synthesis, type SynthesisConfig, SynthesisEngine, type SynthesisRepository, SynthesisSchema, type SynthesisTools, type SynthesisVersion, SynthesisVersionRow, SynthesisVersionRowSchema, TagsJsonSchema, type TranscriptReader, clusterFlagged, createActivityLogger, createActivityRepository, createClaudeCodeTranscriptReader, createExtractionAgentRunner, createExtractionRunRepository, createMemoryRepository, createProjectRepository, createSynthesisAgentRunner, createSynthesisRepository, deleteManyMemories, deleteMemory, getSessionContext, isOverBudget, isSynthesisEnabled, listEvents, listMemoryTypes, logEvent, mergeMemories, noopActivityLogger, queryMemories, resolveProject, resolveReview, resolveReviewMany, resolveScope, revertMemory, revertSynthesis, rowToMemory, rowToProject, runExtraction, runScopeToProjectsMigration, runSynthesis, saveMemory, updateMemory };
|
|
767
886
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.mts
CHANGED
|
@@ -103,6 +103,22 @@ declare function createActivityLogger(db: DatabaseManager): ActivityLogger;
|
|
|
103
103
|
//#region src/config/loader.d.ts
|
|
104
104
|
declare function isSynthesisEnabled(): boolean;
|
|
105
105
|
//#endregion
|
|
106
|
+
//#region src/memory/domain/memory-version.d.ts
|
|
107
|
+
type MemoryVersion = {
|
|
108
|
+
version: number;
|
|
109
|
+
content: string;
|
|
110
|
+
createdAt: string;
|
|
111
|
+
};
|
|
112
|
+
//#endregion
|
|
113
|
+
//#region src/synthesis/domain/synthesis-version.d.ts
|
|
114
|
+
type SynthesisVersion = {
|
|
115
|
+
version: number;
|
|
116
|
+
content: string;
|
|
117
|
+
sourceMemoryHash: string;
|
|
118
|
+
synthesizedAt: string;
|
|
119
|
+
createdAt: string;
|
|
120
|
+
};
|
|
121
|
+
//#endregion
|
|
106
122
|
//#region src/schemas.d.ts
|
|
107
123
|
declare const MEMORY_TYPE_VALUES: readonly ["correction", "preference", "decision", "learning", "fact"];
|
|
108
124
|
declare const MemoryTypeSchema: z.ZodEnum<{
|
|
@@ -339,6 +355,24 @@ declare const MemoryRowSchema: z.ZodObject<{
|
|
|
339
355
|
updated_at: z.ZodString;
|
|
340
356
|
}, z.core.$strip>;
|
|
341
357
|
type MemoryRow = z.infer<typeof MemoryRowSchema>;
|
|
358
|
+
declare const MemoryVersionRowSchema: z.ZodObject<{
|
|
359
|
+
id: z.ZodNumber;
|
|
360
|
+
memory_id: z.ZodString;
|
|
361
|
+
version: z.ZodNumber;
|
|
362
|
+
content: z.ZodString;
|
|
363
|
+
created_at: z.ZodString;
|
|
364
|
+
}, z.core.$strip>;
|
|
365
|
+
type MemoryVersionRow = z.infer<typeof MemoryVersionRowSchema>;
|
|
366
|
+
declare const SynthesisVersionRowSchema: z.ZodObject<{
|
|
367
|
+
id: z.ZodNumber;
|
|
368
|
+
scope: z.ZodString;
|
|
369
|
+
version: z.ZodNumber;
|
|
370
|
+
content: z.ZodString;
|
|
371
|
+
source_memory_hash: z.ZodString;
|
|
372
|
+
synthesized_at: z.ZodString;
|
|
373
|
+
created_at: z.ZodString;
|
|
374
|
+
}, z.core.$strip>;
|
|
375
|
+
type SynthesisVersionRow = z.infer<typeof SynthesisVersionRowSchema>;
|
|
342
376
|
declare const ProjectRowSchema: z.ZodObject<{
|
|
343
377
|
id: z.ZodString;
|
|
344
378
|
name: z.ZodString;
|
|
@@ -394,6 +428,26 @@ interface StatsResult {
|
|
|
394
428
|
needsReview: number;
|
|
395
429
|
pinBudgetChars: number;
|
|
396
430
|
}
|
|
431
|
+
interface ReviewQueueStats {
|
|
432
|
+
pairs: number;
|
|
433
|
+
clusters: number;
|
|
434
|
+
byBand: {
|
|
435
|
+
high: number;
|
|
436
|
+
mid: number;
|
|
437
|
+
low: number;
|
|
438
|
+
};
|
|
439
|
+
byType: Partial<Record<MemoryType, number>>;
|
|
440
|
+
}
|
|
441
|
+
interface BulkOpResult {
|
|
442
|
+
id: string;
|
|
443
|
+
status: "ok" | "error";
|
|
444
|
+
error?: string;
|
|
445
|
+
}
|
|
446
|
+
interface MergeMemoriesOpts {
|
|
447
|
+
keepId: string;
|
|
448
|
+
dropIds: string[];
|
|
449
|
+
mergedContent: string;
|
|
450
|
+
}
|
|
397
451
|
interface MemoryExportRecord {
|
|
398
452
|
id: string;
|
|
399
453
|
content: string;
|
|
@@ -426,6 +480,7 @@ interface CreateReviewEventOpts {
|
|
|
426
480
|
}
|
|
427
481
|
interface MemoryRepository {
|
|
428
482
|
findById(id: string): Memory | undefined;
|
|
483
|
+
findManyById(ids: string[]): Memory[];
|
|
429
484
|
findSimilar(embedding: Float32Array, type: MemoryType, projectHash?: string): SimilarMemoryResult[];
|
|
430
485
|
list(opts?: {
|
|
431
486
|
type?: MemoryType;
|
|
@@ -435,12 +490,22 @@ interface MemoryRepository {
|
|
|
435
490
|
}): Memory[];
|
|
436
491
|
listPinnedGlobal(): Memory[];
|
|
437
492
|
listPinnedForProject(projectHash: string): Memory[];
|
|
438
|
-
listFlagged(
|
|
493
|
+
listFlagged(opts?: {
|
|
494
|
+
projectHash?: string;
|
|
495
|
+
limit?: number;
|
|
496
|
+
minSimilarity?: number;
|
|
497
|
+
maxSimilarity?: number;
|
|
498
|
+
}): Memory[];
|
|
499
|
+
listReviewEdges(projectHash?: string): Array<{
|
|
500
|
+
memoryId: string;
|
|
501
|
+
conflictingMemoryId: string;
|
|
502
|
+
}>;
|
|
439
503
|
listReviewEvents(memoryId: string, opts?: {
|
|
440
504
|
unresolvedOnly?: boolean;
|
|
441
505
|
}): ReviewEvent[];
|
|
442
506
|
getPinnedCharCount(projectHash?: string): number;
|
|
443
507
|
stats(projectHash?: string): StatsResult;
|
|
508
|
+
reviewQueueStats(projectHash?: string): Omit<ReviewQueueStats, "clusters">;
|
|
444
509
|
create(opts: CreateMemoryOpts): Memory;
|
|
445
510
|
overwrite(id: string, content: string, embedding: Float32Array): Memory;
|
|
446
511
|
update(id: string, patch: MemoryPatch, embedding?: Float32Array): Memory;
|
|
@@ -451,6 +516,8 @@ interface MemoryRepository {
|
|
|
451
516
|
incrementAccessCount(id: string): void;
|
|
452
517
|
exportAll(): MemoryExportRecord[];
|
|
453
518
|
importAll(records: MemoryExportRecord[]): void;
|
|
519
|
+
listVersions(memoryId: string): MemoryVersion[];
|
|
520
|
+
getVersion(memoryId: string, version: number): MemoryVersion | undefined;
|
|
454
521
|
}
|
|
455
522
|
interface Embedder {
|
|
456
523
|
embed(text: string): Promise<Float32Array>;
|
|
@@ -560,12 +627,46 @@ interface TranscriptReaderOptions {
|
|
|
560
627
|
}
|
|
561
628
|
declare function createClaudeCodeTranscriptReader(opts?: TranscriptReaderOptions): TranscriptReader;
|
|
562
629
|
//#endregion
|
|
630
|
+
//#region src/memory/application/cluster-flagged.d.ts
|
|
631
|
+
interface FlagCluster {
|
|
632
|
+
clusterId: string;
|
|
633
|
+
memoryIds: string[];
|
|
634
|
+
}
|
|
635
|
+
declare function clusterFlagged(edges: Array<{
|
|
636
|
+
memoryId: string;
|
|
637
|
+
conflictingMemoryId: string;
|
|
638
|
+
}>): FlagCluster[];
|
|
639
|
+
//#endregion
|
|
640
|
+
//#region src/memory/application/delete-many.d.ts
|
|
641
|
+
declare function deleteManyMemories(ids: string[], repo: MemoryRepository, activityLogger?: ActivityLogger): Promise<BulkOpResult[]>;
|
|
642
|
+
//#endregion
|
|
563
643
|
//#region src/memory/application/delete-memory.d.ts
|
|
564
644
|
declare function deleteMemory(id: string, repo: MemoryRepository, activityLogger?: ActivityLogger): Promise<void>;
|
|
565
645
|
//#endregion
|
|
646
|
+
//#region src/memory/application/merge-memories.d.ts
|
|
647
|
+
interface MergeMemoriesResult {
|
|
648
|
+
kept: Memory;
|
|
649
|
+
dropped: string[];
|
|
650
|
+
}
|
|
651
|
+
declare function mergeMemories(opts: MergeMemoriesOpts, deps: {
|
|
652
|
+
repo: MemoryRepository;
|
|
653
|
+
embedder: Embedder;
|
|
654
|
+
activityLogger?: ActivityLogger;
|
|
655
|
+
}): Promise<MergeMemoriesResult>;
|
|
656
|
+
//#endregion
|
|
566
657
|
//#region src/memory/application/resolve-review.d.ts
|
|
567
658
|
declare function resolveReview(memoryId: string, repo: MemoryRepository): void;
|
|
568
659
|
//#endregion
|
|
660
|
+
//#region src/memory/application/resolve-review-many.d.ts
|
|
661
|
+
declare function resolveReviewMany(ids: string[], repo: MemoryRepository): BulkOpResult[];
|
|
662
|
+
//#endregion
|
|
663
|
+
//#region src/memory/application/revert-memory.d.ts
|
|
664
|
+
declare function revertMemory(id: string, version: number, deps: {
|
|
665
|
+
repo: MemoryRepository;
|
|
666
|
+
embedder: Embedder;
|
|
667
|
+
activityLogger?: ActivityLogger;
|
|
668
|
+
}): Promise<Memory>;
|
|
669
|
+
//#endregion
|
|
569
670
|
//#region src/memory/application/save-memory.d.ts
|
|
570
671
|
declare function saveMemory(opts: SaveOptions, deps: {
|
|
571
672
|
repo: MemoryRepository;
|
|
@@ -605,6 +706,7 @@ declare class SqliteMemoryRepository implements MemoryRepository {
|
|
|
605
706
|
create(opts: CreateMemoryOpts): Memory;
|
|
606
707
|
overwrite(id: string, content: string, embedding: Float32Array): Memory;
|
|
607
708
|
findById(id: string): Memory | undefined;
|
|
709
|
+
findManyById(ids: string[]): Memory[];
|
|
608
710
|
update(id: string, patch: MemoryPatch, embedding?: Float32Array): Memory;
|
|
609
711
|
delete(id: string): void;
|
|
610
712
|
list(opts?: {
|
|
@@ -615,7 +717,16 @@ declare class SqliteMemoryRepository implements MemoryRepository {
|
|
|
615
717
|
}): Memory[];
|
|
616
718
|
listPinnedGlobal(): Memory[];
|
|
617
719
|
listPinnedForProject(projectHash: string): Memory[];
|
|
618
|
-
listFlagged(
|
|
720
|
+
listFlagged(opts?: {
|
|
721
|
+
projectHash?: string;
|
|
722
|
+
limit?: number;
|
|
723
|
+
minSimilarity?: number;
|
|
724
|
+
maxSimilarity?: number;
|
|
725
|
+
}): Memory[];
|
|
726
|
+
listReviewEdges(projectHash?: string): Array<{
|
|
727
|
+
memoryId: string;
|
|
728
|
+
conflictingMemoryId: string;
|
|
729
|
+
}>;
|
|
619
730
|
listReviewEvents(memoryId: string, opts?: {
|
|
620
731
|
unresolvedOnly?: boolean;
|
|
621
732
|
}): ReviewEvent[];
|
|
@@ -623,10 +734,13 @@ declare class SqliteMemoryRepository implements MemoryRepository {
|
|
|
623
734
|
resolveReviewEvents(memoryId: string): void;
|
|
624
735
|
getPinnedCharCount(projectHash?: string): number;
|
|
625
736
|
stats(projectHash?: string): StatsResult;
|
|
737
|
+
reviewQueueStats(projectHash?: string): Omit<ReviewQueueStats, "clusters">;
|
|
626
738
|
setPin(id: string, pinned: boolean): Memory;
|
|
627
739
|
incrementAccessCount(id: string): void;
|
|
628
740
|
exportAll(): MemoryExportRecord[];
|
|
629
741
|
importAll(records: MemoryExportRecord[]): void;
|
|
742
|
+
listVersions(memoryId: string): MemoryVersion[];
|
|
743
|
+
getVersion(memoryId: string, version: number): MemoryVersion | undefined;
|
|
630
744
|
}
|
|
631
745
|
declare function createMemoryRepository(db: DatabaseManager, projects: ProjectRepository): MemoryRepository;
|
|
632
746
|
//#endregion
|
|
@@ -733,6 +847,8 @@ interface SynthesisRepository {
|
|
|
733
847
|
saveSynthesis(scope: string, content: string, sourceHash: string): Synthesis;
|
|
734
848
|
getSynthesis(scope: string): Synthesis | undefined;
|
|
735
849
|
listAll(): Synthesis[];
|
|
850
|
+
listVersions(scope: string): SynthesisVersion[];
|
|
851
|
+
getVersion(scope: string, version: number): SynthesisVersion | undefined;
|
|
736
852
|
markInFlight(scope: string): void;
|
|
737
853
|
clearInFlight(scope: string): void;
|
|
738
854
|
clearStaleInFlight(thresholdMs: number): void;
|
|
@@ -751,6 +867,9 @@ declare class SynthesisEngine {
|
|
|
751
867
|
markDirty(scope: string): void;
|
|
752
868
|
}
|
|
753
869
|
//#endregion
|
|
870
|
+
//#region src/synthesis/application/revert-synthesis.d.ts
|
|
871
|
+
declare function revertSynthesis(scope: string, version: number, repo: SynthesisRepository): Synthesis;
|
|
872
|
+
//#endregion
|
|
754
873
|
//#region src/synthesis/application/run-synthesis.d.ts
|
|
755
874
|
declare function runSynthesis(scope: string, deps: {
|
|
756
875
|
synthRepo: SynthesisRepository;
|
|
@@ -763,5 +882,5 @@ declare function createSynthesisAgentRunner(tools: SynthesisTools, config: Synth
|
|
|
763
882
|
//#region src/synthesis/infrastructure/sqlite-synthesis-repository.d.ts
|
|
764
883
|
declare function createSynthesisRepository(db: DatabaseManager): SynthesisRepository;
|
|
765
884
|
//#endregion
|
|
766
|
-
export { ACTIVITY_EVENT_TYPE_VALUES, type ActivityEvent, type ActivityEventInput, type ActivityEventType, ActivityEventTypeSchema, type ActivityLogger, type ActivityRepository, type AgentRunner, type CreateMemoryOpts, type CreateReviewEventOpts, DatabaseError, DatabaseManager, type DownloadProgress, type DownloadResult, type Embedder, EmbeddingService, type ExtractionAgentRunner, type ExtractionConfig, type ExtractionRunRecord, type ExtractionRunRepository, type ExtractionTools, GLOBAL_PROJECT_ID, GLOBAL_PROJECT_NAME, GLOBAL_SCOPE_HASH, type ListEventsFilter, MEMORY_TYPE_VALUES, MIGRATIONS, MODEL_NAME, MembankError, type Memory, type MemoryExportRecord, type MemoryPatch, MemoryPatchSchema, type MemoryRepository, type MemoryRow, MemoryRowSchema, MemorySchema, type MemoryType, MemoryTypeSchema, MigrationMeta, ModelDownloadError, ModelDownloader, PIN_BUDGET_THRESHOLD, type ProgressCallback, Project, type ProjectRepository, ProjectRow, ProjectRowSchema, ProjectSchema, type Querier, type QueryAdapter, QueryEngine, QueryOptions, QueryOptionsSchema, RETENTION_DAYS, type ReviewEvent, type ReviewEventRow, ReviewEventRowSchema, ReviewEventSchema, ReviewReason, ReviewReasonSchema, type RunExtractionInput, type RunExtractionResult, type SaveOptions, SaveOptionsSchema, ScopeToProjectsResult, type ScoredMemory, SessionContext, SessionContextBuilder, SessionContextSchema, type SimilarMemoryResult, SqliteMemoryRepository, type StatsResult, Synthesis, type SynthesisConfig, SynthesisEngine, type SynthesisRepository, SynthesisSchema, type SynthesisTools, TagsJsonSchema, type TranscriptReader, createActivityLogger, createActivityRepository, createClaudeCodeTranscriptReader, createExtractionAgentRunner, createExtractionRunRepository, createMemoryRepository, createProjectRepository, createSynthesisAgentRunner, createSynthesisRepository, deleteMemory, getSessionContext, isOverBudget, isSynthesisEnabled, listEvents, listMemoryTypes, logEvent, noopActivityLogger, queryMemories, resolveProject, resolveReview, resolveScope, rowToMemory, rowToProject, runExtraction, runScopeToProjectsMigration, runSynthesis, saveMemory, updateMemory };
|
|
885
|
+
export { ACTIVITY_EVENT_TYPE_VALUES, type ActivityEvent, type ActivityEventInput, type ActivityEventType, ActivityEventTypeSchema, type ActivityLogger, type ActivityRepository, type AgentRunner, type BulkOpResult, type CreateMemoryOpts, type CreateReviewEventOpts, DatabaseError, DatabaseManager, type DownloadProgress, type DownloadResult, type Embedder, EmbeddingService, type ExtractionAgentRunner, type ExtractionConfig, type ExtractionRunRecord, type ExtractionRunRepository, type ExtractionTools, type FlagCluster, GLOBAL_PROJECT_ID, GLOBAL_PROJECT_NAME, GLOBAL_SCOPE_HASH, type ListEventsFilter, MEMORY_TYPE_VALUES, MIGRATIONS, MODEL_NAME, MembankError, type Memory, type MemoryExportRecord, type MemoryPatch, MemoryPatchSchema, type MemoryRepository, type MemoryRow, MemoryRowSchema, MemorySchema, type MemoryType, MemoryTypeSchema, type MemoryVersion, MemoryVersionRow, MemoryVersionRowSchema, type MergeMemoriesOpts, type MergeMemoriesResult, MigrationMeta, ModelDownloadError, ModelDownloader, PIN_BUDGET_THRESHOLD, type ProgressCallback, Project, type ProjectRepository, ProjectRow, ProjectRowSchema, ProjectSchema, type Querier, type QueryAdapter, QueryEngine, QueryOptions, QueryOptionsSchema, RETENTION_DAYS, type ReviewEvent, type ReviewEventRow, ReviewEventRowSchema, ReviewEventSchema, type ReviewQueueStats, ReviewReason, ReviewReasonSchema, type RunExtractionInput, type RunExtractionResult, type SaveOptions, SaveOptionsSchema, ScopeToProjectsResult, type ScoredMemory, SessionContext, SessionContextBuilder, SessionContextSchema, type SimilarMemoryResult, SqliteMemoryRepository, type StatsResult, Synthesis, type SynthesisConfig, SynthesisEngine, type SynthesisRepository, SynthesisSchema, type SynthesisTools, type SynthesisVersion, SynthesisVersionRow, SynthesisVersionRowSchema, TagsJsonSchema, type TranscriptReader, clusterFlagged, createActivityLogger, createActivityRepository, createClaudeCodeTranscriptReader, createExtractionAgentRunner, createExtractionRunRepository, createMemoryRepository, createProjectRepository, createSynthesisAgentRunner, createSynthesisRepository, deleteManyMemories, deleteMemory, getSessionContext, isOverBudget, isSynthesisEnabled, listEvents, listMemoryTypes, logEvent, mergeMemories, noopActivityLogger, queryMemories, resolveProject, resolveReview, resolveReviewMany, resolveScope, revertMemory, revertSynthesis, rowToMemory, rowToProject, runExtraction, runScopeToProjectsMigration, runSynthesis, saveMemory, updateMemory };
|
|
767
886
|
//# sourceMappingURL=index.d.mts.map
|