plato-sdk-v2 2.0.50__py3-none-any.whl → 2.2.4__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 (158) hide show
  1. plato/__init__.py +7 -6
  2. plato/_generated/__init__.py +1 -1
  3. plato/_generated/api/v1/env/evaluate_session.py +3 -3
  4. plato/_generated/api/v1/env/log_state_mutation.py +4 -4
  5. plato/_generated/api/v1/sandbox/checkpoint_vm.py +3 -3
  6. plato/_generated/api/v1/sandbox/save_vm_snapshot.py +3 -3
  7. plato/_generated/api/v1/sandbox/setup_sandbox.py +8 -8
  8. plato/_generated/api/v1/session/__init__.py +2 -0
  9. plato/_generated/api/v1/session/get_sessions_for_archival.py +100 -0
  10. plato/_generated/api/v1/testcases/__init__.py +6 -2
  11. plato/_generated/api/v1/testcases/get_mutation_groups_for_testcase.py +98 -0
  12. plato/_generated/api/v1/testcases/{get_next_output_testcase_for_scoring.py → get_next_testcase_for_scoring.py} +23 -10
  13. plato/_generated/api/v1/testcases/get_testcase_metadata_for_scoring.py +74 -0
  14. plato/_generated/api/v2/__init__.py +2 -1
  15. plato/_generated/api/v2/jobs/__init__.py +4 -0
  16. plato/_generated/api/v2/jobs/checkpoint.py +3 -3
  17. plato/_generated/api/v2/jobs/disk_snapshot.py +3 -3
  18. plato/_generated/api/v2/jobs/log_for_job.py +4 -39
  19. plato/_generated/api/v2/jobs/make.py +4 -4
  20. plato/_generated/api/v2/jobs/setup_sandbox.py +97 -0
  21. plato/_generated/api/v2/jobs/snapshot.py +3 -3
  22. plato/_generated/api/v2/jobs/snapshot_store.py +91 -0
  23. plato/_generated/api/v2/sessions/__init__.py +4 -0
  24. plato/_generated/api/v2/sessions/checkpoint.py +3 -3
  25. plato/_generated/api/v2/sessions/disk_snapshot.py +3 -3
  26. plato/_generated/api/v2/sessions/evaluate.py +3 -3
  27. plato/_generated/api/v2/sessions/log_job_mutation.py +4 -39
  28. plato/_generated/api/v2/sessions/make.py +4 -4
  29. plato/_generated/api/v2/sessions/setup_sandbox.py +98 -0
  30. plato/_generated/api/v2/sessions/snapshot.py +3 -3
  31. plato/_generated/api/v2/sessions/snapshot_store.py +94 -0
  32. plato/_generated/api/v2/user/__init__.py +7 -0
  33. plato/_generated/api/v2/user/get_current_user.py +76 -0
  34. plato/_generated/models/__init__.py +174 -23
  35. plato/_sims_generator/__init__.py +19 -4
  36. plato/_sims_generator/instruction.py +203 -0
  37. plato/_sims_generator/templates/instruction/helpers.py.jinja +161 -0
  38. plato/_sims_generator/templates/instruction/init.py.jinja +43 -0
  39. plato/agents/__init__.py +107 -517
  40. plato/agents/base.py +145 -0
  41. plato/agents/build.py +61 -0
  42. plato/agents/config.py +160 -0
  43. plato/agents/logging.py +401 -0
  44. plato/agents/runner.py +161 -0
  45. plato/agents/trajectory.py +266 -0
  46. plato/chronos/__init__.py +37 -0
  47. plato/chronos/api/__init__.py +3 -0
  48. plato/chronos/api/agents/__init__.py +13 -0
  49. plato/chronos/api/agents/create_agent.py +63 -0
  50. plato/chronos/api/agents/delete_agent.py +61 -0
  51. plato/chronos/api/agents/get_agent.py +62 -0
  52. plato/chronos/api/agents/get_agent_schema.py +72 -0
  53. plato/chronos/api/agents/get_agent_versions.py +62 -0
  54. plato/chronos/api/agents/list_agents.py +57 -0
  55. plato/chronos/api/agents/lookup_agent.py +74 -0
  56. plato/chronos/api/auth/__init__.py +9 -0
  57. plato/chronos/api/auth/debug_auth_api_auth_debug_get.py +43 -0
  58. plato/chronos/api/auth/get_auth_status_api_auth_status_get.py +61 -0
  59. plato/chronos/api/auth/get_current_user_route_api_auth_me_get.py +60 -0
  60. plato/chronos/api/callback/__init__.py +11 -0
  61. plato/chronos/api/callback/push_agent_logs.py +61 -0
  62. plato/chronos/api/callback/update_agent_status.py +57 -0
  63. plato/chronos/api/callback/upload_artifacts.py +59 -0
  64. plato/chronos/api/callback/upload_logs_zip.py +57 -0
  65. plato/chronos/api/callback/upload_trajectory.py +57 -0
  66. plato/chronos/api/default/__init__.py +7 -0
  67. plato/chronos/api/default/health.py +43 -0
  68. plato/chronos/api/jobs/__init__.py +7 -0
  69. plato/chronos/api/jobs/launch_job.py +63 -0
  70. plato/chronos/api/registry/__init__.py +19 -0
  71. plato/chronos/api/registry/get_agent_schema_api_registry_agents__agent_name__schema_get.py +62 -0
  72. plato/chronos/api/registry/get_agent_versions_api_registry_agents__agent_name__versions_get.py +52 -0
  73. plato/chronos/api/registry/get_world_schema_api_registry_worlds__package_name__schema_get.py +68 -0
  74. plato/chronos/api/registry/get_world_versions_api_registry_worlds__package_name__versions_get.py +52 -0
  75. plato/chronos/api/registry/list_registry_agents_api_registry_agents_get.py +44 -0
  76. plato/chronos/api/registry/list_registry_worlds_api_registry_worlds_get.py +44 -0
  77. plato/chronos/api/runtimes/__init__.py +11 -0
  78. plato/chronos/api/runtimes/create_runtime.py +63 -0
  79. plato/chronos/api/runtimes/delete_runtime.py +61 -0
  80. plato/chronos/api/runtimes/get_runtime.py +62 -0
  81. plato/chronos/api/runtimes/list_runtimes.py +57 -0
  82. plato/chronos/api/runtimes/test_runtime.py +67 -0
  83. plato/chronos/api/secrets/__init__.py +11 -0
  84. plato/chronos/api/secrets/create_secret.py +63 -0
  85. plato/chronos/api/secrets/delete_secret.py +61 -0
  86. plato/chronos/api/secrets/get_secret.py +62 -0
  87. plato/chronos/api/secrets/list_secrets.py +57 -0
  88. plato/chronos/api/secrets/update_secret.py +68 -0
  89. plato/chronos/api/sessions/__init__.py +10 -0
  90. plato/chronos/api/sessions/get_session.py +62 -0
  91. plato/chronos/api/sessions/get_session_logs.py +72 -0
  92. plato/chronos/api/sessions/get_session_logs_download.py +62 -0
  93. plato/chronos/api/sessions/list_sessions.py +57 -0
  94. plato/chronos/api/status/__init__.py +8 -0
  95. plato/chronos/api/status/get_status_api_status_get.py +44 -0
  96. plato/chronos/api/status/get_version_info_api_version_get.py +44 -0
  97. plato/chronos/api/templates/__init__.py +11 -0
  98. plato/chronos/api/templates/create_template.py +63 -0
  99. plato/chronos/api/templates/delete_template.py +61 -0
  100. plato/chronos/api/templates/get_template.py +62 -0
  101. plato/chronos/api/templates/list_templates.py +57 -0
  102. plato/chronos/api/templates/update_template.py +68 -0
  103. plato/chronos/api/trajectories/__init__.py +8 -0
  104. plato/chronos/api/trajectories/get_trajectory.py +62 -0
  105. plato/chronos/api/trajectories/list_trajectories.py +62 -0
  106. plato/chronos/api/worlds/__init__.py +10 -0
  107. plato/chronos/api/worlds/create_world.py +63 -0
  108. plato/chronos/api/worlds/delete_world.py +61 -0
  109. plato/chronos/api/worlds/get_world.py +62 -0
  110. plato/chronos/api/worlds/list_worlds.py +57 -0
  111. plato/chronos/client.py +171 -0
  112. plato/chronos/errors.py +141 -0
  113. plato/chronos/models/__init__.py +647 -0
  114. plato/chronos/py.typed +0 -0
  115. plato/sims/cli.py +299 -123
  116. plato/sims/registry.py +77 -4
  117. plato/v1/cli/agent.py +88 -84
  118. plato/v1/cli/main.py +2 -0
  119. plato/v1/cli/pm.py +441 -119
  120. plato/v1/cli/sandbox.py +747 -191
  121. plato/v1/cli/sim.py +11 -0
  122. plato/v1/cli/verify.py +1269 -0
  123. plato/v1/cli/world.py +3 -0
  124. plato/v1/flow_executor.py +21 -17
  125. plato/v1/models/env.py +11 -11
  126. plato/v1/sdk.py +2 -2
  127. plato/v1/sync_env.py +11 -11
  128. plato/v1/sync_flow_executor.py +21 -17
  129. plato/v1/sync_sdk.py +4 -2
  130. plato/v2/__init__.py +2 -0
  131. plato/v2/async_/environment.py +20 -1
  132. plato/v2/async_/session.py +54 -3
  133. plato/v2/sync/environment.py +2 -1
  134. plato/v2/sync/session.py +52 -2
  135. plato/worlds/README.md +218 -0
  136. plato/worlds/__init__.py +54 -18
  137. plato/worlds/base.py +304 -93
  138. plato/worlds/config.py +239 -73
  139. plato/worlds/runner.py +391 -80
  140. {plato_sdk_v2-2.0.50.dist-info → plato_sdk_v2-2.2.4.dist-info}/METADATA +1 -3
  141. {plato_sdk_v2-2.0.50.dist-info → plato_sdk_v2-2.2.4.dist-info}/RECORD +143 -68
  142. {plato_sdk_v2-2.0.50.dist-info → plato_sdk_v2-2.2.4.dist-info}/entry_points.txt +1 -0
  143. plato/_generated/api/v2/interfaces/__init__.py +0 -27
  144. plato/_generated/api/v2/interfaces/v2_interface_browser_create.py +0 -68
  145. plato/_generated/api/v2/interfaces/v2_interface_cdp_url.py +0 -65
  146. plato/_generated/api/v2/interfaces/v2_interface_click.py +0 -64
  147. plato/_generated/api/v2/interfaces/v2_interface_close.py +0 -59
  148. plato/_generated/api/v2/interfaces/v2_interface_computer_create.py +0 -68
  149. plato/_generated/api/v2/interfaces/v2_interface_cursor.py +0 -64
  150. plato/_generated/api/v2/interfaces/v2_interface_key.py +0 -68
  151. plato/_generated/api/v2/interfaces/v2_interface_screenshot.py +0 -65
  152. plato/_generated/api/v2/interfaces/v2_interface_scroll.py +0 -70
  153. plato/_generated/api/v2/interfaces/v2_interface_type.py +0 -64
  154. plato/world/__init__.py +0 -44
  155. plato/world/base.py +0 -267
  156. plato/world/config.py +0 -139
  157. plato/world/types.py +0 -47
  158. {plato_sdk_v2-2.0.50.dist-info → plato_sdk_v2-2.2.4.dist-info}/WHEEL +0 -0
