@gitsense/gsc-utils 0.2.20 → 0.2.23
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 +432 -0
- package/dist/gsc-utils.cjs.js +229 -11
- package/dist/gsc-utils.esm.js +229 -11
- package/package.json +1 -1
- package/src/ContextUtils.js +23 -5
- package/src/DateUtils.js +113 -0
- package/src/FormatterUtils.js +55 -0
- package/src/GitSenseChatUtils.js +33 -4
- package/src/MessageUtils.js +1 -1
- package/src/PatchUtils/patchProcessor.js +4 -2
|
@@ -283,7 +283,9 @@ function createPatchFromCodeBlocks(CodeBlockUtils, sourceCodeBlockText, targetCo
|
|
|
283
283
|
const targetContent = targetContentTemp.join('\n\n');
|
|
284
284
|
|
|
285
285
|
// Get the number of lines in the header + two blank lines
|
|
286
|
-
|
|
286
|
+
// Note, before the code block header format was solidified, we use to include 'Updated-at' but no more so
|
|
287
|
+
// we need to filter it out from the source header
|
|
288
|
+
const sourceHeaderLineCount = sourceHeaderText.split('\n').filter(line => !line.includes('Updated-at')).length;
|
|
287
289
|
const targetHeaderLineCount = targetHeaderText.split('\n').length;
|
|
288
290
|
|
|
289
291
|
// To keep things simple we are going to require the source and target header line count to be the same.
|
|
@@ -291,7 +293,7 @@ function createPatchFromCodeBlocks(CodeBlockUtils, sourceCodeBlockText, targetCo
|
|
|
291
293
|
if (sourceHeaderLineCount !== targetHeaderLineCount) {
|
|
292
294
|
// Some LLMs will not generate a Parent-UUID for the first version so we won't make this
|
|
293
295
|
// fatal if the sourceHeader does not have a Parent-UUID
|
|
294
|
-
if (
|
|
296
|
+
if (sourceHeaderText.includes('Parent-UUID')) {
|
|
295
297
|
throw new Error('Source and target header line count must be the same');
|
|
296
298
|
}
|
|
297
299
|
}
|