@chatbotkit/react 0.7.0 → 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/.eslintrc ADDED
@@ -0,0 +1 @@
1
+ {}
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @chatbotkit/react
2
2
 
3
+ ## 0.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Upgraded to the latest SDK.
8
+
3
9
  ## 0.7.0
4
10
 
5
11
  ### Minor Changes
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ /* eslint-disable @typescript-eslint/ban-ts-comment */
2
3
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
4
  if (k2 === undefined) k2 = k;
4
5
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ /* eslint-disable @typescript-eslint/ban-ts-comment */
2
3
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
4
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
5
  };
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ /* eslint-disable @typescript-eslint/ban-ts-comment */
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
4
  const react_1 = require("react");
4
5
  const index_js_1 = require("@chatbotkit/sdk/conversation/index.cjs");
@@ -20,7 +21,6 @@ const string_js_1 = require("../utils/string.cjs");
20
21
  * conversationId?: string,
21
22
  * token?: string,
22
23
  * messages?: Message[],
23
- * parse?: boolean,
24
24
  * stream?: boolean,
25
25
  * verbose?: boolean,
26
26
  * onError?: onErrorFn?,
@@ -29,7 +29,7 @@ const string_js_1 = require("../utils/string.cjs");
29
29
  * }}[options]
30
30
  */
31
31
  // @ts-ignore
