@promptbook/wizard 0.101.0-20 β†’ 0.101.0-21

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.
Files changed (51) hide show
  1. package/esm/index.es.js +95 -77
  2. package/esm/index.es.js.map +1 -1
  3. package/esm/typings/src/book-2.0/commitments/ACTION/ACTION.d.ts +0 -12
  4. package/esm/typings/src/book-2.0/commitments/DELETE/DELETE.d.ts +0 -24
  5. package/esm/typings/src/book-2.0/commitments/FORMAT/FORMAT.d.ts +0 -12
  6. package/esm/typings/src/book-2.0/commitments/GOAL/GOAL.d.ts +0 -12
  7. package/esm/typings/src/book-2.0/commitments/KNOWLEDGE/KNOWLEDGE.d.ts +0 -6
  8. package/esm/typings/src/book-2.0/commitments/MEMORY/MEMORY.d.ts +0 -12
  9. package/esm/typings/src/book-2.0/commitments/MESSAGE/MESSAGE.d.ts +0 -12
  10. package/esm/typings/src/book-2.0/commitments/META/META.d.ts +0 -6
  11. package/esm/typings/src/book-2.0/commitments/META_IMAGE/META_IMAGE.d.ts +0 -6
  12. package/esm/typings/src/book-2.0/commitments/META_LINK/META_LINK.d.ts +0 -6
  13. package/esm/typings/src/book-2.0/commitments/MODEL/MODEL.d.ts +0 -12
  14. package/esm/typings/src/book-2.0/commitments/NOTE/NOTE.d.ts +0 -24
  15. package/esm/typings/src/book-2.0/commitments/PERSONA/PERSONA.d.ts +0 -12
  16. package/esm/typings/src/book-2.0/commitments/RULE/RULE.d.ts +0 -12
  17. package/esm/typings/src/book-2.0/commitments/SAMPLE/SAMPLE.d.ts +0 -12
  18. package/esm/typings/src/book-2.0/commitments/SCENARIO/SCENARIO.d.ts +0 -12
  19. package/esm/typings/src/book-2.0/commitments/STYLE/STYLE.d.ts +0 -12
  20. package/esm/typings/src/book-2.0/commitments/_base/createEmptyAgentModelRequirements.d.ts +1 -1
  21. package/esm/typings/src/book-components/AvatarProfile/AvatarChip/AvatarChip.d.ts +3 -0
  22. package/esm/typings/src/book-components/AvatarProfile/AvatarProfile/AvatarProfile.d.ts +3 -0
  23. package/esm/typings/src/book-components/BookEditor/BookEditor.d.ts +3 -0
  24. package/esm/typings/src/book-components/BookEditor/BookEditorInner.d.ts +2 -16
  25. package/esm/typings/src/book-components/Chat/Chat/ChatProps.d.ts +3 -0
  26. package/esm/typings/src/execution/PromptResult.d.ts +2 -4
  27. package/esm/typings/src/llm-providers/_multiple/MultipleLlmExecutionTools.d.ts +2 -5
  28. package/esm/typings/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +6 -2
  29. package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +3 -8
  30. package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +4 -5
  31. package/esm/typings/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +2 -5
  32. package/esm/typings/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +2 -0
  33. package/esm/typings/src/llm-providers/mocked/test/joker.test.d.ts +4 -0
  34. package/esm/typings/src/llm-providers/mocked/test/mocked-chat.test.d.ts +5 -0
  35. package/esm/typings/src/llm-providers/mocked/test/mocked-completion.test.d.ts +4 -0
  36. package/esm/typings/src/llm-providers/ollama/OllamaExecutionTools.d.ts +3 -3
  37. package/esm/typings/src/llm-providers/openai/OpenAiCompatibleExecutionTools.d.ts +1 -0
  38. package/esm/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +3 -8
  39. package/esm/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +5 -14
  40. package/esm/typings/src/scripting/_test/postprocessing.test.d.ts +1 -0
  41. package/esm/typings/src/utils/markdown/humanizeAiText.d.ts +0 -1
  42. package/esm/typings/src/utils/markdown/promptbookifyAiText.d.ts +2 -2
  43. package/esm/typings/src/version.d.ts +1 -1
  44. package/package.json +2 -2
  45. package/umd/index.umd.js +95 -77
  46. package/umd/index.umd.js.map +1 -1
  47. package/esm/typings/src/book-components/Chat/examples/ChatMarkdownDemo.d.ts +0 -16
  48. package/esm/typings/src/expectations/drafts/isDomainNameFree.d.ts +0 -10
  49. package/esm/typings/src/expectations/drafts/isGithubNameFree.d.ts +0 -10
  50. package/esm/typings/src/llm-providers/_common/profiles/llmProviderProfiles.d.ts +0 -81
  51. /package/esm/typings/src/{llm-providers/_common/profiles/test/llmProviderProfiles.test.d.ts β†’ cli/test/ptbk.test.d.ts} +0 -0
