@promptbook/cli 0.103.0-56 → 0.103.0-67
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/apps/agents-server/TODO.txt +5 -1
- package/apps/agents-server/config.ts +3 -1
- package/apps/agents-server/package-lock.json +1220 -47
- package/apps/agents-server/package.json +4 -1
- package/apps/agents-server/src/app/actions.ts +3 -1
- package/apps/agents-server/src/app/agents/[agentName]/AgentOptionsMenu.tsx +72 -6
- package/apps/agents-server/src/app/agents/[agentName]/AgentProfileChat.tsx +21 -8
- package/apps/agents-server/src/app/agents/[agentName]/AgentProfileWrapper.tsx +44 -0
- package/apps/agents-server/src/app/agents/[agentName]/generateAgentMetadata.ts +7 -3
- package/apps/agents-server/src/app/agents/[agentName]/layout.tsx +41 -0
- package/apps/agents-server/src/app/agents/[agentName]/page.tsx +47 -100
- package/apps/agents-server/src/app/agents/[agentName]/website-integration/page.tsx +11 -2
- package/apps/agents-server/src/app/embed/page.tsx +2 -2
- package/apps/agents-server/src/app/layout.tsx +8 -24
- package/apps/agents-server/src/app/manifest.ts +8 -3
- package/apps/agents-server/src/components/AgentProfile/AgentProfile.tsx +339 -0
- package/apps/agents-server/src/components/AgentProfile/AgentProfileFromSource.tsx +23 -0
- package/apps/agents-server/src/{app/agents/[agentName] → components/AgentProfile}/AgentQrCode.tsx +8 -1
- package/apps/agents-server/src/components/LayoutWrapper/LayoutWrapper.tsx +7 -6
- package/apps/agents-server/src/database/metadataDefaults.ts +6 -0
- package/apps/agents-server/src/tools/$provideCdnForServer.ts +13 -1
- package/apps/agents-server/src/utils/cdn/classes/DigitalOceanSpaces.ts +119 -0
- package/apps/agents-server/src/utils/cdn/classes/VercelBlobStorage.ts +2 -1
- package/esm/index.es.js +65 -10
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/components.index.d.ts +2 -2
- package/esm/typings/src/_packages/types.index.d.ts +6 -0
- package/esm/typings/src/book-2.0/agent-source/AgentBasicInformation.d.ts +2 -1
- package/esm/typings/src/book-2.0/agent-source/createCommitmentRegex.d.ts +1 -1
- package/esm/typings/src/book-components/Chat/AgentChat/AgentChat.d.ts +3 -0
- package/esm/typings/src/book-components/Chat/Chat/ChatProps.d.ts +6 -0
- package/esm/typings/src/book-components/PromptbookAgent/PromptbookAgentIntegration.d.ts +52 -0
- package/esm/typings/src/book-components/PromptbookAgent/PromptbookAgentSeamlessIntegration.d.ts +14 -0
- package/esm/typings/src/book-components/icons/SendIcon.d.ts +3 -0
- package/esm/typings/src/commitments/CLOSED/CLOSED.d.ts +4 -0
- package/esm/typings/src/commitments/CLOSED/CLOSED.test.d.ts +4 -0
- package/esm/typings/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +4 -0
- package/esm/typings/src/commitments/_base/BaseCommitmentDefinition.d.ts +6 -0
- package/esm/typings/src/llm-providers/agent/Agent.d.ts +3 -1
- package/esm/typings/src/other/templates/getTemplatesPipelineCollection.d.ts +1 -1
- package/esm/typings/src/types/typeAliases.d.ts +6 -0
- package/esm/typings/src/utils/color/Color.d.ts +1 -1
- package/esm/typings/src/utils/random/$generateBookBoilerplate.d.ts +6 -0
- package/esm/typings/src/utils/random/CzechNamePool.d.ts +7 -0
- package/esm/typings/src/utils/random/EnglishNamePool.d.ts +7 -0
- package/esm/typings/src/utils/random/NamePool.d.ts +17 -0
- package/esm/typings/src/utils/random/getNamePool.d.ts +10 -0
- package/esm/typings/src/version.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +65 -10
- package/umd/index.umd.js.map +1 -1
- package/apps/agents-server/src/app/agents/[agentName]/AgentProfileView.tsx +0 -233
- package/esm/typings/src/book-components/PromptbookAgent/PromptbookAgent.d.ts +0 -29
- /package/apps/agents-server/src/{app/agents/[agentName] → components/AgentProfile}/QrCodeModal.tsx +0 -0
package/esm/index.es.js
CHANGED
|
@@ -47,7 +47,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
47
47
|
* @generated
|
|
48
48
|
* @see https://github.com/webgptorg/promptbook
|
|
49
49
|
*/
|
|
50
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.103.0-
|
|
50
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.103.0-67';
|
|
51
51
|
/**
|
|
52
52
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
53
53
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -374,15 +374,33 @@ class Color {
|
|
|
374
374
|
* @param color
|
|
375
375
|
* @returns Color object
|
|
376
376
|
*/
|
|
377
|
-
static from(color) {
|
|
378
|
-
if (color
|
|
377
|
+
static from(color, _isSingleValue = false) {
|
|
378
|
+
if (color === '') {
|
|
379
|
+
throw new Error(`Can not create color from empty string`);
|
|
380
|
+
}
|
|
381
|
+
else if (color instanceof Color) {
|
|
379
382
|
return take(color);
|
|
380
383
|
}
|
|
381
384
|
else if (Color.isColor(color)) {
|
|
382
385
|
return take(color);
|
|
383
386
|
}
|
|
384
387
|
else if (typeof color === 'string') {
|
|
385
|
-
|
|
388
|
+
try {
|
|
389
|
+
return Color.fromString(color);
|
|
390
|
+
}
|
|
391
|
+
catch (error) {
|
|
392
|
+
// <- Note: Can not use `assertsError(error)` here because it causes circular dependency
|
|
393
|
+
if (_isSingleValue) {
|
|
394
|
+
throw error;
|
|
395
|
+
}
|
|
396
|
+
const parts = color.split(/[\s+,;|]/);
|
|
397
|
+
if (parts.length > 0) {
|
|
398
|
+
return Color.from(parts[0].trim(), true);
|
|
399
|
+
}
|
|
400
|
+
else {
|
|
401
|
+
throw new Error(`Can not create color from given string "${color}"`);
|
|
402
|
+
}
|
|
403
|
+
}
|
|
386
404
|
}
|
|
387
405
|
else {
|
|
388
406
|
console.error({ color });
|
|
@@ -22454,15 +22472,19 @@ const _FormattedBookInMarkdownTranspilerRegistration = $bookTranspilersRegister.
|
|
|
22454
22472
|
*
|
|
22455
22473
|
* @private - TODO: [🧠] Maybe should be public?
|
|
22456
22474
|
*/
|
|
22457
|
-
function createCommitmentRegex(commitment, aliases = []) {
|
|
22475
|
+
function createCommitmentRegex(commitment, aliases = [], requiresContent = true) {
|
|
22458
22476
|
const allCommitments = [commitment, ...aliases];
|
|
22459
22477
|
const patterns = allCommitments.map((c) => {
|
|
22460
22478
|
const escapedCommitment = c.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
22461
22479
|
return escapedCommitment.split(/\s+/).join('\\s+');
|
|
22462
22480
|
});
|
|
22463
22481
|
const keywordPattern = patterns.join('|');
|
|
22464
|
-
|
|
22465
|
-
|
|
22482
|
+
if (requiresContent) {
|
|
22483
|
+
return new RegExp(`^\\s*(?<type>${keywordPattern})\\b\\s+(?<contents>.+)$`, 'gim');
|
|
22484
|
+
}
|
|
22485
|
+
else {
|
|
22486
|
+
return new RegExp(`^\\s*(?<type>${keywordPattern})\\b(?:\\s+(?<contents>.+))?$`, 'gim');
|
|
22487
|
+
}
|
|
22466
22488
|
}
|
|
22467
22489
|
/**
|
|
22468
22490
|
* Generates a regex pattern to match a specific commitment type
|
|
@@ -22495,12 +22517,20 @@ class BaseCommitmentDefinition {
|
|
|
22495
22517
|
this.type = type;
|
|
22496
22518
|
this.aliases = aliases;
|
|
22497
22519
|
}
|
|
22520
|
+
/**
|
|
22521
|
+
* Whether this commitment requires content.
|
|
22522
|
+
* If true, regex will match only if there is content after the commitment keyword.
|
|
22523
|
+
* If false, regex will match even if there is no content.
|
|
22524
|
+
*/
|
|
22525
|
+
get requiresContent() {
|
|
22526
|
+
return true;
|
|
22527
|
+
}
|
|
22498
22528
|
/**
|
|
22499
22529
|
* Creates a regex pattern to match this commitment in agent source
|
|
22500
22530
|
* Uses the existing createCommitmentRegex function as internal helper
|
|
22501
22531
|
*/
|
|
22502
22532
|
createRegex() {
|
|
22503
|
-
return createCommitmentRegex(this.type, this.aliases);
|
|
22533
|
+
return createCommitmentRegex(this.type, this.aliases, this.requiresContent);
|
|
22504
22534
|
}
|
|
22505
22535
|
/**
|
|
22506
22536
|
* Creates a regex pattern to match just the commitment type
|
|
@@ -22652,6 +22682,12 @@ class ClosedCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
22652
22682
|
constructor() {
|
|
22653
22683
|
super('CLOSED');
|
|
22654
22684
|
}
|
|
22685
|
+
/**
|
|
22686
|
+
* The `CLOSED` commitment is standalone.
|
|
22687
|
+
*/
|
|
22688
|
+
get requiresContent() {
|
|
22689
|
+
return false;
|
|
22690
|
+
}
|
|
22655
22691
|
/**
|
|
22656
22692
|
* Short one-line description of CLOSED.
|
|
22657
22693
|
*/
|
|
@@ -25331,6 +25367,12 @@ class UseBrowserCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
25331
25367
|
constructor() {
|
|
25332
25368
|
super('USE BROWSER', ['BROWSER']);
|
|
25333
25369
|
}
|
|
25370
|
+
/**
|
|
25371
|
+
* The `USE BROWSER` commitment is standalone.
|
|
25372
|
+
*/
|
|
25373
|
+
get requiresContent() {
|
|
25374
|
+
return false;
|
|
25375
|
+
}
|
|
25334
25376
|
/**
|
|
25335
25377
|
* Short one-line description of USE BROWSER.
|
|
25336
25378
|
*/
|
|
@@ -26171,11 +26213,11 @@ function parseAgentSource(agentSource) {
|
|
|
26171
26213
|
continue;
|
|
26172
26214
|
}
|
|
26173
26215
|
if (commitment.type === 'META COLOR') {
|
|
26174
|
-
meta.color =
|
|
26216
|
+
meta.color = normalizeSeparator(commitment.content);
|
|
26175
26217
|
continue;
|
|
26176
26218
|
}
|
|
26177
26219
|
if (commitment.type === 'META FONT') {
|
|
26178
|
-
meta.font =
|
|
26220
|
+
meta.font = normalizeSeparator(commitment.content);
|
|
26179
26221
|
continue;
|
|
26180
26222
|
}
|
|
26181
26223
|
if (commitment.type !== 'META') {
|
|
@@ -26211,6 +26253,19 @@ function parseAgentSource(agentSource) {
|
|
|
26211
26253
|
parameters,
|
|
26212
26254
|
};
|
|
26213
26255
|
}
|
|
26256
|
+
/**
|
|
26257
|
+
* Normalizes the separator in the content
|
|
26258
|
+
*
|
|
26259
|
+
* @param content - The content to normalize
|
|
26260
|
+
* @returns The content with normalized separators
|
|
26261
|
+
*/
|
|
26262
|
+
function normalizeSeparator(content) {
|
|
26263
|
+
const trimmed = spaceTrim$2(content);
|
|
26264
|
+
if (trimmed.includes(',')) {
|
|
26265
|
+
return trimmed;
|
|
26266
|
+
}
|
|
26267
|
+
return trimmed.split(/\s+/).join(', ');
|
|
26268
|
+
}
|
|
26214
26269
|
/**
|
|
26215
26270
|
* TODO: [🕛] Unite `AgentBasicInformation`, `ChatParticipant`, `LlmExecutionTools` + `LlmToolsMetadata`
|
|
26216
26271
|
*/
|