@skein-js/server-kit 0.14.1 → 0.15.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/dist/{chunk-XDS3YWFL.js → chunk-TCYGP4ZJ.js} +13 -4
- package/dist/{dev-BfYYRfEB.d.ts → dev-Zz4VRv7T.d.ts} +2 -2
- package/dist/dev.d.ts +2 -2
- package/dist/dev.js +1 -3
- package/dist/{in-memory-runtime-BUUSE63C.js → in-memory-runtime-AOVHAXHJ.js} +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/package.json +6 -5
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
loadAuthEngine,
|
|
10
10
|
loadConfig
|
|
11
11
|
} from "@skein-js/config";
|
|
12
|
+
import { langGraphResolver as langGraphResolver2 } from "@skein-js/langgraph";
|
|
12
13
|
import { MemoryRunEventBus as MemoryRunEventBus2, MemoryRunQueue as MemoryRunQueue2, MemorySkeinStore as MemorySkeinStore2 } from "@skein-js/storage-memory";
|
|
13
14
|
|
|
14
15
|
// src/cors-config.ts
|
|
@@ -99,6 +100,7 @@ function resolveIdempotency(raw) {
|
|
|
99
100
|
|
|
100
101
|
// src/in-memory-deps.ts
|
|
101
102
|
import { MemorySaver } from "@langchain/langgraph";
|
|
103
|
+
import { cloneLangGraphCheckpoint, langGraphResolver, SkeinBaseStore } from "@skein-js/langgraph";
|
|
102
104
|
import { MemoryRunEventBus, MemoryRunQueue, MemorySkeinStore } from "@skein-js/storage-memory";
|
|
103
105
|
|
|
104
106
|
// src/max-page-size.ts
|
|
@@ -152,7 +154,7 @@ function isGraphResolver(graphs) {
|
|
|
152
154
|
return Array.isArray(candidate.ids) && typeof candidate.load === "function";
|
|
153
155
|
}
|
|
154
156
|
function normalizeEmbeddableGraphs(graphs) {
|
|
155
|
-
return isGraphResolver(graphs) ? graphs : graphMapToResolver(graphs);
|
|
157
|
+
return langGraphResolver(isGraphResolver(graphs) ? graphs : graphMapToResolver(graphs));
|
|
156
158
|
}
|
|
157
159
|
function graphMapToResolver(graphs) {
|
|
158
160
|
const ids = Object.keys(graphs);
|
|
@@ -182,6 +184,13 @@ function embedInMemoryGraphs(graphs, overrides = {}) {
|
|
|
182
184
|
// the driver set a long-lived single-process deployment actually runs on.
|
|
183
185
|
bus: new MemoryRunEventBus(resolveMemoryBusLimits()),
|
|
184
186
|
checkpointer: new MemorySaver(),
|
|
187
|
+
// Bridges long-term memory into a LangGraph `BaseStore` so nodes reach it via `getStore()`. A
|
|
188
|
+
// function on deps rather than an import inside the engine — see `ProtocolDeps.storeBridge`.
|
|
189
|
+
storeBridge: (store) => new SkeinBaseStore(store),
|
|
190
|
+
// Throwaway saver for `POST /invoke/:graph_id` — see `ProtocolDeps.ephemeralCheckpointer`.
|
|
191
|
+
ephemeralCheckpointer: () => new MemorySaver(),
|
|
192
|
+
// Clones a checkpoint before it is re-put under another thread id — see `ProtocolDeps.cloneCheckpoint`.
|
|
193
|
+
cloneCheckpoint: cloneLangGraphCheckpoint,
|
|
185
194
|
...overrides
|
|
186
195
|
};
|
|
187
196
|
}
|
|
@@ -222,7 +231,7 @@ async function loadInMemoryRuntime(configPath, importModule, staticSchemas) {
|
|
|
222
231
|
importModule,
|
|
223
232
|
staticSchemas
|
|
224
233
|
});
|
|
225
|
-
const deps = embedInMemoryGraphs(toGraphResolver(graphs));
|
|
234
|
+
const deps = embedInMemoryGraphs(langGraphResolver2(toGraphResolver(graphs)));
|
|
226
235
|
deps.auth = await loadAuthEngine(config.auth, { configDir, importModule });
|
|
227
236
|
return {
|
|
228
237
|
deps,
|
|
@@ -233,11 +242,11 @@ async function loadInMemoryRuntime(configPath, importModule, staticSchemas) {
|
|
|
233
242
|
async function loadReloadableInMemoryRuntime(configPath, importModule, staticSchemas, extraDeps) {
|
|
234
243
|
const first = await loadConfig({ configPath, importModule, staticSchemas });
|
|
235
244
|
let current = first.graphs;
|
|
236
|
-
const graphs = {
|
|
245
|
+
const graphs = langGraphResolver2({
|
|
237
246
|
ids: first.graphs.ids,
|
|
238
247
|
load: (graphId) => current.load(graphId),
|
|
239
248
|
schemas: async (graphId) => await current.schemas(graphId)
|
|
240
|
-
};
|
|
249
|
+
});
|
|
241
250
|
const threadTtl = resolveThreadTtl(first.config.checkpointer?.ttl);
|
|
242
251
|
const storeTtl = resolveStoreTtl(first.config.store?.ttl);
|
|
243
252
|
const idempotency = resolveIdempotency(first.config.skein?.idempotency);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ThreadCheckpointer } from '@skein-js/agent-protocol';
|
|
2
2
|
import { SkeinStore } from '@skein-js/core';
|
|
3
3
|
import { MemoryStoreSnapshot } from '@skein-js/storage-memory';
|
|
4
4
|
|
|
@@ -41,6 +41,6 @@ declare function describeSnapshot(snapshot: DevStateSnapshot): DevStateCounts;
|
|
|
41
41
|
* full history — are copied via the public checkpointer API. Throws if the store can't bulk-restore
|
|
42
42
|
* (both first-party drivers can); a custom driver must implement `restore` to be an import target.
|
|
43
43
|
*/
|
|
44
|
-
declare function loadSnapshotIntoStore(snapshot: DevStateSnapshot, store: SkeinStore, checkpointer:
|
|
44
|
+
declare function loadSnapshotIntoStore(snapshot: DevStateSnapshot, store: SkeinStore, checkpointer: ThreadCheckpointer): Promise<void>;
|
|
45
45
|
|
|
46
46
|
export { type DevStateSnapshot as D, type DevStateCounts as a, describeSnapshot as d, loadSnapshotIntoStore as l, readLanggraphDevState as r };
|
package/dist/dev.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { a as DevStateCounts, d as describeSnapshot, l as loadSnapshotIntoStore, r as readLanggraphDevState } from './dev-
|
|
2
|
-
import '@
|
|
1
|
+
export { a as DevStateCounts, d as describeSnapshot, l as loadSnapshotIntoStore, r as readLanggraphDevState } from './dev-Zz4VRv7T.js';
|
|
2
|
+
import '@skein-js/agent-protocol';
|
|
3
3
|
import '@skein-js/core';
|
|
4
4
|
import '@skein-js/storage-memory';
|
package/dist/dev.js
CHANGED
|
@@ -6,9 +6,7 @@ import {
|
|
|
6
6
|
// src/langgraph-import.ts
|
|
7
7
|
import { readFile } from "fs/promises";
|
|
8
8
|
import path from "path";
|
|
9
|
-
import {
|
|
10
|
-
MemorySaver
|
|
11
|
-
} from "@langchain/langgraph";
|
|
9
|
+
import { MemorySaver } from "@langchain/langgraph";
|
|
12
10
|
import {
|
|
13
11
|
isTerminalRunStatus
|
|
14
12
|
} from "@skein-js/core";
|
package/dist/index.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ import { ModuleImporter, LanggraphJson, GraphSchemas } from '@skein-js/config';
|
|
|
4
4
|
import { CorsOptions } from 'cors';
|
|
5
5
|
export { CorsOptions } from 'cors';
|
|
6
6
|
import { MemoryRunEventBusOptions } from '@skein-js/storage-memory';
|
|
7
|
-
import { D as DevStateSnapshot } from './dev-
|
|
8
|
-
export { a as DevStateCounts } from './dev-
|
|
7
|
+
import { D as DevStateSnapshot } from './dev-Zz4VRv7T.js';
|
|
8
|
+
export { a as DevStateCounts } from './dev-Zz4VRv7T.js';
|
|
9
9
|
import { StoreTtlConfig, ThreadTtlConfig } from '@skein-js/core';
|
|
10
10
|
import { CompiledGraph } from '@langchain/langgraph';
|
|
11
11
|
import { ServerResponse } from 'node:http';
|
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
resolveThreadTtl,
|
|
18
18
|
routesFromHttpConfig,
|
|
19
19
|
toCorsOptions
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-TCYGP4ZJ.js";
|
|
21
21
|
import "./chunk-JUBBCC7R.js";
|
|
22
22
|
|
|
23
23
|
// src/resolve-runtime.ts
|
|
@@ -166,7 +166,7 @@ function resolveLogger(option, injected, frameworkLogger) {
|
|
|
166
166
|
return option ?? frameworkLogger;
|
|
167
167
|
}
|
|
168
168
|
async function resolveRuntimeDeps(options, frameworkLogger) {
|
|
169
|
-
const loaded = options.deps ? { deps: options.deps, cors: void 0, routes: skeinRoutes } : await (await import("./in-memory-runtime-
|
|
169
|
+
const loaded = options.deps ? { deps: options.deps, cors: void 0, routes: skeinRoutes } : await (await import("./in-memory-runtime-AOVHAXHJ.js")).loadInMemoryRuntime(options.config, options.importModule);
|
|
170
170
|
const logger = resolveLogger(options.logger, loaded.deps.logger, frameworkLogger);
|
|
171
171
|
if (logger && !loaded.deps.logger) loaded.deps.logger = logger;
|
|
172
172
|
return { deps: loaded.deps, cors: loaded.cors, routes: loaded.routes, logger };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skein-js/server-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "Shared, framework-agnostic building blocks for skein-js HTTP adapters — in-memory dev runtime, LangGraph dev-state import, and langgraph.json CORS mapping.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Maina Wycliffe <wmmaina7@gmail.com>",
|
|
@@ -49,10 +49,11 @@
|
|
|
49
49
|
"cors": "^2.8.5",
|
|
50
50
|
"superjson": "^2.2.6",
|
|
51
51
|
"zod": "^3.25.76",
|
|
52
|
-
"@skein-js/
|
|
53
|
-
"@skein-js/
|
|
54
|
-
"@skein-js/
|
|
55
|
-
"@skein-js/
|
|
52
|
+
"@skein-js/agent-protocol": "0.15.0",
|
|
53
|
+
"@skein-js/config": "0.15.0",
|
|
54
|
+
"@skein-js/core": "0.15.0",
|
|
55
|
+
"@skein-js/langgraph": "0.15.0",
|
|
56
|
+
"@skein-js/storage-memory": "0.15.0"
|
|
56
57
|
},
|
|
57
58
|
"peerDependencies": {
|
|
58
59
|
"@langchain/langgraph": "^1.4.0"
|