bingocode 1.1.200-beta.14 → 1.1.200-beta.15

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bingocode",
3
- "version": "1.1.200-beta.14",
3
+ "version": "1.1.200-beta.15",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "claude": "bin/claude-win.cjs",
@@ -602,12 +602,6 @@ export class ProviderService {
602
602
  const writtenPaths: string[] = []
603
603
  const failedPaths: string[] = []
604
604
 
605
- // Save pre-link bingo env so we can restore it on disconnect.
606
- const bingoSettings = await this.readSettings()
607
- const preLinkEnv = bingoSettings.env ?? null
608
- bingoSettings.vscodePreLinkEnv = preLinkEnv
609
- await this.writeSettings(bingoSettings)
610
-
611
605
  // Fix #8: Snapshot original VS Code claudeCode per path for unlink restore.
612
606
  const vscodePreLinkClaudeCode: Record<string, unknown> = {}
613
607
  // Fix #9: Backup original contents for rollback on partial failure.
@@ -724,6 +718,7 @@ export class ProviderService {
724
718
  }
725
719
 
726
720
  // Persist so re-sync on restart and unlink work correctly
721
+ const bingoSettings = await this.readSettings()
727
722
  bingoSettings.vscodeLinked = true
728
723
  bingoSettings.vscodeLinkedPaths = writtenPaths
729
724
  bingoSettings.vscodePreLinkClaudeCode = vscodePreLinkClaudeCode
@@ -741,32 +736,18 @@ export class ProviderService {
741
736
  }
742
737
 
743
738
  /**
744
- * Restore pre-link bingo env so the CLI no longer routes through the proxy,
745
- * and reset VS Code settings to their pre-link state (the original claudeCode
746
- * that was saved in vscodePreLinkClaudeCode). Falls back to a minimal stub
747
- * if no snapshot exists.
739
+ * Reset VS Code settings to pre-link state. Does NOT touching bingo
740
+ * settings.env — the CLI keeps routing through the proxy independently.
748
741
  *
749
- * Without this, the only way to stop VS Code from using bingo would be to
750
- * delete ~/.claude/bingo/settings.json entirely — which would also kill CLI
751
- * routing. Saving/restoring the pre-link env keeps CLI and VS Code independent.
742
+ * Restores the original claudeCode snapshot (vscodePreLinkClaudeCode)
743
+ * when available, otherwise writes an override that points VS Code to
744
+ * api.anthropic.com so the extension shows its native login screen.
752
745
  */
753
746
  async unlinkVscode(): Promise<{ paths: string[]; linked: boolean }> {
754
747
  const bingoSettings = await this.readSettings()
755
748
  const linkedPaths = (bingoSettings.vscodeLinkedPaths as string[]) || []
756
749
 
757
- // Restore bingo env to pre-link state
758
- const preLinkEnv = bingoSettings.vscodePreLinkEnv
759
- if (preLinkEnv !== undefined) {
760
- if (preLinkEnv === null || Object.keys(preLinkEnv as Record<string, unknown>).length === 0) {
761
- delete bingoSettings.env
762
- } else {
763
- bingoSettings.env = preLinkEnv
764
- }
765
- delete bingoSettings.vscodePreLinkEnv
766
- }
767
-
768
- // Fix #8: Restore original claudeCode snapshot per-path instead of a hardcoded stub.
769
- // Fall back to { preferredLocation: "panel" } when no snapshot exists for a path.
750
+ // Restore original claudeCode snapshot per-path. Fall back to a clean
770
751
  const preLinkClaudeCode =
771
752
  (bingoSettings.vscodePreLinkClaudeCode as Record<string, unknown> | undefined) || {}
772
753
 
@@ -774,7 +755,12 @@ export class ProviderService {
774
755
  try {
775
756
  const raw = await fs.readFile(settingsPath, "utf-8")
776
757
  const settings = JSON.parse(raw)
777
- settings.claudeCode = preLinkClaudeCode[settingsPath] ?? { preferredLocation: "panel" }
758
+ settings.claudeCode = preLinkClaudeCode[settingsPath] ?? {
759
+ preferredLocation: "panel",
760
+ environmentVariables: [
761
+ { name: "ANTHROPIC_BASE_URL", value: "https://api.anthropic.com" },
762
+ ],
763
+ }
778
764
  await fs.writeFile(settingsPath, JSON.stringify(settings, null, 4) + '\n')
779
765
  } catch {
780
766
  // File may have been moved or deleted since linking — harmless
@@ -784,6 +770,7 @@ export class ProviderService {
784
770
  bingoSettings.vscodeLinked = false
785
771
  delete bingoSettings.vscodeLinkedPaths
786
772
  delete bingoSettings.vscodePreLinkClaudeCode
773
+ delete bingoSettings.vscodePreLinkEnv
787
774
  await this.writeSettings(bingoSettings)
788
775
 
789
776
  return { paths: linkedPaths, linked: false }
package/src/tools.ts CHANGED
@@ -87,8 +87,6 @@ import { TaskListTool } from './tools/TaskListTool/TaskListTool.js'
87
87
  import uniqBy from 'lodash-es/uniqBy.js'
88
88
  import { isToolSearchEnabledOptimistic } from './utils/toolSearch.js'
89
89
  import { isTodoV2Enabled } from './utils/tasks.js'
90
- import { getInitialSettings } from './utils/settings/settings.js'
91
- import { getCurrentSessionBrainMode } from './utils/sessionStorage.js'
92
90
  // Dead code elimination: conditional import for CLAUDE_CODE_VERIFY_PLAN
93
91
  /* eslint-disable custom-rules/no-process-env-top-level, @typescript-eslint/no-require-imports */
94
92
  const VerifyPlanExecutionTool =
@@ -271,13 +269,9 @@ export function filterToolsByDenyRules<
271
269
  return tools.filter(tool => !getDenyRuleForTool(permissionContext, tool))
272
270
  }
273
271
 
274
- function isBrainModeActive(): boolean {
275
- return getInitialSettings().brainMode === true || getCurrentSessionBrainMode() === true
276
- }
277
-
278
272
  export const getTools = (permissionContext: ToolPermissionContext, brainMode?: boolean): Tools => {
279
273
  // Brain mode: coordinator only needs Agent + AskUserQuestion
280
- if (brainMode ?? isBrainModeActive()) {
274
+ if (brainMode) {
281
275
  return filterToolsByDenyRules([AgentTool, AskUserQuestionTool], permissionContext)
282
276
  }
283
277
 
@@ -359,7 +353,7 @@ export function assembleToolPool(
359
353
  mcpTools: Tools,
360
354
  brainMode?: boolean,
361
355
  ): Tools {
362
- const effectiveBrainMode = brainMode ?? isBrainModeActive()
356
+ const effectiveBrainMode = brainMode ?? false
363
357
  const builtInTools = getTools(permissionContext, effectiveBrainMode)
364
358
 
365
359
  // When brainMode is active, skip MCP tools entirely