agentbuildkit 0.1.0__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 (126) hide show
  1. agentbuildkit-0.1.0/.cursor/rules/agent-framework.mdc +25 -0
  2. agentbuildkit-0.1.0/.cursor/rules/python-quality.mdc +17 -0
  3. agentbuildkit-0.1.0/.cursor/rules/secrets-and-side-effects.mdc +22 -0
  4. agentbuildkit-0.1.0/.dockerignore +21 -0
  5. agentbuildkit-0.1.0/.env.example +32 -0
  6. agentbuildkit-0.1.0/.github/SECURITY.md +7 -0
  7. agentbuildkit-0.1.0/.github/workflows/ci.yml +33 -0
  8. agentbuildkit-0.1.0/.github/workflows/release.yml +43 -0
  9. agentbuildkit-0.1.0/.gitignore +29 -0
  10. agentbuildkit-0.1.0/.python-version +1 -0
  11. agentbuildkit-0.1.0/AGENTS.md +37 -0
  12. agentbuildkit-0.1.0/CHANGELOG.md +32 -0
  13. agentbuildkit-0.1.0/CONTRIBUTING.md +31 -0
  14. agentbuildkit-0.1.0/Dockerfile +47 -0
  15. agentbuildkit-0.1.0/LICENSE +202 -0
  16. agentbuildkit-0.1.0/PKG-INFO +166 -0
  17. agentbuildkit-0.1.0/README.md +137 -0
  18. agentbuildkit-0.1.0/docs/architecture.md +153 -0
  19. agentbuildkit-0.1.0/docs/deployment.md +80 -0
  20. agentbuildkit-0.1.0/examples/customer_service/README.md +40 -0
  21. agentbuildkit-0.1.0/examples/customer_service/__init__.py +33 -0
  22. agentbuildkit-0.1.0/examples/customer_service/__main__.py +6 -0
  23. agentbuildkit-0.1.0/examples/customer_service/business.py +181 -0
  24. agentbuildkit-0.1.0/examples/customer_service/cli.py +281 -0
  25. agentbuildkit-0.1.0/examples/customer_service/evaluation.py +545 -0
  26. agentbuildkit-0.1.0/examples/customer_service/health.py +35 -0
  27. agentbuildkit-0.1.0/examples/customer_service/models.py +113 -0
  28. agentbuildkit-0.1.0/examples/customer_service/service.py +236 -0
  29. agentbuildkit-0.1.0/examples/customer_service/team.py +222 -0
  30. agentbuildkit-0.1.0/npm/agentbuildkit/.gitignore +1 -0
  31. agentbuildkit-0.1.0/npm/agentbuildkit/.npmignore +8 -0
  32. agentbuildkit-0.1.0/npm/agentbuildkit/LICENSE +202 -0
  33. agentbuildkit-0.1.0/npm/agentbuildkit/README.md +61 -0
  34. agentbuildkit-0.1.0/npm/agentbuildkit/bin/agentbuildkit.js +15 -0
  35. agentbuildkit-0.1.0/npm/agentbuildkit/package-lock.json +18 -0
  36. agentbuildkit-0.1.0/npm/agentbuildkit/package.json +33 -0
  37. agentbuildkit-0.1.0/npm/agentbuildkit/src/cli.js +223 -0
  38. agentbuildkit-0.1.0/npm/agentbuildkit/src/commands.js +65 -0
  39. agentbuildkit-0.1.0/npm/agentbuildkit/src/errors.js +10 -0
  40. agentbuildkit-0.1.0/npm/agentbuildkit/src/installer.js +80 -0
  41. agentbuildkit-0.1.0/npm/agentbuildkit/src/platform.js +31 -0
  42. agentbuildkit-0.1.0/npm/agentbuildkit/src/prompt.js +41 -0
  43. agentbuildkit-0.1.0/npm/agentbuildkit/src/source.js +85 -0
  44. agentbuildkit-0.1.0/npm/agentbuildkit/src/uv.js +95 -0
  45. agentbuildkit-0.1.0/npm/agentbuildkit/test/cli.test.js +42 -0
  46. agentbuildkit-0.1.0/npm/agentbuildkit/test/installer.test.js +395 -0
  47. agentbuildkit-0.1.0/npm/agentbuildkit/test/platform.test.js +25 -0
  48. agentbuildkit-0.1.0/pyproject.toml +89 -0
  49. agentbuildkit-0.1.0/src/agentbuildkit/__init__.py +7 -0
  50. agentbuildkit-0.1.0/src/agentbuildkit/__main__.py +6 -0
  51. agentbuildkit-0.1.0/src/agentbuildkit/agents/__init__.py +21 -0
  52. agentbuildkit-0.1.0/src/agentbuildkit/agents/boundary.py +350 -0
  53. agentbuildkit-0.1.0/src/agentbuildkit/cli.py +140 -0
  54. agentbuildkit-0.1.0/src/agentbuildkit/config/__init__.py +23 -0
  55. agentbuildkit-0.1.0/src/agentbuildkit/config/settings.py +112 -0
  56. agentbuildkit-0.1.0/src/agentbuildkit/demo/__init__.py +9 -0
  57. agentbuildkit-0.1.0/src/agentbuildkit/demo/models.py +61 -0
  58. agentbuildkit-0.1.0/src/agentbuildkit/demo/present.py +79 -0
  59. agentbuildkit-0.1.0/src/agentbuildkit/demo/scenario.py +554 -0
  60. agentbuildkit-0.1.0/src/agentbuildkit/evaluation/__init__.py +35 -0
  61. agentbuildkit-0.1.0/src/agentbuildkit/evaluation/assertions.py +224 -0
  62. agentbuildkit-0.1.0/src/agentbuildkit/evaluation/models.py +142 -0
  63. agentbuildkit-0.1.0/src/agentbuildkit/evaluation/runner.py +165 -0
  64. agentbuildkit-0.1.0/src/agentbuildkit/evaluation/trace.py +46 -0
  65. agentbuildkit-0.1.0/src/agentbuildkit/external_execution/__init__.py +98 -0
  66. agentbuildkit-0.1.0/src/agentbuildkit/external_execution/binding.py +756 -0
  67. agentbuildkit-0.1.0/src/agentbuildkit/external_execution/models.py +171 -0
  68. agentbuildkit-0.1.0/src/agentbuildkit/external_execution/provider.py +184 -0
  69. agentbuildkit-0.1.0/src/agentbuildkit/external_execution/service.py +787 -0
  70. agentbuildkit-0.1.0/src/agentbuildkit/guardrails/__init__.py +27 -0
  71. agentbuildkit-0.1.0/src/agentbuildkit/guardrails/approval.py +500 -0
  72. agentbuildkit-0.1.0/src/agentbuildkit/integrations/__init__.py +100 -0
  73. agentbuildkit-0.1.0/src/agentbuildkit/integrations/cursor.py +394 -0
  74. agentbuildkit-0.1.0/src/agentbuildkit/integrations/github.py +1165 -0
  75. agentbuildkit-0.1.0/src/agentbuildkit/integrations/http.py +366 -0
  76. agentbuildkit-0.1.0/src/agentbuildkit/mcp/__init__.py +25 -0
  77. agentbuildkit-0.1.0/src/agentbuildkit/mcp/registry.py +282 -0
  78. agentbuildkit-0.1.0/src/agentbuildkit/observability/__init__.py +27 -0
  79. agentbuildkit-0.1.0/src/agentbuildkit/observability/audit.py +121 -0
  80. agentbuildkit-0.1.0/src/agentbuildkit/observability/correlation.py +23 -0
  81. agentbuildkit-0.1.0/src/agentbuildkit/observability/telemetry.py +50 -0
  82. agentbuildkit-0.1.0/src/agentbuildkit/orchestrations/__init__.py +24 -0
  83. agentbuildkit-0.1.0/src/agentbuildkit/providers/__init__.py +38 -0
  84. agentbuildkit-0.1.0/src/agentbuildkit/providers/anthropic.py +60 -0
  85. agentbuildkit-0.1.0/src/agentbuildkit/providers/base.py +59 -0
  86. agentbuildkit-0.1.0/src/agentbuildkit/providers/openai.py +48 -0
  87. agentbuildkit-0.1.0/src/agentbuildkit/providers/registry.py +42 -0
  88. agentbuildkit-0.1.0/src/agentbuildkit/py.typed +0 -0
  89. agentbuildkit-0.1.0/src/agentbuildkit/runtime.py +39 -0
  90. agentbuildkit-0.1.0/src/agentbuildkit/state/__init__.py +91 -0
  91. agentbuildkit-0.1.0/src/agentbuildkit/state/api.py +641 -0
  92. agentbuildkit-0.1.0/src/agentbuildkit/state/github.py +1419 -0
  93. agentbuildkit-0.1.0/src/agentbuildkit/state/models.py +886 -0
  94. agentbuildkit-0.1.0/src/agentbuildkit/state/registry.py +3721 -0
  95. agentbuildkit-0.1.0/src/agentbuildkit/testing/__init__.py +5 -0
  96. agentbuildkit-0.1.0/src/agentbuildkit/testing/scripted_chat.py +107 -0
  97. agentbuildkit-0.1.0/src/agentbuildkit/workflows/__init__.py +107 -0
  98. agentbuildkit-0.1.0/src/agentbuildkit/workflows/nesting.py +175 -0
  99. agentbuildkit-0.1.0/src/agentbuildkit/workflows/patterns.py +229 -0
  100. agentbuildkit-0.1.0/src/agentbuildkit/workflows/persistence.py +1032 -0
  101. agentbuildkit-0.1.0/src/agentbuildkit/workflows/runtime.py +457 -0
  102. agentbuildkit-0.1.0/tests/evaluation/README.md +3 -0
  103. agentbuildkit-0.1.0/tests/integration/README.md +3 -0
  104. agentbuildkit-0.1.0/tests/integration/test_cursor_cloud.py +16 -0
  105. agentbuildkit-0.1.0/tests/unit/test_agents.py +400 -0
  106. agentbuildkit-0.1.0/tests/unit/test_approval.py +197 -0
  107. agentbuildkit-0.1.0/tests/unit/test_cli.py +356 -0
  108. agentbuildkit-0.1.0/tests/unit/test_evaluation.py +292 -0
  109. agentbuildkit-0.1.0/tests/unit/test_external_execution.py +856 -0
  110. agentbuildkit-0.1.0/tests/unit/test_github.py +987 -0
  111. agentbuildkit-0.1.0/tests/unit/test_grants.py +360 -0
  112. agentbuildkit-0.1.0/tests/unit/test_http.py +349 -0
  113. agentbuildkit-0.1.0/tests/unit/test_mcp.py +200 -0
  114. agentbuildkit-0.1.0/tests/unit/test_nesting.py +350 -0
  115. agentbuildkit-0.1.0/tests/unit/test_observability.py +55 -0
  116. agentbuildkit-0.1.0/tests/unit/test_organisation.py +207 -0
  117. agentbuildkit-0.1.0/tests/unit/test_organisation_cli.py +284 -0
  118. agentbuildkit-0.1.0/tests/unit/test_packaging.py +22 -0
  119. agentbuildkit-0.1.0/tests/unit/test_persistence.py +295 -0
  120. agentbuildkit-0.1.0/tests/unit/test_providers.py +526 -0
  121. agentbuildkit-0.1.0/tests/unit/test_scripted_chat.py +43 -0
  122. agentbuildkit-0.1.0/tests/unit/test_settings.py +106 -0
  123. agentbuildkit-0.1.0/tests/unit/test_skeleton.py +32 -0
  124. agentbuildkit-0.1.0/tests/unit/test_state.py +636 -0
  125. agentbuildkit-0.1.0/tests/unit/test_workflows.py +593 -0
  126. agentbuildkit-0.1.0/uv.lock +2460 -0
