Skip to content
Merged
Show file tree
Hide file tree
Changes from 60 commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
d766755
Add parser implementation
RadCod3 Feb 5, 2026
d9fb52f
Add validation to client auth
RadCod3 Feb 5, 2026
ecf2e60
Add agent runtime implementation
RadCod3 Feb 5, 2026
5aacd22
Add agent tests
RadCod3 Feb 5, 2026
90360be
Refactor schema validator and remove unused variables
RadCod3 Feb 5, 2026
59defb4
Add webchat interface support
RadCod3 Feb 5, 2026
00b598b
Add consolechat interface support
RadCod3 Feb 5, 2026
3c36657
Add webhook interface support
RadCod3 Feb 5, 2026
66e68b4
Add tests for interfaces
RadCod3 Feb 5, 2026
d2dfb1a
Add mcp tool support
RadCod3 Feb 5, 2026
3ae824f
Add mcp tests
RadCod3 Feb 5, 2026
2e7f1ad
Add cli script to run project
RadCod3 Feb 5, 2026
60a179e
Add cli invoke tests
RadCod3 Feb 5, 2026
bde8d3d
Suppress info logs from httpx and httpcore
RadCod3 Feb 6, 2026
ec503b5
Fix default webchat signature to align with spec
RadCod3 Feb 6, 2026
f50b493
Remove snapshot from default anthropic model
RadCod3 Feb 6, 2026
63ea9b0
Add webui for webchat interface
RadCod3 Feb 6, 2026
d6f0141
Fix test failure
RadCod3 Feb 6, 2026
1e6066a
Address review comments
RadCod3 Feb 6, 2026
68d6f48
Raise exception on secret resolution failure
RadCod3 Feb 6, 2026
40a99cc
Add exception chaining
RadCod3 Feb 6, 2026
a246dda
Escape chat path before substitution
RadCod3 Feb 6, 2026
0f9e51a
Use exact match for markdown sections
RadCod3 Feb 6, 2026
dd66b43
Fix anthropic model name
RadCod3 Feb 6, 2026
84d6d88
Raise OutputValidationError instead of AgentError
RadCod3 Feb 6, 2026
0850f68
Raise TemplateEvaluationError for invalid templates
RadCod3 Feb 6, 2026
903fcdf
Fix async lifecycle and blocking input issues
RadCod3 Feb 7, 2026
4b9bb03
Expose Agent signature via public property
RadCod3 Feb 7, 2026
5bc3d32
Prevent sensitive error details exposure in web chat
RadCod3 Feb 7, 2026
62eee56
Fix signature parsing for unknown algorithm prefixes
RadCod3 Feb 7, 2026
7f231ca
Add exception chaining and hide internal errors in webhook
RadCod3 Feb 7, 2026
bcccbad
Prevent hang when HTTP server fails to start
RadCod3 Feb 7, 2026
ec446e1
Check extra fields in JSON Schema for http vars
RadCod3 Feb 7, 2026
8d7e2eb
Improve console chat with proper TUI
RadCod3 Feb 7, 2026
afdfd2b
Remove incorrect type hint
RadCod3 Feb 7, 2026
a67f3ef
Raise JSONAccessError for empty field names in JSON paths
RadCod3 Feb 7, 2026
e4b3322
Fix fire-and-forget task for WebSub subscription
RadCod3 Feb 7, 2026
f56f157
Improve styling of TUI
RadCod3 Feb 7, 2026
c3a0a02
Merge branch 'feat/improve-tui' into feat/langchain-py
RadCod3 Feb 7, 2026
8397e0b
Upgrade dependencies
RadCod3 Feb 7, 2026
eaafb19
Fix websub subscription not working
RadCod3 Feb 7, 2026
75ef205
Remove the tool call fix that was needed before
RadCod3 Feb 7, 2026
d9bb051
Rename project to afm-cli for publishing
RadCod3 Feb 7, 2026
4072517
Remove unnecessary tests and update docstring
RadCod3 Feb 7, 2026
f98b050
Add readme and bump version
RadCod3 Feb 7, 2026
b4c991b
Add ci and docker workflow
RadCod3 Feb 8, 2026
8ae19f7
Fix dockerfile
RadCod3 Feb 8, 2026
c665eec
Remove verbose docstrings
RadCod3 Feb 8, 2026
7d9c568
Hide logs in consolechat and add log-file flag
RadCod3 Feb 8, 2026
302b37e
Refactor README and pyproject
RadCod3 Feb 8, 2026
e2a3603
Fix verification bypassing in webhook
RadCod3 Feb 8, 2026
ff42321
Address review comments
RadCod3 Feb 8, 2026
af61d42
Add missing import
RadCod3 Feb 9, 2026
97c9a27
Add review suggestions
RadCod3 Feb 9, 2026
d637d8a
Construct WebSub callback from CLI host/port
RadCod3 Feb 9, 2026
4c01440
Address code review comments
RadCod3 Feb 9, 2026
08ff44d
Pin uv version in dockerfile
RadCod3 Feb 9, 2026
87b6185
Address review comments on session history, WebSub etc.
RadCod3 Feb 9, 2026
d76f2e2
Update readme and workflows with langchain impl
RadCod3 Feb 9, 2026
22c23cb
Fix double-dot path handling in templates
RadCod3 Feb 9, 2026
6599d76
Remove pip and pipx instructions from README
RadCod3 Feb 9, 2026
e96b10c
Fix image vulnerabilities
RadCod3 Feb 9, 2026
3c03899
Remove deadcode and unnecessary docstrings
RadCod3 Feb 9, 2026
b493c19
Rename project to afm
RadCod3 Feb 9, 2026
e2000ce
Update langchain-interpreter/src/afm/__init__.py
RadCod3 Feb 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions .github/workflows/langchain-interpreter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: LangChain Interpreter CI

