Skip to content

Commit 6c3cd74

Browse files
authored
docs(tarko): agent ui config api reference (#1653)
1 parent 1e168f3 commit 6c3cd74

File tree

11 files changed

+587
-11
lines changed

11 files changed

+587
-11
lines changed

multimodal/agent-tars/core/src/agent-tars.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export class AgentTARS<T extends AgentTARSOptions = AgentTARSOptions> extends MC
3232
static label = '@agent-tars/core';
3333

3434
/**
35-
* Default Web UI configuration for Agent TARS
35+
* Default Agent UI Configuration for Agent TARS
3636
*/
3737
static webuiConfig: AgentWebUIImplementation = {
3838
logo: 'https://lf3-static.bytednsdoc.com/obj/eden-cn/zyha-aulnh/ljhwZthlaukjlkulzlp/appicon.png',

multimodal/tarko/agent-server-next/src/utils/webui/config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import type { AgentServer } from '../../types';
99
/**
1010
* Merge web UI config with agent constructor config
1111
* This ensures consistent configuration merging across different contexts
12-
* @param baseWebUIConfig Base web UI configuration from app config
12+
* @param baseWebUIConfig Base Agent UI Configuration from app config
1313
* @param server Optional agent server instance to get constructor config
14-
* @returns Merged web UI configuration
14+
* @returns Merged Agent UI Configuration
1515
*/
1616
export function mergeWebUIConfig(
1717
baseWebUIConfig: AgentWebUIImplementation,

multimodal/tarko/agent-server/src/utils/webui/config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import type { AgentServer } from '../../server';
1010
/**
1111
* Merge web UI config with agent constructor config
1212
* This ensures consistent configuration merging across different contexts
13-
* @param baseWebUIConfig Base web UI configuration from app config
13+
* @param baseWebUIConfig Base Agent UI Configuration from app config
1414
* @param server Optional agent server instance to get constructor config
15-
* @returns Merged web UI configuration
15+
* @returns Merged Agent UI Configuration
1616
*/
1717
export function mergeWebUIConfig(
1818
baseWebUIConfig: AgentWebUIImplementation,

multimodal/tarko/agent-ui-builder/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ new AgentUIBuilder(input: AgentUIBuilderInputOptions)
112112
- `input.sessionInfo`: Session metadata
113113
- `input.staticPath?`: Optional path to static web UI files
114114
- `input.serverInfo?`: Optional server version info
115-
- `input.uiConfig?`: Optional web UI configuration
115+
- `input.uiConfig?`: Optional Agent UI Configuration
116116

117117
#### Methods
118118

multimodal/tarko/agent-ui-builder/src/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export interface AgentUIBuilderInputOptions {
2626
/** Optional server version info */
2727
serverInfo?: AgentServerVersionInfo;
2828

29-
/** Optional web UI configuration to inject */
29+
/** Optional Agent UI Configuration to inject */
3030
uiConfig?: AgentWebUIImplementation;
3131
}
3232

@@ -36,7 +36,7 @@ export interface AgentUIBuilderInputOptions {
3636
export interface UploadOptions {
3737
/** Custom slug for the share URL */
3838
slug?: string;
39-
39+
4040
/** Original user query for metadata */
4141
query?: string;
4242
}

multimodal/tarko/agent-ui/src/config/default-config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import type { BaseAgentWebUIImplementation } from '@tarko/interface';
88
const sandboxBaseUrl = location.host.includes('localhost') ? 'http://localhost:8080' : '';
99

1010
/**
11-
* Default Web UI configuration for standalone deployment
11+
* Default Agent UI Configuration for standalone deployment
1212
*/
1313
export const DEFAULT_WEBUI_CONFIG: BaseAgentWebUIImplementation = {
1414
logo: 'https://lf3-static.bytednsdoc.com/obj/eden-cn/zyha-aulnh/ljhwZthlaukjlkulzlp/icon.png',

multimodal/tarko/agent-ui/src/config/web-ui-config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ import type { BaseAgentWebUIImplementation } from '@tarko/interface';
99
import { ENV_CONFIG } from '@/common/constants';
1010

1111
/**
12-
* Get web UI configuration with enhanced multi-source loading
12+
* Get Agent UI Configuration with enhanced multi-source loading
1313
*/
1414
export function getWebUIConfig(): BaseAgentWebUIImplementation {
1515
const result = loadWebUIConfigSync();
1616
return result.config;
1717
}
1818

1919
/**
20-
* Get web UI configuration with enhanced multi-source loading
20+
* Get Agent UI Configuration with enhanced multi-source loading
2121
*/
2222
export function getWebUIRouteBase(): string {
2323
// Extract actual basename from current URL using shared utility

multimodal/websites/tarko/docs/en/api/_meta.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,10 @@
2323
"type": "file",
2424
"name": "hooks",
2525
"label": "Hooks"
26+
},
27+
{
28+
"type": "file",
29+
"name": "agent-ui-config",
30+
"label": "Agent UI Config"
2631
}
2732
]
Lines changed: 283 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,283 @@
1+
# Agent UI Config
2+
3+
The Agent UI Configuration API allows you to customize the Agent web interface appearance, layout, and behavior. Configure branding, welcome screens, navigation, and GUI Agent display options.
4+
5+
## Configuration Methods
6+
7+
### Via tarko.config.ts
8+
9+
Configure Web UI through the `webui` option in your `tarko.config.ts`:
10+
11+
```typescript
12+
// tarko.config.ts
13+
import { AgentAppConfig } from '@tarko/interface'
14+
15+
export default {
16+
// ... other config
17+
webui: {
18+
logo: 'https://example.com/logo.png',
19+
title: 'My Agent',
20+
subtitle: 'AI Assistant for Development',
21+
welcomTitle: 'Welcome to My Agent',
22+
welcomePrompts: [
23+
'Search for the latest GUI Agent papers',
24+
'Find information about UI TARS'
25+
]
26+
}
27+
} as AgentAppConfig
28+
```
29+
30+
### Via Agent Constructor
31+
32+
Set Agent UI Configuration through the static `webuiConfig` property:
33+
34+
```typescript
35+
// Agent class
36+
import { AgentWebUIImplementation } from '@tarko/interface'
37+
38+
export class MyAgent extends MCPAgent {
39+
static webuiConfig: AgentWebUIImplementation = {
40+
logo: 'https://example.com/logo.png',
41+
title: 'My Agent',
42+
workspace: {
43+
navItems: [
44+
{
45+
title: 'Code Editor',
46+
link: 'http://localhost:3000',
47+
icon: 'code'
48+
}
49+
]
50+
}
51+
}
52+
}
53+
```
54+
55+
## Configuration Options
56+
57+
### Basic Branding
58+
59+
#### logo
60+
61+
```typescript
62+
logo?: string
63+
```
64+
65+
Web UI logo URL. Displayed in the navigation bar.
66+
67+
**Default:** Tarko logo
68+
69+
#### title
70+
71+
```typescript
72+
title?: string
73+
```
74+
75+
Site title displayed in navbar and browser tab.
76+
77+
**Default:** Agent name
78+
79+
#### subtitle
80+
81+
```typescript
82+
subtitle?: string
83+
```
84+
85+
Subtitle for home page and SEO meta description.
86+
87+
#### welcomTitle
88+
89+
```typescript
90+
welcomTitle?: string
91+
```
92+
93+
Hero title displayed on the home page welcome screen.
94+
95+
### Welcome Screen
96+
97+
#### welcomePrompts
98+
99+
```typescript
100+
welcomePrompts?: string[]
101+
```
102+
103+
Array of suggested prompts displayed on the welcome screen.
104+
105+
**Example:**
106+
```typescript
107+
welcomePrompts: [
108+
'Search for the latest GUI Agent papers',
109+
'Find information about UI TARS',
110+
'Tell me the top 5 most popular projects on ProductHunt today'
111+
]
112+
```
113+
114+
#### welcomeCards
115+
116+
```typescript
117+
welcomeCards?: WelcomeCard[]
118+
```
119+
120+
Welcome screen cards with predefined prompts and Agent options.
121+
122+
**WelcomeCard Interface:**
123+
```typescript
124+
interface WelcomeCard {
125+
title: string // Card display title
126+
prompt: string // Prompt content
127+
image?: string // Background image URL
128+
category: string // Grouping category
129+
agentOptions?: Record<string, any> // Agent configuration
130+
}
131+
```
132+
133+
**Example:**
134+
```typescript
135+
welcomeCards: [
136+
{
137+
title: 'Code Review',
138+
prompt: 'Review my latest pull request',
139+
category: 'Development',
140+
image: 'https://images.unsplash.com/photo-1551288049-bebda4e38f71',
141+
agentOptions: { mode: 'review' }
142+
}
143+
]
144+
```
145+
146+
### Workspace Configuration
147+
148+
#### workspace
149+
150+
```typescript
151+
workspace?: {
152+
navItems?: WorkspaceNavItem[]
153+
}
154+
```
155+
156+
Workspace header navigation configuration.
157+
158+
**WorkspaceNavItem Interface:**
159+
```typescript
160+
interface WorkspaceNavItem {
161+
title: string // Display text
162+
link: string // URL to open in new tab
163+
icon?: WorkspaceNavItemIcon // Icon type
164+
}
165+
166+
type WorkspaceNavItemIcon = 'code' | 'monitor' | 'terminal' | 'browser' | 'desktop' | 'default'
167+
```
168+
169+
**Example:**
170+
```typescript
171+
workspace: {
172+
navItems: [
173+
{
174+
title: 'Code Server',
175+
link: 'http://localhost:8080',
176+
icon: 'code'
177+
},
178+
{
179+
title: 'VNC',
180+
link: 'http://localhost:6080',
181+
icon: 'monitor'
182+
}
183+
]
184+
}
185+
```
186+
187+
### Layout Configuration
188+
189+
#### layout
190+
191+
```typescript
192+
layout?: {
193+
defaultLayout?: LayoutMode
194+
enableLayoutSwitchButton?: boolean
195+
enableSidebar?: boolean
196+
enableHome?: boolean
197+
}
198+
```
199+
200+
Layout behavior and display options.
201+
202+
**LayoutMode:**
203+
```typescript
204+
type LayoutMode = 'default' | 'narrow-chat'
205+
```
206+
207+
**Properties:**
208+
- `defaultLayout` - Initial layout mode (default: `'default'`)
209+
- `default` - Standard layout with full workspace
210+
- `narrow-chat` - Compact chat-focused layout
211+
- `enableLayoutSwitchButton` - Show layout toggle in toolbar (default: `false`)
212+
- `enableSidebar` - Display sidebar panel (default: `true`)
213+
- `enableHome` - Register home route (default: `true`)
214+
215+
**Example:**
216+
```typescript
217+
layout: {
218+
defaultLayout: 'narrow-chat',
219+
enableLayoutSwitchButton: true,
220+
enableSidebar: true
221+
}
222+
```
223+
224+
### GUI Agent Configuration
225+
226+
#### guiAgent
227+
228+
```typescript
229+
guiAgent?: {
230+
defaultScreenshotRenderStrategy?: 'both' | 'beforeAction' | 'afterAction'
231+
enableScreenshotRenderStrategySwitch?: boolean
232+
renderGUIAction?: boolean
233+
renderBrowserShell?: boolean
234+
}
235+
```
236+
237+
GUI Agent display and screenshot rendering options.
238+
239+
**Properties:**
240+
- `defaultScreenshotRenderStrategy` - Screenshot display strategy (default: `'afterAction'`)
241+
- `both` - Show before and after screenshots for comparison
242+
- `beforeAction` - Show only pre-action screenshots (suitable for Agent-TARS)
243+
- `afterAction` - Show only post-action screenshots (suitable for Omni-TARS)
244+
- `enableScreenshotRenderStrategySwitch` - Allow runtime strategy switching (default: `false`)
245+
- `renderGUIAction` - Show GUI operation details card (default: `true`)
246+
- `renderBrowserShell` - Wrap screenshots in browser shell UI (default: `true`)
247+
248+
**Example:**
249+
```typescript
250+
guiAgent: {
251+
defaultScreenshotRenderStrategy: 'beforeAction',
252+
enableScreenshotRenderStrategySwitch: true,
253+
renderGUIAction: true,
254+
renderBrowserShell: false
255+
}
256+
```
257+
258+
### Advanced Options
259+
260+
#### enableContextualSelector
261+
262+
```typescript
263+
enableContextualSelector?: boolean
264+
```
265+
266+
Enable @ syntax file selector. When enabled, users can type @ in the input to search and select workspace files/directories.
267+
268+
**Default:** `false`
269+
270+
#### base
271+
272+
```typescript
273+
base?: string
274+
```
275+
276+
Base path for routing deployment. Supports both static paths and regex patterns.
277+
278+
**Examples:**
279+
```typescript
280+
base: "/agent-ui" // Static path
281+
base: "/tenant-.+" // Regex pattern
282+
base: "/(foo|bar)/app" // Regex with groups
283+
```

multimodal/websites/tarko/docs/zh/api/_meta.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,10 @@
2323
"type": "file",
2424
"name": "hooks",
2525
"label": "Hooks"
26+
},
27+
{
28+
"type": "file",
29+
"name": "agent-ui-config",
30+
"label": "Agent UI Config"
2631
}
2732
]

0 commit comments

Comments
 (0)