Skip to content

Commit 038c8a0

Browse files
Merge branch 'master' of github.com:Mintplex-Labs/anything-llm into 3000-mcp-compatibility
2 parents eaaa2bd + bd9b7e8 commit 038c8a0

File tree

9 files changed

+276
-83
lines changed

9 files changed

+276
-83
lines changed

frontend/src/pages/Admin/AgentBuilder/BlockList/index.jsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ export default function BlockList({
225225
e.stopPropagation();
226226
moveBlock(index, index - 1);
227227
}}
228-
className="p-1.5 rounded-lg bg-theme-bg-primary border border-white/5 text-white hover:bg-theme-action-menu-item-hover transition-colors duration-300"
228+
className="w-7 h-7 flex items-center justify-center rounded-lg bg-theme-bg-primary border border-white/5 text-white hover:bg-theme-action-menu-item-hover transition-colors duration-300"
229229
data-tooltip-id="block-action"
230230
data-tooltip-content="Move block up"
231231
>
@@ -238,7 +238,7 @@ export default function BlockList({
238238
e.stopPropagation();
239239
moveBlock(index, index + 1);
240240
}}
241-
className="p-1.5 rounded-lg bg-theme-bg-primary border border-white/5 text-white hover:bg-theme-action-menu-item-hover transition-colors duration-300"
241+
className="w-7 h-7 flex items-center justify-center rounded-lg bg-theme-bg-primary border border-white/5 text-white hover:bg-theme-action-menu-item-hover transition-colors duration-300"
242242
data-tooltip-id="block-action"
243243
data-tooltip-content="Move block down"
244244
>
@@ -250,7 +250,7 @@ export default function BlockList({
250250
e.stopPropagation();
251251
removeBlock(block.id);
252252
}}
253-
className="p-1.5 rounded-lg bg-theme-bg-primary border border-white/5 text-red-400 hover:bg-red-500/10 hover:border-red-500/20 transition-colors duration-300"
253+
className="w-7 h-7 flex items-center justify-center rounded-lg bg-theme-bg-primary border border-white/5 text-red-400 hover:bg-red-500/10 hover:border-red-500/20 transition-colors duration-300"
254254
data-tooltip-id="block-action"
255255
data-tooltip-content="Delete block"
256256
>

frontend/src/pages/Admin/AgentBuilder/HeaderMenu/index.jsx

+69-58
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CaretDown, CaretUp, Plus } from "@phosphor-icons/react";
1+
import { CaretDown, CaretUp, Plus, CaretLeft } from "@phosphor-icons/react";
22
import AnythingInfinityLogo from "@/media/logo/anything-llm-infinity.png";
33
import { useState, useRef, useEffect } from "react";
44
import { useNavigate, useParams } from "react-router-dom";
@@ -32,72 +32,83 @@ export default function HeaderMenu({
3232
}, []);
3333

