refactor: remove terminal MCP, Playwright, and commands infrastructure
- Remove terminal/tmux MCP from voice LLM - it now only uses agent-control MCP - Remove Playwright MCP auto-injection from Claude and Codex agents - Remove commands state from session, store, and UI - Remove present_artifact tool and guidelines from voice prompt - Update agent-prompt.md examples to focus on agents instead of commands - Remove @huggingface/transformers dependency and test scripts - Add expandTilde utility to utils/path.ts 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This commit is contained in:
@@ -4,14 +4,6 @@ import type { Agent } from "@/contexts/session-context";
|
||||
|
||||
export interface ActiveProcessesProps {
|
||||
agents: Agent[];
|
||||
commands: Array<{
|
||||
id: string;
|
||||
name: string;
|
||||
workingDirectory: string;
|
||||
currentCommand: string;
|
||||
isDead: boolean;
|
||||
exitCode: number | null;
|
||||
}>;
|
||||
viewMode: "orchestrator" | "agent";
|
||||
activeAgentId: string | null;
|
||||
onSelectAgent: (serverId: string, id: string) => void;
|
||||
@@ -132,7 +124,6 @@ const styles = StyleSheet.create((theme) => ({
|
||||
|
||||
export function ActiveProcesses({
|
||||
agents,
|
||||
commands,
|
||||
viewMode,
|
||||
activeAgentId,
|
||||
onSelectAgent,
|
||||
|
||||
@@ -34,7 +34,6 @@ export type {
|
||||
DraftInput,
|
||||
ProviderModelState,
|
||||
Agent,
|
||||
Command,
|
||||
ExplorerEntry,
|
||||
ExplorerFile,
|
||||
ExplorerEntryKind,
|
||||
@@ -75,14 +74,6 @@ const SESSION_SNAPSHOT_STORAGE_PREFIX = "@paseo:session-snapshot:";
|
||||
|
||||
type PersistedSessionSnapshot = {
|
||||
agents: AgentSnapshotPayload[];
|
||||
commands: Array<{
|
||||
id: string;
|
||||
name: string;
|
||||
workingDirectory: string;
|
||||
currentCommand: string;
|
||||
isDead: boolean;
|
||||
exitCode: number | null;
|
||||
}>;
|
||||
savedAt: string;
|
||||
};
|
||||
|
||||
@@ -97,7 +88,7 @@ async function loadPersistedSessionSnapshot(serverId: string): Promise<Persisted
|
||||
return null;
|
||||
}
|
||||
const parsed = JSON.parse(raw) as PersistedSessionSnapshot;
|
||||
if (!Array.isArray(parsed?.agents) || !Array.isArray(parsed?.commands)) {
|
||||
if (!Array.isArray(parsed?.agents)) {
|
||||
return null;
|
||||
}
|
||||
return parsed;
|
||||
@@ -107,11 +98,10 @@ async function loadPersistedSessionSnapshot(serverId: string): Promise<Persisted
|
||||
}
|
||||
}
|
||||
|
||||
async function persistSessionSnapshot(serverId: string, snapshot: { agents: AgentSnapshotPayload[]; commands: any[] }) {
|
||||
async function persistSessionSnapshot(serverId: string, snapshot: { agents: AgentSnapshotPayload[] }) {
|
||||
try {
|
||||
const payload: PersistedSessionSnapshot = {
|
||||
agents: snapshot.agents,
|
||||
commands: snapshot.commands,
|
||||
savedAt: new Date().toISOString(),
|
||||
};
|
||||
await AsyncStorage.setItem(getSessionSnapshotStorageKey(serverId), JSON.stringify(payload));
|
||||
@@ -241,7 +231,6 @@ export function SessionProvider({ children, serverUrl, serverId }: SessionProvid
|
||||
const setHasHydratedAgents = useSessionStore((state) => state.setHasHydratedAgents);
|
||||
const setAgents = useSessionStore((state) => state.setAgents);
|
||||
const setAgentLastActivity = useSessionStore((state) => state.setAgentLastActivity);
|
||||
const setCommands = useSessionStore((state) => state.setCommands);
|
||||
const setPendingPermissions = useSessionStore((state) => state.setPendingPermissions);
|
||||
const setGitDiffs = useSessionStore((state) => state.setGitDiffs);
|
||||
const setFileExplorer = useSessionStore((state) => state.setFileExplorer);
|
||||
@@ -368,13 +357,6 @@ export function SessionProvider({ children, serverUrl, serverId }: SessionProvid
|
||||
}
|
||||
|
||||
setPendingPermissions(serverId, pendingPermissions);
|
||||
const commandEntries = snapshot.commands ?? [];
|
||||
setCommands(serverId, (prev) => {
|
||||
if (prev.size > 0) {
|
||||
return prev;
|
||||
}
|
||||
return new Map(commandEntries.map((command) => [command.id, command]));
|
||||
});
|
||||
setHasHydratedAgents(serverId, true);
|
||||
};
|
||||
|
||||
@@ -383,7 +365,7 @@ export function SessionProvider({ children, serverUrl, serverId }: SessionProvid
|
||||
return () => {
|
||||
isMounted = false;
|
||||
};
|
||||
}, [serverId, setAgents, setCommands, setPendingPermissions, setHasHydratedAgents]);
|
||||
}, [serverId, setAgents, setPendingPermissions, setHasHydratedAgents]);
|
||||
|
||||
const updateExplorerState = useCallback(
|
||||
(agentId: string, updater: (state: any) => any) => {
|
||||
@@ -632,9 +614,9 @@ export function SessionProvider({ children, serverUrl, serverId }: SessionProvid
|
||||
sessionStateTimeoutRef.current = null;
|
||||
}
|
||||
|
||||
const { agents: agentsList, commands: commandsList } = message.payload;
|
||||
const { agents: agentsList } = message.payload;
|
||||
|
||||
console.log("[Session] ✅ Received session_state:", agentsList.length, "agents,", commandsList.length, "commands");
|
||||
console.log("[Session] ✅ Received session_state:", agentsList.length, "agents");
|
||||
setInitializingAgents(serverId, new Map());
|
||||
|
||||
const agents = new Map();
|
||||
@@ -651,8 +633,6 @@ export function SessionProvider({ children, serverUrl, serverId }: SessionProvid
|
||||
}
|
||||
}
|
||||
|
||||
const normalizedCommands = commandsList.map((command) => command);
|
||||
|
||||
setAgents(serverId, agents);
|
||||
|
||||
// Initialize agentLastActivity slice (top-level)
|
||||
@@ -661,7 +641,6 @@ export function SessionProvider({ children, serverUrl, serverId }: SessionProvid
|
||||
}
|
||||
|
||||
setPendingPermissions(serverId, pendingPermissions);
|
||||
setCommands(serverId, new Map(normalizedCommands.map((command: any) => [command.id, command])));
|
||||
setAgentStreamState(serverId, (prev) => {
|
||||
if (prev.size === 0) {
|
||||
return prev;
|
||||
@@ -716,7 +695,7 @@ export function SessionProvider({ children, serverUrl, serverId }: SessionProvid
|
||||
|
||||
return changed ? next : prev;
|
||||
});
|
||||
void persistSessionSnapshot(serverId, { agents: agentsList, commands: normalizedCommands });
|
||||
void persistSessionSnapshot(serverId, { agents: agentsList });
|
||||
setHasHydratedAgents(serverId, true);
|
||||
updateConnectionStatus(serverId, { status: "online", lastOnlineAt: new Date().toISOString(), sessionReady: true });
|
||||
});
|
||||
@@ -1271,7 +1250,7 @@ export function SessionProvider({ children, serverUrl, serverId }: SessionProvid
|
||||
unsubProviderModels();
|
||||
unsubAgentDeleted();
|
||||
};
|
||||
}, [ws, audioPlayer, serverId, setIsPlayingAudio, setMessages, setCurrentAssistantMessage, setAgentStreamState, setAgentStreamingBuffer, clearAgentStreamingBuffer, setInitializingAgents, setAgents, setAgentLastActivity, setCommands, setPendingPermissions, setGitDiffs, setFileExplorer, setProviderModels, setHasHydratedAgents, updateConnectionStatus, getSession, saveDraftInput]);
|
||||
}, [ws, audioPlayer, serverId, setIsPlayingAudio, setMessages, setCurrentAssistantMessage, setAgentStreamState, setAgentStreamingBuffer, clearAgentStreamingBuffer, setInitializingAgents, setAgents, setAgentLastActivity, setPendingPermissions, setGitDiffs, setFileExplorer, setProviderModels, setHasHydratedAgents, updateConnectionStatus, getSession, saveDraftInput]);
|
||||
|
||||
const initializeAgent = useCallback(({ agentId, requestId }: { agentId: string; requestId?: string }) => {
|
||||
console.log("[Session] initializeAgent called", { agentId, requestId });
|
||||
|
||||
@@ -108,15 +108,6 @@ export interface Agent {
|
||||
parentAgentId?: string | null;
|
||||
}
|
||||
|
||||
export interface Command {
|
||||
id: string;
|
||||
name: string;
|
||||
workingDirectory: string;
|
||||
currentCommand: string;
|
||||
isDead: boolean;
|
||||
exitCode: number | null;
|
||||
}
|
||||
|
||||
export type ExplorerEntryKind = "file" | "directory";
|
||||
export type ExplorerFileKind = "text" | "image" | "binary";
|
||||
export type ExplorerEncoding = "utf-8" | "base64" | "none";
|
||||
@@ -228,9 +219,8 @@ export interface SessionState {
|
||||
// Initializing agents
|
||||
initializingAgents: Map<string, boolean>;
|
||||
|
||||
// Agents and commands
|
||||
// Agents
|
||||
agents: Map<string, Agent>;
|
||||
commands: Map<string, Command>;
|
||||
|
||||
// Permissions
|
||||
pendingPermissions: Map<string, PendingPermission>;
|
||||
@@ -301,9 +291,6 @@ interface SessionStoreActions {
|
||||
// Agent activity timestamps
|
||||
setAgentLastActivity: (agentId: string, timestamp: Date) => void;
|
||||
|
||||
// Commands
|
||||
setCommands: (serverId: string, commands: Map<string, Command> | ((prev: Map<string, Command>) => Map<string, Command>)) => void;
|
||||
|
||||
// Permissions
|
||||
setPendingPermissions: (serverId: string, perms: Map<string, PendingPermission> | ((prev: Map<string, PendingPermission>) => Map<string, PendingPermission>)) => void;
|
||||
|
||||
@@ -379,7 +366,6 @@ function createInitialSessionState(serverId: string, ws: UseWebSocketReturn, aud
|
||||
agentStreamingBuffer: new Map(),
|
||||
initializingAgents: new Map(),
|
||||
agents: new Map(),
|
||||
commands: new Map(),
|
||||
pendingPermissions: new Map(),
|
||||
gitDiffs: new Map(),
|
||||
fileExplorer: new Map(),
|
||||
@@ -663,28 +649,6 @@ export const useSessionStore = create<SessionStore>()(
|
||||
});
|
||||
},
|
||||
|
||||
// Commands
|
||||
setCommands: (serverId, commands) => {
|
||||
set((prev) => {
|
||||
const session = prev.sessions[serverId];
|
||||
if (!session) {
|
||||
return prev;
|
||||
}
|
||||
const nextCommands = typeof commands === "function" ? commands(session.commands) : commands;
|
||||
if (session.commands === nextCommands) {
|
||||
return prev;
|
||||
}
|
||||
logSessionStoreUpdate("setCommands", serverId, { count: nextCommands.size });
|
||||
return {
|
||||
...prev,
|
||||
sessions: {
|
||||
...prev.sessions,
|
||||
[serverId]: { ...session, commands: nextCommands },
|
||||
},
|
||||
};
|
||||
});
|
||||
},
|
||||
|
||||
// Permissions
|
||||
setPendingPermissions: (serverId, perms) => {
|
||||
set((prev) => {
|
||||
|
||||
Reference in New Issue
Block a user