plato-sdk-v2 2.7.2__py3-none-any.whl → 2.7.3__py3-none-any.whl
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.
- plato/v1/cli/pm.py +77 -27
- {plato_sdk_v2-2.7.2.dist-info → plato_sdk_v2-2.7.3.dist-info}/METADATA +1 -1
- {plato_sdk_v2-2.7.2.dist-info → plato_sdk_v2-2.7.3.dist-info}/RECORD +5 -5
- {plato_sdk_v2-2.7.2.dist-info → plato_sdk_v2-2.7.3.dist-info}/WHEEL +0 -0
- {plato_sdk_v2-2.7.2.dist-info → plato_sdk_v2-2.7.3.dist-info}/entry_points.txt +0 -0
plato/v1/cli/pm.py
CHANGED
|
@@ -544,9 +544,19 @@ def review_base(
|
|
|
544
544
|
console.print(f"[bold red]📋 Most Recent Base Review: REJECTED[/bold red] ({timestamp})")
|
|
545
545
|
else:
|
|
546
546
|
console.print(f"[bold green]📋 Most Recent Base Review: PASSED[/bold green] ({timestamp})")
|
|
547
|
-
comments
|
|
548
|
-
|
|
549
|
-
|
|
547
|
+
# Handle both old 'comments' field and new 'sim_comments' structure
|
|
548
|
+
sim_comments = recent_review.get("sim_comments")
|
|
549
|
+
if sim_comments:
|
|
550
|
+
console.print("[yellow]Reviewer Comments:[/yellow]")
|
|
551
|
+
for i, item in enumerate(sim_comments, 1):
|
|
552
|
+
comment_text = item.get("comment", "")
|
|
553
|
+
if comment_text:
|
|
554
|
+
console.print(f" {i}. {comment_text}")
|
|
555
|
+
else:
|
|
556
|
+
# Fallback to old comments field
|
|
557
|
+
comments = recent_review.get("comments")
|
|
558
|
+
if comments:
|
|
559
|
+
console.print(f"[yellow]Reviewer Comments:[/yellow] {comments}")
|
|
550
560
|
|
|
551
561
|
console.print()
|
|
552
562
|
|
|
@@ -752,8 +762,6 @@ def review_data(
|
|
|
752
762
|
simulator, artifact, require_artifact=False, command_name="review data"
|
|
753
763
|
)
|
|
754
764
|
|
|
755
|
-
# Determine target URL based on simulator
|
|
756
|
-
target_url = f"https://{simulator_name}.web.plato.so"
|
|
757
765
|
console.print(f"[cyan]Simulator:[/cyan] {simulator_name}")
|
|
758
766
|
|
|
759
767
|
# Fetch simulator config and get artifact ID if not provided
|
|
@@ -802,21 +810,21 @@ def review_data(
|
|
|
802
810
|
is_installed = "site-packages" in str(package_dir)
|
|
803
811
|
|
|
804
812
|
if is_installed:
|
|
805
|
-
extension_source_path = package_dir / "extensions" / "
|
|
813
|
+
extension_source_path = package_dir / "extensions" / "data-review"
|
|
806
814
|
else:
|
|
807
815
|
repo_root = package_dir.parent.parent.parent # plato-client/
|
|
808
|
-
extension_source_path = repo_root / "extensions" / "
|
|
816
|
+
extension_source_path = repo_root / "extensions" / "data-review"
|
|
809
817
|
|
|
810
818
|
# Fallback to env var
|
|
811
819
|
if not extension_source_path.exists():
|
|
812
820
|
plato_client_dir_env = os.getenv("PLATO_CLIENT_DIR")
|
|
813
821
|
if plato_client_dir_env:
|
|
814
|
-
env_path = Path(plato_client_dir_env) / "extensions" / "
|
|
822
|
+
env_path = Path(plato_client_dir_env) / "extensions" / "data-review"
|
|
815
823
|
if env_path.exists():
|
|
816
824
|
extension_source_path = env_path
|
|
817
825
|
|
|
818
826
|
if not extension_source_path.exists():
|
|
819
|
-
console.print("[red]❌
|
|
827
|
+
console.print("[red]❌ Data Review extension not found[/red]")
|
|
820
828
|
console.print(f"\n[yellow]Expected location:[/yellow] {extension_source_path}")
|
|
821
829
|
raise typer.Exit(1)
|
|
822
830
|
|
|
@@ -829,14 +837,44 @@ def review_data(
|
|
|
829
837
|
console.print(f"[green]✅ Extension copied to: {extension_path}[/green]")
|
|
830
838
|
|
|
831
839
|
async def _review_data():
|
|
840
|
+
base_url = _get_base_url()
|
|
841
|
+
plato = AsyncPlato(api_key=api_key, base_url=base_url)
|
|
842
|
+
session = None
|
|
832
843
|
playwright = None
|
|
833
844
|
browser = None
|
|
834
845
|
|
|
835
846
|
try:
|
|
847
|
+
# Check if we have an artifact ID to create a session
|
|
848
|
+
if not artifact_id:
|
|
849
|
+
console.print("[red]❌ No artifact ID available. Cannot create session.[/red]")
|
|
850
|
+
console.print("[yellow]Specify artifact with: plato pm review data -s simulator:artifact_id[/yellow]")
|
|
851
|
+
raise typer.Exit(1)
|
|
852
|
+
|
|
853
|
+
# Create session with artifact
|
|
854
|
+
console.print(f"[cyan]Creating {simulator_name} environment with artifact {artifact_id}...[/cyan]")
|
|
855
|
+
session = await plato.sessions.create(
|
|
856
|
+
envs=[Env.artifact(artifact_id)],
|
|
857
|
+
timeout=300,
|
|
858
|
+
)
|
|
859
|
+
console.print(f"[green]✅ Session created: {session.session_id}[/green]")
|
|
860
|
+
|
|
861
|
+
# Reset environment
|
|
862
|
+
console.print("[cyan]Resetting environment...[/cyan]")
|
|
863
|
+
await session.reset()
|
|
864
|
+
console.print("[green]✅ Environment reset complete![/green]")
|
|
865
|
+
|
|
866
|
+
# Get public URL
|
|
867
|
+
public_urls = await session.get_public_url()
|
|
868
|
+
first_alias = session.envs[0].alias if session.envs else None
|
|
869
|
+
public_url = public_urls.get(first_alias) if first_alias else None
|
|
870
|
+
if not public_url and public_urls:
|
|
871
|
+
public_url = list(public_urls.values())[0]
|
|
872
|
+
console.print(f"[cyan]Public URL:[/cyan] {public_url}")
|
|
873
|
+
|
|
836
874
|
user_data_dir = Path.home() / ".plato" / "chrome-data"
|
|
837
875
|
user_data_dir.mkdir(parents=True, exist_ok=True)
|
|
838
876
|
|
|
839
|
-
console.print("[cyan]Launching Chrome with
|
|
877
|
+
console.print("[cyan]Launching Chrome with Data Review extension...[/cyan]")
|
|
840
878
|
|
|
841
879
|
from playwright.async_api import async_playwright
|
|
842
880
|
|
|
@@ -877,13 +915,14 @@ def review_data(
|
|
|
877
915
|
else:
|
|
878
916
|
console.print("[yellow]⚠️ Could not find extension ID. Please set API key manually.[/yellow]")
|
|
879
917
|
|
|
880
|
-
#
|
|
881
|
-
console.print(
|
|
918
|
+
# Navigate to public URL (user logs in manually with displayed credentials)
|
|
919
|
+
console.print("[cyan]Opening environment...[/cyan]")
|
|
882
920
|
main_page = await browser.new_page()
|
|
883
|
-
|
|
884
|
-
|
|
921
|
+
if public_url:
|
|
922
|
+
await main_page.goto(public_url)
|
|
923
|
+
console.print(f"[green]✅ Loaded: {public_url}[/green]")
|
|
885
924
|
|
|
886
|
-
#
|
|
925
|
+
# Use options page to set API key
|
|
887
926
|
if extension_id:
|
|
888
927
|
options_page = await browser.new_page()
|
|
889
928
|
try:
|
|
@@ -907,17 +946,16 @@ def review_data(
|
|
|
907
946
|
await options_page.close()
|
|
908
947
|
|
|
909
948
|
# Bring main page to front
|
|
910
|
-
|
|
949
|
+
if main_page:
|
|
950
|
+
await main_page.bring_to_front()
|
|
911
951
|
|
|
912
952
|
console.print()
|
|
913
953
|
console.print("[bold]Instructions:[/bold]")
|
|
914
|
-
console.print(" 1. Click the
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
console.print(" 3. Use the extension to record and submit reviews")
|
|
920
|
-
console.print(" 4. When done, press Control-C to exit")
|
|
954
|
+
console.print(" 1. Click the Data Review extension icon to open the sidebar")
|
|
955
|
+
console.print(f" 2. Enter '{simulator_name}' as the simulator name and click Start Review")
|
|
956
|
+
console.print(" 3. Take screenshots and add comments for any issues")
|
|
957
|
+
console.print(" 4. Select Pass or Reject and submit the review")
|
|
958
|
+
console.print(" 5. When done, press Control-C to exit")
|
|
921
959
|
|
|
922
960
|
# Show recent review if available
|
|
923
961
|
if recent_review:
|
|
@@ -930,10 +968,20 @@ def review_data(
|
|
|
930
968
|
else:
|
|
931
969
|
console.print(f"[bold green]📋 Most Recent Data Review: PASSED[/bold green] ({timestamp})")
|
|
932
970
|
|
|
933
|
-
comments
|
|
934
|
-
|
|
971
|
+
# Handle both old 'comments' field and new 'sim_comments' structure
|
|
972
|
+
sim_comments = recent_review.get("sim_comments")
|
|
973
|
+
if sim_comments:
|
|
935
974
|
console.print("\n[yellow]Reviewer Comments:[/yellow]")
|
|
936
|
-
|
|
975
|
+
for i, item in enumerate(sim_comments, 1):
|
|
976
|
+
comment_text = item.get("comment", "")
|
|
977
|
+
if comment_text:
|
|
978
|
+
console.print(f" {i}. {comment_text}")
|
|
979
|
+
else:
|
|
980
|
+
# Fallback to old comments field
|
|
981
|
+
comments = recent_review.get("comments")
|
|
982
|
+
if comments:
|
|
983
|
+
console.print("\n[yellow]Reviewer Comments:[/yellow]")
|
|
984
|
+
console.print(f" {comments}")
|
|
937
985
|
console.print("=" * 60)
|
|
938
986
|
|
|
939
987
|
console.print()
|
|
@@ -954,6 +1002,8 @@ def review_data(
|
|
|
954
1002
|
|
|
955
1003
|
finally:
|
|
956
1004
|
try:
|
|
1005
|
+
if session:
|
|
1006
|
+
await session.close()
|
|
957
1007
|
if browser:
|
|
958
1008
|
await browser.close()
|
|
959
1009
|
if playwright:
|
|
@@ -961,7 +1011,7 @@ def review_data(
|
|
|
961
1011
|
if temp_ext_dir.exists():
|
|
962
1012
|
shutil.rmtree(temp_ext_dir, ignore_errors=True)
|
|
963
1013
|
except Exception as e:
|
|
964
|
-
console.print(f"[yellow]⚠️
|
|
1014
|
+
console.print(f"[yellow]⚠️ Cleanup error: {e}[/yellow]")
|
|
965
1015
|
|
|
966
1016
|
handle_async(_review_data())
|
|
967
1017
|
|
|
@@ -425,7 +425,7 @@ plato/v1/cli/__init__.py,sha256=om4b7PxgsoI7rEwuQelmQkqPdhMVn53_5qEN8kvksYw,105
|
|
|
425
425
|
plato/v1/cli/agent.py,sha256=r5Eh2e2-rUIGjK5uevnGKqScABtFK-Spomrrytj-3og,44053
|
|
426
426
|
plato/v1/cli/chronos.py,sha256=lzFY0nomP1AY14i8oc8OvWOdq9ydCiE3dN2XrSupvA4,27827
|
|
427
427
|
plato/v1/cli/main.py,sha256=Yqy1vn4sGyAWKNpDVcLl9pbzkMn89tYVBIxFU30ZtPk,6905
|
|
428
|
-
plato/v1/cli/pm.py,sha256=
|
|
428
|
+
plato/v1/cli/pm.py,sha256=Q6HFTb8ZO_aB0EtAO6-OOsnVv3SoC8hL7UHpawBz46Y,55520
|
|
429
429
|
plato/v1/cli/proxy.py,sha256=WmCt0R9Gos1q0FZTQSsbloNC3-Cnx6Yb60RZF1BzC18,12178
|
|
430
430
|
plato/v1/cli/sandbox.py,sha256=SQb5XCdYvTHEyZxOv9ECtafTdkxpjfq45pYd-m1z7k0,101506
|
|
431
431
|
plato/v1/cli/ssh.py,sha256=9ypjn5kQuaTcVjsWMDIUDyehXRH9fauk_z-C3mXzYJ8,2381
|
|
@@ -504,7 +504,7 @@ plato/worlds/base.py,sha256=-RR71bSxEFI5yydtrtq-AAbuw98CIjvmrbztqzB9oIc,31041
|
|
|
504
504
|
plato/worlds/build_hook.py,sha256=KSoW0kqa5b7NyZ7MYOw2qsZ_2FkWuz0M3Ru7AKOP7Qw,3486
|
|
505
505
|
plato/worlds/config.py,sha256=O1lUXzxp-Z_M7izslT8naXgE6XujjzwYFFrDDzUOueI,12736
|
|
506
506
|
plato/worlds/runner.py,sha256=r9B2BxBae8_dM7y5cJf9xhThp_I1Qvf_tlPq2rs8qC8,4013
|
|
507
|
-
plato_sdk_v2-2.7.
|
|
508
|
-
plato_sdk_v2-2.7.
|
|
509
|
-
plato_sdk_v2-2.7.
|
|
510
|
-
plato_sdk_v2-2.7.
|
|
507
|
+
plato_sdk_v2-2.7.3.dist-info/METADATA,sha256=XmAi4ZSPth7U15myiaNzNL98AIPMnCJjtkTsWWXMUjI,8652
|
|
508
|
+
plato_sdk_v2-2.7.3.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
509
|
+
plato_sdk_v2-2.7.3.dist-info/entry_points.txt,sha256=upGMbJCx6YWUTKrPoYvYUYfFCqYr75nHDwhA-45m6p8,136
|
|
510
|
+
plato_sdk_v2-2.7.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|