Skip to content

Commit 37b5f8b

Browse files
authored
Merge branch 'main' into feat/add-issue-templates
2 parents 4126798 + 1502646 commit 37b5f8b

File tree

13 files changed

+38
-38
lines changed

13 files changed

+38
-38
lines changed

apps/agent-tars/src/renderer/src/agent/AgentFlow.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ export class AgentFlow {
137137
async (event: GlobalEvent) => {
138138
switch (event.type) {
139139
case 'user-interrupt':
140-
await this.eventManager.addUserInteruptionInput(event.text);
140+
await this.eventManager.addUserInterruptionInput(event.text);
141141
this.interruptController.abort();
142142
await chatUtils.updateMessage(
143143
ChatMessageUtil.assistantOmegaMessage({

apps/agent-tars/src/renderer/src/agent/EventManager.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,8 @@ export class EventManager {
186186
/**
187187
* Add a user interrupt instruction event
188188
*/
189-
public async addUserInteruptionInput(text: string): Promise<EventItem> {
190-
return this.addEvent(EventType.UserInteruption, { text });
189+
public async addUserInterruptionInput(text: string): Promise<EventItem> {
190+
return this.addEvent(EventType.UserInterruption, { text });
191191
}
192192

193193
/**
@@ -409,12 +409,12 @@ export class EventManager {
409409
},
410410
};
411411

412-
case EventType.UserInteruption:
412+
case EventType.UserInterruption:
413413
return {
414414
...base,
415415
content: {
416416
text: (
417-
event.content as EventContentDescriptor[EventType.UserInteruption]
417+
event.content as EventContentDescriptor[EventType.UserInterruption]
418418
).text,
419419
},
420420
};

apps/agent-tars/src/renderer/src/agent/mockEvents.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1567,7 +1567,7 @@ export const events = [
15671567
},
15681568
{
15691569
id: 'ee4942bb-1a6e-4caf-86a7-d7b55c8f0134',
1570-
type: 'user-interuption',
1570+
type: 'user-interruption',
15711571
content: {
15721572
text: '直接到最后一步',
15731573
},

apps/agent-tars/src/renderer/src/components/AgentFlowMessage/EventRenderer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { ToolUsed } from './events/ToolUsed';
44
import { AgentStatus } from './events/AgentStatus';
55
import { ChatText } from './events/ChatText';
66
// import { Observation } from './events/Observation';
7-
import { UserInteruption } from './events/UserInteruption';
7+
import { UserInterruption } from './events/UserInterruption';
88
import { AgentFlowEnd } from './events/End';
99

1010
export function EventRenderer({
@@ -20,7 +20,7 @@ export function EventRenderer({
2020
[EventType.AgentStatus]: AgentStatus,
2121
[EventType.ChatText]: ChatText,
2222
// [EventType.Observation]: Observation,
23-
[EventType.UserInteruption]: UserInteruption,
23+
[EventType.UserInterruption]: UserInterruption,
2424
[EventType.End]: AgentFlowEnd,
2525
};
2626

apps/agent-tars/src/renderer/src/components/AgentFlowMessage/events/UserInteruption.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import relativeTime from 'dayjs/plugin/relativeTime';
66

77
dayjs.extend(relativeTime);
88

9-
export function UserInteruption({
9+
export function UserInterruption({
1010
event,
1111
isLastEvent,
1212
}: {

apps/agent-tars/src/renderer/src/type/event.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export enum EventType {
1010
ChatText = 'chat-text',
1111
Observation = 'observation',
1212
NewPlanStep = 'new-plan-step',
13-
UserInteruption = 'user-interuption',
13+
UserInterruption = 'user-interruption',
1414
End = 'end',
1515
}
1616

@@ -52,7 +52,7 @@ export interface EventContentDescriptor {
5252
};
5353
// When tools return the result, it will be displayed as an observation
5454
[EventType.Observation]: any;
55-
[EventType.UserInteruption]: {
55+
[EventType.UserInterruption]: {
5656
text: string;
5757
};
5858
[EventType.End]: {

packages/agent-infra/mcp-servers/commands/TODO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
- And, don't put any constraints on the memory other than a list of strings. Claude can do all that on his own (i.e. a line with `pythoh3` alone should be sufficient, in fact I could do some testing with that alone and see how Claude does)
88
- Another example would be `uname` on a Windows machine.
99
- These different scenarios aren't necessarily mission critical to fix but they offer an opportunity to improve the experience.
10-
- The solution may not be generalizable too and might be specific to commmand that fails, i.e. if I pass the OS name in the ListTools response, that will likely fix that issue.
10+
- The solution may not be generalizable too and might be specific to command that fails, i.e. if I pass the OS name in the ListTools response, that will likely fix that issue.
1111
- i.e. routinely `python` is used and then `python3`
1212
- Or, should I have some static mappings of common commands that fail and when they do, use the fallback? And find a way to tell the LLM? Or,
1313
- Or would some sort of command lookup mechanism be useful? i.e. python3 instead of python

packages/agent-infra/search/browser-search/examples/github-search.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { ConsoleLogger } from '@agent-infra/logger';
66
import { BrowserSearch } from '../src';
77

88
/**
9-
* We commmented github engine temporarily,
9+
* We commented github engine temporarily,
1010
* since it does not work,
1111
* we'll figure out later.
1212
*/

packages/ui-tars/sdk/src/Model.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { useContext } from './context/useContext';
1313
import { Model, type InvokeParams, type InvokeOutput } from './types';
1414

1515
import { preprocessResizeImage, convertToOpenAIMessages } from './utils';
16-
import { DEFUALT_FACTORS, MAX_PIXELS } from './constants';
16+
import { DEFAULT_FACTORS, MAX_PIXELS } from './constants';
1717

1818
type OpenAIChatCompletionCreateParams = Omit<ClientOptions, 'maxRetries'> &
1919
Pick<
@@ -31,7 +31,7 @@ export class UITarsModel extends Model {
3131

3232
/** [widthFactor, heightFactor] */
3333
get factors(): [number, number] {
34-
return DEFUALT_FACTORS;
34+
return DEFAULT_FACTORS;
3535
}
3636

3737
get modelName(): string {

packages/ui-tars/sdk/src/constants.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import type { AgentContext } from './types';
77
export type Factors = [number, number];
88

99
export const MAX_SNAPSHOT_ERR_CNT = 10;
10-
export const DEFUALT_FACTORS: Factors = [1000, 1000];
10+
export const DEFAULT_FACTORS: Factors = [1000, 1000];
1111
export const MAX_PIXELS = 1350 * 28 * 28;
1212
export const SYSTEM_PROMPT = `You are a GUI agent. You are given a task and your action history, with screenshots. You need to perform the next action to complete the task.
1313
@@ -37,7 +37,7 @@ call_user() # Submit the task and call the user when the task is unsolvable, or
3737

3838
export const DEFAULT_CONTEXT = {
3939
logger: console,
40-
factors: DEFUALT_FACTORS,
40+
factors: DEFAULT_FACTORS,
4141
systemPrompt: SYSTEM_PROMPT,
4242
} satisfies Partial<AgentContext>;
4343

packages/ui-tars/sdk/src/utils.test.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@
66
import { describe, expect, it } from 'vitest';
77

88
import { parseBoxToScreenCoords } from './utils';
9-
import { DEFUALT_FACTORS } from './constants';
9+
import { DEFAULT_FACTORS } from './constants';
1010

1111
describe('parseBoxToScreenCoords', () => {
1212
it('should correctly parse single point coordinates', () => {
1313
const result = parseBoxToScreenCoords({
1414
boxStr: '[0.5,0.5]',
1515
screenWidth: 1000,
1616
screenHeight: 800,
17-
factors: DEFUALT_FACTORS,
17+
factors: DEFAULT_FACTORS,
1818
});
1919
expect(result).toEqual({
20-
x: Math.round(0.5 * 1000 * DEFUALT_FACTORS[0]) / DEFUALT_FACTORS[0],
21-
y: Math.round(0.5 * 800 * DEFUALT_FACTORS[1]) / DEFUALT_FACTORS[1],
20+
x: Math.round(0.5 * 1000 * DEFAULT_FACTORS[0]) / DEFAULT_FACTORS[0],
21+
y: Math.round(0.5 * 800 * DEFAULT_FACTORS[1]) / DEFAULT_FACTORS[1],
2222
});
2323
});
2424

@@ -29,8 +29,8 @@ describe('parseBoxToScreenCoords', () => {
2929
screenHeight: 800,
3030
});
3131
expect(result).toEqual({
32-
x: Math.round(0.5 * 1000 * DEFUALT_FACTORS[0]) / DEFUALT_FACTORS[0],
33-
y: Math.round(0.5 * 800 * DEFUALT_FACTORS[1]) / DEFUALT_FACTORS[1],
32+
x: Math.round(0.5 * 1000 * DEFAULT_FACTORS[0]) / DEFAULT_FACTORS[0],
33+
y: Math.round(0.5 * 800 * DEFAULT_FACTORS[1]) / DEFAULT_FACTORS[1],
3434
});
3535
});
3636

@@ -39,11 +39,11 @@ describe('parseBoxToScreenCoords', () => {
3939
boxStr: '[0.2,0.3,0.4,0.5]',
4040
screenWidth: 1000,
4141
screenHeight: 800,
42-
factors: DEFUALT_FACTORS,
42+
factors: DEFAULT_FACTORS,
4343
});
4444
expect(result).toEqual({
45-
x: Math.round(0.3 * 1000 * DEFUALT_FACTORS[0]) / DEFUALT_FACTORS[0], // (0.2 + 0.4) / 2 = 0.3
46-
y: Math.round(0.4 * 800 * DEFUALT_FACTORS[1]) / DEFUALT_FACTORS[1], // (0.3 + 0.5) / 2 = 0.4
45+
x: Math.round(0.3 * 1000 * DEFAULT_FACTORS[0]) / DEFAULT_FACTORS[0], // (0.2 + 0.4) / 2 = 0.3
46+
y: Math.round(0.4 * 800 * DEFAULT_FACTORS[1]) / DEFAULT_FACTORS[1], // (0.3 + 0.5) / 2 = 0.4
4747
});
4848
});
4949

@@ -52,11 +52,11 @@ describe('parseBoxToScreenCoords', () => {
5252
boxStr: '[ 0.5 , 0.5 ]',
5353
screenWidth: 1000,
5454
screenHeight: 800,
55-
factors: DEFUALT_FACTORS,
55+
factors: DEFAULT_FACTORS,
5656
});
5757
expect(result).toEqual({
58-
x: Math.round(0.5 * 1000 * DEFUALT_FACTORS[0]) / DEFUALT_FACTORS[0],
59-
y: Math.round(0.5 * 800 * DEFUALT_FACTORS[1]) / DEFUALT_FACTORS[1],
58+
x: Math.round(0.5 * 1000 * DEFAULT_FACTORS[0]) / DEFAULT_FACTORS[0],
59+
y: Math.round(0.5 * 800 * DEFAULT_FACTORS[1]) / DEFAULT_FACTORS[1],
6060
});
6161
});
6262

@@ -65,11 +65,11 @@ describe('parseBoxToScreenCoords', () => {
6565
boxStr: '[1,1,2,2]',
6666
screenWidth: 1000,
6767
screenHeight: 800,
68-
factors: DEFUALT_FACTORS,
68+
factors: DEFAULT_FACTORS,
6969
});
7070
expect(result).toEqual({
71-
x: Math.round(1.5 * 1000 * DEFUALT_FACTORS[0]) / DEFUALT_FACTORS[0],
72-
y: Math.round(1.5 * 800 * DEFUALT_FACTORS[1]) / DEFUALT_FACTORS[1],
71+
x: Math.round(1.5 * 1000 * DEFAULT_FACTORS[0]) / DEFAULT_FACTORS[0],
72+
y: Math.round(1.5 * 800 * DEFAULT_FACTORS[1]) / DEFAULT_FACTORS[1],
7373
});
7474
});
7575

@@ -78,7 +78,7 @@ describe('parseBoxToScreenCoords', () => {
7878
boxStr: '',
7979
screenWidth: 1000,
8080
screenHeight: 800,
81-
factors: DEFUALT_FACTORS,
81+
factors: DEFAULT_FACTORS,
8282
});
8383
expect(result).toEqual({
8484
x: null,

packages/ui-tars/sdk/src/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { ChatCompletionMessageParam } from 'openai/resources/chat/completions';
77

88
import { IMAGE_PLACEHOLDER, MAX_IMAGE_LENGTH } from '@ui-tars/shared/constants';
99
import { Conversation, Message } from '@ui-tars/shared/types';
10-
import { DEFUALT_FACTORS, type Factors } from './constants';
10+
import { DEFAULT_FACTORS, type Factors } from './constants';
1111

1212
/**
1313
* Parse box string to screen coordinates
@@ -24,7 +24,7 @@ export const parseBoxToScreenCoords = ({
2424
boxStr,
2525
screenWidth,
2626
screenHeight,
27-
factors = DEFUALT_FACTORS,
27+
factors = DEFAULT_FACTORS,
2828
}: {
2929
boxStr: string;
3030
screenWidth: number;

packages/ui-tars/sdk/tests/GUIAgent.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { GUIAgentData, StatusEnum } from '../src';
1212
import { IMAGE_PLACEHOLDER } from '@ui-tars/shared/constants';
1313
import { UITarsModel } from '../src/Model';
1414
import { mockOpenAIResponse } from './testKits/index';
15-
import { DEFUALT_FACTORS } from '../src/constants';
15+
import { DEFAULT_FACTORS } from '../src/constants';
1616

1717
const getContext = vi.fn();
1818
vi.mock('openai', () => ({
@@ -80,7 +80,7 @@ describe('GUIAgent', () => {
8080

8181
expect(operator.execute).toBeCalledTimes(1);
8282
expect(operator.execute.mock.calls[0][0]).toEqual({
83-
factors: DEFUALT_FACTORS,
83+
factors: DEFAULT_FACTORS,
8484
parsedPrediction: {
8585
action_inputs: {
8686
start_box: '[0.072,0.646,0.072,0.646]',
@@ -387,7 +387,7 @@ describe('GUIAgent', () => {
387387

388388
expect(operator.execute).toBeCalledTimes(2);
389389
expect(operator.execute.mock.calls[0][0]).toEqual({
390-
factors: DEFUALT_FACTORS,
390+
factors: DEFAULT_FACTORS,
391391
parsedPrediction: {
392392
action_inputs: {
393393
start_box: '[0.072,0.646,0.072,0.646]',

0 commit comments

Comments
 (0)