agentdex-cli 0.2.0 → 0.2.2

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/client.d.ts CHANGED
@@ -69,6 +69,7 @@ export declare class AgentdexClient {
69
69
  register(event: object): Promise<any>;
70
70
  registerStatus(paymentHash: string): Promise<{
71
71
  paid: boolean;
72
+ status?: string;
72
73
  agent?: object;
73
74
  }>;
74
75
  claim(name: string, event: object): Promise<ClaimResult>;
package/dist/client.js CHANGED
@@ -36,7 +36,11 @@ export class AgentdexClient {
36
36
  }
37
37
  async registerStatus(paymentHash) {
38
38
  const res = await this.fetch(`/api/v1/agents/register/status?payment_hash=${encodeURIComponent(paymentHash)}`);
39
- return res.json();
39
+ const data = await res.json();
40
+ // API returns { status: "paid" | "completed" | "pending" | "expired" }
41
+ // Normalize to { paid: true/false } for CLI consumption
42
+ data.paid = data.status === 'paid' || data.status === 'completed';
43
+ return data;
40
44
  }
41
45
  async claim(name, event) {
42
46
  const res = await this.fetch('/api/v1/agents/claim', {
@@ -51,7 +55,11 @@ export class AgentdexClient {
51
55
  }
52
56
  async claimStatus(paymentHash) {
53
57
  const res = await this.fetch(`/api/v1/agents/claim/status?payment_hash=${encodeURIComponent(paymentHash)}`);
54
- return res.json();
58
+ const data = await res.json();
59
+ // API returns { status: "paid" | "completed" | "pending" | "expired" }
60
+ // Normalize to { paid: true/false } for CLI consumption
61
+ data.paid = data.status === 'paid' || data.status === 'completed';
62
+ return data;
55
63
  }
56
64
  async search(options = {}) {
57
65
  const params = new URLSearchParams();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentdex-cli",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "CLI and SDK for the agentdex AI agent directory",
5
5
  "type": "module",
6
6
  "bin": {
package/src/client.ts CHANGED
@@ -102,9 +102,13 @@ export class AgentdexClient {
102
102
  return res.json();
103
103
  }
104
104
 
105
- async registerStatus(paymentHash: string): Promise<{ paid: boolean; agent?: object }> {
105
+ async registerStatus(paymentHash: string): Promise<{ paid: boolean; status?: string; agent?: object }> {
106
106
  const res = await this.fetch(`/api/v1/agents/register/status?payment_hash=${encodeURIComponent(paymentHash)}`);
107
- return res.json();
107
+ const data = await res.json();
108
+ // API returns { status: "paid" | "completed" | "pending" | "expired" }
109
+ // Normalize to { paid: true/false } for CLI consumption
110
+ data.paid = data.status === 'paid' || data.status === 'completed';
111
+ return data;
108
112
  }
109
113
 
110
114
  async claim(name: string, event: object): Promise<ClaimResult> {
@@ -121,7 +125,11 @@ export class AgentdexClient {
121
125
 
122
126
  async claimStatus(paymentHash: string): Promise<ClaimStatus> {
123
127
  const res = await this.fetch(`/api/v1/agents/claim/status?payment_hash=${encodeURIComponent(paymentHash)}`);
124
- return res.json();
128
+ const data = await res.json();
129
+ // API returns { status: "paid" | "completed" | "pending" | "expired" }
130
+ // Normalize to { paid: true/false } for CLI consumption
131
+ data.paid = data.status === 'paid' || data.status === 'completed';
132
+ return data;
125
133
  }
126
134
 
127
135
  async search(options: SearchOptions = {}): Promise<object[]> {