@@ -1,15 +1,10 @@
1
+ import type { ChatParticipant } from '../../book-components/Chat/types/ChatParticipant';
1
2
  import type { AvailableModel } from '../../execution/AvailableModel';
2
3
  import type { LlmExecutionTools } from '../../execution/LlmExecutionTools';
3
- import type { ChatPromptResult } from '../../execution/PromptResult';
4
- import type { CompletionPromptResult } from '../../execution/PromptResult';
5
- import type { EmbeddingPromptResult } from '../../execution/PromptResult';
4
+ import type { ChatPromptResult, CompletionPromptResult, EmbeddingPromptResult } from '../../execution/PromptResult';
6
5
  import type { RemoteClientOptions } from '../../remote-server/types/RemoteClientOptions';
7
- import type { ChatPrompt } from '../../types/Prompt';
8
- import type { CompletionPrompt } from '../../types/Prompt';
9
- import type { EmbeddingPrompt } from '../../types/Prompt';
10
- import type { string_markdown } from '../../types/typeAliases';
11
- import type { string_markdown_text } from '../../types/typeAliases';
12
- import type { string_title } from '../../types/typeAliases';
6
+ import type { ChatPrompt, CompletionPrompt, EmbeddingPrompt } from '../../types/Prompt';
7
+ import type { string_markdown, string_markdown_text, string_title } from '../../types/typeAliases';
13
8
  /**
14
9
  * Remote server is a proxy server that uses its execution tools internally and exposes the executor interface externally.
15
10
  *
@@ -24,11 +19,7 @@ export declare class RemoteLlmExecutionTools<TCustomOptions = undefined> impleme
24
19
  constructor(options: RemoteClientOptions<TCustomOptions>);
25
20
  get title(): string_title & string_markdown_text;
26
21
  get description(): string_markdown;
27
- get profile(): {
28
- name: string;
29
- fullname: string;
30
- color: string;
31
- };
22
+ get profile(): ChatParticipant;
32
23
  /**
33
24
  * Check the configuration of all execution tools
34
25
  */
@@ -10,5 +10,4 @@ import { string_markdown } from '../../types/typeAliases';
10
10
  export declare function humanizeAiText(aiText: string_markdown): string_markdown;
11
11
  /**
12
12
  * TODO: [🧠] Maybe this should be exported from `@promptbook/utils` not `@promptbook/markdown-utils`
13
- * TODO: [πŸ…ΎοΈ] !!! Use this across the project where AI text is involved
14
13
  */
@@ -2,11 +2,11 @@ import { string_markdown } from '../../types/typeAliases';
2
2
  /**
3
3
  * Function `promptbookifyAiText` will slightly modify the text so we know it was processed by Promptbook
4
4
  *
5
+ * Note: [πŸ”‚] This function is idempotent.
6
+ *
5
7
  * @public exported from `@promptbook/markdown-utils`
6
8
  */
7
9
  export declare function promptbookifyAiText(text: string_markdown): string_markdown;
8
10
  /**
9
- * TODO: !!!!! Make the function idempotent and add "Note: [πŸ”‚] This function is idempotent."
10
- * TODO: [πŸ…ΎοΈ]!!! Use this across the project where AI text is involved
11
11
  * TODO: [🧠][✌️] Make some Promptbook-native token system
12
12
  */
