@brainfile/cli 0.17.0 → 0.17.2
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/.brainfile/brainfile.md.v1.bak +171 -0
- package/.brainfile/logs/task-1.md +206 -0
- package/.brainfile/logs/task-2.md +482 -0
- package/.brainfile/logs/task-3.md +314 -0
- package/.github/workflows/release.yml +35 -0
- package/README.md +3 -5
- package/dist/cli.js +30 -53
- package/dist/cli.js.map +1 -1
- package/dist/commands/add.d.ts +2 -0
- package/dist/commands/add.d.ts.map +1 -1
- package/dist/commands/add.js +16 -2
- package/dist/commands/add.js.map +1 -1
- package/dist/commands/complete.d.ts +5 -7
- package/dist/commands/complete.d.ts.map +1 -1
- package/dist/commands/complete.js +76 -127
- package/dist/commands/complete.js.map +1 -1
- package/dist/commands/contract.d.ts +46 -2
- package/dist/commands/contract.d.ts.map +1 -1
- package/dist/commands/contract.js +499 -2
- package/dist/commands/contract.js.map +1 -1
- package/dist/commands/mcp.d.ts.map +1 -1
- package/dist/commands/mcp.js +1037 -1763
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/migrate.d.ts +2 -2
- package/dist/commands/migrate.d.ts.map +1 -1
- package/dist/commands/migrate.js +127 -89
- package/dist/commands/migrate.js.map +1 -1
- package/dist/commands/move.js.map +1 -1
- package/dist/commands/schema.d.ts.map +1 -1
- package/dist/commands/schema.js +6 -1
- package/dist/commands/schema.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/contractRunner.d.ts.map +1 -1
- package/dist/lib/contractRunner.js +76 -49
- package/dist/lib/contractRunner.js.map +1 -1
- package/dist/mcp/tools/contract.d.ts +25 -0
- package/dist/mcp/tools/contract.d.ts.map +1 -0
- package/dist/mcp/tools/contract.js +33 -0
- package/dist/mcp/tools/contract.js.map +1 -0
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js +22 -9
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/contractSpec.d.ts +2 -0
- package/dist/utils/contractSpec.d.ts.map +1 -1
- package/dist/utils/contractSpec.js +5 -1
- package/dist/utils/contractSpec.js.map +1 -1
- package/dist/utils/hook-settings.d.ts.map +1 -1
- package/dist/utils/hook-settings.js +5 -1
- package/dist/utils/hook-settings.js.map +1 -1
- package/dist/validation/command-lint.d.ts +11 -0
- package/dist/validation/command-lint.d.ts.map +1 -0
- package/dist/validation/command-lint.js +88 -0
- package/dist/validation/command-lint.js.map +1 -0
- package/package.json +2 -2
- package/dist/commands/context.d.ts +0 -19
- package/dist/commands/context.d.ts.map +0 -1
- package/dist/commands/context.js +0 -103
- package/dist/commands/context.js.map +0 -1
- package/dist/commands/history.d.ts +0 -18
- package/dist/commands/history.d.ts.map +0 -1
- package/dist/commands/history.js +0 -92
- package/dist/commands/history.js.map +0 -1
- package/dist/commands/ledger-rebuild.d.ts +0 -17
- package/dist/commands/ledger-rebuild.d.ts.map +0 -1
- package/dist/commands/ledger-rebuild.js +0 -287
- package/dist/commands/ledger-rebuild.js.map +0 -1
- package/dist/commands/ledger.d.ts +0 -20
- package/dist/commands/ledger.d.ts.map +0 -1
- package/dist/commands/ledger.js +0 -111
- package/dist/commands/ledger.js.map +0 -1
- package/dist/commands/migrate-ledger.d.ts +0 -17
- package/dist/commands/migrate-ledger.d.ts.map +0 -1
- package/dist/commands/migrate-ledger.js +0 -127
- package/dist/commands/migrate-ledger.js.map +0 -1
- package/dist/commands/stats.d.ts +0 -20
- package/dist/commands/stats.d.ts.map +0 -1
- package/dist/commands/stats.js +0 -151
- package/dist/commands/stats.js.map +0 -1
- package/dist/tui/components/ArchivePanel.d.ts +0 -16
- package/dist/tui/components/ArchivePanel.d.ts.map +0 -1
- package/dist/tui/components/ArchivePanel.js +0 -115
- package/dist/tui/components/ArchivePanel.js.map +0 -1
- package/dist/utils/date-helpers.d.ts +0 -20
- package/dist/utils/date-helpers.d.ts.map +0 -1
- package/dist/utils/date-helpers.js +0 -54
- package/dist/utils/date-helpers.js.map +0 -1
- package/dist/utils/v2-tasks.d.ts +0 -121
- package/dist/utils/v2-tasks.d.ts.map +0 -1
- package/dist/utils/v2-tasks.js +0 -384
- package/dist/utils/v2-tasks.js.map +0 -1
|
@@ -1,287 +0,0 @@
|
|
|
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.ledgerRebuildCommand = ledgerRebuildCommand;
|
|
40
|
-
const fs = __importStar(require("fs"));
|
|
41
|
-
const path = __importStar(require("path"));
|
|
42
|
-
const child_process_1 = require("child_process");
|
|
43
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
44
|
-
const dist_1 = require("../../../core/dist");
|
|
45
|
-
const logger_1 = require("../utils/logger");
|
|
46
|
-
const cli_error_1 = require("../utils/cli-error");
|
|
47
|
-
const brainfile_path_1 = require("../utils/brainfile-path");
|
|
48
|
-
const v2_detect_1 = require("../utils/v2-detect");
|
|
49
|
-
const COMMIT_MARKER = '__COMMIT__';
|
|
50
|
-
const REBUILT_SUMMARY = 'Rebuilt from git history';
|
|
51
|
-
function runGit(args, cwd) {
|
|
52
|
-
const result = (0, child_process_1.spawnSync)('git', args, {
|
|
53
|
-
cwd,
|
|
54
|
-
encoding: 'utf-8',
|
|
55
|
-
});
|
|
56
|
-
return {
|
|
57
|
-
ok: !result.error && result.status === 0,
|
|
58
|
-
stdout: typeof result.stdout === 'string' ? result.stdout : '',
|
|
59
|
-
stderr: typeof result.stderr === 'string' ? result.stderr : '',
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
function normalizeGitPath(value) {
|
|
63
|
-
return value.replace(/\\/g, '/').replace(/^\.\//, '').trim();
|
|
64
|
-
}
|
|
65
|
-
function isPathWithinDirectory(filePath, directory) {
|
|
66
|
-
return filePath === directory || filePath.startsWith(`${directory}/`);
|
|
67
|
-
}
|
|
68
|
-
function isTaskMarkdownInDirectory(filePath, directory) {
|
|
69
|
-
return filePath.endsWith('.md') && isPathWithinDirectory(filePath, directory);
|
|
70
|
-
}
|
|
71
|
-
function toRepoRelativePath(repoRoot, targetPath) {
|
|
72
|
-
const relative = normalizeGitPath(path.relative(repoRoot, targetPath));
|
|
73
|
-
if (!relative || relative.startsWith('..')) {
|
|
74
|
-
throw (0, cli_error_1.operationFailed)(`Path is outside the git repository: ${targetPath}`);
|
|
75
|
-
}
|
|
76
|
-
return relative;
|
|
77
|
-
}
|
|
78
|
-
function resolveRepoRoot(startDir) {
|
|
79
|
-
const result = runGit(['rev-parse', '--show-toplevel'], startDir);
|
|
80
|
-
if (!result.ok) {
|
|
81
|
-
throw (0, cli_error_1.operationFailed)('ledger rebuild requires a git repository');
|
|
82
|
-
}
|
|
83
|
-
const repoRoot = result.stdout.trim();
|
|
84
|
-
if (!repoRoot) {
|
|
85
|
-
throw (0, cli_error_1.operationFailed)('Failed to resolve git repository root for ledger rebuild');
|
|
86
|
-
}
|
|
87
|
-
return path.resolve(repoRoot);
|
|
88
|
-
}
|
|
89
|
-
function parseCompletionEvents(logOutput, boardRel, logsRel) {
|
|
90
|
-
const events = [];
|
|
91
|
-
let currentCommit = '';
|
|
92
|
-
let currentCompletedAt = '';
|
|
93
|
-
for (const rawLine of logOutput.split('\n')) {
|
|
94
|
-
const line = rawLine.trim();
|
|
95
|
-
if (!line) {
|
|
96
|
-
continue;
|
|
97
|
-
}
|
|
98
|
-
if (line.startsWith(COMMIT_MARKER)) {
|
|
99
|
-
const payload = line.slice(COMMIT_MARKER.length);
|
|
100
|
-
const separatorIndex = payload.indexOf('|');
|
|
101
|
-
if (separatorIndex === -1) {
|
|
102
|
-
currentCommit = '';
|
|
103
|
-
currentCompletedAt = '';
|
|
104
|
-
continue;
|
|
105
|
-
}
|
|
106
|
-
currentCommit = payload.slice(0, separatorIndex).trim();
|
|
107
|
-
currentCompletedAt = payload.slice(separatorIndex + 1).trim();
|
|
108
|
-
continue;
|
|
109
|
-
}
|
|
110
|
-
if (!currentCommit) {
|
|
111
|
-
continue;
|
|
112
|
-
}
|
|
113
|
-
const parts = rawLine.split('\t');
|
|
114
|
-
if (parts.length < 2) {
|
|
115
|
-
continue;
|
|
116
|
-
}
|
|
117
|
-
const status = parts[0].trim();
|
|
118
|
-
if (status === 'D') {
|
|
119
|
-
const deletedPath = normalizeGitPath(parts[1] || '');
|
|
120
|
-
if (!isTaskMarkdownInDirectory(deletedPath, boardRel)) {
|
|
121
|
-
continue;
|
|
122
|
-
}
|
|
123
|
-
events.push({
|
|
124
|
-
commit: currentCommit,
|
|
125
|
-
completedAt: currentCompletedAt,
|
|
126
|
-
sourcePath: deletedPath,
|
|
127
|
-
});
|
|
128
|
-
continue;
|
|
129
|
-
}
|
|
130
|
-
if (!status.startsWith('R') || parts.length < 3) {
|
|
131
|
-
continue;
|
|
132
|
-
}
|
|
133
|
-
const sourcePath = normalizeGitPath(parts[1] || '');
|
|
134
|
-
const targetPath = normalizeGitPath(parts[2] || '');
|
|
135
|
-
if (!isTaskMarkdownInDirectory(sourcePath, boardRel)) {
|
|
136
|
-
continue;
|
|
137
|
-
}
|
|
138
|
-
if (!isTaskMarkdownInDirectory(targetPath, logsRel)) {
|
|
139
|
-
continue;
|
|
140
|
-
}
|
|
141
|
-
events.push({
|
|
142
|
-
commit: currentCommit,
|
|
143
|
-
completedAt: currentCompletedAt,
|
|
144
|
-
sourcePath,
|
|
145
|
-
targetPath,
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
return events;
|
|
149
|
-
}
|
|
150
|
-
function scanCompletionEvents(repoRoot, boardRel, logsRel) {
|
|
151
|
-
const result = runGit([
|
|
152
|
-
'log',
|
|
153
|
-
'--reverse',
|
|
154
|
-
'--date=iso-strict',
|
|
155
|
-
`--pretty=format:${COMMIT_MARKER}%H|%cI`,
|
|
156
|
-
'--name-status',
|
|
157
|
-
'--find-renames',
|
|
158
|
-
'--',
|
|
159
|
-
boardRel,
|
|
160
|
-
logsRel,
|
|
161
|
-
], repoRoot);
|
|
162
|
-
if (!result.ok) {
|
|
163
|
-
const details = result.stderr.trim();
|
|
164
|
-
throw (0, cli_error_1.operationFailed)(details
|
|
165
|
-
? `Failed to scan git history for ledger rebuild: ${details}`
|
|
166
|
-
: 'Failed to scan git history for ledger rebuild');
|
|
167
|
-
}
|
|
168
|
-
return parseCompletionEvents(result.stdout, boardRel, logsRel);
|
|
169
|
-
}
|
|
170
|
-
function parseIsoDate(value) {
|
|
171
|
-
if (!value) {
|
|
172
|
-
return undefined;
|
|
173
|
-
}
|
|
174
|
-
const parsed = Date.parse(value);
|
|
175
|
-
if (!Number.isFinite(parsed)) {
|
|
176
|
-
return undefined;
|
|
177
|
-
}
|
|
178
|
-
return new Date(parsed).toISOString();
|
|
179
|
-
}
|
|
180
|
-
function readTaskFromHistory(event, repoRoot) {
|
|
181
|
-
const showSpecs = [`${event.commit}^:${event.sourcePath}`, `${event.commit}:${event.sourcePath}`];
|
|
182
|
-
if (event.targetPath) {
|
|
183
|
-
showSpecs.push(`${event.commit}:${event.targetPath}`);
|
|
184
|
-
}
|
|
185
|
-
for (const showSpec of showSpecs) {
|
|
186
|
-
const result = runGit(['show', showSpec], repoRoot);
|
|
187
|
-
if (!result.ok || !result.stdout) {
|
|
188
|
-
continue;
|
|
189
|
-
}
|
|
190
|
-
const parsed = (0, dist_1.parseTaskContent)(result.stdout);
|
|
191
|
-
if (parsed) {
|
|
192
|
-
return parsed;
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
return null;
|
|
196
|
-
}
|
|
197
|
-
function inferFilesChangedFromCommit(repoRoot, commit, boardRel, logsRel) {
|
|
198
|
-
const result = runGit(['show', '--pretty=format:', '--name-only', commit], repoRoot);
|
|
199
|
-
if (!result.ok) {
|
|
200
|
-
return [];
|
|
201
|
-
}
|
|
202
|
-
const filesChanged = [];
|
|
203
|
-
const seen = new Set();
|
|
204
|
-
for (const line of result.stdout.split('\n')) {
|
|
205
|
-
const normalized = normalizeGitPath(line);
|
|
206
|
-
if (!normalized || seen.has(normalized)) {
|
|
207
|
-
continue;
|
|
208
|
-
}
|
|
209
|
-
if (isTaskMarkdownInDirectory(normalized, boardRel)) {
|
|
210
|
-
continue;
|
|
211
|
-
}
|
|
212
|
-
if (isTaskMarkdownInDirectory(normalized, logsRel)) {
|
|
213
|
-
continue;
|
|
214
|
-
}
|
|
215
|
-
if (normalized === `${logsRel}/ledger.jsonl`) {
|
|
216
|
-
continue;
|
|
217
|
-
}
|
|
218
|
-
seen.add(normalized);
|
|
219
|
-
filesChanged.push(normalized);
|
|
220
|
-
}
|
|
221
|
-
return filesChanged;
|
|
222
|
-
}
|
|
223
|
-
function buildRebuiltRecord(task, body, completedAt, filesChanged) {
|
|
224
|
-
const record = (0, dist_1.buildLedgerRecord)(task, body, {
|
|
225
|
-
completedAt,
|
|
226
|
-
summary: REBUILT_SUMMARY,
|
|
227
|
-
filesChanged: filesChanged.length > 0 ? filesChanged : undefined,
|
|
228
|
-
});
|
|
229
|
-
// For rebuilds, preserve strict semantics: either inferred files or empty array.
|
|
230
|
-
record.summary = REBUILT_SUMMARY;
|
|
231
|
-
record.filesChanged = filesChanged;
|
|
232
|
-
return record;
|
|
233
|
-
}
|
|
234
|
-
function writeLedger(logsDir, records) {
|
|
235
|
-
fs.mkdirSync(logsDir, { recursive: true });
|
|
236
|
-
const ledgerPath = path.join(logsDir, 'ledger.jsonl');
|
|
237
|
-
const jsonl = records.map((record) => JSON.stringify(record)).join('\n');
|
|
238
|
-
fs.writeFileSync(ledgerPath, jsonl ? `${jsonl}\n` : '', 'utf-8');
|
|
239
|
-
return ledgerPath;
|
|
240
|
-
}
|
|
241
|
-
/**
|
|
242
|
-
* Rebuild `logs/ledger.jsonl` from git history.
|
|
243
|
-
*/
|
|
244
|
-
function ledgerRebuildCommand(options, logger = logger_1.defaultLogger) {
|
|
245
|
-
const filePath = (0, brainfile_path_1.resolveCliBrainfilePath)(options.file);
|
|
246
|
-
if (!fs.existsSync(filePath)) {
|
|
247
|
-
throw (0, cli_error_1.fileNotFound)(filePath);
|
|
248
|
-
}
|
|
249
|
-
if (!(0, v2_detect_1.isV2)(filePath)) {
|
|
250
|
-
throw (0, cli_error_1.operationFailed)('ledger rebuild requires v2 per-task file architecture. Run: brainfile migrate');
|
|
251
|
-
}
|
|
252
|
-
const dirs = (0, v2_detect_1.getV2Dirs)(filePath);
|
|
253
|
-
const repoRoot = resolveRepoRoot(path.dirname(filePath));
|
|
254
|
-
const boardRel = toRepoRelativePath(repoRoot, dirs.boardDir);
|
|
255
|
-
const logsRel = toRepoRelativePath(repoRoot, dirs.logsDir);
|
|
256
|
-
const events = scanCompletionEvents(repoRoot, boardRel, logsRel);
|
|
257
|
-
const records = [];
|
|
258
|
-
let skipped = 0;
|
|
259
|
-
for (const event of events) {
|
|
260
|
-
const parsedTask = readTaskFromHistory(event, repoRoot);
|
|
261
|
-
if (!parsedTask) {
|
|
262
|
-
skipped += 1;
|
|
263
|
-
continue;
|
|
264
|
-
}
|
|
265
|
-
const completedAt = parseIsoDate(event.completedAt) ||
|
|
266
|
-
parseIsoDate(parsedTask.task.completedAt) ||
|
|
267
|
-
new Date().toISOString();
|
|
268
|
-
const filesChanged = inferFilesChangedFromCommit(repoRoot, event.commit, boardRel, logsRel);
|
|
269
|
-
const record = buildRebuiltRecord(parsedTask.task, parsedTask.body, completedAt, filesChanged);
|
|
270
|
-
records.push(record);
|
|
271
|
-
}
|
|
272
|
-
const ledgerPath = writeLedger(dirs.logsDir, records);
|
|
273
|
-
const relativeLedgerPath = path.relative(path.dirname(filePath), ledgerPath) || ledgerPath;
|
|
274
|
-
logger.log(chalk_1.default.green('Ledger rebuild complete.'));
|
|
275
|
-
logger.log('');
|
|
276
|
-
logger.log(chalk_1.default.gray(` Rebuilt: ${records.length}`));
|
|
277
|
-
logger.log(chalk_1.default.gray(` Skipped: ${skipped}`));
|
|
278
|
-
logger.log(chalk_1.default.gray(` Ledger: ${relativeLedgerPath}`));
|
|
279
|
-
return {
|
|
280
|
-
success: true,
|
|
281
|
-
rebuilt: records.length,
|
|
282
|
-
skipped,
|
|
283
|
-
ledgerPath,
|
|
284
|
-
records,
|
|
285
|
-
};
|
|
286
|
-
}
|
|
287
|
-
//# sourceMappingURL=ledger-rebuild.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ledger-rebuild.js","sourceRoot":"","sources":["../../src/commands/ledger-rebuild.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoSA,oDAuDC;AA3VD,uCAAyB;AACzB,2CAA6B;AAC7B,iDAA0C;AAC1C,kDAA0B;AAC1B,6CAK4B;AAC5B,4CAA6D;AAC7D,kDAAmE;AACnE,4DAAkE;AAClE,kDAAqD;AAErD,MAAM,aAAa,GAAG,YAAY,CAAC;AACnC,MAAM,eAAe,GAAG,0BAA0B,CAAC;AA2BnD,SAAS,MAAM,CAAC,IAAc,EAAE,GAAW;IACzC,MAAM,MAAM,GAAG,IAAA,yBAAS,EAAC,KAAK,EAAE,IAAI,EAAE;QACpC,GAAG;QACH,QAAQ,EAAE,OAAO;KAClB,CAAC,CAAC;IAEH,OAAO;QACL,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QACxC,MAAM,EAAE,OAAO,MAAM,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE;QAC9D,MAAM,EAAE,OAAO,MAAM,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE;KAC/D,CAAC;AACJ,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAa;IACrC,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;AAC/D,CAAC;AAED,SAAS,qBAAqB,CAAC,QAAgB,EAAE,SAAiB;IAChE,OAAO,QAAQ,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I,UAAU,CAAC;IAE3F,MAAM,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC,CAAC;IACpD,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACf,MAAM,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,cAAc,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IACvD,MAAM,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,cAAc,OAAO,EAAE,CAAC,CAAC,CAAC;IAChD,MAAM,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,cAAc,kBAAkB,EAAE,CAAC,CAAC,CAAC;IAE3D,OAAO;QACL,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,OAAO,CAAC,MAAM;QACvB,OAAO;QACP,UAAU;QACV,OAAO;KACR,CAAC;AACJ,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { type LedgerRecord } from '../../../core/dist';
|
|
2
|
-
import { type Logger } from '../utils/logger';
|
|
3
|
-
export interface LedgerOptions {
|
|
4
|
-
file: string;
|
|
5
|
-
assignee?: string;
|
|
6
|
-
since?: string;
|
|
7
|
-
until?: string;
|
|
8
|
-
tag?: string;
|
|
9
|
-
contractStatus?: string;
|
|
10
|
-
}
|
|
11
|
-
export interface LedgerResult {
|
|
12
|
-
success: true;
|
|
13
|
-
count: number;
|
|
14
|
-
records: LedgerRecord[];
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Query append-only completion ledger records.
|
|
18
|
-
*/
|
|
19
|
-
export declare function ledgerCommand(options: LedgerOptions, logger?: Logger): LedgerResult;
|
|
20
|
-
//# sourceMappingURL=ledger.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ledger.d.ts","sourceRoot":"","sources":["../../src/commands/ledger.ts"],"names":[],"mappings":"AAEA,OAAO,EAKL,KAAK,YAAY,EAClB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,KAAK,MAAM,EAAiB,MAAM,iBAAiB,CAAC;AAM7D,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,IAAI,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,YAAY,EAAE,CAAC;CACzB;AAqDD;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,GAAE,MAAsB,GAAG,YAAY,CA0BlG"}
|
package/dist/commands/ledger.js
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
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.ledgerCommand = ledgerCommand;
|
|
40
|
-
const fs = __importStar(require("fs"));
|
|
41
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
42
|
-
const dist_1 = require("../../../core/dist");
|
|
43
|
-
const logger_1 = require("../utils/logger");
|
|
44
|
-
const cli_error_1 = require("../utils/cli-error");
|
|
45
|
-
const brainfile_path_1 = require("../utils/brainfile-path");
|
|
46
|
-
const v2_detect_1 = require("../utils/v2-detect");
|
|
47
|
-
const date_helpers_1 = require("../utils/date-helpers");
|
|
48
|
-
function normalizeContractStatus(value) {
|
|
49
|
-
if (!value) {
|
|
50
|
-
return undefined;
|
|
51
|
-
}
|
|
52
|
-
const normalized = value.trim().toLowerCase();
|
|
53
|
-
if (!(0, dist_1.isLedgerContractStatus)(normalized)) {
|
|
54
|
-
throw (0, cli_error_1.validationError)(`--contract-status must be one of: ${dist_1.LEDGER_CONTRACT_STATUSES.join(', ')} (received: ${value})`);
|
|
55
|
-
}
|
|
56
|
-
return normalized;
|
|
57
|
-
}
|
|
58
|
-
function displayLedgerRecords(records, logger) {
|
|
59
|
-
logger.log('');
|
|
60
|
-
logger.log(chalk_1.default.bold(`Ledger records (${records.length})`));
|
|
61
|
-
logger.log(chalk_1.default.gray('─'.repeat(60)));
|
|
62
|
-
if (records.length === 0) {
|
|
63
|
-
logger.log(chalk_1.default.gray(' No matching records found.'));
|
|
64
|
-
logger.log('');
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
for (const record of records) {
|
|
68
|
-
logger.log(` ${chalk_1.default.gray(`[${record.id}]`)} ${chalk_1.default.white(record.title)} ${chalk_1.default.cyan(`(${record.type})`)}`);
|
|
69
|
-
logger.log(` ${chalk_1.default.gray('Completed:')} ${record.completedAt} ${chalk_1.default.gray('Cycle:')} ${record.cycleTimeHours.toFixed(2)}h`);
|
|
70
|
-
if (record.assignee) {
|
|
71
|
-
logger.log(` ${chalk_1.default.gray('Assignee:')} ${chalk_1.default.white(record.assignee)}`);
|
|
72
|
-
}
|
|
73
|
-
if (record.contractStatus) {
|
|
74
|
-
logger.log(` ${chalk_1.default.gray('Contract:')} ${chalk_1.default.white(record.contractStatus)}`);
|
|
75
|
-
}
|
|
76
|
-
if (record.tags && record.tags.length > 0) {
|
|
77
|
-
logger.log(` ${chalk_1.default.gray('Tags:')} ${record.tags.map((tag) => `#${tag}`).join(' ')}`);
|
|
78
|
-
}
|
|
79
|
-
if (record.filesChanged.length > 0) {
|
|
80
|
-
logger.log(` ${chalk_1.default.gray('Files:')} ${record.filesChanged.join(', ')}`);
|
|
81
|
-
}
|
|
82
|
-
logger.log(` ${chalk_1.default.gray('Summary:')} ${record.summary}`);
|
|
83
|
-
logger.log('');
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Query append-only completion ledger records.
|
|
88
|
-
*/
|
|
89
|
-
function ledgerCommand(options, logger = logger_1.defaultLogger) {
|
|
90
|
-
const filePath = (0, brainfile_path_1.resolveCliBrainfilePath)(options.file);
|
|
91
|
-
if (!fs.existsSync(filePath)) {
|
|
92
|
-
throw (0, cli_error_1.fileNotFound)(filePath);
|
|
93
|
-
}
|
|
94
|
-
if (!(0, v2_detect_1.isV2)(filePath)) {
|
|
95
|
-
throw (0, cli_error_1.operationFailed)('Ledger command requires v2 per-task file architecture. Run: brainfile migrate');
|
|
96
|
-
}
|
|
97
|
-
const dateRange = (0, date_helpers_1.buildDateRange)(options.since, options.until);
|
|
98
|
-
const contractStatus = normalizeContractStatus(options.contractStatus);
|
|
99
|
-
const assignee = options.assignee?.trim();
|
|
100
|
-
const tag = options.tag?.trim();
|
|
101
|
-
const dirs = (0, v2_detect_1.getV2Dirs)(filePath);
|
|
102
|
-
const records = (0, dist_1.queryLedger)(dirs.logsDir, {
|
|
103
|
-
assignee: assignee || undefined,
|
|
104
|
-
tags: tag ? [tag] : undefined,
|
|
105
|
-
dateRange,
|
|
106
|
-
contractStatus,
|
|
107
|
-
}).sort((left, right) => right.completedAt.localeCompare(left.completedAt));
|
|
108
|
-
displayLedgerRecords(records, logger);
|
|
109
|
-
return { success: true, count: records.length, records };
|
|
110
|
-
}
|
|
111
|
-
//# sourceMappingURL=ledger.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ledger.js","sourceRoot":"","sources":["../../src/commands/ledger.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoFA,sCA0BC;AA9GD,uCAAyB;AACzB,kDAA0B;AAC1B,6CAM4B;AAC5B,4CAA6D;AAC7D,kDAAoF;AACpF,4DAAkE;AAClE,kDAAqD;AACrD,wDAAuD;AAiBvD,SAAS,uBAAuB,CAAC,KAAc;IAC7C,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAA0B,CAAC;IACtE,IAAI,CAAC,IAAA,6BAAsB,EAAC,UAAU,CAAC,EAAE,CAAC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ean?: boolean;
|
|
5
|
-
}
|
|
6
|
-
export interface MigrateLedgerResult {
|
|
7
|
-
success: true;
|
|
8
|
-
migrated: number;
|
|
9
|
-
skipped: number;
|
|
10
|
-
removed: number;
|
|
11
|
-
ledgerPath: string;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Convert legacy logs/*.md entries into append-only ledger records.
|
|
15
|
-
*/
|
|
16
|
-
export declare function migrateLedgerCommand(options: MigrateLedgerOptions, logger?: Logger): MigrateLedgerResult;
|
|
17
|
-
//# sourceMappingURL=migrate-ledger.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"migrate-ledger.d.ts","sourceRoot":"","sources":["../../src/commands/migrate-ledger.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,MAAM,EAAiB,MAAM,iBAAiB,CAAC;AAK7D,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,IAAI,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB;AAcD;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,oBAAoB,EAC7B,MAAM,GAAE,MAAsB,GAC7B,mBAAmB,CA4ErB"}
|
|
@@ -1,127 +0,0 @@
|
|
|
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.migrateLedgerCommand = migrateLedgerCommand;
|
|
40
|
-
const fs = __importStar(require("fs"));
|
|
41
|
-
const path = __importStar(require("path"));
|
|
42
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
43
|
-
const dist_1 = require("../../../core/dist");
|
|
44
|
-
const logger_1 = require("../utils/logger");
|
|
45
|
-
const cli_error_1 = require("../utils/cli-error");
|
|
46
|
-
const brainfile_path_1 = require("../utils/brainfile-path");
|
|
47
|
-
const v2_detect_1 = require("../utils/v2-detect");
|
|
48
|
-
function recordKey(record) {
|
|
49
|
-
return `${record.id}::${record.completedAt}`;
|
|
50
|
-
}
|
|
51
|
-
function loadExistingRecordKeys(ledgerPath, logsDir) {
|
|
52
|
-
if (!fs.existsSync(ledgerPath)) {
|
|
53
|
-
return new Set();
|
|
54
|
-
}
|
|
55
|
-
return new Set((0, dist_1.readLedger)(logsDir).map(recordKey));
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Convert legacy logs/*.md entries into append-only ledger records.
|
|
59
|
-
*/
|
|
60
|
-
function migrateLedgerCommand(options, logger = logger_1.defaultLogger) {
|
|
61
|
-
const filePath = (0, brainfile_path_1.resolveCliBrainfilePath)(options.file);
|
|
62
|
-
if (!fs.existsSync(filePath)) {
|
|
63
|
-
throw (0, cli_error_1.fileNotFound)(filePath);
|
|
64
|
-
}
|
|
65
|
-
if (!(0, v2_detect_1.isV2)(filePath)) {
|
|
66
|
-
throw (0, cli_error_1.operationFailed)('migrate-ledger requires v2 per-task file architecture. Run: brainfile migrate');
|
|
67
|
-
}
|
|
68
|
-
const dirs = (0, v2_detect_1.getV2Dirs)(filePath);
|
|
69
|
-
const logsDir = dirs.logsDir;
|
|
70
|
-
const ledgerPath = path.join(logsDir, 'ledger.jsonl');
|
|
71
|
-
const legacyDocs = (0, dist_1.readTasksDir)(logsDir).sort((a, b) => {
|
|
72
|
-
const left = a.task.completedAt || a.task.updatedAt || a.task.createdAt || '';
|
|
73
|
-
const right = b.task.completedAt || b.task.updatedAt || b.task.createdAt || '';
|
|
74
|
-
return left.localeCompare(right);
|
|
75
|
-
});
|
|
76
|
-
if (legacyDocs.length === 0) {
|
|
77
|
-
logger.log(chalk_1.default.yellow('No legacy markdown logs found to migrate.'));
|
|
78
|
-
return {
|
|
79
|
-
success: true,
|
|
80
|
-
migrated: 0,
|
|
81
|
-
skipped: 0,
|
|
82
|
-
removed: 0,
|
|
83
|
-
ledgerPath,
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
const existingKeys = loadExistingRecordKeys(ledgerPath, logsDir);
|
|
87
|
-
let migrated = 0;
|
|
88
|
-
let skipped = 0;
|
|
89
|
-
for (const doc of legacyDocs) {
|
|
90
|
-
const completedAt = doc.task.completedAt || doc.task.updatedAt || doc.task.createdAt || new Date().toISOString();
|
|
91
|
-
const record = (0, dist_1.buildLedgerRecord)(doc, doc.body, { completedAt });
|
|
92
|
-
const key = recordKey(record);
|
|
93
|
-
if (existingKeys.has(key)) {
|
|
94
|
-
skipped += 1;
|
|
95
|
-
continue;
|
|
96
|
-
}
|
|
97
|
-
(0, dist_1.appendLedgerRecord)(logsDir, record);
|
|
98
|
-
existingKeys.add(key);
|
|
99
|
-
migrated += 1;
|
|
100
|
-
}
|
|
101
|
-
let removed = 0;
|
|
102
|
-
if (options.clean) {
|
|
103
|
-
for (const doc of legacyDocs) {
|
|
104
|
-
if (!doc.filePath) {
|
|
105
|
-
continue;
|
|
106
|
-
}
|
|
107
|
-
if (fs.existsSync(doc.filePath)) {
|
|
108
|
-
fs.unlinkSync(doc.filePath);
|
|
109
|
-
removed += 1;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
logger.log(chalk_1.default.green('Ledger migration complete.'));
|
|
114
|
-
logger.log('');
|
|
115
|
-
logger.log(chalk_1.default.gray(` Migrated: ${migrated}`));
|
|
116
|
-
logger.log(chalk_1.default.gray(` Skipped: ${skipped}`));
|
|
117
|
-
logger.log(chalk_1.default.gray(` Removed: ${removed}`));
|
|
118
|
-
logger.log(chalk_1.default.gray(` Ledger: ${ledgerPath}`));
|
|
119
|
-
return {
|
|
120
|
-
success: true,
|
|
121
|
-
migrated,
|
|
122
|
-
skipped,
|
|
123
|
-
removed,
|
|
124
|
-
ledgerPath,
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
//# sourceMappingURL=migrate-ledger.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|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AAO,EAAE,IAAI;QACb,QAAQ;QACR,OAAO;QACP,OAAO;QACP,UAAU;KACX,CAAC;AACJ,CAAC"}
|
package/dist/commands/stats.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { type Logger } from '../utils/logger';
|
|
2
|
-
export interface StatsOptions {
|
|
3
|
-
file: string;
|
|
4
|
-
assignee?: string;
|
|
5
|
-
since?: string;
|
|
6
|
-
tag?: string;
|
|
7
|
-
}
|
|
8
|
-
export interface StatsResult {
|
|
9
|
-
success: true;
|
|
10
|
-
totalCompleted: number;
|
|
11
|
-
avgCycleTimeHours: number;
|
|
12
|
-
topAssignee?: string;
|
|
13
|
-
tagDistribution: Record<string, number>;
|
|
14
|
-
validationFailureRate: number;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Aggregate completion analytics from ledger data.
|
|
18
|
-
*/
|
|
19
|
-
export declare function statsCommand(options: StatsOptions, logger?: Logger): StatsResult;
|
|
20
|
-
//# sourceMappingURL=stats.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../src/commands/stats.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,MAAM,EAAiB,MAAM,iBAAiB,CAAC;AAM7D,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,IAAI,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,qBAAqB,EAAE,MAAM,CAAC;CAC/B;AA4FD;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,YAAY,EAAE,MAAM,GAAE,MAAsB,GAAG,WAAW,CAiC/F"}
|