@promptbook/cli 0.104.0-5 → 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.
Files changed (26) hide show
  1. package/apps/agents-server/src/app/agents/[agentName]/AgentProfileWrapper.tsx +3 -2
  2. package/apps/agents-server/src/app/agents/[agentName]/_utils.ts +6 -2
  3. package/apps/agents-server/src/app/agents/[agentName]/code/page.tsx +14 -8
  4. package/apps/agents-server/src/app/agents/[agentName]/images/icon-256.png/route.tsx +5 -2
  5. package/apps/agents-server/src/app/agents/[agentName]/images/screenshot-fullhd.png/route.tsx +2 -2
  6. package/apps/agents-server/src/app/agents/[agentName]/images/screenshot-phone.png/route.tsx +2 -2
  7. package/apps/agents-server/src/app/agents/[agentName]/integration/page.tsx +2 -2
  8. package/apps/agents-server/src/app/agents/[agentName]/links/page.tsx +2 -2
  9. package/apps/agents-server/src/app/agents/[agentName]/opengraph-image.tsx +6 -2
  10. package/apps/agents-server/src/app/agents/[agentName]/page.tsx +7 -4
  11. package/apps/agents-server/src/app/agents/[agentName]/system-message/page.tsx +2 -1
  12. package/apps/agents-server/src/app/api/emails/incoming/sendgrid/route.ts +48 -0
  13. package/apps/agents-server/src/components/AgentProfile/AgentProfile.tsx +10 -2
  14. package/apps/agents-server/src/components/Homepage/AgentCard.tsx +2 -1
  15. package/apps/agents-server/src/message-providers/email/sendgrid/parseInboundSendgridEmail.ts +49 -0
  16. package/apps/agents-server/src/utils/content/extractBodyContentFromHtml.ts +19 -0
  17. package/esm/index.es.js +1 -43
  18. package/esm/index.es.js.map +1 -1
  19. package/esm/typings/src/book-2.0/agent-source/createAgentModelRequirements.d.ts +6 -6
  20. package/esm/typings/src/book-2.0/utils/generatePlaceholderAgentProfileImageUrl.d.ts +3 -3
  21. package/esm/typings/src/types/typeAliases.d.ts +4 -0
  22. package/esm/typings/src/version.d.ts +1 -1
  23. package/package.json +1 -1
  24. package/umd/index.umd.js +1 -43
  25. package/umd/index.umd.js.map +1 -1
  26. package/esm/typings/src/book-2.0/utils/generateGravatarUrl.d.ts +0 -10
@@ -1,6 +1,6 @@
1
1
  import type { AvailableModel } from '../../execution/AvailableModel';
2
2
  import type { LlmExecutionTools } from '../../execution/LlmExecutionTools';
3
- import type { string_model_name } from '../../types/typeAliases';
3
+ import type { string_agent_name, string_model_name, string_system_message, string_url_image } from '../../types/typeAliases';
4
4
  import type { AgentModelRequirements } from './AgentModelRequirements';
5
5
  import type { string_book } from './string_book';
6
6
  /**
@@ -27,18 +27,18 @@ export declare function extractMcpServers(agentSource: string_book): string[];
27
27
  * @deprecated Use createAgentModelRequirements instead
28
28
  * @private
29
29
  */
30
- export declare function createAgentSystemMessage(agentSource: string_book): Promise<string>;
30
+ export declare function createAgentSystemMessage(agentSource: string_book): Promise<string_system_message>;
31
31
  /**
32
32
  * Extracts the agent name from the first line of the agent source
33
33
  * @deprecated Use parseAgentSource instead
34
34
  * @private
35
35
  */
36
- export declare function extractAgentName(agentSource: string_book): string;
36
+ export declare function extractAgentName(agentSource: string_book): string_agent_name;
37
37
  /**
38
- * Extracts the profile image URL from agent source or returns gravatar fallback
38
+ * Extracts the profile image URL from agent source or returns default avatar fallback
39
39
  * @param agentSource The agent source string that may contain META IMAGE line
40
- * @returns Profile image URL (from source or gravatar fallback)
40
+ * @returns Profile image URL (from source or default avatar fallback)
41
41
  * @deprecated Use parseAgentSource instead
42
42
  * @private
43
43
  */
44
- export declare function extractAgentProfileImage(agentSource: string_book): string;
44
+ export declare function extractAgentProfileImage(agentSource: string_book): string_url_image | null;
@@ -1,13 +1,13 @@
1
- import type { string_agent_name, string_url_image } from '../../types/typeAliases';
1
+ import type { string_agent_name, string_agent_permanent_id, string_url_image } from '../../types/typeAliases';
2
2
  /**
3
3
  * Generates an image for the agent to use as profile image
4
4
  *
5
- * @param agentName The agent name to generate avatar for
5
+ * @param agentId - The permanent ID of the agent
6
6
  * @returns The placeholder profile image URL for the agent
7
7
  *
8
8
  * @public exported from `@promptbook/core`
9
9
  */
