synapse-kit 0.0.0-stage → 0.3.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.ko.md +129 -0
- package/README.md +127 -2
- package/dist/causal-memory.json +4581 -0
- package/dist/cli-memory.d.ts +5 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +3474 -0
- package/dist/compiler/causal-build.d.ts +51 -0
- package/dist/compiler/causal-graph.d.ts +6 -0
- package/dist/compiler/cli.d.ts +2 -0
- package/dist/compiler/cli.js +1299 -0
- package/dist/compiler/core/config.d.ts +16 -0
- package/dist/compiler/core/engine.d.ts +17 -0
- package/dist/compiler/core/reporter.d.ts +5 -0
- package/dist/compiler/i18n.d.ts +281 -0
- package/dist/compiler/index.d.ts +21 -0
- package/dist/compiler/index.js +1983 -0
- package/dist/compiler/plugins/cpp.d.ts +19 -0
- package/dist/compiler/plugins/csharp.d.ts +13 -0
- package/dist/compiler/plugins/go.d.ts +15 -0
- package/dist/compiler/plugins/java.d.ts +16 -0
- package/dist/compiler/plugins/native.d.ts +12 -0
- package/dist/compiler/plugins/nsis.d.ts +8 -0
- package/dist/compiler/plugins/python.d.ts +21 -0
- package/dist/compiler/plugins/rust.d.ts +9 -0
- package/dist/compiler/plugins/schema.d.ts +12 -0
- package/dist/compiler/plugins/svelte.d.ts +10 -0
- package/dist/compiler/plugins/typescript.d.ts +23 -0
- package/dist/compiler/types.d.ts +72 -0
- package/dist/compiler/virtual_120b_types.d.ts +18 -0
- package/dist/core/config.d.ts +16 -0
- package/dist/core/engine.d.ts +17 -0
- package/dist/core/reporter.d.ts +5 -0
- package/dist/db/index.js +1910 -0
- package/dist/i18n.d.ts +281 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +8282 -0
- package/dist/memory/causal-benchmark.d.ts +29 -0
- package/dist/memory/causal-branch.d.ts +79 -0
- package/dist/memory/causal-build.d.ts +51 -0
- package/dist/memory/causal-config.d.ts +38 -0
- package/dist/memory/causal-context.d.ts +113 -0
- package/dist/memory/causal-contexts.json +316 -0
- package/dist/memory/causal-graph.d.ts +6 -0
- package/dist/memory/causal-graveyard.d.ts +94 -0
- package/dist/memory/causal-lens.d.ts +133 -0
- package/dist/memory/causal-memory.json +5054 -0
- package/dist/memory/causal-migrator.d.ts +11 -0
- package/dist/memory/causal-peer.d.ts +53 -0
- package/dist/memory/causal-predictor.d.ts +42 -0
- package/dist/memory/causal-query.d.ts +21 -0
- package/dist/memory/causal-server.d.ts +578 -0
- package/dist/memory/causal-store.d.ts +280 -0
- package/dist/memory/causal-synthesizer.d.ts +96 -0
- package/dist/memory/causal-timeseries.d.ts +92 -0
- package/dist/memory/cli.d.ts +13 -0
- package/dist/memory/cli.js +5668 -0
- package/dist/memory/index.d.ts +13 -0
- package/dist/memory/index.js +4451 -0
- package/dist/plugins/cpp.d.ts +19 -0
- package/dist/plugins/csharp.d.ts +13 -0
- package/dist/plugins/go.d.ts +15 -0
- package/dist/plugins/java.d.ts +16 -0
- package/dist/plugins/native.d.ts +12 -0
- package/dist/plugins/nsis.d.ts +8 -0
- package/dist/plugins/python.d.ts +21 -0
- package/dist/plugins/rust.d.ts +9 -0
- package/dist/plugins/schema.d.ts +12 -0
- package/dist/plugins/svelte.d.ts +10 -0
- package/dist/plugins/typescript.d.ts +23 -0
- package/dist/src/cli.d.ts +2 -0
- package/dist/src/core/config.d.ts +12 -0
- package/dist/src/core/engine.d.ts +9 -0
- package/dist/src/core/reporter.d.ts +5 -0
- package/dist/src/index.d.ts +13 -0
- package/dist/src/memory/causal-graph.d.ts +6 -0
- package/dist/src/plugins/native.d.ts +12 -0
- package/dist/src/plugins/nsis.d.ts +8 -0
- package/dist/src/plugins/rust.d.ts +9 -0
- package/dist/src/plugins/schema.d.ts +12 -0
- package/dist/src/plugins/svelte.d.ts +10 -0
- package/dist/src/types.d.ts +55 -0
- package/dist/types.d.ts +72 -0
- package/package.json +87 -4
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 인과율 트리거 규격
|
|
3
|
+
*/
|
|
4
|
+
export interface CausalTrigger {
|
|
5
|
+
readonly files?: readonly string[];
|
|
6
|
+
readonly keywords?: readonly string[];
|
|
7
|
+
readonly commands?: readonly string[];
|
|
8
|
+
readonly alwaysActive?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* 인과율 간선(Relation) 규격
|
|
12
|
+
*/
|
|
13
|
+
export interface CausalRelation {
|
|
14
|
+
readonly from: string;
|
|
15
|
+
readonly to: string;
|
|
16
|
+
readonly relationType: string;
|
|
17
|
+
readonly relation?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* 인과율 규칙(Node) 규격
|
|
21
|
+
*/
|
|
22
|
+
export interface CausalRule {
|
|
23
|
+
readonly id: string;
|
|
24
|
+
readonly domain: string;
|
|
25
|
+
readonly title: string;
|
|
26
|
+
readonly entityType?: string;
|
|
27
|
+
readonly triggers: CausalTrigger;
|
|
28
|
+
readonly invariants: readonly string[];
|
|
29
|
+
readonly actions: readonly string[];
|
|
30
|
+
readonly context: readonly string[];
|
|
31
|
+
readonly lastVerified?: string;
|
|
32
|
+
readonly name?: string;
|
|
33
|
+
readonly confidence?: number;
|
|
34
|
+
readonly weight?: number;
|
|
35
|
+
readonly updatedAt?: string;
|
|
36
|
+
readonly description?: string;
|
|
37
|
+
readonly pattern?: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* 인과율 메모리 데이터베이스 규격
|
|
41
|
+
*/
|
|
42
|
+
export interface CausalMemoryDatabase {
|
|
43
|
+
readonly version: string;
|
|
44
|
+
readonly updatedAt: string;
|
|
45
|
+
readonly totalRules: number;
|
|
46
|
+
readonly totalRelations: number;
|
|
47
|
+
readonly rules: readonly CausalRule[];
|
|
48
|
+
readonly relations: readonly CausalRelation[];
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* 공명 쿼리 입력 규격
|
|
52
|
+
*/
|
|
53
|
+
export interface CausalQueryOptions {
|
|
54
|
+
readonly files?: readonly string[];
|
|
55
|
+
readonly keywords?: readonly string[];
|
|
56
|
+
readonly command?: string;
|
|
57
|
+
readonly domain?: string;
|
|
58
|
+
readonly propagateRelations?: boolean;
|
|
59
|
+
readonly maxHops?: number;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* 공명 쿼리 결과 규격
|
|
63
|
+
*/
|
|
64
|
+
export interface CausalResonanceResult {
|
|
65
|
+
readonly queryDurationMs: number;
|
|
66
|
+
readonly matchedCount: number;
|
|
67
|
+
readonly totalDatabaseRules: number;
|
|
68
|
+
readonly resonanceRules: readonly CausalRule[];
|
|
69
|
+
readonly activeRelations: readonly CausalRelation[];
|
|
70
|
+
readonly tokenDietSavingsRatio: string;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* 구형 memory MCP 호환 엔티티 규격
|
|
74
|
+
*/
|
|
75
|
+
export interface LegacyEntityInput {
|
|
76
|
+
readonly name: string;
|
|
77
|
+
readonly entityType: string;
|
|
78
|
+
readonly observations: readonly string[];
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* 인과율 메모리 저장소 및 O(1) 역인덱스 공명 엔진 클래스 (SRP 및 OCP 준수)
|
|
82
|
+
*/
|
|
83
|
+
export declare class CausalMemoryStore {
|
|
84
|
+
private readonly dbPath;
|
|
85
|
+
private database;
|
|
86
|
+
private lastMtimeMs;
|
|
87
|
+
private alwaysActiveRules;
|
|
88
|
+
private domainIndex;
|
|
89
|
+
private commandIndex;
|
|
90
|
+
private exactKeywordIndex;
|
|
91
|
+
private exactFileIndex;
|
|
92
|
+
private prefixFileRules;
|
|
93
|
+
private compiledSearchRules;
|
|
94
|
+
private titleToRuleMap;
|
|
95
|
+
private idToRuleMap;
|
|
96
|
+
private relationAdjacency;
|
|
97
|
+
constructor(customPath?: string, initialDatabase?: CausalMemoryDatabase);
|
|
98
|
+
/**
|
|
99
|
+
* 디스크 파일 변경(mtimeMs)이 감지된 경우에만 스마트 리로드 수행 (Zero-Copy Cache)
|
|
100
|
+
*/
|
|
101
|
+
reloadIfNeeded(): boolean;
|
|
102
|
+
/**
|
|
103
|
+
* 강제 디스크 리로드
|
|
104
|
+
*/
|
|
105
|
+
reload(): void;
|
|
106
|
+
/**
|
|
107
|
+
* 인메모리 데이터베이스 직접 주입 (벤치마크 및 인메모리 시뮬레이션용)
|
|
108
|
+
*/
|
|
109
|
+
loadFromMemory(db: CausalMemoryDatabase): void;
|
|
110
|
+
/**
|
|
111
|
+
* O(1) 역인덱스(Inverted Index) 및 인접 리스트 그래프(Adjacency List) 재구축
|
|
112
|
+
*/
|
|
113
|
+
private rebuildIndices;
|
|
114
|
+
/**
|
|
115
|
+
* 동일 제목(title) 규칙 중복 시 도메인 우선순위 점수 산출
|
|
116
|
+
*/
|
|
117
|
+
private static getRuleDomainPriority;
|
|
118
|
+
/**
|
|
119
|
+
* 규칙 배열에서 동일 제목(title) 중복 제거 및 정규화
|
|
120
|
+
*/
|
|
121
|
+
private static deduplicateRulesByTitle;
|
|
122
|
+
/**
|
|
123
|
+
* 데이터베이스 로드
|
|
124
|
+
*/
|
|
125
|
+
private loadDatabase;
|
|
126
|
+
/**
|
|
127
|
+
* 데이터베이스 디스크 동기화
|
|
128
|
+
*/
|
|
129
|
+
private saveDatabase;
|
|
130
|
+
getAllRules(): readonly CausalRule[];
|
|
131
|
+
getAllRelations(): readonly CausalRelation[];
|
|
132
|
+
getStatus(): {
|
|
133
|
+
version: string;
|
|
134
|
+
updatedAt: string;
|
|
135
|
+
totalRules: number;
|
|
136
|
+
totalRelations: number;
|
|
137
|
+
dbPath: string;
|
|
138
|
+
domains: string[];
|
|
139
|
+
domainCounts: Record<string, number>;
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
* 부분 문자열 폴백 검색을 위한 지연 컴파일러 (Lazy Compilation)
|
|
143
|
+
*/
|
|
144
|
+
private getCompiledSearchRules;
|
|
145
|
+
/**
|
|
146
|
+
* 초고속 O(1) 역인덱스 및 다중 홉(Multi-Hop) 그래프 전파 공명 쿼리 엔진
|
|
147
|
+
*/
|
|
148
|
+
queryResonance(options: CausalQueryOptions): CausalResonanceResult;
|
|
149
|
+
/**
|
|
150
|
+
* 신규 규칙 등록 또는 기존 규칙 갱신
|
|
151
|
+
*/
|
|
152
|
+
assertRule(rule: CausalRule, persistToDisk?: boolean): void;
|
|
153
|
+
/**
|
|
154
|
+
* 구형 memory MCP 호환: read_graph 대체 (초경량 인과 공명 요약 반환)
|
|
155
|
+
*/
|
|
156
|
+
readSmartGraph(files?: readonly string[]): {
|
|
157
|
+
causalMemoryEngine: string;
|
|
158
|
+
tokenDietSavings: string;
|
|
159
|
+
queryDurationMs: number;
|
|
160
|
+
activeEntitiesCount: number;
|
|
161
|
+
totalIndexedRules: number;
|
|
162
|
+
totalIndexedRelations: number;
|
|
163
|
+
availableDomains: Record<string, number>;
|
|
164
|
+
hint: string;
|
|
165
|
+
entities: {
|
|
166
|
+
name: string;
|
|
167
|
+
entityType: string;
|
|
168
|
+
domain: string;
|
|
169
|
+
invariants: readonly string[];
|
|
170
|
+
actions: readonly string[];
|
|
171
|
+
observations: string[];
|
|
172
|
+
}[];
|
|
173
|
+
relations: readonly CausalRelation[];
|
|
174
|
+
};
|
|
175
|
+
/**
|
|
176
|
+
* 구형 memory MCP 호환: search_nodes
|
|
177
|
+
*/
|
|
178
|
+
searchNodes(query: string): {
|
|
179
|
+
causalMemoryEngine: string;
|
|
180
|
+
tokenDietSavings: string;
|
|
181
|
+
queryDurationMs: number;
|
|
182
|
+
activeEntitiesCount: number;
|
|
183
|
+
totalIndexedRules: number;
|
|
184
|
+
totalIndexedRelations: number;
|
|
185
|
+
availableDomains: Record<string, number>;
|
|
186
|
+
hint: string;
|
|
187
|
+
entities: {
|
|
188
|
+
name: string;
|
|
189
|
+
entityType: string;
|
|
190
|
+
domain: string;
|
|
191
|
+
invariants: readonly string[];
|
|
192
|
+
actions: readonly string[];
|
|
193
|
+
observations: string[];
|
|
194
|
+
}[];
|
|
195
|
+
relations: readonly CausalRelation[];
|
|
196
|
+
} | {
|
|
197
|
+
entities: {
|
|
198
|
+
name: string;
|
|
199
|
+
entityType: string;
|
|
200
|
+
observations: string[];
|
|
201
|
+
}[];
|
|
202
|
+
relations: CausalRelation[];
|
|
203
|
+
};
|
|
204
|
+
/**
|
|
205
|
+
* 구형 memory MCP 호환: open_nodes
|
|
206
|
+
*/
|
|
207
|
+
openNodes(names: readonly string[]): {
|
|
208
|
+
entities: {
|
|
209
|
+
name: string;
|
|
210
|
+
entityType: string;
|
|
211
|
+
observations: string[];
|
|
212
|
+
}[];
|
|
213
|
+
relations: CausalRelation[];
|
|
214
|
+
};
|
|
215
|
+
/**
|
|
216
|
+
* 구형 memory MCP 호환: create_entities
|
|
217
|
+
*/
|
|
218
|
+
createEntities(entities: readonly LegacyEntityInput[], persistToDisk?: boolean): LegacyEntityInput[];
|
|
219
|
+
/**
|
|
220
|
+
* 구형 memory MCP 호환: add_observations
|
|
221
|
+
*/
|
|
222
|
+
addObservations(observations: readonly {
|
|
223
|
+
readonly entityName: string;
|
|
224
|
+
readonly contents: readonly string[];
|
|
225
|
+
}[], persistToDisk?: boolean): {
|
|
226
|
+
entityName: string;
|
|
227
|
+
addedObservations: string[];
|
|
228
|
+
}[];
|
|
229
|
+
/**
|
|
230
|
+
* 구형 memory MCP 호환: create_relations
|
|
231
|
+
*/
|
|
232
|
+
createRelations(relations: readonly CausalRelation[], persistToDisk?: boolean): CausalRelation[];
|
|
233
|
+
/**
|
|
234
|
+
* 단일 인과 규칙 삭제 (연결된 고아 인과 간선 동시 정리)
|
|
235
|
+
*/
|
|
236
|
+
deleteRule(ruleId: string, persistToDisk?: boolean): boolean;
|
|
237
|
+
/**
|
|
238
|
+
* 구형 memory MCP 호환: delete_entities
|
|
239
|
+
*/
|
|
240
|
+
deleteEntities(entityNames: readonly string[], persistToDisk?: boolean): void;
|
|
241
|
+
/**
|
|
242
|
+
* 구형 memory MCP 호환: delete_observations
|
|
243
|
+
*/
|
|
244
|
+
deleteObservations(deletions: readonly {
|
|
245
|
+
readonly entityName: string;
|
|
246
|
+
readonly observations: readonly string[];
|
|
247
|
+
}[], persistToDisk?: boolean): void;
|
|
248
|
+
/**
|
|
249
|
+
* 구형 memory MCP 호환: delete_relations
|
|
250
|
+
*/
|
|
251
|
+
deleteRelations(relations: readonly CausalRelation[], persistToDisk?: boolean): void;
|
|
252
|
+
/**
|
|
253
|
+
* 엔티티 입력으로부터 도메인 및 인과율 규칙 자동 추론
|
|
254
|
+
*/
|
|
255
|
+
static inferRuleFromEntity(ent: LegacyEntityInput, today: string): CausalRule;
|
|
256
|
+
/**
|
|
257
|
+
* 메모리 무결성 감사 (Audit)
|
|
258
|
+
*/
|
|
259
|
+
audit(): {
|
|
260
|
+
ok: boolean;
|
|
261
|
+
totalRules: number;
|
|
262
|
+
totalRelations: number;
|
|
263
|
+
alwaysActiveCount: number;
|
|
264
|
+
issues: string[];
|
|
265
|
+
};
|
|
266
|
+
/**
|
|
267
|
+
* 원시 데이터베이스 객체 반환 (백업 및 피어 동기화용)
|
|
268
|
+
*/
|
|
269
|
+
getRawDatabase(): CausalMemoryDatabase;
|
|
270
|
+
/**
|
|
271
|
+
* 원격 피어 데이터베이스와 로컬 데이터베이스 양방향 무손실 병합 (Sync)
|
|
272
|
+
*/
|
|
273
|
+
mergeDatabase(incomingRules: readonly CausalRule[], incomingRelations?: readonly CausalRelation[]): {
|
|
274
|
+
addedRules: number;
|
|
275
|
+
updatedRules: number;
|
|
276
|
+
addedRelations: number;
|
|
277
|
+
totalRules: number;
|
|
278
|
+
totalRelations: number;
|
|
279
|
+
};
|
|
280
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { ContextCheckpointStore, type ContextCheckpoint } from './causal-context';
|
|
2
|
+
import { CausalMemoryStore } from './causal-store';
|
|
3
|
+
/**
|
|
4
|
+
* Git 변경 사항 상세 통계 규격
|
|
5
|
+
*/
|
|
6
|
+
export interface GitChangeStats {
|
|
7
|
+
readonly insertions: number;
|
|
8
|
+
readonly deletions: number;
|
|
9
|
+
readonly filesChanged: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Git 변경 코드에서 추출된 주요 심볼 메타데이터 규격
|
|
13
|
+
*/
|
|
14
|
+
export interface ExtractedCodeSymbols {
|
|
15
|
+
readonly functions: readonly string[];
|
|
16
|
+
readonly classes: readonly string[];
|
|
17
|
+
readonly interfaces: readonly string[];
|
|
18
|
+
readonly types: readonly string[];
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* 작업 트리의 변경 사항 요약 규격
|
|
22
|
+
*/
|
|
23
|
+
export interface GitChangeSummary {
|
|
24
|
+
readonly cwd: string;
|
|
25
|
+
readonly branch?: string;
|
|
26
|
+
readonly commit?: string;
|
|
27
|
+
readonly modifiedFiles: readonly string[];
|
|
28
|
+
readonly addedFiles: readonly string[];
|
|
29
|
+
readonly deletedFiles: readonly string[];
|
|
30
|
+
readonly untrackedFiles: readonly string[];
|
|
31
|
+
readonly allActiveFiles: readonly string[];
|
|
32
|
+
readonly stats: GitChangeStats;
|
|
33
|
+
readonly extractedSymbols: ExtractedCodeSymbols;
|
|
34
|
+
readonly detectedDomains: readonly string[];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* 역합성된 의도 및 진행 상태 규격
|
|
38
|
+
*/
|
|
39
|
+
export interface SynthesizedIntent {
|
|
40
|
+
readonly title: string;
|
|
41
|
+
readonly goal: string;
|
|
42
|
+
readonly completedSteps: readonly string[];
|
|
43
|
+
readonly pendingTasks: readonly string[];
|
|
44
|
+
readonly keyDecisions: readonly string[];
|
|
45
|
+
readonly activeInvariants: readonly string[];
|
|
46
|
+
readonly suggestedKeywords: readonly string[];
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* 자동 체크포인트 생성 옵션
|
|
50
|
+
*/
|
|
51
|
+
export interface AutoCheckpointOptions {
|
|
52
|
+
readonly title?: string;
|
|
53
|
+
readonly goal?: string;
|
|
54
|
+
readonly extraCompletedSteps?: readonly string[];
|
|
55
|
+
readonly extraPendingTasks?: readonly string[];
|
|
56
|
+
readonly extraKeyDecisions?: readonly string[];
|
|
57
|
+
readonly extraInvariants?: readonly string[];
|
|
58
|
+
readonly customMeta?: Record<string, unknown>;
|
|
59
|
+
readonly autoResonance?: boolean;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Git 커밋 및 diff 기반으로 작업자의 의도와 상태를 역합성하는 인과율 엔진 클래스 (SRP 준수)
|
|
63
|
+
*/
|
|
64
|
+
export declare class CausalSynthesizerEngine {
|
|
65
|
+
private readonly contextStore;
|
|
66
|
+
private readonly memoryStore;
|
|
67
|
+
constructor(contextStore?: ContextCheckpointStore, memoryStore?: CausalMemoryStore);
|
|
68
|
+
/**
|
|
69
|
+
* 지정된 작업 디렉터리의 Git 상태와 diff를 분석하여 변경 내역 요약 생성
|
|
70
|
+
*/
|
|
71
|
+
inspectGitChanges(cwd?: string): Promise<GitChangeSummary>;
|
|
72
|
+
/**
|
|
73
|
+
* Git 통계 파싱 (git diff --stat)
|
|
74
|
+
*/
|
|
75
|
+
private parseGitStats;
|
|
76
|
+
/**
|
|
77
|
+
* git diff로부터 변경된 함수, 클래스, 타입 심볼을 추출
|
|
78
|
+
*/
|
|
79
|
+
private extractSymbolsFromDiff;
|
|
80
|
+
/**
|
|
81
|
+
* 파일 경로 기반 도메인 분류
|
|
82
|
+
*/
|
|
83
|
+
private detectDomainsFromFiles;
|
|
84
|
+
/**
|
|
85
|
+
* Git 미설치 또는 Git 저장소가 아닌 경우의 폴백 파일시스템 스캔
|
|
86
|
+
*/
|
|
87
|
+
private fallbackFilesystemScan;
|
|
88
|
+
/**
|
|
89
|
+
* 변경 사항 분석 결과를 기반으로 작업 의도 및 컨텍스트를 자동 역합성(Reverse Synthesis)
|
|
90
|
+
*/
|
|
91
|
+
synthesizeIntent(summary: GitChangeSummary, customTitle?: string): SynthesizedIntent;
|
|
92
|
+
/**
|
|
93
|
+
* 원클릭 자동 체크포인트 생성 (Git diff 분석 ➔ 역합성 ➔ 스냅샷 저장)
|
|
94
|
+
*/
|
|
95
|
+
autoCheckpoint(cwd?: string, options?: AutoCheckpointOptions): Promise<ContextCheckpoint>;
|
|
96
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { ContextCheckpointStore, type ContextCheckpoint } from './causal-context';
|
|
2
|
+
/**
|
|
3
|
+
* 시계열 이벤트 레코드 규격
|
|
4
|
+
*/
|
|
5
|
+
export interface TimelineEvent {
|
|
6
|
+
readonly id: string;
|
|
7
|
+
readonly timestamp: string;
|
|
8
|
+
readonly timestampMs: number;
|
|
9
|
+
readonly type: 'checkpoint' | 'rule_added' | 'rule_updated' | 'branch_merged' | 'trap_recorded';
|
|
10
|
+
readonly sessionId: string;
|
|
11
|
+
readonly title: string;
|
|
12
|
+
readonly summary: string;
|
|
13
|
+
readonly tags: readonly string[];
|
|
14
|
+
readonly checkpointId?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 두 체크포인트 간의 시계열 차분(Diff) 결과 규격
|
|
18
|
+
*/
|
|
19
|
+
export interface CheckpointDiffResult {
|
|
20
|
+
readonly fromId?: string;
|
|
21
|
+
readonly toId?: string;
|
|
22
|
+
readonly fromCheckpointId: string;
|
|
23
|
+
readonly toCheckpointId: string;
|
|
24
|
+
readonly fromTimestamp: string;
|
|
25
|
+
readonly toTimestamp: string;
|
|
26
|
+
readonly timeDeltaHours: number;
|
|
27
|
+
readonly newlyCompletedSteps?: readonly string[];
|
|
28
|
+
readonly resolvedPendingTasks?: readonly string[];
|
|
29
|
+
readonly addedModifiedFiles?: readonly string[];
|
|
30
|
+
readonly addedPendingTasks: readonly string[];
|
|
31
|
+
readonly resolvedTasks: readonly string[];
|
|
32
|
+
readonly newCompletedSteps: readonly string[];
|
|
33
|
+
readonly newDecisions: readonly string[];
|
|
34
|
+
readonly modifiedFilesDelta: {
|
|
35
|
+
readonly added: readonly string[];
|
|
36
|
+
readonly removed: readonly string[];
|
|
37
|
+
readonly retained: readonly string[];
|
|
38
|
+
};
|
|
39
|
+
readonly activeInvariantsDelta: {
|
|
40
|
+
readonly added: readonly string[];
|
|
41
|
+
readonly removed: readonly string[];
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* 시계열 감쇠 가중치 계산기 및 타임라인 분석기 클래스 (SRP 준수)
|
|
46
|
+
*/
|
|
47
|
+
export declare class CausalTimeSeriesEngine {
|
|
48
|
+
private readonly contextStore;
|
|
49
|
+
constructor(contextStore?: ContextCheckpointStore, _memoryStore?: unknown);
|
|
50
|
+
/**
|
|
51
|
+
* 시계열 감쇠 지수 가중치 산출 (시간 경과 감쇠 + 빈도 가산)
|
|
52
|
+
* Score = BaseScore * exp(-lambda * deltaHours) + alpha * ln(1 + hitCount)
|
|
53
|
+
*/
|
|
54
|
+
static calculateTemporalDecayScore(options: {
|
|
55
|
+
baseScore?: number;
|
|
56
|
+
lastActiveMs: number;
|
|
57
|
+
nowMs?: number;
|
|
58
|
+
halfLifeHours?: number;
|
|
59
|
+
hitCount?: number;
|
|
60
|
+
}): number;
|
|
61
|
+
/**
|
|
62
|
+
* 공명 인과 규칙들에 시계열 시간 감쇠 가중치 계산 반영
|
|
63
|
+
*/
|
|
64
|
+
computeDecayedResonance<T extends {
|
|
65
|
+
updatedAt?: string;
|
|
66
|
+
confidence?: number;
|
|
67
|
+
weight?: number;
|
|
68
|
+
}>(rules: readonly T[]): Array<T & {
|
|
69
|
+
decayScore: number;
|
|
70
|
+
}>;
|
|
71
|
+
/**
|
|
72
|
+
* 특정 세션 또는 전체 작업의 시계열 타임라인 궤적 생성
|
|
73
|
+
*/
|
|
74
|
+
generateTimeline(options?: number | {
|
|
75
|
+
sessionId?: string;
|
|
76
|
+
sinceMs?: number;
|
|
77
|
+
limit?: number;
|
|
78
|
+
}): TimelineEvent[];
|
|
79
|
+
/**
|
|
80
|
+
* 두 체크포인트 간의 차분(Diff) 계산
|
|
81
|
+
*/
|
|
82
|
+
diffCheckpoints(fromId: string, toId: string): CheckpointDiffResult;
|
|
83
|
+
/**
|
|
84
|
+
* 특정 시점으로 컨텍스트 되감기(Rewind)
|
|
85
|
+
* 지정한 체크포인트를 최신 체크포인트로 재발행(Clone)하여 안전하게 되돌림
|
|
86
|
+
*/
|
|
87
|
+
rewindToCheckpoint(targetIdOrTag: string): Promise<ContextCheckpoint>;
|
|
88
|
+
/**
|
|
89
|
+
* 시계열 차분 결과 마크다운 렌더러
|
|
90
|
+
*/
|
|
91
|
+
static formatDiffReport(diff: CheckpointDiffResult): string;
|
|
92
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
export interface MemoryCliOptions {
|
|
3
|
+
lang?: string;
|
|
4
|
+
compact?: boolean;
|
|
5
|
+
agent?: boolean;
|
|
6
|
+
agentMode?: boolean;
|
|
7
|
+
force?: boolean;
|
|
8
|
+
[key: string]: unknown;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* synapse memory CLI 명령어 핸들러
|
|
12
|
+
*/
|
|
13
|
+
export declare function handleMemoryCommand(args: readonly string[], options?: MemoryCliOptions): Promise<number>;
|