@promptbook/core 0.112.0-64 → 0.112.0-65

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 (41) hide show
  1. package/esm/index.es.js +873 -236
  2. package/esm/index.es.js.map +1 -1
  3. package/esm/src/_packages/components.index.d.ts +0 -2
  4. package/esm/src/_packages/core.index.d.ts +2 -2
  5. package/esm/src/_packages/types.index.d.ts +0 -2
  6. package/esm/src/book-2.0/book-language-documentation/BookLanguageDocumentationExample.d.ts +27 -0
  7. package/esm/src/book-2.0/book-language-documentation/bookLanguageCommonPitfalls.d.ts +25 -0
  8. package/esm/src/book-2.0/book-language-documentation/bookLanguageDocumentationExamples.d.ts +10 -0
  9. package/esm/src/book-2.0/book-language-documentation/createStandaloneBookLanguageMarkdown.d.ts +14 -0
  10. package/esm/src/book-2.0/book-language-documentation/renderGroupedCommitmentDocumentationMarkdown.d.ts +43 -0
  11. package/esm/src/book-components/Chat/types/ChatMessage.d.ts +0 -34
  12. package/esm/src/commitments/KNOWLEDGE/KNOWLEDGE.d.ts +0 -11
  13. package/esm/src/commitments/_common/toolRuntimeContext.d.ts +0 -6
  14. package/esm/src/formfactors/index.d.ts +2 -2
  15. package/esm/src/formfactors/matcher/MatcherFormfactorDefinition.d.ts +1 -1
  16. package/esm/src/formfactors/translator/TranslatorFormfactorDefinition.d.ts +1 -1
  17. package/esm/src/llm-providers/openai/OpenAiAgentKitExecutionTools.d.ts +0 -4
  18. package/esm/src/llm-providers/openai/OpenAiAgentKitExecutionToolsOptions.d.ts +0 -9
  19. package/esm/src/version.d.ts +1 -1
  20. package/package.json +1 -2
  21. package/umd/index.umd.js +873 -236
  22. package/umd/index.umd.js.map +1 -1
  23. package/umd/src/_packages/components.index.d.ts +0 -2
  24. package/umd/src/_packages/core.index.d.ts +2 -2
  25. package/umd/src/_packages/types.index.d.ts +0 -2
  26. package/umd/src/book-2.0/book-language-documentation/BookLanguageDocumentationExample.d.ts +27 -0
  27. package/umd/src/book-2.0/book-language-documentation/bookLanguageCommonPitfalls.d.ts +25 -0
  28. package/umd/src/book-2.0/book-language-documentation/bookLanguageDocumentationExamples.d.ts +10 -0
  29. package/umd/src/book-2.0/book-language-documentation/createStandaloneBookLanguageMarkdown.d.ts +14 -0
  30. package/umd/src/book-2.0/book-language-documentation/renderGroupedCommitmentDocumentationMarkdown.d.ts +43 -0
  31. package/umd/src/book-components/Chat/types/ChatMessage.d.ts +0 -34
  32. package/umd/src/commitments/KNOWLEDGE/KNOWLEDGE.d.ts +0 -11
  33. package/umd/src/commitments/_common/toolRuntimeContext.d.ts +0 -6
  34. package/umd/src/formfactors/index.d.ts +2 -2
  35. package/umd/src/formfactors/matcher/MatcherFormfactorDefinition.d.ts +1 -1
  36. package/umd/src/formfactors/translator/TranslatorFormfactorDefinition.d.ts +1 -1
  37. package/umd/src/llm-providers/openai/OpenAiAgentKitExecutionTools.d.ts +0 -4
  38. package/umd/src/llm-providers/openai/OpenAiAgentKitExecutionToolsOptions.d.ts +0 -9
  39. package/umd/src/version.d.ts +1 -1
  40. /package/esm/src/{commitments/KNOWLEDGE/KNOWLEDGE.test.d.ts → book-2.0/book-language-documentation/renderGroupedCommitmentDocumentationMarkdown.test.d.ts} +0 -0
  41. /package/umd/src/{commitments/KNOWLEDGE/KNOWLEDGE.test.d.ts → book-2.0/book-language-documentation/renderGroupedCommitmentDocumentationMarkdown.test.d.ts} +0 -0
package/esm/index.es.js CHANGED
@@ -28,7 +28,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
28
28
  * @generated
29
29
  * @see https://github.com/webgptorg/promptbook
30
30
  */
31
- const PROMPTBOOK_ENGINE_VERSION = '0.112.0-64';
31
+ const PROMPTBOOK_ENGINE_VERSION = '0.112.0-65';
32
32
  /**
33
33
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
34
34
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -12088,18 +12088,6 @@ function parseDataUrlKnowledgeSource(source) {
12088
12088
  }
12089
12089
  // Note: [💞] Ignore a discrepancy between file name and entity name
12090
12090
 
12091
- /**
12092
- * Name of the tool used by agents to search configured `KNOWLEDGE` sources.
12093
- *
12094
- * @public exported from `@promptbook/core`
12095
- */
12096
- const KNOWLEDGE_SEARCH_TOOL_NAME = 'knowledge_search';
12097
- /**
12098
- * Title of the system-message section generated for `KNOWLEDGE` commitments.
12099
- *
12100
- * @private constant of `KnowledgeCommitmentDefinition`
12101
- */
12102
- const KNOWLEDGE_SEARCH_SYSTEM_SECTION_TITLE = 'Knowledge Search';
12103
12091
  /**
12104
12092
  * KNOWLEDGE commitment definition
12105
12093
  *
@@ -12221,17 +12209,9 @@ class KnowledgeCommitmentDefinition extends BaseCommitmentDefinition {
12221
12209
  knowledgeInfoEntries.push(`Knowledge Source Inline: ${inlineSource.filename} (derived from inline content and processed for retrieval during chat)`);
12222
12210
  }
12223
12211
  if (knowledgeInfoEntries.length === 0) {
12224
- return addKnowledgeSearchToolAndSystemSection(nextRequirements);
12212
+ return nextRequirements;
12225
12213
  }
12226
- return addKnowledgeSearchToolAndSystemSection(nextRequirements);
12227
- }
12228
- /**
12229
- * Gets human-readable titles for tool functions provided by this commitment.
12230
- */
12231
- getToolTitles() {
12232
- return {
12233
- [KNOWLEDGE_SEARCH_TOOL_NAME]: 'Knowledge search',
12234
- };
12214
+ return this.appendToSystemMessage(nextRequirements, knowledgeInfoEntries.join('\n'), '\n\n');
12235
12215
  }
12236
12216
  }
12237
12217
  /**
@@ -12245,128 +12225,6 @@ function hasMeaningfulNonUrlText(content, urls) {
12245
12225
  const significantText = contentWithoutUrls.replace(/[\s.,!?;:'"`()[\]{}<>/-]+/g, '');
12246
12226
  return significantText.length > 0;
12247
12227
  }
12248
- /**
12249
- * Adds the shared `knowledge_search` tool definition and the consolidated system-message section.
12250
- *
12251
- * @param requirements - Requirements after one `KNOWLEDGE` commitment was applied.
12252
- * @returns Requirements with the knowledge search instructions and tool definition.
12253
- *
12254
- * @private internal utility of `KnowledgeCommitmentDefinition`
12255
- */
12256
- function addKnowledgeSearchToolAndSystemSection(requirements) {
12257
- const nextRequirements = addKnowledgeSearchTool(requirements);
12258
- const section = createKnowledgeSearchSystemSection(nextRequirements);
12259
- const sectionHeader = `## ${KNOWLEDGE_SEARCH_SYSTEM_SECTION_TITLE}`;
12260
- if (nextRequirements.systemMessage.includes(sectionHeader)) {
12261
- return {
12262
- ...nextRequirements,
12263
- systemMessage: nextRequirements.systemMessage.replace(new RegExp(`## ${KNOWLEDGE_SEARCH_SYSTEM_SECTION_TITLE.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}[\\s\\S]*?(?=\\n\\n##|$)`), section),
12264
- };
12265
- }
12266
- return {
12267
- ...nextRequirements,
12268
- systemMessage: nextRequirements.systemMessage.trim()
12269
- ? `${nextRequirements.systemMessage}\n\n${section}`
12270
- : section,
12271
- };
12272
- }
12273
- /**
12274
- * Adds the `knowledge_search` model tool when it is not already present.
12275
- *
12276
- * @param requirements - Current model requirements.
12277
- * @returns Requirements with the tool definition available to the model.
12278
- *
12279
- * @private internal utility of `KnowledgeCommitmentDefinition`
12280
- */
12281
- function addKnowledgeSearchTool(requirements) {
12282
- const existingTools = requirements.tools || [];
12283
- if (existingTools.some((tool) => tool.name === KNOWLEDGE_SEARCH_TOOL_NAME)) {
12284
- return requirements;
12285
- }
12286
- return {
12287
- ...requirements,
12288
- tools: [
12289
- ...existingTools,
12290
- {
12291
- name: KNOWLEDGE_SEARCH_TOOL_NAME,
12292
- description: spaceTrim$1(`
12293
- Search the agent's configured knowledge sources and return relevant excerpts with citation ids.
12294
- Use this before answering questions that may depend on the agent's KNOWLEDGE commitments.
12295
- `),
12296
- parameters: {
12297
- type: 'object',
12298
- properties: {
12299
- query: {
12300
- type: 'string',
12301
- description: 'The natural-language search query for the knowledge base.',
12302
- },
12303
- limit: {
12304
- type: 'integer',
12305
- description: 'Maximum number of matching source excerpts to return.',
12306
- },
12307
- },
12308
- required: ['query'],
12309
- },
12310
- },
12311
- ],
12312
- };
12313
- }
12314
- /**
12315
- * Creates the model-facing system-message section for knowledge search.
12316
- *
12317
- * @param requirements - Current model requirements.
12318
- * @returns Markdown system-message section.
12319
- *
12320
- * @private internal utility of `KnowledgeCommitmentDefinition`
12321
- */
12322
- function createKnowledgeSearchSystemSection(requirements) {
12323
- const sourceEntries = createKnowledgeSourceSystemEntries(requirements);
12324
- const sourceList = sourceEntries.length > 0 ? sourceEntries.map((entry) => `- ${entry}`).join('\n') : '- None';
12325
- return spaceTrim$1(`
12326
- ## ${KNOWLEDGE_SEARCH_SYSTEM_SECTION_TITLE}
12327
-
12328
- - Use \`${KNOWLEDGE_SEARCH_TOOL_NAME}\` to search the configured knowledge sources before answering questions that depend on this agent's knowledge base.
12329
- - Base source-backed factual answers on the returned excerpts.
12330
- - When you use a returned excerpt, include its citation marker in the answer body, for example \`[0:0]\`.
12331
- - If the search returns no relevant information, say that the knowledge base did not contain the answer instead of inventing it.
12332
-
12333
- Configured knowledge sources:
12334
- ${sourceList}
12335
- `);
12336
- }
12337
- /**
12338
- * Builds a stable list of configured knowledge sources for system-message diagnostics.
12339
- *
12340
- * @param requirements - Current model requirements.
12341
- * @returns Human-readable source entries.
12342
- *
12343
- * @private internal utility of `KnowledgeCommitmentDefinition`
12344
- */
12345
- function createKnowledgeSourceSystemEntries(requirements) {
12346
- var _a;
12347
- const entries = [];
12348
- const seenEntries = new Set();
12349
- for (const source of requirements.knowledgeSources || []) {
12350
- const entry = `Source URL: ${source} (processed for retrieval during chat)`;
12351
- if (seenEntries.has(entry)) {
12352
- continue;
12353
- }
12354
- seenEntries.add(entry);
12355
- entries.push(entry);
12356
- }
12357
- const inlineSources = (((_a = requirements._metadata) === null || _a === void 0 ? void 0 : _a.inlineKnowledgeSources) || [])
12358
- .map((source) => source.filename)
12359
- .filter(Boolean);
12360
- for (const filename of inlineSources) {
12361
- const entry = `Knowledge Source Inline: ${filename} (Inline source: processed for retrieval during chat)`;
12362
- if (seenEntries.has(entry)) {
12363
- continue;
12364
- }
12365
- seenEntries.add(entry);
12366
- entries.push(entry);
12367
- }
12368
- return entries;
12369
- }
12370
12228
 
