@noetaris/harness 0.3.0 → 0.3.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.
package/dist/index.d.ts CHANGED
@@ -687,6 +687,36 @@ declare class StoreLoadError extends Error {
687
687
  readonly cause: unknown;
688
688
  constructor(cause: unknown);
689
689
  }
690
+ /**
691
+ * Thrown by {@link Agent.run} when `store.claim()` returns `null` —
692
+ * another instance already holds the session claim.
693
+ *
694
+ * The caller may inspect `retryAfter` to implement a `429 Retry-After`
695
+ * response or a retry backoff. How to respond is not the framework's concern.
696
+ */
697
+ declare class SessionBusyError extends Error {
698
+ /** The session that is currently claimed by another instance. */
699
+ readonly sessionId: string;
700
+ /**
701
+ * Hint: earliest time (milliseconds since epoch) when a retry may succeed.
702
+ * Derived from the original claim's `expiresAt`. Present when the store
703
+ * includes expiry information in a busy response; absent otherwise.
704
+ */
705
+ readonly retryAfter?: number;
706
+ constructor(sessionId: string, retryAfter?: number);
707
+ }
708
+ /**
709
+ * Thrown by the framework at a step boundary when the active lease has expired
710
+ * without renewal.
711
+ *
712
+ * The run stops without saving state — the session remains at its last
713
+ * checkpoint, allowing another instance to claim and resume it.
714
+ */
715
+ declare class LeaseExpiredError extends Error {
716
+ /** The session whose lease expired. */
717
+ readonly sessionId: string;
718
+ constructor(sessionId: string);
719
+ }
690
720
 
691
721
  /**
692
722
  * Identifies the agent and session for run-level observer callbacks.
@@ -804,4 +834,4 @@ interface ObserverAware {
804
834
  */
805
835
  declare function composeObservers(...observers: Observer[]): Observer;
806
836
 
807
- export { type Agent, type ClaimOptions, type DeepWithMarkers, type FieldDefinition, type FrameworkState, type Harness, type Lease, type LoopDefinition, LoopNotDefinedError, NoInterruptError, type Observer, type ObserverAware, REQUIRED_TAG, RUNTIME_TAG, type RequiredMarker, type RouteFn, type RunContext, type RunFn, type RuntimeMarker, SessionInFlightError, SessionPendingInterruptError, type SessionStore, type SignalTransition, type StateFromSchema, type StepContext, type StepDef, type StepState, StoreLoadError, type StoredRun, type StoredRunMetadata, type TransitionTarget, composeObservers, createAgent, createHarness, field, isRequiredMarker, isRuntimeMarker, required, runtime };
837
+ export { type Agent, type ClaimOptions, type DeepWithMarkers, type FieldDefinition, type FrameworkState, type Harness, type Lease, LeaseExpiredError, type LoopDefinition, LoopNotDefinedError, NoInterruptError, type Observer, type ObserverAware, REQUIRED_TAG, RUNTIME_TAG, type RequiredMarker, type RouteFn, type RunContext, type RunFn, type RuntimeMarker, SessionBusyError, SessionInFlightError, SessionPendingInterruptError, type SessionStore, type SignalTransition, type StateFromSchema, type StepContext, type StepDef, type StepState, StoreLoadError, type StoredRun, type StoredRunMetadata, type TransitionTarget, composeObservers, createAgent, createHarness, field, isRequiredMarker, isRuntimeMarker, required, runtime };
package/dist/index.js CHANGED
@@ -1508,10 +1508,12 @@ function composeObservers(...observers) {
1508
1508
  };
1509
1509
  }
1510
1510
  export {
1511
+ LeaseExpiredError,
1511
1512
  LoopNotDefinedError,
1512
1513
  NoInterruptError,
1513
1514
  REQUIRED_TAG,
1514
1515
  RUNTIME_TAG,
1516
+ SessionBusyError,
1515
1517
  SessionInFlightError,
1516
1518
  SessionPendingInterruptError,
1517
1519
  StoreLoadError,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noetaris/harness",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Agent execution framework — harness implementation",
5
5
  "type": "module",
6
6
  "repository": {