@imayuur/contexthub-shared-types 1.0.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,119 @@
1
+ export interface Session {
2
+ id: string;
3
+ repoPath: string;
4
+ startTime: number;
5
+ endTime?: number;
6
+ agent: string;
7
+ metadata: Record<string, any>;
8
+ }
9
+ export interface MemoryEntry {
10
+ id: string;
11
+ sessionId: string;
12
+ type: 'prompt' | 'response' | 'summary' | 'decision' | 'architecture' | 'bugfix' | 'manual' | 'commit';
13
+ content: string;
14
+ timestamp: number;
15
+ tags: string[];
16
+ embedding?: number[];
17
+ /**
18
+ * Up to 20 paths related to this memory.
19
+ * Path should be repository-relative and validated.
20
+ */
21
+ relatedPaths?: string[];
22
+ /**
23
+ * Up to 20 symbol names (functions, classes, etc.) related to this memory.
24
+ * Names will be sanitized and capped at 200 characters each.
25
+ */
26
+ relatedSymbols?: string[];
27
+ /**
28
+ * Git commit hash associated with this memory (7-40 hex chars).
29
+ */
30
+ commitHash?: string;
31
+ /**
32
+ * Git branch associated with this memory.
33
+ */
34
+ branch?: string;
35
+ }
36
+ export interface ProjectMetadata {
37
+ repoPath: string;
38
+ name: string;
39
+ description?: string;
40
+ language?: string;
41
+ framework?: string;
42
+ createdAt: number;
43
+ updatedAt: number;
44
+ }
45
+ export interface VectorSearchResult {
46
+ id: string;
47
+ score: number;
48
+ metadata: MemoryEntry;
49
+ }
50
+ export interface KnowledgeGraphNode {
51
+ id: string;
52
+ type: 'file' | 'function' | 'class' | 'variable' | 'import';
53
+ label: string;
54
+ properties: Record<string, any>;
55
+ }
56
+ export interface KnowledgeGraphEdge {
57
+ id: string;
58
+ source: string;
59
+ target: string;
60
+ type: 'calls' | 'imports' | 'contains' | 'references';
61
+ properties: Record<string, any>;
62
+ }
63
+ export interface ParsedFile {
64
+ path: string;
65
+ language: string;
66
+ symbols: Symbol[];
67
+ imports: ImportExport[];
68
+ exports: ImportExport[];
69
+ }
70
+ export interface Symbol {
71
+ type: 'function' | 'class' | 'variable' | 'interface' | 'method';
72
+ name: string;
73
+ lineNumber: number;
74
+ columnNumber: number;
75
+ }
76
+ export interface ImportExport {
77
+ source: string;
78
+ imported: string[];
79
+ isDefault: boolean;
80
+ lineNumber: number;
81
+ }
82
+ export declare const VALID_MEMORY_TYPES: readonly ["prompt", "response", "summary", "decision", "architecture", "bugfix", "manual", "commit"];
83
+ export type MemoryType = typeof VALID_MEMORY_TYPES[number];
84
+ export interface SecurityConfig {
85
+ /** Whether encryption at rest is enabled (default: true) */
86
+ encryptionEnabled: boolean;
87
+ /** Max memory entries before archival (default: 10000) */
88
+ maxMemoryEntries: number;
89
+ /** Max input length in characters (default: 51200) */
90
+ maxInputLength: number;
91
+ /** Max file size to read in bytes (default: 50MB) */
92
+ maxFileSizeBytes: number;
93
+ /** Whether auth token is required for MCP (default: false, auto-enabled if CONTEXTHUB_TOKEN is set) */
94
+ authRequired: boolean;
95
+ }
96
+ export interface CodeGraphNode {
97
+ id: string;
98
+ kind: 'file' | 'symbol';
99
+ path: string;
100
+ name?: string;
101
+ lang?: string;
102
+ }
103
+ export interface CodeGraphEdge {
104
+ from: string;
105
+ to: string;
106
+ kind: 'imports' | 'calls' | 'contains';
107
+ }
108
+ export interface CodeGraph {
109
+ version: string;
110
+ updatedAt: number;
111
+ nodes: CodeGraphNode[];
112
+ edges: CodeGraphEdge[];
113
+ }
114
+ export interface GraphDiff {
115
+ addedNodes: CodeGraphNode[];
116
+ removedNodes: CodeGraphNode[];
117
+ addedEdges: CodeGraphEdge[];
118
+ removedEdges: CodeGraphEdge[];
119
+ }
package/dist/index.js ADDED
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ // Shared types for ContextHub
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.VALID_MEMORY_TYPES = void 0;
5
+ // Security-related types
6
+ exports.VALID_MEMORY_TYPES = ['prompt', 'response', 'summary', 'decision', 'architecture', 'bugfix', 'manual', 'commit'];
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "@imayuur/contexthub-shared-types",
3
+ "version": "1.0.0",
4
+ "description": "Shared TypeScript types for ContextHub",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/iMayuuR/contexthub.git",
9
+ "directory": "packages/shared-types"
10
+ },
11
+ "publishConfig": {
12
+ "access": "public"
13
+ },
14
+ "engines": {
15
+ "node": ">=18"
16
+ },
17
+ "main": "dist/index.js",
18
+ "types": "dist/index.d.ts",
19
+ "files": [
20
+ "dist"
21
+ ],
22
+ "scripts": {
23
+ "build": "tsc",
24
+ "dev": "tsc --watch",
25
+ "prepublishOnly": "npm run build"
26
+ },
27
+ "devDependencies": {
28
+ "@types/node": "^18.0.0",
29
+ "typescript": "^5.0.0"
30
+ },
31
+ "author": "Mayur Dattatray Patil",
32
+ "bugs": {
33
+ "url": "https://github.com/iMayuuR/contexthub/issues"
34
+ },
35
+ "homepage": "https://github.com/iMayuuR/contexthub#readme",
36
+ "keywords": [
37
+ "contexthub",
38
+ "mcp",
39
+ "ai-memory",
40
+ "cursor",
41
+ "claude"
42
+ ],
43
+ "exports": {
44
+ ".": {
45
+ "types": "./dist/index.d.ts",
46
+ "default": "./dist/index.js"
47
+ }
48
+ }
49
+ }