@promptbook/wizard 0.112.0-43 → 0.112.0-45

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 (35) hide show
  1. package/esm/index.es.js +144 -57
  2. package/esm/index.es.js.map +1 -1
  3. package/esm/src/avatars/Avatar.d.ts +7 -0
  4. package/esm/src/avatars/avatarRenderingUtils.d.ts +117 -0
  5. package/esm/src/avatars/index.d.ts +6 -0
  6. package/esm/src/avatars/renderAvatarVisual.d.ts +9 -0
  7. package/esm/src/avatars/types/AvatarDefinition.d.ts +20 -0
  8. package/esm/src/avatars/types/AvatarVisualDefinition.d.ts +96 -0
  9. package/esm/src/avatars/visuals/avatarVisualRegistry.d.ts +16 -0
  10. package/esm/src/avatars/visuals/minecraftAvatarVisual.d.ts +7 -0
  11. package/esm/src/avatars/visuals/octopusAvatarVisual.d.ts +7 -0
  12. package/esm/src/avatars/visuals/pixelArtAvatarVisual.d.ts +7 -0
  13. package/esm/src/book-2.0/agent-source/AgentBasicInformation.d.ts +2 -1
  14. package/esm/src/book-2.0/agent-source/TeammateProfileResolver.d.ts +2 -1
  15. package/esm/src/commitments/PERSONA/PERSONA.d.ts +7 -0
  16. package/esm/src/commitments/STYLE/STYLE.d.ts +9 -2
  17. package/esm/src/version.d.ts +1 -1
  18. package/package.json +2 -2
  19. package/umd/index.umd.js +144 -57
  20. package/umd/index.umd.js.map +1 -1
  21. package/umd/src/avatars/Avatar.d.ts +7 -0
  22. package/umd/src/avatars/avatarRenderingUtils.d.ts +117 -0
  23. package/umd/src/avatars/index.d.ts +6 -0
  24. package/umd/src/avatars/renderAvatarVisual.d.ts +9 -0
  25. package/umd/src/avatars/types/AvatarDefinition.d.ts +20 -0
  26. package/umd/src/avatars/types/AvatarVisualDefinition.d.ts +96 -0
  27. package/umd/src/avatars/visuals/avatarVisualRegistry.d.ts +16 -0
  28. package/umd/src/avatars/visuals/minecraftAvatarVisual.d.ts +7 -0
  29. package/umd/src/avatars/visuals/octopusAvatarVisual.d.ts +7 -0
  30. package/umd/src/avatars/visuals/pixelArtAvatarVisual.d.ts +7 -0
  31. package/umd/src/book-2.0/agent-source/AgentBasicInformation.d.ts +2 -1
  32. package/umd/src/book-2.0/agent-source/TeammateProfileResolver.d.ts +2 -1
  33. package/umd/src/commitments/PERSONA/PERSONA.d.ts +7 -0
  34. package/umd/src/commitments/STYLE/STYLE.d.ts +9 -2
  35. package/umd/src/version.d.ts +1 -1
package/esm/index.es.js CHANGED
@@ -38,7 +38,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
38
38
  * @generated
39
39
  * @see https://github.com/webgptorg/promptbook
40
40
  */