@@ -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-19`).
18
+ * It follows semantic versioning (e.g., `0.101.0-20`).
19
19
  *
20
20
  * @generated
21
21
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/wizard",
3
- "version": "0.101.0-20",
3
+ "version": "0.101.0-21",
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/wizard.index.d.ts",
97
97
  "peerDependencies": {
98
- "@promptbook/core": "0.101.0-20"
98
+ "@promptbook/core": "0.101.0-21"
99
99
  },
100
100
  "dependencies": {
101
101
  "@ai-sdk/deepseek": "0.1.6",
package/umd/index.umd.js CHANGED
@@ -48,7 +48,7 @@
48
48
  * @generated
49
49
  * @see https://github.com/webgptorg/promptbook
50
50
  */
51
- const PROMPTBOOK_ENGINE_VERSION = '0.101.0-20';
51
+ const PROMPTBOOK_ENGINE_VERSION = '0.101.0-21';
52
52
  /**
53
53
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
54
54
  * Note: [πŸ’ž] Ignore a discrepancy between file name and entity name
@@ -1349,76 +1349,6 @@
1349
1349
  return deserializedError;
1350
1350
  }
1351
1351
 
1352
- /**
1353
- * Predefined profiles for LLM providers to maintain consistency across the application
1354
- * These profiles represent each provider as a virtual persona in chat interfaces
1355
- *
1356
- * @private !!!!
1357
- */
1358
- const LLM_PROVIDER_PROFILES = {
1359
- OPENAI: {
1360
- name: 'OPENAI',
1361
- fullname: 'OpenAI GPT',
1362
- color: '#10a37f', // OpenAI's signature green
1363
- // Note: avatarSrc could be added when we have provider logos available
1364
- },
1365
- ANTHROPIC: {
1366
- name: 'ANTHROPIC',
1367
- fullname: 'Anthropic Claude',
1368
- color: '#d97706', // Anthropic's orange/amber color
1369
- },
1370
- AZURE_OPENAI: {
1371
- name: 'AZURE_OPENAI',
1372
- fullname: 'Azure OpenAI',
1373
- color: '#0078d4', // Microsoft Azure blue
1374
- },
1375
- GOOGLE: {
1376
- name: 'GOOGLE',
1377
- fullname: 'Google Gemini',
1378
- color: '#4285f4', // Google blue
1379
- },
1380
- DEEPSEEK: {
1381
- name: 'DEEPSEEK',
1382
- fullname: 'DeepSeek',
1383
- color: '#7c3aed', // Purple color for DeepSeek
1384
- },
1385
- OLLAMA: {
1386
- name: 'OLLAMA',
1387
- fullname: 'Ollama',
1388
- color: '#059669', // Emerald green for local models
1389
- },
1390
- REMOTE: {
1391
- name: 'REMOTE',
1392
- fullname: 'Remote Server',
1393
- color: '#6b7280', // Gray for remote/proxy connections
1394
- },
1395
- MOCKED_ECHO: {
1396
- name: 'MOCKED_ECHO',
1397
- fullname: 'Echo (Test)',
1398
- color: '#8b5cf6', // Purple for test/mock tools
1399
- },
1400
- MOCKED_FAKE: {
1401
- name: 'MOCKED_FAKE',
1402
- fullname: 'Fake LLM (Test)',
1403
- color: '#ec4899', // Pink for fake/test tools
1404
- },
1405
- VERCEL: {
1406
- name: 'VERCEL',
1407
- fullname: 'Vercel AI',
1408
- color: '#000000', // Vercel's black
1409
- },
1410
- MULTIPLE: {
1411
- name: 'MULTIPLE',
1412
- fullname: 'Multiple Providers',
1413
- color: '#6366f1', // Indigo for combined/multiple providers
1414
- },
1415
- };
1416
- /**
1417
- * TODO: Refactor this - each profile must be alongside the provider definition
1418
- * TODO: [πŸ•›] Unite `AgentBasicInformation`, `ChatParticipant`, `LlmExecutionTools` + `LlmToolsMetadata`
1419
- * Note: [πŸ’ž] Ignore a discrepancy between file name and entity name
1420
- */
1421
-
1422
1352
  /**
1423
1353
  * Tests if given string is valid URL.
1424
1354
  *
@@ -1512,6 +1442,14 @@
1512
1442
  function keepUnused(...valuesToKeep) {
1513
1443
  }
1514
1444
 
1445
+ /**
1446
+ * Profile for Remote provider
1447
+ */
1448
+ const REMOTE_PROVIDER_PROFILE = {
1449
+ name: 'REMOTE',
1450
+ fullname: 'Remote Server',
1451
+ color: '#6b7280',
1452
+ };
1515
1453
  /**
1516
1454
  * Remote server is a proxy server that uses its execution tools internally and exposes the executor interface externally.
1517
1455
  *
@@ -1534,7 +1472,7 @@
1534
1472
  return `Models from Promptbook remote server ${this.options.remoteServerUrl}`;
1535
1473
  }
1536
1474
  get profile() {
1537
- return LLM_PROVIDER_PROFILES.REMOTE;
1475
+ return REMOTE_PROVIDER_PROFILE;
1538
1476
  }
1539
1477
  /**
1540
1478
  * Check the configuration of all execution tools
@@ -2507,6 +2445,14 @@
2507
2445
  * TODO: [🀝] DRY Maybe some common abstraction between `computeOpenAiUsage` and `computeAnthropicClaudeUsage`
2508
2446
  */
2509
2447
 
2448
+ /**
2449
+ * Profile for Anthropic Claude provider
2450
+ */
2451
+ const ANTHROPIC_PROVIDER_PROFILE = {
2452
+ name: 'ANTHROPIC',
2453
+ fullname: 'Anthropic Claude',
2454
+ color: '#d97706',
2455
+ };
2510
2456
  /**
2511
2457
  * Execution Tools for calling Anthropic Claude API.
2512
2458
  *
@@ -2535,7 +2481,7 @@
2535
2481
  return 'Use all models provided by Anthropic Claude';
2536
2482
  }
2537
2483
  get profile() {
2538
- return LLM_PROVIDER_PROFILES.ANTHROPIC;
2484
+ return ANTHROPIC_PROVIDER_PROFILE;
2539
2485
  }
2540
2486
  async getClient() {
2541
2487
  if (this.client === null) {
@@ -3390,6 +3336,14 @@
3390
3336
  * Note: [πŸ’ž] Ignore a discrepancy between file name and entity name
3391
3337
  */
3392
3338
 
3339
+ /**
3340
+ * Profile for Azure OpenAI provider
3341
+ */
3342
+ const AZURE_OPENAI_PROVIDER_PROFILE = {
3343
+ name: 'AZURE_OPENAI',
3344
+ fullname: 'Azure OpenAI',
3345
+ color: '#0078d4',
3346
+ };
3393
3347
  /**
3394
3348
  * Execution Tools for calling Azure OpenAI API.
3395
3349
  *
@@ -3418,6 +3372,9 @@
3418
3372
  get description() {
3419
3373
  return 'Use all models trained by OpenAI provided by Azure';
3420
3374
  }
3375
+ get profile() {
3376
+ return AZURE_OPENAI_PROVIDER_PROFILE;
3377
+ }
3421
3378
  async getClient() {
3422
3379
  if (this.client === null) {
3423
3380
  this.client = new openai.OpenAIClient(`https://${this.options.resourceName}.openai.azure.com/`, new openai.AzureKeyCredential(this.options.apiKey));