3434
return (
35-
<div className="absolute top-4 left-4 right-4">
36-
<div className="flex justify-between items-center max-w-[1700px] mx-auto">
37-
<div
38-
className="flex items-center bg-theme-settings-input-bg rounded-md border border-white/10 pointer-events-auto"
39-
ref={dropdownRef}
40-
>
35+
<div className="absolute top-[calc(40px+16px)] left-4 right-4">
36+
<div className="flex justify-between items-start max-w-[1700px] mx-auto">
37+
<div className="flex items-center gap-x-2">
4138
<button
4239
onClick={() => navigate(paths.settings.agentSkills())}
43-
className="border-y-none border-l-none flex items-center gap-x-2 px-4 py-2 border-r border-white/10 hover:bg-theme-action-menu-bg transition-colors duration-300"
40+
className="w-8 h-8 flex items-center justify-center rounded-full bg-theme-settings-input-bg border border-white/10 hover:bg-theme-action-menu-bg transition-colors duration-300"
4441
>
45-
<img
46-
src={AnythingInfinityLogo}
47-
alt="logo"
48-
className="w-[20px] light:invert"
42+
<CaretLeft
43+
weight="bold"
44+
className="w-5 h-5 text-theme-text-primary"
4945
/>
50-
<span className="text-theme-text-primary text-sm uppercase tracking-widest">
51-
Builder
52-
</span>
5346
</button>
54-
<div className="relative">
47+
<div
48+
className="flex items-center bg-theme-settings-input-bg rounded-md border border-white/10 pointer-events-auto"
49+
ref={dropdownRef}
50+
>
5551
<button
56-
disabled={!hasOtherFlows}
57-
className="border-none flex items-center justify-between gap-x-1 text-theme-text-primary text-sm px-4 py-2 enabled:hover:bg-theme-action-menu-bg transition-colors duration-300 min-w-[200px] max-w-[300px]"
58-
onClick={() => {
59-
if (!agentName && !hasOtherFlows) {
60-
const agentNameInput = document.getElementById(
61-
"agent-flow-name-input"
62-
);
63-
if (agentNameInput) agentNameInput.focus();
64-
return;
65-
}
66-
setShowDropdown(!showDropdown);
67-
}}
52+
onClick={() => navigate(paths.settings.agentSkills())}
53+
className="!border-t-transparent !border-l-transparent !border-b-transparent flex items-center gap-x-2 px-4 py-2 border-r border-white/10 hover:bg-theme-action-menu-bg transition-colors duration-300"
6854
>
69-
<span
70-
className={`text-sm font-medium truncate ${!!agentName ? "text-theme-text-primary " : "text-theme-text-secondary"}`}
71-
>
72-
{agentName || "Untitled Flow"}
55+
<img
56+
src={AnythingInfinityLogo}
57+
alt="logo"
58+
className="w-[20px] light:invert"
59+
/>
60+
<span className="text-theme-text-primary text-sm uppercase tracking-widest">
61+
Builder
7362
</span>
74-
{hasOtherFlows && (
75-
<div className="flex flex-col ml-2 shrink-0">
76-
<CaretUp size={10} />
77-
<CaretDown size={10} />
63+
</button>
64+
<div className="relative">
65+
<button
66+
disabled={!hasOtherFlows}
67+
className="border-none flex items-center justify-between gap-x-1 text-theme-text-primary text-sm px-4 py-2 enabled:hover:bg-theme-action-menu-bg transition-colors duration-300 min-w-[200px] max-w-[300px]"
68+
onClick={() => {
69+
if (!agentName && !hasOtherFlows) {
70+
const agentNameInput = document.getElementById(
71+
"agent-flow-name-input"
72+
);
73+
if (agentNameInput) agentNameInput.focus();
74+
return;
75+
}
76+
setShowDropdown(!showDropdown);
77+
}}
78+
>
79+
<span
80+
className={`text-sm font-medium truncate ${!!agentName ? "text-theme-text-primary " : "text-theme-text-secondary"}`}
81+
>
82+
{agentName || "Untitled Flow"}
83+
</span>
84+
{hasOtherFlows && (
85+
<div className="flex flex-col ml-2 shrink-0">
86+
<CaretUp size={10} />
87+
<CaretDown size={10} />
88+
</div>
89+
)}
90+
</button>
91+
{showDropdown && (
92+
<div className="absolute top-full left-0 mt-1 w-full min-w-[200px] max-w-[350px] bg-theme-settings-input-bg border border-white/10 rounded-md shadow-lg z-50 animate-fadeUpIn">
93+
{availableFlows
94+
.filter((flow) => flow.uuid !== flowId)
95+
.map((flow) => (
96+
<button
97+
key={flow?.uuid || Math.random()}
98+
onClick={() => {
99+
navigate(paths.agents.editAgent(flow.uuid));
100+
setShowDropdown(false);
101+
}}
102+
className="border-none w-full text-left px-2 py-1 text-sm text-theme-text-primary hover:bg-theme-action-menu-bg transition-colors duration-300"
103+
>
104+
<span className="block truncate">
105+
{flow?.name || "Untitled Flow"}
106+
</span>
107+
</button>
108+
))}
78109
</div>
79110
)}
80-
</button>
81-
{showDropdown && (
82-
<div className="absolute top-full left-0 mt-1 w-full min-w-[200px] max-w-[350px] bg-theme-settings-input-bg border border-white/10 rounded-md shadow-lg z-50 animate-fadeUpIn">
83-
{availableFlows
84-
.filter((flow) => flow.uuid !== flowId)
85-
.map((flow) => (
86-
<button
87-
key={flow?.uuid || Math.random()}
88-
onClick={() => {
89-
navigate(paths.agents.editAgent(flow.uuid));
90-
setShowDropdown(false);
91-
}}
92-
className="border-none w-full text-left px-2 py-1 text-sm text-theme-text-primary hover:bg-theme-action-menu-bg transition-colors duration-300"
93-
>
94-
<span className="block truncate">
95-
{flow?.name || "Untitled Flow"}
96-
</span>
97-
</button>
98-
))}
99-
</div>
100-
)}
111+
</div>
101112
</div>
102113
</div>
103114

@@ -112,7 +123,7 @@ export default function HeaderMenu({
112123
</button>
113124
<button
114125
onClick={onSaveFlow}
115-
className="border-none bg-primary-button hover:opacity-80 text-black px-3 py-2 rounded-lg text-sm font-medium transition-all duration-300 flex items-center justify-center gap-2"
126+
className="border-none bg-primary-button hover:opacity-80 text-black light:text-white px-3 py-2 rounded-lg text-sm font-medium transition-all duration-300 flex items-center justify-center gap-2"
116127
>
117128
Save
118129
</button>

frontend/src/pages/Admin/ExperimentalFeatures/index.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -264,13 +264,13 @@ function FeatureVerification({ children }) {
264264
<div className="flex w-full justify-between items-center p-6 space-x-2 border-t border-theme-modal-border rounded-b">
265265
<a
266266
href={paths.home()}
267-
className="px-4 py-2 rounded-lg text-theme-text-primary hover:bg-red-500/50 light:hover:bg-red-300/50 transition-all duration-300"
267+
className="transition-all duration-300 bg-transparent text-white hover:bg-red-500/50 light:hover:bg-red-300/50 px-4 py-2 rounded-lg text-sm border border-theme-modal-border"
268268
>
269269
Reject & close
270270
</a>
271271
<button
272272
type="submit"
273-
className="transition-all duration-300 text-theme-text-primary hover:bg-blue-300/50 light:hover:bg-blue-300 px-4 py-2 rounded-lg text-sm"
273+
className="transition-all duration-300 bg-white text-black hover:opacity-60 px-4 py-2 rounded-lg text-sm border border-theme-modal-border"
274274
>
275275
I understand
276276
</button>

frontend/src/pages/OnboardingFlow/Steps/Survey/index.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ export default function Survey({ setHeader, setForwardBtn, setBackBtn }) {
261261
<button
262262
type="button"
263263
onClick={skipSurvey}
264-
className="text-white text-base font-medium text-opacity-30 hover:text-opacity-100 mt-8"
264+
className="text-white text-base font-medium text-opacity-30 hover:text-opacity-100 hover:text-teal mt-8"
265265
>
266266
{t("onboarding.survey.skip")}
267267
</button>

frontend/src/pages/OnboardingFlow/Steps/index.jsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ export function OnboardingLayout({ children }) {
7474
<button
7575
disabled={forwardBtn.disabled}
7676
onClick={forwardBtn.onClick}
77-
className="group p-2 rounded-lg border-2 border-zinc-300 disabled:border-zinc-600 h-fit w-fit disabled:not-allowed hover:bg-zinc-100 disabled:hover:bg-transparent"
77+
className="group p-2 rounded-lg border-2 border-zinc-300 disabled:border-zinc-600 h-fit w-fit disabled:not-allowed hover:bg-teal disabled:hover:bg-transparent"
7878
>
7979
<ArrowRight
80-
className="text-white group-hover:text-black group-disabled:text-gray-500"
80+
className="text-white group-hover:text-teal group-disabled:text-gray-500"
8181
size={30}
8282
/>
8383
</button>
@@ -127,11 +127,11 @@ export function OnboardingLayout({ children }) {
127127
<button
128128
disabled={forwardBtn.disabled}
129129
onClick={forwardBtn.onClick}
130-
className="group p-2 rounded-lg border-2 border-theme-sidebar-border h-fit w-fit disabled:cursor-not-allowed hover:bg-theme-bg-secondary disabled:hover:bg-transparent"
130+
className="group p-2 rounded-lg border-2 border-theme-sidebar-border h-fit w-fit disabled:cursor-not-allowed hover:bg-teal disabled:hover:bg-transparent"
131131
aria-label="Continue"
132132
>
133133
<ArrowRight
134-
className="text-theme-text-secondary group-hover:text-theme-text-primary group-disabled:text-gray-500"
134+
className="text-theme-text-secondary group-hover:text-white group-disabled:text-gray-500"
135135
size={30}
136136
/>
137137
</button>

frontend/tailwind.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export default {
4545
warn: "#854708",
4646
success: "#05603A",
4747
darker: "#F4F4F4",
48+
teal: "#0BA5EC",
4849

4950
// Generic theme colors
5051
theme: {

server/utils/agents/aibitat/plugins/sql-agent/SQLConnectors/MSSQL.js

+10-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const mssql = require("mssql");
2-
const UrlPattern = require("url-pattern");
2+
const { ConnectionStringParser } = require("./utils");
33

44
class MSSQLConnector {
55
#connected = false;
@@ -34,18 +34,17 @@ class MSSQLConnector {
3434
}
3535

3636
#parseDatabase() {
37-
const connectionPattern = new UrlPattern(
38-
"mssql\\://:username\\::password@*\\::port/:database*"
39-
);
40-
const match = connectionPattern.match(this.connectionString);
41-
this.database_id = match?.database;
37+
const connectionParser = new ConnectionStringParser({ scheme: "mssql" });
38+
const parsed = connectionParser.parse(this.connectionString);
39+
40+
this.database_id = parsed?.endpoint;
4241
this.connectionConfig = {
4342
...this.connectionConfig,
44-
user: match?.username,
45-
password: match?.password,
46-
database: match?.database,
47-
server: match?._[0],
48-
port: match?.port ? Number(match.port) : null,
43+
user: parsed?.username,
44+
password: parsed?.password,
45+
database: parsed?.endpoint,
46+
server: parsed?.hosts[0]?.host,
47+
port: parsed?.hosts[0]?.port,
4948
};
5049
}
5150

server/utils/agents/aibitat/plugins/sql-agent/SQLConnectors/MySQL.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const mysql = require("mysql2/promise");
2-
const UrlPattern = require("url-pattern");
2+
const { ConnectionStringParser } = require("./utils");
33

44
class MySQLConnector {
55
#connected = false;
@@ -15,9 +15,9 @@ class MySQLConnector {
1515
}
1616

1717
#parseDatabase() {
18-
const connectionPattern = new UrlPattern("mysql\\://*@*/:database*");
19-
const match = connectionPattern.match(this.connectionString);
20-
return match?.database;
18+
const connectionParser = new ConnectionStringParser({ scheme: "mysql" });
19+
const parsed = connectionParser.parse(this.connectionString);
20+
return parsed?.endpoint;
2121
}
2222

2323
async connect() {

0 commit comments

Comments
 (0)