41
- const PROMPTBOOK_ENGINE_VERSION = '0.112.0-43';
41
+ const PROMPTBOOK_ENGINE_VERSION = '0.112.0-45';
42
42
  /**
43
43
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
44
44
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -19259,7 +19259,7 @@ class DeleteCommitmentDefinition extends BaseCommitmentDefinition {
19259
19259
  DELETE Casual conversational style
19260
19260
  REMOVE All emoji usage
19261
19261
  GOAL Provide professional business communications
19262
- STYLE Use formal language and proper business etiquette
19262
+ WRITING RULES Use formal language and proper business etiquette
19263
19263
  \`\`\`
19264
19264
 
19265
19265
  \`\`\`book
@@ -19270,7 +19270,7 @@ class DeleteCommitmentDefinition extends BaseCommitmentDefinition {
19270
19270
  DISCARD Technical jargon explanations
19271
19271
  CANCEL Advanced troubleshooting procedures
19272
19272
  GOAL Help users with simple, easy-to-follow solutions
19273
- STYLE Use plain language that anyone can understand
19273
+ WRITING RULES Use plain language that anyone can understand
19274
19274
  \`\`\`
19275
19275
 
19276
19276
  \`\`\`book
@@ -19287,11 +19287,11 @@ class DeleteCommitmentDefinition extends BaseCommitmentDefinition {
19287
19287
  Concise Information Provider
19288
19288
 
19289
19289
  PERSONA You are a helpful assistant who provides detailed explanations
19290
- STYLE Include examples, analogies, and comprehensive context
19290
+ WRITING RULES Include examples, analogies, and comprehensive context
19291
19291
  CANCEL Detailed explanation style
19292
19292
  DISCARD Examples and analogies
19293
19293
  GOAL Provide brief, direct answers without unnecessary elaboration
19294
- STYLE Be concise and to the point
19294
+ WRITING RULES Be concise and to the point
19295
19295
  \`\`\`
19296
19296
  `);
19297
19297
  }
@@ -19475,7 +19475,7 @@ class FormatCommitmentDefinition extends BaseCommitmentDefinition {
19475
19475
  PERSONA You are a data analysis expert
19476
19476
  FORMAT Present results in structured tables
19477
19477
  FORMAT Include confidence scores for all predictions
19478
- STYLE Be concise and precise in explanations
19478
+ WRITING RULES Be concise and precise in explanations
19479
19479
  \`\`\`
19480
19480
  `);
19481
19481
  }
@@ -19824,7 +19824,7 @@ class GoalCommitmentDefinition extends BaseCommitmentDefinition {
19824
19824
  * Short one-line description of GOAL.
19825
19825
  */
19826
19826
  get description() {
19827
- return 'Define main **goals** the AI assistant should achieve, with later goals having higher priority.';
19827
+ return 'Define the effective agent **goal**; when multiple goals exist, only the last one stays effective.';
19828
19828
  }
