@midscene/computer 1.5.4-beta-20260310030546.0 → 1.5.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.mjs CHANGED
@@ -88,6 +88,15 @@ function _define_property(obj, key, value) {
88
88
  else obj[key] = value;
89
89
  return obj;
90
90
  }
91
+ const computerInputParamSchema = z.object({
92
+ value: z.string().describe('The text to input'),
93
+ mode: z["enum"]([
94
+ 'replace',
95
+ 'clear',
96
+ 'append'
97
+ ]).default('replace').optional().describe('Input mode: replace, clear, or append'),
98
+ locate: getMidsceneLocationSchema().describe('The input field to be filled').optional()
99
+ });
91
100
  const SMOOTH_MOVE_STEPS_TAP = 8;
92
101
  const SMOOTH_MOVE_STEPS_MOUSE_MOVE = 10;
93
102
  const SMOOTH_MOVE_DELAY_TAP = 8;
@@ -290,6 +299,7 @@ Available Displays: ${displays.length > 0 ? displays.map((d)=>d.name).join(', ')
290
299
  }
291
300
  async healthCheck() {
292
301
  console.log('[HealthCheck] Starting health check...');
302
+ console.log("[HealthCheck] @midscene/computer v1.5.4");
293
303
  console.log('[HealthCheck] Taking screenshot...');
294
304
  const screenshotTimeout = 15000;
295
305
  let timeoutId;
@@ -441,6 +451,11 @@ Available Displays: ${displays.length > 0 ? displays.map((d)=>d.name).join(', ')
441
451
  description: 'Move the mouse to the element',
442
452
  interfaceAlias: 'aiHover',
443
453
  paramSchema: actionHoverParamSchema,
454
+ sample: {
455
+ locate: {
456
+ prompt: 'the navigation menu item "Products"'
457
+ }
458
+ },
444
459
  call: async (param)=>{
445
460
  node_assert(libnut, 'libnut not initialized');
446
461
  const element = param.locate;
@@ -456,15 +471,13 @@ Available Displays: ${displays.length > 0 ? displays.map((d)=>d.name).join(', ')
456
471
  name: 'Input',
457
472
  description: 'Input text into the input field',
458
473
  interfaceAlias: 'aiInput',
459
- paramSchema: z.object({
460
- value: z.string().describe('The text to input'),
461
- mode: z["enum"]([
462
- 'replace',
463
- 'clear',
464
- 'append'
465
- ]).default('replace').optional().describe('Input mode: replace, clear, or append'),
466
- locate: getMidsceneLocationSchema().describe('The input field to be filled').optional()
467
- }),
474
+ paramSchema: computerInputParamSchema,
475
+ sample: {
476
+ value: 'test@example.com',
477
+ locate: {
478
+ prompt: 'the email input field'
479
+ }
480
+ },
468
481
  call: async (param)=>{
469
482
  node_assert(libnut, 'libnut not initialized');
470
483
  const element = param.locate;
@@ -758,7 +771,8 @@ class ComputerMidsceneTools extends BaseMidsceneTools {
758
771
  }
759
772
  const tools = new ComputerMidsceneTools();
760
773
  runToolsCLI(tools, 'midscene-computer', {
761
- stripPrefix: 'computer_'
774
+ stripPrefix: 'computer_',
775
+ version: "1.5.4"
762
776
  }).catch((e)=>{
763
777
  if (!(e instanceof CLIError)) console.error(e);
764
778
  process.exit(e instanceof CLIError ? e.exitCode : 1);
package/dist/es/index.mjs CHANGED
@@ -88,6 +88,15 @@ function _define_property(obj, key, value) {
88
88
  else obj[key] = value;
89
89
  return obj;
90
90
  }
91
+ const computerInputParamSchema = z.object({
92
+ value: z.string().describe('The text to input'),
93
+ mode: z["enum"]([
94
+ 'replace',
95
+ 'clear',
96
+ 'append'
97
+ ]).default('replace').optional().describe('Input mode: replace, clear, or append'),
98
+ locate: getMidsceneLocationSchema().describe('The input field to be filled').optional()
99
+ });
91
100
  const SMOOTH_MOVE_STEPS_TAP = 8;
92
101
  const SMOOTH_MOVE_STEPS_MOUSE_MOVE = 10;
93
102
  const SMOOTH_MOVE_DELAY_TAP = 8;
@@ -290,6 +299,7 @@ Available Displays: ${displays.length > 0 ? displays.map((d)=>d.name).join(', ')
290
299
  }
291
300
  async healthCheck() {
292
301
  console.log('[HealthCheck] Starting health check...');
302
+ console.log("[HealthCheck] @midscene/computer v1.5.4");
293
303
  console.log('[HealthCheck] Taking screenshot...');
294
304
  const screenshotTimeout = 15000;
295
305
  let timeoutId;
@@ -441,6 +451,11 @@ Available Displays: ${displays.length > 0 ? displays.map((d)=>d.name).join(', ')
441
451
  description: 'Move the mouse to the element',
442
452
  interfaceAlias: 'aiHover',
443
453
  paramSchema: actionHoverParamSchema,
454
+ sample: {
455
+ locate: {
456
+ prompt: 'the navigation menu item "Products"'
457
+ }
458
+ },
444
459
  call: async (param)=>{
445
460
  node_assert(device_libnut, 'libnut not initialized');
446
461
  const element = param.locate;
@@ -456,15 +471,13 @@ Available Displays: ${displays.length > 0 ? displays.map((d)=>d.name).join(', ')
456
471
  name: 'Input',
457
472
  description: 'Input text into the input field',
458
473
  interfaceAlias: 'aiInput',
459
- paramSchema: z.object({
460
- value: z.string().describe('The text to input'),
461
- mode: z["enum"]([
462
- 'replace',
463
- 'clear',
464
- 'append'
465
- ]).default('replace').optional().describe('Input mode: replace, clear, or append'),
466
- locate: getMidsceneLocationSchema().describe('The input field to be filled').optional()
467
- }),
474
+ paramSchema: computerInputParamSchema,
475
+ sample: {
476
+ value: 'test@example.com',
477
+ locate: {
478
+ prompt: 'the email input field'
479
+ }
480
+ },
468
481
  call: async (param)=>{
469
482
  node_assert(device_libnut, 'libnut not initialized');
470
483
  const element = param.locate;
@@ -756,6 +769,11 @@ class ComputerMidsceneTools extends BaseMidsceneTools {
756
769
  ];
757
770
  }
758
771
  }
772
+ function version() {
773
+ const currentVersion = "1.5.4";
774
+ console.log(`@midscene/computer v${currentVersion}`);
775
+ return currentVersion;
776
+ }
759
777
  function checkAccessibilityPermission(promptIfNeeded = false) {
760
778
  if ('darwin' !== process.platform) return {
761
779
  hasPermission: true,
@@ -821,4 +839,4 @@ async function checkComputerEnvironment() {
821
839
  async function getConnectedDisplays() {
822
840
  return ComputerDevice.listDisplays();
823
841
  }
824
- export { ComputerAgent, ComputerDevice, ComputerMidsceneTools, agentFromComputer, checkAccessibilityPermission, checkComputerEnvironment, checkXvfbInstalled, getConnectedDisplays, needsXvfb, overrideAIConfig };
842
+ export { ComputerAgent, ComputerDevice, ComputerMidsceneTools, agentFromComputer, checkAccessibilityPermission, checkComputerEnvironment, checkXvfbInstalled, getConnectedDisplays, needsXvfb, overrideAIConfig, version };
@@ -87,6 +87,15 @@ function _define_property(obj, key, value) {
87
87
  else obj[key] = value;
88
88
  return obj;
89
89
  }
90
+ const computerInputParamSchema = z.object({
91
+ value: z.string().describe('The text to input'),
92
+ mode: z["enum"]([
93
+ 'replace',
94
+ 'clear',
95
+ 'append'
96
+ ]).default('replace').optional().describe('Input mode: replace, clear, or append'),
97
+ locate: getMidsceneLocationSchema().describe('The input field to be filled').optional()
98
+ });
90
99
  const SMOOTH_MOVE_STEPS_TAP = 8;
91
100
  const SMOOTH_MOVE_STEPS_MOUSE_MOVE = 10;
92
101
  const SMOOTH_MOVE_DELAY_TAP = 8;
@@ -289,6 +298,7 @@ Available Displays: ${displays.length > 0 ? displays.map((d)=>d.name).join(', ')
289
298
  }
290
299
  async healthCheck() {
291
300
  console.log('[HealthCheck] Starting health check...');
301
+ console.log("[HealthCheck] @midscene/computer v1.5.4");
292
302
  console.log('[HealthCheck] Taking screenshot...');
293
303
  const screenshotTimeout = 15000;
294
304
  let timeoutId;
@@ -440,6 +450,11 @@ Available Displays: ${displays.length > 0 ? displays.map((d)=>d.name).join(', ')
440
450
  description: 'Move the mouse to the element',
441
451
  interfaceAlias: 'aiHover',
442
452
  paramSchema: actionHoverParamSchema,
453
+ sample: {
454
+ locate: {
455
+ prompt: 'the navigation menu item "Products"'
456
+ }
457
+ },
443
458
  call: async (param)=>{
444
459
  node_assert(libnut, 'libnut not initialized');
445
460
  const element = param.locate;
@@ -455,15 +470,13 @@ Available Displays: ${displays.length > 0 ? displays.map((d)=>d.name).join(', ')
455
470
  name: 'Input',
456
471
  description: 'Input text into the input field',
457
472
  interfaceAlias: 'aiInput',
458
- paramSchema: z.object({
459
- value: z.string().describe('The text to input'),
460
- mode: z["enum"]([
461
- 'replace',
462
- 'clear',
463
- 'append'
464
- ]).default('replace').optional().describe('Input mode: replace, clear, or append'),
465
- locate: getMidsceneLocationSchema().describe('The input field to be filled').optional()
466
- }),
473
+ paramSchema: computerInputParamSchema,
474
+ sample: {
475
+ value: 'test@example.com',
476
+ locate: {
477
+ prompt: 'the email input field'
478
+ }
479
+ },
467
480
  call: async (param)=>{
468
481
  node_assert(libnut, 'libnut not initialized');
469
482
  const element = param.locate;
@@ -762,7 +775,7 @@ class ComputerMCPServer extends BaseMCPServer {
762
775
  constructor(toolsManager){
763
776
  super({
764
777
  name: '@midscene/computer-mcp',
765
- version: __VERSION__,
778
+ version: "1.5.4",
766
779
  description: 'Control the computer desktop using natural language commands'
767
780
  }, toolsManager);
768
781
  }
package/dist/lib/cli.js CHANGED
@@ -116,6 +116,15 @@ function _define_property(obj, key, value) {
116
116
  else obj[key] = value;
117
117
  return obj;
118
118
  }
119
+ const computerInputParamSchema = core_namespaceObject.z.object({
120
+ value: core_namespaceObject.z.string().describe('The text to input'),
121
+ mode: core_namespaceObject.z["enum"]([
122
+ 'replace',
123
+ 'clear',
124
+ 'append'
125
+ ]).default('replace').optional().describe('Input mode: replace, clear, or append'),
126
+ locate: (0, core_namespaceObject.getMidsceneLocationSchema)().describe('The input field to be filled').optional()
127
+ });
119
128
  const SMOOTH_MOVE_STEPS_TAP = 8;
120
129
  const SMOOTH_MOVE_STEPS_MOUSE_MOVE = 10;
121
130
  const SMOOTH_MOVE_DELAY_TAP = 8;
@@ -318,6 +327,7 @@ Available Displays: ${displays.length > 0 ? displays.map((d)=>d.name).join(', ')
318
327
  }
319
328
  async healthCheck() {
320
329
  console.log('[HealthCheck] Starting health check...');
330
+ console.log("[HealthCheck] @midscene/computer v1.5.4");
321
331
  console.log('[HealthCheck] Taking screenshot...');
322
332
  const screenshotTimeout = 15000;
323
333
  let timeoutId;
@@ -469,6 +479,11 @@ Available Displays: ${displays.length > 0 ? displays.map((d)=>d.name).join(', ')
469
479
  description: 'Move the mouse to the element',
470
480
  interfaceAlias: 'aiHover',
471
481
  paramSchema: device_namespaceObject.actionHoverParamSchema,
482
+ sample: {
483
+ locate: {
484
+ prompt: 'the navigation menu item "Products"'
485
+ }
486
+ },
472
487
  call: async (param)=>{
473
488
  external_node_assert_default()(libnut, 'libnut not initialized');
474
489
  const element = param.locate;
@@ -484,15 +499,13 @@ Available Displays: ${displays.length > 0 ? displays.map((d)=>d.name).join(', ')
484
499
  name: 'Input',
485
500
  description: 'Input text into the input field',
486
501
  interfaceAlias: 'aiInput',
487
- paramSchema: core_namespaceObject.z.object({
488
- value: core_namespaceObject.z.string().describe('The text to input'),
489
- mode: core_namespaceObject.z["enum"]([
490
- 'replace',
491
- 'clear',
492
- 'append'
493
- ]).default('replace').optional().describe('Input mode: replace, clear, or append'),
494
- locate: (0, core_namespaceObject.getMidsceneLocationSchema)().describe('The input field to be filled').optional()
495
- }),
502
+ paramSchema: computerInputParamSchema,
503
+ sample: {
504
+ value: 'test@example.com',
505
+ locate: {
506
+ prompt: 'the email input field'
507
+ }
508
+ },
496
509
  call: async (param)=>{
497
510
  external_node_assert_default()(libnut, 'libnut not initialized');
498
511
  const element = param.locate;
@@ -786,7 +799,8 @@ class ComputerMidsceneTools extends mcp_namespaceObject.BaseMidsceneTools {
786
799
  }
787
800
  const tools = new ComputerMidsceneTools();
788
801
  (0, cli_namespaceObject.runToolsCLI)(tools, 'midscene-computer', {
789
- stripPrefix: 'computer_'
802
+ stripPrefix: 'computer_',
803
+ version: "1.5.4"
790
804
  }).catch((e)=>{
791
805
  if (!(e instanceof cli_namespaceObject.CLIError)) console.error(e);
792
806
  process.exit(e instanceof cli_namespaceObject.CLIError ? e.exitCode : 1);
package/dist/lib/index.js CHANGED
@@ -36,6 +36,7 @@ var __webpack_require__ = {};
36
36
  var __webpack_exports__ = {};
37
37
  __webpack_require__.r(__webpack_exports__);
38
38
  __webpack_require__.d(__webpack_exports__, {
39
+ version: ()=>version,
39
40
  checkComputerEnvironment: ()=>checkComputerEnvironment,
40
41
  checkXvfbInstalled: ()=>checkXvfbInstalled,
41
42
  checkAccessibilityPermission: ()=>checkAccessibilityPermission,
@@ -136,6 +137,15 @@ function _define_property(obj, key, value) {
136
137
  else obj[key] = value;
137
138
  return obj;
138
139
  }
140
+ const computerInputParamSchema = core_namespaceObject.z.object({
141
+ value: core_namespaceObject.z.string().describe('The text to input'),
142
+ mode: core_namespaceObject.z["enum"]([
143
+ 'replace',
144
+ 'clear',
145
+ 'append'
146
+ ]).default('replace').optional().describe('Input mode: replace, clear, or append'),
147
+ locate: (0, core_namespaceObject.getMidsceneLocationSchema)().describe('The input field to be filled').optional()
148
+ });
139
149
  const SMOOTH_MOVE_STEPS_TAP = 8;
140
150
  const SMOOTH_MOVE_STEPS_MOUSE_MOVE = 10;
141
151
  const SMOOTH_MOVE_DELAY_TAP = 8;
@@ -338,6 +348,7 @@ Available Displays: ${displays.length > 0 ? displays.map((d)=>d.name).join(', ')
338
348
  }
339
349
  async healthCheck() {
340
350
  console.log('[HealthCheck] Starting health check...');
351
+ console.log("[HealthCheck] @midscene/computer v1.5.4");
341
352
  console.log('[HealthCheck] Taking screenshot...');
342
353
  const screenshotTimeout = 15000;
343
354
  let timeoutId;
@@ -489,6 +500,11 @@ Available Displays: ${displays.length > 0 ? displays.map((d)=>d.name).join(', ')
489
500
  description: 'Move the mouse to the element',
490
501
  interfaceAlias: 'aiHover',
491
502
  paramSchema: device_namespaceObject.actionHoverParamSchema,
503
+ sample: {
504
+ locate: {
505
+ prompt: 'the navigation menu item "Products"'
506
+ }
507
+ },
492
508
  call: async (param)=>{
493
509
  external_node_assert_default()(device_libnut, 'libnut not initialized');
494
510
  const element = param.locate;
@@ -504,15 +520,13 @@ Available Displays: ${displays.length > 0 ? displays.map((d)=>d.name).join(', ')
504
520
  name: 'Input',
505
521
  description: 'Input text into the input field',
506
522
  interfaceAlias: 'aiInput',
507
- paramSchema: core_namespaceObject.z.object({
508
- value: core_namespaceObject.z.string().describe('The text to input'),
509
- mode: core_namespaceObject.z["enum"]([
510
- 'replace',
511
- 'clear',
512
- 'append'
513
- ]).default('replace').optional().describe('Input mode: replace, clear, or append'),
514
- locate: (0, core_namespaceObject.getMidsceneLocationSchema)().describe('The input field to be filled').optional()
515
- }),
523
+ paramSchema: computerInputParamSchema,
524
+ sample: {
525
+ value: 'test@example.com',
526
+ locate: {
527
+ prompt: 'the email input field'
528
+ }
529
+ },
516
530
  call: async (param)=>{
517
531
  external_node_assert_default()(device_libnut, 'libnut not initialized');
518
532
  const element = param.locate;
@@ -807,6 +821,11 @@ class ComputerMidsceneTools extends mcp_namespaceObject.BaseMidsceneTools {
807
821
  }
808
822
  }
809
823
  const env_namespaceObject = require("@midscene/shared/env");
824
+ function version() {
825
+ const currentVersion = "1.5.4";
826
+ console.log(`@midscene/computer v${currentVersion}`);
827
+ return currentVersion;
828
+ }
810
829
  function checkAccessibilityPermission(promptIfNeeded = false) {
811
830
  if ('darwin' !== process.platform) return {
812
831
  hasPermission: true,
@@ -882,6 +901,7 @@ exports.checkXvfbInstalled = __webpack_exports__.checkXvfbInstalled;
882
901
  exports.getConnectedDisplays = __webpack_exports__.getConnectedDisplays;
883
902
  exports.needsXvfb = __webpack_exports__.needsXvfb;
884
903
  exports.overrideAIConfig = __webpack_exports__.overrideAIConfig;
904
+ exports.version = __webpack_exports__.version;
885
905
  for(var __rspack_i in __webpack_exports__)if (-1 === [
886
906
  "ComputerAgent",
887
907
  "ComputerDevice",
@@ -892,7 +912,8 @@ for(var __rspack_i in __webpack_exports__)if (-1 === [
892
912
  "checkXvfbInstalled",
893
913
  "getConnectedDisplays",
894
914
  "needsXvfb",
895
- "overrideAIConfig"
915
+ "overrideAIConfig",
916
+ "version"
896
917
  ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
897
918
  Object.defineProperty(exports, '__esModule', {
898
919
  value: true
@@ -131,6 +131,15 @@ function _define_property(obj, key, value) {
131
131
  else obj[key] = value;
132
132
  return obj;
133
133
  }
134
+ const computerInputParamSchema = core_namespaceObject.z.object({
135
+ value: core_namespaceObject.z.string().describe('The text to input'),
136
+ mode: core_namespaceObject.z["enum"]([
137
+ 'replace',
138
+ 'clear',
139
+ 'append'
140
+ ]).default('replace').optional().describe('Input mode: replace, clear, or append'),
141
+ locate: (0, core_namespaceObject.getMidsceneLocationSchema)().describe('The input field to be filled').optional()
142
+ });
134
143
  const SMOOTH_MOVE_STEPS_TAP = 8;
135
144
  const SMOOTH_MOVE_STEPS_MOUSE_MOVE = 10;
136
145
  const SMOOTH_MOVE_DELAY_TAP = 8;
@@ -333,6 +342,7 @@ Available Displays: ${displays.length > 0 ? displays.map((d)=>d.name).join(', ')
333
342
  }
334
343
  async healthCheck() {
335
344
  console.log('[HealthCheck] Starting health check...');
345
+ console.log("[HealthCheck] @midscene/computer v1.5.4");
336
346
  console.log('[HealthCheck] Taking screenshot...');
337
347
  const screenshotTimeout = 15000;
338
348
  let timeoutId;
@@ -484,6 +494,11 @@ Available Displays: ${displays.length > 0 ? displays.map((d)=>d.name).join(', ')
484
494
  description: 'Move the mouse to the element',
485
495
  interfaceAlias: 'aiHover',
486
496
  paramSchema: device_namespaceObject.actionHoverParamSchema,
497
+ sample: {
498
+ locate: {
499
+ prompt: 'the navigation menu item "Products"'
500
+ }
501
+ },
487
502
  call: async (param)=>{
488
503
  external_node_assert_default()(libnut, 'libnut not initialized');
489
504
  const element = param.locate;
@@ -499,15 +514,13 @@ Available Displays: ${displays.length > 0 ? displays.map((d)=>d.name).join(', ')
499
514
  name: 'Input',
500
515
  description: 'Input text into the input field',
501
516
  interfaceAlias: 'aiInput',
502
- paramSchema: core_namespaceObject.z.object({
503
- value: core_namespaceObject.z.string().describe('The text to input'),
504
- mode: core_namespaceObject.z["enum"]([
505
- 'replace',
506
- 'clear',
507
- 'append'
508
- ]).default('replace').optional().describe('Input mode: replace, clear, or append'),
509
- locate: (0, core_namespaceObject.getMidsceneLocationSchema)().describe('The input field to be filled').optional()
510
- }),
517
+ paramSchema: computerInputParamSchema,
518
+ sample: {
519
+ value: 'test@example.com',
520
+ locate: {
521
+ prompt: 'the email input field'
522
+ }
523
+ },
511
524
  call: async (param)=>{
512
525
  external_node_assert_default()(libnut, 'libnut not initialized');
513
526
  const element = param.locate;
@@ -806,7 +819,7 @@ class ComputerMCPServer extends mcp_namespaceObject.BaseMCPServer {
806
819
  constructor(toolsManager){
807
820
  super({
808
821
  name: '@midscene/computer-mcp',
809
- version: __VERSION__,
822
+ version: "1.5.4",
810
823
  description: 'Control the computer desktop using natural language commands'
811
824
  }, toolsManager);
812
825
  }
@@ -153,4 +153,6 @@ export declare function needsXvfb(explicitOpt?: boolean): boolean;
153
153
 
154
154
  export { overrideAIConfig }
155
155
 
156
+ export declare function version(): string;
157
+
156
158
  export { }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midscene/computer",
3
- "version": "1.5.4-beta-20260310030546.0",
3
+ "version": "1.5.4",
4
4
  "description": "Midscene.js Computer Desktop Automation",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -36,8 +36,8 @@
36
36
  "@computer-use/libnut": "^4.2.0",
37
37
  "clipboardy": "^4.0.0",
38
38
  "screenshot-desktop": "^1.15.3",
39
- "@midscene/core": "1.5.4-beta-20260310030546.0",
40
- "@midscene/shared": "1.5.4-beta-20260310030546.0"
39
+ "@midscene/shared": "1.5.4",
40
+ "@midscene/core": "1.5.4"
41
41
  },
42
42
  "optionalDependencies": {
43
43
  "node-mac-permissions": "2.5.0"