Skip to content

Commit 6fa904c

Browse files
committed
feat: add SDK examples workspace
0 parents  commit 6fa904c

292 files changed

Lines changed: 18810 additions & 0 deletions

File tree

Some content is hidden

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

.env.example

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# =============================================================================
2+
# arcp sdk-examples — canonical configuration
3+
# =============================================================================
4+
# This is the master list of knobs shared across every language example.
5+
# Each language directory has its own `.env.example` with the same defaults
6+
# plus language-specific additions.
7+
#
8+
# Usage:
9+
# cp .env.example .env
10+
# # edit .env as needed
11+
# make up
12+
# -----------------------------------------------------------------------------
13+
14+
# --- LLM (Ollama) ------------------------------------------------------------
15+
# Small + decent reasoning + tool calling. Alternatives:
16+
# qwen2.5:0.5b ~400MB fastest, weakest reasoning
17+
# qwen2.5:1.5b-instruct ~1GB DEFAULT — balanced
18+
# qwen3:0.6b ~520MB native thinking mode
19+
# llama3.2:1b ~1.3GB strong instruction following
20+
# phi3:mini ~2.2GB stronger reasoning, slower
21+
OLLAMA_MODEL=qwen2.5:1.5b-instruct
22+
OLLAMA_URL=http://ollama:11434
23+
OLLAMA_KEEP_ALIVE=5m
24+
OLLAMA_NUM_CTX=4096
25+
26+
# --- ARCP runtime ------------------------------------------------------------
27+
ARCP_RUNTIME_HOST=0.0.0.0
28+
ARCP_RUNTIME_PORT=8080
29+
ARCP_RUNTIME_PATH=/arcp
30+
ARCP_AUTH_TOKEN=dev-token-change-me
31+
32+
# Pin a specific SDK release for reproducible builds, or leave `latest`.
33+
ARCP_SDK_VERSION=latest
34+
35+
# --- ARCP client -------------------------------------------------------------
36+
ARCP_CLIENT_NAME=sdk-examples-client
37+
ARCP_CLIENT_VERSION=1.0.0
38+
ARCP_CLIENT_TIMEOUT_MS=30000
39+
ARCP_AGENT_NAME=demo
40+
41+
# --- Observability -----------------------------------------------------------
42+
# trace | debug | info | warn | error
43+
LOG_LEVEL=info

.github/workflows/verify.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: verify examples
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
verify:
11+
name: verify ${{ matrix.language }}
12+
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
language: [fsharp, java, php, ruby]
17+
18+
steps:
19+
- name: Check out repo
20+
uses: actions/checkout@v4
21+
22+
- name: Set up Docker Buildx
23+
uses: docker/setup-buildx-action@v3
24+
25+
- name: Build ${{ matrix.language }} example
26+
run: make verify-${{ matrix.language }}

.gitignore

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# env files
2+
.env
3+
.env.local
4+
**/.env
5+
!**/.env.example
6+
SOUL.md
7+
**/PROMPT.md
8+
9+
# OS
10+
.DS_Store
11+
Thumbs.db
12+
13+
# editor
14+
.vscode/
15+
.idea/
16+
*.swp
17+
*.swo
18+
19+
# logs
20+
*.log
21+
logs/
22+
out/
23+
**/out/
24+
reports/
25+
**/reports/
26+
loot/
27+
**/loot/
28+
work/
29+
**/work/
30+
31+
# language: node
32+
node_modules/
33+
*.tsbuildinfo
34+
dist/
35+
.npm/
36+
.pnpm-store/
37+
38+
# language: python
39+
__pycache__/
40+
*.py[cod]
41+
*$py.class
42+
.venv/
43+
venv/
44+
env/
45+
*.egg-info/
46+
.mypy_cache/
47+
.ruff_cache/
48+
.pytest_cache/
49+
50+
# language: go
51+
bin/
52+
*.test
53+
*.out
54+
55+
# language: rust
56+
target/
57+
Cargo.lock.bak
58+
59+
# language: java/kotlin
60+
*.class
61+
*.jar
62+
*.war
63+
build/
64+
.gradle/
65+
target/
66+
67+
# language: csharp/fsharp
68+
obj/
69+
bin/
70+
71+
# language: ruby
72+
.bundle/
73+
vendor/bundle/
74+
*.gem
75+
76+
# language: php
77+
vendor/
78+
composer.phar
79+
80+
# language: swift
81+
.build/
82+
.swiftpm/
83+
Packages/
84+
*.xcodeproj/
85+
86+
# docker
87+
.docker/
88+
ollama-data/

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Agent Runtime Control Protocol contributors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Makefile

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# =============================================================================
2+
# arcp sdk-examples — top-level orchestration
3+
# =============================================================================
4+
# Per-language targets are defined below. Pattern targets fan out so you can
5+
# also run `make up-python`, `make logs-rust`, etc.
6+
# -----------------------------------------------------------------------------
7+
8+
LANGS := csharp fsharp go java kotlin php python ruby rust swift typescript
9+
10+
.DEFAULT_GOAL := help
11+
12+
.PHONY: help
13+
help: ## Show this help
14+
@echo "arcp sdk-examples — top-level commands"
15+
@echo
16+
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_%-]+:.*?## / {printf " \033[36m%-22s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
17+
@echo
18+
@echo "Per-language commands (substitute any of: $(LANGS)):"
19+
@echo " make up-<lang> # docker compose up for one language"
20+
@echo " make down-<lang> # docker compose down"
21+
@echo " make logs-<lang> # tail container logs"
22+
@echo " make verify-<lang> # docker build only — proves @latest install"
23+
@echo " make shell-<lang> # exec into the client container"
24+
25+
.PHONY: verify
26+
verify: ## docker build every language (proves @latest installs cleanly)
27+
@for lang in $(LANGS); do \
28+
echo "==> verify $$lang"; \
29+
$(MAKE) verify-$$lang || exit 1; \
30+
done
31+
@echo
32+
@echo "All languages verified."
33+
34+
.PHONY: clean
35+
clean: ## Remove all built images, containers, and volumes
36+
@for lang in $(LANGS); do \
37+
echo "==> clean $$lang"; \
38+
$(MAKE) -C $$lang clean 2>/dev/null || true; \
39+
done
40+
@docker volume ls -q --filter "name=sdk-examples" | xargs -r docker volume rm || true
41+
42+
.PHONY: ls
43+
ls: ## List languages
44+
@printf '%s\n' $(LANGS)
45+
46+
# --- pattern targets ---------------------------------------------------------
47+
48+
up-%:
49+
@$(MAKE) -C $* up
50+
51+
down-%:
52+
@$(MAKE) -C $* down
53+
54+
logs-%:
55+
@$(MAKE) -C $* logs
56+
57+
verify-%:
58+
@$(MAKE) -C $* verify
59+
60+
shell-%:
61+
@$(MAKE) -C $* shell
62+
63+
build-%:
64+
@$(MAKE) -C $* build

