dactyclaw 1.6.0 → 1.6.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/bin/dactyclaw.js +1 -1
- package/bin_creator.js +1 -1
- package/index.html +2 -4
- package/package.json +1 -1
- package/proxy.js +30 -0
package/bin/dactyclaw.js
CHANGED
|
@@ -165,7 +165,7 @@ program
|
|
|
165
165
|
|
|
166
166
|
// [Dactyclaw Database Sync] - Push Directly to Live Agents Monitor
|
|
167
167
|
try {
|
|
168
|
-
const binId = '
|
|
168
|
+
const binId = '69a2ff58d0ea881f40e21084';
|
|
169
169
|
const apiKey = '$2a$10$aBB0ydwfYD6iKCDgPTjoo.bnBEzpzgTPDr.VjkObebVlsc5azZHpm';
|
|
170
170
|
|
|
171
171
|
// 1. GET current
|
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
|
@@ -1403,10 +1403,8 @@
|
|
|
1403
1403
|
loadMoreBtn.style.display = 'none';
|
|
1404
1404
|
|
|
1405
1405
|
try {
|
|
1406
|
-
// Fetch direct from
|
|
1407
|
-
const response = await fetch('
|
|
1408
|
-
headers: { 'X-Master-Key': '$2a$10$aBB0ydwfYD6iKCDgPTjoo.bnBEzpzgTPDr.VjkObebVlsc5azZHpm' }
|
|
1409
|
-
});
|
|
1406
|
+
// Fetch direct from Local Proxy (bypasses CORS & hides API Key)
|
|
1407
|
+
const response = await fetch('http://127.0.0.1:5500/api/dactyclaw-agents');
|
|
1410
1408
|
|
|
1411
1409
|
if (!response.ok) throw new Error('Database unreachable');
|
|
1412
1410
|
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$aBB0ydwfYD6iKCDgPTjoo.bnBEzpzgTPDr.VjkObebVlsc5azZHpm',
|
|
98
|
+
'X-Access-Key': '$2a$10$aBB0ydwfYD6iKCDgPTjoo.bnBEzpzgTPDr.VjkObebVlsc5azZHpm',
|
|
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]);
|