@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 +1 -0
- package/dist/index.js +12 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
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,
|