plato-sdk-v2 2.6.1__py3-none-any.whl → 2.7.0__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.
Files changed (32) hide show
  1. plato/_generated/__init__.py +1 -1
  2. plato/_generated/api/v2/__init__.py +2 -1
  3. plato/_generated/api/v2/networks/__init__.py +23 -0
  4. plato/_generated/api/v2/networks/add_member.py +75 -0
  5. plato/_generated/api/v2/networks/create_network.py +70 -0
  6. plato/_generated/api/v2/networks/delete_network.py +68 -0
  7. plato/_generated/api/v2/networks/get_network.py +69 -0
  8. plato/_generated/api/v2/networks/list_members.py +69 -0
  9. plato/_generated/api/v2/networks/list_networks.py +74 -0
  10. plato/_generated/api/v2/networks/remove_member.py +73 -0
  11. plato/_generated/api/v2/networks/update_member.py +80 -0
  12. plato/_generated/api/v2/sessions/__init__.py +4 -0
  13. plato/_generated/api/v2/sessions/add_ssh_key.py +81 -0
  14. plato/_generated/api/v2/sessions/connect_network.py +89 -0
  15. plato/_generated/models/__init__.py +150 -24
  16. plato/v1/cli/agent.py +45 -52
  17. plato/v1/cli/chronos.py +46 -58
  18. plato/v1/cli/main.py +14 -25
  19. plato/v1/cli/pm.py +37 -92
  20. plato/v1/cli/proxy.py +343 -0
  21. plato/v1/cli/sandbox.py +305 -385
  22. plato/v1/cli/ssh.py +12 -167
  23. plato/v1/cli/verify.py +79 -55
  24. plato/v1/cli/world.py +13 -12
  25. plato/v2/async_/client.py +24 -2
  26. plato/v2/async_/session.py +48 -0
  27. plato/v2/sync/client.py +24 -2
  28. plato/v2/sync/session.py +48 -0
  29. {plato_sdk_v2-2.6.1.dist-info → plato_sdk_v2-2.7.0.dist-info}/METADATA +1 -1
  30. {plato_sdk_v2-2.6.1.dist-info → plato_sdk_v2-2.7.0.dist-info}/RECORD +32 -20
  31. {plato_sdk_v2-2.6.1.dist-info → plato_sdk_v2-2.7.0.dist-info}/WHEEL +0 -0
  32. {plato_sdk_v2-2.6.1.dist-info → plato_sdk_v2-2.7.0.dist-info}/entry_points.txt +0 -0
plato/v1/cli/chronos.py CHANGED
@@ -48,30 +48,21 @@ def launch(
48
48
  help="Wait for job completion and stream logs",
49
49
  ),
50
50
  ):
