@promptbook/types 0.105.0-0 → 0.105.0-10

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 (66) hide show
  1. package/README.md +36 -77
  2. package/esm/typings/src/_packages/browser.index.d.ts +2 -0
  3. package/esm/typings/src/_packages/core.index.d.ts +4 -0
  4. package/esm/typings/src/_packages/types.index.d.ts +16 -0
  5. package/esm/typings/src/_packages/utils.index.d.ts +2 -0
  6. package/esm/typings/src/book-2.0/agent-source/AgentBasicInformation.d.ts +15 -3
  7. package/esm/typings/src/book-2.0/agent-source/AgentModelRequirements.d.ts +11 -1
  8. package/esm/typings/src/book-2.0/agent-source/communication-samples.test.d.ts +1 -0
  9. package/esm/typings/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments.blocks.test.d.ts +1 -0
  10. package/esm/typings/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments.import.test.d.ts +1 -0
  11. package/esm/typings/src/book-2.0/agent-source/parseAgentSource.import.test.d.ts +1 -0
  12. package/esm/typings/src/book-2.0/agent-source/parseAgentSourceWithCommitments.blocks.test.d.ts +1 -0
  13. package/esm/typings/src/book-components/Chat/AgentChat/AgentChatProps.d.ts +5 -0
  14. package/esm/typings/src/book-components/Chat/Chat/ChatMessageItem.d.ts +15 -1
  15. package/esm/typings/src/book-components/Chat/Chat/ChatProps.d.ts +20 -9
  16. package/esm/typings/src/book-components/Chat/LlmChat/LlmChatProps.d.ts +5 -0
  17. package/esm/typings/src/book-components/Chat/types/ChatMessage.d.ts +43 -0
  18. package/esm/typings/src/commitments/NOTE/NOTE.d.ts +2 -2
  19. package/esm/typings/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +4 -0
  20. package/esm/typings/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.d.ts +10 -0
  21. package/esm/typings/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.test.d.ts +1 -0
  22. package/esm/typings/src/commitments/USE_TIME/USE_TIME.d.ts +44 -0
  23. package/esm/typings/src/commitments/USE_TIME/USE_TIME.test.d.ts +1 -0
  24. package/esm/typings/src/commitments/_base/BaseCommitmentDefinition.d.ts +14 -0
  25. package/esm/typings/src/commitments/_base/CommitmentDefinition.d.ts +14 -0
  26. package/esm/typings/src/commitments/index.d.ts +17 -2
  27. package/esm/typings/src/config.d.ts +1 -0
  28. package/esm/typings/src/execution/LlmExecutionTools.d.ts +3 -1
  29. package/esm/typings/src/import-plugins/$fileImportPlugins.d.ts +7 -0
  30. package/esm/typings/src/import-plugins/AgentFileImportPlugin.d.ts +7 -0
  31. package/esm/typings/src/import-plugins/FileImportPlugin.d.ts +24 -0
  32. package/esm/typings/src/import-plugins/JsonFileImportPlugin.d.ts +7 -0
  33. package/esm/typings/src/import-plugins/TextFileImportPlugin.d.ts +7 -0
  34. package/esm/typings/src/llm-providers/_common/utils/cache/cacheLlmTools.d.ts +2 -1
  35. package/esm/typings/src/llm-providers/_common/utils/count-total-usage/countUsage.d.ts +2 -2
  36. package/esm/typings/src/llm-providers/agent/Agent.d.ts +14 -2
  37. package/esm/typings/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +3 -1
  38. package/esm/typings/src/llm-providers/agent/AgentOptions.d.ts +7 -0
  39. package/esm/typings/src/llm-providers/agent/RemoteAgent.d.ts +1 -0
  40. package/esm/typings/src/llm-providers/agent/RemoteAgentOptions.d.ts +1 -1
  41. package/esm/typings/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +10 -0
  42. package/esm/typings/src/llm-providers/openai/OpenAiCompatibleExecutionTools.d.ts +7 -0
  43. package/esm/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +1 -1
  44. package/esm/typings/src/scripting/javascript/JavascriptExecutionToolsOptions.d.ts +6 -1
  45. package/esm/typings/src/search-engines/SearchEngine.d.ts +1 -1
  46. package/esm/typings/src/search-engines/_index.d.ts +6 -0
  47. package/esm/typings/src/search-engines/bing/BingSearchEngine.d.ts +1 -1
  48. package/esm/typings/src/search-engines/dummy/DummySearchEngine.d.ts +1 -1
  49. package/esm/typings/src/search-engines/google/GoogleSearchEngine.d.ts +18 -0
  50. package/esm/typings/src/search-engines/serp/SerpSearchEngine.d.ts +15 -0
  51. package/esm/typings/src/speech-recognition/BrowserSpeechRecognition.d.ts +21 -0
  52. package/esm/typings/src/speech-recognition/OpenAiSpeechRecognition.d.ts +32 -0
  53. package/esm/typings/src/types/ModelRequirements.d.ts +6 -12
  54. package/esm/typings/src/types/SpeechRecognition.d.ts +58 -0
  55. package/esm/typings/src/types/typeAliases.d.ts +4 -0
  56. package/esm/typings/src/utils/execCommand/$execCommandNormalizeOptions.d.ts +2 -3
  57. package/esm/typings/src/utils/execCommand/ExecCommandOptions.d.ts +7 -1
  58. package/esm/typings/src/utils/misc/linguisticHash.d.ts +6 -0
  59. package/esm/typings/src/utils/misc/linguisticHash.test.d.ts +1 -0
  60. package/esm/typings/src/utils/organization/keepImported.d.ts +9 -0
  61. package/esm/typings/src/utils/organization/keepTypeImported.d.ts +0 -1
  62. package/esm/typings/src/utils/random/$generateBookBoilerplate.d.ts +4 -0
  63. package/esm/typings/src/utils/random/$randomAgentPersona.d.ts +2 -1
  64. package/esm/typings/src/utils/random/$randomAgentRule.d.ts +14 -0
  65. package/esm/typings/src/version.d.ts +1 -1
  66. package/package.json +2 -2
