cliper-memory 0.1.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.
- package/README.md +268 -0
- package/dist/auth/config.d.ts +13 -0
- package/dist/auth/config.d.ts.map +1 -0
- package/dist/auth/config.js +33 -0
- package/dist/auth/config.js.map +1 -0
- package/dist/auth/github.d.ts +5 -0
- package/dist/auth/github.d.ts.map +1 -0
- package/dist/auth/github.js +38 -0
- package/dist/auth/github.js.map +1 -0
- package/dist/cognee/legacyClient.d.ts +20 -0
- package/dist/cognee/legacyClient.d.ts.map +1 -0
- package/dist/cognee/legacyClient.js +409 -0
- package/dist/cognee/legacyClient.js.map +1 -0
- package/dist/commands/analyze.d.ts +6 -0
- package/dist/commands/analyze.d.ts.map +1 -0
- package/dist/commands/analyze.js +216 -0
- package/dist/commands/analyze.js.map +1 -0
- package/dist/commands/auth.d.ts +3 -0
- package/dist/commands/auth.d.ts.map +1 -0
- package/dist/commands/auth.js +85 -0
- package/dist/commands/auth.js.map +1 -0
- package/dist/commands/export.d.ts +6 -0
- package/dist/commands/export.d.ts.map +1 -0
- package/dist/commands/export.js +64 -0
- package/dist/commands/export.js.map +1 -0
- package/dist/commands/init.d.ts +7 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +220 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/push.d.ts +2 -0
- package/dist/commands/push.d.ts.map +1 -0
- package/dist/commands/push.js +94 -0
- package/dist/commands/push.js.map +1 -0
- package/dist/commands/scope.d.ts +2 -0
- package/dist/commands/scope.d.ts.map +1 -0
- package/dist/commands/scope.js +124 -0
- package/dist/commands/scope.js.map +1 -0
- package/dist/commands/status.d.ts +2 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +100 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/sync.d.ts +6 -0
- package/dist/commands/sync.d.ts.map +1 -0
- package/dist/commands/sync.js +83 -0
- package/dist/commands/sync.js.map +1 -0
- package/dist/commands/view.d.ts +2 -0
- package/dist/commands/view.d.ts.map +1 -0
- package/dist/commands/view.js +60 -0
- package/dist/commands/view.js.map +1 -0
- package/dist/context/builder.d.ts +19 -0
- package/dist/context/builder.d.ts.map +1 -0
- package/dist/context/builder.js +143 -0
- package/dist/context/builder.js.map +1 -0
- package/dist/gaps/detector.d.ts +10 -0
- package/dist/gaps/detector.d.ts.map +1 -0
- package/dist/gaps/detector.js +139 -0
- package/dist/gaps/detector.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +101 -0
- package/dist/index.js.map +1 -0
- package/dist/providers/cognee/client.d.ts +32 -0
- package/dist/providers/cognee/client.d.ts.map +1 -0
- package/dist/providers/cognee/client.js +189 -0
- package/dist/providers/cognee/client.js.map +1 -0
- package/dist/providers/cognee/provider.d.ts +7 -0
- package/dist/providers/cognee/provider.d.ts.map +1 -0
- package/dist/providers/cognee/provider.js +17 -0
- package/dist/providers/cognee/provider.js.map +1 -0
- package/dist/providers/memoryProvider.d.ts +4 -0
- package/dist/providers/memoryProvider.d.ts.map +1 -0
- package/dist/providers/memoryProvider.js +3 -0
- package/dist/providers/memoryProvider.js.map +1 -0
- package/dist/resolver/urlFetcher.d.ts +9 -0
- package/dist/resolver/urlFetcher.d.ts.map +1 -0
- package/dist/resolver/urlFetcher.js +134 -0
- package/dist/resolver/urlFetcher.js.map +1 -0
- package/dist/scanner/dependencies.d.ts +14 -0
- package/dist/scanner/dependencies.d.ts.map +1 -0
- package/dist/scanner/dependencies.js +203 -0
- package/dist/scanner/dependencies.js.map +1 -0
- package/dist/scanner/fileContent.d.ts +8 -0
- package/dist/scanner/fileContent.d.ts.map +1 -0
- package/dist/scanner/fileContent.js +133 -0
- package/dist/scanner/fileContent.js.map +1 -0
- package/dist/scanner/fileTree.d.ts +2 -0
- package/dist/scanner/fileTree.d.ts.map +1 -0
- package/dist/scanner/fileTree.js +152 -0
- package/dist/scanner/fileTree.js.map +1 -0
- package/dist/scanner/gitContext.d.ts +25 -0
- package/dist/scanner/gitContext.d.ts.map +1 -0
- package/dist/scanner/gitContext.js +76 -0
- package/dist/scanner/gitContext.js.map +1 -0
- package/dist/scanner/github.d.ts +5 -0
- package/dist/scanner/github.d.ts.map +1 -0
- package/dist/scanner/github.js +30 -0
- package/dist/scanner/github.js.map +1 -0
- package/dist/scanner/githubIssues.d.ts +12 -0
- package/dist/scanner/githubIssues.d.ts.map +1 -0
- package/dist/scanner/githubIssues.js +31 -0
- package/dist/scanner/githubIssues.js.map +1 -0
- package/dist/scanner/githubPullRequests.d.ts +17 -0
- package/dist/scanner/githubPullRequests.d.ts.map +1 -0
- package/dist/scanner/githubPullRequests.js +57 -0
- package/dist/scanner/githubPullRequests.js.map +1 -0
- package/dist/scanner/semanticLabels.d.ts +12 -0
- package/dist/scanner/semanticLabels.d.ts.map +1 -0
- package/dist/scanner/semanticLabels.js +185 -0
- package/dist/scanner/semanticLabels.js.map +1 -0
- package/dist/scope/autoScope.d.ts +2 -0
- package/dist/scope/autoScope.d.ts.map +1 -0
- package/dist/scope/autoScope.js +233 -0
- package/dist/scope/autoScope.js.map +1 -0
- package/dist/scope/config.d.ts +10 -0
- package/dist/scope/config.d.ts.map +1 -0
- package/dist/scope/config.js +71 -0
- package/dist/scope/config.js.map +1 -0
- package/dist/sdk/cliper.d.ts +8 -0
- package/dist/sdk/cliper.d.ts.map +1 -0
- package/dist/sdk/cliper.js +11 -0
- package/dist/sdk/cliper.js.map +1 -0
- package/dist/sdk/memory/memory.d.ts +11 -0
- package/dist/sdk/memory/memory.d.ts.map +1 -0
- package/dist/sdk/memory/memory.js +3 -0
- package/dist/sdk/memory/memory.js.map +1 -0
- package/dist/sdk/memoryBuilder.d.ts +56 -0
- package/dist/sdk/memoryBuilder.d.ts.map +1 -0
- package/dist/sdk/memoryBuilder.js +821 -0
- package/dist/sdk/memoryBuilder.js.map +1 -0
- package/dist/sdk/memoryDeduplicator.d.ts +5 -0
- package/dist/sdk/memoryDeduplicator.d.ts.map +1 -0
- package/dist/sdk/memoryDeduplicator.js +14 -0
- package/dist/sdk/memoryDeduplicator.js.map +1 -0
- package/package.json +67 -0
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.isCogneeConfigured = isCogneeConfigured;
|
|
40
|
+
exports.recallContext = recallContext;
|
|
41
|
+
const fs = __importStar(require("fs"));
|
|
42
|
+
const path = __importStar(require("path"));
|
|
43
|
+
const os = __importStar(require("os"));
|
|
44
|
+
const simple_git_1 = __importDefault(require("simple-git"));
|
|
45
|
+
const COGNEE_BASE_URL = process.env.COGNEE_BASE_URL ?? "";
|
|
46
|
+
const COGNEE_API_KEY = process.env.COGNEE_API_KEY ?? "";
|
|
47
|
+
function isCogneeConfigured() {
|
|
48
|
+
return Boolean(COGNEE_BASE_URL && COGNEE_API_KEY);
|
|
49
|
+
}
|
|
50
|
+
function assertConfigured() {
|
|
51
|
+
if (!isCogneeConfigured()) {
|
|
52
|
+
throw new Error("Cognee not configured. Set COGNEE_BASE_URL and COGNEE_API_KEY environment variables.");
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function chunkArray(items, size) {
|
|
56
|
+
const result = [];
|
|
57
|
+
for (let i = 0; i < items.length; i += size) {
|
|
58
|
+
result.push(items.slice(i, i + size));
|
|
59
|
+
}
|
|
60
|
+
return result;
|
|
61
|
+
}
|
|
62
|
+
// Conservative cap per individual /add document. On a real repo, a single
|
|
63
|
+
// large file (~11,375 chars / ~2,844 tokens) was enough to trigger Cognee's
|
|
64
|
+
// own extraction max_tokens failure — this is a safety net on top of the
|
|
65
|
+
// structural split, not a replacement for it, since structural splitting
|
|
66
|
+
// keeps chunks semantically coherent and this only kicks in for outliers.
|
|
67
|
+
const MAX_CHUNK_CHARS = 3000;
|
|
68
|
+
function buildFileSummaryChunk(summary) {
|
|
69
|
+
return `
|
|
70
|
+
File: ${summary.path}
|
|
71
|
+
|
|
72
|
+
Category:
|
|
73
|
+
${summary.category}
|
|
74
|
+
|
|
75
|
+
Purpose:
|
|
76
|
+
${summary.purpose}
|
|
77
|
+
|
|
78
|
+
Responsibilities:
|
|
79
|
+
${summary.responsibilities.join(", ") || "None"}
|
|
80
|
+
|
|
81
|
+
Exports:
|
|
82
|
+
${summary.exports.join(", ") || "None"}
|
|
83
|
+
|
|
84
|
+
Imports:
|
|
85
|
+
${summary.imports.join(", ") || "None"}
|
|
86
|
+
|
|
87
|
+
External Packages:
|
|
88
|
+
${summary.externalPackages.join(", ") || "None"}
|
|
89
|
+
`.trim();
|
|
90
|
+
}
|
|
91
|
+
async function buildCommitSummaries(projectRoot, gitContext) {
|
|
92
|
+
if (!gitContext.isGitRepo) {
|
|
93
|
+
return [];
|
|
94
|
+
}
|
|
95
|
+
const git = (0, simple_git_1.default)(projectRoot);
|
|
96
|
+
const commits = [];
|
|
97
|
+
if (gitContext.lastCommit) {
|
|
98
|
+
commits.push({
|
|
99
|
+
hash: gitContext.lastCommit.hash,
|
|
100
|
+
author: gitContext.lastCommit.author,
|
|
101
|
+
message: gitContext.lastCommit.message,
|
|
102
|
+
timeAgo: gitContext.lastCommit.timeAgo,
|
|
103
|
+
filesChanged: await getFilesChangedForCommit(git, gitContext.lastCommit.hash),
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
for (const commit of gitContext.recentCommits) {
|
|
107
|
+
commits.push({
|
|
108
|
+
hash: commit.hash,
|
|
109
|
+
author: commit.author,
|
|
110
|
+
message: commit.message,
|
|
111
|
+
timeAgo: commit.timeAgo,
|
|
112
|
+
filesChanged: await getFilesChangedForCommit(git, commit.hash),
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
return commits;
|
|
116
|
+
}
|
|
117
|
+
async function buildCommitChunks(projectRoot, projectName, gitContext) {
|
|
118
|
+
const commits = await buildCommitSummaries(projectRoot, gitContext);
|
|
119
|
+
return commits.map(commit => ({
|
|
120
|
+
label: `commit:${commit.hash}`,
|
|
121
|
+
content: `
|
|
122
|
+
Memory Type:
|
|
123
|
+
Commit
|
|
124
|
+
|
|
125
|
+
Commit:
|
|
126
|
+
${commit.hash}
|
|
127
|
+
|
|
128
|
+
Project:
|
|
129
|
+
${projectName}
|
|
130
|
+
|
|
131
|
+
Branch:
|
|
132
|
+
${gitContext.branch}
|
|
133
|
+
|
|
134
|
+
Author:
|
|
135
|
+
${commit.author}
|
|
136
|
+
|
|
137
|
+
Message:
|
|
138
|
+
${commit.message}
|
|
139
|
+
|
|
140
|
+
Files Changed:
|
|
141
|
+
${commit.filesChanged.join("\n")}
|
|
142
|
+
|
|
143
|
+
Time:
|
|
144
|
+
${commit.timeAgo}
|
|
145
|
+
`.trim()
|
|
146
|
+
}));
|
|
147
|
+
}
|
|
148
|
+
async function getFilesChangedForCommit(git, hash) {
|
|
149
|
+
const output = await git.show([
|
|
150
|
+
"--name-only",
|
|
151
|
+
"--pretty=format:",
|
|
152
|
+
hash,
|
|
153
|
+
]);
|
|
154
|
+
return output
|
|
155
|
+
.split("\n")
|
|
156
|
+
.map(line => line.trim())
|
|
157
|
+
.filter(Boolean);
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Splits an oversized chunk further, preferring paragraph boundaries
|
|
161
|
+
* (blank lines) to avoid cutting mid-sentence, falling back to a hard
|
|
162
|
+
* character split if a single paragraph is itself larger than the cap.
|
|
163
|
+
*/
|
|
164
|
+
function subSplitOversizedChunk(label, content) {
|
|
165
|
+
if (content.length <= MAX_CHUNK_CHARS) {
|
|
166
|
+
return [{ label, content }];
|
|
167
|
+
}
|
|
168
|
+
const paragraphs = content.split(/\n\s*\n/);
|
|
169
|
+
const pieces = [];
|
|
170
|
+
let current = "";
|
|
171
|
+
for (const para of paragraphs) {
|
|
172
|
+
if (para.length > MAX_CHUNK_CHARS) {
|
|
173
|
+
if (current.length > 0) {
|
|
174
|
+
pieces.push(current);
|
|
175
|
+
current = "";
|
|
176
|
+
}
|
|
177
|
+
for (let i = 0; i < para.length; i += MAX_CHUNK_CHARS) {
|
|
178
|
+
pieces.push(para.slice(i, i + MAX_CHUNK_CHARS));
|
|
179
|
+
}
|
|
180
|
+
continue;
|
|
181
|
+
}
|
|
182
|
+
if (current.length + para.length + 2 > MAX_CHUNK_CHARS) {
|
|
183
|
+
pieces.push(current);
|
|
184
|
+
current = para;
|
|
185
|
+
}
|
|
186
|
+
else {
|
|
187
|
+
current = current.length > 0 ? `${current}\n\n${para}` : para;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
if (current.length > 0)
|
|
191
|
+
pieces.push(current);
|
|
192
|
+
return pieces.map((content, i) => ({ label: `${label}:part${i + 1}`, content }));
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Improvement #1 — self-describing chunks.
|
|
196
|
+
* Cognee extracts entities/relationships from each chunk INDEPENDENTLY
|
|
197
|
+
* (unlike Claude, which reads the whole doc in one pass with full context).
|
|
198
|
+
* Without a header, Cognee has to infer from raw code alone that
|
|
199
|
+
* "src/commands/init.ts" belongs to "cliper-sdk" and implements "cliper init".
|
|
200
|
+
* A one-line header gives entity extraction an explicit subject and project
|
|
201
|
+
* anchor to attach relationships to.
|
|
202
|
+
*/
|
|
203
|
+
function fileHeader(projectName, relativePath) {
|
|
204
|
+
return `# File: ${relativePath} — part of the ${projectName} project.\n\n`;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Improvement #3 — dependency edges as plain sentences instead of a
|
|
208
|
+
* "from -> arrow -> to" tree. Cognee's relationship extraction maps far
|
|
209
|
+
* more reliably onto "X imports Y" sentence structure than onto a list
|
|
210
|
+
* formatted for human visual scanning, which is what the dependency-map
|
|
211
|
+
* tree (↳ characters, indentation) was designed for in the original doc.
|
|
212
|
+
*/
|
|
213
|
+
function buildDependencyChunks(projectName, dependencyMap) {
|
|
214
|
+
const chunks = [];
|
|
215
|
+
const edgeGroups = chunkArray(dependencyMap.edges, 10);
|
|
216
|
+
edgeGroups.forEach((group, index) => {
|
|
217
|
+
const lines = [
|
|
218
|
+
`# Dependency relationships in ${projectName}.`,
|
|
219
|
+
"",
|
|
220
|
+
];
|
|
221
|
+
for (const edge of group) {
|
|
222
|
+
const verb = edge.type === "use"
|
|
223
|
+
? "uses"
|
|
224
|
+
: edge.type === "mod"
|
|
225
|
+
? "declares the module"
|
|
226
|
+
: "imports";
|
|
227
|
+
lines.push(`${edge.from} ${verb} ${edge.to}.`);
|
|
228
|
+
}
|
|
229
|
+
chunks.push({
|
|
230
|
+
label: `dependency-map-part${index + 1}`,
|
|
231
|
+
content: lines.join("\n"),
|
|
232
|
+
});
|
|
233
|
+
});
|
|
234
|
+
const externalGroups = chunkArray(dependencyMap.externalPackages, 10);
|
|
235
|
+
externalGroups.forEach((group, index) => {
|
|
236
|
+
const lines = [
|
|
237
|
+
`# External packages used by ${projectName}.`,
|
|
238
|
+
"",
|
|
239
|
+
];
|
|
240
|
+
for (const pkg of group) {
|
|
241
|
+
lines.push(`${projectName} depends on the external package ${pkg}.`);
|
|
242
|
+
}
|
|
243
|
+
chunks.push({
|
|
244
|
+
label: `external-packages-part${index + 1}`,
|
|
245
|
+
content: lines.join("\n"),
|
|
246
|
+
});
|
|
247
|
+
});
|
|
248
|
+
return chunks;
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Improvement #2 — gaps as plain sentences instead of bracketed metadata.
|
|
252
|
+
* The original format `⚠️ [file.ts:6] description` is dense and scannable
|
|
253
|
+
* for a human, but has no clear grammatical subject/predicate for entity
|
|
254
|
+
* extraction to latch onto. A full sentence per gap extracts more reliably.
|
|
255
|
+
*/
|
|
256
|
+
function buildGapChunks(projectName, gaps) {
|
|
257
|
+
if (gaps.length === 0) {
|
|
258
|
+
return [
|
|
259
|
+
{
|
|
260
|
+
label: "detected-gaps",
|
|
261
|
+
content: `# Gaps in ${projectName}.\n\nNo significant gaps were detected.`,
|
|
262
|
+
},
|
|
263
|
+
];
|
|
264
|
+
}
|
|
265
|
+
const severityLabel = {
|
|
266
|
+
high: "high-priority",
|
|
267
|
+
medium: "medium-priority",
|
|
268
|
+
low: "low-priority",
|
|
269
|
+
};
|
|
270
|
+
const typeLabel = {
|
|
271
|
+
undocumented_function: "an undocumented function",
|
|
272
|
+
missing_env_var: "a missing environment variable",
|
|
273
|
+
todo_fixme: "a TODO or FIXME comment",
|
|
274
|
+
implicit_dependency: "an implicit dependency",
|
|
275
|
+
stale_reference: "a stale reference",
|
|
276
|
+
};
|
|
277
|
+
const chunks = [];
|
|
278
|
+
const groups = chunkArray(gaps, 10);
|
|
279
|
+
groups.forEach((group, index) => {
|
|
280
|
+
const lines = [
|
|
281
|
+
`# Gaps in ${projectName}.`,
|
|
282
|
+
"",
|
|
283
|
+
];
|
|
284
|
+
for (const g of group) {
|
|
285
|
+
const location = g.line
|
|
286
|
+
? `${g.file}, line ${g.line}`
|
|
287
|
+
: g.file;
|
|
288
|
+
lines.push(`${location} has a ${severityLabel[g.severity]} gap: ${typeLabel[g.type]}. ${g.description}`);
|
|
289
|
+
}
|
|
290
|
+
chunks.push({
|
|
291
|
+
label: `detected-gaps-part${index + 1}`,
|
|
292
|
+
content: lines.join("\n"),
|
|
293
|
+
});
|
|
294
|
+
});
|
|
295
|
+
return chunks;
|
|
296
|
+
}
|
|
297
|
+
function gitContextSentences(projectName, git) {
|
|
298
|
+
if (!git.isGitRepo) {
|
|
299
|
+
return `# Git context for ${projectName}.\n\n${projectName} is not a git repository.`;
|
|
300
|
+
}
|
|
301
|
+
const lines = [`# Git context for ${projectName}.\n`];
|
|
302
|
+
lines.push(`${projectName} is currently on branch ${git.branch}.`);
|
|
303
|
+
if (git.lastCommit) {
|
|
304
|
+
lines.push(`The last commit on ${projectName} was ${git.lastCommit.hash} by ${git.lastCommit.author}: "${git.lastCommit.message}" (${git.lastCommit.timeAgo}).`);
|
|
305
|
+
}
|
|
306
|
+
for (const c of git.recentCommits) {
|
|
307
|
+
lines.push(`Commit ${c.hash} on ${projectName}: "${c.message}".`);
|
|
308
|
+
}
|
|
309
|
+
if (git.uncommittedChanges.length > 0) {
|
|
310
|
+
const noun = git.uncommittedChanges.length === 1 ? "change" : "changes";
|
|
311
|
+
lines.push(`${projectName} currently has ${git.uncommittedChanges.length} uncommitted ${noun}.`);
|
|
312
|
+
}
|
|
313
|
+
return lines.join("\n");
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Builds Cognee-specific chunks directly from structured data (files, gaps,
|
|
317
|
+
* dependencyMap, gitContext) rather than regex-parsing the flattened
|
|
318
|
+
* context.md markdown. This avoids re-parsing a format designed for human/
|
|
319
|
+
* Claude readability, and lets each chunk be phrased for how Cognee's
|
|
320
|
+
* entity/relationship extraction actually works — independently per chunk,
|
|
321
|
+
* not with the whole-document context a single Claude pass gets.
|
|
322
|
+
*
|
|
323
|
+
* Note: this transform is intentionally Cognee-only. context.md itself
|
|
324
|
+
* (read by Claude, cliper export, and the dashboard parser) is untouched.
|
|
325
|
+
*/
|
|
326
|
+
// async function buildCogneeChunks(
|
|
327
|
+
// projectRoot: string,
|
|
328
|
+
// projectName: string,
|
|
329
|
+
// files: FileContent[],
|
|
330
|
+
// gaps: Gap[],
|
|
331
|
+
// dependencyMap: DependencyMap,
|
|
332
|
+
// gitContext: GitContext
|
|
333
|
+
// ): Promise<CogneeChunk[]> {
|
|
334
|
+
// const chunks: CogneeChunk[] = [];
|
|
335
|
+
// chunks.push({ label: "git-context", content: gitContextSentences(projectName, gitContext) });
|
|
336
|
+
// chunks.push(
|
|
337
|
+
// ...buildDependencyChunks(projectName, dependencyMap)
|
|
338
|
+
// );
|
|
339
|
+
// chunks.push(
|
|
340
|
+
// ...buildGapChunks(projectName, gaps)
|
|
341
|
+
// );
|
|
342
|
+
// const commitChunks = await buildCommitChunks(
|
|
343
|
+
// projectRoot,
|
|
344
|
+
// projectName,
|
|
345
|
+
// gitContext
|
|
346
|
+
// );
|
|
347
|
+
// chunks.push(...commitChunks);
|
|
348
|
+
// for (const file of files) {
|
|
349
|
+
// const summary = buildFileSummary(
|
|
350
|
+
// file,
|
|
351
|
+
// dependencyMap
|
|
352
|
+
// );
|
|
353
|
+
// chunks.push({
|
|
354
|
+
// label: `summary:${file.relativePath}`,
|
|
355
|
+
// content: buildFileSummaryChunk(summary)
|
|
356
|
+
// });
|
|
357
|
+
// }
|
|
358
|
+
// const nonEmptyChunks = chunks.filter((c) => c.content.trim().length > 0);
|
|
359
|
+
// // Safety net: sub-split anything still too large after structural splitting
|
|
360
|
+
// return nonEmptyChunks.flatMap((c) => subSplitOversizedChunk(c.label, c.content));
|
|
361
|
+
// }
|
|
362
|
+
async function uploadChunk(datasetName, label, content) {
|
|
363
|
+
const tmpPath = path.join(os.tmpdir(), `cliper-${label.replace(/[\/:]/g, "_")}-${Date.now()}.md`);
|
|
364
|
+
fs.writeFileSync(tmpPath, content, "utf-8");
|
|
365
|
+
try {
|
|
366
|
+
const fileBuffer = fs.readFileSync(tmpPath);
|
|
367
|
+
const form = new FormData();
|
|
368
|
+
form.append("data", new Blob([fileBuffer], { type: "text/markdown" }), `${label}.md`);
|
|
369
|
+
form.append("datasetName", datasetName);
|
|
370
|
+
const res = await fetch(`${COGNEE_BASE_URL}/api/v1/add`, {
|
|
371
|
+
method: "POST",
|
|
372
|
+
headers: { "X-Api-Key": COGNEE_API_KEY },
|
|
373
|
+
body: form,
|
|
374
|
+
});
|
|
375
|
+
if (!res.ok) {
|
|
376
|
+
const errText = await res.text();
|
|
377
|
+
throw new Error(`/add failed for chunk "${label}": ${res.status} ${errText}`);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
finally {
|
|
381
|
+
fs.unlinkSync(tmpPath);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* Queries Cognee memory for a project's dataset.
|
|
386
|
+
* search_type defaults to GRAPH_COMPLETION (verified working).
|
|
387
|
+
*/
|
|
388
|
+
async function recallContext(projectName, query) {
|
|
389
|
+
assertConfigured();
|
|
390
|
+
const datasetName = `cliper-${projectName}`;
|
|
391
|
+
const res = await fetch(`${COGNEE_BASE_URL}/api/v1/search`, {
|
|
392
|
+
method: "POST",
|
|
393
|
+
headers: {
|
|
394
|
+
"X-Api-Key": COGNEE_API_KEY,
|
|
395
|
+
"Content-Type": "application/json",
|
|
396
|
+
},
|
|
397
|
+
body: JSON.stringify({
|
|
398
|
+
query,
|
|
399
|
+
search_type: "GRAPH_COMPLETION",
|
|
400
|
+
datasets: [datasetName],
|
|
401
|
+
}),
|
|
402
|
+
});
|
|
403
|
+
if (!res.ok) {
|
|
404
|
+
const errText = await res.text();
|
|
405
|
+
throw new Error(`Cognee /search failed: ${res.status} ${errText}`);
|
|
406
|
+
}
|
|
407
|
+
return res.json();
|
|
408
|
+
}
|
|
409
|
+
//# sourceMappingURL=legacyClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacyClient.js","sourceRoot":"","sources":["../../src/cognee/legacyClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,gDAEC;AAujBD,sCA2BC;AAhmBD,uCAAyB;AACzB,2CAA6B;AAC7B,uCAAyB;AAKzB,4DAAmC;AAEnC,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,EAAE,CAAC;AAC1D,MAAM,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,EAAE,CAAC;AAExD,SAAgB,kBAAkB;IAC9B,OAAO,OAAO,CAAC,eAAe,IAAI,cAAc,CAAC,CAAC;AACtD,CAAC;AAED,SAAS,gBAAgB;IACrB,IAAI,CAAC,kBAAkB,EAAE,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CACX,sFAAsF,CACzF,CAAC;IACN,CAAC;AACL,CAAC;AAED,SAAS,UAAU,CAAI,KAAU,EAAE,IAAY;IAC3C,MAAM,MAAM,GAAU,EAAE,CAAC;IAEzB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,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EAAE,CAAC;IAEnB,MAAM,WAAW,GAAG,UAAU,WAAW,EAAE,CAAC;IAE5C,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,eAAe,gBAAgB,EAAE;QACxD,MAAM,EAAE,MAAM;QACd,OAAO,EAAE;YACL,WAAW,EAAE,cAAc;YAC3B,cAAc,EAAE,kBAAkB;SACrC;QACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;YACjB,KAAK;YACL,WAAW,EAAE,kBAAkB;YAC/B,QAAQ,EAAE,CAAC,WAAW,CAAC;SAC1B,CAAC;KACL,CAAC,CAAC;IAEH,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;QACV,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,CAAC,0BAA0B,GAAG,CAAC,MAAM,IAAI,OAAO,EAAE,CAAC,CAAC;IACvE,CAAC;IAED,OAAO,GAAG,CAAC,IAAI,EAAmC,CAAC;AACvD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analyze.d.ts","sourceRoot":"","sources":["../../src/commands/analyze.ts"],"names":[],"mappings":"AAQA,UAAU,cAAc;IACpB,KAAK,EAAE,MAAM,CAAC;CACjB;AA2HD,wBAAsB,cAAc,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAmE3E"}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.analyzeCommand = analyzeCommand;
|
|
40
|
+
const fs = __importStar(require("fs"));
|
|
41
|
+
const path = __importStar(require("path"));
|
|
42
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
43
|
+
const ora_1 = __importDefault(require("ora"));
|
|
44
|
+
const config_1 = require("../scope/config");
|
|
45
|
+
const CLAUDE_SYSTEM = `You are an expert software architect analyzing a codebase context document.
|
|
46
|
+
Your job is to transform raw codebase data into a highly optimized prompt for a Claude AI coding session.
|
|
47
|
+
|
|
48
|
+
Claude thinks best when given:
|
|
49
|
+
- Clear project narrative (what it is, why it exists)
|
|
50
|
+
- Explicit constraints and existing decisions to respect
|
|
51
|
+
- The specific area of focus with surrounding context
|
|
52
|
+
- What NOT to change or break
|
|
53
|
+
- Open questions or uncertainties the developer has
|
|
54
|
+
|
|
55
|
+
Your output must be a ready-to-paste prompt. No preamble. No explanation. Just the prompt itself.`;
|
|
56
|
+
const CHATGPT_SYSTEM = `You are an expert software architect analyzing a codebase context document.
|
|
57
|
+
Your job is to transform raw codebase data into a highly optimized prompt for a ChatGPT coding session.
|
|
58
|
+
|
|
59
|
+
ChatGPT works best when given:
|
|
60
|
+
- Numbered, structured context sections
|
|
61
|
+
- Explicit file paths and code blocks
|
|
62
|
+
- Clear task definition separated from context
|
|
63
|
+
- Constraints listed as bullet points
|
|
64
|
+
- A direct question or task at the end
|
|
65
|
+
|
|
66
|
+
Your output must be a ready-to-paste prompt. No preamble. No explanation. Just the prompt itself.`;
|
|
67
|
+
const CLAUDE_USER = (contextDoc) => `Here is the raw codebase context document generated by Cliper:
|
|
68
|
+
|
|
69
|
+
<context>
|
|
70
|
+
${contextDoc}
|
|
71
|
+
</context>
|
|
72
|
+
|
|
73
|
+
Transform this into an optimized Claude prompt following these rules:
|
|
74
|
+
|
|
75
|
+
CRITICAL ACCURACY RULES:
|
|
76
|
+
- Never expand acronyms unless the context doc explicitly defines them. If you see "SPEL" and the doc doesn't say what it stands for, write "SPEL" — do not invent an expansion.
|
|
77
|
+
- Never infer what a framework "is based on" from inspiration references. "Inspired by Anchor for Solana" does NOT mean the project runs on Solana.
|
|
78
|
+
- Include ALL macros and annotations found in the source code, not just the most common ones. If you see #[require_admin], include it.
|
|
79
|
+
- If a file was truncated, note that there may be additional macros or patterns not visible.
|
|
80
|
+
|
|
81
|
+
FORMAT RULES:
|
|
82
|
+
1. Opens with a concise project narrative (2-3 sentences max) — only state facts explicitly in the context doc
|
|
83
|
+
2. Summarizes the current branch focus and recent work
|
|
84
|
+
3. Lists key architectural decisions already made that must be respected
|
|
85
|
+
4. Highlights the most important files and their roles
|
|
86
|
+
5. Lists ALL macros/annotations found across all files
|
|
87
|
+
6. Surfaces any detected gaps the developer should be aware of
|
|
88
|
+
7. Ends with: "## What I need help with today:"
|
|
89
|
+
|
|
90
|
+
Make it feel like a natural briefing. Never invent details not present in the context doc.`;
|
|
91
|
+
const CHATGPT_USER = (contextDoc) => `Here is the raw codebase context document generated by Cliper:
|
|
92
|
+
|
|
93
|
+
${contextDoc}
|
|
94
|
+
|
|
95
|
+
Transform this into an optimized chatgpt prompt following these rules:
|
|
96
|
+
|
|
97
|
+
CRITICAL ACCURACY RULES:
|
|
98
|
+
- Never expand acronyms unless the context doc explicitly defines them. If you see "SPEL" and the doc doesn't say what it stands for, write "SPEL" — do not invent an expansion.
|
|
99
|
+
- Never infer what a framework "is based on" from inspiration references. "Inspired by Anchor for Solana" does NOT mean the project runs on Solana.
|
|
100
|
+
- Include ALL macros and annotations found in the source code, not just the most common ones. If you see #[require_admin], include it.
|
|
101
|
+
- If a file was truncated, note that there may be additional macros or patterns not visible.
|
|
102
|
+
|
|
103
|
+
FORMAT RULES:
|
|
104
|
+
1. Starts with "## Project Context" as a header
|
|
105
|
+
2. Uses numbered sections for: Project Overview, Tech Stack, Current Branch & Focus, Key Files, Constraints & Decisions, Known Gaps
|
|
106
|
+
3. Uses bullet points and code blocks for file paths and snippets
|
|
107
|
+
4. Keeps each section concise — no more than 5 bullet points per section
|
|
108
|
+
5. Ends with "## Task:" followed by a blank line for the developer to fill in
|
|
109
|
+
|
|
110
|
+
Format it for maximum clarity and scannability. ChatGPT responds best to structured, explicitly labeled context.`;
|
|
111
|
+
async function callAnthropicAPI(contextDoc) {
|
|
112
|
+
const response = await fetch("https://api.anthropic.com/v1/messages", {
|
|
113
|
+
method: "POST",
|
|
114
|
+
headers: {
|
|
115
|
+
"Content-Type": "application/json",
|
|
116
|
+
"x-api-key": process.env.ANTHROPIC_API_KEY ?? "",
|
|
117
|
+
"anthropic-version": "2023-06-01",
|
|
118
|
+
},
|
|
119
|
+
body: JSON.stringify({
|
|
120
|
+
model: "claude-sonnet-4-20250514",
|
|
121
|
+
max_tokens: 2000,
|
|
122
|
+
system: CLAUDE_SYSTEM,
|
|
123
|
+
messages: [{ role: "user", content: CLAUDE_USER(contextDoc) }],
|
|
124
|
+
}),
|
|
125
|
+
});
|
|
126
|
+
if (!response.ok) {
|
|
127
|
+
const err = await response.text();
|
|
128
|
+
throw new Error(`Anthropic API error: ${response.status} — ${err}`);
|
|
129
|
+
}
|
|
130
|
+
const data = await response.json();
|
|
131
|
+
return data.content?.[0]?.text ?? "";
|
|
132
|
+
}
|
|
133
|
+
async function callOpenAIAPI(contextDoc) {
|
|
134
|
+
const response = await fetch("https://api.openai.com/v1/chat/completions", {
|
|
135
|
+
method: "POST",
|
|
136
|
+
headers: {
|
|
137
|
+
"Content-Type": "application/json",
|
|
138
|
+
"Authorization": `Bearer ${process.env.OPENAI_API_KEY ?? ""}`,
|
|
139
|
+
},
|
|
140
|
+
body: JSON.stringify({
|
|
141
|
+
model: "gpt-4o",
|
|
142
|
+
max_tokens: 2000,
|
|
143
|
+
messages: [
|
|
144
|
+
{ role: "system", content: CHATGPT_SYSTEM },
|
|
145
|
+
{ role: "user", content: CHATGPT_USER(contextDoc) },
|
|
146
|
+
],
|
|
147
|
+
}),
|
|
148
|
+
});
|
|
149
|
+
if (!response.ok) {
|
|
150
|
+
const err = await response.text();
|
|
151
|
+
throw new Error(`OpenAI API error: ${response.status} — ${err}`);
|
|
152
|
+
}
|
|
153
|
+
const data = await response.json();
|
|
154
|
+
return data.choices?.[0]?.message?.content ?? "";
|
|
155
|
+
}
|
|
156
|
+
async function analyzeCommand(options) {
|
|
157
|
+
const projectRoot = process.cwd();
|
|
158
|
+
const cliperDir = (0, config_1.getCliperDir)(projectRoot);
|
|
159
|
+
const contextPath = path.join(cliperDir, "context.md");
|
|
160
|
+
// Check context doc exists
|
|
161
|
+
if (!fs.existsSync(contextPath)) {
|
|
162
|
+
console.error(chalk_1.default.red("\n No context doc found. Run cliper init first.\n"));
|
|
163
|
+
process.exit(1);
|
|
164
|
+
}
|
|
165
|
+
const contextDoc = fs.readFileSync(contextPath, "utf-8");
|
|
166
|
+
const model = options.model.toLowerCase();
|
|
167
|
+
// Validate model choice
|
|
168
|
+
if (!["claude", "chatgpt"].includes(model)) {
|
|
169
|
+
console.error(chalk_1.default.red(`\n Unknown model: ${options.model}`));
|
|
170
|
+
console.error(chalk_1.default.gray(" Usage: cliper analyze --model claude"));
|
|
171
|
+
console.error(chalk_1.default.gray(" cliper analyze --model chatgpt\n"));
|
|
172
|
+
process.exit(1);
|
|
173
|
+
}
|
|
174
|
+
// Check API key
|
|
175
|
+
if (model === "claude" && !process.env.ANTHROPIC_API_KEY) {
|
|
176
|
+
console.error(chalk_1.default.red("\n ANTHROPIC_API_KEY not set."));
|
|
177
|
+
console.error(chalk_1.default.gray(" Export it first: export ANTHROPIC_API_KEY=your_key_here\n"));
|
|
178
|
+
process.exit(1);
|
|
179
|
+
}
|
|
180
|
+
if (model === "chatgpt" && !process.env.OPENAI_API_KEY) {
|
|
181
|
+
console.error(chalk_1.default.red("\n OPENAI_API_KEY not set."));
|
|
182
|
+
console.error(chalk_1.default.gray(" Export it first: export OPENAI_API_KEY=your_key_here\n"));
|
|
183
|
+
process.exit(1);
|
|
184
|
+
}
|
|
185
|
+
console.log(chalk_1.default.bold.cyan(`\n cliper analyze — ${model}\n`));
|
|
186
|
+
const spinner = (0, ora_1.default)(`Analyzing context doc with ${model === "claude" ? "Claude" : "ChatGPT"}...`).start();
|
|
187
|
+
try {
|
|
188
|
+
let prompt;
|
|
189
|
+
if (model === "claude") {
|
|
190
|
+
prompt = await callAnthropicAPI(contextDoc);
|
|
191
|
+
const outputPath = path.join(cliperDir, "prompt-claude.md");
|
|
192
|
+
fs.writeFileSync(outputPath, prompt, "utf-8");
|
|
193
|
+
spinner.succeed(chalk_1.default.green("Claude prompt generated"));
|
|
194
|
+
console.log(chalk_1.default.gray(`\n Saved: ${outputPath}\n`));
|
|
195
|
+
console.log(chalk_1.default.cyan(" Copy to clipboard:"));
|
|
196
|
+
console.log(chalk_1.default.white(" cliper analyze --model claude | pbcopy\n"));
|
|
197
|
+
console.log(chalk_1.default.cyan(" Or open directly:"));
|
|
198
|
+
console.log(chalk_1.default.white(` cat ${outputPath} | pbcopy\n`));
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
prompt = await callOpenAIAPI(contextDoc);
|
|
202
|
+
const outputPath = path.join(cliperDir, "prompt-gpt.md");
|
|
203
|
+
fs.writeFileSync(outputPath, prompt, "utf-8");
|
|
204
|
+
spinner.succeed(chalk_1.default.green("ChatGPT prompt generated"));
|
|
205
|
+
console.log(chalk_1.default.gray(`\n Saved: ${outputPath}\n`));
|
|
206
|
+
console.log(chalk_1.default.cyan(" Copy to clipboard:"));
|
|
207
|
+
console.log(chalk_1.default.white(` cat ${outputPath} | pbcopy\n`));
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
catch (err) {
|
|
211
|
+
spinner.fail(chalk_1.default.red("Analysis failed"));
|
|
212
|
+
console.error(chalk_1.default.red(`\n ${err.message}\n`));
|
|
213
|
+
process.exit(1);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
//# sourceMappingURL=analyze.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analyze.js","sourceRoot":"","sources":["../../src/commands/analyze.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqIA,wCAmEC;AAxMD,uCAAyB;AACzB,2CAA6B;AAC7B,kDAA0B;AAC1B,8CAAsB;AACtB,4CAA+C;AAQ/C,MAAM,aAAa,GAAG;;;;;;;;;;kGAU4E,CAAC;AAEnG,MAAM,cAAc,GAAG;;;;;;;;;;kGAU2E,CAAC;AAEnG,MAAM,WAAW,GAAG,CAAC,UAAkB,EAAE,EAAE,CAAC;;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