19829
19829
  /**
19830
19830
  * Icon for this commitment.
@@ -19839,12 +19839,14 @@ class GoalCommitmentDefinition extends BaseCommitmentDefinition {
19839
19839
  return spaceTrim$1(`
19840
19840
  # ${this.type}
19841
19841
 
19842
- Defines the main goal which should be achieved by the AI assistant. There can be multiple goals, and later goals are more important than earlier goals.
19842
+ Defines the main goal which should be achieved by the AI assistant.
19843
+ There can be multiple goals in source, but after inheritance/source rewriting only the last \`GOAL\` /\`GOALS\` remains effective.
19843
19844
 
19844
19845
  ## Key aspects
19845
19846
 
19846
19847
  - Both terms work identically and can be used interchangeably.
19847
- - Later goals have higher priority and can override earlier goals.
19848
+ - Later goals overwrite earlier goals.
19849
+ - The public agent profile text is derived from the last goal.
19848
19850
  - Goals provide clear direction and purpose for the agent's responses.
19849
19851
  - Goals influence decision-making and response prioritization.
19850
19852
 
@@ -19857,9 +19859,7 @@ class GoalCommitmentDefinition extends BaseCommitmentDefinition {
19857
19859
  \`\`\`book
19858
19860
  Customer Support Agent
19859
19861
 
19860
- PERSONA You are a helpful customer support representative
19861
19862
  GOAL Resolve customer issues quickly and efficiently
19862
- GOAL Maintain high customer satisfaction scores
19863
19863
  GOAL Always follow company policies and procedures
19864
19864
  RULE Be polite and professional at all times
19865
19865
  \`\`\`
@@ -19867,19 +19867,15 @@ class GoalCommitmentDefinition extends BaseCommitmentDefinition {
19867
19867
  \`\`\`book
19868
19868
  Educational Assistant
19869
19869
 
19870
- PERSONA You are an educational assistant specializing in mathematics
19871
19870
  GOAL Help students understand mathematical concepts clearly
19872
- GOAL Encourage critical thinking and problem-solving skills
19873
19871
  GOAL Ensure all explanations are age-appropriate and accessible
19874
- STYLE Use simple language and provide step-by-step explanations
19872
+ WRITING RULES Use simple language and provide step-by-step explanations
19875
19873
  \`\`\`
19876
19874
 
19877
19875
  \`\`\`book
19878
19876
  Safety-First Assistant
19879
19877
 
19880
- PERSONA You are a general-purpose AI assistant
19881
19878
  GOAL Be helpful and informative in all interactions
19882
- GOAL Provide accurate and reliable information
19883
19879
  GOAL Always prioritize user safety and ethical guidelines
19884
19880
  RULE Never provide harmful or dangerous advice
19885
19881
  \`\`\`
@@ -20151,7 +20147,7 @@ class KnowledgeCommitmentDefinition extends BaseCommitmentDefinition {
20151
20147
  KNOWLEDGE Academic research requires careful citation and verification
20152
20148
  KNOWLEDGE https://example.com/research-guidelines.pdf
20153
20149
  ACTION Can help with literature reviews and data analysis
20154
- STYLE Present information in clear, academic format
20150
+ WRITING RULES Present information in clear, academic format
20155
20151
  \`\`\`
20156
20152
  `);
20157
20153
  }
@@ -21798,7 +21794,7 @@ class MetaImageCommitmentDefinition extends BaseCommitmentDefinition {
21798
21794
 
21799
21795
  META IMAGE https://example.com/professional-avatar.jpg
21800
21796
  PERSONA You are a professional business assistant
21801
- STYLE Maintain a formal and courteous tone
21797
+ WRITING RULES Maintain a formal and courteous tone
21802
21798
  \`\`\`
21803
21799
 
21804
21800
  \`\`\`book
@@ -21806,7 +21802,7 @@ class MetaImageCommitmentDefinition extends BaseCommitmentDefinition {
21806
21802
 
21807
21803
  META IMAGE /assets/creative-bot-avatar.png
21808
21804
  PERSONA You are a creative and inspiring assistant
21809
- STYLE Be enthusiastic and encouraging
21805
+ WRITING RULES Be enthusiastic and encouraging
21810
21806
  ACTION Can help with brainstorming and ideation
21811
21807
  \`\`\`
21812
21808
  `);
@@ -21965,7 +21961,7 @@ class MetaLinkCommitmentDefinition extends BaseCommitmentDefinition {
21965
21961
  META LINK https://twitter.com/devhandle
21966
21962
  PERSONA You are an experienced open source developer
21967
21963
  ACTION Can help with code reviews and architecture decisions
21968
- STYLE Be direct and technical in explanations
21964
+ WRITING RULES Be direct and technical in explanations
21969
21965
  \`\`\`
21970
21966
  `);
21971
21967
  }
@@ -22171,7 +22167,7 @@ class ModelCommitmentDefinition extends BaseCommitmentDefinition {
22171
22167
  MODEL TEMPERATURE 0.8
22172
22168
  MODEL TOP_P 0.9
22173
22169
  MODEL MAX_TOKENS 2048
22174
- STYLE Be imaginative and expressive
22170
+ WRITING RULES Be imaginative and expressive
22175
22171
  ACTION Can help with storytelling and character development
22176
22172
  \`\`\`
22177
22173
 
@@ -22383,7 +22379,7 @@ class NoteCommitmentDefinition extends BaseCommitmentDefinition {
22383
22379
  NOTE Uses RAG for accessing latest research papers
22384
22380
  PERSONA You are a knowledgeable research assistant
22385
22381
  ACTION Can help with literature reviews and citations
22386
- STYLE Present information in academic format
22382
+ WRITING RULES Present information in academic format
22387
22383
  \`\`\`
22388
22384
  `);
22389
22385
  }
@@ -22498,7 +22494,16 @@ class PersonaCommitmentDefinition extends BaseCommitmentDefinition {
22498
22494
  * Short one-line description of PERSONA.
22499
22495
  */
