multiclaws 0.4.28 → 0.4.29
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/dist/index.js
CHANGED
|
@@ -542,14 +542,16 @@ const plugin = {
|
|
|
542
542
|
api.on("gateway_stop", () => {
|
|
543
543
|
structured.logger.info("[multiclaws] gateway_stop observed");
|
|
544
544
|
});
|
|
545
|
+
// Track the most recently active channel for notifications
|
|
546
|
+
api.on("message_received", (_event, ctx) => {
|
|
547
|
+
if (service && ctx.channelId) {
|
|
548
|
+
service.setActiveChannelId(ctx.channelId);
|
|
549
|
+
}
|
|
550
|
+
});
|
|
545
551
|
// Inject onboarding prompt when profile is pending first-run setup
|
|
546
|
-
api.on("before_prompt_build", async (_event,
|
|
552
|
+
api.on("before_prompt_build", async (_event, _ctx) => {
|
|
547
553
|
if (!service)
|
|
548
554
|
return;
|
|
549
|
-
// Capture the active channel so notifications go to the right place
|
|
550
|
-
if (ctx.channelId) {
|
|
551
|
-
service.setActiveChannelId(ctx.channelId);
|
|
552
|
-
}
|
|
553
555
|
try {
|
|
554
556
|
const review = await service.getPendingProfileReview();
|
|
555
557
|
if (!review.pending)
|
|
@@ -126,9 +126,9 @@ export declare class MulticlawsService extends EventEmitter {
|
|
|
126
126
|
private extractArtifactText;
|
|
127
127
|
/** Fetch with up to 2 retries and exponential backoff. */
|
|
128
128
|
private fetchWithRetry;
|
|
129
|
-
/** Update the active channel
|
|
129
|
+
/** Update the most recently active channel for notifications. */
|
|
130
130
|
setActiveChannelId(channelId: string): void;
|
|
131
|
-
/** Send a notification
|
|
131
|
+
/** Send a notification to the most recently active channel. */
|
|
132
132
|
private notifyUser;
|
|
133
133
|
private log;
|
|
134
134
|
}
|
|
@@ -919,12 +919,12 @@ class MulticlawsService extends node_events_1.EventEmitter {
|
|
|
919
919
|
}
|
|
920
920
|
throw lastError;
|
|
921
921
|
}
|
|
922
|
-
/** Update the active channel
|
|
922
|
+
/** Update the most recently active channel for notifications. */
|
|
923
923
|
setActiveChannelId(channelId) {
|
|
924
924
|
this.activeChannelId = channelId;
|
|
925
925
|
this.log("debug", `activeChannelId set to: ${channelId}`);
|
|
926
926
|
}
|
|
927
|
-
/** Send a notification
|
|
927
|
+
/** Send a notification to the most recently active channel. */
|
|
928
928
|
async notifyUser(message) {
|
|
929
929
|
if (!this.gatewayConfig || !this.activeChannelId)
|
|
930
930
|
return;
|