@promptbook/templates 0.100.0-14 → 0.100.0-15

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 (44) hide show
  1. package/esm/index.es.js +10 -10
  2. package/esm/typings/src/_packages/core.index.d.ts +14 -0
  3. package/esm/typings/src/_packages/types.index.d.ts +28 -0
  4. package/esm/typings/src/book-2.0/agent-source/parseAgentSource.d.ts +30 -0
  5. package/esm/typings/src/book-2.0/agent-source/parseAgentSource.test.d.ts +1 -0
  6. package/esm/typings/src/book-2.0/agent-source/string_agent_source.d.ts +42 -0
  7. package/esm/typings/src/book-2.0/commitments/ACTION/ACTION.d.ts +30 -0
  8. package/esm/typings/src/book-2.0/commitments/FORMAT/FORMAT.d.ts +31 -0
  9. package/esm/typings/src/book-2.0/commitments/KNOWLEDGE/FrontendRAGService.d.ts +48 -0
  10. package/esm/typings/src/book-2.0/commitments/KNOWLEDGE/KNOWLEDGE.d.ts +43 -0
  11. package/esm/typings/src/book-2.0/commitments/KNOWLEDGE/RAGService.d.ts +54 -0
  12. package/esm/typings/src/book-2.0/commitments/KNOWLEDGE/processors/BaseKnowledgeProcessor.d.ts +45 -0
  13. package/esm/typings/src/book-2.0/commitments/KNOWLEDGE/processors/PdfProcessor.d.ts +31 -0
  14. package/esm/typings/src/book-2.0/commitments/KNOWLEDGE/processors/ProcessorFactory.d.ts +23 -0
  15. package/esm/typings/src/book-2.0/commitments/KNOWLEDGE/processors/TextProcessor.d.ts +18 -0
  16. package/esm/typings/src/book-2.0/commitments/KNOWLEDGE/types.d.ts +56 -0
  17. package/esm/typings/src/book-2.0/commitments/KNOWLEDGE/utils/ragHelper.d.ts +34 -0
  18. package/esm/typings/src/book-2.0/commitments/META_IMAGE/META_IMAGE.d.ts +36 -0
  19. package/esm/typings/src/book-2.0/commitments/META_LINK/META_LINK.d.ts +48 -0
  20. package/esm/typings/src/book-2.0/commitments/MODEL/MODEL.d.ts +31 -0
  21. package/esm/typings/src/book-2.0/commitments/NOTE/NOTE.d.ts +41 -0
  22. package/esm/typings/src/book-2.0/commitments/PERSONA/PERSONA.d.ts +38 -0
  23. package/esm/typings/src/book-2.0/commitments/RULE/RULE.d.ts +36 -0
  24. package/esm/typings/src/book-2.0/commitments/SAMPLE/SAMPLE.d.ts +36 -0
  25. package/esm/typings/src/book-2.0/commitments/STYLE/STYLE.d.ts +30 -0
  26. package/esm/typings/src/book-2.0/commitments/_base/BaseCommitmentDefinition.d.ts +43 -0
  27. package/esm/typings/src/book-2.0/commitments/_base/BookCommitment.d.ts +5 -0
  28. package/esm/typings/src/book-2.0/commitments/_base/CommitmentDefinition.d.ts +37 -0
  29. package/esm/typings/src/book-2.0/commitments/_base/NotYetImplementedCommitmentDefinition.d.ts +15 -0
  30. package/esm/typings/src/book-2.0/commitments/_base/createEmptyAgentModelRequirements.d.ts +19 -0
  31. package/esm/typings/src/book-2.0/commitments/_misc/AgentModelRequirements.d.ts +37 -0
  32. package/esm/typings/src/book-2.0/commitments/_misc/AgentSourceParseResult.d.ts +18 -0
  33. package/esm/typings/src/book-2.0/commitments/_misc/ParsedCommitment.d.ts +22 -0
  34. package/esm/typings/src/book-2.0/commitments/_misc/createAgentModelRequirements.d.ts +61 -0
  35. package/esm/typings/src/book-2.0/commitments/_misc/createAgentModelRequirementsWithCommitments.d.ts +35 -0
  36. package/esm/typings/src/book-2.0/commitments/_misc/createCommitmentRegex.d.ts +20 -0
  37. package/esm/typings/src/book-2.0/commitments/_misc/parseAgentSourceWithCommitments.d.ts +24 -0
  38. package/esm/typings/src/book-2.0/commitments/_misc/removeCommentsFromSystemMessage.d.ts +11 -0
  39. package/esm/typings/src/book-2.0/commitments/index.d.ts +54 -0
  40. package/esm/typings/src/book-2.0/utils/profileImageUtils.d.ts +39 -0
  41. package/esm/typings/src/types/typeAliases.d.ts +6 -0
  42. package/esm/typings/src/version.d.ts +1 -1
  43. package/package.json +2 -2
  44. package/umd/index.umd.js +10 -10