on:
push:
branches: [main, dev]
paths:
- "langchain-interpreter/**"
- ".github/workflows/langchain-interpreter.yml"
pull_request:
branches: [main, dev]
paths:
- "langchain-interpreter/**"
- ".github/workflows/langchain-interpreter.yml"

jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: langchain-interpreter

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true

- name: Install dependencies
run: uv sync --dev

- name: Run tests
run: uv run pytest

- name: Lint with ruff
run: uv run ruff check .

docker:
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
permissions:
packages: write
defaults:
run:
working-directory: langchain-interpreter

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Determine image name
id: meta
env:
OWNER: ${{ github.repository_owner }}
run: |
# GHCR requires lowercase repository names
OWNER_LOWER=$(echo "$OWNER" | tr '[:upper:]' '[:lower:]')
echo "image_name=ghcr.io/$OWNER_LOWER/afm-langchain-interpreter" >> $GITHUB_OUTPUT

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: langchain-interpreter
push: true
platforms: linux/amd64,linux/arm64
tags: |
${{ steps.meta.outputs.image_name }}:latest
${{ steps.meta.outputs.image_name }}:${{ github.sha }}
labels: |
org.opencontainers.image.source=https://github.com/${{ github.repository }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.title=AFM LangChain Interpreter
org.opencontainers.image.licenses=Apache-2.0
annotations: |
index:org.opencontainers.image.source=https://github.com/${{ github.repository }}
index:org.opencontainers.image.licenses=Apache-2.0
17 changes: 16 additions & 1 deletion .github/workflows/release-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ on:

env:
# Allowed implementations - update this list when adding new implementations
ALLOWED_IMPLEMENTATIONS: ballerina-interpreter
ALLOWED_IMPLEMENTATIONS: ballerina-interpreter langchain-interpreter

jobs:
release:
Expand Down Expand Up @@ -84,6 +84,21 @@ jobs:
bal build
bal test

- name: Install uv
if: inputs.implementation == 'langchain-interpreter'
uses: astral-sh/setup-uv@v5
with:
enable-cache: true

- name: Build and test (Python)
if: inputs.implementation == 'langchain-interpreter'
env:
IMPLEMENTATION: ${{ inputs.implementation }}
working-directory: ${{ inputs.implementation }}
run: |
uv sync --dev
uv run pytest

- name: Create release branch
env:
IMPLEMENTATION: ${{ inputs.implementation }}
Expand Down
28 changes: 23 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
type: choice
options:
- ballerina-interpreter
- langchain-interpreter
branch:
description: 'Branch to release from'
required: false
Expand Down Expand Up @@ -49,12 +50,22 @@ jobs:
env:
IMPLEMENTATION: ${{ inputs.implementation }}
run: |
# Read version from Ballerina.toml (first match is package version)
RELEASE_VERSION=$(grep '^version = ' "$IMPLEMENTATION/Ballerina.toml" | head -1 | sed 's/version = "\(.*\)"/\1/')
# Determine version file
if [ -f "$IMPLEMENTATION/Ballerina.toml" ]; then
VERSION_FILE="$IMPLEMENTATION/Ballerina.toml"
elif [ -f "$IMPLEMENTATION/pyproject.toml" ]; then
VERSION_FILE="$IMPLEMENTATION/pyproject.toml"
else
echo "::error::No version file found for implementation: $IMPLEMENTATION"
exit 1
fi

# Read version (first match is package version)
RELEASE_VERSION=$(grep '^version = ' "$VERSION_FILE" | head -1 | sed 's/version = "\(.*\)"/\1/')

