@promptbook/components 0.112.0 → 0.113.0-0
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 +139 -13
- 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/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 +1 -1
- package/umd/index.umd.js +139 -13
- 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/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/components`
|
|
53
56
|
|
|
54
57
|
- Promptbooks are [divided into several](#-packages) packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
|
|
@@ -221,7 +224,7 @@ Rest of the documentation is common for **entire promptbook ecosystem**:
|
|
|
221
224
|
|
|
222
225
|
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.
|
|
223
226
|
|
|
224
|
-
Nowadays, the biggest challenge for most business applications isn't the raw capabilities of AI models. Large language models such as GPT-5.
|
|
227
|
+
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.
|
|
225
228
|
|
|
226
229
|
The main challenge lies in **managing the context**, providing rules and knowledge, and narrowing the personality.
|
|
227
230
|
|
|
@@ -229,17 +232,20 @@ In Promptbook, you define your agents **using simple Books** - a human-readable
|
|
|
229
232
|
|
|
230
233
|
<table style="border: 1px solid #777; border-radius: 10px;"><tr><td>
|
|
231
234
|
|
|
232
|
-
**<ins>
|
|
235
|
+
**<ins>Lawyer</ins>**<br/>
|
|
233
236
|
<br/>
|
|
234
|
-
|
|
237
|
+
GOAL You are a company lawyer.<br/>
|
|
235
238
|
Your job is to provide legal advice and support to the company and its employees.<br/>
|
|
236
|
-
|
|
239
|
+
Respond to incoming legal inquiries via email and keep the company website updated with the latest legal policies.<br/>
|
|
240
|
+
<br/>
|
|
237
241
|
**RULE** You are knowledgeable, professional, and detail-oriented.<br/>
|
|
238
242
|
**KNOWLEDGE** https://company.com/company-policies.pdf<br/>
|
|
239
243
|
**KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
244
|
+
<br/>
|
|
245
|
+
USE EMAIL<br/>
|
|
246
|
+
USE BROWSER<br/>
|
|
247
|
+
<br/>
|
|
248
|
+
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/>
|
|
243
249
|
|
|
244
250
|
</td></tr></table>
|
|
245
251
|
|
|
@@ -272,12 +278,12 @@ Goals define what the agent should actively work toward. Unlike a chatbot that o
|
|
|
272
278
|
|
|
273
279
|
<table style="border: 1px solid #777; border-radius: 10px;"><tr><td>
|
|
274
280
|
|
|
275
|
-
**<ins>
|
|
281
|
+
**<ins>Company Lawyer</ins>**<br/>
|
|
276
282
|
<br/>
|
|
277
|
-
|
|
283
|
+
GOAL<br/>
|
|
278
284
|
Your job is to provide legal advice and support to the company and its employees.<br/>
|
|
279
|
-
|
|
280
|
-
|
|
285
|
+
GOAL Respond to incoming legal inquiries via email within 24 hours.<br/>
|
|
286
|
+
GOAL Keep the company website updated with the latest legal policies and compliance information.<br/>
|
|
281
287
|
|
|
282
288
|
</td></tr></table>
|
|
283
289
|
|
|
@@ -295,8 +301,8 @@ Promptbook Engine will automatically enforce this knowledge during interactions.
|
|
|
295
301
|
<br/>
|
|
296
302
|
**PERSONA** You are a company lawyer.<br/>
|
|
297
303
|
Your job is to provide legal advice and support to the company and its employees.<br/>
|
|
298
|
-
|
|
299
|
-
|
|
304
|
+
GOAL Respond to incoming legal inquiries via email within 24 hours.<br/>
|
|
305
|
+
GOAL Keep the company website updated with the latest legal policies and compliance information.<br/>
|
|
300
306
|
**KNOWLEDGE** https://company.com/company-policies.pdf<br/>
|
|
301
307
|
**KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
|
|
302
308
|
|
|
@@ -314,8 +320,8 @@ Depending on rule strictness, Promptbook will either propagate it to the prompt
|
|
|
314
320
|
<br/>
|
|
315
321
|
**PERSONA** You are a company lawyer.<br/>
|
|
316
322
|
Your job is to provide legal advice and support to the company and its employees.<br/>
|
|
317
|
-
|
|
318
|
-
|
|
323
|
+
GOAL Respond to incoming legal inquiries via email within 24 hours.<br/>
|
|
324
|
+
GOAL Keep the company website updated with the latest legal policies and compliance information.<br/>
|
|
319
325
|
**RULE** Always ensure compliance with local laws and regulations.<br/>
|
|
320
326
|
**RULE** Never provide legal advice outside your area of expertise.<br/>
|
|
321
327
|
**RULE** Never provide legal advice about criminal law.<br/>
|
|
@@ -336,16 +342,16 @@ These are what turn a chatbot into a persistent agent that actually does work.
|
|
|
336
342
|
<br/>
|
|
337
343
|
**PERSONA** You are a company lawyer.<br/>
|
|
338
344
|
Your job is to provide legal advice and support to the company and its employees.<br/>
|
|
339
|
-
|
|
340
|
-
|
|
345
|
+
GOAL Respond to incoming legal inquiries via email within 24 hours.<br/>
|
|
346
|
+
GOAL Keep the company website updated with the latest legal policies and compliance information.<br/>
|
|
341
347
|
**RULE** Always ensure compliance with local laws and regulations.<br/>
|
|
342
348
|
**RULE** Never provide legal advice outside your area of expertise.<br/>
|
|
343
349
|
**RULE** Never provide legal advice about criminal law.<br/>
|
|
344
350
|
**KNOWLEDGE** https://company.com/company-policies.pdf<br/>
|
|
345
351
|
**KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
352
|
+
USE EMAIL<br/>
|
|
353
|
+
USE BROWSER<br/>
|
|
354
|
+
USE SEARCH ENGINE<br/>
|
|
349
355
|
|
|
350
356
|
</td></tr></table>
|
|
351
357
|
|
|
@@ -359,20 +365,22 @@ Team commitment allows you to define the team structure and advisory fellow memb
|
|
|
359
365
|
<br/>
|
|
360
366
|
**PERSONA** You are a company lawyer.<br/>
|
|
361
367
|
Your job is to provide legal advice and support to the company and its employees.<br/>
|
|
362
|
-
|
|
363
|
-
|
|
368
|
+
GOAL Respond to incoming legal inquiries via email within 24 hours.<br/>
|
|
369
|
+
GOAL Keep the company website updated with the latest legal policies and compliance information.<br/>
|
|
364
370
|
**RULE** Always ensure compliance with local laws and regulations.<br/>
|
|
365
371
|
**RULE** Never provide legal advice outside your area of expertise.<br/>
|
|
366
372
|
**RULE** Never provide legal advice about criminal law.<br/>
|
|
367
373
|
**KNOWLEDGE** https://company.com/company-policies.pdf<br/>
|
|
368
374
|
**KNOWLEDGE** https://company.com/internal-documents/employee-handbook.docx<br/>
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
375
|
+
USE EMAIL<br/>
|
|
376
|
+
USE BROWSER<br/>
|
|
377
|
+
USE SEARCH ENGINE<br/>
|
|
378
|
+
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/>
|
|
373
379
|
|
|
374
380
|
</td></tr></table>
|
|
375
381
|
|
|
382
|
+
|
|
383
|
+
|
|
376
384
|
### Promptbook Ecosystem
|
|
377
385
|
|
|
378
386
|
Promptbook is an ecosystem of tools centered around the **Agents Server** - a production-ready platform for running persistent AI agents.
|
|
@@ -395,6 +403,8 @@ The [Promptbook Engine](https://github.com/webgptorg/promptbook) is the open-sou
|
|
|
395
403
|
|
|
396
404
|
|
|
397
405
|
|
|
406
|
+
|
|
407
|
+
|
|
398
408
|
## 💜 The Promptbook Project
|
|
399
409
|
|
|
400
410
|
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:
|
|
@@ -432,6 +442,8 @@ Promptbook project is an ecosystem centered around the **Agents Server** - a pla
|
|
|
432
442
|
</tbody>
|
|
433
443
|
</table>
|
|
434
444
|
|
|
445
|
+
|
|
446
|
+
|
|
435
447
|
### 🌐 Community & Social Media
|
|
436
448
|
|
|
437
449
|
Join our growing community of developers and users:
|
|
@@ -488,6 +500,8 @@ Join our growing community of developers and users:
|
|
|
488
500
|
|
|
489
501
|
|
|
490
502
|
|
|
503
|
+
|
|
504
|
+
|
|
491
505
|
## 📚 Documentation
|
|
492
506
|
|
|
493
507
|
See detailed guides and API reference in the [docs](https://github.com/webgptorg/promptbook/discussions/categories/concepts) or [online](https://discord.gg/x3QWNaa89N).
|
|
@@ -695,6 +709,8 @@ The following glossary is used to clarify certain concepts:
|
|
|
695
709
|
|
|
696
710
|
_Note: This section is not a complete dictionary, more list of general AI / LLM terms that has connection with Promptbook_
|
|
697
711
|
|
|
712
|
+
|
|
713
|
+
|
|
698
714
|
### 💯 Core concepts
|
|
699
715
|
|
|
700
716
|
- [📚 Collection of pipelines](https://github.com/webgptorg/promptbook/discussions/65)
|
package/esm/index.es.js
CHANGED
|
@@ -41,7 +41,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
41
41
|
* @generated
|
|
42
42
|
* @see https://github.com/webgptorg/promptbook
|
|
43
43
|
*/
|
|
44
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.
|
|
44
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.113.0-0';
|
|
45
45
|
/**
|
|
46
46
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
47
47
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -12692,6 +12692,70 @@ class MetaLinkCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
12692
12692
|
}
|
|
12693
12693
|
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
12694
12694
|
|
|
12695
|
+
/**
|
|
12696
|
+
* META VISIBILITY commitment definition.
|
|
12697
|
+
*
|
|
12698
|
+
* The `META VISIBILITY` commitment stores whether an agent is public, private, or unlisted.
|
|
12699
|
+
* Agents Server mirrors this value into the database for efficient filtering, but the book
|
|
12700
|
+
* commitment remains the editable source of truth.
|
|
12701
|
+
*
|
|
12702
|
+
* @private Metadata-only commitment used by Agents Server.
|
|
12703
|
+
*/
|
|
12704
|
+
class MetaVisibilityCommitmentDefinition extends BaseCommitmentDefinition {
|
|
12705
|
+
constructor() {
|
|
12706
|
+
super('META VISIBILITY');
|
|
12707
|
+
}
|
|
12708
|
+
/**
|
|
12709
|
+
* Short one-line description of META VISIBILITY.
|
|
12710
|
+
*/
|
|
12711
|
+
get description() {
|
|
12712
|
+
return 'Set whether the agent is private, unlisted, or public.';
|
|
12713
|
+
}
|
|
12714
|
+
/**
|
|
12715
|
+
* Icon for this commitment.
|
|
12716
|
+
*/
|
|
12717
|
+
get icon() {
|
|
12718
|
+
return '👁️';
|
|
12719
|
+
}
|
|
12720
|
+
/**
|
|
12721
|
+
* Markdown documentation for META VISIBILITY commitment.
|
|
12722
|
+
*/
|
|
12723
|
+
get documentation() {
|
|
12724
|
+
return spaceTrim$1(`
|
|
12725
|
+
# META VISIBILITY
|
|
12726
|
+
|
|
12727
|
+
Sets the agent visibility used by Agents Server.
|
|
12728
|
+
|
|
12729
|
+
## Allowed values
|
|
12730
|
+
|
|
12731
|
+
- \`PRIVATE\` - accessible only to signed-in users with access.
|
|
12732
|
+
- \`UNLISTED\` - accessible by direct link but hidden from public listings.
|
|
12733
|
+
- \`PUBLIC\` - visible in public listings and accessible by anyone.
|
|
12734
|
+
|
|
12735
|
+
## Key aspects
|
|
12736
|
+
|
|
12737
|
+
- Does not modify the agent's behavior, system message, or tools.
|
|
12738
|
+
- Whitespace and letter case are normalized when persisted.
|
|
12739
|
+
- If multiple \`META VISIBILITY\` commitments are present, persistence keeps one normalized value.
|
|
12740
|
+
- Agents Server mirrors the value into the database for filtering, but the book is the source of truth.
|
|
12741
|
+
|
|
12742
|
+
## Example
|
|
12743
|
+
|
|
12744
|
+
\`\`\`book
|
|
12745
|
+
Helpful Assistant
|
|
12746
|
+
|
|
12747
|
+
GOAL Be helpful and friendly.
|
|
12748
|
+
META VISIBILITY PUBLIC
|
|
12749
|
+
\`\`\`
|
|
12750
|
+
`);
|
|
12751
|
+
}
|
|
12752
|
+
applyToAgentModelRequirements(requirements, content) {
|
|
12753
|
+
// META VISIBILITY is metadata only and does not alter model requirements.
|
|
12754
|
+
return requirements;
|
|
12755
|
+
}
|
|
12756
|
+
}
|
|
12757
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
12758
|
+
|
|
12695
12759
|
/**
|
|
12696
12760
|
* META VOICE commitment definition
|
|
12697
12761
|
*
|
|
@@ -19187,31 +19251,65 @@ class UseSearchEngineCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
19187
19251
|
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
19188
19252
|
|
|
19189
19253
|
/**
|
|
19190
|
-
* This error
|
|
19254
|
+
* This error indicates that the promptbook in a markdown format cannot be parsed into a valid promptbook object
|
|
19191
19255
|
*
|
|
19192
19256
|
* @public exported from `@promptbook/core`
|
|
19193
19257
|
*/
|
|
19194
|
-
class
|
|
19258
|
+
class ParseError extends Error {
|
|
19195
19259
|
constructor(message) {
|
|
19196
19260
|
super(message);
|
|
19197
|
-
this.name = '
|
|
19198
|
-
Object.setPrototypeOf(this,
|
|
19261
|
+
this.name = 'ParseError';
|
|
19262
|
+
Object.setPrototypeOf(this, ParseError.prototype);
|
|
19199
19263
|
}
|
|
19200
19264
|
}
|
|
19265
|
+
// TODO: Maybe split `ParseError` and `ApplyError`
|
|
19201
19266
|
|
|
19202
19267
|
/**
|
|
19203
|
-
*
|
|
19268
|
+
* Supported visibility states for persisted agents.
|
|
19204
19269
|
*
|
|
19205
19270
|
* @public exported from `@promptbook/core`
|
|
19206
19271
|
*/
|
|
19207
|
-
|
|
19272
|
+
const AGENT_VISIBILITY_VALUES = ['PRIVATE', 'UNLISTED', 'PUBLIC'];
|
|
19273
|
+
/**
|
|
19274
|
+
* Returns `true` when the value is one of supported visibility states.
|
|
19275
|
+
*
|
|
19276
|
+
* @param value - Raw value to validate.
|
|
19277
|
+
* @returns Whether the value is a valid `AgentVisibility`.
|
|
19278
|
+
*
|
|
19279
|
+
* @public exported from `@promptbook/core`
|
|
19280
|
+
*/
|
|
19281
|
+
function isAgentVisibility(value) {
|
|
19282
|
+
return typeof value === 'string' && AGENT_VISIBILITY_VALUES.includes(value);
|
|
19283
|
+
}
|
|
19284
|
+
/**
|
|
19285
|
+
* Normalizes raw visibility text into a supported value.
|
|
19286
|
+
*
|
|
19287
|
+
* @param value - Raw visibility value.
|
|
19288
|
+
* @returns Normalized visibility, or `null` when invalid.
|
|
19289
|
+
*
|
|
19290
|
+
* @public exported from `@promptbook/core`
|
|
19291
|
+
*/
|
|
19292
|
+
function normalizeAgentVisibility(value) {
|
|
19293
|
+
if (typeof value !== 'string') {
|
|
19294
|
+
return null;
|
|
19295
|
+
}
|
|
19296
|
+
const normalized = value.trim().toUpperCase();
|
|
19297
|
+
return isAgentVisibility(normalized) ? normalized : null;
|
|
19298
|
+
}
|
|
19299
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
19300
|
+
|
|
19301
|
+
/**
|
|
19302
|
+
* This error type indicates that some limit was reached
|
|
19303
|
+
*
|
|
19304
|
+
* @public exported from `@promptbook/core`
|
|
19305
|
+
*/
|
|
19306
|
+
class LimitReachedError extends Error {
|
|
19208
19307
|
constructor(message) {
|
|
19209
19308
|
super(message);
|
|
19210
|
-
this.name = '
|
|
19211
|
-
Object.setPrototypeOf(this,
|
|
19309
|
+
this.name = 'LimitReachedError';
|
|
19310
|
+
Object.setPrototypeOf(this, LimitReachedError.prototype);
|
|
19212
19311
|
}
|
|
19213
19312
|
}
|
|
19214
|
-
// TODO: Maybe split `ParseError` and `ApplyError`
|
|
19215
19313
|
|
|
19216
19314
|
/**
|
|
19217
19315
|
* Maximum allowed source length for create-agent payloads.
|
|
@@ -21546,6 +21644,7 @@ const COMMITMENT_REGISTRY = [
|
|
|
21546
21644
|
new MetaDomainCommitmentDefinition(),
|
|
21547
21645
|
new MetaDisclaimerCommitmentDefinition(),
|
|
21548
21646
|
new MetaInputPlaceholderCommitmentDefinition(),
|
|
21647
|
+
new MetaVisibilityCommitmentDefinition(),
|
|
21549
21648
|
new MetaCommitmentDefinition(),
|
|
21550
21649
|
new MetaVoiceCommitmentDefinition(),
|
|
21551
21650
|
new NoteCommitmentDefinition('NOTE'),
|
|
@@ -21997,6 +22096,7 @@ const META_COMMITMENT_APPLIERS = {
|
|
|
21997
22096
|
'META COLOR': applyMetaColorContent,
|
|
21998
22097
|
'META FONT': applyMetaFontContent,
|
|
21999
22098
|
'META VOICE': applyMetaVoiceContent,
|
|
22099
|
+
'META VISIBILITY': applyMetaVisibilityContent,
|
|
22000
22100
|
};
|
|
22001
22101
|
/**
|
|
22002
22102
|
* Applies META-style commitments that mutate parsed profile metadata.
|
|
@@ -22026,6 +22126,10 @@ function applyGenericMetaCommitment(state, content) {
|
|
|
22026
22126
|
applyMetaAvatarContent(state, metaValue);
|
|
22027
22127
|
return;
|
|
22028
22128
|
}
|
|
22129
|
+
if (metaTypeRaw.toUpperCase() === 'VISIBILITY') {
|
|
22130
|
+
applyMetaVisibilityContent(state, metaValue);
|
|
22131
|
+
return;
|
|
22132
|
+
}
|
|
22029
22133
|
const metaType = normalizeTo_camelCase(metaTypeRaw);
|
|
22030
22134
|
state.meta[metaType] = metaValue;
|
|
22031
22135
|
}
|
|
@@ -22102,6 +22206,15 @@ function applyMetaFontContent(state, content) {
|
|
|
22102
22206
|
function applyMetaVoiceContent(state, content) {
|
|
22103
22207
|
state.meta.voice = spaceTrim$1(content);
|
|
22104
22208
|
}
|
|
22209
|
+
/**
|
|
22210
|
+
* Applies META VISIBILITY content into the normalized `meta.visibility` field.
|
|
22211
|
+
*/
|
|
22212
|
+
function applyMetaVisibilityContent(state, content) {
|
|
22213
|
+
const visibility = normalizeAgentVisibility(content);
|
|
22214
|
+
if (visibility) {
|
|
22215
|
+
state.meta.visibility = visibility;
|
|
22216
|
+
}
|
|
22217
|
+
}
|
|
22105
22218
|
/**
|
|
22106
22219
|
* Normalizes the separator in the content
|
|
22107
22220
|
*
|
|
@@ -23606,6 +23719,15 @@ const AGENT_REFERENCE_AT_PATTERN = '(?<!\\S)@[A-Za-z0-9_-]+';
|
|
|
23606
23719
|
* @private function of BookEditorMonaco
|
|
23607
23720
|
*/
|
|
23608
23721
|
const AGENT_REFERENCE_BRACED_PATTERN = '\\{[^{}\\r\\n]+\\}';
|
|
23722
|
+
/**
|
|
23723
|
+
* Pattern matching plain inline `@` tokens, for example email addresses.
|
|
23724
|
+
*
|
|
23725
|
+
* Monaco tokenizes from the current offset, so `team@foo.bar` can otherwise reach
|
|
23726
|
+
* the `@foo` suffix and look like a standalone compact reference.
|
|
23727
|
+
*
|
|
23728
|
+
* @private function of BookEditorMonaco
|
|
23729
|
+
*/
|
|
23730
|
+
const NON_AGENT_REFERENCE_INLINE_AT_TOKEN_REGEX = /[^\s{}]*[^\s@{}]@[^\s{}]+/;
|
|
23609
23731
|
/**
|
|
23610
23732
|
* Commitment types where compact agent references are supported.
|
|
23611
23733
|
*
|
|
@@ -23842,6 +23964,7 @@ const BookEditorMonacoTokenization = {
|
|
|
23842
23964
|
AGENT_URL_REFERENCE_REGEX,
|
|
23843
23965
|
AGENT_REFERENCE_TOKEN_REGEX,
|
|
23844
23966
|
AGENT_REFERENCE_BRACED_REGEX,
|
|
23967
|
+
NON_AGENT_REFERENCE_INLINE_AT_TOKEN_REGEX,
|
|
23845
23968
|
AGENT_REFERENCE_HIGHLIGHT_REGEXES,
|
|
23846
23969
|
extractAgentReferenceValue,
|
|
23847
23970
|
resolveAgentReferenceToUrl,
|
|
@@ -24073,13 +24196,15 @@ function ensureBookEditorMonacoLanguage(monaco, theme = BOOK_EDITOR_RENDER_THEME
|
|
|
24073
24196
|
const commitmentRegex = BookEditorMonacoTokenization.DYNAMIC_COMMITMENT_REGEX;
|
|
24074
24197
|
const agentReferenceCommitmentRegex = /^\s*(FROM|IMPORT|IMPORTS|TEAM)(?=\s|$)/;
|
|
24075
24198
|
const commitmentTransitionRules = createCommitmentTransitionRules(noteLikeCommitmentStates, agentReferenceCommitmentRegex, commitmentRegex);
|
|
24076
|
-
const
|
|
24199
|
+
const PARAMETER_REGEX = /@([a-zA-Z0-9_á-žÁ-Žč-řČ-Řš-žŠ-Žа-яА-ЯёЁ]+)/;
|
|
24200
|
+
const NON_AGENT_REFERENCE_INLINE_AT_TOKEN_REGEX = BookEditorMonacoTokenization.NON_AGENT_REFERENCE_INLINE_AT_TOKEN_REGEX;
|
|
24077
24201
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
24078
24202
|
const defaultBodyRules = [
|
|
24079
24203
|
[/^---[-]*$/, ''],
|
|
24080
24204
|
[CODE_BLOCK_FENCE_REGEX, 'code-block', '@codeblock'],
|
|
24081
24205
|
...commitmentTransitionRules,
|
|
24082
|
-
[
|
|
24206
|
+
[NON_AGENT_REFERENCE_INLINE_AT_TOKEN_REGEX, ''],
|
|
24207
|
+
[PARAMETER_REGEX, 'parameter'],
|
|
24083
24208
|
[/\{[^}]+\}/, 'parameter'],
|
|
24084
24209
|
];
|
|
24085
24210
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -24088,7 +24213,8 @@ function ensureBookEditorMonacoLanguage(monaco, theme = BOOK_EDITOR_RENDER_THEME
|
|
|
24088
24213
|
[CODE_BLOCK_FENCE_REGEX, 'code-block', '@codeblock'],
|
|
24089
24214
|
...commitmentTransitionRules,
|
|
24090
24215
|
...BookEditorMonacoTokenization.AGENT_REFERENCE_HIGHLIGHT_REGEXES.map((regex) => [regex, 'agent-reference']),
|
|
24091
|
-
[
|
|
24216
|
+
[NON_AGENT_REFERENCE_INLINE_AT_TOKEN_REGEX, ''],
|
|
24217
|
+
[PARAMETER_REGEX, 'parameter'],
|
|
24092
24218
|
[/\{[^}]+\}/, 'parameter'],
|
|
24093
24219
|
];
|
|
24094
24220
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|