@promptbook/browser 0.103.0-52 → 0.103.0-54

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 (46) hide show
  1. package/esm/index.es.js +261 -1
  2. package/esm/index.es.js.map +1 -1
  3. package/esm/typings/servers.d.ts +8 -1
  4. package/esm/typings/src/_packages/components.index.d.ts +2 -0
  5. package/esm/typings/src/_packages/core.index.d.ts +6 -0
  6. package/esm/typings/src/_packages/types.index.d.ts +2 -0
  7. package/esm/typings/src/_packages/utils.index.d.ts +2 -0
  8. package/esm/typings/src/book-2.0/agent-source/AgentModelRequirements.d.ts +7 -0
  9. package/esm/typings/src/book-components/Chat/Chat/ChatProps.d.ts +4 -0
  10. package/esm/typings/src/book-components/_common/HamburgerMenu/HamburgerMenu.d.ts +12 -0
  11. package/esm/typings/src/book-components/icons/MicIcon.d.ts +8 -0
  12. package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +17 -0
  13. package/esm/typings/src/commitments/ACTION/ACTION.d.ts +4 -0
  14. package/esm/typings/src/commitments/DELETE/DELETE.d.ts +4 -0
  15. package/esm/typings/src/commitments/FORMAT/FORMAT.d.ts +4 -0
  16. package/esm/typings/src/commitments/GOAL/GOAL.d.ts +4 -0
  17. package/esm/typings/src/commitments/KNOWLEDGE/KNOWLEDGE.d.ts +4 -0
  18. package/esm/typings/src/commitments/MEMORY/MEMORY.d.ts +4 -0
  19. package/esm/typings/src/commitments/MESSAGE/AgentMessageCommitmentDefinition.d.ts +32 -0
  20. package/esm/typings/src/commitments/MESSAGE/InitialMessageCommitmentDefinition.d.ts +4 -0
  21. package/esm/typings/src/commitments/MESSAGE/MESSAGE.d.ts +4 -0
  22. package/esm/typings/src/commitments/MESSAGE/UserMessageCommitmentDefinition.d.ts +32 -0
  23. package/esm/typings/src/commitments/META/META.d.ts +4 -0
  24. package/esm/typings/src/commitments/META_COLOR/META_COLOR.d.ts +4 -0
  25. package/esm/typings/src/commitments/META_IMAGE/META_IMAGE.d.ts +4 -0
  26. package/esm/typings/src/commitments/META_LINK/META_LINK.d.ts +4 -0
  27. package/esm/typings/src/commitments/MODEL/MODEL.d.ts +4 -0
  28. package/esm/typings/src/commitments/NOTE/NOTE.d.ts +4 -0
  29. package/esm/typings/src/commitments/PERSONA/PERSONA.d.ts +4 -0
  30. package/esm/typings/src/commitments/RULE/RULE.d.ts +4 -0
  31. package/esm/typings/src/commitments/SAMPLE/SAMPLE.d.ts +4 -0
  32. package/esm/typings/src/commitments/SCENARIO/SCENARIO.d.ts +4 -0
  33. package/esm/typings/src/commitments/STYLE/STYLE.d.ts +4 -0
  34. package/esm/typings/src/commitments/_base/BaseCommitmentDefinition.d.ts +5 -0
  35. package/esm/typings/src/commitments/_base/CommitmentDefinition.d.ts +5 -0
  36. package/esm/typings/src/commitments/_base/NotYetImplementedCommitmentDefinition.d.ts +4 -0
  37. package/esm/typings/src/commitments/index.d.ts +20 -1
  38. package/esm/typings/src/execution/LlmExecutionTools.d.ts +9 -0
  39. package/esm/typings/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +2 -1
  40. package/esm/typings/src/llm-providers/agent/RemoteAgent.d.ts +10 -1
  41. package/esm/typings/src/utils/normalization/normalizeMessageText.d.ts +9 -0
  42. package/esm/typings/src/utils/normalization/normalizeMessageText.test.d.ts +1 -0
  43. package/esm/typings/src/version.d.ts +1 -1
  44. package/package.json +2 -2
  45. package/umd/index.umd.js +261 -1
  46. package/umd/index.umd.js.map +1 -1
