bma-executor-sdk 0.4.5__tar.gz → 0.4.6__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. {bma_executor_sdk-0.4.5 → bma_executor_sdk-0.4.6}/PKG-INFO +3 -3
  2. {bma_executor_sdk-0.4.5 → bma_executor_sdk-0.4.6}/README.md +2 -2
  3. {bma_executor_sdk-0.4.5 → bma_executor_sdk-0.4.6}/pyproject.toml +1 -1
  4. {bma_executor_sdk-0.4.5 → bma_executor_sdk-0.4.6}/src/bma_executor_sdk/transport.py +6 -5
  5. bma_executor_sdk-0.4.6/tests/test_close_codes.py +11 -0
  6. {bma_executor_sdk-0.4.5 → bma_executor_sdk-0.4.6}/.gitignore +0 -0
  7. {bma_executor_sdk-0.4.5 → bma_executor_sdk-0.4.6}/examples/agent_minimal.py +0 -0
  8. {bma_executor_sdk-0.4.5 → bma_executor_sdk-0.4.6}/examples/executor_minimal.py +0 -0
  9. {bma_executor_sdk-0.4.5 → bma_executor_sdk-0.4.6}/examples/harness_loopback.py +0 -0
  10. {bma_executor_sdk-0.4.5 → bma_executor_sdk-0.4.6}/src/bma_executor_sdk/__init__.py +0 -0
  11. {bma_executor_sdk-0.4.5 → bma_executor_sdk-0.4.6}/src/bma_executor_sdk/_rpc.py +0 -0
  12. {bma_executor_sdk-0.4.5 → bma_executor_sdk-0.4.6}/src/bma_executor_sdk/agent.py +0 -0
  13. {bma_executor_sdk-0.4.5 → bma_executor_sdk-0.4.6}/src/bma_executor_sdk/client.py +0 -0
  14. {bma_executor_sdk-0.4.5 → bma_executor_sdk-0.4.6}/src/bma_executor_sdk/generated.py +0 -0
  15. {bma_executor_sdk-0.4.5 → bma_executor_sdk-0.4.6}/src/bma_executor_sdk/harness.py +0 -0
  16. {bma_executor_sdk-0.4.5 → bma_executor_sdk-0.4.6}/tests/executor_helpers.py +0 -0
  17. {bma_executor_sdk-0.4.5 → bma_executor_sdk-0.4.6}/tests/test_executor_conformance.py +0 -0
  18. {bma_executor_sdk-0.4.5 → bma_executor_sdk-0.4.6}/tests/test_executor_contract.py +0 -0
  19. {bma_executor_sdk-0.4.5 → bma_executor_sdk-0.4.6}/tests/test_executor_interop.py +0 -0
  20. {bma_executor_sdk-0.4.5 → bma_executor_sdk-0.4.6}/tests/test_executor_runtime.py +0 -0
  21. {bma_executor_sdk-0.4.5 → bma_executor_sdk-0.4.6}/tests/test_executor_token_refresh.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: bma-executor-sdk
3
- Version: 0.4.5
3
+ Version: 0.4.6
4
4
  Summary: BMA executor protocol (bma.executor.v1.1): executor, harness and agent ends on asyncio with WebSocket, Unix socket and in-process transports.
5
5
  Project-URL: Repository, https://github.com/beeos-ai/bma-sdks
6
6
  License-Expression: Apache-2.0
@@ -17,13 +17,13 @@ asyncio executor (`ExecutorClient`), harness (`Harness`) and agent ends of the B
17
17
 
18
18
  | | |
19
19
  | --- | --- |
20
- | Version | 0.4.5 (tag `executor-python/v0.4.5`), see [CHANGELOG](../../CHANGELOG.md) |
20
+ | Version | 0.4.6 (tag `executor-python/v0.4.6`), see [CHANGELOG](../../CHANGELOG.md) |
21
21
  | Protocol | `bma.executor.v1.1` (contract 1.1.0, [`lock.json`](../../contracts/bma/executor/lock.json)) |
22
22
  | Python | 3.10 or newer; depends on `httpx` and `websockets` |
23
23
  | Integration guide | [docs/executor](../../docs/executor/README.md) ([中文](../../docs/executor/README.zh-CN.md)) |
