@ferricstore/ferricstore 0.1.7 → 0.2.0

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.
Files changed (98) hide show
  1. package/README.md +17 -5
  2. package/dist/index.cjs +869 -548
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.d.cts +29 -30
  5. package/dist/index.d.ts +29 -30
  6. package/dist/index.js +856 -537
  7. package/dist/index.js.map +1 -1
  8. package/docs/api/assets/hierarchy.js +1 -1
  9. package/docs/api/assets/navigation.js +1 -1
  10. package/docs/api/assets/search.js +1 -1
  11. package/docs/api/classes/ClaimHydrationError.html +5 -2
  12. package/docs/api/classes/ConnectionClosedError.html +6 -3
  13. package/docs/api/classes/FerricStoreClient.html +4 -4
  14. package/docs/api/classes/FerricStoreError.html +6 -3
  15. package/docs/api/classes/FlowAlreadyExistsError.html +6 -3
  16. package/docs/api/classes/FlowBatchError.html +6 -3
  17. package/docs/api/classes/FlowNotFoundError.html +6 -3
  18. package/docs/api/classes/FlowWrongStateError.html +6 -3
  19. package/docs/api/classes/InvalidCommandError.html +6 -3
  20. package/docs/api/classes/KeyValueStore.html +2 -2
  21. package/docs/api/classes/LeaseRenewalError.html +1 -1
  22. package/docs/api/classes/LockHeldError.html +6 -3
  23. package/docs/api/classes/LockNotOwnedError.html +6 -3
  24. package/docs/api/classes/NativeAdapter.html +2 -2
  25. package/docs/api/classes/OverloadedError.html +6 -4
  26. package/docs/api/classes/QueueCompletionError.html +1 -1
  27. package/docs/api/classes/RequestTimeoutError.html +6 -3
  28. package/docs/api/classes/RerouteError.html +6 -3
  29. package/docs/api/classes/StaleLeaseError.html +6 -3
  30. package/docs/api/classes/TDigestStore.html +2 -2
  31. package/docs/api/classes/TopKStore.html +1 -1
  32. package/docs/api/classes/TopologyNativeAdapterPool.html +1 -1
  33. package/docs/api/classes/Workflow.html +1 -1
  34. package/docs/api/functions/classifyServerError.html +1 -1
  35. package/docs/api/functions/mapException.html +1 -1
  36. package/docs/api/hierarchy.html +1 -1
  37. package/docs/api/index.html +16 -6
  38. package/docs/api/interfaces/AdminListOptions.html +1 -1
  39. package/docs/api/interfaces/CancelOptions.html +2 -2
  40. package/docs/api/interfaces/ClaimDueOptions.html +3 -3
  41. package/docs/api/interfaces/CompleteJobsAndClaimJobsResult.html +6 -6
  42. package/docs/api/interfaces/CompleteManyOptions.html +2 -2
  43. package/docs/api/interfaces/CompleteOptions.html +2 -2
  44. package/docs/api/interfaces/CompleteOutcome.html +1 -1
  45. package/docs/api/interfaces/CreateManyOptions.html +1 -1
  46. package/docs/api/interfaces/EffectCompensateOptions.html +1 -1
  47. package/docs/api/interfaces/EffectConfirmOptions.html +1 -1
  48. package/docs/api/interfaces/EffectFailOptions.html +1 -1
  49. package/docs/api/interfaces/EffectStatusOptions.html +1 -1
  50. package/docs/api/interfaces/ExtendLeaseOptions.html +2 -2
  51. package/docs/api/interfaces/FailOptions.html +2 -2
  52. package/docs/api/interfaces/FailOutcome.html +1 -1
  53. package/docs/api/interfaces/FerricStoreClientFromUrlOptions.html +1 -1
  54. package/docs/api/interfaces/FerricStoreClientOptions.html +1 -1
  55. package/docs/api/interfaces/{FetchOrComputeLegacyResult.html → FetchOrComputeComputeResult.html} +2 -2
  56. package/docs/api/interfaces/FlowMaxActiveFailure.html +3 -0
  57. package/docs/api/interfaces/FlowPolicyOptions.html +3 -3
  58. package/docs/api/interfaces/FlowRecord.html +4 -2
  59. package/docs/api/interfaces/FlowStatePolicy.html +2 -2
  60. package/docs/api/interfaces/HistoryOptions.html +2 -2
  61. package/docs/api/interfaces/InvocationCreateOptions.html +2 -2
  62. package/docs/api/interfaces/LeaseMutationOptions.html +2 -2
  63. package/docs/api/interfaces/LimitListOptions.html +1 -1
  64. package/docs/api/interfaces/MutateOptions.html +2 -2
  65. package/docs/api/interfaces/NamedValueMutation.html +1 -1
  66. package/docs/api/interfaces/ProtocolCommand.html +2 -2
  67. package/docs/api/interfaces/ReadOptions.html +2 -2
  68. package/docs/api/interfaces/ReclaimOptions.html +2 -2
  69. package/docs/api/interfaces/RequestContext.html +2 -2
  70. package/docs/api/interfaces/RequestContextOptions.html +2 -2
  71. package/docs/api/interfaces/RetryOptions.html +2 -2
  72. package/docs/api/interfaces/RetryOutcome.html +1 -1
  73. package/docs/api/interfaces/RunStepsItem.html +2 -2
  74. package/docs/api/interfaces/RunStepsManyOptions.html +2 -2
  75. package/docs/api/interfaces/SearchOptions.html +2 -2
  76. package/docs/api/interfaces/StartAndClaimOptions.html +4 -2
  77. package/docs/api/interfaces/StepContinueOptions.html +3 -3
  78. package/docs/api/interfaces/TDigestCreateOptions.html +1 -1
  79. package/docs/api/interfaces/TDigestMergeOptions.html +1 -1
  80. package/docs/api/interfaces/TransitionOptions.html +2 -2
  81. package/docs/api/interfaces/TransitionOutcome.html +1 -1
  82. package/docs/api/modules.html +1 -1
  83. package/docs/api/types/FetchOrComputeFencedResult.html +1 -0
  84. package/docs/api/types/FetchOrComputeResult.html +1 -1
  85. package/docs/api/types/FlowStateMode.html +1 -1
  86. package/docs/api/types/FlowStatePolicyLike.html +1 -1
  87. package/docs/api/types/ManagementPairs.html +1 -1
  88. package/docs/api/types/RequestDisposition.html +1 -1
  89. package/docs/api/types/SearchStateMeta.html +1 -1
  90. package/docs/api/types/TopKReserveOptions.html +1 -1
  91. package/docs/api/variables/COMMAND_OPCODES.html +1 -1
  92. package/docs/api/variables/FERRICSTORE_MINIMUM_SERVER_VERSION.html +2 -0
  93. package/docs/api/variables/FERRICSTORE_NATIVE_PROTOCOL_VERSION.html +2 -0
  94. package/docs/api/variables/FERRICSTORE_SDK_VERSION.html +2 -0
  95. package/package.json +6 -1
  96. package/docs/api/interfaces/FetchOrComputeFencedResult.html +0 -9
  97. package/docs/api/types/FetchOrComputeComputeResult.html +0 -1
  98. package/docs/api/variables/COMPACT_RESPONSE_OPCODES.html +0 -2