package/README.md CHANGED
@@ -304,19 +304,20 @@ Rest of the documentation is common for **entire promptbook ecosystem**:
304
304
 
305
305
  ## 📖 The Book Whitepaper
306
306
 
307
- For most business applications nowadays, the biggest challenge isn't about the raw capabilities of AI models. Large language models like GPT-5 or Claude-4.1 are extremely capable.
307
+ Nowadays, the biggest challenge for most business applications isn't the raw capabilities of AI models. Large language models such as GPT-5.2 and Claude-4.5 are incredibly capable.
308
308
 
309
- The main challenge is to narrow it down, constrain it, set the proper **context, rules, knowledge, and personality**. There are a lot of tools which can do exactly this. On one side, there are no-code platforms which can launch your agent in seconds. On the other side, there are heavy frameworks like Langchain or Semantic Kernel, which can give you deep control.
309
+ The main challenge lies in **managing the context**, providing rules and knowledge, and narrowing the personality.
310
310
 
311
- Promptbook takes the best from both worlds. You are defining your AI behavior by simple **books**, which are very explicit. They are automatically enforced, but they are very easy to understand, very easy to write, and very reliable and portable.
311
+ In Promptbook, you can define your context **using simple Books** that are very explicit, easy to understand and write, reliable, and highly portable.
312
312
 
313
313
  <table style="border: 1px solid #777; border-radius: 10px;"><tr><td>
314
314
 
315
- **<ins>Paul Smith & Associés</ins>**<br/>
315
+ **<ins>Paul Smith</ins>**<br/>
316
316
  <br/>
317
317
  **PERSONA** You are a company lawyer.<br/>
318
318
  Your job is to provide legal advice and support to the company and its employees.<br/>
319
- You are knowledgeable, professional, and detail-oriented.<br/>
319
+ **RULE** You are knowledgeable, professional, and detail-oriented.<br/>
320
+ TEAM You are part of the legal team of Paul Smith & Associés, you discuss with {Emily White}, the head of the compliance department. {George Brown} is expert in corporate law and {Sophia Black} is expert in labor law.<br/>
320
321
 
321
322
  </td></tr></table>
322
323
 
@@ -326,7 +327,9 @@ You are knowledgeable, professional, and detail-oriented.<br/>
326
327
 
327
328
  We have created a language called **Book**, which allows you to write AI agents in their native language and create your own AI persona. Book provides a guide to define all the traits and commitments.
328
329
 
329
- You can look at it as prompting (or writing a system message), but decorated by **commitments**.
330
+ You can look at it as "prompting" _(or writing a system message)_, but decorated by **commitments**.
331
+
332
+ **Commitments** are special syntax elements that define contracts between you and the AI agent. They are transformed by Promptbook Engine into low-level parameters like which model to use, its temperature, system message, RAG index, MCP servers, and many other parameters. For some commitments _(for example `RULE` commitment)_ Promptbook Engine can even create adversary agents and extra checks to enforce the rules.
330
333
 
331
334
  #### `Persona` commitment
332
335
 
@@ -337,8 +340,6 @@ Personas define the character of your AI persona, its role, and how it should in
337
340
  **<ins>Paul Smith & Associés</ins>**<br/>
338
341
  <br/>
339
342
  **PERSONA** You are a company lawyer.<br/>
340
- Your job is to provide legal advice and support to the company and its employees.<br/>
341
- You are knowledgeable, professional, and detail-oriented.<br/>
342
343
 
343
344
  </td></tr></table>
344
345
 
@@ -358,7 +359,7 @@ Promptbook Engine will automatically enforce this knowledge during interactions.
358
359
  Your job is to provide legal advice and support to the company and its employees.<br/>
359
360
  You are knowledgeable, professional, and detail-oriented.<br/>