24
24
 
25
25
  ```sh
26
- pip install bma-executor-sdk==0.4.5
26
+ pip install bma-executor-sdk==0.4.6
27
27
  ```
28
28
 
29
29
  The REST / façade client is the separate package [`bma-sdk`](../../python).
@@ -6,13 +6,13 @@ asyncio executor (`ExecutorClient`), harness (`Harness`) and agent ends of the B
6
6
 
7
7
  | | |
8
8
  | --- | --- |
9
- | Version | 0.4.5 (tag `executor-python/v0.4.5`), see [CHANGELOG](../../CHANGELOG.md) |
9
+ | Version | 0.4.6 (tag `executor-python/v0.4.6`), see [CHANGELOG](../../CHANGELOG.md) |
10
10
  | Protocol | `bma.executor.v1.1` (contract 1.1.0, [`lock.json`](../../contracts/bma/executor/lock.json)) |
11
11
  | Python | 3.10 or newer; depends on `httpx` and `websockets` |
12
12
  | Integration guide | [docs/executor](../../docs/executor/README.md) ([中文](../../docs/executor/README.zh-CN.md)) |
13
13
 
14
14
  ```sh
15
- pip install bma-executor-sdk==0.4.5
15
+ pip install bma-executor-sdk==0.4.6
16
16
  ```
17
17
 
18
18
  The REST / façade client is the separate package [`bma-sdk`](../../python).
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "bma-executor-sdk"
3
- version = "0.4.5"
3
+ version = "0.4.6"
4
4
  description = "BMA executor protocol (bma.executor.v1.1): executor, harness and agent ends on asyncio with WebSocket, Unix socket and in-process transports."
5
5
  readme = "README.md"
6
6
  license = "Apache-2.0"
@@ -21,10 +21,11 @@ from dataclasses import dataclass, field
21
21
  from typing import Protocol
22
22
  from urllib.parse import parse_qsl, urlencode, urlsplit
23
23
 
24
- # WebSocket close codes (executor.openrpc.yaml): 4001 token expired and 4005
25
- # drained reconnect with a fresh token; 4003 unsupported protocol and 4004
26
- # replaced by a newer connection stop the executor, as do 1008 policy
27
- # violation and 4002 forbidden.
24
+ # WebSocket close codes (executor.openrpc.yaml): only 4003 unsupported protocol
25
+ # and 4004 replaced by a newer connection stop the executor. Every other close,
26
+ # including 4001 token expired, 4002 machine runtime refused or ended (for
27
+ # example by a restarting server) and 4005 drained, reconnects with a fresh
28
+ # token.
28
29
  CLOSE_NORMAL = 1000
29
30
  CLOSE_POLICY_VIOLATION = 1008
30
31
  CLOSE_INTERNAL_ERROR = 1011
@@ -33,7 +34,7 @@ CLOSE_FORBIDDEN = 4002
33
34
  CLOSE_UNSUPPORTED_PROTOCOL = 4003
34
35
  CLOSE_REPLACED = 4004
35
36
  CLOSE_DRAINED = 4005
36
- TERMINAL_CLOSE_CODES = frozenset({CLOSE_POLICY_VIOLATION, CLOSE_FORBIDDEN, CLOSE_UNSUPPORTED_PROTOCOL, CLOSE_REPLACED})
37
+ TERMINAL_CLOSE_CODES = frozenset({CLOSE_UNSUPPORTED_PROTOCOL, CLOSE_REPLACED})
37
38
 
38
39
  MAX_FRAME_BYTES = 1 << 20
39
40
 
@@ -0,0 +1,11 @@
1
+ """Only the contract's stop codes end the client: 4003 unsupported protocol
2
+ and 4004 replaced. A restarting server (4002 runtime ended, 1001/1012/1013,
3
+ 4005 drained, 1008 policy) is reconnected."""
4
+
5
+ from __future__ import annotations
6
+
7
+ import bma_executor_sdk as bx
8
+
9
+
10
+ def test_only_4003_and_4004_are_terminal() -> None:
11
+ assert bx.TERMINAL_CLOSE_CODES == frozenset({4003, 4004})