Skip to content

graff — a fast agentic coding harness in Zig: multi-provider, MCP, workflows, DGM evolution loop, TS/Python SDKs

Python

feat(gui): Goal chip + Ultra (ultracode) toggle in the composer

Rach Pradhan61058ee3b83d
diff --git a/gui/src-tauri/src/dto/session.rs b/gui/src-tauri/src/dto/session.rs
index 89eae100..a4bcc19d 100644
--- a/gui/src-tauri/src/dto/session.rs
+++ b/gui/src-tauri/src/dto/session.rs
@@ -127,6 +127,11 @@ pub struct ConversationViewSnapshotDto {
pub active_request_ids: Vec<String>,
pub request_agent_ids: HashMap<String, String>,
pub todos: Vec<SessionTodoDto>,
+ /// Steering objective for this chat, set via `/goal`. Surfaced in the UI as
+ /// the goal chip above the composer. Omitted from the payload when unset.
+ #[serde(skip_serializing_if = "Option::is_none")]
+ #[ts(optional)]
+ pub goal: Option<String>,
pub followup: Option<super::followup::FollowupRequestDto>,
}
@@ -180,6 +185,12 @@ pub struct SessionSnapshotDto {
pub visible_active_request_ids: Vec<String>,
pub visible_request_agent_ids: HashMap<String, String>,
pub visible_todos: Vec<SessionTodoDto>,
+ /// Steering objective of the active chat, set via `/goal`. Mirrors
+ /// `ConversationViewSnapshotDto::goal` for the visible conversation. Omitted
+ /// from the payload when no goal is set.
+ #[serde(skip_serializing_if = "Option::is_none")]
+ #[ts(optional)]
+ pub visible_goal: Option<String>,
pub visible_followup: Option<super::followup::FollowupRequestDto>,
pub conversation_views: Vec<ConversationViewSnapshotDto>,
pub ui_error: Option<String>,
diff --git a/gui/src-tauri/src/runtime/simple.rs b/gui/src-tauri/src/runtime/simple.rs
index 086de27e..f4613ee8 100644
--- a/gui/src-tauri/src/runtime/simple.rs
+++ b/gui/src-tauri/src/runtime/simple.rs
@@ -2125,6 +2125,7 @@ impl RuntimeManager {
.as_ref()
.map(|c| c.todos.clone())
.unwrap_or_default(),
+ visible_goal: visible.as_ref().and_then(|c| c.goal.clone()),
visible_followup,
conversation_views,
ui_error: None,
@@ -2456,6 +2457,7 @@ fn conversation_view(
active_request_ids: conversation.active_request_ids.clone(),
request_agent_ids: conversation.request_agent_ids.clone(),
todos: conversation.todos.clone(),
+ goal: conversation.goal.clone(),
followup,
}
}
diff --git a/gui/src/app/sessionStore.test.ts b/gui/src/app/sessionStore.test.ts
index 56fdbbfb..53c7d7c7 100644
--- a/gui/src/app/sessionStore.test.ts
+++ b/gui/src/app/sessionStore.test.ts
@@ -260,11 +260,13 @@ describe("sessionStore", () => {
expect(getPromptDraftState(sourceKey)).toEqual({
isPending: false,
isPlanningMode: false,
+ isUltraMode: false,
value: "",
});
expect(getPromptDraftState(destinationKey)).toEqual({
isPending: false,
isPlanningMode: true,
+ isUltraMode: false,
value: "ship it",
});
@@ -273,6 +275,7 @@ describe("sessionStore", () => {
expect(getPromptDraftState(destinationKey)).toEqual({
isPending: false,
isPlanningMode: true,
+ isUltraMode: false,
value: "",
});
@@ -281,6 +284,7 @@ describe("sessionStore", () => {
expect(getPromptDraftState(destinationKey)).toEqual({
isPending: false,
isPlanningMode: false,
+ isUltraMode: false,
value: "",
});
expect(sessionStore.getState().promptDraftsByKey[destinationKey]).toBeUndefined();
diff --git a/gui/src/app/sessionStore.ts b/gui/src/app/sessionStore.ts
index e5cc941f..c218e4a9 100644
--- a/gui/src/app/sessionStore.ts
+++ b/gui/src/app/sessionStore.ts
@@ -68,7 +68,11 @@ function writePromptDraftEntry(
): Record<string, PromptDraftEntry> {
const current = drafts[key] ?? null;
const nextEntry =
- entry == null || (entry.value === "" && !entry.isPending && !entry.isPlanningMode)
+ entry == null ||
+ (entry.value === "" &&
+ !entry.isPending &&
+ !entry.isPlanningMode &&
+ !entry.isUltraMode)
? null
: entry;
@@ -81,7 +85,8 @@ function writePromptDraftEntry(
delete nextDrafts[key];
return nextDrafts;
}
-
+ current?.isPlanningMode === nextEntry.isPlanningMode &&
+ current?.isUltraMode === nextEntry.isUltraMode
if (
current?.value === nextEntry.value &&
current?.isPending === nextEntry.isPending &&
@@ -104,6 +109,7 @@ function setPromptDraftEntryValue(
const current = getConversationDraftEntry(drafts, key) ?? {
isPending: false,
isPlanningMode: false,
+ isUltraMode: false,
value: "",
};
@@ -118,6 +124,7 @@ function setPromptDraftEntryPending(
const current = getConversationDraftEntry(drafts, key) ?? {
isPending: false,
isPlanningMode: false,
+ isUltraMode: false,
value: "",
};
@@ -132,12 +139,28 @@ function setPromptDraftEntryPlanningMode(
const current = getConversationDraftEntry(drafts, key) ?? {
isPending: false,
isPlanningMode: false,
+ isUltraMode: false,
value: "",
};
return writePromptDraftEntry(drafts, key, { ...current, isPlanningMode });
}
+function setPromptDraftEntryUltraMode(
+ drafts: Record<string, PromptDraftEntry>,
+ key: string,
+ isUltraMode: boolean,
+): Record<string, PromptDraftEntry> {
+ const current = getConversationDraftEntry(drafts, key) ?? {
+ isPending: false,
+ isPlanningMode: false,
+ isUltraMode: false,
+ value: "",
+ };
+
+ return writePromptDraftEntry(drafts, key, { ...current, isUltraMode });
+}
+
function movePromptDraftEntry(
drafts: Record<string, PromptDraftEntry>,
fromKey: string | null,
@@ -570,6 +593,19 @@ function createSessionStoreState(set: SessionStoreSetter): SessionStoreState {
),
}));
},
+ setPromptDraftUltraMode: (key, isUltraMode) => {
+ if (key == null) {
+ return;
+ }
+
+ set((current) => ({
+ promptDraftsByKey: setPromptDraftEntryUltraMode(
+ current.promptDraftsByKey,
+ key,
+ isUltraMode,
+ ),
+ }));
+ },
setPromptDraftValue: (key, value) => {
if (key == null) {
return;
@@ -677,6 +713,7 @@ export function getPromptDraftState(promptDraftKey: string | null) {
return {
isPending: false,
isPlanningMode: false,
+ isUltraMode: false,
value: "",
};
}
@@ -685,6 +722,7 @@ export function getPromptDraftState(promptDraftKey: string | null) {
sessionStore.getState().promptDraftsByKey[promptDraftKey] ?? {
isPending: false,
isPlanningMode: false,
+ isUltraMode: false,
value: "",
}
);
diff --git a/gui/src/app/types/sessionStore.ts b/gui/src/app/types/sessionStore.ts
index 3052e616..792de3bd 100644
--- a/gui/src/app/types/sessionStore.ts
+++ b/gui/src/app/types/sessionStore.ts
@@ -20,6 +20,12 @@ import type {
export interface PromptDraftEntry {
isPending: boolean;
isPlanningMode: boolean;
+ /**
+ * Per-turn opt-in to the harness `ultracode` codeword (multi-agent workflow
+ * mode). The codeword is injected into the outgoing message text at submit,
+ * then this flag is reset to false.
+ */
+ isUltraMode: boolean;
value: string;
}
@@ -64,6 +70,7 @@ export interface SessionStoreState {
key: string | null,
isPlanningMode: boolean,
) => void;
+ setPromptDraftUltraMode: (key: string | null, isUltraMode: boolean) => void;
setPromptDraftValue: (key: string | null, value: string) => void;
setWorkspacePromptSettings: (
workspacePath: string | null,
diff --git a/gui/src/components/GoalChip.tsx b/gui/src/components/GoalChip.tsx
new file mode 100644
index 00000000..9fc4746c
--- /dev/null
+++ b/gui/src/components/GoalChip.tsx
@@ -0,0 +1,124 @@
+import { useEffect, useRef, useState, type KeyboardEvent } from "react";
+import { TargetIcon, XIcon } from "lucide-react";
+
+import { Button } from "@/components/ui/Button";
+import { Input } from "@/components/ui/Input";
+import { cn } from "@/utils/cn";
+
+interface GoalChipProps {
+ /** The active steering objective, or null when no goal is set. */
+ goal: string | null;
+ /** Set/replace the goal (routes through `/goal <text>`). */
+ onEdit: (goal: string) => void;
+ /** Clear the goal (routes through `/goal clear`). */
+ onClear: () => void;
+ className?: string;
+}
+
+/**
+ * Surfaces the conversation's `/goal` steering objective as a small accent
+ * pill above the composer. The backend already augments every prompt with the
+ * goal; this just makes it visible and editable. Renders nothing when unset.
+ *
+ * - Click the text to edit inline (Enter saves, Escape cancels).
+ * - The ✕ clears the goal.
+ */
+export function GoalChip({ goal, onEdit, onClear, className }: GoalChipProps) {
+ const [isEditing, setIsEditing] = useState(false);
+ const [draft, setDraft] = useState("");
+ const inputRef = useRef<HTMLInputElement | null>(null);
+
+ useEffect(() => {
+ if (isEditing) {
+ inputRef.current?.focus();
+ inputRef.current?.select();
+ }
+ }, [isEditing]);
+
+ if (goal == null || goal.trim().length === 0) {
+ return null;
+ }
+
+ function beginEdit() {
+ setDraft(goal ?? "");
+ setIsEditing(true);
+ }
+
+ function commitEdit() {
+ const next = draft.trim();
+ setIsEditing(false);
+ if (next.length === 0) {
+ // Emptying the field clears the goal rather than setting an empty one.
+ onClear();
+ return;
+ }
+ if (next !== goal) {
+ onEdit(next);
+ }
+ }
+
+ function cancelEdit() {
+ setIsEditing(false);
+ setDraft("");
+ }
+
+ function handleKeyDown(event: KeyboardEvent<HTMLInputElement>) {
+ if (event.key === "Enter") {
+ event.preventDefault();
+ commitEdit();
+ return;
+ }
+ if (event.key === "Escape") {
+ event.preventDefault();
+ cancelEdit();
+ }
+ }
+
+ return (
+ <div
+ className={cn(
+ "mx-auto mb-2 flex w-full max-w-3xl items-center gap-1.5 rounded-full border border-[color:color-mix(in_oklab,var(--accent)_30%,transparent)] bg-[color:color-mix(in_oklab,var(--accent)_8%,transparent)] py-1 pr-1 pl-2.5 text-xs",
+ className,
+ )}
+ >
+ <TargetIcon
+ className="size-3.5 shrink-0 text-[color:var(--accent)]"
+ aria-hidden
+ />
+ <span className="shrink-0 font-medium text-[color:var(--accent)]">
+ Goal
+ </span>
+ {isEditing ? (
+ <Input
+ ref={inputRef}
+ value={draft}
+ onChange={(event) => setDraft(event.target.value)}
+ onKeyDown={handleKeyDown}
+ onBlur={commitEdit}
+ aria-label="Edit goal"
+ className="h-6 min-w-0 flex-1 rounded-sm border-[color:color-mix(in_oklab,var(--accent)_30%,transparent)] bg-transparent px-1.5 text-xs dark:bg-transparent"
+ />
+ ) : (
+ <button
+ type="button"
+ onClick={beginEdit}
+ title={`${goal}\n\nClick to edit · future turns in this chat are steered toward this goal`}
+ className="min-w-0 flex-1 truncate text-left text-foreground/90 hover:text-foreground"
+ >
+ {goal}
+ </button>
+ )}
+ <Button
+ type="button"
+ variant="ghost"
+ size="icon-sm"
+ aria-label="Clear goal"
+ title="Clear goal"
+ className="shrink-0 rounded-full text-muted-foreground hover:text-foreground"
+ onClick={onClear}
+ >
+ <XIcon />
+ </Button>
+ </div>
+ );
+}
diff --git a/gui/src/components/PromptComposer.tsx b/gui/src/components/PromptComposer.tsx
index 142aa8c9..2a2993da 100644
--- a/gui/src/components/PromptComposer.tsx
+++ b/gui/src/components/PromptComposer.tsx
@@ -5,6 +5,7 @@ import { usePrompt } from "../hooks/usePrompt";
import { useCommandRouter } from "../hooks/useCommandRouter";
import { CommandResultDialog } from "./CommandResultDialog";
import { FollowupComposer } from "./FollowupComposer";
+import { GoalChip } from "./GoalChip";
import { PromptActionAlert } from "./PromptActionAlert";
import { PromptInputCard } from "./PromptInputCard";
import { InterruptContinuePrompt } from "./conversation-panel/InterruptContinuePrompt";
@@ -26,15 +27,18 @@ export function PromptComposer({ binding, onCommandResult }: PromptComposerProps
isPlanningMode,
isRequestActive,
isSendingPrompt,
+ isUltraMode,
promptSettings,
promptDraft,
setPlanningMode,
setPromptDraft,
+ setUltraMode,
stopPrompt,
submitPrompt,
updatePromptSettings,
} = usePrompt(binding);
- const { messages, requestAgentIds, todos } = useConversationSession(binding);
+ const { goal, messages, requestAgentIds, todos } =
+ useConversationSession(binding);
const { openProviderSettings } = useSettingsNavigation();
const [dismissedInterruptId, setDismissedInterruptId] = useState<string | null>(
null,
@@ -73,6 +77,39 @@ export function PromptComposer({ binding, onCommandResult }: PromptComposerProps
await submitPrompt();
}, [promptDraft, submitPrompt, trySubmitAsCommand]);
+ // The goal chip mutates `/goal` directly (set/clear). The backend persists
+ // it on the conversation and returns a fresh snapshot, which we apply so the
+ // chip reflects the new state without a round-trip through the composer draft.
+ const runGoalCommand = useCallback(
+ (args: string[]) => {
+ if (workspacePath == null || binding == null) {
+ return;
+ }
+ void desktopClient
+ .runSlashCommand({
+ name: "goal",
+ args,
+ workspacePath,
+ conversationId: binding.conversationId,
+ })
+ .then((result) => {
+ if (result.snapshot != null) {
+ sessionStore.getState().applySessionSnapshot(result.snapshot);
+ }
+ })
+ .catch(() => null);
+ },
+ [binding, workspacePath],
+ );
+ const handleGoalEdit = useCallback(
+ (next: string) => runGoalCommand([next]),
+ [runGoalCommand],
+ );
+ const handleGoalClear = useCallback(
+ () => runGoalCommand(["clear"]),
+ [runGoalCommand],
+ );
+
const handleApproveWorkflow = useCallback(
async (prompt: string) => {
// Saved-workspace/new-chat composers do not have a persisted chat binding
@@ -163,11 +200,17 @@ export function PromptComposer({ binding, onCommandResult }: PromptComposerProps
onAction={openProviderSettings}
/>
) : null}
+ <GoalChip
+ goal={goal}
+ onEdit={handleGoalEdit}
+ onClear={handleGoalClear}
+ />
<PromptInputCard
canCompose={canCompose}
isRequestActive={isRequestActive}
isSendingPrompt={isSendingPrompt}
isPlanningMode={isPlanningMode}
+ isUltraMode={isUltraMode}
promptSettings={promptSettings}
promptDraft={promptDraft}
promptHistory={promptHistory}
@@ -176,6 +219,7 @@ export function PromptComposer({ binding, onCommandResult }: PromptComposerProps
workspacePath={workspacePath}
onCommandSelect={handleCommandSelect}
setPlanningMode={setPlanningMode}
+ setUltraMode={setUltraMode}
setPromptDraft={setPromptDraft}
stopPrompt={stopPrompt}
submitPrompt={handleSubmit}
diff --git a/gui/src/components/PromptInputCard.test.tsx b/gui/src/components/PromptInputCard.test.tsx
index dcf7142b..649cefa9 100644
--- a/gui/src/components/PromptInputCard.test.tsx
+++ b/gui/src/components/PromptInputCard.test.tsx
@@ -37,12 +37,14 @@ function renderPromptInputCard(
<PromptInputCard
canCompose
isPlanningMode={false}
+ isUltraMode={false}
isRequestActive={false}
isSendingPrompt={false}
onCommandSelect={(_: CommandDescriptor) => {}}
promptDraft="Describe this repo"
promptSettings={promptSettings}
setPlanningMode={() => {}}
+ setUltraMode={() => {}}
setPromptDraft={() => {}}
stopPrompt={async () => {}}
submitPrompt={async () => {}}
diff --git a/gui/src/components/PromptInputCard.tsx b/gui/src/components/PromptInputCard.tsx
index 09fe32da..057bd258 100644
--- a/gui/src/components/PromptInputCard.tsx
+++ b/gui/src/components/PromptInputCard.tsx
@@ -3,6 +3,7 @@ import {
ArrowUpIcon,
ChevronDownIcon,
MapIcon,
+ SparklesIcon,
SquareIcon,
ZapIcon,
} from "lucide-react";
@@ -64,6 +65,7 @@ export function PromptInputCard({
isRequestActive,
isSendingPrompt,
isPlanningMode,
+ isUltraMode,
placeholder = "Ask about this workspace…",
promptSettings,
promptDraft,
@@ -74,6 +76,7 @@ export function PromptInputCard({
workspacePath,
onCommandSelect,
setPlanningMode,
+ setUltraMode,
setPromptDraft,
stopPrompt,
submitPrompt,
@@ -339,6 +342,7 @@ export function PromptInputCard({
"relative gap-0 rounded-2xl border border-foreground/5 bg-background/50 p-2 transition-colors transition-shadow ring-0",
isPlanningMode &&
"border-[color:var(--accent)] ring-5 ring-[color:color-mix(in_oklab,var(--accent)_14%,transparent)] border-dashed",
+ isUltraMode && "cg-ultra-shine border-transparent",
)}
>
<CardHeader className="sr-only">
@@ -374,7 +378,13 @@ export function PromptInputCard({
commandMatch &&
"text-transparent caret-[color:var(--foreground)]",
)}
- placeholder={isWorking ? "Queue a follow-up…" : placeholder}
+ placeholder={
+ isWorking
+ ? "Queue a follow-up…"
+ : isUltraMode
+ ? "Describe the job — Ultra fans out parallel agents"
+ : placeholder
+ }
value={promptDraft}
onChange={(event) => handleDraftChange(event.target.value)}
onPaste={handlePaste}
@@ -561,6 +571,27 @@ export function PromptInputCard({
<ZapIcon data-icon="inline-start" />
<span className="text-xs">Fast</span>
</Button>
+ <Button
+ type="button"
+ variant="outline"
+ size="sm"
+ aria-label="Toggle Ultra mode"
+ aria-pressed={isUltraMode}
+ className={cn(
+ "text-muted-foreground hover:bg-transparent hover:text-foreground",
+ isUltraMode &&
+ "border-[color:var(--accent)] bg-[color:color-mix(in_oklab,var(--accent)_12%,transparent)] text-foreground shadow-[0_0_12px_-3px_color-mix(in_oklab,var(--accent)_75%,transparent)] hover:bg-[color:color-mix(in_oklab,var(--accent)_16%,transparent)]",
+ )}
+ disabled={isControlDisabled}
+ onClick={() => setUltraMode(!isUltraMode)}
+ title="Ultra — engage the ultracode codeword: fan out parallel agents for this turn"
+ >
+ <SparklesIcon
+ data-icon="inline-start"
+ className={cn(isUltraMode && "text-[color:var(--accent)]")}
+ />
+ <span className="text-xs">Ultra</span>
+ </Button>
{isPlanningMode ? (
<span
className="inline-flex h-8 items-center gap-2 px-1.5 text-xs font-medium text-muted-foreground"
@@ -577,7 +608,11 @@ export function PromptInputCard({
<Button
type="button"
size="icon-lg"
- className="rounded-full"
+ className={cn(
+ "rounded-full transition-shadow",
+ isUltraMode &&
+ "shadow-[0_0_18px_-2px_color-mix(in_oklab,var(--accent)_70%,transparent)] ring-2 ring-[color:color-mix(in_oklab,var(--accent)_45%,transparent)]",
+ )}
aria-label={isWorking && isSubmitDisabled ? "Stop" : "Send"}
onClick={handlePrimaryAction}
disabled={isWorking ? false : isSubmitDisabled}
diff --git a/gui/src/components/new-chat-screen/NewChatPromptSection.tsx b/gui/src/components/new-chat-screen/NewChatPromptSection.tsx
index 45bf2085..164f1b6c 100644
--- a/gui/src/components/new-chat-screen/NewChatPromptSection.tsx
+++ b/gui/src/components/new-chat-screen/NewChatPromptSection.tsx
@@ -39,10 +39,12 @@ export function NewChatPromptSection({
isPlanningMode,
isRequestActive,
isSendingPrompt,
+ isUltraMode,
promptSettings,
promptDraft,
setPlanningMode,
setPromptDraft,
+ setUltraMode,
stopPrompt,
submitPrompt,
updatePromptSettings,
@@ -133,6 +135,7 @@ export function NewChatPromptSection({
: "Ask anything…"
}
isPlanningMode={isPlanningMode}
+ isUltraMode={isUltraMode}
promptDraft={promptDraft}
promptHistory={promptHistory}
promptSettings={promptSettings}
@@ -141,6 +144,7 @@ export function NewChatPromptSection({
workspacePath={workspacePath}
onCommandSelect={handleCommandSelect}
setPlanningMode={setPlanningMode}
+ setUltraMode={setUltraMode}
setPromptDraft={setPromptDraft}
stopPrompt={stopPrompt}
submitPrompt={handleSubmit}
diff --git a/gui/src/components/types/prompt.ts b/gui/src/components/types/prompt.ts
index bfbfe825..305ead73 100644
--- a/gui/src/components/types/prompt.ts
+++ b/gui/src/components/types/prompt.ts
@@ -30,6 +30,7 @@ export interface PromptInputCardProps {
isRequestActive: boolean;
isSendingPrompt: boolean;
isPlanningMode: boolean;
+ isUltraMode: boolean;
placeholder?: string;
promptSettings: PromptSettings | null;
promptDraft: string;
@@ -40,6 +41,7 @@ export interface PromptInputCardProps {
workspacePath?: string | null;
onCommandSelect: (command: CommandDescriptor) => void;
setPlanningMode: (value: boolean) => void;
+ setUltraMode: (value: boolean) => void;
setPromptDraft: (value: string) => void;
stopPrompt: () => Promise<void>;
submitPrompt: () => Promise<void>;
diff --git a/gui/src/hooks/useConversationActions.ts b/gui/src/hooks/useConversationActions.ts
index 263053e7..87b95564 100644
--- a/gui/src/hooks/useConversationActions.ts
+++ b/gui/src/hooks/useConversationActions.ts
@@ -101,12 +101,23 @@ export function useConversationActions(binding?: ChatBinding | null) {
}
const attachments = getAttachments(promptDraftKey);
- const prompt = appendAttachmentsToPrompt(trimmedPrompt, attachments);
+ let prompt = appendAttachmentsToPrompt(trimmedPrompt, attachments);
+
+ // Ultra mode: inject the `ultracode` codeword the harness watches for
+ // (case-insensitive substring → multi-agent workflow turn). Skip it if
+ // the user already typed it. The toggle is a per-turn opt-in, so it is
+ // reset below once the prompt has been captured.
+ if (draftState.isUltraMode && !/ultracode/i.test(prompt)) {
+ prompt = `${prompt}\n\nultracode`;
+ }
// Clear the composer immediately on send so the draft + any attachment
// don't linger in the bar while the turn runs (the prompt is already
- // captured above).
+ // captured above). Reset Ultra explicitly: clearing only blanks the
+ // value, which on its own would leave the Ultra flag (and the lit
+ // toggle) stuck on for the next turn.
sessionStore.getState().clearPromptDraft(promptDraftKey);
+ sessionStore.getState().setPromptDraftUltraMode(promptDraftKey, false);
sessionStore.getState().clearAttachments(promptDraftKey);
sessionStore.getState().setPromptDraftPending(promptDraftKey, true);
try {
diff --git a/gui/src/hooks/useSession.ts b/gui/src/hooks/useSession.ts
index dfc1842a..c5e9029d 100644
--- a/gui/src/hooks/useSession.ts
+++ b/gui/src/hooks/useSession.ts
@@ -224,6 +224,7 @@ export function useConversationSession(binding?: ChatBinding | null) {
meta.runtimeStatus,
),
followupRequest: currentView?.followup ?? null,
+ goal: currentView?.goal ?? null,
hasCurrentWorkspace: currentWorkspacePath != null,
// An existing conversation is selected but its view (messages) has not
// streamed in yet. Used to show a loading placeholder instead of
@@ -303,6 +304,12 @@ export function usePromptDraft(binding?: ChatBinding | null) {
},
[promptDraftKey],
);
+ const setUltraMode = useCallback(
+ (value: boolean) => {
+ sessionStore.getState().setPromptDraftUltraMode(promptDraftKey, value);
+ },
+ [promptDraftKey],
+ );
const draftState = useSessionStore(
useShallow((state) => {
@@ -335,6 +342,7 @@ export function usePromptDraft(binding?: ChatBinding | null) {
!isConversationRunning,
followupRequest,
isPlanningMode: draftEntry?.isPlanningMode ?? false,
+ isUltraMode: draftEntry?.isUltraMode ?? false,
isSendingPrompt: draftEntry?.isPending ?? false,
promptDraft: draftEntry?.value ?? "",
promptSettings: meta.promptSettings,
@@ -347,7 +355,8 @@ export function usePromptDraft(binding?: ChatBinding | null) {
...draftState,
setPlanningMode,
setPromptDraft,
+ setUltraMode,
}),
- [draftState, setPlanningMode, setPromptDraft],
+ [draftState, setPlanningMode, setPromptDraft, setUltraMode],
);
}
diff --git a/gui/src/services/desktop/types/contracts.generated.ts b/gui/src/services/desktop/types/contracts.generated.ts
index fd8b9d51..e1cebb22 100644
--- a/gui/src/services/desktop/types/contracts.generated.ts
+++ b/gui/src/services/desktop/types/contracts.generated.ts
@@ -29,7 +29,12 @@ export type ConversationSessionSummary = { conversationId: string, title: string
export type ChatBinding = { workspacePath: string, conversationId: string, };
-export type ConversationViewSnapshot = { workspacePath: string, conversationId: string, messages: Array<SessionMessage>, activeRequestIds: Array<string>, requestAgentIds: { [key in string]: string }, todos: Array<SessionTodo>, followup: FollowupRequest | null, };
+export type ConversationViewSnapshot = { workspacePath: string, conversationId: string, messages: Array<SessionMessage>, activeRequestIds: Array<string>, requestAgentIds: { [key in string]: string }, todos: Array<SessionTodo>,
+/**
+ * Steering objective for this chat, set via `/goal`. Surfaced in the UI as
+ * the goal chip above the composer. Omitted from the payload when unset.
+ */
+goal?: string, followup: FollowupRequest | null, };
export type WorkspaceKind = "project" | "managed_chat";
@@ -39,7 +44,13 @@ export type SavedWorkspaceSummary = { id: string, name: string, updatedAt: bigin
export type SavedWorkspaceDetail = { id: string, name: string, layoutJson: string, updatedAt: bigint, };
-export type SessionSnapshot = { activeWorkspacePath: string | null, activeConversationId: string | null, visibleMessages: Array<SessionMessage>, visibleActiveRequestIds: Array<string>, visibleRequestAgentIds: { [key in string]: string }, visibleTodos: Array<SessionTodo>, visibleFollowup: FollowupRequest | null, conversationViews: Array<ConversationViewSnapshot>, uiError: string | null, workspaces: Array<WorkspaceSession>, savedWorkspaces: Array<SavedWorkspaceSummary>, };
+export type SessionSnapshot = { activeWorkspacePath: string | null, activeConversationId: string | null, visibleMessages: Array<SessionMessage>, visibleActiveRequestIds: Array<string>, visibleRequestAgentIds: { [key in string]: string }, visibleTodos: Array<SessionTodo>,
+/**
+ * Steering objective of the active chat, set via `/goal`. Mirrors
+ * `ConversationViewSnapshotDto::goal` for the visible conversation. Omitted
+ * from the payload when no goal is set.
+ */
+visibleGoal?: string, visibleFollowup: FollowupRequest | null, conversationViews: Array<ConversationViewSnapshot>, uiError: string | null, workspaces: Array<WorkspaceSession>, savedWorkspaces: Array<SavedWorkspaceSummary>, };
export type PromptModelOption = { providerId: string, providerName: string, modelId: string, modelName: string | null, contextLength: bigint | null, supportsReasoning: boolean, reasoningEfforts: Array<string>, };
diff --git a/gui/src/styles/index.css b/gui/src/styles/index.css
index a79fdd6a..b393bc8c 100644
--- a/gui/src/styles/index.css
+++ b/gui/src/styles/index.css
@@ -994,3 +994,100 @@
animation: none;
}
}
+
+/* --- Ultra mode shine (the `ultracode` codeword opt-in) ---
+ When Ultra is engaged on the composer, the card wears a slowly rotating
+ rainbow border, mirroring the harness TUI's `ultracodeShine`. The border is
+ painted into a masked ::before so the conic gradient only shows as a ring,
+ and the hue sweep is driven by animating a registered --cg-ultra-angle
+ custom property (smooth, GPU-cheap — no layout, no repaint of children). */
+@property --cg-ultra-angle {
+ syntax: "<angle>";
+ inherits: false;
+ initial-value: 0deg;
+}
+
+@keyframes cg-ultra-spin {
+ to {
+ --cg-ultra-angle: 360deg;
+ }
+}
+
+@keyframes cg-ultra-glow {
+ 0%,
+ 100% {
+ opacity: 0.85;
+ }
+ 50% {
+ opacity: 1;
+ }
+}
+
+.cg-ultra-shine {
+ position: relative;
+ isolation: isolate;
+}
+
+.cg-ultra-shine::before {
+ position: absolute;
+ inset: 0;
+ z-index: -1;
+ padding: 1.5px;
+ content: "";
+ border-radius: inherit;
+ background: conic-gradient(
+ from var(--cg-ultra-angle),
+ #ff5f6d,
+ #ffb347,
+ #ffe66d,
+ #5cd68a,
+ #36c5d6,
+ #5b7cff,
+ #b06aff,
+ #ff5fa2,
+ #ff5f6d
+ );
+ /* Show the gradient only as a ring: fill minus content box. */
+ -webkit-mask:
+ linear-gradient(#000 0 0) content-box,
+ linear-gradient(#000 0 0);
+ -webkit-mask-composite: xor;
+ mask:
+ linear-gradient(#000 0 0) content-box,
+ linear-gradient(#000 0 0);
+ mask-composite: exclude;
+ animation:
+ cg-ultra-spin 4s linear infinite,
+ cg-ultra-glow 2.4s ease-in-out infinite;
+}
+
+/* Soft outer bloom so the card reads as "lit" against the dark surface. */
+.cg-ultra-shine::after {
+ position: absolute;
+ inset: -1px;
+ z-index: -2;
+ content: "";
+ border-radius: inherit;
+ background: conic-gradient(
+ from var(--cg-ultra-angle),
+ #ff5f6d,
+ #ffb347,
+ #ffe66d,
+ #5cd68a,
+ #36c5d6,
+ #5b7cff,
+ #b06aff,
+ #ff5fa2,
+ #ff5f6d
+ );
+ filter: blur(11px);
+ opacity: 0.35;
+ animation: cg-ultra-spin 4s linear infinite;
+}
+
+@media (prefers-reduced-motion: reduce) {
+ .cg-ultra-shine::before,
+ .cg-ultra-shine::after {
+ animation: none;
+ }
+}