@parcha/agentrun-dsl 0.1.0-beta.276 → 0.1.0-beta.278

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.
@@ -220,6 +220,11 @@ export declare function openRecovery(store: RecoveryStore, workflow: Workflow, o
220
220
  * continuation identity, whatever fires again. */
221
221
  escalate(row: Omit<EscalationRow, "tail" | "revision">): Promise<EscalationRow>;
222
222
  escalation(): EscalationRow | undefined;
223
+ /** The run failed: its frame is committed once more, so the journal holds every node the run began and never
224
+ * committed. A node's start is otherwise durable only with the next commit, and a step that failed before anything
225
+ * under it was written (a read of a state path no node wrote) would leave no trace of where the run failed. A
226
+ * stopped driver, or one whose commit failed, writes nothing; a failed write is thrown, as `flush` throws it. */
227
+ failed(): Promise<void>;
223
228
  /** The driver's frame as it stands, serialized: what a host shows of a live run while its store is held. */
224
229
  pinJson(): string;
225
230
  /** How many effects the driver admitted. */
@@ -1209,6 +1209,16 @@ export async function openRecovery(store, workflow, options) {
1209
1209
  return snapshot.escalation;
1210
1210
  },
1211
1211
  escalation() { return snapshot.escalation; },
1212
+ /** The run failed: its frame is committed once more, so the journal holds every node the run began and never
1213
+ * committed. A node's start is otherwise durable only with the next commit, and a step that failed before anything
1214
+ * under it was written (a read of a state path no node wrote) would leave no trace of where the run failed. A
1215
+ * stopped driver, or one whose commit failed, writes nothing; a failed write is thrown, as `flush` throws it. */
1216
+ async failed() {
1217
+ if (fatal || stopping)
1218
+ return;
1219
+ void save();
1220
+ await flush();
1221
+ },
1212
1222
  /** The driver's frame as it stands, serialized: what a host shows of a live run while its store is held. */
1213
1223
  pinJson() { return JSON.stringify(snapshot.pin); },
1214
1224
  /** How many effects the driver admitted. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parcha/agentrun-dsl",
3
- "version": "0.1.0-beta.276",
3
+ "version": "0.1.0-beta.278",
4
4
  "description": "Composable, typed workflows for agents",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",