Skip to content

Commit 8b09abd

Browse files
committed
fixing the merge conflcit
2 parents cdb7eac + 73e2dd9 commit 8b09abd

File tree

250 files changed

+3217
-11469
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

250 files changed

+3217
-11469
lines changed

.cursor/rules/40_temporal_and_agents.mdc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ Temporal integration:
1313
Agent framework:
1414

1515
- Agents are manifest-driven and support multiple agent types (sync and Temporal-based)
16-
- Use the examples under `examples/10_agentic/` and `examples/10_temporal/` for patterns
16+
- Use the examples under `examples/10_async/` and `examples/10_temporal/` for patterns
1717
- For debugging agents, use the CLI flags `--debug-worker` and `--debug-port`

.github/workflows/build-and-push-tutorial-agent.yml

Lines changed: 185 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,192 @@ name: Build and Push Tutorial Agent
33
on:
44
workflow_dispatch:
55
inputs:
6-
agent_path:
7-
description: "Path to the agent directory (e.g., examples/tutorials/10_agentic/00_base/000_hello_acp)"
8-
required: true
9-
type: string
10-
version_tag:
11-
description: "Version tag for the agent build (e.g., v1.0.0, latest)"
12-
required: true
13-
type: string
14-
default: "latest"
15-
16-
workflow_call:
17-
inputs:
18-
agent_path:
19-
description: "Path to the agent directory"
20-
required: true
21-
type: string
22-
version_tag:
23-
description: "Version tag for the agent build"
24-
required: true
25-
type: string
26-
default: "latest"
6+
rebuild_all:
7+
description: "Rebuild all tutorial agents regardless of changes, this is reserved for maintainers only."
8+
required: false
9+
type: boolean
10+
default: false
11+
12+
pull_request:
13+
paths:
14+
- "examples/tutorials/**"
15+
16+
push:
17+
branches:
18+
- main
19+
paths:
20+
- "examples/tutorials/**"
2721

