dsh-mnemon-source-runtime 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 +34 -0
- package/lib/client.js +590 -0
- package/lib/contracts-BqaPCrGD.js +14 -0
- package/lib/contracts.d.ts +86 -0
- package/lib/contracts.js +2 -0
- package/lib/index.d.ts +24 -0
- package/lib/index.js +889 -0
- package/lib/types/client/api.d.ts +13 -0
- package/lib/types/client/pages.d.ts +8 -0
- package/lib/types/client/ui.d.ts +8 -0
- package/lib/types/client.d.ts +3 -0
- package/lib/types/contracts.d.ts +83 -0
- package/lib/types/defaults.d.ts +3 -0
- package/package.json +86 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { RuntimeMemoryImportance, RuntimeMemoryMutationResult, RuntimeMemorySnapshot, RuntimeMemoryTarget } from '../contracts.ts';
|
|
2
|
+
/** Source-owned structural page API; the default bundle may supply agent-assisted callbacks. */
|
|
3
|
+
export interface RuntimePageClient {
|
|
4
|
+
runtimeMemory(): Promise<RuntimeMemorySnapshot>;
|
|
5
|
+
mutateRuntimeMemory(request: {
|
|
6
|
+
action: 'add' | 'replace' | 'remove';
|
|
7
|
+
target: RuntimeMemoryTarget;
|
|
8
|
+
content?: string;
|
|
9
|
+
old_text?: string;
|
|
10
|
+
importance?: RuntimeMemoryImportance;
|
|
11
|
+
branches?: string[];
|
|
12
|
+
}): Promise<RuntimeMemoryMutationResult>;
|
|
13
|
+
}
|
|
@@ -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 { RuntimePageClient } from './api.ts';
|
|
4
|
+
export declare function runtimePageClient(management: MnemonSourceManagementClient): RuntimePageClient;
|
|
5
|
+
export declare function RuntimeSourcePage(props: MemorySourcePageProps): ReactNode;
|
|
6
|
+
export declare function installRuntimeMemoryUI(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,83 @@
|
|
|
1
|
+
export type RuntimeMemoryTarget = 'memory' | 'user';
|
|
2
|
+
export type RuntimeMemoryImportance = 'critical' | 'normal' | 'low';
|
|
3
|
+
export type RuntimeMemoryAction = 'add' | 'replace' | 'remove';
|
|
4
|
+
export interface RuntimeMemoryEntry {
|
|
5
|
+
content: string;
|
|
6
|
+
created_at: string;
|
|
7
|
+
updated_at: string;
|
|
8
|
+
target: RuntimeMemoryTarget;
|
|
9
|
+
importance: RuntimeMemoryImportance;
|
|
10
|
+
/** Optional git branch names that limit where this entry is projected. Absent means every branch. */
|
|
11
|
+
branches?: string[];
|
|
12
|
+
}
|
|
13
|
+
export interface RuntimeMemoryUsage {
|
|
14
|
+
used: number;
|
|
15
|
+
limit: number;
|
|
16
|
+
}
|
|
17
|
+
export interface RuntimeMemoryTargetView extends RuntimeMemoryUsage {
|
|
18
|
+
target: RuntimeMemoryTarget;
|
|
19
|
+
entryCount: number;
|
|
20
|
+
markdownPath: string;
|
|
21
|
+
}
|
|
22
|
+
export interface RuntimeMemorySnapshot {
|
|
23
|
+
directory: string;
|
|
24
|
+
sourcePath: string;
|
|
25
|
+
revision: string;
|
|
26
|
+
generatedAt: string;
|
|
27
|
+
entries: RuntimeMemoryEntry[];
|
|
28
|
+
targets: Record<RuntimeMemoryTarget, RuntimeMemoryTargetView>;
|
|
29
|
+
}
|
|
30
|
+
export interface RuntimeMemoryCompactedEntry {
|
|
31
|
+
content: string;
|
|
32
|
+
importance: RuntimeMemoryImportance;
|
|
33
|
+
/** Branch scope carried through compaction; absent means the entry is visible on every branch. */
|
|
34
|
+
branches?: string[];
|
|
35
|
+
}
|
|
36
|
+
export interface RuntimeMemoryMutation {
|
|
37
|
+
action: RuntimeMemoryAction;
|
|
38
|
+
target: RuntimeMemoryTarget;
|
|
39
|
+
content?: string;
|
|
40
|
+
oldText?: string;
|
|
41
|
+
importance?: RuntimeMemoryImportance;
|
|
42
|
+
/** Git branch names limiting where a target=memory entry is projected. Absent keeps the current scope on replace; an empty list clears it. */
|
|
43
|
+
branches?: string[];
|
|
44
|
+
}
|
|
45
|
+
export type RuntimeMemoryMutationResult = {
|
|
46
|
+
success: true;
|
|
47
|
+
message: string;
|
|
48
|
+
target: RuntimeMemoryTarget;
|
|
49
|
+
entryCount: number;
|
|
50
|
+
usage: RuntimeMemoryUsage;
|
|
51
|
+
added?: string;
|
|
52
|
+
replaced?: {
|
|
53
|
+
from: string;
|
|
54
|
+
to: string;
|
|
55
|
+
};
|
|
56
|
+
removed?: string;
|
|
57
|
+
maintenance?: {
|
|
58
|
+
kind: 'local-compaction' | 'mnemon-archive';
|
|
59
|
+
runId: string;
|
|
60
|
+
provider: string;
|
|
61
|
+
summary: string;
|
|
62
|
+
memoryBodyIds: string[];
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
export interface RuntimeMemoryMaintenancePlan {
|
|
66
|
+
revision: string;
|
|
67
|
+
action: RuntimeMemoryAction;
|
|
68
|
+
target: RuntimeMemoryTarget;
|
|
69
|
+
entries: RuntimeMemoryEntry[];
|
|
70
|
+
pending?: RuntimeMemoryCompactedEntry;
|
|
71
|
+
excluded?: RuntimeMemoryEntry;
|
|
72
|
+
used: number;
|
|
73
|
+
projected: number;
|
|
74
|
+
limit: number;
|
|
75
|
+
requiresMaintenance: boolean;
|
|
76
|
+
}
|
|
77
|
+
export declare const RUNTIME_MEMORY_VERSION = 1;
|
|
78
|
+
export declare const RUNTIME_ENTRY_DELIMITER = "\n\u00A7\n";
|
|
79
|
+
export interface RuntimeMemoryLimits {
|
|
80
|
+
readonly memory: number;
|
|
81
|
+
readonly user: number;
|
|
82
|
+
}
|
|
83
|
+
export declare const RUNTIME_MEMORY_LIMITS: RuntimeMemoryLimits;
|
package/package.json
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "dsh-mnemon-source-runtime",
|
|
3
|
+
"version": "0.5.0-rc.1",
|
|
4
|
+
"description": "Self-contained runtime 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
|
+
"schemastery": "^3.18.0"
|
|
48
|
+
},
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"@deepseek-ai/cordis": "^4.0.1",
|
|
51
|
+
"dsh-mnemon": "0.5.0-rc.1",
|
|
52
|
+
"react": "^18.2.0"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@deepseek-ai/dsh-client-ui-primitives": "0.1.2-rc.1",
|
|
56
|
+
"@testing-library/react": "^16.3.0",
|
|
57
|
+
"@types/node": "^22.0.0",
|
|
58
|
+
"@types/react": "^18.3.0",
|
|
59
|
+
"@types/react-dom": "^18.3.0",
|
|
60
|
+
"dsh-mnemon": "0.5.0-rc.1",
|
|
61
|
+
"jsdom": "^26.0.0",
|
|
62
|
+
"react": "^18.2.0",
|
|
63
|
+
"react-dom": "^18.2.0",
|
|
64
|
+
"tsdown": "^0.22.0",
|
|
65
|
+
"typescript": "^5.9.0",
|
|
66
|
+
"vitest": "^3.2.0"
|
|
67
|
+
},
|
|
68
|
+
"peerDependenciesMeta": {
|
|
69
|
+
"react": {
|
|
70
|
+
"optional": true
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"publishConfig": {
|
|
74
|
+
"access": "public",
|
|
75
|
+
"tag": "rc"
|
|
76
|
+
},
|
|
77
|
+
"repository": {
|
|
78
|
+
"type": "git",
|
|
79
|
+
"url": "git+https://github.com/omdsh-dev/dsh-mnemon.git",
|
|
80
|
+
"directory": "plugins/dsh-mnemon-source-runtime"
|
|
81
|
+
},
|
|
82
|
+
"homepage": "https://github.com/omdsh-dev/dsh-mnemon/tree/main/plugins/dsh-mnemon-source-runtime#readme",
|
|
83
|
+
"bugs": {
|
|
84
|
+
"url": "https://github.com/omdsh-dev/dsh-mnemon/issues"
|
|
85
|
+
}
|
|
86
|
+
}
|