@midscene/core 1.9.4-beta-20260610101007.0 → 1.9.4

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 (62) hide show
  1. package/dist/es/agent/task-builder.mjs +3 -1
  2. package/dist/es/agent/task-builder.mjs.map +1 -1
  3. package/dist/es/agent/tasks.mjs +8 -4
  4. package/dist/es/agent/tasks.mjs.map +1 -1
  5. package/dist/es/agent/utils.mjs +1 -1
  6. package/dist/es/ai-model/inspect.mjs +11 -2
  7. package/dist/es/ai-model/inspect.mjs.map +1 -1
  8. package/dist/es/ai-model/llm-planning.mjs +4 -2
  9. package/dist/es/ai-model/llm-planning.mjs.map +1 -1
  10. package/dist/es/ai-model/models/auto-glm/locate.mjs +2 -1
  11. package/dist/es/ai-model/models/auto-glm/locate.mjs.map +1 -1
  12. package/dist/es/ai-model/models/auto-glm/planning.mjs +4 -3
  13. package/dist/es/ai-model/models/auto-glm/planning.mjs.map +1 -1
  14. package/dist/es/ai-model/models/gpt.mjs +12 -6
  15. package/dist/es/ai-model/models/gpt.mjs.map +1 -1
  16. package/dist/es/ai-model/models/kimi.mjs +42 -0
  17. package/dist/es/ai-model/models/kimi.mjs.map +1 -0
  18. package/dist/es/ai-model/models/registry.mjs +3 -1
  19. package/dist/es/ai-model/models/registry.mjs.map +1 -1
  20. package/dist/es/ai-model/models/ui-tars/planning.mjs +3 -2
  21. package/dist/es/ai-model/models/ui-tars/planning.mjs.map +1 -1
  22. package/dist/es/ai-model/service-caller/index.mjs +13 -7
  23. package/dist/es/ai-model/service-caller/index.mjs.map +1 -1
  24. package/dist/es/service/index.mjs +9 -1
  25. package/dist/es/service/index.mjs.map +1 -1
  26. package/dist/es/types.mjs.map +1 -1
  27. package/dist/es/utils.mjs +2 -2
  28. package/dist/lib/agent/task-builder.js +3 -1
  29. package/dist/lib/agent/task-builder.js.map +1 -1
  30. package/dist/lib/agent/tasks.js +8 -4
  31. package/dist/lib/agent/tasks.js.map +1 -1
  32. package/dist/lib/agent/utils.js +1 -1
  33. package/dist/lib/ai-model/inspect.js +11 -2
  34. package/dist/lib/ai-model/inspect.js.map +1 -1
  35. package/dist/lib/ai-model/llm-planning.js +4 -2
  36. package/dist/lib/ai-model/llm-planning.js.map +1 -1
  37. package/dist/lib/ai-model/models/auto-glm/locate.js +2 -1
  38. package/dist/lib/ai-model/models/auto-glm/locate.js.map +1 -1
  39. package/dist/lib/ai-model/models/auto-glm/planning.js +4 -3
  40. package/dist/lib/ai-model/models/auto-glm/planning.js.map +1 -1
  41. package/dist/lib/ai-model/models/gpt.js +12 -6
  42. package/dist/lib/ai-model/models/gpt.js.map +1 -1
  43. package/dist/lib/ai-model/models/kimi.js +76 -0
  44. package/dist/lib/ai-model/models/kimi.js.map +1 -0
  45. package/dist/lib/ai-model/models/registry.js +3 -1
  46. package/dist/lib/ai-model/models/registry.js.map +1 -1
  47. package/dist/lib/ai-model/models/ui-tars/planning.js +3 -2
  48. package/dist/lib/ai-model/models/ui-tars/planning.js.map +1 -1
  49. package/dist/lib/ai-model/service-caller/index.js +13 -7
  50. package/dist/lib/ai-model/service-caller/index.js.map +1 -1
  51. package/dist/lib/service/index.js +9 -1
  52. package/dist/lib/service/index.js.map +1 -1
  53. package/dist/lib/types.js.map +1 -1
  54. package/dist/lib/utils.js +2 -2
  55. package/dist/types/ai-model/inspect.d.ts +2 -0
  56. package/dist/types/ai-model/models/gpt.d.ts +2 -2
  57. package/dist/types/ai-model/models/kimi.d.ts +18 -0
  58. package/dist/types/ai-model/models/registry.d.ts +17 -2
  59. package/dist/types/ai-model/service-caller/index.d.ts +9 -1
  60. package/dist/types/ai-model/workflows/inspect/types.d.ts +1 -0
  61. package/dist/types/types.d.ts +15 -0
  62. package/package.json +2 -2
