## 1. Package Setup

- [x] 1.1 Create `sdk/` directory and `sdk/src/` subdirectories
- [x] 1.2 Write `sdk/package.json` — name: @sentryagent/idp-sdk, main, types, scripts (build, test)
- [x] 1.3 Write `sdk/tsconfig.json` — strict mode, target ES2020, declaration: true
- [x] 1.4 Write `sdk/README.md` — installation, quick example, full API reference

## 2. Types

- [x] 2.1 Write `sdk/src/types.ts` — all request/response interfaces for all 14 endpoints
- [x] 2.2 Write `sdk/src/errors.ts` — AgentIdPError class with code, message, httpStatus, details

## 3. Core Client

- [x] 3.1 Write `sdk/src/token-manager.ts` — TokenManager: acquires, caches, refreshes tokens; re-issues when exp - 60s
- [x] 3.2 Write `sdk/src/request.ts` — shared request() helper: sets Authorization header, parses JSON, maps errors to AgentIdPError

## 4. Service Clients

- [x] 4.1 Write `sdk/src/services/agents.ts` — AgentRegistryClient: registerAgent, listAgents, getAgent, updateAgent, decommissionAgent
- [x] 4.2 Write `sdk/src/services/credentials.ts` — CredentialClient: generateCredential, listCredentials, rotateCredential, revokeCredential
- [x] 4.3 Write `sdk/src/services/token.ts` — TokenClient: introspectToken, revokeToken (issueToken handled by TokenManager)
- [x] 4.4 Write `sdk/src/services/audit.ts` — AuditClient: queryAuditLog, getAuditEvent

## 5. Main Entry Point

- [x] 5.1 Write `sdk/src/client.ts` — AgentIdPClient: composes all service clients, exposes agents, credentials, token, audit namespaces
- [x] 5.2 Write `sdk/src/index.ts` — exports AgentIdPClient and all public types

## 6. QA

- [x] 6.1 Verify TypeScript compiles with zero errors (npm run build in sdk/)
- [x] 6.2 Verify zero `any` types across all SDK files
- [x] 6.3 Verify all 14 endpoints have corresponding SDK methods
- [x] 6.4 Verify AgentIdPError is thrown (not raw errors) for all failure paths
