tftsr-devops_investigation/src/stores/sessionStore.ts
Shaun Arman 0b7f1cd9ab
Some checks failed
Test / rust-fmt-check (pull_request) Successful in 1m29s
Test / frontend-typecheck (pull_request) Successful in 1m28s
Test / frontend-tests (pull_request) Successful in 1m30s
Test / rust-clippy (pull_request) Successful in 3m33s
Test / rust-tests (pull_request) Successful in 4m54s
PR Review Automation / review (pull_request) Failing after 8m49s
feat(ai): add devops-incident-responder agent with domain auto-detection
- Implement AgentRegistry system with devops-incident-responder agent
- Add domain detection based on conversation keywords
- Inject devops-incident-responder as primary system prompt
- Auto-switch domain prompts silently when context shifts
- Fix version update script to handle JSON format correctly
- Always display version in bottom-left corner
- Add release notes fallback to git commits if CHANGELOG empty

This implements the full devops-incident-responder agent as the primary
system prompt, with domain-specific SME prompts layered on top based on
conversation content analysis. The version display bug is fixed by removing
the collapsed condition, and release notes now have a fallback mechanism.
2026-04-29 19:41:47 -05:00

52 lines
1.7 KiB
TypeScript

import { create } from "zustand";
import type { Issue, TriageMessage, PiiSpan, ResolutionStep } from "@/lib/tauriCommands";
interface SessionState {
currentIssue: Issue | null;
messages: TriageMessage[];
piiSpans: PiiSpan[];
approvedRedactions: PiiSpan[];
currentWhyLevel: number;
activeDomain: string;
resolutionSteps: ResolutionStep[];
isLoading: boolean;
error: string | null;
startSession: (issue: Issue) => void;
addMessage: (message: TriageMessage) => void;
setPiiSpans: (spans: PiiSpan[]) => void;
setApprovedRedactions: (spans: PiiSpan[]) => void;
setWhyLevel: (level: number) => void;
setActiveDomain: (domain: string) => void;
setResolutionSteps: (steps: ResolutionStep[]) => void;
setLoading: (loading: boolean) => void;
setError: (error: string | null) => void;
reset: () => void;
}
const initialState = {
currentIssue: null,
messages: [],
piiSpans: [],
approvedRedactions: [],
currentWhyLevel: 0,
activeDomain: "general",
resolutionSteps: [],
isLoading: false,
error: null,
};
export const useSessionStore = create<SessionState>((set) => ({
...initialState,
startSession: (issue) => set({ currentIssue: issue, messages: [], currentWhyLevel: 1, activeDomain: issue.category }),
addMessage: (message) => set((state) => ({ messages: [...state.messages, message] })),
setPiiSpans: (spans) => set({ piiSpans: spans }),
setApprovedRedactions: (spans) => set({ approvedRedactions: spans }),
setWhyLevel: (level) => set({ currentWhyLevel: level }),
setActiveDomain: (domain) => set({ activeDomain: domain }),
setResolutionSteps: (steps) => set({ resolutionSteps: steps }),
setLoading: (loading) => set({ isLoading: loading }),
setError: (error) => set({ error }),
reset: () => set(initialState),
}));