@promptbook/node 0.105.0-1 → 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.
- package/README.md +36 -77
- package/esm/index.es.js +4055 -135
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/browser.index.d.ts +2 -0
- package/esm/typings/src/_packages/core.index.d.ts +4 -0
- package/esm/typings/src/_packages/types.index.d.ts +16 -0
- package/esm/typings/src/_packages/utils.index.d.ts +2 -0
- package/esm/typings/src/book-2.0/agent-source/AgentBasicInformation.d.ts +15 -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/book-components/Chat/AgentChat/AgentChatProps.d.ts +5 -0
- package/esm/typings/src/book-components/Chat/Chat/ChatMessageItem.d.ts +15 -1
- package/esm/typings/src/book-components/Chat/Chat/ChatProps.d.ts +20 -9
- package/esm/typings/src/book-components/Chat/LlmChat/LlmChatProps.d.ts +5 -0
- package/esm/typings/src/book-components/Chat/types/ChatMessage.d.ts +43 -0
- package/esm/typings/src/commitments/NOTE/NOTE.d.ts +2 -2
- package/esm/typings/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +4 -0
- package/esm/typings/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.d.ts +10 -0
- package/esm/typings/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.test.d.ts +1 -0
- package/esm/typings/src/commitments/USE_TIME/USE_TIME.d.ts +44 -0
- package/esm/typings/src/commitments/USE_TIME/USE_TIME.test.d.ts +1 -0
- package/esm/typings/src/commitments/_base/BaseCommitmentDefinition.d.ts +14 -0
- package/esm/typings/src/commitments/_base/CommitmentDefinition.d.ts +14 -0
- package/esm/typings/src/commitments/index.d.ts +17 -2
- package/esm/typings/src/config.d.ts +1 -0
- package/esm/typings/src/execution/LlmExecutionTools.d.ts +3 -1
- 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 +14 -2
- package/esm/typings/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +3 -1
- package/esm/typings/src/llm-providers/agent/AgentOptions.d.ts +7 -0
- package/esm/typings/src/llm-providers/agent/RemoteAgent.d.ts +1 -0
- package/esm/typings/src/llm-providers/agent/RemoteAgentOptions.d.ts +1 -1
- package/esm/typings/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +10 -0
- package/esm/typings/src/llm-providers/openai/OpenAiCompatibleExecutionTools.d.ts +7 -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/search-engines/SearchEngine.d.ts +1 -1
- package/esm/typings/src/search-engines/_index.d.ts +6 -0
- package/esm/typings/src/search-engines/bing/BingSearchEngine.d.ts +1 -1
- package/esm/typings/src/search-engines/dummy/DummySearchEngine.d.ts +1 -1
- package/esm/typings/src/search-engines/google/GoogleSearchEngine.d.ts +18 -0
- package/esm/typings/src/search-engines/serp/SerpSearchEngine.d.ts +15 -0
- package/esm/typings/src/speech-recognition/BrowserSpeechRecognition.d.ts +21 -0
- package/esm/typings/src/speech-recognition/OpenAiSpeechRecognition.d.ts +32 -0
- package/esm/typings/src/types/ModelRequirements.d.ts +6 -12
- package/esm/typings/src/types/SpeechRecognition.d.ts +58 -0
- package/esm/typings/src/types/typeAliases.d.ts +4 -0
- 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/misc/linguisticHash.d.ts +6 -0
- package/esm/typings/src/utils/misc/linguisticHash.test.d.ts +1 -0
- 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 +2 -2
- package/umd/index.umd.js +4055 -135
- package/umd/index.umd.js.map +1 -1
package/README.md
CHANGED
|
@@ -116,19 +116,20 @@ Rest of the documentation is common for **entire promptbook ecosystem**:
|
|
|
116
116
|
|
|
117
117
|
## 📖 The Book Whitepaper
|
|
118
118
|
|
|
119
|
-
|
|
119
|
+
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.
|
|
120
120
|
|
|
121
|
-
The main challenge
|
|
121
|
+
The main challenge lies in **managing the context**, providing rules and knowledge, and narrowing the personality.
|
|
122
122
|
|
|
123
|
-
Promptbook
|
|
123
|
+
In Promptbook, you can define your context **using simple Books** that are very explicit, easy to understand and write, reliable, and highly portable.
|
|
124
124
|
|
|
125
125
|
<table style="border: 1px solid #777; border-radius: 10px;"><tr><td>
|
|
126
126
|
|
|
127
|
-
**<ins>Paul Smith
|
|
127
|
+
**<ins>Paul Smith</ins>**<br/>
|
|
128
128
|
<br/>
|
|
129
129
|
**PERSONA** You are a company lawyer.<br/>
|
|
130
130
|
Your job is to provide legal advice and support to the company and its employees.<br/>
|
|
131
|
-
You are knowledgeable, professional, and detail-oriented.<br/>
|
|
131
|
+
**RULE** You are knowledgeable, professional, and detail-oriented.<br/>
|
|
132
|
+
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/>
|
|
132
133
|
|
|
133
134
|
</td></tr></table>
|
|
134
135
|
|
|
@@ -138,7 +139,9 @@ You are knowledgeable, professional, and detail-oriented.<br/>
|
|
|
138
139
|
|
|
139
140
|
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.
|
|
140
141
|
|
|
141
|
-
You can look at it as prompting (or writing a system message), but decorated by **commitments**.
|
|
142
|
+
You can look at it as "prompting" _(or writing a system message)_, but decorated by **commitments**.
|
|
143
|
+
|
|
144
|
+
**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.
|
|
142
145
|
|
|
143
146
|
#### `Persona` commitment
|
|
144
147
|
|
|
@@ -149,8 +152,6 @@ Personas define the character of your AI persona, its role, and how it should in
|
|
|
149
152
|
**<ins>Paul Smith & Associés</ins>**<br/>
|
|
150
153
|
<br/>
|
|
151
154
|
**PERSONA** You are a company lawyer.<br/>
|
|
152
|
-
Your job is to provide legal advice and support to the company and its employees.<br/>
|
|
153
|
-
You are knowledgeable, professional, and detail-oriented.<br/>
|
|
154
155
|
|
|
155
156
|
</td></tr></table>
|
|
156
157
|
|
|
@@ -170,7 +171,7 @@ Promptbook Engine will automatically enforce this knowledge during interactions.
|
|
|
170
171
|
Your job is to provide legal advice and support to the company and its employees.<br/>
|
|
171
172
|
You are knowledgeable, professional, and detail-oriented.<br/>
|
|
172
173
|
<br/>
|
|
173
|
-
**KNOWLEDGE**
|
|
174
|
+
**KNOWLEDGE** https://company.com/company-policies.pdf<br/>
|
|
174
175
|
**KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
|
|
175
176
|
|
|
176
177
|
</td></tr></table>
|
|
@@ -192,14 +193,14 @@ You are knowledgeable, professional, and detail-oriented.<br/>
|
|
|
192
193
|
**RULE** Always ensure compliance with laws and regulations.<br/>
|
|
193
194
|
**RULE** Never provide legal advice outside your area of expertise.<br/>
|
|
194
195
|
**RULE** Never provide legal advice about criminal law.<br/>
|
|
195
|
-
**KNOWLEDGE**
|
|
196
|
+
**KNOWLEDGE** https://company.com/company-policies.pdf<br/>
|
|
196
197
|
**KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
|
|
197
198
|
|
|
198
199
|
</td></tr></table>
|
|
199
200
|
|
|
200
|
-
#### `
|
|
201
|
+
#### `Team` commitment
|
|
201
202
|
|
|
202
|
-
|
|
203
|
+
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.
|
|
203
204
|
|
|
204
205
|
<table style="border: 1px solid #777; border-radius: 10px;"><tr><td>
|
|
205
206
|
|
|
@@ -212,81 +213,36 @@ You are knowledgeable, professional, and detail-oriented.<br/>
|
|
|
212
213
|
**RULE** Always ensure compliance with laws and regulations.<br/>
|
|
213
214
|
**RULE** Never provide legal advice outside your area of expertise.<br/>
|
|
214
215
|
**RULE** Never provide legal advice about criminal law.<br/>
|
|
215
|
-
**KNOWLEDGE**
|
|
216
|
+
**KNOWLEDGE** https://company.com/company-policies.pdf<br/>
|
|
216
217
|
**KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
|
|
217
|
-
|
|
218
|
+
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/>
|
|
218
219
|
|
|
219
220
|
</td></tr></table>
|
|
220
221
|
|
|
221
|
-
[Read more about the language](./BLUEPRINT.md)
|
|
222
|
-
|
|
223
|
-
<div style="page-break-after: always;"></div>
|
|
224
|
-
|
|
225
|
-
### Where to use your AI agent in book
|
|
226
|
-
|
|
227
|
-
Books can be useful in various applications and scenarios. Here are some examples:
|
|
228
|
-
|
|
229
|
-
#### Chat apps:
|
|
230
222
|
|
|
231
|
-
Create your own chat shopping assistant and place it in your eShop.
|
|
232
|
-
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.
|
|
233
223
|
|
|
234
|
-
|
|
224
|
+
### Promptbook Ecosystem
|
|
235
225
|
|
|
236
|
-
|
|
226
|
+
!!!@@@
|
|
237
227
|
|
|
238
|
-
####
|
|
239
|
-
|
|
240
|
-
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.
|
|
241
|
-
|
|
242
|
-
This can be integrated to almost any Vibecoding platform, like GitHub Copilot, Amazon CodeWhisperer, Cursor, Cline, Kilocode, Roocode,...
|
|
243
|
-
|
|
244
|
-
They will work the same as you are used to, but with your specific rules written in book.
|
|
245
|
-
|
|
246
|
-
#### Internal Expertise
|
|
247
|
-
|
|
248
|
-
Do you have an app written in TypeScript, Python, C#, Java, or any other language, and you are integrating the AI.
|
|
249
|
-
|
|
250
|
-
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.
|
|
251
|
-
|
|
252
|
-
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.
|
|
253
|
-
|
|
254
|
-
Even works in no-code platforms!
|
|
255
|
-
|
|
256
|
-
<div style="page-break-after: always;"></div>
|
|
228
|
+
#### Promptbook Server
|
|
257
229
|
|
|
258
|
-
|
|
230
|
+
!!!@@@
|
|
259
231
|
|
|
260
|
-
|
|
232
|
+
#### Promptbook Engine
|
|
261
233
|
|
|
262
|
-
|
|
234
|
+
!!!@@@
|
|
263
235
|
|
|
264
|
-
We have written ai asistant in book who can help you with writing your first book.
|
|
265
236
|
|
|
266
|
-
#### Your AI twin
|
|
267
237
|
|
|
268
|
-
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.
|
|
269
238
|
|
|
270
|
-
#### AI persona workpool
|
|
271
239
|
|
|
272
|
-
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.
|
|
273
240
|
|
|
274
241
|
|
|
275
242
|
|
|
276
243
|
|
|
277
244
|
|
|
278
245
|
|
|
279
|
-
## 🚀 Get started
|
|
280
|
-
|
|
281
|
-
Take a look at the simple starter kit with books integrated into the **Hello World** sample applications:
|
|
282
|
-
|
|
283
|
-
- [Hello Book](https://github.com/webgptorg/hello-world)
|
|
284
|
-
- [Hello Book in Node.js](https://github.com/webgptorg/hello-world-node-js)
|
|
285
|
-
- [Hello Book in Next.js](https://github.com/webgptorg/hello-world-next-js)
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
246
|
|
|
291
247
|
|
|
292
248
|
## 💜 The Promptbook Project
|
|
@@ -302,33 +258,32 @@ Promptbook project is ecosystem of multiple projects and tools, following is a l
|
|
|
302
258
|
</thead>
|
|
303
259
|
<tbody>
|
|
304
260
|
<tr>
|
|
305
|
-
<td><a href="https://
|
|
261
|
+
<td><a href="https://gallery.ptbk.io/">Agents Server</a></td>
|
|
306
262
|
<td>
|
|
307
|
-
|
|
308
|
-
<hr>
|
|
309
|
-
There is also <a href="https://github.com/webgptorg/book-extension">a plugin for VSCode</a> to support <code>.book</code> file extension
|
|
263
|
+
Place where you "AI agents live". It allows to create, manage, deploy, and interact with AI agents created in Book language.
|
|
310
264
|
</td>
|
|
311
265
|
</tr>
|
|
312
266
|
<tr>
|
|
313
|
-
<td><a href="https://github.com/webgptorg/
|
|
267
|
+
<td><a href="https://github.com/webgptorg/book">Book language</a></td>
|
|
314
268
|
<td>
|
|
315
|
-
|
|
269
|
+
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.
|
|
270
|
+
<hr>
|
|
271
|
+
There is also <a href="https://github.com/webgptorg/book-extension">a plugin for VSCode</a> to support <code>.book</code> file extension
|
|
316
272
|
</td>
|
|
317
273
|
</tr>
|
|
318
274
|
<tr>
|
|
319
|
-
<td><a href="https://promptbook
|
|
275
|
+
<td><a href="https://github.com/webgptorg/promptbook">Promptbook Engine</a></td>
|
|
320
276
|
<td>
|
|
321
|
-
Promptbook
|
|
277
|
+
Promptbook engine can run AI agents based on Book language.
|
|
278
|
+
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>
|
|
279
|
+
Agent Server is based on Promptbook Engine.
|
|
322
280
|
</td>
|
|
323
281
|
</tr>
|
|
282
|
+
|
|
324
283
|
</tbody>
|
|
325
284
|
</table>
|
|
326
285
|
|
|
327
|
-
Hello world examples:
|
|
328
286
|
|
|
329
|
-
- [Hello world](https://github.com/webgptorg/hello-world)
|
|
330
|
-
- [Hello world in Node.js](https://github.com/webgptorg/hello-world-node-js)
|
|
331
|
-
- [Hello world in Next.js](https://github.com/webgptorg/hello-world-next-js)
|
|
332
287
|
|
|
333
288
|
### 🌐 Community & Social Media
|
|
334
289
|
|
|
@@ -386,6 +341,8 @@ Join our growing community of developers and users:
|
|
|
386
341
|
|
|
387
342
|
|
|
388
343
|
|
|
344
|
+
|
|
345
|
+
|
|
389
346
|
## 📚 Documentation
|
|
390
347
|
|
|
391
348
|
See detailed guides and API reference in the [docs](https://github.com/webgptorg/promptbook/discussions/categories/concepts) or [online](https://discord.gg/x3QWNaa89N).
|
|
@@ -462,6 +419,8 @@ The following glossary is used to clarify certain concepts:
|
|
|
462
419
|
|
|
463
420
|
_Note: This section is not a complete dictionary, more list of general AI / LLM terms that has connection with Promptbook_
|
|
464
421
|
|
|
422
|
+
|
|
423
|
+
|
|
465
424
|
### 💯 Core concepts
|
|
466
425
|
|
|
467
426
|
- [📚 Collection of pipelines](https://github.com/webgptorg/promptbook/discussions/65)
|