22500
22496
  get description() {
22501
- return 'Define who the agent is: background, expertise, and personality.';
22497
+ return 'Deprecated legacy profile commitment. Prefer `GOAL` for agent profile text and inheritance-safe rewrites.';
22498
+ }
22499
+ /**
22500
+ * Optional UI/docs-only deprecation metadata.
22501
+ */
22502
+ get deprecation() {
22503
+ return {
22504
+ message: 'Use `GOAL` for agent profile text and inheritance-safe rewrites.',
22505
+ replacedBy: ['GOAL'],
22506
+ };
22502
22507
  }
22503
22508
  /**
22504
22509
  * Icon for this commitment.
@@ -22513,16 +22518,24 @@ class PersonaCommitmentDefinition extends BaseCommitmentDefinition {
22513
22518
  return spaceTrim$1(`
22514
22519
  # ${this.type}
22515
22520
 
22516
- Defines who the agent is, their background, expertise, and personality traits.
22521
+ Deprecated legacy commitment that defines who the agent is, their background, expertise, and personality traits.
22517
22522
 
22518
- ## Key aspects
22523
+ ## Migration
22519
22524
 
22520
- - Multiple \`PERSONA\` and \`PERSONAE\` commitments are merged together.
22521
- - Both terms work identically and can be used interchangeably.
22522
- - If they are in conflict, the last one takes precedence.
22523
- - You can write persona content in multiple lines.
22525
+ - Existing \`${this.type}\` books still parse and compile.
22526
+ - New books should prefer \`GOAL\`.
22527
+ - Agent profile rendering now prefers the last \`GOAL\` and only falls back to \`${this.type}\` when no goal exists.
22528
+ - Runtime compilation keeps the legacy multi-\`PERSONA\` merge behavior for backward compatibility.
22524
22529
 
22525
- ## Examples
22530
+ ## Preferred replacement
22531
+
22532
+ \`\`\`book
22533
+ Programming Assistant
22534
+
22535
+ GOAL Help the user solve programming problems with practical TypeScript and React guidance.
22536
+ \`\`\`
22537
+
22538
+ ## Legacy compatibility example
22526
22539
 
22527
22540
  \`\`\`book
22528
22541
  Programming Assistant
@@ -22660,7 +22673,7 @@ class RuleCommitmentDefinition extends BaseCommitmentDefinition {
22660
22673
  RULE Always ask for clarification if the user's request is ambiguous
22661
22674
  RULE Be polite and professional in all interactions
22662
22675
  RULES Never provide medical or legal advice
22663
- STYLE Maintain a friendly and helpful tone
22676
+ WRITING RULES Maintain a friendly and helpful tone
22664
22677
  \`\`\`
22665
22678
 
22666
22679
  \`\`\`book
@@ -22929,8 +22942,8 @@ class ScenarioCommitmentDefinition extends BaseCommitmentDefinition {
22929
22942
  /**
22930
22943
  * STYLE commitment definition
22931
22944
  *
22932
- * The STYLE commitment defines how the agent should format and present its responses.
22933
- * This includes tone, writing style, formatting preferences, and communication patterns.
22945
+ * Deprecated legacy writing-style commitment kept for backward compatibility.
22946
+ * New books should prefer `WRITING RULES` for writing-only constraints.
22934
22947
  *
22935
22948
  * Example usage in agent source:
22936
22949
  *
@@ -22949,7 +22962,16 @@ class StyleCommitmentDefinition extends BaseCommitmentDefinition {
22949
22962
  * Short one-line description of STYLE.
22950
22963
  */
