Make curl virtual command use configured corsProxy instead of hardcoded

This commit is contained in:
Alex Gleason committed 2025-11-12 11:10:30 -06:00
1 parent 0b66f81bfc
commit dbf5cfe0a3
6 files changed
+20 -11

No files matched your search

+2 -2
View File
@@ -166,7 +166,7 @@ export const ChatPane = forwardRef<ChatPaneRef, ChatPaneProps>(({
nostr_read_nips_index: new NostrReadNipsIndexTool(),
nostr_generate_kind: new NostrGenerateKindTool(),
nostr_publish_events: new NostrPublishEventsTool(),
shell: new ShellTool(fs, cwd, git, projectsPath, user?.signer),
shell: new ShellTool(fs, cwd, git, projectsPath, config.corsProxy, user?.signer),
read_console_messages: new ReadConsoleMessagesTool(),
skill: new SkillTool(fs, pluginsPath),
};
@@ -180,7 +180,7 @@ export const ChatPane = forwardRef<ChatPaneRef, ChatPaneProps>(({
}
return baseTools;
}, [fs, git, cwd, user, projectId, projectsPath, tmpPath, pluginsPath, handleFileChanged]);
}, [fs, git, cwd, user, projectId, projectsPath, tmpPath, pluginsPath, config.corsProxy, handleFileChanged]);
// Convert tools to OpenAI format
const tools = useMemo(() => {
+4 -2
View File
@@ -8,6 +8,7 @@ import { useFS } from '@/hooks/useFS';
import { useFSPaths } from '@/hooks/useFSPaths';
import { useGit } from '@/hooks/useGit';
import { useCurrentUser } from '@/hooks/useCurrentUser';
import { useAppContext } from '@/hooks/useAppContext';
import { ansiToHtml, containsAnsiCodes } from '@/lib/ansiToHtml';
interface TerminalProps {
@@ -37,10 +38,11 @@ export function Terminal({ projectId, className }: TerminalProps) {
const { projectsPath } = useFSPaths();
const { git } = useGit();
const { user } = useCurrentUser();
const { config } = useAppContext();
// Initialize ShellTool
useEffect(() => {
shellToolRef.current = new ShellTool(fs, `${projectsPath}/${projectId}`, git, projectsPath, user?.signer);
shellToolRef.current = new ShellTool(fs, `${projectsPath}/${projectId}`, git, projectsPath, config.corsProxy, user?.signer);
// Add welcome message
setLines([{
@@ -49,7 +51,7 @@ export function Terminal({ projectId, className }: TerminalProps) {
content: `Welcome to Shakespeare Terminal\nType 'help' to see available commands.`,
timestamp: new Date()
}]);
}, [projectId, fs, git, projectsPath, user?.signer]);
}, [projectId, fs, git, projectsPath, config.corsProxy, user?.signer]);
// Auto-scroll to bottom when new lines are added or execution state changes
useEffect(() => {