@promptbook/node 0.101.0-7 → 0.101.0-8
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 +1 -1
- package/esm/typings/src/_packages/core.index.d.ts +2 -0
- package/esm/typings/src/_packages/types.index.d.ts +2 -0
- package/esm/typings/src/book-2.0/agent-source/AgentBasicInformation.d.ts +31 -0
- package/esm/typings/src/book-2.0/agent-source/parseParameters.d.ts +13 -0
- package/esm/typings/src/version.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +1 -1
package/esm/index.es.js
CHANGED
@@ -28,7 +28,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
|
|
28
28
|
* @generated
|
29
29
|
* @see https://github.com/webgptorg/promptbook
|
30
30
|
*/
|
31
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.101.0-
|
31
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.101.0-8';
|
32
32
|
/**
|
33
33
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
34
34
|
* 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,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-
|
18
|
+
* It follows semantic versioning (e.g., `0.101.0-7`).
|
19
19
|
*
|
20
20
|
* @generated
|
21
21
|
*/
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@promptbook/node",
|
3
|
-
"version": "0.101.0-
|
3
|
+
"version": "0.101.0-8",
|
4
4
|
"description": "Promptbook: Run AI apps in plain human language across multiple models and platforms",
|
5
5
|
"private": false,
|
6
6
|
"sideEffects": false,
|
@@ -93,7 +93,7 @@
|
|
93
93
|
"module": "./esm/index.es.js",
|
94
94
|
"typings": "./esm/typings/src/_packages/node.index.d.ts",
|
95
95
|
"peerDependencies": {
|
96
|
-
"@promptbook/core": "0.101.0-
|
96
|
+
"@promptbook/core": "0.101.0-8"
|
97
97
|
},
|
98
98
|
"dependencies": {
|
99
99
|
"colors": "1.4.0",
|
package/umd/index.umd.js
CHANGED
@@ -45,7 +45,7 @@
|
|
45
45
|
* @generated
|
46
46
|
* @see https://github.com/webgptorg/promptbook
|
47
47
|
*/
|
48
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.101.0-
|
48
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.101.0-8';
|
49
49
|
/**
|
50
50
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
51
51
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|