@@ -3815,6 +3772,14 @@
3815
3772
  }
3816
3773
  }
3817
3774
 
3775
+ /**
3776
+ * Profile for Vercel AI adapter
3777
+ */
3778
+ const VERCEL_PROVIDER_PROFILE = {
3779
+ name: 'VERCEL',
3780
+ fullname: 'Vercel AI',
3781
+ color: '#000000',
3782
+ };
3818
3783
  /**
3819
3784
  * Adapter which creates Promptbook execution tools from Vercel provider
3820
3785
  *
@@ -3837,6 +3802,7 @@
3837
3802
  return {
3838
3803
  title,
3839
3804
  description,
3805
+ profile: VERCEL_PROVIDER_PROFILE,
3840
3806
  checkConfiguration() {
3841
3807
  // Note: There is no way how to check configuration of Vercel provider
3842
3808
  return Promise.resolve();
@@ -4118,6 +4084,14 @@
4118
4084
  * Note: [πŸ’ž] Ignore a discrepancy between file name and entity name
4119
4085
  */
4120
4086
 
4087
+ /**
4088
+ * Profile for Deepseek provider
4089
+ */
4090
+ const DEEPSEEK_PROVIDER_PROFILE = {
4091
+ name: 'DEEPSEEK',
4092
+ fullname: 'DeepSeek',
4093
+ color: '#7c3aed',
4094
+ };
4121
4095
  /**
4122
4096
  * Execution Tools for calling Deepseek API.
4123
4097
  *
@@ -4135,13 +4109,17 @@
4135
4109
  ...options,
4136
4110
  // apiKey: process.env.DEEPSEEK_GENERATIVE_AI_API_KEY,
4137
4111
  });
4138
- return createExecutionToolsFromVercelProvider({
4112
+ const baseTools = createExecutionToolsFromVercelProvider({
4139
4113
  title: 'Deepseek',
4140
4114
  description: 'Implementation of Deepseek models',
4141
4115
  vercelProvider: deepseekVercelProvider,
4142
4116
  availableModels: DEEPSEEK_MODELS,
4143
4117
  ...options,
4144
4118
  });
4119
+ return {
4120
+ ...baseTools,
4121
+ profile: DEEPSEEK_PROVIDER_PROFILE,
4122
+ };
4145
4123
  }, {
4146
4124
  packageName: '@promptbook/deepseek',
4147
4125
  className: 'DeepseekExecutionTools',
@@ -4443,6 +4421,14 @@
4443
4421
  * Note: [πŸ’ž] Ignore a discrepancy between file name and entity name
4444
4422
  */
4445
4423
 
