@promptbook/javascript 0.114.0-3 → 0.114.0-5

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 (152) hide show
  1. package/README.md +4 -12
  2. package/esm/index.es.js +1 -1
  3. package/esm/src/book-2.0/agent-source/AgentBasicInformation.d.ts +3 -3
  4. package/esm/src/cli/cli-commands/coder/boilerplateCount.d.ts +52 -0
  5. package/esm/src/cli/cli-commands/coder/generate-boilerplates.d.ts +3 -2
  6. package/esm/src/cli/cli-commands/coder/verify.d.ts +1 -1
  7. package/esm/src/commitments/{COMPONENT/COMPONENT.d.ts → META_FULLNAME/META_FULLNAME.d.ts} +8 -5
  8. package/esm/src/commitments/META_ID/META_ID.d.ts +32 -0
  9. package/esm/src/commitments/index.d.ts +4 -12
  10. package/esm/src/llm-providers/agent/Agent.d.ts +1 -1
  11. package/esm/src/llm-providers/openai/OpenAiAgentKitExecutionToolsToolBuilder.d.ts +1 -1
  12. package/esm/src/{commitments/USE_BROWSER → scrapers/_common/utils}/fetchUrlContent.d.ts +2 -3
  13. package/esm/src/version.d.ts +1 -1
  14. package/package.json +2 -2
  15. package/umd/index.umd.js +1 -1
  16. package/umd/src/book-2.0/agent-source/AgentBasicInformation.d.ts +3 -3
  17. package/umd/src/cli/cli-commands/coder/boilerplateCount.d.ts +52 -0
  18. package/umd/src/cli/cli-commands/coder/generate-boilerplates.d.ts +3 -2
  19. package/umd/src/cli/cli-commands/coder/verify.d.ts +1 -1
  20. package/umd/src/commitments/{COMPONENT/COMPONENT.d.ts → META_FULLNAME/META_FULLNAME.d.ts} +8 -5
  21. package/umd/src/commitments/META_ID/META_ID.d.ts +32 -0
  22. package/umd/src/commitments/index.d.ts +4 -12
  23. package/umd/src/llm-providers/agent/Agent.d.ts +1 -1
  24. package/umd/src/llm-providers/openai/OpenAiAgentKitExecutionToolsToolBuilder.d.ts +1 -1
  25. package/umd/src/{commitments/USE_BROWSER → scrapers/_common/utils}/fetchUrlContent.d.ts +2 -3
  26. package/umd/src/version.d.ts +1 -1
  27. package/esm/src/commitments/MEMORY/MEMORY.d.ts +0 -48
  28. package/esm/src/commitments/MEMORY/MemoryToolNames.d.ts +0 -11
  29. package/esm/src/commitments/MEMORY/MemoryToolRuntimeAdapter.d.ts +0 -149
  30. package/esm/src/commitments/MEMORY/createMemorySystemMessage.d.ts +0 -6
  31. package/esm/src/commitments/MEMORY/createMemoryToolFunctions.d.ts +0 -8
  32. package/esm/src/commitments/MEMORY/createMemoryTools.d.ts +0 -14
  33. package/esm/src/commitments/MEMORY/getMemoryCommitmentDocumentation.d.ts +0 -6
  34. package/esm/src/commitments/MEMORY/getMemoryToolRuntimeAdapterOrDisabledResult.d.ts +0 -17
  35. package/esm/src/commitments/MEMORY/getMemoryToolTitles.d.ts +0 -7
  36. package/esm/src/commitments/MEMORY/parseMemoryToolArgs.d.ts +0 -61
  37. package/esm/src/commitments/MEMORY/resolveMemoryRuntimeContext.d.ts +0 -8
  38. package/esm/src/commitments/MEMORY/setMemoryToolRuntimeAdapter.d.ts +0 -13
  39. package/esm/src/commitments/META/META.d.ts +0 -65
  40. package/esm/src/commitments/USE/aggregateUseCommitmentSystemMessages.d.ts +0 -32
  41. package/esm/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +0 -58
  42. package/esm/src/commitments/USE_BROWSER/fetchUrlContentViaBrowser.d.ts +0 -13
  43. package/esm/src/commitments/USE_BROWSER/resolveRunBrowserToolForNode.d.ts +0 -10
  44. package/esm/src/commitments/USE_DEEPSEARCH/USE_DEEPSEARCH.d.ts +0 -47
  45. package/esm/src/commitments/USE_EMAIL/USE_EMAIL.d.ts +0 -38
  46. package/esm/src/commitments/USE_EMAIL/parseUseEmailCommitmentContent.d.ts +0 -21
  47. package/esm/src/commitments/USE_EMAIL/parseUseEmailCommitmentContent.test.d.ts +0 -1
  48. package/esm/src/commitments/USE_EMAIL/resolveSendEmailToolForNode.d.ts +0 -11
  49. package/esm/src/commitments/USE_EMAIL/sendEmailViaBrowser.d.ts +0 -13
  50. package/esm/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.d.ts +0 -46
  51. package/esm/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.test.d.ts +0 -1
  52. package/esm/src/commitments/USE_SPAWN/USE_SPAWN.d.ts +0 -38
  53. package/esm/src/commitments/USE_SPAWN/USE_SPAWN.test.d.ts +0 -1
  54. package/esm/src/commitments/USE_SPAWN/resolveSpawnAgentToolForNode.d.ts +0 -9
  55. package/esm/src/commitments/USE_SPAWN/spawnAgentViaBrowser.d.ts +0 -12
  56. package/esm/src/commitments/USE_TIME/USE_TIME.d.ts +0 -43
  57. package/esm/src/commitments/USE_TIME/USE_TIME.test.d.ts +0 -1
  58. package/esm/src/commitments/USE_TIMEOUT/TimeoutToolNames.d.ts +0 -11
  59. package/esm/src/commitments/USE_TIMEOUT/TimeoutToolRuntimeAdapter.d.ts +0 -212
  60. package/esm/src/commitments/USE_TIMEOUT/USE_TIMEOUT.d.ts +0 -38
  61. package/esm/src/commitments/USE_TIMEOUT/USE_TIMEOUT.test.d.ts +0 -1
  62. package/esm/src/commitments/USE_TIMEOUT/createTimeoutSystemMessage.d.ts +0 -6
  63. package/esm/src/commitments/USE_TIMEOUT/createTimeoutToolFunctions.d.ts +0 -8
  64. package/esm/src/commitments/USE_TIMEOUT/createTimeoutTools.d.ts +0 -7
  65. package/esm/src/commitments/USE_TIMEOUT/getTimeoutToolRuntimeAdapterOrDisabledResult.d.ts +0 -17
  66. package/esm/src/commitments/USE_TIMEOUT/parseTimeoutToolArgs.d.ts +0 -78
  67. package/esm/src/commitments/USE_TIMEOUT/resolveTimeoutRuntimeContext.d.ts +0 -8
  68. package/esm/src/commitments/USE_TIMEOUT/setTimeoutToolRuntimeAdapter.d.ts +0 -13
  69. package/esm/src/commitments/WALLET/WALLET.d.ts +0 -21
  70. package/esm/src/commitments/WALLET/WALLET.test.d.ts +0 -1
  71. package/esm/src/commitments/WALLET/WalletToolNames.d.ts +0 -12
  72. package/esm/src/commitments/WALLET/WalletToolRuntimeAdapter.d.ts +0 -163
  73. package/esm/src/commitments/WALLET/createWalletSystemMessage.d.ts +0 -6
  74. package/esm/src/commitments/WALLET/createWalletToolFunctions.d.ts +0 -8
  75. package/esm/src/commitments/WALLET/createWalletTools.d.ts +0 -7
  76. package/esm/src/commitments/WALLET/getWalletCommitmentDocumentation.d.ts +0 -6
  77. package/esm/src/commitments/WALLET/getWalletToolRuntimeAdapterOrDisabledResult.d.ts +0 -16
  78. package/esm/src/commitments/WALLET/getWalletToolTitles.d.ts +0 -7
  79. package/esm/src/commitments/WALLET/parseWalletToolArgs.d.ts +0 -51
  80. package/esm/src/commitments/WALLET/resolveWalletRuntimeContext.d.ts +0 -8
  81. package/esm/src/commitments/WALLET/setWalletToolRuntimeAdapter.d.ts +0 -13
  82. package/esm/src/commitments/_common/createSerpSearchToolFunction.d.ts +0 -12
  83. package/umd/src/book-2.0/agent-source/createAgentModelRequirements.useCommitmentAggregation.test.d.ts +0 -1
  84. package/umd/src/commitments/MEMORY/MEMORY.d.ts +0 -48
  85. package/umd/src/commitments/MEMORY/MEMORY.test.d.ts +0 -1
  86. package/umd/src/commitments/MEMORY/MemoryToolNames.d.ts +0 -11
  87. package/umd/src/commitments/MEMORY/MemoryToolRuntimeAdapter.d.ts +0 -149
  88. package/umd/src/commitments/MEMORY/createMemorySystemMessage.d.ts +0 -6
  89. package/umd/src/commitments/MEMORY/createMemoryToolFunctions.d.ts +0 -8
  90. package/umd/src/commitments/MEMORY/createMemoryTools.d.ts +0 -14
  91. package/umd/src/commitments/MEMORY/getMemoryCommitmentDocumentation.d.ts +0 -6
  92. package/umd/src/commitments/MEMORY/getMemoryToolRuntimeAdapterOrDisabledResult.d.ts +0 -17
  93. package/umd/src/commitments/MEMORY/getMemoryToolTitles.d.ts +0 -7
  94. package/umd/src/commitments/MEMORY/parseMemoryToolArgs.d.ts +0 -61
  95. package/umd/src/commitments/MEMORY/resolveMemoryRuntimeContext.d.ts +0 -8
  96. package/umd/src/commitments/MEMORY/setMemoryToolRuntimeAdapter.d.ts +0 -13
  97. package/umd/src/commitments/META/META.d.ts +0 -65
  98. package/umd/src/commitments/USE/aggregateUseCommitmentSystemMessages.d.ts +0 -32
  99. package/umd/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +0 -58
  100. package/umd/src/commitments/USE_BROWSER/USE_BROWSER.test.d.ts +0 -1
  101. package/umd/src/commitments/USE_BROWSER/fetchUrlContentViaBrowser.d.ts +0 -13
  102. package/umd/src/commitments/USE_BROWSER/resolveRunBrowserToolForNode.d.ts +0 -10
  103. package/umd/src/commitments/USE_BROWSER/resolveRunBrowserToolForNode.test.d.ts +0 -1
  104. package/umd/src/commitments/USE_DEEPSEARCH/USE_DEEPSEARCH.d.ts +0 -47
  105. package/umd/src/commitments/USE_DEEPSEARCH/USE_DEEPSEARCH.test.d.ts +0 -1
  106. package/umd/src/commitments/USE_EMAIL/USE_EMAIL.d.ts +0 -38
  107. package/umd/src/commitments/USE_EMAIL/USE_EMAIL.test.d.ts +0 -1
  108. package/umd/src/commitments/USE_EMAIL/parseUseEmailCommitmentContent.d.ts +0 -21
  109. package/umd/src/commitments/USE_EMAIL/parseUseEmailCommitmentContent.test.d.ts +0 -1
  110. package/umd/src/commitments/USE_EMAIL/resolveSendEmailToolForNode.d.ts +0 -11
  111. package/umd/src/commitments/USE_EMAIL/sendEmailViaBrowser.d.ts +0 -13
  112. package/umd/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.d.ts +0 -46
  113. package/umd/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.test.d.ts +0 -1
  114. package/umd/src/commitments/USE_SPAWN/USE_SPAWN.d.ts +0 -38
  115. package/umd/src/commitments/USE_SPAWN/USE_SPAWN.test.d.ts +0 -1
  116. package/umd/src/commitments/USE_SPAWN/resolveSpawnAgentToolForNode.d.ts +0 -9
  117. package/umd/src/commitments/USE_SPAWN/spawnAgentViaBrowser.d.ts +0 -12
  118. package/umd/src/commitments/USE_TIME/USE_TIME.d.ts +0 -43
  119. package/umd/src/commitments/USE_TIME/USE_TIME.test.d.ts +0 -1
  120. package/umd/src/commitments/USE_TIMEOUT/TimeoutToolNames.d.ts +0 -11
  121. package/umd/src/commitments/USE_TIMEOUT/TimeoutToolRuntimeAdapter.d.ts +0 -212
  122. package/umd/src/commitments/USE_TIMEOUT/USE_TIMEOUT.d.ts +0 -38
  123. package/umd/src/commitments/USE_TIMEOUT/USE_TIMEOUT.test.d.ts +0 -1
  124. package/umd/src/commitments/USE_TIMEOUT/createTimeoutSystemMessage.d.ts +0 -6
  125. package/umd/src/commitments/USE_TIMEOUT/createTimeoutToolFunctions.d.ts +0 -8
  126. package/umd/src/commitments/USE_TIMEOUT/createTimeoutTools.d.ts +0 -7
  127. package/umd/src/commitments/USE_TIMEOUT/getTimeoutToolRuntimeAdapterOrDisabledResult.d.ts +0 -17
  128. package/umd/src/commitments/USE_TIMEOUT/parseTimeoutToolArgs.d.ts +0 -78
  129. package/umd/src/commitments/USE_TIMEOUT/resolveTimeoutRuntimeContext.d.ts +0 -8
  130. package/umd/src/commitments/USE_TIMEOUT/setTimeoutToolRuntimeAdapter.d.ts +0 -13
  131. package/umd/src/commitments/WALLET/WALLET.d.ts +0 -21
  132. package/umd/src/commitments/WALLET/WALLET.test.d.ts +0 -1
  133. package/umd/src/commitments/WALLET/WalletToolNames.d.ts +0 -12
  134. package/umd/src/commitments/WALLET/WalletToolRuntimeAdapter.d.ts +0 -163
  135. package/umd/src/commitments/WALLET/createWalletSystemMessage.d.ts +0 -6
  136. package/umd/src/commitments/WALLET/createWalletToolFunctions.d.ts +0 -8
  137. package/umd/src/commitments/WALLET/createWalletTools.d.ts +0 -7
  138. package/umd/src/commitments/WALLET/getWalletCommitmentDocumentation.d.ts +0 -6
  139. package/umd/src/commitments/WALLET/getWalletToolRuntimeAdapterOrDisabledResult.d.ts +0 -16
  140. package/umd/src/commitments/WALLET/getWalletToolTitles.d.ts +0 -7
  141. package/umd/src/commitments/WALLET/parseWalletToolArgs.d.ts +0 -51
  142. package/umd/src/commitments/WALLET/resolveWalletRuntimeContext.d.ts +0 -8
  143. package/umd/src/commitments/WALLET/setWalletToolRuntimeAdapter.d.ts +0 -13
  144. package/umd/src/commitments/_common/createSerpSearchToolFunction.d.ts +0 -12
  145. /package/esm/src/book-2.0/agent-source/{createAgentModelRequirements.useCommitmentAggregation.test.d.ts → createAgentModelRequirements.commitmentAggregation.test.d.ts} +0 -0
  146. /package/esm/src/{commitments/MEMORY/MEMORY.test.d.ts → cli/cli-commands/coder/boilerplateCount.test.d.ts} +0 -0
  147. /package/esm/src/{commitments/USE_BROWSER/USE_BROWSER.test.d.ts → cli/cli-commands/coder/generate-boilerplates.test.d.ts} +0 -0
  148. /package/esm/src/commitments/{META → META_DESCRIPTION}/META_DESCRIPTION.d.ts +0 -0
  149. /package/{esm/src/commitments/USE_BROWSER/resolveRunBrowserToolForNode.test.d.ts → umd/src/book-2.0/agent-source/createAgentModelRequirements.commitmentAggregation.test.d.ts} +0 -0
  150. /package/{esm/src/commitments/USE_DEEPSEARCH/USE_DEEPSEARCH.test.d.ts → umd/src/cli/cli-commands/coder/boilerplateCount.test.d.ts} +0 -0
  151. /package/{esm/src/commitments/USE_EMAIL/USE_EMAIL.test.d.ts → umd/src/cli/cli-commands/coder/generate-boilerplates.test.d.ts} +0 -0
  152. /package/umd/src/commitments/{META → META_DESCRIPTION}/META_DESCRIPTION.d.ts +0 -0