@@ -0,0 +1,94 @@
1
+ """Snapshot Store"""
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Any
6
+
7
+ import httpx
8
+
9
+ from plato._generated.errors import raise_for_status
10
+ from plato._generated.models import (
11
+ AppApiV2SchemasSessionCreateSnapshotRequest,
12
+ AppApiV2SchemasSessionCreateSnapshotResponse,
13
+ )
14
+
15
+
16
+ def _build_request_args(
17
+ session_id: str,
18
+ body: AppApiV2SchemasSessionCreateSnapshotRequest,
19
+ authorization: str | None = None,
20
+ x_api_key: str | None = None,
21
+ ) -> dict[str, Any]:
22
+ """Build request arguments."""
23
+ url = f"/api/v2/sessions/{session_id}/snapshot_store"
24
+
25
+ headers: dict[str, str] = {}
26
+ if authorization is not None:
27
+ headers["authorization"] = authorization
28
+ if x_api_key is not None:
29
+ headers["X-API-Key"] = x_api_key
30
+
31
+ return {
32
+ "method": "POST",
33
+ "url": url,
34
+ "json": body.model_dump(mode="json", exclude_none=True),
35
+ "headers": headers,
36
+ }
37
+
38
+
39
+ def sync(
40
+ client: httpx.Client,
41
+ session_id: str,
42
+ body: AppApiV2SchemasSessionCreateSnapshotRequest,
43
+ authorization: str | None = None,
44
+ x_api_key: str | None = None,
45
+ ) -> AppApiV2SchemasSessionCreateSnapshotResponse:
46
+ """Create a snapshot-store snapshot of all jobs in the session (disk + memory).
47
+
48
+ Uses the snapshot-store pipeline for chunk-based deduplication and
49
+ efficient storage. This is the preferred method for new base snapshots.
50
+
51
+ Optional request body allows overriding artifact metadata:
52
+ - override_service: Override simulator/service name
53
+ - override_version: Override version/git_hash
54
+ - override_dataset: Override dataset name"""
55
+
56
+ request_args = _build_request_args(
57
+ session_id=session_id,
58
+ body=body,
59
+ authorization=authorization,
60
+ x_api_key=x_api_key,
61
+ )
62
+
63
+ response = client.request(**request_args)
64
+ raise_for_status(response)
65
+ return AppApiV2SchemasSessionCreateSnapshotResponse.model_validate(response.json())
66
+
67
+
68
+ async def asyncio(
69
+ client: httpx.AsyncClient,
70
+ session_id: str,
71
+ body: AppApiV2SchemasSessionCreateSnapshotRequest,
72
+ authorization: str | None = None,
73
+ x_api_key: str | None = None,
74
+ ) -> AppApiV2SchemasSessionCreateSnapshotResponse:
75
+ """Create a snapshot-store snapshot of all jobs in the session (disk + memory).
76
+
77
+ Uses the snapshot-store pipeline for chunk-based deduplication and
78
+ efficient storage. This is the preferred method for new base snapshots.
79
+
80
+ Optional request body allows overriding artifact metadata:
81
+ - override_service: Override simulator/service name
82
+ - override_version: Override version/git_hash
83
+ - override_dataset: Override dataset name"""
84
+
85
+ request_args = _build_request_args(
86
+ session_id=session_id,
87
+ body=body,
88
+ authorization=authorization,
89
+ x_api_key=x_api_key,
90
+ )
91
+
92
+ response = await client.request(**request_args)
93
+ raise_for_status(response)
94
+ return AppApiV2SchemasSessionCreateSnapshotResponse.model_validate(response.json())
@@ -0,0 +1,7 @@
1
+ """API endpoints."""
2
+
3
+ from . import get_current_user
4
+
5
+ __all__ = [
6
+ "get_current_user",
7
+ ]
@@ -0,0 +1,76 @@
1
+ """Get Current User"""
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Any
6
+
7
+ import httpx
8
+
9
+ from plato._generated.errors import raise_for_status
10
+ from plato._generated.models import UserResponse
11
+
12
+
13
+ def _build_request_args(
14
+ authorization: str | None = None,
15
+ x_api_key: str | None = None,
16
+ ) -> dict[str, Any]:
17
+ """Build request arguments."""
18
+ url = "/api/v2/user/me"
19
+
20
+ headers: dict[str, str] = {}
21
+ if authorization is not None:
22
+ headers["authorization"] = authorization
23
+ if x_api_key is not None:
24
+ headers["X-API-Key"] = x_api_key
25
+
26
+ return {
27
+ "method": "GET",
28
+ "url": url,
29
+ "headers": headers,
30
+ }
31
+
32
+
33
+ def sync(
34
+ client: httpx.Client,
35
+ authorization: str | None = None,
36
+ x_api_key: str | None = None,
37
+ ) -> UserResponse:
38
+ """Get current user info.
39
+
40
+ Accepts authentication via:
41
+ - Authorization: Bearer <jwt_token>
42
+ - X-API-Key: <api_key>
43
+
44
+ Returns user info for the authenticated principal."""
45
+
46
+ request_args = _build_request_args(
47
+ authorization=authorization,
48
+ x_api_key=x_api_key,
49
+ )
50
+
51
+ response = client.request(**request_args)
52
+ raise_for_status(response)
53
+ return UserResponse.model_validate(response.json())
54
+
55
+
56
+ async def asyncio(
57
+ client: httpx.AsyncClient,
58
+ authorization: str | None = None,
59
+ x_api_key: str | None = None,
60
+ ) -> UserResponse:
61
+ """Get current user info.
62
+
63
+ Accepts authentication via:
64
+ - Authorization: Bearer <jwt_token>
65
+ - X-API-Key: <api_key>
66
+
67
+ Returns user info for the authenticated principal."""
68
+
69
+ request_args = _build_request_args(
70
+ authorization=authorization,
71
+ x_api_key=x_api_key,
72
+ )
73
+
74
+ response = await client.request(**request_args)
75
+ raise_for_status(response)
76
+ return UserResponse.model_validate(response.json())
@@ -1,6 +1,6 @@
1
1
  # generated by datamodel-codegen:
