@promptbook/browser 0.112.0 → 0.113.0-1

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 (34) hide show
  1. package/README.md +45 -29
  2. package/esm/index.es.js +123 -10
  3. package/esm/index.es.js.map +1 -1
  4. package/esm/src/_packages/core.index.d.ts +22 -0
  5. package/esm/src/_packages/types.index.d.ts +2 -0
  6. package/esm/src/book-2.0/agent-source/AgentBasicInformation.d.ts +2 -0
  7. package/esm/src/book-2.0/agent-source/agentSourceVisibility.d.ts +97 -0
  8. package/esm/src/book-2.0/agent-source/agentSourceVisibility.test.d.ts +1 -0
  9. package/esm/src/book-components/BookEditor/BookEditorMonacoTokenization.d.ts +1 -0
  10. package/esm/src/book-components/Chat/Chat/CitationIframePreview.d.ts +2 -2
  11. package/esm/src/book-components/Chat/utils/livePagePreviewConstants.d.ts +12 -0
  12. package/esm/src/cli/cli-commands/agents-server/buildAgentsServer.d.ts +6 -0
  13. package/esm/src/collection/agent-collection/CreateAgentInput.d.ts +2 -1
  14. package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/prepareAgentSourceForPersistence.d.ts +21 -1
  15. package/esm/src/commitments/META_VISIBILITY/META_VISIBILITY.d.ts +27 -0
  16. package/esm/src/commitments/index.d.ts +2 -1
  17. package/esm/src/version.d.ts +1 -1
  18. package/package.json +2 -2
  19. package/umd/index.umd.js +123 -10
  20. package/umd/index.umd.js.map +1 -1
  21. package/umd/src/_packages/core.index.d.ts +22 -0
  22. package/umd/src/_packages/types.index.d.ts +2 -0
  23. package/umd/src/book-2.0/agent-source/AgentBasicInformation.d.ts +2 -0
  24. package/umd/src/book-2.0/agent-source/agentSourceVisibility.d.ts +97 -0
  25. package/umd/src/book-2.0/agent-source/agentSourceVisibility.test.d.ts +1 -0
  26. package/umd/src/book-components/BookEditor/BookEditorMonacoTokenization.d.ts +1 -0
  27. package/umd/src/book-components/Chat/Chat/CitationIframePreview.d.ts +2 -2
  28. package/umd/src/book-components/Chat/utils/livePagePreviewConstants.d.ts +12 -0
  29. package/umd/src/cli/cli-commands/agents-server/buildAgentsServer.d.ts +6 -0
  30. package/umd/src/collection/agent-collection/CreateAgentInput.d.ts +2 -1
  31. package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/prepareAgentSourceForPersistence.d.ts +21 -1
  32. package/umd/src/commitments/META_VISIBILITY/META_VISIBILITY.d.ts +27 -0
  33. package/umd/src/commitments/index.d.ts +2 -1
  34. package/umd/src/version.d.ts +1 -1
package/README.md CHANGED
@@ -41,14 +41,17 @@ Non-interactive mode takes defaults from command-line options. When `--openai-ap
41
41
  sudo curl -fsSL https://raw.githubusercontent.com/webgptorg/promptbook/refs/heads/main/other/vps/install.sh | bash -s -- \
42
42
  --non-interactive \
43
43
  --yes-i-understand-that-script-should-be-run-on-fresh-server \
44
- --domain s24.ptbk.io \
45
- --openai-api-key sk-proj-abcdef \
46
- --sentry-dsn https://abc@def.ingest.de.sentry.io/123 \
44
+ --domain my-server.com \
45
+ --openai-api-key sk-proj-xxx \
47
46
  --admin-password xxx
48
47
  ```
49
48
 
50
49
 
51
50
 
51
+ <blockquote style="color: #ff8811">
52
+ <b>⚠ Warning:</b> This is a pre-release version of the library. It is not yet ready for production use. Please look at <a href="https://www.npmjs.com/package/@promptbook/core?activeTab=versions">latest stable release</a>.
53
+ </blockquote>
54
+
52
55
  ## 📦 Package `@promptbook/browser`
53
56
 