package/umd/index.umd.js CHANGED
@@ -23,7 +23,7 @@
23
23
  * @generated
24
24
  * @see https://github.com/webgptorg/promptbook
25
25
  */
26
- const PROMPTBOOK_ENGINE_VERSION = '0.103.0-52';
26
+ const PROMPTBOOK_ENGINE_VERSION = '0.103.0-54';
27
27
  /**
28
28
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
29
29
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -2787,6 +2787,12 @@
2787
2787
  get description() {
2788
2788
  return 'Define agent capabilities and actions it can perform.';
2789
2789
  }
2790
+ /**
2791
+ * Icon for this commitment.
2792
+ */
2793
+ get icon() {
2794
+ return '⚡';
2795
+ }
2790
2796
  /**
2791
2797
  * Markdown documentation for ACTION commitment.
2792
2798
  */
@@ -2866,6 +2872,12 @@
2866
2872
  get description() {
2867
2873
  return 'Remove or **disregard** certain information, context, or previous commitments.';
2868
2874
  }
2875
+ /**
2876
+ * Icon for this commitment.
2877
+ */
2878
+ get icon() {
2879
+ return 'đŸ—‘ī¸';
2880
+ }
2869
2881
  /**
2870
2882
  * Markdown documentation for DELETE commitment.
2871
2883
  */
@@ -2982,6 +2994,12 @@
2982
2994
  get description() {
2983
2995
  return 'Specify output structure or formatting requirements.';
2984
2996
  }
2997
+ /**
2998
+ * Icon for this commitment.
2999
+ */
3000
+ get icon() {
3001
+ return '📜';
3002
+ }
2985
3003
  /**
2986
3004
  * Markdown documentation for FORMAT commitment.
2987
3005
  */
@@ -3057,6 +3075,12 @@
3057
3075
  get description() {
3058
3076
  return 'Define main **goals** the AI assistant should achieve, with later goals having higher priority.';
3059
3077
  }
3078
+ /**
3079
+ * Icon for this commitment.
3080
+ */
3081
+ get icon() {
3082
+ return 'đŸŽ¯';
3083
+ }
3060
3084
  /**
3061
3085
  * Markdown documentation for GOAL commitment.
3062
3086
  */
@@ -3153,6 +3177,12 @@
3153
3177
  get description() {
3154
3178
  return 'Add domain **knowledge** via direct text or external sources (RAG).';
3155
3179
  }
3180
+ /**
3181
+ * Icon for this commitment.
3182
+ */
3183
+ get icon() {
3184
+ return '🧠';
3185
+ }
3156
3186
  /**
3157
3187
  * Markdown documentation for KNOWLEDGE commitment.
3158
3188
  */
@@ -3254,6 +3284,12 @@
3254
3284
  get description() {
3255
3285
  return 'Remember past interactions and user **preferences** for personalized responses.';
3256
3286
  }
3287
+ /**
3288
+ * Icon for this commitment.
3289
+ */
3290
+ get icon() {
3291
+ return '🧠';
3292
+ }
3257
3293
  /**
3258
3294
  * Markdown documentation for MEMORY commitment.
3259
3295
  */
@@ -3328,6 +3364,83 @@
3328
3364
  * Note: [💞] Ignore a discrepancy between file name and entity name
3329
3365
  */
3330
3366
 
