@promptbook/types 0.103.0-0 → 0.103.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.
package/README.md CHANGED
@@ -1,8 +1,10 @@
1
1
  <!-- ⚠️ WARNING: This code has been generated so that any manual changes will be overwritten -->
2
2
 
3
- # ✨ Promptbook: AI apps in plain Language
3
+ # ✨ Promptbook: AI Agents
4
+
5
+ Turn your company's scattered knowledge into AI ready Books
6
+
4
7
 
5
- Write AI applications using plain human language across multiple models and platforms.
6
8
 
7
9
 
8
10
 
@@ -304,19 +306,130 @@ Rest of the documentation is common for **entire promptbook ecosystem**:
304
306
 
305
307
 
306
308
 
307
- ## 🤍 The Book Abstract
309
+ ## 📖 The Book Whitepaper
310
+
311
+ 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.
312
+
313
+ 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.
314
+
315
+ 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.
316
+
317
+
318
+ <img
319
+ alt="Paul Smith & Associés Book"
320
+ src="https://promptbook.studio/embed/book-preview.png?book=Paul%20Smith%20%26%20Associ%C3%A9s%0A%20%20%20%20%20%20%7C%20PERSONA%20You%20are%20a%20company%20lawyer.%0A%20%20%20%20%20%20%7C%20Your%20job%20is%20to%20provide%20legal%20advice%20and%20support%20to%20the%20company%20and%20its%20employees.%0A%20%20%20%20%20%20%7C%20You%20are%20knowledgeable%2C%20professional%2C%20and%20detail-oriented.&width=800&height=450&nonce=0"
321
+ />
322
+
323
+ <div style="page-break-after: always;"></div>
324
+
325
+ ### Aspects of great AI agent
326
+
327
+ 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
+ You can look at it as prompting (or writing a system message), but decorated by **commitments**.
330
+
331
+ #### `Persona` commitment
332
+
333
+ Personas define the character of your AI persona, its role, and how it should interact with users. It sets the tone and style of communication.
334
+
335
+
336
+ <img
337
+ alt="Paul Smith & Associés Book"
338
+ src="https://promptbook.studio/embed/book-preview.png?book=Paul%20Smith%20%26%20Associ%C3%A9s%0A%20%20%20%20%20%20%7C%20PERSONA%20You%20are%20a%20company%20lawyer.%0A%20%20%20%20%20%20%7C%20Your%20job%20is%20to%20provide%20legal%20advice%20and%20support%20to%20the%20company%20and%20its%20employees.%0A%20%20%20%20%20%20%7C%20You%20are%20knowledgeable%2C%20professional%2C%20and%20detail-oriented.&width=800&height=450&nonce=0"
339
+ />
340
+
341
+ #### `Knowledge` commitment
342
+
343
+ Knowledge Commitment allows you to provide specific information, facts, or context that the AI should be aware of when responding.
344
+
345
+ This can include domain-specific knowledge, company policies, or any other relevant information.
346
+
347
+ Promptbook Engine will automatically enforce this knowledge during interactions. When the knowledge is short enough, it will be included in the prompt. When it is too long, it will be stored in vector databases and RAG retrieved when needed. But you don't need to care about it.
348
+
349
+
350
+ <img
351
+ alt="Paul Smith & Associés Book"
352
+ src="https://promptbook.studio/embed/book-preview.png?book=Paul%20Smith%20%26%20Associ%C3%A9s%0A%20%20%20%20%20%20%7C%20PERSONA%20You%20are%20a%20company%20lawyer.%0A%20%20%20%20%20%20%7C%20Your%20job%20is%20to%20provide%20legal%20advice%20and%20support%20to%20the%20company%20and%20its%20employees.%0A%20%20%20%20%20%20%7C%20You%20are%20knowledgeable%2C%20professional%2C%20and%20detail-oriented.%0A%20%20%20%20%20%20%7C%20KNOWLEDGE%20%20https%3A%2F%2Fcompany.com%2Fcompany-policies.pdf%0A%20%20%20%20%20%20%7C%20KNOWLEDGE%20https%3A%2F%2Fcompany.com%2Finternal-documents%2Femployee-handbook.docx&width=800&height=450&nonce=0"
353
+ />
354
+
355
+ #### `Rule` commitment
356
+
357
+ Rules will enforce specific behaviors or constraints on the AI's responses. This can include ethical guidelines, communication styles, or any other rules you want the AI to follow.
358
+
359
+ Depending on rule strictness, Promptbook will either propagate it to the prompt or use other techniques, like adversary agent, to enforce it.
360
+
361
+
362
+ <img
363
+ alt="Paul Smith & Associés Book"
364
+ src="https://promptbook.studio/embed/book-preview.png?book=Paul%20Smith%20%26%20Associ%C3%A9s%0A%20%20%20%20%20%20%7C%20PERSONA%20You%20are%20a%20company%20lawyer.%0A%20%20%20%20%20%20%7C%20Your%20job%20is%20to%20provide%20legal%20advice%20and%20support%20to%20the%20company%20and%20its%20employees.%0A%20%20%20%20%20%20%7C%20You%20are%20knowledgeable%2C%20professional%2C%20and%20detail-oriented.%0A%20%20%20%20%20%20%7C%20RULE%20Always%20ensure%20compliance%20with%20laws%20and%20regulations.%0A%20%20%20%20%20%20%7C%20RULE%20Never%20provide%20legal%20advice%20outside%20your%20area%20of%20expertise.%0A%20%20%20%20%20%20%7C%20RULE%20Never%20provide%20legal%20advice%20about%20criminal%20law.%0A%20%20%20%20%20%20%7C%20KNOWLEDGE%20%20https%3A%2F%2Fcompany.com%2Fcompany-policies.pdf%0A%20%20%20%20%20%20%7C%20KNOWLEDGE%20https%3A%2F%2Fcompany.com%2Finternal-documents%2Femployee-handbook.docx&width=800&height=450&nonce=0"
365
+ />
366
+
367
+ #### `Action` commitment
368
+
369
+ 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.
370
+
371
+
372
+ <img
373
+ alt="Paul Smith & Associés Book"
374
+ src="https://promptbook.studio/embed/book-preview.png?book=Paul%20Smith%20%26%20Associ%C3%A9s%0A%20%20%20%20%20%20%7C%20PERSONA%20You%20are%20a%20company%20lawyer.%0A%20%20%20%20%20%20%7C%20Your%20job%20is%20to%20provide%20legal%20advice%20and%20support%20to%20the%20company%20and%20its%20employees.%0A%20%20%20%20%20%20%7C%20You%20are%20knowledgeable%2C%20professional%2C%20and%20detail-oriented.%0A%20%20%20%20%20%20%7C%20RULE%20Always%20ensure%20compliance%20with%20laws%20and%20regulations.%0A%20%20%20%20%20%20%7C%20RULE%20Never%20provide%20legal%20advice%20outside%20your%20area%20of%20expertise.%0A%20%20%20%20%20%20%7C%20RULE%20Never%20provide%20legal%20advice%20about%20criminal%20law.%0A%20%20%20%20%20%20%7C%20KNOWLEDGE%20%20https%3A%2F%2Fcompany.com%2Fcompany-policies.pdf%0A%20%20%20%20%20%20%7C%20KNOWLEDGE%20https%3A%2F%2Fcompany.com%2Finternal-documents%2Femployee-handbook.docx%0A%20%20%20%20%20%20%7C%20ACTION%20When%20a%20user%20asks%20about%20an%20issue%20that%20could%20be%20treated%20as%20a%20crime%2C%20notify%20legal%40company.com.&width=800&height=450&nonce=0"
375
+ />
376
+
377
+ [Read more about the language](./BLUEPRINT.md)
378
+
379
+ <div style="page-break-after: always;"></div>
380
+
381
+ ### Where to use your AI agent in book
382
+
383
+ Books can be useful in various applications and scenarios. Here are some examples:
384
+
385
+ #### Chat apps:
386
+
387
+ Create your own chat shopping assistant and place it in your eShop.
388
+ 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.
389
+
390
+ #### Reply Agent:
391
+
392
+ 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.
393
+
394
+ #### Coding Agent:
395
+
396
+ 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.
397
+
398
+ This can be integrated to almost any Vibecoding platform, like GitHub Copilot, Amazon CodeWhisperer, Cursor, Cline, Kilocode, Roocode,...
399
+
400
+ They will work the same as you are used to, but with your specific rules written in book.
401
+
402
+ #### Internal Expertise
403
+
404
+ Do you have an app written in TypeScript, Python, C#, Java, or any other language, and you are integrating the AI.
308
405
 
