@verboo/code 0.13.2 → 0.13.4

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.mjs +528 -452
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -140171,6 +140171,9 @@ function getAuthTokenSource() {
140171
140171
  }
140172
140172
  return { source: "none", hasToken: false };
140173
140173
  }
140174
+ if (isVerbooMode() && getStoredVerbooOAuthTokens()) {
140175
+ return { source: "claude.ai", hasToken: true };
140176
+ }
140174
140177
  if (process.env.ANTHROPIC_AUTH_TOKEN && !isManagedOAuthContext()) {
140175
140178
  return { source: "ANTHROPIC_AUTH_TOKEN", hasToken: true };
140176
140179
  }
@@ -140792,6 +140795,24 @@ function saveOAuthTokensIfNeeded(tokens) {
140792
140795
  return { success: false, warning: "Failed to save OAuth tokens" };
140793
140796
  }
140794
140797
  }
140798
+ function getStoredVerbooOAuthTokens() {
140799
+ try {
140800
+ const oauthData = getSecureStorage().read()?.verbooOauth;
140801
+ return oauthData?.accessToken ? oauthData : null;
140802
+ } catch (error41) {
140803
+ logError2(error41);
140804
+ return null;
140805
+ }
140806
+ }
140807
+ async function getStoredVerbooOAuthTokensAsync() {
140808
+ try {
140809
+ const oauthData = (await getSecureStorage().readAsync())?.verbooOauth;
140810
+ return oauthData?.accessToken ? oauthData : null;
140811
+ } catch (error41) {
140812
+ logError2(error41);
140813
+ return null;
140814
+ }
140815
+ }
140795
140816
  function clearOAuthTokenCache() {
140796
140817
  getClaudeAIOAuthTokens.cache?.clear?.();
140797
140818
  clearKeychainCache();
@@ -140832,21 +140853,15 @@ async function handleOAuth401ErrorImpl(failedAccessToken) {
140832
140853
  async function getClaudeAIOAuthTokensAsync() {
140833
140854
  if (isBareMode())
140834
140855
  return null;
140856
+ if (isVerbooMode()) {
140857
+ const storedTokens = await getStoredVerbooOAuthTokensAsync();
140858
+ if (storedTokens)
140859
+ return storedTokens;
140860
+ }
140835
140861
  if (process.env.CLAUDE_CODE_OAUTH_TOKEN || getOAuthTokenFromFileDescriptor()) {
140836
140862
  return getClaudeAIOAuthTokens();
140837
140863
  }
140838
- try {
140839
- const secureStorage = getSecureStorage();
140840
- const storageData = await secureStorage.readAsync();
140841
- const oauthData = storageData?.verbooOauth;
140842
- if (!oauthData?.accessToken) {
140843
- return null;
140844
- }
140845
- return oauthData;
140846
- } catch (error41) {
140847
- logError2(error41);
140848
- return null;
140849
- }
140864
+ return getStoredVerbooOAuthTokensAsync();
140850
140865
  }
140851
140866
  function checkAndRefreshOAuthTokenIfNeeded(retryCount = 0, force = false) {
140852
140867
  if (retryCount === 0 && !force) {
@@ -141251,6 +141266,11 @@ var init_auth = __esm(() => {
141251
141266
  getClaudeAIOAuthTokens = memoize_default(() => {
141252
141267
  if (isBareMode())
141253
141268
  return null;
141269
+ if (isVerbooMode()) {
141270
+ const storedTokens = getStoredVerbooOAuthTokens();
141271
+ if (storedTokens)
141272
+ return storedTokens;
141273
+ }
141254
141274
  if (process.env.CLAUDE_CODE_OAUTH_TOKEN) {
141255
141275
  return {
141256
141276
  accessToken: process.env.CLAUDE_CODE_OAUTH_TOKEN,
@@ -141272,18 +141292,7 @@ var init_auth = __esm(() => {
141272
141292
  rateLimitTier: null
141273
141293
  };
141274
141294
  }
141275
- try {
141276
- const secureStorage = getSecureStorage();
141277
- const storageData = secureStorage.read();
141278
- const oauthData = storageData?.verbooOauth;
141279
- if (!oauthData?.accessToken) {
141280
- return null;
141281
- }
141282
- return oauthData;
141283
- } catch (error41) {
141284
- logError2(error41);
141285
- return null;
141286
- }
141295
+ return getStoredVerbooOAuthTokens();
141287
141296
  });
141288
141297
  pending401Handlers = new Map;
141289
141298
  GcpCredentialsTimeoutError = class GcpCredentialsTimeoutError extends Error {
@@ -169750,7 +169759,7 @@ function getClaudeCodeUserAgent() {
169750
169759
  return `claude-code/${"99.0.0"}`;
169751
169760
  }
169752
169761
  function getVerbooCodeUserAgent() {
169753
- const version2 = typeof MACRO !== "undefined" ? "0.13.2" : "unknown";
169762
+ const version2 = typeof MACRO !== "undefined" ? "0.13.4" : "unknown";
169754
169763
  return `verboo-code/${version2}`;
169755
169764
  }
169756
169765
 
@@ -173801,8 +173810,9 @@ class OpenAIShimMessages {
173801
173810
  processEnv: process.env
173802
173811
  });
173803
173812
  const getApiKey = () => this.providerOverride?.getApiKey?.() ?? this.providerOverride?.apiKey ?? routeCredential ?? process.env.OPENAI_API_KEY ?? "";
173804
- const configuredAuthHeaderValue = process.env.OPENAI_AUTH_HEADER_VALUE?.trim();
173805
- const customAuthHeader = process.env.OPENAI_AUTH_HEADER?.trim();
173813
+ const usesVerbooRouter = isVerbooRouterUrl(request.baseUrl);
173814
+ const configuredAuthHeaderValue = usesVerbooRouter ? undefined : process.env.OPENAI_AUTH_HEADER_VALUE?.trim();
173815
+ const customAuthHeader = usesVerbooRouter ? undefined : process.env.OPENAI_AUTH_HEADER?.trim();
173806
173816
  const hasCustomAuthHeader = Boolean(customAuthHeader && /^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/.test(customAuthHeader));
173807
173817
  const applyAuthHeader = () => {
173808
173818
  const apiKey = getApiKey();
@@ -299360,14 +299370,17 @@ ${url3}
299360
299370
  onAuthUrl
299361
299371
  });
299362
299372
  await installVerbooOAuthTokens(tokens);
299363
- await validateVerbooSession();
299373
+ const confirmedSession = await validateVerbooSession();
299374
+ if (confirmedSession.kind === "unauthenticated") {
299375
+ throw new Error("A sessão recém-autenticada foi rejeitada pelo Verboo. Feche variáveis de credencial herdadas do terminal e tente `verboo /login` novamente.");
299376
+ }
299364
299377
  process.stdout.write(`
299365
299378
  ✓ Autenticação concluída.
299366
299379
 
299367
299380
  `);
299368
299381
  saveGlobalConfig((current) => current.hasCompletedOnboarding ? current : { ...current, hasCompletedOnboarding: true });
299382
+ await loadAndCheckModels(confirmedSession.kind === "ok" ? confirmedSession.tokens.accessToken : tokens.accessToken);
299369
299383
  validated = true;
299370
- await loadAndCheckModels(tokens.accessToken);
299371
299384
  }
299372
299385
  var validated = false;
299373
299386
  var init_verbooStartupAuth = __esm(() => {
@@ -393973,7 +393986,7 @@ function getAnthropicEnvMetadata() {
393973
393986
  function getBuildAgeMinutes() {
393974
393987
  if (false)
393975
393988
  ;
393976
- const buildTime = new Date("2026-07-15T01:49:30.886Z").getTime();
393989
+ const buildTime = new Date("2026-07-15T13:23:40.197Z").getTime();
393977
393990
  if (isNaN(buildTime))
393978
393991
  return;
393979
393992
  return Math.floor((Date.now() - buildTime) / 60000);
@@ -422228,7 +422241,7 @@ function buildPrimarySection() {
422228
422241
  });
422229
422242
  return [{
422230
422243
  label: "Version",
422231
- value: "0.13.2"
422244
+ value: "0.13.4"
422232
422245
  }, {
422233
422246
  label: "Session name",
422234
422247
  value: nameValue
@@ -435157,7 +435170,7 @@ function getReleaseTagUrl(version2 = publicBuildVersion) {
435157
435170
  return `${VERBOO_RELEASES_URL}/tag/v${normalizePublicVersion(version2)}`;
435158
435171
  }
435159
435172
  function getPublicBuildVersion() {
435160
- return "0.13.2";
435173
+ return "0.13.4";
435161
435174
  }
435162
435175
  var import_semver10, VERBOO_RELEASES_URL = "https://github.com/verbeux-ai/code/releases", fallbackBuildVersion, publicBuildVersion;
435163
435176
  var init_version = __esm(() => {
@@ -437643,6 +437656,421 @@ var init_keybindings2 = __esm(() => {
437643
437656
  keybindings_default = keybindings;
437644
437657
  });
437645
437658
 
437659
+ // src/utils/plugins/officialMarketplaceStartupCheck.ts
437660
+ import { join as join114 } from "path";
437661
+ function isOfficialMarketplaceAutoInstallDisabled() {
437662
+ return isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL);
437663
+ }
437664
+ function calculateNextRetryDelay(retryCount) {
437665
+ const delay = RETRY_CONFIG.INITIAL_DELAY_MS * Math.pow(RETRY_CONFIG.BACKOFF_MULTIPLIER, retryCount);
437666
+ return Math.min(delay, RETRY_CONFIG.MAX_DELAY_MS);
437667
+ }
437668
+ function shouldRetryInstallation(config3) {
437669
+ if (!config3.officialMarketplaceAutoInstallAttempted) {
437670
+ return true;
437671
+ }
437672
+ const failReason = config3.officialMarketplaceAutoInstallFailReason;
437673
+ const retryCount = config3.officialMarketplaceAutoInstallRetryCount || 0;
437674
+ const nextRetryTime = config3.officialMarketplaceAutoInstallNextRetryTime;
437675
+ const now2 = Date.now();
437676
+ if (retryCount >= RETRY_CONFIG.MAX_ATTEMPTS) {
437677
+ return false;
437678
+ }
437679
+ if (failReason === "policy_blocked") {
437680
+ return false;
437681
+ }
437682
+ if (nextRetryTime && now2 < nextRetryTime) {
437683
+ return false;
437684
+ }
437685
+ return failReason === "unknown" || failReason === "git_unavailable" || failReason === "gcs_unavailable" || failReason === undefined;
437686
+ }
437687
+ async function persistVerbooMarketplaceAutoUpdateDefault() {
437688
+ const knownMarketplaces = await loadKnownMarketplacesConfig();
437689
+ const entry = knownMarketplaces[VERBOO_MARKETPLACE_NAME];
437690
+ if (!entry || entry.autoUpdate !== undefined)
437691
+ return;
437692
+ knownMarketplaces[VERBOO_MARKETPLACE_NAME] = {
437693
+ ...entry,
437694
+ autoUpdate: true
437695
+ };
437696
+ await saveKnownMarketplacesConfig(knownMarketplaces);
437697
+ }
437698
+ function shouldRetryNativeMarketplaceInstallation(state2) {
437699
+ if (!state2?.attempted)
437700
+ return true;
437701
+ if ((state2.retryCount ?? 0) >= RETRY_CONFIG.MAX_ATTEMPTS)
437702
+ return false;
437703
+ if (state2.failReason === "policy_blocked")
437704
+ return false;
437705
+ if (state2.nextRetryTime && Date.now() < state2.nextRetryTime)
437706
+ return false;
437707
+ return true;
437708
+ }
437709
+ function saveNativeMarketplaceAutoInstallState(name, update) {
437710
+ saveGlobalConfig((current) => ({
437711
+ ...current,
437712
+ nativeMarketplaceAutoInstall: {
437713
+ ...current.nativeMarketplaceAutoInstall,
437714
+ [name]: {
437715
+ ...current.nativeMarketplaceAutoInstall?.[name],
437716
+ ...update
437717
+ }
437718
+ }
437719
+ }));
437720
+ }
437721
+ function checkAndInstallVerbooMarketplace() {
437722
+ if (!verbooMarketplaceAutoInstallPromise) {
437723
+ const promise3 = checkAndInstallVerbooMarketplaceImpl();
437724
+ verbooMarketplaceAutoInstallPromise = promise3;
437725
+ promise3.then(() => {
437726
+ if (verbooMarketplaceAutoInstallPromise === promise3) {
437727
+ verbooMarketplaceAutoInstallPromise = undefined;
437728
+ }
437729
+ }, () => {
437730
+ if (verbooMarketplaceAutoInstallPromise === promise3) {
437731
+ verbooMarketplaceAutoInstallPromise = undefined;
437732
+ }
437733
+ });
437734
+ }
437735
+ return verbooMarketplaceAutoInstallPromise;
437736
+ }
437737
+ async function checkAndInstallVerbooMarketplaceImpl() {
437738
+ const config3 = getGlobalConfig();
437739
+ const state2 = config3.nativeMarketplaceAutoInstall?.[VERBOO_MARKETPLACE_NAME];
437740
+ try {
437741
+ const knownMarketplaces = await loadKnownMarketplacesConfig();
437742
+ if (knownMarketplaces[VERBOO_MARKETPLACE_NAME]) {
437743
+ await persistVerbooMarketplaceAutoUpdateDefault();
437744
+ saveNativeMarketplaceAutoInstallState(VERBOO_MARKETPLACE_NAME, {
437745
+ attempted: true,
437746
+ installed: true,
437747
+ failReason: undefined,
437748
+ retryCount: undefined,
437749
+ lastAttemptTime: undefined,
437750
+ nextRetryTime: undefined
437751
+ });
437752
+ return { installed: false, skipped: true, reason: "already_installed" };
437753
+ }
437754
+ if (!shouldRetryNativeMarketplaceInstallation(state2)) {
437755
+ return {
437756
+ installed: false,
437757
+ skipped: true,
437758
+ reason: state2?.failReason ?? "already_attempted"
437759
+ };
437760
+ }
437761
+ if (isOfficialMarketplaceAutoInstallDisabled()) {
437762
+ saveNativeMarketplaceAutoInstallState(VERBOO_MARKETPLACE_NAME, {
437763
+ attempted: true,
437764
+ installed: false,
437765
+ failReason: "policy_blocked"
437766
+ });
437767
+ return { installed: false, skipped: true, reason: "policy_blocked" };
437768
+ }
437769
+ if (!isSourceAllowedByPolicy(VERBOO_MARKETPLACE_SOURCE)) {
437770
+ saveNativeMarketplaceAutoInstallState(VERBOO_MARKETPLACE_NAME, {
437771
+ attempted: true,
437772
+ installed: false,
437773
+ failReason: "policy_blocked"
437774
+ });
437775
+ return { installed: false, skipped: true, reason: "policy_blocked" };
437776
+ }
437777
+ logForDebugging("Attempting to auto-install Verboo marketplace");
437778
+ await addMarketplaceSource(VERBOO_MARKETPLACE_SOURCE);
437779
+ await persistVerbooMarketplaceAutoUpdateDefault();
437780
+ saveNativeMarketplaceAutoInstallState(VERBOO_MARKETPLACE_NAME, {
437781
+ attempted: true,
437782
+ installed: true,
437783
+ failReason: undefined,
437784
+ retryCount: undefined,
437785
+ lastAttemptTime: undefined,
437786
+ nextRetryTime: undefined
437787
+ });
437788
+ logEvent("tengu_official_marketplace_auto_install", {
437789
+ installed: true,
437790
+ skipped: false,
437791
+ verboo_marketplace: true
437792
+ });
437793
+ return { installed: true, skipped: false };
437794
+ } catch (error42) {
437795
+ const retryCount = (state2?.retryCount ?? 0) + 1;
437796
+ const now2 = Date.now();
437797
+ let configSaveFailed = false;
437798
+ try {
437799
+ saveNativeMarketplaceAutoInstallState(VERBOO_MARKETPLACE_NAME, {
437800
+ attempted: true,
437801
+ installed: false,
437802
+ failReason: "unknown",
437803
+ retryCount,
437804
+ lastAttemptTime: now2,
437805
+ nextRetryTime: now2 + calculateNextRetryDelay(retryCount)
437806
+ });
437807
+ } catch (saveError) {
437808
+ configSaveFailed = true;
437809
+ logError2(toError(saveError));
437810
+ }
437811
+ logForDebugging(`Failed to auto-install Verboo marketplace: ${error42 instanceof Error ? error42.message : String(error42)}`, { level: "error" });
437812
+ logError2(toError(error42));
437813
+ logEvent("tengu_official_marketplace_auto_install", {
437814
+ installed: false,
437815
+ skipped: true,
437816
+ failed: true,
437817
+ verboo_marketplace: true,
437818
+ retry_count: retryCount
437819
+ });
437820
+ return {
437821
+ installed: false,
437822
+ skipped: true,
437823
+ reason: "unknown",
437824
+ configSaveFailed
437825
+ };
437826
+ }
437827
+ }
437828
+ async function prepareVerbooMarketplaceForExplicitInstall() {
437829
+ await checkAndInstallVerbooMarketplace();
437830
+ const knownMarketplaces = await loadKnownMarketplacesConfig();
437831
+ if (!knownMarketplaces[VERBOO_MARKETPLACE_NAME]) {
437832
+ await addMarketplaceSource(VERBOO_MARKETPLACE_SOURCE);
437833
+ }
437834
+ await persistVerbooMarketplaceAutoUpdateDefault();
437835
+ await refreshMarketplace(VERBOO_MARKETPLACE_NAME);
437836
+ }
437837
+ async function checkAndInstallNativeMarketplaces() {
437838
+ const verboo = await checkAndInstallVerbooMarketplace();
437839
+ const claude = await checkAndInstallOfficialMarketplace();
437840
+ return { verboo, claude };
437841
+ }
437842
+ async function checkAndInstallOfficialMarketplace() {
437843
+ const config3 = getGlobalConfig();
437844
+ try {
437845
+ const knownMarketplaces = await loadKnownMarketplacesConfig();
437846
+ if (knownMarketplaces[CLAUDE_MARKETPLACE_NAME]) {
437847
+ logForDebugging(`Official marketplace '${CLAUDE_MARKETPLACE_NAME}' already installed, skipping`);
437848
+ saveGlobalConfig((current) => ({
437849
+ ...current,
437850
+ officialMarketplaceAutoInstallAttempted: true,
437851
+ officialMarketplaceAutoInstalled: true
437852
+ }));
437853
+ return { installed: false, skipped: true, reason: "already_installed" };
437854
+ }
437855
+ if (!shouldRetryInstallation(config3)) {
437856
+ const reason = config3.officialMarketplaceAutoInstallFailReason ?? "already_attempted";
437857
+ logForDebugging(`Official marketplace auto-install skipped: ${reason}`);
437858
+ return {
437859
+ installed: false,
437860
+ skipped: true,
437861
+ reason
437862
+ };
437863
+ }
437864
+ if (isOfficialMarketplaceAutoInstallDisabled()) {
437865
+ logForDebugging("Official marketplace auto-install disabled via env var, skipping");
437866
+ saveGlobalConfig((current) => ({
437867
+ ...current,
437868
+ officialMarketplaceAutoInstallAttempted: true,
437869
+ officialMarketplaceAutoInstalled: false,
437870
+ officialMarketplaceAutoInstallFailReason: "policy_blocked"
437871
+ }));
437872
+ logEvent("tengu_official_marketplace_auto_install", {
437873
+ installed: false,
437874
+ skipped: true,
437875
+ policy_blocked: true
437876
+ });
437877
+ return { installed: false, skipped: true, reason: "policy_blocked" };
437878
+ }
437879
+ if (!isSourceAllowedByPolicy(CLAUDE_MARKETPLACE_SOURCE)) {
437880
+ logForDebugging("Official marketplace blocked by enterprise policy, skipping");
437881
+ saveGlobalConfig((current) => ({
437882
+ ...current,
437883
+ officialMarketplaceAutoInstallAttempted: true,
437884
+ officialMarketplaceAutoInstalled: false,
437885
+ officialMarketplaceAutoInstallFailReason: "policy_blocked"
437886
+ }));
437887
+ logEvent("tengu_official_marketplace_auto_install", {
437888
+ installed: false,
437889
+ skipped: true,
437890
+ policy_blocked: true
437891
+ });
437892
+ return { installed: false, skipped: true, reason: "policy_blocked" };
437893
+ }
437894
+ const cacheDir = getMarketplacesCacheDir();
437895
+ const installLocation = join114(cacheDir, CLAUDE_MARKETPLACE_NAME);
437896
+ const gcsSha = await fetchOfficialMarketplaceFromGcs(installLocation, cacheDir);
437897
+ if (gcsSha !== null) {
437898
+ const known = await loadKnownMarketplacesConfig();
437899
+ known[CLAUDE_MARKETPLACE_NAME] = {
437900
+ source: CLAUDE_MARKETPLACE_SOURCE,
437901
+ installLocation,
437902
+ lastUpdated: new Date().toISOString()
437903
+ };
437904
+ await saveKnownMarketplacesConfig(known);
437905
+ saveGlobalConfig((current) => ({
437906
+ ...current,
437907
+ officialMarketplaceAutoInstallAttempted: true,
437908
+ officialMarketplaceAutoInstalled: true,
437909
+ officialMarketplaceAutoInstallFailReason: undefined,
437910
+ officialMarketplaceAutoInstallRetryCount: undefined,
437911
+ officialMarketplaceAutoInstallLastAttemptTime: undefined,
437912
+ officialMarketplaceAutoInstallNextRetryTime: undefined
437913
+ }));
437914
+ logEvent("tengu_official_marketplace_auto_install", {
437915
+ installed: true,
437916
+ skipped: false,
437917
+ via_gcs: true
437918
+ });
437919
+ return { installed: true, skipped: false };
437920
+ }
437921
+ if (!getFeatureValue_CACHED_MAY_BE_STALE("tengu_plugin_official_mkt_git_fallback", true)) {
437922
+ logForDebugging("Official marketplace GCS failed; git fallback disabled by flag — skipping install");
437923
+ const retryCount = (config3.officialMarketplaceAutoInstallRetryCount || 0) + 1;
437924
+ const now2 = Date.now();
437925
+ const nextRetryTime = now2 + calculateNextRetryDelay(retryCount);
437926
+ saveGlobalConfig((current) => ({
437927
+ ...current,
437928
+ officialMarketplaceAutoInstallAttempted: true,
437929
+ officialMarketplaceAutoInstalled: false,
437930
+ officialMarketplaceAutoInstallFailReason: "gcs_unavailable",
437931
+ officialMarketplaceAutoInstallRetryCount: retryCount,
437932
+ officialMarketplaceAutoInstallLastAttemptTime: now2,
437933
+ officialMarketplaceAutoInstallNextRetryTime: nextRetryTime
437934
+ }));
437935
+ logEvent("tengu_official_marketplace_auto_install", {
437936
+ installed: false,
437937
+ skipped: true,
437938
+ gcs_unavailable: true,
437939
+ retry_count: retryCount
437940
+ });
437941
+ return { installed: false, skipped: true, reason: "gcs_unavailable" };
437942
+ }
437943
+ const gitAvailable = await checkGitAvailable();
437944
+ if (!gitAvailable) {
437945
+ logForDebugging("Git not available, skipping official marketplace auto-install");
437946
+ const retryCount = (config3.officialMarketplaceAutoInstallRetryCount || 0) + 1;
437947
+ const now2 = Date.now();
437948
+ const nextRetryDelay = calculateNextRetryDelay(retryCount);
437949
+ const nextRetryTime = now2 + nextRetryDelay;
437950
+ let configSaveFailed = false;
437951
+ try {
437952
+ saveGlobalConfig((current) => ({
437953
+ ...current,
437954
+ officialMarketplaceAutoInstallAttempted: true,
437955
+ officialMarketplaceAutoInstalled: false,
437956
+ officialMarketplaceAutoInstallFailReason: "git_unavailable",
437957
+ officialMarketplaceAutoInstallRetryCount: retryCount,
437958
+ officialMarketplaceAutoInstallLastAttemptTime: now2,
437959
+ officialMarketplaceAutoInstallNextRetryTime: nextRetryTime
437960
+ }));
437961
+ } catch (saveError) {
437962
+ configSaveFailed = true;
437963
+ const configError = toError(saveError);
437964
+ logError2(configError);
437965
+ logForDebugging(`Failed to save marketplace auto-install git_unavailable state: ${saveError}`, { level: "error" });
437966
+ }
437967
+ logEvent("tengu_official_marketplace_auto_install", {
437968
+ installed: false,
437969
+ skipped: true,
437970
+ git_unavailable: true,
437971
+ retry_count: retryCount
437972
+ });
437973
+ return {
437974
+ installed: false,
437975
+ skipped: true,
437976
+ reason: "git_unavailable",
437977
+ configSaveFailed
437978
+ };
437979
+ }
437980
+ logForDebugging("Attempting to auto-install official marketplace");
437981
+ await addMarketplaceSource(CLAUDE_MARKETPLACE_SOURCE);
437982
+ logForDebugging("Successfully auto-installed official marketplace");
437983
+ const previousRetryCount = config3.officialMarketplaceAutoInstallRetryCount || 0;
437984
+ saveGlobalConfig((current) => ({
437985
+ ...current,
437986
+ officialMarketplaceAutoInstallAttempted: true,
437987
+ officialMarketplaceAutoInstalled: true,
437988
+ officialMarketplaceAutoInstallFailReason: undefined,
437989
+ officialMarketplaceAutoInstallRetryCount: undefined,
437990
+ officialMarketplaceAutoInstallLastAttemptTime: undefined,
437991
+ officialMarketplaceAutoInstallNextRetryTime: undefined
437992
+ }));
437993
+ logEvent("tengu_official_marketplace_auto_install", {
437994
+ installed: true,
437995
+ skipped: false,
437996
+ retry_count: previousRetryCount
437997
+ });
437998
+ return { installed: true, skipped: false };
437999
+ } catch (error42) {
438000
+ const errorMessage2 = error42 instanceof Error ? error42.message : String(error42);
438001
+ if (errorMessage2.includes("xcrun: error:")) {
438002
+ markGitUnavailable();
438003
+ logForDebugging("Official marketplace auto-install: git is a non-functional macOS xcrun shim, treating as git_unavailable");
438004
+ logEvent("tengu_official_marketplace_auto_install", {
438005
+ installed: false,
438006
+ skipped: true,
438007
+ git_unavailable: true,
438008
+ macos_xcrun_shim: true
438009
+ });
438010
+ return {
438011
+ installed: false,
438012
+ skipped: true,
438013
+ reason: "git_unavailable"
438014
+ };
438015
+ }
438016
+ logForDebugging(`Failed to auto-install official marketplace: ${errorMessage2}`, { level: "error" });
438017
+ logError2(toError(error42));
438018
+ const retryCount = (config3.officialMarketplaceAutoInstallRetryCount || 0) + 1;
438019
+ const now2 = Date.now();
438020
+ const nextRetryDelay = calculateNextRetryDelay(retryCount);
438021
+ const nextRetryTime = now2 + nextRetryDelay;
438022
+ let configSaveFailed = false;
438023
+ try {
438024
+ saveGlobalConfig((current) => ({
438025
+ ...current,
438026
+ officialMarketplaceAutoInstallAttempted: true,
438027
+ officialMarketplaceAutoInstalled: false,
438028
+ officialMarketplaceAutoInstallFailReason: "unknown",
438029
+ officialMarketplaceAutoInstallRetryCount: retryCount,
438030
+ officialMarketplaceAutoInstallLastAttemptTime: now2,
438031
+ officialMarketplaceAutoInstallNextRetryTime: nextRetryTime
438032
+ }));
438033
+ } catch (saveError) {
438034
+ configSaveFailed = true;
438035
+ const configError = toError(saveError);
438036
+ logError2(configError);
438037
+ logForDebugging(`Failed to save marketplace auto-install failure state: ${saveError}`, { level: "error" });
438038
+ }
438039
+ logEvent("tengu_official_marketplace_auto_install", {
438040
+ installed: false,
438041
+ skipped: true,
438042
+ failed: true,
438043
+ retry_count: retryCount
438044
+ });
438045
+ return {
438046
+ installed: false,
438047
+ skipped: true,
438048
+ reason: "unknown",
438049
+ configSaveFailed
438050
+ };
438051
+ }
438052
+ }
438053
+ var RETRY_CONFIG, verbooMarketplaceAutoInstallPromise;
438054
+ var init_officialMarketplaceStartupCheck = __esm(() => {
438055
+ init_growthbook();
438056
+ init_config7();
438057
+ init_debug();
438058
+ init_envUtils();
438059
+ init_errors();
438060
+ init_log3();
438061
+ init_gitAvailability();
438062
+ init_marketplaceHelpers();
438063
+ init_marketplaceManager();
438064
+ init_officialMarketplace();
438065
+ init_officialMarketplaceGcs();
438066
+ RETRY_CONFIG = {
438067
+ MAX_ATTEMPTS: 10,
438068
+ INITIAL_DELAY_MS: 60 * 60 * 1000,
438069
+ BACKOFF_MULTIPLIER: 2,
438070
+ MAX_DELAY_MS: 7 * 24 * 60 * 60 * 1000
438071
+ };
438072
+ });
438073
+
437646
438074
  // src/utils/plugins/pluginStartupCheck.ts
437647
438075
  var exports_pluginStartupCheck = {};
437648
438076
  __export(exports_pluginStartupCheck, {
@@ -437654,7 +438082,7 @@ __export(exports_pluginStartupCheck, {
437654
438082
  findMissingPlugins: () => findMissingPlugins,
437655
438083
  checkEnabledPlugins: () => checkEnabledPlugins
437656
438084
  });
437657
- import { join as join114 } from "path";
438085
+ import { join as join115 } from "path";
437658
438086
  async function checkEnabledPlugins() {
437659
438087
  const settings = getInitialSettings();
437660
438088
  const enabledPlugins = [];
@@ -437789,7 +438217,7 @@ async function installSelectedPlugins(pluginsToInstall, onProgress, scope = "use
437789
438217
  } else {
437790
438218
  registerPluginInstallation({
437791
438219
  pluginId,
437792
- installPath: join114(marketplaceInstallLocation, entry.source),
438220
+ installPath: join115(marketplaceInstallLocation, entry.source),
437793
438221
  version: entry.version
437794
438222
  }, scope, projectPath);
437795
438223
  }
@@ -437821,7 +438249,7 @@ var init_pluginStartupCheck = __esm(() => {
437821
438249
  });
437822
438250
 
437823
438251
  // src/services/plugins/pluginOperations.ts
437824
- import { dirname as dirname52, join as join115 } from "path";
438252
+ import { dirname as dirname52, join as join116 } from "path";
437825
438253
  function assertInstallableScope(scope) {
437826
438254
  if (!VALID_INSTALLABLE_SCOPES.includes(scope)) {
437827
438255
  throw new Error(`Invalid scope "${scope}". Must be one of: ${VALID_INSTALLABLE_SCOPES.join(", ")}`);
@@ -437907,6 +438335,16 @@ function getPluginInstallationFromV2(pluginId) {
437907
438335
  async function installPluginOp(plugin, scope = "user") {
437908
438336
  assertInstallableScope(scope);
437909
438337
  const { name: pluginName, marketplace: marketplaceName } = parsePluginIdentifier(plugin);
438338
+ if (marketplaceName?.toLowerCase() === VERBOO_MARKETPLACE_NAME) {
438339
+ try {
438340
+ await prepareVerbooMarketplaceForExplicitInstall();
438341
+ } catch (error42) {
438342
+ return {
438343
+ success: false,
438344
+ message: `Could not refresh Verboo marketplace before installing "${pluginName}": ` + errorMessage(error42)
438345
+ };
438346
+ }
438347
+ }
437910
438348
  let foundPlugin;
437911
438349
  let foundMarketplace;
437912
438350
  let marketplaceInstallLocation;
@@ -438299,7 +438737,7 @@ async function performPluginUpdate({
438299
438737
  throw e2;
438300
438738
  }
438301
438739
  const marketplaceDir = marketplaceStats.isDirectory() ? marketplaceInstallLocation : dirname52(marketplaceInstallLocation);
438302
- sourcePath = join115(marketplaceDir, entry.source);
438740
+ sourcePath = join116(marketplaceDir, entry.source);
438303
438741
  try {
438304
438742
  await fs3.stat(sourcePath);
438305
438743
  } catch (e2) {
@@ -438314,7 +438752,7 @@ async function performPluginUpdate({
438314
438752
  throw e2;
438315
438753
  }
438316
438754
  let pluginManifest;
438317
- const manifestPath = join115(sourcePath, ".claude-plugin", "plugin.json");
438755
+ const manifestPath = join116(sourcePath, ".claude-plugin", "plugin.json");
438318
438756
  try {
438319
438757
  pluginManifest = await loadPluginManifest(manifestPath, entry.name, entry.source);
438320
438758
  } catch {}
@@ -438372,6 +438810,8 @@ var init_pluginOperations = __esm(() => {
438372
438810
  init_dependencyResolver();
438373
438811
  init_installedPluginsManager();
438374
438812
  init_marketplaceManager();
438813
+ init_officialMarketplace();
438814
+ init_officialMarketplaceStartupCheck();
438375
438815
  init_pluginDirectories();
438376
438816
  init_pluginIdentifier();
438377
438817
  init_pluginInstallationHelpers();
@@ -438618,383 +439058,6 @@ var init_lspRecommendation = __esm(() => {
438618
439058
  init_officialMarketplace();
438619
439059
  });
438620
439060
 
438621
- // src/utils/plugins/officialMarketplaceStartupCheck.ts
438622
- import { join as join116 } from "path";
438623
- function isOfficialMarketplaceAutoInstallDisabled() {
438624
- return isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL);
438625
- }
438626
- function calculateNextRetryDelay(retryCount) {
438627
- const delay = RETRY_CONFIG.INITIAL_DELAY_MS * Math.pow(RETRY_CONFIG.BACKOFF_MULTIPLIER, retryCount);
438628
- return Math.min(delay, RETRY_CONFIG.MAX_DELAY_MS);
438629
- }
438630
- function shouldRetryInstallation(config3) {
438631
- if (!config3.officialMarketplaceAutoInstallAttempted) {
438632
- return true;
438633
- }
438634
- const failReason = config3.officialMarketplaceAutoInstallFailReason;
438635
- const retryCount = config3.officialMarketplaceAutoInstallRetryCount || 0;
438636
- const nextRetryTime = config3.officialMarketplaceAutoInstallNextRetryTime;
438637
- const now2 = Date.now();
438638
- if (retryCount >= RETRY_CONFIG.MAX_ATTEMPTS) {
438639
- return false;
438640
- }
438641
- if (failReason === "policy_blocked") {
438642
- return false;
438643
- }
438644
- if (nextRetryTime && now2 < nextRetryTime) {
438645
- return false;
438646
- }
438647
- return failReason === "unknown" || failReason === "git_unavailable" || failReason === "gcs_unavailable" || failReason === undefined;
438648
- }
438649
- function shouldRetryNativeMarketplaceInstallation(state2) {
438650
- if (!state2?.attempted)
438651
- return true;
438652
- if ((state2.retryCount ?? 0) >= RETRY_CONFIG.MAX_ATTEMPTS)
438653
- return false;
438654
- if (state2.failReason === "policy_blocked")
438655
- return false;
438656
- if (state2.nextRetryTime && Date.now() < state2.nextRetryTime)
438657
- return false;
438658
- return true;
438659
- }
438660
- function saveNativeMarketplaceAutoInstallState(name, update) {
438661
- saveGlobalConfig((current) => ({
438662
- ...current,
438663
- nativeMarketplaceAutoInstall: {
438664
- ...current.nativeMarketplaceAutoInstall,
438665
- [name]: {
438666
- ...current.nativeMarketplaceAutoInstall?.[name],
438667
- ...update
438668
- }
438669
- }
438670
- }));
438671
- }
438672
- async function checkAndInstallVerbooMarketplace() {
438673
- const config3 = getGlobalConfig();
438674
- const state2 = config3.nativeMarketplaceAutoInstall?.[VERBOO_MARKETPLACE_NAME];
438675
- try {
438676
- const knownMarketplaces = await loadKnownMarketplacesConfig();
438677
- if (knownMarketplaces[VERBOO_MARKETPLACE_NAME]) {
438678
- saveNativeMarketplaceAutoInstallState(VERBOO_MARKETPLACE_NAME, {
438679
- attempted: true,
438680
- installed: true,
438681
- failReason: undefined,
438682
- retryCount: undefined,
438683
- lastAttemptTime: undefined,
438684
- nextRetryTime: undefined
438685
- });
438686
- return { installed: false, skipped: true, reason: "already_installed" };
438687
- }
438688
- if (!shouldRetryNativeMarketplaceInstallation(state2)) {
438689
- return {
438690
- installed: false,
438691
- skipped: true,
438692
- reason: state2?.failReason ?? "already_attempted"
438693
- };
438694
- }
438695
- if (isOfficialMarketplaceAutoInstallDisabled()) {
438696
- saveNativeMarketplaceAutoInstallState(VERBOO_MARKETPLACE_NAME, {
438697
- attempted: true,
438698
- installed: false,
438699
- failReason: "policy_blocked"
438700
- });
438701
- return { installed: false, skipped: true, reason: "policy_blocked" };
438702
- }
438703
- if (!isSourceAllowedByPolicy(VERBOO_MARKETPLACE_SOURCE)) {
438704
- saveNativeMarketplaceAutoInstallState(VERBOO_MARKETPLACE_NAME, {
438705
- attempted: true,
438706
- installed: false,
438707
- failReason: "policy_blocked"
438708
- });
438709
- return { installed: false, skipped: true, reason: "policy_blocked" };
438710
- }
438711
- logForDebugging("Attempting to auto-install Verboo marketplace");
438712
- await addMarketplaceSource(VERBOO_MARKETPLACE_SOURCE);
438713
- saveNativeMarketplaceAutoInstallState(VERBOO_MARKETPLACE_NAME, {
438714
- attempted: true,
438715
- installed: true,
438716
- failReason: undefined,
438717
- retryCount: undefined,
438718
- lastAttemptTime: undefined,
438719
- nextRetryTime: undefined
438720
- });
438721
- logEvent("tengu_official_marketplace_auto_install", {
438722
- installed: true,
438723
- skipped: false,
438724
- verboo_marketplace: true
438725
- });
438726
- return { installed: true, skipped: false };
438727
- } catch (error42) {
438728
- const retryCount = (state2?.retryCount ?? 0) + 1;
438729
- const now2 = Date.now();
438730
- let configSaveFailed = false;
438731
- try {
438732
- saveNativeMarketplaceAutoInstallState(VERBOO_MARKETPLACE_NAME, {
438733
- attempted: true,
438734
- installed: false,
438735
- failReason: "unknown",
438736
- retryCount,
438737
- lastAttemptTime: now2,
438738
- nextRetryTime: now2 + calculateNextRetryDelay(retryCount)
438739
- });
438740
- } catch (saveError) {
438741
- configSaveFailed = true;
438742
- logError2(toError(saveError));
438743
- }
438744
- logForDebugging(`Failed to auto-install Verboo marketplace: ${error42 instanceof Error ? error42.message : String(error42)}`, { level: "error" });
438745
- logError2(toError(error42));
438746
- logEvent("tengu_official_marketplace_auto_install", {
438747
- installed: false,
438748
- skipped: true,
438749
- failed: true,
438750
- verboo_marketplace: true,
438751
- retry_count: retryCount
438752
- });
438753
- return {
438754
- installed: false,
438755
- skipped: true,
438756
- reason: "unknown",
438757
- configSaveFailed
438758
- };
438759
- }
438760
- }
438761
- async function checkAndInstallNativeMarketplaces() {
438762
- const verboo = await checkAndInstallVerbooMarketplace();
438763
- const claude = await checkAndInstallOfficialMarketplace();
438764
- return { verboo, claude };
438765
- }
438766
- async function checkAndInstallOfficialMarketplace() {
438767
- const config3 = getGlobalConfig();
438768
- try {
438769
- const knownMarketplaces = await loadKnownMarketplacesConfig();
438770
- if (knownMarketplaces[CLAUDE_MARKETPLACE_NAME]) {
438771
- logForDebugging(`Official marketplace '${CLAUDE_MARKETPLACE_NAME}' already installed, skipping`);
438772
- saveGlobalConfig((current) => ({
438773
- ...current,
438774
- officialMarketplaceAutoInstallAttempted: true,
438775
- officialMarketplaceAutoInstalled: true
438776
- }));
438777
- return { installed: false, skipped: true, reason: "already_installed" };
438778
- }
438779
- if (!shouldRetryInstallation(config3)) {
438780
- const reason = config3.officialMarketplaceAutoInstallFailReason ?? "already_attempted";
438781
- logForDebugging(`Official marketplace auto-install skipped: ${reason}`);
438782
- return {
438783
- installed: false,
438784
- skipped: true,
438785
- reason
438786
- };
438787
- }
438788
- if (isOfficialMarketplaceAutoInstallDisabled()) {
438789
- logForDebugging("Official marketplace auto-install disabled via env var, skipping");
438790
- saveGlobalConfig((current) => ({
438791
- ...current,
438792
- officialMarketplaceAutoInstallAttempted: true,
438793
- officialMarketplaceAutoInstalled: false,
438794
- officialMarketplaceAutoInstallFailReason: "policy_blocked"
438795
- }));
438796
- logEvent("tengu_official_marketplace_auto_install", {
438797
- installed: false,
438798
- skipped: true,
438799
- policy_blocked: true
438800
- });
438801
- return { installed: false, skipped: true, reason: "policy_blocked" };
438802
- }
438803
- if (!isSourceAllowedByPolicy(CLAUDE_MARKETPLACE_SOURCE)) {
438804
- logForDebugging("Official marketplace blocked by enterprise policy, skipping");
438805
- saveGlobalConfig((current) => ({
438806
- ...current,
438807
- officialMarketplaceAutoInstallAttempted: true,
438808
- officialMarketplaceAutoInstalled: false,
438809
- officialMarketplaceAutoInstallFailReason: "policy_blocked"
438810
- }));
438811
- logEvent("tengu_official_marketplace_auto_install", {
438812
- installed: false,
438813
- skipped: true,
438814
- policy_blocked: true
438815
- });
438816
- return { installed: false, skipped: true, reason: "policy_blocked" };
438817
- }
438818
- const cacheDir = getMarketplacesCacheDir();
438819
- const installLocation = join116(cacheDir, CLAUDE_MARKETPLACE_NAME);
438820
- const gcsSha = await fetchOfficialMarketplaceFromGcs(installLocation, cacheDir);
438821
- if (gcsSha !== null) {
438822
- const known = await loadKnownMarketplacesConfig();
438823
- known[CLAUDE_MARKETPLACE_NAME] = {
438824
- source: CLAUDE_MARKETPLACE_SOURCE,
438825
- installLocation,
438826
- lastUpdated: new Date().toISOString()
438827
- };
438828
- await saveKnownMarketplacesConfig(known);
438829
- saveGlobalConfig((current) => ({
438830
- ...current,
438831
- officialMarketplaceAutoInstallAttempted: true,
438832
- officialMarketplaceAutoInstalled: true,
438833
- officialMarketplaceAutoInstallFailReason: undefined,
438834
- officialMarketplaceAutoInstallRetryCount: undefined,
438835
- officialMarketplaceAutoInstallLastAttemptTime: undefined,
438836
- officialMarketplaceAutoInstallNextRetryTime: undefined
438837
- }));
438838
- logEvent("tengu_official_marketplace_auto_install", {
438839
- installed: true,
438840
- skipped: false,
438841
- via_gcs: true
438842
- });
438843
- return { installed: true, skipped: false };
438844
- }
438845
- if (!getFeatureValue_CACHED_MAY_BE_STALE("tengu_plugin_official_mkt_git_fallback", true)) {
438846
- logForDebugging("Official marketplace GCS failed; git fallback disabled by flag — skipping install");
438847
- const retryCount = (config3.officialMarketplaceAutoInstallRetryCount || 0) + 1;
438848
- const now2 = Date.now();
438849
- const nextRetryTime = now2 + calculateNextRetryDelay(retryCount);
438850
- saveGlobalConfig((current) => ({
438851
- ...current,
438852
- officialMarketplaceAutoInstallAttempted: true,
438853
- officialMarketplaceAutoInstalled: false,
438854
- officialMarketplaceAutoInstallFailReason: "gcs_unavailable",
438855
- officialMarketplaceAutoInstallRetryCount: retryCount,
438856
- officialMarketplaceAutoInstallLastAttemptTime: now2,
438857
- officialMarketplaceAutoInstallNextRetryTime: nextRetryTime
438858
- }));
438859
- logEvent("tengu_official_marketplace_auto_install", {
438860
- installed: false,
438861
- skipped: true,
438862
- gcs_unavailable: true,
438863
- retry_count: retryCount
438864
- });
438865
- return { installed: false, skipped: true, reason: "gcs_unavailable" };
438866
- }
438867
- const gitAvailable = await checkGitAvailable();
438868
- if (!gitAvailable) {
438869
- logForDebugging("Git not available, skipping official marketplace auto-install");
438870
- const retryCount = (config3.officialMarketplaceAutoInstallRetryCount || 0) + 1;
438871
- const now2 = Date.now();
438872
- const nextRetryDelay = calculateNextRetryDelay(retryCount);
438873
- const nextRetryTime = now2 + nextRetryDelay;
438874
- let configSaveFailed = false;
438875
- try {
438876
- saveGlobalConfig((current) => ({
438877
- ...current,
438878
- officialMarketplaceAutoInstallAttempted: true,
438879
- officialMarketplaceAutoInstalled: false,
438880
- officialMarketplaceAutoInstallFailReason: "git_unavailable",
438881
- officialMarketplaceAutoInstallRetryCount: retryCount,
438882
- officialMarketplaceAutoInstallLastAttemptTime: now2,
438883
- officialMarketplaceAutoInstallNextRetryTime: nextRetryTime
438884
- }));
438885
- } catch (saveError) {
438886
- configSaveFailed = true;
438887
- const configError = toError(saveError);
438888
- logError2(configError);
438889
- logForDebugging(`Failed to save marketplace auto-install git_unavailable state: ${saveError}`, { level: "error" });
438890
- }
438891
- logEvent("tengu_official_marketplace_auto_install", {
438892
- installed: false,
438893
- skipped: true,
438894
- git_unavailable: true,
438895
- retry_count: retryCount
438896
- });
438897
- return {
438898
- installed: false,
438899
- skipped: true,
438900
- reason: "git_unavailable",
438901
- configSaveFailed
438902
- };
438903
- }
438904
- logForDebugging("Attempting to auto-install official marketplace");
438905
- await addMarketplaceSource(CLAUDE_MARKETPLACE_SOURCE);
438906
- logForDebugging("Successfully auto-installed official marketplace");
438907
- const previousRetryCount = config3.officialMarketplaceAutoInstallRetryCount || 0;
438908
- saveGlobalConfig((current) => ({
438909
- ...current,
438910
- officialMarketplaceAutoInstallAttempted: true,
438911
- officialMarketplaceAutoInstalled: true,
438912
- officialMarketplaceAutoInstallFailReason: undefined,
438913
- officialMarketplaceAutoInstallRetryCount: undefined,
438914
- officialMarketplaceAutoInstallLastAttemptTime: undefined,
438915
- officialMarketplaceAutoInstallNextRetryTime: undefined
438916
- }));
438917
- logEvent("tengu_official_marketplace_auto_install", {
438918
- installed: true,
438919
- skipped: false,
438920
- retry_count: previousRetryCount
438921
- });
438922
- return { installed: true, skipped: false };
438923
- } catch (error42) {
438924
- const errorMessage2 = error42 instanceof Error ? error42.message : String(error42);
438925
- if (errorMessage2.includes("xcrun: error:")) {
438926
- markGitUnavailable();
438927
- logForDebugging("Official marketplace auto-install: git is a non-functional macOS xcrun shim, treating as git_unavailable");
438928
- logEvent("tengu_official_marketplace_auto_install", {
438929
- installed: false,
438930
- skipped: true,
438931
- git_unavailable: true,
438932
- macos_xcrun_shim: true
438933
- });
438934
- return {
438935
- installed: false,
438936
- skipped: true,
438937
- reason: "git_unavailable"
438938
- };
438939
- }
438940
- logForDebugging(`Failed to auto-install official marketplace: ${errorMessage2}`, { level: "error" });
438941
- logError2(toError(error42));
438942
- const retryCount = (config3.officialMarketplaceAutoInstallRetryCount || 0) + 1;
438943
- const now2 = Date.now();
438944
- const nextRetryDelay = calculateNextRetryDelay(retryCount);
438945
- const nextRetryTime = now2 + nextRetryDelay;
438946
- let configSaveFailed = false;
438947
- try {
438948
- saveGlobalConfig((current) => ({
438949
- ...current,
438950
- officialMarketplaceAutoInstallAttempted: true,
438951
- officialMarketplaceAutoInstalled: false,
438952
- officialMarketplaceAutoInstallFailReason: "unknown",
438953
- officialMarketplaceAutoInstallRetryCount: retryCount,
438954
- officialMarketplaceAutoInstallLastAttemptTime: now2,
438955
- officialMarketplaceAutoInstallNextRetryTime: nextRetryTime
438956
- }));
438957
- } catch (saveError) {
438958
- configSaveFailed = true;
438959
- const configError = toError(saveError);
438960
- logError2(configError);
438961
- logForDebugging(`Failed to save marketplace auto-install failure state: ${saveError}`, { level: "error" });
438962
- }
438963
- logEvent("tengu_official_marketplace_auto_install", {
438964
- installed: false,
438965
- skipped: true,
438966
- failed: true,
438967
- retry_count: retryCount
438968
- });
438969
- return {
438970
- installed: false,
438971
- skipped: true,
438972
- reason: "unknown",
438973
- configSaveFailed
438974
- };
438975
- }
438976
- }
438977
- var RETRY_CONFIG;
438978
- var init_officialMarketplaceStartupCheck = __esm(() => {
438979
- init_growthbook();
438980
- init_config7();
438981
- init_debug();
438982
- init_envUtils();
438983
- init_errors();
438984
- init_log3();
438985
- init_gitAvailability();
438986
- init_marketplaceHelpers();
438987
- init_marketplaceManager();
438988
- init_officialMarketplace();
438989
- init_officialMarketplaceGcs();
438990
- RETRY_CONFIG = {
438991
- MAX_ATTEMPTS: 10,
438992
- INITIAL_DELAY_MS: 60 * 60 * 1000,
438993
- BACKOFF_MULTIPLIER: 2,
438994
- MAX_DELAY_MS: 7 * 24 * 60 * 60 * 1000
438995
- };
438996
- });
438997
-
438998
439061
  // src/state/pluginCommandsStore.ts
438999
439062
  function setPluginCommandsState(commands) {
439000
439063
  pluginCommandsStore.setState(() => [...commands]);
@@ -450876,6 +450939,10 @@ async function updatePlugin(pluginId, installations) {
450876
450939
  return wasUpdated ? pluginId : null;
450877
450940
  }
450878
450941
  async function updatePluginsForMarketplaces(marketplaceNames) {
450942
+ const pluginUpdateMarketplaces = new Set(Array.from(marketplaceNames).filter((name) => name.toLowerCase() !== VERBOO_MARKETPLACE_NAME));
450943
+ if (pluginUpdateMarketplaces.size === 0) {
450944
+ return [];
450945
+ }
450879
450946
  const installedPlugins = loadInstalledPluginsFromDisk();
450880
450947
  const pluginIds = Object.keys(installedPlugins.plugins);
450881
450948
  if (pluginIds.length === 0) {
@@ -450883,7 +450950,7 @@ async function updatePluginsForMarketplaces(marketplaceNames) {
450883
450950
  }
450884
450951
  const results = await Promise.allSettled(pluginIds.map(async (pluginId) => {
450885
450952
  const { marketplace } = parsePluginIdentifier(pluginId);
450886
- if (!marketplace || !marketplaceNames.has(marketplace.toLowerCase())) {
450953
+ if (!marketplace || !pluginUpdateMarketplaces.has(marketplace.toLowerCase())) {
450887
450954
  return null;
450888
450955
  }
450889
450956
  const allInstallations = installedPlugins.plugins[pluginId];
@@ -450908,11 +450975,18 @@ function autoUpdateMarketplacesAndPluginsInBackground() {
450908
450975
  return;
450909
450976
  }
450910
450977
  try {
450978
+ let verbooInstalledThisRun = false;
450979
+ try {
450980
+ const result = await checkAndInstallVerbooMarketplace();
450981
+ verbooInstalledThisRun = result.installed;
450982
+ } catch (error42) {
450983
+ logForDebugging(`Plugin autoupdate: failed to prepare Verboo marketplace: ${errorMessage(error42)}`, { level: "warn" });
450984
+ }
450911
450985
  const autoUpdateEnabledMarketplaces = await getAutoUpdateEnabledMarketplaces();
450912
450986
  if (autoUpdateEnabledMarketplaces.size === 0) {
450913
450987
  return;
450914
450988
  }
450915
- const refreshResults = await Promise.allSettled(Array.from(autoUpdateEnabledMarketplaces).map(async (name) => {
450989
+ const refreshResults = await Promise.allSettled(Array.from(autoUpdateEnabledMarketplaces).filter((name) => !(verbooInstalledThisRun && name.toLowerCase() === VERBOO_MARKETPLACE_NAME)).map(async (name) => {
450916
450990
  try {
450917
450991
  await refreshMarketplace(name, undefined, {
450918
450992
  disableCredentialHelper: true
@@ -450925,7 +450999,7 @@ function autoUpdateMarketplacesAndPluginsInBackground() {
450925
450999
  if (failures.length > 0) {
450926
451000
  logForDebugging(`Plugin autoupdate: ${failures.length} marketplace refresh(es) failed`, { level: "warn" });
450927
451001
  }
450928
- logForDebugging("Plugin autoupdate: checking installed plugins");
451002
+ logForDebugging("Plugin autoupdate: checking eligible installed plugins");
450929
451003
  const updatedPlugins = await updatePlugins(autoUpdateEnabledMarketplaces);
450930
451004
  if (updatedPlugins.length > 0) {
450931
451005
  if (pluginUpdateCallback) {
@@ -450948,6 +451022,8 @@ var init_pluginAutoupdate = __esm(() => {
450948
451022
  init_log3();
450949
451023
  init_installedPluginsManager();
450950
451024
  init_marketplaceManager();
451025
+ init_officialMarketplace();
451026
+ init_officialMarketplaceStartupCheck();
450951
451027
  init_pluginIdentifier();
450952
451028
  init_schemas5();
450953
451029
  });
@@ -451626,7 +451702,7 @@ function ManageMarketplaces({
451626
451702
  marginTop: 1,
451627
451703
  children: /* @__PURE__ */ jsx_runtime246.jsx(ThemedText, {
451628
451704
  dimColor: true,
451629
- children: "Auto-update enabled. Claude Code will automatically update this marketplace and its installed plugins."
451705
+ children: selectedMarketplace.name === VERBOO_MARKETPLACE_NAME ? "Auto-update enabled. Verboo Code will automatically update this marketplace." : "Auto-update enabled. Verboo Code will automatically update this marketplace and its installed plugins."
451630
451706
  })
451631
451707
  }),
451632
451708
  /* @__PURE__ */ jsx_runtime246.jsx(ThemedBox_default, {
@@ -486416,7 +486492,7 @@ var init_bridge_kick = __esm(() => {
486416
486492
  var call63 = async () => {
486417
486493
  return {
486418
486494
  type: "text",
486419
- value: `${"99.0.0"} (built ${"2026-07-15T01:49:30.886Z"})`
486495
+ value: `${"99.0.0"} (built ${"2026-07-15T13:23:40.197Z"})`
486420
486496
  };
486421
486497
  }, version2, version_default;
486422
486498
  var init_version2 = __esm(() => {
@@ -516634,7 +516710,7 @@ var init_schemas5 = __esm(() => {
516634
516710
  source: MarketplaceSourceSchema().describe("Where to fetch the marketplace from"),
516635
516711
  installLocation: exports_external.string().describe("Local cache path where marketplace manifest is stored"),
516636
516712
  lastUpdated: exports_external.string().describe("ISO 8601 timestamp of last marketplace refresh"),
516637
- autoUpdate: exports_external.boolean().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")
516713
+ autoUpdate: exports_external.boolean().optional().describe("Whether to automatically refresh this marketplace on startup")
516638
516714
  }));
516639
516715
  KnownMarketplacesFileSchema = lazySchema(() => exports_external.record(exports_external.string(), KnownMarketplaceSchema()));
516640
516716
  });
@@ -519489,7 +519565,7 @@ function printStartupScreen(modelOverride) {
519489
519565
  const home = process.env.HOME || process.env.USERPROFILE || "";
519490
519566
  const cwd2 = process.cwd();
519491
519567
  const displayCwd = home && cwd2.startsWith(home) ? `~${cwd2.slice(home.length)}` : cwd2;
519492
- const version3 = "0.13.2";
519568
+ const version3 = "0.13.4";
519493
519569
  const bold2 = `${ESC4}1m`;
519494
519570
  const PURPLE = rgb3(...ACCENT);
519495
519571
  const SOFT = rgb3(...CREAM);
@@ -537781,7 +537857,7 @@ var init_routerRateLimitHook = __esm(() => {
537781
537857
  function getSemverPart(version3) {
537782
537858
  return `${import_semver13.major(version3, { loose: true })}.${import_semver13.minor(version3, { loose: true })}.${import_semver13.patch(version3, { loose: true })}`;
537783
537859
  }
537784
- function useUpdateNotification(updatedVersion, initialVersion = "0.13.2") {
537860
+ function useUpdateNotification(updatedVersion, initialVersion = "0.13.4") {
537785
537861
  const [lastNotifiedSemver, setLastNotifiedSemver] = import_react225.useState(() => getSemverPart(initialVersion));
537786
537862
  const [pendingNotification2, setPendingNotification] = import_react225.useState(null);
537787
537863
  if (updatedVersion) {
@@ -537821,7 +537897,7 @@ function AutoUpdater({
537821
537897
  return;
537822
537898
  }
537823
537899
  if (false) {}
537824
- const currentVersion = "0.13.2";
537900
+ const currentVersion = "0.13.4";
537825
537901
  const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
537826
537902
  let latestVersion = await getLatestVersion(channel2);
537827
537903
  const isDisabled = isAutoUpdaterDisabled();
@@ -538174,17 +538250,17 @@ function PackageManagerAutoUpdater(t0) {
538174
538250
  const maxVersion = await getMaxVersion();
538175
538251
  if (maxVersion && latest && gt(latest, maxVersion)) {
538176
538252
  logForDebugging(`PackageManagerAutoUpdater: maxVersion ${maxVersion} is set, capping update from ${latest} to ${maxVersion}`);
538177
- if (gte("0.13.2", maxVersion)) {
538178
- logForDebugging(`PackageManagerAutoUpdater: current version ${"0.13.2"} is already at or above maxVersion ${maxVersion}, skipping update`);
538253
+ if (gte("0.13.4", maxVersion)) {
538254
+ logForDebugging(`PackageManagerAutoUpdater: current version ${"0.13.4"} is already at or above maxVersion ${maxVersion}, skipping update`);
538179
538255
  setUpdateAvailable(false);
538180
538256
  return;
538181
538257
  }
538182
538258
  latest = maxVersion;
538183
538259
  }
538184
- const hasUpdate = latest && !gte("0.13.2", latest) && !shouldSkipVersion(latest);
538260
+ const hasUpdate = latest && !gte("0.13.4", latest) && !shouldSkipVersion(latest);
538185
538261
  setUpdateAvailable(!!hasUpdate);
538186
538262
  if (hasUpdate) {
538187
- logForDebugging(`PackageManagerAutoUpdater: Update available ${"0.13.2"} -> ${latest}`);
538263
+ logForDebugging(`PackageManagerAutoUpdater: Update available ${"0.13.4"} -> ${latest}`);
538188
538264
  }
538189
538265
  };
538190
538266
  $2[0] = t1;
@@ -538218,7 +538294,7 @@ function PackageManagerAutoUpdater(t0) {
538218
538294
  wrap: "truncate",
538219
538295
  children: [
538220
538296
  "currentVersion: ",
538221
- "0.13.2"
538297
+ "0.13.4"
538222
538298
  ]
538223
538299
  });
538224
538300
  $2[3] = verbose;
@@ -554169,10 +554245,10 @@ async function autoUpdateCliInBackground() {
554169
554245
  return;
554170
554246
  const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
554171
554247
  const latest = await getLatestVersion(channel2);
554172
- if (!latest || gte("0.13.2", latest))
554248
+ if (!latest || gte("0.13.4", latest))
554173
554249
  return;
554174
554250
  writeToStdout(`
554175
- Nova versão disponível: ${latest} (atual: ${"0.13.2"})
554251
+ Nova versão disponível: ${latest} (atual: ${"0.13.4"})
554176
554252
  `);
554177
554253
  writeToStdout(`Atualizando automaticamente...
554178
554254
  `);
@@ -571866,7 +571942,7 @@ function WelcomeV2() {
571866
571942
  dimColor: true,
571867
571943
  children: [
571868
571944
  "v",
571869
- "0.13.2",
571945
+ "0.13.4",
571870
571946
  " "
571871
571947
  ]
571872
571948
  })
@@ -572053,7 +572129,7 @@ function WelcomeV2() {
572053
572129
  dimColor: true,
572054
572130
  children: [
572055
572131
  "v",
572056
- "0.13.2",
572132
+ "0.13.4",
572057
572133
  " "
572058
572134
  ]
572059
572135
  })
@@ -572269,7 +572345,7 @@ function AppleTerminalWelcomeV2(t0) {
572269
572345
  dimColor: true,
572270
572346
  children: [
572271
572347
  "v",
572272
- "0.13.2",
572348
+ "0.13.4",
572273
572349
  " "
572274
572350
  ]
572275
572351
  });
@@ -572478,7 +572554,7 @@ function AppleTerminalWelcomeV2(t0) {
572478
572554
  dimColor: true,
572479
572555
  children: [
572480
572556
  "v",
572481
- "0.13.2",
572557
+ "0.13.4",
572482
572558
  " "
572483
572559
  ]
572484
572560
  });
@@ -589880,7 +589956,7 @@ __export(exports_update, {
589880
589956
  });
589881
589957
  async function update() {
589882
589958
  logEvent("tengu_update_check", {});
589883
- writeToStdout(`Current version: ${"0.13.2"}
589959
+ writeToStdout(`Current version: ${"0.13.4"}
589884
589960
  `);
589885
589961
  const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
589886
589962
  writeToStdout(`Checking for updates to ${channel2} version...
@@ -589965,8 +590041,8 @@ async function update() {
589965
590041
  writeToStdout(`Verboo Code is managed by Homebrew.
589966
590042
  `);
589967
590043
  const latest = await getLatestVersion(channel2);
589968
- if (latest && !gte("0.13.2", latest)) {
589969
- writeToStdout(`Update available: ${"0.13.2"} → ${latest}
590044
+ if (latest && !gte("0.13.4", latest)) {
590045
+ writeToStdout(`Update available: ${"0.13.4"} → ${latest}
589970
590046
  `);
589971
590047
  writeToStdout(`
589972
590048
  `);
@@ -589982,8 +590058,8 @@ async function update() {
589982
590058
  writeToStdout(`Verboo Code is managed by winget.
589983
590059
  `);
589984
590060
  const latest = await getLatestVersion(channel2);
589985
- if (latest && !gte("0.13.2", latest)) {
589986
- writeToStdout(`Update available: ${"0.13.2"} → ${latest}
590061
+ if (latest && !gte("0.13.4", latest)) {
590062
+ writeToStdout(`Update available: ${"0.13.4"} → ${latest}
589987
590063
  `);
589988
590064
  writeToStdout(`
589989
590065
  `);
@@ -589999,8 +590075,8 @@ async function update() {
589999
590075
  writeToStdout(`Verboo Code is managed by apk.
590000
590076
  `);
590001
590077
  const latest = await getLatestVersion(channel2);
590002
- if (latest && !gte("0.13.2", latest)) {
590003
- writeToStdout(`Update available: ${"0.13.2"} → ${latest}
590078
+ if (latest && !gte("0.13.4", latest)) {
590079
+ writeToStdout(`Update available: ${"0.13.4"} → ${latest}
590004
590080
  `);
590005
590081
  writeToStdout(`
590006
590082
  `);
@@ -590053,11 +590129,11 @@ async function update() {
590053
590129
  `);
590054
590130
  await gracefulShutdown(1);
590055
590131
  }
590056
- if (result.latestVersion === "0.13.2") {
590057
- writeToStdout(source_default.green(`Verboo Code is up to date (${"0.13.2"})`) + `
590132
+ if (result.latestVersion === "0.13.4") {
590133
+ writeToStdout(source_default.green(`Verboo Code is up to date (${"0.13.4"})`) + `
590058
590134
  `);
590059
590135
  } else {
590060
- writeToStdout(source_default.green(`Successfully updated from ${"0.13.2"} to version ${result.latestVersion}`) + `
590136
+ writeToStdout(source_default.green(`Successfully updated from ${"0.13.4"} to version ${result.latestVersion}`) + `
590061
590137
  `);
590062
590138
  await regenerateCompletionCache();
590063
590139
  }
@@ -590117,12 +590193,12 @@ async function update() {
590117
590193
  `);
590118
590194
  await gracefulShutdown(1);
590119
590195
  }
590120
- if (latestVersion === "0.13.2") {
590121
- writeToStdout(source_default.green(`Verboo Code is up to date (${"0.13.2"})`) + `
590196
+ if (latestVersion === "0.13.4") {
590197
+ writeToStdout(source_default.green(`Verboo Code is up to date (${"0.13.4"})`) + `
590122
590198
  `);
590123
590199
  await gracefulShutdown(0);
590124
590200
  }
590125
- writeToStdout(`New version available: ${latestVersion} (current: ${"0.13.2"})
590201
+ writeToStdout(`New version available: ${latestVersion} (current: ${"0.13.4"})
590126
590202
  `);
590127
590203
  writeToStdout(`Installing update...
590128
590204
  `);
@@ -590167,7 +590243,7 @@ async function update() {
590167
590243
  logForDebugging(`update: Installation status: ${status2}`);
590168
590244
  switch (status2) {
590169
590245
  case "success":
590170
- writeToStdout(source_default.green(`Successfully updated from ${"0.13.2"} to version ${latestVersion}`) + `
590246
+ writeToStdout(source_default.green(`Successfully updated from ${"0.13.4"} to version ${latestVersion}`) + `
590171
590247
  `);
590172
590248
  await regenerateCompletionCache();
590173
590249
  break;
@@ -591422,7 +591498,7 @@ ${customInstructions}` : customInstructions;
591422
591498
  is_native_binary: isInBundledMode()
591423
591499
  });
591424
591500
  logMemoryDiagnostics("start", {
591425
- version: "0.13.2",
591501
+ version: "0.13.4",
591426
591502
  debug: debug2,
591427
591503
  debugToStderr,
591428
591504
  print: print ?? false,
@@ -592233,7 +592309,7 @@ Usage: verboo --remote "your task description"`, () => gracefulShutdown(1));
592233
592309
  pendingHookMessages
592234
592310
  }, renderAndRun);
592235
592311
  }
592236
- }).version(`0.13.2 (${cliDesc})`, "-v, --version", "Output the version number");
592312
+ }).version(`0.13.4 (${cliDesc})`, "-v, --version", "Output the version number");
592237
592313
  program2.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
592238
592314
  program2.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
592239
592315
  if (canUserConfigureAdvisor()) {
@@ -592808,7 +592884,7 @@ if (false) {}
592808
592884
  async function main2() {
592809
592885
  const args = process.argv.slice(2);
592810
592886
  if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
592811
- console.log(`${"0.13.2"} (Verboo Code)`);
592887
+ console.log(`${"0.13.4"} (Verboo Code)`);
592812
592888
  return;
592813
592889
  }
592814
592890
  if (!IS_VERBOO_CLI && args.includes("--provider")) {
@@ -592982,4 +593058,4 @@ async function main2() {
592982
593058
  }
592983
593059
  main2();
592984
593060
 
592985
- //# debugId=1271E869CB00C30E64756E2164756E21
593061
+ //# debugId=7D8FCCCDBB863D5564756E2164756E21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verboo/code",
3
- "version": "0.13.2",
3
+ "version": "0.13.4",
4
4
  "description": "Verboo Code — coding agent for the Verboo platform",
5
5
  "type": "module",
6
6
  "bin": {