12371
12229
  /**
12372
12230
  * LANGUAGE commitment definition
@@ -18092,7 +17950,11 @@ class PersonaCommitmentDefinition extends BaseCommitmentDefinition {
18092
17950
  // Create new system message with persona at the beginning
18093
17951
  // Format: "You are {agentName}\n{personaContent}"
18094
17952
  // The # PERSONA comment will be removed later by removeCommentsFromSystemMessage
18095
- const personaSection = `# PERSONA\nYou are ${agentName}\n${mergedPersonaContent}`; // <- TODO: Use spaceTrim
17953
+ const personaSection = spaceTrim$1((block) => `
17954
+ # PERSONA
17955
+ You are ${agentName}
17956
+ ${block(mergedPersonaContent)}
17957
+ `);
18096
17958
  const newSystemMessage = cleanedMessage ? `${personaSection}\n\n${cleanedMessage}` : personaSection;
18097
17959
  return {
18098
17960
  ...requirements,
@@ -27699,6 +27561,791 @@ const DEFAULT_BOOK = padBook(validateBook(spaceTrim$1(`
27699
27561
  // <- [🐱‍🚀] Buttons into genesis book
27700
27562
  // <- TODO: [🐱‍🚀] generateBookBoilerplate and deprecate `DEFAULT_BOOK`
27701
27563
 
27564
+ /**
27565
+ * Warning message used for unfinished commitments.
27566
+ */
27567
+ const UNFINISHED_COMMITMENT_MESSAGE = 'This commitment is unfinished and not ready to use. Be careful when using it.';
27568
+ /**
27569
+ * Low-level warning message used for low-level commitments.
27570
+ */
27571
+ const LOW_LEVEL_COMMITMENT_MESSAGE = 'This commitment is low-level and not used by most of the users. Be careful when using it.';
27572
+ /**
27573
+ * Short badge text used for deprecated commitments.
27574
+ */
27575
+ const DEPRECATED_COMMITMENT_BADGE_LABEL = 'Deprecated';
27576
+ /**
27577
+ * Short badge text used for unfinished and low-level commitments.
27578
+ */
27579
+ const LOW_LEVEL_COMMITMENT_BADGE_LABEL = 'Low-level';
27580
+ /**
27581
+ * Longer label used for deprecated commitments.
27582
+ */
27583
+ const DEPRECATED_COMMITMENT_DETAIL_LABEL = 'Deprecated commitment';
27584
+ /**
27585
+ * Longer label used for unfinished and low-level commitments.
27586
+ */
27587
+ const LOW_LEVEL_COMMITMENT_DETAIL_LABEL = 'Low-level commitment';
27588
+ /**
27589
+ * Prefix used when formatting replacement guidance.
27590
+ */
27591
+ const PREFERRED_REPLACEMENT_LABEL = 'Preferred replacement';
27592
+ /**
27593
+ * Formats preferred replacement guidance for deprecated commitments.
27594
+ *
27595
+ * @param replacedBy - Preferred replacement commitment keywords.
27596
+ * @returns Optional replacement guidance sentence with leading space.
27597
+ *
27598
+ * @private internal utility of commitment catalog notices
27599
+ */
27600
+ function formatCommitmentReplacementText(replacedBy) {
27601
+ if (!replacedBy || replacedBy.length === 0) {
27602
+ return '';
27603
+ }
27604
+ return ` ${PREFERRED_REPLACEMENT_LABEL}: ${replacedBy.map((type) => `\`${type}\``).join(', ')}.`;
27605
+ }
27606
+ /**
27607
+ * Resolves the notice metadata for deprecated, unfinished, or low-level commitments.
27608
+ *
27609
+ * @param definition - Commitment definition to inspect.
27610
+ * @returns Notice metadata when the commitment should be surfaced with caution.
27611
+ *
27612
+ * @private internal utility of commitment catalog notices
27613
+ */
27614
+ function getCommitmentNoticeMetadata(definition) {
27615
+ if (definition.isUnfinished) {
27616
+ return {
27617
+ kind: 'unfinished',
27618
+ badgeLabel: LOW_LEVEL_COMMITMENT_BADGE_LABEL,
27619
+ detailLabel: LOW_LEVEL_COMMITMENT_DETAIL_LABEL,
27620
+ message: UNFINISHED_COMMITMENT_MESSAGE,
27621
+ };
27622
+ }
27623
+ if (definition.isLowLevel) {
27624
+ return {
27625
+ kind: 'lowLevel',
27626
+ badgeLabel: LOW_LEVEL_COMMITMENT_BADGE_LABEL,
27627
+ detailLabel: LOW_LEVEL_COMMITMENT_DETAIL_LABEL,
27628
+ message: LOW_LEVEL_COMMITMENT_MESSAGE,
27629
+ };
27630
+ }
27631
+ if (definition.deprecation) {
27632
+ return {
27633
+ kind: 'deprecated',
27634
+ badgeLabel: DEPRECATED_COMMITMENT_BADGE_LABEL,
27635
+ detailLabel: DEPRECATED_COMMITMENT_DETAIL_LABEL,
27636
+ message: definition.deprecation.message,
27637
+ };
27638
+ }
27639
+ return null;
27640
+ }
27641
+
27642
+ /**
27643
+ * Common anti-patterns with practical fixes.
27644
+ *
27645
+ * @private internal utility of `createStandaloneBookLanguageMarkdown`
27646
+ */
27647
+ const bookLanguageCommonPitfalls = [
27648
+ {
27649
+ title: 'Too broad agent scope',
27650
+ dont: 'One agent tries to be a lawyer, developer, marketer, and researcher at once.',
27651
+ doInstead: 'Split into focused agents and orchestrate with TEAM or IMPORT.',
27652
+ },
27653
+ {
27654
+ title: 'Unverifiable claims',
27655
+ dont: 'The agent answers internet-dependent questions without tools or without citing sources.',
27656
+ doInstead: 'Add `USE SEARCH ENGINE` / `USE BROWSER` and a citation-oriented `RULE`.',
27657
+ },
27658
+ {
27659
+ title: 'Missing guardrails',
27660
+ dont: 'Only persona is defined, with no behavioral constraints.',
27661
+ doInstead: 'Add concrete `RULE` commitments for safety, scope, and tone.',
27662
+ },
27663
+ {
27664
+ title: 'Overloaded inheritance',
27665
+ dont: 'Using deep `FROM` chains without documenting why each parent is needed.',
27666
+ doInstead: 'Keep inheritance shallow and use focused IMPORT/TEAM composition for reuse.',
27667
+ },
27668
+ {
27669
+ title: 'Unsafe memory usage',
27670
+ dont: 'Storing every detail in memory without boundaries.',
27671
+ doInstead: 'Pair `MEMORY` with explicit rules about what is allowed to persist.',
27672
+ },
27673
+ ];
27674
+
27675
+ /**
27676
+ * End-to-end examples used by the standalone Book language documentation.
27677
+ *
27678
+ * These are intentionally compact but complete, so they can be copy-pasted and
27679
+ * used as practical starting points.
27680
+ *
27681
+ * @private internal utility of `createStandaloneBookLanguageMarkdown`
27682
+ */
27683
+ const bookLanguageDocumentationExamples = [
27684
+ {
27685
+ id: 'minimal-hello-world-agent',
27686
+ title: 'Minimal hello-world agent',
27687
+ goal: 'Create the smallest useful agent with identity and greeting.',
27688
+ source: spaceTrim$1(`
27689
+ Hello World Agent
27690
+
27691
+ GOAL Be a concise and friendly assistant.
27692
+ INITIAL MESSAGE Hello! I am ready to help.
27693
+ CLOSED
27694
+ `),
27695
+ walkthrough: [
27696
+ 'The first line (`Hello World Agent`) is the agent name.',
27697
+ '`GOAL` defines the effective role and profile text.',
27698
+ '`INITIAL MESSAGE` sets a deterministic first message for a new chat.',
27699
+ '`CLOSED` prevents conversational self-modification.',
27700
+ ],
27701
+ },
27702
+ {
27703
+ id: 'tool-using-browser-search-agent',
27704
+ title: 'Tool-using agent (Browser + Search engine)',
27705
+ goal: 'Enable internet research with clear sourcing behavior.',
27706
+ source: spaceTrim$1(`
27707
+ Web Research Assistant
27708
+
27709
+ GOAL Research topics using fresh and verifiable information.
27710
+ USE SEARCH ENGINE Prefer official sources and recent publications.
27711
+ USE BROWSER
27712
+ RULE Verify important claims across multiple sources when possible.
27713
+ RULE Include source links in your final answer.
27714
+ INITIAL MESSAGE Ask me what topic you want to research and how deep the report should be.
27715
+ `),
27716
+ walkthrough: [
27717
+ '`USE SEARCH ENGINE` provides web search tooling and optional search instructions.',
27718
+ '`USE BROWSER` enables URL fetching and interactive browsing tools.',
27719
+ '`RULE` commitments make reliability behavior explicit and repeatable.',
27720
+ 'This pattern is ideal for current-events and fact-checking agents.',
27721
+ ],
27722
+ },
27723
+ {
27724
+ id: 'rule-and-knowledge-agent',
27725
+ title: 'Agent with RULE and KNOWLEDGE',
27726
+ goal: 'Ground responses in explicit constraints and curated sources.',
27727
+ source: spaceTrim$1(`
27728
+ Support Policy Assistant
27729
+
27730
+ GOAL Answer questions about support policy.
27731
+ KNOWLEDGE Refunds are available within 30 days with proof of purchase.
27732
+ KNOWLEDGE https://example.com/support-policy
27733
+ RULE If a policy item is missing in available knowledge, say it explicitly.
27734
+ RULE Never invent legal or policy statements.
27735
+ INITIAL MESSAGE I can explain refund and support rules from provided knowledge.
27736
+ `),
27737
+ walkthrough: [
27738
+ '`KNOWLEDGE` may be inline text or an external URL/document.',
27739
+ '`RULE` commitments define non-negotiable behavior constraints.',
27740
+ 'Combining both creates predictable, grounded policy responses.',
27741
+ 'Use this pattern for compliance, support, and internal procedures.',
27742
+ ],
27743
+ },
27744
+ {
27745
+ id: 'memory-agent-with-long-term-memory',
27746
+ title: 'MEMORY agent with long-term memory',
27747
+ goal: 'Persist user preferences across conversations.',
27748
+ source: spaceTrim$1(`
27749
+ Customer Success Memory Agent
27750
+
27751
+ GOAL Support SaaS customers while remembering relevant setup and preference context.
27752
+ MEMORY Remember product setup, user goals, and communication preferences.
27753
+ RULE Store only user-approved preferences and project context.
27754
+ RULE Never store secrets or sensitive data unless explicitly requested and allowed.
27755
+ INITIAL MESSAGE I can remember your setup and preferences for future sessions.
27756
+ `),
27757
+ walkthrough: [
27758
+ '`MEMORY` adds runtime memory tools and memory-specific system guidance.',
27759
+ '`RULE` commitments narrow what should be remembered to reduce privacy risks.',
27760
+ 'In Agents Server, memory is runtime-backed and user-scoped.',
27761
+ 'Use this for assistants that must preserve context over time.',
27762
+ ],
27763
+ },
27764
+ {
27765
+ id: 'use-project-and-wallet-integration-agent',
27766
+ title: 'USE PROJECT and WALLET external integration',
27767
+ goal: 'Work with GitHub repositories and wallet-backed credentials.',
27768
+ source: spaceTrim$1(`
27769
+ Repository Maintainer
27770
+
27771
+ GOAL Maintain a GitHub repository and prepare safe pull requests.
27772
+ USE PROJECT https://github.com/acme/website
27773
+ WALLET Store credentials for repository operations.
27774
+ RULE Before editing files, explain the planned change and impacted paths.
27775
+ RULE Never reveal raw credentials in chat output.
27776
+ INITIAL MESSAGE I can inspect the repository and help you prepare PR-ready changes.
27777
+ `),
27778
+ walkthrough: [
27779
+ '`USE PROJECT` enables repository tools for listing, reading, editing files, and creating PRs.',
27780
+ 'Credentials are resolved from wallet records at runtime in Agents Server.',
27781
+ '`WALLET` is kept here as a compatibility marker, but current Book 2.0 parsing treats it as deprecated/ignored.',
27782
+ 'In current runtime behavior, wallet-backed integrations are driven by commitments such as `USE PROJECT` and `USE EMAIL`.',
27783
+ ],
27784
+ },
27785
+ {
27786
+ id: 'use-calendar-integration-agent',
27787
+ title: 'USE CALENDAR integration',
27788
+ goal: 'Coordinate meetings and schedules through a connected Google Calendar.',
27789
+ source: spaceTrim$1(`
27790
+ Calendar Assistant
27791
+
27792
+ GOAL Schedule meetings and keep the calendar conflict-free.
27793
+ USE CALENDAR https://calendar.google.com/calendar/u/0/r
27794
+ SCOPES https://www.googleapis.com/auth/calendar
27795
+ RULE Confirm destructive actions before deleting an event.
27796
+ INITIAL MESSAGE Tell me the meeting details and I will schedule it in your calendar.
27797
+ `),
27798
+ walkthrough: [
27799
+ '`USE CALENDAR` enables calendar tools for listing, reading, creating, updating, and deleting events.',
27800
+ 'The first calendar URL identifies which calendar integration should be used.',
27801
+ '`SCOPES` can explicitly request required Google Calendar OAuth permissions.',
27802
+ 'Credentials are resolved from wallet-backed Google Calendar OAuth records at runtime in Agents Server.',
27803
+ ],
27804
+ },
27805
+ {
27806
+ id: 'agents-team-example',
27807
+ title: 'Agents TEAM (with in-book teammates)',
27808
+ goal: 'Delegate sub-tasks to specialized teammates.',
27809
+ source: spaceTrim$1(`
27810
+ Team Manager
27811
+
27812
+ GOAL Coordinate specialists and deliver one consolidated answer.
27813
+ TEAM Ask {Legal Reviewer} for legal constraints and {Implementation Reviewer} for technical feasibility.
27814
+ RULE Always summarize teammate outputs into one action plan.
27815
+
27816
+ ---
27817
+
27818
+ Legal Reviewer
27819
+
27820
+ FROM VOID
27821
+ GOAL Review legal and compliance risk.
27822
+ RULE Flag legal/compliance risk and uncertainty clearly.
27823
+ CLOSED
27824
+
27825
+ ---
27826
+
27827
+ Implementation Reviewer
27828
+
27829
+ FROM VOID
27830
+ GOAL Review implementation effort and delivery risk.
27831
+ RULE Estimate complexity and identify blockers.
27832
+ CLOSED
27833
+ `),
27834
+ walkthrough: [
27835
+ 'The main agent delegates via `TEAM` commitment.',
27836
+ 'References in `{...}` are resolved against embedded agents inside the same book (split by `---`).',
27837
+ 'Each teammate can be isolated with `FROM VOID` for deterministic specialization.',
27838
+ 'This pattern works well for multi-role review and decision support.',
27839
+ ],
27840
+ },
27841
+ ];
27842
+
27843
+ /**
27844
+ * Canonical commitment keyword for the open/closed family.
27845
+ *
27846
+ * @private internal utility of `createStandaloneBookLanguageMarkdown`
27847
+ */
27848
+ const OPEN_COMMITMENT_TYPE = 'OPEN';
27849
+ /**
27850
+ * Canonical commitment keyword for the open/closed family.
27851
+ */
27852
+ const CLOSED_COMMITMENT_TYPE = 'CLOSED';
27853
+ /**
27854
+ * Removes the top-level heading from one commitment documentation block.
27855
+ *
27856
+ * @param markdown - Original markdown source.
27857
+ * @returns Markdown without the first `#` heading.
27858
+ *
27859
+ * @private internal utility of `createStandaloneBookLanguageMarkdown`
27860
+ */
27861
+ function removeLeadingTopLevelHeading(markdown) {
27862
+ return markdown.replace(/^\s*#\s+[^\n]+\n*/u, '').trim();
27863
+ }
27864
+ /**
27865
+ * Renders one subsection for the combined open/closed documentation family.
27866
+ *
27867
+ * @param title - Heading label for the subsection.
27868
+ * @param documentation - Raw commitment documentation markdown.
27869
+ * @returns Markdown subsection with a `####` heading.
27870
+ *
27871
+ * @private internal utility of `createStandaloneBookLanguageMarkdown`
27872
+ */
27873
+ function renderDocumentationSection(title, documentation) {
27874
+ return `#### ${title}\n\n${removeLeadingTopLevelHeading(documentation)}`;
27875
+ }
27876
+ /**
27877
+ * Renders the documentation body for one grouped commitment entry.
27878
+ *
27879
+ * `OPEN` and `CLOSED` are intentionally rendered together so the documentation
27880
+ * surfaces present them as one conceptual switch instead of two isolated pages.
27881
+ *
27882
+ * @param group - Grouped commitment metadata.
27883
+ * @returns Markdown body for the docs page/catalog entry.
27884
+ *
27885
+ * @private internal utility of `createStandaloneBookLanguageMarkdown`
27886
+ */
27887
+ function renderGroupedCommitmentDocumentationMarkdown(group) {
27888
+ const commitmentTypes = new Set([group.primary.type, ...group.aliases]);
27889
+ if (commitmentTypes.has(OPEN_COMMITMENT_TYPE) && commitmentTypes.has(CLOSED_COMMITMENT_TYPE)) {
27890
+ const openCommitmentDefinition = getCommitmentDefinition(OPEN_COMMITMENT_TYPE);
27891
+ const closedCommitmentDefinition = getCommitmentDefinition(CLOSED_COMMITMENT_TYPE);
27892
+ if (openCommitmentDefinition && closedCommitmentDefinition) {
27893
+ return spaceTrim$1((block) => `
27894
+ ${block(renderDocumentationSection(OPEN_COMMITMENT_TYPE, openCommitmentDefinition.documentation))}
27895
+
27896
+ ${block(renderDocumentationSection(CLOSED_COMMITMENT_TYPE, closedCommitmentDefinition.documentation))}
27897
+ `);
27898
+ }
27899
+ }
27900
+ return removeLeadingTopLevelHeading(group.primary.documentation);
27901
+ }
27902
+
27903
+ /**
27904
+ * Commitment types that primarily model composition of multiple agents.
27905
+ *
27906
+ * @private internal utility of `createStandaloneBookLanguageMarkdown`
27907
+ */
27908
+ const COMPOSITION_COMMITMENT_TYPES = new Set(['FROM', 'IMPORT', 'IMPORTS', 'TEAM']);
27909
+ /**
27910
+ * Commitment types that expose tools/runtime capabilities.
27911
+ *
27912
+ * @private internal utility of `createStandaloneBookLanguageMarkdown`
27913
+ */
27914
+ const TOOLING_COMMITMENT_TYPES = new Set([
27915
+ 'USE BROWSER',
27916
+ 'USE DEEPSEARCH',
27917
+ 'USE SEARCH ENGINE',
27918
+ 'USE SEARCH',
27919
+ 'USE SPAWN',
27920
+ 'USE EMAIL',
27921
+ 'USE POPUP',
27922
+ 'USE TIME',
27923
+ 'USE USER LOCATION',
27924
+ 'USE PROJECT',
27925
+ 'USE CALENDAR',
27926
+ 'USE IMAGE GENERATOR',
27927
+ 'USE MCP',
27928
+ 'USE PRIVACY',
27929
+ 'MEMORY',
27930
+ 'MEMORIES',
27931
+ ]);
27932
+ /**
27933
+ * Commitment types that primarily define agent profile metadata.
27934
+ *
27935
+ * @private internal utility of `createStandaloneBookLanguageMarkdown`
27936
+ */
27937
+ const PROFILE_COMMITMENT_TYPES = new Set([
27938
+ 'GOAL',
27939
+ 'GOALS',
27940
+ 'PERSONA',
27941
+ 'PERSONAE',
27942
+ 'META',
27943
+ 'META AVATAR',
27944
+ 'META IMAGE',
27945
+ 'META LINK',
27946
+ 'META DOMAIN',
27947
+ 'META DESCRIPTION',
27948
+ 'META DISCLAIMER',
27949
+ 'META INPUT PLACEHOLDER',
27950
+ 'META COLOR',
27951
+ 'META FONT',
27952
+ 'META VOICE',
27953
+ 'INITIAL MESSAGE',
27954
+ 'MODEL',
27955
+ 'MODELS',
27956
+ ]);
27957
+ /**
27958
+ * Commitment types that primarily define behavioral constraints or prompt shaping.
27959
+ *
27960
+ * @private internal utility of `createStandaloneBookLanguageMarkdown`
27961
+ */
27962
+ const BEHAVIOR_COMMITMENT_TYPES = new Set([
27963
+ 'RULE',
27964
+ 'RULES',
27965
+ 'KNOWLEDGE',
27966
+ 'GOAL',
27967
+ 'GOALS',
27968
+ 'STYLE',
27969
+ 'STYLES',
27970
+ 'LANGUAGE',
27971
+ 'LANGUAGES',
27972
+ 'FORMAT',
27973
+ 'FORMATS',
27974
+ 'TEMPLATE',
27975
+ 'TEMPLATES',
27976
+ 'WRITING SAMPLE',
27977
+ 'WRITING RULES',
27978
+ 'SAMPLE',
27979
+ 'EXAMPLE',
27980
+ 'SCENARIO',
27981
+ 'SCENARIOS',
27982
+ 'MESSAGE',
27983
+ 'MESSAGES',
27984
+ 'MESSAGE SUFFIX',
27985
+ 'USER MESSAGE',
27986
+ 'AGENT MESSAGE',
27987
+ 'INTERNAL MESSAGE',
27988
+ 'OPEN',
27989
+ 'CLOSED',
27990
+ ]);
27991
+ /**
27992
+ * Creates one standalone markdown guide for Book language (Book 2.0 / agent language).
27993
+ *
27994
+ * The output intentionally combines:
27995
+ * - static conceptual building blocks maintained in this repository
27996
+ * - dynamically generated commitment catalog from runtime commitment definitions
27997
+ * so docs stay up-to-date by design.
27998
+ *
27999
+ * @returns Full standalone markdown document.
28000
+ *
28001
+ * @public exported from `@promptbook/core`
28002
+ */
28003
+ function createStandaloneBookLanguageMarkdown() {
28004
+ const groupedCommitments = getGroupedCommitmentDefinitions();
28005
+ const generatedAtIso = new Date().toISOString();
28006
+ const placeholderCommitmentCount = groupedCommitments.filter(({ primary }) => primary instanceof NotYetImplementedCommitmentDefinition).length;
28007
+ const implementedCommitmentCount = groupedCommitments.length - placeholderCommitmentCount;
28008
+ const allCommitmentKeywords = groupedCommitments.flatMap(({ primary, aliases }) => [primary.type, ...aliases]);
28009
+ const toolingCommitments = groupedCommitments.filter(({ primary }) => TOOLING_COMMITMENT_TYPES.has(primary.type));
28010
+ const profileCommitments = groupedCommitments.filter(({ primary }) => PROFILE_COMMITMENT_TYPES.has(primary.type));
28011
+ const compositionCommitments = groupedCommitments.filter(({ primary }) => COMPOSITION_COMMITMENT_TYPES.has(primary.type));
28012
+ const behaviorCommitments = groupedCommitments.filter(({ primary }) => BEHAVIOR_COMMITMENT_TYPES.has(primary.type));
28013
+ return spaceTrim$1(
28014
+ // [✨]
28015
+ (block) => `
28016
+ # Book Language blueprint
28017
+
28018
+ > Canonical standalone guide for Promptbook Book Agent language.
28019
+ > Generated from repository https://github.com/webgptorg/promptbook
28020
+
28021
+ - Book language version: \`${BOOK_LANGUAGE_VERSION}\`
28022
+ - Generated at: \`${generatedAtIso}\`
28023
+ - Commitment groups: \`${groupedCommitments.length}\`
28024
+ - Implemented commitments: \`${implementedCommitmentCount}\`
28025
+ - Placeholder commitments: \`${placeholderCommitmentCount}\`
28026
+
28027
+ ## <a id="table-of-contents"></a>Table of Contents
28028
+
28029
+ - [What Book language is](#what-book-language-is)
28030
+ - [Execution and compilation model](#execution-and-compilation-model)
28031
+ - [Mental model of an agent](#mental-model-of-an-agent)
28032
+ - [How to structure good agents](#how-to-structure-good-agents)
28033
+ - [Primitives and constructs reference](#primitives-and-constructs-reference)
28034
+ - [Commitment catalog (all commitments)](#commitment-catalog-all-commitments)
28035
+ - [End-to-end examples](#end-to-end-examples)
28036
+ - [Do nots and common pitfalls](#do-nots-and-common-pitfalls)
28037
+ - [Build an agent from scratch (offline tutorial)](#build-an-agent-from-scratch-offline-tutorial)
28038
+
28039
+ ## <a id="what-book-language-is"></a>What Book language is
28040
+
28041
+ Book language is a domain-specific language for defining **AI agents** as plain-text source.
28042
+ It solves these problems:
28043
+
28044
+ - **One editable source of truth** for agent behavior, tools, memory, and profile metadata.
28045
+ - **Composable agent architecture** through commitments like \`FROM\`, \`IMPORT\`, and \`TEAM\`.
28046
+ - **Deterministic runtime preparation** where source is parsed and compiled into model requirements.
28047
+ - **Portable agent definitions** that can be copied, versioned, and reviewed as text.
28048
+
28049
+ In this repository, "Book language" means **Book 2.0 agent language**.
28050
+
28051
+ ## <a id="execution-and-compilation-model"></a>Execution and compilation model
28052
+
28053
+ Promptbook and Agents Server use two core passes:
28054
+
28055
+ 1. **Fast parse pass** (\`parseAgentSource\`):
28056
+ It synchronously extracts agent profile/basic info (name, last goal/profile text, meta, capabilities, samples, references).
28057
+ 2. **Compilation pass** (\`createAgentModelRequirements\`):
28058
+ It applies commitments in sequence and builds executable model requirements (system message, tools, memory/tool metadata, imports, etc.).
28059
+
28060
+ In Agents Server, the runtime flow typically includes:
28061
+
28062
+ 1. Resolve scoped references (including in-book references like \`{Some Agent}\`).
28063
+ 2. Resolve inheritance/import chains into effective source.
28064
+ 3. Compile effective source into model requirements.
28065
+ 4. Execute chat turns with resolved tools and runtime adapters.
28066
+
28067
+ ## <a id="mental-model-of-an-agent"></a>Mental model of an agent
28068
+
28069
+ Think of one agent source as four layers:
28070
+
28071
+ 1. **Identity/Profile layer**:
28072
+ Agent name (first non-commitment line), the last \`GOAL\` (preferred) or deprecated \`PERSONA\`, and \`META*\` commitments.
28073
+ 2. **Behavior layer**:
28074
+ \`RULE\`, \`KNOWLEDGE\`, \`WRITING SAMPLE\`, \`WRITING RULES\`, deprecated \`STYLE\`, \`FORMAT\`, \`TEMPLATE\`, \`LANGUAGE\`, \`GOAL\`, and related commitments.
28075
+ 3. **Capability layer**:
28076
+ \`USE*\`, \`MEMORY\`, and other tooling commitments exposing runtime abilities.
28077
+ 4. **Composition layer**:
28078
+ \`FROM\` inheritance, \`IMPORT\` reuse, and \`TEAM\` delegation.
28079
+
28080
+ Agent composition commitments in current runtime:
28081
+
28082
+ - Profile-centric commitments detected: ${profileCommitments
28083
+ .map(({ primary }) => `\`${primary.type}\``)
28084
+ .join(', ')}
28085
+ - Behavior-centric commitments detected: ${behaviorCommitments
28086
+ .map(({ primary }) => `\`${primary.type}\``)
28087
+ .join(', ')}
28088
+ - Tool/runtime commitments detected: ${toolingCommitments
28089
+ .map(({ primary }) => `\`${primary.type}\``)
28090
+ .join(', ')}
28091
+ - Composition commitments detected: ${compositionCommitments
28092
+ .map(({ primary }) => `\`${primary.type}\``)
28093
+ .join(', ')}
28094
+
28095
+ ### META commitments and agent profile
28096
+
28097
+ \`META*\` commitments control profile data shown in UI (for example avatar visual, image, description, disclaimers, domain, input placeholder).
28098
+ They generally shape presentation/metadata rather than tool behavior.
28099
+
28100
+ ### FROM inheritance
28101
+
28102
+ \`FROM\` points to a parent agent source. During inheritance resolution:
28103
+
28104
+ - Parent corpus is merged into effective source.
28105
+ - \`FROM {Void}\` / \`FROM VOID\` means explicit "no parent".
28106
+ - Missing references are surfaced as notes in resolved source.
28107
+
28108
+ ### TEAM and IMPORT
28109
+
28110
+ - \`TEAM\` registers teammate agents as callable tools.
28111
+ - \`IMPORT\` injects imported agent/file content into current agent context.
28112
+ - In Agents Server, compact references like \`{Legal Reviewer}\` can resolve to embedded in-book agents.
28113
+
28114
+ ### USE commitments
28115
+
28116
+ \`USE*\` commitments enable capabilities (search, browser, project integration, email, image generation, etc.).
28117
+ They expose runtime tools and system-message guidance used during execution.
28118
+
28119
+ ## <a id="how-to-structure-good-agents"></a>How to structure good agents
28120
+
28121
+ Recommended patterns and tradeoffs:
28122
+
28123
+ 1. **Single clear role first**:
28124
+ Start with one narrow \`GOAL\`; use \`PERSONA\` only for backward-compatible legacy books.
28125
+ Tradeoff: less initial flexibility, much higher reliability.
28126
+ 2. **Guardrails early**:
28127
+ Add concrete \`RULE\` commitments before adding many tools.
28128
+ Tradeoff: more upfront design, fewer runtime surprises.
28129
+ 3. **Grounding over improvisation**:
28130
+ Prefer \`KNOWLEDGE\` + explicit citation rule for high-stakes answers.
28131
+ Tradeoff: extra maintenance for sources, better factual control.
28132
+ 4. **Composition over monoliths**:
28133
+ Use \`TEAM\`/\`IMPORT\` for specialized responsibilities.
28134
+ Tradeoff: orchestration overhead, stronger modularity and reuse.
28135
+ 5. **Controlled memory**:
28136
+ If using \`MEMORY\`, define what must and must not be remembered.
28137
+ Tradeoff: stricter policy design, better privacy and signal quality.
28138
+
28139
+ ## <a id="primitives-and-constructs-reference"></a>Primitives and constructs reference
28140
+
28141
+ ### Core syntax primitives
28142
+
28143
+ 1. **Agent title**:
28144
+ First non-empty line that is not a commitment keyword.
28145
+ 2. **Commitment block**:
28146
+ Starts with a commitment keyword and continues until the next commitment block or separator.
28147
+ 3. **Horizontal separator**:
28148
+ Lines like \`---\` split sections; in Agents Server they can delimit embedded in-book agents.
28149
+ 4. **Code fences**:
28150
+ Preserved inside commitment content; useful for examples/instructions.
28151
+ 5. **Parameters**:
28152
+ Both \`@parameter\` and \`{parameter}\` notations are supported and parsed.
28153
+
28154
+ ### Reference tokens and pseudo-agents
28155
+
28156
+ - Compact references like \`{Agent Name}\` are resolved by Agents Server reference resolver.
28157
+ - Pseudo-agent forms (for example \`{User}\`, \`{Void}\`) are supported in relevant commitments.
28158
+ - \`{User}\` is intended for \`TEAM\`; \`{Void}\` is useful for explicit no-parent inheritance.
28159
+
28160
+ ### Commitment keywords currently recognized
28161
+
28162
+ ${block(getSafeCodeBlock(allCommitmentKeywords.join(', '), 'text'))}
28163
+
28164
+ ## <a id="commitment-catalog-all-commitments"></a>Commitment catalog (all commitments)
28165
+
28166
+ This section is generated from commitment definitions in \`src/commitments\`.
28167
+ For each commitment group you get:
28168
+
28169
+ - semantics summary (description/icon/status)
28170
+ - parsing schema (\`createTypeRegex\` and \`createRegex\`)
28171
+ - canonical documentation block
28172
+
28173
+ ${block(groupedCommitments.map(renderCommitmentCatalogSection).join('\n\n'))}
28174
+
28175
+ ## <a id="end-to-end-examples"></a>End-to-end examples
28176
+
28177
+ ${block(bookLanguageDocumentationExamples.map(renderExampleSection).join('\n\n'))}
28178
+
28179
+ ## <a id="do-nots-and-common-pitfalls"></a>Do nots and common pitfalls
28180
+
28181
+ ${block(bookLanguageCommonPitfalls
28182
+ .map((pitfall, index) => spaceTrim$1(`
28183
+ ${index + 1}. **${pitfall.title}**
28184
+ - Don't: ${pitfall.dont}
28185
+ - Do instead: ${pitfall.doInstead}
28186
+ `))
28187
+ .join('\n'))}
28188
+
28189
+ ## <a id="build-an-agent-from-scratch-offline-tutorial"></a>Build an agent from scratch (offline tutorial)
28190
+
28191
+ This tutorial is sufficient without internet access.
28192
+
28193
+ 1. **Define role and goal**
28194
+ Create a short name line and one clear \`GOAL\`.
28195
+ 2. **Add behavioral constraints**
28196
+ Add 3-6 specific \`RULE\` commitments covering scope, tone, and safety boundaries.
28197
+ 3. **Add grounding**
28198
+ Add \`KNOWLEDGE\` commitments (inline text or local/importable sources).
28199
+ 4. **Add capabilities**
28200
+ Add only necessary \`USE*\` and/or \`MEMORY\` commitments.
28201
+ 5. **Set profile metadata**
28202
+ Add \`META DESCRIPTION\`, \`META AVATAR\` or \`META IMAGE\`, \`META INPUT PLACEHOLDER\`, and disclaimers if needed.
28203
+ 6. **Add first interaction**
28204
+ Add \`INITIAL MESSAGE\` and optionally sample \`USER MESSAGE\` / \`AGENT MESSAGE\` pairs.
28205
+ 7. **Close for deterministic behavior (optional)**
28206
+ Add \`CLOSED\` when you want stable non-self-modifying behavior.
28207
+
28208
+ Copy-paste template:
28209
+
28210
+ ${block(getSafeCodeBlock(spaceTrim$1(`
28211
+ Project Assistant
28212
+
28213
+ GOAL Help the user turn project ideas into concrete deliverables with focused planning support.
28214
+
28215
+ RULE Ask clarifying questions when requirements are ambiguous.
28216
+ RULE Provide concise, structured outputs with actionable steps.
28217
+ RULE If information is missing, state assumptions explicitly.
28218
+ RULE Do not invent facts.
28219
+
28220
+ KNOWLEDGE Team works in two-week sprints and tracks tasks in Kanban.
28221
+ KNOWLEDGE Preferred output format: summary, plan, risks, next action.
28222
+
28223
+ META DESCRIPTION Practical project-planning assistant.
28224
+ META INPUT PLACEHOLDER Describe your project goal or blocker...
28225
+
28226
+ INITIAL MESSAGE Share your project goal and current blocker, and I will propose a concrete next-step plan.
28227
+ CLOSED
28228
+ `), 'book'))}
28229
+
28230
+ Validation checklist:
28231
+
28232
+ - Does each commitment have a clear purpose?
28233
+ - Are there explicit constraints against hallucination and unsafe behavior?
28234
+ - Are tools only enabled when genuinely needed?
28235
+ - Is memory usage bounded by clear rules?
28236
+ - Is composition (\`FROM\`/\`TEAM\`/\`IMPORT\`) justified and understandable?
28237
+
28238
+ ---
28239
+
28240
+ Generated from:
28241
+
28242
+ - Commitments registry and runtime docs in \`src/commitments\`
28243
+ - Parser/compiler behavior in \`src/book-2.0/agent-source\`
28244
+ - Agents Server reference/inheritance resolution in \`apps/agents-server/src/utils\`
28245
+ - Standalone docs source blocks in \`apps/agents-server/src/utils/bookLanguageDocumentation\`
28246
+ `);
28247
+ }
28248
+ /**
28249
+ * Renders one commitment section in the generated catalog.
28250
+ *
28251
+ * @param groupedCommitment - Grouped commitment definition with aliases.
28252
+ * @returns Markdown section for a single commitment.
28253
+ *
28254
+ * @private internal utility of `createStandaloneBookLanguageMarkdown`
28255
+ */
28256
+ function renderCommitmentCatalogSection(groupedCommitment) {
28257
+ var _a;
28258
+ const { primary, aliases } = groupedCommitment;
28259
+ const notice = getCommitmentNoticeMetadata(primary);
28260
+ const status = primary instanceof NotYetImplementedCommitmentDefinition
28261
+ ? 'Placeholder (not fully implemented)'
28262
+ : notice
28263
+ ? `Implemented (${notice.detailLabel})`
28264
+ : 'Implemented';
28265
+ const aliasText = aliases.length === 0 ? 'None' : aliases.map((alias) => `\`${alias}\``).join(', ');
28266
+ const noticeText = notice
28267
+ ? notice.kind === 'deprecated'
28268
+ ? `- **Deprecation:** ${notice.message}${formatCommitmentReplacementText((_a = primary.deprecation) === null || _a === void 0 ? void 0 : _a.replacedBy)}`
28269
+ : `- **Low-level commitment:** ${notice.message}`
28270
+ : '';
28271
+ const documentationMarkdown = renderGroupedCommitmentDocumentationMarkdown(groupedCommitment);
28272
+ return spaceTrim$1((block) => `
28273
+ ### <a id="commitment-${toStableAnchorId(primary.type)}"></a>${primary.icon} ${primary.type}
28274
+
28275
+ - **Status:** ${status}
28276
+ - **Aliases:** ${aliasText}
28277
+ - **Semantics:** ${primary.description}
28278
+ - **Type schema (\`createTypeRegex\`):** \`${stringifyRegex(primary.createTypeRegex())}\`
28279
+ - **Block schema (\`createRegex\`):** \`${stringifyRegex(primary.createRegex())}\`
28280
+ ${noticeText}
28281
+
28282
+ ${block(documentationMarkdown)}
28283
+ `);
28284
+ }
28285
+ /**
28286
+ * Renders one end-to-end example section.
28287
+ *
28288
+ * @param example - Example definition.
28289
+ * @returns Markdown section for one example.
28290
+ *
28291
+ * @private internal utility of `createStandaloneBookLanguageMarkdown`
28292
+ */
28293
+ function renderExampleSection(example) {
28294
+ return spaceTrim$1((block) => `
28295
+ ### <a id="example-${toStableAnchorId(example.id)}"></a>${example.title}
28296
+
28297
+ **Goal:** ${example.goal}
28298
+
28299
+ **Full source**
28300
+
28301
+ ${block(getSafeCodeBlock(example.source, 'book'))}
28302
+
28303
+ **Walkthrough**
28304
+
28305
+ ${block(example.walkthrough.map((step, index) => `${index + 1}. ${step}`).join('\n'))}
28306
+ `);
28307
+ }
28308
+ /**
28309
+ * Converts a heading label into a stable markdown anchor id.
28310
+ *
28311
+ * @param value - Raw heading/identifier text.
28312
+ * @returns Stable lowercase anchor id.
28313
+ *
28314
+ * @private internal utility of `createStandaloneBookLanguageMarkdown`
28315
+ */
28316
+ function toStableAnchorId(value) {
28317
+ return value
28318
+ .trim()
28319
+ .toLowerCase()
28320
+ .replace(/[^a-z0-9]+/g, '-')
28321
+ .replace(/^-+|-+$/g, '');
28322
+ }
28323
+ /**
28324
+ * Converts a regular expression into a concise literal-like string.
28325
+ *
28326
+ * @param regex - Regex instance.
28327
+ * @returns Printable regex pattern and flags.
28328
+ *
28329
+ * @private internal utility of `createStandaloneBookLanguageMarkdown`
28330
+ */
28331
+ function stringifyRegex(regex) {
28332
+ return `/${regex.source}/${regex.flags}`;
28333
+ }
28334
+ /**
28335
+ * Creates a safe markdown fenced code block even when content contains backticks.
28336
+ *
28337
+ * @param content - Raw code content.
28338
+ * @param language - Optional info-string language label.
28339
+ * @returns Fenced code block.
28340
+ *
28341
+ * @private internal utility of `createStandaloneBookLanguageMarkdown`
28342
+ */
28343
+ function getSafeCodeBlock(content, language = 'markdown') {
28344
+ const maxBacktickCount = Math.max(0, ...(content.match(/`+/g) || []).map((match) => match.length));
28345
+ const fence = '`'.repeat(Math.max(3, maxBacktickCount + 1));
28346
+ return `${fence}${language}\n${content}\n${fence}`;
28347
+ }
28348
+
27702
28349
  /**
27703
28350
  * Generates an image for the agent to use as profile image
27704
28351
  *
@@ -29706,8 +30353,10 @@ const ImageGeneratorFormfactorDefinition = {
29706
30353
  */
29707
30354
  const MatcherFormfactorDefinition = {
29708
30355
  name: 'EXPERIMENTAL_MATCHER',
29709
- description: `An evaluation system that determines whether content meets specific criteria or patterns.
29710
- Used for content validation, quality assessment, and intelligent filtering tasks. Currently in experimental phase.`,
30356
+ description: spaceTrim$1(`
30357
+ An evaluation system that determines whether content meets specific criteria or patterns.
30358
+ Used for content validation, quality assessment, and intelligent filtering tasks. Currently in experimental phase.
30359
+ `),
29711
30360
  documentationUrl: `https://github.com/webgptorg/promptbook/discussions/177`,
29712
30361
  pipelineInterface: {
29713
30362
  inputParameters: [
@@ -29764,9 +30413,11 @@ const SheetsFormfactorDefinition = {
29764
30413
  */
29765
30414
  const TranslatorFormfactorDefinition = {
29766
30415
  name: 'TRANSLATOR',
29767
- description: `A text transformation system that converts input content into different forms,
29768
- including language translations, paraphrasing, style conversions, and tone adjustments.
29769
- This form factor takes one input and produces one transformed output.`,
30416
+ description: spaceTrim$1(`
30417
+ A text transformation system that converts input content into different forms,
30418
+ including language translations, paraphrasing, style conversions, and tone adjustments.
30419
+ This form factor takes one input and produces one transformed output.
30420
+ `),
29770
30421
  documentationUrl: `https://github.com/webgptorg/promptbook/discussions/175`,
29771
30422
  pipelineInterface: {
29772
30423
  inputParameters: [
@@ -31126,12 +31777,21 @@ const QuickChatbotHla = {
31126
31777
  // <- TODO: [🧠] Make this dynamic, async, prepare-phase HLAs
31127
31778
  ],
31128
31779
  });
31129
- // TODO: Use spaceTrim in multiline strings
31130
31780
  $pipelineJson.tasks.push({
31131
31781
  taskType: 'PROMPT_TASK',
31132
31782
  name: 'create-an-answer',
31133
31783
  title: 'Create an answer',
31134
- content: 'Write a response to the user message:\n\n**Question from user**\n\n> {userMessage}\n\n**Previous conversation**\n\n> {previousConversationSummary}',
31784
+ content: spaceTrim$1(`
31785
+ Write a response to the user message:
31786
+
31787
+ **Question from user**
31788
+
31789
+ > {userMessage}
31790
+
31791
+ **Previous conversation**
31792
+
31793
+ > {previousConversationSummary}
31794
+ `),
31135
31795
  resultingParameterName: 'chatbotResponse',
31136
31796
  personaName,
31137
31797
  dependentParameterNames: [
@@ -31143,7 +31803,26 @@ const QuickChatbotHla = {
31143
31803
  taskType: 'PROMPT_TASK',
31144
31804
  name: 'summarize-the-conversation',
31145
31805
  title: 'Summarize the conversation',
31146
- content: 'Summarize the conversation in a few words:\n\n## Rules\n\n- Summarise the text of the conversation in a few words\n- Convert the text to its basic idea\n- Imagine you are writing the headline or subject line of an email\n- Respond with a few words of summary only\n\n## Conversation\n\n**User:**\n\n> {userMessage}\n\n**You:**\n\n> {chatbotResponse}',
31806
+ content: spaceTrim$1(`
31807
+ Summarize the conversation in a few words:
31808
+
31809
+ ## Rules
31810
+
31811
+ - Summarise the text of the conversation in a few words
31812
+ - Convert the text to its basic idea
31813
+ - Imagine you are writing the headline or subject line of an email
31814
+ - Respond with a few words of summary only
31815
+
31816
+ ## Conversation
31817
+
31818
+ **User:**
31819
+
31820
+ > {userMessage}
31821
+
31822
+ **You:**
31823
+
31824
+ > {chatbotResponse}
31825
+ `),
31147
31826
  resultingParameterName: 'conversationSummary',
31148
31827
  personaName,
31149
31828
  expectations: {
@@ -33547,11 +34226,11 @@ function formatChatAttachmentContext(attachments) {
33547
34226
  if (attachments.length === 0) {
33548
34227
  return '';
33549
34228
  }
33550
- return [
33551
- CHAT_ATTACHMENTS_HEADING,
33552
- ...attachments.map((attachment) => formatChatAttachmentLine(attachment)),
33553
- CHAT_ATTACHMENTS_INSTRUCTION,
33554
- ].join('\n');
34229
+ return spaceTrim$1((block) => `
34230
+ ${CHAT_ATTACHMENTS_HEADING}
34231
+ ${block(attachments.map((attachment) => formatChatAttachmentLine(attachment)).join('\n'))}
34232
+ ${CHAT_ATTACHMENTS_INSTRUCTION}
34233
+ `);
33555
34234
  }
33556
34235
 
33557
34236
  /**
@@ -33792,24 +34471,24 @@ function formatResolvedChatAttachmentContent(contentResolution) {
33792
34471
  : ''}`
33793
34472
  : null;
33794
34473
  const warningsLine = contentResolution.warnings.length > 0 ? `Warnings: ${contentResolution.warnings.join(' | ')}` : null;
33795
- if (!contentResolution.content) {
34474
+ const metadataLines = [decodingLine, warningsLine].filter((line) => Boolean(line)).join('\n');
34475
+ const resolvedContent = contentResolution.content;
34476
+ if (!resolvedContent) {
33796
34477
  const reason = contentResolution.reason || 'content unavailable';
33797
- return [`- ${attachmentLabel}: ${reason}. URL: ${contentResolution.attachment.url}`, decodingLine, warningsLine]
33798
- .filter(Boolean)
33799
- .join('\n');
34478
+ return spaceTrim$1((block) => `
34479
+ - ${attachmentLabel}: ${reason}. URL: ${contentResolution.attachment.url}
34480
+ ${block(metadataLines)}
34481
+ `);
33800
34482
  }
33801
34483
  const truncatedLabel = contentResolution.isTruncated ? ' [truncated]' : '';
33802
- return [
33803
- `File: ${attachmentLabel}${truncatedLabel}`,
33804
- `URL: ${contentResolution.attachment.url}`,
33805
- decodingLine,
33806
- warningsLine,
33807
- '```text',
33808
- contentResolution.content,
33809
- '```',
33810
- ]
33811
- .filter(Boolean)
33812
- .join('\n');
34484
+ return spaceTrim$1((block) => `
34485
+ File: ${attachmentLabel}${truncatedLabel}
34486
+ URL: ${contentResolution.attachment.url}
34487
+ ${block(metadataLines)}
34488
+ \`\`\`text
34489
+ ${block(resolvedContent)}
34490
+ \`\`\`
34491
+ `);
33813
34492
  }
33814
34493
  /**
33815
34494
  * Formats inline attachment-content context section for the model.
@@ -33823,11 +34502,14 @@ function formatChatAttachmentContentContext(resolvedContents) {
33823
34502
  if (resolvedContents.length === 0) {
33824
34503
  return '';
33825
34504
  }
33826
- return [
33827
- CHAT_ATTACHMENT_CONTENT_HEADING,
33828
- CHAT_ATTACHMENT_CONTENT_INSTRUCTION,
33829
- ...resolvedContents.map((resolvedContent) => formatResolvedChatAttachmentContent(resolvedContent)),
33830
- ].join('\n\n');
34505
+ return spaceTrim$1((block) => `
34506
+ ${CHAT_ATTACHMENT_CONTENT_HEADING}
34507
+ ${CHAT_ATTACHMENT_CONTENT_INSTRUCTION}
34508
+
34509
+ ${block(resolvedContents
34510
+ .map((resolvedContent) => formatResolvedChatAttachmentContent(resolvedContent))
34511
+ .join('\n\n'))}
34512
+ `);
33831
34513
  }
33832
34514
 
33833
34515
  /**
@@ -34986,9 +35668,11 @@ class OpenAiCompatibleUnsupportedParameterRetrier {
34986
35668
  * Creates the retry-history error message shared by all OpenAI-compatible model variants.
34987
35669
  */
34988
35670
  createAttemptHistoryError(finalErrorMessage) {
34989
- return new PipelineExecutionError(`All attempts failed. Attempt history:\n` +
34990
- formatUnsupportedParameterAttemptHistory(this.attemptStack) +
34991
- `\nFinal error: ${finalErrorMessage}`);
35671
+ return new PipelineExecutionError(spaceTrim$1((block) => `
35672
+ All attempts failed. Attempt history:
35673
+ ${block(formatUnsupportedParameterAttemptHistory(this.attemptStack))}
35674
+ Final error: ${finalErrorMessage}
35675
+ `));
34992
35676
  }
34993
35677
  }
34994
35678
 
@@ -37582,7 +38266,7 @@ class OpenAiAgentKitExecutionTools extends OpenAiVectorStoreHandler {
37582
38266
  });
37583
38267
  }
37584
38268
  let vectorStoreId = cachedVectorStoreId;
37585
- if (this.isNativeKnowledgeSearchEnabled && !vectorStoreId && knowledgeSources && knowledgeSources.length > 0) {
38269
+ if (!vectorStoreId && knowledgeSources && knowledgeSources.length > 0) {
37586
38270
  const vectorStoreResult = await this.createVectorStoreWithKnowledgeSources({
37587
38271
  client: await this.getClient(),
37588
38272
  name,
@@ -37591,19 +38275,13 @@ class OpenAiAgentKitExecutionTools extends OpenAiVectorStoreHandler {
37591
38275
  });
37592
38276
  vectorStoreId = vectorStoreResult.vectorStoreId;
37593
38277
  }
37594
- else if (this.isNativeKnowledgeSearchEnabled && vectorStoreId && this.options.isVerbose) {
38278
+ else if (vectorStoreId && this.options.isVerbose) {
37595
38279
  console.info('[🤰]', 'Using cached vector store for AgentKit agent', {
37596
38280
  name,
37597
38281
  vectorStoreId,
37598
38282
  });
37599
38283
  }
37600
- if (!this.isNativeKnowledgeSearchEnabled) {
37601
- vectorStoreId = undefined;
37602
- }
37603
- const agentKitTools = this.buildAgentKitTools({
37604
- tools,
37605
- vectorStoreId,
37606
- });
38284
+ const agentKitTools = this.buildAgentKitTools({ tools, vectorStoreId });
37607
38285
  const openAiAgentKitAgent = new Agent$1({
37608
38286
  name,
37609
38287
  model: this.agentKitModelName,
@@ -37622,7 +38300,7 @@ class OpenAiAgentKitExecutionTools extends OpenAiVectorStoreHandler {
37622
38300
  name,
37623
38301
  model: this.agentKitModelName,
37624
38302
  toolCount: agentKitTools.length,
37625
- hasVectorStore: this.isNativeKnowledgeSearchEnabled && Boolean(vectorStoreId),
38303
+ hasVectorStore: Boolean(vectorStoreId),
37626
38304
  });
37627
38305
  }
37628
38306
  return preparedAgent;
@@ -38121,12 +38799,6 @@ class OpenAiAgentKitExecutionTools extends OpenAiVectorStoreHandler {
38121
38799
  get agentKitOptions() {
38122
38800
  return this.options;
38123
38801
  }
38124
- /**
38125
- * Returns true when hosted OpenAI vector-store search should back `knowledgeSources`.
38126
- */
38127
- get isNativeKnowledgeSearchEnabled() {
38128
- return this.agentKitOptions.isNativeKnowledgeSearchEnabled !== false;
38129
- }
38130
38802
  /**
38131
38803
  * Discriminant for type guards.
38132
38804
  */
@@ -42650,7 +43322,7 @@ const SDK_TRANSPILER_KNOWLEDGE_THRESHOLD = 1000;
42650
43322
  */
42651
43323
  async function prepareSdkTranspilerContext(book, options) {
42652
43324
  const { agentName } = await parseAgentSource(book);
42653
- const rawModelRequirements = await createAgentModelRequirements(book, undefined, undefined, undefined, {
43325
+ const modelRequirements = await createAgentModelRequirements(book, undefined, undefined, undefined, {
42654
43326
  agentReferenceResolver: options === null || options === void 0 ? void 0 : options.agentReferenceResolver,
42655
43327
  inlineKnowledgeSourceUploader: options === null || options === void 0 ? void 0 : options.inlineKnowledgeSourceUploader,
42656
43328
  teammateProfileResolver: options === null || options === void 0 ? void 0 : options.teammateProfileResolver,
@@ -42660,12 +43332,7 @@ async function prepareSdkTranspilerContext(book, options) {
42660
43332
  const knowledgeContent = knowledgeCommitments.map((commitment) => commitment.content.trim());
42661
43333
  const directKnowledge = knowledgeContent.filter((content) => !isKnowledgeSourceUrl(content));
42662
43334
  const knowledgeSources = knowledgeContent.filter((content) => isKnowledgeSourceUrl(content));
42663
- const isKnowledgeHandledWithRetrieval = directKnowledge.join('\n').length > SDK_TRANSPILER_KNOWLEDGE_THRESHOLD ||
42664
- knowledgeSources.length > 0 ||
42665
- knowledgeCommitments.length > 0;
42666
- const modelRequirements = normalizeSdkTranspilerModelRequirements(rawModelRequirements, {
42667
- isKnowledgeHandledWithRetrieval,
42668
- });
43335
+ const isKnowledgeHandledWithRetrieval = directKnowledge.join('\n').length > SDK_TRANSPILER_KNOWLEDGE_THRESHOLD || knowledgeSources.length > 0;
42669
43336
  const transpiledTeam = createTranspiledTeamExportForContext({
42670
43337
  agentName,
42671
43338
  agentSource: book,
@@ -42683,36 +43350,6 @@ async function prepareSdkTranspilerContext(book, options) {
42683
43350
  transpiledTeam,
42684
43351
  };
42685
43352
  }
42686
- /**
42687
- * Removes the runtime-only knowledge-search tool from SDK harnesses that provide
42688
- * their own generated retrieval scaffold.
42689
- *
42690
- * @param modelRequirements - Raw compiled model requirements.
42691
- * @param options - Knowledge handling mode selected for the generated harness.
42692
- * @returns Model requirements safe to embed into a standalone SDK export.
42693
- */
42694
- function normalizeSdkTranspilerModelRequirements(modelRequirements, options) {
42695
- var _a;
42696
- if (!options.isKnowledgeHandledWithRetrieval) {
42697
- return modelRequirements;
42698
- }
42699
- const tools = (_a = modelRequirements.tools) === null || _a === void 0 ? void 0 : _a.filter((tool) => tool.name !== KNOWLEDGE_SEARCH_TOOL_NAME);
42700
- return {
42701
- ...modelRequirements,
42702
- systemMessage: removeKnowledgeSearchSystemSection(modelRequirements.systemMessage),
42703
- ...(tools ? { tools } : {}),
42704
- };
42705
- }
42706
- /**
42707
- * Removes the generated `## Knowledge Search` instructions from SDK exports
42708
- * that answer with the transpiler's native retrieval scaffold instead.
42709
- *
42710
- * @param systemMessage - Raw system message from compiled model requirements.
42711
- * @returns System message without the runtime-only knowledge-search section.
42712
- */
42713
- function removeKnowledgeSearchSystemSection(systemMessage) {
42714
- return systemMessage.replace(/(?:^|\n\n)## Knowledge Search[\s\S]*?(?=\n\n##|$)/, '').trim();
42715
- }
42716
43353
  /**
42717
43354
  * Detects whether one knowledge commitment points to a URL instead of inline text.
42718
43355
  *
@@ -45383,5 +46020,5 @@ function $generateBookBoilerplate(options) {
45383
46020
  }
45384
46021
  // TODO: [🤶] Maybe export through `@promptbook/utils` or `@promptbook/random` package
45385
46022
 
45386
- export { $bookTranspilersRegister, $generateBookBoilerplate, $llmToolsMetadataRegister, $llmToolsRegister, $scrapersMetadataRegister, $scrapersRegister, ADMIN_EMAIL, ADMIN_GITHUB_NAME, API_REQUEST_TIMEOUT, AbstractFormatError, Agent, AgentCollectionInSupabase, AgentLlmExecutionTools, AgentOsTranspiler, AnthropicClaudeManagedTranspiler, AnthropicClaudeSdkTranspiler, AuthenticationError, BIG_DATASET_TRESHOLD, BOOK_LANGUAGE_VERSION, BlackholeStorage, BoilerplateError, BoilerplateFormfactorDefinition, CLAIM, CLI_APP_ID, COLOR_CONSTANTS, CORE_AGENTS_SERVER, CORE_AGENTS_SERVER_WELL_KNOWN_AGENT_NAMES, CallbackInterfaceTools, ChatbotFormfactorDefinition, CollectionError, CompletionFormfactorDefinition, ConflictError, CsvFormatError, CsvFormatParser, DEFAULT_AGENTS_DIRNAME, DEFAULT_BOOK, DEFAULT_BOOKS_DIRNAME, DEFAULT_BOOK_OUTPUT_PARAMETER_NAME, DEFAULT_BOOK_TITLE, DEFAULT_CSV_SETTINGS, DEFAULT_DOWNLOAD_CACHE_DIRNAME, DEFAULT_EXECUTION_CACHE_DIRNAME, DEFAULT_GET_PIPELINE_COLLECTION_FUNCTION_NAME, DEFAULT_INTERMEDIATE_FILES_STRATEGY, DEFAULT_IS_AUTO_INSTALLED, DEFAULT_IS_VERBOSE, DEFAULT_MAX_CONCURRENT_UPLOADS, DEFAULT_MAX_EXECUTION_ATTEMPTS, DEFAULT_MAX_FILE_SIZE, DEFAULT_MAX_KNOWLEDGE_SOURCES_SCRAPING_DEPTH, DEFAULT_MAX_KNOWLEDGE_SOURCES_SCRAPING_TOTAL, DEFAULT_MAX_PARALLEL_COUNT, DEFAULT_MAX_RECURSION, DEFAULT_MAX_REQUESTS_PER_MINUTE, DEFAULT_PIPELINE_COLLECTION_BASE_FILENAME, DEFAULT_PROMPT_TASK_TITLE, DEFAULT_REMOTE_SERVER_URL, DEFAULT_SCRAPE_CACHE_DIRNAME, DEFAULT_TASK_SIMULATED_DURATION_MS, DEFAULT_TASK_TITLE, DatabaseError, E2BTranspiler, EXPECTATION_UNITS, EnvironmentMismatchError, ExecutionReportStringOptionsDefaults, ExpectError, FAILED_VALUE_PLACEHOLDER, FORMFACTOR_DEFINITIONS, FormattedBookInMarkdownTranspiler, GENERIC_PIPELINE_INTERFACE, GeneratorFormfactorDefinition, GenericFormfactorDefinition, HTTP_STATUS_CODES, ImageGeneratorFormfactorDefinition, KNOWLEDGE_SEARCH_TOOL_NAME, KnowledgeScrapeError, LIMITS, LimitReachedError, MANDATORY_CSV_SETTINGS, MAX_FILENAME_LENGTH, MODEL_ORDERS, MODEL_TRUST_LEVELS, MODEL_VARIANTS, MatcherFormfactorDefinition, MemoryStorage, MissingToolsError, MultipleLlmExecutionTools, NAME, NETWORK_LIMITS, NonTaskSectionTypes, NotAllowed, NotFoundError, NotYetImplementedCommitmentDefinition, NotYetImplementedError, ORDER_OF_PIPELINE_JSON, OpenAiAgentsTranspiler, OpenAiSdkTranspiler, PADDING_LINES, PENDING_VALUE_PLACEHOLDER, PLAYGROUND_APP_ID, PROMPTBOOK_CHAT_COLOR, PROMPTBOOK_COLOR, PROMPTBOOK_ENGINE_VERSION, PROMPTBOOK_ERRORS, PROMPTBOOK_LEGAL_ENTITY, PROMPTBOOK_LOGO_URL, PROMPTBOOK_SYNTAX_COLORS, PROMPT_PARAMETER_SELF_LEARNING_ENABLED, PUBLIC_AGENTS_SERVERS, ParseError, PipelineExecutionError, PipelineLogicError, PipelineUrlError, PrefixStorage, PromptbookFetchError, RESERVED_PARAMETER_NAMES, RemoteAgent, SET_IS_VERBOSE, SectionTypes, SheetsFormfactorDefinition, TIME_INTERVALS, TaskTypes, TextFormatParser, TranslatorFormfactorDefinition, UNCERTAIN_USAGE, UNCERTAIN_ZERO_VALUE, USER_CHAT_COLOR, UnexpectedError, VirusTotalFileSecurityChecker, WrappedError, ZERO_USAGE, ZERO_VALUE, _AgentMetadata, _AgentRegistration, _AnthropicClaudeMetadataRegistration, _AzureOpenAiMetadataRegistration, _BoilerplateScraperMetadataRegistration, _DeepseekMetadataRegistration, _DocumentScraperMetadataRegistration, _GoogleMetadataRegistration, _LegacyDocumentScraperMetadataRegistration, _MarkdownScraperMetadataRegistration, _MarkitdownScraperMetadataRegistration, _OllamaMetadataRegistration, _OpenAiAssistantMetadataRegistration, _OpenAiCompatibleMetadataRegistration, _OpenAiMetadataRegistration, _PdfScraperMetadataRegistration, _WebsiteScraperMetadataRegistration, aboutPromptbookInformation, addUsage, appendChatAttachmentContext, appendChatAttachmentContextWithContent, book, cacheLlmTools, compilePipeline, computeAgentHash, computeCosineSimilarity, countUsage, createAgentLlmExecutionTools, createAgentModelRequirements, createBasicAgentModelRequirements, createDefaultAgentName, createEmptyAgentModelRequirements, createLlmToolsFromConfiguration, createPipelineCollectionFromJson, createPipelineCollectionFromPromise, createPipelineCollectionFromUrl, createPipelineExecutor, createPipelineSubcollection, embeddingVectorToString, executionReportJsonToString, extractParameterNamesFromTask, filterModels, formatChatAttachmentContentContext, formatChatAttachmentContext, generatePlaceholderAgentProfileImageUrl, getAllCommitmentDefinitions, getAllCommitmentTypes, getAllCommitmentsToolTitles, getCommitmentDefinition, getGroupedCommitmentDefinitions, getPipelineInterface, getSingleLlmExecutionTools, identificationToPromptbookToken, isCommitmentSupported, isPassingExpectations, isPipelineImplementingInterface, isPipelineInterfacesEqual, isPipelinePrepared, isValidBook, isValidPipelineString, joinLlmExecutionTools, limitTotalUsage, makeKnowledgeSourceHandler, migratePipeline, normalizeAgentName, normalizeChatAttachments, padBook, parseAgentSource, parseParameters, parsePipeline, pipelineCollectionToJson, pipelineJsonToString, prepareKnowledgePieces, preparePersona, preparePipeline, prettifyPipelineString, promptbookFetch, promptbookTokenToIdentification, resolveChatAttachmentContents, unpreparePipeline, usageToHuman, usageToWorktime, validateBook, validatePipeline, validatePipelineString };
46023
+ export { $bookTranspilersRegister, $generateBookBoilerplate, $llmToolsMetadataRegister, $llmToolsRegister, $scrapersMetadataRegister, $scrapersRegister, ADMIN_EMAIL, ADMIN_GITHUB_NAME, API_REQUEST_TIMEOUT, AbstractFormatError, Agent, AgentCollectionInSupabase, AgentLlmExecutionTools, AgentOsTranspiler, AnthropicClaudeManagedTranspiler, AnthropicClaudeSdkTranspiler, AuthenticationError, BIG_DATASET_TRESHOLD, BOOK_LANGUAGE_VERSION, BlackholeStorage, BoilerplateError, BoilerplateFormfactorDefinition, CLAIM, CLI_APP_ID, COLOR_CONSTANTS, CORE_AGENTS_SERVER, CORE_AGENTS_SERVER_WELL_KNOWN_AGENT_NAMES, CallbackInterfaceTools, ChatbotFormfactorDefinition, CollectionError, CompletionFormfactorDefinition, ConflictError, CsvFormatError, CsvFormatParser, DEFAULT_AGENTS_DIRNAME, DEFAULT_BOOK, DEFAULT_BOOKS_DIRNAME, DEFAULT_BOOK_OUTPUT_PARAMETER_NAME, DEFAULT_BOOK_TITLE, DEFAULT_CSV_SETTINGS, DEFAULT_DOWNLOAD_CACHE_DIRNAME, DEFAULT_EXECUTION_CACHE_DIRNAME, DEFAULT_GET_PIPELINE_COLLECTION_FUNCTION_NAME, DEFAULT_INTERMEDIATE_FILES_STRATEGY, DEFAULT_IS_AUTO_INSTALLED, DEFAULT_IS_VERBOSE, DEFAULT_MAX_CONCURRENT_UPLOADS, DEFAULT_MAX_EXECUTION_ATTEMPTS, DEFAULT_MAX_FILE_SIZE, DEFAULT_MAX_KNOWLEDGE_SOURCES_SCRAPING_DEPTH, DEFAULT_MAX_KNOWLEDGE_SOURCES_SCRAPING_TOTAL, DEFAULT_MAX_PARALLEL_COUNT, DEFAULT_MAX_RECURSION, DEFAULT_MAX_REQUESTS_PER_MINUTE, DEFAULT_PIPELINE_COLLECTION_BASE_FILENAME, DEFAULT_PROMPT_TASK_TITLE, DEFAULT_REMOTE_SERVER_URL, DEFAULT_SCRAPE_CACHE_DIRNAME, DEFAULT_TASK_SIMULATED_DURATION_MS, DEFAULT_TASK_TITLE, DatabaseError, E2BTranspiler, EXPECTATION_UNITS, EnvironmentMismatchError, ExecutionReportStringOptionsDefaults, ExpectError, FAILED_VALUE_PLACEHOLDER, FORMFACTOR_DEFINITIONS, FormattedBookInMarkdownTranspiler, GENERIC_PIPELINE_INTERFACE, GeneratorFormfactorDefinition, GenericFormfactorDefinition, HTTP_STATUS_CODES, ImageGeneratorFormfactorDefinition, KnowledgeScrapeError, LIMITS, LimitReachedError, MANDATORY_CSV_SETTINGS, MAX_FILENAME_LENGTH, MODEL_ORDERS, MODEL_TRUST_LEVELS, MODEL_VARIANTS, MatcherFormfactorDefinition, MemoryStorage, MissingToolsError, MultipleLlmExecutionTools, NAME, NETWORK_LIMITS, NonTaskSectionTypes, NotAllowed, NotFoundError, NotYetImplementedCommitmentDefinition, NotYetImplementedError, ORDER_OF_PIPELINE_JSON, OpenAiAgentsTranspiler, OpenAiSdkTranspiler, PADDING_LINES, PENDING_VALUE_PLACEHOLDER, PLAYGROUND_APP_ID, PROMPTBOOK_CHAT_COLOR, PROMPTBOOK_COLOR, PROMPTBOOK_ENGINE_VERSION, PROMPTBOOK_ERRORS, PROMPTBOOK_LEGAL_ENTITY, PROMPTBOOK_LOGO_URL, PROMPTBOOK_SYNTAX_COLORS, PROMPT_PARAMETER_SELF_LEARNING_ENABLED, PUBLIC_AGENTS_SERVERS, ParseError, PipelineExecutionError, PipelineLogicError, PipelineUrlError, PrefixStorage, PromptbookFetchError, RESERVED_PARAMETER_NAMES, RemoteAgent, SET_IS_VERBOSE, SectionTypes, SheetsFormfactorDefinition, TIME_INTERVALS, TaskTypes, TextFormatParser, TranslatorFormfactorDefinition, UNCERTAIN_USAGE, UNCERTAIN_ZERO_VALUE, USER_CHAT_COLOR, UnexpectedError, VirusTotalFileSecurityChecker, WrappedError, ZERO_USAGE, ZERO_VALUE, _AgentMetadata, _AgentRegistration, _AnthropicClaudeMetadataRegistration, _AzureOpenAiMetadataRegistration, _BoilerplateScraperMetadataRegistration, _DeepseekMetadataRegistration, _DocumentScraperMetadataRegistration, _GoogleMetadataRegistration, _LegacyDocumentScraperMetadataRegistration, _MarkdownScraperMetadataRegistration, _MarkitdownScraperMetadataRegistration, _OllamaMetadataRegistration, _OpenAiAssistantMetadataRegistration, _OpenAiCompatibleMetadataRegistration, _OpenAiMetadataRegistration, _PdfScraperMetadataRegistration, _WebsiteScraperMetadataRegistration, aboutPromptbookInformation, addUsage, appendChatAttachmentContext, appendChatAttachmentContextWithContent, book, cacheLlmTools, compilePipeline, computeAgentHash, computeCosineSimilarity, countUsage, createAgentLlmExecutionTools, createAgentModelRequirements, createBasicAgentModelRequirements, createDefaultAgentName, createEmptyAgentModelRequirements, createLlmToolsFromConfiguration, createPipelineCollectionFromJson, createPipelineCollectionFromPromise, createPipelineCollectionFromUrl, createPipelineExecutor, createPipelineSubcollection, createStandaloneBookLanguageMarkdown, embeddingVectorToString, executionReportJsonToString, extractParameterNamesFromTask, filterModels, formatChatAttachmentContentContext, formatChatAttachmentContext, generatePlaceholderAgentProfileImageUrl, getAllCommitmentDefinitions, getAllCommitmentTypes, getAllCommitmentsToolTitles, getCommitmentDefinition, getGroupedCommitmentDefinitions, getPipelineInterface, getSingleLlmExecutionTools, identificationToPromptbookToken, isCommitmentSupported, isPassingExpectations, isPipelineImplementingInterface, isPipelineInterfacesEqual, isPipelinePrepared, isValidBook, isValidPipelineString, joinLlmExecutionTools, limitTotalUsage, makeKnowledgeSourceHandler, migratePipeline, normalizeAgentName, normalizeChatAttachments, padBook, parseAgentSource, parseParameters, parsePipeline, pipelineCollectionToJson, pipelineJsonToString, prepareKnowledgePieces, preparePersona, preparePipeline, prettifyPipelineString, promptbookFetch, promptbookTokenToIdentification, resolveChatAttachmentContents, unpreparePipeline, usageToHuman, usageToWorktime, validateBook, validatePipeline, validatePipelineString };
45387
46024
  //# sourceMappingURL=index.es.js.map