agentcyberrange 0.1.2__tar.gz → 0.1.3__tar.gz

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 (21) hide show
  1. {agentcyberrange-0.1.2 → agentcyberrange-0.1.3}/PKG-INFO +6 -6
  2. {agentcyberrange-0.1.2 → agentcyberrange-0.1.3}/README.md +5 -5
  3. agentcyberrange-0.1.3/src/agentcyberrange/_version.py +1 -0
  4. {agentcyberrange-0.1.2 → agentcyberrange-0.1.3}/src/agentcyberrange/models.py +2 -1
  5. {agentcyberrange-0.1.2 → agentcyberrange-0.1.3}/src/agentcyberrange/runner.py +32 -14
  6. agentcyberrange-0.1.2/src/agentcyberrange/_version.py +0 -1
  7. {agentcyberrange-0.1.2 → agentcyberrange-0.1.3}/.gitignore +0 -0
  8. {agentcyberrange-0.1.2 → agentcyberrange-0.1.3}/LICENSE +0 -0
  9. {agentcyberrange-0.1.2 → agentcyberrange-0.1.3}/examples/codex_cli.py +0 -0
  10. {agentcyberrange-0.1.2 → agentcyberrange-0.1.3}/examples/manual_client.py +0 -0
  11. {agentcyberrange-0.1.2 → agentcyberrange-0.1.3}/examples/quickstart.py +0 -0
  12. {agentcyberrange-0.1.2 → agentcyberrange-0.1.3}/pyproject.toml +0 -0
  13. {agentcyberrange-0.1.2 → agentcyberrange-0.1.3}/src/agentcyberrange/__init__.py +0 -0
  14. {agentcyberrange-0.1.2 → agentcyberrange-0.1.3}/src/agentcyberrange/client.py +0 -0
  15. {agentcyberrange-0.1.2 → agentcyberrange-0.1.3}/src/agentcyberrange/errors.py +0 -0
  16. {agentcyberrange-0.1.2 → agentcyberrange-0.1.3}/src/agentcyberrange/handles.py +0 -0
  17. {agentcyberrange-0.1.2 → agentcyberrange-0.1.3}/src/agentcyberrange/py.typed +0 -0
  18. {agentcyberrange-0.1.2 → agentcyberrange-0.1.3}/src/agentcyberrange/scheduler.py +0 -0
  19. {agentcyberrange-0.1.2 → agentcyberrange-0.1.3}/src/agentcyberrange/state.py +0 -0
  20. {agentcyberrange-0.1.2 → agentcyberrange-0.1.3}/src/agentcyberrange/submission.py +0 -0
  21. {agentcyberrange-0.1.2 → agentcyberrange-0.1.3}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: agentcyberrange
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: Async Python SDK for Agent Cyber Range
5
5
  Author: Agent Cyber Range contributors
6
6
  License-Expression: MIT
@@ -113,14 +113,14 @@ Environment variables are reserved for connection configuration
113
113
  policy such as concurrency, Agent timeout, model, and permission mode stays explicit in
114
114
  Python arguments or CLI flags instead of hidden process-global configuration.
115
115
 
116
- When `agent_timeout` is omitted, the SDK uses a 30-minute Web (non-post) timeout or a
117
- 2-hour post timeout. Fleet gives both Challenge types a 24-hour Arena lease as the final
118
- resource deadline.
116
+ When `agent_timeout` is omitted, the SDK uses a 30-minute Web (non-post) default or a
117
+ 2-hour post default. These are defaults, not maximums; the server-provided Arena lease is
118
+ the final resource deadline.
119
119
 
120
120
  `agent_timeout` is an optional local limit in seconds. `run_agent()` applies an explicit
121
- value without the old Web/Post type-specific cap. For example, `agent_timeout=3600` runs
121
+ value instead of the default. For example, `agent_timeout=3600` runs
122
122
  both Web and post Agents for up to 60 minutes. The effective deadline is the earlier of
123
- this local limit and the Arena's 24-hour server lease. When the local timeout is reached,
123
+ this local limit and the Arena's `lease_expires_at`. When the local timeout is reached,
124
124
  the SDK signals `arena.cancel_event` and cancels the Agent callback. It then allows
125
125
  cancellation cleanup and Web output finalization for up to two minutes before submitting;
126
126
  submission happens sooner when cleanup finishes sooner. A post Challenge is submitted
@@ -86,14 +86,14 @@ Environment variables are reserved for connection configuration
86
86
  policy such as concurrency, Agent timeout, model, and permission mode stays explicit in
87
87
  Python arguments or CLI flags instead of hidden process-global configuration.
88
88
 
89
- When `agent_timeout` is omitted, the SDK uses a 30-minute Web (non-post) timeout or a
90
- 2-hour post timeout. Fleet gives both Challenge types a 24-hour Arena lease as the final
91
- resource deadline.
89
+ When `agent_timeout` is omitted, the SDK uses a 30-minute Web (non-post) default or a
90
+ 2-hour post default. These are defaults, not maximums; the server-provided Arena lease is
91
+ the final resource deadline.
92
92
 
93
93
  `agent_timeout` is an optional local limit in seconds. `run_agent()` applies an explicit