2
- # filename: tmpofnvi9ej.json
3
- # timestamp: 2026-01-15T20:55:44+00:00
2
+ # filename: tmp28thllk8.json
3
+ # timestamp: 2026-01-17T04:45:09+00:00
4
4
 
5
5
  from __future__ import annotations
6
6
 
@@ -178,6 +178,9 @@ class ArtifactFullDetails(BaseModel):
178
178
  flows: Annotated[str | None, Field(title="Flows")] = None
179
179
  target: Annotated[str | None, Field(title="Target")] = None
180
180
  expires_at: Annotated[AwareDatetime | None, Field(title="Expires At")] = None
181
+ memory_manifest_id: Annotated[str | None, Field(title="Memory Manifest Id")] = None
182
+ disk_manifest_id: Annotated[str | None, Field(title="Disk Manifest Id")] = None
183
+ snapshotted_at: Annotated[AwareDatetime | None, Field(title="Snapshotted At")] = None
181
184
  created_at: Annotated[AwareDatetime, Field(title="Created At")]
182
185
 
183
186
 
@@ -704,6 +707,30 @@ class CreateCheckpointRequest(BaseModel):
704
707
  """
705
708
  Optional expiration time for the artifact (ISO 8601)
706
709
  """
710
+ flows: Annotated[str | None, Field(title="Flows")] = None
711
+ """
712
+ YAML definition of application flows/workflows
713
+ """
714
+ plato_config: Annotated[str | None, Field(title="Plato Config")] = None
715
+ """
716
+ YAML configuration for Plato-specific settings
717
+ """
718
+ internal_app_port: Annotated[int | None, Field(title="Internal App Port")] = None
719
+ """
720
+ Internal port the application listens on
721
+ """
722
+ messaging_port: Annotated[int | None, Field(title="Messaging Port")] = None
723
+ """
724
+ Port for messaging/communication
725
+ """
726
+ target: Annotated[str | None, Field(title="Target")] = None
727
+ """
728
+ Target domain for routing (e.g., sims.plato.so)
729
+ """
730
+ snapshotted_at: Annotated[AwareDatetime | None, Field(title="Snapshotted At")] = None
731
+ """
732
+ Override the snapshot timestamp. If not provided, calculates as parent's snapshotted_at + 30min or current time
733
+ """
707
734
 