4424
+ /**
4425
+ * Profile for Google Gemini provider
4426
+ */
4427
+ const GOOGLE_PROVIDER_PROFILE = {
4428
+ name: 'GOOGLE',
4429
+ fullname: 'Google Gemini',
4430
+ color: '#4285f4',
4431
+ };
4446
4432
  /**
4447
4433
  * Execution Tools for calling Google Gemini API.
4448
4434
  *
@@ -4460,13 +4446,17 @@
4460
4446
  ...options,
4461
4447
  /// apiKey: process.env.GOOGLE_GENERATIVE_AI_API_KEY,
4462
4448
  });
4463
- return createExecutionToolsFromVercelProvider({
4449
+ const baseTools = createExecutionToolsFromVercelProvider({
4464
4450
  title: 'Google',
4465
4451
  description: 'Implementation of Google models',
4466
4452
  vercelProvider: googleGeminiVercelProvider,
4467
4453
  availableModels: GOOGLE_MODELS,
4468
4454
  ...options,
4469
4455
  });
4456
+ return {
4457
+ ...baseTools,
4458
+ profile: GOOGLE_PROVIDER_PROFILE,
4459
+ };
4470
4460
  }, {
4471
4461
  packageName: '@promptbook/google',
4472
4462
  className: 'GoogleExecutionTools',
@@ -5177,6 +5167,7 @@
5177
5167
  * TODO: [πŸ›„] Maybe make custom `OpenAiCompatibleError`
5178
5168
  * TODO: [🧠][🈁] Maybe use `isDeterministic` from options
5179
5169
  * TODO: [🧠][🌰] Allow to pass `title` for tracking purposes
5170
+ * TODO: [🧠][🦒] Make reverse adapter from LlmExecutionTools to OpenAI-compatible:
5180
5171
  */
5181
5172
 
5182
5173
  /**
@@ -5432,6 +5423,14 @@
5432
5423
  * Note: [πŸ’ž] Ignore a discrepancy between file name and entity name
5433
5424
  */
5434
5425
 
5426
+ /**
5427
+ * Profile for Ollama provider
5428
+ */
5429
+ const OLLAMA_PROVIDER_PROFILE = {
5430
+ name: 'OLLAMA',
5431
+ fullname: 'Ollama',
5432
+ color: '#059669',
5433
+ };
5435
5434
  /**
5436
5435
  * Execution Tools for calling Ollama API
5437
5436
  *
@@ -5454,6 +5453,9 @@
5454
5453
  get description() {
5455
5454
  return 'Use all models provided by Ollama';
5456
5455
  }
5456
+ get profile() {
5457
+ return OLLAMA_PROVIDER_PROFILE;
5458
+ }
5457
5459
  /**
5458
5460
  * List all available models (non dynamically)
5459
5461
  *
@@ -5657,6 +5659,14 @@
5657
5659
  * Note: [πŸ’ž] Ignore a discrepancy between file name and entity name
5658
5660
  */
5659
5661
 
5662
+ /**
5663
+ * Profile for OpenAI provider
5664
+ */
5665
+ const OPENAI_PROVIDER_PROFILE = {
5666
+ name: 'OPENAI',
5667
+ fullname: 'OpenAI GPT',
5668
+ color: '#10a37f',
5669
+ };
5660
5670
  /**
5661
5671
  * Execution Tools for calling OpenAI API
5662
5672
  *
@@ -5679,7 +5689,7 @@
5679
5689
  return 'Use all models provided by OpenAI';
5680
5690
  }
5681
5691
  get profile() {
5682
- return LLM_PROVIDER_PROFILES.OPENAI;
5692
+ return OPENAI_PROVIDER_PROFILE;
5683
5693
  }
5684
5694
  /*
5685
5695
  Note: Commenting this out to avoid circular dependency
@@ -7875,6 +7885,14 @@
7875
7885
  return [input];
7876
7886
  }
7877
7887
 
7888
+ /**
7889
+ * Profile for Multiple providers aggregation
7890
+ */
7891
+ const MULTIPLE_PROVIDER_PROFILE = {
7892
+ name: 'MULTIPLE',
7893
+ fullname: 'Multiple Providers',
7894
+ color: '#6366f1',
7895
+ };
7878
7896
  /**
7879
7897
  * Multiple LLM Execution Tools is a proxy server that uses multiple execution tools internally and exposes the executor interface externally.
7880
7898
  *
@@ -7910,7 +7928,7 @@
7910
7928
  `);
7911
7929
  }
7912
7930
  get profile() {
7913
- return LLM_PROVIDER_PROFILES.MULTIPLE;
7931
+ return MULTIPLE_PROVIDER_PROFILE;
7914
7932
  }
7915
7933
  /**
7916
7934
  * Check the configuration of all execution tools