dactyclaw 1.6.0 → 1.6.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/bin/dactyclaw.js +2 -2
- package/bin_creator.js +1 -1
- package/index.html +2 -5
- package/package.json +1 -1
- package/proxy.js +30 -0
package/bin/dactyclaw.js
CHANGED
|
@@ -165,8 +165,8 @@ program
|
|
|
165
165
|
|
|
166
166
|
// [Dactyclaw Database Sync] - Push Directly to Live Agents Monitor
|
|
167
167
|
try {
|
|
168
|
-
const binId = '
|
|
169
|
-
const apiKey = '$2a$10$
|
|
168
|
+
const binId = '69a2ff58d0ea881f40e21084';
|
|
169
|
+
const apiKey = '$2a$10$52cNICm.70qXCx0qkKBG5erLYGg1HMceR1gT4OOPOe5uzCiAJShOG';
|
|
170
170
|
|
|
171
171
|
// 1. GET current
|
|
172
172
|
const resGet = await fetch(`https://api.jsonbin.io/v3/b/${binId}`, {
|
package/bin_creator.js
CHANGED
|
@@ -13,5 +13,5 @@ fetch('https://api.jsonbin.io/v3/b', {
|
|
|
13
13
|
body: bodyData
|
|
14
14
|
})
|
|
15
15
|
.then(r => r.json())
|
|
16
|
-
.then(data => console.log('
|
|
16
|
+
.then(data => console.log('MASTER_BIN_ID_CREATED:', data.metadata.id))
|
|
17
17
|
.catch(err => console.error(err));
|
package/index.html
CHANGED
|
@@ -1279,7 +1279,6 @@
|
|
|
1279
1279
|
const topTokensList = topData.success && topData.tokens ? topData.tokens : allTokens;
|
|
1280
1280
|
renderTop5(topTokensList);
|
|
1281
1281
|
renderTokenTable();
|
|
1282
|
-
renderAgentsTable();
|
|
1283
1282
|
updateTimestamp();
|
|
1284
1283
|
|
|
1285
1284
|
if (!autoRefreshInterval) {
|
|
@@ -1403,10 +1402,8 @@
|
|
|
1403
1402
|
loadMoreBtn.style.display = 'none';
|
|
1404
1403
|
|
|
1405
1404
|
try {
|
|
1406
|
-
// Fetch direct from
|
|
1407
|
-
const response = await fetch('
|
|
1408
|
-
headers: { 'X-Master-Key': '$2a$10$aBB0ydwfYD6iKCDgPTjoo.bnBEzpzgTPDr.VjkObebVlsc5azZHpm' }
|
|
1409
|
-
});
|
|
1405
|
+
// Fetch direct from Local Proxy (bypasses CORS & hides API Key)
|
|
1406
|
+
const response = await fetch('http://127.0.0.1:5500/api/dactyclaw-agents');
|
|
1410
1407
|
|
|
1411
1408
|
if (!response.ok) throw new Error('Database unreachable');
|
|
1412
1409
|
const data = await response.json();
|
package/package.json
CHANGED
package/proxy.js
CHANGED
|
@@ -86,6 +86,36 @@ const server = http.createServer((req, res) => {
|
|
|
86
86
|
proxyReq.end();
|
|
87
87
|
return;
|
|
88
88
|
}
|
|
89
|
+
// Proxy /api/dactyclaw-agents to JSONBin Live Database
|
|
90
|
+
if (req.url === '/api/dactyclaw-agents' || req.url.startsWith('/api/dactyclaw-agents?')) {
|
|
91
|
+
console.log('[DEBUG] JSONBIN PROXY HIT:', req.url);
|
|
92
|
+
const options = {
|
|
93
|
+
hostname: 'api.jsonbin.io',
|
|
94
|
+
path: '/v3/b/69a2ff58d0ea881f40e21084',
|
|
95
|
+
method: 'GET',
|
|
96
|
+
headers: {
|
|
97
|
+
'X-Master-Key': '$2a$10$52cNICm.70qXCx0qkKBG5erLYGg1HMceR1gT4OOPOe5uzCiAJShOG',
|
|
98
|
+
'X-Access-Key': '$2a$10$52cNICm.70qXCx0qkKBG5erLYGg1HMceR1gT4OOPOe5uzCiAJShOG',
|
|
99
|
+
'User-Agent': 'dactyclaw/1.6'
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
const proxyReq = https.request(options, (proxyRes) => {
|
|
103
|
+
console.log('[DEBUG] JSONBIN RESP STATUS:', proxyRes.statusCode);
|
|
104
|
+
res.writeHead(proxyRes.statusCode, {
|
|
105
|
+
...corsHeaders,
|
|
106
|
+
'Content-Type': 'application/json',
|
|
107
|
+
'Cache-Control': 'no-store', // Always fresh logs
|
|
108
|
+
});
|
|
109
|
+
proxyRes.pipe(res);
|
|
110
|
+
});
|
|
111
|
+
proxyReq.on('error', (err) => {
|
|
112
|
+
console.error('[DEBUG] JSONBIN ERROR:', err.message);
|
|
113
|
+
res.writeHead(500, corsHeaders);
|
|
114
|
+
res.end(JSON.stringify({ success: false, error: err.message }));
|
|
115
|
+
});
|
|
116
|
+
proxyReq.end();
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
89
119
|
|
|
90
120
|
// Serve static files
|
|
91
121
|
let filePath = path.join(__dirname, req.url === '/' ? 'index.html' : req.url.split('?')[0]);
|