22951
22964
  get description() {
22952
- return 'Control the tone and writing style of responses.';
22965
+ return 'Deprecated legacy writing-style commitment. Prefer `WRITING RULES` for new books.';
22966
+ }
22967
+ /**
22968
+ * Optional UI/docs-only deprecation metadata.
22969
+ */
22970
+ get deprecation() {
22971
+ return {
22972
+ message: 'Use `WRITING RULES` for writing-only constraints such as tone, length, formatting, or emoji usage.',
22973
+ replacedBy: ['WRITING RULES'],
22974
+ };
22953
22975
  }
22954
22976
  /**
22955
22977
  * Icon for this commitment.
@@ -22964,15 +22986,34 @@ class StyleCommitmentDefinition extends BaseCommitmentDefinition {
22964
22986
  return spaceTrim$1(`
22965
22987
  # ${this.type}
22966
22988
 
22967
- Defines how the agent should format and present its responses (tone, writing style, formatting).
22989
+ Deprecated legacy commitment for writing and presentation instructions.
22990
+
22991
+ ## Migration
22992
+
22993
+ - Existing \`${this.type}\` books still parse and compile.
22994
+ - New books should prefer \`WRITING RULES\`.
22995
+ - Use \`WRITING SAMPLE\` when you want to anchor voice by example instead of stating constraints directly.
22996
+ - The plural alias \`STYLES\` is the same legacy commitment family.
22968
22997
 
22969
22998
  ## Key aspects
22970
22999
 
22971
- - Both terms work identically and can be used interchangeably.
23000
+ - \`${this.type}\` remains functional for backward compatibility only.
22972
23001
  - Later style instructions can override earlier ones.
22973
23002
  - Style affects both tone and presentation format.
22974
23003
 
22975
- ## Examples
23004
+ ## Preferred replacement
23005
+
23006
+ \`\`\`book
23007
+ Technical Writer
23008
+
23009
+ GOAL Help the user understand technical topics with practical, accurate guidance.
23010
+ WRITING RULES Write in a professional but friendly tone.
23011
+ WRITING RULES Use bullet points for lists.
23012
+ WRITING RULES Always provide code examples when explaining programming concepts.
23013
+ FORMAT Use markdown formatting with clear headings
23014
+ \`\`\`
23015
+
23016
+ ## Legacy compatibility examples
22976
23017
 
22977
23018
  \`\`\`book
22978
23019
  Technical Writer
@@ -23287,7 +23328,7 @@ class TeamCommitmentDefinition extends BaseCommitmentDefinition {
23287
23328
  \`\`\`book
23288
23329
  Legal Assistant
23289
23330
 
23290
- PERSONA An expert software developer
23331
+ GOAL Get expert software-development advice from the teammate when legal discussion needs technical context.
23291
23332
  TEAM You can talk with http://localhost:4440/agents/GMw67JN8TXxN7y to discuss the legal aspects.
23292
23333
  \`\`\`
23293
23334
  `);
@@ -23713,7 +23754,7 @@ class TemplateCommitmentDefinition extends BaseCommitmentDefinition {
23713
23754
 
23714
23755
  PERSONA You are a helpful customer support representative
23715
23756
  TEMPLATE Always structure your response with: 1) Acknowledgment, 2) Solution, 3) Follow-up question
23716
- STYLE Be professional and empathetic
23757
+ WRITING RULES Be professional and empathetic
23717
23758
  \`\`\`
23718
23759
 
23719
23760
  \`\`\`book
@@ -24157,7 +24198,7 @@ class UseBrowserCommitmentDefinition extends BaseCommitmentDefinition {
24157
24198
 
24158
24199
  PERSONA You are a news analyst who stays up-to-date with current events
24159
24200
  USE BROWSER
24160
- STYLE Present news in a balanced and objective manner
24201
+ WRITING RULES Present news in a balanced and objective manner
24161
24202
  ACTION Can search for and summarize news articles
24162
24203
  \`\`\`
24163
24204
 
@@ -30111,6 +30152,15 @@ const COMMITMENTS_WITH_AGENT_REFERENCES = new Set(['FROM', 'IMPORT', 'IMPORTS',
30111
30152
  * @private internal constant of `createAgentModelRequirementsWithCommitments`
30112
30153
  */
