Skip to content

Commit 25f9b0c

Browse files
committed
Merge branch 'main' into feat/terminal-command-generation
2 parents 5a100c9 + 1489983 commit 25f9b0c

File tree

16 files changed

+212
-1534
lines changed

16 files changed

+212
-1534
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,6 @@ logs
4545
.qodo/
4646
.vercel
4747
.roo/mcp.json
48+
49+
# Ignore copilot instructions file
50+
.github/copilot-instructions.md

.husky/pre-commit

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
branch="$(git rev-parse --abbrev-ref HEAD)"
22

3-
if [ "$branch" = "main" ]; then
4-
echo "You can't commit directly to main - please check out a branch."
5-
exit 1
6-
fi
3+
# Disabled for personal fork - allow commits to main
4+
# if [ "$branch" = "main" ]; then
5+
# echo "You can't commit directly to main - please check out a branch."
6+
# exit 1
7+
# fi
78

89
# Detect if running on Windows and use pnpm.cmd, otherwise use pnpm.
910
if [ "$OS" = "Windows_NT" ]; then

.husky/pre-push

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
branch="$(git rev-parse --abbrev-ref HEAD)"
22

3-
if [ "$branch" = "main" ]; then
4-
echo "You can't push directly to main - please check out a branch."
5-
exit 1
6-
fi
3+
# Comentamos la restricción de push a main para nuestro fork personal
4+
# if [ "$branch" = "main" ]; then
5+
# echo "You can't push directly to main - please check out a branch."
6+
# exit 1
7+
# fi
78

89
# Detect if running on Windows and use pnpm.cmd, otherwise use pnpm.
910
if [ "$OS" = "Windows_NT" ]; then

CHANGELOG.md

Lines changed: 33 additions & 1464 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
**Modified Version Notice:** This installation has been modified by Alorse. For details, please check the [CHANGELOG.md](CHANGELOG.md)
2+
13
<div align="center">
24
<sub>
35