10
- export declare function generatePlaceholderAgentProfileImageUrl(agentName?: string_agent_name): string_url_image;
10
+ export declare function generatePlaceholderAgentProfileImageUrl(agentIdOrName: string_agent_permanent_id | string_agent_name): string_url_image;
11
11
  /**
12
12
  * TODO: [🤹] Figure out best placeholder image generator https://i.pravatar.cc/1000?u=568
13
13
  */
@@ -140,6 +140,8 @@ export type string_title = string;
140
140
  * Semantic helper
141
141
  *
142
142
  * For example `"My AI Assistant"`
143
+ *
144
+ * TODO: !!!! Brand the type
143
145
  */
144
146
  export type string_agent_name = string;
145
147
  /**
@@ -158,6 +160,8 @@ export type string_agent_hash = string_sha256;
158
160
  * Semantic helper
159
161
  *
160
162
  * For example `"3mJr7AoUXx2Wqd"`
163
+ *
164
+ * TODO: !!!! Brand the type
161
165
  */
162
166
  export type string_agent_permanent_id = string_base_58;
163
167
  /**
@@ -15,7 +15,7 @@ export declare const BOOK_LANGUAGE_VERSION: string_semantic_version;
15
15
  export declare const PROMPTBOOK_ENGINE_VERSION: string_promptbook_version;
16
16
  /**
17
17
  * Represents the version string of the Promptbook engine.
18
- * It follows semantic versioning (e.g., `0.104.0-4`).
18
+ * It follows semantic versioning (e.g., `0.104.0-5`).
19
19
  *
20
20
  * @generated
21
21
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/cli",
3
- "version": "0.104.0-5",
3
+ "version": "0.104.0-6",
4
4
  "description": "Promptbook: Turn your company's scattered knowledge into AI ready books",
5
5
  "private": false,
6
6
  "sideEffects": false,
package/umd/index.umd.js CHANGED
@@ -56,7 +56,7 @@
56
56
  * @generated
57
57
  * @see https://github.com/webgptorg/promptbook
58
58
  */
59
- const PROMPTBOOK_ENGINE_VERSION = '0.104.0-5';
59
+ const PROMPTBOOK_ENGINE_VERSION = '0.104.0-6';
60
60
  /**
61
61
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
62
62
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -26472,44 +26472,6 @@
26472
26472
  };
26473
26473
  }
26474
26474
 
26475
- /**
26476
- * Generates a gravatar URL based on agent name for fallback avatar
26477
- *
26478
- * @param agentName The agent name to generate avatar for
26479
- * @returns Gravatar URL
26480
- *
26481
- * @private - [🤹] The fact that profile image is Gravatar is just implementation detail which should be hidden for consumer
26482
- */
26483
- function generateGravatarUrl(agentName) {
26484
- // Use a default name if none provided
26485
- const safeName = agentName || 'Anonymous Agent';
26486
- // Create a simple hash from the name for consistent avatar
26487
- let hash = 0;
26488
- for (let i = 0; i < safeName.length; i++) {
26489
- const char = safeName.charCodeAt(i);
26490
- hash = (hash << 5) - hash + char;
26491
- hash = hash & hash; // Convert to 32bit integer
26492
- }
26493
- const avatarId = Math.abs(hash).toString();
26494
- return `https://www.gravatar.com/avatar/${avatarId}?default=robohash&size=200&rating=x`;
26495
- }
26496
-
26497
- /**
26498
- * Generates an image for the agent to use as profile image
26499
- *
26500
- * @param agentName The agent name to generate avatar for
26501
- * @returns The placeholder profile image URL for the agent
26502
- *
26503
- * @public exported from `@promptbook/core`
26504
- */
26505
- function generatePlaceholderAgentProfileImageUrl(agentName) {
26506
- // Note: [🤹] The fact that profile image is Gravatar is just implementation detail which should be hidden for consumer
26507
- return generateGravatarUrl(agentName);
26508
- }
26509
- /**
26510
- * TODO: [🤹] Figure out best placeholder image generator https://i.pravatar.cc/1000?u=568
26511
- */
26512
-
26513
26475
  /**
26514
26476
  * Computes SHA-256 hash of the agent source
26515
26477
  *
@@ -26607,10 +26569,6 @@
26607
26569
  const metaType = normalizeTo_camelCase(metaTypeRaw);
26608
26570
  meta[metaType] = spaceTrim__default["default"](commitment.content.substring(metaTypeRaw.length));
26609
26571
  }
26610
- // Generate gravatar fallback if no meta image specified
26611
- if (!meta.image) {
26612
- meta.image = generatePlaceholderAgentProfileImageUrl(parseResult.agentName || '!!');
26613
- }
26614
26572
  // Generate fullname fallback if no meta fullname specified
26615
26573
  if (!meta.fullname) {
26616
26574
  meta.fullname = parseResult.agentName || createDefaultAgentName(agentSource);