3367
+ /**
3368
+ * AGENT MESSAGE commitment definition
3369
+ *
3370
+ * The AGENT MESSAGE commitment defines a message from the agent in the conversation history.
3371
+ * It is used to pre-fill the chat with a conversation history or to provide few-shot examples.
3372
+ *
3373
+ * Example usage in agent source:
3374
+ *
3375
+ * ```book
3376
+ * AGENT MESSAGE What seems to be the issue?
3377
+ * ```
3378
+ *
3379
+ * @private [đŸĒ”] Maybe export the commitments through some package
3380
+ */
3381
+ class AgentMessageCommitmentDefinition extends BaseCommitmentDefinition {
3382
+ constructor() {
3383
+ super('AGENT MESSAGE');
3384
+ }
3385
+ /**
3386
+ * Short one-line description of AGENT MESSAGE.
3387
+ */
3388
+ get description() {
3389
+ return 'Defines a **message from the agent** in the conversation history.';
3390
+ }
3391
+ /**
3392
+ * Icon for this commitment.
3393
+ */
3394
+ get icon() {
3395
+ return '🤖';
3396
+ }
3397
+ /**
3398
+ * Markdown documentation for AGENT MESSAGE commitment.
3399
+ */
3400
+ get documentation() {
3401
+ return spaceTrim.spaceTrim(`
3402
+ # ${this.type}
3403
+
3404
+ 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.
3405
+
3406
+ ## Key aspects
3407
+
3408
+ - Represents a message sent by the agent.
3409
+ - Used for setting up conversation context.
3410
+ - Can be used in conjunction with USER MESSAGE.
3411
+
3412
+ ## Examples
3413
+
3414
+ \`\`\`book
3415
+ Conversation History
3416
+
3417
+ USER MESSAGE Hello, I have a problem.
3418
+ AGENT MESSAGE What seems to be the issue?
3419
+ USER MESSAGE My computer is not starting.
3420
+ \`\`\`
3421
+ `);
3422
+ }
3423
+ applyToAgentModelRequirements(requirements, content) {
3424
+ // AGENT MESSAGE is for UI display purposes / conversation history construction
3425
+ // and typically doesn't need to be added to the system prompt or model requirements directly.
3426
+ // It is extracted separately for the chat interface.
3427
+ var _a;
3428
+ const pendingUserMessage = (_a = requirements.metadata) === null || _a === void 0 ? void 0 : _a.pendingUserMessage;
3429
+ if (pendingUserMessage) {
3430
+ const newSample = { question: pendingUserMessage, answer: content };
3431
+ const newSamples = [...(requirements.samples || []), newSample];
3432
+ const newMetadata = { ...requirements.metadata };
3433
+ delete newMetadata.pendingUserMessage;
3434
+ return {
3435
+ ...requirements,
3436
+ samples: newSamples,
3437
+ metadata: newMetadata,
3438
+ };
3439
+ }
3440
+ return requirements;
3441
+ }
3442
+ }
3443
+
3331
3444
  /**
3332
3445
  * INITIAL MESSAGE commitment definition
3333
3446
  *
@@ -3352,6 +3465,12 @@
3352
3465
  get description() {
3353
3466
  return 'Defines the **initial message** shown to the user when the chat starts.';
3354
3467
  }
3468
+ /**
3469
+ * Icon for this commitment.
3470
+ */
3471
+ get icon() {
3472
+ return '👋';
3473
+ }
3355
3474
  /**
3356
3475
  * Markdown documentation for INITIAL MESSAGE commitment.
3357
3476
  */
@@ -3410,6 +3529,12 @@
3410
3529
  get description() {
3411
3530
  return 'Include actual **messages** the AI assistant has sent during conversation history.';
3412
3531
  }
3532
+ /**
3533
+ * Icon for this commitment.
3534
+ */
3535
+ get icon() {
3536
+ return 'đŸ’Ŧ';
3537
+ }
3413
3538
  /**
3414
3539
  * Markdown documentation for MESSAGE commitment.
3415
3540
  */
@@ -3492,6 +3617,73 @@
3492
3617
  * Note: [💞] Ignore a discrepancy between file name and entity name
3493
3618
  */
3494
3619
 