94
- value without the old Web/Post type-specific cap. For example, `agent_timeout=3600` runs
94
+ value instead of the default. For example, `agent_timeout=3600` runs
95
95
  both Web and post Agents for up to 60 minutes. The effective deadline is the earlier of
96
- this local limit and the Arena's 24-hour server lease. When the local timeout is reached,
96
+ this local limit and the Arena's `lease_expires_at`. When the local timeout is reached,
97
97
  the SDK signals `arena.cancel_event` and cancels the Agent callback. It then allows
98
98
  cancellation cleanup and Web output finalization for up to two minutes before submitting;
99
99
  submission happens sooner when cleanup finishes sooner. A post Challenge is submitted
@@ -0,0 +1 @@
1
+ __version__ = "0.1.3"
@@ -63,6 +63,7 @@ ArenaPollURL: TypeAlias = Annotated[
63
63
  SubmissionStatus: TypeAlias = Literal["scored", "close_pending", "closed"]
64
64
  AgentOutputPath: TypeAlias = str | PathLike[str]
65
65
  NonNegativeInt: TypeAlias = Annotated[StrictInt, Field(ge=0)]
66
+ PositiveInt: TypeAlias = Annotated[StrictInt, Field(gt=0)]
66
67
  Port: TypeAlias = Annotated[StrictInt, Field(ge=1, le=65535)]
67
68
  PositiveSeconds: TypeAlias = Annotated[float, Field(gt=0)]
68
69
 
@@ -82,7 +83,7 @@ class Capacity(SDKModel):
82
83
  total_nodes: NonNegativeInt
83
84
  available_nodes: NonNegativeInt
84
85
  active_arenas_for_token: NonNegativeInt
85
- lease_minutes: Literal[120]
86
+ lease_minutes: PositiveInt
86
87
  server_time: datetime
87
88
 
88
89
 
@@ -28,21 +28,39 @@ async def run_agent(
28
28
  on_event: EventHandler | None = None,
29
29
  arena_ready_delay: float = 0.0,
30
30
  ) -> ExecutionResult:
31
- """Run an Agent once against every available Challenge.
31
+ """Run an Agent once against every selected Challenge.
32
32
 
33
- Only the Agent callback is required. It may return a generated archive path for a
34
- non-post Challenge; when it returns ``None``, the Scheduler submits a minimal empty
35
- ``final_answer`` archive instead. Post Challenges are always submitted with an empty
36
- body. ``max_concurrency`` defaults to one. Agent callbacks default to a
37
- 30-minute Web timeout or a 2-hour post timeout. ``agent_timeout`` optionally sets one
38
- uniform limit for every selected Challenge without applying the old type-specific
39
- cap. The Arena's 24-hour server lease remains the final resource deadline.
40
- ``challenge_ids`` optionally selects an ordered subset. Connection settings default to
41
- ``AGENTCYBERRANGE_BASE_URL`` and ``AGENTCYBERRANGE_TASK_TOKEN``. Passing a client is
42
- primarily useful for embedding and testing; a caller-owned client is not closed by
43
- this function. ``on_event`` reports capacity waits and lifecycle failures without
44
- disabling automatic retries. ``arena_ready_delay`` optionally waits after Fleet
45
- reports an Arena as running before invoking the Agent callback.
33
+ Args:
34
+ agent: Async callback invoked with a ready Arena. Return a ``.tar.gz`` or
35
+ ``.zip`` output path for a non-post Challenge, or ``None`` to let the SDK
36
+ submit a minimal empty ``final_answer`` archive. Post Challenges are always
37
+ submitted with an empty body.
38
+ max_concurrency: Maximum number of Challenge Tasks active at once. Defaults to 1.
39
+ agent_timeout: Local Agent runtime limit in seconds for every selected Challenge.
40
+ When omitted, Web Challenges default to 30 minutes and post Challenges
41
+ default to 2 hours. These are defaults, not maximums: an explicit value may
42
+ be shorter or longer. The server-provided Arena lease remains the final
43
+ deadline.
44
+ challenge_ids: Ordered Challenge IDs to run. When omitted, all currently
45
+ available Challenges are selected.
46
+ base_url: Control-plane base URL. Defaults to ``AGENTCYBERRANGE_BASE_URL`` and
47
+ then ``https://eval.agentcyberrange.io/``.
48
+ task_token: Task Token used to authenticate. Defaults to
49
+ ``AGENTCYBERRANGE_TASK_TOKEN``.
50
+ client: Existing SDK client to use instead of constructing one. A caller-owned
51
+ client is not closed by this function.
52
+ retry_policy: Retry and capacity-wait settings. Defaults to ``RetryPolicy()``.
53
+ on_event: Optional callback for scheduler, capacity, and Arena lifecycle events.
54
+ arena_ready_delay: Seconds to wait after Fleet reports an Arena as running and
55
+ before invoking ``agent``. Defaults to 0.
56
+
57
+ Returns:
58
+ The terminal result for the complete execution.
59
+
60
+ Raises:
61
+ ValueError: A concurrency, timeout, Challenge selection, or delay argument is
62
+ invalid.
63
+ RuntimeError: Authentication configuration or the Challenge catalog is missing.
46
64
  """
47
65
  if max_concurrency < 1:
48
66
  raise ValueError("max_concurrency must be at least 1")
@@ -1 +0,0 @@
1
- __version__ = "0.1.2"
File without changes
File without changes