54
57
  - Promptbooks are [divided into several](#-packages) packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
@@ -120,7 +123,7 @@ Rest of the documentation is common for **entire promptbook ecosystem**:
120
123
 
121
124
  Promptbook lets you create **persistent AI agents** that work on real goals for your company. The [**Agents Server**](https://gallery.ptbk.io/) is the heart of the project - a place where your AI agents live, remember context, collaborate in teams, and get things done.
122
125
 
123
- 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.
126
+ Nowadays, the biggest challenge for most business applications isn't the raw capabilities of AI models. Large language models such as Claude Mythos, GPT-5.6 or Kimi K2.7 are incredibly capable.
124
127
 
125
128
  The main challenge lies in **managing the context**, providing rules and knowledge, and narrowing the personality.
126
129
 
@@ -128,17 +131,20 @@ In Promptbook, you define your agents **using simple Books** - a human-readable
128
131
 
129
132
  <table style="border: 1px solid #777; border-radius: 10px;"><tr><td>
130
133
 
131
- **<ins>Paul Smith</ins>**<br/>
134
+ **<ins>Lawyer</ins>**<br/>
132
135
  <br/>
133
- **PERSONA** You are a company lawyer.<br/>
136
+ GOAL You are a company lawyer.<br/>
134
137
  Your job is to provide legal advice and support to the company and its employees.<br/>
135
- **GOAL** Respond to incoming legal inquiries via email and keep the company website updated with the latest legal policies.<br/>
138
+ Respond to incoming legal inquiries via email and keep the company website updated with the latest legal policies.<br/>
139
+ <br/>
136
140
  **RULE** You are knowledgeable, professional, and detail-oriented.<br/>
137
141
  **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
138
142
  **KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
139
- **USE EMAIL**<br/>
140
- **USE BROWSER**<br/>
141
- **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/>
143
+ <br/>
144
+ USE EMAIL<br/>
145
+ USE BROWSER<br/>
146
+ <br/>
147
+ 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/>
142
148
 
143
149
  </td></tr></table>
144
150
 
@@ -171,12 +177,12 @@ Goals define what the agent should actively work toward. Unlike a chatbot that o
171
177
 
172
178
  <table style="border: 1px solid #777; border-radius: 10px;"><tr><td>
173
179
 
174
- **<ins>Paul Smith & Associés</ins>**<br/>
180
+ **<ins>Company Lawyer</ins>**<br/>
175
181
  <br/>
176
- **PERSONA** You are a company lawyer.<br/>
182
+ GOAL<br/>
177
183
  Your job is to provide legal advice and support to the company and its employees.<br/>
178
- **GOAL** Respond to incoming legal inquiries via email within 24 hours.<br/>
179
- **GOAL** Keep the company website updated with the latest legal policies and compliance information.<br/>
184
+ GOAL Respond to incoming legal inquiries via email within 24 hours.<br/>
185
+ GOAL Keep the company website updated with the latest legal policies and compliance information.<br/>
180
186
 
181
187
  </td></tr></table>
182
188
 
@@ -194,8 +200,8 @@ Promptbook Engine will automatically enforce this knowledge during interactions.
194
200
  <br/>
195
201
  **PERSONA** You are a company lawyer.<br/>
196
202
  Your job is to provide legal advice and support to the company and its employees.<br/>
197
- **GOAL** Respond to incoming legal inquiries via email within 24 hours.<br/>
198
- **GOAL** Keep the company website updated with the latest legal policies and compliance information.<br/>
203
+ GOAL Respond to incoming legal inquiries via email within 24 hours.<br/>
204
+ GOAL Keep the company website updated with the latest legal policies and compliance information.<br/>
199
205
  **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
200
206
  **KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
201
207
 
@@ -213,8 +219,8 @@ Depending on rule strictness, Promptbook will either propagate it to the prompt
213
219
  <br/>
214
220
  **PERSONA** You are a company lawyer.<br/>
215
221
  Your job is to provide legal advice and support to the company and its employees.<br/>
216
- **GOAL** Respond to incoming legal inquiries via email within 24 hours.<br/>
217
- **GOAL** Keep the company website updated with the latest legal policies and compliance information.<br/>
222
+ GOAL Respond to incoming legal inquiries via email within 24 hours.<br/>
223
+ GOAL Keep the company website updated with the latest legal policies and compliance information.<br/>
218
224
  **RULE** Always ensure compliance with local laws and regulations.<br/>
219
225
  **RULE** Never provide legal advice outside your area of expertise.<br/>
220
226
  **RULE** Never provide legal advice about criminal law.<br/>
@@ -235,16 +241,16 @@ These are what turn a chatbot into a persistent agent that actually does work.
235
241
  <br/>
236
242
  **PERSONA** You are a company lawyer.<br/>
237
243
  Your job is to provide legal advice and support to the company and its employees.<br/>
238
- **GOAL** Respond to incoming legal inquiries via email within 24 hours.<br/>
239
- **GOAL** Keep the company website updated with the latest legal policies and compliance information.<br/>
244
+ GOAL Respond to incoming legal inquiries via email within 24 hours.<br/>
245
+ GOAL Keep the company website updated with the latest legal policies and compliance information.<br/>
240
246
  **RULE** Always ensure compliance with local laws and regulations.<br/>
241
247
  **RULE** Never provide legal advice outside your area of expertise.<br/>
242
248
  **RULE** Never provide legal advice about criminal law.<br/>
243
249
  **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
244
250
  **KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
245
- **USE EMAIL**<br/>
246
- **USE BROWSER**<br/>
247
- **USE SEARCH ENGINE**<br/>
251
+ USE EMAIL<br/>
252
+ USE BROWSER<br/>
253
+ USE SEARCH ENGINE<br/>
248
254
 
249
255
  </td></tr></table>
250
256
 
@@ -258,20 +264,22 @@ Team commitment allows you to define the team structure and advisory fellow memb
258
264
  <br/>
259
265
  **PERSONA** You are a company lawyer.<br/>
260
266
  Your job is to provide legal advice and support to the company and its employees.<br/>
261
- **GOAL** Respond to incoming legal inquiries via email within 24 hours.<br/>
262
- **GOAL** Keep the company website updated with the latest legal policies and compliance information.<br/>
267
+ GOAL Respond to incoming legal inquiries via email within 24 hours.<br/>
268
+ GOAL Keep the company website updated with the latest legal policies and compliance information.<br/>
263
269
  **RULE** Always ensure compliance with local laws and regulations.<br/>
264
270
  **RULE** Never provide legal advice outside your area of expertise.<br/>
265
271
  **RULE** Never provide legal advice about criminal law.<br/>
266
272
  **KNOWLEDGE** https://company.com/company-policies.pdf<br/>
267
273
  **KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
268
- **USE EMAIL**<br/>
269
- **USE BROWSER**<br/>
270
- **USE SEARCH ENGINE**<br/>
271
- **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/>
274
+ USE EMAIL<br/>
275
+ USE BROWSER<br/>
276
+ USE SEARCH ENGINE<br/>
277
+ 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/>
272
278
 
273
279
  </td></tr></table>
274
280
 
281
+
282
+
275
283
  ### Promptbook Ecosystem
276
284
 
277
285
  Promptbook is an ecosystem of tools centered around the **Agents Server** - a production-ready platform for running persistent AI agents.
@@ -294,6 +302,8 @@ The [Promptbook Engine](https://github.com/webgptorg/promptbook) is the open-sou
294
302
 
295
303
 
296
304
 
305
+
306
+
297
307
  ## 💜 The Promptbook Project
298
308
 
299
309
  Promptbook project is an ecosystem centered around the **Agents Server** - a platform for creating, deploying, and running persistent AI agents. Following is a list of the most important pieces of the project:
@@ -331,6 +341,8 @@ Promptbook project is an ecosystem centered around the **Agents Server** - a pla
331
341
  </tbody>
332
342
  </table>
333
343
 
344
+
345
+
334
346
  ### 🌐 Community & Social Media
335
347
 
336
348
  Join our growing community of developers and users:
@@ -387,6 +399,8 @@ Join our growing community of developers and users:
387
399
 
388
400
 
389
401
 
402
+
403
+
390
404
  ## 📚 Documentation
391
405
 
392
406
  See detailed guides and API reference in the [docs](https://github.com/webgptorg/promptbook/discussions/categories/concepts) or [online](https://discord.gg/x3QWNaa89N).
@@ -594,6 +608,8 @@ The following glossary is used to clarify certain concepts:
594
608
 
595
609
  _Note: This section is not a complete dictionary, more list of general AI / LLM terms that has connection with Promptbook_
596
610
 
611
+
612
+
597
613
  ### 💯 Core concepts
598
614
 
599
615
  - [📚 Collection of pipelines](https://github.com/webgptorg/promptbook/discussions/65)
package/esm/index.es.js CHANGED
@@ -29,7 +29,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
29
29
  * @generated
30
30
  * @see https://github.com/webgptorg/promptbook
31
31
  */
32
- const PROMPTBOOK_ENGINE_VERSION = '0.112.0';
32
+ const PROMPTBOOK_ENGINE_VERSION = '0.113.0-1';
33
33
  /**
34
34
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
35
35
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -11688,6 +11688,70 @@ class MetaLinkCommitmentDefinition extends BaseCommitmentDefinition {
11688
11688
  }
11689
11689
  // Note: [💞] Ignore a discrepancy between file name and entity name
11690
11690
 
11691
+ /**
11692
+ * META VISIBILITY commitment definition.
11693
+ *
11694
+ * The `META VISIBILITY` commitment stores whether an agent is public, private, or unlisted.
11695
+ * Agents Server mirrors this value into the database for efficient filtering, but the book
11696
+ * commitment remains the editable source of truth.
11697
+ *
11698
+ * @private Metadata-only commitment used by Agents Server.
11699
+ */
11700
+ class MetaVisibilityCommitmentDefinition extends BaseCommitmentDefinition {
11701
+ constructor() {
11702
+ super('META VISIBILITY');
11703
+ }
11704
+ /**
11705
+ * Short one-line description of META VISIBILITY.
11706
+ */
11707
+ get description() {
11708
+ return 'Set whether the agent is private, unlisted, or public.';
11709
+ }
11710
+ /**
11711
+ * Icon for this commitment.
11712
+ */
11713
+ get icon() {
11714
+ return '👁️';
11715
+ }
11716
+ /**
11717
+ * Markdown documentation for META VISIBILITY commitment.
11718
+ */
11719
+ get documentation() {
11720
+ return spaceTrim$1(`
11721
+ # META VISIBILITY
11722
+
11723
+ Sets the agent visibility used by Agents Server.
11724
+
11725
+ ## Allowed values
11726
+
11727
+ - \`PRIVATE\` - accessible only to signed-in users with access.
11728
+ - \`UNLISTED\` - accessible by direct link but hidden from public listings.
11729
+ - \`PUBLIC\` - visible in public listings and accessible by anyone.
11730
+
11731
+ ## Key aspects
11732
+
11733
+ - Does not modify the agent's behavior, system message, or tools.
11734
+ - Whitespace and letter case are normalized when persisted.
11735
+ - If multiple \`META VISIBILITY\` commitments are present, persistence keeps one normalized value.
11736
+ - Agents Server mirrors the value into the database for filtering, but the book is the source of truth.
11737
+
11738
+ ## Example
11739
+
11740
+ \`\`\`book
11741
+ Helpful Assistant
11742
+
11743
+ GOAL Be helpful and friendly.
11744
+ META VISIBILITY PUBLIC
11745
+ \`\`\`
11746
+ `);
11747
+ }
11748
+ applyToAgentModelRequirements(requirements, content) {
11749
+ // META VISIBILITY is metadata only and does not alter model requirements.
11750
+ return requirements;
11751
+ }
11752
+ }
11753
+ // Note: [💞] Ignore a discrepancy between file name and entity name
11754
+
11691
11755
  /**
11692
11756
  * META VOICE commitment definition
11693
11757
  *
@@ -18183,31 +18247,65 @@ class UseSearchEngineCommitmentDefinition extends BaseCommitmentDefinition {
18183
18247
  // Note: [💞] Ignore a discrepancy between file name and entity name
18184
18248
 
18185
18249
  /**
18186
- * This error type indicates that some limit was reached
18250
+ * This error indicates that the promptbook in a markdown format cannot be parsed into a valid promptbook object
18187
18251
  *
18188
18252
  * @public exported from `@promptbook/core`
18189
18253
  */
18190
- class LimitReachedError extends Error {
18254
+ class ParseError extends Error {
18191
18255
  constructor(message) {
18192
18256
  super(message);
18193
- this.name = 'LimitReachedError';
18194
- Object.setPrototypeOf(this, LimitReachedError.prototype);
18257
+ this.name = 'ParseError';
18258
+ Object.setPrototypeOf(this, ParseError.prototype);
18195
18259
  }
18196
18260
  }
18261
+ // TODO: Maybe split `ParseError` and `ApplyError`
18197
18262
 
18198
18263
  /**
18199
- * This error indicates that the promptbook in a markdown format cannot be parsed into a valid promptbook object
18264
+ * Supported visibility states for persisted agents.
18200
18265
  *
18201
18266
  * @public exported from `@promptbook/core`
18202
18267
  */
18203
- class ParseError extends Error {
18268
+ const AGENT_VISIBILITY_VALUES = ['PRIVATE', 'UNLISTED', 'PUBLIC'];
18269
+ /**
18270
+ * Returns `true` when the value is one of supported visibility states.
18271
+ *
18272
+ * @param value - Raw value to validate.
18273
+ * @returns Whether the value is a valid `AgentVisibility`.
18274
+ *
18275
+ * @public exported from `@promptbook/core`
18276
+ */
18277
+ function isAgentVisibility(value) {
18278
+ return typeof value === 'string' && AGENT_VISIBILITY_VALUES.includes(value);
18279
+ }
18280
+ /**
18281
+ * Normalizes raw visibility text into a supported value.
18282
+ *
18283
+ * @param value - Raw visibility value.
18284
+ * @returns Normalized visibility, or `null` when invalid.
18285
+ *
18286
+ * @public exported from `@promptbook/core`
18287
+ */
18288
+ function normalizeAgentVisibility(value) {
18289
+ if (typeof value !== 'string') {
18290
+ return null;
18291
+ }
18292
+ const normalized = value.trim().toUpperCase();
18293
+ return isAgentVisibility(normalized) ? normalized : null;
18294
+ }
18295
+ // Note: [💞] Ignore a discrepancy between file name and entity name
18296
+
18297
+ /**
18298
+ * This error type indicates that some limit was reached
18299
+ *
18300
+ * @public exported from `@promptbook/core`
18301
+ */
18302
+ class LimitReachedError extends Error {
18204
18303
  constructor(message) {
18205
18304
  super(message);
18206
- this.name = 'ParseError';
18207
- Object.setPrototypeOf(this, ParseError.prototype);
18305
+ this.name = 'LimitReachedError';
18306
+ Object.setPrototypeOf(this, LimitReachedError.prototype);
18208
18307
  }
18209
18308
  }
18210
- // TODO: Maybe split `ParseError` and `ApplyError`
18211
18309
 
18212
18310
  /**
18213
18311
  * Maximum allowed source length for create-agent payloads.
@@ -20542,6 +20640,7 @@ const COMMITMENT_REGISTRY = [
20542
20640
  new MetaDomainCommitmentDefinition(),
20543
20641
  new MetaDisclaimerCommitmentDefinition(),
20544
20642
  new MetaInputPlaceholderCommitmentDefinition(),
20643
+ new MetaVisibilityCommitmentDefinition(),
20545
20644
  new MetaCommitmentDefinition(),
20546
20645
  new MetaVoiceCommitmentDefinition(),
20547
20646
  new NoteCommitmentDefinition('NOTE'),
@@ -22196,6 +22295,7 @@ const META_COMMITMENT_APPLIERS = {
22196
22295
  'META COLOR': applyMetaColorContent,
22197
22296
  'META FONT': applyMetaFontContent,
22198
22297
  'META VOICE': applyMetaVoiceContent,
22298
+ 'META VISIBILITY': applyMetaVisibilityContent,
22199
22299
  };
22200
22300
  /**
22201
22301
  * Applies META-style commitments that mutate parsed profile metadata.
@@ -22225,6 +22325,10 @@ function applyGenericMetaCommitment(state, content) {
22225
22325
  applyMetaAvatarContent(state, metaValue);
22226
22326
  return;
22227
22327
  }
22328
+ if (metaTypeRaw.toUpperCase() === 'VISIBILITY') {
22329
+ applyMetaVisibilityContent(state, metaValue);
22330
+ return;
22331
+ }
22228
22332
  const metaType = normalizeTo_camelCase(metaTypeRaw);
22229
22333
  state.meta[metaType] = metaValue;
22230
22334
  }
@@ -22301,6 +22405,15 @@ function applyMetaFontContent(state, content) {
22301
22405
  function applyMetaVoiceContent(state, content) {
22302
22406
  state.meta.voice = spaceTrim$1(content);
22303
22407
  }
22408
+ /**
22409
+ * Applies META VISIBILITY content into the normalized `meta.visibility` field.
22410
+ */
22411
+ function applyMetaVisibilityContent(state, content) {
22412
+ const visibility = normalizeAgentVisibility(content);
22413
+ if (visibility) {
22414
+ state.meta.visibility = visibility;
22415
+ }
22416
+ }
22304
22417
  /**
22305
22418
  * Normalizes the separator in the content
22306
22419
  *