@promptbook/javascript 0.111.0-0 → 0.111.0-1
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/book-components/Chat/hooks/useChatActionsOverlap.d.ts +6 -0
- package/esm/typings/src/commitments/USE_IMAGE_GENERATOR/USE_IMAGE_GENERATOR.d.ts +3 -12
- package/esm/typings/src/utils/knowledge/simplifyKnowledgeLabel.d.ts +20 -0
- package/esm/typings/src/utils/knowledge/simplifyKnowledgeLabel.test.d.ts +1 -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
|
@@ -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.111.0-
|
|
21
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.111.0-1';
|
|
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
|
|
@@ -17,6 +17,12 @@ export type ChatActionsOverlapConfig = {
|
|
|
17
17
|
* Selector used to locate message elements for overlap checks.
|
|
18
18
|
*/
|
|
19
19
|
messageSelector: string;
|
|
20
|
+
/**
|
|
21
|
+
* Optional selector for the actual message content region used for overlap checks.
|
|
22
|
+
*
|
|
23
|
+
* When not provided or when no matching element is found, the full message element is used.
|
|
24
|
+
*/
|
|
25
|
+
messageCollisionSelector?: string;
|
|
20
26
|
/**
|
|
21
27
|
* Messages used to trigger overlap recalculation.
|
|
22
28
|
*/
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { string_javascript_name } from '../../_packages/types.index';
|
|
2
1
|
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
|
|
3
|
-
import { ToolFunction } from '../../scripting/javascript/JavascriptExecutionToolsOptions';
|
|
4
2
|
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
5
3
|
/**
|
|
6
4
|
* USE IMAGE GENERATOR commitment definition
|
|
7
5
|
*
|
|
8
|
-
* The `USE IMAGE GENERATOR` commitment indicates that the agent
|
|
9
|
-
*
|
|
6
|
+
* The `USE IMAGE GENERATOR` commitment indicates that the agent can output
|
|
7
|
+
* markdown placeholders for UI-driven image generation.
|
|
10
8
|
*
|
|
11
9
|
* Example usage in agent source:
|
|
12
10
|
*
|
|
@@ -19,6 +17,7 @@ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
|
19
17
|
*/
|
|
20
18
|
export declare class UseImageGeneratorCommitmentDefinition extends BaseCommitmentDefinition<'USE IMAGE GENERATOR' | 'USE IMAGE GENERATION' | 'IMAGE GENERATOR' | 'IMAGE GENERATION' | 'USE IMAGE'> {
|
|
21
19
|
constructor(type?: 'USE IMAGE GENERATOR' | 'USE IMAGE GENERATION' | 'IMAGE GENERATOR' | 'IMAGE GENERATION' | 'USE IMAGE');
|
|
20
|
+
get requiresContent(): boolean;
|
|
22
21
|
/**
|
|
23
22
|
* Short one-line description of USE IMAGE GENERATOR.
|
|
24
23
|
*/
|
|
@@ -32,14 +31,6 @@ export declare class UseImageGeneratorCommitmentDefinition extends BaseCommitmen
|
|
|
32
31
|
*/
|
|
33
32
|
get documentation(): string;
|
|
34
33
|
applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
|
|
35
|
-
/**
|
|
36
|
-
* Gets human-readable titles for tool functions provided by this commitment.
|
|
37
|
-
*/
|
|
38
|
-
getToolTitles(): Record<string_javascript_name, string>;
|
|
39
|
-
/**
|
|
40
|
-
* Gets the `generate_image` tool function implementation.
|
|
41
|
-
*/
|
|
42
|
-
getToolFunctions(): Record<string_javascript_name, ToolFunction>;
|
|
43
34
|
}
|
|
44
35
|
/**
|
|
45
36
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simplifies knowledge labels for UI chips by:
|
|
3
|
+
* - extracting filename from URL/path-like values,
|
|
4
|
+
* - removing extension,
|
|
5
|
+
* - removing trailing random ID segment when detected,
|
|
6
|
+
* - truncating to 20 characters with ellipsis.
|
|
7
|
+
*
|
|
8
|
+
* @param label - Raw knowledge label or source value.
|
|
9
|
+
* @returns Display-friendly chip label.
|
|
10
|
+
* @private utility of knowledge/source chip rendering
|
|
11
|
+
*/
|
|
12
|
+
export declare function simplifyKnowledgeLabel(label: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* Heuristic that classifies a short text as human-readable, identifier-like, or unknown.
|
|
15
|
+
*
|
|
16
|
+
* @param text - Candidate value (typically a filename segment).
|
|
17
|
+
* @returns `'HUMAN'`, `'ID'`, or `'UNKNOWN'`.
|
|
18
|
+
* @private utility of knowledge/source chip rendering
|
|
19
|
+
*/
|
|
20
|
+
export declare function isHumanOrID(text: string): 'HUMAN' | 'ID' | 'UNKNOWN';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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.
|
|
18
|
+
* It follows semantic versioning (e.g., `0.111.0-0`).
|
|
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.111.0-
|
|
3
|
+
"version": "0.111.0-1",
|
|
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.111.0-
|
|
100
|
+
"@promptbook/core": "0.111.0-1"
|
|
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.111.0-
|
|
25
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.111.0-1';
|
|
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
|