Skip to content

Commit aff3476

Browse files
committed
chore: run prettier to fix formatting
1 parent 566d3ce commit aff3476

File tree

3 files changed

+19
-12
lines changed

3 files changed

+19
-12
lines changed

src/services/systemMessage.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,11 @@ export async function buildSystemMessage(
8484
// Read instruction sets
8585
const globalInstructions = await readInstructionSet(getSystemDirectory());
8686
const workspaceInstructions = await readInstructionSetFromRuntime(runtime, workspacePath);
87-
const contextInstructions = workspaceInstructions ?? (await readInstructionSet(metadata.projectPath));
87+
const contextInstructions =
88+
workspaceInstructions ?? (await readInstructionSet(metadata.projectPath));
8889

8990
// Combine: global + context (workspace takes precedence over project)
90-
const customInstructions = [globalInstructions, contextInstructions]
91-
.filter(Boolean)
92-
.join("\n\n");
91+
const customInstructions = [globalInstructions, contextInstructions].filter(Boolean).join("\n\n");
9392

9493
// Extract mode-specific section (context first, then global fallback)
9594
let modeContent: string | null = null;

src/utils/main/instructionFiles.test.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
import * as fs from "fs/promises";
22
import * as path from "path";
33
import * as os from "os";
4-
import {
5-
readInstructionSet,
6-
gatherInstructionSets,
7-
} from "./instructionFiles";
4+
import { readInstructionSet, gatherInstructionSets } from "./instructionFiles";
85

96
describe("instructionFiles", () => {
107
let tempDir: string;

src/utils/main/instructionFiles.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import * as path from "path";
33
import type { Runtime } from "@/runtime/Runtime";
44
import { readFileString } from "@/utils/runtime/helpers";
55

6-
76
/**
87
* Instruction file names to search for, in priority order.
98
* The first file found in a directory is used as the base instruction set.
@@ -105,10 +104,17 @@ async function readFileWithLocalVariant(
105104
* @param directory - Directory to search for instruction files
106105
* @returns Combined instruction content, or null if no base file exists
107106
*/
108-
export async function readInstructionSet(directory: string | null | undefined): Promise<string | null> {
107+
export async function readInstructionSet(
108+
directory: string | null | undefined
109+
): Promise<string | null> {
109110
if (!directory) return null;
110111
const reader = createLocalFileReader();
111-
return readFileWithLocalVariant(reader, path.resolve(directory), INSTRUCTION_FILE_NAMES, LOCAL_INSTRUCTION_FILENAME);
112+
return readFileWithLocalVariant(
113+
reader,
114+
path.resolve(directory),
115+
INSTRUCTION_FILE_NAMES,
116+
LOCAL_INSTRUCTION_FILENAME
117+
);
112118
}
113119

114120
/**
@@ -124,7 +130,12 @@ export async function readInstructionSetFromRuntime(
124130
directory: string
125131
): Promise<string | null> {
126132
const reader = createRuntimeFileReader(runtime);
127-
return readFileWithLocalVariant(reader, directory, INSTRUCTION_FILE_NAMES, LOCAL_INSTRUCTION_FILENAME);
133+
return readFileWithLocalVariant(
134+
reader,
135+
directory,
136+
INSTRUCTION_FILE_NAMES,
137+
LOCAL_INSTRUCTION_FILENAME
138+
);
128139
}
129140

130141
/**

0 commit comments

Comments
 (0)