README.md

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
# arcp sdk-examples
2+
3+
End-to-end, containerized examples for every ARCP SDK. Each subdirectory is a self-contained, configurable demo: an Ollama-backed local LLM, an ARCP runtime hosting an agent, and an ARCP client driving it.
4+
5+
## What this repo is for
6+
7+
1. **Drop-in e2e setup.** `git clone`, `cd <language>`, `make up`. You get a local LLM, an ARCP runtime, and a client wired together. No external services, no API keys.
8+
2. **`@latest` install proof.** Every Dockerfile pulls the SDK at the latest published version from each ecosystem's package registry. If a build is red, the SDK shipped broken — not the example.
9+
10+
## Languages
11+
12+
| Language | Example theme | Package | Install |
13+
| ------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------------------------- |
14+
| [csharp](csharp/) | ASP.NET Core background worker queue | `Arcp` | `dotnet add package Arcp` |
15+
| [fsharp](fsharp/) | Classical cipher cryptanalysis | `Arcp` | `dotnet add package Arcp` |
16+
| [go](go/) | Concurrent batch document summarizer | `github.com/agentruntimecontrolprotocol/go-sdk` | `go get github.com/agentruntimecontrolprotocol/go-sdk@latest` |
17+
| [java](java/) | Disinformation network mapping (Spring Boot + Spark) | `io.agentruntimecontrolprotocol:arcp` | `mvn` / `gradle` (see [java/README.md](java/README.md)) |
18+
| [kotlin](kotlin/) | Coroutine async data pipeline | `dev.arcp:arcp` | `gradle` (see [kotlin/README.md](kotlin/README.md)) |
19+
| [php](php/) | Phishing-kit teardown sandbox | `arcp/sdk` | `composer require arcp/sdk` |
20+
| [python](python/) | Multi-agent code reviewer (security/perf/style) | `agentruntimecontrolprotocol` | `pip install agentruntimecontrolprotocol` |
21+
| [ruby](ruby/) | Authorized CTF post-exploitation orchestrator (lab-only) | `arcp` | `gem install arcp` |
22+
| [rust](rust/) | High-throughput embedding pipeline | `arcp` | `cargo add arcp` |
23+
| [swift](swift/) | macOS async/await tool-calling agent | `ARCP` (SwiftPM) | `swift package add ARCP` (see [swift/README.md](swift/README.md)) |
24+
| [typescript](typescript/) | Darknet threat-intel crawler (lab `.onion`) | `@agentruntimecontrolprotocol/sdk` | `npm install @agentruntimecontrolprotocol/sdk` |
25+
26+
## Quickstart
27+
28+
```sh
29+
# Pick a language
30+
cd python
31+
32+
# Copy and edit configuration (optional — sensible defaults provided)
33+
cp .env.example .env
34+
35+
# Bring everything up: Ollama pulls model, runtime starts, client runs
36+
make up
37+
38+
# Tear down
39+
make down
40+
```
41+
42+
## How each example is wired
43+
44+
Three containers per example, all defined in that language's `docker-compose.yml`:
45+
46+
```
47+
┌──────────────┐ ws/arcp ┌──────────────┐ http ┌──────────────┐
48+
│ arcp-client │──────────▶│ arcp-runtime │───────▶│ ollama │
49+
│ (your code) │ │ (hosts agent)│ │ (local LLM) │
50+
└──────────────┘ └──────────────┘ └──────────────┘
51+
```
52+
53+
- **`ollama`** — pulls a small model on first start (default: `qwen2.5:1.5b-instruct`, ~1GB), serves OpenAI-compatible inference.
54+
- **`arcp-runtime`** — your language's SDK runtime, hosting a registered agent function. Talks to Ollama for reasoning.
55+
- **`arcp-client`** — your language's SDK client, submitting jobs to the runtime and consuming streamed events.
56+
57+
## Configurability is the point
58+
59+
Every example reads from `.env`. Common knobs (set across all languages):
60+
61+
| Variable | Default | Notes |
62+
| ------------------- | ----------------------- | ------------------------------------------------------ |
63+
| `OLLAMA_MODEL` | `qwen2.5:1.5b-instruct` | Try `qwen2.5:0.5b` (tiny) or `qwen3:0.6b` (reasoning). |
64+
| `OLLAMA_URL` | `http://ollama:11434` | Point elsewhere to use a remote inference host. |
65+
| `OLLAMA_KEEP_ALIVE` | `5m` | How long Ollama keeps the model loaded. |
66+
| `ARCP_RUNTIME_HOST` | `0.0.0.0` | Bind address inside the runtime container. |
67+
| `ARCP_RUNTIME_PORT` | `8080` | Runtime listen port. |
68+
| `ARCP_RUNTIME_PATH` | `/arcp` | WebSocket path. |
69+
| `ARCP_AUTH_TOKEN` | `dev-token-change-me` | Bearer token. **Change for non-local use.** |
70+
| `ARCP_SDK_VERSION` | `latest` | Pin a specific SDK release for reproducible builds. |
71+
| `ARCP_AGENT_NAME` | varies | Logical name registered by the runtime. |
72+
| `LOG_LEVEL` | `info` | `trace` / `debug` / `info` / `warn` / `error`. |
73+
74+
Each language adds example-specific knobs (e.g. `REVIEW_TARGET`, `BATCH_SIZE`, `STREAM_CHUNK_SIZE`). See each `.env.example`.
75+
76+
## Model choices
77+
78+
Default is **`qwen2.5:1.5b-instruct`**~1GB, supports tool calling, runs on CPU at a few tokens/sec on modern laptops. Three documented alternatives:
79+
80+
| Model | Size | Strengths |
81+
| -------------------------- | ------ | ---------------------------- |
82+
| `qwen2.5:0.5b` | ~400MB | Fastest, weakest reasoning |
83+
| `qwen2.5:1.5b-instruct`| ~1GB | Default — balanced |
84+
| `qwen3:0.6b` | ~520MB | Native thinking mode |
85+
| `llama3.2:1b` | ~1.3GB | Strong instruction following |
86+
| `phi3:mini` | ~2.2GB | Stronger reasoning, slower |
87+
88+
Override with `OLLAMA_MODEL=...` in your `.env`.
89+
90+
## Top-level commands
91+
92+
From the repo root:
93+
94+
```sh
95+
make help # List per-language targets
96+
make verify # docker build every language to prove @latest installs
97+
make verify-py # Verify a single language (also: verify-ts, verify-go, ...)
98+
make clean # Remove all built images and volumes
99+
```
100+
101+
## Repo layout
102+
103+
```
104+
sdk-examples/
105+
├── README.md # this file
106+
├── Makefile # top-level orchestration
107+
├── LICENSE
108+
├── .gitignore
109+
├── .env.example # canonical list of all knobs
110+
├── shared/
111+
│ ├── ollama-entrypoint.sh # pulls model on first boot
112+
│ └── docker-compose.ollama.yml
113+
└── <language>/
114+
├── Dockerfile # alpine-based where supported
115+
├── docker-compose.yml # extends shared/docker-compose.ollama.yml
116+
├── Makefile # up/down/logs/shell/verify
117+
├── README.md # what this example demonstrates
118+
├── .env.example # language-specific knobs
119+
├── .dockerignore
120+
├── <build manifest> # package.json / pyproject.toml / etc.
121+
└── src/
122+
└── .gitkeep # your example code goes here
123+
```
124+
125+
## License
126+
127+
MIT. See [LICENSE](LICENSE).

csharp/.dockerignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.env
2+
.env.local
3+
bin/
4+
obj/
5+
*.log
6+
.git/

0 commit comments

Comments
 (0)