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,9 @@
|
|
|
1
|
+
import type { DocumentMutation, DocumentMutationResult, DocumentSearchResult, DocumentSnapshot, DocumentView } from '../contracts.ts';
|
|
2
|
+
/** Source-owned structural page API; the default bundle may supply agent-assisted callbacks. */
|
|
3
|
+
export interface DocumentsPageClient {
|
|
4
|
+
documents(): Promise<DocumentSnapshot>;
|
|
5
|
+
document(id: string): Promise<DocumentView>;
|
|
6
|
+
searchDocuments(query: string, includeArchived?: boolean, limit?: number): Promise<DocumentSearchResult>;
|
|
7
|
+
mutateDocument(request: DocumentMutation): Promise<DocumentMutationResult>;
|
|
8
|
+
archiveDocument(id: string): Promise<DocumentMutationResult>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
import type { DocumentsPageClient } from './api.ts';
|
|
3
|
+
export declare function DocumentsPage(props: {
|
|
4
|
+
client: DocumentsPageClient;
|
|
5
|
+
revision: number;
|
|
6
|
+
writeEnabled: boolean;
|
|
7
|
+
sessionId?: string;
|
|
8
|
+
canCreate?: boolean;
|
|
9
|
+
onMutate: () => void;
|
|
10
|
+
}): JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { installMemorySourceUI, type MemorySourcePageProps, type MnemonSourceManagementClient, type MnemonTranslate } from 'dsh-mnemon/client';
|
|
3
|
+
import type { DocumentsPageClient } from './api.ts';
|
|
4
|
+
export declare function documentsPageClient(management: MnemonSourceManagementClient): DocumentsPageClient;
|
|
5
|
+
export declare function DocumentsSourcePage(props: MemorySourcePageProps): ReactNode;
|
|
6
|
+
export declare function installDocumentsMemoryUI(ctx: Parameters<typeof installMemorySourceUI>[0], t?: MnemonTranslate): () => void;
|
|
7
|
+
export declare const inject: string[];
|
|
8
|
+
export declare function apply(ctx: Parameters<typeof installMemorySourceUI>[0]): void;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
export type DocumentStatus = 'active' | 'archived';
|
|
2
|
+
export interface DocumentRecord {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
description: string;
|
|
6
|
+
status: DocumentStatus;
|
|
7
|
+
filename: string;
|
|
8
|
+
relativePath: string;
|
|
9
|
+
sourcePaths: string[];
|
|
10
|
+
sessionIds: string[];
|
|
11
|
+
createdAt: string;
|
|
12
|
+
updatedAt: string;
|
|
13
|
+
lastAccessedAt: string;
|
|
14
|
+
revision: number;
|
|
15
|
+
contentHash: string;
|
|
16
|
+
sizeBytes: number;
|
|
17
|
+
archivedAt?: string;
|
|
18
|
+
archiveSummary?: string;
|
|
19
|
+
memoryBodyIds: string[];
|
|
20
|
+
}
|
|
21
|
+
export interface DocumentView extends DocumentRecord {
|
|
22
|
+
content: string;
|
|
23
|
+
}
|
|
24
|
+
export interface DocumentSnapshot {
|
|
25
|
+
workspaceRoot: string;
|
|
26
|
+
directory: string;
|
|
27
|
+
indexPath: string;
|
|
28
|
+
generatedAt: string;
|
|
29
|
+
revision: string;
|
|
30
|
+
limitBytes: number;
|
|
31
|
+
activeBytes: number;
|
|
32
|
+
activeCount: number;
|
|
33
|
+
archivedCount: number;
|
|
34
|
+
total: number;
|
|
35
|
+
documents: Array<DocumentRecord & {
|
|
36
|
+
healthy: boolean;
|
|
37
|
+
excerpt: string;
|
|
38
|
+
}>;
|
|
39
|
+
}
|
|
40
|
+
export interface DocumentSearchResult {
|
|
41
|
+
query: string;
|
|
42
|
+
includeArchived: boolean;
|
|
43
|
+
total: number;
|
|
44
|
+
generatedAt: string;
|
|
45
|
+
results: Array<DocumentView & {
|
|
46
|
+
score: number;
|
|
47
|
+
excerpt: string;
|
|
48
|
+
}>;
|
|
49
|
+
}
|
|
50
|
+
export type DocumentMutation = {
|
|
51
|
+
action: 'create';
|
|
52
|
+
title: string;
|
|
53
|
+
description?: string;
|
|
54
|
+
content: string;
|
|
55
|
+
sourcePaths?: string[];
|
|
56
|
+
sessionIds?: string[];
|
|
57
|
+
} | {
|
|
58
|
+
action: 'update';
|
|
59
|
+
id: string;
|
|
60
|
+
title?: string;
|
|
61
|
+
description?: string;
|
|
62
|
+
content?: string;
|
|
63
|
+
sourcePaths?: string[];
|
|
64
|
+
sessionIds?: string[];
|
|
65
|
+
};
|
|
66
|
+
export interface DocumentMutationResult {
|
|
67
|
+
success: true;
|
|
68
|
+
action: 'created' | 'updated' | 'archived';
|
|
69
|
+
document: DocumentView;
|
|
70
|
+
snapshot: DocumentSnapshot;
|
|
71
|
+
maintenance?: {
|
|
72
|
+
runId: string;
|
|
73
|
+
provider: string;
|
|
74
|
+
summary: string;
|
|
75
|
+
memoryBodyIds: string[];
|
|
76
|
+
archivedDocumentIds: string[];
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
export interface DocumentCapacityPlan {
|
|
80
|
+
projected: number;
|
|
81
|
+
limit: number;
|
|
82
|
+
fits: boolean;
|
|
83
|
+
candidates: DocumentRecord[];
|
|
84
|
+
}
|
|
85
|
+
export declare const DOCUMENTS_VERSION = 1;
|
|
86
|
+
export declare const DOCUMENTS_ACTIVE_LIMIT_BYTES: number;
|
package/package.json
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "dsh-mnemon-source-documents",
|
|
3
|
+
"version": "0.5.0-rc.1",
|
|
4
|
+
"description": "Self-contained documents Source for Composable View Memory.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=20"
|
|
9
|
+
},
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./lib/index.d.ts",
|
|
13
|
+
"default": "./lib/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./package.json": "./package.json",
|
|
16
|
+
"./client": {
|
|
17
|
+
"types": "./lib/types/client.d.ts",
|
|
18
|
+
"default": "./lib/client.js"
|
|
19
|
+
},
|
|
20
|
+
"./contracts": {
|
|
21
|
+
"types": "./lib/contracts.d.ts",
|
|
22
|
+
"default": "./lib/contracts.js"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"lib",
|
|
27
|
+
"README.md"
|
|
28
|
+
],
|
|
29
|
+
"dsh": {
|
|
30
|
+
"client": {
|
|
31
|
+
"inject": [
|
|
32
|
+
"slots"
|
|
33
|
+
],
|
|
34
|
+
"platform": "web",
|
|
35
|
+
"external": [
|
|
36
|
+
"dsh-mnemon/client"
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"scripts": {
|
|
41
|
+
"typecheck": "tsc --noEmit",
|
|
42
|
+
"build": "tsdown && tsc -p tsconfig.client-types.json",
|
|
43
|
+
"test": "vitest run",
|
|
44
|
+
"verify": "pnpm typecheck && pnpm test && pnpm build"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"markdown-to-jsx": "^7.7.0",
|
|
48
|
+
"schemastery": "^3.18.0"
|
|
49
|
+
},
|
|
50
|
+
"peerDependencies": {
|
|
51
|
+
"@deepseek-ai/cordis": "^4.0.1",
|
|
52
|
+
"dsh-mnemon": "0.5.0-rc.1",
|
|
53
|
+
"react": "^18.2.0"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@deepseek-ai/dsh-client-ui-primitives": "0.1.2-rc.1",
|
|
57
|
+
"@testing-library/react": "^16.3.0",
|
|
58
|
+
"@types/node": "^22.0.0",
|
|
59
|
+
"@types/react": "^18.3.0",
|
|
60
|
+
"@types/react-dom": "^18.3.0",
|
|
61
|
+
"dsh-mnemon": "0.5.0-rc.1",
|
|
62
|
+
"jsdom": "^26.0.0",
|
|
63
|
+
"react": "^18.2.0",
|
|
64
|
+
"react-dom": "^18.2.0",
|
|
65
|
+
"tsdown": "^0.22.0",
|
|
66
|
+
"typescript": "^5.9.0",
|
|
67
|
+
"vitest": "^3.2.0"
|
|
68
|
+
},
|
|
69
|
+
"peerDependenciesMeta": {
|
|
70
|
+
"react": {
|
|
71
|
+
"optional": true
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"publishConfig": {
|
|
75
|
+
"access": "public",
|
|
76
|
+
"tag": "rc"
|
|
77
|
+
},
|
|
78
|
+
"repository": {
|
|
79
|
+
"type": "git",
|
|
80
|
+
"url": "git+https://github.com/omdsh-dev/dsh-mnemon.git",
|
|
81
|
+
"directory": "plugins/dsh-mnemon-source-documents"
|
|
82
|
+
},
|
|
83
|
+
"homepage": "https://github.com/omdsh-dev/dsh-mnemon/tree/main/plugins/dsh-mnemon-source-documents#readme",
|
|
84
|
+
"bugs": {
|
|
85
|
+
"url": "https://github.com/omdsh-dev/dsh-mnemon/issues"
|
|
86
|
+
}
|
|
87
|
+
}
|