@@ -0,0 +1,54 @@
1
+ import type { BookCommitment } from './_base/BookCommitment';
2
+ import type { CommitmentDefinition } from './_base/CommitmentDefinition';
3
+ /**
4
+ * Registry of all available commitment definitions
5
+ * This array contains instances of all commitment definitions
6
+ * This is the single source of truth for all commitments in the system
7
+ *
8
+ * @private TODO: Maybe should be public?
9
+ */
10
+ export declare const COMMITMENT_REGISTRY: Array<CommitmentDefinition>;
11
+ /**
12
+ * Gets a commitment definition by its type
13
+ * @param type The commitment type to look up
14
+ * @returns The commitment definition or undefined if not found
15
+ *
16
+ * @private TODO: Maybe should be public?
17
+ */
18
+ export declare function getCommitmentDefinition(type: BookCommitment): CommitmentDefinition | undefined;
19
+ /**
20
+ * Gets all available commitment definitions
21
+ * @returns Array of all commitment definitions
22
+ *
23
+ * @private TODO: Maybe should be public?
24
+ */
25
+ export declare function getAllCommitmentDefinitions(): CommitmentDefinition[];
26
+ /**
27
+ * Gets all available commitment types
28
+ * @returns Array of all commitment types
29
+ *
30
+ * @private TODO: Maybe should be public?
31
+ */
32
+ export declare function getAllCommitmentTypes(): BookCommitment[];
33
+ /**
34
+ * Checks if a commitment type is supported
35
+ * @param type The commitment type to check
36
+ * @returns True if the commitment type is supported
37
+ *
38
+ * @private
39
+ */
40
+ export declare function isCommitmentSupported(type: BookCommitment): boolean;
41
+ /**
42
+ * Creates a custom commitment registry with only specified commitments
43
+ * This is useful for customers who want to disable certain commitments
44
+ *
45
+ * @param enabledCommitments Array of commitment types to enable
46
+ * @returns New registry with only the specified commitments
47
+ *
48
+ * @private
49
+ */
50
+ export declare function createCustomCommitmentRegistry(enabledCommitments: BookCommitment[]): CommitmentDefinition[];
51
+ /**
52
+ * TODO: !!!! Maybe create through standardized $register
53
+ * Note: [💞] Ignore a discrepancy between file name and entity name
54
+ */
@@ -0,0 +1,39 @@
1
+ import type { string_url_image } from '../../types/typeAliases';
2
+ /**
3
+ * Extracts profile image URL from agent definition text and returns cleaned system message
4
+ * @param systemMessage The original system message that may contain META IMAGE line
5
+ * @returns Object with profileImageUrl (if found) and cleanedSystemMessage (without META IMAGE line)
6
+ *
7
+ * @private - TODO: [🧠] Maybe should be public?
8
+ */
9
+ export declare function extractProfileImageFromSystemMessage(systemMessage: string): {
10
+ profileImageUrl?: string_url_image;
11
+ cleanedSystemMessage: string;
12
+ };
13
+ /**
14
+ * Extracts persona, examples, and profile image from agent definition text
15
+ * @param systemMessage The original system message that may contain PERSONA, EXAMPLE, and META IMAGE lines
16
+ * @returns Object with extracted information and cleaned system message
17
+ *
18
+ * @private - TODO: [🧠] Maybe should be public?
19
+ */
20
+ export declare function extractAgentMetadata(systemMessage: string): {
21
+ persona?: {
22
+ name: string;
23
+ description?: string;
24
+ };
25
+ examples: string[];
26
+ profileImageUrl?: string_url_image;
27
+ cleanedSystemMessage: string;
28
+ };
29
+ /**
30
+ * Generates a gravatar URL based on agent name for fallback avatar
31
+ * @param name The agent name to generate avatar for
32
+ * @returns Gravatar URL
33
+ *
34
+ * @private - TODO: [🧠] Maybe should be public?
35
+ */
36
+ export declare function generateGravatarUrl(name?: string | null): string;
37
+ /**
38
+ * Note: [💞] Ignore a discrepancy between file name and entity name
39
+ */
@@ -136,6 +136,12 @@ export type ReservedParameters = Record<string_reserved_parameter_name, string_p
136
136
  * For example `"Ai*nautes"`
137
137
  */
138
138
  export type string_title = string;
