openclaw-face-hooks 0.0.1 → 0.0.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.
Files changed (2) hide show
  1. package/handler.ts +7 -5
  2. package/package.json +1 -1
package/handler.ts CHANGED
@@ -46,7 +46,7 @@ function getClient(): S3Client {
46
46
  export async function uploadStatus(payload: StatusPayload): Promise<void> {
47
47
  const bucket = process.env.R2_BUCKET;
48
48
  if (!bucket) {
49
- console.error('[r2-status] R2_BUCKET not set, skipping upload');
49
+ console.error('[openclaw-face-hooks] R2_BUCKET not set, skipping upload');
50
50
  return;
51
51
  }
52
52
 
@@ -60,10 +60,10 @@ export async function uploadStatus(payload: StatusPayload): Promise<void> {
60
60
  CacheControl: 'no-cache',
61
61
  })
62
62
  );
63
- console.log(`[r2-status] Uploaded status (busy: ${payload.busy})`);
63
+ console.log(`[openclaw-face-hooks] Uploaded status (busy: ${payload.busy})`);
64
64
  } catch (err) {
65
65
  console.error(
66
- '[r2-status] Upload failed:',
66
+ '[openclaw-face-hooks] Upload failed:',
67
67
  err instanceof Error ? err.message : String(err)
68
68
  );
69
69
  }
@@ -89,6 +89,8 @@ const handler = async (event: {
89
89
  [key: string]: unknown;
90
90
  };
91
91
  }): Promise<void> => {
92
+ console.log(`[openclaw-face-hooks] Event received: type=${event.type}, action=${event.action}, sessionKey=${event.sessionKey}`);
93
+
92
94
  if (event.type !== 'command') {
93
95
  return;
94
96
  }
@@ -113,8 +115,8 @@ const handler = async (event: {
113
115
  source: event.context.commandSource,
114
116
  };
115
117
 
116
- // Fire and forget don't block command processing
117
- void uploadStatus(payload);
118
+ // Await upload to ensure it completes before process exits (e.g. on /stop)
119
+ await uploadStatus(payload);
118
120
  };
119
121
 
120
122
  export default handler;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openclaw-face-hooks",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "OpenClaw hook for pushing agent status to Cloudflare R2",
5
5
  "scripts": {
6
6
  "test": "vitest",