@trevonistrevon/pi-loop 0.2.7 → 0.2.8

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
@@ -121,6 +121,7 @@ export default function (pi) {
121
121
  trigger: entry.trigger,
122
122
  timestamp: Date.now(),
123
123
  readOnly: entry.readOnly,
124
+ recurring: entry.recurring,
124
125
  });
125
126
  }
126
127
  // ── Session lifecycle ──
@@ -181,8 +182,8 @@ export default function (pi) {
181
182
  // ── Loop fire handler — sends a user message to re-wake the agent ──
182
183
  pi.events.on("loop:fire", (event) => {
183
184
  const data = event;
184
- if (_latestCtx?.hasPendingMessages()) {
185
- debug(`loop:fire #${data.loopId} — agent has pending messages, skipping`);
185
+ if (data.recurring && _latestCtx?.hasPendingMessages()) {
186
+ debug(`loop:fire #${data.loopId} — agent has pending messages, skipping recurring fire`);
186
187
  return;
187
188
  }
188
189
  const triggerInfo = typeof data.trigger === "string"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trevonistrevon/pi-loop",
3
- "version": "0.2.7",
3
+ "version": "0.2.8",
4
4
  "description": "A pi extension for cron/event-based agent re-wake loops and background process monitoring.",
5
5
  "author": "trevonistrevon",
6
6
  "license": "MIT",
package/src/index.ts CHANGED
@@ -41,6 +41,7 @@ interface LoopFireEvent {
41
41
  trigger: Trigger | string;
42
42
  timestamp: number;
43
43
  readOnly?: boolean;
44
+ recurring?: boolean;
44
45
  }
45
46
 
46
47
  interface SessionSwitchEvent {
@@ -136,6 +137,7 @@ export default function (pi: ExtensionAPI) {
136
137
  trigger: entry.trigger,
137
138
  timestamp: Date.now(),
138
139
  readOnly: entry.readOnly,
140
+ recurring: entry.recurring,
139
141
  });
140
142
  }
141
143
 
@@ -207,8 +209,8 @@ export default function (pi: ExtensionAPI) {
207
209
  pi.events.on("loop:fire", (event: unknown) => {
208
210
  const data = event as LoopFireEvent;
209
211
 
210
- if (_latestCtx?.hasPendingMessages()) {
211
- debug(`loop:fire #${data.loopId} — agent has pending messages, skipping`);
212
+ if (data.recurring && _latestCtx?.hasPendingMessages()) {
213
+ debug(`loop:fire #${data.loopId} — agent has pending messages, skipping recurring fire`);
212
214
  return;
213
215
  }
214
216