@@ -25,6 +25,7 @@ export declare function AiLocateSection(options: {
25
25
  searchAreaConfig?: SearchAreaConfig;
26
26
  error?: string;
27
27
  rawResponse: string;
28
+ rawChoiceMessage?: unknown;
28
29
  usage?: AIUsageInfo;
29
30
  }>;
30
31
  export declare function AiExtractElementInfo<T>(options: {
@@ -37,6 +38,7 @@ export declare function AiExtractElementInfo<T>(options: {
37
38
  }): Promise<{
38
39
  parseResult: AIDataExtractionResponse<T>;
39
40
  rawResponse: string;
41
+ rawChoiceMessage: unknown;
40
42
  usage: AIUsageInfo | undefined;
41
43
  reasoning_content: string | undefined;
42
44
  }>;
@@ -2,8 +2,8 @@ import type { ChatCompletionCallContext, ChatCompletionParamsResult, ImageDetail
2
2
  export declare const gptAdapters: {
3
3
  'gpt-5': {
4
4
  chatCompletion: {
5
- unsupportedUserConfig: ("temperature" | "reasoningEnabled" | "reasoningEffort" | "reasoningBudget")[];
6
- buildChatCompletionParams: () => ChatCompletionParamsResult;
5
+ unsupportedUserConfig: "reasoningBudget"[];
6
+ buildChatCompletionParams: (input: ChatCompletionCallContext) => ChatCompletionParamsResult;
7
7
  resolveImageDetail: (input: ChatCompletionCallContext) => ImageDetail | undefined;
8
8
  };
9
9
  locate: {
@@ -0,0 +1,18 @@
1
+ import type { ChatCompletionCallContext, ChatCompletionParamsResult } from './types';
2
+ export declare const kimiAdapters: {
3
+ kimi: {
4
+ chatCompletion: {
5
+ unsupportedUserConfig: ("reasoningEffort" | "reasoningBudget")[];
6
+ buildChatCompletionParams: (input: ChatCompletionCallContext) => ChatCompletionParamsResult;
7
+ };
8
+ locate: {
9
+ resultAdapter: {
10
+ coordinates: {
11
+ shape: "point";
12
+ order: "xy";
13
+ normalizedBy: number;
14
+ };
15
+ };
16
+ };
17
+ };
18
+ };
@@ -1,10 +1,25 @@
1
1
  import type { IModelConfig, TModelFamily } from '@midscene/shared/env';
2
2
  import type { ModelAdapter, ModelAdapterDefinition, ModelRuntime } from './types';
3
3
  export declare const MODEL_ADAPTER_CONFIGS: {
4
+ kimi: {
5
+ chatCompletion: {
6
+ unsupportedUserConfig: ("reasoningEffort" | "reasoningBudget")[];
7
+ buildChatCompletionParams: (input: import("./types").ChatCompletionCallContext) => import("./types").ChatCompletionParamsResult;
8
+ };
9
+ locate: {
10
+ resultAdapter: {
11
+ coordinates: {
12
+ shape: "point";
13
+ order: "xy";
14
+ normalizedBy: number;
15
+ };
16
+ };
17
+ };
18
+ };
4
19
  'gpt-5': {
5
20
  chatCompletion: {
6
- unsupportedUserConfig: ("temperature" | "reasoningEnabled" | "reasoningEffort" | "reasoningBudget")[];
7
- buildChatCompletionParams: () => import("./types").ChatCompletionParamsResult;
21
+ unsupportedUserConfig: "reasoningBudget"[];
22
+ buildChatCompletionParams: (input: import("./types").ChatCompletionCallContext) => import("./types").ChatCompletionParamsResult;
8
23
  resolveImageDetail: (input: import("./types").ChatCompletionCallContext) => import("./types").ImageDetail | undefined;
9
24
  };
10
25
  locate: {
@@ -2,8 +2,13 @@ import type { AIUsageInfo } from '../../types';
2
2
  import type { StreamingCallback } from '../../types';
3
3
  export declare class AIResponseParseError extends Error {
4
4
  usage?: AIUsageInfo;
5
+ /**
6
+ * Adapter-extracted content used by Midscene for parsing. This is not the
7
+ * full provider response or choices[0].message.
8
+ */
5
9
  rawResponse: string;
6
- constructor(message: string, rawResponse: string, usage?: AIUsageInfo);
10
+ rawChoiceMessage?: unknown;
11
+ constructor(message: string, rawResponse: string, usage?: AIUsageInfo, rawChoiceMessage?: unknown);
7
12
  }
8
13
  import { type IModelConfig, type TModelFamily } from '@midscene/shared/env';
9
14
  import OpenAI from 'openai';
@@ -29,6 +34,7 @@ export declare function callAI(messages: ChatCompletionMessageParam[], modelRunt
29
34
  }): Promise<{
30
35
  content: string;
31
36
  reasoning_content?: string;
37
+ rawChoiceMessage?: unknown;
32
38
  usage?: AIUsageInfo;
33
39
  isStreamed: boolean;
34
40
  }>;
@@ -40,10 +46,12 @@ export declare function callAIWithObjectResponse<T>(messages: ChatCompletionMess
40
46
  contentString: string;
41
47
  usage?: AIUsageInfo;
42
48
  reasoning_content?: string;
49
+ rawChoiceMessage?: unknown;
43
50
  }>;
44
51
  export declare function callAIWithStringResponse(msgs: AIArgs, modelRuntime: ModelRuntime, options?: {
45
52
  abortSignal?: AbortSignal;
46
53
  }): Promise<{
47
54
  content: string;
48
55
  usage?: AIUsageInfo;
56
+ rawChoiceMessage?: unknown;
49
57
  }>;
@@ -31,6 +31,7 @@ export interface LocateResult {
31
31
  };
32
32
  rect?: Rect;
33
33
  rawResponse: string;
34
+ rawChoiceMessage?: unknown;
34
35
  usage?: AIUsageInfo;
35
36
  reasoning_content?: string;
36
37
  }
@@ -127,10 +127,20 @@ export type DeepThinkOption = 'unset' | true | false;
127
127
  export interface ServiceTaskInfo {
128
128
  durationMs: number;
129
129
  formatResponse?: string;
130
+ /**
131
+ * Adapter-extracted content used by Midscene for parsing. This is not the
132
+ * full provider response or choices[0].message.
133
+ */
130
134
  rawResponse?: string;
135
+ rawChoiceMessage?: unknown;
131
136
  usage?: AIUsageInfo;
132
137
  searchArea?: Rect;
138
+ /**
139
+ * Adapter-extracted content from the search-area model call. This is not the
140
+ * full provider response or choices[0].message.
141
+ */
133
142
  searchAreaRawResponse?: string;
143
+ searchAreaRawChoiceMessage?: unknown;
134
144
  searchAreaUsage?: AIUsageInfo;
135
145
  reasoning_content?: string;
136
146
  }
@@ -231,7 +241,12 @@ export interface RawResponsePlanningAIResponse {
231
241
  export interface PlanningAIResponse extends Omit<RawResponsePlanningAIResponse, 'action'> {
232
242
  actions?: PlanningAction[];
233
243
  usage?: AIUsageInfo;
244
+ /**
245
+ * Adapter-extracted content used by Midscene for parsing. This is not the
246
+ * full provider response or choices[0].message.
247
+ */
234
248
  rawResponse?: string;
249
+ rawChoiceMessage?: unknown;
235
250
  yamlFlow?: MidsceneYamlFlowItem[];
236
251
  yamlString?: string;
237
252
  error?: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@midscene/core",
3
3
  "description": "Automate browser actions, extract data, and perform assertions using AI. It offers JavaScript SDK, Chrome extension, and support for scripting in YAML. See https://midscenejs.com/ for details.",
4
- "version": "1.9.4-beta-20260610101007.0",
4
+ "version": "1.9.4",
5
5
  "repository": "https://github.com/web-infra-dev/midscene",
6
6
  "homepage": "https://midscenejs.com/",
7
7
  "main": "./dist/lib/index.js",
@@ -99,7 +99,7 @@
99
99
  "semver": "7.5.2",
100
100
  "undici": "^6.0.0",
101
101
  "zod": "^3.25.1",
102
- "@midscene/shared": "1.9.4-beta-20260610101007.0"
102
+ "@midscene/shared": "1.9.4"
103
103
  },
104
104
  "devDependencies": {
105
105
  "@rslib/core": "^0.18.3",