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 +1 -0
- package/dist/client.js +10 -2
- package/package.json +1 -1
- package/src/client.ts +11 -3
package/dist/client.d.ts
CHANGED
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
|
-
|
|
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
|
-
|
|
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
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
|
-
|
|
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
|
-
|
|
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[]> {
|