139
+ /**
140
+ * Semantic helper
141
+ *
142
+ * For example `"My AI Assistant"`
143
+ */
144
+ export type string_agent_name = string;
139
145
  /**
140
146
  * Unstructured description of the persona
141
147
  *
@@ -15,7 +15,7 @@ export declare const BOOK_LANGUAGE_VERSION: string_semantic_version;
15
15
  export declare const PROMPTBOOK_ENGINE_VERSION: string_promptbook_version;
16
16
  /**
17
17
  * Represents the version string of the Promptbook engine.
18
- * It follows semantic versioning (e.g., `0.100.0-13`).
18
+ * It follows semantic versioning (e.g., `0.100.0-14`).
19
19
  *
20
20
  * @generated
21
21
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/templates",
3
- "version": "0.100.0-14",
3
+ "version": "0.100.0-15",
4
4
  "description": "Promptbook: Run AI apps in plain human language across multiple models and platforms",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -95,7 +95,7 @@
95
95
  "module": "./esm/index.es.js",
96
96
  "typings": "./esm/typings/src/_packages/templates.index.d.ts",
97
97
  "peerDependencies": {
98
- "@promptbook/core": "0.100.0-14"
98
+ "@promptbook/core": "0.100.0-15"
99
99
  },
100
100
  "dependencies": {
101
101
  "prettier": "2.8.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.100.0-14';
26
+ const PROMPTBOOK_ENGINE_VERSION = '0.100.0-15';
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
@@ -1572,7 +1572,7 @@
1572
1572
  "preparations": [
1573
1573
  {
1574
1574
  "id": 1,
1575
- "promptbookVersion": "0.100.0-13",
1575
+ "promptbookVersion": "0.100.0-14",
1576
1576
  "usage": {
1577
1577
  "price": {
1578
1578
  "value": 0.0256925
@@ -2131,7 +2131,7 @@
2131
2131
  "preparations": [
2132
2132
  {
2133
2133
  "id": 1,
2134
- "promptbookVersion": "0.100.0-13",
2134
+ "promptbookVersion": "0.100.0-14",
2135
2135
  "usage": {
2136
2136
  "price": {
2137
2137
  "value": 0.0256925
@@ -2831,7 +2831,7 @@
2831
2831
  "preparations": [
2832
2832
  {
2833
2833
  "id": 1,
2834
- "promptbookVersion": "0.100.0-13",
2834
+ "promptbookVersion": "0.100.0-14",
2835
2835
  "usage": {
2836
2836
  "price": {
2837
2837
  "value": 0.0252275
@@ -2973,7 +2973,7 @@
2973
2973
  "preparations": [
2974
2974
  {
2975
2975
  "id": 1,
2976
- "promptbookVersion": "0.100.0-13",
2976
+ "promptbookVersion": "0.100.0-14",
2977
2977
  "usage": {
2978
2978
  "price": {
2979
2979
  "value": 0.026202500000000004
@@ -3069,7 +3069,7 @@
3069
3069
  "preparations": [
3070
3070
  {
3071
3071
  "id": 1,
3072
- "promptbookVersion": "0.100.0-13",
3072
+ "promptbookVersion": "0.100.0-14",
3073
3073
  "usage": {
3074
3074
  "price": {
3075
3075
  "value": 0
@@ -3206,7 +3206,7 @@
3206
3206
  "preparations": [
3207
3207
  {
3208
3208
  "id": 1,
3209
- "promptbookVersion": "0.100.0-13",
3209
+ "promptbookVersion": "0.100.0-14",
3210
3210
  "usage": {
3211
3211
  "price": {
3212
3212
  "value": 0.025450000000000004
@@ -3362,7 +3362,7 @@
3362
3362
  "preparations": [
3363
3363
  {
3364
3364
  "id": 1,
3365
- "promptbookVersion": "0.100.0-13",
3365
+ "promptbookVersion": "0.100.0-14",
3366
3366
  "usage": {
3367
3367
  "price": {
3368
3368
  "value": 0.030412500000000002
@@ -3695,7 +3695,7 @@
3695
3695
  "preparations": [
3696
3696
  {
3697
3697
  "id": 1,
3698
- "promptbookVersion": "0.100.0-13",
3698
+ "promptbookVersion": "0.100.0-14",
3699
3699
  "usage": {
3700
3700
  "price": {
3701
3701
  "value": 0.026502500000000002
@@ -3836,7 +3836,7 @@
3836
3836
  "preparations": [
3837
3837
  {
3838
3838
  "id": 1,
3839
- "promptbookVersion": "0.100.0-13",
3839
+ "promptbookVersion": "0.100.0-14",
3840
3840
  "usage": {
3841
3841
  "price": {
3842
3842
  "value": 0.026462500000000003