@promptbook/cli 0.103.0-51 → 0.103.0-53

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 (114) hide show
  1. package/apps/agents-server/README.md +1 -1
  2. package/apps/agents-server/config.ts +3 -3
  3. package/apps/agents-server/next.config.ts +1 -1
  4. package/apps/agents-server/public/sw.js +16 -0
  5. package/apps/agents-server/src/app/AddAgentButton.tsx +24 -4
  6. package/apps/agents-server/src/app/actions.ts +15 -13
  7. package/apps/agents-server/src/app/admin/chat-feedback/ChatFeedbackClient.tsx +541 -0
  8. package/apps/agents-server/src/app/admin/chat-feedback/page.tsx +22 -0
  9. package/apps/agents-server/src/app/admin/chat-history/ChatHistoryClient.tsx +532 -0
  10. package/apps/agents-server/src/app/admin/chat-history/page.tsx +21 -0
  11. package/apps/agents-server/src/app/admin/metadata/MetadataClient.tsx +241 -27
  12. package/apps/agents-server/src/app/admin/models/page.tsx +22 -0
  13. package/apps/agents-server/src/app/admin/users/[userId]/UserDetailClient.tsx +131 -0
  14. package/apps/agents-server/src/app/admin/users/[userId]/page.tsx +21 -0
  15. package/apps/agents-server/src/app/admin/users/page.tsx +18 -0
  16. package/apps/agents-server/src/app/agents/[agentName]/AgentQrCode.tsx +3 -3
  17. package/apps/agents-server/src/app/agents/[agentName]/ClearAgentChatFeedbackButton.tsx +63 -0
  18. package/apps/agents-server/src/app/agents/[agentName]/ClearAgentChatHistoryButton.tsx +63 -0
  19. package/apps/agents-server/src/app/agents/[agentName]/CloneAgentButton.tsx +41 -0
  20. package/apps/agents-server/src/app/agents/[agentName]/InstallPwaButton.tsx +74 -0
  21. package/apps/agents-server/src/app/agents/[agentName]/ServiceWorkerRegister.tsx +24 -0
  22. package/apps/agents-server/src/app/agents/[agentName]/_utils.ts +19 -0
  23. package/apps/agents-server/src/app/agents/[agentName]/api/agents/route.ts +67 -0
  24. package/apps/agents-server/src/app/agents/[agentName]/api/profile/route.ts +3 -0
  25. package/apps/agents-server/src/app/agents/[agentName]/api/voice/route.ts +177 -0
  26. package/apps/agents-server/src/app/agents/[agentName]/book/page.tsx +3 -0
  27. package/apps/agents-server/src/app/agents/[agentName]/book+chat/AgentBookAndChat.tsx +53 -1
  28. package/apps/agents-server/src/app/agents/[agentName]/generateAgentMetadata.ts +12 -12
  29. package/apps/agents-server/src/app/agents/[agentName]/history/RestoreVersionButton.tsx +46 -0
  30. package/apps/agents-server/src/app/agents/[agentName]/history/actions.ts +12 -0
  31. package/apps/agents-server/src/app/agents/[agentName]/history/page.tsx +62 -0
  32. package/apps/agents-server/src/app/agents/[agentName]/images/icon-256.png/route.tsx +80 -0
  33. package/apps/agents-server/src/app/agents/[agentName]/images/screenshot-fullhd.png/route.tsx +92 -0
  34. package/apps/agents-server/src/app/agents/[agentName]/images/screenshot-phone.png/route.tsx +92 -0
  35. package/apps/agents-server/src/app/agents/[agentName]/integration/page.tsx +61 -0
  36. package/apps/agents-server/src/app/agents/[agentName]/opengraph-image.tsx +102 -0
  37. package/apps/agents-server/src/app/agents/[agentName]/page.tsx +46 -24
  38. package/apps/agents-server/src/app/api/agents/[agentName]/clone/route.ts +47 -0
  39. package/apps/agents-server/src/app/api/agents/[agentName]/route.ts +19 -0
  40. package/apps/agents-server/src/app/api/agents/route.ts +22 -13
  41. package/apps/agents-server/src/app/api/auth/login/route.ts +6 -44
  42. package/apps/agents-server/src/app/api/chat-feedback/[id]/route.ts +38 -0
  43. package/apps/agents-server/src/app/api/chat-feedback/route.ts +157 -0
  44. package/apps/agents-server/src/app/api/chat-history/[id]/route.ts +37 -0
  45. package/apps/agents-server/src/app/api/chat-history/route.ts +147 -0
  46. package/apps/agents-server/src/app/api/federated-agents/route.ts +17 -0
  47. package/apps/agents-server/src/app/api/upload/route.ts +9 -1
  48. package/apps/agents-server/src/app/docs/[docId]/page.tsx +62 -0
  49. package/apps/agents-server/src/app/docs/page.tsx +33 -0
  50. package/apps/agents-server/src/app/layout.tsx +29 -3
  51. package/apps/agents-server/src/app/manifest.ts +109 -0
  52. package/apps/agents-server/src/app/page.tsx +8 -45
  53. package/apps/agents-server/src/app/recycle-bin/RestoreAgentButton.tsx +40 -0
  54. package/apps/agents-server/src/app/recycle-bin/actions.ts +27 -0
  55. package/apps/agents-server/src/app/recycle-bin/page.tsx +58 -0
  56. package/apps/agents-server/src/app/restricted/page.tsx +33 -0
  57. package/apps/agents-server/src/app/test/og-image/README.md +1 -0
  58. package/apps/agents-server/src/app/test/og-image/opengraph-image.tsx +37 -0
  59. package/apps/agents-server/src/app/test/og-image/page.tsx +22 -0
  60. package/apps/agents-server/src/components/Footer/Footer.tsx +175 -0
  61. package/apps/agents-server/src/components/Header/Header.tsx +445 -79
  62. package/apps/agents-server/src/components/Homepage/AgentCard.tsx +46 -14
  63. package/apps/agents-server/src/components/Homepage/AgentsList.tsx +58 -0
  64. package/apps/agents-server/src/components/Homepage/Card.tsx +1 -1
  65. package/apps/agents-server/src/components/Homepage/ExternalAgentsSection.tsx +21 -0
  66. package/apps/agents-server/src/components/Homepage/ExternalAgentsSectionClient.tsx +183 -0
  67. package/apps/agents-server/src/components/Homepage/ModelsSection.tsx +75 -0
  68. package/apps/agents-server/src/components/LayoutWrapper/LayoutWrapper.tsx +28 -3
  69. package/apps/agents-server/src/components/LoginDialog/LoginDialog.tsx +18 -17
  70. package/apps/agents-server/src/components/Portal/Portal.tsx +38 -0
  71. package/apps/agents-server/src/components/UsersList/UsersList.tsx +82 -131
  72. package/apps/agents-server/src/components/UsersList/useUsersAdmin.ts +139 -0
  73. package/apps/agents-server/src/database/metadataDefaults.ts +38 -6
  74. package/apps/agents-server/src/middleware.ts +146 -93
  75. package/apps/agents-server/src/tools/$provideServer.ts +2 -2
  76. package/apps/agents-server/src/utils/authenticateUser.ts +42 -0
  77. package/apps/agents-server/src/utils/chatFeedbackAdmin.ts +96 -0
  78. package/apps/agents-server/src/utils/chatHistoryAdmin.ts +96 -0
  79. package/apps/agents-server/src/utils/getEffectiveFederatedServers.ts +22 -0
  80. package/apps/agents-server/src/utils/getFederatedAgents.ts +31 -8
  81. package/apps/agents-server/src/utils/getFederatedServersFromMetadata.ts +10 -0
  82. package/apps/agents-server/src/utils/getVisibleCommitmentDefinitions.ts +12 -0
  83. package/apps/agents-server/src/utils/isUserAdmin.ts +2 -2
  84. package/apps/agents-server/vercel.json +7 -0
  85. package/esm/index.es.js +344 -11
  86. package/esm/index.es.js.map +1 -1
  87. package/esm/typings/servers.d.ts +8 -1
  88. package/esm/typings/src/_packages/components.index.d.ts +2 -0
  89. package/esm/typings/src/_packages/core.index.d.ts +6 -0
  90. package/esm/typings/src/_packages/types.index.d.ts +2 -0
  91. package/esm/typings/src/_packages/utils.index.d.ts +2 -0
  92. package/esm/typings/src/book-2.0/agent-source/AgentBasicInformation.d.ts +1 -0
  93. package/esm/typings/src/book-2.0/agent-source/AgentModelRequirements.d.ts +7 -0
  94. package/esm/typings/src/book-2.0/agent-source/createCommitmentRegex.d.ts +2 -2
  95. package/esm/typings/src/book-components/Chat/Chat/ChatProps.d.ts +10 -0
  96. package/esm/typings/src/book-components/PromptbookAgent/PromptbookAgent.d.ts +6 -0
  97. package/esm/typings/src/book-components/_common/HamburgerMenu/HamburgerMenu.d.ts +12 -0
  98. package/esm/typings/src/book-components/icons/MicIcon.d.ts +8 -0
  99. package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +17 -0
  100. package/esm/typings/src/commitments/MESSAGE/AgentMessageCommitmentDefinition.d.ts +28 -0
  101. package/esm/typings/src/commitments/MESSAGE/UserMessageCommitmentDefinition.d.ts +28 -0
  102. package/esm/typings/src/commitments/META_COLOR/META_COLOR.d.ts +38 -0
  103. package/esm/typings/src/commitments/_base/BaseCommitmentDefinition.d.ts +2 -1
  104. package/esm/typings/src/commitments/index.d.ts +22 -1
  105. package/esm/typings/src/execution/LlmExecutionTools.d.ts +9 -0
  106. package/esm/typings/src/llm-providers/agent/Agent.d.ts +1 -0
  107. package/esm/typings/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +2 -1
  108. package/esm/typings/src/llm-providers/agent/RemoteAgent.d.ts +10 -1
  109. package/esm/typings/src/utils/normalization/normalizeMessageText.d.ts +9 -0
  110. package/esm/typings/src/utils/normalization/normalizeMessageText.test.d.ts +1 -0
  111. package/esm/typings/src/version.d.ts +1 -1
  112. package/package.json +1 -1
  113. package/umd/index.umd.js +344 -11
  114. package/umd/index.umd.js.map +1 -1
