-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
103 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,24 @@ | ||
export function joinStringsUntilMaxLength( | ||
parsedFiles: string[], | ||
maxLength: number | ||
): string { | ||
let combinedString = "" | ||
) { | ||
let codeDiff = "" | ||
let currentLength = 0 | ||
let maxLengthExceeded = false | ||
|
||
for (const file of parsedFiles) { | ||
const fileLength = file.length | ||
|
||
if (currentLength + fileLength <= maxLength) { | ||
combinedString += file | ||
codeDiff += file | ||
currentLength += fileLength | ||
} else { | ||
maxLengthExceeded = true | ||
const remainingLength = maxLength - currentLength | ||
combinedString += file.slice(0, remainingLength) | ||
codeDiff += file.slice(0, remainingLength) | ||
break | ||
} | ||
} | ||
|
||
return combinedString | ||
return { codeDiff, maxLengthExceeded } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,5 @@ | ||
import envConstants from "constants.json" | ||
|
||
type Addresses = {} | ||
type Constants = {} | ||
|
||
export const constants: Constants = envConstants.values | ||
|
||
export const addresses: Addresses = | ||
envConstants.addresses[process.env.NEXT_PUBLIC_CHAIN_ID] | ||
|
||
export default constants | ||
export const startDescription = "\n\n<!-- start pr-codex -->" | ||
export const endDescription = "<!-- end pr-codex -->" | ||
export const codexCommand = "/codex " | ||
export const maxChanges = 1000 | ||
export const maxCodeDiff = 11500 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters