@promptbook/node 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.
- package/README.md +45 -29
- package/esm/index.es.js +114 -1
- package/esm/index.es.js.map +1 -1
- package/esm/src/_packages/core.index.d.ts +22 -0
- package/esm/src/_packages/types.index.d.ts +2 -0
- package/esm/src/book-2.0/agent-source/AgentBasicInformation.d.ts +2 -0
- package/esm/src/book-2.0/agent-source/agentSourceVisibility.d.ts +97 -0
- package/esm/src/book-2.0/agent-source/agentSourceVisibility.test.d.ts +1 -0
- package/esm/src/book-components/BookEditor/BookEditorMonacoTokenization.d.ts +1 -0
- package/esm/src/book-components/Chat/Chat/CitationIframePreview.d.ts +2 -2
- package/esm/src/book-components/Chat/utils/livePagePreviewConstants.d.ts +12 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer.d.ts +6 -0
- package/esm/src/collection/agent-collection/CreateAgentInput.d.ts +2 -1
- package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/prepareAgentSourceForPersistence.d.ts +21 -1
- package/esm/src/commitments/META_VISIBILITY/META_VISIBILITY.d.ts +27 -0
- package/esm/src/commitments/index.d.ts +2 -1
- package/esm/src/version.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +114 -1
- package/umd/index.umd.js.map +1 -1
- package/umd/src/_packages/core.index.d.ts +22 -0
- package/umd/src/_packages/types.index.d.ts +2 -0
- package/umd/src/book-2.0/agent-source/AgentBasicInformation.d.ts +2 -0
- package/umd/src/book-2.0/agent-source/agentSourceVisibility.d.ts +97 -0
- package/umd/src/book-2.0/agent-source/agentSourceVisibility.test.d.ts +1 -0
- package/umd/src/book-components/BookEditor/BookEditorMonacoTokenization.d.ts +1 -0
- package/umd/src/book-components/Chat/Chat/CitationIframePreview.d.ts +2 -2
- package/umd/src/book-components/Chat/utils/livePagePreviewConstants.d.ts +12 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer.d.ts +6 -0
- package/umd/src/collection/agent-collection/CreateAgentInput.d.ts +2 -1
- package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/prepareAgentSourceForPersistence.d.ts +21 -1
- package/umd/src/commitments/META_VISIBILITY/META_VISIBILITY.d.ts +27 -0
- package/umd/src/commitments/index.d.ts +2 -1
- 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
|
|
45
|
-
--openai-api-key sk-proj-
|
|
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/node`
|
|
53
56
|
|
|
54
57
|
- Promptbooks are [divided into several](#-packages) packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
|
|
@@ -136,7 +139,7 @@ Rest of the documentation is common for **entire promptbook ecosystem**:
|
|
|
136
139
|
|
|
137
140
|
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.
|
|
138
141
|
|
|
139
|
-
Nowadays, the biggest challenge for most business applications isn't the raw capabilities of AI models. Large language models such as GPT-5.
|
|
142
|
+
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.
|
|
140
143
|
|
|
141
144
|
The main challenge lies in **managing the context**, providing rules and knowledge, and narrowing the personality.
|
|
142
145
|
|
|
@@ -144,17 +147,20 @@ In Promptbook, you define your agents **using simple Books** - a human-readable
|
|
|
144
147
|
|
|
145
148
|
<table style="border: 1px solid #777; border-radius: 10px;"><tr><td>
|
|
146
149
|
|
|
147
|
-
**<ins>
|
|
150
|
+
**<ins>Lawyer</ins>**<br/>
|
|
148
151
|
<br/>
|
|
149
|
-
|
|
152
|
+
GOAL You are a company lawyer.<br/>
|
|
150
153
|
Your job is to provide legal advice and support to the company and its employees.<br/>
|
|
151
|
-
|
|
154
|
+
Respond to incoming legal inquiries via email and keep the company website updated with the latest legal policies.<br/>
|
|
155
|
+
<br/>
|
|
152
156
|
**RULE** You are knowledgeable, professional, and detail-oriented.<br/>
|
|
153
157
|
**KNOWLEDGE** https://company.com/company-policies.pdf<br/>
|
|
154
158
|
**KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
159
|
+
<br/>
|
|
160
|
+
USE EMAIL<br/>
|
|
161
|
+
USE BROWSER<br/>
|
|
162
|
+
<br/>
|
|
163
|
+
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/>
|
|
158
164
|
|
|
159
165
|
</td></tr></table>
|
|
160
166
|
|
|
@@ -187,12 +193,12 @@ Goals define what the agent should actively work toward. Unlike a chatbot that o
|
|
|
187
193
|
|
|
188
194
|
<table style="border: 1px solid #777; border-radius: 10px;"><tr><td>
|
|
189
195
|
|
|
190
|
-
**<ins>
|
|
196
|
+
**<ins>Company Lawyer</ins>**<br/>
|
|
191
197
|
<br/>
|
|
192
|
-
|
|
198
|
+
GOAL<br/>
|
|
193
199
|
Your job is to provide legal advice and support to the company and its employees.<br/>
|
|
194
|
-
|
|
195
|
-
|
|
200
|
+
GOAL Respond to incoming legal inquiries via email within 24 hours.<br/>
|
|
201
|
+
GOAL Keep the company website updated with the latest legal policies and compliance information.<br/>
|
|
196
202
|
|
|
197
203
|
</td></tr></table>
|
|
198
204
|
|
|
@@ -210,8 +216,8 @@ Promptbook Engine will automatically enforce this knowledge during interactions.
|
|
|
210
216
|
<br/>
|
|
211
217
|
**PERSONA** You are a company lawyer.<br/>
|
|
212
218
|
Your job is to provide legal advice and support to the company and its employees.<br/>
|
|
213
|
-
|
|
214
|
-
|
|
219
|
+
GOAL Respond to incoming legal inquiries via email within 24 hours.<br/>
|
|
220
|
+
GOAL Keep the company website updated with the latest legal policies and compliance information.<br/>
|
|
215
221
|
**KNOWLEDGE** https://company.com/company-policies.pdf<br/>
|
|
216
222
|
**KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
|
|
217
223
|
|
|
@@ -229,8 +235,8 @@ Depending on rule strictness, Promptbook will either propagate it to the prompt
|
|
|
229
235
|
<br/>
|
|
230
236
|
**PERSONA** You are a company lawyer.<br/>
|
|
231
237
|
Your job is to provide legal advice and support to the company and its employees.<br/>
|
|
232
|
-
|
|
233
|
-
|
|
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/>
|
|
234
240
|
**RULE** Always ensure compliance with local laws and regulations.<br/>
|
|
235
241
|
**RULE** Never provide legal advice outside your area of expertise.<br/>
|
|
236
242
|
**RULE** Never provide legal advice about criminal law.<br/>
|
|
@@ -251,16 +257,16 @@ These are what turn a chatbot into a persistent agent that actually does work.
|
|
|
251
257
|
<br/>
|
|
252
258
|
**PERSONA** You are a company lawyer.<br/>
|
|
253
259
|
Your job is to provide legal advice and support to the company and its employees.<br/>
|
|
254
|
-
|
|
255
|
-
|
|
260
|
+
GOAL Respond to incoming legal inquiries via email within 24 hours.<br/>
|
|
261
|
+
GOAL Keep the company website updated with the latest legal policies and compliance information.<br/>
|
|
256
262
|
**RULE** Always ensure compliance with local laws and regulations.<br/>
|
|
257
263
|
**RULE** Never provide legal advice outside your area of expertise.<br/>
|
|
258
264
|
**RULE** Never provide legal advice about criminal law.<br/>
|
|
259
265
|
**KNOWLEDGE** https://company.com/company-policies.pdf<br/>
|
|
260
266
|
**KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
267
|
+
USE EMAIL<br/>
|
|
268
|
+
USE BROWSER<br/>
|
|
269
|
+
USE SEARCH ENGINE<br/>
|
|
264
270
|
|
|
265
271
|
</td></tr></table>
|
|
266
272
|
|
|
@@ -274,20 +280,22 @@ Team commitment allows you to define the team structure and advisory fellow memb
|
|
|
274
280
|
<br/>
|
|
275
281
|
**PERSONA** You are a company lawyer.<br/>
|
|
276
282
|
Your job is to provide legal advice and support to the company and its employees.<br/>
|
|
277
|
-
|
|
278
|
-
|
|
283
|
+
GOAL Respond to incoming legal inquiries via email within 24 hours.<br/>
|
|
284
|
+
GOAL Keep the company website updated with the latest legal policies and compliance information.<br/>
|
|
279
285
|
**RULE** Always ensure compliance with local laws and regulations.<br/>
|
|
280
286
|
**RULE** Never provide legal advice outside your area of expertise.<br/>
|
|
281
287
|
**RULE** Never provide legal advice about criminal law.<br/>
|
|
282
288
|
**KNOWLEDGE** https://company.com/company-policies.pdf<br/>
|
|
283
289
|
**KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
290
|
+
USE EMAIL<br/>
|
|
291
|
+
USE BROWSER<br/>
|
|
292
|
+
USE SEARCH ENGINE<br/>
|
|
293
|
+
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/>
|
|
288
294
|
|
|
289
295
|
</td></tr></table>
|
|
290
296
|
|
|
297
|
+
|
|
298
|
+
|
|
291
299
|
### Promptbook Ecosystem
|
|
292
300
|
|
|
293
301
|
Promptbook is an ecosystem of tools centered around the **Agents Server** - a production-ready platform for running persistent AI agents.
|
|
@@ -310,6 +318,8 @@ The [Promptbook Engine](https://github.com/webgptorg/promptbook) is the open-sou
|
|
|
310
318
|
|
|
311
319
|
|
|
312
320
|
|
|
321
|
+
|
|
322
|
+
|
|
313
323
|
## 💜 The Promptbook Project
|
|
314
324
|
|
|
315
325
|
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:
|
|
@@ -347,6 +357,8 @@ Promptbook project is an ecosystem centered around the **Agents Server** - a pla
|
|
|
347
357
|
</tbody>
|
|
348
358
|
</table>
|
|
349
359
|
|
|
360
|
+
|
|
361
|
+
|
|
350
362
|
### 🌐 Community & Social Media
|
|
351
363
|
|
|
352
364
|
Join our growing community of developers and users:
|
|
@@ -403,6 +415,8 @@ Join our growing community of developers and users:
|
|
|
403
415
|
|
|
404
416
|
|
|
405
417
|
|
|
418
|
+
|
|
419
|
+
|
|
406
420
|
## 📚 Documentation
|
|
407
421
|
|
|
408
422
|
See detailed guides and API reference in the [docs](https://github.com/webgptorg/promptbook/discussions/categories/concepts) or [online](https://discord.gg/x3QWNaa89N).
|
|
@@ -610,6 +624,8 @@ The following glossary is used to clarify certain concepts:
|
|
|
610
624
|
|
|
611
625
|
_Note: This section is not a complete dictionary, more list of general AI / LLM terms that has connection with Promptbook_
|
|
612
626
|
|
|
627
|
+
|
|
628
|
+
|
|
613
629
|
### 💯 Core concepts
|
|
614
630
|
|
|
615
631
|
- [📚 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.
|
|
39
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.113.0-1';
|
|
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
|
|
@@ -21015,6 +21015,70 @@ class MetaLinkCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
21015
21015
|
}
|
|
21016
21016
|
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
21017
21017
|
|
|
21018
|
+
/**
|
|
21019
|
+
* META VISIBILITY commitment definition.
|
|
21020
|
+
*
|
|
21021
|
+
* The `META VISIBILITY` commitment stores whether an agent is public, private, or unlisted.
|
|
21022
|
+
* Agents Server mirrors this value into the database for efficient filtering, but the book
|
|
21023
|
+
* commitment remains the editable source of truth.
|
|
21024
|
+
*
|
|
21025
|
+
* @private Metadata-only commitment used by Agents Server.
|
|
21026
|
+
*/
|
|
21027
|
+
class MetaVisibilityCommitmentDefinition extends BaseCommitmentDefinition {
|
|
21028
|
+
constructor() {
|
|
21029
|
+
super('META VISIBILITY');
|
|
21030
|
+
}
|
|
21031
|
+
/**
|
|
21032
|
+
* Short one-line description of META VISIBILITY.
|
|
21033
|
+
*/
|
|
21034
|
+
get description() {
|
|
21035
|
+
return 'Set whether the agent is private, unlisted, or public.';
|
|
21036
|
+
}
|
|
21037
|
+
/**
|
|
21038
|
+
* Icon for this commitment.
|
|
21039
|
+
*/
|
|
21040
|
+
get icon() {
|
|
21041
|
+
return '👁️';
|
|
21042
|
+
}
|
|
21043
|
+
/**
|
|
21044
|
+
* Markdown documentation for META VISIBILITY commitment.
|
|
21045
|
+
*/
|
|
21046
|
+
get documentation() {
|
|
21047
|
+
return spaceTrim$1(`
|
|
21048
|
+
# META VISIBILITY
|
|
21049
|
+
|
|
21050
|
+
Sets the agent visibility used by Agents Server.
|
|
21051
|
+
|
|
21052
|
+
## Allowed values
|
|
21053
|
+
|
|
21054
|
+
- \`PRIVATE\` - accessible only to signed-in users with access.
|
|
21055
|
+
- \`UNLISTED\` - accessible by direct link but hidden from public listings.
|
|
21056
|
+
- \`PUBLIC\` - visible in public listings and accessible by anyone.
|
|
21057
|
+
|
|
21058
|
+
## Key aspects
|
|
21059
|
+
|
|
21060
|
+
- Does not modify the agent's behavior, system message, or tools.
|
|
21061
|
+
- Whitespace and letter case are normalized when persisted.
|
|
21062
|
+
- If multiple \`META VISIBILITY\` commitments are present, persistence keeps one normalized value.
|
|
21063
|
+
- Agents Server mirrors the value into the database for filtering, but the book is the source of truth.
|
|
21064
|
+
|
|
21065
|
+
## Example
|
|
21066
|
+
|
|
21067
|
+
\`\`\`book
|
|
21068
|
+
Helpful Assistant
|
|
21069
|
+
|
|
21070
|
+
GOAL Be helpful and friendly.
|
|
21071
|
+
META VISIBILITY PUBLIC
|
|
21072
|
+
\`\`\`
|
|
21073
|
+
`);
|
|
21074
|
+
}
|
|
21075
|
+
applyToAgentModelRequirements(requirements, content) {
|
|
21076
|
+
// META VISIBILITY is metadata only and does not alter model requirements.
|
|
21077
|
+
return requirements;
|
|
21078
|
+
}
|
|
21079
|
+
}
|
|
21080
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
21081
|
+
|
|
21018
21082
|
/**
|
|
21019
21083
|
* META VOICE commitment definition
|
|
21020
21084
|
*
|
|
@@ -27238,6 +27302,40 @@ class UseSearchEngineCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
27238
27302
|
}
|
|
27239
27303
|
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
27240
27304
|
|
|
27305
|
+
/**
|
|
27306
|
+
* Supported visibility states for persisted agents.
|
|
27307
|
+
*
|
|
27308
|
+
* @public exported from `@promptbook/core`
|
|
27309
|
+
*/
|
|
27310
|
+
const AGENT_VISIBILITY_VALUES = ['PRIVATE', 'UNLISTED', 'PUBLIC'];
|
|
27311
|
+
/**
|
|
27312
|
+
* Returns `true` when the value is one of supported visibility states.
|
|
27313
|
+
*
|
|
27314
|
+
* @param value - Raw value to validate.
|
|
27315
|
+
* @returns Whether the value is a valid `AgentVisibility`.
|
|
27316
|
+
*
|
|
27317
|
+
* @public exported from `@promptbook/core`
|
|
27318
|
+
*/
|
|
27319
|
+
function isAgentVisibility(value) {
|
|
27320
|
+
return typeof value === 'string' && AGENT_VISIBILITY_VALUES.includes(value);
|
|
27321
|
+
}
|
|
27322
|
+
/**
|
|
27323
|
+
* Normalizes raw visibility text into a supported value.
|
|
27324
|
+
*
|
|
27325
|
+
* @param value - Raw visibility value.
|
|
27326
|
+
* @returns Normalized visibility, or `null` when invalid.
|
|
27327
|
+
*
|
|
27328
|
+
* @public exported from `@promptbook/core`
|
|
27329
|
+
*/
|
|
27330
|
+
function normalizeAgentVisibility(value) {
|
|
27331
|
+
if (typeof value !== 'string') {
|
|
27332
|
+
return null;
|
|
27333
|
+
}
|
|
27334
|
+
const normalized = value.trim().toUpperCase();
|
|
27335
|
+
return isAgentVisibility(normalized) ? normalized : null;
|
|
27336
|
+
}
|
|
27337
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
27338
|
+
|
|
27241
27339
|
/**
|
|
27242
27340
|
* Maximum allowed source length for create-agent payloads.
|
|
27243
27341
|
*
|
|
@@ -29538,6 +29636,7 @@ const COMMITMENT_REGISTRY = [
|
|
|
29538
29636
|
new MetaDomainCommitmentDefinition(),
|
|
29539
29637
|
new MetaDisclaimerCommitmentDefinition(),
|
|
29540
29638
|
new MetaInputPlaceholderCommitmentDefinition(),
|
|
29639
|
+
new MetaVisibilityCommitmentDefinition(),
|
|
29541
29640
|
new MetaCommitmentDefinition(),
|
|
29542
29641
|
new MetaVoiceCommitmentDefinition(),
|
|
29543
29642
|
new NoteCommitmentDefinition('NOTE'),
|
|
@@ -30891,6 +30990,7 @@ const META_COMMITMENT_APPLIERS = {
|
|
|
30891
30990
|
'META COLOR': applyMetaColorContent,
|
|
30892
30991
|
'META FONT': applyMetaFontContent,
|
|
30893
30992
|
'META VOICE': applyMetaVoiceContent,
|
|
30993
|
+
'META VISIBILITY': applyMetaVisibilityContent,
|
|
30894
30994
|
};
|
|
30895
30995
|
/**
|
|
30896
30996
|
* Applies META-style commitments that mutate parsed profile metadata.
|
|
@@ -30920,6 +31020,10 @@ function applyGenericMetaCommitment(state, content) {
|
|
|
30920
31020
|
applyMetaAvatarContent(state, metaValue);
|
|
30921
31021
|
return;
|
|
30922
31022
|
}
|
|
31023
|
+
if (metaTypeRaw.toUpperCase() === 'VISIBILITY') {
|
|
31024
|
+
applyMetaVisibilityContent(state, metaValue);
|
|
31025
|
+
return;
|
|
31026
|
+
}
|
|
30923
31027
|
const metaType = normalizeTo_camelCase(metaTypeRaw);
|
|
30924
31028
|
state.meta[metaType] = metaValue;
|
|
30925
31029
|
}
|
|
@@ -30996,6 +31100,15 @@ function applyMetaFontContent(state, content) {
|
|
|
30996
31100
|
function applyMetaVoiceContent(state, content) {
|
|
30997
31101
|
state.meta.voice = spaceTrim$1(content);
|
|
30998
31102
|
}
|
|
31103
|
+
/**
|
|
31104
|
+
* Applies META VISIBILITY content into the normalized `meta.visibility` field.
|
|
31105
|
+
*/
|
|
31106
|
+
function applyMetaVisibilityContent(state, content) {
|
|
31107
|
+
const visibility = normalizeAgentVisibility(content);
|
|
31108
|
+
if (visibility) {
|
|
31109
|
+
state.meta.visibility = visibility;
|
|
31110
|
+
}
|
|
31111
|
+
}
|
|
30999
31112
|
/**
|
|
31000
31113
|
* Normalizes the separator in the content
|
|
31001
31114
|
*
|