@promptbook/remote-client 0.89.0-20 → 0.89.0-21

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.
@@ -11,7 +11,7 @@ import type { RemoteServerOptions } from './types/RemoteServerOptions';
11
11
  */
12
12
  export declare function startRemoteServer<TCustomOptions = undefined>(options: RemoteServerOptions<TCustomOptions>): RemoteServer;
13
13
  /**
14
- * TODO: !! Add CORS and security - probbably via `helmet`
14
+ * TODO: [🌡] Add CORS and security - probbably via `helmet`
15
15
  * TODO: Split this file into multiple functions - handler for each request
16
16
  * TODO: Maybe use `$exportJson`
17
17
  * TODO: [🧠][🛍] Maybe not `isAnonymous: boolean` BUT `mode: 'ANONYMOUS'|'COLLECTION'`
@@ -8,7 +8,6 @@ import type { LlmExecutionTools } from '../../execution/LlmExecutionTools';
8
8
  import type { string_app_id } from '../../types/typeAliases';
9
9
  import type { string_email } from '../../types/typeAliases';
10
10
  import type { string_password } from '../../types/typeAliases';
11
- import type { string_uri } from '../../types/typeAliases';
12
11
  import type { string_user_id } from '../../types/typeAliases';
13
12
  import type { ApplicationModeIdentification } from '../socket-types/_subtypes/Identification';
14
13
  import type { Identification } from '../socket-types/_subtypes/Identification';
@@ -30,15 +29,6 @@ export type RemoteServerOptions<TCustomOptions> = CommonToolsOptions & {
30
29
  * Port on which the server will listen
31
30
  */
32
31
  readonly port: number;
33
- /**
34
- * Root path of the server
35
- *
36
- * Note: This is useful when you reverse proxy the server without changing the path
37
- *
38
- * @default '/'
39
- * @example '/api/promptbook/'
40
- */
41
- readonly rootPath?: string_uri;
42
32
  /**
43
33
  * Creates execution tools the client
44
34
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/remote-client",
3
- "version": "0.89.0-20",
3
+ "version": "0.89.0-21",
4
4
  "description": "It's time for a paradigm shift. The future of software in plain English, French or Latin",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -51,7 +51,7 @@
51
51
  "module": "./esm/index.es.js",
52
52
  "typings": "./esm/typings/src/_packages/remote-client.index.d.ts",
53
53
  "peerDependencies": {
54
- "@promptbook/core": "0.89.0-20"
54
+ "@promptbook/core": "0.89.0-21"
55
55
  },
56
56
  "dependencies": {
57
57
  "crypto": "1.0.1",
package/umd/index.umd.js CHANGED
@@ -23,7 +23,7 @@
23
23
  * @generated
24
24
  * @see https://github.com/webgptorg/promptbook
25
25
  */
26
- const PROMPTBOOK_ENGINE_VERSION = '0.89.0-20';
26
+ const PROMPTBOOK_ENGINE_VERSION = '0.89.0-21';
27
27
  /**
28
28
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
29
29
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -564,17 +564,17 @@
564
564
  */
565
565
  async function createRemoteClient(options) {
566
566
  const { remoteServerUrl } = options;
567
- let path = new URL(remoteServerUrl).pathname;
568
- if (path.endsWith('/')) {
569
- path = path.slice(0, -1);
570
- }
571
- path = `${path}/socket.io`;
567
+ console.log('!!! Connecting to socket.io server', remoteServerUrl, {
568
+ retries: CONNECTION_RETRIES_LIMIT,
569
+ timeout: CONNECTION_TIMEOUT_MS,
570
+ path: '/socket.io',
571
+ });
572
572
  return new Promise((resolve, reject) => {
573
573
  const socket = socket_ioClient.io(remoteServerUrl, {
574
574
  retries: CONNECTION_RETRIES_LIMIT,
575
575
  timeout: CONNECTION_TIMEOUT_MS,
576
- path,
577
- transports: [/*'websocket', <- TODO: [🌬] Make websocket transport work */ 'polling'],
576
+ path: '/socket.io',
577
+ transports: ['polling', 'websocket' /*, <- TODO: [🌬] Allow to pass `transports`, add 'webtransport' */],
578
578
  });
579
579
  // console.log('Connecting to', this.options.remoteServerUrl.href, { socket });
580
580
  socket.on('connect', () => {