3620
+ /**
3621
+ * USER MESSAGE commitment definition
3622
+ *
3623
+ * The USER MESSAGE commitment defines a message from the user in the conversation history.
3624
+ * It is used to pre-fill the chat with a conversation history or to provide few-shot examples.
3625
+ *
3626
+ * Example usage in agent source:
3627
+ *
3628
+ * ```book
3629
+ * USER MESSAGE Hello, I have a problem.
3630
+ * ```
3631
+ *
3632
+ * @private [đŸĒ”] Maybe export the commitments through some package
3633
+ */
3634
+ class UserMessageCommitmentDefinition extends BaseCommitmentDefinition {
3635
+ constructor() {
3636
+ super('USER MESSAGE');
3637
+ }
3638
+ /**
3639
+ * Short one-line description of USER MESSAGE.
3640
+ */
3641
+ get description() {
3642
+ return 'Defines a **message from the user** in the conversation history.';
3643
+ }
3644
+ /**
3645
+ * Icon for this commitment.
3646
+ */
3647
+ get icon() {
3648
+ return '🧑';
3649
+ }
3650
+ /**
3651
+ * Markdown documentation for USER MESSAGE commitment.
3652
+ */
3653
+ get documentation() {
3654
+ return spaceTrim.spaceTrim(`
3655
+ # ${this.type}
3656
+
3657
+ 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.
3658
+
3659
+ ## Key aspects
3660
+
3661
+ - Represents a message sent by the user.
3662
+ - Used for setting up conversation context.
3663
+ - Can be used in conjunction with AGENT MESSAGE.
3664
+
3665
+ ## Examples
3666
+
3667
+ \`\`\`book
3668
+ Conversation History
3669
+
3670
+ USER MESSAGE Hello, I have a problem.
3671
+ AGENT MESSAGE What seems to be the issue?
3672
+ USER MESSAGE My computer is not starting.
3673
+ \`\`\`
3674
+ `);
3675
+ }
3676
+ applyToAgentModelRequirements(requirements, content) {
3677
+ return {
3678
+ ...requirements,
3679
+ metadata: {
3680
+ ...requirements.metadata,
3681
+ pendingUserMessage: content,
3682
+ },
3683
+ };
3684
+ }
3685
+ }
3686
+
3495
3687
  /**
3496
3688
  * META commitment definition
3497
3689
  *
@@ -3528,6 +3720,12 @@
3528
3720
  get description() {
3529
3721
  return 'Set meta-information about the agent (IMAGE, LINK, TITLE, DESCRIPTION, etc.).';
3530
3722
  }
3723
+ /**
3724
+ * Icon for this commitment.
3725
+ */
3726
+ get icon() {
3727
+ return 'â„šī¸';
3728
+ }
3531
3729
  /**
3532
3730
  * Markdown documentation for META commitment.
3533
3731
  */
@@ -3655,6 +3853,12 @@
3655
3853
  get description() {
3656
3854
  return "Set the agent's accent color.";
3657
3855
  }
3856
+ /**
3857
+ * Icon for this commitment.
3858
+ */
3859
+ get icon() {
3860
+ return '🎨';
3861
+ }
3658
3862
  /**
3659
3863
  * Markdown documentation for META COLOR commitment.
3660
3864
  */
@@ -3733,6 +3937,12 @@
3733
3937
  get description() {
3734
3938
  return "Set the agent's profile image URL.";
3735
3939
  }
3940
+ /**
3941
+ * Icon for this commitment.
3942
+ */
3943
+ get icon() {
3944
+ return 'đŸ–ŧī¸';
3945
+ }
3736
3946
  /**
3737
3947
  * Markdown documentation for META IMAGE commitment.
3738
3948
  */
@@ -3823,6 +4033,12 @@
3823
4033
  get description() {
3824
4034
  return 'Enforce AI model requirements including name and technical parameters.';
3825
4035
  }
