summaryrefslogtreecommitdiffhomepage
path: root/packages/frontend/src/lib/components/SystemPromptPanel.svelte
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-05-22 15:24:13 +0900
committerAdam Malczewski <[email protected]>2026-05-22 15:24:13 +0900
commit9ecaabd87c0e51b8a7408dabb0133a9344586859 (patch)
tree4b5809ab23948a5e3f558f3aa34c52d5038f4e19 /packages/frontend/src/lib/components/SystemPromptPanel.svelte
parent8f1dd855f0c4c877bff8d3a4ba193432b268b1c2 (diff)
downloaddispatch-9ecaabd87c0e51b8a7408dabb0133a9344586859.tar.gz
dispatch-9ecaabd87c0e51b8a7408dabb0133a9344586859.zip
feat: agent builder, CWD support, auto-save, UI polish, unavailable tool handling
- Agent Builder: full CRUD with card grid, drag-and-drop model reorder, edit/delete - Auto-save on edit with 600ms debounce, AbortController for concurrency, fieldset disabled until name entered - Agent definitions stored as TOML with cwd field, loaded from global/project dirs - Working directory: per-tab CWD override in Chat Settings, agent default CWD, auto-create on first message - CWD validation: check-dir endpoint with ~ expansion, real-time validity indicator - Subagent CWD validated against parent's effective CWD using path.relative - Unavailable tool calls: caught gracefully, shown as tool call with error badge, model retries - UI: tab bar border radius, sidebar border removed, chat input ghost style, scroll-to-bottom rectangle - Skills dir collapse uses CSS rotation, Model Choice renamed to Chat Settings, System Prompt view removed - Reusable SkillsBrowser/ToolPermissions with external mode for Agent Builder - ModelSelector: Agent/Manual toggle, agent list, Agent Settings link - Page router, skills recursive scanning, bin/up gopass removed, docker volume mounts
Diffstat (limited to 'packages/frontend/src/lib/components/SystemPromptPanel.svelte')
-rw-r--r--packages/frontend/src/lib/components/SystemPromptPanel.svelte66
1 files changed, 33 insertions, 33 deletions
diff --git a/packages/frontend/src/lib/components/SystemPromptPanel.svelte b/packages/frontend/src/lib/components/SystemPromptPanel.svelte
index 6b91ebe..d9039f4 100644
--- a/packages/frontend/src/lib/components/SystemPromptPanel.svelte
+++ b/packages/frontend/src/lib/components/SystemPromptPanel.svelte
@@ -1,42 +1,42 @@
<script lang="ts">
- import { onMount } from "svelte";
- import { appSettings } from "../settings.svelte.js";
-
- const {
- apiBase = "",
- }: {
- apiBase?: string;
- } = $props();
-
- const DEFAULT_PROMPT = "You are Dispatch, a helpful AI coding assistant. Be concise and helpful.";
-
- async function loadPrompt(): Promise<void> {
- try {
- const res = await fetch(`${apiBase}/tabs/settings/system_prompt`);
- if (res.ok) {
- const data = await res.json() as { value: string | null };
- const value = data.value ?? DEFAULT_PROMPT;
- appSettings.systemPrompt = value;
- appSettings.savedSystemPrompt = value;
- }
- } catch {
- // ignore
+import { onMount } from "svelte";
+import { appSettings } from "../settings.svelte.js";
+
+const {
+ apiBase = "",
+}: {
+ apiBase?: string;
+} = $props();
+
+const DEFAULT_PROMPT = "You are Dispatch, a helpful AI coding assistant. Be concise and helpful.";
+
+async function loadPrompt(): Promise<void> {
+ try {
+ const res = await fetch(`${apiBase}/tabs/settings/system_prompt`);
+ if (res.ok) {
+ const data = (await res.json()) as { value: string | null };
+ const value = data.value ?? DEFAULT_PROMPT;
+ appSettings.systemPrompt = value;
+ appSettings.savedSystemPrompt = value;
}
+ } catch {
+ // ignore
}
+}
- function resetPrompt(): void {
- appSettings.systemPrompt = appSettings.savedSystemPrompt;
- }
+function resetPrompt(): void {
+ appSettings.systemPrompt = appSettings.savedSystemPrompt;
+}
- const isDirty = $derived(appSettings.systemPrompt !== appSettings.savedSystemPrompt);
+const isDirty = $derived(appSettings.systemPrompt !== appSettings.savedSystemPrompt);
- onMount(() => {
- if (!appSettings.systemPrompt) {
- appSettings.systemPrompt = DEFAULT_PROMPT;
- appSettings.savedSystemPrompt = DEFAULT_PROMPT;
- }
- loadPrompt();
- });
+onMount(() => {
+ if (!appSettings.systemPrompt) {
+ appSettings.systemPrompt = DEFAULT_PROMPT;
+ appSettings.savedSystemPrompt = DEFAULT_PROMPT;
+ }
+ loadPrompt();
+});
</script>
<div class="flex flex-col gap-3 flex-1 min-h-0">