2822
permissions:
2923
contents: read
3024
packages: write
25+
26+
jobs:
27+
check-permissions:
28+
if: ${{ github.event_name == 'workflow_dispatch' }}
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Check if user is maintainer
32+
uses: actions/github-script@v7
33+
with:
34+
script: |
35+
const { data: permission } = await github.rest.repos.getCollaboratorPermissionLevel({
36+
owner: context.repo.owner,
37+
repo: context.repo.repo,
38+
username: context.actor
39+
});
40+
41+
const allowedRoles = ['admin', 'maintain'];
42+
if (!allowedRoles.includes(permission.permission)) {
43+
throw new Error(`❌ User ${context.actor} does not have sufficient permissions. Required: ${allowedRoles.join(', ')}. Current: ${permission.permission}`);
44+
}
45+
46+
find-agents:
47+
runs-on: ubuntu-latest
48+
needs: [check-permissions]
49+
if: ${{ !cancelled() && !failure() }}
50+
outputs:
51+
agents: ${{ steps.get-agents.outputs.agents }}
52+
has_agents: ${{ steps.get-agents.outputs.has_agents }}
53+
steps:
54+
- name: Checkout repository
55+
uses: actions/checkout@v4
56+
with:
57+
fetch-depth: 0 # Fetch full history for git diff
58+
59+
- name: Find tutorial agents to build
60+
id: get-agents
61+
env:
62+
REBUILD_ALL: ${{ inputs.rebuild_all }}
63+
run: |
64+
# Find all tutorial directories with manifest.yaml
65+
all_agents=$(find examples/tutorials -name "manifest.yaml" -exec dirname {} \; | sort)
66+
agents_to_build=()
67+
68+
if [ "$REBUILD_ALL" = "true" ]; then
69+
echo "Rebuild all agents requested"
70+
agents_to_build=($(echo "$all_agents"))
71+
72+
echo "### 🔄 Rebuilding All Tutorial Agents" >> $GITHUB_STEP_SUMMARY
73+
else
74+
# Determine the base branch for comparison
75+
if [ "${{ github.event_name }}" = "pull_request" ]; then
76+
BASE_BRANCH="origin/${{ github.base_ref }}"
77+
echo "Comparing against PR base branch: $BASE_BRANCH"
78+
else
79+
BASE_BRANCH="HEAD~1"
80+
echo "Comparing against previous commit: $BASE_BRANCH"
81+
fi
82+
83+
# Check each agent directory for changes
84+
for agent_dir in $all_agents; do
85+
echo "Checking $agent_dir for changes..."
86+
87+
# Check if any files in this agent directory have changed
88+
if git diff --name-only $BASE_BRANCH HEAD | grep -q "^$agent_dir/"; then
89+
echo " ✅ Changes detected in $agent_dir"
90+
agents_to_build+=("$agent_dir")
91+
else
92+
echo " ⏭️ No changes in $agent_dir - skipping build"
93+
fi
94+
done
95+
96+
echo "### 🔄 Changed Tutorial Agents" >> $GITHUB_STEP_SUMMARY
97+
fi
98+
99+
# Convert array to JSON format and output summary
100+
if [ ${#agents_to_build[@]} -eq 0 ]; then
101+
echo "No agents to build"
102+
echo "agents=[]" >> $GITHUB_OUTPUT
103+
echo "has_agents=false" >> $GITHUB_OUTPUT
104+
else
105+
echo "Agents to build: ${#agents_to_build[@]}"
106+
agents_json=$(printf '%s\n' "${agents_to_build[@]}" | jq -R -s -c 'split("\n") | map(select(length > 0))')
107+
echo "agents=$agents_json" >> $GITHUB_OUTPUT
108+
echo "has_agents=true" >> $GITHUB_OUTPUT
109+
110+
echo "" >> $GITHUB_STEP_SUMMARY
111+
for agent in "${agents_to_build[@]}"; do
112+
echo "- \`$agent\`" >> $GITHUB_STEP_SUMMARY
113+
done
114+
echo "" >> $GITHUB_STEP_SUMMARY
115+
fi
116+
117+
build-agents:
118+
needs: find-agents
119+
if: ${{ needs.find-agents.outputs.has_agents == 'true' }}
120+
runs-on: ubuntu-latest
121+
timeout-minutes: 15
122+
strategy:
123+
matrix:
124+
agent_path: ${{ fromJson(needs.find-agents.outputs.agents) }}
125+
fail-fast: false
126+
127+
name: build-${{ matrix.agent_path }}
128+
steps:
129+
- name: Checkout repository
130+
uses: actions/checkout@v4
131+
132+
- name: Set up Docker Buildx
133+
uses: docker/setup-buildx-action@v3
134+
135+
- name: Set up Python
136+
uses: actions/setup-python@v4
137+
with:
138+
python-version: "3.12"
139+
140+
- name: Get latest agentex-sdk version from PyPI
141+
id: get-version
142+
run: |
143+
LATEST_VERSION=$(curl -s https://pypi.org/pypi/agentex-sdk/json | jq -r '.info.version')
144+
echo "Latest agentex-sdk version: $LATEST_VERSION"
145+
echo "AGENTEX_SDK_VERSION=$LATEST_VERSION" >> $GITHUB_ENV
146+
pip install agentex-sdk==$LATEST_VERSION
147+
echo "Installed agentex-sdk version $LATEST_VERSION"
148+
149+
- name: Generate Image name
150+
id: image-name
151+
run: |
152+
# Remove examples/tutorials/ prefix and replace / with -
153+
AGENT_NAME=$(echo "${{ matrix.agent_path }}" | sed 's|^examples/tutorials/||' | sed 's|/|-|g')
154+
echo "AGENT_NAME=$AGENT_NAME" >> $GITHUB_ENV
155+
echo "agent_name=$AGENT_NAME" >> $GITHUB_OUTPUT
156+
echo "Agent name set to $AGENT_NAME"
157+
158+
- name: Login to GitHub Container Registry
159+
# Only login if we're going to push (main branch or rebuild_all)
160+
if: ${{ github.event_name == 'push' || inputs.rebuild_all }}
161+
uses: docker/login-action@v3
162+
with:
163+
registry: ghcr.io
164+
username: ${{ github.actor }}
165+
password: ${{ secrets.GITHUB_TOKEN }}
166+
167+
- name: Build and Conditionally Push Agent Image
168+
env:
169+
REGISTRY: ghcr.io
170+
run: |
171+
AGENT_NAME="${{ steps.image-name.outputs.agent_name }}"
172+
REPOSITORY_NAME="${{ github.repository }}/tutorial-agents/${AGENT_NAME}"
173+
174+
# Determine if we should push based on event type
175+
if [ "${{ github.event_name }}" = "push" ] || [ "${{ inputs.rebuild_all }}" = "true" ]; then
176+
SHOULD_PUSH=true
177+
VERSION_TAG="latest"
178+
echo "🚀 Building and pushing agent: ${{ matrix.agent_path }}"
179+
else
180+
SHOULD_PUSH=false
181+
VERSION_TAG="${{ github.commit.sha }}"
182+
echo "🔍 Validating build for agent: ${{ matrix.agent_path }}"
183+
fi
184+
185+
# Build command - add --push only if we should push
186+
BUILD_ARGS="--manifest ${{ matrix.agent_path }}/manifest.yaml --registry ${REGISTRY} --tag ${VERSION_TAG} --platforms linux/amd64 --repository-name ${REPOSITORY_NAME}"
187+
188+
if [ "$SHOULD_PUSH" = "true" ]; then
189+
agentex agents build $BUILD_ARGS --push
190+
echo "✅ Successfully built and pushed: ${REGISTRY}/${REPOSITORY_NAME}:${VERSION_TAG}"
191+
else
192+
agentex agents build $BUILD_ARGS
193+
echo "✅ Build validation successful for: ${{ matrix.agent_path }}"
194+
fi

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.5.3"
2+
".": "0.6.5"
33
}

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 34
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sgp%2Fagentex-sdk-2b422fbf02ff3b77795fb8c71cbe784de3a3add48560655ba4fe7f3fcc509995.yml
3-
openapi_spec_hash: bca5c04d823694c87417dae188480291
4-
config_hash: 0197f86ba1a4b1b5ce813d0e62138588
1+
configured_endpoints: 36
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sgp%2Fagentex-sdk-17022011bf153e3ac9e20d23c5dca8a3072b0e735b47bb391b6e35b00348d5a5.yml
3+
openapi_spec_hash: 0927cdce49a6e6915d6060c2ab43b0d0
4+
config_hash: 758ca2ffe20517da913adf250c924c8a

CHANGELOG.md

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,47 @@
11
# Changelog
22

3+
## 0.6.5 (2025-11-06)
4+
5+
Full Changelog: [v0.6.4...v0.6.5](https://github.com/scaleapi/scale-agentex-python/compare/v0.6.4...v0.6.5)
6+
7+
## 0.6.4 (2025-11-06)
8+
9+
Full Changelog: [v0.6.3...v0.6.4](https://github.com/scaleapi/scale-agentex-python/compare/v0.6.3...v0.6.4)
10+
11+
## 0.6.3 (2025-11-06)
12+
13+
Full Changelog: [v0.6.2...v0.6.3](https://github.com/scaleapi/scale-agentex-python/compare/v0.6.2...v0.6.3)
14+
15+
## 0.6.2 (2025-11-05)
16+
17+
Full Changelog: [v0.6.1...v0.6.2](https://github.com/scaleapi/scale-agentex-python/compare/v0.6.1...v0.6.2)
18+
19+
### Features
20+
21+
* **api:** update via SDK Studio ([b732dfa](https://github.com/scaleapi/scale-agentex-python/commit/b732dfac50cacc90c84a751fd6c75d18fa5b43ed))
22+
23+
## 0.6.1 (2025-11-05)
24+
25+
Full Changelog: [v0.6.0...v0.6.1](https://github.com/scaleapi/scale-agentex-python/compare/v0.6.0...v0.6.1)
26+
27+
### Features
28+
29+
* **api:** api update ([f6189a4](https://github.com/scaleapi/scale-agentex-python/commit/f6189a43e1430fdd16c8d10e6ad835d9dfa5871c))
30+
* **api:** api update ([714c719](https://github.com/scaleapi/scale-agentex-python/commit/714c7194e488e6070c99e200b91189f50dcdb831))
31+
32+
## 0.6.0 (2025-11-04)
33+
34+
Full Changelog: [v0.5.3...v0.6.0](https://github.com/scaleapi/scale-agentex-python/compare/v0.5.3...v0.6.0)
35+
36+
### Features
37+
38+
* **api:** api update ([ec61dd3](https://github.com/scaleapi/scale-agentex-python/commit/ec61dd3124fbf169dcdcced262a30bfbed080b5f))
39+
40+
41+
### Chores
42+
43+
* **internal:** grammar fix (it's -> its) ([36e27da](https://github.com/scaleapi/scale-agentex-python/commit/36e27daed52435b300f090ac4643cd502a817a1e))
44+
345
## 0.5.3 (2025-10-31)
446

547
Full Changelog: [v0.5.2...v0.5.3](https://github.com/scaleapi/scale-agentex-python/compare/v0.5.2...v0.5.3)
@@ -179,7 +221,7 @@ Full Changelog: [v0.4.10...v0.4.11](https://github.com/scaleapi/agentex-python/c
179221

180222
### Bug Fixes
181223

182-
* Adding new example for guardrails instead of using 10_agentic ([15dc44b](https://github.com/scaleapi/agentex-python/commit/15dc44b333a977564c9974cc089d5ef578840714))
224+
* Adding new example for guardrails instead of using 10_async ([15dc44b](https://github.com/scaleapi/agentex-python/commit/15dc44b333a977564c9974cc089d5ef578840714))
183225
* avoid newer type syntax ([6b5c82a](https://github.com/scaleapi/agentex-python/commit/6b5c82aab9ebcf755575b641aced2b77a13a71c3))
184226

185227

api.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,3 +152,16 @@ Methods:
152152
- <code title="get /tracker/{tracker_id}">client.tracker.<a href="./src/agentex/resources/tracker.py">retrieve</a>(tracker_id) -> <a href="./src/agentex/types/agent_task_tracker.py">AgentTaskTracker</a></code>
153153
- <code title="put /tracker/{tracker_id}">client.tracker.<a href="./src/agentex/resources/tracker.py">update</a>(tracker_id, \*\*<a href="src/agentex/types/tracker_update_params.py">params</a>) -> <a href="./src/agentex/types/agent_task_tracker.py">AgentTaskTracker</a></code>
154154
- <code title="get /tracker">client.tracker.<a href="./src/agentex/resources/tracker.py">list</a>(\*\*<a href="src/agentex/types/tracker_list_params.py">params</a>) -> <a href="./src/agentex/types/tracker_list_response.py">TrackerListResponse</a></code>
155+
156+
# DeploymentHistory
157+
158+
Types:
159+
160+
```python
161+
from agentex.types import DeploymentHistory, DeploymentHistoryListResponse
162+
```
163+
164+
Methods:
165+
166+
- <code title="get /deployment-history/{deployment_id}">client.deployment_history.<a href="./src/agentex/resources/deployment_history.py">retrieve</a>(deployment_id) -> <a href="./src/agentex/types/deployment_history.py">DeploymentHistory</a></code>
167+
- <code title="get /deployment-history">client.deployment_history.<a href="./src/agentex/resources/deployment_history.py">list</a>(\*\*<a href="src/agentex/types/deployment_history_list_params.py">params</a>) -> <a href="./src/agentex/types/deployment_history_list_response.py">DeploymentHistoryListResponse</a></code>

examples/launch-tutorials.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ declare -a TUTORIALS=(
4141
"tutorials/00_sync/000_hello_acp|Basic Hello ACP (Sync)"
4242
"tutorials/00_sync/010_multiturn|Multi-turn Chat (Sync)"
4343
"tutorials/00_sync/020_streaming|Streaming Response (Sync)"
44-
"tutorials/10_agentic/00_base/000_hello_acp|Basic Hello ACP (Agentic)"
45-
"tutorials/10_agentic/00_base/010_multiturn|Multi-turn Chat (Agentic)"
46-
"tutorials/10_agentic/00_base/020_streaming|Streaming Response (Agentic)"
47-
"tutorials/10_agentic/00_base/030_tracing|Tracing Example (Agentic)"
48-
"tutorials/10_agentic/00_base/040_other_sdks|Other SDKs Integration (Agentic)"
49-
"tutorials/10_agentic/00_base/080_batch_events|Batch Events (Agentic)"
50-
"tutorials/10_agentic/10_temporal/000_hello_acp|Basic Hello ACP (Temporal)"
51-
"tutorials/10_agentic/10_temporal/010_agent_chat|Agent Chat (Temporal)"
52-
"tutorials/10_agentic/10_temporal/020_state_machine|State Machine (Temporal)"
44+
"tutorials/10_async/00_base/000_hello_acp|Basic Hello ACP (Async)"
45+
"tutorials/10_async/00_base/010_multiturn|Multi-turn Chat (Async)"
46+
"tutorials/10_async/00_base/020_streaming|Streaming Response (Async)"
47+
"tutorials/10_async/00_base/030_tracing|Tracing Example (Async)"
48+
"tutorials/10_async/00_base/040_other_sdks|Other SDKs Integration (Async)"
49+
"tutorials/10_async/00_base/080_batch_events|Batch Events (Async)"
50+
"tutorials/10_async/10_temporal/000_hello_acp|Basic Hello ACP (Temporal)"
51+
"tutorials/10_async/10_temporal/010_agent_chat|Agent Chat (Temporal)"
52+
"tutorials/10_async/10_temporal/020_state_machine|State Machine (Temporal)"
5353
)
5454

5555
# Function to print colored output
@@ -90,7 +90,7 @@ show_menu() {
9090
print_colored $GREEN " c. Clean up any orphaned tutorial processes"
9191
print_colored $GREEN " q. Quit"
9292
echo ""
93-
print_colored $YELLOW "📌 Note: The multi-agent system tutorial (tutorials/10_agentic/90_multi_agent_non_temporal) is excluded"
93+
print_colored $YELLOW "📌 Note: The multi-agent system tutorial (tutorials/10_async/90_multi_agent_non_temporal) is excluded"
9494
print_colored $YELLOW " as it has a special launch process. Use its own start-agents.sh script."
9595
echo ""
9696
}

examples/tutorials/00_sync/000_hello_acp/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ RUN uv pip install --system --upgrade pip setuptools wheel
2222

2323
ENV UV_HTTP_TIMEOUT=1000
2424

25+
2526
# Copy pyproject.toml and README.md to install dependencies
2627
COPY 000_hello_acp/pyproject.toml /app/000_hello_acp/pyproject.toml
2728
COPY 000_hello_acp/README.md /app/000_hello_acp/README.md
@@ -38,4 +39,4 @@ RUN uv pip install --system .
3839
ENV PYTHONPATH=/app
3940

4041
# Run the agent using uvicorn
41-
CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"]
42+
CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"]

examples/tutorials/00_sync/000_hello_acp/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The simplest agent type: synchronous request/response pattern with a single `@ac
66
## What You'll Learn
77
- Building a basic synchronous agent
88
- The `@acp.on_message_send` handler pattern
9-
- When to use sync vs agentic agents
9+
- When to use sync vs async agents
1010

1111
## Prerequisites
1212
- Development environment set up (see [main repo README](https://github.com/scaleapi/scale-agentex))
@@ -39,6 +39,6 @@ That's it - one handler, immediate response. No task creation, no state manageme
3939
- Operations that complete in under a second
4040

4141
## Why This Matters
42-
Sync agents are the simplest way to get started with AgentEx. They're perfect for learning the basics and building stateless agents. Once you need conversation memory or task tracking, you'll graduate to agentic agents.
42+
Sync agents are the simplest way to get started with AgentEx. They're perfect for learning the basics and building stateless agents. Once you need conversation memory or task tracking, you'll graduate to async agents.
4343

4444
**Next:** [010_multiturn](../010_multiturn/) - Add conversation memory to your agent

examples/tutorials/00_sync/000_hello_acp/manifest.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ agent:
6161

6262
# Type of ACP to use
6363
# sync: Simple synchronous ACP implementation
64-
# agentic: Advanced ACP with sub-types "base" or "temporal" (requires config)
64+
# async: Asynchronous, non-blocking ACP implementation
6565
acp_type: sync
6666

6767
# Description of what your agent does

0 commit comments

Comments
 (0)