@promptbook/wizard 0.100.0-19 → 0.100.0-21

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
@@ -38,7 +38,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
38
38
  * @generated
39
39
  * @see https://github.com/webgptorg/promptbook
40
40
  */
41
- const PROMPTBOOK_ENGINE_VERSION = '0.100.0-19';
41
+ const PROMPTBOOK_ENGINE_VERSION = '0.100.0-21';
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
@@ -7,6 +7,10 @@ import { createEmptyAgentModelRequirements } from '../book-2.0/commitments/_base
7
7
  import { createBasicAgentModelRequirements } from '../book-2.0/commitments/_base/createEmptyAgentModelRequirements';
8
8
  import { NotYetImplementedCommitmentDefinition } from '../book-2.0/commitments/_base/NotYetImplementedCommitmentDefinition';
9
9
  import { createAgentModelRequirements } from '../book-2.0/commitments/_misc/createAgentModelRequirements';
10
+ import { getCommitmentDefinition } from '../book-2.0/commitments/index';
11
+ import { getAllCommitmentDefinitions } from '../book-2.0/commitments/index';
12
+ import { getAllCommitmentTypes } from '../book-2.0/commitments/index';
13
+ import { isCommitmentSupported } from '../book-2.0/commitments/index';
10
14
  import { collectionToJson } from '../collection/collectionToJson';
11
15
  import { createCollectionFromJson } from '../collection/constructors/createCollectionFromJson';
12
16
  import { createCollectionFromPromise } from '../collection/constructors/createCollectionFromPromise';
@@ -164,6 +168,10 @@ export { createEmptyAgentModelRequirements };
164
168
  export { createBasicAgentModelRequirements };
165
169
  export { NotYetImplementedCommitmentDefinition };
166
170
  export { createAgentModelRequirements };
171
+ export { getCommitmentDefinition };
172
+ export { getAllCommitmentDefinitions };
173
+ export { getAllCommitmentTypes };
174
+ export { isCommitmentSupported };
167
175
  export { collectionToJson };
168
176
  export { createCollectionFromJson };
169
177
  export { createCollectionFromPromise };
@@ -15,7 +15,7 @@ import type { AgentModelRequirements } from '../_misc/AgentModelRequirements';
15
15
  *
16
16
  * @private [🪔] Maybe export the commitments through some package
17
17
  */
