@midscene/core 1.17.2 → 1.17.3

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.
Files changed (93) hide show
  1. package/dist/es/agent/utils.mjs +1 -1
  2. package/dist/es/ai-model/model-adapter/resolve.mjs +2 -2
  3. package/dist/es/ai-model/model-adapter/resolve.mjs.map +1 -1
  4. package/dist/es/ai-model/models/ant-ling/adapter.mjs +51 -0
  5. package/dist/es/ai-model/models/ant-ling/adapter.mjs.map +1 -0
  6. package/dist/es/ai-model/models/jev/adapter.mjs +1 -1
  7. package/dist/es/ai-model/models/jev/adapter.mjs.map +1 -1
  8. package/dist/es/ai-model/models/model-fallback.mjs +2 -2
  9. package/dist/es/ai-model/models/model-fallback.mjs.map +1 -1
  10. package/dist/es/ai-model/models/registry.mjs +2 -0
  11. package/dist/es/ai-model/models/registry.mjs.map +1 -1
  12. package/dist/es/dump/execution-recorder.mjs +70 -0
  13. package/dist/es/dump/execution-recorder.mjs.map +1 -0
  14. package/dist/es/dump/html-utils.mjs +51 -1
  15. package/dist/es/dump/html-utils.mjs.map +1 -1
  16. package/dist/es/dump/report-artifact-reader.mjs +85 -0
  17. package/dist/es/dump/report-artifact-reader.mjs.map +1 -0
  18. package/dist/es/dump/report-artifact-store.mjs +164 -0
  19. package/dist/es/dump/report-artifact-store.mjs.map +1 -0
  20. package/dist/es/dump/screenshot-store.mjs +40 -15
  21. package/dist/es/dump/screenshot-store.mjs.map +1 -1
  22. package/dist/es/dump/test-report-images.mjs +120 -0
  23. package/dist/es/dump/test-report-images.mjs.map +1 -0
  24. package/dist/es/report-cli.mjs +8 -7
  25. package/dist/es/report-cli.mjs.map +1 -1
  26. package/dist/es/report-generator.mjs +56 -47
  27. package/dist/es/report-generator.mjs.map +1 -1
  28. package/dist/es/report-html-template.mjs +1 -1
  29. package/dist/es/report.mjs +29 -55
  30. package/dist/es/report.mjs.map +1 -1
  31. package/dist/es/test-run-report.mjs.map +1 -1
  32. package/dist/es/utils.mjs +1 -1
  33. package/dist/lib/agent/utils.js +1 -1
  34. package/dist/lib/ai-model/model-adapter/resolve.js +2 -2
  35. package/dist/lib/ai-model/model-adapter/resolve.js.map +1 -1
  36. package/dist/lib/ai-model/models/ant-ling/adapter.js +85 -0
  37. package/dist/lib/ai-model/models/ant-ling/adapter.js.map +1 -0
  38. package/dist/lib/ai-model/models/jev/adapter.js +1 -1
  39. package/dist/lib/ai-model/models/jev/adapter.js.map +1 -1
  40. package/dist/lib/ai-model/models/model-fallback.js +2 -2
  41. package/dist/lib/ai-model/models/model-fallback.js.map +1 -1
  42. package/dist/lib/ai-model/models/registry.js +4 -2
  43. package/dist/lib/ai-model/models/registry.js.map +1 -1
  44. package/dist/lib/dump/execution-recorder.js +104 -0
  45. package/dist/lib/dump/execution-recorder.js.map +1 -0
  46. package/dist/lib/dump/html-utils.js +67 -5
  47. package/dist/lib/dump/html-utils.js.map +1 -1
  48. package/dist/lib/dump/report-artifact-reader.js +134 -0
  49. package/dist/lib/dump/report-artifact-reader.js.map +1 -0
  50. package/dist/lib/dump/report-artifact-store.js +204 -0
  51. package/dist/lib/dump/report-artifact-store.js.map +1 -0
  52. package/dist/lib/dump/screenshot-store.js +42 -14
  53. package/dist/lib/dump/screenshot-store.js.map +1 -1
  54. package/dist/lib/dump/test-report-images.js +154 -0
  55. package/dist/lib/dump/test-report-images.js.map +1 -0
  56. package/dist/lib/report-cli.js +8 -7
  57. package/dist/lib/report-cli.js.map +1 -1
  58. package/dist/lib/report-generator.js +54 -45
  59. package/dist/lib/report-generator.js.map +1 -1
  60. package/dist/lib/report-html-template.js +1 -1
  61. package/dist/lib/report.js +54 -56
  62. package/dist/lib/report.js.map +1 -1
  63. package/dist/lib/test-run-report.js.map +1 -1
  64. package/dist/lib/utils.js +1 -1
  65. package/dist/types/ai-model/model-adapter/resolve.d.ts +1 -1
  66. package/dist/types/ai-model/model-adapter/resolve.d.ts.map +1 -1
  67. package/dist/types/ai-model/model-adapter/types.d.ts +4 -2
  68. package/dist/types/ai-model/model-adapter/types.d.ts.map +1 -1
  69. package/dist/types/ai-model/models/ant-ling/adapter.d.ts +23 -0
  70. package/dist/types/ai-model/models/ant-ling/adapter.d.ts.map +1 -0
  71. package/dist/types/ai-model/models/jev/adapter.d.ts +1 -1
  72. package/dist/types/ai-model/models/registry.d.ts +20 -1
  73. package/dist/types/ai-model/models/registry.d.ts.map +1 -1
  74. package/dist/types/dump/execution-recorder.d.ts +23 -0
  75. package/dist/types/dump/execution-recorder.d.ts.map +1 -0
  76. package/dist/types/dump/html-utils.d.ts +9 -0
  77. package/dist/types/dump/html-utils.d.ts.map +1 -1
  78. package/dist/types/dump/report-artifact-reader.d.ts +19 -0
  79. package/dist/types/dump/report-artifact-reader.d.ts.map +1 -0
  80. package/dist/types/dump/report-artifact-store.d.ts +22 -0
  81. package/dist/types/dump/report-artifact-store.d.ts.map +1 -0
  82. package/dist/types/dump/screenshot-store.d.ts +6 -0
  83. package/dist/types/dump/screenshot-store.d.ts.map +1 -1
  84. package/dist/types/dump/test-report-images.d.ts +14 -0
  85. package/dist/types/dump/test-report-images.d.ts.map +1 -0
  86. package/dist/types/report-cli.d.ts.map +1 -1
  87. package/dist/types/report-generator.d.ts +4 -3
  88. package/dist/types/report-generator.d.ts.map +1 -1
  89. package/dist/types/report.d.ts +3 -0
  90. package/dist/types/report.d.ts.map +1 -1
  91. package/dist/types/test-run-report.d.ts +2 -0
  92. package/dist/types/test-run-report.d.ts.map +1 -1
  93. package/package.json +2 -2
@@ -193,7 +193,7 @@ async function matchElementFromCache(context, cacheEntry, cachePrompt, cacheable
193
193
  return;
194
194
  }
195
195
  }