32
- function useConversationManager({ conversationId: _conversationId = '', token: _token = '', messages: _messages = [], parse = false, stream = false, verbose = false, onError = null, onSend = null, onReceive = null, } = {}) {
32
+ function useConversationManager({ conversationId: _conversationId = '', token: _token = '', messages: _messages = [], stream = false, verbose = false, onError = null, onSend = null, onReceive = null, } = {}) {
33
33
  // general states
34
34
  const [conversationId, setConversationId] = (0, react_1.useState)(_conversationId);
35
35
  const [token, setToken] = (0, react_1.useState)(_token);
@@ -142,12 +142,10 @@ function useConversationManager({ conversationId: _conversationId = '', token: _
142
142
  const [redactedText, ...redactedEntities] = redactEnitities(thisText, entities);
143
143
  const secret = options?.token || token;
144
144
  const client = new index_js_1.ConversationClient({ secret });
145
+ // @ts-ignore
145
146
  const completion = client.complete(conversationId, {
146
- // @ts-ignore
147
147
  text: redactedText,
148
- // @ts-ignore
149
148
  entities: redactedEntities,
150
- parse: parse,
151
149
  });
152
150
  let iter;
153
151
  if (stream) {
@@ -15,7 +15,6 @@
15
15
  * conversationId?: string,
16
16
  * token?: string,
17
17
  * messages?: Message[],
18
- * parse?: boolean,
19
18
  * stream?: boolean,
20
19
  * verbose?: boolean,
21
20
  * onError?: onErrorFn?,
@@ -23,11 +22,10 @@
23
22
  * onReceive?: onReceiveFn?,
24
23
  * }}[options]
25
24
  */
26
- export default function useConversationManager({ conversationId: _conversationId, token: _token, messages: _messages, parse, stream, verbose, onError, onSend, onReceive, }?: {
25
+ export default function useConversationManager({ conversationId: _conversationId, token: _token, messages: _messages, stream, verbose, onError, onSend, onReceive, }?: {
27
26
  conversationId?: string | undefined;
28
27
  token?: string | undefined;
29
28
  messages?: Message[] | undefined;
30
- parse?: boolean | undefined;
31
29
  stream?: boolean | undefined;
32
30
  verbose?: boolean | undefined;
33
31
  onError?: onErrorFn | null | undefined;
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @typescript-eslint/ban-ts-comment */
1
2
  import React, { useRef, useEffect } from 'react';
2
3
  export function AutoScrollAnchor() {
3
4
  return React.createElement("div", { className: "auto-scroll-anchor ![height:1px]" });
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @typescript-eslint/ban-ts-comment */
1
2
  import React from 'react';
2
3
  /**
3
4
  * @typedef {(event: React.ChangeEvent<HTMLTextAreaElement>) => any} onInputFn
@@ -15,7 +15,6 @@
15
15
  * conversationId?: string,
16
16
  * token?: string,
17
17
  * messages?: Message[],
18
- * parse?: boolean,
19
18
  * stream?: boolean,
20
19
  * verbose?: boolean,
21
20
  * onError?: onErrorFn?,
@@ -23,11 +22,10 @@
23
22
  * onReceive?: onReceiveFn?,
24
23
  * }}[options]
25
24
  */
26
- export default function useConversationManager({ conversationId: _conversationId, token: _token, messages: _messages, parse, stream, verbose, onError, onSend, onReceive, }?: {
25
+ export default function useConversationManager({ conversationId: _conversationId, token: _token, messages: _messages, stream, verbose, onError, onSend, onReceive, }?: {
27
26
  conversationId?: string | undefined;
28
27
  token?: string | undefined;
29
28
  messages?: Message[] | undefined;
30
- parse?: boolean | undefined;
31
29
  stream?: boolean | undefined;
32
30
  verbose?: boolean | undefined;
33
31
  onError?: onErrorFn | null | undefined;
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @typescript-eslint/ban-ts-comment */
1
2
  import { useState, useEffect } from 'react';
2
3
  import { ConversationClient } from '@chatbotkit/sdk/conversation/index.js';
3
4
  import { getRandomId, replaceWithCoordinates } from '../utils/string.js';
@@ -18,7 +19,6 @@ import { getRandomId, replaceWithCoordinates } from '../utils/string.js';
18
19
  * conversationId?: string,
19
20
  * token?: string,
20
21
  * messages?: Message[],
21
- * parse?: boolean,
22
22
  * stream?: boolean,
23
23
  * verbose?: boolean,
24
24
  * onError?: onErrorFn?,
@@ -27,7 +27,7 @@ import { getRandomId, replaceWithCoordinates } from '../utils/string.js';
27
27
  * }}[options]
28
28
  */
29
29
  // @ts-ignore
30
- export default function useConversationManager({ conversationId: _conversationId = '', token: _token = '', messages: _messages = [], parse = false, stream = false, verbose = false, onError = null, onSend = null, onReceive = null, } = {}) {
30
+ export default function useConversationManager({ conversationId: _conversationId = '', token: _token = '', messages: _messages = [], stream = false, verbose = false, onError = null, onSend = null, onReceive = null, } = {}) {
31
31
  // general states
32
32
  const [conversationId, setConversationId] = useState(_conversationId);
33
33
  const [token, setToken] = useState(_token);
@@ -140,12 +140,10 @@ export default function useConversationManager({ conversationId: _conversationId
140
140
  const [redactedText, ...redactedEntities] = redactEnitities(thisText, entities);
141
141
  const secret = options?.token || token;
142
142
  const client = new ConversationClient({ secret });
143
+ // @ts-ignore
143
144
  const completion = client.complete(conversationId, {
144
- // @ts-ignore
145
145
  text: redactedText,
146
- // @ts-ignore
147
146
  entities: redactedEntities,
148
- parse: parse,
149
147
  });
150
148
  let iter;
151
149
  if (stream) {
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "@chatbotkit/react",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "The fastest way to build advanced AI chat bots",
5
5
  "license": "ISC",
6
+ "engines": {
7
+ "node": ">=18.16.0"
8
+ },
6
9
  "repository": {
7
10
  "type": "git",
8
11
  "url": "git+https://github.com/chatbotkit/node-sdk.git"
@@ -23,14 +26,14 @@
23
26
  "type": "module",
24
27
  "main": "./dist/esm/index.js",
25
28
  "exports": {
26
- ".": {
29
+ "./components/AutoScroller": {
27
30
  "require": {
28
- "types": "./dist/cjs/index.d.ts",
29
- "default": "./dist/cjs/index.cjs"
31
+ "types": "./dist/cjs/components/AutoScroller.d.ts",
32
+ "default": "./dist/cjs/components/AutoScroller.cjs"
30
33
  },
31
34
  "import": {
32
- "types": "./dist/esm/index.d.ts",
33
- "default": "./dist/esm/index.js"
35
+ "types": "./dist/esm/components/AutoScroller.d.ts",
36
+ "default": "./dist/esm/components/AutoScroller.js"
34
37
  }
35
38
  },
36
39
  "./components/AutoScroller.js": {
@@ -43,6 +46,16 @@
43
46
  "default": "./dist/esm/components/AutoScroller.js"
44
47
  }
45
48
  },
49
+ "./components/AutoTextarea": {
50
+ "require": {
51
+ "types": "./dist/cjs/components/AutoTextarea.d.ts",
52
+ "default": "./dist/cjs/components/AutoTextarea.cjs"
53
+ },
54
+ "import": {
55
+ "types": "./dist/esm/components/AutoTextarea.d.ts",
56
+ "default": "./dist/esm/components/AutoTextarea.js"
57
+ }
58
+ },
46
59
  "./components/AutoTextarea.js": {
47
60
  "require": {
48
61
  "types": "./dist/cjs/components/AutoTextarea.d.ts",
@@ -53,6 +66,16 @@
53
66
  "default": "./dist/esm/components/AutoTextarea.js"
54
67
  }
55
68
  },
69
+ "./hooks/useConversationManager": {
70
+ "require": {
71
+ "types": "./dist/cjs/hooks/useConversationManager.d.ts",
72
+ "default": "./dist/cjs/hooks/useConversationManager.cjs"
73
+ },
74
+ "import": {
75
+ "types": "./dist/esm/hooks/useConversationManager.d.ts",
76
+ "default": "./dist/esm/hooks/useConversationManager.js"
77
+ }
78
+ },
56
79
  "./hooks/useConversationManager.js": {
57
80
  "require": {
58
81
  "types": "./dist/cjs/hooks/useConversationManager.d.ts",
@@ -63,6 +86,26 @@
63
86
  "default": "./dist/esm/hooks/useConversationManager.js"
64
87
  }
65
88
  },
89
+ ".": {
90
+ "require": {
91
+ "types": "./dist/cjs/index.d.ts",
92
+ "default": "./dist/cjs/index.cjs"
93
+ },
94
+ "import": {
95
+ "types": "./dist/esm/index.d.ts",
96
+ "default": "./dist/esm/index.js"
97
+ }
98
+ },
99
+ "./index": {
100
+ "require": {
101
+ "types": "./dist/cjs/index.d.ts",
102
+ "default": "./dist/cjs/index.cjs"
103
+ },
104
+ "import": {
105
+ "types": "./dist/esm/index.d.ts",
106
+ "default": "./dist/esm/index.js"
107
+ }
108
+ },
66
109
  "./index.js": {
67
110
  "require": {
68
111
  "types": "./dist/cjs/index.d.ts",
@@ -73,6 +116,16 @@
73
116
  "default": "./dist/esm/index.js"
74
117
  }
75
118
  },
119
+ "./utils/string": {
120
+ "require": {
121
+ "types": "./dist/cjs/utils/string.d.ts",
122
+ "default": "./dist/cjs/utils/string.cjs"
123
+ },
124
+ "import": {
125
+ "types": "./dist/esm/utils/string.d.ts",
126
+ "default": "./dist/esm/utils/string.js"
127
+ }
128
+ },
76
129
  "./utils/string.js": {
77
130
  "require": {
78
131
  "types": "./dist/cjs/utils/string.d.ts",
@@ -92,6 +145,7 @@
92
145
  "build:cjs_rewrite_ts": "node ../../scripts/rewrite-ts.js",
93
146
  "build:esm": "tsc -p tsconfig.esm.json",
94
147
  "build:exports": "node ../../scripts/build-exports.js",
148
+ "check": "tsc --noEmit",
95
149
  "test": "true"
96
150
  },
97
151
  "types": "./dist/esm/index.d.ts",