package/dist/index.d.cts CHANGED
@@ -4,9 +4,15 @@ import { Buffer as Buffer$1 } from 'node:buffer';
4
4
  declare class FerricStoreError extends Error {
5
5
  readonly code: string;
6
6
  readonly raw: unknown;
7
+ readonly retryable: boolean | undefined;
8
+ readonly safeToRetry: boolean | undefined;
9
+ readonly retryAfterMs: number | undefined;
7
10
  constructor(message: string, options?: {
8
11
  raw?: unknown;
9
12
  cause?: unknown;
13
+ retryable?: boolean;
14
+ safeToRetry?: boolean;
15
+ retryAfterMs?: number;
10
16
  });
11
17
  }
12
18
  type RequestDisposition = "unsent" | "possibly_sent";
@@ -53,13 +59,14 @@ declare class InvalidCommandError extends FerricStoreError {
53
59
  }
54
60
  declare class OverloadedError extends FerricStoreError {
55
61
  readonly code = "overloaded";
56
- readonly retryAfterMs: number | undefined;
57
62
  readonly reason: string | undefined;
58
63
  constructor(message: string, options?: {
59
64
  raw?: unknown;
60
65
  cause?: unknown;
61
66
  retryAfterMs?: number;
62
67
  reason?: string;
68
+ retryable?: boolean;
69
+ safeToRetry?: boolean;
63
70
  });
64
71
  }
65
72
  /** The contacted endpoint cannot serve this route and topology should be refreshed. */
@@ -391,16 +398,6 @@ declare const COMMAND_OPCODES: {
391
398
  readonly "FERRICSTORE.METRICS": 783;
392
399
  readonly "FERRICSTORE.BLOBGC": 784;
393
400
  };
