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
34 changes: 17 additions & 17 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@agent-score/sdk",
"version": "1.2.0",
"version": "1.3.0",
"description": "TypeScript client for the AgentScore trust and reputation API",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
Expand Down Expand Up @@ -56,7 +56,7 @@
"eslint-plugin-unused-imports": "^4.4.1",
"tsup": "^8.5.1",
"typescript": "^6.0.2",
"typescript-eslint": "^8.57.2",
"typescript-eslint": "^8.58.0",
"vitest": "^4.1.2"
}
}
35 changes: 29 additions & 6 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export type EntityType = 'agent' | 'service' | 'hybrid' | 'wallet' | 'bot' | 'un
export type ReputationStatus = 'unknown' | 'known_unscored' | 'scored' | 'stale' | 'indexing';

export interface Subject {
chain: string;
chains: string[];
address: string;
}

Expand All @@ -24,12 +24,20 @@ export interface Classification {
}

export interface Score {
value: number | null;
grade: Grade | null;
scored_at: string | null;
status: ReputationStatus;
version: string;
}

export interface ChainScore {
value: number | null;
grade: Grade | null;
confidence: number | null;
dimensions: Record<string, number> | null;
scored_at: string | null;
status: ReputationStatus;
version: string;
}

Expand Down Expand Up @@ -106,13 +114,19 @@ export interface AgentSummary {
grade: Grade;
}

export interface ChainEntry {
chain: string;
score: ChainScore;
classification: Classification;
identity: Identity;
activity: Activity;
evidence_summary: EvidenceSummary;
}

export interface ReputationResponse {
subject: Subject;
classification: Classification;
score: Score;
identity: Identity | null;
activity: Activity | null;
evidence_summary: EvidenceSummary | null;
chains: ChainEntry[];
data_semantics: string;
caveats: string[];
updated_at: string | null;
Expand All @@ -134,10 +148,19 @@ export interface AssessRequest {
policy?: DecisionPolicy;
}

export interface AssessResponse extends ReputationResponse {
export interface AssessResponse {
subject: Subject;
score: Score;
chains: ChainEntry[];
decision: string | null;
decision_reasons: string[];
on_the_fly: boolean;
data_semantics: string;
caveats: string[];
updated_at: string | null;
operator_score?: OperatorScore;
reputation?: Reputation;
agents?: AgentSummary[];
}

export interface AgentRecord {
Expand Down
Loading
Loading