@promptbook/wizard 0.105.0-3 → 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 CHANGED
@@ -72,19 +72,20 @@ Rest of the documentation is common for **entire promptbook ecosystem**:
72
72
 
73
73
  ## 📖 The Book Whitepaper
74
74
 
75
- 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.
75
+ 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.
76
76
 
77
- 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.
77
+ The main challenge lies in **managing the context**, providing rules and knowledge, and narrowing the personality.
78
78
 
79
- 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.
79
+ In Promptbook, you can define your context **using simple Books** that are very explicit, easy to understand and write, reliable, and highly portable.
80
80
 
81
81
  <table style="border: 1px solid #777; border-radius: 10px;"><tr><td>
82
82
 
83
- **<ins>Paul Smith & Associés</ins>**<br/>
83
+ **<ins>Paul Smith</ins>**<br/>
84
84
  <br/>
85
85
  **PERSONA** You are a company lawyer.<br/>
86
86
  Your job is to provide legal advice and support to the company and its employees.<br/>
87
- You are knowledgeable, professional, and detail-oriented.<br/>
87
+ **RULE** You are knowledgeable, professional, and detail-oriented.<br/>
88
+ 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/>
88
89
 
89
90
  </td></tr></table>
90
91
 
@@ -94,7 +95,9 @@ You are knowledgeable, professional, and detail-oriented.<br/>
94
95
 
95
96
  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.
96
97
 
97
- You can look at it as prompting (or writing a system message), but decorated by **commitments**.
98
+ You can look at it as "prompting" _(or writing a system message)_, but decorated by **commitments**.
99
+
100
+ **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.
98
101
 
99
102
  #### `Persona` commitment
100
103
 
@@ -105,8 +108,6 @@ Personas define the character of your AI persona, its role, and how it should in
105
108
  **<ins>Paul Smith & Associés</ins>**<br/>
106
109
  <br/>
107
110
  **PERSONA** You are a company lawyer.<br/>
108
- Your job is to provide legal advice and support to the company and its employees.<br/>
109
- You are knowledgeable, professional, and detail-oriented.<br/>
110
111
 
111
112
  </td></tr></table>
112
113
 
@@ -126,7 +127,7 @@ Promptbook Engine will automatically enforce this knowledge during interactions.
126
127
  Your job is to provide legal advice and support to the company and its employees.<br/>
127
128
  You are knowledgeable, professional, and detail-oriented.<br/>
128
129
  <br/>
129
- **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
130
+ **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
130
131
  **KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
131
132
 
132
133
  </td></tr></table>
@@ -148,14 +149,14 @@ You are knowledgeable, professional, and detail-oriented.<br/>
148
149
  **RULE** Always ensure compliance with laws and regulations.<br/>
149
150
  **RULE** Never provide legal advice outside your area of expertise.<br/>
150
151
  **RULE** Never provide legal advice about criminal law.<br/>
151
- **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
152
+ **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
152
153
  **KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
153
154
 
154
155
  </td></tr></table>
155
156
 
156
- #### `Action` commitment
157
+ #### `Team` commitment
157
158
 
158
- 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.
159
+ 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.
159
160
 
160
161
  <table style="border: 1px solid #777; border-radius: 10px;"><tr><td>
161
162
 
@@ -168,81 +169,36 @@ You are knowledgeable, professional, and detail-oriented.<br/>
168
169
  **RULE** Always ensure compliance with laws and regulations.<br/>
169
170
  **RULE** Never provide legal advice outside your area of expertise.<br/>
170
171
  **RULE** Never provide legal advice about criminal law.<br/>
171
- **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
172
+ **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
172
173
  **KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
173
- **ACTION** When a user asks about an issue that could be treated as a crime, notify legal@company.com.<br/>
174
+ 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/>
174
175
 
175
176
  </td></tr></table>
176
177
 
177
- [Read more about the language](./BLUEPRINT.md)
178
-
179
- <div style="page-break-after: always;"></div>
180
-
181
- ### Where to use your AI agent in book
182
-
183
- Books can be useful in various applications and scenarios. Here are some examples:
184
-
185
- #### Chat apps:
186
178
 
187
- Create your own chat shopping assistant and place it in your eShop.
188
- 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.
189
179
 
190
- #### Reply Agent:
180
+ ### Promptbook Ecosystem
191
181
 
192
- 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.
182
+ !!!@@@
193
183
 