708
735
 
709
736
  class CreateCheckpointResult(BaseModel):
@@ -1590,6 +1617,7 @@ class LogStatusResponse(BaseModel):
1590
1617
  )
1591
1618
  status: Annotated[Status, Field(title="Status")]
1592
1619
  message: Annotated[str | None, Field(title="Message")] = None
1620
+ logs_count: Annotated[int | None, Field(title="Logs Count")] = None
1593
1621
 
1594
1622
 
1595
1623
  class MakeEnvBatchRequest(BaseModel):
@@ -1694,9 +1722,9 @@ class NodePolicyConfig(BaseModel):
1694
1722
  """
1695
1723
  Number of VMs per CPU core (e.g., 0.5 means 2 cores per VM)
1696
1724
  """
1697
- vms_per_dispatcher: Annotated[int | None, Field(title="Vms Per Dispatcher")] = 5
1725
+ max_vms_per_dispatcher: Annotated[int | None, Field(title="Max Vms Per Dispatcher")] = 100
1698
1726
  """
1699
- Number of VMs each dispatcher manages
1727
+ Maximum VMs per dispatcher (used to calculate dispatcher count)
1700
1728
  """
1701
1729
  vm_heartbeat_timeout: Annotated[int | None, Field(title="Vm Heartbeat Timeout")] = 300
