@midscene/core 1.10.0 → 1.10.1-beta-20260624112700.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/agent/utils.mjs +1 -1
- package/dist/es/ai-model/workflows/planning/locate-normalization.mjs +1 -1
- package/dist/es/ai-model/workflows/planning/locate-normalization.mjs.map +1 -1
- package/dist/es/utils.mjs +2 -2
- package/dist/lib/agent/utils.js +1 -1
- package/dist/lib/ai-model/workflows/planning/locate-normalization.js +1 -1
- package/dist/lib/ai-model/workflows/planning/locate-normalization.js.map +1 -1
- package/dist/lib/utils.js +2 -2
- package/package.json +2 -2
package/dist/es/agent/utils.mjs
CHANGED
|
@@ -173,7 +173,7 @@ async function matchElementFromCache(context, cacheEntry, cachePrompt, cacheable
|
|
|
173
173
|
return;
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
|
-
const getMidsceneVersion = ()=>"1.10.0";
|
|
176
|
+
const getMidsceneVersion = ()=>"1.10.1-beta-20260624112700.0";
|
|
177
177
|
const parsePrompt = (prompt)=>{
|
|
178
178
|
if ('string' == typeof prompt) return {
|
|
179
179
|
textPrompt: prompt,
|
|
@@ -7,7 +7,7 @@ function normalizePlanningActionLocateFields(actions, { actionSpace, includeLoca
|
|
|
7
7
|
const actionInActionSpace = actionSpace.find((actionInSpace)=>actionInSpace.name === action.type);
|
|
8
8
|
if (!actionInActionSpace) return void debug('skip locate normalization for action outside actionSpace', action);
|
|
9
9
|
debug('actionInActionSpace matched', actionInActionSpace);
|
|
10
|
-
const locateFields =
|
|
10
|
+
const locateFields = findAllMidsceneLocatorField(actionInActionSpace.paramSchema);
|
|
11
11
|
debug('locateFields', locateFields);
|
|
12
12
|
locateFields.forEach((field)=>{
|
|
13
13
|
const locateResult = action.param?.[field];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-model/workflows/planning/locate-normalization.mjs","sources":["../../../../../src/ai-model/workflows/planning/locate-normalization.ts"],"sourcesContent":["import { findAllMidsceneLocatorField } from '@/common';\nimport type { DeviceAction } from '@/device';\nimport type { PlanningAction } from '@/types';\nimport { getDebug } from '@midscene/shared/logger';\nimport { assert } from '@midscene/shared/utils';\nimport type {\n LocateResultAdapter,\n LocateResultContext,\n} from '../../shared/model-locate-result/types';\n\nconst debug = getDebug('planning');\n\nexport function normalizePlanningActionLocateFields(\n actions: PlanningAction[],\n {\n actionSpace,\n includeLocateInPlanning,\n locateResultAdapter,\n locateResultContext,\n }: {\n actionSpace: DeviceAction[];\n includeLocateInPlanning: boolean;\n locateResultAdapter?: LocateResultAdapter;\n locateResultContext: LocateResultContext;\n },\n): void {\n actions.forEach((action) => {\n const actionInActionSpace = actionSpace.find(\n (actionInSpace) => actionInSpace.name === action.type,\n );\n if (!actionInActionSpace) {\n debug('skip locate normalization for action outside actionSpace', action);\n return;\n }\n\n debug('actionInActionSpace matched', actionInActionSpace);\n const locateFields =
|
|
1
|
+
{"version":3,"file":"ai-model/workflows/planning/locate-normalization.mjs","sources":["../../../../../src/ai-model/workflows/planning/locate-normalization.ts"],"sourcesContent":["import { findAllMidsceneLocatorField } from '@/common';\nimport type { DeviceAction } from '@/device';\nimport type { PlanningAction } from '@/types';\nimport { getDebug } from '@midscene/shared/logger';\nimport { assert } from '@midscene/shared/utils';\nimport type {\n LocateResultAdapter,\n LocateResultContext,\n} from '../../shared/model-locate-result/types';\n\nconst debug = getDebug('planning');\n\nexport function normalizePlanningActionLocateFields(\n actions: PlanningAction[],\n {\n actionSpace,\n includeLocateInPlanning,\n locateResultAdapter,\n locateResultContext,\n }: {\n actionSpace: DeviceAction[];\n includeLocateInPlanning: boolean;\n locateResultAdapter?: LocateResultAdapter;\n locateResultContext: LocateResultContext;\n },\n): void {\n actions.forEach((action) => {\n const actionInActionSpace = actionSpace.find(\n (actionInSpace) => actionInSpace.name === action.type,\n );\n if (!actionInActionSpace) {\n debug('skip locate normalization for action outside actionSpace', action);\n return;\n }\n\n debug('actionInActionSpace matched', actionInActionSpace);\n const locateFields = findAllMidsceneLocatorField(\n actionInActionSpace.paramSchema,\n );\n\n debug('locateFields', locateFields);\n\n locateFields.forEach((field) => {\n const locateResult = action.param?.[field];\n if (!locateResult) {\n return;\n }\n\n if (!includeLocateInPlanning) {\n if (typeof locateResult === 'object') {\n // In prompt-only planning mode, ignore any accidental coordinates from the model.\n action.param[field] = { prompt: locateResult.prompt };\n }\n return;\n }\n\n assert(\n locateResultAdapter,\n 'planning locate normalization requires a locate result adapter',\n );\n action.param[field] = {\n ...locateResult,\n locatedPixelBbox: locateResultAdapter.adaptPlanningParamToPixelBbox(\n locateResult,\n locateResultContext,\n ),\n };\n });\n });\n}\n"],"names":["debug","getDebug","normalizePlanningActionLocateFields","actions","actionSpace","includeLocateInPlanning","locateResultAdapter","locateResultContext","action","actionInActionSpace","actionInSpace","locateFields","findAllMidsceneLocatorField","field","locateResult","assert"],"mappings":";;;AAUA,MAAMA,QAAQC,SAAS;AAEhB,SAASC,oCACdC,OAAyB,EACzB,EACEC,WAAW,EACXC,uBAAuB,EACvBC,mBAAmB,EACnBC,mBAAmB,EAMpB;IAEDJ,QAAQ,OAAO,CAAC,CAACK;QACf,MAAMC,sBAAsBL,YAAY,IAAI,CAC1C,CAACM,gBAAkBA,cAAc,IAAI,KAAKF,OAAO,IAAI;QAEvD,IAAI,CAACC,qBAAqB,YACxBT,MAAM,4DAA4DQ;QAIpER,MAAM,+BAA+BS;QACrC,MAAME,eAAeC,4BACnBH,oBAAoB,WAAW;QAGjCT,MAAM,gBAAgBW;QAEtBA,aAAa,OAAO,CAAC,CAACE;YACpB,MAAMC,eAAeN,OAAO,KAAK,EAAE,CAACK,MAAM;YAC1C,IAAI,CAACC,cACH;YAGF,IAAI,CAACT,yBAAyB;gBAC5B,IAAI,AAAwB,YAAxB,OAAOS,cAETN,OAAO,KAAK,CAACK,MAAM,GAAG;oBAAE,QAAQC,aAAa,MAAM;gBAAC;gBAEtD;YACF;YAEAC,OACET,qBACA;YAEFE,OAAO,KAAK,CAACK,MAAM,GAAG;gBACpB,GAAGC,YAAY;gBACf,kBAAkBR,oBAAoB,6BAA6B,CACjEQ,cACAP;YAEJ;QACF;IACF;AACF"}
|