@promptbook/wizard 0.100.0-15 → 0.100.0-17

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-15';
41
+ const PROMPTBOOK_ENGINE_VERSION = '0.100.0-17';
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
@@ -1,7 +1,8 @@
1
1
  import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
2
2
  import { parseAgentSource } from '../book-2.0/agent-source/parseAgentSource';
3
- import { isAgentSource } from '../book-2.0/agent-source/string_agent_source';
4
- import { validateAgentSource } from '../book-2.0/agent-source/string_agent_source';
3
+ import { isValidBook } from '../book-2.0/agent-source/string_book';
4
+ import { validateBook } from '../book-2.0/agent-source/string_book';
5
+ import { DEFAULT_BOOK } from '../book-2.0/agent-source/string_book';
5
6
  import { createEmptyAgentModelRequirements } from '../book-2.0/commitments/_base/createEmptyAgentModelRequirements';
6
7
  import { createBasicAgentModelRequirements } from '../book-2.0/commitments/_base/createEmptyAgentModelRequirements';
7
8
  import { NotYetImplementedCommitmentDefinition } from '../book-2.0/commitments/_base/NotYetImplementedCommitmentDefinition';
@@ -156,8 +157,9 @@ import { TaskTypes } from '../types/TaskType';
156
157
  import { REMOTE_SERVER_URLS } from '../../servers';
157
158
  export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
158
159
  export { parseAgentSource };
159
- export { isAgentSource };
160
- export { validateAgentSource };
160
+ export { isValidBook };
161
+ export { validateBook };
162
+ export { DEFAULT_BOOK };
161
163
  export { createEmptyAgentModelRequirements };
162
164
  export { createBasicAgentModelRequirements };
163
165
  export { NotYetImplementedCommitmentDefinition };
@@ -1,5 +1,5 @@
1
1
  import type { AgentSourceBasicInformation } from '../book-2.0/agent-source/parseAgentSource';
2
- import type { string_agent_source } from '../book-2.0/agent-source/string_agent_source';
2
+ import type { string_book } from '../book-2.0/agent-source/string_book';
3
3
  import type { BookCommitment } from '../book-2.0/commitments/_base/BookCommitment';
4
4
  import type { CommitmentDefinition } from '../book-2.0/commitments/_base/CommitmentDefinition';
5
5
  import type { AgentModelRequirements } from '../book-2.0/commitments/_misc/AgentModelRequirements';
@@ -317,7 +317,7 @@ import type { CheckSerializableAsJsonOptions } from '../utils/serialization/chec
317
317
  import type { ExportJsonOptions } from '../utils/serialization/exportJson';
318
318
  import type { string_promptbook_version } from '../version';
319
319
  export type { AgentSourceBasicInformation };
320
- export type { string_agent_source };
320
+ export type { string_book };
321
321
  export type { BookCommitment };
322
322
  export type { CommitmentDefinition };
323
323
  export type { AgentModelRequirements };
@@ -1,6 +1,6 @@
1
1
  import type { string_agent_name } from '../../types/typeAliases';
2
2
  import type { string_url_image } from '../../types/typeAliases';
