@promptbook/wizard 0.101.0-7 → 0.101.0-9

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
@@ -36,7 +36,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
36
36
  * @generated
37
37
  * @see https://github.com/webgptorg/promptbook
38
38
  */
39
- const PROMPTBOOK_ENGINE_VERSION = '0.101.0-7';
39
+ const PROMPTBOOK_ENGINE_VERSION = '0.101.0-9';
40
40
  /**
41
41
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
42
42
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -1,6 +1,7 @@
1
1
  import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
2
2
  import { createAgentModelRequirements } from '../book-2.0/agent-source/createAgentModelRequirements';
3
3
  import { parseAgentSource } from '../book-2.0/agent-source/parseAgentSource';
4
+ import { parseParameters } from '../book-2.0/agent-source/parseParameters';
4
5
  import { isValidBook } from '../book-2.0/agent-source/string_book';
5
6
  import { validateBook } from '../book-2.0/agent-source/string_book';
6
7
  import { DEFAULT_BOOK } from '../book-2.0/agent-source/string_book';
@@ -166,6 +167,7 @@ import { REMOTE_SERVER_URLS } from '../../servers';
166
167
  export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
167
168
  export { createAgentModelRequirements };
168
169
  export { parseAgentSource };
170
+ export { parseParameters };
169
171
  export { isValidBook };
170
172
  export { validateBook };
171
173
  export { DEFAULT_BOOK };
@@ -1,3 +1,4 @@
1
+ import type { BookParameter } from '../book-2.0/agent-source/AgentBasicInformation';
1
2
  import type { AgentBasicInformation } from '../book-2.0/agent-source/AgentBasicInformation';
2
3
  import type { AgentModelRequirements } from '../book-2.0/agent-source/AgentModelRequirements';
3
4
  import type { string_book } from '../book-2.0/agent-source/string_book';
@@ -322,6 +323,7 @@ import type { CheckSerializableAsJsonOptions } from '../utils/serialization/chec
322
323
  import type { ExportJsonOptions } from '../utils/serialization/exportJson';
323
324
  import type { ITakeChain } from '../utils/take/interfaces/ITakeChain';
324
325
  import type { string_promptbook_version } from '../version';
326
+ export type { BookParameter };
325
327
  export type { AgentBasicInformation };
326
328
  export type { AgentModelRequirements };
327
329
  export type { string_book };
@@ -1,4 +1,28 @@
1
1
  import type { string_agent_name, string_url_image } from '../../types/typeAliases';
2
+ /**
3
+ * Unified parameter representation that supports two different notations:
4
+ * 1. @Parameter - single word parameter starting with @
5
+ * 2. {parameterName} or {parameter with multiple words} or {parameterName: description text}
6
+ * Both notations represent the same syntax feature - parameters
7
+ */
8
+ export type BookParameter = {
9
+ /**
10
+ * The raw text of the parameter as it appears in the source
11
+ */
12
+ text: string;
13
+ /**
14
+ * The notation used for this parameter
15
+ */
16
+ notation: 'at' | 'brace';
17
+ /**
18
+ * The parameter name (without @ or {})
19
+ */
20
+ name: string;
21
+ /**
22
+ * Optional description for {parameterName: description} notation
23
+ */
24
+ description?: string;
25
+ };
2
26
  export type AgentBasicInformation = {
3
27
  /**
4
28
  * Name of the agent
@@ -15,6 +39,13 @@ export type AgentBasicInformation = {
15
39
  * This is the line starting with "META IMAGE"
16
40
  */
17
41
  profileImageUrl: string_url_image;
42
+ /**
43
+ * Parameters found in the agent source
44
+ * Supports two different notations for the same syntax feature:
45
+ * - @Parameter (single word parameter starting with @)
46
+ * - {parameterName} or {parameter with multiple words} or {parameterName: description text}
47
+ */
48
+ parameters: BookParameter[];
18
49
  };