1702
1730
  """
@@ -1744,6 +1772,52 @@ class NodeS3Config(BaseModel):
1744
1772
  """
1745
1773
 
1746
1774
 
1775
+ class NodeSnapshotStoreConfig(BaseModel):
1776
+ model_config = ConfigDict(
1777
+ extra="allow",
1778
+ )
1779
+ bucket: Annotated[str | None, Field(title="Bucket")] = "plato-firecracker-snapshots"
1780
+ """
1781
+ S3 bucket for snapshot-store packs/manifests.
1782
+ """
1783
+ prefix: Annotated[str | None, Field(title="Prefix")] = "snapshot-packs"
1784
+ """
1785
+ S3 prefix for snapshot-store packs/manifests.
1786
+ """
1787
+ region: Annotated[str | None, Field(title="Region")] = "us-west-1"
1788
+ """
1789
+ AWS region for snapshot-store S3 operations.
1790
+ """
1791
+ endpoint_url: Annotated[str | None, Field(title="Endpoint Url")] = None
1792
+ """
1793
+ S3 endpoint URL for snapshot-store (MinIO/LocalStack).
1794
+ """
1795
+ metadata_store: Annotated[Literal["postgres"], Field(title="Metadata Store")] = "postgres"
1796
+ """
1797
+ Snapshot-store metadata backend.
1798
+ """
1799
+ postgres_dsn: Annotated[str | None, Field(title="Postgres Dsn")] = None
1800
+ """
1801
+ Postgres DSN for snapshot-store metadata.
1802
+ """
1803
+ cache_mb: Annotated[int | None, Field(title="Cache Mb")] = 0
1804
+ """
1805
+ Snapshot-store userspace decompressed page cache size in MB (0 to disable). This cache deduplicates pages by content hash across all manifests. For memory mounts (mount-mem): direct_io is disabled by default, so the kernel page cache already handles caching and deduplication for mmap'd files. Multiple VMs restoring from the same snapshot share kernel-cached pages automatically. The userspace cache is redundant here. For disk mounts (mount-tree): direct_io is enabled by default for overlay write coherency, bypassing the kernel cache. However, the userspace cache only helps for unmodified base image pages read by multiple VMs. Since disk workloads involve frequent writes (logs, temp files, databases), written pages are served from the overlay and bypass this cache entirely. The benefit is marginal for typical workloads. Recommendation: Leave at 0 for most deployments.
1806
+ """
1807
+ compression_workers: Annotated[int | None, Field(title="Compression Workers")] = 1
1808
+ """
1809
+ Worker threads for snapshot-store compression.
1810
+ """
1811
+ upload_max_attempts: Annotated[int | None, Field(title="Upload Max Attempts")] = 3
1812
+ """
1813
+ Max upload attempts for snapshot-store uploads.
1814
+ """
1815
+ storage_root: Annotated[str | None, Field(title="Storage Root")] = None
1816
+ """
1817
+ Local storage root for snapshot-store data.
1818
+ """
1819
+
1820
+
1747
1821
  class NodeStatusResponse(BaseModel):
