@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/umd/index.umd.js CHANGED
@@ -56,12 +56,23 @@
56
56
  * @generated
57
57
  * @see https://github.com/webgptorg/promptbook
58
58
  */
59
- const PROMPTBOOK_ENGINE_VERSION = '0.103.0-51';
59
+ const PROMPTBOOK_ENGINE_VERSION = '0.103.0-53';
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
63
63
  */
64
64
 
65
+ /**
66
+ * Core Promptbook server configuration.
67
+ *
68
+ * This server is also used for auto-federation in the Agents Server.
69
+ */
70
+ const CORE_SERVER = {
71
+ title: 'Promptbook Core',
72
+ description: `Core Promptbook server used for auto-federation`,
73
+ owner: 'AI Web, LLC <legal@ptbk.io> (https://www.ptbk.io/)',
74
+ urls: ['https://core.ptbk.io/'],
75
+ };
65
76
  /**
66
77
  * Available remote servers for the Promptbook
67
78
  *
@@ -83,6 +94,7 @@
83
94
  owner: 'AI Web, LLC <legal@ptbk.io> (https://www.ptbk.io/)',
84
95
  urls: ['https://s6.ptbk.io/'],
85
96
  },
97
+ CORE_SERVER,
86
98
  /*
87
99
  Note: Working on older version of Promptbook and not supported anymore
88
100
  {
@@ -95,7 +107,6 @@
95
107
  */
96
108
  ];
97
109
  /**
98
- * TODO: [🐱‍🚀] Auto-federated server from url in here
99
110
  * Note: [💞] Ignore a discrepancy between file name and entity name
100
111
  */
101
112
 
@@ -20690,12 +20701,15 @@
20690
20701
  fileStreams.push(file);
20691
20702
  }
20692
20703
  else {
20704
+ /*
20705
+ TODO: [🐱‍🚀] Resolve problem with browser environment
20693
20706
  // Assume it's a local file path
20694
20707
  // Note: This will work in Node.js environment
20695
20708
  // For browser environments, this would need different handling
20696
20709
  const fs = await import('fs');
20697
20710
  const fileStream = fs.createReadStream(source);
20698
20711
  fileStreams.push(fileStream);
20712
+ */
20699
20713
  }
20700
20714
  }
20701
20715
  catch (error) {
@@ -20784,12 +20798,15 @@
20784
20798
  fileStreams.push(file);
20785
20799
  }
20786
20800
  else {
20801
+ /*
20802
+ TODO: [🐱‍🚀] Resolve problem with browser environment
20787
20803
  // Assume it's a local file path
20788
20804
  // Note: This will work in Node.js environment
20789
20805
  // For browser environments, this would need different handling
20790
20806
  const fs = await import('fs');
20791
20807
  const fileStream = fs.createReadStream(source);
20792
20808
  fileStreams.push(fileStream);
20809
+ */
20793
20810
  }
20794
20811
  }
