diff --git a/package.json b/package.json index 2baef7c..e55b968 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@agent-score/sdk", - "version": "2.6.4", + "version": "2.7.0", "description": "TypeScript client for the AgentScore APIs", "main": "./dist/index.js", "module": "./dist/index.mjs", diff --git a/src/types.ts b/src/types.ts index 9810843..4d20e5f 100644 --- a/src/types.ts +++ b/src/types.ts @@ -633,6 +633,10 @@ export interface CredentialItem { expires_at: string | null; last_used_at: string | null; created_at: string; + /** `true` when a live refresh token can still mint a replacement for this + * credential. An expired credential is listed only while this holds, since + * revoking it is what stops the renewal. */ + refreshable?: boolean; } export interface AccountVerification { diff --git a/tests/sessions-credentials.test.ts b/tests/sessions-credentials.test.ts index 5a2776a..3570d04 100644 --- a/tests/sessions-credentials.test.ts +++ b/tests/sessions-credentials.test.ts @@ -293,6 +293,7 @@ const CREDENTIAL_LIST_RESPONSE = { expires_at: '2027-04-09T00:00:00Z', last_used_at: '2026-04-08T12:00:00Z', created_at: '2026-04-01T00:00:00Z', + refreshable: true, }, { id: 'cred_def456', @@ -315,6 +316,9 @@ describe('AgentScore.listCredentials()', () => { expect(result.credentials).toHaveLength(2); expect(result.credentials[0].id).toBe('cred_abc123'); expect(result.credentials[1].last_used_at).toBeNull(); + expect(result.credentials[0].refreshable).toBe(true); + // Optional on the wire: an older API build omits the key entirely. + expect(result.credentials[1].refreshable).toBeUndefined(); }); it('sends GET request to /v1/credentials', async () => {