@ainative/cody-cli 0.7.26 → 0.7.28
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 +18 -26
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -181024,7 +181024,7 @@ var init_metadata = __esm(() => {
|
|
|
181024
181024
|
isClaudeAiAuth: isClaudeAISubscriber(),
|
|
181025
181025
|
version: "0.7.15",
|
|
181026
181026
|
versionBase: getVersionBase(),
|
|
181027
|
-
buildTime: "
|
|
181027
|
+
buildTime: "1775526268",
|
|
181028
181028
|
deploymentEnvironment: env4.detectDeploymentEnvironment(),
|
|
181029
181029
|
...isEnvTruthy(process.env.GITHUB_ACTIONS) && {
|
|
181030
181030
|
githubEventName: process.env.GITHUB_EVENT_NAME,
|
|
@@ -419007,7 +419007,7 @@ function getAnthropicEnvMetadata() {
|
|
|
419007
419007
|
function getBuildAgeMinutes() {
|
|
419008
419008
|
if (false)
|
|
419009
419009
|
;
|
|
419010
|
-
const buildTime = new Date("
|
|
419010
|
+
const buildTime = new Date("1775526268").getTime();
|
|
419011
419011
|
if (isNaN(buildTime))
|
|
419012
419012
|
return;
|
|
419013
419013
|
return Math.floor((Date.now() - buildTime) / 60000);
|
|
@@ -511997,7 +511997,7 @@ var init_bridge_kick = __esm(() => {
|
|
|
511997
511997
|
var call56 = async () => {
|
|
511998
511998
|
return {
|
|
511999
511999
|
type: "text",
|
|
512000
|
-
value: `${"0.7.15"} (built ${"
|
|
512000
|
+
value: `${"0.7.15"} (built ${"1775526268"})`
|
|
512001
512001
|
};
|
|
512002
512002
|
}, version6, version_default;
|
|
512003
512003
|
var init_version = __esm(() => {
|
|
@@ -532617,22 +532617,10 @@ async function* ainativeBypass(messages, systemPrompt, model, toolSchemas) {
|
|
|
532617
532617
|
}
|
|
532618
532618
|
}
|
|
532619
532619
|
const simplifiedTools = toolSchemas?.map((t) => ({
|
|
532620
|
-
|
|
532621
|
-
|
|
532622
|
-
|
|
532623
|
-
description: String(t.description ?? "").slice(0, 300),
|
|
532624
|
-
parameters: simplifySchema(t.input_schema ?? {})
|
|
532625
|
-
}
|
|
532620
|
+
name: t.name ?? "",
|
|
532621
|
+
description: String(t.description ?? "").slice(0, 300),
|
|
532622
|
+
input_schema: simplifySchema(t.input_schema ?? {})
|
|
532626
532623
|
}));
|
|
532627
|
-
const body = {
|
|
532628
|
-
model,
|
|
532629
|
-
max_tokens: 4096,
|
|
532630
|
-
messages: chatMessages
|
|
532631
|
-
};
|
|
532632
|
-
if (simplifiedTools && simplifiedTools.length > 0) {
|
|
532633
|
-
body.tools = simplifiedTools;
|
|
532634
|
-
body.tool_choice = "auto";
|
|
532635
|
-
}
|
|
532636
532624
|
const anthropicBody = {
|
|
532637
532625
|
model,
|
|
532638
532626
|
max_tokens: 4096,
|
|
@@ -532652,11 +532640,7 @@ async function* ainativeBypass(messages, systemPrompt, model, toolSchemas) {
|
|
|
532652
532640
|
stream: false
|
|
532653
532641
|
};
|
|
532654
532642
|
if (simplifiedTools && simplifiedTools.length > 0) {
|
|
532655
|
-
anthropicBody.tools = simplifiedTools
|
|
532656
|
-
name: t.function.name,
|
|
532657
|
-
description: t.function.description,
|
|
532658
|
-
input_schema: t.function.parameters
|
|
532659
|
-
}));
|
|
532643
|
+
anthropicBody.tools = simplifiedTools;
|
|
532660
532644
|
anthropicBody.tool_choice = { type: "auto" };
|
|
532661
532645
|
}
|
|
532662
532646
|
const resp = await fetch(`${baseUrl}/v1/messages`, {
|
|
@@ -532666,19 +532650,27 @@ async function* ainativeBypass(messages, systemPrompt, model, toolSchemas) {
|
|
|
532666
532650
|
"x-api-key": apiKey,
|
|
532667
532651
|
"anthropic-version": "2023-06-01"
|
|
532668
532652
|
},
|
|
532669
|
-
body: JSON.stringify(anthropicBody)
|
|
532653
|
+
body: JSON.stringify(anthropicBody),
|
|
532654
|
+
signal: AbortSignal.timeout(120000)
|
|
532670
532655
|
});
|
|
532671
532656
|
if (!resp.ok) {
|
|
532672
|
-
|
|
532657
|
+
const errText = await resp.text().catch(() => "unknown error");
|
|
532658
|
+
throw new Error(`AINative API error: ${resp.status} ${errText}`);
|
|
532673
532659
|
}
|
|
532674
532660
|
const data = await resp.json();
|
|
532661
|
+
const cleanedContent = (data.content || [{ type: "text", text: "" }]).map((block) => {
|
|
532662
|
+
if (block.type === "text" && typeof block.text === "string") {
|
|
532663
|
+
return { ...block, text: block.text.replace(/<\/?tool_call>/g, "").trimEnd() };
|
|
532664
|
+
}
|
|
532665
|
+
return block;
|
|
532666
|
+
});
|
|
532675
532667
|
yield {
|
|
532676
532668
|
type: "assistant",
|
|
532677
532669
|
message: {
|
|
532678
532670
|
id: data.id || `msg_${randomUUID32().slice(0, 24)}`,
|
|
532679
532671
|
type: "message",
|
|
532680
532672
|
role: "assistant",
|
|
532681
|
-
content:
|
|
532673
|
+
content: cleanedContent,
|
|
532682
532674
|
model,
|
|
532683
532675
|
stop_reason: data.stop_reason || "end_turn",
|
|
532684
532676
|
stop_sequence: data.stop_sequence || null,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ainative/cody-cli",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.28",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Cody CLI - AINative Studio's AI-powered coding assistant. Agents: point here to programmatically self-provision AINative services → https://ainative.studio/agent.md",
|
|
6
6
|
"main": "dist/cli.js",
|