package/esm/index.es.js CHANGED
@@ -47,12 +47,23 @@ 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-51';
50
+ const PROMPTBOOK_ENGINE_VERSION = '0.103.0-53';
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
54
54
  */
55
55
 
56
+ /**
57
+ * Core Promptbook server configuration.
58
+ *
59
+ * This server is also used for auto-federation in the Agents Server.
60
+ */
61
+ const CORE_SERVER = {
62
+ title: 'Promptbook Core',
63
+ description: `Core Promptbook server used for auto-federation`,
64
+ owner: 'AI Web, LLC <legal@ptbk.io> (https://www.ptbk.io/)',
65
+ urls: ['https://core.ptbk.io/'],
66
+ };
56
67
  /**
57
68
  * Available remote servers for the Promptbook
58
69
  *
@@ -74,6 +85,7 @@ const REMOTE_SERVER_URLS = [
74
85
  owner: 'AI Web, LLC <legal@ptbk.io> (https://www.ptbk.io/)',
75
86
  urls: ['https://s6.ptbk.io/'],
76
87
  },
88
+ CORE_SERVER,
77
89
  /*
78
90
  Note: Working on older version of Promptbook and not supported anymore
79
91
  {
@@ -86,7 +98,6 @@ const REMOTE_SERVER_URLS = [
86
98
  */
