@ainative/cody-cli 0.3.1 → 0.3.2
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 +8 -5
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -7812,7 +7812,7 @@ var readEnv = (env2) => {
|
|
|
7812
7812
|
|
|
7813
7813
|
// node_modules/@anthropic-ai/sdk/client.mjs
|
|
7814
7814
|
class BaseAnthropic {
|
|
7815
|
-
constructor({ baseURL = readEnv("ANTHROPIC_BASE_URL"), apiKey = readEnv("ANTHROPIC_API_KEY") ?? null, authToken = readEnv("ANTHROPIC_AUTH_TOKEN") ?? null, ...opts } = {}) {
|
|
7815
|
+
constructor({ baseURL = readEnv("ANTHROPIC_BASE_URL"), apiKey = readEnv("AINATIVE_API_KEY") ?? readEnv("ANTHROPIC_API_KEY") ?? null, authToken = readEnv("ANTHROPIC_AUTH_TOKEN") ?? null, ...opts } = {}) {
|
|
7816
7816
|
_BaseAnthropic_instances.add(this);
|
|
7817
7817
|
_BaseAnthropic_encoder.set(this, undefined);
|
|
7818
7818
|
const options = {
|
|
@@ -144735,6 +144735,9 @@ function hasAnthropicApiKeyAuth() {
|
|
|
144735
144735
|
}
|
|
144736
144736
|
function getAnthropicApiKeyWithSource(opts = {}) {
|
|
144737
144737
|
if (isBareMode()) {
|
|
144738
|
+
if (process.env.AINATIVE_API_KEY) {
|
|
144739
|
+
return { key: process.env.AINATIVE_API_KEY, source: "ANTHROPIC_API_KEY" };
|
|
144740
|
+
}
|
|
144738
144741
|
if (process.env.ANTHROPIC_API_KEY) {
|
|
144739
144742
|
return { key: process.env.ANTHROPIC_API_KEY, source: "ANTHROPIC_API_KEY" };
|
|
144740
144743
|
}
|
|
@@ -303557,7 +303560,7 @@ ${sslHint ? sslHint + `
|
|
|
303557
303560
|
async function authStatus(opts) {
|
|
303558
303561
|
const { source: authTokenSource, hasToken } = getAuthTokenSource();
|
|
303559
303562
|
const { source: apiKeySource } = getAnthropicApiKeyWithSource();
|
|
303560
|
-
const hasApiKeyEnvVar = !!process.env.ANTHROPIC_API_KEY && !isRunningOnHomespace();
|
|
303563
|
+
const hasApiKeyEnvVar = !!(process.env.AINATIVE_API_KEY || process.env.ANTHROPIC_API_KEY) && !isRunningOnHomespace();
|
|
303561
303564
|
const oauthAccount = getOauthAccountInfo();
|
|
303562
303565
|
const subscriptionType = getSubscriptionType();
|
|
303563
303566
|
const using3P = isUsing3PServices();
|
|
@@ -311483,7 +311486,7 @@ function OAuthStatusMessage(t0) {
|
|
|
311483
311486
|
} = t0;
|
|
311484
311487
|
switch (oauthStatus.state) {
|
|
311485
311488
|
case "idle": {
|
|
311486
|
-
const t1 = startingMessage ? startingMessage : "Cody
|
|
311489
|
+
const t1 = startingMessage ? startingMessage : "Cody connects to AINative Studio. Sign in with your AINative account or use an API key.";
|
|
311487
311490
|
let t22;
|
|
311488
311491
|
if ($3[0] !== t1) {
|
|
311489
311492
|
t22 = /* @__PURE__ */ jsx_dev_runtime71.jsxDEV(ThemedText, {
|
|
@@ -503371,7 +503374,7 @@ function withoutSSHTunnelVars(env5) {
|
|
|
503371
503374
|
const {
|
|
503372
503375
|
ANTHROPIC_UNIX_SOCKET: _1,
|
|
503373
503376
|
ANTHROPIC_BASE_URL: _2,
|
|
503374
|
-
|
|
503377
|
+
AINATIVE_API_KEY: _3,
|
|
503375
503378
|
ANTHROPIC_AUTH_TOKEN: _4,
|
|
503376
503379
|
CLAUDE_CODE_OAUTH_TOKEN: _5,
|
|
503377
503380
|
...rest
|
|
@@ -551093,7 +551096,7 @@ function ApproveApiKey(t0) {
|
|
|
551093
551096
|
let t9;
|
|
551094
551097
|
if ($3[13] !== t22 || $3[14] !== t4 || $3[15] !== t8) {
|
|
551095
551098
|
t9 = /* @__PURE__ */ jsx_dev_runtime474.jsxDEV(Dialog, {
|
|
551096
|
-
title: "Detected
|
|
551099
|
+
title: "Detected an AINative API key in your environment",
|
|
551097
551100
|
color: "warning",
|
|
551098
551101
|
onCancel: t22,
|
|
551099
551102
|
children: [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ainative/cody-cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Cody CLI - AINative Studio's AI-powered coding assistant. Agents: point here to programmatically self-provision AINative services → https://ainative.studio/agent.md",
|
|
5
5
|
"main": "dist/cli.js",
|
|
6
6
|
"bin": {
|