openkitt 0.2.7 → 0.2.8
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/dist/cli.js +19 -3
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -257956,7 +257956,17 @@ function formatToolError(error4) {
|
|
|
257956
257956
|
}
|
|
257957
257957
|
return String(error4);
|
|
257958
257958
|
}
|
|
257959
|
-
function toAssistantHistoryEntry(response) {
|
|
257959
|
+
function toAssistantHistoryEntry(response, provider) {
|
|
257960
|
+
if (provider === "anthropic") {
|
|
257961
|
+
const contentBlocks = [];
|
|
257962
|
+
if (response.content) {
|
|
257963
|
+
contentBlocks.push({ type: "text", text: response.content });
|
|
257964
|
+
}
|
|
257965
|
+
for (const call of response.toolCalls) {
|
|
257966
|
+
contentBlocks.push({ type: "tool_use", id: call.id, name: call.name, input: call.arguments });
|
|
257967
|
+
}
|
|
257968
|
+
return { role: "assistant", content: contentBlocks };
|
|
257969
|
+
}
|
|
257960
257970
|
const entry = {
|
|
257961
257971
|
role: "assistant",
|
|
257962
257972
|
content: response.content
|
|
@@ -258039,7 +258049,7 @@ async function executeOperations(options) {
|
|
|
258039
258049
|
if (!hasToolCalls && expectsToolCalls) {
|
|
258040
258050
|
return response.content;
|
|
258041
258051
|
}
|
|
258042
|
-
conversationHistory.push(toAssistantHistoryEntry(response));
|
|
258052
|
+
conversationHistory.push(toAssistantHistoryEntry(response, llmClient.getProvider()));
|
|
258043
258053
|
const toolResults = [];
|
|
258044
258054
|
for (const toolCall of response.toolCalls) {
|
|
258045
258055
|
const result = await executeToolCall({
|
|
@@ -265582,7 +265592,7 @@ async function helpCommand(_context, _args) {
|
|
|
265582
265592
|
// package.json
|
|
265583
265593
|
var package_default = {
|
|
265584
265594
|
name: "openkitt",
|
|
265585
|
-
version: "0.2.
|
|
265595
|
+
version: "0.2.8",
|
|
265586
265596
|
description: "AI-powered monorepo scaffolding CLI",
|
|
265587
265597
|
keywords: [
|
|
265588
265598
|
"cli",
|
|
@@ -265827,9 +265837,15 @@ async function dispatchCommand(commandLine, context) {
|
|
|
265827
265837
|
}
|
|
265828
265838
|
if (process.stdin.isTTY)
|
|
265829
265839
|
process.stdin.setRawMode(false);
|
|
265840
|
+
const originalExit = process.exit.bind(process);
|
|
265841
|
+
process.exit = (code) => {
|
|
265842
|
+
if (code !== undefined && code !== 0)
|
|
265843
|
+
originalExit(code);
|
|
265844
|
+
};
|
|
265830
265845
|
try {
|
|
265831
265846
|
await resolveAndRunHandler(route, context, parsed.args, parsed.key);
|
|
265832
265847
|
} finally {
|
|
265848
|
+
process.exit = originalExit;
|
|
265833
265849
|
if (process.stdin.isTTY)
|
|
265834
265850
|
process.stdin.setRawMode(true);
|
|
265835
265851
|
}
|