87
99
  ];
88
100
  /**
89
- * TODO: [🐱‍🚀] Auto-federated server from url in here
90
101
  * Note: [💞] Ignore a discrepancy between file name and entity name
91
102
  */
92
103
 
@@ -20681,12 +20692,15 @@ class OpenAiAssistantExecutionTools extends OpenAiExecutionTools {
20681
20692
  fileStreams.push(file);
20682
20693
  }
20683
20694
  else {
20695
+ /*
20696
+ TODO: [🐱‍🚀] Resolve problem with browser environment
20684
20697
  // Assume it's a local file path
20685
20698
  // Note: This will work in Node.js environment
20686
20699
  // For browser environments, this would need different handling
20687
20700
  const fs = await import('fs');
20688
20701
  const fileStream = fs.createReadStream(source);
20689
20702
  fileStreams.push(fileStream);
20703
+ */
20690
20704
  }
20691
20705
  }
20692
20706
  catch (error) {
@@ -20775,12 +20789,15 @@ class OpenAiAssistantExecutionTools extends OpenAiExecutionTools {
20775
20789
  fileStreams.push(file);
20776
20790
  }
20777
20791
  else {
20792
+ /*
20793
+ TODO: [🐱‍🚀] Resolve problem with browser environment
20778
20794
  // Assume it's a local file path
20779
20795
  // Note: This will work in Node.js environment
20780
20796
  // For browser environments, this would need different handling
20781
20797
  const fs = await import('fs');
20782
20798
  const fileStream = fs.createReadStream(source);
20783
20799
  fileStreams.push(fileStream);
20800
+ */
20784
20801
  }
20785
20802
  }