@@ -1,61 +0,0 @@
1
- import type { DeleteMemoryToolArgs, RetrieveMemoryToolArgs, StoreMemoryToolArgs, UpdateMemoryToolArgs } from './MemoryToolRuntimeAdapter';
2
- /**
3
- * Parsed retrieve memory arguments.
4
- *
5
- * @private type of MemoryCommitmentDefinition
6
- */
7
- type ParsedRetrieveMemoryArgs = {
8
- query?: string;
9
- limit?: number;
10
- };
11
- /**
12
- * Parsed store memory arguments.
13
- *
14
- * @private type of MemoryCommitmentDefinition
15
- */
16
- type ParsedStoreMemoryArgs = {
17
- content: string;
18
- isGlobal: boolean;
19
- };
20
- /**
21
- * Parsed update memory arguments.
22
- *
23
- * @private type of MemoryCommitmentDefinition
24
- */
25
- type ParsedUpdateMemoryArgs = {
26
- memoryId: string;
27
- content: string;
28
- isGlobal?: boolean;
29
- };
30
- /**
31
- * Parsed delete memory arguments.
32
- *
33
- * @private type of MemoryCommitmentDefinition
34
- */
35
- type ParsedDeleteMemoryArgs = {
36
- memoryId: string;
37
- };
38
- /**
39
- * Collection of MEMORY tool argument parsers.
40
- *
41
- * @private function of MemoryCommitmentDefinition
42
- */
43
- export declare const parseMemoryToolArgs: {
44
- /**
45
- * Parses retrieve memory arguments.
46
- */
47
- retrieve(args: RetrieveMemoryToolArgs): ParsedRetrieveMemoryArgs;
48
- /**
49
- * Parses store memory arguments.
50
- */
51
- store(args: StoreMemoryToolArgs): ParsedStoreMemoryArgs;
52
- /**
53
- * Parses update memory arguments.
54
- */
55
- update(args: UpdateMemoryToolArgs): ParsedUpdateMemoryArgs;
56
- /**
57
- * Parses delete memory arguments.
58
- */
59
- delete(args: DeleteMemoryToolArgs): ParsedDeleteMemoryArgs;
60
- };
61
- export {};
@@ -1,8 +0,0 @@
1
- import type { TODO_any } from '../../utils/organization/TODO_any';
2
- import type { MemoryToolRuntimeContext } from './MemoryToolRuntimeAdapter';
3
- /**
4
- * Resolves runtime context from hidden tool arguments.
5
- *
6
- * @private function of MemoryCommitmentDefinition
7
- */
8
- export declare function resolveMemoryRuntimeContext(args: Record<string, TODO_any>): MemoryToolRuntimeContext;
@@ -1,13 +0,0 @@
1
- import type { MemoryToolRuntimeAdapter } from './MemoryToolRuntimeAdapter';
2
- /**
3
- * Sets runtime adapter used by MEMORY commitment tools.
4
- *
5
- * @private function of MemoryCommitmentDefinition
6
- */
7
- export declare function setMemoryToolRuntimeAdapter(adapter: MemoryToolRuntimeAdapter | null): void;
8
- /**
9
- * Gets runtime adapter used by MEMORY commitment tools.
10
- *
11
- * @private function of MemoryCommitmentDefinition
12
- */
13
- export declare function getMemoryToolRuntimeAdapter(): MemoryToolRuntimeAdapter | null;
@@ -1,65 +0,0 @@
1
- import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
2
- import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
3
- /**
4
- * META commitment definition
5
- *
6
- * The META commitment handles all meta-information about the agent such as:
7
- * - META AVATAR / META VISUAL: Sets the agent's built-in default avatar visual
8
- * - META IMAGE: Sets the agent's avatar/profile image URL
9
- * - META LINK: Provides profile/source links for the person the agent models
10
- * - META DOMAIN: Sets the canonical custom domain/host of the agent
11
- * - META TITLE: Sets the agent's display title
12
- * - META DESCRIPTION: Sets the agent's description
13
- * - META INPUT PLACEHOLDER: Sets chat input placeholder text
14
- * - META THINKING MESSAGE: Adds custom thinking placeholder variants
15
- * - META [ANYTHING]: Any other meta information in uppercase format
16
- *
17
- * These commitments are special because they don't affect the system message,
18
- * but are handled separately in the parsing logic for profile display.
19
- *
20
- * Example usage in agent source:
21
- *
22
- * ```book
23
- * META VISUAL pixel-art
24
- * META IMAGE https://example.com/avatar.jpg
25
- * META LINK https://twitter.com/username
26
- * META DOMAIN my-agent.com
27
- * META TITLE Professional Assistant
28
- * META DESCRIPTION An AI assistant specialized in business tasks
29
- * META INPUT PLACEHOLDER Write a message...
30
- * META THINKING MESSAGE Thinking...
31
- * META AUTHOR John Doe
32
- * META VERSION 1.0
33
- * ```
34
- *
35
- * @private [🪔] Maybe export the commitments through some package
36
- */
37
- export declare class MetaCommitmentDefinition extends BaseCommitmentDefinition<`META${string}`> {
38
- constructor();
39
- /**
40
- * Short one-line description of META commitments.
41
- */
42
- get description(): string;
43
- /**
44
- * Icon for this commitment.
45
- */
46
- get icon(): string;
47
- /**
48
- * Markdown documentation for META commitment.
49
- */
50
- get documentation(): string;
51
- applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
52
- /**
53
- * Extracts meta information from the content based on the meta type
54
- * This is used by the parsing logic
55
- */
56
- extractMetaValue(metaType: string, content: string): string | null;
57
- /**
58
- * Validates if the provided content is a valid URL (for IMAGE and LINK types)
59
- */
60
- isValidUrl(content: string): boolean;
61
- /**
62
- * Checks if this is a known meta type
63
- */
64
- isKnownMetaType(metaType: string): boolean;
65
- }
@@ -1,32 +0,0 @@
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 DEEPSEARCH' | '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
- *
17
- * @private internal utility of `USE` commitments
18
- */
19
- export declare function appendAggregatedUseCommitmentPlaceholder(requirements: AgentModelRequirements, type: AggregatedUseCommitmentType): AgentModelRequirements;
20
- /**
21
- * Replaces temporary `USE` placeholders with one aggregated system-message block per commitment type.
22
- *
23
- * Distinct additional-instruction blocks are merged in stable source order while the hard-coded section is emitted only once.
24
- *
25
- * @param requirements - Model requirements produced by commitment-by-commitment application.
26
- * @param commitments - Filtered commitments in their original source order.
27
- * @returns Requirements with aggregated `USE` system-message sections.
28
- *
29
- * @private internal utility of `createAgentModelRequirementsWithCommitments`
30
- */
31
- export declare function aggregateUseCommitmentSystemMessages(requirements: AgentModelRequirements, commitments: ReadonlyArray<ParsedCommitment>): AgentModelRequirements;
32
- export {};
@@ -1,58 +0,0 @@
1
- import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
2
- import type { ToolFunction } from '../../scripting/javascript/JavascriptExecutionToolsOptions';
3
- import type { string_javascript_name } from '../../types/string_person_fullname';
4
- import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
5
- /**
6
- * USE BROWSER commitment definition
7
- *
8
- * The `USE BROWSER` commitment indicates that the agent should utilize browser tools
9
- * to access and retrieve up-to-date information from the internet when necessary.
10
- *
11
- * This commitment provides two levels of browser access:
12
- * 1. One-shot URL fetching: Simple function to fetch and scrape URL content
13
- * 2. Running browser: For complex tasks like scrolling, clicking, form filling, etc.
14
- *
15
- * The content following `USE BROWSER` is an arbitrary text that the agent should know
16
- * (e.g. browsing scope or preferred sources).
17
- *
18
- * Example usage in agent source:
19
- *
20
- * ```book
21
- * USE BROWSER
22
- * USE BROWSER Prefer official documentation and source websites.
23
- * ```
24
- *
25
- * @private [🪔] Maybe export the commitments through some package
26
- */
27
- export declare class UseBrowserCommitmentDefinition extends BaseCommitmentDefinition<'USE BROWSER'> {
28
- constructor();
29
- /**
30
- * The `USE BROWSER` commitment is standalone.
31
- */
32
- get requiresContent(): boolean;
33
- /**
34
- * Short one-line description of USE BROWSER.
35
- */
36
- get description(): string;
37
- /**
38
- * Icon for this commitment.
39
- */
40
- get icon(): string;
41
- /**
42
- * Markdown documentation for USE BROWSER commitment.
43
- */
44
- get documentation(): string;
45
- /**
46
- * Gets human-readable titles for tool functions provided by this commitment.
47
- */
48
- getToolTitles(): Record<string_javascript_name, string>;
49
- applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
50
- /**
51
- * Gets the browser tool function implementations.
52
- *
53
- * This method automatically detects the environment and uses:
54
- * - Server-side: Direct scraping via fetchUrlContent (Node.js)
55
- * - Browser: Proxy through Agents Server API via fetchUrlContentViaBrowser
56
- */
57
- getToolFunctions(): Record<string_javascript_name, ToolFunction>;
58
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,13 +0,0 @@
1
- /**
2
- * Client-side safe wrapper for fetching URL content
3
- *
4
- * This function proxies requests to the Agents Server API endpoint for scraping,
5
- * making it safe to use in browser environments.
6
- *
7
- * @param url The URL to fetch and scrape
8
- * @param agentsServerUrl The base URL of the agents server (defaults to current origin)
9
- * @returns Markdown content from the URL
10
- *
11
- * @private internal utility for USE BROWSER commitment
12
- */
13
- export declare function fetchUrlContentViaBrowser(url: string, agentsServerUrl?: string): Promise<string>;
@@ -1,10 +0,0 @@
1
- import type { ToolFunction } from '../../scripting/javascript/JavascriptExecutionToolsOptions';
2
- /**
3
- * Resolves the server-side implementation of the `run_browser` tool for Node.js environments.
4
- *
5
- * This uses fully lazy resolution to keep CLI startup independent from optional browser tooling.
6
- * When the server tool cannot be resolved, the fallback implementation throws a helpful error.
7
- *
8
- * @private internal utility for USE BROWSER commitment
9
- */
10
- export declare function resolveRunBrowserToolForNode(): ToolFunction;
@@ -1,47 +0,0 @@
1
- import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
2
- import type { ToolFunction } from '../../scripting/javascript/JavascriptExecutionToolsOptions';
3
- import type { string_javascript_name } from '../../types/string_person_fullname';
4
- import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
5
- /**
6
- * USE DEEPSEARCH commitment definition
7
- *
8
- * The `USE DEEPSEARCH` commitment indicates that the agent should use a deeper research-oriented
9
- * search workflow instead of lightweight web search when it needs fresh information from the internet.
10
- *
11
- * The content following `USE DEEPSEARCH` is an arbitrary text that the agent should know
12
- * (e.g. search scope or research instructions).
13
- *
14
- * Example usage in agent source:
15
- *
16
- * ```book
17
- * USE DEEPSEARCH
18
- * USE DEEPSEARCH Compare official vendor documentation with independent benchmarks.
19
- * ```
20
- *
21
- * @private [🪔] Maybe export the commitments through some package
22
- */
23
- export declare class UseDeepSearchCommitmentDefinition extends BaseCommitmentDefinition<'USE DEEPSEARCH'> {
24
- constructor();
25
- get requiresContent(): boolean;
26
- /**
27
- * Short one-line description of USE DEEPSEARCH.
28
- */
29
- get description(): string;
30
- /**
31
- * Icon for this commitment.
32
- */
33
- get icon(): string;
34
- /**
35
- * Markdown documentation for USE DEEPSEARCH commitment.
36
- */
37
- get documentation(): string;
38
- applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
39
- /**
40
- * Gets human-readable titles for tool functions provided by this commitment.
41
- */
42
- getToolTitles(): Record<string_javascript_name, string>;
43
- /**
44
- * Gets the local fallback implementation for the `deep_search` tool.
45
- */
46
- getToolFunctions(): Record<string_javascript_name, ToolFunction>;
47
- }
@@ -1,38 +0,0 @@
1
- import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
2
- import type { ToolFunction } from '../../scripting/javascript/JavascriptExecutionToolsOptions';
3
- import type { string_javascript_name } from '../../types/string_person_fullname';
4
- import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
5
- /**
6
- * USE EMAIL commitment definition.
7
- *
8
- * The `USE EMAIL` commitment enables outbound email sending through the `send_email` tool.
9
- *
10
- * @private [🪔] Maybe export the commitments through some package
11
- */
12
- export declare class UseEmailCommitmentDefinition extends BaseCommitmentDefinition<'USE EMAIL'> {
13
- constructor();
14
- get requiresContent(): boolean;
15
- /**
16
- * Short one-line description of USE EMAIL.
17
- */
18
- get description(): string;
19
- /**
20
- * Icon for this commitment.
21
- */
22
- get icon(): string;
23
- /**
24
- * Markdown documentation for USE EMAIL commitment.
25
- */
26
- get documentation(): string;
27
- applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
28
- /**
29
- * Gets human-readable titles for tool functions provided by this commitment.
30
- */
31
- getToolTitles(): Record<string_javascript_name, string>;
32
- /**
33
- * Gets the browser-safe `send_email` implementation.
34
- *
35
- * Node.js runtime overrides this via `getAllCommitmentsToolFunctionsForNode`.
36
- */
37
- getToolFunctions(): Record<string_javascript_name, ToolFunction>;
38
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,21 +0,0 @@
1
- /**
2
- * Parsed payload of one `USE EMAIL` commitment.
3
- *
4
- * @private internal USE EMAIL type
5
- */
6
- export type ParsedUseEmailCommitmentContent = {
7
- senderEmail: string | null;
8
- senderEmailRaw: string | null;
9
- instructions: string;
10
- };
11
- /**
12
- * Parses `USE EMAIL` commitment content into optional sender email + additional instructions.
13
- *
14
- * Examples:
15
- * - `agent@example.com`
16
- * - `agent@example.com Keep emails concise`
17
- * - `Keep emails concise`
18
- *
19
- * @private internal utility of USE EMAIL commitment
20
- */
21
- export declare function parseUseEmailCommitmentContent(content: string): ParsedUseEmailCommitmentContent;
@@ -1,11 +0,0 @@
1
- import type { ToolFunction } from '../../scripting/javascript/JavascriptExecutionToolsOptions';
2
- /**
3
- * Resolves the server-side implementation of the send_email tool for Node.js environments.
4
- *
5
- * This uses a lazy require so the core package can still load even if the Agents Server
6
- * module is unavailable. When the server tool cannot be resolved, a fallback implementation
7
- * throws a helpful error message.
8
- *
9
- * @private internal utility for USE EMAIL commitment
10
- */
11
- export declare function resolveSendEmailToolForNode(): ToolFunction;
@@ -1,13 +0,0 @@
1
- /**
2
- * Client-side safe wrapper for sending emails.
3
- *
4
- * This function proxies requests to the Agents Server API endpoint for email queuing,
5
- * making it safe to use in browser environments.
6
- *
7
- * @param args Email payload forwarded to the server-side `send_email` tool
8
- * @param agentsServerUrl The base URL of the agents server (defaults to current origin)
9
- * @returns Result string from the server-side send_email tool
10
- *
11
- * @private internal utility for USE EMAIL commitment
12
- */
13
- export declare function sendEmailViaBrowser(args: Record<string, unknown>, agentsServerUrl?: string): Promise<string>;
@@ -1,46 +0,0 @@
1
- import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
2
- import type { ToolFunction } from '../../scripting/javascript/JavascriptExecutionToolsOptions';
3
- import type { string_javascript_name } from '../../types/string_person_fullname';
4
- import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
5
- /**
6
- * USE SEARCH ENGINE commitment definition
7
- *
8
- * The `USE SEARCH ENGINE` commitment indicates that the agent should utilize a search engine tool
9
- * to access and retrieve up-to-date information from the internet when necessary.
10
- *
11
- * The content following `USE SEARCH ENGINE` is an arbitrary text that the agent should know (e.g. search scope or instructions).
12
- *
13
- * Example usage in agent source:
14
- *
15
- * ```book
16
- * USE SEARCH ENGINE
17
- * USE SEARCH ENGINE Hledej informace o Přemyslovcích
18
- * ```
19
- *
20
- * @private [🪔] Maybe export the commitments through some package
21
- */
22
- export declare class UseSearchEngineCommitmentDefinition extends BaseCommitmentDefinition<'USE SEARCH ENGINE'> {
23
- constructor();
24
- get requiresContent(): boolean;
25
- /**
26
- * Short one-line description of USE SEARCH ENGINE.
27
- */
28
- get description(): string;
29
- /**
30
- * Icon for this commitment.
31
- */
32
- get icon(): string;
33
- /**
34
- * Markdown documentation for USE SEARCH ENGINE commitment.
35
- */
36
- get documentation(): string;
37
- applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
38
- /**
39
- * Gets human-readable titles for tool functions provided by this commitment.
40
- */
41
- getToolTitles(): Record<string_javascript_name, string>;
42
- /**
43
- * Gets the `web_search` tool function implementation.
44
- */
45
- getToolFunctions(): Record<string_javascript_name, ToolFunction>;
46
- }
@@ -1,38 +0,0 @@
1
- import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
2
- import type { ToolFunction } from '../../scripting/javascript/JavascriptExecutionToolsOptions';
3
- import type { string_javascript_name } from '../../types/string_person_fullname';
4
- import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
5
- /**
6
- * USE SPAWN commitment definition.
7
- *
8
- * The `USE SPAWN` commitment enables creating new persistent child agents through one tool call.
9
- *
10
- * @private [🪔] Maybe export the commitments through some package
11
- */
12
- export declare class UseSpawnCommitmentDefinition extends BaseCommitmentDefinition<'USE SPAWN'> {
13
- constructor();
14
- get requiresContent(): boolean;
15
- /**
16
- * Short one-line description of USE SPAWN.
17
- */
18
- get description(): string;
19
- /**
20
- * Icon for this commitment.
21
- */
22
- get icon(): string;
23
- /**
24
- * Markdown documentation for USE SPAWN commitment.
25
- */
26
- get documentation(): string;
27
- applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
28
- /**
29
- * Gets human-readable titles for tool functions provided by this commitment.
30
- */
31
- getToolTitles(): Record<string_javascript_name, string>;
32
- /**
33
- * Gets browser-safe `spawn_agent` implementation.
34
- *
35
- * Node.js runtime overrides this through `getAllCommitmentsToolFunctionsForNode`.
36
- */
37
- getToolFunctions(): Record<string_javascript_name, ToolFunction>;
38
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,9 +0,0 @@
1
- import type { ToolFunction } from '../../scripting/javascript/JavascriptExecutionToolsOptions';
2
- /**
3
- * Resolves the server-side `spawn_agent` tool for Node.js runtimes.
4
- *
5
- * Uses lazy require so core package can load outside Agents Server.
6
- *
7
- * @private internal utility for USE SPAWN commitment
8
- */
9
- export declare function resolveSpawnAgentToolForNode(): ToolFunction;
@@ -1,12 +0,0 @@
1
- /**
2
- * Browser-safe wrapper for spawning one persisted Agents Server agent.
3
- *
4
- * This function proxies requests to the Agents Server `/api/spawn-agent` endpoint.
5
- *
6
- * @param args Tool payload forwarded to server-side `spawn_agent` tool.
7
- * @param agentsServerUrl Optional explicit agents server base URL.
8
- * @returns JSON string with structured spawn result.
9
- *
10
- * @private internal utility for USE SPAWN commitment
11
- */
12
- export declare function spawnAgentViaBrowser(args: Record<string, unknown>, agentsServerUrl?: string): Promise<string>;
@@ -1,43 +0,0 @@
1
- import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
2
- import type { ToolFunction } from '../../scripting/javascript/JavascriptExecutionToolsOptions';
3
- import type { string_javascript_name } from '../../types/string_person_fullname';
4
- import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
5
- /**
6
- * USE TIME commitment definition
7
- *
8
- * The `USE TIME` commitment indicates that the agent should be able to determine the current date and time.
9
- *
10
- * Example usage in agent source:
11
- *
12
- * ```book
13
- * USE TIME
14
- * USE TIME Prefer the user's local timezone.
15
- * ```
16
- *
17
- * @private [🪔] Maybe export the commitments through some package
18
- */
19
- export declare class UseTimeCommitmentDefinition extends BaseCommitmentDefinition<'USE TIME'> {
20
- constructor();
21
- get requiresContent(): boolean;
22
- /**
23
- * Short one-line description of USE TIME.
24
- */
25
- get description(): string;
26
- /**
27
- * Icon for this commitment.
28
- */
29
- get icon(): string;
30
- /**
31
- * Markdown documentation for USE TIME commitment.
32
- */
33
- get documentation(): string;
34
- applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
35
- /**
36
- * Gets human-readable titles for tool functions provided by this commitment.
37
- */
38
- getToolTitles(): Record<string_javascript_name, string>;
39
- /**
40
- * Gets the `get_current_time` tool function implementation.
41
- */
42
- getToolFunctions(): Record<string_javascript_name, ToolFunction>;
43
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,11 +0,0 @@
1
- /**
2
- * Tool names provided by the `USE TIMEOUT` commitment.
3
- *
4
- * @private internal USE TIMEOUT constant
5
- */
6
- export declare const TimeoutToolNames: {
7
- readonly set: string;
8
- readonly cancel: string;
9
- readonly list: string;
10
- readonly update: string;
11
- };