@promptbook/cli 0.114.0-33 → 0.114.0-34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/esm/index.es.js +1254 -318
  2. package/esm/index.es.js.map +1 -1
  3. package/esm/scripts/run-codex-prompts/common/createFreeDiskSpaceGuard.d.ts +25 -0
  4. package/esm/scripts/run-codex-prompts/common/formatUnknownErrorDetails.d.ts +4 -0
  5. package/esm/scripts/run-codex-prompts/common/resolveCoderAgent.d.ts +21 -3
  6. package/esm/scripts/run-codex-prompts/main/listCoderPrompts.d.ts +1 -1
  7. package/esm/scripts/run-codex-prompts/prompts/buildPromptRunTraceContent.d.ts +77 -0
  8. package/esm/scripts/run-codex-prompts/prompts/buildPromptRunTracePath.d.ts +10 -0
  9. package/esm/scripts/run-codex-prompts/prompts/isPromptCompatibleWithRunner.d.ts +11 -6
  10. package/esm/scripts/run-codex-prompts/prompts/loadPromptFiles.d.ts +1 -1
  11. package/esm/scripts/run-codex-prompts/prompts/writePromptRunTrace.d.ts +19 -0
  12. package/esm/scripts/run-codex-prompts/runners/common/buildHarnessAuthenticationError.d.ts +20 -0
  13. package/esm/scripts/run-codex-prompts/runners/common/createAuthenticationAwarePromptRunner.d.ts +11 -0
  14. package/esm/scripts/run-codex-prompts/runners/common/extractHarnessAuthenticationFailureReason.d.ts +9 -0
  15. package/esm/scripts/run-codex-prompts/ui/buildCoderRunUiFrame.d.ts +3 -0
  16. package/esm/src/book-2.0/book-language-documentation/getSafeCodeBlock.d.ts +1 -1
  17. package/esm/src/book-components/Chat/MockedChat/MockedChat.test.d.ts +2 -0
  18. package/esm/src/cli/cli-commands/coder/$ensureCoderHarnessGitignoreRules.d.ts +2 -1
  19. package/esm/src/cli/cli-commands/coder/agentCliOptions.d.ts +21 -0
  20. package/esm/src/cli/cli-commands/coder/boilerplateTemplates.d.ts +8 -21
  21. package/esm/src/cli/cli-commands/coder/coderReferencedArtifacts.d.ts +33 -0
  22. package/esm/src/cli/cli-commands/coder/ensureCoderPackageJsonFile.d.ts +4 -2
  23. package/esm/src/cli/cli-commands/coder/ensureCoderVscodeSettingsFile.d.ts +2 -0
  24. package/esm/src/cli/cli-commands/coder/ensureDirectory.d.ts +6 -0
  25. package/esm/src/cli/cli-commands/coder/getDefaultCoderPackageJsonScripts.d.ts +6 -0
  26. package/esm/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.d.ts +7 -5
  27. package/esm/src/cli/cli-commands/coder/mergeStringRecordJsonFile.d.ts +19 -1
  28. package/esm/src/cli/cli-commands/coder/printCoderRunFailure.d.ts +6 -0
  29. package/esm/src/cli/cli-commands/common/$askForConfirmation.d.ts +4 -2
  30. package/esm/src/cli/cli-commands/common/disk-space/$assertSufficientFreeDiskSpace.d.ts +12 -0
  31. package/esm/src/cli/cli-commands/common/disk-space/$assertSufficientFreeDiskSpace.test.d.ts +1 -0
  32. package/esm/src/cli/cli-commands/common/disk-space/$readFreeDiskSpaceStatus.d.ts +11 -0
  33. package/esm/src/cli/cli-commands/common/disk-space/$readFreeDiskSpaceStatus.test.d.ts +1 -0
  34. package/esm/src/cli/cli-commands/common/disk-space/FreeDiskSpaceStatus.d.ts +33 -0
  35. package/esm/src/cli/cli-commands/common/disk-space/formatFreeDiskSpaceBytes.d.ts +6 -0
  36. package/esm/src/cli/cli-commands/common/disk-space/formatFreeDiskSpaceBytes.test.d.ts +1 -0
  37. package/esm/src/cli/cli-commands/common/disk-space/formatLowFreeDiskSpaceWarning.d.ts +10 -0
  38. package/esm/src/cli/cli-commands/common/disk-space/freeDiskSpaceConstants.d.ts +28 -0
  39. package/esm/src/cli/cli-commands/common/disk-space/resolveFreeDiskSpaceLevel.d.ts +7 -0
  40. package/esm/src/cli/cli-commands/common/disk-space/resolveFreeDiskSpaceLevel.test.d.ts +1 -0
  41. package/esm/src/cli/cli-commands/common/harness/$applyHarnessInstallationStatus.d.ts +2 -1
  42. package/esm/src/cli/cli-commands/common/harness/$ensureHarnessInstallations.d.ts +3 -2
  43. package/esm/src/cli/cli-commands/common/harness/HarnessDefinition.d.ts +26 -0
  44. package/esm/src/cli/cli-commands/common/npm/$askForNpmPackageInstallationApproval.d.ts +4 -2
  45. package/esm/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.d.ts +2 -1
  46. package/esm/src/cli/cli-commands/common/questionsCliOptions.d.ts +45 -0
  47. package/esm/src/cli/cli-commands/common/questionsCliOptions.test.d.ts +1 -0
  48. package/esm/src/cli/common/$deprecateCliCommand.d.ts +3 -0
  49. package/esm/src/cli/common/$hideCliCommandFromHelp.d.ts +11 -0
  50. package/esm/src/cli/common/$hideCliCommandFromHelp.test.d.ts +1 -0
  51. package/esm/src/cli/common/$requireCliSubcommand.d.ts +18 -0
  52. package/esm/src/cli/common/$requireCliSubcommand.test.d.ts +1 -0
  53. package/esm/src/llm-providers/vercel/VercelExecutionToolsOptions.d.ts +5 -2
  54. package/esm/src/version.d.ts +1 -1
  55. package/package.json +8 -11
  56. package/src/book-2.0/book-language-documentation/getSafeCodeBlock.ts +1 -1
  57. package/src/book-components/Chat/MockedChat/MockedChat.tsx +25 -1
  58. package/src/cli/cli-commands/agent-folder.ts +2 -6
  59. package/src/cli/cli-commands/agent.ts +2 -6
  60. package/src/cli/cli-commands/agents-server.ts +2 -6
  61. package/src/cli/cli-commands/coder/$ensureCoderHarnessGitignoreRules.ts +3 -0
  62. package/src/cli/cli-commands/coder/add.ts +27 -2
  63. package/src/cli/cli-commands/coder/agentCliOptions.ts +32 -0
  64. package/src/cli/cli-commands/coder/boilerplateTemplates.ts +17 -44
  65. package/src/cli/cli-commands/coder/coderReferencedArtifacts.ts +106 -0
  66. package/src/cli/cli-commands/coder/ensureCoderPackageJsonFile.ts +4 -2
  67. package/src/cli/cli-commands/coder/ensureCoderVscodeSettingsFile.ts +5 -1
  68. package/src/cli/cli-commands/coder/ensureDirectory.ts +27 -1
  69. package/src/cli/cli-commands/coder/getDefaultCoderPackageJsonScripts.ts +99 -10
  70. package/src/cli/cli-commands/coder/init.ts +23 -14
  71. package/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.ts +18 -27
  72. package/src/cli/cli-commands/coder/list.ts +15 -3
  73. package/src/cli/cli-commands/coder/mergeStringRecordJsonFile.ts +31 -7
  74. package/src/cli/cli-commands/coder/ping.ts +25 -22
  75. package/src/cli/cli-commands/coder/printCoderRunFailure.ts +14 -0
  76. package/src/cli/cli-commands/coder/printInitializationSummary.ts +23 -16
  77. package/src/cli/cli-commands/coder/run.ts +34 -23
  78. package/src/cli/cli-commands/coder/server.ts +43 -32
  79. package/src/cli/cli-commands/coder.ts +2 -6
  80. package/src/cli/cli-commands/common/$askForConfirmation.ts +12 -2
  81. package/src/cli/cli-commands/common/disk-space/$assertSufficientFreeDiskSpace.ts +35 -0
  82. package/src/cli/cli-commands/common/disk-space/$readFreeDiskSpaceStatus.ts +37 -0
  83. package/src/cli/cli-commands/common/disk-space/FreeDiskSpaceStatus.ts +39 -0
  84. package/src/cli/cli-commands/common/disk-space/formatFreeDiskSpaceBytes.ts +26 -0
  85. package/src/cli/cli-commands/common/disk-space/formatLowFreeDiskSpaceWarning.ts +33 -0
  86. package/src/cli/cli-commands/common/disk-space/freeDiskSpaceConstants.ts +33 -0
  87. package/src/cli/cli-commands/common/disk-space/resolveFreeDiskSpaceLevel.ts +21 -0
  88. package/src/cli/cli-commands/common/harness/$applyHarnessInstallationStatus.ts +17 -5
  89. package/src/cli/cli-commands/common/harness/$ensureHarnessInstallations.ts +8 -3
  90. package/src/cli/cli-commands/common/harness/HarnessDefinition.ts +36 -0
  91. package/src/cli/cli-commands/common/npm/$askForNpmPackageInstallationApproval.ts +8 -3
  92. package/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.ts +13 -2
  93. package/src/cli/cli-commands/common/questionsCliOptions.ts +89 -0
  94. package/src/cli/cli-commands/run.ts +3 -1
  95. package/src/cli/common/$deprecateCliCommand.ts +5 -0
  96. package/src/cli/common/$hideCliCommandFromHelp.ts +27 -0
  97. package/src/cli/common/$requireCliSubcommand.ts +35 -0
  98. package/src/cli/promptbookCli.ts +13 -9
  99. package/src/llm-providers/vercel/VercelExecutionToolsOptions.ts +7 -2
  100. package/src/llm-providers/vercel/createExecutionToolsFromVercelProvider.ts +18 -17
  101. package/src/other/templates/getTemplatesPipelineCollection.ts +677 -881
  102. package/src/version.ts +2 -2
  103. package/src/versions.txt +1 -0
  104. package/umd/index.umd.js +1253 -317
  105. package/umd/index.umd.js.map +1 -1
  106. package/umd/scripts/run-codex-prompts/common/createFreeDiskSpaceGuard.d.ts +25 -0
  107. package/umd/scripts/run-codex-prompts/common/formatUnknownErrorDetails.d.ts +4 -0
  108. package/umd/scripts/run-codex-prompts/common/resolveCoderAgent.d.ts +21 -3
  109. package/umd/scripts/run-codex-prompts/main/listCoderPrompts.d.ts +1 -1
  110. package/umd/scripts/run-codex-prompts/prompts/buildPromptRunTraceContent.d.ts +77 -0
  111. package/umd/scripts/run-codex-prompts/prompts/buildPromptRunTracePath.d.ts +10 -0
  112. package/umd/scripts/run-codex-prompts/prompts/isPromptCompatibleWithRunner.d.ts +11 -6
  113. package/umd/scripts/run-codex-prompts/prompts/loadPromptFiles.d.ts +1 -1
  114. package/umd/scripts/run-codex-prompts/prompts/writePromptRunTrace.d.ts +19 -0
  115. package/umd/scripts/run-codex-prompts/runners/common/buildHarnessAuthenticationError.d.ts +20 -0
  116. package/umd/scripts/run-codex-prompts/runners/common/createAuthenticationAwarePromptRunner.d.ts +11 -0
  117. package/umd/scripts/run-codex-prompts/runners/common/extractHarnessAuthenticationFailureReason.d.ts +9 -0
  118. package/umd/scripts/run-codex-prompts/ui/buildCoderRunUiFrame.d.ts +3 -0
  119. package/umd/src/book-2.0/book-language-documentation/getSafeCodeBlock.d.ts +1 -1
  120. package/umd/src/book-components/Chat/MockedChat/MockedChat.test.d.ts +2 -0
  121. package/umd/src/cli/cli-commands/coder/$ensureCoderHarnessGitignoreRules.d.ts +2 -1
  122. package/umd/src/cli/cli-commands/coder/agentCliOptions.d.ts +21 -0
  123. package/umd/src/cli/cli-commands/coder/boilerplateTemplates.d.ts +8 -21
  124. package/umd/src/cli/cli-commands/coder/coderReferencedArtifacts.d.ts +33 -0
  125. package/umd/src/cli/cli-commands/coder/ensureCoderPackageJsonFile.d.ts +4 -2
  126. package/umd/src/cli/cli-commands/coder/ensureCoderVscodeSettingsFile.d.ts +2 -0
  127. package/umd/src/cli/cli-commands/coder/ensureDirectory.d.ts +6 -0
  128. package/umd/src/cli/cli-commands/coder/getDefaultCoderPackageJsonScripts.d.ts +6 -0
  129. package/umd/src/cli/cli-commands/coder/init.test.d.ts +1 -0
  130. package/umd/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.d.ts +7 -5
  131. package/umd/src/cli/cli-commands/coder/mergeStringRecordJsonFile.d.ts +19 -1
  132. package/umd/src/cli/cli-commands/coder/printCoderRunFailure.d.ts +6 -0
  133. package/umd/src/cli/cli-commands/common/$askForConfirmation.d.ts +4 -2
  134. package/umd/src/cli/cli-commands/common/$askForConfirmation.test.d.ts +1 -0
  135. package/umd/src/cli/cli-commands/common/disk-space/$assertSufficientFreeDiskSpace.d.ts +12 -0
  136. package/umd/src/cli/cli-commands/common/disk-space/$assertSufficientFreeDiskSpace.test.d.ts +1 -0
  137. package/umd/src/cli/cli-commands/common/disk-space/$readFreeDiskSpaceStatus.d.ts +11 -0
  138. package/umd/src/cli/cli-commands/common/disk-space/$readFreeDiskSpaceStatus.test.d.ts +1 -0
  139. package/umd/src/cli/cli-commands/common/disk-space/FreeDiskSpaceStatus.d.ts +33 -0
  140. package/umd/src/cli/cli-commands/common/disk-space/formatFreeDiskSpaceBytes.d.ts +6 -0
  141. package/umd/src/cli/cli-commands/common/disk-space/formatFreeDiskSpaceBytes.test.d.ts +1 -0
  142. package/umd/src/cli/cli-commands/common/disk-space/formatLowFreeDiskSpaceWarning.d.ts +10 -0
  143. package/umd/src/cli/cli-commands/common/disk-space/freeDiskSpaceConstants.d.ts +28 -0
  144. package/umd/src/cli/cli-commands/common/disk-space/resolveFreeDiskSpaceLevel.d.ts +7 -0
  145. package/umd/src/cli/cli-commands/common/disk-space/resolveFreeDiskSpaceLevel.test.d.ts +1 -0
  146. package/umd/src/cli/cli-commands/common/harness/$applyHarnessInstallationStatus.d.ts +2 -1
  147. package/umd/src/cli/cli-commands/common/harness/$ensureHarnessInstallations.d.ts +3 -2
  148. package/umd/src/cli/cli-commands/common/harness/HarnessDefinition.d.ts +26 -0
  149. package/umd/src/cli/cli-commands/common/npm/$askForNpmPackageInstallationApproval.d.ts +4 -2
  150. package/umd/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.d.ts +2 -1
  151. package/umd/src/cli/cli-commands/common/questionsCliOptions.d.ts +45 -0
  152. package/umd/src/cli/cli-commands/common/questionsCliOptions.test.d.ts +1 -0
  153. package/umd/src/cli/common/$deprecateCliCommand.d.ts +3 -0
  154. package/umd/src/cli/common/$hideCliCommandFromHelp.d.ts +11 -0
  155. package/umd/src/cli/common/$hideCliCommandFromHelp.test.d.ts +1 -0
  156. package/umd/src/cli/common/$requireCliSubcommand.d.ts +18 -0
  157. package/umd/src/cli/common/$requireCliSubcommand.test.d.ts +1 -0
  158. package/umd/src/llm-providers/vercel/VercelExecutionToolsOptions.d.ts +5 -2
  159. package/umd/src/version.d.ts +1 -1
  160. package/esm/src/cli/cli-commands/coder/agentCodingFile.d.ts +0 -13
  161. package/esm/src/cli/cli-commands/common/harnessUpdateCliOptions.d.ts +0 -29
  162. package/src/cli/cli-commands/coder/agentCodingFile.ts +0 -25
  163. package/src/cli/cli-commands/common/harnessUpdateCliOptions.ts +0 -46
  164. package/umd/src/cli/cli-commands/coder/agentCodingFile.d.ts +0 -13
  165. package/umd/src/cli/cli-commands/common/harnessUpdateCliOptions.d.ts +0 -29
  166. /package/esm/src/cli/cli-commands/{common/harnessUpdateCliOptions.test.d.ts → coder/init.test.d.ts} +0 -0
  167. /package/{umd/src/cli/cli-commands/common/harnessUpdateCliOptions.test.d.ts → esm/src/cli/cli-commands/common/$askForConfirmation.test.d.ts} +0 -0
