@coffer-org/plugin-webchat 2.2.0 → 2.2.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.
@@ -2,12 +2,16 @@ import { pruneThreadMessages } from '@coffer-org/server/thread-store';
2
2
  import { threadsAction, historyAction } from "./actions.js";
3
3
  import { sendAction } from "./send.js";
4
4
  import { CONNECTOR } from "./chain-store.js";
5
+ import { registerConnector } from '@coffer-org/plugin-orchestrator/runtime';
5
6
  const THREAD_TTL_MS = Number(process.env['WEBCHAT_THREAD_TTL_MS'] ?? 30 * 86_400_000);
7
+ let unregisterConnector;
6
8
  export { WEB_FORMAT } from "./format.js";
7
9
  export { makeStreamingConnector } from "./connector.js";
8
10
  export { chatIdFor, chatPrefixFor, recordUser, recordAssistant, buildChain } from "./chain-store.js";
9
11
  export { sendAction, pageContext } from "./send.js";
10
12
  export const serverHooks = {
13
+ init: () => { unregisterConnector = registerConnector({ id: 'webchat' }); },
14
+ teardown: () => { unregisterConnector?.(); unregisterConnector = undefined; },
11
15
  userActions: {
12
16
  threads: threadsAction,
13
17
  history: historyAction,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coffer-org/plugin-webchat",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=24"
@@ -26,8 +26,8 @@
26
26
  "test:ui": "vitest run --root ."
27
27
  },
28
28
  "dependencies": {
29
- "@coffer-org/plugin-orchestrator": "^2.1.1",
30
- "@coffer-org/sdk": "^2.1.1",
29
+ "@coffer-org/plugin-orchestrator": "^2.3.0",
30
+ "@coffer-org/sdk": "^2.1.2",
31
31
  "@coffer-org/server": "^2.2.2",
32
32
  "react-markdown": "^10.1.0",
33
33
  "remark-gfm": "^4.0.1"