18
- export declare class ActionCommitmentDefinition extends BaseCommitmentDefinition {
18
+ export declare class ActionCommitmentDefinition extends BaseCommitmentDefinition<'ACTION'> {
19
19
  constructor();
20
20
  applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
21
21
  }
@@ -16,7 +16,7 @@ import type { AgentModelRequirements } from '../_misc/AgentModelRequirements';
16
16
  *
17
17
  * @private [🪔] Maybe export the commitments through some package
18
18
  */
19
- export declare class FormatCommitmentDefinition extends BaseCommitmentDefinition {
19
+ export declare class FormatCommitmentDefinition extends BaseCommitmentDefinition<'FORMAT'> {
20
20
  constructor();
21
21
  applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
22
22
  }
@@ -19,7 +19,7 @@ import { FrontendRAGService } from './FrontendRAGService';
19
19
  *
20
20
  * @private [🪔] Maybe export the commitments through some package
21
21
  */
22
- export declare class KnowledgeCommitmentDefinition extends BaseCommitmentDefinition {
22
+ export declare class KnowledgeCommitmentDefinition extends BaseCommitmentDefinition<'KNOWLEDGE'> {
23
23
  private ragService;
24
24
  constructor();
25
25
  applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
@@ -16,7 +16,7 @@ import type { AgentModelRequirements } from '../_misc/AgentModelRequirements';
16
16
  *
17
17
  * @private [🪔] Maybe export the commitments through some package
18
18
  */
19
- export declare class MetaImageCommitmentDefinition extends BaseCommitmentDefinition {
19
+ export declare class MetaImageCommitmentDefinition extends BaseCommitmentDefinition<'META IMAGE'> {
20
20
  constructor();
21
21
  applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
22
22
  /**
@@ -24,7 +24,7 @@ import type { AgentModelRequirements } from '../_misc/AgentModelRequirements';
24
24
  *
25
25
  * @private [🪔] Maybe export the commitments through some package
26
26
  */
27
- export declare class MetaLinkCommitmentDefinition extends BaseCommitmentDefinition {
27
+ export declare class MetaLinkCommitmentDefinition extends BaseCommitmentDefinition<'META LINK'> {
28
28
  constructor();
29
29
  applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
30
30
  /**
@@ -16,7 +16,7 @@ import type { AgentModelRequirements } from '../_misc/AgentModelRequirements';
16
16
  *
17
17
  * @private [🪔] Maybe export the commitments through some package
18
18
  */
19
- export declare class ModelCommitmentDefinition extends BaseCommitmentDefinition {
19
+ export declare class ModelCommitmentDefinition extends BaseCommitmentDefinition<'MODEL'> {
20
20
  constructor();
21
21
  applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
22
22
  }
@@ -26,7 +26,7 @@ import type { AgentModelRequirements } from '../_misc/AgentModelRequirements';
26
26
  *
27
27
  * @private [🪔] Maybe export the commitments through some package
28
28
  */
29
- export declare class NoteCommitmentDefinition extends BaseCommitmentDefinition {
29
+ export declare class NoteCommitmentDefinition extends BaseCommitmentDefinition<'NOTE'> {
30
30
  constructor();
31
31
  applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
32
32
  }
@@ -23,7 +23,7 @@ import type { AgentModelRequirements } from '../_misc/AgentModelRequirements';
23
23
  *
24
24
  * @private [🪔] Maybe export the commitments through some package
25
25
  */
26
- export declare class PersonaCommitmentDefinition extends BaseCommitmentDefinition {
26
+ export declare class PersonaCommitmentDefinition extends BaseCommitmentDefinition<'PERSONA'> {
27
27
  constructor();
28
28
  applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
29
29
  }
@@ -15,7 +15,7 @@ import type { AgentModelRequirements } from '../_misc/AgentModelRequirements';
15
15
  *
16
16
  * @private [🪔] Maybe export the commitments through some package
17
17
  */
18
- export declare class RuleCommitmentDefinition extends BaseCommitmentDefinition {
18
+ export declare class RuleCommitmentDefinition extends BaseCommitmentDefinition<'RULE' | 'RULES'> {
19
19
  constructor(type?: 'RULE' | 'RULES');
20
20
  applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
21
21
  }
@@ -15,7 +15,7 @@ import type { AgentModelRequirements } from '../_misc/AgentModelRequirements';
15
15
  *
16
16
  * @private [🪔] Maybe export the commitments through some package
17
17
  */
18
- export declare class SampleCommitmentDefinition extends BaseCommitmentDefinition {
18
+ export declare class SampleCommitmentDefinition extends BaseCommitmentDefinition<'SAMPLE' | 'EXAMPLE'> {
19
19
  constructor(type?: 'SAMPLE' | 'EXAMPLE');
20
20
  applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
21
21
  }
@@ -15,7 +15,7 @@ import type { AgentModelRequirements } from '../_misc/AgentModelRequirements';
15
15
  *
16
16
  * @private [🪔] Maybe export the commitments through some package
17
17
  */
18
- export declare class StyleCommitmentDefinition extends BaseCommitmentDefinition {
18
+ export declare class StyleCommitmentDefinition extends BaseCommitmentDefinition<'STYLE'> {
19
19
  constructor();
20
20
  applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
21
21
  }
@@ -1,5 +1,4 @@
1
1
  import type { AgentModelRequirements } from '../_misc/AgentModelRequirements';
2
- import type { BookCommitment } from './BookCommitment';
3
2
  import type { CommitmentDefinition } from './CommitmentDefinition';
4
3
  /**
5
4
  * Base implementation of CommitmentDefinition that provides common functionality
@@ -7,9 +6,9 @@ import type { CommitmentDefinition } from './CommitmentDefinition';
7
6
  *
8
7
  * @private
9
8
  */
10
- export declare abstract class BaseCommitmentDefinition implements CommitmentDefinition {
11
- readonly type: BookCommitment;
12
- constructor(type: BookCommitment);
9
+ export declare abstract class BaseCommitmentDefinition<TBookCommitment extends string> implements CommitmentDefinition {
10
+ readonly type: TBookCommitment;
11
+ constructor(type: TBookCommitment);
13
12
  /**
14
13
  * Creates a regex pattern to match this commitment in agent source
15
14
  * Uses the existing createCommitmentRegex function as internal helper
@@ -1,6 +1,5 @@
1
1
  import type { AgentModelRequirements } from '../_misc/AgentModelRequirements';
2
2
  import { BaseCommitmentDefinition } from './BaseCommitmentDefinition';
3
- import type { BookCommitment } from './BookCommitment';
4
3
  /**
5
4
  * Placeholder commitment definition for commitments that are not yet implemented
6
5
  *
@@ -9,7 +8,7 @@ import type { BookCommitment } from './BookCommitment';
9
8
  *
10
9
  * @public exported from `@promptbook/core`
11
10
  */
12
- export declare class NotYetImplementedCommitmentDefinition extends BaseCommitmentDefinition {
13
- constructor(type: BookCommitment);
11
+ export declare class NotYetImplementedCommitmentDefinition<TBookCommitment extends string> extends BaseCommitmentDefinition<TBookCommitment> {
12
+ constructor(type: TBookCommitment);
14
13
  applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
15
14
  }
@@ -1,53 +1,55 @@
1
1
  import type { BookCommitment } from './_base/BookCommitment';
2
2
  import type { CommitmentDefinition } from './_base/CommitmentDefinition';
3
+ import { ActionCommitmentDefinition } from './ACTION/ACTION';
4
+ import { FormatCommitmentDefinition } from './FORMAT/FORMAT';
5
+ import { KnowledgeCommitmentDefinition } from './KNOWLEDGE/KNOWLEDGE';
6
+ import { MetaImageCommitmentDefinition } from './META_IMAGE/META_IMAGE';
7
+ import { MetaLinkCommitmentDefinition } from './META_LINK/META_LINK';
8
+ import { ModelCommitmentDefinition } from './MODEL/MODEL';
9
+ import { NoteCommitmentDefinition } from './NOTE/NOTE';
10
+ import { PersonaCommitmentDefinition } from './PERSONA/PERSONA';
11
+ import { RuleCommitmentDefinition } from './RULE/RULE';
12
+ import { SampleCommitmentDefinition } from './SAMPLE/SAMPLE';
13
+ import { StyleCommitmentDefinition } from './STYLE/STYLE';
14
+ import { NotYetImplementedCommitmentDefinition } from './_base/NotYetImplementedCommitmentDefinition';
3
15
  /**
4
16
  * Registry of all available commitment definitions
5
17
  * This array contains instances of all commitment definitions
6
18
  * This is the single source of truth for all commitments in the system
7
19
  *
8
- * @private TODO: Maybe should be public?
20
+ * @private Use functions to access commitments instead of this array directly
9
21
  */
10
- export declare const COMMITMENT_REGISTRY: Array<CommitmentDefinition>;
22
+ export declare const COMMITMENT_REGISTRY: readonly [PersonaCommitmentDefinition, KnowledgeCommitmentDefinition, StyleCommitmentDefinition, RuleCommitmentDefinition, RuleCommitmentDefinition, SampleCommitmentDefinition, SampleCommitmentDefinition, FormatCommitmentDefinition, ModelCommitmentDefinition, ActionCommitmentDefinition, MetaImageCommitmentDefinition, MetaLinkCommitmentDefinition, NoteCommitmentDefinition, NotYetImplementedCommitmentDefinition<"EXPECT">, NotYetImplementedCommitmentDefinition<"SCENARIO">, NotYetImplementedCommitmentDefinition<"SCENARIOS">, NotYetImplementedCommitmentDefinition<"BEHAVIOUR">, NotYetImplementedCommitmentDefinition<"BEHAVIOURS">, NotYetImplementedCommitmentDefinition<"AVOID">, NotYetImplementedCommitmentDefinition<"AVOIDANCE">, NotYetImplementedCommitmentDefinition<"GOAL">, NotYetImplementedCommitmentDefinition<"GOALS">, NotYetImplementedCommitmentDefinition<"CONTEXT">];
11
23
  /**
12
24
  * Gets a commitment definition by its type
13
25
  * @param type The commitment type to look up
14
- * @returns The commitment definition or undefined if not found
26
+ * @returns The commitment definition or null if not found
15
27
  *
16
- * @private TODO: Maybe should be public?
28
+ * @public exported from `@promptbook/core`
17
29
  */
18
- export declare function getCommitmentDefinition(type: BookCommitment): CommitmentDefinition | undefined;
30
+ export declare function getCommitmentDefinition(type: BookCommitment): CommitmentDefinition | null;
19
31
  /**
20
32
  * Gets all available commitment definitions
21
33
  * @returns Array of all commitment definitions
22
34
  *
23
- * @private TODO: Maybe should be public?
35
+ * @public exported from `@promptbook/core`
24
36
  */
25
- export declare function getAllCommitmentDefinitions(): CommitmentDefinition[];
37
+ export declare function getAllCommitmentDefinitions(): ReadonlyArray<CommitmentDefinition>;
26
38
  /**
27
39
  * Gets all available commitment types
28
40
  * @returns Array of all commitment types
29
41
  *
30
- * @private TODO: Maybe should be public?
42
+ * @public exported from `@promptbook/core`
31
43
  */
32
- export declare function getAllCommitmentTypes(): BookCommitment[];
44
+ export declare function getAllCommitmentTypes(): ReadonlyArray<BookCommitment>;
33
45
  /**
34
46
  * Checks if a commitment type is supported
35
47
  * @param type The commitment type to check
36
48
  * @returns True if the commitment type is supported
37
49
  *
38
- * @private
50
+ * @public exported from `@promptbook/core`
39
51
  */
40
52
  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
53
  /**
52
54
  * TODO: !!!! Maybe create through standardized $register
53
55
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -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-18`).
18
+ * It follows semantic versioning (e.g., `0.100.0-20`).
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.100.0-19",
3
+ "version": "0.100.0-21",
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.100.0-19"
98
+ "@promptbook/core": "0.100.0-21"
99
99
  },
100
100
  "dependencies": {
101
101
  "@ai-sdk/deepseek": "0.1.6",
package/umd/index.umd.js CHANGED
@@ -49,7 +49,7 @@
49
49
  * @generated
50
50
  * @see https://github.com/webgptorg/promptbook
51
51
  */
52
- const PROMPTBOOK_ENGINE_VERSION = '0.100.0-19';
52
+ const PROMPTBOOK_ENGINE_VERSION = '0.100.0-21';
53
53
  /**
54
54
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
55
55
  * Note: [💞] Ignore a discrepancy between file name and entity name