@@ -22,6 +22,7 @@ import { $initializeStartPipelinesServerCommand } from './cli-commands/start-pip
22
22
  import { $initializeTestCommand } from './cli-commands/test-command';
23
23
  import { $addGlobalOptionsToCommand } from './common/$addGlobalOptionsToCommand';
24
24
  import { $deprecateCliCommand } from './common/$deprecateCliCommand';
25
+ import { $reportMissingCliSubcommand } from './common/$requireCliSubcommand';
25
26
 
26
27
  /**
27
28
  * Shared deprecation text for top-level CLI commands backed by the old pipeline system.
@@ -97,10 +98,17 @@ export async function promptbookCli(): Promise<void> {
97
98
 
98
99
  // Note: These options are valid for all commands
99
100
 
101
+ // Note: Commands are listed in the help in the order they are registered,
102
+ // `coder` is the most used one so it goes first and the deprecated ones,
103
+ // which `$deprecateTopLevelCommands` hides from the help entirely, go last
104
+ $initializeCoderCommand(program);
105
+ $initializeAgentCommand(program);
106
+ $initializeAgentFolderCommand(program);
107
+ $initializeAgentsServerCommand(program);
100
108
  $initializeAboutCommand(program);
109
+ $initializeHelloCommand(program);
101
110
  $initializeRunCommand(program);
102
111
  $initializeLoginCommand(program);
103
- $initializeHelloCommand(program);
104
112
  $initializeMakeCommand(program);
105
113
  $initializePrettifyCommand(program);
106
114
  $initializeTestCommand(program);
@@ -108,19 +116,16 @@ export async function promptbookCli(): Promise<void> {
108
116
  $initializeListScrapersCommand(program);
109
117
  $initializeStartAgentsServerCommand(program);
110
118
  $initializeStartPipelinesServerCommand(program);
111
- $initializeAgentCommand(program);
112
- $initializeAgentFolderCommand(program);
113
- $initializeAgentsServerCommand(program);
114
- $initializeCoderCommand(program);
115
119
 
116
120
  $deprecateTopLevelCommands(program);
117
121
 
118
122
  // TODO: [🧠] Should it be here or not> $addGlobalOptionsToCommand(program);
119
123
  program.commands.forEach($addGlobalOptionsToCommand);
120
124
 
125
+ // Note: There is no default command, so `ptbk` without a subcommand asks for one
126
+ // instead of running the deprecated `ptbk run`
121
127
  if (commandLineArguments.length === 0) {
122
- program.outputHelp();
123
- return process.exit(0);
128
+ return $reportMissingCliSubcommand(program);
124
129
  }
125
130
 
126
131
  program.parse(process.argv);
@@ -138,7 +143,7 @@ function isTopLevelVersionRequested(commandLineArguments: ReadonlyArray<string>)
138
143
  }
139
144
 
140
145
  /**
141
- * Adds one deprecation notice to each configured top-level legacy command.
146
+ * Marks each configured top-level legacy command as deprecated, which keeps it usable but takes it out of the help.
142
147
  */
