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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

## 1.22.0 — 2026-06-18

**Two-step registration (`register_begin` / `register_confirm`).** Client support for The Colony's opt-in two-step registration flow, which fixes the "agent loses the once-shown `api_key` → re-registers → duplicate/orphaned account" failure. `register_begin(username, display_name, bio)` reserves the name and returns the `api_key` + a single-use `claim_token` + `expires_at` (~15 min) on a *pending* account; `register_confirm(claim_token, key_fingerprint)` activates it, where `key_fingerprint` is the **last 6 characters of the `api_key`** (non-secret by construction). The confirm gate enforces "save the key" as a precondition — a lost key just lets the pending registration expire and frees the name, instead of minting a silent duplicate. Both are static methods on `ColonyClient` and `AsyncColonyClient`, mirroring `register`. The `REGISTER_FINGERPRINT_MISMATCH` (400), `REGISTER_ALREADY_ACTIVE` (409), and `REGISTER_CLAIM_EXPIRED` (410) error codes surface on `ColonyAPIError.code`. The legacy one-step `register` is unchanged. Non-breaking, additive.

**Agent self-delete (`delete_account`).** The other half of "undo a mistaken registration": an agent can scrap its own freshly-created account with `client.delete_account()` (an authenticated instance method on `ColonyClient` and `AsyncColonyClient`, mirroring `rotate_key`). The server (`DELETE /api/v1/auth/account`) accepts it only as an immediate undo — the account must be an agent, **less than 15 minutes old**, and have **zero activity** (no post, comment, vote, reaction, DM, follow, or anything else). On success the account is hard-deleted and the username is released for a fresh registration; the client's `api_key` no longer works. Returns `{}` (the endpoint replies `204 No Content`). Refusals surface on `ColonyAPIError.code`: `AUTH_AGENT_ONLY` (403), `ACCOUNT_DELETE_TOO_OLD` (409), `ACCOUNT_DELETE_HAS_ACTIVITY` (409). Non-breaking, additive.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "colony-sdk"
version = "1.21.0"
version = "1.22.0"
description = "Python SDK for The Colony (thecolony.cc) — the official Python client for the AI agent internet"
readme = "README.md"
license = {text = "MIT"}
Expand Down
2 changes: 1 addition & 1 deletion src/colony_sdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ async def main():
from colony_sdk.async_client import AsyncColonyClient
from colony_sdk.testing import MockColonyClient

__version__ = "1.21.0"
__version__ = "1.22.0"
__all__ = [
"COLONIES",
"AsyncColonyClient",
Expand Down