Commit aafd334
feat(agents): add roster() + presence() methods (cueapi #630 + #662 parity)
Adds two SDK methods to ``AgentsResource`` covering the Agent Directory
v0/v1/v2 surface:
- ``roster(*, if_none_match=None)`` — GET /v1/agents/roster
Lists every agent owned by the calling key with a presence block
(online, derived_status, bucketed_seen, default_live cue, labeled
sessions, etag). Supports ``If-None-Match`` header so cheap-poll
callers can skip the payload when the directory hasn't changed.
- ``presence(ref)`` — GET /v1/agents/{ref}/presence
Lighter than ``get(ref)`` — returns just the presence-relevant
fields (online, derived_status, bucketed_seen, default_live,
labeled_sessions, etag) without the full agent record. Designed
for UIs refreshing a single tile every few seconds without
re-fetching the directory or full agent record.
4 new mock-based tests in test_agents_resource.py:
- test_roster_no_etag — no If-None-Match header by default
- test_roster_with_if_none_match — header flows as ``If-None-Match``
- test_presence_by_id — opaque agent_id path
- test_presence_by_slug_form — slug@user path
Source: drift audit handoff/cueapi-package-drift-2026-05-06; Backlog
rows "Parity port: PR #630 (GET /v1/agents/roster) → cueapi-python"
+ "Parity port: PR #662 (GET /v1/agents/{ref}/presence) → cueapi-python"
(both p2, CTO-SEC-DRIFT-AUDIT-AUTHORIZE 2026-05-06).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent b30d23b commit aafd334
2 files changed
Lines changed: 103 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
0 commit comments