143
148
  function $deprecateTopLevelCommands(program: commander.Command): void {
144
149
  for (const command of program.commands) {
@@ -151,7 +156,6 @@ function $deprecateTopLevelCommands(program: commander.Command): void {
151
156
  }
152
157
 
153
158
  // Note: [🟡] Code for CLI program [promptbookCli](src/cli/promptbookCli.ts) should never be published outside of `@promptbook/cli`
154
- // TODO: [🧠] Maybe `run` command the default, instead of `ptbk run ./foo.book` -> `ptbk ./foo.book`
155
159
  // TODO: [🥠] Do not export, its just for CLI script
156
160
  // TODO: [🕌] When more functionalities, rename
157
161
  // Note: 11:11
@@ -24,7 +24,12 @@ export type VercelExecutionToolsOptions = CommonToolsOptions &
24
24
  // and not to pass it as a separate parameter
25
25
 
26
26
  /**
27
- * Additional settings for chat models when calling `vercelProvider.chat('model-name', settings)`
27
+ * Additional settings for chat models, for example `temperature` or `providerOptions`
28
+ *
29
+ * Note: Since Vercel AI SDK v5 these settings belong to the model call, not to
30
+ * `vercelProvider.chat('model-name')` which takes just the model name
28
31
  */
29
- readonly additionalChatSettings?: Partial<Parameters<VercelProvider['chat']>[1]>;
32
+ readonly additionalChatSettings?: Partial<
33
+ Omit<Parameters<ReturnType<VercelProvider['chat']>['doGenerate']>[0], 'prompt'>
34
+ >;
30
35
  };
@@ -34,7 +34,9 @@ const VERCEL_PROVIDER_PROFILE: ChatParticipant = {
34
34
  */
35
35
  export function createExecutionToolsFromVercelProvider(options: VercelExecutionToolsOptions): LlmExecutionTools {
36
36
  let { title, description } = options;
37
- const { vercelProvider, availableModels, userId, additionalChatSettings = {} } = options;
37
+ const { vercelProvider, availableModels, additionalChatSettings = {} } = options;
38
+ // <- Note: `userId` is not forwarded, because Vercel AI SDK moved provider-specific settings like `user` from
39
+ // `vercelProvider.chat(modelName, settings)` into `providerOptions` which are keyed by the provider
38
40
 
39
41
  if (!/Vercel/i.test(title)) {
40
42
  title = `${title} (through Vercel)`;
@@ -89,10 +91,7 @@ export function createExecutionToolsFromVercelProvider(options: VercelExecutionT
89
91
  );
90
92
  }
91
93
 
92
- const model = await vercelProvider.chat(modelName, {
93
- user: userId?.toString() || undefined,
94
- ...additionalChatSettings,
95
- });
94
+ const model = await vercelProvider.chat(modelName);
96
95
 
97
96
  const rawPromptContent = templateParameters(content, { ...parameters, modelName });
98
97
 
@@ -132,14 +131,9 @@ export function createExecutionToolsFromVercelProvider(options: VercelExecutionT
132
131
 
133
132
  const rawRequest: Parameters<typeof model.doGenerate>[0] = {
134
133
  // <- TODO: [☂]
135
- inputFormat: 'messages',
136
- mode: {
137
- type: 'regular',
138
- tools: [
139
- /* <- TODO: Pass the tools */
140
- ],
141
- },
142
134
  prompt: promptMessages,
135
+ // <- TODO: Pass the tools via `tools`
136
+ ...additionalChatSettings,
143
137
  };
144
138
 
145
139
  const start: string_date_iso8601 = $getCurrentDate();
@@ -161,10 +155,17 @@ export function createExecutionToolsFromVercelProvider(options: VercelExecutionT
161
155
  console.info(colors.bgWhite('rawResponse'), JSON.stringify(rawResponse, null, 4));
162
156
  }
163
157
 
164
- if (rawResponse.text === undefined) {
158
+ // Note: Vercel AI SDK returns ordered content parts, the chat message is made only of the text parts
159
+ const responseTextParts = rawResponse.content.flatMap((contentPart) =>
160
+ contentPart.type === 'text' ? [contentPart.text] : [],
161
+ );
162
+
163
+ if (responseTextParts.length === 0) {
165
164
  throw new PipelineExecutionError('No response message');
166
165
  }
167
166
 
167
+ const responseText = responseTextParts.join('');
168
+
168
169
  const complete: string_date_iso8601 = $getCurrentDate();
169
170
 
170
171
  const duration = uncertainNumber((new Date(complete).getTime() - new Date(start).getTime()) / 1000);
@@ -173,15 +174,15 @@ export function createExecutionToolsFromVercelProvider(options: VercelExecutionT
173
174
  price: UNCERTAIN_ZERO_VALUE, // <- TODO: [🕘] Price count
174
175
  duration,
175
176
  input: {
176
- tokensCount: uncertainNumber(rawResponse.usage.promptTokens),
177
+ tokensCount: uncertainNumber(rawResponse.usage.inputTokens),
177
178
  ...computeUsageCounts(
178
179
  rawPromptContent,
179
180
  // <- TODO: [🕘][🙀] What about system message
180
181
  ),
181
182
  },
182
183
  output: {
183
- tokensCount: uncertainNumber(rawResponse.usage.completionTokens),
184
- ...computeUsageCounts(rawResponse.text),
184
+ tokensCount: uncertainNumber(rawResponse.usage.outputTokens),
185
+ ...computeUsageCounts(responseText),
185
186
  },
186
187
  };
187
188
 
@@ -189,7 +190,7 @@ export function createExecutionToolsFromVercelProvider(options: VercelExecutionT
189
190
  name: 'promptResult',
190
191
  message: `Result of \`createExecutionToolsFromVercelProvider.callChatModel\``,
191
192
  value: {
192
- content: rawResponse.text,
193
+ content: responseText,
193
194
  modelName,
194
195
  timing: {
195
196
  start,