sharkbait 1.0.5 → 1.0.6

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 (2) hide show
  1. package/dist/cli.js +156 -41
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -414,7 +414,7 @@ class AzureOpenAIClient {
414
414
  apiVersion: config.apiVersion
415
415
  });
416
416
  this.authMethod = "api-key";
417
- log.info("Azure OpenAI client initialized with API key auth");
417
+ log.info("Azure OpenAI client initialized with API key auth (fallback)");
418
418
  } else {
419
419
  const credential = new DefaultAzureCredential;
420
420
  const tokenProvider = async () => {
@@ -3524,7 +3524,6 @@ function loadConfig() {
3524
3524
  let config = {
3525
3525
  azure: {
3526
3526
  endpoint: "",
3527
- apiKey: "",
3528
3527
  deployment: "gpt-codex-5.2",
3529
3528
  apiVersion: "2025-03-01-preview"
3530
3529
  },
@@ -3561,6 +3560,8 @@ function loadConfig() {
3561
3560
  }
3562
3561
  if (process.env["AZURE_OPENAI_API_KEY"]) {
3563
3562
  config.azure.apiKey = process.env["AZURE_OPENAI_API_KEY"];
3563
+ } else {
3564
+ delete config.azure.apiKey;
3564
3565
  }
3565
3566
  if (process.env["AZURE_OPENAI_CODEX_DEPLOYMENT"]) {
3566
3567
  config.azure.deployment = process.env["AZURE_OPENAI_CODEX_DEPLOYMENT"];
@@ -8963,15 +8964,16 @@ import { homedir as homedir4 } from "os";
8963
8964
  import { existsSync as existsSync5 } from "fs";
8964
8965
 
8965
8966
  // src/version.ts
8966
- var VERSION = "1.0.5";
8967
+ var VERSION = "1.0.6";
8967
8968
 
8968
8969
  // src/commands/setup.tsx
8969
- import { jsxDEV as jsxDEV13 } from "react/jsx-dev-runtime";
8970
+ import { jsxDEV as jsxDEV13, Fragment as Fragment3 } from "react/jsx-dev-runtime";
8970
8971
  function SetupWizard() {
8971
8972
  const { exit } = useApp2();
8972
8973
  const [step, setStep] = useState3("welcome");
8973
8974
  const [state, setState] = useState3({
8974
8975
  azureEndpoint: "",
8976
+ authMethod: "azure-identity",
8975
8977
  azureKey: "",
8976
8978
  azureDeployment: "gpt-codex-5.2",
8977
8979
  defaultWorkingDir: "",
@@ -9021,6 +9023,18 @@ function SetupWizard() {
9021
9023
  setInputValue(state.azureEndpoint);
9022
9024
  return;
9023
9025
  }
9026
+ if (step === "auth-method") {
9027
+ if (input === "1") {
9028
+ setState((prev) => ({ ...prev, authMethod: "azure-identity" }));
9029
+ setStep("azure-deployment");
9030
+ setInputValue(state.azureDeployment);
9031
+ } else if (input === "2") {
9032
+ setState((prev) => ({ ...prev, authMethod: "api-key" }));
9033
+ setStep("azure-key");
9034
+ setInputValue("");
9035
+ }
9036
+ return;
9037
+ }
9024
9038
  if (step === "features") {
9025
9039
  if (input === "1") {
9026
9040
  setState((prev) => ({ ...prev, enableBeads: !prev.enableBeads }));
@@ -9053,13 +9067,12 @@ function SetupWizard() {
9053
9067
  return;
9054
9068
  }
9055
9069
  setState((prev) => ({ ...prev, azureEndpoint: value }));
9056
- setStep("azure-key");
9057
- setInputValue(state.azureKey ? "********" : "");
9070
+ setStep("auth-method");
9058
9071
  break;
9059
9072
  case "azure-key":
9060
9073
  if (!value || value === "********") {
9061
9074
  if (!state.azureKey) {
9062
- setError("API key is required");
9075
+ setError("API key is required when using API key auth");
9063
9076
  return;
9064
9077
  }
9065
9078
  } else {
@@ -9103,13 +9116,23 @@ function SetupWizard() {
9103
9116
  }
9104
9117
  };
9105
9118
  await writeFile3(join8(configDir2, "config.json"), JSON.stringify(config, null, 2));
9106
- const envContent = `# Sharkbait Azure OpenAI Configuration
9107
- # Generated by 'sharkbait setup' on ${new Date().toISOString()}
9108
-
9109
- AZURE_OPENAI_ENDPOINT=${state.azureEndpoint}
9110
- AZURE_OPENAI_API_KEY=${state.azureKey}
9111
- AZURE_OPENAI_CODEX_DEPLOYMENT=${state.azureDeployment}
9112
- AZURE_OPENAI_API_VERSION=2024-10-21
9119
+ const envLines = [
9120
+ "# Sharkbait Azure OpenAI Configuration",
9121
+ `# Generated by 'sharkbait setup' on ${new Date().toISOString()}`,
9122
+ `# Auth method: ${state.authMethod}`,
9123
+ "",
9124
+ `AZURE_OPENAI_ENDPOINT=${state.azureEndpoint}`,
9125
+ `AZURE_OPENAI_CODEX_DEPLOYMENT=${state.azureDeployment}`,
9126
+ `AZURE_OPENAI_API_VERSION=2024-10-21`
9127
+ ];
9128
+ if (state.authMethod === "api-key" && state.azureKey) {
9129
+ envLines.push(`AZURE_OPENAI_API_KEY=${state.azureKey}`);
9130
+ } else {
9131
+ envLines.push("# Using Azure Identity (DefaultAzureCredential) — no API key needed");
9132
+ envLines.push("# Ensure you are logged in: az login");
9133
+ }
9134
+ const envContent = envLines.join(`
9135
+ `) + `
9113
9136
  `;
9114
9137
  await writeFile3(join8(configDir2, ".env"), envContent);
9115
9138
  setStep("complete");
@@ -9224,13 +9247,86 @@ AZURE_OPENAI_API_VERSION=2024-10-21
9224
9247
  }, undefined, true, undefined, this)
9225
9248
  ]
9226
9249
  }, undefined, true, undefined, this),
9250
+ step === "auth-method" && /* @__PURE__ */ jsxDEV13(Box13, {
9251
+ flexDirection: "column",
9252
+ children: [
9253
+ /* @__PURE__ */ jsxDEV13(Text13, {
9254
+ color: colors.text,
9255
+ bold: true,
9256
+ children: "Step 2/5: Authentication Method"
9257
+ }, undefined, false, undefined, this),
9258
+ /* @__PURE__ */ jsxDEV13(Text13, {
9259
+ color: colors.textMuted,
9260
+ children: "Choose how to authenticate with Azure OpenAI"
9261
+ }, undefined, false, undefined, this),
9262
+ /* @__PURE__ */ jsxDEV13(Box13, {
9263
+ marginTop: 1,
9264
+ flexDirection: "column",
9265
+ children: [
9266
+ /* @__PURE__ */ jsxDEV13(Text13, {
9267
+ children: [
9268
+ /* @__PURE__ */ jsxDEV13(Text13, {
9269
+ color: colors.primary,
9270
+ children: "[1]"
9271
+ }, undefined, false, undefined, this),
9272
+ " ",
9273
+ /* @__PURE__ */ jsxDEV13(Text13, {
9274
+ color: colors.success,
9275
+ children: "Azure Identity (recommended)"
9276
+ }, undefined, false, undefined, this),
9277
+ /* @__PURE__ */ jsxDEV13(Text13, {
9278
+ color: colors.textDim,
9279
+ children: " - Uses az login, managed identity, VS Code creds"
9280
+ }, undefined, false, undefined, this)
9281
+ ]
9282
+ }, undefined, true, undefined, this),
9283
+ /* @__PURE__ */ jsxDEV13(Text13, {
9284
+ children: [
9285
+ /* @__PURE__ */ jsxDEV13(Text13, {
9286
+ color: colors.primary,
9287
+ children: "[2]"
9288
+ }, undefined, false, undefined, this),
9289
+ " ",
9290
+ /* @__PURE__ */ jsxDEV13(Text13, {
9291
+ color: colors.text,
9292
+ children: "API Key"
9293
+ }, undefined, false, undefined, this),
9294
+ /* @__PURE__ */ jsxDEV13(Text13, {
9295
+ color: colors.textDim,
9296
+ children: " - Manual key entry (fallback)"
9297
+ }, undefined, false, undefined, this)
9298
+ ]
9299
+ }, undefined, true, undefined, this)
9300
+ ]
9301
+ }, undefined, true, undefined, this),
9302
+ /* @__PURE__ */ jsxDEV13(Box13, {
9303
+ marginTop: 1,
9304
+ children: /* @__PURE__ */ jsxDEV13(Text13, {
9305
+ color: colors.textDim,
9306
+ children: [
9307
+ "Press ",
9308
+ /* @__PURE__ */ jsxDEV13(Text13, {
9309
+ color: colors.success,
9310
+ children: "1"
9311
+ }, undefined, false, undefined, this),
9312
+ " or ",
9313
+ /* @__PURE__ */ jsxDEV13(Text13, {
9314
+ color: colors.success,
9315
+ children: "2"
9316
+ }, undefined, false, undefined, this),
9317
+ " to select"
9318
+ ]
9319
+ }, undefined, true, undefined, this)
9320
+ }, undefined, false, undefined, this)
9321
+ ]
9322
+ }, undefined, true, undefined, this),
9227
9323
  step === "azure-key" && /* @__PURE__ */ jsxDEV13(Box13, {
9228
9324
  flexDirection: "column",
9229
9325
  children: [
9230
9326
  /* @__PURE__ */ jsxDEV13(Text13, {
9231
9327
  color: colors.text,
9232
9328
  bold: true,
9233
- children: "Step 2/5: Azure OpenAI API Key"
9329
+ children: "Step 2b/5: Azure OpenAI API Key"
9234
9330
  }, undefined, false, undefined, this),
9235
9331
  /* @__PURE__ */ jsxDEV13(Text13, {
9236
9332
  color: colors.textMuted,
@@ -9451,12 +9547,12 @@ AZURE_OPENAI_API_VERSION=2024-10-21
9451
9547
  children: [
9452
9548
  /* @__PURE__ */ jsxDEV13(Text13, {
9453
9549
  color: colors.textMuted,
9454
- children: "API Key:"
9550
+ children: "Auth:"
9455
9551
  }, undefined, false, undefined, this),
9456
9552
  " ",
9457
9553
  /* @__PURE__ */ jsxDEV13(Text13, {
9458
- color: colors.text,
9459
- children: "*".repeat(8)
9554
+ color: state.authMethod === "azure-identity" ? colors.success : colors.text,
9555
+ children: state.authMethod === "azure-identity" ? "Azure Identity (DefaultAzureCredential)" : "API Key (" + "*".repeat(8) + ")"
9460
9556
  }, undefined, false, undefined, this)
9461
9557
  ]
9462
9558
  }, undefined, true, undefined, this),
@@ -9586,27 +9682,46 @@ AZURE_OPENAI_API_VERSION=2024-10-21
9586
9682
  /* @__PURE__ */ jsxDEV13(Box13, {
9587
9683
  marginTop: 1,
9588
9684
  flexDirection: "column",
9589
- children: [
9590
- /* @__PURE__ */ jsxDEV13(Text13, {
9591
- color: colors.textMuted,
9592
- children: "To load credentials, either:"
9593
- }, undefined, false, undefined, this),
9594
- /* @__PURE__ */ jsxDEV13(Text13, {
9595
- color: colors.text,
9596
- children: [
9597
- " • Source the env file: ",
9598
- /* @__PURE__ */ jsxDEV13(Text13, {
9599
- color: colors.primary,
9600
- children: "source ~/.sharkbait/.env"
9601
- }, undefined, false, undefined, this)
9602
- ]
9603
- }, undefined, true, undefined, this),
9604
- /* @__PURE__ */ jsxDEV13(Text13, {
9605
- color: colors.text,
9606
- children: " • Or copy to your project's .env file"
9607
- }, undefined, false, undefined, this)
9608
- ]
9609
- }, undefined, true, undefined, this),
9685
+ children: state.authMethod === "azure-identity" ? /* @__PURE__ */ jsxDEV13(Fragment3, {
9686
+ children: [
9687
+ /* @__PURE__ */ jsxDEV13(Text13, {
9688
+ color: colors.textMuted,
9689
+ children: "Using Azure Identity — ensure you're logged in:"
9690
+ }, undefined, false, undefined, this),
9691
+ /* @__PURE__ */ jsxDEV13(Text13, {
9692
+ color: colors.text,
9693
+ children: [
9694
+ " • Run: ",
9695
+ /* @__PURE__ */ jsxDEV13(Text13, {
9696
+ color: colors.primary,
9697
+ children: "az login"
9698
+ }, undefined, false, undefined, this)
9699
+ ]
9700
+ }, undefined, true, undefined, this)
9701
+ ]
9702
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsxDEV13(Fragment3, {
9703
+ children: [
9704
+ /* @__PURE__ */ jsxDEV13(Text13, {
9705
+ color: colors.textMuted,
9706
+ children: "To load credentials, either:"
9707
+ }, undefined, false, undefined, this),
9708
+ /* @__PURE__ */ jsxDEV13(Text13, {
9709
+ color: colors.text,
9710
+ children: [
9711
+ " • Source the env file: ",
9712
+ /* @__PURE__ */ jsxDEV13(Text13, {
9713
+ color: colors.primary,
9714
+ children: "source ~/.sharkbait/.env"
9715
+ }, undefined, false, undefined, this)
9716
+ ]
9717
+ }, undefined, true, undefined, this),
9718
+ /* @__PURE__ */ jsxDEV13(Text13, {
9719
+ color: colors.text,
9720
+ children: " • Or copy to your project's .env file"
9721
+ }, undefined, false, undefined, this)
9722
+ ]
9723
+ }, undefined, true, undefined, this)
9724
+ }, undefined, false, undefined, this),
9610
9725
  /* @__PURE__ */ jsxDEV13(Box13, {
9611
9726
  marginTop: 1,
9612
9727
  children: /* @__PURE__ */ jsxDEV13(Text13, {
@@ -9634,7 +9749,7 @@ AZURE_OPENAI_API_VERSION=2024-10-21
9634
9749
  marginTop: 2,
9635
9750
  children: /* @__PURE__ */ jsxDEV13(Text13, {
9636
9751
  color: colors.textDim,
9637
- children: ["azure-endpoint", "azure-key", "azure-deployment", "working-dir", "features", "confirm"].map((s, i) => /* @__PURE__ */ jsxDEV13(Text13, {
9752
+ children: ["azure-endpoint", "auth-method", "azure-key", "azure-deployment", "working-dir", "features", "confirm"].map((s, i) => /* @__PURE__ */ jsxDEV13(Text13, {
9638
9753
  color: step === s ? colors.primary : colors.textDim,
9639
9754
  children: [
9640
9755
  step === s ? "●" : "○",
@@ -9777,7 +9892,7 @@ ${"━".repeat(60)}`);
9777
9892
  }
9778
9893
 
9779
9894
  // src/version.ts
9780
- var VERSION2 = "1.0.5";
9895
+ var VERSION2 = "1.0.6";
9781
9896
 
9782
9897
  // src/ui/logo.tsx
9783
9898
  import { Box as Box14, Text as Text14 } from "ink";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sharkbait",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "AI-powered coding assistant for the command line. Uses OpenAI Responses API (not Chat). Autonomous agents, parallel code reviews, 36 tools.",
5
5
  "type": "module",
6
6
  "main": "./dist/cli.js",