@@ -10,10 +10,6 @@ import {
1010 type ExecutionTask ,
1111 type ExecutionTaskLog ,
1212 type GroupedActionDump ,
13- Insight ,
14- type InsightAction ,
15- type InsightExtractOption ,
16- type InsightExtractParam ,
1713 type LocateOption ,
1814 type LocateResultElement ,
1915 type LocateValidatorResult ,
@@ -23,6 +19,10 @@ import {
2319 type PlanningAction ,
2420 type Rect ,
2521 type ScrollParam ,
22+ Service ,
23+ type ServiceAction ,
24+ type ServiceExtractOption ,
25+ type ServiceExtractParam ,
2626 type TUserPrompt ,
2727 type TaskRunner ,
2828 type UIContext ,
@@ -82,7 +82,7 @@ const includedInRect = (point: [number, number], rect: Rect) => {
8282 return x >= left && x <= left + width && y >= top && y <= top + height ;
8383} ;
8484
85- const defaultInsightExtractOption : InsightExtractOption = {
85+ const defaultServiceExtractOption : ServiceExtractOption = {
8686 domIncluded : false ,
8787 screenshotIncluded : true ,
8888} ;
@@ -107,7 +107,7 @@ export class Agent<
107107> {
108108 interface : InterfaceType ;
109109
110- insight : Insight ;
110+ service : Service ;
111111
112112 dump : GroupedActionDump ;
113113
@@ -245,7 +245,7 @@ export class Agent<
245245
246246 this . onTaskStartTip = this . opts . onTaskStartTip ;
247247
248- this . insight = new Insight ( async ( ) => {
248+ this . service = new Service ( async ( ) => {
249249 return this . getUIContext ( ) ;
250250 } ) ;
251251
@@ -263,7 +263,7 @@ export class Agent<
263263 ) ;
264264 }
265265
266- this . taskExecutor = new TaskExecutor ( this . interface , this . insight , {
266+ this . taskExecutor = new TaskExecutor ( this . interface , this . service , {
267267 taskCache : this . taskCache ,
268268 onTaskStart : this . callbackOnTaskStartTip . bind ( this ) ,
269269 replanningCycleLimit : this . opts . replanningCycleLimit ,
@@ -278,7 +278,7 @@ export class Agent<
278278 return this . interface . actionSpace ( ) ;
279279 }
280280
281- async getUIContext ( action ?: InsightAction ) : Promise < UIContext > {
281+ async getUIContext ( action ?: ServiceAction ) : Promise < UIContext > {
282282 // Check VL model configuration when UI context is first needed
283283 this . ensureVLModelWarning ( ) ;
284284
@@ -765,8 +765,8 @@ export class Agent<
765765 }
766766
767767 async aiQuery < ReturnType = any > (
768- demand : InsightExtractParam ,
769- opt : InsightExtractOption = defaultInsightExtractOption ,
768+ demand : ServiceExtractParam ,
769+ opt : ServiceExtractOption = defaultServiceExtractOption ,
770770 ) : Promise < ReturnType > {
771771 const modelConfig = this . modelConfigManager . getModelConfig ( 'VQA' ) ;
772772 const { output, runner } = await this . taskExecutor . createTypeQueryExecution (
@@ -781,7 +781,7 @@ export class Agent<
781781
782782 async aiBoolean (
783783 prompt : TUserPrompt ,
784- opt : InsightExtractOption = defaultInsightExtractOption ,
784+ opt : ServiceExtractOption = defaultServiceExtractOption ,
785785 ) : Promise < boolean > {
786786 const modelConfig = this . modelConfigManager . getModelConfig ( 'VQA' ) ;
787787
@@ -799,7 +799,7 @@ export class Agent<
799799
800800 async aiNumber (
801801 prompt : TUserPrompt ,
802- opt : InsightExtractOption = defaultInsightExtractOption ,
802+ opt : ServiceExtractOption = defaultServiceExtractOption ,
803803 ) : Promise < number > {
804804 const modelConfig = this . modelConfigManager . getModelConfig ( 'VQA' ) ;
805805
@@ -817,7 +817,7 @@ export class Agent<
817817
818818 async aiString (
819819 prompt : TUserPrompt ,
820- opt : InsightExtractOption = defaultInsightExtractOption ,
820+ opt : ServiceExtractOption = defaultServiceExtractOption ,
821821 ) : Promise < string > {
822822 const modelConfig = this . modelConfigManager . getModelConfig ( 'VQA' ) ;
823823
@@ -835,7 +835,7 @@ export class Agent<
835835
836836 async aiAsk (
837837 prompt : TUserPrompt ,
838- opt : InsightExtractOption = defaultInsightExtractOption ,
838+ opt : ServiceExtractOption = defaultServiceExtractOption ,
839839 ) : Promise < string > {
840840 return this . aiString ( prompt , opt ) ;
841841 }
@@ -873,7 +873,7 @@ export class Agent<
873873 // use same intent as aiLocate
874874 const modelConfig = this . modelConfigManager . getModelConfig ( 'grounding' ) ;
875875
876- const text = await this . insight . describe ( center , modelConfig , {
876+ const text = await this . service . describe ( center , modelConfig , {
877877 deepThink,
878878 } ) ;
879879 debug ( 'aiDescribe text' , text ) ;
@@ -961,15 +961,15 @@ export class Agent<
961961 async aiAssert (
962962 assertion : TUserPrompt ,
963963 msg ?: string ,
964- opt ?: AgentAssertOpt & InsightExtractOption ,
964+ opt ?: AgentAssertOpt & ServiceExtractOption ,
965965 ) {
966966 const modelConfig = this . modelConfigManager . getModelConfig ( 'VQA' ) ;
967967
968- const insightOpt : InsightExtractOption = {
969- domIncluded : opt ?. domIncluded ?? defaultInsightExtractOption . domIncluded ,
968+ const serviceOpt : ServiceExtractOption = {
969+ domIncluded : opt ?. domIncluded ?? defaultServiceExtractOption . domIncluded ,
970970 screenshotIncluded :
971971 opt ?. screenshotIncluded ??
972- defaultInsightExtractOption . screenshotIncluded ,
972+ defaultServiceExtractOption . screenshotIncluded ,
973973 doNotThrowError : opt ?. doNotThrowError ,
974974 } ;
975975
@@ -980,7 +980,7 @@ export class Agent<
980980 'Assert' ,
981981 textPrompt ,
982982 modelConfig ,
983- insightOpt ,
983+ serviceOpt ,
984984 multimodalPrompt ,
985985 ) ;
986986 await this . afterTaskRunning ( runner , true ) ;
0 commit comments