@rivus/agent 0.8.4 → 0.8.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/dist/index.d.ts CHANGED
@@ -263,6 +263,7 @@ interface FeishuCardDeliveryLedgerStateOptions {
263
263
  interface FeishuCardDeliveryReconciler {
264
264
  reconcile(): Effect.Effect<{
265
265
  readonly repaired: number;
266
+ readonly skipped: number;
266
267
  readonly terminalRuns: number;
267
268
  }, unknown>;
268
269
  }
package/dist/index.js CHANGED
@@ -139,18 +139,29 @@ function createFeishuCardDeliveryReconciler(options) {
139
139
  const terminalByRun = /* @__PURE__ */ new Map();
140
140
  for (const event of options.events) for (const action of projector.apply(event)) if (action.type !== "update_text" && action.type !== "handoff") terminalByRun.set(action.runId, action);
141
141
  let repaired = 0;
142
+ let skipped = 0;
142
143
  for (const [runId, action] of terminalByRun) {
143
144
  if (options.ledger.isTerminalPublished(runId)) continue;
144
- yield* options.publish(action);
145
+ yield* options.publish(action).pipe(Effect.catchAll((error) => {
146
+ if (isMissingPresentationError(error)) {
147
+ skipped += 1;
148
+ return Effect.void;
149
+ }
150
+ return Effect.fail(error);
151
+ }));
145
152
  yield* options.ledger.markTerminal(runId);
146
153
  repaired += 1;
147
154
  }
148
155
  return {
149
156
  repaired,
157
+ skipped,
150
158
  terminalRuns: terminalByRun.size
151
159
  };
152
160
  }) };
153
161
  }
162
+ function isMissingPresentationError(error) {
163
+ return error !== null && typeof error === "object" && error._tag === "FeishuCardTargetNotFound";
164
+ }
154
165
  function initialRecord(runId) {
155
166
  return {
156
167
  revision: 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rivus/agent",
3
- "version": "0.8.4",
3
+ "version": "0.8.6",
4
4
  "description": "A local agent daemon core built around a usable agent harness and domain events.",
5
5
  "type": "module",
6
6
  "license": "MIT",