20795
20812
  catch (error) {
@@ -22404,9 +22421,13 @@
22404
22421
  *
22405
22422
  * @private - TODO: [🧠] Maybe should be public?
22406
22423
  */
22407
- function createCommitmentRegex(commitment) {
22408
- const escapedCommitment = commitment.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
22409
- const keywordPattern = escapedCommitment.split(/\s+/).join('\\s+');
22424
+ function createCommitmentRegex(commitment, aliases = []) {
22425
+ const allCommitments = [commitment, ...aliases];
22426
+ const patterns = allCommitments.map((c) => {
22427
+ const escapedCommitment = c.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
22428
+ return escapedCommitment.split(/\s+/).join('\\s+');
22429
+ });
22430
+ const keywordPattern = patterns.join('|');
22410
22431
  const regex = new RegExp(`^\\s*(?<type>${keywordPattern})\\b\\s+(?<contents>.+)$`, 'gim');
22411
22432
  return regex;
22412
22433
  }
@@ -22419,9 +22440,13 @@
22419
22440
  *
22420
22441
  * @private
22421
22442
  */
22422
- function createCommitmentTypeRegex(commitment) {
22423
- const escapedCommitment = commitment.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
22424
- const keywordPattern = escapedCommitment.split(/\s+/).join('\\s+');
22443
+ function createCommitmentTypeRegex(commitment, aliases = []) {
22444
+ const allCommitments = [commitment, ...aliases];
22445
+ const patterns = allCommitments.map((c) => {
22446
+ const escapedCommitment = c.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
22447
+ return escapedCommitment.split(/\s+/).join('\\s+');
22448
+ });
22449
+ const keywordPattern = patterns.join('|');
22425
22450
  const regex = new RegExp(`^\\s*(?<type>${keywordPattern})\\b`, 'gim');
22426
22451
  return regex;
22427
22452
  }
@@ -22433,22 +22458,23 @@
22433
22458
  * @private
22434
22459
  */
22435
22460
  class BaseCommitmentDefinition {
22436
- constructor(type) {
22461
+ constructor(type, aliases = []) {
22437
22462
  this.type = type;
22463
+ this.aliases = aliases;
22438
22464
  }
22439
22465
  /**
22440
22466
  * Creates a regex pattern to match this commitment in agent source
22441
22467
  * Uses the existing createCommitmentRegex function as internal helper
22442
22468
  */
22443
22469
  createRegex() {
22444
- return createCommitmentRegex(this.type);
22470
+ return createCommitmentRegex(this.type, this.aliases);
22445
22471
  }
22446
22472
  /**
22447
22473
  * Creates a regex pattern to match just the commitment type
22448
22474
  * Uses the existing createCommitmentTypeRegex function as internal helper
22449
22475
  */
22450
22476
  createTypeRegex() {
22451
- return createCommitmentTypeRegex(this.type);
22477
+ return createCommitmentTypeRegex(this.type, this.aliases);
22452
22478
  }
22453
22479
  /**
22454
22480
  * Helper method to create a new requirements object with updated system message
@@ -23059,6 +23085,77 @@
23059
23085
  * Note: [💞] Ignore a discrepancy between file name and entity name
23060
23086
  */
23061
23087
 
23088
+ /**
23089
+ * AGENT MESSAGE commitment definition
23090
+ *
23091
+ * The AGENT MESSAGE commitment defines a message from the agent in the conversation history.
23092
+ * It is used to pre-fill the chat with a conversation history or to provide few-shot examples.
23093
+ *
23094
+ * Example usage in agent source:
23095
+ *
23096
+ * ```book
23097
+ * AGENT MESSAGE What seems to be the issue?
23098
+ * ```
23099
+ *
23100
+ * @private [🪔] Maybe export the commitments through some package
23101
+ */
23102
+ class AgentMessageCommitmentDefinition extends BaseCommitmentDefinition {
23103
+ constructor() {
23104
+ super('AGENT MESSAGE');
23105
+ }
23106
+ /**
23107
+ * Short one-line description of AGENT MESSAGE.
23108
+ */
23109
+ get description() {
23110
+ return 'Defines a **message from the agent** in the conversation history.';
23111
+ }
23112
+ /**
23113
+ * Markdown documentation for AGENT MESSAGE commitment.
23114
+ */
23115
+ get documentation() {
23116
+ return spaceTrim.spaceTrim(`
23117
+ # ${this.type}
23118
+
23119
+ 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.
23120
+
23121
+ ## Key aspects
23122
+
23123
+ - Represents a message sent by the agent.
23124
+ - Used for setting up conversation context.
23125
+ - Can be used in conjunction with USER MESSAGE.
23126
+
23127
+ ## Examples
23128
+
23129
+ \`\`\`book
23130
+ Conversation History
23131
+
23132
+ USER MESSAGE Hello, I have a problem.
23133
+ AGENT MESSAGE What seems to be the issue?
23134
+ USER MESSAGE My computer is not starting.
23135
+ \`\`\`
23136
+ `);
23137
+ }
23138
+ applyToAgentModelRequirements(requirements, content) {
23139
+ // AGENT MESSAGE is for UI display purposes / conversation history construction
23140
+ // and typically doesn't need to be added to the system prompt or model requirements directly.
23141
+ // It is extracted separately for the chat interface.
23142
+ var _a;
23143
+ const pendingUserMessage = (_a = requirements.metadata) === null || _a === void 0 ? void 0 : _a.pendingUserMessage;
23144
+ if (pendingUserMessage) {
23145
+ const newSample = { question: pendingUserMessage, answer: content };
23146
+ const newSamples = [...(requirements.samples || []), newSample];
23147
+ const newMetadata = { ...requirements.metadata };
23148
+ delete newMetadata.pendingUserMessage;
23149
+ return {
23150
+ ...requirements,
23151
+ samples: newSamples,
23152
+ metadata: newMetadata,
23153
+ };
23154
+ }
23155
+ return requirements;
23156
+ }
23157
+ }
23158
+
23062
23159
  /**
23063
23160
  * INITIAL MESSAGE commitment definition
23064
23161
  *
@@ -23223,6 +23320,67 @@
23223
23320
  * Note: [💞] Ignore a discrepancy between file name and entity name
23224
23321
  */
23225
23322
 
23323
+ /**
23324
+ * USER MESSAGE commitment definition
23325
+ *
23326
+ * The USER MESSAGE commitment defines a message from the user in the conversation history.
23327
+ * It is used to pre-fill the chat with a conversation history or to provide few-shot examples.
23328
+ *
23329
+ * Example usage in agent source:
23330
+ *
23331
+ * ```book
23332
+ * USER MESSAGE Hello, I have a problem.
23333
+ * ```
23334
+ *
23335
+ * @private [🪔] Maybe export the commitments through some package
23336
+ */
23337
+ class UserMessageCommitmentDefinition extends BaseCommitmentDefinition {
23338
+ constructor() {
23339
+ super('USER MESSAGE');
23340
+ }
23341
+ /**
23342
+ * Short one-line description of USER MESSAGE.
23343
+ */
23344
+ get description() {
23345
+ return 'Defines a **message from the user** in the conversation history.';
23346
+ }
23347
+ /**
23348
+ * Markdown documentation for USER MESSAGE commitment.
23349
+ */
23350
+ get documentation() {
23351
+ return spaceTrim.spaceTrim(`
23352
+ # ${this.type}
23353
+
23354
+ 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.
23355
+
23356
+ ## Key aspects
23357
+
23358
+ - Represents a message sent by the user.
23359
+ - Used for setting up conversation context.
23360
+ - Can be used in conjunction with AGENT MESSAGE.
23361
+
23362
+ ## Examples
23363
+
23364
+ \`\`\`book
23365
+ Conversation History
23366
+
23367
+ USER MESSAGE Hello, I have a problem.
23368
+ AGENT MESSAGE What seems to be the issue?
23369
+ USER MESSAGE My computer is not starting.
23370
+ \`\`\`
23371
+ `);
23372
+ }
23373
+ applyToAgentModelRequirements(requirements, content) {
23374
+ return {
23375
+ ...requirements,
23376
+ metadata: {
23377
+ ...requirements.metadata,
23378
+ pendingUserMessage: content,
23379
+ },
23380
+ };
23381
+ }
23382
+ }
23383
+
23226
23384
  /**
23227
23385
  * META commitment definition
23228
23386
  *
@@ -23360,6 +23518,165 @@
23360
23518
  * Note: [💞] Ignore a discrepancy between file name and entity name
23361
23519
  */
23362
23520
 
23521
+ /**
23522
+ * META COLOR commitment definition
23523
+ *
23524
+ * The META COLOR commitment sets the agent's accent color.
23525
+ * This commitment is special because it doesn't affect the system message,
23526
+ * but is handled separately in the parsing logic.
23527
+ *
23528
+ * Example usage in agent source:
23529
+ *
23530
+ * ```book
23531
+ * META COLOR #ff0000
23532
+ * META COLOR #00ff00
23533
+ * ```
23534
+ *
23535
+ * @private [🪔] Maybe export the commitments through some package
23536
+ */
23537
+ class MetaColorCommitmentDefinition extends BaseCommitmentDefinition {
23538
+ constructor() {
23539
+ super('META COLOR', ['COLOR']);
23540
+ }
23541
+ /**
23542
+ * Short one-line description of META COLOR.
23543
+ */
23544
+ get description() {
23545
+ return "Set the agent's accent color.";
23546
+ }
23547
+ /**
23548
+ * Markdown documentation for META COLOR commitment.
23549
+ */
23550
+ get documentation() {
23551
+ return spaceTrim.spaceTrim(`
23552
+ # META COLOR
23553
+
23554
+ Sets the agent's accent color.
23555
+
23556
+ ## Key aspects
23557
+
23558
+ - Does not modify the agent's behavior or responses.
23559
+ - Only one \`META COLOR\` should be used per agent.
23560
+ - If multiple are specified, the last one takes precedence.
23561
+ - Used for visual representation in user interfaces.
23562
+
23563
+ ## Examples
23564
+
23565
+ \`\`\`book
23566
+ Professional Assistant
23567
+
23568
+ META COLOR #3498db
23569
+ PERSONA You are a professional business assistant
23570
+ \`\`\`
23571
+
23572
+ \`\`\`book
23573
+ Creative Helper
23574
+
23575
+ META COLOR #e74c3c
23576
+ PERSONA You are a creative and inspiring assistant
23577
+ \`\`\`
23578
+ `);
23579
+ }
23580
+ applyToAgentModelRequirements(requirements, content) {
23581
+ // META COLOR doesn't modify the system message or model requirements
23582
+ // It's handled separately in the parsing logic for profile color extraction
23583
+ // This method exists for consistency with the CommitmentDefinition interface
23584
+ return requirements;
23585
+ }
23586
+ /**
23587
+ * Extracts the profile color from the content
23588
+ * This is used by the parsing logic
23589
+ */
23590
+ extractProfileColor(content) {
23591
+ const trimmedContent = content.trim();
23592
+ return trimmedContent || null;
23593
+ }
23594
+ }
23595
+ /**
23596
+ * Note: [💞] Ignore a discrepancy between file name and entity name
23597
+ */
23598
+
23599
+ /**
23600
+ * META IMAGE commitment definition
23601
+ *
23602
+ * The META IMAGE commitment sets the agent's avatar/profile image URL.
23603
+ * This commitment is special because it doesn't affect the system message,
23604
+ * but is handled separately in the parsing logic.
23605
+ *
23606
+ * Example usage in agent source:
23607
+ *
23608
+ * ```book
23609
+ * META IMAGE https://example.com/avatar.jpg
23610
+ * META IMAGE /assets/agent-avatar.png
23611
+ * ```
23612
+ *
23613
+ * @private [🪔] Maybe export the commitments through some package
23614
+ */
23615
+ class MetaImageCommitmentDefinition extends BaseCommitmentDefinition {
23616
+ constructor() {
23617
+ super('META IMAGE', ['IMAGE']);
23618
+ }
23619
+ /**
23620
+ * Short one-line description of META IMAGE.
23621
+ */
23622
+ get description() {
23623
+ return "Set the agent's profile image URL.";
23624
+ }
23625
+ /**
23626
+ * Markdown documentation for META IMAGE commitment.
23627
+ */
23628
+ get documentation() {
23629
+ return spaceTrim.spaceTrim(`
23630
+ # META IMAGE
23631
+
23632
+ Sets the agent's avatar/profile image URL.
23633
+
23634
+ ## Key aspects
23635
+
23636
+ - Does not modify the agent's behavior or responses.
23637
+ - Only one \`META IMAGE\` should be used per agent.
23638
+ - If multiple are specified, the last one takes precedence.
23639
+ - Used for visual representation in user interfaces.
23640
+
23641
+ ## Examples
23642
+
23643
+ \`\`\`book
23644
+ Professional Assistant
23645
+
23646
+ META IMAGE https://example.com/professional-avatar.jpg
23647
+ PERSONA You are a professional business assistant
23648
+ STYLE Maintain a formal and courteous tone
23649
+ \`\`\`
23650
+
23651
+ \`\`\`book
23652
+ Creative Helper
23653
+
23654
+ META IMAGE /assets/creative-bot-avatar.png
23655
+ PERSONA You are a creative and inspiring assistant
23656
+ STYLE Be enthusiastic and encouraging
23657
+ ACTION Can help with brainstorming and ideation
23658
+ \`\`\`
23659
+ `);
23660
+ }
23661
+ applyToAgentModelRequirements(requirements, content) {
23662
+ // META IMAGE doesn't modify the system message or model requirements
23663
+ // It's handled separately in the parsing logic for profile image extraction
23664
+ // This method exists for consistency with the CommitmentDefinition interface
23665
+ return requirements;
23666
+ }
23667
+ /**
23668
+ * Extracts the profile image URL from the content
23669
+ * This is used by the parsing logic
23670
+ */
23671
+ extractProfileImageUrl(content) {
23672
+ const trimmedContent = content.trim();
23673
+ return trimmedContent || null;
23674
+ }
23675
+ }
23676
+ /**
23677
+ * Note: [💞] Ignore a discrepancy between file name and entity name
23678
+ */
23679
+
23363
23680
  /**
23364
23681
  * MODEL commitment definition
23365
23682
  *
@@ -24267,6 +24584,8 @@
24267
24584
  new ModelCommitmentDefinition('MODELS'),
24268
24585
  new ActionCommitmentDefinition('ACTION'),
24269
24586
  new ActionCommitmentDefinition('ACTIONS'),
24587
+ new MetaImageCommitmentDefinition(),
24588
+ new MetaColorCommitmentDefinition(),
24270
24589
  new MetaCommitmentDefinition(),
24271
24590
  new NoteCommitmentDefinition('NOTE'),
24272
24591
  new NoteCommitmentDefinition('NOTES'),
@@ -24275,6 +24594,8 @@
24275
24594
  new GoalCommitmentDefinition('GOAL'),
24276
24595
  new GoalCommitmentDefinition('GOALS'),
24277
24596
  new InitialMessageCommitmentDefinition(),
24597
+ new UserMessageCommitmentDefinition(),
24598
+ new AgentMessageCommitmentDefinition(),
24278
24599
  new MessageCommitmentDefinition('MESSAGE'),
24279
24600
  new MessageCommitmentDefinition('MESSAGES'),
24280
24601
  new ScenarioCommitmentDefinition('SCENARIO'),
@@ -24719,6 +25040,14 @@
24719
25040
  links.push(spaceTrim__default["default"](commitment.content));
24720
25041
  continue;
24721
25042
  }
25043
+ if (commitment.type === 'META IMAGE') {
25044
+ meta.image = spaceTrim__default["default"](commitment.content);
25045
+ continue;
25046
+ }
25047
+ if (commitment.type === 'META COLOR') {
25048
+ meta.color = spaceTrim__default["default"](commitment.content);
25049
+ continue;
25050
+ }
24722
25051
  if (commitment.type !== 'META') {
24723
25052
  continue;
24724
25053
  }
@@ -24734,6 +25063,10 @@
24734
25063
  if (!meta.image) {
24735
25064
  meta.image = generatePlaceholderAgentProfileImageUrl(parseResult.agentName || '!!');
24736
25065
  }
25066
+ // Generate fullname fallback if no meta fullname specified
25067
+ if (!meta.fullname) {
25068
+ meta.fullname = parseResult.agentName || createDefaultAgentName(agentSource);
25069
+ }
24737
25070
  // Parse parameters using unified approach - both @Parameter and {parameter} notations
24738
25071
  // are treated as the same syntax feature with unified representation
24739
25072
  const parameters = parseParameters(agentSource);