aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/claude/index.ts
diff options
context:
space:
mode:
authorbndw <ben@bdw.to>2026-02-28 21:08:40 -0800
committerbndw <ben@bdw.to>2026-02-28 21:08:40 -0800
commit04c63d4ef601876186e5d7fab980d76575c494ec (patch)
tree2620784e148957ae2ee3af0327c2b128983577e7 /src/main/claude/index.ts
parent0da42e4fa414ab3268d4f71896455097239f8590 (diff)
feat: **1. `src/main/db/schema.ts`** — add `settings` table … (+10 more)
- ✅ **1. `src/main/db/schema.ts`** — add `settings` table to `initSchema` - ✅ **2. `src/main/db/settings.ts`** — create file with `getSetting`, `getSettings`, `setSetting`, `deleteSetting` - ✅ **3. `src/main/claude/phases.ts`** — add `customSystemPrompt?` param to `getPhaseConfig`; add `getDefaultSystemPromptTemplate` export - ✅ **4. `src/main/claude/index.ts`** — import `getSetting`; load custom prompt in `sendMessage`; pass to `getPhaseConfig` - ✅ **5. `src/main/ipc/handlers.ts`** — import `settingsDb` + `getDefaultSystemPromptTemplate`; register `settings:get`, `settings:set`, `settings:delete`, `settings:getDefaultPrompts` - ✅ **6. `src/main/preload.ts`** — add `getSettings`, `setSetting`, `deleteSetting`, `getDefaultSystemPrompts` to interface + api object - ✅ **7. `renderer/src/styles/globals.css`** — append all new CSS rules - ✅ **8. `renderer/src/components/settings/SystemPromptsSettings.tsx`** — create file (new directory) - ✅ **9. `renderer/src/components/SettingsPage.tsx`** — create file - ✅ **10. `renderer/src/components/Header.tsx`** — add `onOpenSettings` prop + ⚙ button - ✅ **11. `renderer/src/App.tsx`** — add `showSettings` state; import + render `<SettingsPage>`; pass `onOpenSettings` to Header
Diffstat (limited to 'src/main/claude/index.ts')
-rw-r--r--src/main/claude/index.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/claude/index.ts b/src/main/claude/index.ts
index 8971844..30a0f57 100644
--- a/src/main/claude/index.ts
+++ b/src/main/claude/index.ts
@@ -4,6 +4,7 @@ import { getPhaseConfig, getNextPhase, getArtifactFilename } from "./phases";
4import type { Phase, UserPermissionMode } from "./phases"; 4import type { Phase, UserPermissionMode } from "./phases";
5import { getProject } from "../db/projects"; 5import { getProject } from "../db/projects";
6import { updateSession } from "../db/sessions"; 6import { updateSession } from "../db/sessions";
7import { getSetting } from "../db/settings";
7import { autoCommitTurn } from "../git"; 8import { autoCommitTurn } from "../git";
8import fs from "node:fs"; 9import fs from "node:fs";
9import path from "node:path"; 10import path from "node:path";
@@ -44,10 +45,14 @@ export async function sendMessage({
44 const sessionDir = getSessionDir(project.path, session.id); 45 const sessionDir = getSessionDir(project.path, session.id);
45 ensureDir(sessionDir); 46 ensureDir(sessionDir);
46 47
48 // Load any custom system prompt for this phase (null → use default)
49 const customSystemPrompt = getSetting(`systemPrompt.${session.phase}`) ?? undefined;
50
47 const phaseConfig = getPhaseConfig( 51 const phaseConfig = getPhaseConfig(
48 session.phase as Phase, 52 session.phase as Phase,
49 sessionDir, 53 sessionDir,
50 session.permission_mode as UserPermissionMode 54 session.permission_mode as UserPermissionMode,
55 customSystemPrompt
51 ); 56 );
52 57
53 const q = query({ 58 const q = query({