@skein-js/server-kit 0.10.0 → 0.11.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 +16 -2
- package/dist/index.js +5 -2
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ProtocolRuntime, ProtocolDeps, Logger, RunWorkerOptions, GraphResolver, ProtocolResponse } from '@skein-js/agent-protocol';
|
|
2
2
|
export { CompiledGraphFactory, DEFAULT_RUN_CONCURRENCY, DEFAULT_SHUTDOWN_GRACE_MS, GraphResolver, ProtocolDeps, ResolvedGraph, RunWorkerOptions } from '@skein-js/agent-protocol';
|
|
3
|
-
import { ModuleImporter, GraphSchemas } from '@skein-js/config';
|
|
3
|
+
import { ModuleImporter, LanggraphJson, GraphSchemas } from '@skein-js/config';
|
|
4
4
|
import { CorsOptions } from 'cors';
|
|
5
5
|
export { CorsOptions } from 'cors';
|
|
6
6
|
import { MemoryStoreSnapshot } from '@skein-js/storage-memory';
|
|
@@ -135,6 +135,13 @@ interface InMemoryRuntimeConfig {
|
|
|
135
135
|
/** Load `langgraph.json`, wiring fresh in-memory drivers and reading its `http.cors` for the adapter. */
|
|
136
136
|
declare function loadInMemoryRuntime(configPath: string, importModule?: ModuleImporter, staticSchemas?: Record<string, GraphSchemas>): Promise<InMemoryRuntimeConfig>;
|
|
137
137
|
interface ReloadableInMemoryRuntime extends InMemoryRuntimeConfig {
|
|
138
|
+
/**
|
|
139
|
+
* The parsed `langgraph.json`, so a caller that needs a block this runtime doesn't act on itself
|
|
140
|
+
* (`telemetry`, say) can read it without a second `loadConfig` — which would re-import every graph.
|
|
141
|
+
*/
|
|
142
|
+
config: LanggraphJson;
|
|
143
|
+
/** Directory holding `langgraph.json`, for resolving paths declared relative to it. */
|
|
144
|
+
configDir: string;
|
|
138
145
|
/**
|
|
139
146
|
* Re-read the config and swap in freshly imported graphs, keeping the same drivers. Because the
|
|
140
147
|
* run engine calls `graphs.load()` per run (it never caches the compiled graph itself), the next
|
|
@@ -153,7 +160,14 @@ interface ReloadableInMemoryRuntime extends InMemoryRuntimeConfig {
|
|
|
153
160
|
* dev` pairs this with vite's watcher (clear vite's cache, then `reloadGraphs()` — no server
|
|
154
161
|
* restart, no lost state) and with on-disk JSON persistence across restarts.
|
|
155
162
|
*/
|
|
156
|
-
declare function loadReloadableInMemoryRuntime(configPath: string, importModule?: ModuleImporter, staticSchemas?: Record<string, GraphSchemas
|
|
163
|
+
declare function loadReloadableInMemoryRuntime(configPath: string, importModule?: ModuleImporter, staticSchemas?: Record<string, GraphSchemas>,
|
|
164
|
+
/**
|
|
165
|
+
* Extra deps to build in, for a caller that acts on a config block this runtime doesn't itself
|
|
166
|
+
* read (`telemetry`). Merged **into** the constructed `deps`, so every consumer sees the same
|
|
167
|
+
* object — patching the returned `deps` afterwards would miss anything that already snapshotted it
|
|
168
|
+
* (`resolveDeps` spreads, it doesn't alias).
|
|
169
|
+
*/
|
|
170
|
+
extraDeps?: Partial<Omit<ProtocolDeps, "graphs">>): Promise<ReloadableInMemoryRuntime>;
|
|
157
171
|
|
|
158
172
|
type AnyCompiledGraph = CompiledGraph<any>;
|
|
159
173
|
/**
|
package/dist/index.js
CHANGED
|
@@ -153,7 +153,7 @@ async function loadInMemoryRuntime(configPath, importModule, staticSchemas) {
|
|
|
153
153
|
cors: corsFromHttpConfig(config.http)
|
|
154
154
|
};
|
|
155
155
|
}
|
|
156
|
-
async function loadReloadableInMemoryRuntime(configPath, importModule, staticSchemas) {
|
|
156
|
+
async function loadReloadableInMemoryRuntime(configPath, importModule, staticSchemas, extraDeps) {
|
|
157
157
|
const first = await loadConfig({ configPath, importModule, staticSchemas });
|
|
158
158
|
let current = first.graphs;
|
|
159
159
|
const graphs = {
|
|
@@ -169,11 +169,14 @@ async function loadReloadableInMemoryRuntime(configPath, importModule, staticSch
|
|
|
169
169
|
queue: new MemoryRunQueue2(),
|
|
170
170
|
bus: new MemoryRunEventBus2(),
|
|
171
171
|
checkpointer,
|
|
172
|
-
auth: await loadAuthEngine(first.config.auth, { configDir: first.configDir, importModule })
|
|
172
|
+
auth: await loadAuthEngine(first.config.auth, { configDir: first.configDir, importModule }),
|
|
173
|
+
...extraDeps
|
|
173
174
|
};
|
|
174
175
|
return {
|
|
175
176
|
deps,
|
|
176
177
|
cors: corsFromHttpConfig(first.config.http),
|
|
178
|
+
config: first.config,
|
|
179
|
+
configDir: first.configDir,
|
|
177
180
|
reloadGraphs: async () => {
|
|
178
181
|
current = (await loadConfig({ configPath, importModule, staticSchemas })).graphs;
|
|
179
182
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skein-js/server-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.1",
|
|
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>",
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
"cors": "^2.8.5",
|
|
45
45
|
"superjson": "^2.2.6",
|
|
46
46
|
"zod": "^3.25.76",
|
|
47
|
-
"@skein-js/agent-protocol": "0.
|
|
48
|
-
"@skein-js/config": "0.
|
|
49
|
-
"@skein-js/
|
|
50
|
-
"@skein-js/
|
|
47
|
+
"@skein-js/agent-protocol": "0.11.1",
|
|
48
|
+
"@skein-js/config": "0.11.1",
|
|
49
|
+
"@skein-js/core": "0.11.1",
|
|
50
|
+
"@skein-js/storage-memory": "0.11.1"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"@langchain/langgraph": "^1.4.0"
|