agentpools 0.1.9__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 (70) hide show
  1. agentpools-0.1.9/.github/workflows/ci.yml +124 -0
  2. agentpools-0.1.9/.github/workflows/release.yml +210 -0
  3. agentpools-0.1.9/.gitignore +15 -0
  4. agentpools-0.1.9/Cargo.lock +1147 -0
  5. agentpools-0.1.9/Cargo.toml +14 -0
  6. agentpools-0.1.9/LICENSE-MIT +21 -0
  7. agentpools-0.1.9/PKG-INFO +98 -0
  8. agentpools-0.1.9/README.md +199 -0
  9. agentpools-0.1.9/archive/lib.rs +882 -0
  10. agentpools-0.1.9/archive/task-path/README.md +5 -0
  11. agentpools-0.1.9/archive/task-path/error.rs +129 -0
  12. agentpools-0.1.9/archive/task-path/pool.rs +552 -0
  13. agentpools-0.1.9/archive/task-path/pool_tests.rs +427 -0
  14. agentpools-0.1.9/archive/task-path/task.rs +41 -0
  15. agentpools-0.1.9/bindings/python/Cargo.toml +17 -0
  16. agentpools-0.1.9/bindings/python/README.md +90 -0
  17. agentpools-0.1.9/bindings/python/src/lib.rs +195 -0
  18. agentpools-0.1.9/crates/README.md +52 -0
  19. agentpools-0.1.9/crates/agentpools-acp/Cargo.toml +35 -0
  20. agentpools-0.1.9/crates/agentpools-acp/README.md +132 -0
  21. agentpools-0.1.9/crates/agentpools-acp/examples/batch_add.rs +573 -0
  22. agentpools-0.1.9/crates/agentpools-acp/examples/batch_add_report.html +168 -0
  23. agentpools-0.1.9/crates/agentpools-acp/examples/codex.rs +51 -0
  24. agentpools-0.1.9/crates/agentpools-acp/src/interop.rs +315 -0
  25. agentpools-0.1.9/crates/agentpools-acp/src/lib.rs +589 -0
  26. agentpools-0.1.9/crates/agentpools-acp/src/shared_process.rs +706 -0
  27. agentpools-0.1.9/crates/agentpools-acp/src/transport.rs +56 -0
  28. agentpools-0.1.9/crates/agentpools-acp/tests/bin/mcp_add.rs +56 -0
  29. agentpools-0.1.9/crates/agentpools-acp/tests/bin/mock_agent.rs +300 -0
  30. agentpools-0.1.9/crates/agentpools-acp/tests/mcp.rs +34 -0
  31. agentpools-0.1.9/crates/agentpools-acp/tests/stdio.rs +547 -0
  32. agentpools-0.1.9/crates/agentpools-codex/Cargo.toml +14 -0
  33. agentpools-0.1.9/crates/agentpools-codex/README.md +73 -0
  34. agentpools-0.1.9/crates/agentpools-codex/src/lib.rs +551 -0
  35. agentpools-0.1.9/crates/agentpools-codex/src/shared.rs +560 -0
  36. agentpools-0.1.9/crates/agentpools-runtime/Cargo.toml +20 -0
  37. agentpools-0.1.9/crates/agentpools-runtime/README.md +119 -0
  38. agentpools-0.1.9/crates/agentpools-runtime/src/lib.rs +757 -0
  39. agentpools-0.1.9/crates/agentpools-runtime/src/mcp.rs +509 -0
  40. agentpools-0.1.9/crates/agentpools-runtime/src/process.rs +82 -0
  41. agentpools-0.1.9/crates/agentpools-runtime/tests/bin/mock_runtime.rs +93 -0
  42. agentpools-0.1.9/crates/agentpools-runtime/tests/native.rs +374 -0
  43. agentpools-0.1.9/crates/agentpools-transport/Cargo.toml +13 -0
  44. agentpools-0.1.9/crates/agentpools-transport/README.md +84 -0
  45. agentpools-0.1.9/crates/agentpools-transport/src/lib.rs +685 -0
  46. agentpools-0.1.9/docs/execution-modes-and-reports.md +79 -0
  47. agentpools-0.1.9/docs/language-api.md +77 -0
  48. agentpools-0.1.9/docs/multi-runtime-usage.md +169 -0
  49. agentpools-0.1.9/docs/npm-packaging-and-usage.md +243 -0
  50. agentpools-0.1.9/docs/release.md +57 -0
  51. agentpools-0.1.9/docs/runtime-architecture.md +101 -0
  52. agentpools-0.1.9/examples/mcp_passthrough.rs +67 -0
  53. agentpools-0.1.9/examples/measure_batch_add.ps1 +182 -0
  54. agentpools-0.1.9/examples/measure_batch_add.py +344 -0
  55. agentpools-0.1.9/examples/multiple_runtimes.rs +88 -0
  56. agentpools-0.1.9/pyproject.toml +15 -0
  57. agentpools-0.1.9/python/agentpools/__init__.py +82 -0
  58. agentpools-0.1.9/python/agentpools/__init__.pyi +16 -0
  59. agentpools-0.1.9/python/agentpools/_native.pyi +17 -0
  60. agentpools-0.1.9/python/agentpools/py.typed +0 -0
  61. agentpools-0.1.9/scripts/check_release_versions.py +63 -0
  62. agentpools-0.1.9/src/README.md +115 -0
  63. agentpools-0.1.9/src/activity.rs +87 -0
  64. agentpools-0.1.9/src/backend.rs +37 -0
  65. agentpools-0.1.9/src/cancellation.rs +16 -0
  66. agentpools-0.1.9/src/error.rs +110 -0
  67. agentpools-0.1.9/src/lease.rs +140 -0
  68. agentpools-0.1.9/src/lib.rs +21 -0
  69. agentpools-0.1.9/src/pool.rs +365 -0
  70. agentpools-0.1.9/tests/pool.rs +251 -0