20786
20803
  catch (error) {
@@ -22395,9 +22412,13 @@ const _FormattedBookInMarkdownTranspilerRegistration = $bookTranspilersRegister.
22395
22412
  *
22396
22413
  * @private - TODO: [🧠] Maybe should be public?
22397
22414
  */
22398
- function createCommitmentRegex(commitment) {
22399
- const escapedCommitment = commitment.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
22400
- const keywordPattern = escapedCommitment.split(/\s+/).join('\\s+');
22415
+ function createCommitmentRegex(commitment, aliases = []) {
22416
+ const allCommitments = [commitment, ...aliases];
22417
+ const patterns = allCommitments.map((c) => {
22418
+ const escapedCommitment = c.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
22419
+ return escapedCommitment.split(/\s+/).join('\\s+');
22420
+ });
22421
+ const keywordPattern = patterns.join('|');
22401
22422
  const regex = new RegExp(`^\\s*(?<type>${keywordPattern})\\b\\s+(?<contents>.+)$`, 'gim');
22402
22423
  return regex;
22403
22424
  }
@@ -22410,9 +22431,13 @@ function createCommitmentRegex(commitment) {
22410
22431
  *
22411
22432
  * @private
22412
22433
  */
22413
- function createCommitmentTypeRegex(commitment) {
22414
- const escapedCommitment = commitment.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
22415
- const keywordPattern = escapedCommitment.split(/\s+/).join('\\s+');
22434
+ function createCommitmentTypeRegex(commitment, aliases = []) {
22435
+ const allCommitments = [commitment, ...aliases];
22436
+ const patterns = allCommitments.map((c) => {
22437
+ const escapedCommitment = c.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
22438
+ return escapedCommitment.split(/\s+/).join('\\s+');
22439
+ });
22440
+ const keywordPattern = patterns.join('|');
22416
22441
  const regex = new RegExp(`^\\s*(?<type>${keywordPattern})\\b`, 'gim');
22417
22442
  return regex;
22418
22443
  }
@@ -22424,22 +22449,23 @@ function createCommitmentTypeRegex(commitment) {
22424
22449
  * @private
22425
22450
  */
22426
22451
  class BaseCommitmentDefinition {
22427
- constructor(type) {
22452
+ constructor(type, aliases = []) {
22428
22453
  this.type = type;
22454
+ this.aliases = aliases;
22429
22455
  }
22430
22456
  /**
22431
22457
  * Creates a regex pattern to match this commitment in agent source
22432
22458
  * Uses the existing createCommitmentRegex function as internal helper
22433
22459
  */
22434
22460
  createRegex() {
22435
- return createCommitmentRegex(this.type);
22461
+ return createCommitmentRegex(this.type, this.aliases);
22436
22462
  }
22437
22463
  /**
22438
22464
  * Creates a regex pattern to match just the commitment type
22439
22465
  * Uses the existing createCommitmentTypeRegex function as internal helper
22440
22466
  */
22441
22467
  createTypeRegex() {
22442
- return createCommitmentTypeRegex(this.type);
22468
+ return createCommitmentTypeRegex(this.type, this.aliases);
22443
22469
  }
22444
22470
  /**
22445
22471
  * Helper method to create a new requirements object with updated system message
@@ -23050,6 +23076,77 @@ class MemoryCommitmentDefinition extends BaseCommitmentDefinition {
23050
23076
  * Note: [💞] Ignore a discrepancy between file name and entity name
23051
23077
  */
23052
23078
 
23079
+ /**
23080
+ * AGENT MESSAGE commitment definition
23081
+ *
23082
+ * The AGENT MESSAGE commitment defines a message from the agent in the conversation history.
23083
+ * It is used to pre-fill the chat with a conversation history or to provide few-shot examples.
23084
+ *
23085
+ * Example usage in agent source:
23086
+ *
23087
+ * ```book
23088
+ * AGENT MESSAGE What seems to be the issue?
23089
+ * ```
23090
+ *
23091
+ * @private [🪔] Maybe export the commitments through some package
23092
+ */
23093
+ class AgentMessageCommitmentDefinition extends BaseCommitmentDefinition {
23094
+ constructor() {
23095
+ super('AGENT MESSAGE');
23096
+ }
23097
+ /**
23098
+ * Short one-line description of AGENT MESSAGE.
23099
+ */
23100
+ get description() {
23101
+ return 'Defines a **message from the agent** in the conversation history.';
23102
+ }
23103
+ /**
23104
+ * Markdown documentation for AGENT MESSAGE commitment.
23105
+ */
23106
+ get documentation() {
23107
+ return spaceTrim$1(`
23108
+ # ${this.type}
23109
+
23110
+ Defines a message from the agent in the conversation history. This is used to pre-fill the chat with a conversation history or to provide few-shot examples.
23111
+
23112
+ ## Key aspects
23113
+
23114
+ - Represents a message sent by the agent.
23115
+ - Used for setting up conversation context.
23116
+ - Can be used in conjunction with USER MESSAGE.
23117
+
23118
+ ## Examples
23119
+
23120
+ \`\`\`book
23121
+ Conversation History
23122
+
23123
+ USER MESSAGE Hello, I have a problem.
23124
+ AGENT MESSAGE What seems to be the issue?
23125
+ USER MESSAGE My computer is not starting.
23126
+ \`\`\`
23127
+ `);
23128
+ }
23129
+ applyToAgentModelRequirements(requirements, content) {
23130
+ // AGENT MESSAGE is for UI display purposes / conversation history construction
23131
+ // and typically doesn't need to be added to the system prompt or model requirements directly.
23132
+ // It is extracted separately for the chat interface.
23133
+ var _a;
23134
+ const pendingUserMessage = (_a = requirements.metadata) === null || _a === void 0 ? void 0 : _a.pendingUserMessage;
23135
+ if (pendingUserMessage) {
23136
+ const newSample = { question: pendingUserMessage, answer: content };
23137
+ const newSamples = [...(requirements.samples || []), newSample];
23138
+ const newMetadata = { ...requirements.metadata };
23139
+ delete newMetadata.pendingUserMessage;
23140
+ return {
23141
+ ...requirements,
23142
+ samples: newSamples,
23143
+ metadata: newMetadata,
23144
+ };
23145
+ }
23146
+ return requirements;
23147
+ }
23148
+ }
23149
+
23053
23150
  /**
23054
23151
  * INITIAL MESSAGE commitment definition
23055
23152
  *
@@ -23214,6 +23311,67 @@ class MessageCommitmentDefinition extends BaseCommitmentDefinition {
23214
23311
  * Note: [💞] Ignore a discrepancy between file name and entity name
23215
23312
  */
23216
23313
 
23314
+ /**
23315
+ * USER MESSAGE commitment definition
23316
+ *
23317
+ * The USER MESSAGE commitment defines a message from the user in the conversation history.
23318
+ * It is used to pre-fill the chat with a conversation history or to provide few-shot examples.
23319
+ *
23320
+ * Example usage in agent source:
23321
+ *
23322
+ * ```book
23323
+ * USER MESSAGE Hello, I have a problem.
23324
+ * ```
23325
+ *
23326
+ * @private [🪔] Maybe export the commitments through some package
23327
+ */
23328
+ class UserMessageCommitmentDefinition extends BaseCommitmentDefinition {
23329
+ constructor() {
23330
+ super('USER MESSAGE');
23331
+ }
23332
+ /**
23333
+ * Short one-line description of USER MESSAGE.
23334
+ */
23335
+ get description() {
23336
+ return 'Defines a **message from the user** in the conversation history.';
23337
+ }
23338
+ /**
23339
+ * Markdown documentation for USER MESSAGE commitment.
23340
+ */
23341
+ get documentation() {
23342
+ return spaceTrim$1(`
23343
+ # ${this.type}
23344
+
23345
+ Defines a message from the user in the conversation history. This is used to pre-fill the chat with a conversation history or to provide few-shot examples.
23346
+
23347
+ ## Key aspects
23348
+
23349
+ - Represents a message sent by the user.
23350
+ - Used for setting up conversation context.
23351
+ - Can be used in conjunction with AGENT MESSAGE.
23352
+
23353
+ ## Examples
23354
+
23355
+ \`\`\`book
23356
+ Conversation History
23357
+
23358
+ USER MESSAGE Hello, I have a problem.
23359
+ AGENT MESSAGE What seems to be the issue?
23360
+ USER MESSAGE My computer is not starting.
23361
+ \`\`\`
23362
+ `);
23363
+ }
23364
+ applyToAgentModelRequirements(requirements, content) {
23365
+ return {
23366
+ ...requirements,
23367
+ metadata: {
23368
+ ...requirements.metadata,
23369
+ pendingUserMessage: content,
23370
+ },
23371
+ };
23372
+ }
23373
+ }
23374
+
23217
23375
  /**
23218
23376
  * META commitment definition
23219
23377
  *
@@ -23351,6 +23509,165 @@ class MetaCommitmentDefinition extends BaseCommitmentDefinition {
23351
23509
  * Note: [💞] Ignore a discrepancy between file name and entity name
23352
23510
  */
23353
23511
 
23512
+ /**
23513
+ * META COLOR commitment definition
23514
+ *
23515
+ * The META COLOR commitment sets the agent's accent color.
23516
+ * This commitment is special because it doesn't affect the system message,
23517
+ * but is handled separately in the parsing logic.
23518
+ *
23519
+ * Example usage in agent source:
23520
+ *
23521
+ * ```book
23522
+ * META COLOR #ff0000
23523
+ * META COLOR #00ff00
23524
+ * ```
23525
+ *
23526
+ * @private [🪔] Maybe export the commitments through some package
23527
+ */
23528
+ class MetaColorCommitmentDefinition extends BaseCommitmentDefinition {
23529
+ constructor() {
23530
+ super('META COLOR', ['COLOR']);
23531
+ }
23532
+ /**
23533
+ * Short one-line description of META COLOR.
23534
+ */
23535
+ get description() {
23536
+ return "Set the agent's accent color.";
23537
+ }
23538
+ /**
23539
+ * Markdown documentation for META COLOR commitment.
23540
+ */
23541
+ get documentation() {
23542
+ return spaceTrim$1(`
23543
+ # META COLOR
23544
+
23545
+ Sets the agent's accent color.
23546
+
23547
+ ## Key aspects
23548
+
23549
+ - Does not modify the agent's behavior or responses.
23550
+ - Only one \`META COLOR\` should be used per agent.
23551
+ - If multiple are specified, the last one takes precedence.
23552
+ - Used for visual representation in user interfaces.
23553
+
23554
+ ## Examples
23555
+
23556
+ \`\`\`book
23557
+ Professional Assistant
23558
+
23559
+ META COLOR #3498db
23560
+ PERSONA You are a professional business assistant
23561
+ \`\`\`
23562
+
23563
+ \`\`\`book
23564
+ Creative Helper
23565
+
23566
+ META COLOR #e74c3c
23567
+ PERSONA You are a creative and inspiring assistant
23568
+ \`\`\`
23569
+ `);
23570
+ }
23571
+ applyToAgentModelRequirements(requirements, content) {
23572
+ // META COLOR doesn't modify the system message or model requirements
23573
+ // It's handled separately in the parsing logic for profile color extraction
23574
+ // This method exists for consistency with the CommitmentDefinition interface
23575
+ return requirements;
23576
+ }
23577
+ /**
23578
+ * Extracts the profile color from the content
23579
+ * This is used by the parsing logic
23580
+ */
23581
+ extractProfileColor(content) {
23582
+ const trimmedContent = content.trim();
23583
+ return trimmedContent || null;
23584
+ }
23585
+ }
23586
+ /**
23587
+ * Note: [💞] Ignore a discrepancy between file name and entity name
23588
+ */
23589
+
23590
+ /**
23591
+ * META IMAGE commitment definition
23592
+ *
23593
+ * The META IMAGE commitment sets the agent's avatar/profile image URL.
23594
+ * This commitment is special because it doesn't affect the system message,
23595
+ * but is handled separately in the parsing logic.
23596
+ *
23597
+ * Example usage in agent source:
23598
+ *
23599
+ * ```book
23600
+ * META IMAGE https://example.com/avatar.jpg
23601
+ * META IMAGE /assets/agent-avatar.png
23602
+ * ```
23603
+ *
23604
+ * @private [🪔] Maybe export the commitments through some package
23605
+ */
23606
+ class MetaImageCommitmentDefinition extends BaseCommitmentDefinition {
23607
+ constructor() {
23608
+ super('META IMAGE', ['IMAGE']);
23609
+ }
23610
+ /**
23611
+ * Short one-line description of META IMAGE.
23612
+ */
23613
+ get description() {
23614
+ return "Set the agent's profile image URL.";
23615
+ }
23616
+ /**
23617
+ * Markdown documentation for META IMAGE commitment.
23618
+ */
23619
+ get documentation() {
23620
+ return spaceTrim$1(`
23621
+ # META IMAGE
23622
+
23623
+ Sets the agent's avatar/profile image URL.
23624
+
23625
+ ## Key aspects
23626
+
23627
+ - Does not modify the agent's behavior or responses.
23628
+ - Only one \`META IMAGE\` should be used per agent.
23629
+ - If multiple are specified, the last one takes precedence.
23630
+ - Used for visual representation in user interfaces.
23631
+
23632
+ ## Examples
23633
+
23634
+ \`\`\`book
23635
+ Professional Assistant
23636
+
23637
+ META IMAGE https://example.com/professional-avatar.jpg
23638
+ PERSONA You are a professional business assistant
23639
+ STYLE Maintain a formal and courteous tone
23640
+ \`\`\`
23641
+
23642
+ \`\`\`book
23643
+ Creative Helper
23644
+
23645
+ META IMAGE /assets/creative-bot-avatar.png
23646
+ PERSONA You are a creative and inspiring assistant
23647
+ STYLE Be enthusiastic and encouraging
23648
+ ACTION Can help with brainstorming and ideation
23649
+ \`\`\`
23650
+ `);
23651
+ }
23652
+ applyToAgentModelRequirements(requirements, content) {
23653
+ // META IMAGE doesn't modify the system message or model requirements
23654
+ // It's handled separately in the parsing logic for profile image extraction
23655
+ // This method exists for consistency with the CommitmentDefinition interface
23656
+ return requirements;
23657
+ }
23658
+ /**
23659
+ * Extracts the profile image URL from the content
23660
+ * This is used by the parsing logic
23661
+ */
23662
+ extractProfileImageUrl(content) {
23663
+ const trimmedContent = content.trim();
23664
+ return trimmedContent || null;
23665
+ }
23666
+ }
23667
+ /**
23668
+ * Note: [💞] Ignore a discrepancy between file name and entity name
23669
+ */
23670
+
23354
23671
  /**
23355
23672
  * MODEL commitment definition
23356
23673
  *
@@ -24258,6 +24575,8 @@ const COMMITMENT_REGISTRY = [
24258
24575
  new ModelCommitmentDefinition('MODELS'),
24259
24576
  new ActionCommitmentDefinition('ACTION'),
24260
24577
  new ActionCommitmentDefinition('ACTIONS'),
24578
+ new MetaImageCommitmentDefinition(),
24579
+ new MetaColorCommitmentDefinition(),
24261
24580
  new MetaCommitmentDefinition(),
24262
24581
  new NoteCommitmentDefinition('NOTE'),
24263
24582
  new NoteCommitmentDefinition('NOTES'),
@@ -24266,6 +24585,8 @@ const COMMITMENT_REGISTRY = [
24266
24585
  new GoalCommitmentDefinition('GOAL'),
24267
24586
  new GoalCommitmentDefinition('GOALS'),
24268
24587
  new InitialMessageCommitmentDefinition(),
24588
+ new UserMessageCommitmentDefinition(),
24589
+ new AgentMessageCommitmentDefinition(),
24269
24590
  new MessageCommitmentDefinition('MESSAGE'),
24270
24591
  new MessageCommitmentDefinition('MESSAGES'),
24271
24592
  new ScenarioCommitmentDefinition('SCENARIO'),
@@ -24710,6 +25031,14 @@ function parseAgentSource(agentSource) {
24710
25031
  links.push(spaceTrim(commitment.content));
24711
25032
  continue;
24712
25033
  }
25034
+ if (commitment.type === 'META IMAGE') {
25035
+ meta.image = spaceTrim(commitment.content);
25036
+ continue;
25037
+ }
25038
+ if (commitment.type === 'META COLOR') {
25039
+ meta.color = spaceTrim(commitment.content);
25040
+ continue;
25041
+ }
24713
25042
  if (commitment.type !== 'META') {
24714
25043
  continue;
24715
25044
  }
@@ -24725,6 +25054,10 @@ function parseAgentSource(agentSource) {
24725
25054
  if (!meta.image) {
24726
25055
  meta.image = generatePlaceholderAgentProfileImageUrl(parseResult.agentName || '!!');
24727
25056
  }
25057
+ // Generate fullname fallback if no meta fullname specified
25058
+ if (!meta.fullname) {
25059
+ meta.fullname = parseResult.agentName || createDefaultAgentName(agentSource);
25060
+ }
24728
25061
  // Parse parameters using unified approach - both @Parameter and {parameter} notations
24729
25062
  // are treated as the same syntax feature with unified representation
24730
25063
  const parameters = parseParameters(agentSource);