@promptbook/javascript 0.112.0-25 → 0.112.0-27
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/src/book-2.0/agent-source/createAgentModelRequirements.useCommitmentAggregation.test.d.ts +1 -0
- package/esm/src/book-components/_common/MenuHoisting/MenuHoistingContext.d.ts +0 -47
- package/esm/src/commitments/USE/aggregateUseCommitmentSystemMessages.d.ts +30 -0
- package/esm/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +3 -2
- package/esm/src/version.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +1 -1
- package/umd/src/book-2.0/agent-source/createAgentModelRequirements.useCommitmentAggregation.test.d.ts +1 -0
- package/umd/src/book-components/_common/MenuHoisting/MenuHoistingContext.d.ts +0 -47
- package/umd/src/commitments/USE/aggregateUseCommitmentSystemMessages.d.ts +30 -0
- package/umd/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +3 -2
- package/umd/src/version.d.ts +1 -1
package/esm/index.es.js
CHANGED
|
@@ -18,7 +18,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
18
18
|
* @generated
|
|
19
19
|
* @see https://github.com/webgptorg/promptbook
|
|
20
20
|
*/
|
|
21
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-
|
|
21
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-27';
|
|
22
22
|
/**
|
|
23
23
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
24
24
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -26,45 +26,6 @@ export type HoistedMenuItem = {
|
|
|
26
26
|
*/
|
|
27
27
|
isActive?: boolean;
|
|
28
28
|
};
|
|
29
|
-
/**
|
|
30
|
-
* Shared actions provided to hoisted mobile menu-section renderers.
|
|
31
|
-
*
|
|
32
|
-
* @private mechanism inside Promptbook
|
|
33
|
-
*/
|
|
34
|
-
export type HoistedMobileMenuSectionRenderOptions = {
|
|
35
|
-
/**
|
|
36
|
-
* Closes the owning mobile header menu.
|
|
37
|
-
*/
|
|
38
|
-
readonly closeMenu: () => void;
|
|
39
|
-
};
|
|
40
|
-
/**
|
|
41
|
-
* Mobile-only section hoisted into the shared application menu.
|
|
42
|
-
*
|
|
43
|
-
* @private mechanism inside Promptbook
|
|
44
|
-
*/
|
|
45
|
-
export type HoistedMobileMenuSection = {
|
|
46
|
-
/**
|
|
47
|
-
* Stable identifier used to preserve section open state.
|
|
48
|
-
*/
|
|
49
|
-
readonly key: string;
|
|
50
|
-
/**
|
|
51
|
-
* Visible section label rendered by the mobile menu.
|
|
52
|
-
*/
|
|
53
|
-
readonly label: ReactNode;
|
|
54
|
-
/**
|
|
55
|
-
* Whether the section should start expanded whenever the menu opens.
|
|
56
|
-
*/
|
|
57
|
-
readonly isDefaultOpen?: boolean;
|
|
58
|
-
/**
|
|
59
|
-
* Lazily renders section content inside the mobile header menu.
|
|
60
|
-
*/
|
|
61
|
-
readonly renderContent: (options: HoistedMobileMenuSectionRenderOptions) => ReactNode;
|
|
62
|
-
};
|
|
63
|
-
/**
|
|
64
|
-
* Value exposed through the shared menu-hoisting context.
|
|
65
|
-
*
|
|
66
|
-
* @private mechanism inside Promptbook
|
|
67
|
-
*/
|
|
68
29
|
type MenuHoistingContextType = {
|
|
69
30
|
/**
|
|
70
31
|
* The currently hoisted menu items
|
|
@@ -74,14 +35,6 @@ type MenuHoistingContextType = {
|
|
|
74
35
|
* Set the hoisted menu items
|
|
75
36
|
*/
|
|
76
37
|
setMenu: (items: HoistedMenuItem[]) => void;
|
|
77
|
-
/**
|
|
78
|
-
* Mobile-only sections hoisted into the shared application menu.
|
|
79
|
-
*/
|
|
80
|
-
mobileMenuSections: HoistedMobileMenuSection[];
|
|
81
|
-
/**
|
|
82
|
-
* Sets the mobile-only hoisted menu sections.
|
|
83
|
-
*/
|
|
84
|
-
setMobileMenuSections: (sections: HoistedMobileMenuSection[]) => void;
|
|
85
38
|
};
|
|
86
39
|
/**
|
|
87
40
|
* Provider for menu hoisting
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
|
|
2
|
+
import type { ParsedCommitment } from '../_base/ParsedCommitment';
|
|
3
|
+
/**
|
|
4
|
+
* `USE` commitment types whose system-message sections are aggregated after the
|
|
5
|
+
* commitment-by-commitment application step.
|
|
6
|
+
*
|
|
7
|
+
* @private internal utility of `createAgentModelRequirementsWithCommitments`
|
|
8
|
+
*/
|
|
9
|
+
type AggregatedUseCommitmentType = 'USE BROWSER' | 'USE SEARCH ENGINE' | 'USE TIME';
|
|
10
|
+
/**
|
|
11
|
+
* Adds the placeholder for an aggregated `USE` system-message section only once, preserving the section position from the first occurrence.
|
|
12
|
+
*
|
|
13
|
+
* @param requirements - Current model requirements.
|
|
14
|
+
* @param type - Aggregated `USE` commitment type being applied.
|
|
15
|
+
* @returns Requirements with the placeholder inserted when it was not already present.
|
|
16
|
+
* @private internal utility of `USE` commitments
|
|
17
|
+
*/
|
|
18
|
+
export declare function appendAggregatedUseCommitmentPlaceholder(requirements: AgentModelRequirements, type: AggregatedUseCommitmentType): AgentModelRequirements;
|
|
19
|
+
/**
|
|
20
|
+
* Replaces temporary `USE` placeholders with one aggregated system-message block per commitment type.
|
|
21
|
+
*
|
|
22
|
+
* Distinct additional-instruction blocks are merged in stable source order while the hard-coded section is emitted only once.
|
|
23
|
+
*
|
|
24
|
+
* @param requirements - Model requirements produced by commitment-by-commitment application.
|
|
25
|
+
* @param commitments - Filtered commitments in their original source order.
|
|
26
|
+
* @returns Requirements with aggregated `USE` system-message sections.
|
|
27
|
+
* @private internal utility of `createAgentModelRequirementsWithCommitments`
|
|
28
|
+
*/
|
|
29
|
+
export declare function aggregateUseCommitmentSystemMessages(requirements: AgentModelRequirements, commitments: ReadonlyArray<ParsedCommitment>): AgentModelRequirements;
|
|
30
|
+
export {};
|
|
@@ -12,13 +12,14 @@ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
|
12
12
|
* 1. One-shot URL fetching: Simple function to fetch and scrape URL content
|
|
13
13
|
* 2. Running browser: For complex tasks like scrolling, clicking, form filling, etc.
|
|
14
14
|
*
|
|
15
|
-
* The content following `USE BROWSER` is
|
|
15
|
+
* The content following `USE BROWSER` is an arbitrary text that the agent should know
|
|
16
|
+
* (e.g. browsing scope or preferred sources).
|
|
16
17
|
*
|
|
17
18
|
* Example usage in agent source:
|
|
18
19
|
*
|
|
19
20
|
* ```book
|
|
20
21
|
* USE BROWSER
|
|
21
|
-
* USE BROWSER
|
|
22
|
+
* USE BROWSER Prefer official documentation and source websites.
|
|
22
23
|
* ```
|
|
23
24
|
*
|
|
24
25
|
* @private [🪔] Maybe export the commitments through some package
|
package/esm/src/version.d.ts
CHANGED
|
@@ -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.112.0-
|
|
18
|
+
* It follows semantic versioning (e.g., `0.112.0-26`).
|
|
19
19
|
*
|
|
20
20
|
* @generated
|
|
21
21
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/javascript",
|
|
3
|
-
"version": "0.112.0-
|
|
3
|
+
"version": "0.112.0-27",
|
|
4
4
|
"description": "Promptbook: Turn your company's scattered knowledge into AI ready books",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"module": "./esm/index.es.js",
|
|
98
98
|
"typings": "./esm/typings/src/_packages/javascript.index.d.ts",
|
|
99
99
|
"peerDependencies": {
|
|
100
|
-
"@promptbook/core": "0.112.0-
|
|
100
|
+
"@promptbook/core": "0.112.0-27"
|
|
101
101
|
},
|
|
102
102
|
"dependencies": {
|
|
103
103
|
"crypto": "1.0.1",
|
package/umd/index.umd.js
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* @generated
|
|
23
23
|
* @see https://github.com/webgptorg/promptbook
|
|
24
24
|
*/
|
|
25
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-
|
|
25
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-27';
|
|
26
26
|
/**
|
|
27
27
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
28
28
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -26,45 +26,6 @@ export type HoistedMenuItem = {
|
|
|
26
26
|
*/
|
|
27
27
|
isActive?: boolean;
|
|
28
28
|
};
|
|
29
|
-
/**
|
|
30
|
-
* Shared actions provided to hoisted mobile menu-section renderers.
|
|
31
|
-
*
|
|
32
|
-
* @private mechanism inside Promptbook
|
|
33
|
-
*/
|
|
34
|
-
export type HoistedMobileMenuSectionRenderOptions = {
|
|
35
|
-
/**
|
|
36
|
-
* Closes the owning mobile header menu.
|
|
37
|
-
*/
|
|
38
|
-
readonly closeMenu: () => void;
|
|
39
|
-
};
|
|
40
|
-
/**
|
|
41
|
-
* Mobile-only section hoisted into the shared application menu.
|
|
42
|
-
*
|
|
43
|
-
* @private mechanism inside Promptbook
|
|
44
|
-
*/
|
|
45
|
-
export type HoistedMobileMenuSection = {
|
|
46
|
-
/**
|
|
47
|
-
* Stable identifier used to preserve section open state.
|
|
48
|
-
*/
|
|
49
|
-
readonly key: string;
|
|
50
|
-
/**
|
|
51
|
-
* Visible section label rendered by the mobile menu.
|
|
52
|
-
*/
|
|
53
|
-
readonly label: ReactNode;
|
|
54
|
-
/**
|
|
55
|
-
* Whether the section should start expanded whenever the menu opens.
|
|
56
|
-
*/
|
|
57
|
-
readonly isDefaultOpen?: boolean;
|
|
58
|
-
/**
|
|
59
|
-
* Lazily renders section content inside the mobile header menu.
|
|
60
|
-
*/
|
|
61
|
-
readonly renderContent: (options: HoistedMobileMenuSectionRenderOptions) => ReactNode;
|
|
62
|
-
};
|
|
63
|
-
/**
|
|
64
|
-
* Value exposed through the shared menu-hoisting context.
|
|
65
|
-
*
|
|
66
|
-
* @private mechanism inside Promptbook
|
|
67
|
-
*/
|
|
68
29
|
type MenuHoistingContextType = {
|
|
69
30
|
/**
|
|
70
31
|
* The currently hoisted menu items
|
|
@@ -74,14 +35,6 @@ type MenuHoistingContextType = {
|
|
|
74
35
|
* Set the hoisted menu items
|
|
75
36
|
*/
|
|
76
37
|
setMenu: (items: HoistedMenuItem[]) => void;
|
|
77
|
-
/**
|
|
78
|
-
* Mobile-only sections hoisted into the shared application menu.
|
|
79
|
-
*/
|
|
80
|
-
mobileMenuSections: HoistedMobileMenuSection[];
|
|
81
|
-
/**
|
|
82
|
-
* Sets the mobile-only hoisted menu sections.
|
|
83
|
-
*/
|
|
84
|
-
setMobileMenuSections: (sections: HoistedMobileMenuSection[]) => void;
|
|
85
38
|
};
|
|
86
39
|
/**
|
|
87
40
|
* Provider for menu hoisting
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
|
|
2
|
+
import type { ParsedCommitment } from '../_base/ParsedCommitment';
|
|
3
|
+
/**
|
|
4
|
+
* `USE` commitment types whose system-message sections are aggregated after the
|
|
5
|
+
* commitment-by-commitment application step.
|
|
6
|
+
*
|
|
7
|
+
* @private internal utility of `createAgentModelRequirementsWithCommitments`
|
|
8
|
+
*/
|
|
9
|
+
type AggregatedUseCommitmentType = 'USE BROWSER' | 'USE SEARCH ENGINE' | 'USE TIME';
|
|
10
|
+
/**
|
|
11
|
+
* Adds the placeholder for an aggregated `USE` system-message section only once, preserving the section position from the first occurrence.
|
|
12
|
+
*
|
|
13
|
+
* @param requirements - Current model requirements.
|
|
14
|
+
* @param type - Aggregated `USE` commitment type being applied.
|
|
15
|
+
* @returns Requirements with the placeholder inserted when it was not already present.
|
|
16
|
+
* @private internal utility of `USE` commitments
|
|
17
|
+
*/
|
|
18
|
+
export declare function appendAggregatedUseCommitmentPlaceholder(requirements: AgentModelRequirements, type: AggregatedUseCommitmentType): AgentModelRequirements;
|
|
19
|
+
/**
|
|
20
|
+
* Replaces temporary `USE` placeholders with one aggregated system-message block per commitment type.
|
|
21
|
+
*
|
|
22
|
+
* Distinct additional-instruction blocks are merged in stable source order while the hard-coded section is emitted only once.
|
|
23
|
+
*
|
|
24
|
+
* @param requirements - Model requirements produced by commitment-by-commitment application.
|
|
25
|
+
* @param commitments - Filtered commitments in their original source order.
|
|
26
|
+
* @returns Requirements with aggregated `USE` system-message sections.
|
|
27
|
+
* @private internal utility of `createAgentModelRequirementsWithCommitments`
|
|
28
|
+
*/
|
|
29
|
+
export declare function aggregateUseCommitmentSystemMessages(requirements: AgentModelRequirements, commitments: ReadonlyArray<ParsedCommitment>): AgentModelRequirements;
|
|
30
|
+
export {};
|
|
@@ -12,13 +12,14 @@ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
|
12
12
|
* 1. One-shot URL fetching: Simple function to fetch and scrape URL content
|
|
13
13
|
* 2. Running browser: For complex tasks like scrolling, clicking, form filling, etc.
|
|
14
14
|
*
|
|
15
|
-
* The content following `USE BROWSER` is
|
|
15
|
+
* The content following `USE BROWSER` is an arbitrary text that the agent should know
|
|
16
|
+
* (e.g. browsing scope or preferred sources).
|
|
16
17
|
*
|
|
17
18
|
* Example usage in agent source:
|
|
18
19
|
*
|
|
19
20
|
* ```book
|
|
20
21
|
* USE BROWSER
|
|
21
|
-
* USE BROWSER
|
|
22
|
+
* USE BROWSER Prefer official documentation and source websites.
|
|
22
23
|
* ```
|
|
23
24
|
*
|
|
24
25
|
* @private [🪔] Maybe export the commitments through some package
|
package/umd/src/version.d.ts
CHANGED
|
@@ -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.112.0-
|
|
18
|
+
* It follows semantic versioning (e.g., `0.112.0-26`).
|
|
19
19
|
*
|
|
20
20
|
* @generated
|
|
21
21
|
*/
|