@promptbook/components 0.112.0-26 → 0.112.0-27
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/esm/index.es.js +154 -35
- package/esm/index.es.js.map +1 -1
- package/esm/src/book-2.0/agent-source/createAgentModelRequirements.useCommitmentAggregation.test.d.ts +1 -0
- package/esm/src/book-components/_common/MenuHoisting/MenuHoistingContext.d.ts +0 -47
- package/esm/src/commitments/USE/aggregateUseCommitmentSystemMessages.d.ts +30 -0
- package/esm/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +3 -2
- package/esm/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/umd/index.umd.js +157 -38
- package/umd/index.umd.js.map +1 -1
- package/umd/src/book-2.0/agent-source/createAgentModelRequirements.useCommitmentAggregation.test.d.ts +1 -0
- package/umd/src/book-components/_common/MenuHoisting/MenuHoistingContext.d.ts +0 -47
- package/umd/src/commitments/USE/aggregateUseCommitmentSystemMessages.d.ts +30 -0
- package/umd/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +3 -2
- package/umd/src/version.d.ts +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -26,45 +26,6 @@ export type HoistedMenuItem = {
|
|
|
26
26
|
*/
|
|
27
27
|
isActive?: boolean;
|
|
28
28
|
};
|
|
29
|
-
/**
|
|
30
|
-
* Shared actions provided to hoisted mobile menu-section renderers.
|
|
31
|
-
*
|
|
32
|
-
* @private mechanism inside Promptbook
|
|
33
|
-
*/
|
|
34
|
-
export type HoistedMobileMenuSectionRenderOptions = {
|
|
35
|
-
/**
|
|
36
|
-
* Closes the owning mobile header menu.
|
|
37
|
-
*/
|
|
38
|
-
readonly closeMenu: () => void;
|
|
39
|
-
};
|
|
40
|
-
/**
|
|
41
|
-
* Mobile-only section hoisted into the shared application menu.
|
|
42
|
-
*
|
|
43
|
-
* @private mechanism inside Promptbook
|
|
44
|
-
*/
|
|
45
|
-
export type HoistedMobileMenuSection = {
|
|
46
|
-
/**
|
|
47
|
-
* Stable identifier used to preserve section open state.
|
|
48
|
-
*/
|
|
49
|
-
readonly key: string;
|
|
50
|
-
/**
|
|
51
|
-
* Visible section label rendered by the mobile menu.
|
|
52
|
-
*/
|
|
53
|
-
readonly label: ReactNode;
|
|
54
|
-
/**
|
|
55
|
-
* Whether the section should start expanded whenever the menu opens.
|
|
56
|
-
*/
|
|
57
|
-
readonly isDefaultOpen?: boolean;
|
|
58
|
-
/**
|
|
59
|
-
* Lazily renders section content inside the mobile header menu.
|
|
60
|
-
*/
|
|
61
|
-
readonly renderContent: (options: HoistedMobileMenuSectionRenderOptions) => ReactNode;
|
|
62
|
-
};
|
|
63
|
-
/**
|
|
64
|
-
* Value exposed through the shared menu-hoisting context.
|
|
65
|
-
*
|
|
66
|
-
* @private mechanism inside Promptbook
|
|
67
|
-
*/
|
|
68
29
|
type MenuHoistingContextType = {
|
|
69
30
|
/**
|
|
70
31
|
* The currently hoisted menu items
|
|
@@ -74,14 +35,6 @@ type MenuHoistingContextType = {
|
|
|
74
35
|
* Set the hoisted menu items
|
|
75
36
|
*/
|
|
76
37
|
setMenu: (items: HoistedMenuItem[]) => void;
|
|
77
|
-
/**
|
|
78
|
-
* Mobile-only sections hoisted into the shared application menu.
|
|
79
|
-
*/
|
|
80
|
-
mobileMenuSections: HoistedMobileMenuSection[];
|
|
81
|
-
/**
|
|
82
|
-
* Sets the mobile-only hoisted menu sections.
|
|
83
|
-
*/
|
|
84
|
-
setMobileMenuSections: (sections: HoistedMobileMenuSection[]) => void;
|
|
85
38
|
};
|
|
86
39
|
/**
|
|
87
40
|
* Provider for menu hoisting
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
|
|
2
|
+
import type { ParsedCommitment } from '../_base/ParsedCommitment';
|
|
3
|
+
/**
|
|
4
|
+
* `USE` commitment types whose system-message sections are aggregated after the
|
|
5
|
+
* commitment-by-commitment application step.
|
|
6
|
+
*
|
|
7
|
+
* @private internal utility of `createAgentModelRequirementsWithCommitments`
|
|
8
|
+
*/
|
|
9
|
+
type AggregatedUseCommitmentType = 'USE BROWSER' | 'USE SEARCH ENGINE' | 'USE TIME';
|
|
10
|
+
/**
|
|
11
|
+
* Adds the placeholder for an aggregated `USE` system-message section only once, preserving the section position from the first occurrence.
|
|
12
|
+
*
|
|
13
|
+
* @param requirements - Current model requirements.
|
|
14
|
+
* @param type - Aggregated `USE` commitment type being applied.
|
|
15
|
+
* @returns Requirements with the placeholder inserted when it was not already present.
|
|
16
|
+
* @private internal utility of `USE` commitments
|
|
17
|
+
*/
|
|
18
|
+
export declare function appendAggregatedUseCommitmentPlaceholder(requirements: AgentModelRequirements, type: AggregatedUseCommitmentType): AgentModelRequirements;
|
|
19
|
+
/**
|
|
20
|
+
* Replaces temporary `USE` placeholders with one aggregated system-message block per commitment type.
|
|
21
|
+
*
|
|
22
|
+
* Distinct additional-instruction blocks are merged in stable source order while the hard-coded section is emitted only once.
|
|
23
|
+
*
|
|
24
|
+
* @param requirements - Model requirements produced by commitment-by-commitment application.
|
|
25
|
+
* @param commitments - Filtered commitments in their original source order.
|
|
26
|
+
* @returns Requirements with aggregated `USE` system-message sections.
|
|
27
|
+
* @private internal utility of `createAgentModelRequirementsWithCommitments`
|
|
28
|
+
*/
|
|
29
|
+
export declare function aggregateUseCommitmentSystemMessages(requirements: AgentModelRequirements, commitments: ReadonlyArray<ParsedCommitment>): AgentModelRequirements;
|
|
30
|
+
export {};
|
|
@@ -12,13 +12,14 @@ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
|
12
12
|
* 1. One-shot URL fetching: Simple function to fetch and scrape URL content
|
|
13
13
|
* 2. Running browser: For complex tasks like scrolling, clicking, form filling, etc.
|
|
14
14
|
*
|
|
15
|
-
* The content following `USE BROWSER` is
|
|
15
|
+
* The content following `USE BROWSER` is an arbitrary text that the agent should know
|
|
16
|
+
* (e.g. browsing scope or preferred sources).
|
|
16
17
|
*
|
|
17
18
|
* Example usage in agent source:
|
|
18
19
|
*
|
|
19
20
|
* ```book
|
|
20
21
|
* USE BROWSER
|
|
21
|
-
* USE BROWSER
|
|
22
|
+
* USE BROWSER Prefer official documentation and source websites.
|
|
22
23
|
* ```
|
|
23
24
|
*
|
|
24
25
|
* @private [🪔] Maybe export the commitments through some package
|
package/esm/src/version.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export declare const BOOK_LANGUAGE_VERSION: string_semantic_version;
|
|
|
15
15
|
export declare const PROMPTBOOK_ENGINE_VERSION: string_promptbook_version;
|
|
16
16
|
/**
|
|
17
17
|
* Represents the version string of the Promptbook engine.
|
|
18
|
-
* It follows semantic versioning (e.g., `0.112.0-
|
|
18
|
+
* It follows semantic versioning (e.g., `0.112.0-26`).
|
|
19
19
|
*
|
|
20
20
|
* @generated
|
|
21
21
|
*/
|
package/package.json
CHANGED
package/umd/index.umd.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react/jsx-runtime'), require('react'), require('spacetrim'), require('crypto-js'), require('crypto-js/enc-hex'), require('path'), require('crypto'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'react/jsx-runtime', 'react', 'spacetrim', 'crypto-js', 'crypto-js/enc-hex', 'path', 'crypto', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["promptbook-components"] = {}, global.jsxRuntime, global.react, global.spacetrim, global.cryptoJs, global.hexEncoder, global.path, global.crypto$1, global.
|
|
5
|
-
})(this, (function (exports, jsxRuntime, react, spacetrim, cryptoJs, hexEncoder, path, crypto$1,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react/jsx-runtime'), require('react'), require('spacetrim'), require('crypto-js'), require('crypto-js/enc-hex'), require('path'), require('crypto'), require('moment'), require('mime-types'), require('react-dom'), require('@monaco-editor/react'), require('destroyable'), require('katex'), require('react-dom/client'), require('showdown'), require('rxjs'), require('jspdf'), require('lucide-react'), require('waitasecond'), require('crypto-js/sha256'), require('papaparse'), require('colors'), require('@openai/agents'), require('bottleneck'), require('openai'), require('qrcode')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'react/jsx-runtime', 'react', 'spacetrim', 'crypto-js', 'crypto-js/enc-hex', 'path', 'crypto', 'moment', 'mime-types', 'react-dom', '@monaco-editor/react', 'destroyable', 'katex', 'react-dom/client', 'showdown', 'rxjs', 'jspdf', 'lucide-react', 'waitasecond', 'crypto-js/sha256', 'papaparse', 'colors', '@openai/agents', 'bottleneck', 'openai', 'qrcode'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["promptbook-components"] = {}, global.jsxRuntime, global.react, global.spacetrim, global.cryptoJs, global.hexEncoder, global.path, global.crypto$1, global.moment, global.mimeTypes, global.reactDom, global.MonacoEditor, global.destroyable, global.katex, global.client, global.showdown, global.rxjs, global.jspdf, global.lucideReact, global.waitasecond, global.sha256, global.papaparse, global.colors, global.agents, global.Bottleneck, global.OpenAI, global.QRCode));
|
|
5
|
+
})(this, (function (exports, jsxRuntime, react, spacetrim, cryptoJs, hexEncoder, path, crypto$1, moment, mimeTypes, reactDom, MonacoEditor, destroyable, katex, client, showdown, rxjs, jspdf, lucideReact, waitasecond, sha256, papaparse, colors, agents, Bottleneck, OpenAI, QRCode) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
* @generated
|
|
31
31
|
* @see https://github.com/webgptorg/promptbook
|
|
32
32
|
*/
|
|
33
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-
|
|
33
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-27';
|
|
34
34
|
/**
|
|
35
35
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
36
36
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -11355,6 +11355,147 @@
|
|
|
11355
11355
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
11356
11356
|
*/
|
|
11357
11357
|
|
|
11358
|
+
/**
|
|
11359
|
+
* All `USE` commitment types currently participating in final system-message aggregation.
|
|
11360
|
+
*
|
|
11361
|
+
* @private internal constant for `aggregateUseCommitmentSystemMessages`
|
|
11362
|
+
*/
|
|
11363
|
+
const AGGREGATED_USE_COMMITMENT_TYPES = ['USE BROWSER', 'USE SEARCH ENGINE', 'USE TIME'];
|
|
11364
|
+
/**
|
|
11365
|
+
* Prefix used for temporary in-system-message placeholders that preserve the first-occurrence position of aggregated `USE` sections.
|
|
11366
|
+
*
|
|
11367
|
+
* @private internal constant for `appendAggregatedUseCommitmentPlaceholder`
|
|
11368
|
+
*/
|
|
11369
|
+
const AGGREGATED_USE_COMMITMENT_PLACEHOLDER_PREFIX = '# AGGREGATED USE COMMITMENT: ';
|
|
11370
|
+
/**
|
|
11371
|
+
* Type guard for `USE` commitment types that are aggregated in the final system message.
|
|
11372
|
+
*
|
|
11373
|
+
* @param type - Commitment type to check.
|
|
11374
|
+
* @returns `true` when the commitment participates in `USE` system-message aggregation.
|
|
11375
|
+
* @private internal utility of `aggregateUseCommitmentSystemMessages`
|
|
11376
|
+
*/
|
|
11377
|
+
function isAggregatedUseCommitmentType(type) {
|
|
11378
|
+
return AGGREGATED_USE_COMMITMENT_TYPES.includes(type);
|
|
11379
|
+
}
|
|
11380
|
+
/**
|
|
11381
|
+
* Creates the placeholder token used to reserve the first-occurrence position of an aggregated `USE` system-message section.
|
|
11382
|
+
*
|
|
11383
|
+
* @param type - Aggregated `USE` commitment type.
|
|
11384
|
+
* @returns Single-line placeholder comment stored in the interim system message.
|
|
11385
|
+
* @private internal utility of `appendAggregatedUseCommitmentPlaceholder`
|
|
11386
|
+
*/
|
|
11387
|
+
function getAggregatedUseCommitmentPlaceholder(type) {
|
|
11388
|
+
return `${AGGREGATED_USE_COMMITMENT_PLACEHOLDER_PREFIX}${type}`;
|
|
11389
|
+
}
|
|
11390
|
+
/**
|
|
11391
|
+
* Combines distinct additional instruction blocks in source order.
|
|
11392
|
+
*
|
|
11393
|
+
* @param additionalInstructions - Deduplicated instruction blocks collected from the agent source.
|
|
11394
|
+
* @returns Combined instruction text ready for `formatOptionalInstructionBlock`.
|
|
11395
|
+
* @private internal utility of `createAggregatedUseCommitmentSystemMessage`
|
|
11396
|
+
*/
|
|
11397
|
+
function combineAdditionalInstructions(additionalInstructions) {
|
|
11398
|
+
return additionalInstructions.join('\n');
|
|
11399
|
+
}
|
|
11400
|
+
/**
|
|
11401
|
+
* Creates the final aggregated system-message section for a supported `USE` commitment type.
|
|
11402
|
+
*
|
|
11403
|
+
* @param type - Aggregated `USE` commitment type.
|
|
11404
|
+
* @param additionalInstructions - Distinct additional instructions in source order.
|
|
11405
|
+
* @returns Final system-message block for the commitment type.
|
|
11406
|
+
* @private internal utility of `aggregateUseCommitmentSystemMessages`
|
|
11407
|
+
*/
|
|
11408
|
+
function createAggregatedUseCommitmentSystemMessage(type, additionalInstructions) {
|
|
11409
|
+
const combinedAdditionalInstructions = combineAdditionalInstructions(additionalInstructions);
|
|
11410
|
+
switch (type) {
|
|
11411
|
+
case 'USE TIME':
|
|
11412
|
+
return spacetrim.spaceTrim((block) => `
|
|
11413
|
+
Time and date context:
|
|
11414
|
+
- It is ${moment__default["default"]().format('MMMM YYYY')} now.
|
|
11415
|
+
- If you need more precise current time information, use the tool "get_current_time".
|
|
11416
|
+
${block(formatOptionalInstructionBlock('Time instructions', combinedAdditionalInstructions))}
|
|
11417
|
+
`);
|
|
11418
|
+
case 'USE BROWSER':
|
|
11419
|
+
return spacetrim.spaceTrim((block) => `
|
|
11420
|
+
You have access to browser tools to fetch and access content from the internet.
|
|
11421
|
+
- Use "fetch_url_content" to retrieve content from specific URLs (webpages or documents) using scrapers.
|
|
11422
|
+
- Use "run_browser" for real interactive browser automation (navigation, clicks, typing, waiting, scrolling).
|
|
11423
|
+
When you need to know information from a specific website or document, use the fetch_url_content tool.
|
|
11424
|
+
${block(formatOptionalInstructionBlock('Browser instructions', combinedAdditionalInstructions))}
|
|
11425
|
+
`);
|
|
11426
|
+
case 'USE SEARCH ENGINE':
|
|
11427
|
+
return spacetrim.spaceTrim((block) => `
|
|
11428
|
+
Tool:
|
|
11429
|
+
- You have access to the web search engine via the tool "web_search".
|
|
11430
|
+
- Use it to find up-to-date information or facts that you don't know.
|
|
11431
|
+
- When you need to know some information from the internet, use the tool provided to you.
|
|
11432
|
+
- Do not make up information when you can search for it.
|
|
11433
|
+
- Do not tell the user you cannot search for information, YOU CAN.
|
|
11434
|
+
${block(formatOptionalInstructionBlock('Search instructions', combinedAdditionalInstructions))}
|
|
11435
|
+
`);
|
|
11436
|
+
}
|
|
11437
|
+
}
|
|
11438
|
+
/**
|
|
11439
|
+
* Adds the placeholder for an aggregated `USE` system-message section only once, preserving the section position from the first occurrence.
|
|
11440
|
+
*
|
|
11441
|
+
* @param requirements - Current model requirements.
|
|
11442
|
+
* @param type - Aggregated `USE` commitment type being applied.
|
|
11443
|
+
* @returns Requirements with the placeholder inserted when it was not already present.
|
|
11444
|
+
* @private internal utility of `USE` commitments
|
|
11445
|
+
*/
|
|
11446
|
+
function appendAggregatedUseCommitmentPlaceholder(requirements, type) {
|
|
11447
|
+
const placeholder = getAggregatedUseCommitmentPlaceholder(type);
|
|
11448
|
+
if (requirements.systemMessage.includes(placeholder)) {
|
|
11449
|
+
return requirements;
|
|
11450
|
+
}
|
|
11451
|
+
const systemMessage = requirements.systemMessage.trim()
|
|
11452
|
+
? `${requirements.systemMessage}\n\n${placeholder}`
|
|
11453
|
+
: placeholder;
|
|
11454
|
+
return {
|
|
11455
|
+
...requirements,
|
|
11456
|
+
systemMessage,
|
|
11457
|
+
};
|
|
11458
|
+
}
|
|
11459
|
+
/**
|
|
11460
|
+
* Replaces temporary `USE` placeholders with one aggregated system-message block per commitment type.
|
|
11461
|
+
*
|
|
11462
|
+
* Distinct additional-instruction blocks are merged in stable source order while the hard-coded section is emitted only once.
|
|
11463
|
+
*
|
|
11464
|
+
* @param requirements - Model requirements produced by commitment-by-commitment application.
|
|
11465
|
+
* @param commitments - Filtered commitments in their original source order.
|
|
11466
|
+
* @returns Requirements with aggregated `USE` system-message sections.
|
|
11467
|
+
* @private internal utility of `createAgentModelRequirementsWithCommitments`
|
|
11468
|
+
*/
|
|
11469
|
+
function aggregateUseCommitmentSystemMessages(requirements, commitments) {
|
|
11470
|
+
const additionalInstructionsByType = new Map();
|
|
11471
|
+
for (const commitment of commitments) {
|
|
11472
|
+
if (!isAggregatedUseCommitmentType(commitment.type)) {
|
|
11473
|
+
continue;
|
|
11474
|
+
}
|
|
11475
|
+
let additionalInstructions = additionalInstructionsByType.get(commitment.type);
|
|
11476
|
+
if (!additionalInstructions) {
|
|
11477
|
+
additionalInstructions = [];
|
|
11478
|
+
additionalInstructionsByType.set(commitment.type, additionalInstructions);
|
|
11479
|
+
}
|
|
11480
|
+
const normalizedContent = spacetrim.spaceTrim(commitment.content);
|
|
11481
|
+
if (normalizedContent && !additionalInstructions.includes(normalizedContent)) {
|
|
11482
|
+
additionalInstructions.push(normalizedContent);
|
|
11483
|
+
}
|
|
11484
|
+
}
|
|
11485
|
+
let systemMessage = requirements.systemMessage;
|
|
11486
|
+
for (const [type, additionalInstructions] of additionalInstructionsByType) {
|
|
11487
|
+
const placeholder = getAggregatedUseCommitmentPlaceholder(type);
|
|
11488
|
+
if (!systemMessage.includes(placeholder)) {
|
|
11489
|
+
continue;
|
|
11490
|
+
}
|
|
11491
|
+
systemMessage = systemMessage.replace(placeholder, createAggregatedUseCommitmentSystemMessage(type, additionalInstructions));
|
|
11492
|
+
}
|
|
11493
|
+
return {
|
|
11494
|
+
...requirements,
|
|
11495
|
+
systemMessage,
|
|
11496
|
+
};
|
|
11497
|
+
}
|
|
11498
|
+
|
|
11358
11499
|
/**
|
|
11359
11500
|
* Client-side safe wrapper for fetching URL content
|
|
11360
11501
|
*
|
|
@@ -11405,13 +11546,14 @@
|
|
|
11405
11546
|
* 1. One-shot URL fetching: Simple function to fetch and scrape URL content
|
|
11406
11547
|
* 2. Running browser: For complex tasks like scrolling, clicking, form filling, etc.
|
|
11407
11548
|
*
|
|
11408
|
-
* The content following `USE BROWSER` is
|
|
11549
|
+
* The content following `USE BROWSER` is an arbitrary text that the agent should know
|
|
11550
|
+
* (e.g. browsing scope or preferred sources).
|
|
11409
11551
|
*
|
|
11410
11552
|
* Example usage in agent source:
|
|
11411
11553
|
*
|
|
11412
11554
|
* ```book
|
|
11413
11555
|
* USE BROWSER
|
|
11414
|
-
* USE BROWSER
|
|
11556
|
+
* USE BROWSER Prefer official documentation and source websites.
|
|
11415
11557
|
* ```
|
|
11416
11558
|
*
|
|
11417
11559
|
* @private [🪔] Maybe export the commitments through some package
|
|
@@ -11449,7 +11591,7 @@
|
|
|
11449
11591
|
|
|
11450
11592
|
## Key aspects
|
|
11451
11593
|
|
|
11452
|
-
- The content following \`USE BROWSER\` is
|
|
11594
|
+
- The content following \`USE BROWSER\` is an arbitrary text that the agent should know (e.g. browsing scope or preferred sources).
|
|
11453
11595
|
- Provides two levels of browser access:
|
|
11454
11596
|
1. **One-shot URL fetching**: Simple function to fetch and scrape URL content (active)
|
|
11455
11597
|
2. **Running browser**: For complex tasks like scrolling, clicking, form filling, etc. (runtime-dependent)
|
|
@@ -11566,20 +11708,14 @@
|
|
|
11566
11708
|
});
|
|
11567
11709
|
}
|
|
11568
11710
|
const updatedTools = [...existingTools, ...toolsToAdd];
|
|
11569
|
-
|
|
11570
|
-
return this.appendToSystemMessage({
|
|
11711
|
+
return appendAggregatedUseCommitmentPlaceholder({
|
|
11571
11712
|
...requirements,
|
|
11572
11713
|
tools: updatedTools,
|
|
11573
11714
|
_metadata: {
|
|
11574
11715
|
...requirements._metadata,
|
|
11575
11716
|
useBrowser: true,
|
|
11576
11717
|
},
|
|
11577
|
-
},
|
|
11578
|
-
You have access to browser tools to fetch and access content from the internet.
|
|
11579
|
-
- Use "fetch_url_content" to retrieve content from specific URLs (webpages or documents) using scrapers.
|
|
11580
|
-
- Use "run_browser" for real interactive browser automation (navigation, clicks, typing, waiting, scrolling).
|
|
11581
|
-
When you need to know information from a specific website or document, use the fetch_url_content tool.
|
|
11582
|
-
`));
|
|
11718
|
+
}, this.type);
|
|
11583
11719
|
}
|
|
11584
11720
|
/**
|
|
11585
11721
|
* Gets the browser tool function implementations.
|
|
@@ -15208,7 +15344,6 @@
|
|
|
15208
15344
|
`);
|
|
15209
15345
|
}
|
|
15210
15346
|
applyToAgentModelRequirements(requirements, content) {
|
|
15211
|
-
const extraInstructions = formatOptionalInstructionBlock('Search instructions', content);
|
|
15212
15347
|
// Get existing tools array or create new one
|
|
15213
15348
|
const existingTools = requirements.tools || [];
|
|
15214
15349
|
// Add 'web_search' to tools if not already present
|
|
@@ -15221,7 +15356,6 @@
|
|
|
15221
15356
|
description: spacetrim.spaceTrim(`
|
|
15222
15357
|
Search the internet for information.
|
|
15223
15358
|
Use this tool when you need to find up-to-date information or facts that you don't know.
|
|
15224
|
-
${!content ? '' : `Search scope / instructions: ${content}`}
|
|
15225
15359
|
`),
|
|
15226
15360
|
parameters: {
|
|
15227
15361
|
type: 'object',
|
|
@@ -15259,23 +15393,14 @@
|
|
|
15259
15393
|
},
|
|
15260
15394
|
},
|
|
15261
15395
|
];
|
|
15262
|
-
|
|
15263
|
-
return this.appendToSystemMessage({
|
|
15396
|
+
return appendAggregatedUseCommitmentPlaceholder({
|
|
15264
15397
|
...requirements,
|
|
15265
15398
|
tools: updatedTools,
|
|
15266
15399
|
_metadata: {
|
|
15267
15400
|
...requirements._metadata,
|
|
15268
15401
|
useSearchEngine: content || true,
|
|
15269
15402
|
},
|
|
15270
|
-
},
|
|
15271
|
-
Tool:
|
|
15272
|
-
- You have access to the web search engine via the tool "web_search".
|
|
15273
|
-
- Use it to find up-to-date information or facts that you don't know.
|
|
15274
|
-
- When you need to know some information from the internet, use the tool provided to you.
|
|
15275
|
-
- Do not make up information when you can search for it.
|
|
15276
|
-
- Do not tell the user you cannot search for information, YOU CAN.
|
|
15277
|
-
${block(extraInstructions)}
|
|
15278
|
-
`));
|
|
15403
|
+
}, this.type);
|
|
15279
15404
|
}
|
|
15280
15405
|
/**
|
|
15281
15406
|
* Gets human-readable titles for tool functions provided by this commitment.
|
|
@@ -16386,7 +16511,6 @@
|
|
|
16386
16511
|
`);
|
|
16387
16512
|
}
|
|
16388
16513
|
applyToAgentModelRequirements(requirements, content) {
|
|
16389
|
-
const extraInstructions = formatOptionalInstructionBlock('Time instructions', content);
|
|
16390
16514
|
// Get existing tools array or create new one
|
|
16391
16515
|
const existingTools = requirements.tools || [];
|
|
16392
16516
|
// Add 'get_current_time' to tools if not already present
|
|
@@ -16410,19 +16534,13 @@
|
|
|
16410
16534
|
},
|
|
16411
16535
|
// <- TODO: !!!! define the function in LLM tools
|
|
16412
16536
|
];
|
|
16413
|
-
|
|
16414
|
-
return this.appendToSystemMessage({
|
|
16537
|
+
return appendAggregatedUseCommitmentPlaceholder({
|
|
16415
16538
|
...requirements,
|
|
16416
16539
|
tools: updatedTools,
|
|
16417
16540
|
_metadata: {
|
|
16418
16541
|
...requirements._metadata,
|
|
16419
16542
|
},
|
|
16420
|
-
},
|
|
16421
|
-
Time and date context:
|
|
16422
|
-
- It is ${moment__default["default"]().format('MMMM YYYY')} now.
|
|
16423
|
-
- If you need more precise current time information, use the tool "get_current_time".
|
|
16424
|
-
${block(extraInstructions)}
|
|
16425
|
-
`));
|
|
16543
|
+
}, this.type);
|
|
16426
16544
|
}
|
|
16427
16545
|
/**
|
|
16428
16546
|
* Gets human-readable titles for tool functions provided by this commitment.
|
|
@@ -28843,6 +28961,7 @@
|
|
|
28843
28961
|
}
|
|
28844
28962
|
}
|
|
28845
28963
|
}
|
|
28964
|
+
requirements = aggregateUseCommitmentSystemMessages(requirements, filteredCommitments);
|
|
28846
28965
|
// Handle IMPORT commitments for generic files
|
|
28847
28966
|
// Note: This logic could be moved to ImportCommitmentDefinition, but it needs to be asynchronous
|
|
28848
28967
|
if (requirements.importedFileUrls && requirements.importedFileUrls.length > 0) {
|