plato-sdk-v2 2.6.0__py3-none-any.whl → 2.6.1__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/agents/runner.py CHANGED
@@ -25,7 +25,6 @@ logger = logging.getLogger(__name__)
25
25
  async def run_agent(
26
26
  image: str,
27
27
  config: dict,
28
- secrets: dict[str, str],
29
28
  instruction: str,
30
29
  workspace: str | None = None,
31
30
  logs_dir: str | None = None,
@@ -35,8 +34,7 @@ async def run_agent(
35
34
 
36
35
  Args:
37
36
  image: Docker image URI
38
- config: Agent configuration dict
39
- secrets: Secret values (API keys, etc.)
37
+ config: Agent configuration dict (includes secrets)
40
38
  instruction: Task instruction for the agent
41
39
  workspace: Docker volume name for workspace (created if None)
42
40
  logs_dir: Ignored (kept for backwards compatibility)
@@ -173,15 +171,12 @@ async def run_agent(
173
171
  ]
174
172
  )
175
173
 
176
- for key, value in secrets.items():
177
- docker_cmd.extend(["-e", f"{key.upper()}={value}"])
178
-
179
174
  docker_cmd.append(image)
180
175
 
181
176
  # Pass instruction via CLI arg
182
177
  docker_cmd.extend(["--instruction", instruction])
183
178
 
184
- logger.info(f"Starting container: {container_name}")
179
+ logger.debug(f"Starting container: {container_name}")
185
180
 
186
181
  # Run container - agents emit their own OTel spans
187
182
  # Use large limit to handle agents that output long lines (e.g., JSON with file contents)
@@ -192,32 +187,6 @@ async def run_agent(
192
187
  limit=100 * 1024 * 1024, # 100MB buffer limit
193
188
  )
194
189
 
195
- # Get and print container IP in background
196
- async def print_container_ip():
197
- await asyncio.sleep(3) # Wait for container to start
198
- try:
199
- inspect_proc = await asyncio.create_subprocess_exec(
200
- "docker",
201
- "inspect",
202
- "-f",
203
- "{{.NetworkSettings.IPAddress}}",
204
- container_name,
205
- stdout=asyncio.subprocess.PIPE,
206
- stderr=asyncio.subprocess.PIPE,
207
- )
208
- stdout, _ = await inspect_proc.communicate()
209
- container_ip = stdout.decode().strip()
210
- if container_ip:
211
- logger.info("=" * 50)
212
- logger.info(f"Container: {container_name}")
213
- logger.info(f"Container IP: {container_ip}")
214
- logger.info(f"noVNC: http://{container_ip}:6080")
215
- logger.info("=" * 50)
216
- except Exception:
217
- pass
218
-
219
- asyncio.create_task(print_container_ip())
220
-
221
190
  # Stream and capture output for error reporting using chunked reads to handle large lines
222
191
  output_lines: list[str] = []
223
192
  assert process.stdout is not None
plato/v1/cli/chronos.py CHANGED
@@ -375,6 +375,7 @@ async def _create_chronos_session(
375
375
  world_name: str,
376
376
  world_config: dict,
377
377
  plato_session_id: str | None = None,
378
+ tags: list[str] | None = None,
378
379
  ) -> dict:
379
380
  """Create a session in Chronos."""
380
381
  import httpx
@@ -388,6 +389,7 @@ async def _create_chronos_session(
388
389
  "world_name": world_name,
389
390
  "world_config": world_config,
390
391
  "plato_session_id": plato_session_id,
392
+ "tags": tags or [],
391
393
  },
392
394
  headers={"x-api-key": api_key},
393
395
  )