194
- #### Coding Agent:
195
-
196
- 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.
197
-
198
- This can be integrated to almost any Vibecoding platform, like GitHub Copilot, Amazon CodeWhisperer, Cursor, Cline, Kilocode, Roocode,...
199
-
200
- They will work the same as you are used to, but with your specific rules written in book.
201
-
202
- #### Internal Expertise
203
-
204
- Do you have an app written in TypeScript, Python, C#, Java, or any other language, and you are integrating the AI.
205
-
206
- 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.
207
-
208
- 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.
209
-
210
- Even works in no-code platforms!
211
-
212
- <div style="page-break-after: always;"></div>
184
+ #### Promptbook Server
213
185
 
214
- ### How to create your AI agent in book
186
+ !!!@@@
215
187
 
216
- Now you want to use it. There are several ways how to write your first book:
188
+ #### Promptbook Engine
217
189
 
218
- #### From scratch with help from Paul
190
+ !!!@@@
219
191
 
220
- We have written ai asistant in book who can help you with writing your first book.
221
192
 
222
- #### Your AI twin
223
193
 
224
- 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.
225
194
 
226
- #### AI persona workpool
227
195
 
228
- 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.
229
196
 
230
197
 
231
198
 
232
199
 
233
200
 
234
201
 
235
- ## 🚀 Get started
236
-
237
- Take a look at the simple starter kit with books integrated into the **Hello World** sample applications:
238
-
239
- - [Hello Book](https://github.com/webgptorg/hello-world)
240
- - [Hello Book in Node.js](https://github.com/webgptorg/hello-world-node-js)
241
- - [Hello Book in Next.js](https://github.com/webgptorg/hello-world-next-js)
242
-
243
-
244
-
245
-
246
202
 
247
203
 
248
204
  ## 💜 The Promptbook Project
@@ -258,33 +214,32 @@ Promptbook project is ecosystem of multiple projects and tools, following is a l
258
214
  </thead>
259
215
  <tbody>
260
216
  <tr>
261
- <td><a href="https://github.com/webgptorg/book">Book language</a></td>
217
+ <td><a href="https://gallery.ptbk.io/">Agents Server</a></td>
262
218
  <td>
263
- Book is a human-understandable markup language for writing AI applications such as chatbots, knowledge bases, agents, avarars, translators, automations and more.
264
- <hr>
265
- There is also <a href="https://github.com/webgptorg/book-extension">a plugin for VSCode</a> to support <code>.book</code> file extension
219
+ Place where you "AI agents live". It allows to create, manage, deploy, and interact with AI agents created in Book language.
266
220
  </td>
267
221
  </tr>
268
222
  <tr>
269
- <td><a href="https://github.com/webgptorg/promptbook">Promptbook Engine</a></td>
223
+ <td><a href="https://github.com/webgptorg/book">Book language</a></td>
270
224
  <td>
271
- 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>
225
+ 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.
226
+ <hr>
227
+ There is also <a href="https://github.com/webgptorg/book-extension">a plugin for VSCode</a> to support <code>.book</code> file extension
272
228
  </td>
273
229
  </tr>
274
230
  <tr>
275
- <td><a href="https://promptbook.studio">Promptbook Studio</a></td>
231
+ <td><a href="https://github.com/webgptorg/promptbook">Promptbook Engine</a></td>
276
232
  <td>
277
- Promptbook.studio is a web-based editor and runner for book applications. It is still in the experimental MVP stage.
233
+ Promptbook engine can run AI agents based on Book language.
234
+ 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>
235
+ Agent Server is based on Promptbook Engine.
278
236
  </td>
279
237
  </tr>
238
+
280
239
  </tbody>
281
240
  </table>
282
241
 
283
- Hello world examples:
284
242
 
285
- - [Hello world](https://github.com/webgptorg/hello-world)
286
- - [Hello world in Node.js](https://github.com/webgptorg/hello-world-node-js)
287
- - [Hello world in Next.js](https://github.com/webgptorg/hello-world-next-js)
288
243
 
289
244
  ### 🌐 Community & Social Media
290
245
 
@@ -342,6 +297,8 @@ Join our growing community of developers and users:
342
297
 
343
298
 
344
299
 
300
+
301
+
345
302
  ## 📚 Documentation
346
303
 
347
304
  See detailed guides and API reference in the [docs](https://github.com/webgptorg/promptbook/discussions/categories/concepts) or [online](https://discord.gg/x3QWNaa89N).
@@ -418,6 +375,8 @@ The following glossary is used to clarify certain concepts:
418
375
 
419
376
  _Note: This section is not a complete dictionary, more list of general AI / LLM terms that has connection with Promptbook_
420
377
 
378
+
379
+
421
380
  ### 💯 Core concepts
422
381
 
423
382
  - [📚 Collection of pipelines](https://github.com/webgptorg/promptbook/discussions/65)
package/esm/index.es.js CHANGED
@@ -36,7 +36,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
36
36
  * @generated
37
37
  * @see https://github.com/webgptorg/promptbook
38
38
  */
39
- const PROMPTBOOK_ENGINE_VERSION = '0.105.0-3';
39
+ const PROMPTBOOK_ENGINE_VERSION = '0.105.0-4';
40
40
  /**
41
41
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
42
42
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -5972,7 +5972,7 @@ class OpenAiCompatibleExecutionTools {
5972
5972
  const args = ${functionArgs};
5973
5973
  return await ${functionName}(args);
5974
5974
  `,
5975
- parameters: {}, // <- TODO: [🧠] What parameters to pass?
5975
+ parameters: prompt.parameters,
5976
5976
  });
5977
5977
  }
5978
5978
  catch (error) {
@@ -8237,7 +8237,7 @@ class OpenAiAssistantExecutionTools extends OpenAiExecutionTools {
8237
8237
  const args = ${JSON.stringify(functionArgs)};
8238
8238
  return await ${functionName}(args);
8239
8239
  `,
8240
- parameters: {}, // <- TODO: [🧠] What parameters to pass?
8240
+ parameters: prompt.parameters,
8241
8241
  });
8242
8242
  if (this.options.isVerbose) {
8243
8243
  console.info(`✅ Tool ${functionName} executed:`, functionResponse);
@@ -17826,7 +17826,12 @@ class UseTimeCommitmentDefinition extends BaseCommitmentDefinition {
17826
17826
  description: 'Get the current date and time in ISO 8601 format.',
17827
17827
  parameters: {
17828
17828
  type: 'object',
17829
- properties: {},
17829
+ properties: {
17830
+ timezone: {
17831
+ type: 'string',
17832
+ description: 'Optional timezone name (e.g. "Europe/Prague", "UTC", "America/New_York").',
17833
+ },
17834
+ },
17830
17835
  required: [],
17831
17836
  },
17832
17837
  },
@@ -17846,9 +17851,36 @@ class UseTimeCommitmentDefinition extends BaseCommitmentDefinition {
17846
17851
  */
17847
17852
  getToolFunctions() {
17848
17853
  return {
17849
- async get_current_time() {
17850
- console.log('!!!! [Tool] get_current_time called');
17851
- return new Date().toISOString();
17854
+ async get_current_time(args) {
17855
+ var _a;
17856
+ console.log('!!!! [Tool] get_current_time called', { args });
17857
+ const { timezone } = args;
17858
+ if (!timezone) {
17859
+ return new Date().toISOString();
17860
+ }
17861
+ try {
17862
+ // Note: Returning ISO 8601 string but in the requested timezone
17863
+ const formatter = new Intl.DateTimeFormat('en-CA', {
17864
+ timeZone: timezone,
17865
+ year: 'numeric',
17866
+ month: '2-digit',
17867
+ day: '2-digit',
17868
+ hour: '2-digit',
17869
+ minute: '2-digit',
17870
+ second: '2-digit',
17871
+ hour12: false,
17872
+ timeZoneName: 'shortOffset',
17873
+ });
17874
+ const parts = formatter.formatToParts(new Date());
17875
+ const part = (type) => { var _a; return (_a = parts.find((p) => p.type === type)) === null || _a === void 0 ? void 0 : _a.value; };
17876
+ // en-CA format is YYYY-MM-DD
17877
+ const isoString = `${part('year')}-${part('month')}-${part('day')}T${part('hour')}:${part('minute')}:${part('second')}${(_a = part('timeZoneName')) === null || _a === void 0 ? void 0 : _a.replace('GMT', '')}`;
17878
+ return isoString;
17879
+ }
17880
+ catch (error) {
17881
+ // Fallback to UTC if timezone is invalid
17882
+ return new Date().toISOString();
17883
+ }
17852
17884
  },
17853
17885
  };
17854
17886
  }