51
- """
52
- Launch a Chronos job from a config file.
53
-
54
- \b
55
- Config format:
56
- {
57
- "world": {
58
- "package": "plato-world-structured-execution:0.1.17",
59
- "config": {
60
- "skill_runner": {
61
- "image": "computer-use:1.1.0",
62
- "config": { ... }
63
- },
64
- "secrets": { ... }
65
- }
66
- },
67
- "runtime": {
68
- "artifact_id": "..." // optional
69
- }
70
- }
71
-
72
- Examples:
73
- plato chronos launch config.json
74
- plato chronos launch config.json --wait
51
+ """Launch a Chronos job from a config file.
52
+
53
+ Submits a job configuration to the Chronos service to run a world with its
54
+ configured agents and secrets.
55
+
56
+ Arguments:
57
+ config: Path to the job configuration JSON file
58
+
59
+ Options:
60
+ -u, --url: Chronos API URL (default: https://chronos.plato.so, or CHRONOS_URL env var)
61
+ -k, --api-key: Plato API key for authentication (or PLATO_API_KEY env var)
62
+ -w, --wait: Wait for job completion and stream logs (not yet implemented)
63
+
64
+ The config file should contain world.package (required) and optionally world.config,
65
+ runtime.artifact_id, and tags.
75
66
  """
76
67
  import httpx
77
68
 
@@ -148,12 +139,18 @@ def example(
148
139
  help="Output file path (prints to stdout if not specified)",
149
140
  ),
150
141
  ):
151
- """
152
- Generate an example job config file.
142
+ """Generate an example job config file.
143
+
144
+ Creates a sample JSON configuration for launching Chronos jobs, which can be
145
+ customized for your use case.
146
+
147
+ Arguments:
148
+ world: World type to generate example for (default: "structured-execution")
153
149
 
154
- Examples:
155
- plato chronos example
156
- plato chronos example structured-execution -o config.json
150
+ Options:
151
+ -o, --output: Output file path. If not specified, prints to stdout.
152
+
153
+ Available worlds: structured-execution, code-world
157
154
  """
158
155
  examples = {
159
156
  "structured-execution": {
@@ -724,14 +721,17 @@ def stop(
724
721
  help="Plato API key for authentication",
725
722
  ),
726
723
  ):
727
- """
728
- Stop a running Chronos session.
724
+ """Stop a running Chronos session.
729
725
 
730
- This marks the session as cancelled with status reason "User cancelled".
726
+ Marks the session as cancelled with status reason "User cancelled" and terminates
727
+ any running containers.
731
728
 
732
- Examples:
733
- plato chronos stop abc123
734
- plato chronos stop abc123 --url https://chronos.plato.so
729
+ Arguments:
730
+ session_id: The session ID to stop (from 'plato chronos launch' output)
731
+
732
+ Options:
733
+ -u, --url: Chronos API URL (default: https://chronos.plato.so, or CHRONOS_URL env var)
734
+ -k, --api-key: Plato API key for authentication (or PLATO_API_KEY env var)
735
735
  """
736
736
  # Set defaults
737
737
  if not chronos_url:
@@ -784,32 +784,20 @@ def dev(
784
784
  typer.Option("--env-timeout", help="Timeout for environment creation (seconds)"),
785
785
  ] = 7200,
786
786
  ):
787
- """
788
- Run a world locally for development/debugging.
787
+ """Run a world locally for development/debugging.
789
788
 
790
- This runs the world in a Docker container with docker.sock mounted,
791
- allowing the world to spawn agent containers.
789
+ Builds and runs the world in a Docker container with docker.sock mounted,
790
+ allowing the world to spawn agent containers. Mounts local source code for
791
+ live development without rebuilding.
792
792
 
793
- \b
794
- Config format (same as Chronos launch):
795
- {
796
- "world": {
797
- "package": "plato-world-structured-execution:0.1.17",
798
- "config": {
799
- "skill_runner": {
800
- "image": "computer-use:1.1.0",
801
- "config": { ... }
802
- },
803
- "secrets": { ... }
804
- }
805
- },
806
- "runtime": {
807
- "artifact_id": "..."
808
- }
809
- }
793
+ Arguments:
794
+ config: Path to job config JSON file (same format as 'plato chronos launch')
810
795
 
811
- Example:
812
- plato chronos dev config.json -w ~/worlds/my-world -a ~/agents --platform linux/amd64
796
+ Options:
797
+ -w, --world-dir: Directory containing world source code to mount into the container
798
+ -a, --agents-dir: Directory containing agent source code to mount (optional)
799
+ -p, --platform: Docker platform for building (e.g., 'linux/amd64' for M1 Macs)
800
+ --env-timeout: Timeout in seconds for environment creation (default: 7200 = 2 hours)
813
801
  """
814
802
  logging.basicConfig(
815
803
  level=logging.INFO,
plato/v1/cli/main.py CHANGED
@@ -11,6 +11,7 @@ from dotenv import load_dotenv
11
11
  from plato.v1.cli.agent import agent_app
12
12
  from plato.v1.cli.chronos import chronos_app
13
13
  from plato.v1.cli.pm import pm_app
14
+ from plato.v1.cli.proxy import app as proxy_app
14
15
  from plato.v1.cli.sandbox import sandbox_app
15
16
  from plato.v1.cli.utils import console
16
17
  from plato.v1.cli.world import world_app
@@ -73,6 +74,7 @@ app.add_typer(pm_app, name="pm")
73
74
  app.add_typer(agent_app, name="agent")
74
75
  app.add_typer(world_app, name="world")
75
76
  app.add_typer(chronos_app, name="chronos")
77
+ app.add_typer(proxy_app, name="proxy")
76
78
 
77
79
 
78
80
  # =============================================================================
@@ -84,21 +86,13 @@ app.add_typer(chronos_app, name="chronos")
84
86
  def hub(
85
87
  ctx: typer.Context,
86
88
  ):
87
- """
88
- Launch the Plato Hub CLI (interactive TUI for managing simulators).
89
-
90
- The hub command opens the Go-based Plato CLI which provides an interactive
91
- terminal UI for browsing simulators, launching environments, and managing VMs.
89
+ """Launch the Plato Hub CLI (interactive TUI for managing simulators).
92
90
 
93
- Available subcommands:
94
- - clone <service>: Clone a service from Plato Hub
95
- - credentials: Display your Plato Hub credentials
96
- - (no args): Start interactive TUI mode
91
+ Opens the Go-based Plato CLI which provides an interactive terminal UI for
92
+ browsing simulators, launching environments, and managing VMs. Any additional
93
+ arguments are passed through to the Go CLI.
97
94
 
98
- Examples:
99
- plato hub clone espocrm
100
- plato hub credentials
101
- plato hub
95
+ Common subcommands: 'clone <service>', 'credentials', or no args for interactive mode.
102
96
  """
103
97
  # Find the bundled CLI binary
104
98
  plato_bin = _find_bundled_cli()
@@ -129,14 +123,12 @@ def hub(
129
123
  def clone(
130
124
  service: str = typer.Argument(..., help="Service name to clone (e.g., espocrm)"),
131
125
  ):
132
- """
133
- Clone a service repository from Plato Hub (Gitea).
126
+ """Clone a service repository from Plato Hub (Gitea).
134
127
 
135
- This clones the simulator source code to your local machine.
128
+ Clones the simulator source code to your local machine for development or review.
136
129
 
137
- Examples:
138
- plato clone espocrm
139
- plato clone gitea
130
+ Arguments:
131
+ service: Service name to clone (e.g., 'espocrm', 'gitea')
140
132
  """
141
133
  plato_bin = _find_bundled_cli()
142
134
  if not plato_bin:
@@ -153,13 +145,10 @@ def clone(
153
145
 
154
146
  @app.command()
155
147
  def credentials():
156
- """
157
- Display your Plato Hub (Gitea) credentials.
158
-
159
- Shows the username and password needed to access Plato's Gitea repositories.
148
+ """Display your Plato Hub (Gitea) credentials.
160
149
 
161
- Example:
162
- plato credentials
150
+ Shows the username and password needed to access Plato's Gitea repositories
151
+ for cloning and pushing simulator code.
163
152
  """
164
153
  plato_bin = _find_bundled_cli()
165
154
  if not plato_bin:
plato/v1/cli/pm.py CHANGED
@@ -240,44 +240,20 @@ def _list_pending_reviews(review_type: str):
240
240
 
241
241
  @list_app.command(name="base")
242
242
  def list_base():
243
- """
244
- List simulators pending base/environment review.
245
-
246
- Shows simulators waiting for environment review (status: env_review_requested).
247
- Use this to see what needs reviewing before running 'plato pm review base'.
248
-
249
- USAGE:
250
-
251
- plato pm list base
252
-
253
- OUTPUT COLUMNS:
243
+ """List simulators pending base/environment review.
254
244
 
255
- - Name: Simulator name
256
- - Assignees: Who's assigned to review
257
- - Notes: Any notes about the simulator
258
- - base_artifact_id: The artifact to review
245
+ Shows simulators with status 'env_review_requested' in a table format.
246
+ Displays name, assignees, notes, and base_artifact_id for each simulator.
259
247
  """
260
248
  _list_pending_reviews("base")
261
249
 
262
250
 
263
251
  @list_app.command(name="data")
264
252
  def list_data():
265
- """
266
- List simulators pending data review.
267
-
268
- Shows simulators waiting for data review (status: data_review_requested).
269
- Use this to see what needs reviewing before running 'plato pm review data'.
270
-
271
- USAGE:
272
-
273
- plato pm list data
253
+ """List simulators pending data review.
274
254
 
275
- OUTPUT COLUMNS:
276
-
277
- - Name: Simulator name
278
- - Assignees: Who's assigned to review
279
- - Notes: Any notes about the simulator
280
- - data_artifact_id: The artifact to review
255
+ Shows simulators with status 'data_review_requested' in a table format.
256
+ Displays name, assignees, notes, and data_artifact_id for each simulator.
281
257
  """
282
258
  _list_pending_reviews("data")
283
259
 
@@ -307,25 +283,19 @@ def review_base(
307
283
  help="Run login flow and check state, but skip interactive review. For automated verification.",
308
284
  ),
309
285
  ):
310
- """
311
- Review base/environment artifact for a simulator.
312
-
313
- Opens the simulator in a browser for manual testing. After testing,
314
- you can pass (→ env_approved) or reject (→ env_in_progress).
315
-
316
- SPECIFYING SIMULATOR AND ARTIFACT:
286
+ """Review base/environment artifact for a simulator.
317
287
 
318
- -s <simulator> Use server's base_artifact_id
319
- -s <simulator> -a <artifact-uuid> Explicit artifact
320
- -s <simulator>:<artifact-uuid> Colon notation (same as above)
321
-
322
- EXAMPLES:
323
-
324
- plato pm review base -s espocrm
325
- plato pm review base -s espocrm -a e9c25ca5-1234-5678-9abc-def012345678
326
- plato pm review base -s espocrm:e9c25ca5-1234-5678-9abc-def012345678
288
+ Creates an environment from the artifact, launches a browser for testing,
289
+ runs the login flow, and checks for database mutations. After testing,
290
+ choose pass (→ env_approved) or reject ( env_in_progress).
327
291
 
328
292
  Requires simulator status: env_review_requested
293
+
294
+ Options:
295
+ -s, --simulator: Simulator name. Supports colon notation for artifact:
296
+ '-s sim' (uses server's base_artifact_id) or '-s sim:<uuid>'
297
+ -a, --artifact: Explicit artifact UUID to review. Overrides server's value.
298
+ --skip-review: Run automated checks without interactive review session.
329
299
  """
330
300
  api_key = require_api_key()
331
301
 
@@ -676,25 +646,18 @@ def review_data(
676
646
  help="Artifact UUID to review. If not provided, uses server's data_artifact_id.",
677
647
  ),
678
648
  ):
679
- """
680
- Launch browser with EnvGen Recorder extension for data review.
649
+ """Launch browser with EnvGen Recorder extension for data review.
681
650
 
682
651
  Opens Chrome with the EnvGen Recorder extension installed for reviewing
683
- data artifacts. Close the browser when done.
684
-
685
- SPECIFYING SIMULATOR AND ARTIFACT:
686
-
687
- -s <simulator> Use server's data_artifact_id
688
- -s <simulator> -a <artifact-uuid> Explicit artifact
689
- -s <simulator>:<artifact-uuid> Colon notation (same as above)
690
-
691
- EXAMPLES:
692
-
693
- plato pm review data -s fathom
694
- plato pm review data -s fathom -a e9c25ca5-1234-5678-9abc-def012345678
695
- plato pm review data -s fathom:e9c25ca5-1234-5678-9abc-def012345678
652
+ data artifacts. The extension sidebar can be used to record and submit reviews.
653
+ Press Control-C to exit when done.
696
654
 
697
655
  Requires simulator status: data_review_requested
656
+
657
+ Options:
658
+ -s, --simulator: Simulator name. Supports colon notation for artifact:
659
+ '-s sim' (uses server's data_artifact_id) or '-s sim:<uuid>'
660
+ -a, --artifact: Explicit artifact UUID to review. Overrides server's value.
698
661
  """
699
662
  api_key = require_api_key()
700
663
 
@@ -924,27 +887,14 @@ def review_data(
924
887
 
925
888
  @submit_app.command(name="base")
926
889
  def submit_base():
927
- """
928
- Submit base/environment artifact for review after snapshot.
929
-
930
- Reads simulator name and artifact ID from .sandbox.yaml (created by
931
- plato sandbox start). Run this from the simulator directory after
932
- creating a snapshot.
933
-
934
- Transitions simulator from env_in_progress → env_review_requested.
935
-
936
- USAGE:
890
+ """Submit base/environment artifact for review after snapshot.
937
891
 
938
- plato pm submit base # No args needed - reads from .sandbox.yaml
939
-
940
- PREREQUISITES:
941
-
942
- 1. plato sandbox start --from-config
943
- 2. plato sandbox start-services
944
- 3. plato sandbox snapshot
945
- 4. plato pm submit base ← you are here
892
+ Reads simulator name and artifact_id from .sandbox.yaml, syncs metadata from
893
+ plato-config.yml to the server, and transitions status to env_review_requested.
894
+ Run from the simulator directory after creating a snapshot.
946
895
 
947
896
  Requires simulator status: env_in_progress
897
+ No arguments needed - reads everything from .sandbox.yaml and plato-config.yml.
948
898
  """
949
899
  api_key = require_api_key()
950
900
 
@@ -1091,22 +1041,17 @@ def submit_data(
1091
1041
  help="Artifact UUID to submit for data review (required).",
1092
1042
  ),
1093
1043
  ):
1094
- """
1095
- Submit data artifact for review after data generation.
1096
-
1097
- Transitions simulator from data_in_progress → data_review_requested.
1044
+ """Submit data artifact for review after data generation.
1098
1045
 
1099
- SPECIFYING SIMULATOR AND ARTIFACT (both required):
1100
-
1101
- -s <simulator> -a <artifact-uuid> Explicit artifact
1102
- -s <simulator>:<artifact-uuid> Colon notation (same as above)
1103
-
1104
- EXAMPLES:
1105
-
1106
- plato pm submit data -s espocrm -a e9c25ca5-1234-5678-9abc-def012345678
1107
- plato pm submit data -s espocrm:e9c25ca5-1234-5678-9abc-def012345678
1046
+ Transitions simulator from data_in_progress data_review_requested and
1047
+ tags the artifact as 'data-pending-review'.
1108
1048
 
1109
1049
  Requires simulator status: data_in_progress
1050
+
1051
+ Options:
1052
+ -s, --simulator: Simulator name. Supports colon notation:
1053
+ '-s sim:<uuid>' or use separate -a flag
1054
+ -a, --artifact: Artifact UUID to submit (required)
1110
1055
  """
1111
1056
  api_key = require_api_key()
1112
1057