360
361
  <br/>
361
- **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
362
+ **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
362
363
  **KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
363
364
 
364
365
  </td></tr></table>
@@ -380,14 +381,14 @@ You are knowledgeable, professional, and detail-oriented.<br/>
380
381
  **RULE** Always ensure compliance with laws and regulations.<br/>
381
382
  **RULE** Never provide legal advice outside your area of expertise.<br/>
382
383
  **RULE** Never provide legal advice about criminal law.<br/>
383
- **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
384
+ **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
384
385
  **KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
385
386
 
386
387
  </td></tr></table>
387
388
 
388
- #### `Action` commitment
389
+ #### `Team` commitment
389
390
 
390
- Action Commitment allows you to define specific actions that the AI can take during interactions. This can include things like posting on a social media platform, sending emails, creating calendar events, or interacting with your internal systems.
391
+ Team commitment allows you to define the team structure and advisory fellow members the AI can consult with. This allows the AI to simulate collaboration and consultation with other experts, enhancing the quality of its responses.
391
392
 
392
393
  <table style="border: 1px solid #777; border-radius: 10px;"><tr><td>
393
394
 
@@ -400,81 +401,36 @@ You are knowledgeable, professional, and detail-oriented.<br/>
400
401
  **RULE** Always ensure compliance with laws and regulations.<br/>
401
402
  **RULE** Never provide legal advice outside your area of expertise.<br/>
402
403
  **RULE** Never provide legal advice about criminal law.<br/>
403
- **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
404
+ **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
404
405
  **KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
405
- **ACTION** When a user asks about an issue that could be treated as a crime, notify legal@company.com.<br/>
406
+ TEAM You are part of the legal team of Paul Smith & Associés, you discuss with {Emily White}, the head of the compliance department. {George Brown} is expert in corporate law and {Sophia Black} is expert in labor law.<br/>
406
407
 
407
408
  </td></tr></table>
408
409
 
409
- [Read more about the language](./BLUEPRINT.md)
410
-
411
- <div style="page-break-after: always;"></div>
412
-
413
- ### Where to use your AI agent in book
414
-
415
- Books can be useful in various applications and scenarios. Here are some examples:
416
-
417
- #### Chat apps:
418
410
 
419
- Create your own chat shopping assistant and place it in your eShop.
420
- You will be able to answer customer questions, help them find products, and provide personalized recommendations. Everything is tightly controlled by the book you have written.
421
411
 
422
- #### Reply Agent:
412
+ ### Promptbook Ecosystem
423
413
 
424
- Create your own AI agent, which will look at your emails and reply to them. It can even create drafts for you to review before sending.
414
+ !!!@@@
425
415
 
426
- #### Coding Agent:
427
-
428
- Do you love Vibecoding, but the AI code is not always aligned with your coding style and architecture, rules, security, etc.? Create your own coding agent to help enforce your specific coding standards and practices.
429
-
430
- This can be integrated to almost any Vibecoding platform, like GitHub Copilot, Amazon CodeWhisperer, Cursor, Cline, Kilocode, Roocode,...
431
-
432
- They will work the same as you are used to, but with your specific rules written in book.
433
-
434
- #### Internal Expertise
435
-
436
- Do you have an app written in TypeScript, Python, C#, Java, or any other language, and you are integrating the AI.
437
-
438
- You can avoid struggle with choosing the best model, its settings like temperature, max tokens, etc., by writing a book agent and using it as your AI expertise.
439
-
440
- Doesn't matter if you do automations, data analysis, customer support, sentiment analysis, classification, or any other task. Your AI agent will be tailored to your specific needs and requirements.
441
-
442
- Even works in no-code platforms!
443
-
444
- <div style="page-break-after: always;"></div>
416
+ #### Promptbook Server
445
417
 
446
- ### How to create your AI agent in book
418
+ !!!@@@
447
419
 
448
- Now you want to use it. There are several ways how to write your first book:
420
+ #### Promptbook Engine
449
421
 
450
- #### From scratch with help from Paul
422
+ !!!@@@
451
423
 
452
- We have written ai asistant in book who can help you with writing your first book.
453
424
 
454
- #### Your AI twin
455
425
 
456
- Copy your own behavior, personality, and knowledge into book and create your AI twin. It can help you with your work, personal life, or any other task.
457
426
 
458
- #### AI persona workpool
459
427
 
460
- Or you can pick from our library of pre-written books for various roles and tasks. You can find books for customer support, coding, marketing, sales, HR, legal, and many other roles.
461
428
 
462
429
 
463
430
 
464
431
 
465
432
 
466
433
 
