@clawchatsai/connector 0.0.99 → 0.1.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/server/index.js +8 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clawchatsai/connector",
3
- "version": "0.0.99",
3
+ "version": "0.1.0",
4
4
  "type": "module",
5
5
  "description": "ClawChats OpenClaw plugin — P2P tunnel + local API bridge",
6
6
  "main": "dist/index.js",
package/server/index.js CHANGED
@@ -22,6 +22,7 @@ import { handleStatic } from './controllers/static.js';
22
22
  import { handleAgents } from './controllers/agents.js';
23
23
  import { createSettingsHandlers } from './controllers/settings.js';
24
24
  import { createWorkspaceStore } from './store/workspace-store.js';
25
+ import { cleanGatewaySession } from './gateway-cleanup.js';
25
26
  import { parseSessionKey } from './util/helpers.js';
26
27
  import { send, sendError, parseBody, uuid, matchRoute, setCors } from './util/http.js';
27
28
 
@@ -241,6 +242,13 @@ export function createApp(config = {}) {
241
242
  return send(res, 200, { ok: true });
242
243
  }
243
244
 
245
+ if (method === 'POST' && urlPath === '/api/incognito/cleanup') {
246
+ const { sessionKey, threadId } = await parseBody(req);
247
+ if (sessionKey) cleanGatewaySession(sessionKey);
248
+ if (threadId) { try { fs.rmSync(path.join(UPLOADS_DIR, threadId), { recursive: true }); } catch { /* ok */ } }
249
+ return send(res, 200, { ok: true });
250
+ }
251
+
244
252
  sendError(res, 404, `Not found: ${method} ${urlPath}`);
245
253
  } catch (err) {
246
254
  console.error(`Error handling ${method} ${urlPath}:`, err);