@@ -18,9 +18,9 @@ export interface FileReference {
1818
1919/**
2020 * Converts diagnostic data into a CSV-formatted string.
21- * @param diagnostics - Array of diagnostic objects with severity, filename, range, code, and message.
22- * @param sep - Separator for CSV fields.
23- * @returns CSV string with each diagnostic entry on a new line.
21+ * @param diagnostics - Array of diagnostic objects containing severity, filename, range, code, and message.
22+ * @param sep - String used as the separator for CSV fields.
23+ * @returns CSV string with each diagnostic entry on a separate line.
2424 */
2525export function diagnosticsToCSV ( diagnostics : Diagnostic [ ] , sep : string ) {
2626 return diagnostics
@@ -39,10 +39,10 @@ export function diagnosticsToCSV(diagnostics: Diagnostic[], sep: string) {
3939}
4040
4141/**
42- * Determines the group name of a given template.
43- * @param template - The template object to evaluate.
44- * @returns Group name of the template, "system" if the ID starts with "system",
45- * or "unassigned" if no group is set .
42+ * Determines the group name of a template.
43+ * @param template - The template to evaluate, containing an ID and optional group .
44+ * @returns The group name of the template. Returns "system" if the ID starts with "system",
45+ * the existing group if set, or "unassigned" if no group is determined .
4646 */
4747export function templateGroup ( template : PromptScript ) {
4848 return (
@@ -57,9 +57,9 @@ export const eolPosition = 0x3fffffff // End of line position, a large constant
5757export const eofPosition : CharPosition = [ 0x3fffffff , 0 ] // End of file position, a tuple with a large constant
5858
5959/**
60- * Organizes templates by directory and identifies the presence of JS or TS files in each directory.
61- * @param prj - The project containing the scripts to process .
62- * @returns An array of objects, each representing a directory with its name and boolean flags for JS and TS file presence .
60+ * Organizes templates by directory and determines the presence of JavaScript or TypeScript files in each directory.
61+ * @param prj - The project containing the scripts to analyze .
62+ * @returns An array of objects, each representing a directory with its name and flags indicating the presence of JavaScript and TypeScript files .
6363 */
6464export function collectFolders ( prj : Project ) {
6565 const folders : Record <
@@ -80,9 +80,9 @@ export function collectFolders(prj: Project) {
8080
8181/**
8282 * Retrieves a script by its ID from the project's scripts list.
83- * @param prj - The project containing the scripts.
84- * @param system - The system prompt instance with the script ID to find .
85- * @returns The matching PromptScript or undefined if no match is found.
83+ * @param prj - The project containing the scripts to search .
84+ * @param system - The system prompt instance containing the script ID to match .
85+ * @returns The matching script or undefined if no match is found.
8686 */
8787export function resolveScript ( prj : Project , system : SystemPromptInstance ) {
8888 return prj ?. scripts ?. find ( ( t ) => t . id == system . id ) // Find and return the template with the matching ID
0 commit comments