@johngalt5/bsv-overlay 0.2.10 → 0.2.11
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/index.ts +13 -22
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -157,28 +157,19 @@ function startBackgroundService(env, cliPath, logger) {
|
|
|
157
157
|
if (event.action === 'queued-for-agent' && event.serviceId) {
|
|
158
158
|
logger?.info?.(`[bsv-overlay] ⚡ Incoming ${event.serviceId} request from ${event.from?.slice(0, 12)}... — waking agent`);
|
|
159
159
|
|
|
160
|
-
//
|
|
161
|
-
const
|
|
162
|
-
(
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
}),
|
|
174
|
-
});
|
|
175
|
-
if (wakeResp.ok) {
|
|
176
|
-
logger?.info?.('[bsv-overlay] Agent woken for service fulfillment');
|
|
177
|
-
}
|
|
178
|
-
} catch (wakeErr: any) {
|
|
179
|
-
logger?.warn?.('[bsv-overlay] Failed to wake agent:', wakeErr.message);
|
|
180
|
-
}
|
|
181
|
-
})();
|
|
160
|
+
// Write alert file for the cron-based fulfillment checker to pick up
|
|
161
|
+
const alertDir = path.join(process.env.HOME || '', '.clawdbot', 'bsv-overlay');
|
|
162
|
+
const alertPath = path.join(alertDir, 'pending-alert.jsonl');
|
|
163
|
+
try {
|
|
164
|
+
fs.mkdirSync(alertDir, { recursive: true });
|
|
165
|
+
fs.appendFileSync(alertPath, JSON.stringify({
|
|
166
|
+
requestId: event.id,
|
|
167
|
+
serviceId: event.serviceId,
|
|
168
|
+
from: event.from,
|
|
169
|
+
satoshis: event.satoshisReceived,
|
|
170
|
+
ts: Date.now(),
|
|
171
|
+
}) + '\n');
|
|
172
|
+
} catch {}
|
|
182
173
|
}
|
|
183
174
|
} catch {}
|
|
184
175
|
}
|