Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions core/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1103,6 +1103,7 @@ export interface Tool {
basePolicy: ToolPolicy,
parsedArgs: Record<string, unknown>,
) => ToolPolicy;
displayToolArgs?: boolean;
}

interface ToolChoice {
Expand Down
5 changes: 3 additions & 2 deletions core/tools/definitions/editFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ export const editFileTool: Tool = {
type: "function",
displayTitle: "Edit File",
wouldLikeTo: "edit {{{ filepath }}}",
isCurrently: "editing {{{ filepath }}}",
hasAlready: "edited {{{ filepath }}}",
isCurrently: "editing a file",
hasAlready: "edited a file",
group: BUILT_IN_GROUP_NAME,
readonly: false,
isInstant: false,
Expand Down Expand Up @@ -56,4 +56,5 @@ For example:`,
],
],
},
displayToolArgs: false,
};
7 changes: 5 additions & 2 deletions gui/src/components/StyledMarkdownPreview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const StyledMarkdown = styled.div<{
fontSize?: number;
whiteSpace: string;
bgColor: string;
padding: number;
}>`
h1 {
font-size: 1.25em;
Expand Down Expand Up @@ -103,8 +104,8 @@ const StyledMarkdown = styled.div<{
"Helvetica Neue",
sans-serif;
font-size: ${(props) => props.fontSize || getFontSize()}px;
padding-left: 8px;
padding-right: 8px;
padding-left: ${(props) => props.padding}px;
padding-right: ${(props) => props.padding}px;
color: ${vscForeground};

p,
Expand Down Expand Up @@ -135,6 +136,7 @@ interface StyledMarkdownPreviewProps {
toolCallId?: string;
expandCodeblocks?: boolean;
collapsible?: boolean;
padding?: boolean;
}

const HLJS_LANGUAGE_CLASSNAME_PREFIX = "language-";
Expand Down Expand Up @@ -366,6 +368,7 @@ const StyledMarkdownPreview = memo(function StyledMarkdownPreview(
fontSize={getFontSize()}
whiteSpace={codeWrapState}
bgColor={props.useParentBackgroundColor ? "" : vscBackground}
padding={(props.padding ?? true) ? 8 : 0}
>
{reactContent}
</StyledMarkdown>
Expand Down
1 change: 1 addition & 0 deletions gui/src/pages/gui/ToolCallDiv/CreateFile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export function CreateFile(props: CreateFileToolCallProps) {
disableManualApply
source={src}
itemIndex={props.historyIndex}
padding={false}
/>
) : null;
}
1 change: 1 addition & 0 deletions gui/src/pages/gui/ToolCallDiv/EditFile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export function EditFile(props: EditToolCallProps) {
toolCallId={props.toolCallId}
itemIndex={props.historyIndex}
collapsible={true}
padding={false}
/>
);
}
4 changes: 2 additions & 2 deletions gui/src/pages/gui/ToolCallDiv/ToolCallDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function ToolCallDisplay({

const args: [string, any][] = useMemo(() => {
return Object.entries(toolCallState.parsedArgs);
}, [toolCallState.parsedArgs]);
}, [toolCallState.parsedArgs, tool?.displayToolArgs]);

return (
<div className="flex flex-col justify-center px-4">
Expand All @@ -42,7 +42,7 @@ export function ToolCallDisplay({
{!!toolCallState.output && (
<ToolTruncateHistoryIcon historyIndex={historyIndex} />
)}
{!!args.length ? (
{!!args.length && (tool?.displayToolArgs ?? true) ? (
<ArgsToggleIcon
isShowing={argsExpanded}
setIsShowing={setArgsExpanded}
Expand Down
Loading