Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/ci-install-built-wheel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ jobs:
needs: test
uses: ./.github/workflows/release-rust-python-package.yaml
with:
tag: retry-with-backoff-v0.2.0
tag: retry-with-backoff-v0.2.1
repository: testpypi
publish_enabled: false
2 changes: 1 addition & 1 deletion .github/workflows/ci-rust-python-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,6 @@ jobs:
id-token: write
uses: ./.github/workflows/release-rust-python-package.yaml
with:
tag: retry-with-backoff-v0.2.0
tag: retry-with-backoff-v0.2.1
repository: testpypi
publish_enabled: false
14 changes: 14 additions & 0 deletions .github/workflows/ci-scaffold-generator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ jobs:
--description "CI scaffold default test plugin" \
--author "CI"

- name: Verify default plugin standalone CPEX imports
run: |
! grep -R "mcpgateway\.plugins\.framework\|from mcpgateway\|import mcpgateway\|mcpgateway\.plugins\|gateway\.plugins" plugins/rust/python-package/ci_scaffold_default
grep -R "cpex.framework" plugins/rust/python-package/ci_scaffold_default
grep -F '"cpex>=0.1.0rc1"' plugins/rust/python-package/ci_scaffold_default/pyproject.toml
python3 -m py_compile plugins/rust/python-package/ci_scaffold_default/cpex_ci_scaffold_default/ci_scaffold_default.py

- name: Sync default plugin
working-directory: plugins/rust/python-package/ci_scaffold_default
run: make sync
Expand All @@ -75,6 +82,13 @@ jobs:
--author "CI" \
--hooks prompt_pre_fetch,prompt_post_fetch,tool_pre_invoke,tool_post_invoke,resource_pre_fetch,resource_post_fetch,agent_pre_invoke,agent_post_invoke,http_pre_request,http_post_request,http_auth_resolve_user,http_auth_check_permission

- name: Verify all-hooks plugin standalone CPEX imports
run: |
! grep -R "mcpgateway\.plugins\.framework\|from mcpgateway\|import mcpgateway\|mcpgateway\.plugins\|gateway\.plugins" plugins/rust/python-package/ci_scaffold_all_hooks
grep -R "cpex.framework" plugins/rust/python-package/ci_scaffold_all_hooks
grep -F '"cpex>=0.1.0rc1"' plugins/rust/python-package/ci_scaffold_all_hooks/pyproject.toml
python3 -m py_compile plugins/rust/python-package/ci_scaffold_all_hooks/cpex_ci_scaffold_all_hooks/ci_scaffold_all_hooks.py

- name: Sync all-hooks plugin
working-directory: plugins/rust/python-package/ci_scaffold_all_hooks
run: make sync
Expand Down
16 changes: 15 additions & 1 deletion .github/workflows/release-rust-python-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ on:
options:
- testpypi
- pypi
allow_non_main_pypi:
description: "Allow PyPI publishing when the release tag is not on main"
required: false
default: false
type: boolean

