@promptbook/utils 0.105.0-1 → 0.105.0-4
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 +36 -77
- package/esm/index.es.js +2 -1
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/core.index.d.ts +2 -0
- package/esm/typings/src/_packages/types.index.d.ts +4 -0
- package/esm/typings/src/book-2.0/agent-source/AgentBasicInformation.d.ts +10 -3
- package/esm/typings/src/book-2.0/agent-source/AgentModelRequirements.d.ts +11 -1
- package/esm/typings/src/book-2.0/agent-source/communication-samples.test.d.ts +1 -0
- package/esm/typings/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments.blocks.test.d.ts +1 -0
- package/esm/typings/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments.import.test.d.ts +1 -0
- package/esm/typings/src/book-2.0/agent-source/parseAgentSource.import.test.d.ts +1 -0
- package/esm/typings/src/book-2.0/agent-source/parseAgentSourceWithCommitments.blocks.test.d.ts +1 -0
- package/esm/typings/src/commitments/USE_TIME/USE_TIME.d.ts +40 -0
- package/esm/typings/src/commitments/USE_TIME/USE_TIME.test.d.ts +1 -0
- package/esm/typings/src/commitments/_base/BaseCommitmentDefinition.d.ts +8 -0
- package/esm/typings/src/commitments/_base/CommitmentDefinition.d.ts +8 -0
- package/esm/typings/src/commitments/index.d.ts +11 -2
- package/esm/typings/src/config.d.ts +1 -0
- package/esm/typings/src/import-plugins/$fileImportPlugins.d.ts +7 -0
- package/esm/typings/src/import-plugins/AgentFileImportPlugin.d.ts +7 -0
- package/esm/typings/src/import-plugins/FileImportPlugin.d.ts +24 -0
- package/esm/typings/src/import-plugins/JsonFileImportPlugin.d.ts +7 -0
- package/esm/typings/src/import-plugins/TextFileImportPlugin.d.ts +7 -0
- package/esm/typings/src/llm-providers/_common/utils/cache/cacheLlmTools.d.ts +2 -1
- package/esm/typings/src/llm-providers/_common/utils/count-total-usage/countUsage.d.ts +2 -2
- package/esm/typings/src/llm-providers/agent/Agent.d.ts +9 -2
- package/esm/typings/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +3 -1
- package/esm/typings/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +10 -0
- package/esm/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +1 -1
- package/esm/typings/src/scripting/javascript/JavascriptExecutionToolsOptions.d.ts +6 -1
- package/esm/typings/src/types/ModelRequirements.d.ts +6 -12
- package/esm/typings/src/utils/execCommand/$execCommandNormalizeOptions.d.ts +2 -3
- package/esm/typings/src/utils/execCommand/ExecCommandOptions.d.ts +7 -1
- package/esm/typings/src/utils/organization/keepImported.d.ts +9 -0
- package/esm/typings/src/utils/organization/keepTypeImported.d.ts +0 -1
- package/esm/typings/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/umd/index.umd.js +2 -1
- package/umd/index.umd.js.map +1 -1
package/README.md
CHANGED
|
@@ -361,19 +361,20 @@ Rest of the documentation is common for **entire promptbook ecosystem**:
|
|
|
361
361
|
|
|
362
362
|
## 📖 The Book Whitepaper
|
|
363
363
|
|
|
364
|
-
|
|
364
|
+
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.
|
|
365
365
|
|
|
366
|
-
The main challenge
|
|
366
|
+
The main challenge lies in **managing the context**, providing rules and knowledge, and narrowing the personality.
|
|
367
367
|
|
|
368
|
-
Promptbook
|
|
368
|
+
In Promptbook, you can define your context **using simple Books** that are very explicit, easy to understand and write, reliable, and highly portable.
|
|
369
369
|
|
|
370
370
|
<table style="border: 1px solid #777; border-radius: 10px;"><tr><td>
|
|
371
371
|
|
|
372
|
-
**<ins>Paul Smith
|
|
372
|
+
**<ins>Paul Smith</ins>**<br/>
|
|
373
373
|
<br/>
|
|
374
374
|
**PERSONA** You are a company lawyer.<br/>
|
|
375
375
|
Your job is to provide legal advice and support to the company and its employees.<br/>
|
|
376
|
-
You are knowledgeable, professional, and detail-oriented.<br/>
|
|
376
|
+
**RULE** You are knowledgeable, professional, and detail-oriented.<br/>
|
|
377
|
+
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/>
|
|
377
378
|
|
|
378
379
|
</td></tr></table>
|
|
379
380
|
|
|
@@ -383,7 +384,9 @@ You are knowledgeable, professional, and detail-oriented.<br/>
|
|
|
383
384
|
|
|
384
385
|
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.
|
|
385
386
|
|
|
386
|
-
You can look at it as prompting (or writing a system message), but decorated by **commitments**.
|
|
387
|
+
You can look at it as "prompting" _(or writing a system message)_, but decorated by **commitments**.
|
|
388
|
+
|
|
389
|
+
**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.
|
|
387
390
|
|
|
388
391
|
#### `Persona` commitment
|
|
389
392
|
|
|
@@ -394,8 +397,6 @@ Personas define the character of your AI persona, its role, and how it should in
|
|
|
394
397
|
**<ins>Paul Smith & Associés</ins>**<br/>
|
|
395
398
|
<br/>
|
|
396
399
|
**PERSONA** You are a company lawyer.<br/>
|
|
397
|
-
Your job is to provide legal advice and support to the company and its employees.<br/>
|
|
398
|
-
You are knowledgeable, professional, and detail-oriented.<br/>
|
|
399
400
|
|
|
400
401
|
</td></tr></table>
|
|
401
402
|
|
|
@@ -415,7 +416,7 @@ Promptbook Engine will automatically enforce this knowledge during interactions.
|
|
|
415
416
|
Your job is to provide legal advice and support to the company and its employees.<br/>
|
|
416
417
|
You are knowledgeable, professional, and detail-oriented.<br/>
|
|
417
418
|
<br/>
|
|
418
|
-
**KNOWLEDGE**
|
|
419
|
+
**KNOWLEDGE** https://company.com/company-policies.pdf<br/>
|
|
419
420
|
**KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
|
|
420
421
|
|
|
421
422
|
</td></tr></table>
|
|
@@ -437,14 +438,14 @@ You are knowledgeable, professional, and detail-oriented.<br/>
|
|
|
437
438
|
**RULE** Always ensure compliance with laws and regulations.<br/>
|
|
438
439
|
**RULE** Never provide legal advice outside your area of expertise.<br/>
|
|
439
440
|
**RULE** Never provide legal advice about criminal law.<br/>
|
|
440
|
-
**KNOWLEDGE**
|
|
441
|
+
**KNOWLEDGE** https://company.com/company-policies.pdf<br/>
|
|
441
442
|
**KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
|
|
442
443
|
|
|
443
444
|
</td></tr></table>
|
|
444
445
|
|
|
445
|
-
#### `
|
|
446
|
+
#### `Team` commitment
|
|
446
447
|
|
|
447
|
-
|
|
448
|
+
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.
|
|
448
449
|
|
|
449
450
|
<table style="border: 1px solid #777; border-radius: 10px;"><tr><td>
|
|
450
451
|
|
|
@@ -457,81 +458,36 @@ You are knowledgeable, professional, and detail-oriented.<br/>
|
|
|
457
458
|
**RULE** Always ensure compliance with laws and regulations.<br/>
|
|
458
459
|
**RULE** Never provide legal advice outside your area of expertise.<br/>
|
|
459
460
|
**RULE** Never provide legal advice about criminal law.<br/>
|
|
460
|
-
**KNOWLEDGE**
|
|
461
|
+
**KNOWLEDGE** https://company.com/company-policies.pdf<br/>
|
|
461
462
|
**KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
|
|
462
|
-
|
|
463
|
+
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/>
|
|
463
464
|
|
|
464
465
|
</td></tr></table>
|
|
465
466
|
|
|
466
|
-
[Read more about the language](./BLUEPRINT.md)
|
|
467
|
-
|
|
468
|
-
<div style="page-break-after: always;"></div>
|
|
469
|
-
|
|
470
|
-
### Where to use your AI agent in book
|
|
471
|
-
|
|
472
|
-
Books can be useful in various applications and scenarios. Here are some examples:
|
|
473
|
-
|
|
474
|
-
#### Chat apps:
|
|
475
467
|
|
|
476
|
-
Create your own chat shopping assistant and place it in your eShop.
|
|
477
|
-
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.
|
|
478
468
|
|
|
479
|
-
|
|
469
|
+
### Promptbook Ecosystem
|
|
480
470
|
|
|
481
|
-
|
|
471
|
+
!!!@@@
|
|
482
472
|
|
|
483
|
-
####
|
|
484
|
-
|
|
485
|
-
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.
|
|
486
|
-
|
|
487
|
-
This can be integrated to almost any Vibecoding platform, like GitHub Copilot, Amazon CodeWhisperer, Cursor, Cline, Kilocode, Roocode,...
|
|
488
|
-
|
|
489
|
-
They will work the same as you are used to, but with your specific rules written in book.
|
|
490
|
-
|
|
491
|
-
#### Internal Expertise
|
|
492
|
-
|
|
493
|
-
Do you have an app written in TypeScript, Python, C#, Java, or any other language, and you are integrating the AI.
|
|
494
|
-
|
|
495
|
-
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.
|
|
496
|
-
|
|
497
|
-
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.
|
|
498
|
-
|
|
499
|
-
Even works in no-code platforms!
|
|
500
|
-
|
|
501
|
-
<div style="page-break-after: always;"></div>
|
|
473
|
+
#### Promptbook Server
|
|
502
474
|
|
|
503
|
-
|
|
475
|
+
!!!@@@
|
|
504
476
|
|
|
505
|
-
|
|
477
|
+
#### Promptbook Engine
|
|
506
478
|
|
|
507
|
-
|
|
479
|
+
!!!@@@
|
|
508
480
|
|
|
509
|
-
We have written ai asistant in book who can help you with writing your first book.
|
|
510
481
|
|
|
511
|
-
#### Your AI twin
|
|
512
482
|
|
|
513
|
-
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.
|
|
514
483
|
|
|
515
|
-
#### AI persona workpool
|
|
516
484
|
|
|
517
|
-
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.
|
|
518
485
|
|
|
519
486
|
|
|
520
487
|
|
|
521
488
|
|
|
522
489
|
|
|
523
490
|
|
|
524
|
-
## 🚀 Get started
|
|
525
|
-
|
|
526
|
-
Take a look at the simple starter kit with books integrated into the **Hello World** sample applications:
|
|
527
|
-
|
|
528
|
-
- [Hello Book](https://github.com/webgptorg/hello-world)
|
|
529
|
-
- [Hello Book in Node.js](https://github.com/webgptorg/hello-world-node-js)
|
|
530
|
-
- [Hello Book in Next.js](https://github.com/webgptorg/hello-world-next-js)
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
491
|
|
|
536
492
|
|
|
537
493
|
## 💜 The Promptbook Project
|
|
@@ -547,33 +503,32 @@ Promptbook project is ecosystem of multiple projects and tools, following is a l
|
|
|
547
503
|
</thead>
|
|
548
504
|
<tbody>
|
|
549
505
|
<tr>
|
|
550
|
-
<td><a href="https://
|
|
506
|
+
<td><a href="https://gallery.ptbk.io/">Agents Server</a></td>
|
|
551
507
|
<td>
|
|
552
|
-
|
|
553
|
-
<hr>
|
|
554
|
-
There is also <a href="https://github.com/webgptorg/book-extension">a plugin for VSCode</a> to support <code>.book</code> file extension
|
|
508
|
+
Place where you "AI agents live". It allows to create, manage, deploy, and interact with AI agents created in Book language.
|
|
555
509
|
</td>
|
|
556
510
|
</tr>
|
|
557
511
|
<tr>
|
|
558
|
-
<td><a href="https://github.com/webgptorg/
|
|
512
|
+
<td><a href="https://github.com/webgptorg/book">Book language</a></td>
|
|
559
513
|
<td>
|
|
560
|
-
|
|
514
|
+
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.
|
|
515
|
+
<hr>
|
|
516
|
+
There is also <a href="https://github.com/webgptorg/book-extension">a plugin for VSCode</a> to support <code>.book</code> file extension
|
|
561
517
|
</td>
|
|
562
518
|
</tr>
|
|
563
519
|
<tr>
|
|
564
|
-
<td><a href="https://promptbook
|
|
520
|
+
<td><a href="https://github.com/webgptorg/promptbook">Promptbook Engine</a></td>
|
|
565
521
|
<td>
|
|
566
|
-
Promptbook
|
|
522
|
+
Promptbook engine can run AI agents based on Book language.
|
|
523
|
+
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>
|
|
524
|
+
Agent Server is based on Promptbook Engine.
|
|
567
525
|
</td>
|
|
568
526
|
</tr>
|
|
527
|
+
|
|
569
528
|
</tbody>
|
|
570
529
|
</table>
|
|
571
530
|
|
|
572
|
-
Hello world examples:
|
|
573
531
|
|
|
574
|
-
- [Hello world](https://github.com/webgptorg/hello-world)
|
|
575
|
-
- [Hello world in Node.js](https://github.com/webgptorg/hello-world-node-js)
|
|
576
|
-
- [Hello world in Next.js](https://github.com/webgptorg/hello-world-next-js)
|
|
577
532
|
|
|
578
533
|
### 🌐 Community & Social Media
|
|
579
534
|
|
|
@@ -631,6 +586,8 @@ Join our growing community of developers and users:
|
|
|
631
586
|
|
|
632
587
|
|
|
633
588
|
|
|
589
|
+
|
|
590
|
+
|
|
634
591
|
## 📚 Documentation
|
|
635
592
|
|
|
636
593
|
See detailed guides and API reference in the [docs](https://github.com/webgptorg/promptbook/discussions/categories/concepts) or [online](https://discord.gg/x3QWNaa89N).
|
|
@@ -707,6 +664,8 @@ The following glossary is used to clarify certain concepts:
|
|
|
707
664
|
|
|
708
665
|
_Note: This section is not a complete dictionary, more list of general AI / LLM terms that has connection with Promptbook_
|
|
709
666
|
|
|
667
|
+
|
|
668
|
+
|
|
710
669
|
### 💯 Core concepts
|
|
711
670
|
|
|
712
671
|
- [📚 Collection of pipelines](https://github.com/webgptorg/promptbook/discussions/65)
|
package/esm/index.es.js
CHANGED
|
@@ -18,7 +18,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
18
18
|
* @generated
|
|
19
19
|
* @see https://github.com/webgptorg/promptbook
|
|
20
20
|
*/
|
|
21
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.105.0-
|
|
21
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.105.0-4';
|
|
22
22
|
/**
|
|
23
23
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
24
24
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -943,6 +943,7 @@ const PROMPTBOOK_COLOR = Color.fromString('promptbook');
|
|
|
943
943
|
SEPARATOR: Color.fromHex('#cccccc'),
|
|
944
944
|
COMMITMENT: Color.fromHex('#DA0F78'),
|
|
945
945
|
PARAMETER: Color.fromHex('#8e44ad'),
|
|
946
|
+
CODE_BLOCK: Color.fromHex('#7700ffff'),
|
|
946
947
|
});
|
|
947
948
|
// <- TODO: [🧠][🈵] Using `Color` here increases the package size approx 3kb, maybe remove it
|
|
948
949
|
/**
|