196
- const getMidsceneVersion = ()=>"1.17.2";
196
+ const getMidsceneVersion = ()=>"1.17.3";
197
197
  const parsePrompt = (prompt)=>{
198
198
  if ('string' == typeof prompt) return {
199
199
  textPrompt: prompt,
@@ -57,7 +57,7 @@ function resolveImagePreprocess(imagePreprocess) {
57
57
  class ResolvedModelAdapter {
58
58
  constructor(config, modelFamily){
59
59
  _define_property(this, "modelType", void 0);
60
- _define_property(this, "supportedTaskTypes", void 0);
60
+ _define_property(this, "allowedTaskTypes", void 0);
61
61
  _define_property(this, "supportedProtocols", void 0);
62
62
  _define_property(this, "jsonParser", void 0);
63
63
  _define_property(this, "chatCompletion", void 0);
@@ -69,7 +69,7 @@ class ResolvedModelAdapter {
69
69
  _define_property(this, "planning", void 0);
70
70
  _define_property(this, "locate", void 0);
71
71
  this.modelType = config.modelType ?? 'generative';
72
- this.supportedTaskTypes = config.supportedTaskTypes;
72
+ this.allowedTaskTypes = config.allowedTaskTypes;
73
73
  this.supportedProtocols = config.supportedProtocols ?? [
74
74
  'openai-chat'
75
75
  ];
@@ -1 +1 @@
1
- {"version":3,"file":"ai-model/model-adapter/resolve.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../../src/ai-model/model-adapter/resolve.ts"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { parseModelResponseJson } from '../shared/json';\nimport { resolveChatCompletion } from './chat-completion';\nimport { buildDefaultCodexAppServerParams } from './codex-app-server';\nimport { resolveInsight } from './insight';\nimport type { InsightAdapter } from './insight-protocol';\nimport { resolveLocate } from './locate';\nimport { resolveCustomPlanningDefinition, resolvePlanning } from './planning';\nimport { resolveResponses } from './responses';\nimport type {\n BuildCodexAppServerParams,\n ChatCompletionAdapter,\n ImagePreprocessPolicy,\n JsonParser,\n LocateAdapter,\n ModelAdapter,\n ModelAdapterDefinition,\n PlanningAdapter,\n ResolveImageDetail,\n ResponsesAdapter,\n} from './types';\n\nconst defaultImageDetail: ResolveImageDetail = ({ imageDetail }) =>\n imageDetail ?? 'high';\n\nfunction resolveJsonParser(\n jsonParser: ModelAdapterDefinition['jsonParser'],\n): JsonParser {\n if (!jsonParser || jsonParser === 'lenient-json') {\n return parseModelResponseJson;\n }\n\n if (typeof jsonParser === 'function') {\n return jsonParser;\n }\n\n throw new Error(`Unknown json parser preset: ${jsonParser}`);\n}\n\nfunction resolveImagePreprocess(\n imagePreprocess: ModelAdapterDefinition['imagePreprocess'],\n): ImagePreprocessPolicy {\n return {\n padBlockSize: imagePreprocess?.padBlockSize,\n };\n}\n\nexport class ResolvedModelAdapter implements ModelAdapter {\n readonly modelType: ModelAdapter['modelType'];\n readonly supportedTaskTypes: ModelAdapter['supportedTaskTypes'];\n readonly supportedProtocols: ModelAdapter['supportedProtocols'];\n readonly jsonParser: JsonParser;\n readonly chatCompletion: ChatCompletionAdapter;\n readonly resolveImageDetail: ResolveImageDetail;\n readonly responses: ResponsesAdapter;\n readonly buildCodexAppServerParams: BuildCodexAppServerParams;\n readonly imagePreprocess: ImagePreprocessPolicy;\n readonly insight: InsightAdapter;\n readonly planning: PlanningAdapter;\n readonly locate: LocateAdapter;\n\n constructor(config: ModelAdapterDefinition, modelFamily: string) {\n this.modelType = config.modelType ?? 'generative';\n this.supportedTaskTypes = config.supportedTaskTypes;\n this.supportedProtocols = config.supportedProtocols ?? ['openai-chat'];\n this.jsonParser = resolveJsonParser(config.jsonParser);\n this.chatCompletion = resolveChatCompletion(config.chatCompletion);\n this.resolveImageDetail = config.resolveImageDetail ?? defaultImageDetail;\n this.responses = resolveResponses(config.responses);\n this.buildCodexAppServerParams =\n config.buildCodexAppServerParams ?? buildDefaultCodexAppServerParams;\n this.imagePreprocess = resolveImagePreprocess(config.imagePreprocess);\n this.insight = resolveInsight(config.insight, {\n jsonParser: this.jsonParser,\n });\n const customPlanner =\n config.planning?.kind === 'custom' ? config.planning.planner : undefined;\n const resolvedCustomPlanner = customPlanner\n ? resolveCustomPlanningDefinition(customPlanner)\n : undefined;\n this.locate = resolveLocate(config.locate, resolvedCustomPlanner, {\n jsonParser: this.jsonParser,\n });\n this.planning = resolvePlanning(\n config.planning,\n resolvedCustomPlanner,\n { jsonParser: this.jsonParser },\n this.locate.kind === 'standard'\n ? this.locate.element.resultCodec\n : undefined,\n );\n }\n}\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","defaultImageDetail","imageDetail","resolveJsonParser","jsonParser","parseModelResponseJson","Error","resolveImagePreprocess","imagePreprocess","ResolvedModelAdapter","config","modelFamily","resolveChatCompletion","resolveResponses","buildDefaultCodexAppServerParams","resolveInsight","customPlanner","undefined","resolvedCustomPlanner","resolveCustomPlanningDefinition","resolveLocate","resolvePlanning"],"mappings":";;;IAAAA,oBAAoB,CAAC,GAAG,CAAC,UAASC;QACjC,IAAI,IAAIC,OAAOD,WACR,IAAGD,oBAAoB,CAAC,CAACC,YAAYC,QAAQ,CAACF,oBAAoB,CAAC,CAAC,UAASE,MACzEC,OAAO,cAAc,CAAC,UAASD,KAAK;YAAE,YAAY;YAAM,KAAKD,UAAU,CAACC,IAAI;QAAC;IAGzF;;;ICNAF,oBAAoB,CAAC,GAAG,CAACI,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAACC,KAAKC;;;ICClFL,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,AAAkB,eAAlB,OAAOM,UAA0BA,OAAO,WAAW,EACrDH,OAAO,cAAc,CAAC,UAASG,OAAO,WAAW,EAAE;YAAE,OAAO;QAAS;QAEtEH,OAAO,cAAc,CAAC,UAAS,cAAc;YAAE,OAAO;QAAK;IAC5D;;;;;;;;;;;;;;;;;;;;;;;;ACeA,MAAMI,qBAAyC,CAAC,EAAEC,WAAW,EAAE,GAC7DA,eAAe;AAEjB,SAASC,kBACPC,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AC,UAAU;QAC7B;QACA,MAAMM,gBACJN,OAAO,QAAQ,EAAE,SAAS,WAAWA,OAAO,QAAQ,CAAC,OAAO,GAAGO;QACjE,MAAMC,wBAAwBF,gBAC1BG,AAAAA,IAAAA,qCAAAA,+BAAAA,AAAAA,EAAgCH,iBAChCC;QACJ,IAAI,CAAC,MAAM,GAAGG,AAAAA,IAAAA,mCAAAA,aAAAA,AAAAA,EAAcV,OAAO,MAAM,EAAEQ,uBAAuB;YAChE,YAAY,IAAI,CAAC,UAAU;QAC7B;QACA,IAAI,CAAC,QAAQ,GAAGG,AAAAA,IAAAA,qCAAAA,eAAAA,AAAAA,EACdX,OAAO,QAAQ,EACfQ,uBACA;YAAE,YAAY,IAAI,CAAC,UAAU;QAAC,GAC9B,AAAqB,eAArB,IAAI,CAAC,MAAM,CAAC,IAAI,GACZ,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,GAC/BD;IAER;AACF"}
1
+ {"version":3,"file":"ai-model/model-adapter/resolve.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../../src/ai-model/model-adapter/resolve.ts"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { parseModelResponseJson } from '../shared/json';\nimport { resolveChatCompletion } from './chat-completion';\nimport { buildDefaultCodexAppServerParams } from './codex-app-server';\nimport { resolveInsight } from './insight';\nimport type { InsightAdapter } from './insight-protocol';\nimport { resolveLocate } from './locate';\nimport { resolveCustomPlanningDefinition, resolvePlanning } from './planning';\nimport { resolveResponses } from './responses';\nimport type {\n BuildCodexAppServerParams,\n ChatCompletionAdapter,\n ImagePreprocessPolicy,\n JsonParser,\n LocateAdapter,\n ModelAdapter,\n ModelAdapterDefinition,\n PlanningAdapter,\n ResolveImageDetail,\n ResponsesAdapter,\n} from './types';\n\nconst defaultImageDetail: ResolveImageDetail = ({ imageDetail }) =>\n imageDetail ?? 'high';\n\nfunction resolveJsonParser(\n jsonParser: ModelAdapterDefinition['jsonParser'],\n): JsonParser {\n if (!jsonParser || jsonParser === 'lenient-json') {\n return parseModelResponseJson;\n }\n\n if (typeof jsonParser === 'function') {\n return jsonParser;\n }\n\n throw new Error(`Unknown json parser preset: ${jsonParser}`);\n}\n\nfunction resolveImagePreprocess(\n imagePreprocess: ModelAdapterDefinition['imagePreprocess'],\n): ImagePreprocessPolicy {\n return {\n padBlockSize: imagePreprocess?.padBlockSize,\n };\n}\n\nexport class ResolvedModelAdapter implements ModelAdapter {\n readonly modelType: ModelAdapter['modelType'];\n readonly allowedTaskTypes: ModelAdapter['allowedTaskTypes'];\n readonly supportedProtocols: ModelAdapter['supportedProtocols'];\n readonly jsonParser: JsonParser;\n readonly chatCompletion: ChatCompletionAdapter;\n readonly resolveImageDetail: ResolveImageDetail;\n readonly responses: ResponsesAdapter;\n readonly buildCodexAppServerParams: BuildCodexAppServerParams;\n readonly imagePreprocess: ImagePreprocessPolicy;\n readonly insight: InsightAdapter;\n readonly planning: PlanningAdapter;\n readonly locate: LocateAdapter;\n\n constructor(config: ModelAdapterDefinition, modelFamily: string) {\n this.modelType = config.modelType ?? 'generative';\n this.allowedTaskTypes = config.allowedTaskTypes;\n this.supportedProtocols = config.supportedProtocols ?? ['openai-chat'];\n this.jsonParser = resolveJsonParser(config.jsonParser);\n this.chatCompletion = resolveChatCompletion(config.chatCompletion);\n this.resolveImageDetail = config.resolveImageDetail ?? defaultImageDetail;\n this.responses = resolveResponses(config.responses);\n this.buildCodexAppServerParams =\n config.buildCodexAppServerParams ?? buildDefaultCodexAppServerParams;\n this.imagePreprocess = resolveImagePreprocess(config.imagePreprocess);\n this.insight = resolveInsight(config.insight, {\n jsonParser: this.jsonParser,\n });\n const customPlanner =\n config.planning?.kind === 'custom' ? config.planning.planner : undefined;\n const resolvedCustomPlanner = customPlanner\n ? resolveCustomPlanningDefinition(customPlanner)\n : undefined;\n this.locate = resolveLocate(config.locate, resolvedCustomPlanner, {\n jsonParser: this.jsonParser,\n });\n this.planning = resolvePlanning(\n config.planning,\n resolvedCustomPlanner,\n { jsonParser: this.jsonParser },\n this.locate.kind === 'standard'\n ? this.locate.element.resultCodec\n : undefined,\n );\n }\n}\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","defaultImageDetail","imageDetail","resolveJsonParser","jsonParser","parseModelResponseJson","Error","resolveImagePreprocess","imagePreprocess","ResolvedModelAdapter","config","modelFamily","resolveChatCompletion","resolveResponses","buildDefaultCodexAppServerParams","resolveInsight","customPlanner","undefined","resolvedCustomPlanner","resolveCustomPlanningDefinition","resolveLocate","resolvePlanning"],"mappings":";;;IAAAA,oBAAoB,CAAC,GAAG,CAAC,UAASC;QACjC,IAAI,IAAIC,OAAOD,WACR,IAAGD,oBAAoB,CAAC,CAACC,YAAYC,QAAQ,CAACF,oBAAoB,CAAC,CAAC,UAASE,MACzEC,OAAO,cAAc,CAAC,UAASD,KAAK;YAAE,YAAY;YAAM,KAAKD,UAAU,CAACC,IAAI;QAAC;IAGzF;;;ICNAF,oBAAoB,CAAC,GAAG,CAACI,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAACC,KAAKC;;;ICClFL,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,AAAkB,eAAlB,OAAOM,UAA0BA,OAAO,WAAW,EACrDH,OAAO,cAAc,CAAC,UAASG,OAAO,WAAW,EAAE;YAAE,OAAO;QAAS;QAEtEH,OAAO,cAAc,CAAC,UAAS,cAAc;YA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AuBG,OAAO,eAAe;QACpE,IAAI,CAAC,OAAO,GAAGK,AAAAA,IAAAA,oCAAAA,cAAAA,AAAAA,EAAeL,OAAO,OAAO,EAAE;YAC5C,YAAY,IAAI,CAAC,UAAU;QAC7B;QACA,MAAMM,gBACJN,OAAO,QAAQ,EAAE,SAAS,WAAWA,OAAO,QAAQ,CAAC,OAAO,GAAGO;QACjE,MAAMC,wBAAwBF,gBAC1BG,AAAAA,IAAAA,qCAAAA,+BAAAA,AAAAA,EAAgCH,iBAChCC;QACJ,IAAI,CAAC,MAAM,GAAGG,AAAAA,IAAAA,mCAAAA,aAAAA,AAAAA,EAAcV,OAAO,MAAM,EAAEQ,uBAAuB;YAChE,YAAY,IAAI,CAAC,UAAU;QAC7B;QACA,IAAI,CAAC,QAAQ,GAAGG,AAAAA,IAAAA,qCAAAA,eAAAA,AAAAA,EACdX,OAAO,QAAQ,EACfQ,uBACA;YAAE,YAAY,IAAI,CAAC,UAAU;QAAC,GAC9B,AAAqB,eAArB,IAAI,CAAC,MAAM,CAAC,IAAI,GACZ,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,GAC/BD;IAER;AACF"}
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ antLingAdapters: ()=>antLingAdapters
28
+ });
29
+ const buildAntLingChatCompletionParams = (input)=>{
30
+ const { midsceneDefaults, userConfig } = input;
31
+ const { reasoningEnabled } = userConfig;
32
+ return {
33
+ config: {
34
+ ...midsceneDefaults,
35
+ ...void 0 !== userConfig.temperature ? {
36
+ temperature: userConfig.temperature
37
+ } : {},
38
+ ...'none' !== userConfig.responseFormat && input.expectedJsonObjectResponse ? {
39
+ response_format: {
40
+ type: 'json_object'
41
+ }
42
+ } : {},
43
+ ...'default' !== reasoningEnabled ? {
44
+ thinking: {
45
+ type: reasoningEnabled ?? false ? 'enabled' : 'disabled'
46
+ }
47
+ } : {}
48
+ }
49
+ };
50
+ };
51
+ const antLingAdapters = {
52
+ 'ant-ling': {
53
+ supportedProtocols: [
54
+ 'openai-chat'
55
+ ],
56
+ chatCompletion: {
57
+ unsupportedUserConfig: [
58
+ 'reasoningEffort',
59
+ 'reasoningBudget'
60
+ ],
61
+ buildChatCompletionParams: buildAntLingChatCompletionParams
62
+ },
63
+ locate: {
64
+ element: {
65
+ resultFormat: {
66
+ resultKey: 'point',
67
+ coordinates: {
68
+ shape: 'point',
69
+ order: 'xy',
70
+ normalizedBy: 1000
71
+ }
72
+ }
73
+ }
74
+ }
75
+ }
76
+ };
77
+ exports.antLingAdapters = __webpack_exports__.antLingAdapters;
78
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
79
+ "antLingAdapters"
80
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
81
+ Object.defineProperty(exports, '__esModule', {
82
+ value: true
83
+ });
84
+
85
+ //# sourceMappingURL=adapter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-model/models/ant-ling/adapter.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../../../src/ai-model/models/ant-ling/adapter.ts"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import type { TModelFamily } from '@midscene/shared/env';\nimport type {\n ChatCompletionCallContext,\n ChatCompletionParamsResult,\n ModelAdapterDefinition,\n} from '../../model-adapter/types';\n\nconst buildAntLingChatCompletionParams = (\n input: ChatCompletionCallContext,\n): ChatCompletionParamsResult => {\n const { midsceneDefaults, userConfig } = input;\n const { reasoningEnabled } = userConfig;\n\n return {\n config: {\n ...midsceneDefaults,\n ...(userConfig.temperature !== undefined\n ? { temperature: userConfig.temperature }\n : {}),\n // https://developer.ant-ling.com/en/docs/tutorials/structured-outputs/\n ...(userConfig.responseFormat !== 'none' &&\n input.expectedJsonObjectResponse\n ? { response_format: { type: 'json_object' } }\n : {}),\n ...(reasoningEnabled !== 'default'\n ? {\n thinking: {\n type: (reasoningEnabled ?? false) ? 'enabled' : 'disabled',\n },\n }\n : {}),\n },\n };\n};\n\nexport const antLingAdapters = {\n 'ant-ling': {\n supportedProtocols: ['openai-chat'],\n chatCompletion: {\n unsupportedUserConfig: ['reasoningEffort', 'reasoningBudget'],\n buildChatCompletionParams: buildAntLingChatCompletionParams,\n },\n locate: {\n element: {\n resultFormat: {\n resultKey: 'point',\n coordinates: {\n shape: 'point',\n order: 'xy',\n normalizedBy: 1000,\n },\n },\n },\n },\n },\n} satisfies Pick<Record<TModelFamily, ModelAdapterDefinition>, 'ant-ling'>;\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","buildAntLingChatCompletionParams","input","midsceneDefaults","userConfig","reasoningEnabled","undefined","antLingAdapters"],"mappings":";;;IAAAA,oBAAoB,CAAC,GAAG,CAAC,UAASC;QACjC,IAAI,IAAIC,OAAOD,WACR,IAAGD,oBAAoB,CAAC,CAACC,YAAYC,QAAQ,CAACF,oBAAoB,CAAC,CAAC,UAASE,MACzEC,OAAO,cAAc,CAAC,UAASD,KAAK;YAAE,YAAY;YAAM,KAAKD,UAAU,CAACC,IAAI;QAAC;IAGzF;;;ICNAF,oBAAoB,CAAC,GAAG,CAACI,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAACC,KAAKC;;;ICClFL,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,AAAkB,eAAlB,OAAOM,UAA0BA,OAAO,WAAW,EACrDH,OAAO,cAAc,CAAC,UAASG,OAAO,WAAW,EAAE;YAAE,OAAO;QAAS;QAEtEH,OAAO,cAAc,CAAC,UAAS,cAAc;YAAE,OAAO;QAAK;IAC5D;;;;;;;ACCA,MAAMI,mCAAmC,CACvCC;IAEA,MAAM,EAAEC,gBAAgB,EAAEC,UAAU,EAAE,GAAGF;IACzC,MAAM,EAAEG,gBAAgB,EAAE,GAAGD;IAE7B,OAAO;QACL,QAAQ;YACN,GAAGD,gBAAgB;YACnB,GAAIC,AAA2BE,WAA3BF,WAAW,WAAW,GACtB;gBAAE,aAAaA,WAAW,WAAW;YAAC,IACtC,CAAC,CAAC;YAEN,GAAIA,AAA8B,WAA9BA,WAAW,cAAc,IAC7BF,MAAM,0BAA0B,GAC5B;gBAAE,iBAAiB;oBAAE,MAAM;gBAAc;YAAE,IAC3C,CAAC,CAAC;YACN,GAAIG,AAAqB,cAArBA,mBACA;gBACE,UAAU;oBACR,MAAOA,oBAAoB,QAAS,YAAY;gBAClD;YACF,IACA,CAAC,CAAC;QACR;IACF;AACF;AAEO,MAAME,kBAAkB;IAC7B,YAAY;QACV,oBAAoB;YAAC;SAAc;QACnC,gBAAgB;YACd,uBAAuB;gBAAC;gBAAmB;aAAkB;YAC7D,2BAA2BN;QAC7B;QACA,QAAQ;YACN,SAAS;gBACP,cAAc;oBACZ,WAAW;oBACX,aAAa;wBACX,OAAO;wBACP,OAAO;wBACP,cAAc;oBAChB;gBACF;YACF;QACF;IACF;AACF"}
@@ -32,7 +32,7 @@ const external_planning_js_namespaceObject = require("./planning.js");
32
32
  const jevAdapters = {
33
33
  jev: {
34
34
  modelType: 'system-one',
35
- supportedTaskTypes: [
35
+ allowedTaskTypes: [
36
36
  'locate',
37
37
  'boolean',
38
38
  'planning'
@@ -1 +1 @@
1
- {"version":3,"file":"ai-model/models/jev/adapter.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../../../src/ai-model/models/jev/adapter.ts"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import type { TModelFamily } from '@midscene/shared/env';\nimport type { ModelAdapterDefinition } from '../../model-adapter/types';\nimport { jevBoolean } from './boolean';\nimport { jevLocate } from './locate';\nimport { jevPlan } from './planning';\n\nexport const jevAdapters = {\n jev: {\n modelType: 'system-one',\n supportedTaskTypes: ['locate', 'boolean', 'planning'],\n supportedProtocols: [],\n locate: { kind: 'custom', locateFn: jevLocate },\n insight: { booleanFn: jevBoolean },\n planning: {\n kind: 'custom',\n planFn: jevPlan,\n cacheEnabled: false,\n supportsActionDeepLocate: false,\n defaultReplanningCycleLimit: 20,\n },\n },\n} satisfies Pick<Record<TModelFamily, ModelAdapterDefinition>, 'jev'>;\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","jevAdapters","jevLocate","jevBoolean","jevPlan"],"mappings":";;;IAAAA,oBAAoB,CAAC,GAAG,CAAC,UAASC;QACjC,IAAI,IAAIC,OAAOD,WACR,IAAGD,oBAAoB,CAAC,CAACC,YAAYC,QAAQ,CAACF,oBAAoB,CAAC,CAAC,UAASE,MACzEC,OAAO,cAAc,CAAC,UAASD,KAAK;YAAE,YAAY;YAAM,KAAKD,UAAU,CAACC,IAAI;QAAC;IAGzF;;;ICNAF,oBAAoB,CAAC,GAAG,CAACI,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAACC,KAAKC;;;ICClFL,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,AAAkB,eAAlB,OAAOM,UAA0BA,OAAO,WAAW,EACrDH,OAAO,cAAc,CAAC,UAASG,OAAO,WAAW,EAAE;YAAE,OAAO;QAAS;QAEtEH,OAAO,cAAc,CAAC,UAAS,cAAc;YAAE,OAAO;QAAK;IAC5D;;;;;;;;;;ACAO,MAAMI,cAAc;IACzB,KAAK;QACH,WAAW;QACX,oBAAoB;YAAC;YAAU;YAAW;SAAW;QACrD,oBAAoB,EAAE;QACtB,QAAQ;YAAE,MAAM;YAAU,UAAUC,mCAAAA,SAASA;QAAC;QAC9C,SAAS;YAAE,WAAWC,oCAAAA,UAAUA;QAAC;QACjC,UAAU;YACR,MAAM;YACN,QAAQC,qCAAAA,OAAOA;YACf,cAAc;YACd,0BAA0B;YAC1B,6BAA6B;QAC/B;IACF;AACF"}
1
+ {"version":3,"file":"ai-model/models/jev/adapter.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../../../src/ai-model/models/jev/adapter.ts"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import type { TModelFamily } from '@midscene/shared/env';\nimport type { ModelAdapterDefinition } from '../../model-adapter/types';\nimport { jevBoolean } from './boolean';\nimport { jevLocate } from './locate';\nimport { jevPlan } from './planning';\n\nexport const jevAdapters = {\n jev: {\n modelType: 'system-one',\n allowedTaskTypes: ['locate', 'boolean', 'planning'],\n supportedProtocols: [],\n locate: { kind: 'custom', locateFn: jevLocate },\n insight: { booleanFn: jevBoolean },\n planning: {\n kind: 'custom',\n planFn: jevPlan,\n cacheEnabled: false,\n supportsActionDeepLocate: false,\n defaultReplanningCycleLimit: 20,\n },\n },\n} satisfies Pick<Record<TModelFamily, ModelAdapterDefinition>, 'jev'>;\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","jevAdapters","jevLocate","jevBoolean","jevPlan"],"mappings":";;;IAAAA,oBAAoB,CAAC,GAAG,CAAC,UAASC;QACjC,IAAI,IAAIC,OAAOD,WACR,IAAGD,oBAAoB,CAAC,CAACC,YAAYC,QAAQ,CAACF,oBAAoB,CAAC,CAAC,UAASE,MACzEC,OAAO,cAAc,CAAC,UAASD,KAAK;YAAE,YAAY;YAAM,KAAKD,UAAU,CAACC,IAAI;QAAC;IAGzF;;;ICNAF,oBAAoB,CAAC,GAAG,CAACI,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAACC,KAAKC;;;ICClFL,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,AAAkB,eAAlB,OAAOM,UAA0BA,OAAO,WAAW,EACrDH,OAAO,cAAc,CAAC,UAASG,OAAO,WAAW,EAAE;YAAE,OAAO;QAAS;QAEtEH,OAAO,cAAc,CAAC,UAAS,cAAc;YAAE,OAAO;QAAK;IAC5D;;;;;;;;;;ACAO,MAAMI,cAAc;IACzB,KAAK;QACH,WAAW;QACX,kBAAkB;YAAC;YAAU;YAAW;SAAW;QACnD,oBAAoB,EAAE;QACtB,QAAQ;YAAE,MAAM;YAAU,UAAUC,mCAAAA,SAASA;QAAC;QAC9C,SAAS;YAAE,WAAWC,oCAAAA,UAAUA;QAAC;QACjC,UAAU;YACR,MAAM;YACN,QAAQC,qCAAAA,OAAOA;YACf,cAAc;YACd,0BAA0B;YAC1B,6BAA6B;QAC/B;IACF;AACF"}
@@ -30,13 +30,13 @@ const logger_namespaceObject = require("@midscene/shared/logger");
30
30
  const external_registry_js_namespaceObject = require("./registry.js");
31
31
  function resolveModelForTaskType(configs, intent, taskType) {
32
32
  const requested = (0, external_registry_js_namespaceObject.getModelRuntime)(configs.getModelConfig(intent));
33
- if (!requested.adapter.supportedTaskTypes || requested.adapter.supportedTaskTypes.includes(taskType)) return requested;
33
+ if (!requested.adapter.allowedTaskTypes || requested.adapter.allowedTaskTypes.includes(taskType)) return requested;
34
34
  const config = configs.getModelConfig('default');
35
35
  const runtime = (0, external_registry_js_namespaceObject.getModelRuntime)({
36
36
  ...config,
37
37
  intent
38
38
  });
39
- if (runtime.adapter.supportedTaskTypes && !runtime.adapter.supportedTaskTypes.includes(taskType)) throw new Error(`The default model cannot perform ${taskType}. Configure a general-purpose default model.`);
39
+ if (runtime.adapter.allowedTaskTypes && !runtime.adapter.allowedTaskTypes.includes(taskType)) throw new Error(`The default model cannot perform ${taskType}. Configure a general-purpose default model.`);
40
40
  const reason = `${requested.config.modelFamily} does not support ${taskType}; using the default model`;
41
41
  (0, logger_namespaceObject.getDebug)('ai:model-fallback', {
42
42
  console: true
@@ -1 +1 @@
1
- {"version":3,"file":"ai-model/models/model-fallback.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../../src/ai-model/models/model-fallback.ts"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import type { IModelConfig, TIntent } from '@midscene/shared/env';\nimport { getDebug } from '@midscene/shared/logger';\nimport type { ModelRuntime, ModelTaskType } from '../model-adapter/types';\nimport { getModelRuntime } from './registry';\n\nexport function resolveModelForTaskType(\n configs: { getModelConfig(intent: TIntent): IModelConfig },\n intent: TIntent,\n taskType: ModelTaskType,\n): ModelRuntime {\n const requested = getModelRuntime(configs.getModelConfig(intent));\n if (\n !requested.adapter.supportedTaskTypes ||\n requested.adapter.supportedTaskTypes.includes(taskType)\n ) {\n return requested;\n }\n const config = configs.getModelConfig('default');\n const runtime = getModelRuntime({ ...config, intent });\n if (\n runtime.adapter.supportedTaskTypes &&\n !runtime.adapter.supportedTaskTypes.includes(taskType)\n ) {\n throw new Error(\n `The default model cannot perform ${taskType}. Configure a general-purpose default model.`,\n );\n }\n const reason = `${requested.config.modelFamily} does not support ${taskType}; using the default model`;\n getDebug('ai:model-fallback', { console: true })(reason);\n return {\n ...runtime,\n modelFallback: {\n requestedModel: requested.config.modelName,\n requestedSlot: requested.config.slot,\n taskType,\n reason,\n },\n };\n}\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","resolveModelForTaskType","configs","intent","taskType","requested","getModelRuntime","config","runtime","Error","reason","getDebug"],"mappings":";;;IAAAA,oBAAoB,CAAC,GAAG,CAAC,UAASC;QACjC,IAAI,IA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,GAAGD;IACjD,OAAO;QACL,GAAGF,OAAO;QACV,eAAe;YACb,gBAAgBH,UAAU,MAAM,CAAC,SAAS;YAC1C,eAAeA,UAAU,MAAM,CAAC,IAAI;YACpCD;YACAM;QACF;IACF;AACF"}
1
+ {"version":3,"file":"ai-model/models/model-fallback.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../../src/ai-model/models/model-fallback.ts"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import type { IModelConfig, TIntent } from '@midscene/shared/env';\nimport { getDebug } from '@midscene/shared/logger';\nimport type { ModelRuntime, ModelTaskType } from '../model-adapter/types';\nimport { getModelRuntime } from './registry';\n\nexport function resolveModelForTaskType(\n configs: { getModelConfig(intent: TIntent): IModelConfig },\n intent: TIntent,\n taskType: ModelTaskType,\n): ModelRuntime {\n const requested = getModelRuntime(configs.getModelConfig(intent));\n if (\n !requested.adapter.allowedTaskTypes ||\n requested.adapter.allowedTaskTypes.includes(taskType)\n ) {\n return requested;\n }\n const config = configs.getModelConfig('default');\n const runtime = getModelRuntime({ ...config, intent });\n if (\n runtime.adapter.allowedTaskTypes &&\n !runtime.adapter.allowedTaskTypes.includes(taskType)\n ) {\n throw new Error(\n `The default model cannot perform ${taskType}. Configure a general-purpose default model.`,\n );\n }\n const reason = `${requested.config.modelFamily} does not support ${taskType}; using the default model`;\n getDebug('ai:model-fallback', { console: true })(reason);\n return {\n ...runtime,\n modelFallback: {\n requestedModel: requested.config.modelName,\n requestedSlot: requested.config.slot,\n taskType,\n reason,\n },\n };\n}\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","resolveModelForTaskType","configs","intent","taskType","requested","getModelRuntime","config","runtime","Error","reason","getDebug"],"mappings":";;;IAAAA,oBAAoB,CAAC,GAAG,CAAC,UAASC;QACjC,IAAI,IAAIC,OAAOD,WACR,IAAGD,oBAAoB,CAAC,CAACC,YAAYC,QAAQ,CAACF,oBAAoB,CAAC,CAAC,UAASE,MACzEC,OAAO,cAAc,CAAC,UAASD,KAAK;YAAE,YAAY;YAAM,KAAKD,UAAU,CAACC,IAAI;QAAC;IAGzF;;;ICNAF,oBAAoB,CAAC,GAAG,CAACI,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAACC,KAAKC;;;ICClFL,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,AAAkB,eAAlB,OAAOM,UAA0BA,OAAO,WAAW,EACrDH,OAAO,cAAc,CAAC,UAASG,OAAO,WAAW,EAAE;YAAE,OAAO;QAAS;QAEtEH,OAAO,cAAc,CAAC,UAAS,cAAc;YAAE,OAAO;QAAK;IAC5D;;;;;;;;;ACDO,SAASI,wBACdC,OAA0D,EAC1DC,MAAe,EACfC,QAAuB;IAEvB,MAAMC,YAAYC,AAAAA,IAAAA,qCAAAA,eAAAA,AAAAA,EAAgBJ,QAAQ,cAAc,CAACC;IACzD,IACE,CAACE,UAAU,OAAO,CAAC,gBAAgB,IACnCA,UAAU,OAAO,CAAC,gBAAgB,CAAC,QAAQ,CAACD,WAE5C,OAAOC;IAET,MAAME,SAASL,QAAQ,cAAc,CAAC;IACtC,MAAMM,UAAUF,AAAAA,IAAAA,qCAAAA,eAAAA,AAAAA,EAAgB;QAAE,GAAGC,MAAM;QAAEJ;IAAO;IACpD,IACEK,QAAQ,OAAO,CAAC,gBAAgB,IAChC,CAACA,QAAQ,OAAO,CAAC,gBAAgB,CAAC,QAAQ,CAACJ,WAE3C,MAAM,IAAIK,MACR,CAAC,iCAAiC,EAAEL,SAAS,4CAA4C,CAAC;IAG9F,MAAMM,SAAS,GAAGL,UAAU,MAAM,CAAC,WAAW,CAAC,kBAAkB,EAAED,SAAS,yBAAyB,CAAC;IACtGO,IAAAA,uBAAAA,QAAAA,AAAAA,EAAS,qBAAqB;QAAE,SAAS;IAAK,GAAGD;IACjD,OAAO;QACL,GAAGF,OAAO;QACV,eAAe;YACb,gBAAgBH,UAAU,MAAM,CAAC,SAAS;YAC1C,eAAeA,UAAU,MAAM,CAAC,IAAI;YACpCD;YACAM;QACF;IACF;AACF"}
@@ -30,7 +30,8 @@ __webpack_require__.d(__webpack_exports__, {
30
30
  });
31
31
  const logger_namespaceObject = require("@midscene/shared/logger");
32
32
  const resolve_js_namespaceObject = require("../model-adapter/resolve.js");
33
- const adapter_js_namespaceObject = require("./auto-glm/adapter.js");
33
+ const adapter_js_namespaceObject = require("./ant-ling/adapter.js");
34
+ const external_auto_glm_adapter_js_namespaceObject = require("./auto-glm/adapter.js");
34
35
  const external_deepseek_adapter_js_namespaceObject = require("./deepseek/adapter.js");
35
36
  const external_default_js_namespaceObject = require("./default.js");
36
37
  const external_doubao_js_namespaceObject = require("./doubao.js");
@@ -43,6 +44,7 @@ const external_mimo_js_namespaceObject = require("./mimo.js");
43
44
  const external_qwen_js_namespaceObject = require("./qwen.js");
44
45
  const external_ui_tars_adapter_js_namespaceObject = require("./ui-tars/adapter.js");
45
46
  const MODEL_ADAPTER_CONFIGS = {
47
+ ...adapter_js_namespaceObject.antLingAdapters,
46
48
  ...external_jev_adapter_js_namespaceObject.jevAdapters,
47
49
  ...external_qwen_js_namespaceObject.qwenAdapters,
48
50
  ...external_deepseek_adapter_js_namespaceObject.deepSeekAdapters,
@@ -50,7 +52,7 @@ const MODEL_ADAPTER_CONFIGS = {
50
52
  ...external_gemini_js_namespaceObject.geminiAdapters,
51
53
  ...external_ui_tars_adapter_js_namespaceObject.uiTarsAdapters,
52
54
  ...external_glm_js_namespaceObject.glmAdapters,
53
- ...adapter_js_namespaceObject.autoGlmAdapters,
55
+ ...external_auto_glm_adapter_js_namespaceObject.autoGlmAdapters,
54
56
  ...external_gpt_js_namespaceObject.gptAdapters,
55
57
  ...external_kimi_js_namespaceObject.kimiAdapters,
56
58
  ...external_mimo_js_namespaceObject.mimoAdapters
@@ -1 +1 @@
1
- {"version":3,"file":"ai-model/models/registry.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../../src/ai-model/models/registry.ts"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import type { IModelConfig, TModelFamily } from '@midscene/shared/env';\nimport { getDebug } from '@midscene/shared/logger';\nimport { ResolvedModelAdapter } from '../model-adapter/resolve';\nimport type {\n ModelAdapter,\n ModelAdapterDefinition,\n ModelRuntime,\n} from '../model-adapter/types';\nimport { autoGlmAdapters } from './auto-glm/adapter';\nimport { deepSeekAdapters } from './deepseek/adapter';\nimport { defaultOpenAICompatibleAdapterConfig } from './default';\nimport { doubaoAdapters } from './doubao';\nimport { geminiAdapters } from './gemini';\nimport { glmAdapters } from './glm';\nimport { gptAdapters } from './gpt';\nimport { jevAdapters } from './jev/adapter';\nimport { kimiAdapters } from './kimi';\nimport { mimoAdapters } from './mimo';\nimport { qwenAdapters } from './qwen';\nimport { uiTarsAdapters } from './ui-tars/adapter';\n\nexport const MODEL_ADAPTER_CONFIGS = {\n ...jevAdapters,\n ...qwenAdapters,\n ...deepSeekAdapters,\n ...doubaoAdapters,\n ...geminiAdapters,\n ...uiTarsAdapters,\n ...glmAdapters,\n ...autoGlmAdapters,\n ...gptAdapters,\n ...kimiAdapters,\n ...mimoAdapters,\n} satisfies Record<TModelFamily, ModelAdapterDefinition>;\n\ntype ModelAdapterCacheKey = TModelFamily | 'default';\n\nconst modelAdapterCache = new Map<ModelAdapterCacheKey, ModelAdapter>();\nconst debugModelAdapter = getDebug('ai:model-adapter');\n\nfunction debugAdapterUnsupportedUserConfig(\n modelFamily: ModelAdapterCacheKey,\n adapter: ModelAdapter,\n): void {\n if (adapter.chatCompletion.unsupportedUserConfig.length > 0) {\n debugModelAdapter(\n `model adapter \"${modelFamily}\" (chat-completion) unsupportedUserConfig: ${JSON.stringify(adapter.chatCompletion.unsupportedUserConfig)}`,\n );\n }\n if (adapter.responses.unsupportedUserConfig.length > 0) {\n debugModelAdapter(\n `model adapter \"${modelFamily}\" (responses) unsupportedUserConfig: ${JSON.stringify(adapter.responses.unsupportedUserConfig)}`,\n );\n }\n}\n\nexport function getModelAdapter(modelFamily?: TModelFamily): ModelAdapter {\n const cacheKey: ModelAdapterCacheKey = modelFamily ?? 'default';\n let adapter = modelAdapterCache.get(cacheKey);\n if (adapter) {\n return adapter;\n }\n\n const config = modelFamily\n ? MODEL_ADAPTER_CONFIGS[modelFamily]\n : defaultOpenAICompatibleAdapterConfig;\n if (!config) {\n throw new Error(\n `No model adapter registered for modelFamily: ${modelFamily}`,\n );\n }\n\n adapter = new ResolvedModelAdapter(config, cacheKey);\n modelAdapterCache.set(cacheKey, adapter);\n debugAdapterUnsupportedUserConfig(cacheKey, adapter);\n\n return adapter;\n}\n\nexport function getModelRuntime(config: IModelConfig): ModelRuntime {\n return {\n config,\n adapter: getModelAdapter(config.modelFamily),\n };\n}\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","MODEL_ADAPTER_CONFIGS","jevAdapters","qwenAdapters","deepSeekAdapters","doubaoAdapters","geminiAdapters","uiTarsAdapters","glmAdapters","autoGlmAdapters","gptAdapters","kimiAdapters","mimoAdapters","modelAdapterCache","Map","debugModelAdapter","getDebug","debugAdapterUnsupportedUserConfig","modelFamily","adapter","JSON","getModelAdapter","cacheKey","config","defaultOpenAICompatibleAdapterConfig","Error","ResolvedModelAdapter","getModelRuntime"],"mappings":";;;IAAAA,oBAAoB,CAAC,GAAG,CAAC,UAASC;QACjC,IAAI,IAAIC,OAAOD,WACR,IAAGD,oBAAoB,CAAC,CAACC,YAAYC,QAAQ,CAACF,oBAAoB,CAAC,CAAC,UAASE,MACzEC,OAAO,cAAc,CAAC,UAASD,KAAK;YAAE,YAAY;YAAM,KAAKD,UAAU,CAACC,IAAI;QAAC;IAGzF;;;ICNAF,oBAAoB,CAAC,GAAG,CAACI,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAACC,KAAKC;;;ICClFL,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,AAAkB,eAAlB,OAAOM,UAA0BA,OAAO,WAAW,EACrDH,OAAO,cAAc,CAAC,UAASG,OAAO,WAAW,EAAE;YAAE,OAAO;QAAS;QAEtEH,OAAO,cAAc,CAAC,UAAS,cAAc;YAAE,OAAO;QAAK;IAC5D;;;;;;;;;;;;;;;;;;;;;;;ACeO,MAAMI,wBAAwB;IACnC,GAAGC,wCAAAA,WAAW;IACd,GAAGC,iCAAAA,YAAY;IACf,GAAGC,6CAAAA,gBAAgB;IACnB,GAAGC,mCAAAA,cAAc;IACjB,GAAGC,mCAAAA,cAAc;IACjB,GAAGC,4CAAAA,cAAc;IACjB,GAAGC,gCAAAA,WAAW;IACd,GAAGC,2BAAAA,eAAe;IAClB,GAAGC,gCAAAA,WAAW;IACd,GAAGC,iCAAAA,YAAY;IACf,GAAGC,iCAAAA,YAAY;AACjB;AAIA,MAAMC,oBAAoB,IAAIC;AAC9B,MAAMC,oBAAoBC,AAAAA,IAAAA,uBAAAA,QAAAA,AAAAA,EAAS;AAEnC,SAASC,kCACPC,WAAiC,EACjCC,OAAqB;IAErB,IAAIA,QAAQ,cAAc,CAAC,qBAAqB,CAAC,MAAM,GAAG,GACxDJ,kBACE,CAAC,eAAe,EAAEG,YAAY,2CAA2C,EAAEE,KAAK,SAAS,CAACD,QAAQ,cAAc,CAAC,qBAAqB,GAAG;IAG7I,IAAIA,QAAQ,SAAS,CAAC,qBAAqB,CAAC,MAAM,GAAG,GACnDJ,kBACE,CAAC,eAAe,EAAEG,YAAY,qCAAqC,EAAEE,KAAK,SAAS,CAACD,QAAQ,SAAS,CAAC,qBAAqB,GAAG;AAGpI;AAEO,SAASE,gBAAgBH,WAA0B;IACxD,MAAMI,WAAiCJ,eAAe;IACtD,IAAIC,UAAUN,kBAAkB,GAAG,CAACS;IACpC,IAAIH,SACF,OAAOA;IAGT,MAAMI,SAASL,cACXjB,qBAAqB,CAACiB,YAAY,GAClCM,oCAAAA,oCAAoCA;IACxC,IAAI,CAACD,QACH,MAAM,IAAIE,MACR,CAAC,6CAA6C,EAAEP,aAAa;IAIjEC,UAAU,IAAIO,2BAAAA,oBAAoBA,CAACH,QAAQD;IAC3CT,kBAAkB,GAAG,CAACS,UAAUH;IAChCF,kCAAkCK,UAAUH;IAE5C,OAAOA;AACT;AAEO,SAASQ,gBAAgBJ,MAAoB;IAClD,OAAO;QACLA;QACA,SAASF,gBAAgBE,OAAO,WAAW;IAC7C;AACF"}
1
+ {"version":3,"file":"ai-model/models/registry.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../../src/ai-model/models/registry.ts"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import type { IModelConfig, TModelFamily } from '@midscene/shared/env';\nimport { getDebug } from '@midscene/shared/logger';\nimport { ResolvedModelAdapter } from '../model-adapter/resolve';\nimport type {\n ModelAdapter,\n ModelAdapterDefinition,\n ModelRuntime,\n} from '../model-adapter/types';\nimport { antLingAdapters } from './ant-ling/adapter';\nimport { autoGlmAdapters } from './auto-glm/adapter';\nimport { deepSeekAdapters } from './deepseek/adapter';\nimport { defaultOpenAICompatibleAdapterConfig } from './default';\nimport { doubaoAdapters } from './doubao';\nimport { geminiAdapters } from './gemini';\nimport { glmAdapters } from './glm';\nimport { gptAdapters } from './gpt';\nimport { jevAdapters } from './jev/adapter';\nimport { kimiAdapters } from './kimi';\nimport { mimoAdapters } from './mimo';\nimport { qwenAdapters } from './qwen';\nimport { uiTarsAdapters } from './ui-tars/adapter';\n\nexport const MODEL_ADAPTER_CONFIGS = {\n ...antLingAdapters,\n ...jevAdapters,\n ...qwenAdapters,\n ...deepSeekAdapters,\n ...doubaoAdapters,\n ...geminiAdapters,\n ...uiTarsAdapters,\n ...glmAdapters,\n ...autoGlmAdapters,\n ...gptAdapters,\n ...kimiAdapters,\n ...mimoAdapters,\n} satisfies Record<TModelFamily, ModelAdapterDefinition>;\n\ntype ModelAdapterCacheKey = TModelFamily | 'default';\n\nconst modelAdapterCache = new Map<ModelAdapterCacheKey, ModelAdapter>();\nconst debugModelAdapter = getDebug('ai:model-adapter');\n\nfunction debugAdapterUnsupportedUserConfig(\n modelFamily: ModelAdapterCacheKey,\n adapter: ModelAdapter,\n): void {\n if (adapter.chatCompletion.unsupportedUserConfig.length > 0) {\n debugModelAdapter(\n `model adapter \"${modelFamily}\" (chat-completion) unsupportedUserConfig: ${JSON.stringify(adapter.chatCompletion.unsupportedUserConfig)}`,\n );\n }\n if (adapter.responses.unsupportedUserConfig.length > 0) {\n debugModelAdapter(\n `model adapter \"${modelFamily}\" (responses) unsupportedUserConfig: ${JSON.stringify(adapter.responses.unsupportedUserConfig)}`,\n );\n }\n}\n\nexport function getModelAdapter(modelFamily?: TModelFamily): ModelAdapter {\n const cacheKey: ModelAdapterCacheKey = modelFamily ?? 'default';\n let adapter = modelAdapterCache.get(cacheKey);\n if (adapter) {\n return adapter;\n }\n\n const config = modelFamily\n ? MODEL_ADAPTER_CONFIGS[modelFamily]\n : defaultOpenAICompatibleAdapterConfig;\n if (!config) {\n throw new Error(\n `No model adapter registered for modelFamily: ${modelFamily}`,\n );\n }\n\n adapter = new ResolvedModelAdapter(config, cacheKey);\n modelAdapterCache.set(cacheKey, adapter);\n debugAdapterUnsupportedUserConfig(cacheKey, adapter);\n\n return adapter;\n}\n\nexport function getModelRuntime(config: IModelConfig): ModelRuntime {\n return {\n config,\n adapter: getModelAdapter(config.modelFamily),\n };\n}\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","MODEL_ADAPTER_CONFIGS","antLingAdapters","jevAdapters","qwenAdapters","deepSeekAdapters","doubaoAdapters","geminiAdapters","uiTarsAdapters","glmAdapters","autoGlmAdapters","gptAdapters","kimiAdapters","mimoAdapters","modelAdapterCache","Map","debugModelAdapter","getDebug","debugAdapterUnsupportedUserConfig","modelFamily","adapter","JSON","getModelAdapter","cacheKey","config","defaultOpenAICompatibleAdapterConfig","Error","ResolvedModelAdapter","getModelRuntime"],"mappings":";;;IAAAA,oBAAoB,CAAC,GAAG,CAAC,UAASC;QACjC,IAAI,IAAIC,OAAOD,WACR,IAAGD,oBAAoB,CAAC,CAACC,YAAYC,QAAQ,CAACF,oBAAoB,CAAC,CAAC,UAASE,MACzEC,OAAO,cAAc,CAAC,UAASD,KAAK;YAAE,YAAY;YAAM,KAAKD,UAAU,CAACC,IAAI;QAAC;IAGzF;;;ICNAF,oBAAoB,CAAC,GAAG,CAACI,KAAKC,OAAUF,OAA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pC,IAAIH,SACF,OAAOA;IAGT,MAAMI,SAASL,cACXlB,qBAAqB,CAACkB,YAAY,GAClCM,oCAAAA,oCAAoCA;IACxC,IAAI,CAACD,QACH,MAAM,IAAIE,MACR,CAAC,6CAA6C,EAAEP,aAAa;IAIjEC,UAAU,IAAIO,2BAAAA,oBAAoBA,CAACH,QAAQD;IAC3CT,kBAAkB,GAAG,CAACS,UAAUH;IAChCF,kCAAkCK,UAAUH;IAE5C,OAAOA;AACT;AAEO,SAASQ,gBAAgBJ,MAAoB;IAClD,OAAO;QACLA;QACA,SAASF,gBAAgBE,OAAO,WAAW;IAC7C;AACF"}
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ ExecutionRecorder: ()=>ExecutionRecorder
28
+ });
29
+ const external_types_js_namespaceObject = require("../types.js");
30
+ function _define_property(obj, key, value) {
31
+ if (key in obj) Object.defineProperty(obj, key, {
32
+ value: value,
33
+ enumerable: true,
34
+ configurable: true,
35
+ writable: true
36
+ });
37
+ else obj[key] = value;
38
+ return obj;
39
+ }
40
+ class ExecutionRecorder {
41
+ record(execution, meta) {
42
+ this.meta = meta;
43
+ let key = execution.id ? `id:${execution.id}` : this.anonymousKeys.get(execution);
44
+ if (!key) {
45
+ key = `anonymous:${++this.nextAnonymousKey}`;
46
+ this.anonymousKeys.set(execution, key);
47
+ }
48
+ this.records.set(key, execution);
49
+ return key;
50
+ }
51
+ get executions() {
52
+ return [
53
+ ...this.records.values()
54
+ ];
55
+ }
56
+ get reportMeta() {
57
+ return this.meta;
58
+ }
59
+ toDump(meta = this.meta) {
60
+ if (!meta) throw new Error('Cannot create a report without execution metadata');
61
+ return new external_types_js_namespaceObject.ReportActionDump({
62
+ ...meta,
63
+ executions: this.executions
64
+ });
65
+ }
66
+ capture(executionIds, meta = this.meta) {
67
+ const selected = executionIds ? new Set(executionIds) : void 0;
68
+ const executions = this.executions.filter((execution)=>!selected || execution.id && selected.has(execution.id));
69
+ if (!meta) throw new Error('Cannot capture a report without execution metadata');
70
+ return {
71
+ capturedAt: new Date().toISOString(),
72
+ screenshots: executions.flatMap((execution)=>execution.collectScreenshots()),
73
+ referenceImageUrls: [
74
+ ...new Set(executions.flatMap((execution)=>[
75
+ ...execution.getReferenceImageUrls()
76
+ ]))
77
+ ],
78
+ dump: external_types_js_namespaceObject.ReportActionDump.fromSerializedString(new external_types_js_namespaceObject.ReportActionDump({
79
+ ...meta,
80
+ executions
81
+ }).serialize())
82
+ };
83
+ }
84
+ clear() {
85
+ this.records.clear();
86
+ this.anonymousKeys = new WeakMap();
87
+ this.meta = void 0;
88
+ }
89
+ constructor(){
90
+ _define_property(this, "records", new Map());
91
+ _define_property(this, "anonymousKeys", new WeakMap());
92
+ _define_property(this, "nextAnonymousKey", 0);
93
+ _define_property(this, "meta", void 0);
94
+ }
95
+ }
96
+ exports.ExecutionRecorder = __webpack_exports__.ExecutionRecorder;
97
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
98
+ "ExecutionRecorder"
99
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
100
+ Object.defineProperty(exports, '__esModule', {
101
+ value: true
102
+ });
103
+
104
+ //# sourceMappingURL=execution-recorder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dump/execution-recorder.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../src/dump/execution-recorder.ts"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import type { ScreenshotItem } from '../screenshot-item';\nimport {\n type ExecutionDump,\n ReportActionDump,\n type ReportMeta,\n} from '../types';\n\nexport interface ExecutionRecordSnapshot {\n capturedAt: string;\n dump: ReportActionDump;\n screenshots: ScreenshotItem[];\n referenceImageUrls: string[];\n}\n\n/** Execution facts and immutable cutoffs, independent of HTML and file I/O. */\nexport class ExecutionRecorder {\n private readonly records = new Map<string, ExecutionDump>();\n private anonymousKeys = new WeakMap<ExecutionDump, string>();\n private nextAnonymousKey = 0;\n private meta?: ReportMeta;\n\n record(execution: ExecutionDump, meta: ReportMeta): string {\n this.meta = meta;\n let key = execution.id\n ? `id:${execution.id}`\n : this.anonymousKeys.get(execution);\n if (!key) {\n key = `anonymous:${++this.nextAnonymousKey}`;\n this.anonymousKeys.set(execution, key);\n }\n this.records.set(key, execution);\n return key;\n }\n\n get executions(): ExecutionDump[] {\n return [...this.records.values()];\n }\n\n get reportMeta(): ReportMeta | undefined {\n return this.meta;\n }\n\n toDump(meta = this.meta): ReportActionDump {\n if (!meta)\n throw new Error('Cannot create a report without execution metadata');\n return new ReportActionDump({ ...meta, executions: this.executions });\n }\n\n /** Freeze facts before any asynchronous asset writes or subsequent progress. */\n capture(\n executionIds?: readonly string[],\n meta = this.meta,\n ): ExecutionRecordSnapshot {\n const selected = executionIds ? new Set(executionIds) : undefined;\n const executions = this.executions.filter(\n (execution) => !selected || (execution.id && selected.has(execution.id)),\n );\n if (!meta)\n throw new Error('Cannot capture a report without execution metadata');\n return {\n capturedAt: new Date().toISOString(),\n screenshots: executions.flatMap((execution) =>\n execution.collectScreenshots(),\n ),\n referenceImageUrls: [\n ...new Set(\n executions.flatMap((execution) => [\n ...execution.getReferenceImageUrls(),\n ]),\n ),\n ],\n dump: ReportActionDump.fromSerializedString(\n new ReportActionDump({ ...meta, executions }).serialize(),\n ),\n };\n }\n\n clear(): void {\n this.records.clear();\n this.anonymousKeys = new WeakMap();\n this.meta = undefined;\n }\n}\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","ExecutionRecorder","execution","meta","Error","ReportActionDump","executionIds","selected","Set","undefined","executions","Date","WeakMap","Map"],"mappings":";;;IAAAA,oBAAoB,CAAC,GAAG,CAAC,UAASC;QACjC,IAAI,IAAIC,OAAOD,WACR,IAAGD,oBAAoB,CAAC,CAACC,YAAYC,QAAQ,CAACF,oBAAoB,CAAC,CAAC,UAASE,MACzEC,OAAO,cAAc,CAAC,UAASD,KAAK;YAAE,YAAY;YAAM,KAAKD,UAAU,CAACC,IAAI;QAAC;IAGzF;;;ICNAF,oBAAoB,CAAC,GAAG,CAACI,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAACC,KAAKC;;;ICClFL,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,AAAkB,eAAlB,OAAOM,UAA0BA,OAAO,WAAW,EACrDH,OAAO,cAAc,CAAC,UAASG,OAAO,WAAW,EAAE;YAAE,OAAO;QAAS;QAEtEH,OAAO,cAAc,CAAC,UAAS,cAAc;YAAE,OAAO;QAAK;IAC5D;;;;;;;;;;;;;;;;;;ACSO,MA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A,gBAAAA,CAAAA,oBAAqC,CACzC,IAAIA,kCAAAA,gBAAgBA,CAAC;gBAAE,GAAGF,IAAI;gBAAEO;YAAW,GAAG,SAAS;QAE3D;IACF;IAEA,QAAc;QACZ,IAAI,CAAC,OAAO,CAAC,KAAK;QAClB,IAAI,CAAC,aAAa,GAAG,IAAIE;QACzB,IAAI,CAAC,IAAI,GAAGH;IACd;;QAjEA,uBAAiB,WAAU,IAAII;QAC/B,uBAAQ,iBAAgB,IAAID;QAC5B,uBAAQ,oBAAmB;QAC3B,uBAAQ,QAAR;;AA+DF"}
@@ -46,24 +46,29 @@ var __webpack_exports__ = {};
46
46
  parseDumpScriptAttributes: ()=>parseDumpScriptAttributes,
47
47
  extractImageByIdSync: ()=>extractImageByIdSync,
48
48
  escapeContent: ()=>escapeContent,
49
- DATA_SCREENSHOT_MODE_ATTR: ()=>DATA_SCREENSHOT_MODE_ATTR,
50
- generateDumpScriptTag: ()=>generateDumpScriptTag,
51
49
  extractTestRunReportDumpSync: ()=>extractTestRunReportDumpSync,
50
+ generateDumpScriptTag: ()=>generateDumpScriptTag,
51
+ DATA_SCREENSHOT_MODE_ATTR: ()=>DATA_SCREENSHOT_MODE_ATTR,
52
52
  STREAMING_CHUNK_SIZE: ()=>STREAMING_CHUNK_SIZE,
53
- streamDumpScriptsSync: ()=>streamDumpScriptsSync,
53
+ streamDumpScriptsAsync: ()=>streamDumpScriptsAsync,
54
54
  extractLastDumpScriptSync: ()=>extractLastDumpScriptSync,
55
55
  generateTestRunReportScriptTag: ()=>generateTestRunReportScriptTag,
56
+ generateReportArtifactScriptTag: ()=>generateReportArtifactScriptTag,
56
57
  parseDumpScript: ()=>parseDumpScript,
58
+ streamDumpScriptsSync: ()=>streamDumpScriptsSync,
59
+ extractReportArtifactPathSync: ()=>extractReportArtifactPathSync,
57
60
  streamImageScriptsToFile: ()=>streamImageScriptsToFile,
58
- streamScanTags: ()=>streamScanTags,
59
- streamScanTagsAsync: ()=>streamScanTagsAsync,
60
61
  parseImageScripts: ()=>parseImageScripts,
61
62
  extractAllDumpScriptsSync: ()=>extractAllDumpScriptsSync,
63
+ extractReportArtifactPathAsync: ()=>extractReportArtifactPathAsync,
64
+ streamScanTags: ()=>streamScanTags,
65
+ streamScanTagsAsync: ()=>streamScanTagsAsync,
62
66
  unescapeContent: ()=>unescapeContent
63
67
  });
64
68
  var external_node_fs_ = __webpack_require__("node:fs");
65
69
  const promises_namespaceObject = require("node:fs/promises");
66
70
  const external_node_string_decoder_namespaceObject = require("node:string_decoder");
71
+ const report_artifact_namespaceObject = require("@midscene/shared/report-artifact");
67
72
  const utils_namespaceObject = require("@midscene/shared/utils");
68
73
  const external_test_run_report_js_namespaceObject = require("../test-run-report.js");
69
74
  function _define_property(obj, key, value) {
@@ -143,6 +148,55 @@ var __webpack_exports__ = {};
143
148
  function htmlScriptCloseTag() {
144
149
  return String.fromCharCode(60) + "/script>";
145
150
  }
151
+ function generateReportArtifactScriptTag(path) {
152
+ (0, report_artifact_namespaceObject.assertReportArtifactPath)(path);
153
+ return [
154
+ String.fromCharCode(60),
155
+ 'script type="',
156
+ report_artifact_namespaceObject.REPORT_ARTIFACT_SCRIPT_TYPE,
157
+ '">',
158
+ JSON.stringify(path),
159
+ htmlScriptCloseTag()
160
+ ].join('');
161
+ }
162
+ function reportArtifactPathExtractor(filePath) {
163
+ let result;
164
+ return {
165
+ get path () {
166
+ return result;
167
+ },
168
+ visit: (content)=>{
169
+ const tagEnd = content.indexOf('>');
170
+ const type = content.slice(0, tagEnd).match(/(?:^|\s)type\s*=\s*["']([^"']+)["']/i)?.[1];
171
+ if (type !== report_artifact_namespaceObject.REPORT_ARTIFACT_SCRIPT_TYPE) return false;
172
+ if (void 0 !== result) throw new Error(`Report contains multiple artifact entries: ${filePath}`);
173
+ const path = JSON.parse(unescapeContent(content.slice(tagEnd + 1)));
174
+ (0, report_artifact_namespaceObject.assertReportArtifactPath)(path);
175
+ result = path;
176
+ return false;
177
+ }
178
+ };
179
+ }
180
+ function extractReportArtifactPathSync(filePath) {
181
+ const extractor = reportArtifactPathExtractor(filePath);
182
+ streamScanTags(filePath, `${String.fromCharCode(60)}script`, htmlScriptCloseTag(), extractor.visit);
183
+ return extractor.path;
184
+ }
185
+ async function extractReportArtifactPathAsync(filePath) {
186
+ const extractor = reportArtifactPathExtractor(filePath);
187
+ await streamScanTagsAsync(filePath, `${String.fromCharCode(60)}script`, htmlScriptCloseTag(), extractor.visit);
188
+ return extractor.path;
189
+ }
190
+ async function streamDumpScriptsAsync(filePath, visitor) {
191
+ await streamScanTagsAsync(filePath, `${String.fromCharCode(60)}script`, htmlScriptCloseTag(), (content)=>{
192
+ const tagEnd = content.indexOf('>');
193
+ const type = content.slice(0, tagEnd).match(/(?:^|\s)type\s*=\s*["']([^"']+)["']/i)?.[1];
194
+ return 'midscene_web_dump' === type ? visitor({
195
+ openTag: content.slice(0, tagEnd + 1),
196
+ content: content.slice(tagEnd + 1)
197
+ }) : false;
198
+ });
199
+ }
146
200
  function generateTestRunReportScriptTag(dump) {
147
201
  return [
148
202
  String.fromCharCode(60),
@@ -497,15 +551,19 @@ exports.escapeContent = __webpack_exports__.escapeContent;
497
551
  exports.extractAllDumpScriptsSync = __webpack_exports__.extractAllDumpScriptsSync;
498
552
  exports.extractImageByIdSync = __webpack_exports__.extractImageByIdSync;
499
553
  exports.extractLastDumpScriptSync = __webpack_exports__.extractLastDumpScriptSync;
554
+ exports.extractReportArtifactPathAsync = __webpack_exports__.extractReportArtifactPathAsync;
555
+ exports.extractReportArtifactPathSync = __webpack_exports__.extractReportArtifactPathSync;
500
556
  exports.extractTestRunReportDumpSync = __webpack_exports__.extractTestRunReportDumpSync;
501
557
  exports.generateAgentReportComment = __webpack_exports__.generateAgentReportComment;
502
558
  exports.generateDumpScriptTag = __webpack_exports__.generateDumpScriptTag;
503
559
  exports.generateImageScriptTag = __webpack_exports__.generateImageScriptTag;
560
+ exports.generateReportArtifactScriptTag = __webpack_exports__.generateReportArtifactScriptTag;
504
561
  exports.generateTestRunReportScriptTag = __webpack_exports__.generateTestRunReportScriptTag;
505
562
  exports.getBaseUrlFixScript = __webpack_exports__.getBaseUrlFixScript;
506
563
  exports.parseDumpScript = __webpack_exports__.parseDumpScript;
507
564
  exports.parseDumpScriptAttributes = __webpack_exports__.parseDumpScriptAttributes;
508
565
  exports.parseImageScripts = __webpack_exports__.parseImageScripts;
566
+ exports.streamDumpScriptsAsync = __webpack_exports__.streamDumpScriptsAsync;
509
567
  exports.streamDumpScriptsSync = __webpack_exports__.streamDumpScriptsSync;
510
568
  exports.streamImageScriptsToFile = __webpack_exports__.streamImageScriptsToFile;
511
569
  exports.streamScanTags = __webpack_exports__.streamScanTags;
@@ -519,15 +577,19 @@ for(var __rspack_i in __webpack_exports__)if (-1 === [
519
577
  "extractAllDumpScriptsSync",
520
578
  "extractImageByIdSync",
521
579
  "extractLastDumpScriptSync",
580
+ "extractReportArtifactPathAsync",
581
+ "extractReportArtifactPathSync",
522
582
  "extractTestRunReportDumpSync",
523
583
  "generateAgentReportComment",
524
584
  "generateDumpScriptTag",
525
585
  "generateImageScriptTag",
586
+ "generateReportArtifactScriptTag",
526
587
  "generateTestRunReportScriptTag",
527
588
  "getBaseUrlFixScript",
528
589
  "parseDumpScript",
529
590
  "parseDumpScriptAttributes",
530
591
  "parseImageScripts",
592
+ "streamDumpScriptsAsync",
531
593
  "streamDumpScriptsSync",
532
594
  "streamImageScriptsToFile",
533
595
  "streamScanTags",