@promptbook/wizard 0.104.0-4 โ 0.104.0-6
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 +3 -44
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/book-2.0/agent-source/createAgentModelRequirements.d.ts +6 -6
- package/esm/typings/src/book-2.0/utils/generatePlaceholderAgentProfileImageUrl.d.ts +3 -3
- package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentsDatabaseSchema.d.ts +18 -15
- package/esm/typings/src/types/typeAliases.d.ts +4 -0
- package/esm/typings/src/version.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +3 -44
- package/umd/index.umd.js.map +1 -1
- package/esm/typings/src/book-2.0/utils/generateGravatarUrl.d.ts +0 -10
package/esm/index.es.js
CHANGED
|
@@ -36,7 +36,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
36
36
|
* @generated
|
|
37
37
|
* @see https://github.com/webgptorg/promptbook
|
|
38
38
|
*/
|
|
39
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.104.0-
|
|
39
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.104.0-6';
|
|
40
40
|
/**
|
|
41
41
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
42
42
|
* Note: [๐] Ignore a discrepancy between file name and entity name
|
|
@@ -17531,44 +17531,6 @@ function normalizeTo_camelCase(text, _isFirstLetterCapital = false) {
|
|
|
17531
17531
|
* TODO: [๐บ] Use some intermediate util splitWords
|
|
17532
17532
|
*/
|
|
17533
17533
|
|
|
17534
|
-
/**
|
|
17535
|
-
* Generates a gravatar URL based on agent name for fallback avatar
|
|
17536
|
-
*
|
|
17537
|
-
* @param agentName The agent name to generate avatar for
|
|
17538
|
-
* @returns Gravatar URL
|
|
17539
|
-
*
|
|
17540
|
-
* @private - [๐คน] The fact that profile image is Gravatar is just implementation detail which should be hidden for consumer
|
|
17541
|
-
*/
|
|
17542
|
-
function generateGravatarUrl(agentName) {
|
|
17543
|
-
// Use a default name if none provided
|
|
17544
|
-
const safeName = agentName || 'Anonymous Agent';
|
|
17545
|
-
// Create a simple hash from the name for consistent avatar
|
|
17546
|
-
let hash = 0;
|
|
17547
|
-
for (let i = 0; i < safeName.length; i++) {
|
|
17548
|
-
const char = safeName.charCodeAt(i);
|
|
17549
|
-
hash = (hash << 5) - hash + char;
|
|
17550
|
-
hash = hash & hash; // Convert to 32bit integer
|
|
17551
|
-
}
|
|
17552
|
-
const avatarId = Math.abs(hash).toString();
|
|
17553
|
-
return `https://www.gravatar.com/avatar/${avatarId}?default=robohash&size=200&rating=x`;
|
|
17554
|
-
}
|
|
17555
|
-
|
|
17556
|
-
/**
|
|
17557
|
-
* Generates an image for the agent to use as profile image
|
|
17558
|
-
*
|
|
17559
|
-
* @param agentName The agent name to generate avatar for
|
|
17560
|
-
* @returns The placeholder profile image URL for the agent
|
|
17561
|
-
*
|
|
17562
|
-
* @public exported from `@promptbook/core`
|
|
17563
|
-
*/
|
|
17564
|
-
function generatePlaceholderAgentProfileImageUrl(agentName) {
|
|
17565
|
-
// Note: [๐คน] The fact that profile image is Gravatar is just implementation detail which should be hidden for consumer
|
|
17566
|
-
return generateGravatarUrl(agentName);
|
|
17567
|
-
}
|
|
17568
|
-
/**
|
|
17569
|
-
* TODO: [๐คน] Figure out best placeholder image generator https://i.pravatar.cc/1000?u=568
|
|
17570
|
-
*/
|
|
17571
|
-
|
|
17572
17534
|
/**
|
|
17573
17535
|
* Computes SHA-256 hash of the given object
|
|
17574
17536
|
*
|
|
@@ -17993,10 +17955,6 @@ function parseAgentSource(agentSource) {
|
|
|
17993
17955
|
const metaType = normalizeTo_camelCase(metaTypeRaw);
|
|
17994
17956
|
meta[metaType] = spaceTrim$2(commitment.content.substring(metaTypeRaw.length));
|
|
17995
17957
|
}
|
|
17996
|
-
// Generate gravatar fallback if no meta image specified
|
|
17997
|
-
if (!meta.image) {
|
|
17998
|
-
meta.image = generatePlaceholderAgentProfileImageUrl(parseResult.agentName || '!!');
|
|
17999
|
-
}
|
|
18000
17958
|
// Generate fullname fallback if no meta fullname specified
|
|
18001
17959
|
if (!meta.fullname) {
|
|
18002
17960
|
meta.fullname = parseResult.agentName || createDefaultAgentName(agentSource);
|
|
@@ -19170,12 +19128,13 @@ function cacheLlmTools(llmTools, options = {}) {
|
|
|
19170
19128
|
}
|
|
19171
19129
|
}
|
|
19172
19130
|
catch (error) {
|
|
19131
|
+
assertsError(error);
|
|
19173
19132
|
// If validation throws an unexpected error, don't cache
|
|
19174
19133
|
shouldCache = false;
|
|
19175
19134
|
if (isVerbose) {
|
|
19176
19135
|
console.info('Not caching result due to validation error for key:', key, {
|
|
19177
19136
|
content: promptResult.content,
|
|
19178
|
-
validationError:
|
|
19137
|
+
validationError: serializeError(error),
|
|
19179
19138
|
});
|
|
19180
19139
|
}
|
|
19181
19140
|
}
|