antenna-fyi 0.6.1 → 0.7.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/install.js +78 -19
- package/package.json +1 -1
package/install.js
CHANGED
|
@@ -1,19 +1,78 @@
|
|
|
1
|
-
// postinstall —
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
// postinstall — auto-detect agent platforms and install
|
|
2
|
+
|
|
3
|
+
import { existsSync, mkdirSync, copyFileSync } from "fs";
|
|
4
|
+
import { join, dirname } from "path";
|
|
5
|
+
import { fileURLToPath } from "url";
|
|
6
|
+
import { homedir } from "os";
|
|
7
|
+
import { execSync } from "child_process";
|
|
8
|
+
|
|
9
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
10
|
+
const __dirname = dirname(__filename);
|
|
11
|
+
const home = homedir();
|
|
12
|
+
let installed = [];
|
|
13
|
+
|
|
14
|
+
console.log("\n📡 Antenna — Nearby People Discovery\n");
|
|
15
|
+
|
|
16
|
+
// ── Hermes ────────────────────────────────────────────────────────
|
|
17
|
+
const hermesHome = join(home, ".hermes");
|
|
18
|
+
if (existsSync(hermesHome)) {
|
|
19
|
+
try {
|
|
20
|
+
// Plugin
|
|
21
|
+
const pluginDir = join(hermesHome, "plugins", "antenna");
|
|
22
|
+
const templateDir = join(__dirname, "lib", "hermes-plugin");
|
|
23
|
+
if (!existsSync(pluginDir)) mkdirSync(pluginDir, { recursive: true });
|
|
24
|
+
for (const f of ["plugin.yaml", "__init__.py", "schemas.py", "tools.py"]) {
|
|
25
|
+
const src = join(templateDir, f);
|
|
26
|
+
if (existsSync(src)) copyFileSync(src, join(pluginDir, f));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// Skill
|
|
30
|
+
const skillDir = join(hermesHome, "skills", "antenna");
|
|
31
|
+
if (!existsSync(skillDir)) mkdirSync(skillDir, { recursive: true });
|
|
32
|
+
copyFileSync(join(__dirname, "skill", "SKILL.md"), join(skillDir, "SKILL.md"));
|
|
33
|
+
|
|
34
|
+
// Deps
|
|
35
|
+
const hermesAgent = join(hermesHome, "hermes-agent");
|
|
36
|
+
if (existsSync(hermesAgent)) {
|
|
37
|
+
try {
|
|
38
|
+
execSync("uv pip install supabase", { cwd: hermesAgent, stdio: "ignore", timeout: 60_000 });
|
|
39
|
+
} catch {
|
|
40
|
+
try {
|
|
41
|
+
execSync("pip install supabase", { stdio: "ignore", timeout: 60_000 });
|
|
42
|
+
} catch { /* user can install manually */ }
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
installed.push("Hermes (Plugin + Skill + deps)");
|
|
47
|
+
} catch (e) {
|
|
48
|
+
console.log(` ⚠️ Hermes detected but setup failed: ${e.message}`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// ── OpenClaw ──────────────────────────────────────────────────────
|
|
53
|
+
const openclawHome = join(home, ".openclaw");
|
|
54
|
+
if (existsSync(openclawHome)) {
|
|
55
|
+
try {
|
|
56
|
+
const skillDir = join(openclawHome, "skills", "antenna");
|
|
57
|
+
if (!existsSync(skillDir)) mkdirSync(skillDir, { recursive: true });
|
|
58
|
+
copyFileSync(join(__dirname, "skill", "SKILL.md"), join(skillDir, "SKILL.md"));
|
|
59
|
+
installed.push("OpenClaw (Skill)");
|
|
60
|
+
} catch (e) {
|
|
61
|
+
console.log(` ⚠️ OpenClaw detected but setup failed: ${e.message}`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// ── Result ────────────────────────────────────────────────────────
|
|
66
|
+
if (installed.length > 0) {
|
|
67
|
+
console.log(" ✅ Auto-configured for: " + installed.join(", "));
|
|
68
|
+
console.log(" Restart your agent to activate.\n");
|
|
69
|
+
} else {
|
|
70
|
+
console.log(" No agent platform detected (~/.hermes or ~/.openclaw).");
|
|
71
|
+
console.log(" You can still use the CLI: antenna help\n");
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
console.log(" Quick start:");
|
|
75
|
+
console.log(" antenna setup Create your card");
|
|
76
|
+
console.log(" antenna scan --lat … --lng … Find people");
|
|
77
|
+
console.log(" antenna serve Start MCP server");
|
|
78
|
+
console.log(" antenna help Full usage\n");
|