@ferricstore/ferricstore 0.11.10 → 0.12.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.
- package/README.md +32 -3
- package/dist/durability-DlDCsdlo.d.cts +16 -0
- package/dist/durability-DplL0SbW.d.ts +16 -0
- package/dist/index.cjs +13 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -162
- package/dist/index.d.ts +5 -162
- package/dist/index.js +13 -2
- package/dist/index.js.map +1 -1
- package/dist/internal-lEEDZpPH.d.cts +4 -0
- package/dist/internal-lEEDZpPH.d.ts +4 -0
- package/dist/langgraph.cjs +1278 -0
- package/dist/langgraph.cjs.map +1 -0
- package/dist/langgraph.d.cts +148 -0
- package/dist/langgraph.d.ts +148 -0
- package/dist/langgraph.js +1252 -0
- package/dist/langgraph.js.map +1 -0
- package/dist/openai-agents.cjs +580 -0
- package/dist/openai-agents.cjs.map +1 -0
- package/dist/openai-agents.d.cts +44 -0
- package/dist/openai-agents.d.ts +44 -0
- package/dist/openai-agents.js +555 -0
- package/dist/openai-agents.js.map +1 -0
- package/dist/outcomes-BbFDp3AH.d.ts +160 -0
- package/dist/outcomes-DmBwnq0Y.d.cts +160 -0
- package/docs/agent-frameworks.md +159 -0
- package/docs/api/assets/highlight.css +12 -12
- package/docs/api/classes/ClaimHydrationError.html +2 -2
- package/docs/api/classes/ConnectionClosedError.html +2 -2
- package/docs/api/classes/FerricStoreError.html +2 -2
- package/docs/api/classes/FlowAlreadyExistsError.html +2 -2
- package/docs/api/classes/FlowBatchError.html +2 -2
- package/docs/api/classes/FlowNotFoundError.html +2 -2
- package/docs/api/classes/FlowQueryError.html +2 -2
- package/docs/api/classes/FlowWrongStateError.html +2 -2
- package/docs/api/classes/HTTPTransportError.html +2 -2
- package/docs/api/classes/InvalidCommandError.html +2 -2
- package/docs/api/classes/LeaseRenewalError.html +2 -2
- package/docs/api/classes/LockHeldError.html +2 -2
- package/docs/api/classes/LockNotOwnedError.html +2 -2
- package/docs/api/classes/OverloadedError.html +2 -2
- package/docs/api/classes/QueueCompletionError.html +2 -2
- package/docs/api/classes/RequestTimeoutError.html +2 -2
- package/docs/api/classes/RerouteError.html +2 -2
- package/docs/api/classes/StaleLeaseError.html +2 -2
- package/docs/api/classes/StalePolicyGenerationError.html +2 -2
- package/docs/api/functions/httpCommandDisposition.html +1 -1
- package/docs/api/index.html +44 -24
- package/docs/api/media/agent-frameworks.md +159 -0
- package/docs/api/media/langgraph.ts +23 -0
- package/docs/api/media/openai-agents-session.ts +13 -0
- package/docs/api/types/HTTPCommandDisposition.html +1 -1
- package/docs/api/variables/FERRICSTORE_SDK_VERSION.html +1 -1
- package/package.json +42 -2
package/README.md
CHANGED
|
@@ -16,10 +16,23 @@ npm install @ferricstore/ferricstore
|
|
|
16
16
|
|
|
17
17
|
Requires Node.js 22.22 or newer. The SDK ships ESM and CommonJS builds and is tested with Node 22, 24, and 26.
|
|
18
18
|
|
|
19
|
+
Agent framework adapters are optional:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install @ferricstore/ferricstore @langchain/langgraph @langchain/core
|
|
23
|
+
# or
|
|
24
|
+
npm install @ferricstore/ferricstore @openai/agents
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Use `@ferricstore/ferricstore/langgraph` for a LangGraph.js checkpointer,
|
|
28
|
+
long-term `BaseStore`, and FerricFlow handler bridge. Use
|
|
29
|
+
`@ferricstore/ferricstore/openai-agents` for an atomic, idempotent OpenAI
|
|
30
|
+
Agents SDK `Session`. See [docs/agent-frameworks.md](docs/agent-frameworks.md).
|
|
31
|
+
|
|
19
32
|
## Compatibility
|
|
20
33
|
|
|
21
|
-
TypeScript SDK `0.
|
|
22
|
-
FerricStore 0.11.
|
|
34
|
+
TypeScript SDK `0.12.0` requires FerricStore server `0.11.4` or newer. With
|
|
35
|
+
FerricStore 0.11.11 it negotiates compact Stream mode 34 for homogeneous auto-ID
|
|
23
36
|
`XADD` pipelines and compact Pub/Sub mode 35 for homogeneous `PUBLISH`
|
|
24
37
|
pipelines. Native wire protocol v1 and the generic fallback are unchanged.
|
|
25
38
|
Capabilities and response-size limits are negotiated
|
|
@@ -44,7 +57,7 @@ const { FerricStoreClient, JsonCodec } = require("@ferricstore/ferricstore");
|
|
|
44
57
|
docker run -p 6388:6388 \
|
|
45
58
|
-e FERRICSTORE_PROTECTED_MODE=false \
|
|
46
59
|
-v ferricstore_data:/data \
|
|
47
|
-
quay.io/ferricstore/ferricstore:0.11.
|
|
60
|
+
quay.io/ferricstore/ferricstore:0.11.11@sha256:d9f488539f0d6c1a513d2315e7a9c2947cc795b393f3774c9de8ba5e5b5c21b5
|
|
48
61
|
```
|
|
49
62
|
|
|
50
63
|
## Query durable runs
|
|
@@ -130,6 +143,20 @@ headers across origins, so configure only endpoints and redirect targets you
|
|
|
130
143
|
trust. Use `ferric://` or `ferrics://` whenever connection-local behavior is
|
|
131
144
|
required.
|
|
132
145
|
|
|
146
|
+
Run the complete HTTP-compatible integration surface through a real TLS
|
|
147
|
+
listener with ACL authentication using:
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
FERRICSTORE_IMAGE=quay.io/ferricstore/ferricstore:0.11.11@sha256:d9f488539f0d6c1a513d2315e7a9c2947cc795b393f3774c9de8ba5e5b5c21b5 \
|
|
151
|
+
npm run test:integration:http
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
The runner creates a private CA, verifies that unauthenticated access and a
|
|
155
|
+
restricted user's forbidden `SET` are rejected, and sets
|
|
156
|
+
`FERRICSTORE_USERNAME`, `FERRICSTORE_PASSWORD`, and `FERRICSTORE_CA_FILE` for
|
|
157
|
+
the tests. Native-only subscriptions, topology, and session controls stay in
|
|
158
|
+
the native integration jobs.
|
|
159
|
+
|
|
133
160
|
## Cluster-aware client
|
|
134
161
|
|
|
135
162
|
For a single node, use `fromUrl`. For a FerricStore cluster, pass multiple seed URLs. The SDK fetches the server `SHARDS` topology, routes keyed commands to the current shard leader, and refuses learned hosts outside the seed-host trust set by default. The creation promise resolves only after startup and authentication succeed; cluster creation also waits for the initial topology, so connection failures reject the corresponding `await` directly.
|
|
@@ -635,6 +662,8 @@ Runnable examples live in the `examples/` directory:
|
|
|
635
662
|
- [signals.ts](examples/signals.ts)
|
|
636
663
|
- [value-refs.ts](examples/value-refs.ts)
|
|
637
664
|
- [kv-store.ts](examples/kv-store.ts)
|
|
665
|
+
- [langgraph.ts](examples/langgraph.ts)
|
|
666
|
+
- [openai-agents-session.ts](examples/openai-agents-session.ts)
|
|
638
667
|
|
|
639
668
|
## Codecs
|
|
640
669
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { C as CommandArgument, a as Command } from './internal-lEEDZpPH.cjs';
|
|
2
|
+
|
|
3
|
+
interface FerricStoreCommandClient {
|
|
4
|
+
command(...args: CommandArgument[]): Promise<unknown>;
|
|
5
|
+
pipeline?(commands: readonly Command[]): Promise<unknown[]>;
|
|
6
|
+
}
|
|
7
|
+
interface FerricStoreLockOptions {
|
|
8
|
+
/** Lease duration for adapter mutation locks. Defaults to five minutes. */
|
|
9
|
+
lockTtlMs?: number;
|
|
10
|
+
/** Maximum time to wait for a contended mutation lock. Defaults to 30 seconds. */
|
|
11
|
+
lockWaitMs?: number;
|
|
12
|
+
/** Delay between lock acquisition attempts. Defaults to 10 milliseconds. */
|
|
13
|
+
lockRetryMs?: number;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type { FerricStoreCommandClient as F, FerricStoreLockOptions as a };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { C as CommandArgument, a as Command } from './internal-lEEDZpPH.js';
|
|
2
|
+
|
|
3
|
+
interface FerricStoreCommandClient {
|
|
4
|
+
command(...args: CommandArgument[]): Promise<unknown>;
|
|
5
|
+
pipeline?(commands: readonly Command[]): Promise<unknown[]>;
|
|
6
|
+
}
|
|
7
|
+
interface FerricStoreLockOptions {
|
|
8
|
+
/** Lease duration for adapter mutation locks. Defaults to five minutes. */
|
|
9
|
+
lockTtlMs?: number;
|
|
10
|
+
/** Maximum time to wait for a contended mutation lock. Defaults to 30 seconds. */
|
|
11
|
+
lockWaitMs?: number;
|
|
12
|
+
/** Delay between lock acquisition attempts. Defaults to 10 milliseconds. */
|
|
13
|
+
lockRetryMs?: number;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type { FerricStoreCommandClient as F, FerricStoreLockOptions as a };
|
package/dist/index.cjs
CHANGED
|
@@ -8704,6 +8704,9 @@ var sessionOnlyCommands = /* @__PURE__ */ new Set([
|
|
|
8704
8704
|
"CLIENT",
|
|
8705
8705
|
"DISCARD",
|
|
8706
8706
|
"EXEC",
|
|
8707
|
+
"FETCH_OR_COMPUTE",
|
|
8708
|
+
"FETCH_OR_COMPUTE_ERROR",
|
|
8709
|
+
"FETCH_OR_COMPUTE_RESULT",
|
|
8707
8710
|
"HELLO",
|
|
8708
8711
|
"MONITOR",
|
|
8709
8712
|
"MULTI",
|
|
@@ -8753,6 +8756,7 @@ var encoding = "ferricstore-json-v1";
|
|
|
8753
8756
|
var bytesMarker = "$ferricstore_bytes";
|
|
8754
8757
|
var mapMarker = "$ferricstore_map";
|
|
8755
8758
|
var maxDepth = 64;
|
|
8759
|
+
var integerJSON = /^-?(?:0|[1-9][0-9]*)$/u;
|
|
8756
8760
|
var bytesMarkerBaseBytes = import_node_buffer34.Buffer.byteLength(bytesMarker) + 7;
|
|
8757
8761
|
var mapMarkerBaseBytes = import_node_buffer34.Buffer.byteLength(mapMarker) + 7;
|
|
8758
8762
|
function encodeHTTPCommands(commands, maxBytes = Number.MAX_SAFE_INTEGER) {
|
|
@@ -8765,13 +8769,20 @@ function encodeHTTPCommands(commands, maxBytes = Number.MAX_SAFE_INTEGER) {
|
|
|
8765
8769
|
function decodeHTTPEnvelope(source) {
|
|
8766
8770
|
let parsed;
|
|
8767
8771
|
try {
|
|
8768
|
-
parsed = JSON.parse(source.toString("utf8"));
|
|
8772
|
+
parsed = JSON.parse(source.toString("utf8"), preserveIntegerPrecision);
|
|
8769
8773
|
} catch (error) {
|
|
8770
8774
|
throw new TypeError("invalid HTTP command response JSON", { cause: error });
|
|
8771
8775
|
}
|
|
8772
8776
|
if (!isRecord(parsed)) throw new TypeError("HTTP command response must be an object");
|
|
8773
8777
|
return decodePlainRecord(parsed, 0);
|
|
8774
8778
|
}
|
|
8779
|
+
function preserveIntegerPrecision(_key, value, context) {
|
|
8780
|
+
if (typeof value !== "number" || Number.isSafeInteger(value) || !Number.isInteger(value)) {
|
|
8781
|
+
return value;
|
|
8782
|
+
}
|
|
8783
|
+
const literal = context?.source;
|
|
8784
|
+
return literal != null && integerJSON.test(literal) ? BigInt(literal) : value;
|
|
8785
|
+
}
|
|
8775
8786
|
function encodeValue(value, depth, budget) {
|
|
8776
8787
|
if (depth > maxDepth) throw new TypeError("HTTP command value exceeds maximum depth");
|
|
8777
8788
|
if (value == null) {
|
|
@@ -21367,7 +21378,7 @@ var WorkflowWorker = class {
|
|
|
21367
21378
|
};
|
|
21368
21379
|
|
|
21369
21380
|
// src/version.ts
|
|
21370
|
-
var FERRICSTORE_SDK_VERSION = "0.
|
|
21381
|
+
var FERRICSTORE_SDK_VERSION = "0.12.0";
|
|
21371
21382
|
var FERRICSTORE_MINIMUM_SERVER_VERSION = "0.11.4";
|
|
21372
21383
|
var FERRICSTORE_NATIVE_PROTOCOL_VERSION = 1;
|
|
21373
21384
|
// Annotate the CommonJS export names for ESM import in node:
|