Skip to content
Merged
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
14 changes: 0 additions & 14 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,3 @@ updates:
- dependency-name: "*"
update-types:
- version-update:semver-patch

- package-ecosystem: nix
directory: "/"
schedule:
interval: "weekly"
time: "06:00"
timezone: "America/Chicago"
labels: []
commit-message:
prefix: "chore"
groups:
nix:
patterns:
- "*"
23 changes: 6 additions & 17 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,14 @@ jobs:
fetch-tags: true
persist-credentials: false

- name: Setup Nix
uses: nixbuild/nix-quick-install-action@2c9db80fb984ceb1bcaa77cdda3fdf8cfba92035 # v34

- name: Cache Nix store
uses: nix-community/cache-nix-action@7df957e333c1e5da7721f60227dbba6d06080569 # v7.0.2
- name: Setup mise
uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # v4.0.1
with:
primary-key: nix-acp-go-sdk-${{ runner.os }}-${{ hashFiles('**/*.nix', 'flake.lock') }}
restore-prefixes-first-match: nix-acp-go-sdk-${{ runner.os }}-
gc-max-store-size-linux: 2G
purge: true
purge-prefixes: nix-acp-go-sdk-${{ runner.os }}-
purge-created: 0
purge-primary-key: never
install: true
cache: true

- name: Check formatting (treefmt)
run: nix develop .# --command treefmt --fail-on-change
run: mise exec -- make check

- name: Make tests
run: nix develop .# --command make test

- name: Nix flake checks
run: nix flake check
run: mise exec -- make test
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
.gocache
.gopath

# Nix files
.envrc
.direnv
# mise
mise.local.toml
.mise.local.toml
7 changes: 4 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ Core SDK code lives at the repo root (`agent.go`, `client.go`, `connection.go`,
- `go test ./...` exercises unit tests across packages.
- `go run ./example/agent` and `go run ./example/client` provide quick manual validation of agent/client behavior.
- `make test` runs `go test` and ensures all examples still build.
- `make fmt` delegates to `nix fmt` so Go, Nix, and Markdown stay formatted consistently.
- `nix flake check` validates the flake definition and linting hooks used in CI.
- `make fmt` runs `treefmt` so Go and Markdown stay formatted consistently.
- `make check` runs `treefmt --fail-on-change` plus the README guard used in CI.
- `mise install` provisions the toolchain (Go, gopls, golangci-lint, treefmt, etc.); run it once after cloning.

## Coding Style & Naming Conventions

Target Go 1.21 idioms: tabs for indentation, short receiver names, and CamelCase for exported symbols (`AgentLoader`), lowerCamelCase for unexported helpers. Prefer table-driven tests and keep files focused on a single protocol concern. Run `nix fmt` or `gofumpt -w .` to normalize spacing, imports, and composite literals before sending a change.
Target Go 1.21 idioms: tabs for indentation, short receiver names, and CamelCase for exported symbols (`AgentLoader`), lowerCamelCase for unexported helpers. Prefer table-driven tests and keep files focused on a single protocol concern. Run `make fmt` or `gofumpt -w .` to normalize spacing, imports, and composite literals before sending a change.

## Testing Guidelines

Expand Down
22 changes: 12 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ MDSH ?= mdsh

version: README.md schema/meta.json schema/schema.json schema/meta.unstable.json schema/schema.unstable.json
cd cmd/generate && env -u GOPATH -u GOMODCACHE go run .
env -u GOPATH -u GOMODCACHE go run mvdan.cc/gofumpt@latest -w .
gofumpt -w .
touch $@
echo $(ACP_VERSION) > $@

Expand Down Expand Up @@ -49,21 +49,23 @@ schema/schema.unstable.json: schema/version
fi

README.md: schema/version
@command -v $(MDSH) >/dev/null || { echo "mdsh not found; run 'nix develop' or install it." 1>&2; exit 1; }
@command -v $(MDSH) >/dev/null || { echo "mdsh not found; run 'mise install' or install it." 1>&2; exit 1; }
$(MDSH) --input README.md

.PHONY: guard-readme
guard-readme:
@command -v $(MDSH) >/dev/null || { echo "mdsh not found; run 'nix develop' or install it." 1>&2; exit 1; }
$(MDSH) --frozen --input README.md

.PHONY: fmt
fmt:
nix fmt
treefmt

# treefmt runs mdsh + mdformat over the markdown, which keeps README.md
# regenerated and in sync (replacing the old mdsh guard). mdsh and mdformat
# disagree on the blank line after an mdsh directive: mdsh strips it, mdformat
# re-adds it. The net result is a no-op (README is a fixpoint of the pair), but
# that intermediate churn trips treefmt's own --fail-on-change. So we format in
# place and let git confirm there's no net drift instead.
.PHONY: check
check: guard-readme
nix flake check
check:
treefmt
git diff --exit-code

.PHONY: test
test: $(GO_FILES)
Expand Down
7 changes: 3 additions & 4 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ code, helper APIs, and library version remain in sync.

## Prerequisites

- Go 1.21 or newer.
- `make`, `curl`, and `git` in your `PATH`.
- Nix is required for `make fmt` and `make check` (they invoke `nix fmt` and
`nix flake check`). Use `nix develop` or an equivalent environment before
running these targets.
- [mise](https://mise.jdx.dev) for the toolchain. Run `mise install` once to
provision Go, `treefmt`, and the formatters/linters that `make fmt` and
`make check` invoke.
- The repository must have an Actions secret named `ANTHROPIC_API_KEY` so the
release-notes workflow can update GitHub Release bodies after publication.

Expand Down
82 changes: 0 additions & 82 deletions flake.lock

This file was deleted.

68 changes: 0 additions & 68 deletions flake.nix

This file was deleted.

Loading