@promptbook/editable 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 CHANGED
@@ -17,7 +17,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
17
17
  * @generated
18
18
  * @see https://github.com/webgptorg/promptbook
19
19
  */
20
- const PROMPTBOOK_ENGINE_VERSION = '0.101.0-7';
20
+ const PROMPTBOOK_ENGINE_VERSION = '0.101.0-8';
21
21
  /**
22
22
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
23
23
  * 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-6`).
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/editable",
3
- "version": "0.101.0-7",
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,
@@ -95,7 +95,7 @@
95
95
  "module": "./esm/index.es.js",
96
96
  "typings": "./esm/typings/src/_packages/editable.index.d.ts",
97
97
  "peerDependencies": {
98
- "@promptbook/core": "0.101.0-7"
98
+ "@promptbook/core": "0.101.0-8"
99
99
  },
100
100
  "dependencies": {
101
101
  "crypto-js": "4.2.0",
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.101.0-7';
26
+ const PROMPTBOOK_ENGINE_VERSION = '0.101.0-8';
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