@poncho-ai/harness 0.32.0 → 0.32.1

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @poncho-ai/harness@0.32.0 build /Users/cesar/Dev/latitude/poncho-ai/packages/harness
2
+ > @poncho-ai/harness@0.32.1 build /Users/cesar/Dev/latitude/poncho-ai/packages/harness
3
3
  > node scripts/embed-docs.js && tsup src/index.ts --format esm --dts
4
4
 
5
5
  [embed-docs] Generated poncho-docs.ts with 4 topics
@@ -8,8 +8,8 @@
8
8
  CLI tsup v8.5.1
9
9
  CLI Target: es2022
10
10
  ESM Build start
11
- ESM dist/index.js 340.95 KB
12
- ESM ⚡️ Build success in 194ms
11
+ ESM dist/index.js 341.29 KB
12
+ ESM ⚡️ Build success in 66ms
13
13
  DTS Build start
14
- DTS ⚡️ Build success in 3547ms
14
+ DTS ⚡️ Build success in 3395ms
15
15
  DTS dist/index.d.ts 34.66 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @poncho-ai/harness
2
2
 
3
+ ## 0.32.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`67424e0`](https://github.com/cesr/poncho-ai/commit/67424e073b2faa28a255781f91a80f4602c745e2) Thanks [@cesr](https://github.com/cesr)! - Fix stale fired reminders not being cleaned up: pruneStale now removes all fired reminders immediately and runs on list() in addition to create().
8
+
3
9
  ## 0.32.0
4
10
 
5
11
  ### Minor Changes
package/dist/index.js CHANGED
@@ -3220,13 +3220,14 @@ var parseReminderList = (raw) => {
3220
3220
  var pruneStale = (reminders) => {
3221
3221
  const cutoff = Date.now() - STALE_CANCELLED_MS;
3222
3222
  return reminders.filter(
3223
- (r) => r.status === "pending" || r.createdAt > cutoff
3223
+ (r) => r.status === "pending" || r.status === "cancelled" && r.createdAt > cutoff
3224
3224
  );
3225
3225
  };
3226
3226
  var generateId2 = () => (globalThis.crypto?.randomUUID?.() ?? `${Date.now()}-${Math.random()}`).slice(0, 8);
3227
3227
  var InMemoryReminderStore = class {
3228
3228
  reminders = [];
3229
3229
  async list() {
3230
+ this.reminders = pruneStale(this.reminders);
3230
3231
  return [...this.reminders];
3231
3232
  }
3232
3233
  async create(input) {
@@ -3283,7 +3284,10 @@ var FileReminderStore = class {
3283
3284
  await writeJsonAtomic3(fp, reminders);
3284
3285
  }
3285
3286
  async list() {
3286
- return this.readAll();
3287
+ const all = await this.readAll();
3288
+ const pruned = pruneStale(all);
3289
+ if (pruned.length !== all.length) await this.writeAll(pruned);
3290
+ return pruned;
3287
3291
  }
3288
3292
  async create(input) {
3289
3293
  const reminder = {
@@ -3349,7 +3353,10 @@ var KVBackedReminderStore = class {
3349
3353
  }
3350
3354
  }
3351
3355
  async list() {
3352
- return this.readAll();
3356
+ const all = await this.readAll();
3357
+ const pruned = pruneStale(all);
3358
+ if (pruned.length !== all.length) await this.writeAll(pruned);
3359
+ return pruned;
3353
3360
  }
3354
3361
  async create(input) {
3355
3362
  let reminders;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@poncho-ai/harness",
3
- "version": "0.32.0",
3
+ "version": "0.32.1",
4
4
  "description": "Agent execution runtime - conversation loop, tool dispatch, streaming",
5
5
  "repository": {
6
6
  "type": "git",
@@ -66,11 +66,13 @@ const parseReminderList = (raw: unknown): Reminder[] => {
66
66
  return raw.filter(isValidReminder);
67
67
  };
68
68
 
69
- /** Remove cancelled reminders older than 7 days. Fired reminders are deleted immediately on fire. */
69
+ /** Remove all fired reminders and cancelled reminders older than 7 days. */
70
70
  const pruneStale = (reminders: Reminder[]): Reminder[] => {
71
71
  const cutoff = Date.now() - STALE_CANCELLED_MS;
72
72
  return reminders.filter(
73
- (r) => r.status === "pending" || r.createdAt > cutoff,
73
+ (r) =>
74
+ r.status === "pending" ||
75
+ (r.status === "cancelled" && r.createdAt > cutoff),
74
76
  );
75
77
  };
76
78
 
@@ -85,6 +87,7 @@ class InMemoryReminderStore implements ReminderStore {
85
87
  private reminders: Reminder[] = [];
86
88
 
87
89
  async list(): Promise<Reminder[]> {
90
+ this.reminders = pruneStale(this.reminders);
88
91
  return [...this.reminders];
89
92
  }
90
93
 
@@ -160,7 +163,10 @@ class FileReminderStore implements ReminderStore {
160
163
  }
161
164
 
162
165
  async list(): Promise<Reminder[]> {
163
- return this.readAll();
166
+ const all = await this.readAll();
167
+ const pruned = pruneStale(all);
168
+ if (pruned.length !== all.length) await this.writeAll(pruned);
169
+ return pruned;
164
170
  }
165
171
 
166
172
  async create(input: {
@@ -245,7 +251,10 @@ class KVBackedReminderStore implements ReminderStore {
245
251
  }
246
252
 
247
253
  async list(): Promise<Reminder[]> {
248
- return this.readAll();
254
+ const all = await this.readAll();
255
+ const pruned = pruneStale(all);
256
+ if (pruned.length !== all.length) await this.writeAll(pruned);
257
+ return pruned;
249
258
  }
250
259
 
251
260
  async create(input: {