forge-tool 2.0.0__tar.gz → 2.0.1__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.
- {forge_tool-2.0.0 → forge_tool-2.0.1}/PKG-INFO +13 -10
- {forge_tool-2.0.0 → forge_tool-2.0.1}/README.md +11 -8
- {forge_tool-2.0.0 → forge_tool-2.0.1}/pyproject.toml +2 -2
- {forge_tool-2.0.0 → forge_tool-2.0.1}/src/forge_tool/dora.py +3 -2
- {forge_tool-2.0.0 → forge_tool-2.0.1}/src/forge_tool/endpoint/models.py +11 -11
- {forge_tool-2.0.0 → forge_tool-2.0.1}/src/forge_tool/handler.py +2 -2
- {forge_tool-2.0.0 → forge_tool-2.0.1}/src/forge_tool/wire/envelope.py +2 -2
- {forge_tool-2.0.0 → forge_tool-2.0.1}/src/forge_tool/wire/messages.py +4 -2
- {forge_tool-2.0.0 → forge_tool-2.0.1}/LICENSE +0 -0
- {forge_tool-2.0.0 → forge_tool-2.0.1}/src/forge_tool/__init__.py +0 -0
- {forge_tool-2.0.0 → forge_tool-2.0.1}/src/forge_tool/endpoint/__init__.py +0 -0
- {forge_tool-2.0.0 → forge_tool-2.0.1}/src/forge_tool/endpoint/exceptions.py +0 -0
- {forge_tool-2.0.0 → forge_tool-2.0.1}/src/forge_tool/endpoint/protocol.py +0 -0
- {forge_tool-2.0.0 → forge_tool-2.0.1}/src/forge_tool/py.typed +0 -0
- {forge_tool-2.0.0 → forge_tool-2.0.1}/src/forge_tool/wire/__init__.py +0 -0
- {forge_tool-2.0.0 → forge_tool-2.0.1}/src/forge_tool/wire/codec.py +0 -0
- {forge_tool-2.0.0 → forge_tool-2.0.1}/src/forge_tool/wire/descriptor.py +0 -0
- {forge_tool-2.0.0 → forge_tool-2.0.1}/src/forge_tool/wire/errors.py +0 -0
- {forge_tool-2.0.0 → forge_tool-2.0.1}/src/forge_tool/wire/factories.py +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: forge-tool
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.1
|
|
4
4
|
Summary: Typed endpoint contracts for Forge query, action, and session tools.
|
|
5
5
|
Author: X-ERA
|
|
6
6
|
License-Expression: Apache-2.0
|
|
7
7
|
License-File: LICENSE
|
|
8
8
|
Requires-Dist: forge-msgs>=2.0.0,<3 ; extra == 'dora'
|
|
9
|
-
Requires-Python: >=3.
|
|
9
|
+
Requires-Python: >=3.11
|
|
10
10
|
Provides-Extra: dora
|
|
11
11
|
Description-Content-Type: text/markdown
|
|
12
12
|
|
|
@@ -46,7 +46,7 @@ handling therefore does not imply a complete caller-to-provider Action or Sessio
|
|
|
46
46
|
|
|
47
47
|
## Installation
|
|
48
48
|
|
|
49
|
-
Python 3.
|
|
49
|
+
Python 3.11 or newer is required. Install the current Tool release from PyPI:
|
|
50
50
|
|
|
51
51
|
```bash
|
|
52
52
|
pip install forge-tool
|
|
@@ -59,13 +59,16 @@ Dora-capable Operator or Adapter node:
|
|
|
59
59
|
pip install 'forge-tool[dora]'
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
The complete Forge source workspace still requires Python 3.12 or newer. From a
|
|
63
|
+
source checkout, run code through that workspace:
|
|
64
64
|
|
|
65
65
|
```bash
|
|
66
66
|
uv run python your_endpoint.py
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
+
For Python 3.11, install the standalone Tool distribution into a separate environment;
|
|
70
|
+
the workspace also includes packages that require Python 3.12.
|
|
71
|
+
|
|
69
72
|
The base package has no runtime dependencies. `import forge_tool` does not import
|
|
70
73
|
`forge_msgs` or PyArrow. The optional extra adds the carrier stack, not `dora-rs`; the
|
|
71
74
|
concrete node package remains responsible for its Dora dependency.
|
|
@@ -425,10 +428,10 @@ Explicitly import from `forge_tool.dora`:
|
|
|
425
428
|
|
|
426
429
|
## Protocol documentation
|
|
427
430
|
|
|
428
|
-
- [Tool documentation index](https://github.com/
|
|
429
|
-
- [Architecture](https://github.com/
|
|
430
|
-
- [ToolEndpoint Wire protocol](https://github.com/
|
|
431
|
-
- [Canonical `ToolMessage` Arrow schema](https://github.com/
|
|
431
|
+
- [Tool documentation index](https://github.com/PhyAgentOS/forge/blob/forge-tool-v2.0.1/interfaces/forge_tool/README.md)
|
|
432
|
+
- [Architecture](https://github.com/PhyAgentOS/forge/blob/forge-tool-v2.0.1/interfaces/forge_tool/ARCHITECTURE.md)
|
|
433
|
+
- [ToolEndpoint Wire protocol](https://github.com/PhyAgentOS/forge/blob/forge-tool-v2.0.1/interfaces/forge_tool/PROTOCOL.md)
|
|
434
|
+
- [Canonical `ToolMessage` Arrow schema](https://github.com/PhyAgentOS/forge/blob/forge-msgs-v2.1.0/interfaces/forge_msgs/tool.v1.yaml)
|
|
432
435
|
|
|
433
436
|
## Development
|
|
434
437
|
|
|
@@ -440,4 +443,4 @@ uv run pytest packages/tool/tests
|
|
|
440
443
|
|
|
441
444
|
## License
|
|
442
445
|
|
|
443
|
-
Apache-2.0. See the release [LICENSE](https://github.com/
|
|
446
|
+
Apache-2.0. See the release [LICENSE](https://github.com/PhyAgentOS/forge/blob/forge-tool-v2.0.1/LICENSE).
|
|
@@ -34,7 +34,7 @@ handling therefore does not imply a complete caller-to-provider Action or Sessio
|
|
|
34
34
|
|
|
35
35
|
## Installation
|
|
36
36
|
|
|
37
|
-
Python 3.
|
|
37
|
+
Python 3.11 or newer is required. Install the current Tool release from PyPI:
|
|
38
38
|
|
|
39
39
|
```bash
|
|
40
40
|
pip install forge-tool
|
|
@@ -47,13 +47,16 @@ Dora-capable Operator or Adapter node:
|
|
|
47
47
|
pip install 'forge-tool[dora]'
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
The complete Forge source workspace still requires Python 3.12 or newer. From a
|
|
51
|
+
source checkout, run code through that workspace:
|
|
52
52
|
|
|
53
53
|
```bash
|
|
54
54
|
uv run python your_endpoint.py
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
+
For Python 3.11, install the standalone Tool distribution into a separate environment;
|
|
58
|
+
the workspace also includes packages that require Python 3.12.
|
|
59
|
+
|
|
57
60
|
The base package has no runtime dependencies. `import forge_tool` does not import
|
|
58
61
|
`forge_msgs` or PyArrow. The optional extra adds the carrier stack, not `dora-rs`; the
|
|
59
62
|
concrete node package remains responsible for its Dora dependency.
|
|
@@ -413,10 +416,10 @@ Explicitly import from `forge_tool.dora`:
|
|
|
413
416
|
|
|
414
417
|
## Protocol documentation
|
|
415
418
|
|
|
416
|
-
- [Tool documentation index](https://github.com/
|
|
417
|
-
- [Architecture](https://github.com/
|
|
418
|
-
- [ToolEndpoint Wire protocol](https://github.com/
|
|
419
|
-
- [Canonical `ToolMessage` Arrow schema](https://github.com/
|
|
419
|
+
- [Tool documentation index](https://github.com/PhyAgentOS/forge/blob/forge-tool-v2.0.1/interfaces/forge_tool/README.md)
|
|
420
|
+
- [Architecture](https://github.com/PhyAgentOS/forge/blob/forge-tool-v2.0.1/interfaces/forge_tool/ARCHITECTURE.md)
|
|
421
|
+
- [ToolEndpoint Wire protocol](https://github.com/PhyAgentOS/forge/blob/forge-tool-v2.0.1/interfaces/forge_tool/PROTOCOL.md)
|
|
422
|
+
- [Canonical `ToolMessage` Arrow schema](https://github.com/PhyAgentOS/forge/blob/forge-msgs-v2.1.0/interfaces/forge_msgs/tool.v1.yaml)
|
|
420
423
|
|
|
421
424
|
## Development
|
|
422
425
|
|
|
@@ -428,4 +431,4 @@ uv run pytest packages/tool/tests
|
|
|
428
431
|
|
|
429
432
|
## License
|
|
430
433
|
|
|
431
|
-
Apache-2.0. See the release [LICENSE](https://github.com/
|
|
434
|
+
Apache-2.0. See the release [LICENSE](https://github.com/PhyAgentOS/forge/blob/forge-tool-v2.0.1/LICENSE).
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "forge-tool"
|
|
3
|
-
version = "2.0.
|
|
3
|
+
version = "2.0.1"
|
|
4
4
|
description = "Typed endpoint contracts for Forge query, action, and session tools."
|
|
5
5
|
readme = "README.md"
|
|
6
|
-
requires-python = ">=3.
|
|
6
|
+
requires-python = ">=3.11"
|
|
7
7
|
license = "Apache-2.0"
|
|
8
8
|
license-files = ["LICENSE"]
|
|
9
9
|
authors = [
|
|
@@ -5,6 +5,7 @@ from __future__ import annotations
|
|
|
5
5
|
import asyncio
|
|
6
6
|
import logging
|
|
7
7
|
from collections.abc import Awaitable, Callable
|
|
8
|
+
from typing import TypeAlias
|
|
8
9
|
|
|
9
10
|
import pyarrow as pa
|
|
10
11
|
from forge_msgs import ToolMessage, ToolMessageSizeError
|
|
@@ -26,8 +27,8 @@ _CORRELATED_ERROR_RESERVE_BYTES = 512
|
|
|
26
27
|
_MIN_BINDING_MESSAGE_BYTES = 1_024
|
|
27
28
|
_DEFAULT_CARRIER_OVERHEAD_BYTES = 65_536
|
|
28
29
|
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
_ToolArrowValue: TypeAlias = pa.RecordBatch | pa.Table | pa.StructArray
|
|
31
|
+
DoraEventSink: TypeAlias = Callable[[pa.RecordBatch], Awaitable[None]]
|
|
31
32
|
|
|
32
33
|
|
|
33
34
|
def _message_envelope(message: ToolMessage) -> ToolEnvelope:
|
|
@@ -5,12 +5,12 @@ from __future__ import annotations
|
|
|
5
5
|
import math
|
|
6
6
|
from collections.abc import Mapping
|
|
7
7
|
from dataclasses import dataclass, field
|
|
8
|
-
from typing import Any, Literal
|
|
8
|
+
from typing import Any, Literal, TypeAlias
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
ToolSemantics: TypeAlias = Literal["query", "action", "session"]
|
|
12
|
+
EndpointState: TypeAlias = Literal["ready", "busy", "degraded", "unavailable"]
|
|
13
|
+
ExecutionPhase: TypeAlias = Literal[
|
|
14
14
|
"accepted",
|
|
15
15
|
"running",
|
|
16
16
|
"stopping",
|
|
@@ -20,7 +20,7 @@ type ExecutionPhase = Literal[
|
|
|
20
20
|
"stopped",
|
|
21
21
|
"unknown",
|
|
22
22
|
]
|
|
23
|
-
|
|
23
|
+
ToolEventType: TypeAlias = Literal[
|
|
24
24
|
"progress",
|
|
25
25
|
"heartbeat",
|
|
26
26
|
"executor_completed",
|
|
@@ -28,18 +28,18 @@ type ToolEventType = Literal[
|
|
|
28
28
|
"cancelled",
|
|
29
29
|
"stopped",
|
|
30
30
|
]
|
|
31
|
-
|
|
31
|
+
ToolResultStatus: TypeAlias = Literal[
|
|
32
32
|
"succeeded",
|
|
33
33
|
"failed",
|
|
34
34
|
"cancelled",
|
|
35
35
|
"stopped",
|
|
36
36
|
"unknown",
|
|
37
37
|
]
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
ToolResultResponseStatus: TypeAlias = Literal["pending", "available", "not_found"]
|
|
39
|
+
ToolControlCommand: TypeAlias = Literal["cancel", "stop"]
|
|
40
|
+
EndpointRegistryOperation: TypeAlias = Literal["register", "unregister"]
|
|
41
|
+
EndpointRegistryResponseStatus: TypeAlias = Literal["accepted", "rejected"]
|
|
42
|
+
ToolControlStatus: TypeAlias = Literal[
|
|
43
43
|
"accepted",
|
|
44
44
|
"rejected",
|
|
45
45
|
"terminal",
|
|
@@ -6,7 +6,7 @@ import asyncio
|
|
|
6
6
|
from collections import OrderedDict
|
|
7
7
|
from collections.abc import Awaitable, Callable, Mapping
|
|
8
8
|
from dataclasses import dataclass, field
|
|
9
|
-
from typing import cast
|
|
9
|
+
from typing import TypeAlias, cast
|
|
10
10
|
|
|
11
11
|
from .endpoint import (
|
|
12
12
|
ActionToolEndpoint,
|
|
@@ -40,7 +40,7 @@ from .wire import (
|
|
|
40
40
|
validate_message_envelope,
|
|
41
41
|
)
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
ToolEventSink: TypeAlias = Callable[[ToolEnvelope], Awaitable[None]]
|
|
44
44
|
|
|
45
45
|
_REQUIRED_METHODS = {
|
|
46
46
|
"query": ("query",),
|
|
@@ -5,7 +5,7 @@ from __future__ import annotations
|
|
|
5
5
|
import math
|
|
6
6
|
from collections.abc import Mapping
|
|
7
7
|
from dataclasses import dataclass, field
|
|
8
|
-
from typing import Any, Literal
|
|
8
|
+
from typing import Any, Literal, TypeAlias
|
|
9
9
|
|
|
10
10
|
from .errors import ToolProtocolError
|
|
11
11
|
|
|
@@ -13,7 +13,7 @@ TOOL_ENDPOINT_PROTOCOL = "forge.tool.endpoint/v1alpha1"
|
|
|
13
13
|
MAX_SAFE_JSON_INTEGER = 9_007_199_254_740_991
|
|
14
14
|
MAX_JSON_DEPTH = 64
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
ToolMessageType: TypeAlias = Literal[
|
|
17
17
|
"endpoint.register",
|
|
18
18
|
"endpoint.unregister",
|
|
19
19
|
"endpoint.registry.response",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
from collections.abc import Mapping
|
|
6
|
-
from typing import Any, cast
|
|
6
|
+
from typing import Any, TypeVar, cast
|
|
7
7
|
|
|
8
8
|
from ..endpoint import (
|
|
9
9
|
EndpointRegistryResponse,
|
|
@@ -24,6 +24,8 @@ from .descriptor import validate_registration_envelope
|
|
|
24
24
|
from .envelope import ToolEnvelope, _is_blank, _json_value
|
|
25
25
|
from .errors import ToolProtocolError
|
|
26
26
|
|
|
27
|
+
_T = TypeVar("_T")
|
|
28
|
+
|
|
27
29
|
|
|
28
30
|
def _error(message: str, path: str) -> ToolProtocolError:
|
|
29
31
|
return ToolProtocolError(
|
|
@@ -59,7 +61,7 @@ def _fields(
|
|
|
59
61
|
raise _error("; ".join(details), path)
|
|
60
62
|
|
|
61
63
|
|
|
62
|
-
def _construct
|
|
64
|
+
def _construct(factory: type[_T], path: str, **values: Any) -> _T:
|
|
63
65
|
try:
|
|
64
66
|
return factory(**values)
|
|
65
67
|
except (TypeError, ValueError) as error:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|