# Validate version format
if [[ ! "$RELEASE_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "::error::Version in Ballerina.toml must be in format X.Y.Z, got: $RELEASE_VERSION"
echo "::error::Version in $VERSION_FILE must be in format X.Y.Z, got: $RELEASE_VERSION"
exit 1
fi

Expand Down Expand Up @@ -120,7 +131,14 @@ jobs:
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git pull origin "$BRANCH" --rebase
sed -i "s/^version = \".*\"/version = \"$NEXT_VERSION\"/" "$IMPLEMENTATION/Ballerina.toml"
git add "$IMPLEMENTATION/Ballerina.toml"
# Determine version file
if [ -f "$IMPLEMENTATION/Ballerina.toml" ]; then
VERSION_FILE="$IMPLEMENTATION/Ballerina.toml"
elif [ -f "$IMPLEMENTATION/pyproject.toml" ]; then
VERSION_FILE="$IMPLEMENTATION/pyproject.toml"
fi

sed -i "s/^version = \".*\"/version = \"$NEXT_VERSION\"/" "$VERSION_FILE"
git add "$VERSION_FILE"
Comment on lines +134 to +142
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Missing error handling when neither version file is found.

Unlike the validate step (lines 58–61), the bump-version step silently proceeds with an unset VERSION_FILE if neither Ballerina.toml nor pyproject.toml exists. This would cause sed and git add to receive an empty path argument, producing a confusing failure.

Proposed fix: add the same guard as the validate step
           # Determine version file
           if [ -f "$IMPLEMENTATION/Ballerina.toml" ]; then
             VERSION_FILE="$IMPLEMENTATION/Ballerina.toml"
           elif [ -f "$IMPLEMENTATION/pyproject.toml" ]; then
             VERSION_FILE="$IMPLEMENTATION/pyproject.toml"
+          else
+            echo "::error::No version file found for implementation: $IMPLEMENTATION"
+            exit 1
           fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Determine version file
if [ -f "$IMPLEMENTATION/Ballerina.toml" ]; then
VERSION_FILE="$IMPLEMENTATION/Ballerina.toml"
elif [ -f "$IMPLEMENTATION/pyproject.toml" ]; then
VERSION_FILE="$IMPLEMENTATION/pyproject.toml"
fi
sed -i "s/^version = \".*\"/version = \"$NEXT_VERSION\"/" "$VERSION_FILE"
git add "$VERSION_FILE"
# Determine version file
if [ -f "$IMPLEMENTATION/Ballerina.toml" ]; then
VERSION_FILE="$IMPLEMENTATION/Ballerina.toml"
elif [ -f "$IMPLEMENTATION/pyproject.toml" ]; then
VERSION_FILE="$IMPLEMENTATION/pyproject.toml"
else
echo "::error::No version file found for implementation: $IMPLEMENTATION"
exit 1
fi
sed -i "s/^version = \".*\"/version = \"$NEXT_VERSION\"/" "$VERSION_FILE"
git add "$VERSION_FILE"
🤖 Prompt for AI Agents
In @.github/workflows/release.yml around lines 134 - 142, The bump-version step
can proceed with an empty VERSION_FILE if neither Ballerina.toml nor
pyproject.toml exists; add the same guard used in the validate step: after the
if/elif that sets VERSION_FILE, check that VERSION_FILE is non-empty and, if it
is empty, print a clear error message mentioning IMPLEMENTATION and NEXT_VERSION
and exit with a non-zero status so sed and git add are not called with an empty
path; update the bump-version step to fail-fast when VERSION_FILE is unset.

git commit -m "Bump $IMPLEMENTATION version to $NEXT_VERSION"
git push origin "$BRANCH"
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ Reference implementations for [Agent-Flavored Markdown (AFM)](https://wso2.githu
| Implementation | Language/Framework | Status |
|----------------|-------------------|--------|
| [ballerina-interpreter](./ballerina-interpreter) | Ballerina | Active |
| langchain-interpreter | Python/LangChain | Planned |
| [langchain-interpreter](./langchain-interpreter) | Python/LangChain | Active |

## Repository Structure

```
reference-implementations-afm/
├── ballerina-interpreter/ # Ballerina-based AFM interpreter
├── langchain-interpreter/ # LangChain-based AFM interpreter
└── .github/workflows/ # CI/CD (path-filtered per implementation)
```

Expand Down
12 changes: 12 additions & 0 deletions langchain-interpreter/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.venv
.git
.github
__pycache__
*.pyc
.pytest_cache
.coverage
htmlcov
.env
dist
build
*.egg-info
Loading