src/api/providers/xai.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,15 @@ export class XAIHandler extends BaseProvider implements SingleCompletionHandler
7878
if (chunk.usage) {
7979
// Extract detailed token information if available
8080
// First check for prompt_tokens_details structure (real API response)
81-
const promptDetails = "prompt_tokens_details" in chunk.usage ? chunk.usage.prompt_tokens_details : null;
82-
const cachedTokens = promptDetails && "cached_tokens" in promptDetails ? promptDetails.cached_tokens : 0;
81+
const promptDetails = "prompt_tokens_details" in chunk.usage ? chunk.usage.prompt_tokens_details : null
82+
const cachedTokens = promptDetails && "cached_tokens" in promptDetails ? promptDetails.cached_tokens : 0
8383

8484
// Fall back to direct fields in usage (used in test mocks)
85-
const readTokens = cachedTokens || ("cache_read_input_tokens" in chunk.usage ? (chunk.usage as any).cache_read_input_tokens : 0);
86-
const writeTokens = "cache_creation_input_tokens" in chunk.usage ? (chunk.usage as any).cache_creation_input_tokens : 0;
85+
const readTokens =
86+
cachedTokens ||
87+
("cache_read_input_tokens" in chunk.usage ? (chunk.usage as any).cache_read_input_tokens : 0)
88+
const writeTokens =
89+
"cache_creation_input_tokens" in chunk.usage ? (chunk.usage as any).cache_creation_input_tokens : 0
8790

8891
yield {
8992
type: "usage",

src/core/webview/webviewMessageHandler.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1364,6 +1364,29 @@ export const webviewMessageHandler = async (
13641364
}
13651365
}
13661366
break
1367+
case "getApiConfigurationById":
1368+
if (message.text) {
1369+
try {
1370+
const { name: _, ...providerSettings } = await provider.providerSettingsManager.getProfile({
1371+
id: message.text,
1372+
})
1373+
provider.postMessageToWebview({
1374+
type: "apiConfigurationById",
1375+
apiConfigById: providerSettings,
1376+
values: { configId: message.text },
1377+
})
1378+
} catch (error) {
1379+
provider.log(
1380+
`Error get api configuration by ID: ${JSON.stringify(error, Object.getOwnPropertyNames(error), 2)}`,
1381+
)
1382+
provider.postMessageToWebview({
1383+
type: "apiConfigurationById",
1384+
apiConfigById: undefined,
1385+
values: { configId: message.text, error: error.message },
1386+
})
1387+
}
1388+
}
1389+
break
13671390
case "deleteApiConfiguration":
13681391
if (message.text) {
13691392
const answer = await vscode.window.showInformationMessage(

src/shared/ExtensionMessage.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export interface ExtensionMessage {
6262
| "enhancedPrompt"
6363
| "commitSearchResults"
6464
| "listApiConfig"
65+
| "apiConfigurationById"
6566
| "routerModels"
6667
| "openAiModels"
6768
| "ollamaModels"
@@ -136,6 +137,7 @@ export interface ExtensionMessage {
136137
mcpServers?: McpServer[]
137138
commits?: GitCommit[]
138139
listApiConfig?: ProviderSettingsEntry[]
140+
apiConfigById?: ProviderSettings
139141
mode?: Mode
140142
customMode?: ModeConfig
141143
slug?: string

src/shared/WebviewMessage.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export interface WebviewMessage {
2727
| "deleteApiConfiguration"
2828
| "loadApiConfiguration"
2929
| "loadApiConfigurationById"
30+
| "getApiConfigurationById"
3031
| "renameApiConfiguration"
3132
| "getListApiConfiguration"
3233
| "customInstructions"

webview-ui/src/components/chat/ChatRow.tsx

Lines changed: 58 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const ChatRow = memo(
6363
const prevHeightRef = useRef(0)
6464

6565
const [chatrow, { height }] = useSize(
66-
<div className="px-[15px] py-[10px] pr-[6px]">
66+
<div className="px-[15px] py-[10px]">
6767
<ChatRowContent {...props} />
6868
</div>,
6969
)
@@ -138,7 +138,7 @@ export const ChatRowContent = ({
138138

139139
const normalColor = "var(--vscode-foreground)"
140140
const errorColor = "var(--vscode-errorForeground)"
141-
const successColor = "var(--vscode-charts-green)"
141+
const successColor = "var(--vscode-button-background)"
142142
const cancelledColor = "var(--vscode-descriptionForeground)"
143143

144144
const [icon, title] = useMemo(() => {
@@ -263,13 +263,17 @@ export const ChatRowContent = ({
263263
gap: "10px",
264264
marginBottom: "10px",
265265
wordBreak: "break-word",
266+
fontSize: "var(--text-lg)",
267+
lineHeight: "1.6",
266268
}
267269

268270
const pStyle: React.CSSProperties = {
269271
margin: 0,
270272
whiteSpace: "pre-wrap",
271273
wordBreak: "break-word",
272274
overflowWrap: "anywhere",
275+
fontSize: "var(--text-lg)",
276+
lineHeight: "1.6",
273277
}
274278

275279
const tool = useMemo(
@@ -716,6 +720,7 @@ export const ChatRowContent = ({
716720
display: "flex",
717721
alignItems: "center",
718722
gap: "6px",
723+
lineHeight: "1.6",
719724
}}>
720725
<span className="codicon codicon-arrow-right"></span>
721726
{t("chat:subtasks.newTaskContent")}
@@ -753,6 +758,7 @@ export const ChatRowContent = ({
753758
display: "flex",
754759
alignItems: "center",
755760
gap: "6px",
761+
lineHeight: "1.6",
756762
}}>
757763
<span className="codicon codicon-check"></span>
758764
{t("chat:subtasks.completionContent")}
@@ -792,6 +798,7 @@ export const ChatRowContent = ({
792798
alignItems: "center",
793799
justifyContent: "space-between",
794800
cursor: "pointer",
801+
lineHeight: "1.6",
795802
}}
796803
onClick={() => setIsDiffErrorExpanded(!isDiffErrorExpanded)}>
797804
<div
@@ -883,6 +890,7 @@ export const ChatRowContent = ({
883890
display: "flex",
884891
alignItems: "center",
885892
gap: "6px",
893+
lineHeight: "1.6",
886894
}}>
887895
<span className="codicon codicon-arrow-left"></span>
888896
{t("chat:subtasks.resultContent")}
@@ -979,26 +987,43 @@ export const ChatRowContent = ({
979987
)
980988
case "user_feedback":
981989
return (
982-
<div className="bg-vscode-editor-background border rounded-xs p-1 overflow-hidden whitespace-pre-wrap">
983-
<div className="flex justify-between">
984-
<div className="flex-grow px-2 py-1 wrap-anywhere">
985-
<Mention text={message.text} withShadow />
990+
<div className="w-[90%] flex justify-end mx-auto mr-0">
991+
<div
992+
className="rounded-lg p-1 overflow-hidden whitespace-pre-wrap w-full"
993+
style={{
994+
backgroundColor:
995+
"color-mix(in srgb, var(--vscode-button-background) 20%, transparent)",
996+
border: "1px solid color-mix(in srgb, var(--vscode-button-background) 20%, transparent)",
997+
}}>
998+
<div className="flex justify-between">
999+
<div
1000+
className="flex-grow px-2 py-1 wrap-anywhere"
1001+
style={{
1002+
color: "var(--vscode-list-activeSelectionForeground)",
1003+
fontSize: "var(--text-lx)",
1004+
lineHeight: "1.6",
1005+
}}>
1006+
<Mention text={message.text} withShadow />
1007+
</div>
1008+
<Button
1009+
variant="ghost"
1010+
size="icon"
1011+
className="shrink-0"
1012+
disabled={isStreaming}
1013+
onClick={(e) => {
1014+
e.stopPropagation()
1015+
vscode.postMessage({ type: "deleteMessage", value: message.ts })
1016+
}}>
1017+
<span
1018+
className="codicon codicon-trash"
1019+
style={{ color: "var(--vscode-foreground)" }}
1020+
/>
1021+
</Button>
9861022
</div>
987-
<Button
988-
variant="ghost"
989-
size="icon"
990-
className="shrink-0"
991-
disabled={isStreaming}
992-
onClick={(e) => {
993-
e.stopPropagation()
994-
vscode.postMessage({ type: "deleteMessage", value: message.ts })
995-
}}>
996-
<span className="codicon codicon-trash" />
997-
</Button>
1023+
{message.images && message.images.length > 0 && (
1024+
<Thumbnails images={message.images} style={{ marginTop: "8px" }} />
1025+
)}
9981026
</div>
999-
{message.images && message.images.length > 0 && (
1000-
<Thumbnails images={message.images} style={{ marginTop: "8px" }} />
1001-
)}
10021027
</div>
10031028
)
10041029
case "user_feedback_diff":
@@ -1033,7 +1058,18 @@ export const ChatRowContent = ({
10331058
{icon}
10341059
{title}
10351060
</div>
1036-
<div style={{ color: "var(--vscode-charts-green)", paddingTop: 10 }}>
1061+
<div
1062+
style={{
1063+
backgroundColor:
1064+
"color-mix(in srgb, var(--vscode-button-background) 10%, transparent)",
1065+
color: "var(--vscode-list-activeSelectionForeground)",
1066+
paddingTop: 10,
1067+
padding: "10px",
1068+
borderRadius: "6px",
1069+
border: "1px solid color-mix(in srgb, var(--vscode-button-background) 20%, transparent)",
1070+
fontSize: "calc(var(--vscode-font-size) * 1.25)",
1071+
lineHeight: "1.6",
1072+
}}>
10371073
<Markdown markdown={message.text} />
10381074
</div>
10391075
</>
@@ -1189,7 +1225,7 @@ export const ChatRowContent = ({
11891225
{icon}
11901226
{title}
11911227
</div>
1192-
<div style={{ color: "var(--vscode-charts-green)", paddingTop: 10 }}>
1228+
<div style={{ color: "var(--vscode-button-background)", paddingTop: 10 }}>
11931229
<Markdown markdown={message.text} partial={message.partial} />
11941230
</div>
11951231
</div>

0 commit comments

Comments
 (0)