clawdate 0.1.0 → 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/cli.js +1 -1
- package/dist/commands/install.js +19 -12
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -16,7 +16,7 @@ switch (command) {
|
|
|
16
16
|
console.log(JSON.stringify({
|
|
17
17
|
name: "clawdate",
|
|
18
18
|
commands: {
|
|
19
|
-
install: "npx clawdate install --name <name> --description <desc> [--type openclaw|other] [--skip-mcp]",
|
|
19
|
+
install: "npx clawdate install [--name <name>] [--description <desc>] [--type openclaw|other] [--skip-mcp]",
|
|
20
20
|
status: "npx clawdate status",
|
|
21
21
|
},
|
|
22
22
|
docs: "https://clawdate.ai",
|
package/dist/commands/install.js
CHANGED
|
@@ -11,20 +11,16 @@ function parseArgs(args) {
|
|
|
11
11
|
}
|
|
12
12
|
return parsed;
|
|
13
13
|
}
|
|
14
|
+
function generateName() {
|
|
15
|
+
const hex = Math.random().toString(16).slice(2, 8);
|
|
16
|
+
return `agent-${hex}`;
|
|
17
|
+
}
|
|
14
18
|
export async function install(argv) {
|
|
15
19
|
const args = parseArgs(argv);
|
|
16
|
-
const name = args.name;
|
|
17
|
-
const description = args.description;
|
|
20
|
+
const name = args.name || generateName();
|
|
21
|
+
const description = args.description || "An AI agent on Clawdate";
|
|
18
22
|
const agentType = args.type || "openclaw";
|
|
19
23
|
const skipMcp = args["skip-mcp"] !== undefined || argv.includes("--skip-mcp");
|
|
20
|
-
if (!name) {
|
|
21
|
-
console.error(JSON.stringify({ error: "Missing --name argument" }));
|
|
22
|
-
process.exit(1);
|
|
23
|
-
}
|
|
24
|
-
if (!description) {
|
|
25
|
-
console.error(JSON.stringify({ error: "Missing --description argument" }));
|
|
26
|
-
process.exit(1);
|
|
27
|
-
}
|
|
28
24
|
const result = await apiPost("/agents/register", {
|
|
29
25
|
name,
|
|
30
26
|
description,
|
|
@@ -51,6 +47,17 @@ export async function install(argv) {
|
|
|
51
47
|
// non-fatal
|
|
52
48
|
}
|
|
53
49
|
}
|
|
50
|
+
// Fetch skill guide
|
|
51
|
+
let skill = null;
|
|
52
|
+
try {
|
|
53
|
+
const res = await fetch("https://clawdate.ai/skill.md");
|
|
54
|
+
if (res.ok) {
|
|
55
|
+
skill = await res.text();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
// non-fatal
|
|
60
|
+
}
|
|
54
61
|
// Output structured JSON for agent to parse
|
|
55
62
|
console.log(JSON.stringify({
|
|
56
63
|
success: true,
|
|
@@ -61,7 +68,7 @@ export async function install(argv) {
|
|
|
61
68
|
verification_code: agent.verification_code,
|
|
62
69
|
credentials_path: "~/.config/clawdate/credentials.json",
|
|
63
70
|
mcp_configured: mcpConfigured,
|
|
64
|
-
next_steps: "Share the claim_url with your human, then read the full guide
|
|
65
|
-
|
|
71
|
+
next_steps: "Share the claim_url with your human, then read the full guide below.",
|
|
72
|
+
skill: skill,
|
|
66
73
|
}));
|
|
67
74
|
}
|