1748
1822
  model_config = ConfigDict(
1749
1823
  extra="allow",
@@ -2061,6 +2135,7 @@ class RegisterRequest(BaseModel):
2061
2135
  plato_config: Annotated[str | None, Field(title="Plato Config")] = None
2062
2136
  flows: Annotated[str | None, Field(title="Flows")] = None
2063
2137
  target: Annotated[str | None, Field(title="Target")] = None
2138
+ snapshotted_at: Annotated[AwareDatetime | None, Field(title="Snapshotted At")] = None
2064
2139
 
2065
2140
 
2066
2141
  class RegisterResponse(BaseModel):
@@ -2279,6 +2354,27 @@ class SdkConfig(BaseModel):
2279
2354
  """
2280
2355
 
2281
2356
 
2357
+ class SessionArchivalInfo(BaseModel):
2358
+ model_config = ConfigDict(
2359
+ extra="allow",
2360
+ )
2361
+ session_id: Annotated[str, Field(title="Session Id")]
2362
+ created_at: Annotated[AwareDatetime, Field(title="Created At")]
2363
+ logs_archived_at: Annotated[AwareDatetime | None, Field(title="Logs Archived At")] = None
2364
+ organization_id: Annotated[int, Field(title="Organization Id")]
2365
+ simulator_id: Annotated[int | None, Field(title="Simulator Id")] = None
2366
+
2367
+
2368
+ class SessionArchivalListResponse(BaseModel):
2369
+ model_config = ConfigDict(
2370
+ extra="allow",
2371
+ )
2372
+ sessions: Annotated[list[SessionArchivalInfo], Field(title="Sessions")]
2373
+ total_count: Annotated[int, Field(title="Total Count")]
2374
+ page: Annotated[int, Field(title="Page")]
2375
+ page_size: Annotated[int, Field(title="Page Size")]
2376
+
2377
+
2282
2378
  class SessionBackupLogInput(BaseModel):
2283
2379
  model_config = ConfigDict(
2284
2380
  extra="allow",
@@ -2404,25 +2500,25 @@ class SetupRootPasswordRequest(BaseModel):
2404
2500
  """
2405
2501
 
2406
2502
 
2407
- class SetupSandboxResponse(BaseModel):
2503
+ class SetupSandboxResult(BaseModel):
2408
2504
  model_config = ConfigDict(
2409
2505
  extra="allow",
2410
2506
  )
2411
- status: Annotated[str, Field(title="Status")]
2507
+ success: Annotated[bool, Field(title="Success")]
2412
2508
  """
2413
- Status
2509
+ Whether setup completed successfully
2414
2510
  """
2415
- timestamp: Annotated[str | None, Field(title="Timestamp")] = None
2511
+ stdout: Annotated[str | None, Field(title="Stdout")] = ""
2416
2512
  """
2417
- Timestamp
2513
+ Command stdout
2418
2514
  """
2419
- correlation_id: Annotated[str, Field(title="Correlation Id")]
2515
+ stderr: Annotated[str | None, Field(title="Stderr")] = ""
2420
2516
  """
2421
- Correlation ID for tracking
2517
+ Command stderr
2422
2518
  """
2423
- ssh_url: Annotated[str, Field(title="Ssh Url")]
2519
+ error: Annotated[str | None, Field(title="Error")] = None
2424
2520
  """
2425
- SSH URL for connecting to sandbox
2521
+ Error message if failed
2426
2522
  """
2427
2523
 
2428
2524
 
@@ -3015,6 +3111,18 @@ class UploadPackageResponse(BaseModel):
3015
3111
  message: Annotated[str, Field(title="Message")]
3016
3112
 
3017
3113
 
3114
+ class UserResponse(BaseModel):
3115
+ model_config = ConfigDict(
3116
+ extra="allow",
3117
+ )
3118
+ id: Annotated[int, Field(title="Id")]
3119
+ public_id: Annotated[str, Field(title="Public Id")]
3120
+ email: Annotated[str | None, Field(title="Email")] = None
3121
+ name: Annotated[str | None, Field(title="Name")] = None
3122
+ organization_id: Annotated[int | None, Field(title="Organization Id")] = None
3123
+ organization_name: Annotated[str | None, Field(title="Organization Name")] = None
3124
+
3125
+
3018
3126
  class VMManagementResponse(BaseModel):
3019
3127
  model_config = ConfigDict(
3020
3128
  extra="allow",
@@ -3668,6 +3776,45 @@ class AppApiV2SchemasSessionPublicUrlResponse(BaseModel):
3668
3776
  """
3669
3777
 
3670
3778
 
3779
+ class AppApiV2SchemasSessionSetupSandboxRequest(BaseModel):
3780
+ model_config = ConfigDict(
3781
+ extra="allow",
3782
+ )
3783
+ timeout: Annotated[int | None, Field(title="Timeout")] = 120
3784
+ """
3785
+ Setup timeout in seconds
3786
+ """
3787
+
3788
+
3789
+ class AppApiV2SchemasSessionSetupSandboxResponse(BaseModel):
3790
+ model_config = ConfigDict(
3791
+ extra="allow",
3792
+ )
3793
+ results: Annotated[dict[str, SetupSandboxResult], Field(title="Results")]
3794
+
3795
+
3796
+ class AppSchemasBuildModelsSetupSandboxResponse(BaseModel):
3797
+ model_config = ConfigDict(
3798
+ extra="allow",
3799
+ )
3800
+ status: Annotated[str, Field(title="Status")]
3801
+ """
3802
+ Status
3803
+ """
3804
+ timestamp: Annotated[str | None, Field(title="Timestamp")] = None
3805
+ """
3806
+ Timestamp
3807
+ """
3808
+ correlation_id: Annotated[str, Field(title="Correlation Id")]
3809
+ """
3810
+ Correlation ID for tracking
3811
+ """
3812
+ ssh_url: Annotated[str, Field(title="Ssh Url")]
3813
+ """
3814
+ SSH URL for connecting to sandbox
3815
+ """
3816
+
3817
+
3671
3818
  class AppSchemasBuildModelsSimConfigCompute(BaseModel):
3672
3819
  model_config = ConfigDict(
3673
3820
  extra="allow",
@@ -4203,6 +4350,10 @@ class NodeConfig(BaseModel):
4203
4350
  """
4204
4351
  S3/Minio configuration for snapshots and artifacts
4205
4352
  """
4353
+ snapshot_store: NodeSnapshotStoreConfig | None = None
4354
+ """
4355
+ Snapshot-store configuration for manifest/pack pipeline
4356
+ """
4206
4357
  build: NodeBuildConfig | None = None
4207
4358
  """
4208
4359
  Build configuration including SSH keys for VMs
@@ -4545,7 +4696,7 @@ class PlatoConfig(BaseModel):
4545
4696
  """
4546
4697
 
4547
4698
 
4548
- class SetupSandboxRequest(BaseModel):
4699
+ class VMManagementRequest(BaseModel):
4549
4700
  model_config = ConfigDict(
4550
4701
  extra="allow",
4551
4702
  )
@@ -4565,17 +4716,9 @@ class SetupSandboxRequest(BaseModel):
4565
4716
  """
4566
4717
  Request timeout in seconds
4567
4718
  """
4568
- ssh_password: Annotated[str | None, Field(title="Ssh Password")] = None
4569
- """
4570
- SSH password for plato user (optional)
4571
- """
4572
- ssh_public_key: Annotated[str | None, Field(title="Ssh Public Key")] = None
4573
- """
4574
- SSH public key to add to plato user's authorized_keys (optional)
4575
- """
4576
4719
 
4577
4720
 
4578
- class VMManagementRequest(BaseModel):
4721
+ class AppSchemasBuildModelsSetupSandboxRequest(BaseModel):
4579
4722
  model_config = ConfigDict(
4580
4723
  extra="allow",
4581
4724
  )
@@ -4595,6 +4738,14 @@ class VMManagementRequest(BaseModel):
4595
4738
  """
4596
4739
  Request timeout in seconds
4597
4740
  """
4741
+ ssh_password: Annotated[str | None, Field(title="Ssh Password")] = None
4742
+ """
4743
+ SSH password for plato user (optional)
4744
+ """
4745
+ ssh_public_key: Annotated[str | None, Field(title="Ssh Public Key")] = None
4746
+ """
4747
+ SSH public key to add to plato user's authorized_keys (optional)
4748
+ """
4598
4749
 
4599
4750
 
4600
4751
  DbModelsTestCaseModelJSONSchemaDraft7.model_rebuild()
@@ -1,9 +1,10 @@
1
1
  """OpenAPI SDK Generator for Plato.
2
2
 
3
- This module provides tools to generate Python SDKs from OpenAPI specifications.
3
+ This module provides tools to generate Python SDKs from OpenAPI specifications,
4
+ as well as instruction-based SDKs for sims that don't need API clients.
4
5
 
5
- Usage:
6
- from plato.sims.generator import parse_openapi, PythonGenerator, OAuthConfig
6
+ Usage (OpenAPI-based):
7
+ from plato._sims_generator import parse_openapi, PythonGenerator, OAuthConfig
7
8
 
8
9
  api = parse_openapi(spec_dict)
9
10
  generator = PythonGenerator(
@@ -21,10 +22,22 @@ Usage:
21
22
  )
22
23
  generator.generate()
23
24
 
25
+ Usage (Instruction-based):
26
+ from plato._sims_generator import InstructionConfig, InstructionGenerator
27
+
28
+ config = InstructionConfig.from_yaml(Path("specs/instructions.yaml"))
29
+ generator = InstructionGenerator(
30
+ config,
31
+ output_path,
32
+ package_name="localstack",
33
+ )
34
+ generator.generate()
35
+
24
36
  Or via CLI:
25
- uv run python -m plato.sims.generator.cli --path spec.yaml --output ./output --package mypackage
37
+ plato sims publish --config plato-config.yml
26
38
  """
27
39
 
40
+ from .instruction import InstructionConfig, InstructionGenerator
28
41
  from .parser import API, Endpoint, Schema, Type, parse_openapi
29
42
  from .python import AuthConfig, BasicAuthConfig, BearerTokenConfig, OAuthConfig, PythonGenerator, SessionAuthConfig
30
43
 
@@ -40,4 +53,6 @@ __all__ = [
40
53
  "BearerTokenConfig",
41
54
  "BasicAuthConfig",
42
55
  "SessionAuthConfig",
56
+ "InstructionConfig",
57
+ "InstructionGenerator",
43
58
  ]