add: dynamic instructions (#927)
This commit is contained in:
@@ -325,14 +325,12 @@ function rewriteFileCitations(
|
||||
fileOpener: FileOpenerScheme | undefined,
|
||||
cwd: string = process.cwd(),
|
||||
): string {
|
||||
if (!fileOpener) {
|
||||
// Should we reformat the citations even if we cannot linkify them?
|
||||
return markdown;
|
||||
}
|
||||
|
||||
citationRegex.lastIndex = 0;
|
||||
return markdown.replace(citationRegex, (_match, file, start, _end) => {
|
||||
const absPath = path.resolve(cwd, file);
|
||||
if (!fileOpener) {
|
||||
return `[${file}](${absPath})`;
|
||||
}
|
||||
const uri = `${fileOpener}://file${absPath}:${start}`;
|
||||
const label = `${file}:${start}`;
|
||||
// In practice, sometimes multiple citations for the same file, but with a
|
||||
|
||||
@@ -62,11 +62,19 @@ const TerminalMessageHistory: React.FC<TerminalMessageHistoryProps> = ({
|
||||
key={`${message.id}-${index}`}
|
||||
flexDirection="column"
|
||||
marginLeft={
|
||||
message.type === "message" && message.role === "user" ? 0 : 4
|
||||
message.type === "message" &&
|
||||
(message.role === "user" || message.role === "assistant")
|
||||
? 0
|
||||
: 4
|
||||
}
|
||||
marginTop={
|
||||
message.type === "message" && message.role === "user" ? 0 : 1
|
||||
}
|
||||
marginBottom={
|
||||
message.type === "message" && message.role === "assistant"
|
||||
? 1
|
||||
: 0
|
||||
}
|
||||
>
|
||||
<TerminalChatResponseItem
|
||||
item={message}
|
||||
|
||||
Reference in New Issue
Block a user