@openagentmarket/create-agent 1.5.0 → 1.5.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/index.js +28 -6
- package/package.json +8 -8
- package/src/index.ts +28 -6
package/dist/index.js
CHANGED
|
@@ -201,15 +201,37 @@ async function scaffoldHirer() {
|
|
|
201
201
|
` const reg = item.registrationFile || {};`,
|
|
202
202
|
` const name = reg.name || "Unknown";`,
|
|
203
203
|
` const desc = reg.description || "";`,
|
|
204
|
-
` // Find xmtpAddress from metadata array`,
|
|
205
|
-
` const meta = item.metadata || [];`,
|
|
206
|
-
` let addr = item.owner || "?";`,
|
|
207
|
-
` const walletMeta = meta.find((m: any) => m.key === "agentWallet");`,
|
|
208
|
-
` if (walletMeta) addr = walletMeta.value;`,
|
|
209
204
|
` const agentId = item.agentId || "";`,
|
|
205
|
+
``,
|
|
206
|
+
` // Extract XMTP chat address from a2aEndpoint or endpointsRawJson`,
|
|
207
|
+
` let chatAddr = "";`,
|
|
208
|
+
` try {`,
|
|
209
|
+
` // Primary: use a2aEndpoint (always present)`,
|
|
210
|
+
` if (reg.a2aEndpoint && reg.a2aEndpoint.includes("openagent.market/chat")) {`,
|
|
211
|
+
` const url = new URL(reg.a2aEndpoint);`,
|
|
212
|
+
` chatAddr = url.searchParams.get("agent") || "";`,
|
|
213
|
+
` }`,
|
|
214
|
+
` // Fallback: try endpointsRawJson`,
|
|
215
|
+
` if (!chatAddr) {`,
|
|
216
|
+
` const services = JSON.parse(reg.endpointsRawJson || "[]");`,
|
|
217
|
+
` for (const svc of services) {`,
|
|
218
|
+
` if (svc.endpoint && svc.endpoint.includes("openagent.market/chat")) {`,
|
|
219
|
+
` const url = new URL(svc.endpoint);`,
|
|
220
|
+
` chatAddr = url.searchParams.get("agent") || "";`,
|
|
221
|
+
` break;`,
|
|
222
|
+
` }`,
|
|
223
|
+
` }`,
|
|
224
|
+
` }`,
|
|
225
|
+
` } catch {}`,
|
|
226
|
+
``,
|
|
227
|
+
` // Last resort: owner address`,
|
|
228
|
+
` if (!chatAddr) chatAddr = item.owner || "?";`,
|
|
229
|
+
``,
|
|
210
230
|
` console.log(" 🤖 " + name + (agentId ? " (#" + agentId + ")" : ""));`,
|
|
211
231
|
` if (desc) console.log(" " + desc.slice(0, 120) + (desc.length > 120 ? "..." : ""));`,
|
|
212
|
-
` console.log("
|
|
232
|
+
` console.log(" Chat: /chat " + chatAddr + " <message>");`,
|
|
233
|
+
` const numericId = (agentId || "").split(":").pop() || "";`,
|
|
234
|
+
` if (numericId) console.log(" Profile: https://8004agents.ai/base/agent/" + numericId);`,
|
|
213
235
|
` console.log("");`,
|
|
214
236
|
` }`,
|
|
215
237
|
` console.log("Total: " + data.items.length + " agent(s)");`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openagentmarket/create-agent",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.2",
|
|
4
4
|
"description": "CLI to scaffold a new OpenAgent project (hirer or worker)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -12,15 +12,15 @@
|
|
|
12
12
|
"start": "node dist/index.js"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"
|
|
16
|
-
"kleur": "^4.1.5",
|
|
15
|
+
"ethers": "^6.16.0",
|
|
17
16
|
"fs-extra": "^11.2.0",
|
|
18
|
-
"
|
|
17
|
+
"kleur": "^4.1.5",
|
|
18
|
+
"prompts": "^2.4.2"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@types/prompts": "^2.4.9",
|
|
22
21
|
"@types/fs-extra": "^11.0.4",
|
|
23
|
-
"
|
|
24
|
-
"@types/
|
|
22
|
+
"@types/node": "^20.11.20",
|
|
23
|
+
"@types/prompts": "^2.4.9",
|
|
24
|
+
"typescript": "^5.3.3"
|
|
25
25
|
}
|
|
26
|
-
}
|
|
26
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -216,15 +216,37 @@ async function scaffoldHirer() {
|
|
|
216
216
|
` const reg = item.registrationFile || {};`,
|
|
217
217
|
` const name = reg.name || "Unknown";`,
|
|
218
218
|
` const desc = reg.description || "";`,
|
|
219
|
-
` // Find xmtpAddress from metadata array`,
|
|
220
|
-
` const meta = item.metadata || [];`,
|
|
221
|
-
` let addr = item.owner || "?";`,
|
|
222
|
-
` const walletMeta = meta.find((m: any) => m.key === "agentWallet");`,
|
|
223
|
-
` if (walletMeta) addr = walletMeta.value;`,
|
|
224
219
|
` const agentId = item.agentId || "";`,
|
|
220
|
+
``,
|
|
221
|
+
` // Extract XMTP chat address from a2aEndpoint or endpointsRawJson`,
|
|
222
|
+
` let chatAddr = "";`,
|
|
223
|
+
` try {`,
|
|
224
|
+
` // Primary: use a2aEndpoint (always present)`,
|
|
225
|
+
` if (reg.a2aEndpoint && reg.a2aEndpoint.includes("openagent.market/chat")) {`,
|
|
226
|
+
` const url = new URL(reg.a2aEndpoint);`,
|
|
227
|
+
` chatAddr = url.searchParams.get("agent") || "";`,
|
|
228
|
+
` }`,
|
|
229
|
+
` // Fallback: try endpointsRawJson`,
|
|
230
|
+
` if (!chatAddr) {`,
|
|
231
|
+
` const services = JSON.parse(reg.endpointsRawJson || "[]");`,
|
|
232
|
+
` for (const svc of services) {`,
|
|
233
|
+
` if (svc.endpoint && svc.endpoint.includes("openagent.market/chat")) {`,
|
|
234
|
+
` const url = new URL(svc.endpoint);`,
|
|
235
|
+
` chatAddr = url.searchParams.get("agent") || "";`,
|
|
236
|
+
` break;`,
|
|
237
|
+
` }`,
|
|
238
|
+
` }`,
|
|
239
|
+
` }`,
|
|
240
|
+
` } catch {}`,
|
|
241
|
+
``,
|
|
242
|
+
` // Last resort: owner address`,
|
|
243
|
+
` if (!chatAddr) chatAddr = item.owner || "?";`,
|
|
244
|
+
``,
|
|
225
245
|
` console.log(" 🤖 " + name + (agentId ? " (#" + agentId + ")" : ""));`,
|
|
226
246
|
` if (desc) console.log(" " + desc.slice(0, 120) + (desc.length > 120 ? "..." : ""));`,
|
|
227
|
-
` console.log("
|
|
247
|
+
` console.log(" Chat: /chat " + chatAddr + " <message>");`,
|
|
248
|
+
` const numericId = (agentId || "").split(":").pop() || "";`,
|
|
249
|
+
` if (numericId) console.log(" Profile: https://8004agents.ai/base/agent/" + numericId);`,
|
|
228
250
|
` console.log("");`,
|
|
229
251
|
` }`,
|
|
230
252
|
` console.log("Total: " + data.items.length + " agent(s)");`,
|