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.
- package/handler.ts +7 -5
- 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('[
|
|
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(`[
|
|
63
|
+
console.log(`[openclaw-face-hooks] Uploaded status (busy: ${payload.busy})`);
|
|
64
64
|
} catch (err) {
|
|
65
65
|
console.error(
|
|
66
|
-
'[
|
|
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
|
-
//
|
|
117
|
-
|
|
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;
|