@promptbook/core 0.114.0-25 → 0.114.0-26

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.
package/esm/index.es.js CHANGED
@@ -26,7 +26,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
26
26
  * @generated
27
27
  * @see https://github.com/webgptorg/promptbook
28
28
  */
29
- const PROMPTBOOK_ENGINE_VERSION = '0.114.0-25';
29
+ const PROMPTBOOK_ENGINE_VERSION = '0.114.0-26';
30
30
  /**
31
31
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
32
32
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -23863,29 +23863,36 @@ class UseUserLocationCommitmentDefinition extends BaseCommitmentDefinition {
23863
23863
  /**
23864
23864
  * `WRITING RULES` commitment definition.
23865
23865
  *
23866
- * It adds constraints that apply strictly to writing style and presentation
23867
- * rather than task-solving behavior.
23866
+ * The `WRITING RULES`/`WRITING RULE` commitment adds constraints that apply strictly to writing style
23867
+ * and presentation rather than task-solving behavior.
23868
+ *
23869
+ * Example usage in agent source:
23870
+ *
23871
+ * ```book
23872
+ * WRITING RULES Keep every response under 120 words
23873
+ * WRITING RULE Always end the message with an emoji
23874
+ * ```
23868
23875
  *
23869
23876
  * @private [🪔] Maybe export the commitments through some package
23870
23877
  */
23871
23878
  class WritingRulesCommitmentDefinition extends BaseCommitmentDefinition {
23872
- constructor() {
23873
- super('WRITING RULES');
23879
+ constructor(type = 'WRITING RULES') {
23880
+ super(type);
23874
23881
  }
23875
23882
  /**
23876
- * Short one-line description of `WRITING RULES`.
23883
+ * Short one-line description of `WRITING RULES`/`WRITING RULE`.
23877
23884
  */
23878
23885
  get description() {
23879
23886
  return 'Add writing-only constraints such as tone, length, formatting, or emoji usage.';
23880
23887
  }
23881
23888
  /**
23882
- * Icon for `WRITING RULES`.
23889
+ * Icon for `WRITING RULES`/`WRITING RULE`.
23883
23890
  */
23884
23891
  get icon() {
23885
23892
  return '📝';
23886
23893
  }
23887
23894
  /**
23888
- * Markdown documentation for `WRITING RULES`.
23895
+ * Markdown documentation for `WRITING RULES`/`WRITING RULE` commitment.
23889
23896
  */
23890
23897
  get documentation() {
23891
23898
  return spaceTrim$1(`
@@ -23895,6 +23902,7 @@ class WritingRulesCommitmentDefinition extends BaseCommitmentDefinition {
23895
23902
 
23896
23903
  ## Key aspects
23897
23904
 
23905
+ - All writing rules are treated equally regardless of singular/plural form.
23898
23906
  - Use it for writing-only constraints such as tone, formatting, length, emoji usage, punctuation, or reading level.
23899
23907
  - Do **not** use it for problem-solving behavior, policy, tool usage, or decision-making logic. Use \`RULE\` for that.
23900
23908
  - Newer writing-rules blocks override conflicting earlier writing-rules blocks.
@@ -24093,7 +24101,8 @@ const COMMITMENT_REGISTRY = [
24093
24101
  new LanguageCommitmentDefinition('LANGUAGE'),
24094
24102
  new LanguageCommitmentDefinition('LANGUAGES'),
24095
24103
  new WritingSampleCommitmentDefinition(),
24096
- new WritingRulesCommitmentDefinition(),
24104
+ new WritingRulesCommitmentDefinition('WRITING RULES'),
24105
+ new WritingRulesCommitmentDefinition('WRITING RULE'),
24097
24106
  new SampleCommitmentDefinition('SAMPLE'),
24098
24107
  new SampleCommitmentDefinition('EXAMPLE'),
24099
24108
  new FormatCommitmentDefinition('FORMAT'),
@@ -27547,6 +27556,7 @@ const BEHAVIOR_COMMITMENT_TYPES = new Set([
27547
27556
  'LANGUAGES',
27548
27557
  'WRITING SAMPLE',
27549
27558
  'WRITING RULES',
27559
+ 'WRITING RULE',
27550
27560
  'SCENARIO',
27551
27561
  'SCENARIOS',
27552
27562
  'MESSAGE',