@promptbook/vercel 0.103.0-23 → 0.103.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 CHANGED
@@ -16,7 +16,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
16
16
  * @generated
17
17
  * @see https://github.com/webgptorg/promptbook
18
18
  */
19
- const PROMPTBOOK_ENGINE_VERSION = '0.103.0-23';
19
+ const PROMPTBOOK_ENGINE_VERSION = '0.103.0-27';
20
20
  /**
21
21
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
22
22
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -30,6 +30,8 @@ import { _PdfScraperRegistration } from '../scrapers/pdf/register-constructor';
30
30
  import { _PdfScraperMetadataRegistration } from '../scrapers/pdf/register-metadata';
31
31
  import { _WebsiteScraperRegistration } from '../scrapers/website/register-constructor';
32
32
  import { _WebsiteScraperMetadataRegistration } from '../scrapers/website/register-metadata';
33
+ import { _LangchainTranspilerRegistration } from '../transpilers/langchain/register';
34
+ import { _OpenAiSdkTranspilerRegistration } from '../transpilers/openai/register';
33
35
  export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
34
36
  export { _CLI };
35
37
  export { _AnthropicClaudeMetadataRegistration };
@@ -62,3 +64,5 @@ export { _PdfScraperRegistration };
62
64
  export { _PdfScraperMetadataRegistration };
63
65
  export { _WebsiteScraperRegistration };
64
66
  export { _WebsiteScraperMetadataRegistration };
67
+ export { _LangchainTranspilerRegistration };
68
+ export { _OpenAiSdkTranspilerRegistration };
@@ -171,6 +171,7 @@ import { _WebsiteScraperMetadataRegistration } from '../scrapers/website/registe
171
171
  import { BlackholeStorage } from '../storage/blackhole/BlackholeStorage';
172
172
  import { MemoryStorage } from '../storage/memory/MemoryStorage';
173
173
  import { PrefixStorage } from '../storage/utils/PrefixStorage';
174
+ import { $bookTranspilersRegister } from '../transpilers/_common/register/$bookTranspilersRegister';
174
175
  import { MODEL_VARIANTS } from '../types/ModelVariant';
175
176
  import { NonTaskSectionTypes } from '../types/SectionType';
176
177
  import { SectionTypes } from '../types/SectionType';
@@ -349,6 +350,7 @@ export { _WebsiteScraperMetadataRegistration };
349
350
  export { BlackholeStorage };
350
351
  export { MemoryStorage };
351
352
  export { PrefixStorage };
353
+ export { $bookTranspilersRegister };
352
354
  export { MODEL_VARIANTS };
353
355
  export { NonTaskSectionTypes };
354
356
  export { SectionTypes };
@@ -167,6 +167,9 @@ import type { PostprocessingFunction } from '../scripting/javascript/JavascriptE
167
167
  import type { PromptbookStorage } from '../storage/_common/PromptbookStorage';
168
168
  import type { FileCacheStorageOptions } from '../storage/file-cache-storage/FileCacheStorageOptions';
169
169
  import type { IndexedDbStorageOptions } from '../storage/local-storage/utils/IndexedDbStorageOptions';
170
+ import type { BookTranspiler } from '../transpilers/_common/BookTranspiler';
171
+ import type { BookTranspilerDefinition } from '../transpilers/_common/BookTranspilerDefinition';
172
+ import type { BookTranspilerOptions } from '../transpilers/_common/BookTranspilerOptions';
170
173
  import type { IntermediateFilesStrategy } from '../types/IntermediateFilesStrategy';
171
174
  import type { ModelRequirements } from '../types/ModelRequirements';
172
175
  import type { CompletionModelRequirements } from '../types/ModelRequirements';
@@ -501,6 +504,9 @@ export type { PostprocessingFunction };
501
504
  export type { PromptbookStorage };
502
505
  export type { FileCacheStorageOptions };
503
506
  export type { IndexedDbStorageOptions };
507
+ export type { BookTranspiler };
508
+ export type { BookTranspilerDefinition };
509
+ export type { BookTranspilerOptions };
504
510
  export type { IntermediateFilesStrategy };
505
511
  export type { ModelRequirements };
506
512
  export type { CompletionModelRequirements };
@@ -29,6 +29,8 @@ import { _PdfScraperRegistration } from '../scrapers/pdf/register-constructor';
29
29
  import { _PdfScraperMetadataRegistration } from '../scrapers/pdf/register-metadata';
30
30
  import { _WebsiteScraperRegistration } from '../scrapers/website/register-constructor';
31
31
  import { _WebsiteScraperMetadataRegistration } from '../scrapers/website/register-metadata';
32
+ import { _LangchainTranspilerRegistration } from '../transpilers/langchain/register';
33
+ import { _OpenAiSdkTranspilerRegistration } from '../transpilers/openai/register';
32
34
  import { wizard } from '../wizard/wizard';
33
35
  export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
34
36
  export { _AnthropicClaudeMetadataRegistration };
@@ -61,4 +63,6 @@ export { _PdfScraperRegistration };
61
63
  export { _PdfScraperMetadataRegistration };
62
64
  export { _WebsiteScraperRegistration };
63
65
  export { _WebsiteScraperMetadataRegistration };
66
+ export { _LangchainTranspilerRegistration };
67
+ export { _OpenAiSdkTranspilerRegistration };
64
68
  export { wizard };
@@ -42,6 +42,11 @@ export type MockedChatDelayConfig = {
42
42
  * If true, disables typing effect and shows full message at once (BLOCKY_FLOW)
43
43
  */