309
- **It's time for a paradigm shift! The future of software is written in plain English, French, or Latin.**
406
+ 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.
310
407
 
311
- During the computer revolution, we have seen [multiple generations of computer languages](https://github.com/webgptorg/promptbook/discussions/180), from the physical rewiring of the vacuum tubes through low-level machine code to the high-level languages like Python or JavaScript. And now, we're on the edge of the **next revolution**!
408
+ 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.
312
409
 
313
- It's a revolution of writing software in **plain human language** that is understandable and executable by both humans and machines – and it's going to change everything!
410
+ Even works in no-code platforms!
314
411
 
315
- The incredible growth in power of microprocessors and the Moore's Law have been the driving force behind the ever-more powerful languages, and it's been an amazing journey! Similarly, the large language models (like GPT or Claude) are the next big thing in language technology, and they're set to transform the way we interact with computers.
412
+ <div style="page-break-after: always;"></div>
316
413
 
317
- This shift will happen whether we're ready or not. Our mission is to make it excellent, not just good.
414
+ ### How to create your AI agent in book
318
415
 
319
- **Join us in this journey!**
416
+ Now you want to use it. There are several ways how to write your first book:
417
+
418
+ #### From scratch with help from Paul
419
+
420
+ We have written ai asistant in book who can help you with writing your first book.
421
+
422
+
423
+
424
+ #### Your AI twin
425
+
426
+ 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.
427
+
428
+
429
+
430
+ #### AI persona workpool
431
+
432
+ 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.
320
433
 
321
434
 
322
435
 
@@ -431,80 +544,7 @@ Join our growing community of developers and users:
431
544
 
432
545
 
433
546
 
434
- ## 📘 Book Language Blueprint
435
-
436
- _A concise, Markdown-based DSL for crafting AI workflows and automations._
437
-
438
- ### Introduction
439
-
440
- Book is a Markdown-based language that simplifies the creation of AI applications, workflows, and automations. With human-readable commands, you can define inputs, outputs, personas, knowledge sources, and actions—without needing model-specific details.
441
-
442
- ### Example
443
-
444
- ```book
445
- # 🌟 My First Book
446
-
447
- - BOOK VERSION 1.0.0
448
- - URL https://promptbook.studio/hello.book
449
- - INPUT PARAMETER {topic}
450
- - OUTPUT PARAMETER {article}
451
-
452
- # Write an Article
453
-
454
- - PERSONA Jane, marketing specialist with prior experience in tech and AI writing
455
- - KNOWLEDGE https://wikipedia.org/
456
- - KNOWLEDGE ./journalist-ethics.pdf
457
- - EXPECT MIN 1 Sentence
458
- - EXPECT MAX 5 Pages
459
-
460
- > Write an article about {topic}
461
-
462
- → {article}
463
- ```
464
-
465
- Each part of the book defines one of three circles:
466
547
 
467
- ### **1. What:** Workflows, Tasks and Parameters
468
-
469
- What work needs to be done. Each book defines a [workflow _(scenario or pipeline)_](https://github.com/webgptorg/promptbook/discussions/88), which is one or more tasks. Each workflow has a fixed input and output. For example, you have a book that generates an article from a topic. Once it generates an article about AI, once about marketing, once about cooking. The workflow (= your AI program) is the same, only the input and output change.
470
-
471
- **Related commands:**
472
-
473
- - [PARAMETER](https://github.com/webgptorg/promptbook/blob/main/documents/commands/PARAMETER.md)
474
-
475
- ### **2. Who:** Personas
476
-
477
- Who does the work. Each task is performed by a persona. A persona is a description of your virtual employee. It is a higher abstraction than the model, tokens, temperature, top-k, top-p and other model parameters.
478
-
479
- You can describe what you want in human language like `Jane, creative writer with a sense of sharp humour` instead of `gpt-4-2024-13-31, temperature 1.2, top-k 40, STOP token ".\n",...`.
480
-
481
- Personas can have access to different knowledge, tools and actions. They can also consult their work with other personas or user, if allowed.
482
-
483
- **Related commands:**
484
-
485
- - [PERSONA](https://github.com/webgptorg/promptbook/blob/main/documents/commands/PERSONA.md)
486
-
487
- ### **3. How:** Knowledge, Instruments and Actions
488
-
489
- The resources used by the personas are used to do the work.
490
-
491
- **Related commands:**
492
-
493
- - [KNOWLEDGE](https://github.com/webgptorg/promptbook/blob/main/documents/commands/KNOWLEDGE.md) of documents, websites, and other resources
494
- - [INSTRUMENT](https://github.com/webgptorg/promptbook/blob/main/documents/commands/INSTRUMENT.md) for real-time data like time, location, weather, stock prices, searching the internet, calculations, etc.
495
- - [ACTION](https://github.com/webgptorg/promptbook/blob/main/documents/commands/ACTION.md) for actions like sending emails, creating files, ending a workflow, etc.
496
-
497
- ### General Principles
498
-
499
- Book language is based on markdown. It is subset of markdown. It is designed to be easy to read and write. It is designed to be understandable by both humans and machines and without specific knowledge of the language.
500
-
501
- The file has a `.book` extension and uses UTF-8 encoding without BOM.
502
-
503
- Books have two variants: flat — just a prompt without structure, and full — with tasks, commands, and prompts.
504
-
505
- As it is source code, it can leverage all the features of version control systems like git and does not suffer from the problems of binary formats, proprietary formats, or no-code solutions.
506
-
507
- But unlike programming languages, it is designed to be understandable by non-programmers and non-technical people.
508
548
 
509
549
 
510
550
 
@@ -584,6 +624,8 @@ The following glossary is used to clarify certain concepts:
584
624
 
585
625
  _Note: This section is not a complete dictionary, more list of general AI / LLM terms that has connection with Promptbook_
586
626
 
627
+
628
+
587
629
  ### 💯 Core concepts
588
630
 
589
631
  - [📚 Collection of pipelines](https://github.com/webgptorg/promptbook/discussions/65)
@@ -1,4 +1,5 @@
1
1
  import type { AgentBasicInformation } from '../../../book-2.0/agent-source/AgentBasicInformation';
2
+ import type { string_book } from '../../../book-2.0/agent-source/string_book';
2
3
  import type { string_css_class } from '../../../types/typeAliases';
3
4
  /**
4
5
  * Props of `AvatarProfile`
@@ -10,6 +11,10 @@ export type AvatarProfileProps = {
10
11
  * Agent to be shown
11
12
  */
12
13
  readonly agent: AgentBasicInformation;
14
+ /**
15
+ * The source of the agent, which will be displayed in the BookEditor.
16
+ */
17
+ readonly agentSource: string_book;
13
18
  /**
14
19
  * Optional CSS class name which will be added to root <div> element
15
20
  */
@@ -0,0 +1,15 @@
1
+ /// <reference types="react" />
2
+ import type { string_book } from '../../../book-2.0/agent-source/string_book';
3
+ type AvatarProfileTooltipProps = {
4
+ agentSource: string_book;
5
+ position: {
6
+ top: number;
7
+ left: number;
8
+ };
9
+ };
10
+ /**
11
+ *
12
+ * @private internal subcomponent of `<Chat>` component
13
+ */
14
+ export declare const AvatarProfileTooltip: import("react").ForwardRefExoticComponent<AvatarProfileTooltipProps & import("react").RefAttributes<HTMLDivElement>>;
15
+ export {};
@@ -8,6 +8,10 @@ import type { string_knowledge_source_content } from '../../types/typeAliases';
8
8
  * @public exported from `@promptbook/components`
9
9
  */
10
10
  export type BookEditorProps = {
11
+ /**
12
+ * The source of the agent to be displayed in the editor.
13
+ */
14
+ readonly agentSource?: string_book;
11
15
  /**
12
16
  * Additional CSS classes to apply to the editor container.
13
17
  */
@@ -16,11 +20,6 @@ export type BookEditorProps = {
16
20
  * Optional CSS style which will be added to root <div/> element
17
21
  */
18
22
  readonly style?: CSSProperties;
19
- /**
20
- * CSS className for a font (e.g. from next/font) to style the editor text.
21
- * If omitted, defaults to system serif fonts.
22
- */
23
- readonly fontClassName?: string;
24
23
  /**
25
24
  * The book which is being edited.
26
25
  */
@@ -46,6 +45,12 @@ export type BookEditorProps = {
46
45
  * By default, the footer is hidden.
47
46
  */
48
47
  readonly isFooterShown?: boolean;
48
+ /**
49
+ * If true, the editor is in read-only mode
50
+ *
51
+ * @default false
52
+ */
53
+ readonly isReadonly?: boolean;
49
54
  };
50
55
  /**
51
56
  * Renders a book editor
@@ -0,0 +1,5 @@
1
+ import type { BookEditorProps } from './BookEditor';
2
+ /**
3
+ * @private Internal component used by `BookEditor`
4
+ */
5
+ export declare function BookEditorMonaco(props: BookEditorProps): import("react/jsx-runtime").JSX.Element;
@@ -3,6 +3,7 @@
3
3
  * In Next.js environments, you can override this by importing the font directly
4
4
  *
5
5
  * @public exported from `@promptbook/components`
6
+ * @deprecated !!! Remove
6
7
  */
7
8
  export declare const DEFAULT_BOOK_FONT_CLASS: any;
8
9
  /**
@@ -1,5 +1,6 @@
1
1
  import type { id, string_color, string_person_fullname, string_url_image } from '../../../types/typeAliases';
2
2
  import { Color } from '../../../utils/color/Color';
3
+ import type { string_book } from '../../../book-2.0/agent-source/string_book';
3
4
  /**
4
5
  * A participant in the chat
5
6
  *
@@ -26,6 +27,10 @@ export type ChatParticipant = {
26
27
  * Color associated with the participant
27
28
  */
28
29
  color?: string_color | Color;
30
+ /**
31
+ * Agent source for avatar profile
32
+ */
33
+ agentSource?: string_book;
29
34
  };
30
35
  /**
31
36
  * TODO: [🕛] Unite `AgentBasicInformation`, `ChatParticipant`, `LlmExecutionTools` + `LlmToolsMetadata`
@@ -0,0 +1,13 @@
1
+ import { ReactNode } from 'react';
2
+ /**
3
+ *
4
+ * @private internal subcomponent of `<Chat>` component
5
+ */
6
+ export declare function Modal({ children, onClose, className, }: {
7
+ children: ReactNode;
8
+ onClose: () => void;
9
+ className?: string;
10
+ }): import("react").ReactPortal;
11
+ /**
12
+ * TODO: !!!! Use this also for feedback modal in Chat component -Make modals DRY
13
+ */
@@ -4,4 +4,4 @@ import type { string_css_class } from '../../../types/typeAliases';
4
4
  *
5
5
  * @private within the `@promptbook/components`
6
6
  */
7
- export declare function classNames(...classes: Array<string_css_class | undefined | false | null>): string_css_class;
7
+ export declare function classNames(...classes: Array<string_css_class | undefined | false | null | 0>): string_css_class;
@@ -35,7 +35,7 @@ export declare const ADMIN_GITHUB_NAME: string_name;
35
35
  *
36
36
  * @public exported from `@promptbook/core`
37
37
  */
38
- export declare const CLAIM = "It's time for a paradigm shift. The future of software in plain English, French or Latin";
38
+ export declare const CLAIM = "Turn your company's scattered knowledge into AI ready books";
39
39
  /**
40
40
  * Color of the Promptbook
41
41
  *
@@ -16,5 +16,6 @@ export type InjectCssModuleIntoShadowRootOptions = {
16
16
  *
17
17
  * @public exported from `@promptbook/components`
18
18
  * <- TODO: [🧠] Make `@promptbook/components-utils`
19
+ * @deprecated This was used for BookEditor shadow DOM support, which is no longer needed
19
20
  */
20
21
  export declare function injectCssModuleIntoShadowRoot(options: InjectCssModuleIntoShadowRootOptions): void;
@@ -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.102.0`).
18
+ * It follows semantic versioning (e.g., `0.103.0-9`).
19
19
  *
20
20
  * @generated
21
21
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@promptbook/types",
3
- "version": "0.103.0-0",
4
- "description": "Promptbook: Run AI apps in plain human language across multiple models and platforms",
3
+ "version": "0.103.0-10",
4
+ "description": "Promptbook: Turn your company's scattered knowledge into AI ready books",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "repository": {
@@ -92,6 +92,6 @@
92
92
  },
93
93
  "typings": "./esm/typings/src/_packages/types.index.d.ts",
94
94
  "peerDependencies": {
95
- "@promptbook/core": "0.103.0-0"
95
+ "@promptbook/core": "0.103.0-10"
96
96
  }
97
97
  }
@@ -1,5 +0,0 @@
1
- import type { BookEditorProps } from './BookEditor';
2
- /**
3
- * @private util of `<BookEditor />`
4
- */
5
- export declare function BookEditorInner(props: BookEditorProps): import("react/jsx-runtime").JSX.Element;