@@ -249,9 +249,9 @@ export function StatusIndicatorsExample() {
}
export const StatusIndicatorsExampleProps = {
- instanceUrl: '{from environment variables}',
+ apiBaseUrl: '{from environment variables}',
token: '{from environment variables}',
- flow: 'FlowData (status indicators)',
+ initialFlow: 'FlowData (status indicators)',
showDefaultHeader: false,
readOnly: true
}
diff --git a/packages/agentflow/package.json b/packages/agentflow/package.json
index 19a0b399e..2223bed15 100644
--- a/packages/agentflow/package.json
+++ b/packages/agentflow/package.json
@@ -27,8 +27,8 @@
"dev:example": "vite --config examples/vite.config.ts",
"format": "prettier --write \"{src,examples}/**/*.{ts,tsx,js,jsx,json,css,md}\"",
"format:check": "prettier --check \"{src,examples}/**/*.{ts,tsx,js,jsx,json,css,md}\"",
- "lint": "eslint \"{src,examples/src}/**/*.{js,jsx,ts,tsx}\"",
- "lint:fix": "eslint \"{src,examples/src}/**/*.{js,jsx,ts,tsx}\" --fix",
+ "lint": "eslint \"{src,examples/src}/**/*.{js,jsx,ts,tsx,json,md}\"",
+ "lint:fix": "eslint \"{src,examples/src}/**/*.{js,jsx,ts,tsx,json,md}\" --fix",
"test": "jest",
"test:watch": "jest --watch",
"test:coverage": "jest --coverage",
diff --git a/packages/agentflow/src/Agentflow.tsx b/packages/agentflow/src/Agentflow.tsx
index 3cf01f3dd..1dccd60ce 100644
--- a/packages/agentflow/src/Agentflow.tsx
+++ b/packages/agentflow/src/Agentflow.tsx
@@ -203,7 +203,7 @@ function AgentflowCanvas({
* function App() {
* return (
*
@@ -213,9 +213,9 @@ function AgentflowCanvas({
*/
export const Agentflow = forwardRef
(function Agentflow(props, ref) {
const {
- instanceUrl,
+ apiBaseUrl,
token,
- flow,
+ initialFlow,
components,
onFlowChange,
onSave,
@@ -231,17 +231,17 @@ export const Agentflow = forwardRef(function
return (
-
+
{children}
diff --git a/packages/agentflow/src/core/types/index.ts b/packages/agentflow/src/core/types/index.ts
index dc3953a0f..5876e3ae2 100644
--- a/packages/agentflow/src/core/types/index.ts
+++ b/packages/agentflow/src/core/types/index.ts
@@ -174,14 +174,14 @@ export interface PaletteRenderProps {
// ============================================================================
export interface AgentflowProps {
- /** Base URL of the Flowise server (e.g., "https://flowise-url.com") */
- instanceUrl: string
+ /** Flowise API server endpoint (e.g., "https://flowise-url.com") */
+ apiBaseUrl: string
/** Authentication token for API calls */
token?: string
/** Initial flow data to render */
- flow?: FlowData
+ initialFlow?: FlowData
/** Flow ID for loading existing flow */
flowId?: string
@@ -253,7 +253,7 @@ export interface AgentFlowInstance {
export interface ApiContextValue {
client: AxiosInstance
- instanceUrl: string
+ apiBaseUrl: string
}
export interface ConfigContextValue {
diff --git a/packages/agentflow/src/features/canvas/components/NodeIcon.tsx b/packages/agentflow/src/features/canvas/components/NodeIcon.tsx
index a343e3aa9..a72266f5b 100644
--- a/packages/agentflow/src/features/canvas/components/NodeIcon.tsx
+++ b/packages/agentflow/src/features/canvas/components/NodeIcon.tsx
@@ -5,10 +5,10 @@ import { renderNodeIcon } from '../nodeIcons'
export interface NodeIconProps {
data: NodeData
- instanceUrl: string
+ apiBaseUrl: string
}
-function NodeIconComponent({ data, instanceUrl }: NodeIconProps) {
+function NodeIconComponent({ data, apiBaseUrl }: NodeIconProps) {
if (data.color && !data.icon) {
return (
diff --git a/packages/agentflow/src/features/canvas/components/NodeModelConfigs.tsx b/packages/agentflow/src/features/canvas/components/NodeModelConfigs.tsx
index 167bb5b7a..eb5ffd139 100644
--- a/packages/agentflow/src/features/canvas/components/NodeModelConfigs.tsx
+++ b/packages/agentflow/src/features/canvas/components/NodeModelConfigs.tsx
@@ -17,7 +17,7 @@ export interface NodeModelConfigsProps {
* Displays model configuration badges on a node
*/
function NodeModelConfigsComponent({ inputs }: NodeModelConfigsProps) {
- const { instanceUrl } = useApiContext()
+ const { apiBaseUrl } = useApiContext()
const { isDarkMode } = useConfigContext()
if (!inputs) return null
@@ -51,7 +51,7 @@ function NodeModelConfigsComponent({ inputs }: NodeModelConfigsProps) {
>
{item.config?.modelName || item.config?.model}
diff --git a/packages/agentflow/src/features/canvas/containers/AgentFlowNode.tsx b/packages/agentflow/src/features/canvas/containers/AgentFlowNode.tsx
index 27a17d6ed..520f85311 100644
--- a/packages/agentflow/src/features/canvas/containers/AgentFlowNode.tsx
+++ b/packages/agentflow/src/features/canvas/containers/AgentFlowNode.tsx
@@ -24,7 +24,7 @@ export interface AgentFlowNodeProps {
*/
function AgentFlowNodeComponent({ data }: AgentFlowNodeProps) {
const { isDarkMode } = useConfigContext()
- const { instanceUrl } = useApiContext()
+ const { apiBaseUrl } = useApiContext()
const ref = useRef(null)
const updateNodeInternals = useUpdateNodeInternals()
@@ -99,7 +99,7 @@ function AgentFlowNodeComponent({ data }: AgentFlowNodeProps) {
-
+
(null)
const reactFlowWrapper = useRef(null)
@@ -83,7 +83,7 @@ function IterationNodeComponent({ data }: IterationNodeProps) {
setIsHovered(true)} onMouseLeave={() => setIsHovered(false)}>
-
+
{
diff --git a/packages/agentflow/src/features/node-palette/AddNodesDrawer.tsx b/packages/agentflow/src/features/node-palette/AddNodesDrawer.tsx
index 9b76f0ed3..5baef12c4 100644
--- a/packages/agentflow/src/features/node-palette/AddNodesDrawer.tsx
+++ b/packages/agentflow/src/features/node-palette/AddNodesDrawer.tsx
@@ -47,7 +47,7 @@ export interface AddNodesDrawerProps {
*/
function AddNodesDrawerComponent({ nodes, onDragStart, onNodeClick }: AddNodesDrawerProps) {
const theme = useTheme()
- const { instanceUrl } = useApiContext()
+ const { apiBaseUrl } = useApiContext()
const { isDarkMode: _isDarkMode } = useConfigContext()
const [searchValue, setSearchValue] = useState('')
@@ -331,7 +331,7 @@ function AddNodesDrawerComponent({ nodes, onDragStart, onNodeClick }: AddNodesDr
objectFit: 'contain'
}}
alt={node.name}
- src={`${instanceUrl}/api/v1/node-icon/${node.name}`}
+ src={`${apiBaseUrl}/api/v1/node-icon/${node.name}`}
/>
diff --git a/packages/agentflow/src/infrastructure/api/client.ts b/packages/agentflow/src/infrastructure/api/client.ts
index 7b8339b96..f7da80817 100644
--- a/packages/agentflow/src/infrastructure/api/client.ts
+++ b/packages/agentflow/src/infrastructure/api/client.ts
@@ -2,10 +2,10 @@ import axios, { AxiosInstance } from 'axios'
/**
* Creates a configured axios client for API calls
- * @param instanceUrl - Base URL of the Flowise server
+ * @param apiBaseUrl - Base URL of the Flowise server
* @param token - Authentication token (optional)
*/
-export function createApiClient(instanceUrl: string, token?: string): AxiosInstance {
+export function createApiClient(apiBaseUrl: string, token?: string): AxiosInstance {
const headers: Record = {
'Content-Type': 'application/json'
}
@@ -15,7 +15,7 @@ export function createApiClient(instanceUrl: string, token?: string): AxiosInsta
}
const client = axios.create({
- baseURL: `${instanceUrl}/api/v1`,
+ baseURL: `${apiBaseUrl}/api/v1`,
headers
})
diff --git a/packages/agentflow/src/infrastructure/store/ApiContext.tsx b/packages/agentflow/src/infrastructure/store/ApiContext.tsx
index cbee27380..bd07e012d 100644
--- a/packages/agentflow/src/infrastructure/store/ApiContext.tsx
+++ b/packages/agentflow/src/infrastructure/store/ApiContext.tsx
@@ -6,7 +6,7 @@ import { type ChatflowsApi, createApiClient, createChatflowsApi, createNodesApi,
interface ApiContextValue {
client: AxiosInstance
- instanceUrl: string
+ apiBaseUrl: string
nodesApi: NodesApi
chatflowsApi: ChatflowsApi
}
@@ -14,24 +14,24 @@ interface ApiContextValue {
const ApiContext = createContext(null)
interface ApiProviderProps {
- instanceUrl: string
+ apiBaseUrl: string
token?: string
children: ReactNode
}
-export function ApiProvider({ instanceUrl, token, children }: ApiProviderProps) {
+export function ApiProvider({ apiBaseUrl, token, children }: ApiProviderProps) {
const value = useMemo(() => {
- const client = createApiClient(instanceUrl, token)
+ const client = createApiClient(apiBaseUrl, token)
const nodesApi = createNodesApi(client)
const chatflowsApi = createChatflowsApi(client)
return {
client,
- instanceUrl,
+ apiBaseUrl,
nodesApi,
chatflowsApi
}
- }, [instanceUrl, token])
+ }, [apiBaseUrl, token])
return {children}
}