We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
`view.flows.add` command does not exist but the examples reference it
#### Problem Description

The `view.flows.add` command does not exist but the example `duplicate-modify-replay.py` shows this command being used.

`replay.client` seems to perform both the "add to view" and "replay" function.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `examples/addons/duplicate-modify-replay.py`
Content:
```
1 """Take incoming HTTP requests and replay them with modified parameters."""
2 from mitmproxy import ctx
3 
4 
5 def request(flow):
6     # Avoid an infinite loop by not replaying already replayed requests
7     if flow.is_replay == "request":
8         return
9     flow = flow.copy()
10     # Only interactive tools have a view. If we have one, add a duplicate entry
11     # for our flow.
12     if "view" in ctx.master.addons:
13         ctx.master.commands.call("view.flows.add", [flow])
14     flow.request.path = "/changed"
15     ctx.master.commands.call("replay.client", [flow])
16
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/examples/addons/duplicate-modify-replay.py b/examples/addons/duplicate-modify-replay.py
--- a/examples/addons/duplicate-modify-replay.py
+++ b/examples/addons/duplicate-modify-replay.py
@@ -10,6 +10,6 @@
     # Only interactive tools have a view. If we have one, add a duplicate entry
     # for our flow.
     if "view" in ctx.master.addons:
-        ctx.master.commands.call("view.flows.add", [flow])
+        ctx.master.commands.call("view.flows.duplicate", [flow])
     flow.request.path = "/changed"
     ctx.master.commands.call("replay.client", [flow])

{"golden_diff": "diff --git a/examples/addons/duplicate-modify-replay.py b/examples/addons/duplicate-modify-replay.py\n--- a/examples/addons/duplicate-modify-replay.py\n+++ b/examples/addons/duplicate-modify-replay.py\n@@ -10,6 +10,6 @@\n     # Only interactive tools have a view. If we have one, add a duplicate entry\n     # for our flow.\n     if \"view\" in ctx.master.addons:\n-        ctx.master.commands.call(\"view.flows.add\", [flow])\n+        ctx.master.commands.call(\"view.flows.duplicate\", [flow])\n     flow.request.path = \"/changed\"\n     ctx.master.commands.call(\"replay.client\", [flow])\n", "issue": "`view.flows.add` command does not exist but the examples reference it\n#### Problem Description\r\n\r\nThe `view.flows.add` command does not exist but the example `duplicate-modify-replay.py` shows this command being used.\r\n\r\n`replay.client` seems to perform both the \"add to view\" and \"replay\" function.\n", "before_files": [{"content": "\"\"\"Take incoming HTTP requests and replay them with modified parameters.\"\"\"\nfrom mitmproxy import ctx\n\n\ndef request(flow):\n    # Avoid an infinite loop by not replaying already replayed requests\n    if flow.is_replay == \"request\":\n        return\n    flow = flow.copy()\n    # Only interactive tools have a view. If we have one, add a duplicate entry\n    # for our flow.\n    if \"view\" in ctx.master.addons:\n        ctx.master.commands.call(\"view.flows.add\", [flow])\n    flow.request.path = \"/changed\"\n    ctx.master.commands.call(\"replay.client\", [flow])\n", "path": "examples/addons/duplicate-modify-replay.py"}], "after_files": [{"content": "\"\"\"Take incoming HTTP requests and replay them with modified parameters.\"\"\"\nfrom mitmproxy import ctx\n\n\ndef request(flow):\n    # Avoid an infinite loop by not replaying already replayed requests\n    if flow.is_replay == \"request\":\n        return\n    flow = flow.copy()\n    # Only interactive tools have a view. If we have one, add a duplicate entry\n    # for our flow.\n    if \"view\" in ctx.master.addons:\n        ctx.master.commands.call(\"view.flows.duplicate\", [flow])\n    flow.request.path = \"/changed\"\n    ctx.master.commands.call(\"replay.client\", [flow])\n", "path": "examples/addons/duplicate-modify-replay.py"}]}