@@ -545,12 +547,14 @@ async def _run_dev_impl(
545
547
 
546
548
  # Create Chronos session
547
549
  console.print("[blue]Creating Chronos session...[/blue]")
550
+ tags = raw_config.get("tags", [])
548
551
  chronos_session = await _create_chronos_session(
549
552
  chronos_url=chronos_url,
550
553
  api_key=api_key,
551
554
  world_name=world_name,
552
555
  world_config=config_data,
553
556
  plato_session_id=plato_session_id,
557
+ tags=tags,
554
558
  )
555
559
  chronos_session_id = chronos_session["public_id"]
556
560
  console.print(f"[green]✅ Created Chronos session: {chronos_session_id}[/green]")
@@ -638,10 +642,6 @@ async def _run_dev_impl(
638
642
  f"UPLOAD_URL={chronos_session.get('upload_url', '')}",
639
643
  ]
640
644
 
641
- # Add secrets as env vars
642
- for key, value in config_data.get("secrets", {}).items():
643
- docker_cmd.extend(["-e", f"{key.upper()}={value}"])
644
-
645
645
  # Use world runner image
646
646
  docker_cmd.append(world_runner_image)
647
647
 
plato/worlds/base.py CHANGED
@@ -227,7 +227,6 @@ class BaseWorld(ABC, Generic[ConfigT]):
227
227
  self,
228
228
  image: str,
229
229
  config: dict,
230
- secrets: dict[str, str],
231
230
  instruction: str,
232
231
  workspace: str | None = None,
233
232
  logs_dir: str | None = None,
@@ -241,7 +240,6 @@ class BaseWorld(ABC, Generic[ConfigT]):
241
240
  Args:
242
241
  image: Docker image URI
243
242
  config: Agent configuration dict
244
- secrets: Secret values (API keys, etc.)
245
243
  instruction: Task instruction for the agent
246
244
  workspace: Docker volume name for workspace
247
245
  logs_dir: Ignored (kept for backwards compatibility)
@@ -249,11 +247,13 @@ class BaseWorld(ABC, Generic[ConfigT]):
249
247
 
250
248
  Returns:
251
249
  The container name that was created
250
+
251
+ Note: Common API key environment variables (ANTHROPIC_API_KEY, etc.)
252
+ are automatically forwarded to the agent container.
252
253
  """
253
254
  container_name = await _run_agent_raw(
254
255
  image=image,
255
256
  config=config,
256
- secrets=secrets,
257
257
  instruction=instruction,
258
258
  workspace=workspace,
259
259
  logs_dir=logs_dir,
plato/worlds/config.py CHANGED
@@ -153,7 +153,6 @@ class RunConfig(BaseModel):
153
153
  session_id: str = ""
154
154
  otel_url: str = "" # OTel endpoint URL
155
155
  upload_url: str = "" # Presigned S3 URL for uploads
156
- all_secrets: dict[str, str] = Field(default_factory=dict) # All secrets (world + agent)
157
156
 
158
157
  # Serialized Plato session for connecting to VM and sending heartbeats
159
158
  # This is the output of Session.dump() - used to restore session with Session.load()
@@ -203,7 +202,7 @@ class RunConfig(BaseModel):
203
202
  env_list_field: dict | None = None # For EnvList marker (arbitrary envs)
204
203
 
205
204
  # Skip runtime fields
206
- runtime_fields = {"session_id", "otel_url", "upload_url", "all_secrets", "plato_session", "checkpoint", "state"}
205
+ runtime_fields = {"session_id", "otel_url", "upload_url", "plato_session", "checkpoint", "state"}
207
206
 
208
207
  for field_name, prop_schema in properties.items():
209
208
  if field_name in runtime_fields:
@@ -319,8 +318,8 @@ class RunConfig(BaseModel):
319
318
  # Handle agents dict -> individual agent fields
320
319
  agents_dict = data.pop("agents", {})
321
320
 
322
- # Handle secrets dict -> individual secret fields
323
- secrets_dict = data.pop("secrets", {})
321
+ # Handle secrets dict -> individual secret fields (for schema validation)
322
+ secrets_dict = data.pop("secrets", {}) # Pop but don't store separately
324
323
 
325
324
  # Check if there's an EnvList field - if so, don't pop envs as a dict
326
325
  has_env_list = any(isinstance(m, EnvList) for m in annotations.values())
@@ -356,9 +355,6 @@ class RunConfig(BaseModel):
356
355
  if isinstance(env_list, list):
357
356
  parsed[field_name] = [_parse_env_config(e) if isinstance(e, dict) else e for e in env_list]
358
357
 
359
- # Store all secrets for agent use
360
- parsed["all_secrets"] = secrets_dict
361
-
362
358
  return cls(**parsed)
363
359
 
364
360
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plato-sdk-v2
3
- Version: 2.6.0
3
+ Version: 2.6.1
4
4
  Summary: Python SDK for the Plato API
5
5
  Author-email: Plato <support@plato.so>
6
6
  License-Expression: MIT
@@ -303,7 +303,7 @@ plato/agents/base.py,sha256=vUbPQuNSo6Ka2lIB_ZOXgi4EoAjtAD7GIj9LnNotam0,4577
303
303
  plato/agents/build.py,sha256=CNMbVQFs2_pYit1dA29Davve28Yi4c7TNK9wBB7odrE,1621
304
304
  plato/agents/config.py,sha256=GWXEAbruNVI2q3XIWpQ9vGLK2wGhsFPYA-oekmAlrg8,5392
305
305
  plato/agents/otel.py,sha256=A2LkkjBtjSe0eztr9UvYvSUOwfmShCgPg3OUN8nOyIo,9159
306
- plato/agents/runner.py,sha256=piow_uO1eymreRMU-TX8tcIOn6aurafpjA5ptSR9JPM,9211
306
+ plato/agents/runner.py,sha256=Y-e5fCfPJpG1Wo1ICLco8kHzm7u-kbzwgbvLH3XBN-w,7969
307
307
  plato/agents/trajectory.py,sha256=WdiBmua0KvCrNaM3qgPI7-7B4xmSkfbP4oZ_9_8qHzU,10529
308
308
  plato/chronos/__init__.py,sha256=RHMvSrQS_-vkKOyTRuAkp2gKDP1HEuBLDnw8jcZs1Jg,739
309
309
  plato/chronos/client.py,sha256=YcOGtHWERyOD9z8LKt8bRMVL0cEwL2hiAP4qQgdZlUI,5495
@@ -412,7 +412,7 @@ plato/v1/sync_flow_executor.py,sha256=kgvNYOtA9FHeNfP7qb8ZPUIlTsfIss_Z98W8uX5vec
412
412
  plato/v1/sync_sdk.py,sha256=2sedg1QJiSxr1I3kCyfaLAnlAgHlbblc3QQP_47O30k,25697
413
413
  plato/v1/cli/__init__.py,sha256=om4b7PxgsoI7rEwuQelmQkqPdhMVn53_5qEN8kvksYw,105
414
414
  plato/v1/cli/agent.py,sha256=EbmEKWCMC5DJjmVDrYuwGenhIDgPjie8hdwrDOTSXaY,43766
415
- plato/v1/cli/chronos.py,sha256=S6_PKDsZt55XDVFKPxJY5FQBfoYePLpZq3JTnNN75rY,27430
415
+ plato/v1/cli/chronos.py,sha256=fevRWbEcpHH9GzxpAx5CdKB1b52hN8q2PnO7BZldpgY,27389
416
416
  plato/v1/cli/main.py,sha256=iKUz6Mu-4-dgr29qOUmDqBaumOCzNQKZsHAalVtaH0Q,6932
417
417
  plato/v1/cli/pm.py,sha256=TIvXBIWFDjr4s1girMMCuvHWQJkjpmsS-igAamddIWE,49746
418
418
  plato/v1/cli/sandbox.py,sha256=jhTney-Pr8bGmWIXOjVIMtZJ7v7uIoRnuh3wfG7weRg,98718
@@ -487,11 +487,11 @@ plato/v2/utils/models.py,sha256=PwehSSnIRG-tM3tWL1PzZEH77ZHhIAZ9R0UPs6YknbM,1441
487
487
  plato/v2/utils/proxy_tunnel.py,sha256=8ZTd0jCGSfIHMvSv1fgEyacuISWnGPHLPbDglWroTzY,10463
488
488
  plato/worlds/README.md,sha256=XFOkEA3cNNcrWkk-Cxnsl-zn-y0kvUENKQRSqFKpdqw,5479
489
489
  plato/worlds/__init__.py,sha256=nwuEerEkP2TSfadPiOMcUE3p6u1vhaS7ZxfTh2zNcF8,2217
490
- plato/worlds/base.py,sha256=8skzeNlufimvXdWBKVAjmgkZ3xGGt0ijRnu6darPxsk,31017
490
+ plato/worlds/base.py,sha256=-RR71bSxEFI5yydtrtq-AAbuw98CIjvmrbztqzB9oIc,31041
491
491
  plato/worlds/build_hook.py,sha256=KSoW0kqa5b7NyZ7MYOw2qsZ_2FkWuz0M3Ru7AKOP7Qw,3486
492
- plato/worlds/config.py,sha256=OJtBygnVACQl_kGF8iLofTIk8zMu8tTCNYav6lHdwNI,12874
492
+ plato/worlds/config.py,sha256=O1lUXzxp-Z_M7izslT8naXgE6XujjzwYFFrDDzUOueI,12736
493
493
  plato/worlds/runner.py,sha256=r9B2BxBae8_dM7y5cJf9xhThp_I1Qvf_tlPq2rs8qC8,4013
494
- plato_sdk_v2-2.6.0.dist-info/METADATA,sha256=_c1ttshrdw9fnmaXOO3-tEVSHGWz24tWl6s33A9viGw,8652
495
- plato_sdk_v2-2.6.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
496
- plato_sdk_v2-2.6.0.dist-info/entry_points.txt,sha256=upGMbJCx6YWUTKrPoYvYUYfFCqYr75nHDwhA-45m6p8,136
497
- plato_sdk_v2-2.6.0.dist-info/RECORD,,
494
+ plato_sdk_v2-2.6.1.dist-info/METADATA,sha256=k75QQnrgiZGJItMu0V86deiGRwyshWevF66gZl6QNa0,8652
495
+ plato_sdk_v2-2.6.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
496
+ plato_sdk_v2-2.6.1.dist-info/entry_points.txt,sha256=upGMbJCx6YWUTKrPoYvYUYfFCqYr75nHDwhA-45m6p8,136
497
+ plato_sdk_v2-2.6.1.dist-info/RECORD,,