agentenv-framework 0.9.1254__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.
- agent_env/__init__.py +0 -0
- agent_env/a2a_agent/__init__.py +23 -0
- agent_env/a2a_agent/a2a_agent.py +600 -0
- agent_env/a2a_agent/conversation_store.py +356 -0
- agent_env/a2a_agent/object_transfer.py +609 -0
- agent_env/a2a_agent/protocol.py +238 -0
- agent_env/a2a_agent/store.py +201 -0
- agent_env/a2a_agent/validator.py +901 -0
- agent_env/artifact/__init__.py +48 -0
- agent_env/artifact/artifact.py +74 -0
- agent_env/artifact/artifacts/__init__.py +0 -0
- agent_env/artifact/artifacts/cli.py +83 -0
- agent_env/artifact/artifacts/docker_image.py +457 -0
- agent_env/artifact/artifacts/environment.py +89 -0
- agent_env/artifact/artifacts/environment_universe.py +156 -0
- agent_env/artifact/artifacts/file.py +214 -0
- agent_env/artifact/artifacts/file_artifact_universe.py +206 -0
- agent_env/artifact/artifacts/skill.py +206 -0
- agent_env/artifact/artifacts/vm_image.py +95 -0
- agent_env/artifact/ref.py +15 -0
- agent_env/artifact/registry.py +251 -0
- agent_env/artifact/store.py +295 -0
- agent_env/artifact/universe.py +38 -0
- agent_env/attribution.py +41 -0
- agent_env/bundle/__init__.py +4 -0
- agent_env/bundle/_fs.py +128 -0
- agent_env/bundle/authoring.py +239 -0
- agent_env/bundle/installed.py +175 -0
- agent_env/bundle/ledger.py +269 -0
- agent_env/bundle/materialize.py +204 -0
- agent_env/bundle/parse.py +594 -0
- agent_env/bundle/plan.py +414 -0
- agent_env/bundle/resolve.py +404 -0
- agent_env/bundle/run.py +361 -0
- agent_env/cli/__init__.py +69 -0
- agent_env/cli/__main__.py +10 -0
- agent_env/cli/_installers.py +576 -0
- agent_env/cli/_plugin_changes.py +947 -0
- agent_env/cli/a2a_agent/__init__.py +22 -0
- agent_env/cli/a2a_agent/add_skill.py +97 -0
- agent_env/cli/a2a_agent/deploy.py +60 -0
- agent_env/cli/a2a_agent/get.py +15 -0
- agent_env/cli/a2a_agent/get_instance.py +26 -0
- agent_env/cli/a2a_agent/put.py +78 -0
- agent_env/cli/a2a_agent/validate.py +56 -0
- agent_env/cli/artifact/__init__.py +20 -0
- agent_env/cli/artifact/cli.py +83 -0
- agent_env/cli/artifact/environment.py +44 -0
- agent_env/cli/artifact/environment_universe.py +163 -0
- agent_env/cli/artifact/file_artifact_universe.py +281 -0
- agent_env/cli/artifact/skill.py +128 -0
- agent_env/cli/banner.py +25 -0
- agent_env/cli/config.py +263 -0
- agent_env/cli/env/__init__.py +31 -0
- agent_env/cli/env/deploy.py +112 -0
- agent_env/cli/env/gateway.py +57 -0
- agent_env/cli/env/get_instance.py +40 -0
- agent_env/cli/env/mcp_server.py +410 -0
- agent_env/cli/env/multi.py +282 -0
- agent_env/cli/env/service_db.py +99 -0
- agent_env/cli/env/snapshot.py +35 -0
- agent_env/cli/env/state/__init__.py +6 -0
- agent_env/cli/env/state/init.py +108 -0
- agent_env/cli/env/state/teardown.py +44 -0
- agent_env/cli/env/website.py +216 -0
- agent_env/cli/env/website_browser.py +67 -0
- agent_env/cli/eval/__init__.py +16 -0
- agent_env/cli/eval/add_tasks.py +63 -0
- agent_env/cli/eval/create.py +49 -0
- agent_env/cli/eval/run.py +194 -0
- agent_env/cli/identity/__init__.py +5 -0
- agent_env/cli/identity/client_identity.py +37 -0
- agent_env/cli/plugin.py +438 -0
- agent_env/cli/run.py +285 -0
- agent_env/cli/task/__init__.py +21 -0
- agent_env/cli/task/create.py +109 -0
- agent_env/cli/task/get.py +17 -0
- agent_env/cli/task/get_instance.py +34 -0
- agent_env/cli/task/run.py +615 -0
- agent_env/cli/task/validate.py +31 -0
- agent_env/cli/up.py +123 -0
- agent_env/cli/utils.py +183 -0
- agent_env/config/__init__.py +50 -0
- agent_env/config/describe.py +1067 -0
- agent_env/config/errors.py +13 -0
- agent_env/config/loader.py +245 -0
- agent_env/config/model.py +154 -0
- agent_env/config/paths.py +25 -0
- agent_env/config/plugin_tables.py +101 -0
- agent_env/config/provenance.py +134 -0
- agent_env/config/runtime.py +1064 -0
- agent_env/config/snapshot.py +81 -0
- agent_env/entity_refs.py +186 -0
- agent_env/env/__init__.py +49 -0
- agent_env/env/env.py +433 -0
- agent_env/env/env_artifact_store.py +87 -0
- agent_env/env/envs/__init__.py +7 -0
- agent_env/env/envs/_deployment.py +281 -0
- agent_env/env/envs/gateway_server.py +32 -0
- agent_env/env/envs/mcp_server.py +387 -0
- agent_env/env/envs/multi_env.py +780 -0
- agent_env/env/envs/service_db/Dockerfile +20 -0
- agent_env/env/envs/service_db/Dockerfile.db-mcp +42 -0
- agent_env/env/envs/service_db/Dockerfile.db-web +8 -0
- agent_env/env/envs/service_db.py +92 -0
- agent_env/env/envs/website.py +294 -0
- agent_env/env/envs/website_browser/Dockerfile +40 -0
- agent_env/env/envs/website_browser/__init__.py +17 -0
- agent_env/env/envs/website_browser/entrypoint.sh +13 -0
- agent_env/env/gateway/Dockerfile +14 -0
- agent_env/env/gateway/__init__.py +37 -0
- agent_env/env/gateway/clock.py +184 -0
- agent_env/env/gateway/constants.py +190 -0
- agent_env/env/gateway/entrypoint.py +156 -0
- agent_env/env/gateway/gateway.py +1095 -0
- agent_env/env/gateway/get_time.py +60 -0
- agent_env/env/gateway/requirements.txt +4 -0
- agent_env/env/gateway/triggers.py +1193 -0
- agent_env/env/legacy_protocol.py +146 -0
- agent_env/env/registry.py +93 -0
- agent_env/env/snapshot_store.py +372 -0
- agent_env/env/store.py +411 -0
- agent_env/eval/__init__.py +14 -0
- agent_env/eval/eval.py +68 -0
- agent_env/eval/store.py +116 -0
- agent_env/examples/hello/README.md +9 -0
- agent_env/examples/hello/artifacts/greeting/check.sh +1 -0
- agent_env/examples/hello/artifacts/greeting/hello.txt +1 -0
- agent_env/examples/hello/tasks/hello.json +10 -0
- agent_env/explorer/__init__.py +12 -0
- agent_env/explorer/app.py +277 -0
- agent_env/explorer/openapi_docs.py +242 -0
- agent_env/explorer/plugin.py +95 -0
- agent_env/explorer/routers/__init__.py +1 -0
- agent_env/explorer/routers/common.py +174 -0
- agent_env/explorer/routers/conversations.py +25 -0
- agent_env/explorer/routers/objects.py +112 -0
- agent_env/explorer/routers/runs.py +475 -0
- agent_env/plugins/__init__.py +59 -0
- agent_env/plugins/_cli.py +244 -0
- agent_env/plugins/_discovery.py +97 -0
- agent_env/plugins/_inventory.py +262 -0
- agent_env/plugins/_registration.py +268 -0
- agent_env/plugins/_report.py +47 -0
- agent_env/plugins/_requirements.py +55 -0
- agent_env/providers/__init__.py +37 -0
- agent_env/providers/env_providers/__init__.py +12 -0
- agent_env/providers/env_providers/constants.py +13 -0
- agent_env/providers/env_providers/env_gateway_provider.py +1354 -0
- agent_env/providers/env_providers/env_provider.py +237 -0
- agent_env/providers/env_providers/env_server_provider.py +133 -0
- agent_env/providers/env_state/__init__.py +49 -0
- agent_env/providers/env_state/env_state_provider.py +554 -0
- agent_env/providers/env_state/local_postgres.py +390 -0
- agent_env/providers/env_state/store.py +112 -0
- agent_env/providers/sandbox_providers/__init__.py +29 -0
- agent_env/providers/sandbox_providers/chained_sandbox_provider.py +93 -0
- agent_env/providers/sandbox_providers/e2b/__init__.py +6 -0
- agent_env/providers/sandbox_providers/e2b/provider.py +376 -0
- agent_env/providers/sandbox_providers/e2b/sandbox.py +342 -0
- agent_env/providers/sandbox_providers/e2b/template.py +158 -0
- agent_env/providers/sandbox_providers/local_sandbox.py +408 -0
- agent_env/providers/sandbox_providers/modal_sandbox.py +500 -0
- agent_env/providers/sandbox_providers/modal_vm_sandbox.py +466 -0
- agent_env/providers/sandbox_providers/sandbox.py +387 -0
- agent_env/providers/sandbox_providers/sandbox_provider.py +614 -0
- agent_env/py.typed +0 -0
- agent_env/runner/__init__.py +16 -0
- agent_env/runner/local_runner.py +190 -0
- agent_env/runner/runner.py +127 -0
- agent_env/runner/store.py +94 -0
- agent_env/store/__init__.py +126 -0
- agent_env/store/_google.py +68 -0
- agent_env/store/base.py +33 -0
- agent_env/store/document_store/__init__.py +60 -0
- agent_env/store/document_store/document_store.py +519 -0
- agent_env/store/document_store/dynamodb_document_store.py +306 -0
- agent_env/store/document_store/evaluation.py +199 -0
- agent_env/store/document_store/firestore_mongo_document_store.py +242 -0
- agent_env/store/document_store/mongo_document_store.py +259 -0
- agent_env/store/document_store/sqlite_document_store.py +314 -0
- agent_env/store/ids.py +123 -0
- agent_env/store/image_store/__init__.py +34 -0
- agent_env/store/image_store/ecr_image_store.py +131 -0
- agent_env/store/image_store/google_credentials.py +113 -0
- agent_env/store/image_store/image_store.py +113 -0
- agent_env/store/image_store/local_registry_image_store.py +106 -0
- agent_env/store/image_store/oci_registry_credentials.py +196 -0
- agent_env/store/local_state.py +27 -0
- agent_env/store/object_store/__init__.py +24 -0
- agent_env/store/object_store/gcs_object_store.py +415 -0
- agent_env/store/object_store/local_object_store.py +143 -0
- agent_env/store/object_store/object_store.py +198 -0
- agent_env/store/object_store/s3_object_store.py +354 -0
- agent_env/store/query.py +112 -0
- agent_env/store/routing.py +609 -0
- agent_env/store/secret_store/__init__.py +19 -0
- agent_env/store/secret_store/aws_secrets_manager_secret_store.py +293 -0
- agent_env/store/secret_store/gcp_secret_manager_secret_store.py +319 -0
- agent_env/store/secret_store/local_secret_store.py +47 -0
- agent_env/store/secret_store/secret_store.py +19 -0
- agent_env/task/__init__.py +27 -0
- agent_env/task/interrupts.py +109 -0
- agent_env/task/registry.py +27 -0
- agent_env/task/step_journal.py +99 -0
- agent_env/task/store.py +940 -0
- agent_env/task/task.py +815 -0
- agent_env/task/teardown.py +142 -0
- agent_env/task_step/__init__.py +47 -0
- agent_env/task_step/context.py +195 -0
- agent_env/task_step/context_ops.py +224 -0
- agent_env/task_step/registry.py +182 -0
- agent_env/task_step/review_store.py +118 -0
- agent_env/task_step/snapshot_utils/__init__.py +2 -0
- agent_env/task_step/snapshot_utils/agent_state_capture.py +261 -0
- agent_env/task_step/snapshot_utils/snapshot_series.py +631 -0
- agent_env/task_step/store.py +129 -0
- agent_env/task_step/task_step.py +173 -0
- agent_env/task_step/task_steps/__init__.py +27 -0
- agent_env/task_step/task_steps/a2a_agent_validator/__init__.py +31 -0
- agent_env/task_step/task_steps/a2a_agent_validator/fixtures/README.md +158 -0
- agent_env/task_step/task_steps/a2a_agent_validator/fixtures/clip.m4a +0 -0
- agent_env/task_step/task_steps/a2a_agent_validator/fixtures/clip.mp3 +0 -0
- agent_env/task_step/task_steps/a2a_agent_validator/fixtures/clip.mp4 +0 -0
- agent_env/task_step/task_steps/a2a_agent_validator/fixtures/clip.ogg +0 -0
- agent_env/task_step/task_steps/a2a_agent_validator/fixtures/clip.wav +0 -0
- agent_env/task_step/task_steps/a2a_agent_validator/fixtures/document.pdf +0 -0
- agent_env/task_step/task_steps/a2a_agent_validator/fixtures/red.gif +0 -0
- agent_env/task_step/task_steps/a2a_agent_validator/fixtures/red.jpg +0 -0
- agent_env/task_step/task_steps/a2a_agent_validator/fixtures/red.png +0 -0
- agent_env/task_step/task_steps/a2a_agent_validator/verify_a2a_agent_card.py +103 -0
- agent_env/task_step/task_steps/a2a_agent_validator/verify_a2a_agent_config_identity.py +69 -0
- agent_env/task_step/task_steps/a2a_agent_validator/verify_a2a_agent_mcp.py +178 -0
- agent_env/task_step/task_steps/a2a_agent_validator/verify_a2a_core_protocol.py +67 -0
- agent_env/task_step/task_steps/a2a_agent_validator/verify_a2a_install.py +115 -0
- agent_env/task_step/task_steps/a2a_agent_validator/verify_a2a_litellm_attribution.py +124 -0
- agent_env/task_step/task_steps/a2a_agent_validator/verify_a2a_litellm_attribution_runtime.py +173 -0
- agent_env/task_step/task_steps/a2a_agent_validator/verify_a2a_modalities.py +270 -0
- agent_env/task_step/task_steps/a2a_agent_validator/verify_a2a_peer_agents.py +102 -0
- agent_env/task_step/task_steps/a2a_agent_validator/verify_a2a_role.py +151 -0
- agent_env/task_step/task_steps/a2a_agent_validator/verify_a2a_skill_config.py +194 -0
- agent_env/task_step/task_steps/a2a_agent_validator/verify_a2a_snapshot.py +111 -0
- agent_env/task_step/task_steps/a2a_agent_validator/verify_a2a_system_prompt.py +215 -0
- agent_env/task_step/task_steps/a2a_agent_validator/verify_a2a_trajectory.py +164 -0
- agent_env/task_step/task_steps/add_skills.py +240 -0
- agent_env/task_step/task_steps/apply_server_config.py +288 -0
- agent_env/task_step/task_steps/collect_artifacts.py +940 -0
- agent_env/task_step/task_steps/deploy_agent.py +626 -0
- agent_env/task_step/task_steps/deploy_env.py +197 -0
- agent_env/task_step/task_steps/deploy_human_agent.py +100 -0
- agent_env/task_step/task_steps/deploy_sandbox.py +170 -0
- agent_env/task_step/task_steps/env_card_validator/__init__.py +4 -0
- agent_env/task_step/task_steps/env_card_validator/verify_env_card.py +109 -0
- agent_env/task_step/task_steps/env_card_validator/verify_env_core_protocol.py +108 -0
- agent_env/task_step/task_steps/install_agent.py +376 -0
- agent_env/task_step/task_steps/load_artifact.py +775 -0
- agent_env/task_step/task_steps/mcp_cli_builder/__init__.py +4 -0
- agent_env/task_step/task_steps/mcp_cli_builder/build_mcp_cli.py +201 -0
- agent_env/task_step/task_steps/mcp_cli_builder/codegen.py +627 -0
- agent_env/task_step/task_steps/mcp_env_validator/__init__.py +44 -0
- agent_env/task_step/task_steps/mcp_env_validator/validation_gate_aggregator.py +102 -0
- agent_env/task_step/task_steps/mcp_env_validator/verify_mcp_env_assessment.py +78 -0
- agent_env/task_step/task_steps/mcp_env_validator/verify_mcp_tool_schema.py +152 -0
- agent_env/task_step/task_steps/mcp_env_validator/verify_spec_conformance.py +486 -0
- agent_env/task_step/task_steps/modify_env_tool_access.py +80 -0
- agent_env/task_step/task_steps/multienv_validator/__init__.py +3 -0
- agent_env/task_step/task_steps/multienv_validator/combine_universe_verdicts.py +107 -0
- agent_env/task_step/task_steps/multienv_validator/universe_comparison.py +253 -0
- agent_env/task_step/task_steps/multienv_validator/verify_universe_agent_judge.py +180 -0
- agent_env/task_step/task_steps/multienv_validator/verify_universe_roundtrip.py +241 -0
- agent_env/task_step/task_steps/peer_agents.py +92 -0
- agent_env/task_step/task_steps/prompt_agent.py +900 -0
- agent_env/task_step/task_steps/register_agent_triggers.py +113 -0
- agent_env/task_step/task_steps/register_env_triggers.py +97 -0
- agent_env/task_step/task_steps/reset_env.py +71 -0
- agent_env/task_step/task_steps/review.py +152 -0
- agent_env/task_step/task_steps/run_code.py +461 -0
- agent_env/task_step/task_steps/run_code_runner.py +52 -0
- agent_env/task_step/task_steps/run_docker_container.py +380 -0
- agent_env/task_step/task_steps/sandbox_utils/__init__.py +0 -0
- agent_env/task_step/task_steps/sandbox_utils/sandbox_utils.py +79 -0
- agent_env/task_step/task_steps/snapshot_agent_state.py +205 -0
- agent_env/task_step/task_steps/snapshot_env.py +637 -0
- agent_env/task_step/task_steps/sync_env_clock.py +132 -0
- agent_env/task_step/task_steps/teardown_sandboxes.py +170 -0
- agent_env/task_step/task_steps/verifiers/__init__.py +23 -0
- agent_env/task_step/task_steps/verifiers/agent_prompt_response_verifier.py +166 -0
- agent_env/task_step/task_steps/verifiers/aggregate_verifiers.py +90 -0
- agent_env/task_step/task_steps/verifiers/env_outcome_verifier.py +127 -0
- agent_env/task_step/task_steps/verifiers/judge_utils/__init__.py +2 -0
- agent_env/task_step/task_steps/verifiers/judge_utils/frame_selection.py +377 -0
- agent_env/task_step/task_steps/verifiers/judge_utils/judge_output_format.py +1293 -0
- agent_env/task_step/task_steps/verifiers/judge_utils/trajectory_filter.py +514 -0
- agent_env/task_step/task_steps/verifiers/rubrics_verifier.py +1318 -0
- agent_env/task_step/task_steps/verifiers/run_container_unit_tests_verifier.py +434 -0
- agent_env/task_step/task_steps/verifiers/scoring.py +40 -0
- agent_env/task_step/task_steps/verifiers/verify_sandbox.py +308 -0
- agent_env/task_step/thread_work.py +61 -0
- agent_env/utils/__init__.py +0 -0
- agent_env/utils/card_naming.py +108 -0
- agent_env/utils/deprecation.py +109 -0
- agent_env/utils/docker_build.py +29 -0
- agent_env/utils/exec_retry.py +77 -0
- agent_env/utils/litellm_attribution.py +59 -0
- agent_env/utils/paths.py +20 -0
- agentenv_framework-0.9.1254.dist-info/METADATA +394 -0
- agentenv_framework-0.9.1254.dist-info/RECORD +312 -0
- agentenv_framework-0.9.1254.dist-info/WHEEL +4 -0
- agentenv_framework-0.9.1254.dist-info/entry_points.txt +5 -0
- agentenv_framework-0.9.1254.dist-info/licenses/LICENSE +202 -0
- agentenv_framework-0.9.1254.dist-info/licenses/NOTICE +4 -0
- agentenv_framework-0.9.1254.dist-info/licenses/THIRD_PARTY_NOTICES.md +7665 -0
agent_env/cli/run.py
ADDED
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
"""``agent-env run``: run the tasks and evals of a bundle, a folder or one an installed package provides."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import os
|
|
6
|
+
import shlex
|
|
7
|
+
import time
|
|
8
|
+
import traceback
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
|
|
11
|
+
import click
|
|
12
|
+
|
|
13
|
+
from agent_env.bundle import BundleError, BundleKind, BundleRun, Outcome, RunInterrupted, TaskRun, run_bundle
|
|
14
|
+
from agent_env.bundle.installed import InstalledBundle, checked, find_bundle, installed_bundles, run_name
|
|
15
|
+
from agent_env.plugins._discovery import discovery_error
|
|
16
|
+
from agent_env.providers.sandbox_providers.local_sandbox import LocalSandbox
|
|
17
|
+
from agent_env.task.interrupts import Interrupts
|
|
18
|
+
from agent_env.task.teardown import RecordedSandbox, TeardownReport, kind, recorded_sandboxes, sandbox_ids
|
|
19
|
+
from agent_env.task_step.context import TaskStepContext
|
|
20
|
+
from agent_env.task_step.task_steps.teardown_sandboxes import TORN_DOWN_KEY
|
|
21
|
+
|
|
22
|
+
_COLORS = {Outcome.PASSED: "green", Outcome.BELOW_ONE: "yellow", Outcome.UNSCORED: "yellow", Outcome.FAILED: "red",
|
|
23
|
+
Outcome.CANCELLED: "yellow"}
|
|
24
|
+
_ENV_ENDPOINTS = (("mcp", "mcp_url"), ("gateway", "gateway_url"), ("pgweb", "db_web_url"), ("db-mcp", "db_mcp_url"),
|
|
25
|
+
("vnc", "vnc_url"), ("expires", "expires_at_utc"))
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@click.command()
|
|
29
|
+
@click.argument("bundle", required=False)
|
|
30
|
+
@click.option("--task", "tasks", multiple=True, help="Run this task, by name or id. Repeatable.")
|
|
31
|
+
@click.option("--eval", "evals", multiple=True, help="Run this eval's tasks, by name or id. Repeatable.")
|
|
32
|
+
@click.option("--model", default=None, help="The model the agent runs on. The judge keeps its own.")
|
|
33
|
+
@click.option("--sandbox", default=None,
|
|
34
|
+
help="The sandbox provider envs, agents, sandboxes and the judge deploy on; comma-separated for a "
|
|
35
|
+
"fallback chain.")
|
|
36
|
+
@click.option("--keep", is_flag=True,
|
|
37
|
+
help="Keep the sandboxes up after the runs, print their endpoints, and tear them down on Ctrl-C.")
|
|
38
|
+
@click.pass_context
|
|
39
|
+
def run(ctx: click.Context, bundle: str | None, tasks: tuple[str, ...], evals: tuple[str, ...], model: str | None,
|
|
40
|
+
sandbox: str | None, keep: bool):
|
|
41
|
+
"""Run a bundle's tasks and evals, or list the installed bundles.
|
|
42
|
+
|
|
43
|
+
BUNDLE is a folder, or the name of a bundle an installed package provides (PACKAGE/NAME when several
|
|
44
|
+
packages provide that name). Without BUNDLE, it lists the installed bundles.
|
|
45
|
+
|
|
46
|
+
With no --task or --eval, it runs every eval or, in a bundle without evals, every task. Each task runs
|
|
47
|
+
once, at most four at a time, and the run exits 1 if any of them failed. With --verbose, a run that
|
|
48
|
+
raised prints its traceback.
|
|
49
|
+
|
|
50
|
+
Each run's sandboxes are torn down as it ends; its instance and outputs stay. --keep holds them up
|
|
51
|
+
until Ctrl-C instead. Ctrl-C or SIGTERM mid-run cancels the runs, tears them down, prints what ran and
|
|
52
|
+
exits 130 (143 for SIGTERM); a second one stops the teardown and prints what is still up.
|
|
53
|
+
"""
|
|
54
|
+
if bundle is None:
|
|
55
|
+
if tasks or evals or model or sandbox or keep:
|
|
56
|
+
raise click.UsageError("--task, --eval, --model, --sandbox and --keep need a BUNDLE to run")
|
|
57
|
+
_list_installed()
|
|
58
|
+
return
|
|
59
|
+
root, id_root = _locate(bundle)
|
|
60
|
+
verbose = ctx.find_root().params.get("verbose")
|
|
61
|
+
try:
|
|
62
|
+
result = run_bundle(root, tasks=tasks, evals=evals, model=model, sandbox=sandbox, on_progress=click.echo,
|
|
63
|
+
id_root=id_root, keep=keep)
|
|
64
|
+
except BundleError as e:
|
|
65
|
+
_note_an_installed_namesake(e, bundle, root, id_root)
|
|
66
|
+
raise
|
|
67
|
+
except RunInterrupted as stop:
|
|
68
|
+
with Interrupts():
|
|
69
|
+
_summarize(stop.result, verbose)
|
|
70
|
+
_report_teardown(stop.result)
|
|
71
|
+
raise SystemExit(128 + stop.signum) from None
|
|
72
|
+
with Interrupts() as interrupts:
|
|
73
|
+
_summarize(result, verbose)
|
|
74
|
+
if keep:
|
|
75
|
+
result = _hold(result, interrupts)
|
|
76
|
+
_report_teardown(result)
|
|
77
|
+
if result.failed:
|
|
78
|
+
raise SystemExit(1)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def _path_like(text: str) -> bool:
|
|
82
|
+
"""Text that names a folder even when there is none there."""
|
|
83
|
+
return text.startswith((".", "/", "~"))
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
def _locate(text: str) -> tuple[Path, str | None]:
|
|
87
|
+
"""The folder ``text`` names, and the id root of an installed bundle's. An existing folder wins, and text
|
|
88
|
+
that starts like a path is always one; anything else names an installed bundle."""
|
|
89
|
+
if _path_like(text) or os.path.isdir(text):
|
|
90
|
+
return Path(text), None
|
|
91
|
+
found = find_bundle(text, _installed())
|
|
92
|
+
return found.root, found.id_root
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
def _note_an_installed_namesake(error: BundleError, text: str, root: Path, id_root: str | None) -> None:
|
|
96
|
+
"""A folder that isn't a bundle can hide the installed bundle the user meant. The note names it by its
|
|
97
|
+
qualified name, which only helps when that isn't what was typed and isn't a folder too."""
|
|
98
|
+
if id_root is not None or _path_like(text) or _has_kind_folder(root):
|
|
99
|
+
return
|
|
100
|
+
try:
|
|
101
|
+
found = find_bundle(text)
|
|
102
|
+
except Exception:
|
|
103
|
+
return
|
|
104
|
+
if os.path.isdir(found.qualified):
|
|
105
|
+
return
|
|
106
|
+
error.add_note(f"an installed bundle is also named {text!r}: run it with agent-env run {found.qualified}")
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
def _has_kind_folder(root: Path) -> bool:
|
|
110
|
+
return any(os.path.isdir(root / kind.value) for kind in BundleKind)
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
def _installed() -> tuple[InstalledBundle, ...]:
|
|
114
|
+
try:
|
|
115
|
+
return installed_bundles()
|
|
116
|
+
except Exception as e:
|
|
117
|
+
raise click.ClickException(f"the installed bundles can't be read: {discovery_error(e)}") from e
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
def _list_installed() -> None:
|
|
121
|
+
bundles = _installed()
|
|
122
|
+
if not bundles:
|
|
123
|
+
click.echo("No bundles are installed. agent-env run PATH runs a folder.")
|
|
124
|
+
return
|
|
125
|
+
header = ("NAME", "PACKAGE", "CONTENTS", "DESCRIPTION")
|
|
126
|
+
rows = [(run_name(bundle, bundles), f"{bundle.package} {bundle.version}", *_contents(bundle)) for bundle in bundles]
|
|
127
|
+
widths = [max(len(row[i]) for row in (header, *rows)) for i in range(3)]
|
|
128
|
+
|
|
129
|
+
def echo(name: str, package: str, contents: str, description: str) -> None:
|
|
130
|
+
click.echo(f"{name:<{widths[0]}} {package:<{widths[1]}} {contents:<{widths[2]}} {description}".rstrip())
|
|
131
|
+
|
|
132
|
+
echo(*header)
|
|
133
|
+
for bundle, row in zip(bundles, rows):
|
|
134
|
+
echo(*row)
|
|
135
|
+
if bundle.root is not None:
|
|
136
|
+
click.echo(f"{'':<{widths[0]}} {bundle.root}")
|
|
137
|
+
click.echo("\nRun one with agent-env run NAME. To change one, copy its folder and run the copy.")
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
def _contents(bundle: InstalledBundle) -> tuple[str, str]:
|
|
141
|
+
"""What ``bundle`` holds and its description, or why it can't run."""
|
|
142
|
+
if bundle.problem:
|
|
143
|
+
return "invalid", bundle.problem
|
|
144
|
+
try:
|
|
145
|
+
parsed = checked(bundle)
|
|
146
|
+
except BundleError as e:
|
|
147
|
+
return "invalid", e.summary
|
|
148
|
+
counts = [_count(parsed.entries, kind, noun) for kind, noun in ((BundleKind.TASK, "task"), (BundleKind.EVAL, "eval"))]
|
|
149
|
+
return ", ".join(count for count in counts if count), parsed.description or ""
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
def _count(entries, kind: BundleKind, noun: str) -> str:
|
|
153
|
+
n = sum(entry.kind is kind for entry in entries)
|
|
154
|
+
return f"{n} {noun}{'s' if n != 1 else ''}" if n else ""
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
def _summarize(result: BundleRun, verbose: bool) -> None:
|
|
158
|
+
click.echo()
|
|
159
|
+
click.echo("Tasks:")
|
|
160
|
+
for run in result.runs:
|
|
161
|
+
click.echo(click.style(f" {_described(result, run)}", fg=_COLORS[run.outcome]))
|
|
162
|
+
if result.evals:
|
|
163
|
+
click.echo("Evals:")
|
|
164
|
+
for eval_run in result.evals:
|
|
165
|
+
passed, failed, cancelled = (sum(run.outcome is outcome for run in eval_run.runs)
|
|
166
|
+
for outcome in (Outcome.PASSED, Outcome.FAILED, Outcome.CANCELLED))
|
|
167
|
+
line = f" {result.path(eval_run.entry)} v{eval_run.version}: {passed} of {len(eval_run.runs)} passed"
|
|
168
|
+
rest = [f"{failed} failed" if failed else "", f"{cancelled} cancelled" if cancelled else ""]
|
|
169
|
+
click.echo(", ".join([line, *filter(None, rest)]))
|
|
170
|
+
for entry in result.skipped:
|
|
171
|
+
click.echo(f"{result.path(entry)} isn't named by any eval, so it didn't run; run it with "
|
|
172
|
+
f"--task {shlex.quote(entry.name)}")
|
|
173
|
+
if verbose:
|
|
174
|
+
_print_tracebacks(result)
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
def _print_tracebacks(result: BundleRun) -> None:
|
|
178
|
+
for run in result.runs:
|
|
179
|
+
if run.error is not None:
|
|
180
|
+
click.echo(f"\n{result.path(run.entry)} raised:", err=True)
|
|
181
|
+
click.echo("".join(traceback.format_exception(run.error)).rstrip(), err=True)
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
def _described(result: BundleRun, run: TaskRun) -> str:
|
|
185
|
+
if not run.started:
|
|
186
|
+
return f"{result.path(run.entry)} v{run.task.version}: didn't start"
|
|
187
|
+
return (f"{result.path(run.entry)} v{run.task.version}: {_outcome(run)}, {run.duration:.1f}s, "
|
|
188
|
+
f"{f'instance {run.instance_id}' if run.instance_id else 'no instance recorded'}")
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
def _outcome(run: TaskRun) -> str:
|
|
192
|
+
if run.outcome is Outcome.FAILED:
|
|
193
|
+
if not run.failed_steps:
|
|
194
|
+
return f"failed: {type(run.error).__name__}: {run.error}"
|
|
195
|
+
return "failed at " + "; ".join(f"step {failure['step_id']!r}: {failure['error_type']}: {failure['error']}"
|
|
196
|
+
for failure in run.failed_steps)
|
|
197
|
+
scores = ", ".join(f"{step_id}: {score:g}" for step_id, score in run.scores.items())
|
|
198
|
+
return f"{run.outcome.value} ({scores})" if scores else run.outcome.value
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
def _hold(result: BundleRun, interrupts: Interrupts) -> BundleRun:
|
|
202
|
+
"""Print what the runs keep up, wait for Ctrl-C or SIGTERM, then tear it down; another one stops that."""
|
|
203
|
+
kept = [run for run in result.runs if run.torn_down is None]
|
|
204
|
+
count = sum(len(TeardownReport.skipped(run.context).left) for run in kept)
|
|
205
|
+
if not count:
|
|
206
|
+
click.echo("\nNothing to keep up: no run left a sandbox.")
|
|
207
|
+
return result
|
|
208
|
+
click.echo("\nKept up:")
|
|
209
|
+
for run in kept:
|
|
210
|
+
lines = _kept_up(run.context)
|
|
211
|
+
if lines:
|
|
212
|
+
click.echo(f" {result.path(run.entry)}")
|
|
213
|
+
for line in lines:
|
|
214
|
+
click.echo(f" {line}")
|
|
215
|
+
them = "it" if count == 1 else "them"
|
|
216
|
+
click.echo(f"\nHolding {_sandboxes(count)} up; Ctrl-C tears {them} down.")
|
|
217
|
+
while not interrupts.count:
|
|
218
|
+
time.sleep(0.2)
|
|
219
|
+
if interrupts.count > 1:
|
|
220
|
+
return result
|
|
221
|
+
click.echo(f"\nTearing down {_sandboxes(count)} (Ctrl-C again to stop now)")
|
|
222
|
+
try:
|
|
223
|
+
return result.teardown()
|
|
224
|
+
except RunInterrupted as stopped:
|
|
225
|
+
return stopped.result
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
def _kept_up(context: TaskStepContext) -> list[str]:
|
|
229
|
+
"""Each sandbox still up: the records behind it, the endpoints of those it is the sandbox of, and a local
|
|
230
|
+
one's folder."""
|
|
231
|
+
torn_down = set(context.metadata.get(TORN_DOWN_KEY) or [])
|
|
232
|
+
records = _records(context)
|
|
233
|
+
lines = []
|
|
234
|
+
for sandbox in recorded_sandboxes(context):
|
|
235
|
+
if sandbox.sandbox_id in torn_down:
|
|
236
|
+
continue
|
|
237
|
+
behind = [(label, record, endpoints) for label, record, endpoints in records
|
|
238
|
+
if sandbox.sandbox_id in sandbox_ids(record)]
|
|
239
|
+
lines.append(f"{sandbox.sandbox_id} {kind(sandbox)} {', '.join(label for label, _, _ in behind)}")
|
|
240
|
+
for _, record, endpoints in behind:
|
|
241
|
+
if getattr(record, "sandbox_id", None) == sandbox.sandbox_id:
|
|
242
|
+
lines.extend(f" {label} {value}" for label, value in endpoints if value)
|
|
243
|
+
if folder := LocalSandbox.find_work_dir(sandbox.sandbox_id):
|
|
244
|
+
lines.append(f" folder {folder}")
|
|
245
|
+
return lines
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
def _records(context: TaskStepContext) -> list[tuple[str, object, list[tuple[str, str | None]]]]:
|
|
249
|
+
"""Every deployed record in ``context``, labelled, with the endpoints it records."""
|
|
250
|
+
records = []
|
|
251
|
+
for sandbox in context.deployed_sandboxes:
|
|
252
|
+
ports = [(f"port {port}", url) for port, url in (sandbox.tunnel_urls or {}).items()]
|
|
253
|
+
records.append((f"sandbox {sandbox.sandbox_name}", sandbox,
|
|
254
|
+
[*ports, ("vnc", sandbox.vnc_url), ("expires", sandbox.expires_at_utc)]))
|
|
255
|
+
for env in context.deployed_envs:
|
|
256
|
+
endpoints = [(label, getattr(env, field, None)) for label, field in _ENV_ENDPOINTS]
|
|
257
|
+
sites = [(f"site {name}", url) for name, url in (getattr(env, "website_frontend_urls", None) or {}).items()]
|
|
258
|
+
records.append((f"env {env.env_id}", env, [*endpoints, *sites]))
|
|
259
|
+
for agent in context.deployed_agents:
|
|
260
|
+
records.append((f"agent {agent.agent_name}", agent, [("a2a", agent.a2a_url or agent.api_url)]))
|
|
261
|
+
return records
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
def _report_teardown(result: BundleRun) -> None:
|
|
265
|
+
reports = [run.torn_down or TeardownReport.skipped(run.context) for run in result.runs]
|
|
266
|
+
terminated = sum(len(report.terminated) for report in reports)
|
|
267
|
+
still_up = [sandbox for report in reports for sandbox in report.still_up
|
|
268
|
+
if sandbox.sandbox_type != "local" or LocalSandbox.find_work_dir(sandbox.sandbox_id)]
|
|
269
|
+
if terminated or still_up:
|
|
270
|
+
click.echo()
|
|
271
|
+
if terminated:
|
|
272
|
+
click.echo(f"Tore down {_sandboxes(terminated)}.")
|
|
273
|
+
if still_up:
|
|
274
|
+
click.echo(click.style(f"Still up, {_sandboxes(len(still_up))}:", fg="yellow"))
|
|
275
|
+
for sandbox in still_up:
|
|
276
|
+
click.echo(f" {_still_up(sandbox)}")
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
def _still_up(sandbox: RecordedSandbox) -> str:
|
|
280
|
+
folder = LocalSandbox.find_work_dir(sandbox.sandbox_id)
|
|
281
|
+
return " ".join([sandbox.sandbox_id, kind(sandbox), *([str(folder)] if folder else [])])
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
def _sandboxes(n: int) -> str:
|
|
285
|
+
return f"{n} sandbox{'es' if n != 1 else ''}"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import click
|
|
2
|
+
|
|
3
|
+
from .create import create
|
|
4
|
+
from .get import get
|
|
5
|
+
from .get_instance import get_instance
|
|
6
|
+
from .run import run, run_batch
|
|
7
|
+
from .validate import validate
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@click.group()
|
|
11
|
+
def task():
|
|
12
|
+
"""Task commands."""
|
|
13
|
+
pass
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
task.add_command(create)
|
|
17
|
+
task.add_command(get)
|
|
18
|
+
task.add_command(get_instance)
|
|
19
|
+
task.add_command(run)
|
|
20
|
+
task.add_command(run_batch)
|
|
21
|
+
task.add_command(validate)
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"""Create a task from a JSON definition file."""
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
6
|
+
import click
|
|
7
|
+
|
|
8
|
+
from agent_env.plugins import _registration
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@click.command()
|
|
12
|
+
@click.argument("filepath", type=click.Path(exists=True, dir_okay=False, path_type=Path))
|
|
13
|
+
@click.option("--id", "task_id", required=True, help="Task id")
|
|
14
|
+
@click.option(
|
|
15
|
+
"--project-id",
|
|
16
|
+
"project_id",
|
|
17
|
+
required=True,
|
|
18
|
+
help=(
|
|
19
|
+
"Project id for LiteLLM cost attribution. Required for new "
|
|
20
|
+
"tasks; tasks created before this requirement landed run without "
|
|
21
|
+
"one and the runner falls back to manual attribution."
|
|
22
|
+
),
|
|
23
|
+
)
|
|
24
|
+
@click.option(
|
|
25
|
+
"--skip-validation",
|
|
26
|
+
is_flag=True,
|
|
27
|
+
help="Save even if preflight finds problems (they are printed either way).",
|
|
28
|
+
)
|
|
29
|
+
def create(filepath: Path, task_id: str, project_id: str, skip_validation: bool):
|
|
30
|
+
"""Create a task from a JSON file containing step definitions.
|
|
31
|
+
|
|
32
|
+
\b
|
|
33
|
+
The JSON file should contain a list of step dicts, e.g.:
|
|
34
|
+
[
|
|
35
|
+
{"id": "step-1", "type": "deploy_env", "env_id": "my-env"},
|
|
36
|
+
{"id": "step-2", "type": "prompt_agent", "prompt": "Hello"}
|
|
37
|
+
]
|
|
38
|
+
"""
|
|
39
|
+
from agent_env.task import Task
|
|
40
|
+
|
|
41
|
+
click.echo(f"Reading steps from {filepath}...")
|
|
42
|
+
with open(filepath) as f:
|
|
43
|
+
steps = json.load(f)
|
|
44
|
+
|
|
45
|
+
if not isinstance(steps, list):
|
|
46
|
+
click.echo("Error: JSON file must contain a list of step dicts", err=True)
|
|
47
|
+
raise SystemExit(1)
|
|
48
|
+
|
|
49
|
+
built = _build_steps(steps)
|
|
50
|
+
_report_preflight(
|
|
51
|
+
Task(id=task_id, version=None, steps=[s for _, s in built], project_id=project_id),
|
|
52
|
+
skip_validation,
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
task_steps = []
|
|
56
|
+
for i, (kwargs, step) in enumerate(built):
|
|
57
|
+
saved = type(step).put(**kwargs)
|
|
58
|
+
click.echo(f" Step {i + 1}/{len(built)}: {step.type} id={saved.id} version={saved.version}")
|
|
59
|
+
task_steps.append(saved)
|
|
60
|
+
|
|
61
|
+
click.echo(f"Creating task '{task_id}' with {len(task_steps)} steps (project_id={project_id})...")
|
|
62
|
+
task = Task.put(id=task_id, steps=task_steps, project_id=project_id)
|
|
63
|
+
click.echo(f"Created task: id={task.id} version={task.version} steps={len(task.steps)}")
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def _build_steps(steps: list[dict]) -> list[tuple[dict, object]]:
|
|
67
|
+
"""Instantiate every step as ``(kwargs, step)`` without writing anything.
|
|
68
|
+
|
|
69
|
+
`step_cls.put` writes unconditionally, so a create that preflight rejects must
|
|
70
|
+
not have left step documents behind — one extra version per retry.
|
|
71
|
+
"""
|
|
72
|
+
from agent_env.task_step.registry import get_task_step_registry
|
|
73
|
+
|
|
74
|
+
registry = get_task_step_registry()
|
|
75
|
+
built = []
|
|
76
|
+
for step_dict in steps:
|
|
77
|
+
step_type = step_dict["type"]
|
|
78
|
+
step_cls = registry.get(step_type)
|
|
79
|
+
if step_cls is None:
|
|
80
|
+
click.echo(
|
|
81
|
+
f"Error: Unknown task step type: {step_type}{_registration.failure_note(_registration.TASK_STEPS, step_type)}",
|
|
82
|
+
err=True,
|
|
83
|
+
)
|
|
84
|
+
raise SystemExit(1)
|
|
85
|
+
kwargs = {k: v for k, v in step_dict.items() if k != "type"}
|
|
86
|
+
kwargs.setdefault("version", None)
|
|
87
|
+
# retry_config lives on the TaskStep base but most step __init__s don't
|
|
88
|
+
# accept it; construct without it and hydrate (as Task.from_dict does),
|
|
89
|
+
# so retry_config on any step type doesn't crash create. put() below
|
|
90
|
+
# handles the kwargs form the same way.
|
|
91
|
+
from agent_env.task_step.task_step import attach_retry_config
|
|
92
|
+
|
|
93
|
+
ctor_kwargs = {k: v for k, v in kwargs.items() if k != "retry_config"}
|
|
94
|
+
step = attach_retry_config(step_cls(**ctor_kwargs), step_dict)
|
|
95
|
+
built.append((kwargs, step))
|
|
96
|
+
return built
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def _report_preflight(task, skip_validation: bool) -> None:
|
|
100
|
+
problems = task.preflight()
|
|
101
|
+
if not problems:
|
|
102
|
+
return
|
|
103
|
+
click.echo(f"Preflight found {len(problems)} problem(s):", err=True)
|
|
104
|
+
for p in problems:
|
|
105
|
+
click.echo(f" - {p}", err=True)
|
|
106
|
+
if not skip_validation:
|
|
107
|
+
click.echo("Nothing was saved. Re-run with --skip-validation to save anyway.", err=True)
|
|
108
|
+
raise SystemExit(1)
|
|
109
|
+
click.echo("Saving anyway (--skip-validation).", err=True)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"""Get a task definition and output its JSON."""
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
|
|
5
|
+
import click
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@click.command()
|
|
9
|
+
@click.option("--id", "task_id", required=True, help="Task id")
|
|
10
|
+
@click.option("--version", "task_version", default=None, type=int, help="Task version (defaults to latest)")
|
|
11
|
+
def get(task_id: str, task_version: int | None):
|
|
12
|
+
"""Get a task and output its step definitions as JSON."""
|
|
13
|
+
from agent_env.task import Task
|
|
14
|
+
|
|
15
|
+
task = Task.get(task_id, task_version)
|
|
16
|
+
steps = task.to_dict()["steps"]
|
|
17
|
+
click.echo(json.dumps(steps, indent=2))
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"""Get a task instance by ID."""
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
|
|
5
|
+
import click
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@click.command("get-instance")
|
|
9
|
+
@click.option("--id", "instance_id", required=True, help="Task instance ID")
|
|
10
|
+
def get_instance(instance_id: str):
|
|
11
|
+
"""Look up a task run instance."""
|
|
12
|
+
from agent_env.store.base import NotFoundError
|
|
13
|
+
|
|
14
|
+
from agent_env.task.store import get_task_instance_store
|
|
15
|
+
|
|
16
|
+
try:
|
|
17
|
+
instance = get_task_instance_store().get(instance_id)
|
|
18
|
+
except NotFoundError:
|
|
19
|
+
click.echo(f"Error: Task instance '{instance_id}' not found", err=True)
|
|
20
|
+
raise SystemExit(1)
|
|
21
|
+
|
|
22
|
+
click.echo(f"Instance ID: {instance.instance_id}")
|
|
23
|
+
click.echo(f"Task ID: {instance.task_id}")
|
|
24
|
+
click.echo(f"Task Version: {instance.task_version}")
|
|
25
|
+
click.echo(f"Status: {instance.status}")
|
|
26
|
+
click.echo(f"Progress: {instance.current_step}/{instance.total_steps}")
|
|
27
|
+
if instance.created_at_utc:
|
|
28
|
+
click.echo(f"Created At (UTC): {instance.created_at_utc}")
|
|
29
|
+
if instance.completed_at_utc:
|
|
30
|
+
click.echo(f"Completed At (UTC): {instance.completed_at_utc}")
|
|
31
|
+
if instance.error:
|
|
32
|
+
click.echo(f"Error: {instance.error}")
|
|
33
|
+
if instance.context:
|
|
34
|
+
click.echo(f"Context: {json.dumps(instance.context, indent=2)}")
|