394
- /** Direct compact response kinds advertised by the FerricStore native protocol. */
395
- declare const COMPACT_RESPONSE_OPCODES: {
396
- readonly flow_claim_jobs_v1: readonly [515];
397
- readonly flow_record_list_v1: readonly [526, 535, 536, 537, 538, 539, 541];
398
- readonly flow_record_v1: readonly [514];
399
- readonly kv_get_v1: readonly [257];
400
- readonly kv_mget_v1: readonly [260, 524];
401
- readonly ok_list_v1: readonly [258, 261, 527, 528, 530, 531, 532];
402
- readonly pipeline_v1: readonly [14];
403
- };
404
401
  interface ProtocolCommand {
405
402
  readonly opcode: number;
406
403
  readonly payload: unknown;
@@ -428,9 +425,9 @@ declare class NativeAdapter implements CommandExecutor {
428
425
  private readonly closedWaiters;
429
426
  private readonly chunkAssembler;
430
427
  private closed;
428
+ private readonly capabilities;
431
429
  private protocolLanes;
432
430
  private maxPipelineCommands;
433
- private maxRequestFrameBytes;
434
431
  private pendingControlRequests;
435
432
  private readonly maxPendingControlRequests;
436
433
  private readonly heartbeat;
@@ -641,17 +638,7 @@ interface FetchOrComputeHitResult<T = unknown> {
641
638
  readonly status: "hit";
642
639
  readonly value: T | null;
643
640
  }
644
- interface FetchOrComputeLegacyResult {
645
- /** Opaque application hint echoed for the process elected to compute. */
646
- readonly computeHint: Buffer;
647
- readonly computeMode: "legacy";
648
- /** Explicit null distinguishes a legacy tokenless lease from an omitted token. */
649
- readonly computeToken: null;
650
- readonly hit: false;
651
- readonly shouldCompute: true;
652
- readonly status: "compute";
653
- }
654
- interface FetchOrComputeFencedResult {
641
+ interface FetchOrComputeComputeResult {
655
642
  /** Opaque application hint echoed for the process elected to compute. */
656
643
  readonly computeHint: Buffer;
657
644
  readonly computeMode: "fenced";
@@ -661,8 +648,12 @@ interface FetchOrComputeFencedResult {
661
648
  readonly shouldCompute: true;
662
649
  readonly status: "compute";
663
650
  }
664
- type FetchOrComputeComputeResult = FetchOrComputeLegacyResult | FetchOrComputeFencedResult;
651
+ type FetchOrComputeFencedResult = FetchOrComputeComputeResult;
665
652
  type FetchOrComputeResult<T = unknown> = FetchOrComputeHitResult<T> | FetchOrComputeComputeResult;
653
+ interface FlowMaxActiveFailure {
654
+ readonly maxActiveMs: number;
655
+ readonly reason: "max_active_ms";
656
+ }
666
657
  interface FlowRecord<TPayload = unknown> {
667
658
  id: string;
668
659
  type: string;
@@ -677,6 +668,8 @@ interface FlowRecord<TPayload = unknown> {
677
668
  rootFlowId?: string;
678
669
  correlationId?: string;
679
670
  maxActiveMs?: number;
671
+ error?: unknown;
672
+ failureReason?: string;
680
673
  valueRefs?: Record<string, unknown>;
681
674
  values?: Record<string, unknown>;
682
675
  valueSizes?: Record<string, unknown>;
@@ -901,6 +894,8 @@ interface StartAndClaimOptions {
901
894
  nowMs?: number;
902
895
  priority?: number;
903
896
  retentionTtlMs?: number;
897
+ /** Maximum active lifetime from creation, or "infinity" to disable a type policy timeout. */
898
+ maxActiveMs?: MaxActiveMs;
904
899
  attributes?: Record<string, CommandArgument>;
905
900
  stateMeta?: StateMeta;
906
901
  values?: Record<string, unknown>;
@@ -1569,11 +1564,9 @@ declare class HashStore {
1569
1564
  type TopKReserveOptions = {
1570
1565
  width?: never;
1571
1566
  depth?: never;
1572
- decay?: never;
1573
1567
  } | {
1574
1568
  width: number;
1575
1569
  depth: number;
1576
- decay: number;
1577
1570
  };
1578
1571
  interface CountMinMergeOptions {
1579
1572
  weights?: readonly (number | bigint)[];
@@ -1753,10 +1746,10 @@ declare class FerricStoreClientCore extends FerricStoreAdministrationClient {
1753
1746
  }): Promise<FetchOrComputeResult<T>>;
1754
1747
  fetchOrComputeResult(key: string, value: unknown, options: {
1755
1748
  ttlMs: number;
1756
- computeToken: Buffer$1 | null;
1749
+ computeToken: Buffer$1;
1757
1750
  }): Promise<boolean>;
1758
1751
  fetchOrComputeError(key: string, message: string, options: {
1759
- computeToken: Buffer$1 | null;
1752
+ computeToken: Buffer$1;
1760
1753
  }): Promise<boolean>;
1761
1754
  }
1762
1755
 
@@ -2006,7 +1999,6 @@ declare class FerricStoreClient extends FerricStoreProducerClient {
2006
1999
  transitionTo?: string;
2007
2000
  runAtMs?: number;
2008
2001
  nowMs?: number;
2009
- priority?: number;
2010
2002
  values?: Record<string, unknown>;
2011
2003
  valueRefs?: Record<string, string>;
2012
2004
  dropValues?: string[];
@@ -2360,7 +2352,14 @@ declare class WorkflowWorker {
2360
2352
  private applyHandlerError;
2361
2353
  }
2362
2354
 
2355
+ /** TypeScript SDK package version. */
2356
+ declare const FERRICSTORE_SDK_VERSION = "0.2.0";
2357
+ /** Oldest FerricStore server supported by this breaking beta contract. */
2358
+ declare const FERRICSTORE_MINIMUM_SERVER_VERSION = "0.8.0";
2359
+ /** Native framing and opcode ABI version; unchanged by FerricStore 0.8. */
2360
+ declare const FERRICSTORE_NATIVE_PROTOCOL_VERSION = 1;
2361
+
2363
2362
  /** @deprecated Use RequestDisposition; retained for source compatibility. */
2364
2363
  type ConnectionRequestDisposition = RequestDisposition;
2365
2364
 
2366
- export { type AdminListOptions, type ApprovalListOptions, type ApprovalRequestOptions, type AttributeQueryOptions, type AutoBatchOptions, type BackoffKind, type BackpressurePolicy, BitmapStore, BloomFilterStore, type BudgetCommitOptions, type BudgetReserveOptions, COMMAND_OPCODES, COMPACT_RESPONSE_OPCODES, type CancelOptions, type ChildSpec, type CircuitOpenOptions, type ClaimDueOptions, ClaimHydrationError, type ClaimHydrationItem, type ClaimedItem, type Codec, type CollectionScanOptions, type Command, type CommandArgument, type CommandExecutor, type CompleteJobsAndClaimJobsResult, type CompleteManyOptions, type CompleteOptions, type CompleteOutcome, ConnectionClosedError, type ConnectionRequestDisposition, type CountMinMergeOptions, CountMinSketchStore, type CreateItem, type CreateManyOptions, type CreateOptions, CuckooFilterStore, type EffectCompensateOptions, type EffectConfirmOptions, type EffectFailOptions, type EffectReserveOptions, type EffectStatusOptions, type EndpointPolicy, type ExceptionPolicy, type ExecutePipelineOptions, type ExpiryCondition, type ExtendLeaseOptions, type FailOptions, type FailOutcome, type FencedItem, type FencingToken, FerricStoreClient, type FerricStoreClientFromUrlOptions, type FerricStoreClientOptions, FerricStoreError, type FetchOrComputeComputeResult, type FetchOrComputeFencedResult, type FetchOrComputeHitResult, type FetchOrComputeLegacyResult, type FetchOrComputeResult, type FlowAdminRecord, FlowAlreadyExistsError, type FlowBatchCompletedItem, FlowBatchError, FlowNotFoundError, type FlowPolicyOptions, type FlowRecord, type FlowStateMode, type FlowStatePolicy, type FlowStatePolicyLike, type FlowStatsOptions, FlowWrongStateError, type GeoAddOptions, type GeoMember, GeoStore, type GetExOptions, type GovernanceLedgerOptions, type HashScanResult, HashStore, type HistoryOptions, HyperLogLogStore, type IntegerReply, InvalidCommandError, type InvocationCreateOptions, JsonCodec, type KeyInfo, KeyValueStore, type LeaseMutationOptions, LeaseRenewalError, type LimitAmountOptions, type LimitLeaseOptions, type LimitListOptions, type LimitReleaseOptions, ListStore, LockHeldError, LockNotOwnedError, type ManagementPairs, type MaxActiveMs, type MutateOptions, type NamedValueMutation, NativeAdapter, type NativeAdapterOptions, type NativeClientOptions, type NativeProtocolEvent, type Outcome, OverloadedError, type ProtocolCommand, Queue, type QueueBatchHandler, QueueClient, QueueCompletionError, type QueueHandler, type QueueJob, type QueueOptions, QueueWorker, type QueueWorkerResult, type RangeLimit, type RateLimitResult, RawCodec, type ReadOptions, type ReclaimOptions, type ReconnectOptions, ReconnectingExecutor, type RequestContext, type RequestContextOptions, type RequestDisposition, RequestTimeoutError, RerouteError, type RetryOptions, type RetryOutcome, type RetryPolicy, type RoutingEndpoint, type RoutingRoute, RoutingTopology, type RunStepsItem, type RunStepsManyOptions, type ScanOptions, type ScheduleFireDueOptions, type ScheduleListOptions, type ScheduleOptions, type SearchOptions, type SearchStateMeta, type SetOptions, type SetScanResult, SetStore, type SortedSetScanResult, SortedSetStore, StaleLeaseError, type StartAndClaimOptions, type StateMeta, type StateMetaValue, type StateOptions, type StateRegistration, type StepContinueOptions, type StoreCommandClient, StreamStore, type TDigestCreateOptions, type TDigestMergeOptions, TDigestStore, type TopKReserveOptions, TopKStore, type TopologyNativeAdapterOptions, TopologyNativeAdapterPool, type TransitionOptions, type TransitionOutcome, type ValueConfig, type WorkerConfig, type WorkerProfile, type WorkerRefillStrategy, Workflow, WorkflowClient, WorkflowContext, WorkflowFlowCommands, type WorkflowHandler, type WorkflowOptions, WorkflowWorker, type WorkflowWorkerResult, type XReadStream, type ZAddMember, type ZAddOptions, classifyServerError, complete, fail, isOutcome, isReconnectableClosedConnectionError, mapException, retry, transition };
2365
+ export { type AdminListOptions, type ApprovalListOptions, type ApprovalRequestOptions, type AttributeQueryOptions, type AutoBatchOptions, type BackoffKind, type BackpressurePolicy, BitmapStore, BloomFilterStore, type BudgetCommitOptions, type BudgetReserveOptions, COMMAND_OPCODES, type CancelOptions, type ChildSpec, type CircuitOpenOptions, type ClaimDueOptions, ClaimHydrationError, type ClaimHydrationItem, type ClaimedItem, type Codec, type CollectionScanOptions, type Command, type CommandArgument, type CommandExecutor, type CompleteJobsAndClaimJobsResult, type CompleteManyOptions, type CompleteOptions, type CompleteOutcome, ConnectionClosedError, type ConnectionRequestDisposition, type CountMinMergeOptions, CountMinSketchStore, type CreateItem, type CreateManyOptions, type CreateOptions, CuckooFilterStore, type EffectCompensateOptions, type EffectConfirmOptions, type EffectFailOptions, type EffectReserveOptions, type EffectStatusOptions, type EndpointPolicy, type ExceptionPolicy, type ExecutePipelineOptions, type ExpiryCondition, type ExtendLeaseOptions, FERRICSTORE_MINIMUM_SERVER_VERSION, FERRICSTORE_NATIVE_PROTOCOL_VERSION, FERRICSTORE_SDK_VERSION, type FailOptions, type FailOutcome, type FencedItem, type FencingToken, FerricStoreClient, type FerricStoreClientFromUrlOptions, type FerricStoreClientOptions, FerricStoreError, type FetchOrComputeComputeResult, type FetchOrComputeFencedResult, type FetchOrComputeHitResult, type FetchOrComputeResult, type FlowAdminRecord, FlowAlreadyExistsError, type FlowBatchCompletedItem, FlowBatchError, type FlowMaxActiveFailure, FlowNotFoundError, type FlowPolicyOptions, type FlowRecord, type FlowStateMode, type FlowStatePolicy, type FlowStatePolicyLike, type FlowStatsOptions, FlowWrongStateError, type GeoAddOptions, type GeoMember, GeoStore, type GetExOptions, type GovernanceLedgerOptions, type HashScanResult, HashStore, type HistoryOptions, HyperLogLogStore, type IntegerReply, InvalidCommandError, type InvocationCreateOptions, JsonCodec, type KeyInfo, KeyValueStore, type LeaseMutationOptions, LeaseRenewalError, type LimitAmountOptions, type LimitLeaseOptions, type LimitListOptions, type LimitReleaseOptions, ListStore, LockHeldError, LockNotOwnedError, type ManagementPairs, type MaxActiveMs, type MutateOptions, type NamedValueMutation, NativeAdapter, type NativeAdapterOptions, type NativeClientOptions, type NativeProtocolEvent, type Outcome, OverloadedError, type ProtocolCommand, Queue, type QueueBatchHandler, QueueClient, QueueCompletionError, type QueueHandler, type QueueJob, type QueueOptions, QueueWorker, type QueueWorkerResult, type RangeLimit, type RateLimitResult, RawCodec, type ReadOptions, type ReclaimOptions, type ReconnectOptions, ReconnectingExecutor, type RequestContext, type RequestContextOptions, type RequestDisposition, RequestTimeoutError, RerouteError, type RetryOptions, type RetryOutcome, type RetryPolicy, type RoutingEndpoint, type RoutingRoute, RoutingTopology, type RunStepsItem, type RunStepsManyOptions, type ScanOptions, type ScheduleFireDueOptions, type ScheduleListOptions, type ScheduleOptions, type SearchOptions, type SearchStateMeta, type SetOptions, type SetScanResult, SetStore, type SortedSetScanResult, SortedSetStore, StaleLeaseError, type StartAndClaimOptions, type StateMeta, type StateMetaValue, type StateOptions, type StateRegistration, type StepContinueOptions, type StoreCommandClient, StreamStore, type TDigestCreateOptions, type TDigestMergeOptions, TDigestStore, type TopKReserveOptions, TopKStore, type TopologyNativeAdapterOptions, TopologyNativeAdapterPool, type TransitionOptions, type TransitionOutcome, type ValueConfig, type WorkerConfig, type WorkerProfile, type WorkerRefillStrategy, Workflow, WorkflowClient, WorkflowContext, WorkflowFlowCommands, type WorkflowHandler, type WorkflowOptions, WorkflowWorker, type WorkflowWorkerResult, type XReadStream, type ZAddMember, type ZAddOptions, classifyServerError, complete, fail, isOutcome, isReconnectableClosedConnectionError, mapException, retry, transition };
package/dist/index.d.ts CHANGED
@@ -4,9 +4,15 @@ import { Buffer as Buffer$1 } from 'node:buffer';
4
4
  declare class FerricStoreError extends Error {
5
5
  readonly code: string;
6
6
  readonly raw: unknown;
7
+ readonly retryable: boolean | undefined;
8
+ readonly safeToRetry: boolean | undefined;
9
+ readonly retryAfterMs: number | undefined;
7
10
  constructor(message: string, options?: {
8
11
  raw?: unknown;
9
12
  cause?: unknown;
13
+ retryable?: boolean;
14
+ safeToRetry?: boolean;
15
+ retryAfterMs?: number;
10
16
  });
11
17
  }
12
18
  type RequestDisposition = "unsent" | "possibly_sent";
@@ -53,13 +59,14 @@ declare class InvalidCommandError extends FerricStoreError {
53
59
  }
54
60
  declare class OverloadedError extends FerricStoreError {
55
61
  readonly code = "overloaded";
56
- readonly retryAfterMs: number | undefined;
57
62
  readonly reason: string | undefined;
58
63
  constructor(message: string, options?: {
59
64
  raw?: unknown;
60
65
  cause?: unknown;
61
66
  retryAfterMs?: number;
62
67
  reason?: string;
68
+ retryable?: boolean;
69
+ safeToRetry?: boolean;
63
70
  });
64
71
  }
65
72
  /** The contacted endpoint cannot serve this route and topology should be refreshed. */
@@ -391,16 +398,6 @@ declare const COMMAND_OPCODES: {
391
398
  readonly "FERRICSTORE.METRICS": 783;
392
399
  readonly "FERRICSTORE.BLOBGC": 784;
393
400
  };
394
- /** Direct compact response kinds advertised by the FerricStore native protocol. */
395
- declare const COMPACT_RESPONSE_OPCODES: {
396
- readonly flow_claim_jobs_v1: readonly [515];
397
- readonly flow_record_list_v1: readonly [526, 535, 536, 537, 538, 539, 541];
398
- readonly flow_record_v1: readonly [514];
399
- readonly kv_get_v1: readonly [257];
400
- readonly kv_mget_v1: readonly [260, 524];
401
- readonly ok_list_v1: readonly [258, 261, 527, 528, 530, 531, 532];
402
- readonly pipeline_v1: readonly [14];
403
- };
404
401
  interface ProtocolCommand {
405
402
  readonly opcode: number;
406
403
  readonly payload: unknown;
@@ -428,9 +425,9 @@ declare class NativeAdapter implements CommandExecutor {
428
425
  private readonly closedWaiters;
429
426
  private readonly chunkAssembler;
430
427
  private closed;
428
+ private readonly capabilities;
431
429
  private protocolLanes;
432
430
  private maxPipelineCommands;
433
- private maxRequestFrameBytes;
434
431
  private pendingControlRequests;
435
432
  private readonly maxPendingControlRequests;
436
433
  private readonly heartbeat;
@@ -641,17 +638,7 @@ interface FetchOrComputeHitResult<T = unknown> {
641
638
  readonly status: "hit";
642
639
  readonly value: T | null;
643
640
  }
644
- interface FetchOrComputeLegacyResult {
645
- /** Opaque application hint echoed for the process elected to compute. */
646
- readonly computeHint: Buffer;
647
- readonly computeMode: "legacy";
648
- /** Explicit null distinguishes a legacy tokenless lease from an omitted token. */
649
- readonly computeToken: null;
650
- readonly hit: false;
651
- readonly shouldCompute: true;
652
- readonly status: "compute";
653
- }
654
- interface FetchOrComputeFencedResult {
641
+ interface FetchOrComputeComputeResult {
655
642
  /** Opaque application hint echoed for the process elected to compute. */
656
643
  readonly computeHint: Buffer;
657
644
  readonly computeMode: "fenced";
@@ -661,8 +648,12 @@ interface FetchOrComputeFencedResult {
661
648
  readonly shouldCompute: true;
662
649
  readonly status: "compute";
663
650
  }
664
- type FetchOrComputeComputeResult = FetchOrComputeLegacyResult | FetchOrComputeFencedResult;
651
+ type FetchOrComputeFencedResult = FetchOrComputeComputeResult;
665
652
  type FetchOrComputeResult<T = unknown> = FetchOrComputeHitResult<T> | FetchOrComputeComputeResult;
653
+ interface FlowMaxActiveFailure {
654
+ readonly maxActiveMs: number;
655
+ readonly reason: "max_active_ms";
656
+ }
666
657
  interface FlowRecord<TPayload = unknown> {
667
658
  id: string;
668
659
  type: string;
@@ -677,6 +668,8 @@ interface FlowRecord<TPayload = unknown> {
677
668
  rootFlowId?: string;
678
669
  correlationId?: string;
679
670
  maxActiveMs?: number;
671
+ error?: unknown;
672
+ failureReason?: string;
680
673
  valueRefs?: Record<string, unknown>;
681
674
  values?: Record<string, unknown>;
682
675
  valueSizes?: Record<string, unknown>;
@@ -901,6 +894,8 @@ interface StartAndClaimOptions {
901
894
  nowMs?: number;
902
895
  priority?: number;
903
896
  retentionTtlMs?: number;
897
+ /** Maximum active lifetime from creation, or "infinity" to disable a type policy timeout. */
898
+ maxActiveMs?: MaxActiveMs;
904
899
  attributes?: Record<string, CommandArgument>;
905
900
  stateMeta?: StateMeta;
906
901
  values?: Record<string, unknown>;
@@ -1569,11 +1564,9 @@ declare class HashStore {
1569
1564
  type TopKReserveOptions = {
1570
1565
  width?: never;
1571
1566
  depth?: never;
1572
- decay?: never;
1573
1567
  } | {
1574
1568
  width: number;
1575
1569
  depth: number;
1576
- decay: number;
1577
1570
  };
1578
1571
  interface CountMinMergeOptions {
1579
1572
  weights?: readonly (number | bigint)[];
@@ -1753,10 +1746,10 @@ declare class FerricStoreClientCore extends FerricStoreAdministrationClient {
1753
1746
  }): Promise<FetchOrComputeResult<T>>;
1754
1747
  fetchOrComputeResult(key: string, value: unknown, options: {
1755
1748
  ttlMs: number;
1756
- computeToken: Buffer$1 | null;
1749
+ computeToken: Buffer$1;
1757
1750
  }): Promise<boolean>;
1758
1751
  fetchOrComputeError(key: string, message: string, options: {
1759
- computeToken: Buffer$1 | null;
1752
+ computeToken: Buffer$1;
1760
1753
  }): Promise<boolean>;
1761
1754
  }
1762
1755
 
@@ -2006,7 +1999,6 @@ declare class FerricStoreClient extends FerricStoreProducerClient {
2006
1999
  transitionTo?: string;
2007
2000
  runAtMs?: number;
2008
2001
  nowMs?: number;
2009
- priority?: number;
2010
2002
  values?: Record<string, unknown>;
2011
2003
  valueRefs?: Record<string, string>;
2012
2004
  dropValues?: string[];
@@ -2360,7 +2352,14 @@ declare class WorkflowWorker {
2360
2352
  private applyHandlerError;
2361
2353
  }
2362
2354
 
2355
+ /** TypeScript SDK package version. */
2356
+ declare const FERRICSTORE_SDK_VERSION = "0.2.0";
2357
+ /** Oldest FerricStore server supported by this breaking beta contract. */
2358
+ declare const FERRICSTORE_MINIMUM_SERVER_VERSION = "0.8.0";
2359
+ /** Native framing and opcode ABI version; unchanged by FerricStore 0.8. */
2360
+ declare const FERRICSTORE_NATIVE_PROTOCOL_VERSION = 1;
2361
+
2363
2362
  /** @deprecated Use RequestDisposition; retained for source compatibility. */
2364
2363
  type ConnectionRequestDisposition = RequestDisposition;
2365
2364
 
2366
- export { type AdminListOptions, type ApprovalListOptions, type ApprovalRequestOptions, type AttributeQueryOptions, type AutoBatchOptions, type BackoffKind, type BackpressurePolicy, BitmapStore, BloomFilterStore, type BudgetCommitOptions, type BudgetReserveOptions, COMMAND_OPCODES, COMPACT_RESPONSE_OPCODES, type CancelOptions, type ChildSpec, type CircuitOpenOptions, type ClaimDueOptions, ClaimHydrationError, type ClaimHydrationItem, type ClaimedItem, type Codec, type CollectionScanOptions, type Command, type CommandArgument, type CommandExecutor, type CompleteJobsAndClaimJobsResult, type CompleteManyOptions, type CompleteOptions, type CompleteOutcome, ConnectionClosedError, type ConnectionRequestDisposition, type CountMinMergeOptions, CountMinSketchStore, type CreateItem, type CreateManyOptions, type CreateOptions, CuckooFilterStore, type EffectCompensateOptions, type EffectConfirmOptions, type EffectFailOptions, type EffectReserveOptions, type EffectStatusOptions, type EndpointPolicy, type ExceptionPolicy, type ExecutePipelineOptions, type ExpiryCondition, type ExtendLeaseOptions, type FailOptions, type FailOutcome, type FencedItem, type FencingToken, FerricStoreClient, type FerricStoreClientFromUrlOptions, type FerricStoreClientOptions, FerricStoreError, type FetchOrComputeComputeResult, type FetchOrComputeFencedResult, type FetchOrComputeHitResult, type FetchOrComputeLegacyResult, type FetchOrComputeResult, type FlowAdminRecord, FlowAlreadyExistsError, type FlowBatchCompletedItem, FlowBatchError, FlowNotFoundError, type FlowPolicyOptions, type FlowRecord, type FlowStateMode, type FlowStatePolicy, type FlowStatePolicyLike, type FlowStatsOptions, FlowWrongStateError, type GeoAddOptions, type GeoMember, GeoStore, type GetExOptions, type GovernanceLedgerOptions, type HashScanResult, HashStore, type HistoryOptions, HyperLogLogStore, type IntegerReply, InvalidCommandError, type InvocationCreateOptions, JsonCodec, type KeyInfo, KeyValueStore, type LeaseMutationOptions, LeaseRenewalError, type LimitAmountOptions, type LimitLeaseOptions, type LimitListOptions, type LimitReleaseOptions, ListStore, LockHeldError, LockNotOwnedError, type ManagementPairs, type MaxActiveMs, type MutateOptions, type NamedValueMutation, NativeAdapter, type NativeAdapterOptions, type NativeClientOptions, type NativeProtocolEvent, type Outcome, OverloadedError, type ProtocolCommand, Queue, type QueueBatchHandler, QueueClient, QueueCompletionError, type QueueHandler, type QueueJob, type QueueOptions, QueueWorker, type QueueWorkerResult, type RangeLimit, type RateLimitResult, RawCodec, type ReadOptions, type ReclaimOptions, type ReconnectOptions, ReconnectingExecutor, type RequestContext, type RequestContextOptions, type RequestDisposition, RequestTimeoutError, RerouteError, type RetryOptions, type RetryOutcome, type RetryPolicy, type RoutingEndpoint, type RoutingRoute, RoutingTopology, type RunStepsItem, type RunStepsManyOptions, type ScanOptions, type ScheduleFireDueOptions, type ScheduleListOptions, type ScheduleOptions, type SearchOptions, type SearchStateMeta, type SetOptions, type SetScanResult, SetStore, type SortedSetScanResult, SortedSetStore, StaleLeaseError, type StartAndClaimOptions, type StateMeta, type StateMetaValue, type StateOptions, type StateRegistration, type StepContinueOptions, type StoreCommandClient, StreamStore, type TDigestCreateOptions, type TDigestMergeOptions, TDigestStore, type TopKReserveOptions, TopKStore, type TopologyNativeAdapterOptions, TopologyNativeAdapterPool, type TransitionOptions, type TransitionOutcome, type ValueConfig, type WorkerConfig, type WorkerProfile, type WorkerRefillStrategy, Workflow, WorkflowClient, WorkflowContext, WorkflowFlowCommands, type WorkflowHandler, type WorkflowOptions, WorkflowWorker, type WorkflowWorkerResult, type XReadStream, type ZAddMember, type ZAddOptions, classifyServerError, complete, fail, isOutcome, isReconnectableClosedConnectionError, mapException, retry, transition };
2365
+ export { type AdminListOptions, type ApprovalListOptions, type ApprovalRequestOptions, type AttributeQueryOptions, type AutoBatchOptions, type BackoffKind, type BackpressurePolicy, BitmapStore, BloomFilterStore, type BudgetCommitOptions, type BudgetReserveOptions, COMMAND_OPCODES, type CancelOptions, type ChildSpec, type CircuitOpenOptions, type ClaimDueOptions, ClaimHydrationError, type ClaimHydrationItem, type ClaimedItem, type Codec, type CollectionScanOptions, type Command, type CommandArgument, type CommandExecutor, type CompleteJobsAndClaimJobsResult, type CompleteManyOptions, type CompleteOptions, type CompleteOutcome, ConnectionClosedError, type ConnectionRequestDisposition, type CountMinMergeOptions, CountMinSketchStore, type CreateItem, type CreateManyOptions, type CreateOptions, CuckooFilterStore, type EffectCompensateOptions, type EffectConfirmOptions, type EffectFailOptions, type EffectReserveOptions, type EffectStatusOptions, type EndpointPolicy, type ExceptionPolicy, type ExecutePipelineOptions, type ExpiryCondition, type ExtendLeaseOptions, FERRICSTORE_MINIMUM_SERVER_VERSION, FERRICSTORE_NATIVE_PROTOCOL_VERSION, FERRICSTORE_SDK_VERSION, type FailOptions, type FailOutcome, type FencedItem, type FencingToken, FerricStoreClient, type FerricStoreClientFromUrlOptions, type FerricStoreClientOptions, FerricStoreError, type FetchOrComputeComputeResult, type FetchOrComputeFencedResult, type FetchOrComputeHitResult, type FetchOrComputeResult, type FlowAdminRecord, FlowAlreadyExistsError, type FlowBatchCompletedItem, FlowBatchError, type FlowMaxActiveFailure, FlowNotFoundError, type FlowPolicyOptions, type FlowRecord, type FlowStateMode, type FlowStatePolicy, type FlowStatePolicyLike, type FlowStatsOptions, FlowWrongStateError, type GeoAddOptions, type GeoMember, GeoStore, type GetExOptions, type GovernanceLedgerOptions, type HashScanResult, HashStore, type HistoryOptions, HyperLogLogStore, type IntegerReply, InvalidCommandError, type InvocationCreateOptions, JsonCodec, type KeyInfo, KeyValueStore, type LeaseMutationOptions, LeaseRenewalError, type LimitAmountOptions, type LimitLeaseOptions, type LimitListOptions, type LimitReleaseOptions, ListStore, LockHeldError, LockNotOwnedError, type ManagementPairs, type MaxActiveMs, type MutateOptions, type NamedValueMutation, NativeAdapter, type NativeAdapterOptions, type NativeClientOptions, type NativeProtocolEvent, type Outcome, OverloadedError, type ProtocolCommand, Queue, type QueueBatchHandler, QueueClient, QueueCompletionError, type QueueHandler, type QueueJob, type QueueOptions, QueueWorker, type QueueWorkerResult, type RangeLimit, type RateLimitResult, RawCodec, type ReadOptions, type ReclaimOptions, type ReconnectOptions, ReconnectingExecutor, type RequestContext, type RequestContextOptions, type RequestDisposition, RequestTimeoutError, RerouteError, type RetryOptions, type RetryOutcome, type RetryPolicy, type RoutingEndpoint, type RoutingRoute, RoutingTopology, type RunStepsItem, type RunStepsManyOptions, type ScanOptions, type ScheduleFireDueOptions, type ScheduleListOptions, type ScheduleOptions, type SearchOptions, type SearchStateMeta, type SetOptions, type SetScanResult, SetStore, type SortedSetScanResult, SortedSetStore, StaleLeaseError, type StartAndClaimOptions, type StateMeta, type StateMetaValue, type StateOptions, type StateRegistration, type StepContinueOptions, type StoreCommandClient, StreamStore, type TDigestCreateOptions, type TDigestMergeOptions, TDigestStore, type TopKReserveOptions, TopKStore, type TopologyNativeAdapterOptions, TopologyNativeAdapterPool, type TransitionOptions, type TransitionOutcome, type ValueConfig, type WorkerConfig, type WorkerProfile, type WorkerRefillStrategy, Workflow, WorkflowClient, WorkflowContext, WorkflowFlowCommands, type WorkflowHandler, type WorkflowOptions, WorkflowWorker, type WorkflowWorkerResult, type XReadStream, type ZAddMember, type ZAddOptions, classifyServerError, complete, fail, isOutcome, isReconnectableClosedConnectionError, mapException, retry, transition };