44
44
  blocky?: boolean;
45
+ /**
46
+ * This prop will allow to show N first messages immediately, while the rest will be typed out with delays
47
+ * @default 0
48
+ */
49
+ showIntermediateMessages?: number;
45
50
  };
46
51
  /**
47
52
  * Props for MockedChat component
@@ -0,0 +1,19 @@
1
+ import type { BookTranspilerOptions } from './BookTranspilerOptions';
2
+ /**
3
+ * Transpiler takes a book and transpiles it into another format.
4
+ */
5
+ export type BookTranspiler =
6
+ /**
7
+ * Transpiles a book.
8
+ *
9
+ * @param book book to transpile
10
+ * @param options additional options for the transpiler
11
+ * @returns transpiled book
12
+ */
13
+ (book: string, options: BookTranspilerOptions) => Promise<string>;
14
+ /**
15
+ * TODO: [🧠] Should there be a BookTranspiler class or just a function?
16
+ * Maybe a class with a constructor that takes ExecutionTools.
17
+ * Then the instance would be a function.
18
+ * @see LlmExecutionTools
19
+ */
@@ -0,0 +1,37 @@
1
+ import type { ExecutionTools } from '../../execution/ExecutionTools';
2
+ import type { string_name, string_title } from '../../types/typeAliases';
3
+ import type { Registered } from '../../utils/misc/$Register';
4
+ import type { BookTranspiler } from './BookTranspiler';
5
+ /**
6
+ * Definition of a book transpiler.
7
+ *
8
+ * @see https://github.com/webgptorg/promptbook/issues/249
9
+ */
10
+ export type BookTranspilerDefinition = Registered & {
11
+ /**
12
+ * The name of the transpiler.
13
+ * It is used to identify the transpiler in the register.
14
+ *
15
+ * @example 'python-langchain'
16
+ */
17
+ readonly name: string_name;
18
+ /**
19
+ * The title of the transpiler.
20
+ * It is used to display the transpiler in the UI.
21
+ *
22
+ * @example 'Python Langchain'
23
+ */
24
+ readonly title: string_title;
25
+ /**
26
+ * The factory function to create a transpiler instance.
27
+ * It can be async.
28
+ *
29
+ * @param tools the execution tools that can be used by the transpiler
30
+ * @returns the transpiler instance
31
+ */
32
+ readonly new: (tools: ExecutionTools) => BookTranspiler | Promise<BookTranspiler>;
33
+ };
34
+ /**
35
+ * TODO: [🧠] What other information should be in the public profile of the transpiler?
36
+ * - input format, output format, version, description, icon, etc.
37
+ */
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Options for the BookTranspiler.
3
+ *
4
+ * @see https://github.com/webgptorg/promptbook/issues/249
5
+ */
6
+ export type BookTranspilerOptions = {
7
+ /**
8
+ * If true, the transpiler will log verbose information to the console.
9
+ *
10
+ * @default false
11
+ */
12
+ readonly isVerbose?: boolean;
13
+ /**
14
+ * If true, the transpiler will include comments in the output.
15
+ *
16
+ * @default true
17
+ */
18
+ readonly shouldIncludeComments?: boolean;
19
+ };
@@ -0,0 +1,15 @@
1
+ import { $Register } from '../../../utils/misc/$Register';
2
+ import type { BookTranspilerDefinition } from '../BookTranspilerDefinition';
3
+ /**
4
+ * Register for book transpilers.
5
+ *
6
+ * Note: `$` is used to indicate that this interacts with the global scope
7
+ * @singleton Only one instance of each register is created per build, but there can be more instances across different builds or environments.
8
+ * @see https://github.com/webgptorg/promptbook/issues/249
9
+ *
10
+ * @public exported from `@promptbook/core`
11
+ */
12
+ export declare const $bookTranspilersRegister: $Register<BookTranspilerDefinition>;
13
+ /**
14
+ * TODO: [®] DRY Register logic
15
+ */
@@ -0,0 +1,7 @@
1
+ import type { BookTranspilerDefinition } from '../_common/BookTranspilerDefinition';
2
+ /**
3
+ * Transpiler to Python code using LangChain library.
4
+ *
5
+ * @private TODO: !!!! Which package should export this?
6
+ */
7
+ export declare const LangchainTranspiler: BookTranspilerDefinition;
@@ -0,0 +1,15 @@
1
+ import { Registration } from '../../_packages/types.index';
2
+ /**
3
+ * Registration of LLM provider
4
+ *
5
+ * Warning: This is not useful for the end user, it is just a side effect of the mechanism that handles all available LLM tools
6
+ *
7
+ * @public exported from `@promptbook/wizard`
8
+ * @public exported from `@promptbook/cli`
9
+ *
10
+ * TODO: !!!! Which package should export this?
11
+ */
12
+ export declare const _LangchainTranspilerRegistration: Registration;
13
+ /**
14
+ * Note: [💞] Ignore a discrepancy between file name and entity name
15
+ */
@@ -0,0 +1,13 @@
1
+ import type { BookTranspilerDefinition } from '../_common/BookTranspilerDefinition';
2
+ /**
3
+ * Transpiler to Javascript code using OpenAI SDK.
4
+ *
5
+ * @private TODO: !!!! Which package should export this?
6
+ */
7
+ export declare const OpenAiSdkTranspiler: BookTranspilerDefinition;
8
+ /**
9
+ * TODO: [🧠] What should be the scope of the transpiled code?
10
+ * - Just a single function?
11
+ * - A class?
12
+ * - A whole package?
13
+ */
@@ -0,0 +1,15 @@
1
+ import { Registration } from '../../_packages/types.index';
2
+ /**
3
+ * Registration of LLM provider
4
+ *
5
+ * Warning: This is not useful for the end user, it is just a side effect of the mechanism that handles all available LLM tools
6
+ *
7
+ * @public exported from `@promptbook/wizard`
8
+ * @public exported from `@promptbook/cli`
9
+ *
10
+ * TODO: !!!! Which package should export this?
11
+ */
12
+ export declare const _OpenAiSdkTranspilerRegistration: Registration;
13
+ /**
14
+ * Note: [💞] Ignore a discrepancy between file name and entity name
15
+ */
@@ -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.103.0-22`).
18
+ * It follows semantic versioning (e.g., `0.103.0-26`).
19
19
  *
20
20
  * @generated
21
21
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/vercel",
3
- "version": "0.103.0-23",
3
+ "version": "0.103.0-27",
4
4
  "description": "Promptbook: Turn your company's scattered knowledge into AI ready books",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -94,11 +94,11 @@
94
94
  "module": "./esm/index.es.js",
95
95
  "typings": "./esm/typings/src/_packages/vercel.index.d.ts",
96
96
  "peerDependencies": {
97
- "@promptbook/core": "0.103.0-23"
97
+ "@promptbook/core": "0.103.0-27"
98
98
  },
99
99
  "dependencies": {
100
100
  "colors": "1.4.0",
101
101
  "crypto": "1.0.1",
102
- "spacetrim": "0.11.59"
102
+ "spacetrim": "0.11.60"
103
103
  }
104
104
  }
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.103.0-23';
26
+ const PROMPTBOOK_ENGINE_VERSION = '0.103.0-27';
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