3
- import type { string_agent_source } from './string_agent_source';
3
+ import type { string_book } from './string_book';
4
4
  export interface AgentSourceBasicInformation {
5
5
  /**
6
6
  * Name of the agent
@@ -27,4 +27,4 @@ export interface AgentSourceBasicInformation {
27
27
  *
28
28
  * @public exported from `@promptbook/core`
29
29
  */
30
- export declare function parseAgentSource(agentSource: string_agent_source): AgentSourceBasicInformation;
30
+ export declare function parseAgentSource(agentSource: string_book): AgentSourceBasicInformation;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Branded type for books
3
+ */
4
+ export type string_book = string & {
5
+ readonly __type: 'book';
6
+ };
7
+ /**
8
+ * Type guard to check if a string is a valid agent source
9
+ *
10
+ * @public exported from `@promptbook/core`
11
+ */
12
+ export declare function isValidBook(value: string): value is string_book;
13
+ /**
14
+ * Validates and converts a string to agent source branded type
15
+ * This function should be used when you have a string that you know represents agent source
16
+ * but need to convert it to the branded type for type safety
17
+ *
18
+ * @public exported from `@promptbook/core`
19
+ */
20
+ export declare function validateBook(source: string): string_book;
21
+ /**
22
+ * Default book
23
+ *
24
+ * @public exported from `@promptbook/core`
25
+ */
26
+ export declare const DEFAULT_BOOK: string_book;
@@ -1,4 +1,4 @@
1
- import type { string_agent_source } from '../../agent-source/string_agent_source';
1
+ import type { string_book } from '../../agent-source/string_book';
2
2
  import type { AgentModelRequirements } from './AgentModelRequirements';
3
3
  /**
4
4
  * Creates model requirements for an agent based on its source
@@ -10,7 +10,7 @@ import type { AgentModelRequirements } from './AgentModelRequirements';
10
10
  *
11
11
  * @public exported from `@promptbook/core`
12
12
  */
13
- export declare function createAgentModelRequirements(agentSource: string_agent_source, modelName?: string): Promise<AgentModelRequirements>;
13
+ export declare function createAgentModelRequirements(agentSource: string_book, modelName?: string): Promise<AgentModelRequirements>;
14
14
  /**
15
15
  * Clears the cache for createAgentModelRequirements
16
16
  * Useful when agent sources are updated and cached results should be invalidated
@@ -23,7 +23,7 @@ export declare function clearAgentModelRequirementsCache(): void;
23
23
  * @param agentSource The agent source to remove from cache
24
24
  * @private
25
25
  */
26
- export declare function invalidateAgentModelRequirementsCache(agentSource: string_agent_source): void;
26
+ export declare function invalidateAgentModelRequirementsCache(agentSource: string_book): void;
27
27
  /**
28
28
  * Gets the current cache size (for debugging/monitoring)
29
29
  *
@@ -38,19 +38,19 @@ export declare function getAgentModelRequirementsCacheSize(): number;
38
38
  *
39
39
  * @private TODO: [🧠] Maybe should be public
40
40
  */
41
- export declare function extractMcpServers(agentSource: string_agent_source): string[];
41
+ export declare function extractMcpServers(agentSource: string_book): string[];
42
42
  /**
43
43
  * Creates a system message for an agent based on its source
44
44
  * @deprecated Use createAgentModelRequirements instead
45
45
  * @private
46
46
  */
47
- export declare function createAgentSystemMessage(agentSource: string_agent_source): Promise<string>;
47
+ export declare function createAgentSystemMessage(agentSource: string_book): Promise<string>;
48
48
  /**
49
49
  * Extracts the agent name from the first line of the agent source
50
50
  * @deprecated Use parseAgentSource instead
51
51
  * @private
52
52
  */
53
- export declare function extractAgentName(agentSource: string_agent_source): string;
53
+ export declare function extractAgentName(agentSource: string_book): string;
54
54
  /**
55
55
  * Extracts the profile image URL from agent source or returns gravatar fallback
56
56
  * @param agentSource The agent source string that may contain META IMAGE line
@@ -58,4 +58,4 @@ export declare function extractAgentName(agentSource: string_agent_source): stri
58
58
  * @deprecated Use parseAgentSource instead
59
59
  * @private
60
60
  */
61
- export declare function extractAgentProfileImage(agentSource: string_agent_source): string;
61
+ export declare function extractAgentProfileImage(agentSource: string_book): string;
@@ -1,4 +1,4 @@
1
- import type { string_agent_source } from '../../agent-source/string_agent_source';
1
+ import type { string_book } from '../../agent-source/string_book';
2
2
  import type { AgentModelRequirements } from './AgentModelRequirements';
3
3
  /**
4
4
  * Creates agent model requirements using the new commitment system
@@ -7,14 +7,14 @@ import type { AgentModelRequirements } from './AgentModelRequirements';
7
7
  *
8
8
  * @private
9
9
  */
10
- export declare function createAgentModelRequirementsWithCommitments(agentSource: string_agent_source, modelName?: string): Promise<AgentModelRequirements>;
10
+ export declare function createAgentModelRequirementsWithCommitments(agentSource: string_book, modelName?: string): Promise<AgentModelRequirements>;
11
11
  /**
12
12
  * Cached version of createAgentModelRequirementsWithCommitments
13
13
  * This maintains the same caching behavior as the original function
14
14
  *
15
15
  * @private
16
16
  */
17
- export declare function createAgentModelRequirementsWithCommitmentsCached(agentSource: string_agent_source, modelName?: string): Promise<AgentModelRequirements>;
17
+ export declare function createAgentModelRequirementsWithCommitmentsCached(agentSource: string_book, modelName?: string): Promise<AgentModelRequirements>;
18
18
  /**
19
19
  * Clears the cache for createAgentModelRequirementsWithCommitments
20
20
  *
@@ -26,7 +26,7 @@ export declare function clearAgentModelRequirementsWithCommitmentsCache(): void;
26
26
  *
27
27
  * @private
28
28
  */
29
- export declare function invalidateAgentModelRequirementsWithCommitmentsCache(agentSource: string_agent_source): void;
29
+ export declare function invalidateAgentModelRequirementsWithCommitmentsCache(agentSource: string_book): void;
30
30
  /**
31
31
  * Gets the current cache size
32
32
  *
@@ -1,5 +1,5 @@
1
1
  import type { AgentSourceBasicInformation } from '../../agent-source/parseAgentSource';
2
- import type { string_agent_source } from '../../agent-source/string_agent_source';
2
+ import type { string_book } from '../../agent-source/string_book';
3
3
  import type { AgentSourceParseResult } from './AgentSourceParseResult';
4
4
  /**
5
5
  * Parses agent source using the new commitment system with multiline support
@@ -7,18 +7,18 @@ import type { AgentSourceParseResult } from './AgentSourceParseResult';
7
7
  *
8
8
  * @private
9
9
  */
10
- export declare function parseAgentSourceWithCommitments(agentSource: string_agent_source): AgentSourceParseResult;
10
+ export declare function parseAgentSourceWithCommitments(agentSource: string_book): AgentSourceParseResult;
11
11
  /**
12
12
  * Extracts basic information from agent source using the new commitment system
13
13
  * This maintains compatibility with the original parseAgentSource interface
14
14
  *
15
15
  * @private
16
16
  */
17
- export declare function parseAgentSourceBasicInfo(agentSource: string_agent_source): AgentSourceBasicInformation;
17
+ export declare function parseAgentSourceBasicInfo(agentSource: string_book): AgentSourceBasicInformation;
18
18
  /**
19
19
  * Extracts META LINK commitments from agent source
20
20
  * Returns an array of all META LINK URLs found in the agent source
21
21
  *
22
22
  * @private
23
23
  */
24
- export declare function extractMetaLinks(agentSource: string_agent_source): string[];
24
+ export declare function extractMetaLinks(agentSource: string_book): string[];
@@ -1,3 +1,4 @@
1
+ import type { string_book } from '../book-2.0/agent-source/string_book';
1
2
  import type { PipelineString } from './PipelineString';
2
3
  /**
3
4
  * Tag function for notating a pipeline with a book\`...\ notation as template literal
@@ -12,7 +13,7 @@ import type { PipelineString } from './PipelineString';
12
13
  * @returns the pipeline string
13
14
  * @public exported from `@promptbook/core`
14
15
  */
15
- export declare function book(strings: TemplateStringsArray, ...values: Array<string>): PipelineString;
16
+ export declare function book(strings: TemplateStringsArray, ...values: Array<string>): string_book & PipelineString;
16
17
  /**
17
18
  * TODO: [🧠][🈴] Where is the best location for this file
18
19
  * 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-14`).
18
+ * It follows semantic versioning (e.g., `0.100.0-16`).
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-15",
3
+ "version": "0.100.0-17",
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-15"
98
+ "@promptbook/core": "0.100.0-17"
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-15';
52
+ const PROMPTBOOK_ENGINE_VERSION = '0.100.0-17';
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
@@ -1,42 +0,0 @@
1
- /**
2
- * Branded type for agent source strings
3
- *
4
- * This ensures type safety when working with agent source data throughout the application.
5
- * Agent source strings contain structured data in a specific format:
6
- * - First line: Agent name
7
- * - PERSONA line: Agent persona/description (optional)
8
- * - META IMAGE line: Profile image URL (optional)
9
- * - Remaining content: System message (after removing META IMAGE line)
10
- */
11
- export type string_agent_source = string & {
12
- readonly __brand: 'agent_source';
13
- };
14
- /**
15
- * Type guard to check if a string is a valid agent source
16
- *
17
- * @public exported from `@promptbook/core`
18
- */
19
- export declare function isAgentSource(value: string): value is string_agent_source;
20
- /**
21
- * Creates a branded agent source string from a regular string
22
- * Performs basic validation to ensure the string is suitable as agent source
23
- *
24
- * @private
25
- * @deprecated Use `validateAgentSource` instead - these functions are now equivalent
26
- */
27
- export declare function createAgentSource(source: string): string_agent_source;
28
- /**
29
- * Safely converts a string to agent source with fallback
30
- *
31
- * @private
32
- * @deprecated Use `validateAgentSource` instead - these functions are now equivalent
33
- */
34
- export declare function toAgentSource(source: string, fallback?: string): string_agent_source;
35
- /**
36
- * Validates and converts a string to agent source branded type
37
- * This function should be used when you have a string that you know represents agent source
38
- * but need to convert it to the branded type for type safety
39
- *
40
- * @public exported from `@promptbook/core`
41
- */
42
- export declare function validateAgentSource(source: string): string_agent_source;