@promptbook/remote-server 0.103.0-46 → 0.103.0-48
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/esm/index.es.js +16 -9
- package/esm/index.es.js.map +1 -1
- package/esm/typings/servers.d.ts +1 -7
- package/esm/typings/src/_packages/components.index.d.ts +4 -0
- package/esm/typings/src/_packages/core.index.d.ts +22 -14
- package/esm/typings/src/_packages/types.index.d.ts +14 -6
- package/esm/typings/src/book-2.0/agent-source/AgentBasicInformation.d.ts +7 -3
- package/esm/typings/src/book-2.0/agent-source/AgentModelRequirements.d.ts +6 -1
- package/esm/typings/src/book-2.0/agent-source/AgentSourceParseResult.d.ts +3 -2
- package/esm/typings/src/book-2.0/agent-source/computeAgentHash.d.ts +8 -0
- package/esm/typings/src/book-2.0/agent-source/computeAgentHash.test.d.ts +1 -0
- package/esm/typings/src/book-2.0/agent-source/createCommitmentRegex.d.ts +1 -1
- package/esm/typings/src/book-2.0/agent-source/createDefaultAgentName.d.ts +8 -0
- package/esm/typings/src/book-2.0/agent-source/normalizeAgentName.d.ts +9 -0
- package/esm/typings/src/book-2.0/agent-source/normalizeAgentName.test.d.ts +1 -0
- package/esm/typings/src/book-2.0/agent-source/parseAgentSourceWithCommitments.d.ts +1 -1
- package/esm/typings/src/book-components/Chat/AgentChat/AgentChat.d.ts +14 -0
- package/esm/typings/src/book-components/Chat/AgentChat/AgentChat.test.d.ts +1 -0
- package/esm/typings/src/book-components/Chat/AgentChat/AgentChatProps.d.ts +13 -0
- package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +1 -60
- package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentsDatabaseSchema.d.ts +57 -32
- package/esm/typings/src/{book-2.0/commitments → commitments}/ACTION/ACTION.d.ts +1 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/DELETE/DELETE.d.ts +1 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/FORMAT/FORMAT.d.ts +1 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/GOAL/GOAL.d.ts +1 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/KNOWLEDGE/KNOWLEDGE.d.ts +1 -5
- package/esm/typings/src/{book-2.0/commitments → commitments}/MEMORY/MEMORY.d.ts +1 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/MESSAGE/MESSAGE.d.ts +1 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/META/META.d.ts +1 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/META_IMAGE/META_IMAGE.d.ts +1 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/META_LINK/META_LINK.d.ts +1 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/MODEL/MODEL.d.ts +1 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/NOTE/NOTE.d.ts +1 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/PERSONA/PERSONA.d.ts +1 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/RULE/RULE.d.ts +1 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/SAMPLE/SAMPLE.d.ts +1 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/SCENARIO/SCENARIO.d.ts +1 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/STYLE/STYLE.d.ts +1 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/_base/BaseCommitmentDefinition.d.ts +1 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/_base/CommitmentDefinition.d.ts +1 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/_base/NotYetImplementedCommitmentDefinition.d.ts +1 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/_base/createEmptyAgentModelRequirements.d.ts +1 -1
- package/esm/typings/src/execution/LlmExecutionTools.d.ts +1 -1
- package/esm/typings/src/llm-providers/_common/utils/assertUniqueModels.d.ts +12 -0
- package/esm/typings/src/llm-providers/agent/Agent.d.ts +10 -9
- package/esm/typings/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +5 -1
- package/esm/typings/src/llm-providers/agent/CreateAgentLlmExecutionToolsOptions.d.ts +1 -1
- package/esm/typings/src/llm-providers/agent/RemoteAgent.d.ts +32 -0
- package/esm/typings/src/llm-providers/agent/RemoteAgentOptions.d.ts +11 -0
- package/esm/typings/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +29 -4
- package/esm/typings/src/llm-providers/openai/openai-models.test.d.ts +4 -0
- package/esm/typings/src/remote-server/startAgentServer.d.ts +1 -1
- package/esm/typings/src/remote-server/startRemoteServer.d.ts +1 -2
- package/esm/typings/src/storage/_common/PromptbookStorage.d.ts +1 -0
- package/esm/typings/src/transpilers/openai-sdk/register.d.ts +1 -1
- package/esm/typings/src/types/typeAliases.d.ts +12 -0
- package/esm/typings/src/utils/color/internal-utils/checkChannelValue.d.ts +0 -3
- package/esm/typings/src/utils/normalization/normalize-to-kebab-case.d.ts +2 -0
- package/esm/typings/src/utils/normalization/normalizeTo_PascalCase.d.ts +3 -0
- package/esm/typings/src/utils/normalization/normalizeTo_camelCase.d.ts +2 -0
- package/esm/typings/src/utils/normalization/titleToName.d.ts +2 -0
- package/esm/typings/src/utils/random/$generateBookBoilerplate.d.ts +2 -2
- package/esm/typings/src/utils/random/$randomFullnameWithColor.d.ts +1 -1
- package/esm/typings/src/version.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +19 -12
- package/umd/index.umd.js.map +1 -1
- /package/esm/typings/src/{book-2.0/commitments → commitments}/_base/BookCommitment.d.ts +0 -0
- /package/esm/typings/src/{book-2.0/commitments → commitments}/_base/ParsedCommitment.d.ts +0 -0
- /package/esm/typings/src/{book-2.0/commitments → commitments}/index.d.ts +0 -0
package/esm/index.es.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { join, basename, dirname, isAbsolute } from 'path';
|
|
1
2
|
import { spawn } from 'child_process';
|
|
2
3
|
import colors from 'colors';
|
|
3
4
|
import spaceTrim$1, { spaceTrim } from 'spacetrim';
|
|
@@ -9,7 +10,6 @@ import { Server } from 'socket.io';
|
|
|
9
10
|
import swaggerUi from 'swagger-ui-express';
|
|
10
11
|
import { randomBytes } from 'crypto';
|
|
11
12
|
import { stat, access, constants, readFile, writeFile, readdir, mkdir, watch } from 'fs/promises';
|
|
12
|
-
import { join, basename, dirname, isAbsolute } from 'path';
|
|
13
13
|
import { Subject } from 'rxjs';
|
|
14
14
|
import hexEncoder from 'crypto-js/enc-hex';
|
|
15
15
|
import sha256 from 'crypto-js/sha256';
|
|
@@ -33,7 +33,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
33
33
|
* @generated
|
|
34
34
|
* @see https://github.com/webgptorg/promptbook
|
|
35
35
|
*/
|
|
36
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.103.0-
|
|
36
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.103.0-48';
|
|
37
37
|
/**
|
|
38
38
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
39
39
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -268,9 +268,6 @@ function checkChannelValue(channelName, value) {
|
|
|
268
268
|
throw new Error(`${channelName} channel is greater than 255, it is ${value}`);
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
|
-
/**
|
|
272
|
-
* TODO: [🧠][🚓] Is/which combination it better to use asserts/check, validate or is utility function?
|
|
273
|
-
*/
|
|
274
271
|
|
|
275
272
|
/**
|
|
276
273
|
* Color object represents an RGB color with alpha channel
|
|
@@ -1296,16 +1293,18 @@ function $execCommand(options) {
|
|
|
1296
1293
|
*
|
|
1297
1294
|
* @see https://github.com/webgptorg/promptbook#remote-server
|
|
1298
1295
|
* @public exported from `@promptbook/remote-server`
|
|
1299
|
-
* <- TODO: !!!!
|
|
1296
|
+
* <- TODO: !!!! Change to `@promptbook/agent-server`
|
|
1300
1297
|
*/
|
|
1301
1298
|
async function startAgentServer(options) {
|
|
1302
1299
|
const { port = 4440 } = options;
|
|
1303
1300
|
// TODO: !!!! [🌕]
|
|
1301
|
+
const agentsServerRoot = join(__dirname, '../apps/agents-server');
|
|
1304
1302
|
console.trace(`!!! Starting agents server on port ${port}...`);
|
|
1305
1303
|
console.log(`!!! cwd`, process.cwd());
|
|
1306
1304
|
console.log(`!!! __dirname`, __dirname);
|
|
1305
|
+
console.log(`!!! agentsServerRoot`, agentsServerRoot);
|
|
1307
1306
|
await $execCommand({
|
|
1308
|
-
cwd:
|
|
1307
|
+
cwd: agentsServerRoot,
|
|
1309
1308
|
command: `next dev --port ${port} `,
|
|
1310
1309
|
isVerbose: true,
|
|
1311
1310
|
});
|
|
@@ -4595,6 +4594,8 @@ function removeDiacritics(input) {
|
|
|
4595
4594
|
/**
|
|
4596
4595
|
* Converts a given text to kebab-case format.
|
|
4597
4596
|
*
|
|
4597
|
+
* Note: [🔂] This function is idempotent.
|
|
4598
|
+
*
|
|
4598
4599
|
* @param text The text to be converted.
|
|
4599
4600
|
* @returns The kebab-case formatted string.
|
|
4600
4601
|
* @example 'hello-world'
|
|
@@ -4750,6 +4751,8 @@ function removeEmojis(text) {
|
|
|
4750
4751
|
/**
|
|
4751
4752
|
* Converts a title string into a normalized name.
|
|
4752
4753
|
*
|
|
4754
|
+
* Note: [🔂] This function is idempotent.
|
|
4755
|
+
*
|
|
4753
4756
|
* @param value The title string to be converted to a name.
|
|
4754
4757
|
* @returns A normalized name derived from the input title.
|
|
4755
4758
|
* @example 'Hello World!' -> 'hello-world'
|
|
@@ -7852,6 +7855,8 @@ async function $provideScrapersForNode(tools, options) {
|
|
|
7852
7855
|
/**
|
|
7853
7856
|
* Normalizes a given text to camelCase format.
|
|
7854
7857
|
*
|
|
7858
|
+
* Note: [🔂] This function is idempotent.
|
|
7859
|
+
*
|
|
7855
7860
|
* @param text The text to be normalized.
|
|
7856
7861
|
* @param _isFirstLetterCapital Whether the first letter should be capitalized.
|
|
7857
7862
|
* @returns The camelCase formatted string.
|
|
@@ -7978,6 +7983,9 @@ function nameToUriParts(name) {
|
|
|
7978
7983
|
}
|
|
7979
7984
|
|
|
7980
7985
|
/**
|
|
7986
|
+
* Normalizes a given text to PascalCase format.
|
|
7987
|
+
*
|
|
7988
|
+
* Note: [🔂] This function is idempotent.
|
|
7981
7989
|
*
|
|
7982
7990
|
* @param text @public exported from `@promptbook/utils`
|
|
7983
7991
|
* @returns
|
|
@@ -9627,8 +9635,7 @@ function startRemoteServer(options) {
|
|
|
9627
9635
|
};
|
|
9628
9636
|
}
|
|
9629
9637
|
/**
|
|
9630
|
-
|
|
9631
|
-
* TODO: !!!! Allow to chat with agents directly via remote server
|
|
9638
|
+
|
|
9632
9639
|
* TODO: [🕋] Use here `aboutPromptbookInformation`
|
|
9633
9640
|
* TODO: [🌡] Add CORS and security - probably via `helmet`
|
|
9634
9641
|
* TODO: Split this file into multiple functions - handler for each request
|