4036
+ /**
4037
+ * Icon for this commitment.
4038
+ */
4039
+ get icon() {
4040
+ return 'âš™ī¸';
4041
+ }
3826
4042
  /**
3827
4043
  * Markdown documentation for MODEL commitment.
3828
4044
  */
@@ -4058,6 +4274,12 @@
4058
4274
  get description() {
4059
4275
  return 'Add developer-facing notes without changing behavior or output.';
4060
4276
  }
4277
+ /**
4278
+ * Icon for this commitment.
4279
+ */
4280
+ get icon() {
4281
+ return '📝';
4282
+ }
4061
4283
  /**
4062
4284
  * Markdown documentation for NOTE commitment.
4063
4285
  */
@@ -4160,6 +4382,12 @@
4160
4382
  get description() {
4161
4383
  return 'Define who the agent is: background, expertise, and personality.';
4162
4384
  }
4385
+ /**
4386
+ * Icon for this commitment.
4387
+ */
4388
+ get icon() {
4389
+ return '👤';
4390
+ }
4163
4391
  /**
4164
4392
  * Markdown documentation for PERSONA commitment.
4165
4393
  */
@@ -4287,6 +4515,12 @@
4287
4515
  get description() {
4288
4516
  return 'Add behavioral rules the agent must follow.';
4289
4517
  }
4518
+ /**
4519
+ * Icon for this commitment.
4520
+ */
4521
+ get icon() {
4522
+ return 'âš–ī¸';
4523
+ }
4290
4524
  /**
4291
4525
  * Markdown documentation for RULE/RULES commitment.
4292
4526
  */
@@ -4363,6 +4597,12 @@
4363
4597
  get description() {
4364
4598
  return 'Provide example responses to guide behavior.';
4365
4599
  }
4600
+ /**
4601
+ * Icon for this commitment.
4602
+ */
4603
+ get icon() {
4604
+ return '🔍';
4605
+ }
4366
4606
  /**
4367
4607
  * Markdown documentation for SAMPLE/EXAMPLE commitment.
4368
4608
  */
@@ -4440,6 +4680,12 @@
4440
4680
  get description() {
4441
4681
  return 'Define specific **situations** or contexts for AI responses, with later scenarios having higher priority.';
4442
4682
  }
4683
+ /**
4684
+ * Icon for this commitment.
4685
+ */
4686
+ get icon() {
4687
+ return '🎭';
4688
+ }
4443
4689
  /**
4444
4690
  * Markdown documentation for SCENARIO commitment.
4445
4691
  */
@@ -4556,6 +4802,12 @@
4556
4802
  get description() {
4557
4803
  return 'Control the tone and writing style of responses.';
4558
4804
  }
4805
+ /**
4806
+ * Icon for this commitment.
4807
+ */
4808
+ get icon() {
4809
+ return 'đŸ–‹ī¸';
4810
+ }
4559
4811
  /**
4560
4812
  * Markdown documentation for STYLE commitment.
4561
4813
  */
@@ -4625,6 +4877,12 @@
4625
4877
  get description() {
4626
4878
  return 'Placeholder commitment that appends content verbatim to the system message.';
4627
4879
  }
4880
+ /**
4881
+ * Icon for this commitment.
4882
+ */
4883
+ get icon() {
4884
+ return '🚧';
4885
+ }
4628
4886
  /**
4629
4887
  * Markdown documentation available at runtime.
4630
4888
  */
@@ -4705,6 +4963,8 @@
4705
4963
  new GoalCommitmentDefinition('GOAL'),
4706
4964
  new GoalCommitmentDefinition('GOALS'),
4707
4965
  new InitialMessageCommitmentDefinition(),
4966
+ new UserMessageCommitmentDefinition(),
4967
+ new AgentMessageCommitmentDefinition(),
4708
4968
  new MessageCommitmentDefinition('MESSAGE'),
4709
4969
  new MessageCommitmentDefinition('MESSAGES'),
4710
4970
  new ScenarioCommitmentDefinition('SCENARIO'),