@promptbook/remote-client 0.100.1 → 0.100.3-0
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/README.md +4 -0
- package/esm/index.es.js +14 -7
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/book-2.0/agent-source/parseAgentSource.d.ts +2 -2
- package/esm/typings/src/book-2.0/commitments/_base/CommitmentDefinition.d.ts +2 -2
- package/esm/typings/src/book-2.0/commitments/_misc/AgentModelRequirements.d.ts +2 -2
- package/esm/typings/src/book-2.0/commitments/_misc/AgentSourceParseResult.d.ts +2 -2
- package/esm/typings/src/book-2.0/commitments/_misc/ParsedCommitment.d.ts +2 -2
- package/esm/typings/src/execution/utils/validatePromptResult.d.ts +4 -4
- package/esm/typings/src/utils/take/interfaces/ITakeChain.d.ts +2 -2
- package/esm/typings/src/utils/validators/filePath/isValidFilePath.d.ts +1 -1
- package/esm/typings/src/version.d.ts +1 -1
- package/esm/typings/src/wizard/wizard.d.ts +2 -2
- package/package.json +2 -2
- package/umd/index.umd.js +14 -7
- package/umd/index.umd.js.map +1 -1
package/README.md
CHANGED
|
@@ -29,6 +29,10 @@ Write AI applications using plain human language across multiple models and plat
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
|
+
<blockquote style="color: #ff8811">
|
|
33
|
+
<b>⚠ Warning:</b> This is a pre-release version of the library. It is not yet ready for production use. Please look at <a href="https://www.npmjs.com/package/@promptbook/core?activeTab=versions">latest stable release</a>.
|
|
34
|
+
</blockquote>
|
|
35
|
+
|
|
32
36
|
## 📦 Package `@promptbook/remote-client`
|
|
33
37
|
|
|
34
38
|
- Promptbooks are [divided into several](#-packages) packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
|
package/esm/index.es.js
CHANGED
|
@@ -20,7 +20,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
|
|
|
20
20
|
* @generated
|
|
21
21
|
* @see https://github.com/webgptorg/promptbook
|
|
22
22
|
*/
|
|
23
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.100.
|
|
23
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.100.3-0';
|
|
24
24
|
/**
|
|
25
25
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
26
26
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -707,7 +707,7 @@ const SectionTypes = [
|
|
|
707
707
|
];
|
|
708
708
|
|
|
709
709
|
/**
|
|
710
|
-
* Tests if given string is valid
|
|
710
|
+
* Tests if given string is valid file path.
|
|
711
711
|
*
|
|
712
712
|
* Note: This does not check if the file exists only if the path is valid
|
|
713
713
|
* @public exported from `@promptbook/utils`
|
|
@@ -719,18 +719,25 @@ function isValidFilePath(filename) {
|
|
|
719
719
|
if (filename.split('\n').length > 1) {
|
|
720
720
|
return false;
|
|
721
721
|
}
|
|
722
|
-
|
|
723
|
-
|
|
722
|
+
// Normalize slashes early so heuristics can detect path-like inputs
|
|
723
|
+
const filenameSlashes = filename.replace(/\\/g, '/');
|
|
724
|
+
// Reject strings that look like sentences (informational text)
|
|
725
|
+
// Heuristic: contains multiple spaces and ends with a period, or contains typical sentence punctuation
|
|
726
|
+
// But skip this heuristic if the string looks like a path (contains '/' or starts with a drive letter)
|
|
727
|
+
if (filename.trim().length > 60 && // long enough to be a sentence
|
|
728
|
+
/[.!?]/.test(filename) && // contains sentence punctuation
|
|
729
|
+
filename.split(' ').length > 8 && // has many words
|
|
730
|
+
!/\/|^[A-Z]:/i.test(filenameSlashes) // do NOT treat as sentence if looks like a path
|
|
731
|
+
) {
|
|
724
732
|
return false;
|
|
725
733
|
}
|
|
726
|
-
const filenameSlashes = filename.split('\\').join('/');
|
|
727
734
|
// Absolute Unix path: /hello.txt
|
|
728
735
|
if (/^(\/)/i.test(filenameSlashes)) {
|
|
729
736
|
// console.log(filename, 'Absolute Unix path: /hello.txt');
|
|
730
737
|
return true;
|
|
731
738
|
}
|
|
732
|
-
// Absolute Windows path:
|
|
733
|
-
if (/^
|
|
739
|
+
// Absolute Windows path: C:/ or C:\ (allow spaces and multiple dots in filename)
|
|
740
|
+
if (/^[A-Z]:\/.+$/i.test(filenameSlashes)) {
|
|
734
741
|
// console.log(filename, 'Absolute Windows path: /hello.txt');
|
|
735
742
|
return true;
|
|
736
743
|
}
|