30113
30154
  const DELETE_COMMITMENT_TYPES = new Set(['DELETE', 'CANCEL', 'DISCARD', 'REMOVE']);
30155
+ /**
30156
+ * Commitments whose earlier occurrences are overwritten by the last occurrence in source order.
30157
+ *
30158
+ * @private internal constant of `createAgentModelRequirementsWithCommitments`
30159
+ */
30160
+ const OVERWRITTEN_COMMITMENT_GROUP_BY_TYPE = new Map([
30161
+ ['GOAL', 'GOAL'],
30162
+ ['GOALS', 'GOAL'],
30163
+ ]);
30114
30164
  /**
30115
30165
  * Regex pattern matching markdown horizontal lines that should not be copied into the final system message.
30116
30166
  *
@@ -30161,7 +30211,7 @@ function getSafeReferenceCommitmentFallback(commitmentType, originalContent) {
30161
30211
  */
30162
30212
  async function createAgentModelRequirementsWithCommitments(agentSource, modelName, options) {
30163
30213
  const parseResult = parseAgentSourceWithCommitments(agentSource);
30164
- const filteredCommitments = filterDeletedCommitments(parseResult.commitments);
30214
+ const filteredCommitments = filterOverwrittenCommitments(filterDeletedCommitments(parseResult.commitments));
30165
30215
  let requirements = createInitialAgentModelRequirements(parseResult.agentName, modelName);
30166
30216
  requirements = await applyCommitmentsToRequirements(requirements, filteredCommitments, options);
30167
30217
  requirements = aggregateUseCommitmentSystemMessages(requirements, filteredCommitments);
@@ -30172,6 +30222,35 @@ async function createAgentModelRequirementsWithCommitments(agentSource, modelNam
30172
30222
  requirements = await applyPendingInlineKnowledgeSources(requirements, options === null || options === void 0 ? void 0 : options.inlineKnowledgeSourceUploader);
30173
30223
  return finalizeRequirements(requirements);
30174
30224
  }
30225
+ /**
30226
+ * Removes earlier commitments that are overwritten by later commitments of the same semantic group.
30227
+ *
30228
+ * This currently keeps only the last `GOAL` / `GOALS` commitment so inheritance rewrites
30229
+ * and multi-goal sources expose one effective goal to the runtime.
30230
+ *
30231
+ * @param commitments - Parsed commitments after DELETE-like filtering.
30232
+ * @returns Commitments with overwritten entries removed while preserving source order.
30233
+ *
30234
+ * @private internal utility of `createAgentModelRequirementsWithCommitments`
30235
+ */
30236
+ function filterOverwrittenCommitments(commitments) {
30237
+ const seenOverwriteGroups = new Set();
30238
+ const keptCommitments = [];
30239
+ for (let index = commitments.length - 1; index >= 0; index--) {
30240
+ const commitment = commitments[index];
30241
+ const overwriteGroup = OVERWRITTEN_COMMITMENT_GROUP_BY_TYPE.get(commitment.type);
30242
+ if (!overwriteGroup) {
30243
+ keptCommitments.push(commitment);
30244
+ continue;
30245
+ }
30246
+ if (seenOverwriteGroups.has(overwriteGroup)) {
30247
+ continue;
30248
+ }
30249
+ seenOverwriteGroups.add(overwriteGroup);
30250
+ keptCommitments.push(commitment);
30251
+ }
30252
+ return keptCommitments.reverse();
30253
+ }
30175
30254
  /**
30176
30255
  * Creates the initial requirements object with the parsed agent name stored in metadata and an optional model override.
30177
30256
  *
@@ -30814,7 +30893,7 @@ function createDefaultAgentName(agentSource) {
30814
30893
  function parseAgentSource(agentSource) {
30815
30894
  const parseResult = parseAgentSourceWithCommitments(agentSource);
30816
30895
  const resolvedAgentName = parseResult.agentName || createDefaultAgentName(agentSource);
30817
- const personaDescription = extractPersonaDescription(parseResult.commitments);
30896
+ const personaDescription = extractAgentProfileText(parseResult.commitments);
30818
30897
  const initialMessage = extractInitialMessage(parseResult.commitments);
30819
30898
  const parsedProfile = extractParsedAgentProfile(parseResult.commitments);
30820
30899
  ensureMetaFullname(parsedProfile.meta, resolvedAgentName);
@@ -30918,25 +30997,33 @@ const META_COMMITMENT_APPLIERS = {
30918
30997
  */
30919
30998
  const LOCAL_AGENT_REFERENCE_PREFIXES = ['./', '../', '/'];
30920
30999
  /**
30921
- * Builds the combined persona description from PERSONA commitments.
31000
+ * Resolves the public agent profile text from the last GOAL/GOALS commitment,
31001
+ * falling back to the deprecated PERSONA/PERSONAE commitments when no goal exists.
30922
31002
  *
30923
31003
  * @private internal utility of `parseAgentSource`
30924
31004
  */
30925
- function extractPersonaDescription(commitments) {
30926
- let personaDescription = null;
31005
+ function extractAgentProfileText(commitments) {
31006
+ let goalDescription = '';
31007
+ let hasGoalDescription = false;
31008
+ let personaDescription = '';
31009
+ let hasPersonaDescription = false;
30927
31010
  for (const commitment of commitments) {
30928
- if (commitment.type !== 'PERSONA') {
30929
- continue;
30930
- }
30931
- if (personaDescription === null) {
30932
- personaDescription = '';
31011
+ if (commitment.type === 'GOAL' || commitment.type === 'GOALS') {
31012
+ goalDescription = commitment.content;
31013
+ hasGoalDescription = true;
30933
31014
  }
30934
- else {
30935
- personaDescription += `\n\n${personaDescription}`;
31015
+ if (commitment.type === 'PERSONA' || commitment.type === 'PERSONAE') {
31016
+ personaDescription = commitment.content;
31017
+ hasPersonaDescription = true;
30936
31018
  }
30937
- personaDescription += commitment.content;
30938
31019
  }
30939
- return personaDescription;
31020
+ if (hasGoalDescription) {
31021
+ return goalDescription;
31022
+ }
31023
+ if (hasPersonaDescription) {
31024
+ return personaDescription;
31025
+ }
31026
+ return null;
30940
31027
  }
30941
31028
  /**
30942
31029
  * Resolves the last INITIAL MESSAGE commitment, which is the public initial-message value.
@@ -31423,7 +31510,7 @@ async function createAgentModelRequirements(agentSource, modelName, availableMod
31423
31510
  * Selects the best model using the preparePersona function
31424
31511
  * This directly uses preparePersona to ensure DRY principle
31425
31512
  *
31426
- * @param agentSource The agent source to derive persona description from
31513
+ * @param agentSource The agent source to derive effective profile text from
31427
31514
  * @param llmTools LLM tools for preparing persona
31428
31515
  * @returns The name of the best selected model
31429
31516
  *
@@ -31431,9 +31518,9 @@ async function createAgentModelRequirements(agentSource, modelName, availableMod
31431
31518
  */
31432
31519
  async function selectBestModelUsingPersona(agentSource, llmTools) {
31433
31520
  var _a;
31434
- // Parse agent source to get persona description
31521
+ // Parse agent source to get the effective profile description
31435
31522
  const { agentName, personaDescription } = parseAgentSource(agentSource);
31436
- // Use agent name as fallback if no persona description is available
31523
+ // Use agent name as fallback if no profile description is available
31437
31524
  const description = personaDescription || agentName || 'AI Agent';
31438
31525
  try {
31439
31526
  // Use preparePersona directly