@midscene/core 1.5.5 → 1.5.6

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.
@@ -0,0 +1,46 @@
1
+ import type { AIUsageInfo, DeepThinkOption, StreamingCallback } from '../../types';
2
+ import type { IModelConfig } from '@midscene/shared/env';
3
+ import type { ChatCompletionMessageParam } from 'openai/resources/index';
4
+ type CodexReasoningEffort = 'low' | 'medium' | 'high' | 'xhigh';
5
+ type CodexTextInput = {
6
+ type: 'text';
7
+ text: string;
8
+ text_elements: any[];
9
+ };
10
+ type CodexImageInput = {
11
+ type: 'image';
12
+ url: string;
13
+ detail?: string;
14
+ };
15
+ type CodexLocalImageInput = {
16
+ type: 'localImage';
17
+ path: string;
18
+ detail?: string;
19
+ };
20
+ type CodexTurnInput = CodexTextInput | CodexImageInput | CodexLocalImageInput;
21
+ type CodexTurnResult = {
22
+ content: string;
23
+ reasoning_content?: string;
24
+ usage?: AIUsageInfo;
25
+ isStreamed: boolean;
26
+ };
27
+ export declare const isCodexAppServerProvider: (baseURL?: string) => boolean;
28
+ export declare const normalizeCodexLocalImagePath: (imageUrl: string, platform?: NodeJS.Platform) => string;
29
+ export declare const resolveCodexReasoningEffort: ({ deepThink, modelConfig, }: {
30
+ deepThink?: DeepThinkOption;
31
+ modelConfig: IModelConfig;
32
+ }) => CodexReasoningEffort | undefined;
33
+ export declare const buildCodexTurnPayloadFromMessages: (messages: ChatCompletionMessageParam[], options?: {
34
+ imageDetailOverride?: string;
35
+ }) => {
36
+ developerInstructions?: string;
37
+ input: CodexTurnInput[];
38
+ };
39
+ export declare function callAIWithCodexAppServer(messages: ChatCompletionMessageParam[], modelConfig: IModelConfig, options?: {
40
+ stream?: boolean;
41
+ onChunk?: StreamingCallback;
42
+ deepThink?: DeepThinkOption;
43
+ abortSignal?: AbortSignal;
44
+ }): Promise<CodexTurnResult>;
45
+ export declare function __shutdownCodexAppServerForTests(): Promise<void>;
46
+ export {};
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.5.5",
4
+ "version": "1.5.6",
5
5
  "repository": "https://github.com/web-infra-dev/midscene",
6
6
  "homepage": "https://midscenejs.com/",
7
7
  "main": "./dist/lib/index.js",
@@ -97,7 +97,7 @@
97
97
  "semver": "7.5.2",
98
98
  "undici": "^6.0.0",
99
99
  "zod": "3.24.3",
100
- "@midscene/shared": "1.5.5"
100
+ "@midscene/shared": "1.5.6"
101
101
  },
102
102
  "devDependencies": {
103
103
  "@rslib/core": "^0.18.3",