19
50
  /**
20
51
  * TODO: [🕛] Unite `AgentBasicInformation`, `ChatParticipant`, `LlmExecutionTools` + `LlmToolsMetadata`
@@ -0,0 +1,13 @@
1
+ import type { BookParameter } from './AgentBasicInformation';
2
+ /**
3
+ * Parses parameters from text using both supported notations:
4
+ * 1. @Parameter - single word parameter starting with @
5
+ * 2. {parameterName} or {parameter with multiple words} or {parameterName: description text}
6
+ *
7
+ * Both notations represent the same syntax feature - parameters
8
+ *
9
+ * @param text - Text to extract parameters from
10
+ * @returns Array of parsed parameters with unified representation
11
+ * @public exported from `@promptbook/core`
12
+ */
13
+ export declare function parseParameters(text: string): BookParameter[];
@@ -15,8 +15,8 @@ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
15
15
  *
16
16
  * @private [🪔] Maybe export the commitments through some package
17
17
  */
18
- export declare class ActionCommitmentDefinition extends BaseCommitmentDefinition<'ACTION'> {
19
- constructor();
18
+ export declare class ActionCommitmentDefinition extends BaseCommitmentDefinition<'ACTION' | 'ACTIONS'> {
19
+ constructor(type?: 'ACTION' | 'ACTIONS');
20
20
  /**
21
21
  * Short one-line description of ACTION.
22
22
  */
@@ -33,6 +33,12 @@ export declare class ActionCommitmentDefinition extends BaseCommitmentDefinition
33
33
  * @private [🪔] Maybe export the commitments through some package
34
34
  */
35
35
  export declare const ActionCommitment: ActionCommitmentDefinition;
36
+ /**
37
+ * Singleton instance of the ACTIONS commitment definition
38
+ *
39
+ * @private [🪔] Maybe export the commitments through some package
40
+ */
41
+ export declare const ActionsCommitment: ActionCommitmentDefinition;
36
42
  /**
37
43
  * Note: [💞] Ignore a discrepancy between file name and entity name
38
44
  */
@@ -16,8 +16,8 @@ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
16
16
  *
17
17
  * @private [🪔] Maybe export the commitments through some package
18
18
  */
19
- export declare class FormatCommitmentDefinition extends BaseCommitmentDefinition<'FORMAT'> {
20
- constructor();
19
+ export declare class FormatCommitmentDefinition extends BaseCommitmentDefinition<'FORMAT' | 'FORMATS'> {
20
+ constructor(type?: 'FORMAT' | 'FORMATS');
21
21
  /**
22
22
  * Short one-line description of FORMAT.
23
23
  */
@@ -34,6 +34,12 @@ export declare class FormatCommitmentDefinition extends BaseCommitmentDefinition
34
34
  * @private [🪔] Maybe export the commitments through some package
35
35
  */
36
36
  export declare const FormatCommitment: FormatCommitmentDefinition;
37
+ /**
38
+ * Singleton instance of the FORMATS commitment definition
39
+ *
40
+ * @private [🪔] Maybe export the commitments through some package
41
+ */
42
+ export declare const FormatsCommitment: FormatCommitmentDefinition;
37
43
  /**
38
44
  * Note: [💞] Ignore a discrepancy between file name and entity name
39
45
  */
@@ -16,8 +16,8 @@ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
16
16
  *
17
17
  * @private [🪔] Maybe export the commitments through some package
18
18
  */
19
- export declare class GoalCommitmentDefinition extends BaseCommitmentDefinition<'GOAL'> {
20
- constructor();
19
+ export declare class GoalCommitmentDefinition extends BaseCommitmentDefinition<'GOAL' | 'GOALS'> {
20
+ constructor(type?: 'GOAL' | 'GOALS');
21
21
  /**
22
22
  * Short one-line description of GOAL.
23
23
  */
@@ -34,6 +34,12 @@ export declare class GoalCommitmentDefinition extends BaseCommitmentDefinition<'
34
34
  * @private [🪔] Maybe export the commitments through some package
35
35
  */
36
36
  export declare const GoalCommitment: GoalCommitmentDefinition;
37
+ /**
38
+ * Singleton instance of the GOALS commitment definition
39
+ *
40
+ * @private [🪔] Maybe export the commitments through some package
41
+ */
42
+ export declare const GoalsCommitment: GoalCommitmentDefinition;
37
43
  /**
38
44
  * Note: [💞] Ignore a discrepancy between file name and entity name
39
45
  */
@@ -35,7 +35,7 @@ export declare class KnowledgeCommitmentDefinition extends BaseCommitmentDefinit
35
35
  private isUrl;
36
36
  }
37
37
  /**
38
- * Singleton instance of the KNOWLEDGE commitment definition
38
+ * Singleton instance of the KNOWLEDGE commitment definition !!!!
39
39
  *
40
40
  * @private [🪔] Maybe export the commitments through some package
41
41
  */
@@ -17,8 +17,8 @@ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
17
17
  *
18
18
  * @private [🪔] Maybe export the commitments through some package
19
19
  */
20
- export declare class MemoryCommitmentDefinition extends BaseCommitmentDefinition<'MEMORY'> {
21
- constructor();
20
+ export declare class MemoryCommitmentDefinition extends BaseCommitmentDefinition<'MEMORY' | 'MEMORIES'> {
21
+ constructor(type?: 'MEMORY' | 'MEMORIES');
22
22
  /**
23
23
  * Short one-line description of MEMORY.
24
24
  */
@@ -35,6 +35,12 @@ export declare class MemoryCommitmentDefinition extends BaseCommitmentDefinition
35
35
  * @private [🪔] Maybe export the commitments through some package
36
36
  */
37
37
  export declare const MemoryCommitment: MemoryCommitmentDefinition;
38
+ /**
39
+ * Singleton instance of the MEMORIES commitment definition
40
+ *
41
+ * @private [🪔] Maybe export the commitments through some package
42
+ */
43
+ export declare const MemoriesCommitment: MemoryCommitmentDefinition;
38
44
  /**
39
45
  * Note: [💞] Ignore a discrepancy between file name and entity name
40
46
  */
@@ -18,8 +18,8 @@ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
18
18
  *
19
19
  * @private [🪔] Maybe export the commitments through some package
20
20
  */
21
- export declare class MessageCommitmentDefinition extends BaseCommitmentDefinition<'MESSAGE'> {
22
- constructor();
21
+ export declare class MessageCommitmentDefinition extends BaseCommitmentDefinition<'MESSAGE' | 'MESSAGES'> {
22
+ constructor(type?: 'MESSAGE' | 'MESSAGES');
23
23
  /**
24
24
  * Short one-line description of MESSAGE.
25
25
  */
@@ -36,6 +36,12 @@ export declare class MessageCommitmentDefinition extends BaseCommitmentDefinitio
36
36
  * @private [🪔] Maybe export the commitments through some package
37
37
  */
38
38
  export declare const MessageCommitment: MessageCommitmentDefinition;
39
+ /**
40
+ * Singleton instance of the MESSAGES commitment definition
41
+ *
42
+ * @private [🪔] Maybe export the commitments through some package
43
+ */
44
+ export declare const MessagesCommitment: MessageCommitmentDefinition;
39
45
  /**
40
46
  * Note: [💞] Ignore a discrepancy between file name and entity name
41
47
  */
@@ -16,8 +16,8 @@ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
16
16
  *
17
17
  * @private [🪔] Maybe export the commitments through some package
18
18
  */
19
- export declare class ModelCommitmentDefinition extends BaseCommitmentDefinition<'MODEL'> {
20
- constructor();
19
+ export declare class ModelCommitmentDefinition extends BaseCommitmentDefinition<'MODEL' | 'MODELS'> {
20
+ constructor(type?: 'MODEL' | 'MODELS');
21
21
  /**
22
22
  * Short one-line description of MODEL.
23
23
  */
@@ -34,6 +34,12 @@ export declare class ModelCommitmentDefinition extends BaseCommitmentDefinition<
34
34
  * @private [🪔] Maybe export the commitments through some package
35
35
  */
36
36
  export declare const ModelCommitment: ModelCommitmentDefinition;
37
+ /**
38
+ * Singleton instance of the MODELS commitment definition
39
+ *
40
+ * @private [🪔] Maybe export the commitments through some package
41
+ */
42
+ export declare const ModelsCommitment: ModelCommitmentDefinition;
37
43
  /**
38
44
  * Note: [💞] Ignore a discrepancy between file name and entity name
39
45
  */
@@ -26,8 +26,8 @@ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
26
26
  *
27
27
  * @private [🪔] Maybe export the commitments through some package
28
28
  */
29
- export declare class NoteCommitmentDefinition extends BaseCommitmentDefinition<'NOTE'> {
30
- constructor();
29
+ export declare class NoteCommitmentDefinition extends BaseCommitmentDefinition<'NOTE' | 'NOTES'> {
30
+ constructor(type?: 'NOTE' | 'NOTES');
31
31
  /**
32
32
  * Short one-line description of NOTE.
33
33
  */
@@ -44,6 +44,12 @@ export declare class NoteCommitmentDefinition extends BaseCommitmentDefinition<'
44
44
  * @private [🪔] Maybe export the commitments through some package
45
45
  */
46
46
  export declare const NoteCommitment: NoteCommitmentDefinition;
47
+ /**
48
+ * Singleton instance of the NOTES commitment definition
49
+ *
50
+ * @private [🪔] Maybe export the commitments through some package
51
+ */
52
+ export declare const NotesCommitment: NoteCommitmentDefinition;
47
53
  /**
48
54
  * [💞] Ignore a discrepancy between file name and entity name
49
55
  */
@@ -23,8 +23,8 @@ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
23
23
  *
24
24
  * @private [🪔] Maybe export the commitments through some package
25
25
  */
26
- export declare class PersonaCommitmentDefinition extends BaseCommitmentDefinition<'PERSONA'> {
27
- constructor();
26
+ export declare class PersonaCommitmentDefinition extends BaseCommitmentDefinition<'PERSONA' | 'PERSONAE'> {
27
+ constructor(type?: 'PERSONA' | 'PERSONAE');
28
28
  /**
29
29
  * Short one-line description of PERSONA.
30
30
  */
@@ -41,6 +41,12 @@ export declare class PersonaCommitmentDefinition extends BaseCommitmentDefinitio
41
41
  * @private [🪔] Maybe export the commitments through some package
42
42
  */
43
43
  export declare const PersonaCommitment: PersonaCommitmentDefinition;
44
+ /**
45
+ * Singleton instance of the PERSONAE commitment definition
46
+ *
47
+ * @private [🪔] Maybe export the commitments through some package
48
+ */
49
+ export declare const PersonaeCommitment: PersonaCommitmentDefinition;
44
50
  /**
45
51
  * Note: [💞] Ignore a discrepancy between file name and entity name
46
52
  */
@@ -17,8 +17,8 @@ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
17
17
  *
18
18
  * @private [🪔] Maybe export the commitments through some package
19
19
  */
20
- export declare class ScenarioCommitmentDefinition extends BaseCommitmentDefinition<'SCENARIO'> {
21
- constructor();
20
+ export declare class ScenarioCommitmentDefinition extends BaseCommitmentDefinition<'SCENARIO' | 'SCENARIOS'> {
21
+ constructor(type?: 'SCENARIO' | 'SCENARIOS');
22
22
  /**
23
23
  * Short one-line description of SCENARIO.
24
24
  */
@@ -35,6 +35,12 @@ export declare class ScenarioCommitmentDefinition extends BaseCommitmentDefiniti
35
35
  * @private [🪔] Maybe export the commitments through some package
36
36
  */
37
37
  export declare const ScenarioCommitment: ScenarioCommitmentDefinition;
38
+ /**
39
+ * Singleton instance of the SCENARIOS commitment definition
40
+ *
41
+ * @private [🪔] Maybe export the commitments through some package
42
+ */
43
+ export declare const ScenariosCommitment: ScenarioCommitmentDefinition;
38
44
  /**
39
45
  * Note: [💞] Ignore a discrepancy between file name and entity name
40
46
  */
@@ -15,8 +15,8 @@ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
15
15
  *
16
16
  * @private [🪔] Maybe export the commitments through some package
17
17
  */
18
- export declare class StyleCommitmentDefinition extends BaseCommitmentDefinition<'STYLE'> {
19
- constructor();
18
+ export declare class StyleCommitmentDefinition extends BaseCommitmentDefinition<'STYLE' | 'STYLES'> {
19
+ constructor(type?: 'STYLE' | 'STYLES');
20
20
  /**
21
21
  * Short one-line description of STYLE.
22
22
  */
@@ -33,6 +33,12 @@ export declare class StyleCommitmentDefinition extends BaseCommitmentDefinition<
33
33
  * @private [🪔] Maybe export the commitments through some package
34
34
  */
35
35
  export declare const StyleCommitment: StyleCommitmentDefinition;
36
+ /**
37
+ * Singleton instance of the STYLES commitment definition
38
+ *
39
+ * @private [🪔] Maybe export the commitments through some package
40
+ */
41
+ export declare const StylesCommitment: StyleCommitmentDefinition;
36
42
  /**
37
43
  * [💞] Ignore a discrepancy between file name and entity name
38
44
  */
@@ -23,7 +23,7 @@ import { NotYetImplementedCommitmentDefinition } from './_base/NotYetImplemented
23
23
  *
24
24
  * @private Use functions to access commitments instead of this array directly
25
25
  */
26
- export declare const COMMITMENT_REGISTRY: readonly [PersonaCommitmentDefinition, KnowledgeCommitmentDefinition, MemoryCommitmentDefinition, StyleCommitmentDefinition, RuleCommitmentDefinition, RuleCommitmentDefinition, SampleCommitmentDefinition, SampleCommitmentDefinition, FormatCommitmentDefinition, ModelCommitmentDefinition, ActionCommitmentDefinition, MetaCommitmentDefinition, NoteCommitmentDefinition, GoalCommitmentDefinition, MessageCommitmentDefinition, ScenarioCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, NotYetImplementedCommitmentDefinition<"EXPECT">, NotYetImplementedCommitmentDefinition<"SCENARIOS">, NotYetImplementedCommitmentDefinition<"BEHAVIOUR">, NotYetImplementedCommitmentDefinition<"BEHAVIOURS">, NotYetImplementedCommitmentDefinition<"AVOID">, NotYetImplementedCommitmentDefinition<"AVOIDANCE">, NotYetImplementedCommitmentDefinition<"GOALS">, NotYetImplementedCommitmentDefinition<"CONTEXT">];
26
+ export declare const COMMITMENT_REGISTRY: readonly [PersonaCommitmentDefinition, PersonaCommitmentDefinition, KnowledgeCommitmentDefinition, MemoryCommitmentDefinition, MemoryCommitmentDefinition, StyleCommitmentDefinition, StyleCommitmentDefinition, RuleCommitmentDefinition, RuleCommitmentDefinition, SampleCommitmentDefinition, SampleCommitmentDefinition, FormatCommitmentDefinition, FormatCommitmentDefinition, ModelCommitmentDefinition, ModelCommitmentDefinition, ActionCommitmentDefinition, ActionCommitmentDefinition, MetaCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, GoalCommitmentDefinition, GoalCommitmentDefinition, MessageCommitmentDefinition, MessageCommitmentDefinition, ScenarioCommitmentDefinition, ScenarioCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, NotYetImplementedCommitmentDefinition<"EXPECT">, NotYetImplementedCommitmentDefinition<"BEHAVIOUR">, NotYetImplementedCommitmentDefinition<"BEHAVIOURS">, NotYetImplementedCommitmentDefinition<"AVOID">, NotYetImplementedCommitmentDefinition<"AVOIDANCE">, NotYetImplementedCommitmentDefinition<"CONTEXT">];
27
27
  /**
28
28
  * Gets a commitment definition by its type
29
29
  * @param type The commitment type to look up
@@ -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.101.0-6`).
18
+ * It follows semantic versioning (e.g., `0.101.0-8`).
19
19
  *
20
20
  * @generated
21
21
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/wizard",
3
- "version": "0.101.0-7",
3
+ "version": "0.101.0-9",
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/wizard.index.d.ts",
97
97
  "peerDependencies": {
98
- "@promptbook/core": "0.101.0-7"
98
+ "@promptbook/core": "0.101.0-9"
99
99
  },
100
100
  "dependencies": {
101
101
  "@ai-sdk/deepseek": "0.1.6",
package/umd/index.umd.js CHANGED
@@ -48,7 +48,7 @@
48
48
  * @generated
49
49
  * @see https://github.com/webgptorg/promptbook
50
50
  */
51
- const PROMPTBOOK_ENGINE_VERSION = '0.101.0-7';
51
+ const PROMPTBOOK_ENGINE_VERSION = '0.101.0-9';
52
52
  /**
53
53
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
54
54
  * Note: [💞] Ignore a discrepancy between file name and entity name