Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
51ade64
feat: 1.9.0 — new denial codes + agent_memory type (TEC-226/218/227)
vvillait88 Apr 24, 2026
cb0f000
feat: AssessResponse.linked_wallets type (TEC-226 review-2 N1)
vvillait88 Apr 24, 2026
fcb9925
chore: review-cycle cleanup + type parity fixes
vvillait88 Apr 24, 2026
47a1c55
docs(claude): document wallet-auth response fields across methods
vvillait88 Apr 24, 2026
db23a7a
feat: add probe-strategy NextStepsAction values to the type enum
vvillait88 Apr 24, 2026
78497b5
docs(readme): document agent_memory + linked_wallets in session/asses…
vvillait88 Apr 24, 2026
d6f7996
feat(types): describe both gate-default and merchant-override denial …
vvillait88 Apr 24, 2026
930a0df
feat(types): AssociateWalletResponse.agent_memory for first-seen capt…
vvillait88 Apr 24, 2026
1e0bca3
chore: homepage URL → agentscore.sh (product landing, not docs subdom…
vvillait88 Apr 24, 2026
e954f42
feat(types): drop token_revoked from DenialCode union
vvillait88 Apr 24, 2026
a9563d1
feat(types): drop mint_new_credential from NextStepsAction
vvillait88 Apr 24, 2026
d9be5cb
chore(ci): bump actions/cache v4→v5, osv-scanner v2.3.2→v2.3.5, drop …
vvillait88 Apr 25, 2026
3270a1f
fix(ci): osv-scanner binary must be _linux_arm64 (Blacksmith runners …
vvillait88 Apr 25, 2026
b0a418b
chore(deps): refresh lockfiles to clear transitive CVEs
vvillait88 Apr 25, 2026
bd0a02d
docs: note Solana wallet address support + linked_wallets may mix EVM…
vvillait88 Apr 25, 2026
7cd40e9
fix(client): use a fresh AbortController for 429 retry
vvillait88 Apr 26, 2026
b868259
feat(sdk): add verifyWebhookSignature helper
vvillait88 Apr 26, 2026
dddfe3e
docs(readme): add verifyWebhookSignature section
vvillait88 Apr 26, 2026
b76a5af
feat: add isAgentScoreTestAddress + AGENTSCORE_TEST_ADDRESSES
vvillait88 Apr 26, 2026
7a33866
test(coverage): cover retry-abort path in 429 retry handler
vvillait88 Apr 26, 2026
2056909
docs(types): replace 'legacy merchant override' with 'merchant-emitte…
vvillait88 Apr 26, 2026
3d134f1
feat(types): promote inline shapes + rename CredentialListItem → Cred…
vvillait88 Apr 27, 2026
03651a5
chore(deps): add lefthook devDep + prepare script for auto-install
vvillait88 Apr 27, 2026
75ba394
feat(sdk): preserve response-body fields on AgentScoreError + accept …
vvillait88 Apr 27, 2026
ea422cc
feat(sdk)!: drop verifyWebhookSignature — AgentScore emits no webhooks
vvillait88 Apr 27, 2026
bf63ba2
docs(readme): document AgentScoreError.details + createSession identi…
vvillait88 Apr 27, 2026
0f47bcc
chore(release): bump to 2.0.0
vvillait88 Apr 27, 2026
b412e2a
chore: bump typescript-eslint 8.59.0→8.59.1 (patch)
vvillait88 Apr 29, 2026
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
12 changes: 7 additions & 5 deletions .claude/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ TypeScript client for the AgentScore trust and reputation API.

## Identity Model

Two identity paths: `X-Wallet-Address` (wallet-based) and `X-Operator-Token` (credential-based). Wallet addresses accept both EVM (`0x...` 40-hex) and Solana (base58, 32–44 chars) formats — network is auto-detected from the address shape. `assess()` responses include `resolved_operator` and `linked_wallets[]` (same-operator sibling wallets, normalized per network — EVM lowercased, Solana base58 verbatim; may mix chains for cross-chain operators). `createSession()` and `createCredential()` responses include an `agent_memory` cross-merchant pattern hint. `createSession()` also returns `next_steps.action: "deliver_verify_url_and_poll"` + polling instructions. `pollSession()` returns `next_steps.action` of `continue_polling`, `retry_merchant_request_with_operator_token`, `use_stored_operator_token`, `create_new_session`, `verification_failed`, or `contact_support` depending on state.

## Methods

- `getReputation(address, options?)` — cached reputation lookup (free)
- `assess(address, options?)` — identity gate with policy (paid). Accepts `operatorToken` for non-wallet agents.
- `createSession(options?)` — create verification session for identity bootstrapping
- `pollSession(sessionId, pollSecret)` — poll session status, returns credential when verified
- `createCredential(options?)` — create operator credential (24h TTL default)
- `assess(address, options?)` — identity gate with policy (paid). Accepts `operatorToken` for non-wallet agents. Response includes `linked_wallets[]` and `resolved_operator`.
- `createSession(options?)` — create verification session for identity bootstrapping. Returns `agent_memory` + `next_steps`.
- `pollSession(sessionId, pollSecret)` — poll session status, returns credential when verified, plus `next_steps.action`.
- `createCredential(options?)` — create operator credential (24h TTL default). Response includes `agent_memory`.
- `listCredentials()` — list active credentials
- `revokeCredential(id)` — revoke a credential
- `associateWallet({ operatorToken, walletAddress, network, idempotencyKey? })` — report a signer wallet seen paying under a credential (TEC-189). Fire-and-forget; use the payment intent id / tx hash as `idempotencyKey` so retries don't inflate transaction_count.
- `associateWallet({ operatorToken, walletAddress, network, idempotencyKey? })` — report a signer wallet seen paying under a credential. Fire-and-forget; use the payment intent id / tx hash as `idempotencyKey` so retries don't inflate transaction_count.

## Architecture

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
steps:
- uses: useblacksmith/checkout@v1
- uses: oven-sh/setup-bun@v2
- uses: actions/cache@v4
- uses: actions/cache@v5
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ jobs:

- name: Install osv-scanner
run: |
curl -fsSL https://github.com/google/osv-scanner/releases/download/v2.3.2/osv-scanner_linux_amd64 -o osv-scanner
curl -fsSL https://github.com/google/osv-scanner/releases/download/v2.3.5/osv-scanner_linux_arm64 -o osv-scanner
chmod +x osv-scanner

- name: Scan dependencies
run: ./osv-scanner --lockfile=bun.lock --format=table || true
run: ./osv-scanner scan source --lockfile=bun.lock --format=table

29 changes: 28 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,30 @@ console.log(result.decision); // "allow" | "deny"

### Verification Sessions

Bootstrap identity for first-time agents:
Bootstrap identity for first-time agents. The success body carries structured `next_steps` (with `action: "deliver_verify_url_and_poll"`) and a cross-merchant `agent_memory` hint. Poll responses carry `next_steps.action` from the typed `NextStepsAction` union (`continue_polling`, `retry_merchant_request_with_operator_token`, `use_stored_operator_token`, `create_new_session`, `verification_failed`, `contact_support`).

```typescript
// Create a session — returns a verify_url for the user and a poll_url for the agent
const session = await client.createSession();
console.log(session.verify_url, session.poll_url, session.poll_secret);
console.log(session.next_steps.action); // "deliver_verify_url_and_poll"

// Poll until the user completes verification
const status = await client.pollSession(session.session_id, session.poll_secret);
if (status.status === "verified") {
console.log(status.operator_token); // "opc_..." — use for future requests
}

// Optional pre-association: attach the session to a known wallet or refresh KYC
// for an existing operator credential.
await client.createSession({ address: "0x..." });
await client.createSession({ operator_token: "opc_..." }); // KYC refresh
```

### Wallet resolution

`assess()` responses include `resolved_operator` and `linked_wallets[]` — all same-operator sibling wallets (claimed via SIWE or captured via prior `associateWallet`). The list may mix EVM addresses (`0x...` lowercased) and Solana addresses (base58, case-preserved) for cross-chain operators; merchants doing wallet-signer-match checks should accept a payment signed by any address in the list, regardless of chain. The `address` parameter on `assess()` and `getReputation()` accepts either format — network is auto-detected from the address shape.

### Credential Management

```typescript
Expand Down Expand Up @@ -121,6 +131,23 @@ try {
}
```

`AgentScoreError.details` carries the rest of the response body — `verify_url`, `linked_wallets`, `claimed_operator`, `actual_signer`, `expected_signer`, `reasons`, `agent_memory` — so callers can branch on granular denial codes without re-parsing:

```typescript
try {
await client.assess("0xabc...", { policy: { require_kyc: true } });
} catch (err) {
if (!(err instanceof AgentScoreError)) throw err;
if (err.code === "wallet_signer_mismatch") {
const linked = err.details.linked_wallets as string[] | undefined;
console.log("Re-sign from one of:", linked);
}
if (err.code === "token_expired") {
console.log("Verify at:", err.details.verify_url);
}
}
```

## Documentation

- [API Reference](https://docs.agentscore.sh)
Expand Down
Loading
Loading