dsh-mnemon-source-documents 0.5.0-rc.1
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 +39 -0
- package/lib/client.js +1594 -0
- package/lib/contracts.d.ts +89 -0
- package/lib/contracts.js +5 -0
- package/lib/index.d.ts +22 -0
- package/lib/index.js +1034 -0
- package/lib/types/client/api.d.ts +9 -0
- package/lib/types/client/pages.d.ts +10 -0
- package/lib/types/client/ui.d.ts +8 -0
- package/lib/types/client.d.ts +3 -0
- package/lib/types/contracts.d.ts +86 -0
- package/package.json +87 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
//#region src/contracts.d.ts
|
|
2
|
+
type DocumentStatus = 'active' | 'archived';
|
|
3
|
+
interface DocumentRecord {
|
|
4
|
+
id: string;
|
|
5
|
+
title: string;
|
|
6
|
+
description: string;
|
|
7
|
+
status: DocumentStatus;
|
|
8
|
+
filename: string;
|
|
9
|
+
relativePath: string;
|
|
10
|
+
sourcePaths: string[];
|
|
11
|
+
sessionIds: string[];
|
|
12
|
+
createdAt: string;
|
|
13
|
+
updatedAt: string;
|
|
14
|
+
lastAccessedAt: string;
|
|
15
|
+
revision: number;
|
|
16
|
+
contentHash: string;
|
|
17
|
+
sizeBytes: number;
|
|
18
|
+
archivedAt?: string;
|
|
19
|
+
archiveSummary?: string;
|
|
20
|
+
memoryBodyIds: string[];
|
|
21
|
+
}
|
|
22
|
+
interface DocumentView extends DocumentRecord {
|
|
23
|
+
content: string;
|
|
24
|
+
}
|
|
25
|
+
interface DocumentSnapshot {
|
|
26
|
+
workspaceRoot: string;
|
|
27
|
+
directory: string;
|
|
28
|
+
indexPath: string;
|
|
29
|
+
generatedAt: string;
|
|
30
|
+
revision: string;
|
|
31
|
+
limitBytes: number;
|
|
32
|
+
activeBytes: number;
|
|
33
|
+
activeCount: number;
|
|
34
|
+
archivedCount: number;
|
|
35
|
+
total: number;
|
|
36
|
+
documents: Array<DocumentRecord & {
|
|
37
|
+
healthy: boolean;
|
|
38
|
+
excerpt: string;
|
|
39
|
+
}>;
|
|
40
|
+
}
|
|
41
|
+
interface DocumentSearchResult {
|
|
42
|
+
query: string;
|
|
43
|
+
includeArchived: boolean;
|
|
44
|
+
total: number;
|
|
45
|
+
generatedAt: string;
|
|
46
|
+
results: Array<DocumentView & {
|
|
47
|
+
score: number;
|
|
48
|
+
excerpt: string;
|
|
49
|
+
}>;
|
|
50
|
+
}
|
|
51
|
+
type DocumentMutation = {
|
|
52
|
+
action: 'create';
|
|
53
|
+
title: string;
|
|
54
|
+
description?: string;
|
|
55
|
+
content: string;
|
|
56
|
+
sourcePaths?: string[];
|
|
57
|
+
sessionIds?: string[];
|
|
58
|
+
} | {
|
|
59
|
+
action: 'update';
|
|
60
|
+
id: string;
|
|
61
|
+
title?: string;
|
|
62
|
+
description?: string;
|
|
63
|
+
content?: string;
|
|
64
|
+
sourcePaths?: string[];
|
|
65
|
+
sessionIds?: string[];
|
|
66
|
+
};
|
|
67
|
+
interface DocumentMutationResult {
|
|
68
|
+
success: true;
|
|
69
|
+
action: 'created' | 'updated' | 'archived';
|
|
70
|
+
document: DocumentView;
|
|
71
|
+
snapshot: DocumentSnapshot;
|
|
72
|
+
maintenance?: {
|
|
73
|
+
runId: string;
|
|
74
|
+
provider: string;
|
|
75
|
+
summary: string;
|
|
76
|
+
memoryBodyIds: string[];
|
|
77
|
+
archivedDocumentIds: string[];
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
interface DocumentCapacityPlan {
|
|
81
|
+
projected: number;
|
|
82
|
+
limit: number;
|
|
83
|
+
fits: boolean;
|
|
84
|
+
candidates: DocumentRecord[];
|
|
85
|
+
}
|
|
86
|
+
declare const DOCUMENTS_VERSION = 1;
|
|
87
|
+
declare const DOCUMENTS_ACTIVE_LIMIT_BYTES: number;
|
|
88
|
+
//#endregion
|
|
89
|
+
export { DOCUMENTS_ACTIVE_LIMIT_BYTES, DOCUMENTS_VERSION, DocumentCapacityPlan, DocumentMutation, DocumentMutationResult, DocumentRecord, DocumentSearchResult, DocumentSnapshot, DocumentStatus, DocumentView };
|
package/lib/contracts.js
ADDED
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DOCUMENTS_ACTIVE_LIMIT_BYTES, DOCUMENTS_VERSION, DocumentCapacityPlan, DocumentMutation, DocumentMutationResult, DocumentRecord, DocumentSearchResult, DocumentSnapshot, DocumentStatus, DocumentView } from "./contracts.js";
|
|
2
|
+
import z from "schemastery";
|
|
3
|
+
import { MemorySourceDefinition } from "dsh-mnemon/contracts";
|
|
4
|
+
import { Context } from "@deepseek-ai/cordis";
|
|
5
|
+
//#region src/config.d.ts
|
|
6
|
+
interface Config {
|
|
7
|
+
dataDir?: string;
|
|
8
|
+
limitBytes?: number;
|
|
9
|
+
}
|
|
10
|
+
declare const Config: z<Config>;
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/source.d.ts
|
|
13
|
+
declare function createDocumentsMemorySource(config?: Config): MemorySourceDefinition;
|
|
14
|
+
declare const DOCUMENTS_MEMORY_SOURCE: MemorySourceDefinition;
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/index.d.ts
|
|
17
|
+
declare const name = "dsh-mnemon-source-documents";
|
|
18
|
+
declare const inject: string[];
|
|
19
|
+
declare const memoryPlugin: import("dsh-mnemon/extension-sdk").MemoryPluginDescriptor;
|
|
20
|
+
declare function apply(ctx: Context, config?: Config): void;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { Config, type DOCUMENTS_ACTIVE_LIMIT_BYTES, DOCUMENTS_MEMORY_SOURCE, type DOCUMENTS_VERSION, type DocumentCapacityPlan, type DocumentMutation, type DocumentMutationResult, type DocumentRecord, type DocumentSearchResult, type DocumentSnapshot, type DocumentStatus, type DocumentView, apply, createDocumentsMemorySource, inject, memoryPlugin, name };
|