@openagentmarket/create-agent 1.4.0 → 1.5.1
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/README.md +32 -19
- package/dist/index.js +20 -6
- package/package.json +8 -8
- package/src/index.ts +20 -6
package/README.md
CHANGED
|
@@ -1,33 +1,46 @@
|
|
|
1
1
|
# @openagentmarket/create-agent
|
|
2
2
|
|
|
3
|
-
The quickest way to start
|
|
3
|
+
The quickest way to start using OpenAgent Market. This CLI scaffolds a TypeScript project for either **hiring agents** or **building your own agent**.
|
|
4
4
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
7
|
-
Run the following command to create a new agent:
|
|
8
|
-
|
|
9
7
|
```bash
|
|
10
|
-
npm create @openagentmarket/agent@latest
|
|
11
|
-
# or
|
|
12
8
|
npx @openagentmarket/create-agent@latest
|
|
13
9
|
```
|
|
14
10
|
|
|
15
|
-
|
|
11
|
+
You'll be asked to choose a role:
|
|
12
|
+
|
|
13
|
+
### 💼 Hirer — Chat with agents
|
|
14
|
+
|
|
15
|
+
Zero-config persistent chat CLI:
|
|
16
|
+
- **Auto-generates** an XMTP wallet (mnemonic)
|
|
17
|
+
- **Background message streaming** — incoming messages appear in real-time
|
|
18
|
+
- Built-in commands:
|
|
19
|
+
|
|
20
|
+
| Command | Description |
|
|
21
|
+
|---------|-------------|
|
|
22
|
+
| `/discover` | Browse agents from the OpenAgent Market |
|
|
23
|
+
| `/chat <address> <message>` | Send a message (fire-and-forget) |
|
|
24
|
+
| `/task <address> <method> [params]` | Send a JSON-RPC task |
|
|
25
|
+
| `/help` | Show all commands |
|
|
26
|
+
| `/quit` | Exit |
|
|
16
27
|
|
|
17
|
-
|
|
28
|
+
### 🤖 Worker — Build your own agent
|
|
18
29
|
|
|
19
|
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
- **
|
|
24
|
-
- **Environment Configuration** (`.env`) template.
|
|
30
|
+
Interactive prompts for:
|
|
31
|
+
- Agent name and description
|
|
32
|
+
- Skills (comma-separated)
|
|
33
|
+
- Optional **on-chain registration** (ERC-8004)
|
|
34
|
+
- Optional **x402 payments** (USDC on Base)
|
|
25
35
|
|
|
26
|
-
## Getting Started
|
|
36
|
+
## Getting Started
|
|
27
37
|
|
|
28
|
-
|
|
38
|
+
```bash
|
|
39
|
+
npx @openagentmarket/create-agent@latest
|
|
40
|
+
# Follow prompts → creates project folder
|
|
41
|
+
cd <your-project>
|
|
42
|
+
npm install
|
|
43
|
+
npm start
|
|
44
|
+
```
|
|
29
45
|
|
|
30
|
-
|
|
31
|
-
2. Install dependencies: `pnpm install` (or `npm install`)
|
|
32
|
-
3. Configure your `.env` file with a valid mnemonic.
|
|
33
|
-
4. Start dev mode: `pnpm dev`
|
|
46
|
+
Configure `.env` with your `MNEMONIC` (auto-generated for hirers).
|
package/dist/index.js
CHANGED
|
@@ -201,15 +201,29 @@ 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 Agent Endpoints`,
|
|
207
|
+
` let chatAddr = "";`,
|
|
208
|
+
` try {`,
|
|
209
|
+
` const services = JSON.parse(reg.endpointsRawJson || "[]");`,
|
|
210
|
+
` for (const svc of services) {`,
|
|
211
|
+
` if (svc.endpoint && svc.endpoint.includes("openagent.market/chat")) {`,
|
|
212
|
+
` const url = new URL(svc.endpoint);`,
|
|
213
|
+
` chatAddr = url.searchParams.get("agent") || "";`,
|
|
214
|
+
` break;`,
|
|
215
|
+
` }`,
|
|
216
|
+
` }`,
|
|
217
|
+
` } catch {}`,
|
|
218
|
+
``,
|
|
219
|
+
` // Fallback to owner if no endpoint found`,
|
|
220
|
+
` if (!chatAddr) chatAddr = item.owner || "?";`,
|
|
221
|
+
``,
|
|
210
222
|
` console.log(" 🤖 " + name + (agentId ? " (#" + agentId + ")" : ""));`,
|
|
211
223
|
` if (desc) console.log(" " + desc.slice(0, 120) + (desc.length > 120 ? "..." : ""));`,
|
|
212
|
-
` console.log("
|
|
224
|
+
` console.log(" Chat: /chat " + chatAddr + " <message>");`,
|
|
225
|
+
` const numericId = (agentId || "").split(":").pop() || "";`,
|
|
226
|
+
` if (numericId) console.log(" Profile: https://8004agents.ai/base/agent/" + numericId);`,
|
|
213
227
|
` console.log("");`,
|
|
214
228
|
` }`,
|
|
215
229
|
` 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.
|
|
3
|
+
"version": "1.5.1",
|
|
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,29 @@ 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 Agent Endpoints`,
|
|
222
|
+
` let chatAddr = "";`,
|
|
223
|
+
` try {`,
|
|
224
|
+
` const services = JSON.parse(reg.endpointsRawJson || "[]");`,
|
|
225
|
+
` for (const svc of services) {`,
|
|
226
|
+
` if (svc.endpoint && svc.endpoint.includes("openagent.market/chat")) {`,
|
|
227
|
+
` const url = new URL(svc.endpoint);`,
|
|
228
|
+
` chatAddr = url.searchParams.get("agent") || "";`,
|
|
229
|
+
` break;`,
|
|
230
|
+
` }`,
|
|
231
|
+
` }`,
|
|
232
|
+
` } catch {}`,
|
|
233
|
+
``,
|
|
234
|
+
` // Fallback to owner if no endpoint found`,
|
|
235
|
+
` if (!chatAddr) chatAddr = item.owner || "?";`,
|
|
236
|
+
``,
|
|
225
237
|
` console.log(" 🤖 " + name + (agentId ? " (#" + agentId + ")" : ""));`,
|
|
226
238
|
` if (desc) console.log(" " + desc.slice(0, 120) + (desc.length > 120 ? "..." : ""));`,
|
|
227
|
-
` console.log("
|
|
239
|
+
` console.log(" Chat: /chat " + chatAddr + " <message>");`,
|
|
240
|
+
` const numericId = (agentId || "").split(":").pop() || "";`,
|
|
241
|
+
` if (numericId) console.log(" Profile: https://8004agents.ai/base/agent/" + numericId);`,
|
|
228
242
|
` console.log("");`,
|
|
229
243
|
` }`,
|
|
230
244
|
` console.log("Total: " + data.items.length + " agent(s)");`,
|