@midscene/shared 1.6.3-beta-20260403070857.0 → 1.6.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.
- package/dist/es/cli/cli-runner.mjs +13 -1
- package/dist/es/env/types.mjs +1 -0
- package/dist/lib/cli/cli-runner.js +13 -1
- package/dist/lib/env/types.js +1 -0
- package/dist/types/cli/cli-runner.d.ts +8 -0
- package/dist/types/cli/index.d.ts +1 -1
- package/dist/types/env/types.d.ts +1 -1
- package/package.json +1 -1
- package/src/cli/cli-runner.ts +26 -1
- package/src/cli/index.ts +1 -1
- package/src/env/types.ts +2 -0
|
@@ -89,7 +89,7 @@ function printHelp(scriptName, commands, version) {
|
|
|
89
89
|
}
|
|
90
90
|
console.log(`\nUsage: ${scriptName} <command> [options]\n`);
|
|
91
91
|
console.log('Commands:');
|
|
92
|
-
for (const { name, def } of commands)console.log(` ${name.padEnd(30)} ${def.description}`);
|
|
92
|
+
for (const { name, def } of commands.filter((command)=>!command.hidden))console.log(` ${name.padEnd(30)} ${def.description}`);
|
|
93
93
|
console.log(` ${'version'.padEnd(30)} Show CLI version`);
|
|
94
94
|
console.log(`\nRun "${scriptName} <command> --help" for more info.`);
|
|
95
95
|
}
|
|
@@ -105,6 +105,18 @@ async function runToolsCLI(tools, scriptName, options) {
|
|
|
105
105
|
name: removePrefix(def.name, options?.stripPrefix).toLowerCase(),
|
|
106
106
|
def
|
|
107
107
|
}));
|
|
108
|
+
if (options?.extraCommands?.length) commands.push(...options.extraCommands.flatMap((cmd)=>[
|
|
109
|
+
{
|
|
110
|
+
name: cmd.name.toLowerCase(),
|
|
111
|
+
def: cmd.def,
|
|
112
|
+
hidden: cmd.hidden
|
|
113
|
+
},
|
|
114
|
+
...(cmd.aliases ?? []).map((alias)=>({
|
|
115
|
+
name: alias.toLowerCase(),
|
|
116
|
+
def: cmd.def,
|
|
117
|
+
hidden: true
|
|
118
|
+
}))
|
|
119
|
+
]));
|
|
108
120
|
const cliVersion = options?.version;
|
|
109
121
|
const [commandName, ...restArgs] = rawArgs;
|
|
110
122
|
if (!commandName || '--help' === commandName || '-h' === commandName) {
|
package/dist/es/env/types.mjs
CHANGED
|
@@ -131,7 +131,7 @@ function printHelp(scriptName, commands, version) {
|
|
|
131
131
|
}
|
|
132
132
|
console.log(`\nUsage: ${scriptName} <command> [options]\n`);
|
|
133
133
|
console.log('Commands:');
|
|
134
|
-
for (const { name, def } of commands)console.log(` ${name.padEnd(30)} ${def.description}`);
|
|
134
|
+
for (const { name, def } of commands.filter((command)=>!command.hidden))console.log(` ${name.padEnd(30)} ${def.description}`);
|
|
135
135
|
console.log(` ${'version'.padEnd(30)} Show CLI version`);
|
|
136
136
|
console.log(`\nRun "${scriptName} <command> --help" for more info.`);
|
|
137
137
|
}
|
|
@@ -147,6 +147,18 @@ async function runToolsCLI(tools, scriptName, options) {
|
|
|
147
147
|
name: removePrefix(def.name, options?.stripPrefix).toLowerCase(),
|
|
148
148
|
def
|
|
149
149
|
}));
|
|
150
|
+
if (options?.extraCommands?.length) commands.push(...options.extraCommands.flatMap((cmd)=>[
|
|
151
|
+
{
|
|
152
|
+
name: cmd.name.toLowerCase(),
|
|
153
|
+
def: cmd.def,
|
|
154
|
+
hidden: cmd.hidden
|
|
155
|
+
},
|
|
156
|
+
...(cmd.aliases ?? []).map((alias)=>({
|
|
157
|
+
name: alias.toLowerCase(),
|
|
158
|
+
def: cmd.def,
|
|
159
|
+
hidden: true
|
|
160
|
+
}))
|
|
161
|
+
]));
|
|
150
162
|
const cliVersion = options?.version;
|
|
151
163
|
const [commandName, ...restArgs] = rawArgs;
|
|
152
164
|
if (!commandName || '--help' === commandName || '-h' === commandName) {
|
package/dist/lib/env/types.js
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import type { BaseMidsceneTools } from '../mcp/base-tools';
|
|
2
|
+
import type { ToolDefinition } from '../mcp/types';
|
|
3
|
+
export interface CLIExtraCommand {
|
|
4
|
+
name: string;
|
|
5
|
+
def: ToolDefinition;
|
|
6
|
+
aliases?: string[];
|
|
7
|
+
hidden?: boolean;
|
|
8
|
+
}
|
|
2
9
|
export interface CLIRunnerOptions {
|
|
3
10
|
stripPrefix?: string;
|
|
4
11
|
argv?: string[];
|
|
5
12
|
version?: string;
|
|
13
|
+
extraCommands?: CLIExtraCommand[];
|
|
6
14
|
}
|
|
7
15
|
export declare class CLIError extends Error {
|
|
8
16
|
exitCode: number;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { runToolsCLI, CLIError, parseValue, parseCliArgs, removePrefix, } from './cli-runner';
|
|
2
|
-
export type { CLIRunnerOptions } from './cli-runner';
|
|
2
|
+
export type { CLIRunnerOptions, CLIExtraCommand } from './cli-runner';
|
|
@@ -128,7 +128,7 @@ export type TGlobalConfig = Record<TEnvKeys, string | undefined>;
|
|
|
128
128
|
/**
|
|
129
129
|
* valid Model family types
|
|
130
130
|
*/
|
|
131
|
-
export type TModelFamily = 'qwen2.5-vl' | 'qwen3-vl' | 'qwen3.5' | 'doubao-vision' | 'doubao-seed' | 'gemini' | 'vlm-ui-tars' | 'vlm-ui-tars-doubao' | 'vlm-ui-tars-doubao-1.5' | 'glm-v' | 'auto-glm' | 'auto-glm-multilingual' | 'gpt-5';
|
|
131
|
+
export type TModelFamily = 'qwen2.5-vl' | 'qwen3-vl' | 'qwen3.5' | 'qwen3.6' | 'doubao-vision' | 'doubao-seed' | 'gemini' | 'vlm-ui-tars' | 'vlm-ui-tars-doubao' | 'vlm-ui-tars-doubao-1.5' | 'glm-v' | 'auto-glm' | 'auto-glm-multilingual' | 'gpt-5';
|
|
132
132
|
export declare const MODEL_FAMILY_VALUES: TModelFamily[];
|
|
133
133
|
export interface IModelConfigForInsight {
|
|
134
134
|
[MIDSCENE_INSIGHT_MODEL_NAME]: string;
|
package/package.json
CHANGED
package/src/cli/cli-runner.ts
CHANGED
|
@@ -15,12 +15,21 @@ const debug = getDebug('cli-runner');
|
|
|
15
15
|
interface CLICommand {
|
|
16
16
|
name: string;
|
|
17
17
|
def: ToolDefinition;
|
|
18
|
+
hidden?: boolean;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface CLIExtraCommand {
|
|
22
|
+
name: string;
|
|
23
|
+
def: ToolDefinition;
|
|
24
|
+
aliases?: string[];
|
|
25
|
+
hidden?: boolean;
|
|
18
26
|
}
|
|
19
27
|
|
|
20
28
|
export interface CLIRunnerOptions {
|
|
21
29
|
stripPrefix?: string;
|
|
22
30
|
argv?: string[];
|
|
23
31
|
version?: string;
|
|
32
|
+
extraCommands?: CLIExtraCommand[];
|
|
24
33
|
}
|
|
25
34
|
|
|
26
35
|
export class CLIError extends Error {
|
|
@@ -142,7 +151,7 @@ function printHelp(
|
|
|
142
151
|
}
|
|
143
152
|
console.log(`\nUsage: ${scriptName} <command> [options]\n`);
|
|
144
153
|
console.log('Commands:');
|
|
145
|
-
for (const { name, def } of commands) {
|
|
154
|
+
for (const { name, def } of commands.filter((command) => !command.hidden)) {
|
|
146
155
|
console.log(` ${name.padEnd(30)} ${def.description}`);
|
|
147
156
|
}
|
|
148
157
|
console.log(` ${'version'.padEnd(30)} Show CLI version`);
|
|
@@ -169,6 +178,22 @@ export async function runToolsCLI(
|
|
|
169
178
|
name: removePrefix(def.name, options?.stripPrefix).toLowerCase(),
|
|
170
179
|
def,
|
|
171
180
|
}));
|
|
181
|
+
if (options?.extraCommands?.length) {
|
|
182
|
+
commands.push(
|
|
183
|
+
...options.extraCommands.flatMap((cmd) => [
|
|
184
|
+
{
|
|
185
|
+
name: cmd.name.toLowerCase(),
|
|
186
|
+
def: cmd.def,
|
|
187
|
+
hidden: cmd.hidden,
|
|
188
|
+
},
|
|
189
|
+
...(cmd.aliases ?? []).map((alias) => ({
|
|
190
|
+
name: alias.toLowerCase(),
|
|
191
|
+
def: cmd.def,
|
|
192
|
+
hidden: true,
|
|
193
|
+
})),
|
|
194
|
+
]),
|
|
195
|
+
);
|
|
196
|
+
}
|
|
172
197
|
const cliVersion = options?.version;
|
|
173
198
|
|
|
174
199
|
const [commandName, ...restArgs] = rawArgs;
|
package/src/cli/index.ts
CHANGED
package/src/env/types.ts
CHANGED
|
@@ -293,6 +293,7 @@ export type TModelFamily =
|
|
|
293
293
|
| 'qwen2.5-vl'
|
|
294
294
|
| 'qwen3-vl'
|
|
295
295
|
| 'qwen3.5'
|
|
296
|
+
| 'qwen3.6'
|
|
296
297
|
| 'doubao-vision'
|
|
297
298
|
| 'doubao-seed'
|
|
298
299
|
| 'gemini'
|
|
@@ -311,6 +312,7 @@ export const MODEL_FAMILY_VALUES: TModelFamily[] = [
|
|
|
311
312
|
'qwen2.5-vl',
|
|
312
313
|
'qwen3-vl',
|
|
313
314
|
'qwen3.5',
|
|
315
|
+
'qwen3.6',
|
|
314
316
|
'vlm-ui-tars',
|
|
315
317
|
'vlm-ui-tars-doubao',
|
|
316
318
|
'vlm-ui-tars-doubao-1.5',
|