MCPcopy
hub / github.com/stitionai/devika / run_cmd

Function run_cmd

src/browser/interaction.py:503–523  ·  view source on GitHub ↗
(cmd)

Source from the content-addressed store, hash-verified

501 return response
502
503 def run_cmd(cmd):
504 cmd = cmd.split("\n")[0]
505
506 if cmd.startswith("SCROLL UP"):
507 _crawler.scroll("up")
508 elif cmd.startswith("SCROLL DOWN"):
509 _crawler.scroll("down")
510 elif cmd.startswith("CLICK"):
511 commasplit = cmd.split(",")
512 id = commasplit[0].split(" ")[1]
513 _crawler.click(id)
514 elif cmd.startswith("TYPE"):
515 spacesplit = cmd.split(" ")
516 id = spacesplit[1]
517 text = " ".join(spacesplit[2:])
518 text = text[1:-1]
519 if cmd.startswith("TYPESUBMIT"):
520 text += '\n'
521 _crawler.type(id, text)
522
523 time.sleep(2)
524
525 gpt_cmd = ""
526 prev_cmd = ""

Callers 1

start_interactionFunction · 0.85

Calls 3

scrollMethod · 0.80
clickMethod · 0.80
typeMethod · 0.80

Tested by

no test coverage detected