467
- ## 🚀 Get started
468
-
469
- Take a look at the simple starter kit with books integrated into the **Hello World** sample applications:
470
-
471
- - [Hello Book](https://github.com/webgptorg/hello-world)
472
- - [Hello Book in Node.js](https://github.com/webgptorg/hello-world-node-js)
473
- - [Hello Book in Next.js](https://github.com/webgptorg/hello-world-next-js)
474
-
475
-
476
-
477
-
478
434
 
479
435
 
480
436
  ## 💜 The Promptbook Project
@@ -490,33 +446,32 @@ Promptbook project is ecosystem of multiple projects and tools, following is a l
490
446
  </thead>
491
447
  <tbody>
492
448
  <tr>
493
- <td><a href="https://github.com/webgptorg/book">Book language</a></td>
449
+ <td><a href="https://gallery.ptbk.io/">Agents Server</a></td>
494
450
  <td>
495
- Book is a human-understandable markup language for writing AI applications such as chatbots, knowledge bases, agents, avarars, translators, automations and more.
496
- <hr>
497
- There is also <a href="https://github.com/webgptorg/book-extension">a plugin for VSCode</a> to support <code>.book</code> file extension
451
+ Place where you "AI agents live". It allows to create, manage, deploy, and interact with AI agents created in Book language.
498
452
  </td>
499
453
  </tr>
500
454
  <tr>
501
- <td><a href="https://github.com/webgptorg/promptbook">Promptbook Engine</a></td>
455
+ <td><a href="https://github.com/webgptorg/book">Book language</a></td>
502
456
  <td>
503
- Promptbook engine can run applications written in Book language. It is released as <a href="https://www.npmjs.com/package/@promptbook/core#-packages-for-developers">multiple NPM packages</a> and <a href="https://hub.docker.com/r/hejny/promptbook">Docker HUB</a>
457
+ Human-friendly, high-level language that abstracts away low-level details of AI. It allows to focus on personality, behavior, knowledge, and rules of AI agents rather than on models, parameters, and prompt engineering.
458
+ <hr>
459
+ There is also <a href="https://github.com/webgptorg/book-extension">a plugin for VSCode</a> to support <code>.book</code> file extension
504
460
  </td>
505
461
  </tr>
506
462
  <tr>
507
- <td><a href="https://promptbook.studio">Promptbook Studio</a></td>
463
+ <td><a href="https://github.com/webgptorg/promptbook">Promptbook Engine</a></td>
508
464
  <td>
509
- Promptbook.studio is a web-based editor and runner for book applications. It is still in the experimental MVP stage.
465
+ Promptbook engine can run AI agents based on Book language.
466
+ It is released as <a href="https://www.npmjs.com/package/@promptbook/core#-packages-for-developers">multiple NPM packages</a> and <a href="https://hub.docker.com/r/hejny/promptbook">Promptbook Agent Server as Docker Package</a>
467
+ Agent Server is based on Promptbook Engine.
510
468
  </td>
511
469
  </tr>
470
+
512
471
  </tbody>
513
472
  </table>
514
473
 
515
- Hello world examples:
516
474
 
517
- - [Hello world](https://github.com/webgptorg/hello-world)
518
- - [Hello world in Node.js](https://github.com/webgptorg/hello-world-node-js)
519
- - [Hello world in Next.js](https://github.com/webgptorg/hello-world-next-js)
520
475
 
521
476
  ### 🌐 Community & Social Media
522
477
 
@@ -574,6 +529,8 @@ Join our growing community of developers and users:
574
529
 
575
530
 
576
531
 
532
+
533
+
577
534
  ## 📚 Documentation
578
535
 
579
536
  See detailed guides and API reference in the [docs](https://github.com/webgptorg/promptbook/discussions/categories/concepts) or [online](https://discord.gg/x3QWNaa89N).
@@ -650,6 +607,8 @@ The following glossary is used to clarify certain concepts:
650
607
 
651
608
  _Note: This section is not a complete dictionary, more list of general AI / LLM terms that has connection with Promptbook_
652
609
 
610
+
611
+
653
612
  ### 💯 Core concepts
654
613
 
655
614
  - [📚 Collection of pipelines](https://github.com/webgptorg/promptbook/discussions/65)
@@ -1,6 +1,7 @@
1
1
  import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
2
2
  import { SimplePromptInterfaceTools } from '../dialogs/simple-prompt/SimplePromptInterfaceTools';
3
3
  import { $provideScrapersForBrowser } from '../scrapers/_common/register/$provideScrapersForBrowser';
4
+ import { BrowserSpeechRecognition } from '../speech-recognition/BrowserSpeechRecognition';
4
5
  import { getIndexedDbStorage } from '../storage/local-storage/getIndexedDbStorage';
5
6
  import { getLocalStorage } from '../storage/local-storage/getLocalStorage';
6
7
  import { getSessionStorage } from '../storage/local-storage/getSessionStorage';
@@ -10,6 +11,7 @@ import { ObjectUrl } from '../utils/files/ObjectUrl';
10
11
  export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
11
12
  export { SimplePromptInterfaceTools };
12
13
  export { $provideScrapersForBrowser };
14
+ export { BrowserSpeechRecognition };
13
15
  export { getIndexedDbStorage };
14
16
  export { getLocalStorage };
15
17
  export { getSessionStorage };
@@ -27,6 +27,8 @@ import { getAllCommitmentTypes } from '../commitments/index';
27
27
  import { isCommitmentSupported } from '../commitments/index';
28
28
  import type { GroupedCommitmentDefinition } from '../commitments/index';
29
29
  import { getGroupedCommitmentDefinitions } from '../commitments/index';
30
+ import { getAllCommitmentsToolFunctions } from '../commitments/index';
31
+ import { getAllCommitmentsToolTitles } from '../commitments/index';
30
32
  import { NAME } from '../config';
31
33
  import { ADMIN_EMAIL } from '../config';
32
34
  import { PROMPTBOOK_LEGAL_ENTITY } from '../config';
@@ -225,6 +227,8 @@ export { getAllCommitmentTypes };
225
227
  export { isCommitmentSupported };
226
228
  export type { GroupedCommitmentDefinition };
227
229
  export { getGroupedCommitmentDefinitions };
230
+ export { getAllCommitmentsToolFunctions };
231
+ export { getAllCommitmentsToolTitles };
228
232
  export { NAME };
229
233
  export { ADMIN_EMAIL };
230
234
  export { PROMPTBOOK_LEGAL_ENTITY };
@@ -106,6 +106,7 @@ import type { CsvSettings } from '../formats/csv/CsvSettings';
106
106
  import type { AbstractFormfactorDefinition } from '../formfactors/_common/AbstractFormfactorDefinition';
107
107
  import type { FormfactorDefinition } from '../formfactors/_common/FormfactorDefinition';
108
108
  import type { string_formfactor_name } from '../formfactors/_common/string_formfactor_name';
109
+ import type { FileImportPlugin } from '../import-plugins/FileImportPlugin';
109
110
  import type { LlmToolsConfiguration } from '../llm-providers/_common/register/LlmToolsConfiguration';
110
111
  import type { LlmToolsMetadata } from '../llm-providers/_common/register/LlmToolsMetadata';
111
112
  import type { LlmToolsOptions } from '../llm-providers/_common/register/LlmToolsOptions';
@@ -179,8 +180,10 @@ import type { ScraperSourceHandler } from '../scrapers/_common/Scraper';
179
180
  import type { ScraperIntermediateSource } from '../scrapers/_common/ScraperIntermediateSource';
180
181
  import type { JavascriptExecutionToolsOptions } from '../scripting/javascript/JavascriptExecutionToolsOptions';
181
182
  import type { PostprocessingFunction } from '../scripting/javascript/JavascriptExecutionToolsOptions';
183
+ import type { ToolFunction } from '../scripting/javascript/JavascriptExecutionToolsOptions';
182
184
  import type { SearchEngine } from '../search-engines/SearchEngine';
183
185
  import type { SearchResult } from '../search-engines/SearchResult';
186
+ import type { OpenAiSpeechRecognitionOptions } from '../speech-recognition/OpenAiSpeechRecognition';
184
187
  import type { PromptbookStorage } from '../storage/_common/PromptbookStorage';
185
188
  import type { FileCacheStorageOptions } from '../storage/file-cache-storage/FileCacheStorageOptions';
186
189
  import type { IndexedDbStorageOptions } from '../storage/local-storage/utils/IndexedDbStorageOptions';
@@ -205,6 +208,10 @@ import type { ImagePrompt } from '../types/Prompt';
205
208
  import type { EmbeddingPrompt } from '../types/Prompt';
206
209
  import type { ScriptLanguage } from '../types/ScriptLanguage';
207
210
  import type { SectionType } from '../types/SectionType';
211
+ import type { SpeechRecognition } from '../types/SpeechRecognition';
212
+ import type { SpeechRecognitionStartOptions } from '../types/SpeechRecognition';
213
+ import type { SpeechRecognitionState } from '../types/SpeechRecognition';
214
+ import type { SpeechRecognitionEvent } from '../types/SpeechRecognition';
208
215
  import type { TaskType } from '../types/TaskType';
209
216
  import type { string_char_emoji } from '../types/typeAliasEmoji';
210
217
  import type { string_business_category_name } from '../types/typeAliases';
@@ -314,6 +321,7 @@ import type { string_license_token } from '../types/typeAliases';
314
321
  import type { string_password } from '../types/typeAliases';
315
322
  import type { string_ssh_key } from '../types/typeAliases';
316
323
  import type { string_pgp_key } from '../types/typeAliases';
324
+ import type { string_language } from '../types/typeAliases';
317
325
  import type { string_date_iso8601 } from '../types/typeAliases';
318
326
  import type { number_usd } from '../types/typeAliases';
319
327
  import type { number_id } from '../types/typeAliases';
@@ -478,6 +486,7 @@ export type { CsvSettings };
478
486
  export type { AbstractFormfactorDefinition };
479
487
  export type { FormfactorDefinition };
480
488
  export type { string_formfactor_name };
489
+ export type { FileImportPlugin };
481
490
  export type { LlmToolsConfiguration };
482
491
  export type { LlmToolsMetadata };
483
492
  export type { LlmToolsOptions };
@@ -551,8 +560,10 @@ export type { ScraperSourceHandler };
551
560
  export type { ScraperIntermediateSource };
552
561
  export type { JavascriptExecutionToolsOptions };
553
562
  export type { PostprocessingFunction };
563
+ export type { ToolFunction };
554
564
  export type { SearchEngine };
555
565
  export type { SearchResult };
566
+ export type { OpenAiSpeechRecognitionOptions };
556
567
  export type { PromptbookStorage };
557
568
  export type { FileCacheStorageOptions };
558
569
  export type { IndexedDbStorageOptions };
@@ -577,6 +588,10 @@ export type { ImagePrompt };
577
588
  export type { EmbeddingPrompt };
578
589
  export type { ScriptLanguage };
579
590
  export type { SectionType };
591
+ export type { SpeechRecognition };
592
+ export type { SpeechRecognitionStartOptions };
593
+ export type { SpeechRecognitionState };
594
+ export type { SpeechRecognitionEvent };
580
595
  export type { TaskType };
581
596
  export type { string_char_emoji };
582
597
  export type { string_business_category_name };
@@ -686,6 +701,7 @@ export type { string_license_token };
686
701
  export type { string_password };
687
702
  export type { string_ssh_key };
688
703
  export type { string_pgp_key };
704
+ export type { string_language };
689
705
  export type { string_date_iso8601 };
690
706
  export type { number_usd };
691
707
  export type { number_id };
@@ -29,6 +29,7 @@ import { CountUtils } from '../utils/expectation-counters/index';
29
29
  import { $getCurrentDate } from '../utils/misc/$getCurrentDate';
30
30
  import { computeHash } from '../utils/misc/computeHash';
31
31
  import { debounce } from '../utils/misc/debounce';
32
+ import { linguisticHash } from '../utils/misc/linguisticHash';
32
33
  import { parseNumber } from '../utils/misc/parseNumber';
33
34
  import { capitalize } from '../utils/normalization/capitalize';
34
35
  import { decapitalize } from '../utils/normalization/decapitalize';
@@ -118,6 +119,7 @@ export { CountUtils };
118
119
  export { $getCurrentDate };
119
120
  export { computeHash };
120
121
  export { debounce };
122
+ export { linguisticHash };
121
123
  export { parseNumber };
122
124
  export { capitalize };
123
125
  export { decapitalize };
@@ -31,7 +31,7 @@ export type AgentCapability = {
31
31
  /**
32
32
  * The type of the capability
33
33
  */
34
- type: 'browser' | 'search-engine' | 'knowledge';
34
+ type: 'browser' | 'search-engine' | 'knowledge' | 'time' | 'inheritance' | 'import';
35
35
  /**
36
36
  * The label to display for this capability
37
37
  */
@@ -40,6 +40,11 @@ export type AgentCapability = {
40
40
  * The name of the icon to display for this capability
41
41
  */
42
42
  iconName: string;
43
+ /**
44
+ * Optional link to another agent
45
+ * This is used for 'inheritance' and 'import' types
46
+ */
47
+ agentUrl?: string_agent_url;
43
48
  };
44
49
  export type AgentBasicInformation = {
45
50
  /**
@@ -90,12 +95,19 @@ export type AgentBasicInformation = {
90
95
  * - @Parameter (single word parameter starting with @)
91
96
  * - {parameterName} or {parameter with multiple words} or {parameterName: description text}
92
97
  */
93
- parameters: BookParameter[];
98
+ parameters: Array<BookParameter>;
94
99
  /**
95
100
  * Capabilities of the agent
96
101
  * This is parsed from commitments like USE BROWSER, USE SEARCH ENGINE, KNOWLEDGE, etc.
97
102
  */
98
- capabilities: AgentCapability[];
103
+ capabilities: Array<AgentCapability>;
104
+ /**
105
+ * List of sample conversations (question/answer pairs)
106
+ */
107
+ samples: Array<{
108
+ question: string | null;
109
+ answer: string;
110
+ }>;
99
111
  };
100
112
  /**
101
113
  * TODO: [🐱‍🚀] Make all properties of `AgentBasicInformation` readonly
@@ -32,6 +32,10 @@ export type AgentModelRequirements = {
32
32
  * List of imported agent URLs
33
33
  */
34
34
  readonly importedAgentUrls?: ReadonlyArray<string_agent_url>;
35
+ /**
36
+ * List of imported file URLs or paths
37
+ */
38
+ readonly importedFileUrls?: ReadonlyArray<string>;
35
39
  /**
36
40
  * Optional list of knowledge source links that the agent can use
37
41
  */
@@ -40,7 +44,7 @@ export type AgentModelRequirements = {
40
44
  * List of sample conversations (question/answer pairs)
41
45
  */
42
46
  readonly samples?: ReadonlyArray<{
43
- question: string;
47
+ question: string | null;
44
48
  answer: string;
45
49
  }>;
46
50
  /**
@@ -64,6 +68,12 @@ export type AgentModelRequirements = {
64
68
  * Each commitment can store its own data here
65
69
  */
66
70
  readonly metadata?: Record<string, TODO_any>;
71
+ /**
72
+ * Notes associated with the agent
73
+ *
74
+ * Note: This does not affect agent behavior in any way
75
+ */
76
+ readonly notes?: ReadonlyArray<string>;
67
77
  };
68
78
  /**
69
79
  * TODO: [🐤] DRY `AgentModelRequirements` and `ModelRequirements`
@@ -10,4 +10,9 @@ export type AgentChatProps = Omit<LlmChatProps, 'thread' | 'llmTools' | 'initial
10
10
  * The agent to chat with
11
11
  */
12
12
  readonly agent: Agent;
13
+ /**
14
+ * Optional mapping of technical tool names to human-readable titles.
15
+ * e.g., { "web_search": "Searching the web..." }
16
+ */
17
+ readonly toolTitles?: Record<string, string>;
13
18
  };
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import type { id } from '../../../types/typeAliases';
3
+ import type { TODO_any } from '../../../utils/organization/TODO_any';
3
4
  import type { ChatMessage } from '../types/ChatMessage';
4
5
  import type { ChatParticipant } from '../types/ChatParticipant';
5
6
  import type { ChatProps } from './ChatProps';
@@ -33,11 +34,24 @@ type ChatMessageItemProps = Pick<ChatProps, 'onMessage' | 'participants'> & {
33
34
  * Called when the create agent button is pressed for book code blocks.
34
35
  */
35
36
  onCreateAgent?: (bookContent: string) => void;
37
+ /**
38
+ * Optional mapping of technical tool names to human-readable titles.
39
+ * e.g., { "web_search": "Searching the web..." }
40
+ */
41
+ toolTitles?: Record<string, string>;
42
+ /**
43
+ * Called when a tool call chiplet is clicked.
44
+ */
45
+ onToolCallClick?: (toolCall: {
46
+ name: string;
47
+ arguments?: TODO_any;
48
+ result?: TODO_any;
49
+ }) => void;
36
50
  };
37
51
  /**
38
52
  * Renders a single chat message item with avatar, content, buttons, and rating.
39
53
  *
40
54
  * @private internal subcomponent of `<Chat>` component
41
55
  */
42
- export declare const ChatMessageItem: import("react").MemoExoticComponent<({ message, participant, participants, isLastMessage, onMessage, setExpandedMessageId, isExpanded, currentRating, handleRating, mode, isCopyButtonEnabled, isFeedbackEnabled, onCopy, onCreateAgent, }: ChatMessageItemProps) => import("react/jsx-runtime").JSX.Element>;
56
+ export declare const ChatMessageItem: import("react").MemoExoticComponent<({ message, participant, participants, isLastMessage, onMessage, setExpandedMessageId, isExpanded, currentRating, handleRating, mode, isCopyButtonEnabled, isFeedbackEnabled, onCopy, onCreateAgent, toolTitles, onToolCallClick, }: ChatMessageItemProps) => import("react/jsx-runtime").JSX.Element>;
43
57
  export {};
@@ -5,6 +5,8 @@ import type { ChatMessage } from '../types/ChatMessage';
5
5
  import type { ChatParticipant } from '../types/ChatParticipant';
6
6
  import { string_color } from '../../../types/typeAliases';
7
7
  import { Color } from '../../../_packages/color.index';
8
+ import { SpeechRecognition } from '../../../types/SpeechRecognition';
9
+ import type { TODO_any } from '../../../utils/organization/TODO_any';
8
10
  /**
9
11
  * @public exported from `@promptbook/components`
10
12
  */
@@ -47,13 +49,9 @@ export type ChatProps = {
47
49
  */
48
50
  readonly isVoiceRecognitionButtonShown?: boolean;
49
51
  /**
50
- * Optional callback to trigger voice input
52
+ * Speech recognition provider
51
53
  */
52
- onVoiceInput?(): void;
53
- /**
54
- * The language code to use for voice recognition
55
- */
56
- readonly voiceLanguage?: string;
54
+ readonly speechRecognition?: SpeechRecognition;
57
55
  /**
58
56
  * Optional placeholder message for the textarea
59
57
  *
@@ -152,6 +150,16 @@ export type ChatProps = {
152
150
  * Keys should match ChatMessage.from values (e.g., 'USER', 'AGENT_{id}', etc.)
153
151
  */
154
152
  readonly participants?: ReadonlyArray<ChatParticipant>;
153
+ /**
154
+ * Optional mapping of technical tool names to human-readable titles.
155
+ * e.g., { "web_search": "Searching the web..." }
156
+ */
157
+ readonly toolTitles?: Record<string, string>;
158
+ /**
159
+ * Optional callback to create a new agent from the template.
160
+ * If provided, renders the [Create Agent] button for book code blocks.
161
+ */
162
+ onCreateAgent?: (bookContent: string) => void;
155
163
  /**
156
164
  * Optional callback for handling user feedback on messages
157
165
  * When provided, star rating buttons (1-5 stars) will be displayed next to each message
@@ -188,10 +196,13 @@ export type ChatProps = {
188
196
  */
189
197
  isCopyButtonEnabled?: boolean;
190
198
  /**
191
- * Optional callback for creating an agent from a book code block.
192
- * When provided, "Create Agent" buttons will be shown for book code blocks.
199
+ * Called when a tool call chiplet is clicked.
193
200
  */
194
- onCreateAgent?: (bookContent: string) => void;
201
+ onToolCallClick?: (toolCall: {
202
+ name: string;
203
+ arguments?: TODO_any;
204
+ result?: TODO_any;
205
+ }) => void;
195
206
  };
196
207
  /**
197
208
  * TODO: [☁️] Export component prop types only to `@promptbook/components` (not `@promptbook/types`)
@@ -57,4 +57,9 @@ export type LlmChatProps = Omit<ChatProps, 'messages' | 'onMessage' | 'onChange'
57
57
  * This is useful for seamless transitions from other pages.
58
58
  */
59
59
  readonly autoExecuteMessage?: string;
60
+ /**
61
+ * Optional mapping of technical tool names to human-readable titles.
62
+ * e.g., { "web_search": "Searching the web..." }
63
+ */
64
+ readonly toolTitles?: Record<string, string>;
60
65
  };
@@ -1,5 +1,6 @@
1
1
  import { Message } from '../../../types/Message';
2
2
  import type { id, string_markdown } from '../../../types/typeAliases';
3
+ import type { TODO_any } from '../../../utils/organization/TODO_any';
3
4
  /**
4
5
  * Represents a single message within a chat interface.
5
6
  *
@@ -33,6 +34,48 @@ export type ChatMessage = Omit<Message<id>, 'direction' | 'recipients' | 'thread
33
34
  * Indicates if the message was sent via a voice call
34
35
  */
35
36
  isVoiceCall?: boolean;
37
+ /**
38
+ * Optional tool calls made during the execution
39
+ */
40
+ readonly ongoingToolCalls?: ReadonlyArray<{
41
+ /**
42
+ * Name of the tool
43
+ */
44
+ readonly name: string;
45
+ /**
46
+ * Arguments for the tool call
47
+ */
48
+ readonly arguments?: string | Record<string, TODO_any>;
49
+ /**
50
+ * Result of the tool call
51
+ */
52
+ readonly result?: TODO_any;
53
+ /**
54
+ * Raw tool call from the model
55
+ */
56
+ readonly rawToolCall?: TODO_any;
57
+ }>;
58
+ /**
59
+ * Optional tool calls that have been completed
60
+ */
61
+ readonly completedToolCalls?: ReadonlyArray<{
62
+ /**
63
+ * Name of the tool
64
+ */
65
+ readonly name: string;
66
+ /**
67
+ * Arguments for the tool call
68
+ */
69
+ readonly arguments?: string | Record<string, TODO_any>;
70
+ /**
71
+ * Result of the tool call
72
+ */
73
+ readonly result?: TODO_any;
74
+ /**
75
+ * Raw tool call from the model
76
+ */
77
+ readonly rawToolCall?: TODO_any;
78
+ }>;
36
79
  /**
37
80
  * Optional file attachments
38
81
  */
@@ -26,8 +26,8 @@ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
26
26
  *
27
27
  * @private [🪔] Maybe export the commitments through some package
28
28
  */
29
- export declare class NoteCommitmentDefinition extends BaseCommitmentDefinition<'NOTE' | 'NOTES' | 'COMMENT' | 'NONCE'> {
30
- constructor(type?: 'NOTE' | 'NOTES' | 'COMMENT' | 'NONCE');
29
+ export declare class NoteCommitmentDefinition extends BaseCommitmentDefinition<'NOTE' | 'NOTES' | 'COMMENT' | 'NONCE' | 'TODO'> {
30
+ constructor(type?: 'NOTE' | 'NOTES' | 'COMMENT' | 'NONCE' | 'TODO');
31
31
  /**
32
32
  * Short one-line description of NOTE.
33
33
  */
@@ -35,6 +35,10 @@ export declare class UseBrowserCommitmentDefinition extends BaseCommitmentDefini
35
35
  * Markdown documentation for USE BROWSER commitment.
36
36
  */
37
37
  get documentation(): string;
38
+ /**
39
+ * Gets human-readable titles for tool functions provided by this commitment.
40
+ */
41
+ getToolTitles(): Record<string, string>;
38
42
  applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
39
43
  }
40
44
  /**