@otterware/openclaw-otter 0.2.5 → 0.2.6
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.js +14 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -173,6 +173,20 @@ export default defineChannelPluginEntry({
|
|
|
173
173
|
: undefined,
|
|
174
174
|
);
|
|
175
175
|
|
|
176
|
+
// OpenClaw tells clients of a compaction inside a run, not of one before it (a transcript
|
|
177
|
+
// over its byte limit), where a chat would wait on it without a word.
|
|
178
|
+
const compaction = (phase) => (_event, ctx) => {
|
|
179
|
+
if (!ctx?.sessionKey) return;
|
|
180
|
+
api.agent?.events?.emitAgentEvent?.({
|
|
181
|
+
runId: `${ctx.sessionId ?? ctx.sessionKey}:compaction`,
|
|
182
|
+
sessionKey: ctx.sessionKey,
|
|
183
|
+
stream: "otter.compaction",
|
|
184
|
+
data: phase === "start" ? { phase } : { phase, completed: true },
|
|
185
|
+
});
|
|
186
|
+
};
|
|
187
|
+
api.on("before_compaction", compaction("start"));
|
|
188
|
+
api.on("after_compaction", compaction("end"));
|
|
189
|
+
|
|
176
190
|
// What you send in an Otter chat, as the gateway's owner: `chat.send`'s run, with the authority
|
|
177
191
|
// a configured channel owner has (an automation another chat made, for one).
|
|
178
192
|
api.registerGatewayMethod(
|
package/package.json
CHANGED