@promptbook/utils 0.114.0-1 → 0.114.0-3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -15
- package/esm/index.es.js +1 -1
- package/esm/src/book-2.0/book-language-documentation/BookLanguageManualDictionary.d.ts +1 -15
- package/esm/src/book-2.0/book-language-documentation/getBookLanguageManualCommitmentGroups.d.ts +1 -1
- package/esm/src/book-2.0/book-language-documentation/renderCommitmentCatalogSection.d.ts +0 -4
- package/esm/src/book-components/Chat/utils/$provideServerDomWindow.d.ts +11 -0
- package/esm/src/book-components/Chat/utils/renderMarkdown.d.ts +7 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/createAgentsServerRuntimeEnvironment.d.ts +7 -0
- package/esm/src/cli/cli-commands/coder/agentCodingFile.d.ts +2 -3
- package/esm/src/cli/cli-commands/coder/ping.d.ts +10 -0
- package/esm/src/cli/cli-commands/coder/ping.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/coderGitSyncCliOptions.d.ts +34 -0
- package/esm/src/cli/cli-commands/common/coderGitSyncCliOptions.test.d.ts +1 -0
- package/esm/src/cli/common/loadPromptsModule.d.ts +16 -0
- package/esm/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +1 -1
- package/esm/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +1 -1
- package/esm/src/llm-providers/openai/OpenAiAgentKitExecutionTools.d.ts +1 -1
- package/esm/src/llm-providers/openai/OpenAiAgentKitExecutionToolsToolBuilder.d.ts +1 -1
- package/esm/src/llm-providers/openai/OpenAiAssistantExecutionToolsStreamRunner.d.ts +1 -1
- package/esm/src/llm-providers/openai/OpenAiAssistantExecutionToolsToolRunner.d.ts +1 -1
- package/esm/src/llm-providers/openai/OpenAiCompatibleNonChatPromptCaller.d.ts +1 -1
- package/esm/src/llm-providers/openai/OpenAiCompatibleRequestManager.d.ts +1 -1
- package/esm/src/llm-providers/openai/utils/callOpenAiCompatibleChatModel.d.ts +1 -1
- package/esm/src/llm-providers/openai/utils/loadOpenAiAgentsModule.d.ts +203 -0
- package/esm/src/llm-providers/openai/utils/uploadFilesToOpenAi.d.ts +1 -1
- package/esm/src/utils/misc/createLazyModuleLoader.d.ts +14 -0
- package/esm/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/umd/index.umd.js +1 -1
- package/umd/src/book-2.0/book-language-documentation/BookLanguageManualDictionary.d.ts +1 -15
- package/umd/src/book-2.0/book-language-documentation/getBookLanguageManualCommitmentGroups.d.ts +1 -1
- package/umd/src/book-2.0/book-language-documentation/renderCommitmentCatalogSection.d.ts +0 -4
- package/umd/src/book-components/Chat/utils/$provideServerDomWindow.d.ts +11 -0
- package/umd/src/book-components/Chat/utils/renderMarkdown.d.ts +7 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/createAgentsServerRuntimeEnvironment.d.ts +7 -0
- package/umd/src/cli/cli-commands/coder/agentCodingFile.d.ts +2 -3
- package/umd/src/cli/cli-commands/coder/ping.d.ts +10 -0
- package/umd/src/cli/cli-commands/coder/ping.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/coderGitSyncCliOptions.d.ts +34 -0
- package/umd/src/cli/cli-commands/common/coderGitSyncCliOptions.test.d.ts +1 -0
- package/umd/src/cli/common/loadPromptsModule.d.ts +16 -0
- package/umd/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +1 -1
- package/umd/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +1 -1
- package/umd/src/llm-providers/openai/OpenAiAgentKitExecutionTools.d.ts +1 -1
- package/umd/src/llm-providers/openai/OpenAiAgentKitExecutionToolsToolBuilder.d.ts +1 -1
- package/umd/src/llm-providers/openai/OpenAiAssistantExecutionToolsStreamRunner.d.ts +1 -1
- package/umd/src/llm-providers/openai/OpenAiAssistantExecutionToolsToolRunner.d.ts +1 -1
- package/umd/src/llm-providers/openai/OpenAiCompatibleNonChatPromptCaller.d.ts +1 -1
- package/umd/src/llm-providers/openai/OpenAiCompatibleRequestManager.d.ts +1 -1
- package/umd/src/llm-providers/openai/utils/callOpenAiCompatibleChatModel.d.ts +1 -1
- package/umd/src/llm-providers/openai/utils/loadOpenAiAgentsModule.d.ts +203 -0
- package/umd/src/llm-providers/openai/utils/uploadFilesToOpenAi.d.ts +1 -1
- package/umd/src/utils/misc/createLazyModuleLoader.d.ts +14 -0
- package/umd/src/version.d.ts +1 -1
package/README.md
CHANGED
|
@@ -807,26 +807,27 @@ ptbk coder verify
|
|
|
807
807
|
| ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ------ | ---- | ----- | ------------------------------------------------------------------------ |
|
|
808
808
|
| `ptbk coder init` | Creates `prompts/`, `prompts/done/`, the project-generic template files materialized in `prompts/templates/` (currently `common.md`), and a starter `AGENTS.md`; ensures `.env` contains `CODING_AGENT_GIT_NAME`, `CODING_AGENT_GIT_EMAIL`, and `CODING_AGENT_GIT_SIGNING_KEY`; adds helper coder scripts to `package.json`; ensures `.gitignore` contains `/.promptbook`; and configures `.vscode/settings.json` to save pasted prompt images into `prompts/screenshots/`. |
|
|
809
809
|
| `ptbk coder generate-boilerplates` | Creates new prompt markdown files with fresh emoji tags so you can quickly fill in coding tasks; `--template` accepts either a built-in alias or a markdown file path relative to the project root. |
|
|
810
|
-
| `ptbk coder run` | Picks the next ready prompt, appends optional context, runs it through the selected coding agent, can optionally verify each attempt with a shell test command and feed failing output back for retries, then marks success or failure, commits the result, and pushes only when `--auto-push` is enabled.
|
|
810
|
+
| `ptbk coder run` | Picks the next ready prompt, can run tests before coding to stop or repair pre-existing failures, appends optional context, runs it through the selected coding agent, can optionally verify each attempt with a shell test command and feed failing output back for retries, then marks success or failure, commits the result, and pushes only when `--auto-push` is enabled. |
|
|
811
811
|
| `ptbk coder find-refactor-candidates` | Scans the repository for oversized or overpacked files and writes prompt files for likely refactors; `--level <xlow | low | medium | high | xhigh | extreme>` ranges from a very benevolent scan to a very aggressive sweep. |
|
|
812
812
|
| `ptbk coder verify` | Walks through completed prompts, archives truly finished work, and adds follow-up repair prompts for unfinished results. |
|
|
813
813
|
|
|
814
814
|
#### Most useful `ptbk coder run` flags
|
|
815
815
|
|
|
816
|
-
| Flag | Purpose
|
|
817
|
-
| -------------------------- |
|
|
818
|
-
| `--harness <name>` | Selects the coding harness.
|
|
819
|
-
| `--model <model>` | Chooses the runner model; required for `openai-codex` and `gemini`, optional for `github-copilot`.
|
|
820
|
-
| `--context <text-or-file>` | Appends extra instructions inline or from a file like `AGENTS.md`.
|
|
821
|
-
| `--test <command>` | Runs a verification command after each prompt attempt and feeds failing output back for retries.
|
|
822
|
-
| `--
|
|
823
|
-
| `--
|
|
824
|
-
| `--
|
|
825
|
-
| `--
|
|
826
|
-
| `--
|
|
827
|
-
| `--
|
|
828
|
-
| `--
|
|
829
|
-
| `--auto-
|
|
816
|
+
| Flag | Purpose |
|
|
817
|
+
| -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
818
|
+
| `--harness <name>` | Selects the coding harness. |
|
|
819
|
+
| `--model <model>` | Chooses the runner model; required for `openai-codex` and `gemini`, optional for `github-copilot`. |
|
|
820
|
+
| `--context <text-or-file>` | Appends extra instructions inline or from a file like `AGENTS.md`. |
|
|
821
|
+
| `--test <command>` | Runs a verification command after each prompt attempt and feeds failing output back for retries. |
|
|
822
|
+
| `--test-before <mode>` | Runs tests before coding: `no` (default), `yes-and-fail` (stop with results), or `yes-and-fix` (create one repair prompt first); defaults to `npm test` when enabled without `--test`. |
|
|
823
|
+
| `--thinking-level <level>` | Sets reasoning effort for supported runners. |
|
|
824
|
+
| `--no-auto` | Waits for user confirmation before each prompt instead of running automatically through the queue. |
|
|
825
|
+
| `--ignore-git-changes` | Disables the clean-working-tree guard. |
|
|
826
|
+
| `--priority <n>` | Runs only prompts at or above the given priority. |
|
|
827
|
+
| `--dry-run` | Prints which prompts are ready instead of executing them. |
|
|
828
|
+
| `--allow-credits` | Lets OpenAI Codex spend credits when required. |
|
|
829
|
+
| `--auto-push` | Pushes each successful coding-agent commit to the configured remote. |
|
|
830
|
+
| `--auto-migrate` | Runs testing-server database migrations after each successful prompt. |
|
|
830
831
|
|
|
831
832
|
#### Typical usage pattern
|
|
832
833
|
|
package/esm/index.es.js
CHANGED
|
@@ -17,7 +17,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
17
17
|
* @generated
|
|
18
18
|
* @see https://github.com/webgptorg/promptbook
|
|
19
19
|
*/
|
|
20
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.114.0-
|
|
20
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.114.0-3';
|
|
21
21
|
/**
|
|
22
22
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
23
23
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -86,9 +86,7 @@ export type BookLanguageManualDictionary = {
|
|
|
86
86
|
readonly metadataLabels: {
|
|
87
87
|
readonly bookLanguageVersion: string;
|
|
88
88
|
readonly generatedAt: string;
|
|
89
|
-
readonly
|
|
90
|
-
readonly implementedCommitments: string;
|
|
91
|
-
readonly placeholderCommitments: string;
|
|
89
|
+
readonly commitmentCount: string;
|
|
92
90
|
};
|
|
93
91
|
/**
|
|
94
92
|
* Heading of the table of contents.
|
|
@@ -128,7 +126,6 @@ export type BookLanguageManualDictionary = {
|
|
|
128
126
|
readonly primitivesSections: {
|
|
129
127
|
readonly coreSyntax: BookLanguageManualChapter;
|
|
130
128
|
readonly references: BookLanguageManualChapter;
|
|
131
|
-
readonly keywordsTitle: string;
|
|
132
129
|
};
|
|
133
130
|
/**
|
|
134
131
|
* Suffixes distinguishing a server-specific catalog from the portable one.
|
|
@@ -141,18 +138,7 @@ export type BookLanguageManualDictionary = {
|
|
|
141
138
|
* Labels used in every commitment catalog entry.
|
|
142
139
|
*/
|
|
143
140
|
readonly commitmentLabels: {
|
|
144
|
-
readonly status: string;
|
|
145
141
|
readonly aliases: string;
|
|
146
|
-
readonly semantics: string;
|
|
147
|
-
readonly typeSchema: string;
|
|
148
|
-
readonly blockSchema: string;
|
|
149
|
-
readonly lowLevelNotice: string;
|
|
150
|
-
readonly usage: string;
|
|
151
|
-
readonly usageOccurrence: string;
|
|
152
|
-
readonly usageOccurrences: string;
|
|
153
|
-
readonly statusImplemented: string;
|
|
154
|
-
readonly statusPlaceholder: string;
|
|
155
|
-
readonly noAliases: string;
|
|
156
142
|
};
|
|
157
143
|
/**
|
|
158
144
|
* Labels used by end-to-end example sections.
|
package/esm/src/book-2.0/book-language-documentation/getBookLanguageManualCommitmentGroups.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export type BookLanguageManualCommitmentGroups = {
|
|
|
16
16
|
*/
|
|
17
17
|
readonly documented: ReadonlyArray<BookLanguageManualCommitmentGroup>;
|
|
18
18
|
/**
|
|
19
|
-
* Low-level
|
|
19
|
+
* Low-level commitments documented in their own closing chapter.
|
|
20
20
|
*/
|
|
21
21
|
readonly lowLevel: ReadonlyArray<BookLanguageManualCommitmentGroup>;
|
|
22
22
|
};
|
|
@@ -10,10 +10,6 @@ export type RenderCommitmentCatalogSectionOptions = {
|
|
|
10
10
|
* Grouped commitment definition with aliases.
|
|
11
11
|
*/
|
|
12
12
|
readonly groupedCommitment: BookLanguageManualCommitmentGroup;
|
|
13
|
-
/**
|
|
14
|
-
* Number of uses across the selected server agents.
|
|
15
|
-
*/
|
|
16
|
-
readonly usageCount: number;
|
|
17
13
|
/**
|
|
18
14
|
* Translated labels of the manual.
|
|
19
15
|
*/
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { WindowLike as DomWindowLike } from 'dompurify';
|
|
2
|
+
/**
|
|
3
|
+
* Provides a DOM `window` for runtimes which do not have one, for example Node.js during server-side rendering
|
|
4
|
+
*
|
|
5
|
+
* Note: `$` is used to indicate that this function is not a pure function - it creates and caches one shared DOM window
|
|
6
|
+
*
|
|
7
|
+
* @returns DOM window which can back a DOM-dependent library like `DOMPurify`
|
|
8
|
+
* @throws {EnvironmentMismatchError} When the current runtime can not create a DOM window
|
|
9
|
+
* @private utility of `renderMarkdown`
|
|
10
|
+
*/
|
|
11
|
+
export declare function $provideServerDomWindow(): DomWindowLike;
|
|
@@ -25,6 +25,13 @@ export type MarkdownInlineReference = {
|
|
|
25
25
|
* Link target for the rendered reference.
|
|
26
26
|
*/
|
|
27
27
|
readonly href: string;
|
|
28
|
+
/**
|
|
29
|
+
* Markdown link destination prefixes that should render as this reference as well.
|
|
30
|
+
*
|
|
31
|
+
* This supports legacy links such as an Agents Server project file URL while keeping
|
|
32
|
+
* `reference` as the canonical `[[project]]` token.
|
|
33
|
+
*/
|
|
34
|
+
readonly sourceHrefPrefixes?: ReadonlyArray<string>;
|
|
28
35
|
/**
|
|
29
36
|
* Optional hover title for the rendered reference.
|
|
30
37
|
*/
|
|
@@ -18,6 +18,12 @@ export declare const PTBK_AGENTS_SERVER_BUILD_WORKER_COUNT_ENV = "PTBK_AGENTS_SE
|
|
|
18
18
|
* @private internal constant of `buildAgentsServer`
|
|
19
19
|
*/
|
|
20
20
|
export declare const PTBK_AGENTS_SERVER_IGNORE_NEXT_VALIDATION_ENV = "PTBK_AGENTS_SERVER_IGNORE_NEXT_VALIDATION";
|
|
21
|
+
/**
|
|
22
|
+
* Environment variable that disables throwaway webpack filesystem caches for CLI-owned production builds.
|
|
23
|
+
*
|
|
24
|
+
* @private internal constant of `buildAgentsServer`
|
|
25
|
+
*/
|
|
26
|
+
export declare const PTBK_AGENTS_SERVER_DISABLE_WEBPACK_FILESYSTEM_CACHE_ENV = "PTBK_AGENTS_SERVER_DISABLE_WEBPACK_FILESYSTEM_CACHE";
|
|
21
27
|
/**
|
|
22
28
|
* Adds dependency-resolution environment required by the materialized Agents Server runtime.
|
|
23
29
|
*
|
|
@@ -25,4 +31,5 @@ export declare const PTBK_AGENTS_SERVER_IGNORE_NEXT_VALIDATION_ENV = "PTBK_AGENT
|
|
|
25
31
|
*/
|
|
26
32
|
export declare function createAgentsServerRuntimeEnvironment(environment: NodeJS.ProcessEnv, nodeModulesPath: string, options?: {
|
|
27
33
|
readonly isNextValidationIgnored?: boolean;
|
|
34
|
+
readonly isWebpackFilesystemCacheDisabled?: boolean;
|
|
28
35
|
}): NodeJS.ProcessEnv;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { string_markdown } from '../../../types/typeAliases';
|
|
1
2
|
/**
|
|
2
3
|
* Relative path to the Promptbook Coder quick-reference file initialized in project roots.
|
|
3
4
|
*
|
|
@@ -9,6 +10,4 @@ export declare const AGENT_CODING_FILE_PATH = "AGENT_CODING.md";
|
|
|
9
10
|
*
|
|
10
11
|
* @private internal utility of `ptbk coder`
|
|
11
12
|
*/
|
|
12
|
-
export declare function getDefaultCoderAgentCodingFileContent(
|
|
13
|
-
readonly packageJsonScripts: Readonly<Record<string, string>>;
|
|
14
|
-
}): string;
|
|
13
|
+
export declare function getDefaultCoderAgentCodingFileContent(): string_markdown;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Command as Program } from 'commander';
|
|
2
|
+
import type { $side_effect } from '../../../utils/organization/$side_effect';
|
|
3
|
+
/**
|
|
4
|
+
* Initializes `coder ping` command for Promptbook CLI utilities
|
|
5
|
+
*
|
|
6
|
+
* Note: `$` is used to indicate that this function is not a pure function - it registers a command in the CLI
|
|
7
|
+
*
|
|
8
|
+
* @private internal function of `promptbookCli`
|
|
9
|
+
*/
|
|
10
|
+
export declare function $initializeCoderPingCommand(program: Program): $side_effect;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -9,6 +9,7 @@ import type { $side_effect } from '../../utils/organization/$side_effect';
|
|
|
9
9
|
* - generate-boilerplates: Generate prompt boilerplate files
|
|
10
10
|
* - find-refactor-candidates: Find files that need refactoring
|
|
11
11
|
* - run: Run coding prompts with AI agents
|
|
12
|
+
* - ping: Test one harness and model with a tiny dummy prompt
|
|
12
13
|
* - verify: Verify completed prompts
|
|
13
14
|
* - find-fresh-emoji-tags: Find unused emoji tags
|
|
14
15
|
*
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Command as Program } from 'commander';
|
|
2
|
+
import type { CoderGitSyncOptions } from '../../../../scripts/run-codex-prompts/git/coderGitSync';
|
|
3
|
+
export type { CoderGitSyncOptions };
|
|
4
|
+
/**
|
|
5
|
+
* Commander option bag for the shared `ptbk coder` git synchronization flags.
|
|
6
|
+
*
|
|
7
|
+
* @private internal utility of `promptbookCli`
|
|
8
|
+
*/
|
|
9
|
+
export type CoderGitSyncCliOptions = {
|
|
10
|
+
readonly commit: boolean;
|
|
11
|
+
readonly autoPush: boolean;
|
|
12
|
+
readonly autoPull: boolean;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Description block shared by the `ptbk coder` commands which can synchronize their changes with git.
|
|
16
|
+
*
|
|
17
|
+
* @private internal utility of `promptbookCli`
|
|
18
|
+
*/
|
|
19
|
+
export declare const CODER_GIT_SYNC_DESCRIPTION: string;
|
|
20
|
+
/**
|
|
21
|
+
* Registers the shared `--commit`, `--auto-push` and `--auto-pull` flags on a `ptbk coder` command.
|
|
22
|
+
*
|
|
23
|
+
* Note: Unlike `ptbk coder run`, which commits by default and opts out through `--no-commit`,
|
|
24
|
+
* these commands never touch git unless the flags are used explicitly.
|
|
25
|
+
*
|
|
26
|
+
* @private internal utility of `promptbookCli`
|
|
27
|
+
*/
|
|
28
|
+
export declare function addCoderGitSyncOptions(command: Program): void;
|
|
29
|
+
/**
|
|
30
|
+
* Converts the Commander git synchronization flags into normalized git synchronization options.
|
|
31
|
+
*
|
|
32
|
+
* @private internal utility of `promptbookCli`
|
|
33
|
+
*/
|
|
34
|
+
export declare function normalizeCoderGitSyncCliOptions(cliOptions: CoderGitSyncCliOptions): CoderGitSyncOptions;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="prompts" />
|
|
2
|
+
/**
|
|
3
|
+
* Loads the interactive terminal prompt library (`prompts`) on demand
|
|
4
|
+
*
|
|
5
|
+
* Note: [🐌] Loaded lazily to keep the startup of the `ptbk` CLI utility fast - most commands never ask the user
|
|
6
|
+
* anything interactively
|
|
7
|
+
*
|
|
8
|
+
* @private internal utility of Promptbook CLI
|
|
9
|
+
*/
|
|
10
|
+
export declare const loadPromptsModule: () => Promise<{
|
|
11
|
+
default: typeof import("prompts");
|
|
12
|
+
inject: typeof import("prompts").inject;
|
|
13
|
+
override: typeof import("prompts").override;
|
|
14
|
+
prompt: any;
|
|
15
|
+
prompts: typeof import("prompts").prompts;
|
|
16
|
+
}>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Anthropic from '@anthropic-ai/sdk';
|
|
1
|
+
import type Anthropic from '@anthropic-ai/sdk';
|
|
2
2
|
import type { ChatParticipant } from '../../book-components/Chat/types/ChatParticipant';
|
|
3
3
|
import type { AvailableModel } from '../../execution/AvailableModel';
|
|
4
4
|
import type { LlmExecutionTools } from '../../execution/LlmExecutionTools';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OpenAIClient } from '@azure/openai';
|
|
1
|
+
import type { OpenAIClient } from '@azure/openai';
|
|
2
2
|
import type { ChatParticipant } from '../../book-components/Chat/types/ChatParticipant';
|
|
3
3
|
import type { AvailableModel } from '../../execution/AvailableModel';
|
|
4
4
|
import type { LlmExecutionTools } from '../../execution/LlmExecutionTools';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Agent as AgentFromKit } from '@openai/agents';
|
|
1
|
+
import type { Agent as AgentFromKit } from '@openai/agents';
|
|
2
2
|
import type { CallChatModelStreamOptions, LlmExecutionTools } from '../../execution/LlmExecutionTools';
|
|
3
3
|
import type { ChatPromptResult } from '../../execution/PromptResult';
|
|
4
4
|
import type { ModelRequirements } from '../../types/ModelRequirements';
|
|
@@ -38,7 +38,7 @@ export declare class OpenAiAgentKitExecutionToolsToolBuilder {
|
|
|
38
38
|
buildAgentKitTools(options: {
|
|
39
39
|
readonly tools?: ModelRequirements['tools'];
|
|
40
40
|
readonly vectorStoreId?: string;
|
|
41
|
-
}): Array<AgentKitTool
|
|
41
|
+
}): Promise<Array<AgentKitTool>>;
|
|
42
42
|
/**
|
|
43
43
|
* Resolves the stored Promptbook tool result for one AgentKit tool call.
|
|
44
44
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import OpenAI from 'openai';
|
|
1
|
+
import type OpenAI from 'openai';
|
|
2
2
|
import type { ChatPromptResult } from '../../execution/PromptResult';
|
|
3
3
|
import type { Prompt } from '../../types/Prompt';
|
|
4
4
|
import type { string_date_iso8601, string_token } from '../../types/string_token';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import OpenAI from 'openai';
|
|
1
|
+
import type OpenAI from 'openai';
|
|
2
2
|
import type { ChatPromptResult } from '../../execution/PromptResult';
|
|
3
3
|
import type { ScriptExecutionTools } from '../../execution/ScriptExecutionTools';
|
|
4
4
|
import type { Prompt } from '../../types/Prompt';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import OpenAI from 'openai';
|
|
1
|
+
import type OpenAI from 'openai';
|
|
2
2
|
import type { AvailableModel } from '../../execution/AvailableModel';
|
|
3
3
|
import type { CompletionPromptResult, EmbeddingPromptResult, ImagePromptResult } from '../../execution/PromptResult';
|
|
4
4
|
import type { Usage } from '../../execution/Usage';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import OpenAI from 'openai';
|
|
1
|
+
import type OpenAI from 'openai';
|
|
2
2
|
import type { OpenAiCompatibleExecutionToolsNonProxiedOptions } from './OpenAiCompatibleExecutionToolsOptions';
|
|
3
3
|
/**
|
|
4
4
|
* Manages OpenAI-compatible client creation plus shared retry and rate-limit behavior.
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/**
|
|
3
|
+
* Loads the OpenAI AgentKit SDK (`@openai/agents`) on demand
|
|
4
|
+
*
|
|
5
|
+
* Note: [🐌] The AgentKit SDK is one of the heaviest dependencies of Promptbook, loading it eagerly would slow down
|
|
6
|
+
* every single run of the `ptbk` CLI utility even when no AgentKit agent is used
|
|
7
|
+
*
|
|
8
|
+
* @private internal utility of `@promptbook/openai`
|
|
9
|
+
*/
|
|
10
|
+
export declare const loadOpenAiAgentsModule: () => Promise<{
|
|
11
|
+
default: typeof import("@openai/agents");
|
|
12
|
+
applyPatchTool: typeof import("@openai/agents").applyPatchTool;
|
|
13
|
+
shellTool: typeof import("@openai/agents").shellTool;
|
|
14
|
+
realtime: typeof import("@openai/agents-realtime");
|
|
15
|
+
RuntimeEventEmitter: typeof import("events");
|
|
16
|
+
Agent: typeof import("@openai/agents").Agent;
|
|
17
|
+
AgentsError: typeof import("@openai/agents").AgentsError;
|
|
18
|
+
GuardrailExecutionError: typeof import("@openai/agents").GuardrailExecutionError;
|
|
19
|
+
InputGuardrailTripwireTriggered: typeof import("@openai/agents").InputGuardrailTripwireTriggered;
|
|
20
|
+
MaxTurnsExceededError: typeof import("@openai/agents").MaxTurnsExceededError;
|
|
21
|
+
ModelBehaviorError: typeof import("@openai/agents").ModelBehaviorError;
|
|
22
|
+
OutputGuardrailTripwireTriggered: typeof import("@openai/agents").OutputGuardrailTripwireTriggered;
|
|
23
|
+
ToolInputGuardrailTripwireTriggered: typeof import("@openai/agents").ToolInputGuardrailTripwireTriggered;
|
|
24
|
+
ToolOutputGuardrailTripwireTriggered: typeof import("@openai/agents").ToolOutputGuardrailTripwireTriggered;
|
|
25
|
+
ToolCallError: typeof import("@openai/agents").ToolCallError;
|
|
26
|
+
ToolTimeoutError: typeof import("@openai/agents").ToolTimeoutError;
|
|
27
|
+
UserError: typeof import("@openai/agents").UserError;
|
|
28
|
+
SystemError: typeof import("@openai/agents").SystemError;
|
|
29
|
+
RunAgentUpdatedStreamEvent: typeof import("@openai/agents").RunAgentUpdatedStreamEvent;
|
|
30
|
+
RunRawModelStreamEvent: typeof import("@openai/agents").RunRawModelStreamEvent;
|
|
31
|
+
RunItemStreamEvent: typeof import("@openai/agents").RunItemStreamEvent;
|
|
32
|
+
defineOutputGuardrail: typeof import("@openai/agents").defineOutputGuardrail;
|
|
33
|
+
ToolGuardrailFunctionOutputFactory: {
|
|
34
|
+
allow(outputInfo?: any): import("@openai/agents").ToolGuardrailFunctionOutput;
|
|
35
|
+
rejectContent(message: string, outputInfo?: any): import("@openai/agents").ToolGuardrailFunctionOutput;
|
|
36
|
+
throwException(outputInfo?: any): import("@openai/agents").ToolGuardrailFunctionOutput;
|
|
37
|
+
};
|
|
38
|
+
defineToolInputGuardrail: typeof import("@openai/agents").defineToolInputGuardrail;
|
|
39
|
+
defineToolOutputGuardrail: typeof import("@openai/agents").defineToolOutputGuardrail;
|
|
40
|
+
resolveToolInputGuardrails: typeof import("@openai/agents").resolveToolInputGuardrails;
|
|
41
|
+
resolveToolOutputGuardrails: typeof import("@openai/agents").resolveToolOutputGuardrails;
|
|
42
|
+
getHandoff: typeof import("@openai/agents").getHandoff;
|
|
43
|
+
getTransferMessage: typeof import("@openai/agents").getTransferMessage;
|
|
44
|
+
Handoff: typeof import("@openai/agents").Handoff;
|
|
45
|
+
handoff: typeof import("@openai/agents").handoff;
|
|
46
|
+
assistant: typeof import("@openai/agents").assistant;
|
|
47
|
+
system: typeof import("@openai/agents").system;
|
|
48
|
+
user: typeof import("@openai/agents").user;
|
|
49
|
+
extractAllTextOutput: typeof import("@openai/agents").extractAllTextOutput;
|
|
50
|
+
RunHandoffCallItem: typeof import("@openai/agents").RunHandoffCallItem;
|
|
51
|
+
RunHandoffOutputItem: typeof import("@openai/agents").RunHandoffOutputItem;
|
|
52
|
+
RunMessageOutputItem: typeof import("@openai/agents").RunMessageOutputItem;
|
|
53
|
+
RunReasoningItem: typeof import("@openai/agents").RunReasoningItem;
|
|
54
|
+
RunToolApprovalItem: typeof import("@openai/agents").RunToolApprovalItem;
|
|
55
|
+
RunToolCallItem: typeof import("@openai/agents").RunToolCallItem;
|
|
56
|
+
RunToolCallOutputItem: typeof import("@openai/agents").RunToolCallOutputItem;
|
|
57
|
+
AgentHooks: typeof import("@openai/agents").AgentHooks;
|
|
58
|
+
getLogger: typeof import("@openai/agents").getLogger;
|
|
59
|
+
applyDiff: typeof import("@openai/agents").applyDiff;
|
|
60
|
+
getAllMcpTools: typeof import("@openai/agents").getAllMcpTools;
|
|
61
|
+
invalidateServerToolsCache: typeof import("@openai/agents").invalidateServerToolsCache;
|
|
62
|
+
mcpToFunctionTool: typeof import("@openai/agents").mcpToFunctionTool;
|
|
63
|
+
MCPServerStdio: typeof import("@openai/agents").MCPServerStdio;
|
|
64
|
+
MCPServerStreamableHttp: typeof import("@openai/agents").MCPServerStreamableHttp;
|
|
65
|
+
MCPServerSSE: typeof import("@openai/agents").MCPServerSSE;
|
|
66
|
+
MCPServers: typeof import("@openai/agents").MCPServers;
|
|
67
|
+
connectMcpServers: typeof import("@openai/agents").connectMcpServers;
|
|
68
|
+
createMCPToolStaticFilter: typeof import("@openai/agents").createMCPToolStaticFilter;
|
|
69
|
+
OPENAI_DEFAULT_MODEL_ENV_VARIABLE_NAME: "OPENAI_DEFAULT_MODEL";
|
|
70
|
+
gpt5ReasoningSettingsRequired: typeof import("@openai/agents").gpt5ReasoningSettingsRequired;
|
|
71
|
+
getDefaultModel: typeof import("@openai/agents").getDefaultModel;
|
|
72
|
+
getDefaultModelSettings: typeof import("@openai/agents").getDefaultModelSettings;
|
|
73
|
+
isGpt5Default: typeof import("@openai/agents").isGpt5Default;
|
|
74
|
+
setDefaultModelProvider: typeof import("@openai/agents").setDefaultModelProvider;
|
|
75
|
+
RunResult: typeof import("@openai/agents").RunResult;
|
|
76
|
+
StreamedRunResult: typeof import("@openai/agents").StreamedRunResult;
|
|
77
|
+
run: typeof import("@openai/agents").run;
|
|
78
|
+
Runner: typeof import("@openai/agents").Runner;
|
|
79
|
+
RunContext: typeof import("@openai/agents").RunContext;
|
|
80
|
+
RunState: typeof import("@openai/agents").RunState;
|
|
81
|
+
computerTool: typeof import("@openai/agents").computerTool;
|
|
82
|
+
hostedMcpTool: typeof import("@openai/agents").hostedMcpTool;
|
|
83
|
+
tool: typeof import("@openai/agents").tool;
|
|
84
|
+
invokeFunctionTool: typeof import("@openai/agents").invokeFunctionTool;
|
|
85
|
+
getGlobalTraceProvider: typeof import("@openai/agents").getGlobalTraceProvider;
|
|
86
|
+
TraceProvider: typeof import("@openai/agents").TraceProvider;
|
|
87
|
+
runToolInputGuardrails: typeof import("@openai/agents").runToolInputGuardrails;
|
|
88
|
+
runToolOutputGuardrails: typeof import("@openai/agents").runToolOutputGuardrails;
|
|
89
|
+
RequestUsage: typeof import("@openai/agents").RequestUsage;
|
|
90
|
+
Usage: typeof import("@openai/agents").Usage;
|
|
91
|
+
isOpenAIResponsesCompactionAwareSession: typeof import("@openai/agents").isOpenAIResponsesCompactionAwareSession;
|
|
92
|
+
MemorySession: typeof import("@openai/agents").MemorySession;
|
|
93
|
+
protocol: typeof import("@openai/agents-core/dist/types/protocol");
|
|
94
|
+
addTraceProcessor(processor: import("@openai/agents").TracingProcessor): void;
|
|
95
|
+
setTraceProcessors(processors: import("@openai/agents").TracingProcessor[]): void;
|
|
96
|
+
setTracingDisabled(disabled: boolean): void;
|
|
97
|
+
startTraceExportLoop(): void;
|
|
98
|
+
getCurrentSpan: typeof import("@openai/agents").getCurrentSpan;
|
|
99
|
+
getCurrentTrace: typeof import("@openai/agents").getCurrentTrace;
|
|
100
|
+
getOrCreateTrace: typeof import("@openai/agents").getOrCreateTrace;
|
|
101
|
+
resetCurrentSpan: typeof import("@openai/agents").resetCurrentSpan;
|
|
102
|
+
setCurrentSpan: typeof import("@openai/agents").setCurrentSpan;
|
|
103
|
+
withTrace: typeof import("@openai/agents").withTrace;
|
|
104
|
+
BatchTraceProcessor: typeof import("@openai/agents").BatchTraceProcessor;
|
|
105
|
+
ConsoleSpanExporter: typeof import("@openai/agents").ConsoleSpanExporter;
|
|
106
|
+
NoopSpan: typeof import("@openai/agents").NoopSpan;
|
|
107
|
+
Span: typeof import("@openai/agents").Span;
|
|
108
|
+
NoopTrace: typeof import("@openai/agents").NoopTrace;
|
|
109
|
+
Trace: typeof import("@openai/agents").Trace;
|
|
110
|
+
generateGroupId: typeof import("@openai/agents").generateGroupId;
|
|
111
|
+
generateSpanId: typeof import("@openai/agents").generateSpanId;
|
|
112
|
+
generateTraceId: typeof import("@openai/agents").generateTraceId;
|
|
113
|
+
createResponseSpan(options?: import("@openai/agents-core/types").DeepPartial<import("@openai/agents-core/dist/tracing/provider").CreateSpanOptions<import("@openai/agents").ResponseSpanData>> | undefined, parent?: import("@openai/agents").Trace | import("@openai/agents").Span<any> | undefined): import("@openai/agents").Span<import("@openai/agents").ResponseSpanData>;
|
|
114
|
+
createAgentSpan(options?: import("@openai/agents-core/types").DeepPartial<import("@openai/agents-core/dist/tracing/provider").CreateSpanOptions<import("@openai/agents").AgentSpanData>> | undefined, parent?: import("@openai/agents").Trace | import("@openai/agents").Span<any> | undefined): import("@openai/agents").Span<import("@openai/agents").AgentSpanData>;
|
|
115
|
+
createFunctionSpan(options: import("@openai/agents-core/types").DeepPartial<import("@openai/agents-core/dist/tracing/provider").CreateSpanOptions<import("@openai/agents").FunctionSpanData>> & {
|
|
116
|
+
data: {
|
|
117
|
+
name: string;
|
|
118
|
+
};
|
|
119
|
+
}, parent?: import("@openai/agents").Trace | import("@openai/agents").Span<any> | undefined): import("@openai/agents").Span<import("@openai/agents").FunctionSpanData>;
|
|
120
|
+
createHandoffSpan(options?: import("@openai/agents-core/types").DeepPartial<import("@openai/agents-core/dist/tracing/provider").CreateSpanOptions<import("@openai/agents").HandoffSpanData>> | undefined, parent?: import("@openai/agents").Trace | import("@openai/agents").Span<any> | undefined): import("@openai/agents").Span<import("@openai/agents").HandoffSpanData>;
|
|
121
|
+
createGenerationSpan(options?: import("@openai/agents-core/types").DeepPartial<import("@openai/agents-core/dist/tracing/provider").CreateSpanOptions<import("@openai/agents").GenerationSpanData>> | undefined, parent?: import("@openai/agents").Trace | import("@openai/agents").Span<any> | undefined): import("@openai/agents").Span<import("@openai/agents").GenerationSpanData>;
|
|
122
|
+
createCustomSpan(options: import("@openai/agents-core/types").DeepPartial<import("@openai/agents-core/dist/tracing/provider").CreateSpanOptions<import("@openai/agents").CustomSpanData>> & {
|
|
123
|
+
data: {
|
|
124
|
+
name: string;
|
|
125
|
+
};
|
|
126
|
+
}, parent?: import("@openai/agents").Trace | import("@openai/agents").Span<any> | undefined): import("@openai/agents").Span<import("@openai/agents").CustomSpanData>;
|
|
127
|
+
createGuardrailSpan(options: import("@openai/agents-core/types").DeepPartial<import("@openai/agents-core/dist/tracing/provider").CreateSpanOptions<import("@openai/agents").GuardrailSpanData>> & {
|
|
128
|
+
data: {
|
|
129
|
+
name: string;
|
|
130
|
+
};
|
|
131
|
+
}, parent?: import("@openai/agents").Trace | import("@openai/agents").Span<any> | undefined): import("@openai/agents").Span<import("@openai/agents").GuardrailSpanData>;
|
|
132
|
+
createTranscriptionSpan(options: import("@openai/agents-core/types").DeepPartial<import("@openai/agents-core/dist/tracing/provider").CreateSpanOptions<import("@openai/agents").TranscriptionSpanData>> & {
|
|
133
|
+
data: {
|
|
134
|
+
input: {
|
|
135
|
+
data: string;
|
|
136
|
+
format: (string & {}) | "pcm";
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
}, parent?: import("@openai/agents").Trace | import("@openai/agents").Span<any> | undefined): import("@openai/agents").Span<import("@openai/agents").TranscriptionSpanData>;
|
|
140
|
+
createSpeechSpan(options: import("@openai/agents-core/types").DeepPartial<import("@openai/agents-core/dist/tracing/provider").CreateSpanOptions<import("@openai/agents").SpeechSpanData>> & {
|
|
141
|
+
data: {
|
|
142
|
+
output: {
|
|
143
|
+
data: string;
|
|
144
|
+
format: (string & {}) | "pcm";
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
}, parent?: import("@openai/agents").Trace | import("@openai/agents").Span<any> | undefined): import("@openai/agents").Span<import("@openai/agents").SpeechSpanData>;
|
|
148
|
+
createSpeechGroupSpan(options?: import("@openai/agents-core/types").DeepPartial<import("@openai/agents-core/dist/tracing/provider").CreateSpanOptions<import("@openai/agents").SpeechGroupSpanData>> | undefined, parent?: import("@openai/agents").Trace | import("@openai/agents").Span<any> | undefined): import("@openai/agents").Span<import("@openai/agents").SpeechGroupSpanData>;
|
|
149
|
+
createMCPListToolsSpan(options?: import("@openai/agents-core/types").DeepPartial<import("@openai/agents-core/dist/tracing/provider").CreateSpanOptions<import("@openai/agents").MCPListToolsSpanData>> | undefined, parent?: import("@openai/agents").Trace | import("@openai/agents").Span<any> | undefined): import("@openai/agents").Span<import("@openai/agents").MCPListToolsSpanData>;
|
|
150
|
+
withResponseSpan: <TOutput>(fn: (span: import("@openai/agents").Span<import("@openai/agents").ResponseSpanData>) => Promise<TOutput>, options?: import("@openai/agents-core/types").DeepPartial<import("@openai/agents-core/dist/tracing/provider").CreateSpanOptions<import("@openai/agents").ResponseSpanData>> | undefined, parent?: import("@openai/agents").Trace | import("@openai/agents").Span<any> | undefined) => Promise<TOutput>;
|
|
151
|
+
withAgentSpan: <TOutput_1>(fn: (span: import("@openai/agents").Span<import("@openai/agents").AgentSpanData>) => Promise<TOutput_1>, options?: import("@openai/agents-core/types").DeepPartial<import("@openai/agents-core/dist/tracing/provider").CreateSpanOptions<import("@openai/agents").AgentSpanData>> | undefined, parent?: import("@openai/agents").Trace | import("@openai/agents").Span<any> | undefined) => Promise<TOutput_1>;
|
|
152
|
+
withFunctionSpan: <TOutput_2>(fn: (span: import("@openai/agents").Span<import("@openai/agents").FunctionSpanData>) => Promise<TOutput_2>, options: import("@openai/agents-core/types").DeepPartial<import("@openai/agents-core/dist/tracing/provider").CreateSpanOptions<import("@openai/agents").FunctionSpanData>> & {
|
|
153
|
+
data: {
|
|
154
|
+
name: string;
|
|
155
|
+
};
|
|
156
|
+
}, parent?: import("@openai/agents").Trace | import("@openai/agents").Span<any> | undefined) => Promise<TOutput_2>;
|
|
157
|
+
withHandoffSpan: <TOutput_3>(fn: (span: import("@openai/agents").Span<import("@openai/agents").HandoffSpanData>) => Promise<TOutput_3>, options?: import("@openai/agents-core/types").DeepPartial<import("@openai/agents-core/dist/tracing/provider").CreateSpanOptions<import("@openai/agents").HandoffSpanData>> | undefined, parent?: import("@openai/agents").Trace | import("@openai/agents").Span<any> | undefined) => Promise<TOutput_3>;
|
|
158
|
+
withGenerationSpan: <TOutput_4>(fn: (span: import("@openai/agents").Span<import("@openai/agents").GenerationSpanData>) => Promise<TOutput_4>, options?: import("@openai/agents-core/types").DeepPartial<import("@openai/agents-core/dist/tracing/provider").CreateSpanOptions<import("@openai/agents").GenerationSpanData>> | undefined, parent?: import("@openai/agents").Trace | import("@openai/agents").Span<any> | undefined) => Promise<TOutput_4>;
|
|
159
|
+
withCustomSpan: <TOutput_5>(fn: (span: import("@openai/agents").Span<import("@openai/agents").CustomSpanData>) => Promise<TOutput_5>, options: import("@openai/agents-core/types").DeepPartial<import("@openai/agents-core/dist/tracing/provider").CreateSpanOptions<import("@openai/agents").CustomSpanData>> & {
|
|
160
|
+
data: {
|
|
161
|
+
name: string;
|
|
162
|
+
};
|
|
163
|
+
}, parent?: import("@openai/agents").Trace | import("@openai/agents").Span<any> | undefined) => Promise<TOutput_5>;
|
|
164
|
+
withGuardrailSpan: <TOutput_6>(fn: (span: import("@openai/agents").Span<import("@openai/agents").GuardrailSpanData>) => Promise<TOutput_6>, options: import("@openai/agents-core/types").DeepPartial<import("@openai/agents-core/dist/tracing/provider").CreateSpanOptions<import("@openai/agents").GuardrailSpanData>> & {
|
|
165
|
+
data: {
|
|
166
|
+
name: string;
|
|
167
|
+
};
|
|
168
|
+
}, parent?: import("@openai/agents").Trace | import("@openai/agents").Span<any> | undefined) => Promise<TOutput_6>;
|
|
169
|
+
withTranscriptionSpan: <TOutput_7>(fn: (span: import("@openai/agents").Span<import("@openai/agents").TranscriptionSpanData>) => Promise<TOutput_7>, options: import("@openai/agents-core/types").DeepPartial<import("@openai/agents-core/dist/tracing/provider").CreateSpanOptions<import("@openai/agents").TranscriptionSpanData>> & {
|
|
170
|
+
data: {
|
|
171
|
+
input: {
|
|
172
|
+
data: string;
|
|
173
|
+
format: (string & {}) | "pcm";
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
}, parent?: import("@openai/agents").Trace | import("@openai/agents").Span<any> | undefined) => Promise<TOutput_7>;
|
|
177
|
+
withSpeechSpan: <TOutput_8>(fn: (span: import("@openai/agents").Span<import("@openai/agents").SpeechSpanData>) => Promise<TOutput_8>, options: import("@openai/agents-core/types").DeepPartial<import("@openai/agents-core/dist/tracing/provider").CreateSpanOptions<import("@openai/agents").SpeechSpanData>> & {
|
|
178
|
+
data: {
|
|
179
|
+
output: {
|
|
180
|
+
data: string;
|
|
181
|
+
format: (string & {}) | "pcm";
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
}, parent?: import("@openai/agents").Trace | import("@openai/agents").Span<any> | undefined) => Promise<TOutput_8>;
|
|
185
|
+
withSpeechGroupSpan: <TOutput_9>(fn: (span: import("@openai/agents").Span<import("@openai/agents").SpeechGroupSpanData>) => Promise<TOutput_9>, options?: import("@openai/agents-core/types").DeepPartial<import("@openai/agents-core/dist/tracing/provider").CreateSpanOptions<import("@openai/agents").SpeechGroupSpanData>> | undefined, parent?: import("@openai/agents").Trace | import("@openai/agents").Span<any> | undefined) => Promise<TOutput_9>;
|
|
186
|
+
withMCPListToolsSpan: <TOutput_10>(fn: (span: import("@openai/agents").Span<import("@openai/agents").MCPListToolsSpanData>) => Promise<TOutput_10>, options?: import("@openai/agents-core/types").DeepPartial<import("@openai/agents-core/dist/tracing/provider").CreateSpanOptions<import("@openai/agents").MCPListToolsSpanData>> | undefined, parent?: import("@openai/agents").Trace | import("@openai/agents").Span<any> | undefined) => Promise<TOutput_10>;
|
|
187
|
+
OpenAIProvider: typeof import("@openai/agents").OpenAIProvider;
|
|
188
|
+
OpenAIResponsesModel: typeof import("@openai/agents").OpenAIResponsesModel;
|
|
189
|
+
OpenAIChatCompletionsModel: typeof import("@openai/agents").OpenAIChatCompletionsModel;
|
|
190
|
+
setDefaultOpenAIClient: typeof import("@openai/agents").setDefaultOpenAIClient;
|
|
191
|
+
setOpenAIAPI: typeof import("@openai/agents").setOpenAIAPI;
|
|
192
|
+
setDefaultOpenAIKey: typeof import("@openai/agents").setDefaultOpenAIKey;
|
|
193
|
+
setTracingExportApiKey: typeof import("@openai/agents").setTracingExportApiKey;
|
|
194
|
+
setDefaultOpenAITracingExporter: typeof import("@openai/agents").setDefaultOpenAITracingExporter;
|
|
195
|
+
OpenAITracingExporter: typeof import("@openai/agents").OpenAITracingExporter;
|
|
196
|
+
webSearchTool: typeof import("@openai/agents").webSearchTool;
|
|
197
|
+
fileSearchTool: typeof import("@openai/agents").fileSearchTool;
|
|
198
|
+
codeInterpreterTool: typeof import("@openai/agents").codeInterpreterTool;
|
|
199
|
+
imageGenerationTool: typeof import("@openai/agents").imageGenerationTool;
|
|
200
|
+
OpenAIConversationsSession: typeof import("@openai/agents").OpenAIConversationsSession;
|
|
201
|
+
startOpenAIConversationsSession: typeof import("@openai/agents").startOpenAIConversationsSession;
|
|
202
|
+
OpenAIResponsesCompactionSession: typeof import("@openai/agents").OpenAIResponsesCompactionSession;
|
|
203
|
+
}>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a loader which imports one module on the first call and reuses the very same module afterwards
|
|
3
|
+
*
|
|
4
|
+
* Note: [🐌] Heavy third-party dependencies are imported lazily to keep the startup of the Promptbook CLI fast.
|
|
5
|
+
* A statically imported dependency is loaded every single time the bundle is loaded, even when the running
|
|
6
|
+
* command never touches it. A lazily imported dependency is loaded only when the feature is really used.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* const loadJsdomModule = createLazyModuleLoader(() => import('jsdom'));
|
|
10
|
+
* const { JSDOM } = await loadJsdomModule();
|
|
11
|
+
*
|
|
12
|
+
* @private internal utility of Promptbook
|
|
13
|
+
*/
|
|
14
|
+
export declare function createLazyModuleLoader<TModule>(importModule: () => Promise<TModule>): () => Promise<TModule>;
|
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.
|
|
18
|
+
* It follows semantic versioning (e.g., `0.114.0-2`).
|
|
19
19
|
*
|
|
20
20
|
* @generated
|
|
21
21
|
*/
|
package/package.json
CHANGED
package/umd/index.umd.js
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
* @generated
|
|
24
24
|
* @see https://github.com/webgptorg/promptbook
|
|
25
25
|
*/
|
|
26
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.114.0-
|
|
26
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.114.0-3';
|
|
27
27
|
/**
|
|
28
28
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
29
29
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -86,9 +86,7 @@ export type BookLanguageManualDictionary = {
|
|
|
86
86
|
readonly metadataLabels: {
|
|
87
87
|
readonly bookLanguageVersion: string;
|
|
88
88
|
readonly generatedAt: string;
|
|
89
|
-
readonly
|
|
90
|
-
readonly implementedCommitments: string;
|
|
91
|
-
readonly placeholderCommitments: string;
|
|
89
|
+
readonly commitmentCount: string;
|
|
92
90
|
};
|
|
93
91
|
/**
|
|
94
92
|
* Heading of the table of contents.
|
|
@@ -128,7 +126,6 @@ export type BookLanguageManualDictionary = {
|
|
|
128
126
|
readonly primitivesSections: {
|
|
129
127
|
readonly coreSyntax: BookLanguageManualChapter;
|
|
130
128
|
readonly references: BookLanguageManualChapter;
|
|
131
|
-
readonly keywordsTitle: string;
|
|
132
129
|
};
|
|
133
130
|
/**
|
|
134
131
|
* Suffixes distinguishing a server-specific catalog from the portable one.
|
|
@@ -141,18 +138,7 @@ export type BookLanguageManualDictionary = {
|
|
|
141
138
|
* Labels used in every commitment catalog entry.
|
|
142
139
|
*/
|
|
143
140
|
readonly commitmentLabels: {
|
|
144
|
-
readonly status: string;
|
|
145
141
|
readonly aliases: string;
|
|
146
|
-
readonly semantics: string;
|
|
147
|
-
readonly typeSchema: string;
|
|
148
|
-
readonly blockSchema: string;
|
|
149
|
-
readonly lowLevelNotice: string;
|
|
150
|
-
readonly usage: string;
|
|
151
|
-
readonly usageOccurrence: string;
|
|
152
|
-
readonly usageOccurrences: string;
|
|
153
|
-
readonly statusImplemented: string;
|
|
154
|
-
readonly statusPlaceholder: string;
|
|
155
|
-
readonly noAliases: string;
|
|
156
142
|
};
|
|
157
143
|
/**
|
|
158
144
|
* Labels used by end-to-end example sections.
|
package/umd/src/book-2.0/book-language-documentation/getBookLanguageManualCommitmentGroups.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export type BookLanguageManualCommitmentGroups = {
|
|
|
16
16
|
*/
|
|
17
17
|
readonly documented: ReadonlyArray<BookLanguageManualCommitmentGroup>;
|
|
18
18
|
/**
|
|
19
|
-
* Low-level
|
|
19
|
+
* Low-level commitments documented in their own closing chapter.
|
|
20
20
|
*/
|
|
21
21
|
readonly lowLevel: ReadonlyArray<BookLanguageManualCommitmentGroup>;
|
|
22
22
|
};
|
|
@@ -10,10 +10,6 @@ export type RenderCommitmentCatalogSectionOptions = {
|
|
|
10
10
|
* Grouped commitment definition with aliases.
|
|
11
11
|
*/
|
|
12
12
|
readonly groupedCommitment: BookLanguageManualCommitmentGroup;
|
|
13
|
-
/**
|
|
14
|
-
* Number of uses across the selected server agents.
|
|
15
|
-
*/
|
|
16
|
-
readonly usageCount: number;
|
|
17
13
|
/**
|
|
18
14
|
* Translated labels of the manual.
|
|
19
15
|
*/
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { WindowLike as DomWindowLike } from 'dompurify';
|
|
2
|
+
/**
|
|
3
|
+
* Provides a DOM `window` for runtimes which do not have one, for example Node.js during server-side rendering
|
|
4
|
+
*
|
|
5
|
+
* Note: `$` is used to indicate that this function is not a pure function - it creates and caches one shared DOM window
|
|
6
|
+
*
|
|
7
|
+
* @returns DOM window which can back a DOM-dependent library like `DOMPurify`
|
|
8
|
+
* @throws {EnvironmentMismatchError} When the current runtime can not create a DOM window
|
|
9
|
+
* @private utility of `renderMarkdown`
|
|
10
|
+
*/
|
|
11
|
+
export declare function $provideServerDomWindow(): DomWindowLike;
|
|
@@ -25,6 +25,13 @@ export type MarkdownInlineReference = {
|
|
|
25
25
|
* Link target for the rendered reference.
|
|
26
26
|
*/
|
|
27
27
|
readonly href: string;
|
|
28
|
+
/**
|
|
29
|
+
* Markdown link destination prefixes that should render as this reference as well.
|
|
30
|
+
*
|
|
31
|
+
* This supports legacy links such as an Agents Server project file URL while keeping
|
|
32
|
+
* `reference` as the canonical `[[project]]` token.
|
|
33
|
+
*/
|
|
34
|
+
readonly sourceHrefPrefixes?: ReadonlyArray<string>;
|
|
28
35
|
/**
|
|
29
36
|
* Optional hover title for the rendered reference.
|
|
30
37
|
*/
|
|
@@ -18,6 +18,12 @@ export declare const PTBK_AGENTS_SERVER_BUILD_WORKER_COUNT_ENV = "PTBK_AGENTS_SE
|
|
|
18
18
|
* @private internal constant of `buildAgentsServer`
|
|
19
19
|
*/
|
|
20
20
|
export declare const PTBK_AGENTS_SERVER_IGNORE_NEXT_VALIDATION_ENV = "PTBK_AGENTS_SERVER_IGNORE_NEXT_VALIDATION";
|
|
21
|
+
/**
|
|
22
|
+
* Environment variable that disables throwaway webpack filesystem caches for CLI-owned production builds.
|
|
23
|
+
*
|
|
24
|
+
* @private internal constant of `buildAgentsServer`
|
|
25
|
+
*/
|
|
26
|
+
export declare const PTBK_AGENTS_SERVER_DISABLE_WEBPACK_FILESYSTEM_CACHE_ENV = "PTBK_AGENTS_SERVER_DISABLE_WEBPACK_FILESYSTEM_CACHE";
|
|
21
27
|
/**
|
|
22
28
|
* Adds dependency-resolution environment required by the materialized Agents Server runtime.
|
|
23
29
|
*
|
|
@@ -25,4 +31,5 @@ export declare const PTBK_AGENTS_SERVER_IGNORE_NEXT_VALIDATION_ENV = "PTBK_AGENT
|
|
|
25
31
|
*/
|
|
26
32
|
export declare function createAgentsServerRuntimeEnvironment(environment: NodeJS.ProcessEnv, nodeModulesPath: string, options?: {
|
|
27
33
|
readonly isNextValidationIgnored?: boolean;
|
|
34
|
+
readonly isWebpackFilesystemCacheDisabled?: boolean;
|
|
28
35
|
}): NodeJS.ProcessEnv;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { string_markdown } from '../../../types/typeAliases';
|
|
1
2
|
/**
|
|
2
3
|
* Relative path to the Promptbook Coder quick-reference file initialized in project roots.
|
|
3
4
|
*
|
|
@@ -9,6 +10,4 @@ export declare const AGENT_CODING_FILE_PATH = "AGENT_CODING.md";
|
|
|
9
10
|
*
|
|
10
11
|
* @private internal utility of `ptbk coder`
|
|
11
12
|
*/
|
|
12
|
-
export declare function getDefaultCoderAgentCodingFileContent(
|
|
13
|
-
readonly packageJsonScripts: Readonly<Record<string, string>>;
|
|
14
|
-
}): string;
|
|
13
|
+
export declare function getDefaultCoderAgentCodingFileContent(): string_markdown;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Command as Program } from 'commander';
|
|
2
|
+
import type { $side_effect } from '../../../utils/organization/$side_effect';
|
|
3
|
+
/**
|
|
4
|
+
* Initializes `coder ping` command for Promptbook CLI utilities
|
|
5
|
+
*
|
|
6
|
+
* Note: `$` is used to indicate that this function is not a pure function - it registers a command in the CLI
|
|
7
|
+
*
|
|
8
|
+
* @private internal function of `promptbookCli`
|
|
9
|
+
*/
|
|
10
|
+
export declare function $initializeCoderPingCommand(program: Program): $side_effect;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -9,6 +9,7 @@ import type { $side_effect } from '../../utils/organization/$side_effect';
|
|
|
9
9
|
* - generate-boilerplates: Generate prompt boilerplate files
|
|
10
10
|
* - find-refactor-candidates: Find files that need refactoring
|
|
11
11
|
* - run: Run coding prompts with AI agents
|
|
12
|
+
* - ping: Test one harness and model with a tiny dummy prompt
|
|
12
13
|
* - verify: Verify completed prompts
|
|
13
14
|
* - find-fresh-emoji-tags: Find unused emoji tags
|
|
14
15
|
*
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Command as Program } from 'commander';
|
|
2
|
+
import type { CoderGitSyncOptions } from '../../../../scripts/run-codex-prompts/git/coderGitSync';
|
|
3
|
+
export type { CoderGitSyncOptions };
|
|
4
|
+
/**
|
|
5
|
+
* Commander option bag for the shared `ptbk coder` git synchronization flags.
|
|
6
|
+
*
|
|
7
|
+
* @private internal utility of `promptbookCli`
|
|
8
|
+
*/
|
|
9
|
+
export type CoderGitSyncCliOptions = {
|
|
10
|
+
readonly commit: boolean;
|
|
11
|
+
readonly autoPush: boolean;
|
|
12
|
+
readonly autoPull: boolean;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Description block shared by the `ptbk coder` commands which can synchronize their changes with git.
|
|
16
|
+
*
|
|
17
|
+
* @private internal utility of `promptbookCli`
|
|
18
|
+
*/
|
|
19
|
+
export declare const CODER_GIT_SYNC_DESCRIPTION: string;
|
|
20
|
+
/**
|
|
21
|
+
* Registers the shared `--commit`, `--auto-push` and `--auto-pull` flags on a `ptbk coder` command.
|
|
22
|
+
*
|
|
23
|
+
* Note: Unlike `ptbk coder run`, which commits by default and opts out through `--no-commit`,
|
|
24
|
+
* these commands never touch git unless the flags are used explicitly.
|
|
25
|
+
*
|
|
26
|
+
* @private internal utility of `promptbookCli`
|
|
27
|
+
*/
|
|
28
|
+
export declare function addCoderGitSyncOptions(command: Program): void;
|
|
29
|
+
/**
|
|
30
|
+
* Converts the Commander git synchronization flags into normalized git synchronization options.
|
|
31
|
+
*
|
|
32
|
+
* @private internal utility of `promptbookCli`
|
|
33
|
+
*/
|
|
34
|
+
export declare function normalizeCoderGitSyncCliOptions(cliOptions: CoderGitSyncCliOptions): CoderGitSyncOptions;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="prompts" />
|
|
2
|
+
/**
|
|
3
|
+
* Loads the interactive terminal prompt library (`prompts`) on demand
|
|
4
|
+
*
|
|
5
|
+
* Note: [🐌] Loaded lazily to keep the startup of the `ptbk` CLI utility fast - most commands never ask the user
|
|
6
|
+
* anything interactively
|
|
7
|
+
*
|
|
8
|
+
* @private internal utility of Promptbook CLI
|
|
9
|
+
*/
|
|
10
|
+
export declare const loadPromptsModule: () => Promise<{
|
|
11
|
+
default: typeof import("prompts");
|
|
12
|
+
inject: typeof import("prompts").inject;
|
|
13
|
+
override: typeof import("prompts").override;
|
|
14
|
+
prompt: any;
|
|
15
|
+
prompts: typeof import("prompts").prompts;
|
|
16
|
+
}>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Anthropic from '@anthropic-ai/sdk';
|
|
1
|
+
import type Anthropic from '@anthropic-ai/sdk';
|
|
2
2
|
import type { ChatParticipant } from '../../book-components/Chat/types/ChatParticipant';
|
|
3
3
|
import type { AvailableModel } from '../../execution/AvailableModel';
|
|
4
4
|
import type { LlmExecutionTools } from '../../execution/LlmExecutionTools';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OpenAIClient } from '@azure/openai';
|
|
1
|
+
import type { OpenAIClient } from '@azure/openai';
|
|
2
2
|
import type { ChatParticipant } from '../../book-components/Chat/types/ChatParticipant';
|
|
3
3
|
import type { AvailableModel } from '../../execution/AvailableModel';
|
|
4
4
|
import type { LlmExecutionTools } from '../../execution/LlmExecutionTools';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Agent as AgentFromKit } from '@openai/agents';
|
|
1
|
+
import type { Agent as AgentFromKit } from '@openai/agents';
|
|
2
2
|
import type { CallChatModelStreamOptions, LlmExecutionTools } from '../../execution/LlmExecutionTools';
|
|
3
3
|
import type { ChatPromptResult } from '../../execution/PromptResult';
|
|
4
4
|
import type { ModelRequirements } from '../../types/ModelRequirements';
|
|
@@ -38,7 +38,7 @@ export declare class OpenAiAgentKitExecutionToolsToolBuilder {
|
|
|
38
38
|
buildAgentKitTools(options: {
|
|
39
39
|
readonly tools?: ModelRequirements['tools'];
|
|
40
40
|
readonly vectorStoreId?: string;
|
|
41
|
-
}): Array<AgentKitTool
|
|
41
|
+
}): Promise<Array<AgentKitTool>>;
|
|
42
42
|
/**
|
|
43
43
|
* Resolves the stored Promptbook tool result for one AgentKit tool call.
|
|
44
44
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import OpenAI from 'openai';
|
|
1
|
+
import type OpenAI from 'openai';
|
|
2
2
|
import type { ChatPromptResult } from '../../execution/PromptResult';
|
|
3
3
|
import type { Prompt } from '../../types/Prompt';
|
|
4
4
|
import type { string_date_iso8601, string_token } from '../../types/string_token';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import OpenAI from 'openai';
|
|
1
|
+
import type OpenAI from 'openai';
|
|
2
2
|
import type { ChatPromptResult } from '../../execution/PromptResult';
|
|
3
3
|
import type { ScriptExecutionTools } from '../../execution/ScriptExecutionTools';
|
|
4
4
|
import type { Prompt } from '../../types/Prompt';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import OpenAI from 'openai';
|
|
1
|
+
import type OpenAI from 'openai';
|
|
2
2
|
import type { AvailableModel } from '../../execution/AvailableModel';
|
|
3
3
|
import type { CompletionPromptResult, EmbeddingPromptResult, ImagePromptResult } from '../../execution/PromptResult';
|
|
4
4
|
import type { Usage } from '../../execution/Usage';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import OpenAI from 'openai';
|
|
1
|
+
import type OpenAI from 'openai';
|
|
2
2
|
import type { OpenAiCompatibleExecutionToolsNonProxiedOptions } from './OpenAiCompatibleExecutionToolsOptions';
|
|
3
3
|
/**
|
|
4
4
|
* Manages OpenAI-compatible client creation plus shared retry and rate-limit behavior.
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/**
|
|
3
|
+
* Loads the OpenAI AgentKit SDK (`@openai/agents`) on demand
|
|
4
|
+
*
|
|
5
|
+
* Note: [🐌] The AgentKit SDK is one of the heaviest dependencies of Promptbook, loading it eagerly would slow down
|
|
6
|
+
* every single run of the `ptbk` CLI utility even when no AgentKit agent is used
|
|
7
|
+
*
|
|
8
|
+
* @private internal utility of `@promptbook/openai`
|
|
9
|
+
*/
|
|
10
|
+
export declare const loadOpenAiAgentsModule: () => Promise<{
|
|
11
|
+
default: typeof import("@openai/agents");
|
|
12
|
+
applyPatchTool: typeof import("@openai/agents").applyPatchTool;
|
|
13
|
+
shellTool: typeof import("@openai/agents").shellTool;
|
|
14
|
+
realtime: typeof import("@openai/agents-realtime");
|
|
15
|
+
RuntimeEventEmitter: typeof import("events");
|
|
16
|
+
Agent: typeof import("@openai/agents").Agent;
|
|
17
|
+
AgentsError: typeof import("@openai/agents").AgentsError;
|
|
18
|
+
GuardrailExecutionError: typeof import("@openai/agents").GuardrailExecutionError;
|
|
19
|
+
InputGuardrailTripwireTriggered: typeof import("@openai/agents").InputGuardrailTripwireTriggered;
|
|
20
|
+
MaxTurnsExceededError: typeof import("@openai/agents").MaxTurnsExceededError;
|
|
21
|
+
ModelBehaviorError: typeof import("@openai/agents").ModelBehaviorError;
|
|
22
|
+
OutputGuardrailTripwireTriggered: typeof import("@openai/agents").OutputGuardrailTripwireTriggered;
|
|
23
|
+
ToolInputGuardrailTripwireTriggered: typeof import("@openai/agents").ToolInputGuardrailTripwireTriggered;
|
|
24
|
+
ToolOutputGuardrailTripwireTriggered: typeof import("@openai/agents").ToolOutputGuardrailTripwireTriggered;
|
|
25
|
+
ToolCallError: typeof import("@openai/agents").ToolCallError;
|
|
26
|
+
ToolTimeoutError: typeof import("@openai/agents").ToolTimeoutError;
|
|
27
|
+
UserError: typeof import("@openai/agents").UserError;
|
|
28
|
+
SystemError: typeof import("@openai/agents").SystemError;
|
|
29
|
+
RunAgentUpdatedStreamEvent: typeof import("@openai/agents").RunAgentUpdatedStreamEvent;
|
|
30
|
+
RunRawModelStreamEvent: typeof import("@openai/agents").RunRawModelStreamEvent;
|
|
31
|
+
RunItemStreamEvent: typeof import("@openai/agents").RunItemStreamEvent;
|
|
32
|
+
defineOutputGuardrail: typeof import("@openai/agents").defineOutputGuardrail;
|
|
33
|
+
ToolGuardrailFunctionOutputFactory: {
|
|
34
|
+
allow(outputInfo?: any): import("@openai/agents").ToolGuardrailFunctionOutput;
|
|
35
|
+
rejectContent(message: string, outputInfo?: any): import("@openai/agents").ToolGuardrailFunctionOutput;
|
|
36
|
+
throwException(outputInfo?: any): import("@openai/agents").ToolGuardrailFunctionOutput;
|
|
37
|
+
};
|
|
38
|
+
defineToolInputGuardrail: typeof import("@openai/agents").defineToolInputGuardrail;
|
|
39
|
+
defineToolOutputGuardrail: typeof import("@openai/agents").defineToolOutputGuardrail;
|
|
40
|
+
resolveToolInputGuardrails: typeof import("@openai/agents").resolveToolInputGuardrails;
|
|
41
|
+
resolveToolOutputGuardrails: typeof import("@openai/agents").resolveToolOutputGuardrails;
|
|
42
|
+
getHandoff: typeof import("@openai/agents").getHandoff;
|
|
43
|
+
getTransferMessage: typeof import("@openai/agents").getTransferMessage;
|
|
44
|
+
Handoff: typeof import("@openai/agents").Handoff;
|
|
45
|
+
handoff: typeof import("@openai/agents").handoff;
|
|
46
|
+
assistant: typeof import("@openai/agents").assistant;
|
|
47
|
+
system: typeof import("@openai/agents").system;
|
|
48
|
+
user: typeof import("@openai/agents").user;
|
|
49
|
+
extractAllTextOutput: typeof import("@openai/agents").extractAllTextOutput;
|
|
50
|
+
RunHandoffCallItem: typeof import("@openai/agents").RunHandoffCallItem;
|
|
51
|
+
RunHandoffOutputItem: typeof import("@openai/agents").RunHandoffOutputItem;
|
|
52
|
+
RunMessageOutputItem: typeof import("@openai/agents").RunMessageOutputItem;
|
|
53
|
+
RunReasoningItem: typeof import("@openai/agents").RunReasoningItem;
|
|
54
|
+
RunToolApprovalItem: typeof import("@openai/agents").RunToolApprovalItem;
|
|
55
|
+
RunToolCallItem: typeof import("@openai/agents").RunToolCallItem;
|
|
56
|
+
RunToolCallOutputItem: typeof import("@openai/agents").RunToolCallOutputItem;
|
|
57
|
+
AgentHooks: typeof import("@openai/agents").AgentHooks;
|
|
58
|
+
getLogger: typeof import("@openai/agents").getLogger;
|
|
59
|
+
applyDiff: typeof import("@openai/agents").applyDiff;
|
|
60
|
+
getAllMcpTools: typeof import("@openai/agents").getAllMcpTools;
|
|
61
|
+
invalidateServerToolsCache: typeof import("@openai/agents").invalidateServerToolsCache;
|
|
62
|
+
mcpToFunctionTool: typeof import("@openai/agents").mcpToFunctionTool;
|
|
63
|
+
MCPServerStdio: typeof import("@openai/agents").MCPServerStdio;
|
|
64
|
+
MCPServerStreamableHttp: typeof import("@openai/agents").MCPServerStreamableHttp;
|
|
65
|
+
MCPServerSSE: typeof import("@openai/agents").MCPServerSSE;
|
|
66
|
+
MCPServers: typeof import("@openai/agents").MCPServers;
|
|
67
|
+
connectMcpServers: typeof import("@openai/agents").connectMcpServers;
|
|
68
|
+
createMCPToolStaticFilter: typeof import("@openai/agents").createMCPToolStaticFilter;
|
|
69
|
+
OPENAI_DEFAULT_MODEL_ENV_VARIABLE_NAME: "OPENAI_DEFAULT_MODEL";
|
|
70
|
+
gpt5ReasoningSettingsRequired: typeof import("@openai/agents").gpt5ReasoningSettingsRequired;
|
|
71
|
+
getDefaultModel: typeof import("@openai/agents").getDefaultModel;
|
|
72
|
+
getDefaultModelSettings: typeof import("@openai/agents").getDefaultModelSettings;
|
|
73
|
+
isGpt5Default: typeof import("@openai/agents").isGpt5Default;
|
|
74
|
+
setDefaultModelProvider: typeof import("@openai/agents").setDefaultModelProvider;
|
|
75
|
+
RunResult: typeof import("@openai/agents").RunResult;
|
|
76
|
+
StreamedRunResult: typeof import("@openai/agents").StreamedRunResult;
|
|
77
|
+
run: typeof import("@openai/agents").run;
|
|
78
|
+
Runner: typeof import("@openai/agents").Runner;
|
|
79
|
+
RunContext: typeof import("@openai/agents").RunContext;
|
|
80
|
+
RunState: typeof import("@openai/agents").RunState;
|
|
81
|
+
computerTool: typeof import("@openai/agents").computerTool;
|
|
82
|
+
hostedMcpTool: typeof import("@openai/agents").hostedMcpTool;
|
|
83
|
+
tool: typeof import("@openai/agents").tool;
|
|
84
|
+
invokeFunctionTool: typeof import("@openai/agents").invokeFunctionTool;
|
|
85
|
+
getGlobalTraceProvider: typeof import("@openai/agents").getGlobalTraceProvider;
|
|
86
|
+
TraceProvider: typeof import("@openai/agents").TraceProvider;
|
|
87
|
+
runToolInputGuardrails: typeof import("@openai/agents").runToolInputGuardrails;
|
|
88
|
+
runToolOutputGuardrails: typeof import("@openai/agents").runToolOutputGuardrails;
|
|
89
|
+
RequestUsage: typeof import("@openai/agents").RequestUsage;
|
|
90
|
+
Usage: typeof import("@openai/agents").Usage;
|
|
91
|
+
isOpenAIResponsesCompactionAwareSession: typeof import("@openai/agents").isOpenAIResponsesCompactionAwareSession;
|
|
92
|
+
MemorySession: typeof import("@openai/agents").MemorySession;
|
|
93
|
+
protocol: typeof import("@openai/agents-core/dist/types/protocol");
|
|
94
|
+
addTraceProcessor(processor: import("@openai/agents").TracingProcessor): void;
|
|
95
|
+
setTraceProcessors(processors: import("@openai/agents").TracingProcessor[]): void;
|
|
96
|
+
setTracingDisabled(disabled: boolean): void;
|
|
97
|
+
startTraceExportLoop(): void;
|
|
98
|
+
getCurrentSpan: typeof import("@openai/agents").getCurrentSpan;
|
|
99
|
+
getCurrentTrace: typeof import("@openai/agents").getCurrentTrace;
|
|
100
|
+
getOrCreateTrace: typeof import("@openai/agents").getOrCreateTrace;
|
|
101
|
+
resetCurrentSpan: typeof import("@openai/agents").resetCurrentSpan;
|
|
102
|
+
setCurrentSpan: typeof import("@openai/agents").setCurrentSpan;
|
|
103
|
+
withTrace: typeof import("@openai/agents").withTrace;
|
|
104
|
+
BatchTraceProcessor: typeof import("@openai/agents").BatchTraceProcessor;
|
|
105
|
+
ConsoleSpanExporter: typeof import("@openai/agents").ConsoleSpanExporter;
|
|
106
|
+
NoopSpan: typeof import("@openai/agents").NoopSpan;
|
|
107
|
+
Span: typeof import("@openai/agents").Span;
|
|
108
|
+
NoopTrace: typeof import("@openai/agents").NoopTrace;
|
|
109
|
+
Trace: typeof import("@openai/agents").Trace;
|
|
110
|
+
generateGroupId: typeof import("@openai/agents").generateGroupId;
|
|
111
|
+
generateSpanId: typeof import("@openai/agents").generateSpanId;
|
|
112
|
+
generateTraceId: typeof import("@openai/agents").generateTraceId;
|
|
113
|
+
createResponseSpan(options?: import("@openai/agents-core/types").DeepPartial<import("@openai/agents-core/dist/tracing/provider").CreateSpanOptions<import("@openai/agents").ResponseSpanData>> | undefined, parent?: import("@openai/agents").Trace | import("@openai/agents").Span<any> | undefined): import("@openai/agents").Span<import("@openai/agents").ResponseSpanData>;
|
|
114
|
+
createAgentSpan(options?: import("@openai/agents-core/types").DeepPartial<import("@openai/agents-core/dist/tracing/provider").CreateSpanOptions<import("@openai/agents").AgentSpanData>> | undefined, parent?: import("@openai/agents").Trace | import("@openai/agents").Span<any> | undefined): import("@openai/agents").Span<import("@openai/agents").AgentSpanData>;
|
|
115
|
+
createFunctionSpan(options: import("@openai/agents-core/types").DeepPartial<import("@openai/agents-core/dist/tracing/provider").CreateSpanOptions<import("@openai/agents").FunctionSpanData>> & {
|
|
116
|
+
data: {
|
|
117
|
+
name: string;
|
|
118
|
+
};
|
|
119
|
+
}, parent?: import("@openai/agents").Trace | import("@openai/agents").Span<any> | undefined): import("@openai/agents").Span<import("@openai/agents").FunctionSpanData>;
|
|
120
|
+
createHandoffSpan(options?: import("@openai/agents-core/types").DeepPartial<import("@openai/agents-core/dist/tracing/provider").CreateSpanOptions<import("@openai/agents").HandoffSpanData>> | undefined, parent?: import("@openai/agents").Trace | import("@openai/agents").Span<any> | undefined): import("@openai/agents").Span<import("@openai/agents").HandoffSpanData>;
|
|
121
|
+
createGenerationSpan(options?: import("@openai/agents-core/types").DeepPartial<import("@openai/agents-core/dist/tracing/provider").CreateSpanOptions<import("@openai/agents").GenerationSpanData>> | undefined, parent?: import("@openai/agents").Trace | import("@openai/agents").Span<any> | undefined): import("@openai/agents").Span<import("@openai/agents").GenerationSpanData>;
|
|
122
|
+
createCustomSpan(options: import("@openai/agents-core/types").DeepPartial<import("@openai/agents-core/dist/tracing/provider").CreateSpanOptions<import("@openai/agents").CustomSpanData>> & {
|
|
123
|
+
data: {
|
|
124
|
+
name: string;
|
|
125
|
+
};
|
|
126
|
+
}, parent?: import("@openai/agents").Trace | import("@openai/agents").Span<any> | undefined): import("@openai/agents").Span<import("@openai/agents").CustomSpanData>;
|
|
127
|
+
createGuardrailSpan(options: import("@openai/agents-core/types").DeepPartial<import("@openai/agents-core/dist/tracing/provider").CreateSpanOptions<import("@openai/agents").GuardrailSpanData>> & {
|
|
128
|
+
data: {
|
|
129
|
+
name: string;
|
|
130
|
+
};
|
|
131
|
+
}, parent?: import("@openai/agents").Trace | import("@openai/agents").Span<any> | undefined): import("@openai/agents").Span<import("@openai/agents").GuardrailSpanData>;
|
|
132
|
+
createTranscriptionSpan(options: import("@openai/agents-core/types").DeepPartial<import("@openai/agents-core/dist/tracing/provider").CreateSpanOptions<import("@openai/agents").TranscriptionSpanData>> & {
|
|
133
|
+
data: {
|
|
134
|
+
input: {
|
|
135
|
+
data: string;
|
|
136
|
+
format: (string & {}) | "pcm";
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
}, parent?: import("@openai/agents").Trace | import("@openai/agents").Span<any> | undefined): import("@openai/agents").Span<import("@openai/agents").TranscriptionSpanData>;
|
|
140
|
+
createSpeechSpan(options: import("@openai/agents-core/types").DeepPartial<import("@openai/agents-core/dist/tracing/provider").CreateSpanOptions<import("@openai/agents").SpeechSpanData>> & {
|
|
141
|
+
data: {
|
|
142
|
+
output: {
|
|
143
|
+
data: string;
|
|
144
|
+
format: (string & {}) | "pcm";
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
}, parent?: import("@openai/agents").Trace | import("@openai/agents").Span<any> | undefined): import("@openai/agents").Span<import("@openai/agents").SpeechSpanData>;
|
|
148
|
+
createSpeechGroupSpan(options?: import("@openai/agents-core/types").DeepPartial<import("@openai/agents-core/dist/tracing/provider").CreateSpanOptions<import("@openai/agents").SpeechGroupSpanData>> | undefined, parent?: import("@openai/agents").Trace | import("@openai/agents").Span<any> | undefined): import("@openai/agents").Span<import("@openai/agents").SpeechGroupSpanData>;
|
|
149
|
+
createMCPListToolsSpan(options?: import("@openai/agents-core/types").DeepPartial<import("@openai/agents-core/dist/tracing/provider").CreateSpanOptions<import("@openai/agents").MCPListToolsSpanData>> | undefined, parent?: import("@openai/agents").Trace | import("@openai/agents").Span<any> | undefined): import("@openai/agents").Span<import("@openai/agents").MCPListToolsSpanData>;
|
|
150
|
+
withResponseSpan: <TOutput>(fn: (span: import("@openai/agents").Span<import("@openai/agents").ResponseSpanData>) => Promise<TOutput>, options?: import("@openai/agents-core/types").DeepPartial<import("@openai/agents-core/dist/tracing/provider").CreateSpanOptions<import("@openai/agents").ResponseSpanData>> | undefined, parent?: import("@openai/agents").Trace | import("@openai/agents").Span<any> | undefined) => Promise<TOutput>;
|
|
151
|
+
withAgentSpan: <TOutput_1>(fn: (span: import("@openai/agents").Span<import("@openai/agents").AgentSpanData>) => Promise<TOutput_1>, options?: import("@openai/agents-core/types").DeepPartial<import("@openai/agents-core/dist/tracing/provider").CreateSpanOptions<import("@openai/agents").AgentSpanData>> | undefined, parent?: import("@openai/agents").Trace | import("@openai/agents").Span<any> | undefined) => Promise<TOutput_1>;
|
|
152
|
+
withFunctionSpan: <TOutput_2>(fn: (span: import("@openai/agents").Span<import("@openai/agents").FunctionSpanData>) => Promise<TOutput_2>, options: import("@openai/agents-core/types").DeepPartial<import("@openai/agents-core/dist/tracing/provider").CreateSpanOptions<import("@openai/agents").FunctionSpanData>> & {
|
|
153
|
+
data: {
|
|
154
|
+
name: string;
|
|
155
|
+
};
|
|
156
|
+
}, parent?: import("@openai/agents").Trace | import("@openai/agents").Span<any> | undefined) => Promise<TOutput_2>;
|
|
157
|
+
withHandoffSpan: <TOutput_3>(fn: (span: import("@openai/agents").Span<import("@openai/agents").HandoffSpanData>) => Promise<TOutput_3>, options?: import("@openai/agents-core/types").DeepPartial<import("@openai/agents-core/dist/tracing/provider").CreateSpanOptions<import("@openai/agents").HandoffSpanData>> | undefined, parent?: import("@openai/agents").Trace | import("@openai/agents").Span<any> | undefined) => Promise<TOutput_3>;
|
|
158
|
+
withGenerationSpan: <TOutput_4>(fn: (span: import("@openai/agents").Span<import("@openai/agents").GenerationSpanData>) => Promise<TOutput_4>, options?: import("@openai/agents-core/types").DeepPartial<import("@openai/agents-core/dist/tracing/provider").CreateSpanOptions<import("@openai/agents").GenerationSpanData>> | undefined, parent?: import("@openai/agents").Trace | import("@openai/agents").Span<any> | undefined) => Promise<TOutput_4>;
|
|
159
|
+
withCustomSpan: <TOutput_5>(fn: (span: import("@openai/agents").Span<import("@openai/agents").CustomSpanData>) => Promise<TOutput_5>, options: import("@openai/agents-core/types").DeepPartial<import("@openai/agents-core/dist/tracing/provider").CreateSpanOptions<import("@openai/agents").CustomSpanData>> & {
|
|
160
|
+
data: {
|
|
161
|
+
name: string;
|
|
162
|
+
};
|
|
163
|
+
}, parent?: import("@openai/agents").Trace | import("@openai/agents").Span<any> | undefined) => Promise<TOutput_5>;
|
|
164
|
+
withGuardrailSpan: <TOutput_6>(fn: (span: import("@openai/agents").Span<import("@openai/agents").GuardrailSpanData>) => Promise<TOutput_6>, options: import("@openai/agents-core/types").DeepPartial<import("@openai/agents-core/dist/tracing/provider").CreateSpanOptions<import("@openai/agents").GuardrailSpanData>> & {
|
|
165
|
+
data: {
|
|
166
|
+
name: string;
|
|
167
|
+
};
|
|
168
|
+
}, parent?: import("@openai/agents").Trace | import("@openai/agents").Span<any> | undefined) => Promise<TOutput_6>;
|
|
169
|
+
withTranscriptionSpan: <TOutput_7>(fn: (span: import("@openai/agents").Span<import("@openai/agents").TranscriptionSpanData>) => Promise<TOutput_7>, options: import("@openai/agents-core/types").DeepPartial<import("@openai/agents-core/dist/tracing/provider").CreateSpanOptions<import("@openai/agents").TranscriptionSpanData>> & {
|
|
170
|
+
data: {
|
|
171
|
+
input: {
|
|
172
|
+
data: string;
|
|
173
|
+
format: (string & {}) | "pcm";
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
}, parent?: import("@openai/agents").Trace | import("@openai/agents").Span<any> | undefined) => Promise<TOutput_7>;
|
|
177
|
+
withSpeechSpan: <TOutput_8>(fn: (span: import("@openai/agents").Span<import("@openai/agents").SpeechSpanData>) => Promise<TOutput_8>, options: import("@openai/agents-core/types").DeepPartial<import("@openai/agents-core/dist/tracing/provider").CreateSpanOptions<import("@openai/agents").SpeechSpanData>> & {
|
|
178
|
+
data: {
|
|
179
|
+
output: {
|
|
180
|
+
data: string;
|
|
181
|
+
format: (string & {}) | "pcm";
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
}, parent?: import("@openai/agents").Trace | import("@openai/agents").Span<any> | undefined) => Promise<TOutput_8>;
|
|
185
|
+
withSpeechGroupSpan: <TOutput_9>(fn: (span: import("@openai/agents").Span<import("@openai/agents").SpeechGroupSpanData>) => Promise<TOutput_9>, options?: import("@openai/agents-core/types").DeepPartial<import("@openai/agents-core/dist/tracing/provider").CreateSpanOptions<import("@openai/agents").SpeechGroupSpanData>> | undefined, parent?: import("@openai/agents").Trace | import("@openai/agents").Span<any> | undefined) => Promise<TOutput_9>;
|
|
186
|
+
withMCPListToolsSpan: <TOutput_10>(fn: (span: import("@openai/agents").Span<import("@openai/agents").MCPListToolsSpanData>) => Promise<TOutput_10>, options?: import("@openai/agents-core/types").DeepPartial<import("@openai/agents-core/dist/tracing/provider").CreateSpanOptions<import("@openai/agents").MCPListToolsSpanData>> | undefined, parent?: import("@openai/agents").Trace | import("@openai/agents").Span<any> | undefined) => Promise<TOutput_10>;
|
|
187
|
+
OpenAIProvider: typeof import("@openai/agents").OpenAIProvider;
|
|
188
|
+
OpenAIResponsesModel: typeof import("@openai/agents").OpenAIResponsesModel;
|
|
189
|
+
OpenAIChatCompletionsModel: typeof import("@openai/agents").OpenAIChatCompletionsModel;
|
|
190
|
+
setDefaultOpenAIClient: typeof import("@openai/agents").setDefaultOpenAIClient;
|
|
191
|
+
setOpenAIAPI: typeof import("@openai/agents").setOpenAIAPI;
|
|
192
|
+
setDefaultOpenAIKey: typeof import("@openai/agents").setDefaultOpenAIKey;
|
|
193
|
+
setTracingExportApiKey: typeof import("@openai/agents").setTracingExportApiKey;
|
|
194
|
+
setDefaultOpenAITracingExporter: typeof import("@openai/agents").setDefaultOpenAITracingExporter;
|
|
195
|
+
OpenAITracingExporter: typeof import("@openai/agents").OpenAITracingExporter;
|
|
196
|
+
webSearchTool: typeof import("@openai/agents").webSearchTool;
|
|
197
|
+
fileSearchTool: typeof import("@openai/agents").fileSearchTool;
|
|
198
|
+
codeInterpreterTool: typeof import("@openai/agents").codeInterpreterTool;
|
|
199
|
+
imageGenerationTool: typeof import("@openai/agents").imageGenerationTool;
|
|
200
|
+
OpenAIConversationsSession: typeof import("@openai/agents").OpenAIConversationsSession;
|
|
201
|
+
startOpenAIConversationsSession: typeof import("@openai/agents").startOpenAIConversationsSession;
|
|
202
|
+
OpenAIResponsesCompactionSession: typeof import("@openai/agents").OpenAIResponsesCompactionSession;
|
|
203
|
+
}>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a loader which imports one module on the first call and reuses the very same module afterwards
|
|
3
|
+
*
|
|
4
|
+
* Note: [🐌] Heavy third-party dependencies are imported lazily to keep the startup of the Promptbook CLI fast.
|
|
5
|
+
* A statically imported dependency is loaded every single time the bundle is loaded, even when the running
|
|
6
|
+
* command never touches it. A lazily imported dependency is loaded only when the feature is really used.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* const loadJsdomModule = createLazyModuleLoader(() => import('jsdom'));
|
|
10
|
+
* const { JSDOM } = await loadJsdomModule();
|
|
11
|
+
*
|
|
12
|
+
* @private internal utility of Promptbook
|
|
13
|
+
*/
|
|
14
|
+
export declare function createLazyModuleLoader<TModule>(importModule: () => Promise<TModule>): () => Promise<TModule>;
|
package/umd/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.
|
|
18
|
+
* It follows semantic versioning (e.g., `0.114.0-2`).
|
|
19
19
|
*
|
|
20
20
|
* @generated
|
|
21
21
|
*/
|