@@ -0,0 +1,25 @@
1
+ ---
2
+ description: Microsoft Agent Framework is the only agent framework for this repository
3
+ alwaysApply: true
4
+ ---
5
+
6
+ # Agent Framework
7
+
8
+ Microsoft Agent Framework 1.x is the agent framework for this repository.
9
+
10
+ - Build agents with `agent_framework.Agent`. Each agent declares its provider and model. Inject the chat client. The OpenAI provider constructs `OpenAIChatClient`. The Anthropic provider constructs `AnthropicClient`.
11
+ - Compose explicit flows with `WorkflowBuilder`. Use `SequentialBuilder`, `ConcurrentBuilder`, `HandoffBuilder`, `GroupChatBuilder`, or `MagenticBuilder` when one of those patterns matches the task.
12
+ - Put reusable harness code in `src/agentbuildkit`. Put the customer-service demonstration in `examples/customer_service`.
13
+ - Use a Pydantic model for agent and workflow inputs and outputs.
14
+ - Use ordinary Python for routing, validation, and aggregation when the step does not need model judgment.
15
+
16
+ ```python
17
+ from pydantic import BaseModel
18
+
19
+
20
+ class TaskResult(BaseModel):
21
+ summary: str
22
+ confidence: float
23
+ ```
24
+
25
+ Leave AutoGen, Semantic Kernel, and the experimental `@workflow` API out of this repository. Keep Microsoft Foundry in the optional `foundry` extra.
@@ -0,0 +1,17 @@
1
+ ---
2
+ description: Python 3.12 quality bar for new code
3
+ globs: "**/*.py"
4
+ alwaysApply: false
5
+ ---
6
+
7
+ # Python quality
8
+
9
+ - Target Python 3.12. Annotate public functions.
10
+ - New behaviour ships with a test that passes without a live model.
11
+ - Mark tests that call a model or external service with `@pytest.mark.integration`.
12
+ - Run `uv run ruff check .`, `uv run ruff format --check .`, `uv run pyright`, and `uv run pytest` before handing work back.
13
+
14
+ ```python
15
+ def test_route_selects_research() -> None:
16
+ assert route("find sources") == "research"
17
+ ```
@@ -0,0 +1,22 @@
1
+ ---
2
+ description: Secrets, side effects, and audit requirements
3
+ alwaysApply: true
4
+ ---
5
+
6
+ # Secrets and side effects
7
+
8
+ - Never commit secrets. `.env` stays local. Update `.env.example` with empty placeholders when a new setting is added.
9
+ - Read credentials through settings loading. Call `SecretString.get_secret_value()` only where a client constructor needs a string.
10
+ - Do not log, print, or put secrets in tool arguments or traces.
11
+ - Side-effecting tools and external API writes require an allowlist entry and human approval before they run.
12
+ - Record an audit event for agent runs, tool calls, and approval decisions. Leave sensitive prompt and tool payloads out of exported telemetry.
13
+
14
+ ```python
15
+ from agent_framework import tool
16
+
17
+
18
+ @tool(approval_mode="always_require")
19
+ def send_message(recipient: str, body: str) -> str:
20
+ """Send a message. This tool must not run until a person approves the call."""
21
+ raise NotImplementedError
22
+ ```
@@ -0,0 +1,21 @@
1
+ .git
2
+ .github
3
+ .cursor
4
+ .venv
5
+ .env
6
+ .env.*
7
+ __pycache__/
8
+ *.py[cod]
9
+ .pytest_cache/
10
+ .ruff_cache/
11
+ .pyright/
12
+ .mypy_cache/
13
+ .coverage
14
+ htmlcov/
15
+ dist/
16
+ build/
17
+ traces/
18
+ .data/
19
+ *.sqlite
20
+ *.db
21
+ tests/
@@ -0,0 +1,32 @@
1
+ # Default local development path. Copy this file to .env and fill in the key locally.
2
+ # Never commit .env.
3
+ #
4
+ # Provider credentials. The harness does not require either key to import.
5
+ # Each agent declares its own provider and model.
6
+ # A live OpenAI agent needs OPENAI_API_KEY.
7
+ OPENAI_API_KEY=
8
+ # A live Anthropic agent needs ANTHROPIC_API_KEY. The default example does not.
9
+ # ANTHROPIC_API_KEY=
10
+
11
+ # Optional Microsoft Foundry settings. Install the extra first:
12
+ # uv sync --extra foundry
13
+ # FOUNDRY_PROJECT_ENDPOINT=
14
+ # FOUNDRY_MODEL=
15
+
16
+ # Application settings loaded with the APP_ prefix.
17
+ # Console export stays off unless this is set to true. Sensitive payloads stay off.
18
+ APP_SERVICE_NAME=agentbuildkit
19
+ APP_ENVIRONMENT=local
20
+ APP_ENABLE_CONSOLE_EXPORTERS=false
21
+ # APP_OTLP_ENDPOINT=
22
+ # Directory for durable workflow state. The container image sets this to /data.
23
+ # APP_STATE_DIRECTORY=
24
+
25
+ # GitHub App credentials for governed repository operations.
26
+ # The private key is a PEM string. It never belongs in a prompt or a log.
27
+ # GITHUB_APP_ID=
28
+ # GITHUB_INSTALLATION_ID=
29
+ # GITHUB_PRIVATE_KEY=
30
+
31
+ # Cursor Cloud Agent API key. It stays on the authorization header.
32
+ # CURSOR_API_KEY=
@@ -0,0 +1,7 @@
1
+ # Security
2
+
3
+ Report a vulnerability privately. Do not open a public GitHub issue for it, and do not include exploit details, credentials, or proof-of-concept data in a public place.
4
+
5
+ This repository does not publish a security email address. GitHub private vulnerability reporting on [gluzio/agentbuildkit](https://github.com/gluzio/agentbuildkit) is the channel to use when that feature is enabled for the repository. This file does not mean that feature is already enabled.
6
+
7
+ Until a private channel is available, contact the repository owner directly.
@@ -0,0 +1,33 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+
7
+ jobs:
8
+ check:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - name: Checkout
12
+ uses: actions/checkout@v4
13
+
14
+ - name: Install uv
15
+ uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
16
+ with:
17
+ python-version: "3.12"
18
+ enable-cache: true
19
+
20
+ - name: Install dependencies
21
+ run: uv sync --locked --all-groups --no-extra foundry
22
+
23
+ - name: Lint
24
+ run: uv run ruff check .
25
+
26
+ - name: Format check
27
+ run: uv run ruff format --check .
28
+
29
+ - name: Type check
30
+ run: uv run pyright
31
+
32
+ - name: Test
33
+ run: uv run pytest
@@ -0,0 +1,43 @@
1
+ # Publishes agentbuildkit when a GitHub Release is published from a v* tag.
2
+ # The package version comes from pyproject.toml. PyPI authentication is
3
+ # Trusted Publishing through GitHub OIDC. This workflow stores no PyPI token.
4
+
5
+ name: Publish to PyPI
6
+
7
+ on:
8
+ release:
9
+ types:
10
+ - published
11
+
12
+ permissions:
13
+ contents: read
14
+
15
+ jobs:
16
+ publish:
17
+ name: Publish agentbuildkit to PyPI
18
+ if: startsWith(github.event.release.tag_name, 'v')
19
+ runs-on: ubuntu-latest
20
+ environment:
21
+ name: pypi
22
+ url: https://pypi.org/p/agentbuildkit
23
+ permissions:
24
+ contents: read
25
+ id-token: write
26
+ attestations: write
27
+ steps:
28
+ - name: Checkout release
29
+ uses: actions/checkout@v4
30
+ with:
31
+ ref: ${{ github.event.release.tag_name }}
32
+ persist-credentials: false
33
+
34
+ - name: Install uv and Python 3.12
35
+ uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
36
+ with:
37
+ python-version: "3.12"
38
+
39
+ - name: Build wheel and sdist
40
+ run: uv build
41
+
42
+ - name: Publish to PyPI
43
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,29 @@
1
+ # Python
2
+ .venv/
3
+ __pycache__/
4
+ *.py[cod]
5
+ *.egg-info/
6
+ .pytest_cache/
7
+ .ruff_cache/
8
+ .pyright/
9
+ .mypy_cache/
10
+ .coverage
11
+ htmlcov/
12
+ dist/
13
+ build/
14
+
15
+ # Secrets and local telemetry
16
+ .env
17
+ .env.*
18
+ !.env.example
19
+ traces/
20
+ .data/
21
+ *.sqlite
22
+ *.sqlite3
23
+ *.sqlite-journal
24
+ *.sqlite-wal
25
+ *.sqlite-shm
26
+ *.db
27
+
28
+ # OS and editors
29
+ .DS_Store
@@ -0,0 +1 @@
1
+ 3.12
@@ -0,0 +1,37 @@
1
+ # Agent instructions
2
+
3
+ This repository is AgentBuildKit, a Python harness for reliable AI agents on Microsoft Agent Framework 1.x. Follow these rules for every change.
4
+
5
+ ## Framework
6
+
7
+ - Microsoft Agent Framework is the only agent framework. Use `agent_framework` and its first-party packages.
8
+ - Each agent declares `provider` and `model`. The OpenAI provider constructs `OpenAIChatClient`. The Anthropic provider constructs `AnthropicClient`. Agent execution receives an injected client and does not branch on the provider.
9
+ - Microsoft Foundry stays an optional extra (`uv sync --extra foundry`). Do not add it to the default dependencies.
10
+ - Leave AutoGen, Semantic Kernel, and the experimental functional `@workflow` API out of this repository.
11
+ - Prefer stable graph workflows (`WorkflowBuilder`) and the orchestration builders in `agent_framework.orchestrations`.
12
+
13
+ ## Design
14
+
15
+ - Prefer deterministic Python where the step does not need model judgment. Use an agent for judgment, tool selection, or language generation.
16
+ - Agent and workflow inputs and outputs use Pydantic models.
17
+ - Reusable harness code belongs in `src/agentbuildkit`. The customer-service demonstration belongs in `examples/customer_service`. Do not add customer-service concepts to the harness.
18
+ - New behaviour ships with a test that passes without a live model. Mark live-service tests with `@pytest.mark.integration`.
19
+
20
+ ## Side effects, secrets, and audit
21
+
22
+ - External side effects require an allowlisted tool and human approval before they run. Use `@tool(approval_mode="always_require")` for writes and other side effects.
23
+ - MCP servers and HTTP APIs come from an explicit allowlist. Pass credentials through a header provider or client configuration, never through model-supplied tool arguments.
24
+ - Important actions are observable and auditable. Export OpenTelemetry traces and record approval decisions. Keep sensitive prompt and tool payloads out of shared telemetry.
25
+ - Never commit secrets. `.env` is local. Update `.env.example` with empty placeholders when adding a setting.
26
+ - Do not log or print `SecretString` values. Call `get_secret_value()` only at the client boundary that requires a plain string.
27
+
28
+ ## Checks
29
+
30
+ Before handing work back, run:
31
+
32
+ ```bash
33
+ uv run ruff check .
34
+ uv run ruff format --check .
35
+ uv run pyright
36
+ uv run pytest
37
+ ```
@@ -0,0 +1,32 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0
4
+
5
+ Initial public release. This version is prepared for publication. It has not been published to PyPI or npm.
6
+
7
+ - Python package `agentbuildkit` 0.1.0 and command `agentkit`.
8
+ - Per-agent OpenAI and Anthropic provider and model selection. One workflow can mix both. A scripted client remains available for tests and the offline demo.
9
+ - Typed agent inputs and outputs.
10
+ - Deterministic routing, per-agent tool allowlists, and read versus side-effect classification.
11
+ - Human approval before a side effect, SQLite pause and resume, at-most-once side-effect execution, and persisted rejections.
12
+ - Audit events that record the provider and model and omit credentials, plus an offline evaluation runner.
13
+ - Governed GitHub repository operations and one external-execution grant for Cursor. Credentials stay on the authorization header.
14
+ - `agentkit demo`, an offline run of that harness. It needs no API key.
15
+ - Node bootstrapper `agentbuildkit` 0.0.1. `npx agentbuildkit` installs the Python CLI with uv into an isolated tool environment. Installing uv requires a prompt, or `--install-uv` when the terminal is not interactive.
16
+ - Apache License 2.0.
17
+
18
+ ## 1.0.0
19
+
20
+ Earlier reusable release of the agent organisation template, before this product name.
21
+
22
+ - Typed agent boundaries, with Pydantic inputs and outputs.
23
+ - Deterministic orchestration for routing, review, and aggregation.
24
+ - Governed tools, classified as read or side effect.
25
+ - Human approval before a side effect runs, with at-most-once resume inside the workflow store.
26
+ - Durable workflow state in SQLite, mounted as a volume in the container.
27
+ - Allowlisted HTTP and MCP integrations. Credentials stay in configuration.
28
+ - An offline evaluation framework for organisation-defined cases.
29
+ - OpenTelemetry export, correlation ids, and audit events that omit prompts and secrets.
30
+ - A fictional B2B customer-service organisation as the working example.
31
+ - A non-root Docker image that runs the existing command.
32
+ - A client playbook: discovery, specification, Cursor prompt, and deployment checklist.
@@ -0,0 +1,31 @@
1
+ # Contributing
2
+
3
+ AgentBuildKit is a Python 3.12 project. [uv](https://docs.astral.sh/uv/) installs the interpreter and the dependencies.
4
+
5
+ ```bash
6
+ uv sync
7
+ ```
8
+
9
+ Run the checks before opening a pull request:
10
+
11
+ ```bash
12
+ uv run ruff check .
13
+ uv run ruff format --check .
14
+ uv run pyright
15
+ uv run pytest
16
+ ```
17
+
18
+ The offline demo needs no API key:
19
+
20
+ ```bash
21
+ uv run agentkit demo --approve
22
+ ```
23
+
24
+ Bootstrapper tests live in `npm/agentbuildkit` and do not download uv or Python:
25
+
26
+ ```bash
27
+ cd npm/agentbuildkit
28
+ npm test
29
+ ```
30
+
31
+ Pull requests should keep the existing behaviour covered by an offline test. Live provider tests belong behind `@pytest.mark.integration`. Do not commit `.env` or credentials. Do not add a dependency on a second agent framework.
@@ -0,0 +1,47 @@
1
+ # syntax=docker/dockerfile:1
2
+
3
+ FROM python:3.12-slim-bookworm AS build
4
+
5
+ COPY --from=ghcr.io/astral-sh/uv:0.12.18 /uv /bin/uv
6
+
7
+ WORKDIR /app
8
+
9
+ ENV UV_COMPILE_BYTECODE=1 \
10
+ UV_LINK_MODE=copy \
11
+ UV_PROJECT_ENVIRONMENT=/app/.venv
12
+
13
+ COPY pyproject.toml uv.lock ./
14
+ RUN --mount=type=cache,target=/root/.cache/uv \
15
+ uv sync --locked --no-dev --no-install-project
16
+
17
+ COPY README.md ./
18
+ COPY src ./src
19
+ RUN --mount=type=cache,target=/root/.cache/uv \
20
+ uv sync --locked --no-dev --no-editable
21
+
22
+ FROM python:3.12-slim-bookworm
23
+
24
+ WORKDIR /app
25
+
26
+ ENV PYTHONDONTWRITEBYTECODE=1 \
27
+ PYTHONUNBUFFERED=1 \
28
+ APP_STATE_DIRECTORY=/data \
29
+ PYTHONPATH=/app/examples \
30
+ PATH="/app/.venv/bin:$PATH"
31
+
32
+ RUN groupadd --gid 10001 app \
33
+ && useradd --uid 10001 --gid 10001 --create-home --shell /usr/sbin/nologin app \
34
+ && mkdir -p /data \
35
+ && chown app:app /data
36
+
37
+ COPY --from=build --chown=app:app /app/.venv /app/.venv
38
+ COPY --chown=app:app examples ./examples
39
+
40
+ USER app
41
+
42
+ VOLUME ["/data"]
43
+
44
+ HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
45
+ CMD ["python", "-m", "customer_service.health"]
46
+
47
+ ENTRYPOINT ["python", "-m", "customer_service"]
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.