@promptbook/cli 0.114.0-2 → 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/apps/agents-server/next.config.ts +11 -0
- package/apps/agents-server/src/app/layout.tsx +6 -0
- package/esm/index.es.js +677 -199
- package/esm/index.es.js.map +1 -1
- package/esm/scripts/run-codex-prompts/common/runGoScript/scriptExecutionLog.d.ts +7 -0
- package/esm/scripts/run-codex-prompts/git/coderGitSync.d.ts +43 -0
- package/esm/scripts/run-codex-prompts/git/commitChanges.d.ts +3 -0
- package/esm/scripts/run-codex-prompts/main/resolvePromptRunner.d.ts +8 -1
- package/esm/scripts/run-codex-prompts/ping/buildCoderPingPrompt.d.ts +20 -0
- package/esm/scripts/run-codex-prompts/ping/extractCoderPingAnswer.d.ts +9 -0
- package/esm/scripts/run-codex-prompts/ping/pingCoderHarness.d.ts +23 -0
- package/esm/scripts/run-codex-prompts/ping/printCoderPingResult.d.ts +5 -0
- package/esm/scripts/verify-prompts/verify-prompts.d.ts +5 -0
- package/esm/src/book-components/Chat/utils/$provideServerDomWindow.d.ts +11 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/createAgentsServerRuntimeEnvironment.d.ts +7 -0
- package/esm/src/cli/cli-commands/coder/ping.d.ts +2 -5
- package/esm/src/cli/cli-commands/coder.d.ts +1 -1
- 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/src/book-3.0/LiteAgent.ts +11 -9
- package/src/book-components/Chat/utils/$provideServerDomWindow.ts +77 -0
- package/src/book-components/Chat/utils/renderMarkdown.ts +2 -23
- package/src/cli/cli-commands/agents-server/buildAgentsServer/createAgentsServerRuntimeEnvironment.ts +14 -0
- package/src/cli/cli-commands/agents-server/buildAgentsServer/ensureAgentsServerBuild.ts +1 -0
- package/src/cli/cli-commands/coder/add.ts +40 -12
- package/src/cli/cli-commands/coder/generate-boilerplates.ts +31 -5
- package/src/cli/cli-commands/coder/init.ts +27 -1
- package/src/cli/cli-commands/coder/ping.ts +23 -45
- package/src/cli/cli-commands/coder/verify.ts +27 -12
- package/src/cli/cli-commands/coder.ts +3 -3
- package/src/cli/cli-commands/common/coderGitSyncCliOptions.ts +78 -0
- package/src/cli/cli-commands/run/prepareRunCommandResources.ts +2 -1
- package/src/cli/cli-commands/run/resolveRunInputParameters.ts +2 -1
- package/src/cli/cli-commands/runInteractiveChatbot.ts +2 -1
- package/src/cli/common/$provideLlmToolsForCli.ts +2 -1
- package/src/cli/common/loadPromptsModule.ts +13 -0
- package/src/conversion/archive/loadArchive.ts +2 -1
- package/src/conversion/archive/loadJsZipModule.ts +10 -0
- package/src/conversion/archive/saveArchive.ts +2 -1
- package/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.ts +13 -1
- package/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.ts +13 -1
- package/src/llm-providers/openai/OpenAiAgentKitExecutionTools.ts +6 -2
- package/src/llm-providers/openai/OpenAiAgentKitExecutionToolsToolBuilder.ts +7 -5
- package/src/llm-providers/openai/OpenAiAssistantExecutionTools.ts +1 -1
- package/src/llm-providers/openai/OpenAiAssistantExecutionToolsStreamRunner.ts +1 -1
- package/src/llm-providers/openai/OpenAiAssistantExecutionToolsToolRunner.ts +1 -1
- package/src/llm-providers/openai/OpenAiCompatibleNonChatPromptCaller.ts +1 -1
- package/src/llm-providers/openai/OpenAiCompatibleRequestManager.ts +12 -1
- package/src/llm-providers/openai/utils/callOpenAiCompatibleChatModel.ts +1 -1
- package/src/llm-providers/openai/utils/loadOpenAiAgentsModule.ts +11 -0
- package/src/llm-providers/openai/utils/uploadFilesToOpenAi.ts +1 -1
- package/src/other/templates/getTemplatesPipelineCollection.ts +678 -967
- package/src/remote-server/createRemoteClient.ts +12 -1
- package/src/scrapers/website/WebsiteScraper.ts +22 -2
- package/src/utils/misc/createLazyModuleLoader.ts +27 -0
- package/src/version.ts +2 -2
- package/src/versions.txt +1 -0
- package/umd/index.umd.js +750 -266
- package/umd/index.umd.js.map +1 -1
- package/umd/scripts/run-codex-prompts/common/runGoScript/scriptExecutionLog.d.ts +7 -0
- package/umd/scripts/run-codex-prompts/git/coderGitSync.d.ts +43 -0
- package/umd/scripts/run-codex-prompts/git/commitChanges.d.ts +3 -0
- package/umd/scripts/run-codex-prompts/main/resolvePromptRunner.d.ts +8 -1
- package/umd/scripts/run-codex-prompts/ping/buildCoderPingPrompt.d.ts +20 -0
- package/umd/scripts/run-codex-prompts/ping/extractCoderPingAnswer.d.ts +9 -0
- package/umd/scripts/run-codex-prompts/ping/pingCoderHarness.d.ts +23 -0
- package/umd/scripts/run-codex-prompts/ping/printCoderPingResult.d.ts +5 -0
- package/umd/scripts/verify-prompts/verify-prompts.d.ts +5 -0
- package/umd/src/book-components/Chat/utils/$provideServerDomWindow.d.ts +11 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/createAgentsServerRuntimeEnvironment.d.ts +7 -0
- package/umd/src/cli/cli-commands/coder/ping.d.ts +2 -5
- package/umd/src/cli/cli-commands/coder.d.ts +1 -1
- 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/esm/scripts/run-agent-chat/runCoderPing.d.ts +0 -48
- package/umd/scripts/run-agent-chat/runCoderPing.d.ts +0 -48
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
* Environment variable read by the shell wrapper to tee live output into the temporary runtime log file.
|
|
3
3
|
*/
|
|
4
4
|
export declare const PTBK_CODER_LOG_FILE_ENV_NAME = "PTBK_CODER_LOG_FILE";
|
|
5
|
+
/**
|
|
6
|
+
* Log line which separates the raw script input from the raw script output of one execution section.
|
|
7
|
+
*
|
|
8
|
+
* Readers of a runtime log split on this marker to look only at what the harness really produced,
|
|
9
|
+
* without the generated script and the prompt it embeds.
|
|
10
|
+
*/
|
|
11
|
+
export declare const SCRIPT_EXECUTION_LOG_RAW_OUTPUT_MARKER = "--- raw output ---";
|
|
5
12
|
/**
|
|
6
13
|
* Shapes one bash invocation that optionally mirrors live script output into a temporary log file.
|
|
7
14
|
*/
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Automatic git synchronization of the project changes made by one `ptbk coder` command.
|
|
3
|
+
*
|
|
4
|
+
* Note: This is the single place where pulling, committing and pushing of `ptbk coder` project changes is
|
|
5
|
+
* implemented, every command which offers `--commit`, `--auto-push` and `--auto-pull` reuses it.
|
|
6
|
+
*/
|
|
7
|
+
export type CoderGitSyncOptions = {
|
|
8
|
+
/**
|
|
9
|
+
* Commit the changes made by the command.
|
|
10
|
+
*/
|
|
11
|
+
readonly isCommitEnabled: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Push the created commit to the remote repository.
|
|
14
|
+
*/
|
|
15
|
+
readonly isAutoPushEnabled: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Pull the latest changes from the remote repository before the command changes anything.
|
|
18
|
+
*/
|
|
19
|
+
readonly isAutoPullEnabled: boolean;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Git synchronization which leaves the repository completely untouched.
|
|
23
|
+
*
|
|
24
|
+
* Note: This is the default for every command and helper which supports the git synchronization.
|
|
25
|
+
*/
|
|
26
|
+
export declare const DISABLED_CODER_GIT_SYNC_OPTIONS: CoderGitSyncOptions;
|
|
27
|
+
/**
|
|
28
|
+
* Pulls the latest repository changes before a `ptbk coder` command changes the project.
|
|
29
|
+
*/
|
|
30
|
+
export declare function $pullCoderChanges(options: {
|
|
31
|
+
readonly gitSync: CoderGitSyncOptions;
|
|
32
|
+
readonly projectPath?: string;
|
|
33
|
+
}): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Commits - and when requested also pushes - the changes one `ptbk coder` command has just made.
|
|
36
|
+
*
|
|
37
|
+
* Note: A repository without any change is left alone instead of creating an empty commit.
|
|
38
|
+
*/
|
|
39
|
+
export declare function $commitCoderChanges(options: {
|
|
40
|
+
readonly gitSync: CoderGitSyncOptions;
|
|
41
|
+
readonly commitMessage: string;
|
|
42
|
+
readonly projectPath?: string;
|
|
43
|
+
}): Promise<void>;
|
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
* `options.includePaths` can restrict staging, `options.onlyPaths` can restrict the commit pathspec,
|
|
5
5
|
* `options.excludePaths` can keep temporary artifacts out of the created commit and
|
|
6
6
|
* `options.isEmptyCommitAllowed` keeps a round without any file change from failing.
|
|
7
|
+
*
|
|
8
|
+
* Note: The temporary commit message file is written inside the project, so it is always excluded from the commit
|
|
9
|
+
* itself for projects which do not keep the Promptbook temporary directory out of version control.
|
|
7
10
|
*/
|
|
8
11
|
export declare function commitChanges(message: string, options?: {
|
|
9
12
|
autoPush?: boolean;
|
|
@@ -7,6 +7,13 @@ type RunnerMetadata = {
|
|
|
7
7
|
runnerName: string;
|
|
8
8
|
modelName?: string;
|
|
9
9
|
};
|
|
10
|
+
/**
|
|
11
|
+
* Subset of `RunOptions` which decides which prompt runner is created and how it is labeled.
|
|
12
|
+
*
|
|
13
|
+
* Commands that only need one configured harness — such as `ptbk coder ping` — pass just these
|
|
14
|
+
* fields instead of assembling a complete `RunOptions` for a run they never start.
|
|
15
|
+
*/
|
|
16
|
+
export type PromptRunnerSelectionOptions = Pick<RunOptions, 'agentName' | 'model' | 'thinkingLevel' | 'allowCredits' | 'isVerbose' | 'isMachineReadableProgressEnabled'>;
|
|
10
17
|
/**
|
|
11
18
|
* Resolved runner setup used by `runCodexPrompts`.
|
|
12
19
|
*/
|
|
@@ -20,5 +27,5 @@ type PromptRunnerResolution = {
|
|
|
20
27
|
*
|
|
21
28
|
* @private function of runCodexPrompts
|
|
22
29
|
*/
|
|
23
|
-
export declare function resolvePromptRunner(options:
|
|
30
|
+
export declare function resolvePromptRunner(options: PromptRunnerSelectionOptions): PromptRunnerResolution;
|
|
24
31
|
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Marker the pinged harness is asked to prefix its answer with, so the reply can be recognized
|
|
3
|
+
* in the raw runner output of every supported harness.
|
|
4
|
+
*
|
|
5
|
+
* Note: The marker must stay free of regular-expression metacharacters, because
|
|
6
|
+
* `extractCoderPingAnswer` builds its pattern from it.
|
|
7
|
+
*/
|
|
8
|
+
export declare const CODER_PING_ANSWER_MARKER = "PTBK-CODER-PING-ANSWER";
|
|
9
|
+
/**
|
|
10
|
+
* Answer a working harness and model returns for the dummy work of `ptbk coder ping`.
|
|
11
|
+
*/
|
|
12
|
+
export declare const CODER_PING_EXPECTED_ANSWER: string;
|
|
13
|
+
/**
|
|
14
|
+
* Builds the dummy prompt sent by `ptbk coder ping`.
|
|
15
|
+
*
|
|
16
|
+
* The work is intentionally the smallest possible one that still reaches the model: it spends a
|
|
17
|
+
* negligible amount of the harness quota, it needs no tool and it explicitly forbids touching the
|
|
18
|
+
* project, so a ping leaves the project exactly as it was.
|
|
19
|
+
*/
|
|
20
|
+
export declare function buildCoderPingPrompt(): string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extracts the answer of a pinged harness from the runtime log of its runner shell.
|
|
3
|
+
*
|
|
4
|
+
* Only the raw output of the last execution is searched, so the answer marker contained in the
|
|
5
|
+
* prompt of the raw input is never mistaken for the answer of the harness.
|
|
6
|
+
*
|
|
7
|
+
* @returns The answer of the harness, or `null` when the harness produced no recognizable answer
|
|
8
|
+
*/
|
|
9
|
+
export declare function extractCoderPingAnswer(runtimeLog: string): string | null;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { PromptRunnerSelectionOptions } from '../main/resolvePromptRunner';
|
|
2
|
+
import type { CoderPingResult } from './CoderPingResult';
|
|
3
|
+
/**
|
|
4
|
+
* Options for one `ptbk coder ping` round trip.
|
|
5
|
+
*/
|
|
6
|
+
export type PingCoderHarnessOptions = PromptRunnerSelectionOptions & {
|
|
7
|
+
/**
|
|
8
|
+
* Project the harness is started in. Defaults to the current working directory.
|
|
9
|
+
*/
|
|
10
|
+
readonly projectPath?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Mirrors the live harness output to the terminal instead of only reporting the compact result.
|
|
13
|
+
*/
|
|
14
|
+
readonly shouldPrintLiveOutput?: boolean;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Sends one tiny dummy prompt through the selected harness and model and measures the round trip.
|
|
18
|
+
*
|
|
19
|
+
* The ping reuses the very same runner the coding queue uses, so it really exercises the configured
|
|
20
|
+
* harness, model, thinking level and authentication — including the retry behavior on rate limits.
|
|
21
|
+
* Both temporary artifacts it creates are removed again, so the project is left as it was.
|
|
22
|
+
*/
|
|
23
|
+
export declare function pingCoderHarness(options: PingCoderHarnessOptions): Promise<CoderPingResult>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CoderGitSyncOptions } from '../run-codex-prompts/git/coderGitSync';
|
|
1
2
|
import type { PromptFile } from '../run-codex-prompts/prompts/types/PromptFile';
|
|
2
3
|
/**
|
|
3
4
|
* Options supported by the prompt verification helper.
|
|
@@ -11,6 +12,10 @@ export type VerifyPromptsOptions = {
|
|
|
11
12
|
* Ignore prompt files whose filename or first prompt line contains one of the provided values.
|
|
12
13
|
*/
|
|
13
14
|
readonly ignore?: ReadonlyArray<string>;
|
|
15
|
+
/**
|
|
16
|
+
* Automatic git synchronization applied around each single verification.
|
|
17
|
+
*/
|
|
18
|
+
readonly gitSync?: CoderGitSyncOptions;
|
|
14
19
|
};
|
|
15
20
|
/**
|
|
16
21
|
* Starts the verification loop and exits when no `[ ]` prompts remain.
|
|
@@ -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;
|
|
@@ -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,12 +1,9 @@
|
|
|
1
1
|
import type { Command as Program } from 'commander';
|
|
2
2
|
import type { $side_effect } from '../../../utils/organization/$side_effect';
|
|
3
3
|
/**
|
|
4
|
-
* Initializes `coder ping` command for Promptbook CLI utilities
|
|
4
|
+
* Initializes `coder ping` command for Promptbook CLI utilities
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
* and reports how long the harness/model turn took.
|
|
8
|
-
*
|
|
9
|
-
* Note: `$` is used to indicate that this function is not a pure function - it registers a command in the CLI.
|
|
6
|
+
* Note: `$` is used to indicate that this function is not a pure function - it registers a command in the CLI
|
|
10
7
|
*
|
|
11
8
|
* @private internal function of `promptbookCli`
|
|
12
9
|
*/
|
|
@@ -8,8 +8,8 @@ import type { $side_effect } from '../../utils/organization/$side_effect';
|
|
|
8
8
|
* - add: Add one ready-to-run prompt file to the queue
|
|
9
9
|
* - generate-boilerplates: Generate prompt boilerplate files
|
|
10
10
|
* - find-refactor-candidates: Find files that need refactoring
|
|
11
|
-
* - ping: Test one harness and model connection with a disposable task
|
|
12
11
|
* - run: Run coding prompts with AI agents
|
|
12
|
+
* - ping: Test one harness and model with a tiny dummy prompt
|
|
13
13
|
* - verify: Verify completed prompts
|
|
14
14
|
* - find-fresh-emoji-tags: Find unused emoji tags
|
|
15
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