@valiron/sdk 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -14,145 +14,118 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.ValironSDK = void 0;
17
+ exports.ValironClient = exports.ValironSDK = void 0;
18
18
  const clients_1 = require("./clients");
19
19
  /**
20
- * Valiron SDK - Official TypeScript SDK for the Trust Layer for Agentic Economy
20
+ * Valiron SDK Official TypeScript SDK for the Trust Layer for Agentic Economy
21
21
  *
22
22
  * @example
23
23
  * ```typescript
24
24
  * import { ValironSDK } from '@valiron/sdk';
25
25
  *
26
- * const valiron = new ValironSDK({
27
- * apiKey: 'vln_your_api_key'
28
- * });
26
+ * const valiron = new ValironSDK();
29
27
  *
30
- * // Check if agent can access production
31
- * const decision = await valiron.checkAgent('123');
32
- * if (decision.route === 'prod') {
28
+ * // Get full trust profile (identity + reputation + routing)
29
+ * const profile = await valiron.getAgentProfile('25459');
30
+ *
31
+ * if (profile.routing.finalRoute === 'prod') {
33
32
  * // Allow full production access
34
33
  * }
35
34
  * ```
36
35
  */
37
36
  class ValironSDK {
38
- constructor(config) {
39
- this.trustClient = new clients_1.TrustClient(config);
40
- this.reputationClient = new clients_1.ReputationClient(config);
37
+ constructor(config = {}) {
38
+ this.client = new clients_1.ValironClient(config);
41
39
  }
42
40
  /**
43
- * Check agent routing decision
41
+ * Get the complete trust profile for an ERC-8004 agent.
44
42
  *
45
- * This is the primary method for determining how to route requests from an agent.
46
- * Valiron automatically handles sandbox testing if the agent hasn't been evaluated.
43
+ * Returns on-chain identity, on-chain reputation (feedback count,
44
+ * average score, individual entries), local behavioral reputation
45
+ * (Valiron sandbox metrics), and a hybrid routing decision.
47
46
  *
48
47
  * @param agentId - The ERC-8004 agent ID
49
- * @returns Routing decision with detailed explanation
48
+ * @returns Full agent trust profile
50
49
  *
51
50
  * @example
52
51
  * ```typescript
53
- * const result = await valiron.checkAgent('417');
52
+ * const profile = await valiron.getAgentProfile('25459');
54
53
  *
55
- * switch (result.route) {
56
- * case 'prod':
57
- * return handleProductionRequest();
58
- * case 'prod_throttled':
59
- * return handleThrottledRequest();
60
- * case 'sandbox':
61
- * case 'sandbox_only':
62
- * return rejectRequest();
63
- * }
54
+ * console.log(profile.routing.finalRoute); // 'prod'
55
+ * console.log(profile.routing.decision); // human-readable explanation
56
+ * console.log(profile.localReputation?.tier); // 'AAA'
57
+ * console.log(profile.onchainReputation.averageScore); // 92.5
64
58
  * ```
65
59
  */
66
- async checkAgent(agentId) {
67
- return this.trustClient.checkAgent(agentId);
68
- }
69
- /**
70
- * Check wallet routing decision
71
- *
72
- * Legacy method for wallet-based routing. Prefer `checkAgent()` for ERC-8004 agents.
73
- *
74
- * @param wallet - The wallet address
75
- * @returns Routing decision
76
- */
77
- async checkWallet(wallet) {
78
- return this.trustClient.checkWallet(wallet);
60
+ async getAgentProfile(agentId) {
61
+ return this.client.getAgentProfile(agentId);
79
62
  }
80
63
  /**
81
- * Get complete agent trust profile
64
+ * Convenience helper get just the routing decision for an agent.
82
65
  *
83
- * Returns comprehensive trust data including on-chain reputation,
84
- * behavioral analysis scores, and routing logic.
66
+ * This calls `getAgentProfile` under the hood and extracts the
67
+ * `routing.finalRoute` field.
85
68
  *
86
69
  * @param agentId - The ERC-8004 agent ID
87
- * @returns Complete agent profile
70
+ * @returns The route decision string
88
71
  *
89
72
  * @example
90
73
  * ```typescript
91
- * const profile = await valiron.getAgentProfile('417');
92
- * console.log(`Agent score: ${profile.localReputation?.score}`);
93
- * console.log(`Tier: ${profile.localReputation?.tier}`);
94
- * console.log(`On-chain feedback: ${profile.onchainReputation.count} entries`);
74
+ * const route = await valiron.checkAgent('25459');
75
+ * if (route === 'prod' || route === 'prod_throttled') {
76
+ * return handleRequest();
77
+ * }
95
78
  * ```
96
79
  */
97
- async getAgentProfile(agentId) {
98
- return this.trustClient.getAgentProfile(agentId);
99
- }
100
- /**
101
- * Get wallet profile
102
- *
103
- * @param wallet - The wallet address
104
- * @returns Wallet profile with routing info
105
- */
106
- async getWalletProfile(wallet) {
107
- return this.trustClient.getWalletProfile(wallet);
80
+ async checkAgent(agentId) {
81
+ const profile = await this.client.getAgentProfile(agentId);
82
+ return profile.routing.finalRoute;
108
83
  }
109
84
  /**
110
- * Submit feedback about an agent's behavior
85
+ * Get a trust profile by wallet address (reverse lookup).
111
86
  *
112
- * This allows you to report an agent's behavior to Valiron.
113
- * Valiron handles IPFS storage and on-chain submission automatically.
87
+ * If the wallet has an associated agent ID in local state, the full
88
+ * profile (identity + on-chain reputation) is included. Otherwise
89
+ * only local behavioral data is returned.
114
90
  *
115
- * @param params - Feedback parameters
116
- * @returns Submission result with transaction hash
91
+ * @param wallet - Ethereum wallet address
92
+ * @returns Wallet trust profile
117
93
  *
118
94
  * @example
119
95
  * ```typescript
120
- * await valiron.submitFeedback({
121
- * agentId: '417',
122
- * score: 95,
123
- * outcome: 'success',
124
- * metadata: {
125
- * taskType: 'data_processing',
126
- * duration: 1234
127
- * }
128
- * });
96
+ * const profile = await valiron.getWalletProfile('0x52ce…');
97
+ * console.log(profile.routing.finalRoute);
129
98
  * ```
130
99
  */
131
- async submitFeedback(params) {
132
- return this.reputationClient.submitFeedback(params);
100
+ async getWalletProfile(wallet) {
101
+ return this.client.getWalletProfile(wallet);
133
102
  }
134
103
  /**
135
- * Manually trigger sandbox testing
104
+ * Trigger real sandbox testing for an agent.
136
105
  *
137
- * Useful for re-evaluating an agent or testing specific scenarios.
106
+ * Sends a series of test requests against the agent's HTTP endpoint
107
+ * (if registered on-chain) or through the sandbox relay, then computes
108
+ * a Valiron behavioral score and stores the result.
138
109
  *
139
- * @param params - Sandbox test parameters
140
- * @returns Test trigger result
110
+ * @param agentId - The ERC-8004 agent ID
111
+ * @returns Sandbox test results including score, tier, and metrics
141
112
  *
142
113
  * @example
143
114
  * ```typescript
144
- * await valiron.triggerSandboxTest({
145
- * agentId: '417',
146
- * behaviorType: 'good'
147
- * });
115
+ * const result = await valiron.triggerSandboxTest('25459');
116
+ * console.log(result.valironScore); // 95
117
+ * console.log(result.tier); // 'AAA'
118
+ * console.log(result.riskLevel); // 'GREEN'
119
+ * console.log(result.testSummary); // { totalRequests, successCount, … }
148
120
  * ```
149
121
  */
150
- async triggerSandboxTest(params) {
151
- return this.reputationClient.triggerSandboxTest(params);
122
+ async triggerSandboxTest(agentId) {
123
+ return this.client.triggerSandboxTest(agentId);
152
124
  }
153
125
  }
154
126
  exports.ValironSDK = ValironSDK;
155
- // Export everything
127
+ // Re-export everything
156
128
  __exportStar(require("./types"), exports);
157
- __exportStar(require("./clients"), exports);
129
+ var clients_2 = require("./clients");
130
+ Object.defineProperty(exports, "ValironClient", { enumerable: true, get: function () { return clients_2.ValironClient; } });
158
131
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,uCAA0D;AAU1D;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAa,UAAU;IAIrB,YAAY,MAAqB;QAC/B,IAAI,CAAC,WAAW,GAAG,IAAI,qBAAW,CAAC,MAAM,CAAC,CAAC;QAC3C,IAAI,CAAC,gBAAgB,GAAG,IAAI,0BAAgB,CAAC,MAAM,CAAC,CAAC;IACvD,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,KAAK,CAAC,UAAU,CAAC,OAAe;QAC9B,OAAO,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IAC9C,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,WAAW,CAAC,MAAc;QAC9B,OAAO,IAAI,CAAC,WAAW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O,CAAC,CAAC;QAC3D,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC;IACpC,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,KAAK,CAAC,gBAAgB,CAAC,MAAc;QACnC,OAAO,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAC9C,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,KAAK,CAAC,kBAAkB,CAAC,OAAe;QACtC,OAAO,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;IACjD,CAAC;CACF;AA/FD,gCA+FC;AAED,uBAAuB;AACvB,0CAAwB;AACxB,qCAA0C;AAAjC,wGAAA,aAAa,OAAA"}
package/dist/types.d.ts CHANGED
@@ -1,25 +1,44 @@
1
1
  /**
2
2
  * Valiron SDK Types
3
3
  *
4
- * Type definitions for the Valiron Trust Layer API
4
+ * Type definitions for the Valiron Operator API
5
+ * Matches the actual edge-proxy /operator/* endpoints
5
6
  */
6
- export type RouteDecision = 'prod' | 'prod_throttled' | 'sandbox' | 'sandbox_only';
7
- export type RiskLevel = 'GREEN' | 'YELLOW' | 'RED';
8
- export type MoodysRating = 'AAA' | 'AA' | 'A' | 'BAA' | 'BA' | 'B' | 'CAA' | 'CA' | 'C';
9
- export interface OnChainReputation {
10
- feedbackCount: number;
11
- averageScore: number;
12
- agentId?: string;
13
- wallet?: string;
7
+ export type RouteDecision = "prod" | "prod_throttled" | "sandbox" | "sandbox_only";
8
+ export type RiskLevel = "GREEN" | "YELLOW" | "RED";
9
+ export type MoodysRating = "AAA" | "AA" | "A" | "BAA" | "BA" | "B" | "CAA" | "CA" | "C";
10
+ export interface AgentIdentity {
11
+ agentId: string;
12
+ wallet: string;
13
+ tokenUri: string;
14
+ name: string;
15
+ image: string;
16
+ description: string;
17
+ /** ERC-8004 endpoints, e.g. { agentWallet: "eip155:1:0x…", api: "https://…" } */
18
+ endpoints: Record<string, string>;
19
+ trustModels: string[];
20
+ /** Any additional metadata from the Agent Registration File */
21
+ [key: string]: unknown;
14
22
  }
15
- export interface LocalReputation {
23
+ export interface FeedbackEntry {
24
+ from: string;
16
25
  score: number;
17
- tier: MoodysRating;
18
- riskLevel: RiskLevel;
19
- graduated?: boolean;
20
- metrics?: BehavioralMetrics;
21
- ipfsCid?: string;
22
- updatedAt?: number;
26
+ tag1: string;
27
+ tag2: string;
28
+ uri: string;
29
+ hash: string;
30
+ blockNumber: string;
31
+ transactionHash: string;
32
+ feedbackIndex?: string;
33
+ indexedTag1?: string;
34
+ endpoint?: string;
35
+ }
36
+ export interface OnchainReputation {
37
+ count: string;
38
+ averageScore: number;
39
+ feedbackEntries: FeedbackEntry[];
40
+ totalFeedback: number;
41
+ error?: string;
23
42
  }
24
43
  export interface BehavioralMetrics {
25
44
  loops?: number;
@@ -28,63 +47,86 @@ export interface BehavioralMetrics {
28
47
  errorRate?: number;
29
48
  averageLatency?: number;
30
49
  burstiness?: number;
50
+ onChainFeedbackCount?: number;
51
+ onChainAverageScore?: number;
31
52
  }
32
- export interface RoutingResponse {
33
- route: RouteDecision;
34
- reason: string;
35
- onChainData?: OnChainReputation;
36
- localReputation?: LocalReputation;
37
- explanation: string;
53
+ export interface LocalReputation {
54
+ exists: boolean;
55
+ score?: number;
56
+ tier?: MoodysRating | string;
57
+ riskLevel?: RiskLevel | string;
58
+ graduated?: boolean;
59
+ metrics?: BehavioralMetrics;
60
+ ipfsCid?: string | null;
61
+ agentId?: string | null;
62
+ lastUpdated?: string | null;
63
+ message?: string;
64
+ error?: string;
38
65
  }
39
- export interface AgentIdentity {
40
- agentId: string;
41
- wallet: string;
42
- name?: string;
43
- description?: string;
44
- image?: string;
45
- endpoints?: string[];
46
- externalUri?: string;
66
+ export interface RoutingSignals {
67
+ onchain: {
68
+ feedbackCount: number;
69
+ averageScore: number;
70
+ threshold: string;
71
+ };
72
+ local: {
73
+ exists: boolean;
74
+ graduated: boolean;
75
+ tier: string;
76
+ riskLevel: string;
77
+ score: number;
78
+ };
47
79
  }
48
- export interface FeedbackEntry {
49
- clientAddress: string;
50
- score: number;
51
- timestamp: number;
52
- tag1?: string;
53
- tag2?: string;
54
- endpoint?: string;
55
- feedbackURI?: string;
56
- feedbackHash?: string;
57
- revoked?: boolean;
58
- response?: string;
80
+ export interface RoutingExplanation {
81
+ finalRoute: RouteDecision;
82
+ decision: string;
83
+ reasons: string[];
84
+ signals: RoutingSignals;
59
85
  }
86
+ /**
87
+ * Response from `GET /operator/agent/:agentId`
88
+ */
60
89
  export interface AgentProfile {
61
90
  agentId: string;
62
91
  identity: AgentIdentity;
63
- onchainReputation: {
64
- count: number;
65
- averageScore: number;
66
- feedbackEntries: FeedbackEntry[];
67
- };
68
- localReputation?: LocalReputation;
69
- routing: {
70
- finalRoute: RouteDecision;
71
- decision: string;
72
- reasons: string[];
73
- signals: {
74
- onChainQualifies: boolean;
75
- hasLocalReputation: boolean;
76
- localRiskLevel?: RiskLevel;
77
- };
78
- };
92
+ onchainReputation: OnchainReputation;
93
+ localReputation: LocalReputation | null;
94
+ routing: RoutingExplanation;
95
+ timestamp: string;
79
96
  }
97
+ /**
98
+ * Response from `GET /operator/wallet/:wallet`
99
+ */
80
100
  export interface WalletProfile {
81
101
  wallet: string;
82
- agentId?: string;
83
- route: RouteDecision;
84
- score?: number;
85
- tier?: MoodysRating;
86
- onChainData?: OnChainReputation;
87
- localReputation?: LocalReputation;
102
+ agentId: string | null;
103
+ identity: AgentIdentity | null;
104
+ onchainReputation: OnchainReputation | null;
105
+ localReputation: LocalReputation | null;
106
+ routing: RoutingExplanation;
107
+ timestamp: string;
108
+ }
109
+ export interface SandboxTestSummary {
110
+ totalRequests: number;
111
+ successCount: number;
112
+ rateLimitCount: number;
113
+ errorCount: number;
114
+ avgLatencyMs: number;
115
+ }
116
+ /**
117
+ * Response from `POST /operator/trigger-sandbox/:agentId`
118
+ */
119
+ export interface SandboxResult {
120
+ ok: boolean;
121
+ agentId: string;
122
+ wallet: string;
123
+ mode: "endpoint-probe" | "sandbox-relay";
124
+ metrics: BehavioralMetrics;
125
+ valironScore: number;
126
+ tier: MoodysRating;
127
+ riskLevel: RiskLevel;
128
+ testSummary: SandboxTestSummary;
129
+ message: string;
88
130
  }
89
131
  export interface ValironConfig {
90
132
  /**
@@ -108,16 +150,6 @@ export interface ValironConfig {
108
150
  */
109
151
  debug?: boolean;
110
152
  }
111
- export interface SubmitFeedbackParams {
112
- agentId: string;
113
- score: number;
114
- outcome: 'success' | 'failure';
115
- metadata?: Record<string, any>;
116
- }
117
- export interface SandboxTestParams {
118
- agentId: string;
119
- behaviorType?: 'good' | 'moderate' | 'bad';
120
- }
121
153
  export declare class ValironError extends Error {
122
154
  code: string;
123
155
  statusCode?: number | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,gBAAgB,GAAG,SAAS,GAAG,cAAc,CAAC;AAEnF,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;AAEnD,MAAM,MAAM,YAAY,GACpB,KAAK,GACL,IAAI,GACJ,GAAG,GACH,KAAK,GACL,IAAI,GACJ,GAAG,GACH,KAAK,GACL,IAAI,GACJ,GAAG,CAAC;AAER,MAAM,WAAW,iBAAiB;IAChC,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,YAAY,CAAC;IACnB,SAAS,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;I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C;IACzC,OAAO,EAAE,iBAAiB,CAAC;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,YAAY,CAAC;IACnB,SAAS,EAAE,SAAS,CAAC;IACrB,WAAW,EAAE,kBAAkB,CAAC;IAChC,OAAO,EAAE,MAAM,CAAC;CACjB;AAID,MAAM,WAAW,aAAa;IAC5B;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAID,qBAAa,YAAa,SAAQ,KAAK;IAG5B,IAAI,EAAE,MAAM;IACZ,UAAU,CAAC,EAAE,MAAM;gBAF1B,OAAO,EAAE,MAAM,EACR,IAAI,EAAE,MAAM,EACZ,UAAU,CAAC,EAAE,MAAM,YAAA;CAK7B"}
package/dist/types.js CHANGED
@@ -2,16 +2,18 @@
2
2
  /**
3
3
  * Valiron SDK Types
4
4
  *
5
- * Type definitions for the Valiron Trust Layer API
5
+ * Type definitions for the Valiron Operator API
6
+ * Matches the actual edge-proxy /operator/* endpoints
6
7
  */
7
8
  Object.defineProperty(exports, "__esModule", { value: true });
8
9
  exports.ValironError = void 0;
10
+ // ─── Errors ─────────────────────────────────────────────────────────────────
9
11
  class ValironError extends Error {
10
12
  constructor(message, code, statusCode) {
11
13
  super(message);
12
14
  this.code = code;
13
15
  this.statusCode = statusCode;
14
- this.name = 'ValironError';
16
+ this.name = "ValironError";
15
17
  }
16
18
  }
17
19
  exports.ValironError = ValironError;
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AA+IH,MAAa,YAAa,SAAQ,KAAK;IACrC,YACE,OAAe,EACR,IAAY,EACZ,UAAmB;QAE1B,KAAK,CAAC,OAAO,CAAC,CAAC;QAHR,SAAI,GAAJ,IAAI,CAAQ;QACZ,eAAU,GAAV,UAAU,CAAS;QAG1B,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;IAC7B,CAAC;CACF;AATD,oCASC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAmMH,+EAA+E;AAE/E,MAAa,YAAa,SAAQ,KAAK;IACrC,YACE,OAAe,EACR,IAAY,EACZ,UAAmB;QAE1B,KAAK,CAAC,OAAO,CAAC,CAAC;QAHR,SAAI,GAAJ,IAAI,CAAQ;QACZ,eAAU,GAAV,UAAU,CAAS;QAG1B,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;IAC7B,CAAC;CACF;AATD,oCASC"}
package/package.json CHANGED
@@ -1,18 +1,12 @@
1
1
  {
2
2
  "name": "@valiron/sdk",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "description": "Official TypeScript SDK for Valiron - Trust Layer for Agentic Economy",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "engines": {
8
8
  "node": ">=18.0.0"
9
9
  },
10
- "scripts": {
11
- "build": "tsc",
12
- "dev": "tsc --watch",
13
- "test": "node test/validate.mjs && node test/validate-examples.mjs",
14
- "prepublishOnly": "pnpm build"
15
- },
16
10
  "keywords": [
17
11
  "valiron",
18
12
  "ai-agents",
@@ -37,5 +31,10 @@
37
31
  "files": [
38
32
  "dist",
39
33
  "README.md"
40
- ]
41
- }
34
+ ],
35
+ "scripts": {
36
+ "build": "tsc",
37
+ "dev": "tsc --watch",
38
+ "test": "node test/validate.mjs && node test/validate-examples.mjs"
39
+ }
40
+ }