@@ -0,0 +1,124 @@
1
+ name: Build and test
2
+
3
+ on:
4
+ push:
5
+ branches: [master, main]
6
+ pull_request:
7
+ workflow_call:
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ rust:
14
+ runs-on: ubuntu-24.04
15
+ steps:
16
+ - uses: actions/checkout@v7
17
+ - uses: dtolnay/rust-toolchain@stable
18
+ with:
19
+ components: clippy, rustfmt
20
+ - name: Check formatting
21
+ run: cargo fmt --all --check
22
+ - name: Test workspace
23
+ run: cargo test --workspace --all-features --locked
24
+ timeout-minutes: 15
25
+ - name: Lint workspace
26
+ run: cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
27
+
28
+ node:
29
+ name: Node ${{ matrix.target }}
30
+ runs-on: ${{ matrix.os }}
31
+ strategy:
32
+ fail-fast: false
33
+ matrix:
34
+ include:
35
+ - { os: windows-2025, target: x86_64-pc-windows-msvc }
36
+ - { os: ubuntu-24.04, target: x86_64-unknown-linux-gnu }
37
+ - { os: ubuntu-24.04-arm, target: aarch64-unknown-linux-gnu }
38
+ - { os: macos-15-intel, target: x86_64-apple-darwin }
39
+ - { os: macos-15, target: aarch64-apple-darwin }
40
+ defaults:
41
+ run:
42
+ shell: bash
43
+ steps:
44
+ - uses: actions/checkout@v7
45
+ - uses: dtolnay/rust-toolchain@stable
46
+ - uses: actions/setup-node@v7
47
+ with:
48
+ node-version: '22'
49
+ cache: npm
50
+ cache-dependency-path: bindings/node/package-lock.json
51
+ - name: Install Node dependencies
52
+ working-directory: bindings/node
53
+ run: npm ci
54
+ - name: Build mock agents and runtimes
55
+ run: |
56
+ cargo build -p agentpools-acp --features test-support --bin agentpools-acp-mock-agent --locked
57
+ cargo build -p agentpools-runtime --bin mock_runtime --locked
58
+ - name: Build native addon
59
+ working-directory: bindings/node
60
+ run: npm run build -- --target '${{ matrix.target }}'
61
+ - name: Test Node API with mock ACP and runtimes
62
+ working-directory: bindings/node
63
+ run: npm test
64
+ timeout-minutes: 15
65
+ - uses: actions/upload-artifact@v7
66
+ with:
67
+ name: node-${{ matrix.target }}
68
+ path: bindings/node/agentpools.*.node
69
+ if-no-files-found: error
70
+
71
+ python:
72
+ name: Python ${{ matrix.target }}
73
+ runs-on: ${{ matrix.os }}
74
+ strategy:
75
+ fail-fast: false
76
+ matrix:
77
+ include:
78
+ - { os: windows-2025, target: x86_64-pc-windows-msvc }
79
+ - { os: ubuntu-24.04, target: x86_64-unknown-linux-gnu }
80
+ - { os: ubuntu-24.04-arm, target: aarch64-unknown-linux-gnu }
81
+ - { os: macos-15-intel, target: x86_64-apple-darwin }
82
+ - { os: macos-15, target: aarch64-apple-darwin }
83
+ defaults:
84
+ run:
85
+ shell: bash
86
+ steps:
87
+ - uses: actions/checkout@v7
88
+ - uses: dtolnay/rust-toolchain@stable
89
+ - uses: actions/setup-python@v7
90
+ with:
91
+ python-version: '3.11'
92
+ - name: Build sdist
93
+ if: matrix.target == 'x86_64-unknown-linux-gnu'
94
+ uses: PyO3/maturin-action@v1
95
+ with:
96
+ working-directory: bindings/python
97
+ command: sdist
98
+ args: --out dist
99
+ - name: Build wheel
100
+ uses: PyO3/maturin-action@v1
101
+ with:
102
+ working-directory: bindings/python
103
+ target: ${{ matrix.target }}
104
+ manylinux: '2_28'
105
+ args: --release --locked --out dist
106
+ - name: Fix permissions
107
+ if: runner.os == 'Linux'
108
+ run: sudo chown -R $(id -u):$(id -g) bindings/python/dist || true
109
+ - name: Build mock agents and runtimes
110
+ run: |
111
+ cargo build -p agentpools-acp --features test-support --bin agentpools-acp-mock-agent --locked
112
+ cargo build -p agentpools-runtime --bin mock_runtime --locked
113
+ - name: Install built wheel
114
+ run: python -m pip install --no-deps bindings/python/dist/*.whl
115
+ - name: Test Python API with mock ACP and runtimes
116
+ run: python -m unittest discover -s bindings/python/test -v
117
+ timeout-minutes: 15
118
+ - uses: actions/upload-artifact@v7
119
+ with:
120
+ name: python-${{ matrix.target }}
121
+ path: |
122
+ bindings/python/dist/*.whl
123
+ bindings/python/dist/*.tar.gz
124
+ if-no-files-found: error
@@ -0,0 +1,210 @@
1
+ name: Prepare or publish release
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ version:
7
+ description: Version already set in every package manifest (for example 0.1.0)
8
+ required: true
9
+ type: string
10
+ publish:
11
+ description: Publish to crates.io, npm, and PyPI after all builds pass
12
+ required: true
13
+ default: false
14
+ type: boolean
15
+
16
+ permissions:
17
+ contents: read
18
+
19
+ jobs:
20
+ preflight:
21
+ runs-on: ubuntu-24.04
22
+ steps:
23
+ - uses: actions/checkout@v7
24
+ - uses: actions/setup-python@v7
25
+ with:
26
+ python-version: '3.11'
27
+ - name: Check package versions and publish ref
28
+ env:
29
+ RELEASE_VERSION: ${{ inputs.version }}
30
+ PUBLISH: ${{ inputs.publish }}
31
+ run: |
32
+ python scripts/check_release_versions.py "$RELEASE_VERSION"
33
+ if [[ "$PUBLISH" == 'true' && "$GITHUB_REF" != "refs/tags/v$RELEASE_VERSION" ]]; then
34
+ echo "Publishing requires running this workflow from tag v$RELEASE_VERSION" >&2
35
+ exit 1
36
+ fi
37
+ shell: bash
38
+
39
+ build:
40
+ needs: preflight
41
+ uses: ./.github/workflows/ci.yml
42
+
43
+ stage-npm:
44
+ needs: build
45
+ runs-on: ubuntu-24.04
46
+ defaults:
47
+ run:
48
+ working-directory: bindings/node
49
+ shell: bash
50
+ steps:
51
+ - uses: actions/checkout@v7
52
+ - uses: actions/setup-node@v7
53
+ with:
54
+ node-version: '22'
55
+ - name: Install packaging CLI
56
+ run: npm ci
57
+ - uses: actions/download-artifact@v8
58
+ with:
59
+ pattern: node-*
60
+ path: bindings/node/artifacts
61
+ merge-multiple: true
62
+ - name: Assemble platform packages
63
+ run: |
64
+ test "$(find artifacts -maxdepth 1 -name 'agentpools.*.node' | wc -l)" -eq 5
65
+ npm run release:collect
66
+ npm run release:prepare
67
+ mkdir -p dist
68
+ for package in npm/*; do
69
+ test -f "$package"/agentpools.*.node
70
+ (cd "$package" && npm pack --pack-destination ../../dist)
71
+ done
72
+ npm pack --pack-destination ./dist
73
+ test "$(find dist -maxdepth 1 -name '*.tgz' | wc -l)" -eq 6
74
+ - uses: actions/upload-artifact@v7
75
+ with:
76
+ name: release-npm
77
+ path: bindings/node/dist/*.tgz
78
+ if-no-files-found: error
79
+
80
+ stage-python:
81
+ needs: build
82
+ runs-on: ubuntu-24.04
83
+ steps:
84
+ - uses: actions/download-artifact@v8
85
+ with:
86
+ pattern: python-*
87
+ path: dist
88
+ merge-multiple: true
89
+ - name: Check wheel and sdist set
90
+ run: |
91
+ test "$(find dist -maxdepth 1 -name '*.whl' | wc -l)" -eq 5
92
+ test "$(find dist -maxdepth 1 -name '*.tar.gz' | wc -l)" -eq 1
93
+ - uses: actions/upload-artifact@v7
94
+ with:
95
+ name: release-python
96
+ path: |
97
+ dist/*.whl
98
+ dist/*.tar.gz
99
+ if-no-files-found: error
100
+
101
+ publish-cargo:
102
+ if: inputs.publish
103
+ continue-on-error: true
104
+ needs: [preflight, stage-npm, stage-python]
105
+ runs-on: ubuntu-24.04
106
+ environment: crates-io
107
+ steps:
108
+ - uses: actions/checkout@v7
109
+ - uses: dtolnay/rust-toolchain@stable
110
+ - name: Publish core crate
111
+ env:
112
+ CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
113
+ run: cargo publish -p agentpools --locked
114
+ - name: Wait for core crate to reach the index
115
+ env:
116
+ RELEASE_VERSION: ${{ inputs.version }}
117
+ run: |
118
+ for attempt in {1..20}; do
119
+ if cargo info "agentpools@$RELEASE_VERSION" >/dev/null 2>&1; then exit 0; fi
120
+ sleep 30
121
+ done
122
+ echo "agentpools $RELEASE_VERSION did not reach crates.io in time" >&2
123
+ exit 1
124
+ - name: Publish transport crate
125
+ env:
126
+ CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
127
+ run: cargo publish -p agentpools-transport --locked
128
+ - name: Wait for transport crate to reach the index
129
+ env:
130
+ RELEASE_VERSION: ${{ inputs.version }}
131
+ run: |
132
+ for attempt in {1..20}; do
133
+ if cargo info "agentpools-transport@$RELEASE_VERSION" >/dev/null 2>&1; then exit 0; fi
134
+ sleep 30
135
+ done
136
+ echo "agentpools-transport $RELEASE_VERSION did not reach crates.io in time" >&2
137
+ exit 1
138
+ - name: Publish ACP crate
139
+ env:
140
+ CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
141
+ run: cargo publish -p agentpools-acp --locked
142
+ - name: Wait for ACP crate to reach the index
143
+ env:
144
+ RELEASE_VERSION: ${{ inputs.version }}
145
+ run: |
146
+ for attempt in {1..20}; do
147
+ if cargo info "agentpools-acp@$RELEASE_VERSION" >/dev/null 2>&1; then exit 0; fi
148
+ sleep 30
149
+ done
150
+ echo "agentpools-acp $RELEASE_VERSION did not reach crates.io in time" >&2
151
+ exit 1
152
+ - name: Publish Codex crate
153
+ env:
154
+ CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
155
+ run: cargo publish -p agentpools-codex --locked
156
+ - name: Wait for Codex crate to reach the index
157
+ env:
158
+ RELEASE_VERSION: ${{ inputs.version }}
159
+ run: |
160
+ for attempt in {1..20}; do
161
+ if cargo info "agentpools-codex@$RELEASE_VERSION" >/dev/null 2>&1; then exit 0; fi
162
+ sleep 30
163
+ done
164
+ echo "agentpools-codex $RELEASE_VERSION did not reach crates.io in time" >&2
165
+ exit 1
166
+ - name: Publish Runtime crate
167
+ env:
168
+ CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
169
+ run: cargo publish -p agentpools-runtime --locked
170
+
171
+ publish-npm:
172
+ if: inputs.publish
173
+ needs: stage-npm
174
+ runs-on: ubuntu-24.04
175
+ environment: npm
176
+ steps:
177
+ - uses: actions/setup-node@v7
178
+ with:
179
+ node-version: '22'
180
+ registry-url: https://registry.npmjs.org
181
+ - uses: actions/download-artifact@v8
182
+ with:
183
+ name: release-npm
184
+ path: dist
185
+ - name: Publish platform packages, then root package
186
+ env:
187
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
188
+ RELEASE_VERSION: ${{ inputs.version }}
189
+ run: |
190
+ cd dist
191
+ for target in win32-x64-msvc linux-x64-gnu linux-arm64-gnu darwin-x64 darwin-arm64; do
192
+ npm publish "./agentpools-$target-$RELEASE_VERSION.tgz" --access public
193
+ done
194
+ npm publish "./agentpools-$RELEASE_VERSION.tgz" --access public
195
+ shell: bash
196
+
197
+ publish-pypi:
198
+ if: inputs.publish
199
+ continue-on-error: true
200
+ needs: stage-python
201
+ runs-on: ubuntu-24.04
202
+ environment: pypi
203
+ permissions:
204
+ id-token: write
205
+ steps:
206
+ - uses: actions/download-artifact@v8
207
+ with:
208
+ name: release-python
209
+ path: dist
210
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,15 @@
1
+ /target
2
+ **/node_modules
3
+ **/*.node
4
+ **/*.pyd
5
+ **/*.so
6
+ **/*.dylib
7
+ **/__pycache__
8
+ **/.venv
9
+ **/dist
10
+ **/wheels
11
+ /bindings/node/index.d.ts
12
+ /bindings/node/native.d.ts
13
+ /bindings/node/native.js
14
+ **/*.pdb
15
+