@skein-js/nestjs 0.6.3 → 0.8.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 CHANGED
@@ -53,6 +53,24 @@ await server.listen(2024);
53
53
  SSE responses write directly to the raw Node response and stream the pre-serialized frames the engine
54
54
  produced, tearing the run's subscription down on client disconnect.
55
55
 
56
+ ## API
57
+
58
+ - **`SkeinModule.forRoot(options): DynamicModule`** — the primary entry point; `imports: [...]` it to
59
+ mount the protocol as middleware alongside your controllers. `options` is `SkeinRuntimeOptions`.
60
+ - **`SkeinMiddleware`** — the underlying Nest middleware, for callers wiring their own module.
61
+ - **`createNestServer(options): Promise<SkeinNestServer>`** — a standalone server;
62
+ `SkeinNestServer` = `{ app, runtime, listen(port?, host?), close() }`. `close()` closes the Nest app,
63
+ which stops the run worker via the module's shutdown hook.
64
+ - **`SKEIN_RUNTIME` / `SKEIN_LOGGER` / `SKEIN_CORS`** — DI tokens; inject `SKEIN_RUNTIME` to reach the
65
+ `ResolvedProtocolRuntime` from your own providers — its `.runtime` is the `ProtocolRuntime`
66
+ (assistants, handlers, worker), plus `.cors`.
67
+ - **`SkeinRuntimeOptions`** — the shared seam every adapter accepts: common `{ logger?, cors?, warm? }`
68
+ **plus** either `{ config, importModule? }` (in-memory runtime from a `langgraph.json`) **or**
69
+ `{ deps }` (bring-your-own `ProtocolDeps`, e.g. from [`@skein-js/runtime`](../runtime)'s
70
+ `buildRuntime`).
71
+ - Low-level mappers: `toProtocolRequest`, plus `sendNodeResponse` / `sendNodeError` (re-exported from
72
+ [`@skein-js/server-kit`](../server-kit)).
73
+
56
74
  ## Learn more
57
75
 
58
76
  - [`@skein-js/express`](../server-express) — the reference adapter
package/dist/index.js CHANGED
@@ -23,7 +23,7 @@ import {
23
23
 
24
24
  // src/skein.middleware.ts
25
25
  import { Inject, Injectable } from "@nestjs/common";
26
- import { foldThreadId, matchSkeinRoute } from "@skein-js/agent-protocol";
26
+ import { copyThreadIdIntoBody, matchSkeinRoute } from "@skein-js/agent-protocol";
27
27
  import { SkeinHttpError } from "@skein-js/core";
28
28
  import {
29
29
  applyNodeCors,
@@ -123,7 +123,7 @@ var SkeinMiddleware = class {
123
123
  const request = toProtocolRequest(req, url, match.params, body);
124
124
  const invoke = this.resolved.runtime.handlers[match.binding.handler];
125
125
  const response = await invoke(
126
- match.binding.foldThreadIdIntoBody ? foldThreadId(request) : request
126
+ match.binding.foldThreadIdIntoBody ? copyThreadIdIntoBody(request) : request
127
127
  );
128
128
  await sendNodeResponse(response, res);
129
129
  } catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skein-js/nestjs",
3
- "version": "0.6.3",
3
+ "version": "0.8.0",
4
4
  "description": "NestJS adapter for skein-js — serve the Agent Protocol from a Nest module.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Maina Wycliffe <wmmaina7@gmail.com>",
@@ -40,9 +40,9 @@
40
40
  "node": ">=20"
41
41
  },
42
42
  "dependencies": {
43
- "@skein-js/agent-protocol": "0.6.3",
44
- "@skein-js/server-kit": "0.6.3",
45
- "@skein-js/core": "0.6.3"
43
+ "@skein-js/core": "0.8.0",
44
+ "@skein-js/server-kit": "0.8.0",
45
+ "@skein-js/agent-protocol": "0.8.0"
46
46
  },
47
47
  "peerDependencies": {
48
48
  "@langchain/langgraph": "^1.4.0",
@@ -58,7 +58,7 @@
58
58
  "@nestjs/platform-express": "^11.0.0",
59
59
  "reflect-metadata": "^0.2.2",
60
60
  "rxjs": "^7.8.1",
61
- "@skein-js/storage-memory": "0.6.3"
61
+ "@skein-js/storage-memory": "0.8.0"
62
62
  },
63
63
  "publishConfig": {
64
64
  "access": "public"