permissions:
contents: read
Expand All @@ -47,6 +52,7 @@ jobs:
wheel_matrix: ${{ steps.resolve.outputs.wheel_matrix }}
publish_env: ${{ steps.resolve.outputs.publish_env }}
publish_enabled: ${{ steps.resolve.outputs.publish_enabled }}
allow_non_main_pypi: ${{ steps.resolve.outputs.allow_non_main_pypi }}
checkout_ref: ${{ steps.resolve.outputs.checkout_ref }}
tag_on_main: ${{ steps.resolve.outputs.tag_on_main }}
steps:
Expand All @@ -65,6 +71,7 @@ jobs:
TAG_INPUT: ${{ inputs.tag }}
REPOSITORY_INPUT: ${{ inputs.repository }}
PUBLISH_ENABLED: ${{ inputs.publish_enabled }}
ALLOW_NON_MAIN_PYPI: ${{ inputs.allow_non_main_pypi }}
run: |
set -euo pipefail
git fetch --force origin "refs/heads/main:refs/remotes/origin/main"
Expand Down Expand Up @@ -111,6 +118,11 @@ jobs:
echo "wheel_matrix=${wheel_matrix}"
echo "checkout_ref=${checkout_ref}"
echo "tag_on_main=${tag_on_main}"
if [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" && "${ALLOW_NON_MAIN_PYPI}" == "true" ]]; then
echo "allow_non_main_pypi=true"
else
echo "allow_non_main_pypi=false"
fi
if [[ "${PUBLISH_ENABLED}" == "false" ]]; then
echo "publish_enabled=false"
else
Expand Down Expand Up @@ -219,6 +231,7 @@ jobs:
cp -R "${GITHUB_WORKSPACE}/plugins/tests/${{ needs.resolve.outputs.slug }}" "${tmpdir}/tests/${{ needs.resolve.outputs.slug }}"
cp "${GITHUB_WORKSPACE}/plugins/tests/conftest.py" "${tmpdir}/tests/conftest.py"
cp "${GITHUB_WORKSPACE}/plugins/tests/plugin_hooks.py" "${tmpdir}/tests/plugin_hooks.py"
cp "${GITHUB_WORKSPACE}/plugins/tests/real_cpex_imports.py" "${tmpdir}/tests/real_cpex_imports.py"
cp "${GITHUB_WORKSPACE}/plugins/tests/pytest.ini" "${tmpdir}/pytest.ini"
cd "${tmpdir}"
export CPEX_TEST_PLUGIN_HOOKS=1
Expand Down Expand Up @@ -271,6 +284,7 @@ jobs:
cp -R "${GITHUB_WORKSPACE}/plugins/tests/${{ needs.resolve.outputs.slug }}" "${tmpdir}/tests/${{ needs.resolve.outputs.slug }}"
cp "${GITHUB_WORKSPACE}/plugins/tests/conftest.py" "${tmpdir}/tests/conftest.py"
cp "${GITHUB_WORKSPACE}/plugins/tests/plugin_hooks.py" "${tmpdir}/tests/plugin_hooks.py"
cp "${GITHUB_WORKSPACE}/plugins/tests/real_cpex_imports.py" "${tmpdir}/tests/real_cpex_imports.py"
cp "${GITHUB_WORKSPACE}/plugins/tests/pytest.ini" "${tmpdir}/pytest.ini"
cd "${tmpdir}"
export CPEX_TEST_PLUGIN_HOOKS=1
Expand All @@ -281,7 +295,7 @@ jobs:
fi

publish:
if: ${{ needs.resolve.outputs.publish_enabled == 'true' && (needs.resolve.outputs.publish_env != 'pypi' || needs.resolve.outputs.tag_on_main == 'true') }}
if: ${{ needs.resolve.outputs.publish_enabled == 'true' && (needs.resolve.outputs.publish_env != 'pypi' || needs.resolve.outputs.tag_on_main == 'true' || needs.resolve.outputs.allow_non_main_pypi == 'true') }}
needs: [resolve, build-wheel, build-sdist]
runs-on: ubuntu-latest
environment: ${{ needs.resolve.outputs.publish_env }}
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This is a monorepo of standalone plugin packages for the ContextForge Plugin Ext
- Plugins are Rust+Python (PyO3/maturin) or pure Python.
- Each plugin has its own `pyproject.toml`, `Cargo.toml`, `Makefile`, and `tests/`.
- Package names follow the pattern `cpex-<plugin-name>` (e.g., `cpex-rate-limiter`).
- `mcpgateway` is a runtime dependency provided by the host gateway — never declare it in `pyproject.toml`.
- `cpex` is the framework runtime dependency; declare it in plugin `pyproject.toml`.

## Build & Test

Expand Down
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/framework_bridge/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use pyo3::prelude::*;
use pyo3::types::{PyAny, PyDict, PyModule};

fn framework_class<'py>(py: Python<'py>, name: &str) -> PyResult<Bound<'py, PyAny>> {
PyModule::import(py, "mcpgateway.plugins.framework")?.getattr(name)
PyModule::import(py, "cpex.framework")?.getattr(name)
}

pub fn build_framework_object<'py, const N: usize>(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "encoded_exfil_detection"
version = "0.2.1"
version = "0.2.2"
edition.workspace = true
authors.workspace = true
license.workspace = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from pydantic import BaseModel, Field, field_validator

# First-Party
from mcpgateway.plugins.framework import (
from cpex.framework import (
Plugin,
PluginConfig,
PluginContext,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
description: "Detect suspicious encoded payload exfiltration patterns in prompts, tool outputs, and resources"
author: "ContextForge Contributors"
version: "0.2.1"
version: "0.2.2"
kind: "cpex_encoded_exfil_detection.encoded_exfil_detection.EncodedExfilDetectorPlugin"
available_hooks:
- "prompt_pre_fetch"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ license = { text = "Apache-2.0" }
readme = "README.md"
requires-python = ">=3.11"
dependencies = [
"cpex>=0.1.0rc1",
"pydantic>=2,<3",
]
classifiers = [
Expand Down
Loading
Loading