theus-cli 0.2.51 → 0.2.53

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/cli.js +528 -394
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -58896,7 +58896,7 @@ async function _executeApiKeyHelper(isNonInteractiveSession) {
58896
58896
  if (isApiKeyHelperFromProjectOrLocalSettings()) {
58897
58897
  const hasTrust = checkHasTrustDialogAccepted();
58898
58898
  if (!hasTrust && !isNonInteractiveSession) {
58899
- const error40 = new Error(`Security: apiKeyHelper executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.FEEDBACK_CHANNEL}.`);
58899
+ const error40 = new Error(`Security: apiKeyHelper executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.FEEDBACK_CHANNEL}.`);
58900
58900
  logAntError("apiKeyHelper invoked before trust check", error40);
58901
58901
  logEvent("tengu_apiKeyHelper_missing_trust11", {});
58902
58902
  return null;
@@ -58940,7 +58940,7 @@ async function runAwsAuthRefresh() {
58940
58940
  if (isAwsAuthRefreshFromProjectSettings()) {
58941
58941
  const hasTrust = checkHasTrustDialogAccepted();
58942
58942
  if (!hasTrust && !getIsNonInteractiveSession()) {
58943
- const error40 = new Error(`Security: awsAuthRefresh executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.FEEDBACK_CHANNEL}.`);
58943
+ const error40 = new Error(`Security: awsAuthRefresh executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.FEEDBACK_CHANNEL}.`);
58944
58944
  logAntError("awsAuthRefresh invoked before trust check", error40);
58945
58945
  logEvent("tengu_awsAuthRefresh_missing_trust", {});
58946
58946
  return false;
@@ -59000,7 +59000,7 @@ async function getAwsCredsFromCredentialExport() {
59000
59000
  if (isAwsCredentialExportFromProjectSettings()) {
59001
59001
  const hasTrust = checkHasTrustDialogAccepted();
59002
59002
  if (!hasTrust && !getIsNonInteractiveSession()) {
59003
- const error40 = new Error(`Security: awsCredentialExport executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.FEEDBACK_CHANNEL}.`);
59003
+ const error40 = new Error(`Security: awsCredentialExport executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.FEEDBACK_CHANNEL}.`);
59004
59004
  logAntError("awsCredentialExport invoked before trust check", error40);
59005
59005
  logEvent("tengu_awsCredentialExport_missing_trust", {});
59006
59006
  return null;
@@ -59085,7 +59085,7 @@ async function runGcpAuthRefresh() {
59085
59085
  if (isGcpAuthRefreshFromProjectSettings()) {
59086
59086
  const hasTrust = checkHasTrustDialogAccepted();
59087
59087
  if (!hasTrust && !getIsNonInteractiveSession()) {
59088
- const error40 = new Error(`Security: gcpAuthRefresh executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.FEEDBACK_CHANNEL}.`);
59088
+ const error40 = new Error(`Security: gcpAuthRefresh executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.FEEDBACK_CHANNEL}.`);
59089
59089
  logAntError("gcpAuthRefresh invoked before trust check", error40);
59090
59090
  logEvent("tengu_gcpAuthRefresh_missing_trust", {});
59091
59091
  return false;
@@ -59780,7 +59780,7 @@ var init_auth = __esm(() => {
59780
59780
 
59781
59781
  // utils/userAgent.ts
59782
59782
  function getTheusCodeUserAgent() {
59783
- return `theus-code/${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}`;
59783
+ return `theus-code/${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}`;
59784
59784
  }
59785
59785
 
59786
59786
  // utils/workloadContext.ts
@@ -59802,7 +59802,7 @@ function getUserAgent() {
59802
59802
  const clientApp = process.env.THEUS_AGENT_SDK_CLIENT_APP ? `, client-app/${process.env.THEUS_AGENT_SDK_CLIENT_APP}` : "";
59803
59803
  const workload = getWorkload();
59804
59804
  const workloadSuffix = workload ? `, workload/${workload}` : "";
59805
- return `theus-cli/${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} (${process.env.USER_TYPE}, ${process.env.THEUS_CODE_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
59805
+ return `theus-cli/${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} (${process.env.USER_TYPE}, ${process.env.THEUS_CODE_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
59806
59806
  }
59807
59807
  function getMCPUserAgent() {
59808
59808
  const parts = [];
@@ -59816,7 +59816,7 @@ function getMCPUserAgent() {
59816
59816
  parts.push(`client-app/${process.env.THEUS_AGENT_SDK_CLIENT_APP}`);
59817
59817
  }
59818
59818
  const suffix = parts.length > 0 ? ` (${parts.join(", ")})` : "";
59819
- return `theus-code/${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}${suffix}`;
59819
+ return `theus-code/${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}${suffix}`;
59820
59820
  }
59821
59821
  function getWebFetchUserAgent() {
59822
59822
  return `Theus-User (${getTheusCodeUserAgent()}; +https://support.theus.pe/)`;
@@ -59954,7 +59954,7 @@ var init_user = __esm(() => {
59954
59954
  deviceId,
59955
59955
  sessionId: getSessionId(),
59956
59956
  email: getEmail(),
59957
- appVersion: { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
59957
+ appVersion: { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
59958
59958
  platform: getHostPlatformForAnalytics(),
59959
59959
  organizationUuid,
59960
59960
  accountUuid,
@@ -61669,7 +61669,7 @@ var init_metadata = __esm(() => {
61669
61669
  COMPOUND_OPERATOR_REGEX = /\s*(?:&&|\|\||[;|])\s*/;
61670
61670
  WHITESPACE_REGEX = /\s+/;
61671
61671
  getVersionBase = memoize_default(() => {
61672
- const match = { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION.match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
61672
+ const match = { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION.match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
61673
61673
  return match ? match[0] : undefined;
61674
61674
  });
61675
61675
  buildEnvContext = memoize_default(async () => {
@@ -61709,9 +61709,9 @@ var init_metadata = __esm(() => {
61709
61709
  isGithubAction: isEnvTruthy(process.env.GITHUB_ACTIONS),
61710
61710
  isTheusCodeAction: isEnvTruthy(process.env.THEUS_CODE_ACTION),
61711
61711
  isTheusAiAuth: isTheusAISubscriber(),
61712
- version: { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
61712
+ version: { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
61713
61713
  versionBase: getVersionBase(),
61714
- buildTime: { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.BUILD_TIME,
61714
+ buildTime: { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.BUILD_TIME,
61715
61715
  deploymentEnvironment: env3.detectDeploymentEnvironment(),
61716
61716
  ...isEnvTruthy(process.env.GITHUB_ACTIONS) && {
61717
61717
  githubEventName: process.env.GITHUB_EVENT_NAME,
@@ -62377,7 +62377,7 @@ function initialize1PEventLogging() {
62377
62377
  const platform2 = getPlatform();
62378
62378
  const attributes = {
62379
62379
  [ATTR_SERVICE_NAME]: "theus-code",
62380
- [ATTR_SERVICE_VERSION]: { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
62380
+ [ATTR_SERVICE_VERSION]: { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
62381
62381
  };
62382
62382
  if (platform2 === "wsl") {
62383
62383
  const wslVersion = getWslVersion();
@@ -62404,7 +62404,7 @@ function initialize1PEventLogging() {
62404
62404
  })
62405
62405
  ]
62406
62406
  });
62407
- firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.theus.theus_code.events", { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
62407
+ firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.theus.theus_code.events", { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
62408
62408
  }
62409
62409
  async function reinitialize1PEventLoggingIfConfigChanged() {
62410
62410
  if (!is1PEventLoggingEnabled() || !firstPartyEventLoggerProvider) {
@@ -64275,7 +64275,7 @@ function getAttributionHeader(fingerprint) {
64275
64275
  if (!isAttributionHeaderEnabled()) {
64276
64276
  return "";
64277
64277
  }
64278
- const version2 = `${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}.${fingerprint}`;
64278
+ const version2 = `${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}.${fingerprint}`;
64279
64279
  const entrypoint = process.env.THEUS_CODE_ENTRYPOINT ?? "unknown";
64280
64280
  const cch = "";
64281
64281
  const workload = getWorkload();
@@ -108362,7 +108362,7 @@ Complete the user's request by providing accurate, documentation-based guidance.
108362
108362
  }
108363
108363
  function getFeedbackGuideline() {
108364
108364
  if (isUsing3PServices()) {
108365
- return `- When you cannot find an answer or the feature doesn't exist, direct the user to ${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.ISSUES_EXPLAINER}`;
108365
+ return `- When you cannot find an answer or the feature doesn't exist, direct the user to ${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.ISSUES_EXPLAINER}`;
108366
108366
  }
108367
108367
  return "- When you cannot find an answer or the feature doesn't exist, direct the user to use /feedback to report a feature request or bug";
108368
108368
  }
@@ -116710,6 +116710,263 @@ var init_imageValidation = __esm(() => {
116710
116710
  };
116711
116711
  });
116712
116712
 
116713
+ // services/rateLimitMessages.ts
116714
+ function isRateLimitErrorMessage(text) {
116715
+ return RATE_LIMIT_ERROR_PREFIXES.some((prefix) => text.startsWith(prefix));
116716
+ }
116717
+ function getRateLimitMessage(limits, model) {
116718
+ if (limits.isUsingOverage) {
116719
+ if (limits.overageStatus === "allowed_warning") {
116720
+ return {
116721
+ message: "You're close to your extra usage spending limit",
116722
+ severity: "warning"
116723
+ };
116724
+ }
116725
+ return null;
116726
+ }
116727
+ if (limits.status === "rejected") {
116728
+ return { message: getLimitReachedText(limits, model), severity: "error" };
116729
+ }
116730
+ if (limits.status === "allowed_warning") {
116731
+ const WARNING_THRESHOLD = 0.7;
116732
+ if (limits.utilization !== undefined && limits.utilization < WARNING_THRESHOLD) {
116733
+ return null;
116734
+ }
116735
+ const subscriptionType = getSubscriptionType();
116736
+ const isTeamOrEnterprise = subscriptionType === "team" || subscriptionType === "enterprise";
116737
+ const hasExtraUsageEnabled = getOauthAccountInfo()?.hasExtraUsageEnabled === true;
116738
+ if (isTeamOrEnterprise && hasExtraUsageEnabled && !hasTheusAiBillingAccess()) {
116739
+ return null;
116740
+ }
116741
+ const text = getEarlyWarningText(limits);
116742
+ if (text) {
116743
+ return { message: text, severity: "warning" };
116744
+ }
116745
+ }
116746
+ return null;
116747
+ }
116748
+ function getRateLimitErrorMessage(limits, model) {
116749
+ const message = getRateLimitMessage(limits, model);
116750
+ if (message && message.severity === "error") {
116751
+ return message.message;
116752
+ }
116753
+ return null;
116754
+ }
116755
+ function getRateLimitWarning(limits, model) {
116756
+ const message = getRateLimitMessage(limits, model);
116757
+ if (message && message.severity === "warning") {
116758
+ return message.message;
116759
+ }
116760
+ return null;
116761
+ }
116762
+ function getLimitReachedText(limits, model) {
116763
+ const resetsAt = limits.resetsAt;
116764
+ const resetTime = resetsAt ? formatResetTime(resetsAt, true) : undefined;
116765
+ const overageResetTime = limits.overageResetsAt ? formatResetTime(limits.overageResetsAt, true) : undefined;
116766
+ const resetMessage = resetTime ? ` \xB7 resets ${resetTime}` : "";
116767
+ if (limits.overageStatus === "rejected") {
116768
+ let overageResetMessage = "";
116769
+ if (resetsAt && limits.overageResetsAt) {
116770
+ if (resetsAt < limits.overageResetsAt) {
116771
+ overageResetMessage = ` \xB7 resets ${resetTime}`;
116772
+ } else {
116773
+ overageResetMessage = ` \xB7 resets ${overageResetTime}`;
116774
+ }
116775
+ } else if (resetTime) {
116776
+ overageResetMessage = ` \xB7 resets ${resetTime}`;
116777
+ } else if (overageResetTime) {
116778
+ overageResetMessage = ` \xB7 resets ${overageResetTime}`;
116779
+ }
116780
+ if (limits.overageDisabledReason === "out_of_credits") {
116781
+ return `You're out of extra usage${overageResetMessage}`;
116782
+ }
116783
+ return formatLimitReachedText("limit", overageResetMessage, model);
116784
+ }
116785
+ if (limits.rateLimitType === "seven_day_sonnet") {
116786
+ const subscriptionType = getSubscriptionType();
116787
+ const isProOrEnterprise = subscriptionType === "pro" || subscriptionType === "enterprise";
116788
+ const limit = isProOrEnterprise ? "weekly limit" : "Sonnet limit";
116789
+ return formatLimitReachedText(limit, resetMessage, model);
116790
+ }
116791
+ if (limits.rateLimitType === "seven_day_opus") {
116792
+ return formatLimitReachedText("Opus limit", resetMessage, model);
116793
+ }
116794
+ if (limits.rateLimitType === "seven_day") {
116795
+ return formatLimitReachedText("weekly limit", resetMessage, model);
116796
+ }
116797
+ if (limits.rateLimitType === "five_hour") {
116798
+ return formatLimitReachedText("session limit", resetMessage, model);
116799
+ }
116800
+ return formatLimitReachedText("usage limit", resetMessage, model);
116801
+ }
116802
+ function getEarlyWarningText(limits) {
116803
+ let limitName = null;
116804
+ switch (limits.rateLimitType) {
116805
+ case "seven_day":
116806
+ limitName = "weekly limit";
116807
+ break;
116808
+ case "five_hour":
116809
+ limitName = "session limit";
116810
+ break;
116811
+ case "seven_day_opus":
116812
+ limitName = "Opus limit";
116813
+ break;
116814
+ case "seven_day_sonnet":
116815
+ limitName = "Sonnet limit";
116816
+ break;
116817
+ case "overage":
116818
+ limitName = "extra usage";
116819
+ break;
116820
+ case undefined:
116821
+ return null;
116822
+ }
116823
+ const used = limits.utilization ? Math.floor(limits.utilization * 100) : undefined;
116824
+ const resetTime = limits.resetsAt ? formatResetTime(limits.resetsAt, true) : undefined;
116825
+ const upsell = getWarningUpsellText(limits.rateLimitType);
116826
+ if (used && resetTime) {
116827
+ const base3 = `You've used ${used}% of your ${limitName} \xB7 resets ${resetTime}`;
116828
+ return upsell ? `${base3} \xB7 ${upsell}` : base3;
116829
+ }
116830
+ if (used) {
116831
+ const base3 = `You've used ${used}% of your ${limitName}`;
116832
+ return upsell ? `${base3} \xB7 ${upsell}` : base3;
116833
+ }
116834
+ if (limits.rateLimitType === "overage") {
116835
+ limitName += " limit";
116836
+ }
116837
+ if (resetTime) {
116838
+ const base3 = `Approaching ${limitName} \xB7 resets ${resetTime}`;
116839
+ return upsell ? `${base3} \xB7 ${upsell}` : base3;
116840
+ }
116841
+ const base2 = `Approaching ${limitName}`;
116842
+ return upsell ? `${base2} \xB7 ${upsell}` : base2;
116843
+ }
116844
+ function getWarningUpsellText(rateLimitType) {
116845
+ const subscriptionType = getSubscriptionType();
116846
+ const hasExtraUsageEnabled = getOauthAccountInfo()?.hasExtraUsageEnabled === true;
116847
+ if (rateLimitType === "five_hour") {
116848
+ if (subscriptionType === "team" || subscriptionType === "enterprise") {
116849
+ if (!hasExtraUsageEnabled && isOverageProvisioningAllowed()) {
116850
+ return "/extra-usage to request more";
116851
+ }
116852
+ return null;
116853
+ }
116854
+ if (subscriptionType === "pro" || subscriptionType === "max") {
116855
+ return "/upgrade to keep using Theus";
116856
+ }
116857
+ }
116858
+ if (rateLimitType === "overage") {
116859
+ if (subscriptionType === "team" || subscriptionType === "enterprise") {
116860
+ if (!hasExtraUsageEnabled && isOverageProvisioningAllowed()) {
116861
+ return "/extra-usage to request more";
116862
+ }
116863
+ }
116864
+ }
116865
+ return null;
116866
+ }
116867
+ function getUsingOverageText(limits) {
116868
+ const resetTime = limits.resetsAt ? formatResetTime(limits.resetsAt, true) : "";
116869
+ let limitName = "";
116870
+ if (limits.rateLimitType === "five_hour") {
116871
+ limitName = "session limit";
116872
+ } else if (limits.rateLimitType === "seven_day") {
116873
+ limitName = "weekly limit";
116874
+ } else if (limits.rateLimitType === "seven_day_opus") {
116875
+ limitName = "Opus limit";
116876
+ } else if (limits.rateLimitType === "seven_day_sonnet") {
116877
+ const subscriptionType = getSubscriptionType();
116878
+ const isProOrEnterprise = subscriptionType === "pro" || subscriptionType === "enterprise";
116879
+ limitName = isProOrEnterprise ? "weekly limit" : "Sonnet limit";
116880
+ }
116881
+ if (!limitName) {
116882
+ return "Now using extra usage";
116883
+ }
116884
+ const resetMessage = resetTime ? ` \xB7 Your ${limitName} resets ${resetTime}` : "";
116885
+ return `You're now using extra usage${resetMessage}`;
116886
+ }
116887
+ function formatLimitReachedText(limit, resetMessage, _model) {
116888
+ if (process.env.USER_TYPE === "ant") {
116889
+ return `You've hit your ${limit}${resetMessage}. If you have feedback about this limit, post in ${FEEDBACK_CHANNEL_ANT}. You can reset your limits with /reset-limits`;
116890
+ }
116891
+ return `You've hit your ${limit}${resetMessage}`;
116892
+ }
116893
+ function isGatewayQuotaExceededBody(body) {
116894
+ if (typeof body !== "object" || body === null)
116895
+ return false;
116896
+ const b = body;
116897
+ if (b.quota_exceeded === true)
116898
+ return true;
116899
+ const err2 = b.error;
116900
+ return typeof err2 === "object" && err2 !== null && err2.code === "quota_exceeded";
116901
+ }
116902
+ function asNonEmptyString(value) {
116903
+ if (typeof value === "string" && value.trim().length > 0)
116904
+ return value;
116905
+ if (typeof value === "number" && Number.isFinite(value))
116906
+ return String(value);
116907
+ return;
116908
+ }
116909
+ function isGatewayQuotaExceededMessage(text) {
116910
+ return text.startsWith(GATEWAY_QUOTA_EXCEEDED_MESSAGE_PREFIX);
116911
+ }
116912
+ function creditsFromBody(creditos, tt) {
116913
+ const direct = asNonEmptyString(creditos);
116914
+ if (direct)
116915
+ return direct;
116916
+ const ttStr = asNonEmptyString(tt);
116917
+ if (!ttStr)
116918
+ return;
116919
+ const ttNum = Number(ttStr);
116920
+ if (!Number.isFinite(ttNum))
116921
+ return;
116922
+ return String(Math.round(ttNum / 1000));
116923
+ }
116924
+ function getGatewayQuotaExceededMessage(body) {
116925
+ const pausePromise = "Sin sorpresas: al tope, Theus se pausa \u2014 jam\xE1s factura de m\xE1s.";
116926
+ const genericFallback = `Llegaste al l\xEDmite de tu plan. ${pausePromise} Revisa tus opciones en ${THEUS_PRICING_URL} (anual = 2 meses gratis).`;
116927
+ if (!isGatewayQuotaExceededBody(body)) {
116928
+ return genericFallback;
116929
+ }
116930
+ const plan = asNonEmptyString(body.plan);
116931
+ const cuotaCreditos = creditsFromBody(body.creditos_cuota, body.cuota_tt);
116932
+ const reset3 = asNonEmptyString(body.reset);
116933
+ const url3 = asNonEmptyString(body.url) ?? THEUS_PRICING_URL;
116934
+ if (!plan || !cuotaCreditos || !reset3) {
116935
+ return `Llegaste al l\xEDmite de tu plan. ${pausePromise} Revisa tus opciones en ${url3} (anual = 2 meses gratis).`;
116936
+ }
116937
+ const base2 = `Llegaste al l\xEDmite de tu plan ${plan} (${cuotaCreditos} cr\xE9ditos) \xB7 se renueva ${reset3}. ${pausePromise}`;
116938
+ const upgradePlan = asNonEmptyString(body.upgrade?.plan);
116939
+ const upgradeCreditos = creditsFromBody(body.upgrade?.creditos, body.upgrade?.tt);
116940
+ const upgradePrecio = asNonEmptyString(body.upgrade?.precio);
116941
+ if (upgradePlan && upgradeCreditos && upgradePrecio) {
116942
+ return `${base2} \xBFNecesitas seguir hoy? ${upgradePlan} incluye ${upgradeCreditos} cr\xE9ditos por ${upgradePrecio} \u2192 ${url3} (anual = 2 meses gratis)`;
116943
+ }
116944
+ return `${base2} Revisa tus opciones en ${url3} (anual = 2 meses gratis).`;
116945
+ }
116946
+ var FEEDBACK_CHANNEL_ANT = "#briarpatch-cc", RATE_LIMIT_ERROR_PREFIXES, THEUS_PRICING_URL = "https://theus.pe/precios", GATEWAY_QUOTA_EXCEEDED_MESSAGE_PREFIX = "Llegaste al l\xEDmite de tu plan", GatewayQuotaExceededError;
116947
+ var init_rateLimitMessages = __esm(() => {
116948
+ init_auth();
116949
+ init_billing();
116950
+ init_format();
116951
+ RATE_LIMIT_ERROR_PREFIXES = [
116952
+ "You've hit your",
116953
+ "You've used",
116954
+ "You're now using extra usage",
116955
+ "You're close to",
116956
+ "You're out of extra usage"
116957
+ ];
116958
+ GatewayQuotaExceededError = class GatewayQuotaExceededError extends Error {
116959
+ status;
116960
+ body;
116961
+ constructor(body, status) {
116962
+ super(getGatewayQuotaExceededMessage(body));
116963
+ this.name = "GatewayQuotaExceededError";
116964
+ this.status = status;
116965
+ this.body = body;
116966
+ }
116967
+ };
116968
+ });
116969
+
116713
116970
  // tools/FileReadTool/imageProcessor.ts
116714
116971
  async function getImageProcessor() {
116715
116972
  if (imageProcessorModule) {
@@ -167076,7 +167333,7 @@ function getTelemetryAttributes() {
167076
167333
  attributes["session.id"] = sessionId;
167077
167334
  }
167078
167335
  if (shouldIncludeAttribute("OTEL_METRICS_INCLUDE_VERSION")) {
167079
- attributes["app.version"] = { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
167336
+ attributes["app.version"] = { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
167080
167337
  }
167081
167338
  const oauthAccount = getOauthAccountInfo();
167082
167339
  if (oauthAccount) {
@@ -169819,253 +170076,6 @@ var init_vscodeSdkMcp = __esm(() => {
169819
170076
  }));
169820
170077
  });
169821
170078
 
169822
- // services/rateLimitMessages.ts
169823
- function isRateLimitErrorMessage(text) {
169824
- return RATE_LIMIT_ERROR_PREFIXES.some((prefix) => text.startsWith(prefix));
169825
- }
169826
- function getRateLimitMessage(limits, model) {
169827
- if (limits.isUsingOverage) {
169828
- if (limits.overageStatus === "allowed_warning") {
169829
- return {
169830
- message: "You're close to your extra usage spending limit",
169831
- severity: "warning"
169832
- };
169833
- }
169834
- return null;
169835
- }
169836
- if (limits.status === "rejected") {
169837
- return { message: getLimitReachedText(limits, model), severity: "error" };
169838
- }
169839
- if (limits.status === "allowed_warning") {
169840
- const WARNING_THRESHOLD = 0.7;
169841
- if (limits.utilization !== undefined && limits.utilization < WARNING_THRESHOLD) {
169842
- return null;
169843
- }
169844
- const subscriptionType = getSubscriptionType();
169845
- const isTeamOrEnterprise = subscriptionType === "team" || subscriptionType === "enterprise";
169846
- const hasExtraUsageEnabled = getOauthAccountInfo()?.hasExtraUsageEnabled === true;
169847
- if (isTeamOrEnterprise && hasExtraUsageEnabled && !hasTheusAiBillingAccess()) {
169848
- return null;
169849
- }
169850
- const text = getEarlyWarningText(limits);
169851
- if (text) {
169852
- return { message: text, severity: "warning" };
169853
- }
169854
- }
169855
- return null;
169856
- }
169857
- function getRateLimitErrorMessage(limits, model) {
169858
- const message = getRateLimitMessage(limits, model);
169859
- if (message && message.severity === "error") {
169860
- return message.message;
169861
- }
169862
- return null;
169863
- }
169864
- function getRateLimitWarning(limits, model) {
169865
- const message = getRateLimitMessage(limits, model);
169866
- if (message && message.severity === "warning") {
169867
- return message.message;
169868
- }
169869
- return null;
169870
- }
169871
- function getLimitReachedText(limits, model) {
169872
- const resetsAt = limits.resetsAt;
169873
- const resetTime = resetsAt ? formatResetTime(resetsAt, true) : undefined;
169874
- const overageResetTime = limits.overageResetsAt ? formatResetTime(limits.overageResetsAt, true) : undefined;
169875
- const resetMessage = resetTime ? ` \xB7 resets ${resetTime}` : "";
169876
- if (limits.overageStatus === "rejected") {
169877
- let overageResetMessage = "";
169878
- if (resetsAt && limits.overageResetsAt) {
169879
- if (resetsAt < limits.overageResetsAt) {
169880
- overageResetMessage = ` \xB7 resets ${resetTime}`;
169881
- } else {
169882
- overageResetMessage = ` \xB7 resets ${overageResetTime}`;
169883
- }
169884
- } else if (resetTime) {
169885
- overageResetMessage = ` \xB7 resets ${resetTime}`;
169886
- } else if (overageResetTime) {
169887
- overageResetMessage = ` \xB7 resets ${overageResetTime}`;
169888
- }
169889
- if (limits.overageDisabledReason === "out_of_credits") {
169890
- return `You're out of extra usage${overageResetMessage}`;
169891
- }
169892
- return formatLimitReachedText("limit", overageResetMessage, model);
169893
- }
169894
- if (limits.rateLimitType === "seven_day_sonnet") {
169895
- const subscriptionType = getSubscriptionType();
169896
- const isProOrEnterprise = subscriptionType === "pro" || subscriptionType === "enterprise";
169897
- const limit = isProOrEnterprise ? "weekly limit" : "Sonnet limit";
169898
- return formatLimitReachedText(limit, resetMessage, model);
169899
- }
169900
- if (limits.rateLimitType === "seven_day_opus") {
169901
- return formatLimitReachedText("Opus limit", resetMessage, model);
169902
- }
169903
- if (limits.rateLimitType === "seven_day") {
169904
- return formatLimitReachedText("weekly limit", resetMessage, model);
169905
- }
169906
- if (limits.rateLimitType === "five_hour") {
169907
- return formatLimitReachedText("session limit", resetMessage, model);
169908
- }
169909
- return formatLimitReachedText("usage limit", resetMessage, model);
169910
- }
169911
- function getEarlyWarningText(limits) {
169912
- let limitName = null;
169913
- switch (limits.rateLimitType) {
169914
- case "seven_day":
169915
- limitName = "weekly limit";
169916
- break;
169917
- case "five_hour":
169918
- limitName = "session limit";
169919
- break;
169920
- case "seven_day_opus":
169921
- limitName = "Opus limit";
169922
- break;
169923
- case "seven_day_sonnet":
169924
- limitName = "Sonnet limit";
169925
- break;
169926
- case "overage":
169927
- limitName = "extra usage";
169928
- break;
169929
- case undefined:
169930
- return null;
169931
- }
169932
- const used = limits.utilization ? Math.floor(limits.utilization * 100) : undefined;
169933
- const resetTime = limits.resetsAt ? formatResetTime(limits.resetsAt, true) : undefined;
169934
- const upsell = getWarningUpsellText(limits.rateLimitType);
169935
- if (used && resetTime) {
169936
- const base3 = `You've used ${used}% of your ${limitName} \xB7 resets ${resetTime}`;
169937
- return upsell ? `${base3} \xB7 ${upsell}` : base3;
169938
- }
169939
- if (used) {
169940
- const base3 = `You've used ${used}% of your ${limitName}`;
169941
- return upsell ? `${base3} \xB7 ${upsell}` : base3;
169942
- }
169943
- if (limits.rateLimitType === "overage") {
169944
- limitName += " limit";
169945
- }
169946
- if (resetTime) {
169947
- const base3 = `Approaching ${limitName} \xB7 resets ${resetTime}`;
169948
- return upsell ? `${base3} \xB7 ${upsell}` : base3;
169949
- }
169950
- const base2 = `Approaching ${limitName}`;
169951
- return upsell ? `${base2} \xB7 ${upsell}` : base2;
169952
- }
169953
- function getWarningUpsellText(rateLimitType) {
169954
- const subscriptionType = getSubscriptionType();
169955
- const hasExtraUsageEnabled = getOauthAccountInfo()?.hasExtraUsageEnabled === true;
169956
- if (rateLimitType === "five_hour") {
169957
- if (subscriptionType === "team" || subscriptionType === "enterprise") {
169958
- if (!hasExtraUsageEnabled && isOverageProvisioningAllowed()) {
169959
- return "/extra-usage to request more";
169960
- }
169961
- return null;
169962
- }
169963
- if (subscriptionType === "pro" || subscriptionType === "max") {
169964
- return "/upgrade to keep using Theus";
169965
- }
169966
- }
169967
- if (rateLimitType === "overage") {
169968
- if (subscriptionType === "team" || subscriptionType === "enterprise") {
169969
- if (!hasExtraUsageEnabled && isOverageProvisioningAllowed()) {
169970
- return "/extra-usage to request more";
169971
- }
169972
- }
169973
- }
169974
- return null;
169975
- }
169976
- function getUsingOverageText(limits) {
169977
- const resetTime = limits.resetsAt ? formatResetTime(limits.resetsAt, true) : "";
169978
- let limitName = "";
169979
- if (limits.rateLimitType === "five_hour") {
169980
- limitName = "session limit";
169981
- } else if (limits.rateLimitType === "seven_day") {
169982
- limitName = "weekly limit";
169983
- } else if (limits.rateLimitType === "seven_day_opus") {
169984
- limitName = "Opus limit";
169985
- } else if (limits.rateLimitType === "seven_day_sonnet") {
169986
- const subscriptionType = getSubscriptionType();
169987
- const isProOrEnterprise = subscriptionType === "pro" || subscriptionType === "enterprise";
169988
- limitName = isProOrEnterprise ? "weekly limit" : "Sonnet limit";
169989
- }
169990
- if (!limitName) {
169991
- return "Now using extra usage";
169992
- }
169993
- const resetMessage = resetTime ? ` \xB7 Your ${limitName} resets ${resetTime}` : "";
169994
- return `You're now using extra usage${resetMessage}`;
169995
- }
169996
- function formatLimitReachedText(limit, resetMessage, _model) {
169997
- if (process.env.USER_TYPE === "ant") {
169998
- return `You've hit your ${limit}${resetMessage}. If you have feedback about this limit, post in ${FEEDBACK_CHANNEL_ANT}. You can reset your limits with /reset-limits`;
169999
- }
170000
- return `You've hit your ${limit}${resetMessage}`;
170001
- }
170002
- function isGatewayQuotaExceededBody(body) {
170003
- if (typeof body !== "object" || body === null)
170004
- return false;
170005
- const b = body;
170006
- if (b.quota_exceeded === true)
170007
- return true;
170008
- const err2 = b.error;
170009
- return typeof err2 === "object" && err2 !== null && err2.code === "quota_exceeded";
170010
- }
170011
- function asNonEmptyString(value) {
170012
- if (typeof value === "string" && value.trim().length > 0)
170013
- return value;
170014
- if (typeof value === "number" && Number.isFinite(value))
170015
- return String(value);
170016
- return;
170017
- }
170018
- function isGatewayQuotaExceededMessage(text) {
170019
- return text.startsWith(GATEWAY_QUOTA_EXCEEDED_MESSAGE_PREFIX);
170020
- }
170021
- function creditsFromBody(creditos, tt) {
170022
- const direct = asNonEmptyString(creditos);
170023
- if (direct)
170024
- return direct;
170025
- const ttStr = asNonEmptyString(tt);
170026
- if (!ttStr)
170027
- return;
170028
- const ttNum = Number(ttStr);
170029
- if (!Number.isFinite(ttNum))
170030
- return;
170031
- return String(Math.round(ttNum / 1000));
170032
- }
170033
- function getGatewayQuotaExceededMessage(body) {
170034
- const pausePromise = "Sin sorpresas: al tope, Theus se pausa \u2014 jam\xE1s factura de m\xE1s.";
170035
- const genericFallback = `Llegaste al l\xEDmite de tu plan. ${pausePromise} Revisa tus opciones en ${THEUS_PRICING_URL} (anual = 2 meses gratis).`;
170036
- if (!isGatewayQuotaExceededBody(body)) {
170037
- return genericFallback;
170038
- }
170039
- const plan = asNonEmptyString(body.plan);
170040
- const cuotaCreditos = creditsFromBody(body.creditos_cuota, body.cuota_tt);
170041
- const reset3 = asNonEmptyString(body.reset);
170042
- const url3 = asNonEmptyString(body.url) ?? THEUS_PRICING_URL;
170043
- if (!plan || !cuotaCreditos || !reset3) {
170044
- return `Llegaste al l\xEDmite de tu plan. ${pausePromise} Revisa tus opciones en ${url3} (anual = 2 meses gratis).`;
170045
- }
170046
- const base2 = `Llegaste al l\xEDmite de tu plan ${plan} (${cuotaCreditos} cr\xE9ditos) \xB7 se renueva ${reset3}. ${pausePromise}`;
170047
- const upgradePlan = asNonEmptyString(body.upgrade?.plan);
170048
- const upgradeCreditos = creditsFromBody(body.upgrade?.creditos, body.upgrade?.tt);
170049
- const upgradePrecio = asNonEmptyString(body.upgrade?.precio);
170050
- if (upgradePlan && upgradeCreditos && upgradePrecio) {
170051
- return `${base2} \xBFNecesitas seguir hoy? ${upgradePlan} incluye ${upgradeCreditos} cr\xE9ditos por ${upgradePrecio} \u2192 ${url3} (anual = 2 meses gratis)`;
170052
- }
170053
- return `${base2} Revisa tus opciones en ${url3} (anual = 2 meses gratis).`;
170054
- }
170055
- var FEEDBACK_CHANNEL_ANT = "#briarpatch-cc", RATE_LIMIT_ERROR_PREFIXES, THEUS_PRICING_URL = "https://theus.pe/precios", GATEWAY_QUOTA_EXCEEDED_MESSAGE_PREFIX = "Llegaste al l\xEDmite de tu plan";
170056
- var init_rateLimitMessages = __esm(() => {
170057
- init_auth();
170058
- init_billing();
170059
- init_format();
170060
- RATE_LIMIT_ERROR_PREFIXES = [
170061
- "You've hit your",
170062
- "You've used",
170063
- "You're now using extra usage",
170064
- "You're close to",
170065
- "You're out of extra usage"
170066
- ];
170067
- });
170068
-
170069
170079
  // services/theusAiLimits.ts
170070
170080
  function getRateLimitDisplayName(type) {
170071
170081
  return RATE_LIMIT_DISPLAY_NAMES[type] || type;
@@ -203207,7 +203217,7 @@ function getInstallationEnv() {
203207
203217
  return;
203208
203218
  }
203209
203219
  function getTheusCodeVersion() {
203210
- return { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
203220
+ return { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
203211
203221
  }
203212
203222
  async function getInstalledVSCodeExtensionVersion(command) {
203213
203223
  const { stdout } = await execFileNoThrow(command, ["--list-extensions", "--show-versions"], {
@@ -204725,7 +204735,7 @@ async function getMcpHeadersFromHelper(serverName, config2) {
204725
204735
  if ("scope" in config2 && isMcpServerFromProjectOrLocalSettings(config2) && !getIsNonInteractiveSession()) {
204726
204736
  const hasTrust = checkHasTrustDialogAccepted();
204727
204737
  if (!hasTrust) {
204728
- const error40 = new Error(`Security: headersHelper for MCP server '${serverName}' executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.FEEDBACK_CHANNEL}.`);
204738
+ const error40 = new Error(`Security: headersHelper for MCP server '${serverName}' executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.FEEDBACK_CHANNEL}.`);
204729
204739
  logAntError("MCP headersHelper invoked before trust check", error40);
204730
204740
  logEvent("tengu_mcp_headersHelper_missing_trust", {});
204731
204741
  return null;
@@ -205935,7 +205945,7 @@ async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) {
205935
205945
  const client2 = new Client({
205936
205946
  name: "theus-code",
205937
205947
  title: "Theus",
205938
- version: { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION ?? "unknown",
205948
+ version: { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION ?? "unknown",
205939
205949
  description: "Theus's agentic coding tool",
205940
205950
  websiteUrl: PRODUCT_URL
205941
205951
  }, {
@@ -206289,7 +206299,7 @@ var init_client5 = __esm(() => {
206289
206299
  const client2 = new Client({
206290
206300
  name: "theus-code",
206291
206301
  title: "Theus",
206292
- version: { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION ?? "unknown",
206302
+ version: { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION ?? "unknown",
206293
206303
  description: "Theus's agentic coding tool",
206294
206304
  websiteUrl: PRODUCT_URL
206295
206305
  }, {
@@ -216868,7 +216878,7 @@ async function initializeBetaTracing(resource) {
216868
216878
  });
216869
216879
  logs.setGlobalLoggerProvider(loggerProvider);
216870
216880
  setLoggerProvider(loggerProvider);
216871
- const eventLogger = logs.getLogger("com.theus.theus_code.events", { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
216881
+ const eventLogger = logs.getLogger("com.theus.theus_code.events", { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
216872
216882
  setEventLogger(eventLogger);
216873
216883
  process.on("beforeExit", async () => {
216874
216884
  await loggerProvider?.forceFlush();
@@ -216908,7 +216918,7 @@ async function initializeTelemetry() {
216908
216918
  const platform4 = getPlatform();
216909
216919
  const baseAttributes = {
216910
216920
  [ATTR_SERVICE_NAME]: "theus-code",
216911
- [ATTR_SERVICE_VERSION]: { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
216921
+ [ATTR_SERVICE_VERSION]: { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
216912
216922
  };
216913
216923
  if (platform4 === "wsl") {
216914
216924
  const wslVersion = getWslVersion();
@@ -216953,7 +216963,7 @@ async function initializeTelemetry() {
216953
216963
  } catch {}
216954
216964
  };
216955
216965
  registerCleanup(shutdownTelemetry2);
216956
- return meterProvider2.getMeter("com.theus.theus_code", { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
216966
+ return meterProvider2.getMeter("com.theus.theus_code", { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
216957
216967
  }
216958
216968
  const meterProvider = new MeterProvider({
216959
216969
  resource,
@@ -216973,7 +216983,7 @@ async function initializeTelemetry() {
216973
216983
  });
216974
216984
  logs.setGlobalLoggerProvider(loggerProvider);
216975
216985
  setLoggerProvider(loggerProvider);
216976
- const eventLogger = logs.getLogger("com.theus.theus_code.events", { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
216986
+ const eventLogger = logs.getLogger("com.theus.theus_code.events", { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
216977
216987
  setEventLogger(eventLogger);
216978
216988
  logForDebugging("[3P telemetry] Event logger set successfully");
216979
216989
  process.on("beforeExit", async () => {
@@ -217035,7 +217045,7 @@ Current timeout: ${timeoutMs}ms
217035
217045
  }
217036
217046
  };
217037
217047
  registerCleanup(shutdownTelemetry);
217038
- return meterProvider.getMeter("com.theus.theus_code", { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
217048
+ return meterProvider.getMeter("com.theus.theus_code", { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
217039
217049
  }
217040
217050
  async function flushTelemetry() {
217041
217051
  const meterProvider = getMeterProvider();
@@ -217575,7 +217585,7 @@ async function installOrUpdateTheusPackage(channel2, specificVersion) {
217575
217585
  return "install_failed";
217576
217586
  }
217577
217587
  const versionSpec = specificVersion ? specificVersion : channel2 === "stable" ? "stable" : "latest";
217578
- const result = await execFileNoThrowWithCwd("npm", ["install", `${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}@${versionSpec}`], { cwd: getLocalInstallDir(), maxBuffer: 1e6 });
217588
+ const result = await execFileNoThrowWithCwd("npm", ["install", `${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}@${versionSpec}`], { cwd: getLocalInstallDir(), maxBuffer: 1e6 });
217579
217589
  if (result.code !== 0) {
217580
217590
  const error40 = new Error(`Failed to install Theus CLI package: ${result.stderr}`);
217581
217591
  logError2(error40);
@@ -217721,9 +217731,9 @@ async function assertMinVersion() {
217721
217731
  if (false) {}
217722
217732
  try {
217723
217733
  const versionConfig = await getDynamicConfig_BLOCKS_ON_INIT("tengu_version_config", { minVersion: "0.0.0" });
217724
- if (versionConfig.minVersion && lt({ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, versionConfig.minVersion)) {
217734
+ if (versionConfig.minVersion && lt({ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, versionConfig.minVersion)) {
217725
217735
  console.error(`
217726
- It looks like your version of Theus (${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}) needs an update.
217736
+ It looks like your version of Theus (${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}) needs an update.
217727
217737
  A newer version (${versionConfig.minVersion} or higher) is required to continue.
217728
217738
 
217729
217739
  To update, please run:
@@ -217864,7 +217874,7 @@ async function getInstallationPrefix() {
217864
217874
  return prefixResult.stdout.trim();
217865
217875
  }
217866
217876
  function getGlobalInstallPackageManager() {
217867
- if ({ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL === "theus-cli") {
217877
+ if ({ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL === "theus-cli") {
217868
217878
  return "npm";
217869
217879
  }
217870
217880
  return env3.isRunningWithBun() ? "bun" : "npm";
@@ -217889,7 +217899,7 @@ async function checkGlobalInstallPermissions() {
217889
217899
  }
217890
217900
  async function getLatestVersion(channel2) {
217891
217901
  const npmTag = channel2 === "stable" ? "stable" : "latest";
217892
- const result = await execFileNoThrowWithCwd("npm", ["view", `${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}@${npmTag}`, "version", "--prefer-online"], { abortSignal: AbortSignal.timeout(5000), cwd: homedir18() });
217902
+ const result = await execFileNoThrowWithCwd("npm", ["view", `${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}@${npmTag}`, "version", "--prefer-online"], { abortSignal: AbortSignal.timeout(5000), cwd: homedir18() });
217893
217903
  if (result.code !== 0) {
217894
217904
  logForDebugging(`npm view failed with code ${result.code}`);
217895
217905
  if (result.stderr) {
@@ -217905,7 +217915,7 @@ async function getLatestVersion(channel2) {
217905
217915
  return result.stdout.trim();
217906
217916
  }
217907
217917
  async function getNpmDistTags() {
217908
- const result = await execFileNoThrowWithCwd("npm", ["view", { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL, "dist-tags", "--json", "--prefer-online"], { abortSignal: AbortSignal.timeout(5000), cwd: homedir18() });
217918
+ const result = await execFileNoThrowWithCwd("npm", ["view", { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL, "dist-tags", "--json", "--prefer-online"], { abortSignal: AbortSignal.timeout(5000), cwd: homedir18() });
217909
217919
  if (result.code !== 0) {
217910
217920
  logForDebugging(`npm view dist-tags failed with code ${result.code}`);
217911
217921
  return { latest: null, stable: null };
@@ -217945,7 +217955,7 @@ async function installGlobalPackage(specificVersion) {
217945
217955
  logError2(new AutoUpdaterError("Another process is currently installing an update"));
217946
217956
  logEvent("tengu_auto_updater_lock_contention", {
217947
217957
  pid: process.pid,
217948
- currentVersion: { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
217958
+ currentVersion: { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
217949
217959
  });
217950
217960
  return "in_progress";
217951
217961
  }
@@ -217954,7 +217964,7 @@ async function installGlobalPackage(specificVersion) {
217954
217964
  if (!env3.isRunningWithBun() && env3.isNpmFromWindowsPath()) {
217955
217965
  logError2(new Error("Windows NPM detected in WSL environment"));
217956
217966
  logEvent("tengu_auto_updater_windows_npm_in_wsl", {
217957
- currentVersion: { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
217967
+ currentVersion: { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
217958
217968
  });
217959
217969
  console.error(`
217960
217970
  Error: Windows NPM detected in WSL
@@ -217973,7 +217983,7 @@ To fix this issue:
217973
217983
  if (!hasPermissions) {
217974
217984
  return "no_permissions";
217975
217985
  }
217976
- const packageSpec = specificVersion ? `${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}@${specificVersion}` : { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL;
217986
+ const packageSpec = specificVersion ? `${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}@${specificVersion}` : { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL;
217977
217987
  const packageManager = getGlobalInstallPackageManager();
217978
217988
  const installResult = await execFileNoThrowWithCwd(packageManager, ["install", "-g", packageSpec], { cwd: homedir18() });
217979
217989
  if (installResult.code !== 0) {
@@ -218301,8 +218311,8 @@ async function detectMultipleInstallations() {
218301
218311
  installations.push({ type: "npm-local", path: localPath });
218302
218312
  }
218303
218313
  const packagesToCheck = ["@theus-ai/theus-code"];
218304
- if ({ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL && { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL !== "@theus-ai/theus-code") {
218305
- packagesToCheck.push({ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL);
218314
+ if ({ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL && { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL !== "@theus-ai/theus-code") {
218315
+ packagesToCheck.push({ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL);
218306
218316
  }
218307
218317
  const npmResult = await execFileNoThrow("npm", [
218308
218318
  "-g",
@@ -218485,7 +218495,7 @@ function detectLinuxGlobPatternWarnings() {
218485
218495
  }
218486
218496
  async function getDoctorDiagnostic() {
218487
218497
  const installationType = await getCurrentInstallationType();
218488
- const version2 = { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION ? { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION : "unknown";
218498
+ const version2 = { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION ? { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION : "unknown";
218489
218499
  const installationPath = await getInstallationPath();
218490
218500
  const invokedBinary = getInvokedBinary();
218491
218501
  const multipleInstallations = await detectMultipleInstallations();
@@ -218497,8 +218507,8 @@ async function getDoctorDiagnostic() {
218497
218507
  for (const install of npmInstalls) {
218498
218508
  if (install.type === "npm-global") {
218499
218509
  let uninstallCmd = "npm -g uninstall @theus-ai/theus-code";
218500
- if ({ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL && { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL !== "@theus-ai/theus-code") {
218501
- uninstallCmd += ` && npm -g uninstall ${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}`;
218510
+ if ({ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL && { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL !== "@theus-ai/theus-code") {
218511
+ uninstallCmd += ` && npm -g uninstall ${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}`;
218502
218512
  }
218503
218513
  warnings.push({
218504
218514
  issue: `Leftover npm global installation at ${install.path}`,
@@ -218610,7 +218620,7 @@ async function getLatestVersionFromArtifactory(tag2 = "latest") {
218610
218620
  const startTime2 = Date.now();
218611
218621
  const { stdout, code, stderr } = await execFileNoThrowWithCwd("npm", [
218612
218622
  "view",
218613
- `${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.NATIVE_PACKAGE_URL}@${tag2}`,
218623
+ `${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.NATIVE_PACKAGE_URL}@${tag2}`,
218614
218624
  "version",
218615
218625
  "--prefer-online",
218616
218626
  "--registry",
@@ -218634,7 +218644,7 @@ async function getLatestVersionFromArtifactory(tag2 = "latest") {
218634
218644
  latency_ms: latencyMs,
218635
218645
  source_npm: true
218636
218646
  });
218637
- logForDebugging(`npm view ${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.NATIVE_PACKAGE_URL}@${tag2} version: ${stdout}`);
218647
+ logForDebugging(`npm view ${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.NATIVE_PACKAGE_URL}@${tag2} version: ${stdout}`);
218638
218648
  const latestVersion = stdout.trim();
218639
218649
  return latestVersion;
218640
218650
  }
@@ -218690,7 +218700,7 @@ async function downloadVersionFromArtifactory(version2, stagingPath) {
218690
218700
  const fs3 = getFsImplementation();
218691
218701
  await fs3.rm(stagingPath, { recursive: true, force: true });
218692
218702
  const platform4 = getPlatform2();
218693
- const platformPackageName = `${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.NATIVE_PACKAGE_URL}-${platform4}`;
218703
+ const platformPackageName = `${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.NATIVE_PACKAGE_URL}-${platform4}`;
218694
218704
  logForDebugging(`Fetching integrity hash for ${platformPackageName}@${version2}`);
218695
218705
  const {
218696
218706
  stdout: integrityOutput,
@@ -218719,7 +218729,7 @@ async function downloadVersionFromArtifactory(version2, stagingPath) {
218719
218729
  name: "theus-native-installer",
218720
218730
  version: "0.0.1",
218721
218731
  dependencies: {
218722
- [{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.NATIVE_PACKAGE_URL]: version2
218732
+ [{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.NATIVE_PACKAGE_URL]: version2
218723
218733
  }
218724
218734
  };
218725
218735
  const packageLock = {
@@ -218732,10 +218742,10 @@ async function downloadVersionFromArtifactory(version2, stagingPath) {
218732
218742
  name: "theus-native-installer",
218733
218743
  version: "0.0.1",
218734
218744
  dependencies: {
218735
- [{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.NATIVE_PACKAGE_URL]: version2
218745
+ [{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.NATIVE_PACKAGE_URL]: version2
218736
218746
  }
218737
218747
  },
218738
- [`node_modules/${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.NATIVE_PACKAGE_URL}`]: {
218748
+ [`node_modules/${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.NATIVE_PACKAGE_URL}`]: {
218739
218749
  version: version2,
218740
218750
  optionalDependencies: {
218741
218751
  [platformPackageName]: version2
@@ -218757,7 +218767,7 @@ async function downloadVersionFromArtifactory(version2, stagingPath) {
218757
218767
  if (result.code !== 0) {
218758
218768
  throw new Error(`npm ci failed with code ${result.code}: ${result.stderr}`);
218759
218769
  }
218760
- logForDebugging(`Successfully downloaded and verified ${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.NATIVE_PACKAGE_URL}@${version2}`);
218770
+ logForDebugging(`Successfully downloaded and verified ${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.NATIVE_PACKAGE_URL}@${version2}`);
218761
218771
  }
218762
218772
  function getStallTimeoutMs() {
218763
218773
  return Number(process.env.THEUS_CODE_STALL_TIMEOUT_MS_FOR_TESTING) || DEFAULT_STALL_TIMEOUT_MS;
@@ -219420,8 +219430,8 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
219420
219430
  const maxVersion = await getMaxVersion();
219421
219431
  if (maxVersion && gt(version2, maxVersion)) {
219422
219432
  logForDebugging(`Native installer: maxVersion ${maxVersion} is set, capping update from ${version2} to ${maxVersion}`);
219423
- if (gte({ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, maxVersion)) {
219424
- logForDebugging(`Native installer: current version ${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} is already at or above maxVersion ${maxVersion}, skipping update`);
219433
+ if (gte({ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, maxVersion)) {
219434
+ logForDebugging(`Native installer: current version ${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} is already at or above maxVersion ${maxVersion}, skipping update`);
219425
219435
  logEvent("tengu_native_update_skipped_max_version", {
219426
219436
  latency_ms: Date.now() - startTime2,
219427
219437
  max_version: maxVersion,
@@ -219432,7 +219442,7 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
219432
219442
  version2 = maxVersion;
219433
219443
  }
219434
219444
  }
219435
- if (!forceReinstall && version2 === { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION && await versionIsAvailable(version2) && await isPossibleTheusBinary(executablePath)) {
219445
+ if (!forceReinstall && version2 === { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION && await versionIsAvailable(version2) && await isPossibleTheusBinary(executablePath)) {
219436
219446
  logForDebugging(`Found ${version2} at ${executablePath}, skipping install`);
219437
219447
  logEvent("tengu_native_update_complete", {
219438
219448
  latency_ms: Date.now() - startTime2,
@@ -220182,8 +220192,8 @@ async function cleanupNpmInstallations() {
220182
220192
  } else if (codePackageResult.error) {
220183
220193
  errors4.push(codePackageResult.error);
220184
220194
  }
220185
- if ({ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL && { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL !== "@theus-ai/theus-code") {
220186
- const macroPackageResult = await attemptNpmUninstall({ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL);
220195
+ if ({ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL && { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL !== "@theus-ai/theus-code") {
220196
+ const macroPackageResult = await attemptNpmUninstall({ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL);
220187
220197
  if (macroPackageResult.success) {
220188
220198
  removed++;
220189
220199
  if (macroPackageResult.warning) {
@@ -230672,6 +230682,37 @@ var init_ConsoleOAuthFlow = __esm(() => {
230672
230682
  var NOVEDADES;
230673
230683
  var init_data = __esm(() => {
230674
230684
  NOVEDADES = [
230685
+ {
230686
+ version: "v0.2.53",
230687
+ fecha: "2026-07-26",
230688
+ titulo: "Windows: el mapa 3D del proyecto por fin aparece",
230689
+ puntos: [
230690
+ "En Windows, Theus abr\xEDa el mapa del proyecto cl\xE1sico en vez del grafo 3D, y no explicaba por qu\xE9. Eran dos cosas: el instalador saltaba \xD1aupa en todas las instalaciones de Windows (le faltaba la huella de verificaci\xF3n del paquete en el canal de descargas), y aunque lo hubieras instalado a mano, Theus solo lo buscaba en rutas de macOS y Linux.",
230691
+ "Ya est\xE1 corregido en los dos sitios: reinstala con \xABirm https://theus.pe/install.ps1 | iex\xBB y abre una terminal nueva. El motor de c\xF3digo y su mapa 3D quedan disponibles como en macOS y Linux.",
230692
+ "Si aun as\xED no aparece, el registro de depuraci\xF3n ahora dice cu\xE1l de las dos cosas falla: que no encuentra el motor, o que su mapa no respondi\xF3 a tiempo. Antes se ca\xEDa al mapa cl\xE1sico en silencio.",
230693
+ "Y en \xAB/recarga\xBB: los cr\xE9ditos de cada pack se leen del servidor, no de una copia en el CLI que se hab\xEDa quedado desfasada anunciando menos de lo que se entrega. Tambi\xE9n ves tu saldo actual y cu\xE1ntos packs te quedan en el ciclo."
230694
+ ]
230695
+ },
230696
+ {
230697
+ version: "v0.2.52",
230698
+ fecha: "2026-07-26",
230699
+ titulo: "Cuando se agota tu plan, ahora te lo decimos",
230700
+ puntos: [
230701
+ "Al llegar al tope de tu plan, Theus mostraba \xABRequest timed out\xBB despu\xE9s de varios minutos de espera. El servidor s\xED explicaba el motivo, pero el mensaje se perd\xEDa por el camino y el CLI segu\xEDa probando alternativas hasta rendirse por tiempo.",
230702
+ "Ahora corta al instante y te dice lo que pasa: tu plan, tus cr\xE9ditos, cu\xE1ndo se renueva y qu\xE9 opciones tienes. Sin esperas de siete minutos para acabar sin saber qu\xE9 fall\xF3.",
230703
+ "En el servidor: los cr\xE9ditos ya no cuentan igual lo que escribes que lo que el modelo responde (la entrada pondera menos, porque cuesta menos), y las respuestas que se interrumpen a mitad cierran con un error expl\xEDcito en vez de dejar la conexi\xF3n colgada."
230704
+ ]
230705
+ },
230706
+ {
230707
+ version: "v0.2.51",
230708
+ fecha: "2026-07-24",
230709
+ titulo: "N\xFAcleo reconstruido: menos formas de que algo falle",
230710
+ puntos: [
230711
+ "Un release de robustez, no de novedades visibles: reconstruimos el n\xFAcleo del CLI y saldamos la deuda de tipos que arrastraba, miles de inconsistencias que el compilador nunca llegaba a verificar.",
230712
+ "Dos fallos salieron a la luz y quedaron corregidos: el manejo del correo de tu cuenta al iniciar sesi\xF3n ahora tolera que el servidor omita alg\xFAn dato, y un di\xE1logo interno que pod\xEDa dejar la caja de texto sin responder.",
230713
+ "Sin cambios en c\xF3mo usas Theus ni en lo que hace: las mismas funciones, con la bater\xEDa de pruebas en verde."
230714
+ ]
230715
+ },
230675
230716
  {
230676
230717
  version: "v0.2.50",
230677
230718
  fecha: "2026-07-24",
@@ -247589,12 +247630,25 @@ import { existsSync as existsSync8 } from "fs";
247589
247630
  import { homedir as homedir24 } from "os";
247590
247631
  import { join as join74 } from "path";
247591
247632
  function resolveNaupaBinary() {
247633
+ const isWindows2 = process.platform === "win32";
247634
+ const exe = isWindows2 ? "naupa.exe" : "naupa";
247592
247635
  const fromEnv = (process.env.THEUS_NAUPA_BIN ?? "").trim();
247593
247636
  if (fromEnv) {
247594
- return existsSync8(fromEnv) ? fromEnv : null;
247637
+ if (existsSync8(fromEnv))
247638
+ return fromEnv;
247639
+ if (isWindows2 && !/\.exe$/i.test(fromEnv) && existsSync8(`${fromEnv}.exe`)) {
247640
+ return `${fromEnv}.exe`;
247641
+ }
247642
+ return null;
247595
247643
  }
247596
- const candidates = [
247597
- join74(homedir24(), ".local", "bin", "naupa"),
247644
+ const candidates = isWindows2 ? [
247645
+ ...process.env.LOCALAPPDATA ? [join74(process.env.LOCALAPPDATA, "Theus", "bin", exe)] : [],
247646
+ ...process.env.APPDATA ? [join74(process.env.APPDATA, "Theus", "bin", exe)] : [],
247647
+ join74(homedir24(), "AppData", "Local", "Theus", "bin", exe),
247648
+ join74(homedir24(), ".local", "bin", exe),
247649
+ join74(homedir24(), ".theus", "bin", exe)
247650
+ ] : [
247651
+ join74(homedir24(), ".local", "bin", exe),
247598
247652
  "/opt/homebrew/bin/naupa",
247599
247653
  "/usr/local/bin/naupa"
247600
247654
  ];
@@ -247603,9 +247657,11 @@ function resolveNaupaBinary() {
247603
247657
  return candidate;
247604
247658
  }
247605
247659
  if (typeof Bun !== "undefined" && typeof Bun.which === "function") {
247606
- const fromPath = Bun.which("naupa");
247607
- if (fromPath)
247608
- return fromPath;
247660
+ for (const name of isWindows2 ? [exe, "naupa"] : [exe]) {
247661
+ const fromPath = Bun.which(name);
247662
+ if (fromPath)
247663
+ return fromPath;
247664
+ }
247609
247665
  }
247610
247666
  return null;
247611
247667
  }
@@ -247898,9 +247954,11 @@ async function openProjectDashboard(handle) {
247898
247954
  if (process.env.THEUS_DASHBOARD !== "neural") {
247899
247955
  try {
247900
247956
  const { isNaupaEnabled: isNaupaEnabled2 } = await Promise.resolve().then(() => (init_common3(), exports_common));
247901
- if (isNaupaEnabled2() && await waitForNaupaUi(15000)) {
247957
+ const naupaListo = isNaupaEnabled2();
247958
+ if (naupaListo && await waitForNaupaUi(15000)) {
247902
247959
  return openLocalUrl(NAUPA_UI_URL);
247903
247960
  }
247961
+ logForDebugging(naupaListo ? `[dashboard] \xD1aupa est\xE1 instalado pero su UI 3D no respondi\xF3 en ${NAUPA_UI_URL} a tiempo; abriendo el dashboard neural.` : "[dashboard] \xD1aupa no est\xE1 instalado (o no se resolvi\xF3 su binario); abriendo el dashboard neural. Inst\xE1lalo con el instalador oficial, o apunta THEUS_NAUPA_BIN a su ruta.");
247904
247962
  } catch {}
247905
247963
  }
247906
247964
  return openLocalUrl(handle.status.dashboardUrl);
@@ -248028,6 +248086,7 @@ var init_projectIntelligence = __esm(() => {
248028
248086
  init_paths2();
248029
248087
  init_dbSchema();
248030
248088
  init_dashboardHtml();
248089
+ init_debug();
248031
248090
  running = new Map;
248032
248091
  openedDashboards = new Set;
248033
248092
  FONT_ROUTES = [
@@ -305118,6 +305177,14 @@ async function* queryLoop(params, consumedCommandUuids) {
305118
305177
  });
305119
305178
  return { reason: "image_error" };
305120
305179
  }
305180
+ if (error40 instanceof GatewayQuotaExceededError) {
305181
+ yield* yieldMissingToolResultBlocks(assistantMessages, errorMessage2);
305182
+ yield createAssistantAPIErrorMessage({
305183
+ content: error40.message,
305184
+ error: "rate_limit"
305185
+ });
305186
+ return { reason: "model_error", error: error40 };
305187
+ }
305121
305188
  yield* yieldMissingToolResultBlocks(assistantMessages, errorMessage2);
305122
305189
  yield createAssistantAPIErrorMessage({
305123
305190
  content: errorMessage2
@@ -305488,6 +305555,7 @@ var init_query = __esm(() => {
305488
305555
  init_compact();
305489
305556
  init_analytics();
305490
305557
  init_imageValidation();
305558
+ init_rateLimitMessages();
305491
305559
  init_imageResizer();
305492
305560
  init_Tool();
305493
305561
  init_log2();
@@ -305592,9 +305660,9 @@ function getTheusEnvMetadata() {
305592
305660
  };
305593
305661
  }
305594
305662
  function getBuildAgeMinutes() {
305595
- if (!{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.BUILD_TIME)
305663
+ if (!{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.BUILD_TIME)
305596
305664
  return;
305597
- const buildTime = new Date({ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.BUILD_TIME).getTime();
305665
+ const buildTime = new Date({ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.BUILD_TIME).getTime();
305598
305666
  if (isNaN(buildTime))
305599
305667
  return;
305600
305668
  return Math.floor((Date.now() - buildTime) / 60000);
@@ -322103,6 +322171,12 @@ function logToolUseToolResultMismatch(toolUseId, messages, messagesForAPI) {
322103
322171
  } catch (_) {}
322104
322172
  }
322105
322173
  function getAssistantMessageFromError(error40, model, options2) {
322174
+ if (error40 instanceof GatewayQuotaExceededError) {
322175
+ return createAssistantAPIErrorMessage({
322176
+ content: getGatewayQuotaExceededMessage(error40.body),
322177
+ error: "rate_limit"
322178
+ });
322179
+ }
322106
322180
  if (error40 instanceof import_sdk10.APIConnectionTimeoutError || error40 instanceof import_sdk10.APIConnectionError && error40.message.toLowerCase().includes("timeout")) {
322107
322181
  return createAssistantAPIErrorMessage({
322108
322182
  content: API_TIMEOUT_ERROR_MESSAGE,
@@ -322243,7 +322317,7 @@ function getAssistantMessageFromError(error40, model, options2) {
322243
322317
  if (process.env.USER_TYPE === "ant") {
322244
322318
  const baseMessage = `API Error: 400 ${error40.message}
322245
322319
 
322246
- Run /share and post the JSON file to ${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.FEEDBACK_CHANNEL}.`;
322320
+ Run /share and post the JSON file to ${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.FEEDBACK_CHANNEL}.`;
322247
322321
  const rewindInstruction = getIsNonInteractiveSession() ? "" : " Then, use /rewind to recover the conversation.";
322248
322322
  return createAssistantAPIErrorMessage({
322249
322323
  content: baseMessage + rewindInstruction,
@@ -322279,7 +322353,7 @@ Run /share and post the JSON file to ${{ VERSION: "0.2.51", BUILD_TIME: "1970-01
322279
322353
  if (process.env.USER_TYPE === "ant" && !process.env.THEUS_MODEL && error40 instanceof Error && error40.message.toLowerCase().includes("invalid model name")) {
322280
322354
  const orgId = getOauthAccountInfo()?.organizationUuid;
322281
322355
  const baseMsg = `[THEUS-INTERNAL] Your org isn't gated into the \`${model}\` model. Either run \`theus\` with \`THEUS_MODEL=${getDefaultMainLoopModelSetting()}\``;
322282
- const msg = orgId ? `${baseMsg} or share your orgId (${orgId}) in ${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.FEEDBACK_CHANNEL} for help getting access.` : `${baseMsg} or reach out in ${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.FEEDBACK_CHANNEL} for help getting access.`;
322356
+ const msg = orgId ? `${baseMsg} or share your orgId (${orgId}) in ${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.FEEDBACK_CHANNEL} for help getting access.` : `${baseMsg} or reach out in ${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.FEEDBACK_CHANNEL} for help getting access.`;
322283
322357
  return createAssistantAPIErrorMessage({
322284
322358
  content: msg,
322285
322359
  error: "invalid_request"
@@ -330203,7 +330277,7 @@ async function submitTranscriptShare(messages, trigger, appearanceId) {
330203
330277
  } catch {}
330204
330278
  const data = {
330205
330279
  trigger,
330206
- version: { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
330280
+ version: { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
330207
330281
  platform: process.platform,
330208
330282
  transcript,
330209
330283
  subagentTranscripts: Object.keys(subagentTranscripts).length > 0 ? subagentTranscripts : undefined,
@@ -330408,10 +330482,10 @@ Si el usuario indic\xF3 una duraci\xF3n, p\xE1sala en el par\xE1metro \`duration
330408
330482
 
330409
330483
  // commands/issue/index.ts
330410
330484
  function getCliVersion() {
330411
- return { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION ? { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION : "desconocida";
330485
+ return { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION ? { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION : "desconocida";
330412
330486
  }
330413
330487
  function getIssuesExplainer() {
330414
- return { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.ISSUES_EXPLAINER ? { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.ISSUES_EXPLAINER : "report issues to the Theus maintainers";
330488
+ return { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.ISSUES_EXPLAINER ? { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.ISSUES_EXPLAINER : "report issues to the Theus maintainers";
330415
330489
  }
330416
330490
  function getActiveModelLabel() {
330417
330491
  try {
@@ -333244,7 +333318,7 @@ function buildPrimarySection() {
333244
333318
  });
333245
333319
  return [{
333246
333320
  label: "Version",
333247
- value: { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
333321
+ value: { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
333248
333322
  }, {
333249
333323
  label: "Session name",
333250
333324
  value: nameValue
@@ -337060,7 +337134,7 @@ function Config({
337060
337134
  }
337061
337135
  })
337062
337136
  }) : showSubmenu === "ChannelDowngrade" ? /* @__PURE__ */ jsx_runtime189.jsx(ChannelDowngradeDialog, {
337063
- currentVersion: { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
337137
+ currentVersion: { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
337064
337138
  onChoice: (choice) => {
337065
337139
  setShowSubmenu(null);
337066
337140
  setTabsHidden(false);
@@ -337072,7 +337146,7 @@ function Config({
337072
337146
  autoUpdatesChannel: "stable"
337073
337147
  };
337074
337148
  if (choice === "stay") {
337075
- newSettings.minimumVersion = { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
337149
+ newSettings.minimumVersion = { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
337076
337150
  }
337077
337151
  updateSettingsForSource("userSettings", newSettings);
337078
337152
  setSettingsData((prev_27) => ({
@@ -345317,7 +345391,7 @@ function HelpV2(t0) {
345317
345391
  let t6;
345318
345392
  if ($2[31] !== tabs) {
345319
345393
  t6 = /* @__PURE__ */ jsx_runtime217.jsx(Tabs, {
345320
- title: `Theus v${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}`,
345394
+ title: `Theus v${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}`,
345321
345395
  color: "professionalBlue",
345322
345396
  defaultTab: "general",
345323
345397
  children: tabs
@@ -363569,7 +363643,7 @@ function Onboarding({
363569
363643
  flexDirection: "column",
363570
363644
  children: [
363571
363645
  /* @__PURE__ */ jsx_runtime250.jsx(TheusBanner, {
363572
- version: { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
363646
+ version: { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
363573
363647
  }),
363574
363648
  /* @__PURE__ */ jsx_runtime250.jsxs(ThemedBox_default, {
363575
363649
  flexDirection: "column",
@@ -363810,17 +363884,42 @@ function safeIsSubscriber() {
363810
363884
  function apiBase() {
363811
363885
  return getOauthConfig().BASE_API_URL.replace(/\/+$/, "");
363812
363886
  }
363813
- async function fetchRecargaDisponible(token) {
363887
+ async function fetchRecargaStatus(token) {
363888
+ const apagado = {
363889
+ disponible: false,
363890
+ packs: PACKS_FALLBACK,
363891
+ saldoCreditos: null,
363892
+ packsRestantes: null
363893
+ };
363814
363894
  try {
363815
363895
  const res = await fetch(`${apiBase()}/v1/recarga/status`, {
363816
363896
  headers: { authorization: `Bearer ${token}`, "theus-version": "2023-06-01" }
363817
363897
  });
363818
363898
  if (!res.ok)
363819
- return false;
363899
+ return apagado;
363820
363900
  const data = await res.json().catch(() => null);
363821
- return data?.disponible === true;
363901
+ if (data?.disponible !== true)
363902
+ return apagado;
363903
+ const remotos = (data.packs ?? []).map((p) => {
363904
+ const id = String(p?.slug ?? "");
363905
+ if (!PACK_IDS.includes(id))
363906
+ return null;
363907
+ const creditos = Number(p?.creditos);
363908
+ const precioUsd = Number(p?.precio_usd);
363909
+ if (!Number.isFinite(creditos) || creditos <= 0)
363910
+ return null;
363911
+ if (!Number.isFinite(precioUsd) || precioUsd <= 0)
363912
+ return null;
363913
+ return { id, nombre: String(p?.nombre || id), precioUsd, creditos };
363914
+ }).filter((p) => p !== null);
363915
+ return {
363916
+ disponible: true,
363917
+ packs: remotos.length > 0 ? remotos : PACKS_FALLBACK,
363918
+ saldoCreditos: typeof data.saldo_creditos === "number" ? data.saldo_creditos : null,
363919
+ packsRestantes: typeof data.packs_restantes === "number" ? data.packs_restantes : null
363920
+ };
363822
363921
  } catch {
363823
- return false;
363922
+ return apagado;
363824
363923
  }
363825
363924
  }
363826
363925
  async function fetchCheckoutUrl(token, pack) {
@@ -363854,7 +363953,7 @@ function parseArgs2(raw) {
363854
363953
  const confirmar = parts.includes("confirmar");
363855
363954
  return { packId, confirmar };
363856
363955
  }
363857
- var PACKS, PACK_IDS, call32 = async (args) => {
363956
+ var PACKS_FALLBACK, PACK_IDS, call32 = async (args) => {
363858
363957
  const token = safeAccessToken();
363859
363958
  if (!token) {
363860
363959
  return {
@@ -363863,10 +363962,11 @@ var PACKS, PACK_IDS, call32 = async (args) => {
363863
363962
  `)
363864
363963
  };
363865
363964
  }
363866
- const disponible = await fetchRecargaDisponible(token);
363867
- if (!disponible) {
363965
+ const estado = await fetchRecargaStatus(token);
363966
+ if (!estado.disponible) {
363868
363967
  return { type: "text", value: "La recarga a\xFAn no est\xE1 disponible." };
363869
363968
  }
363969
+ const packs = estado.packs;
363870
363970
  const { packId, confirmar } = parseArgs2(args);
363871
363971
  if (!packId) {
363872
363972
  const lines = [];
@@ -363876,12 +363976,21 @@ var PACKS, PACK_IDS, call32 = async (args) => {
363876
363976
  lines.push("expl\xEDcito \u2014 t\xFA eliges cu\xE1ndo comprar, nunca se cobra nada autom\xE1ticamente");
363877
363977
  lines.push("cuando se agota tu cuota del plan.");
363878
363978
  lines.push("");
363979
+ if (estado.saldoCreditos != null && estado.saldoCreditos > 0) {
363980
+ lines.push(`Ya tienes ${formatCreditos(estado.saldoCreditos)} cr\xE9ditos de saldo (no expiran).`);
363981
+ lines.push("");
363982
+ }
363879
363983
  lines.push("Packs disponibles:");
363880
- for (const pack2 of PACKS)
363984
+ for (const pack2 of packs)
363881
363985
  lines.push(formatPackLine(pack2));
363882
363986
  lines.push("");
363883
- lines.push("M\xE1ximo 4 packs por ciclo. Primero se consume la cuota incluida de tu plan;");
363884
- lines.push("tu saldo de cr\xE9ditos recargado se usa solo despu\xE9s.");
363987
+ if (estado.packsRestantes != null) {
363988
+ lines.push(`Te quedan ${estado.packsRestantes} packs comprables en este ciclo. Primero se consume`);
363989
+ lines.push("la cuota incluida de tu plan; tu saldo recargado se usa solo despu\xE9s.");
363990
+ } else {
363991
+ lines.push("Primero se consume la cuota incluida de tu plan; tu saldo de cr\xE9ditos");
363992
+ lines.push("recargado se usa solo despu\xE9s.");
363993
+ }
363885
363994
  lines.push("");
363886
363995
  lines.push("Para comprar: theus recarga <pack> (por ejemplo: theus recarga turbo)");
363887
363996
  if (!safeIsSubscriber()) {
@@ -363891,7 +364000,7 @@ var PACKS, PACK_IDS, call32 = async (args) => {
363891
364000
  return { type: "text", value: lines.join(`
363892
364001
  `) };
363893
364002
  }
363894
- const pack = PACKS.find((p) => p.id === packId);
364003
+ const pack = packs.find((p) => p.id === packId);
363895
364004
  if (!pack) {
363896
364005
  return { type: "text", value: `Pack desconocido: ${packId}` };
363897
364006
  }
@@ -363930,12 +364039,12 @@ var init_recarga = __esm(() => {
363930
364039
  init_oauth();
363931
364040
  init_auth();
363932
364041
  init_browser();
363933
- PACKS = [
363934
- { id: "impulso", nombre: "Impulso", precioUsd: 10, creditos: 390 },
363935
- { id: "turbo", nombre: "Turbo", precioUsd: 25, creditos: 1000 },
363936
- { id: "nitro", nombre: "Nitro", precioUsd: 60, creditos: 2450 }
364042
+ PACKS_FALLBACK = [
364043
+ { id: "impulso", nombre: "Impulso", precioUsd: 10, creditos: 440 },
364044
+ { id: "turbo", nombre: "Turbo", precioUsd: 25, creditos: 1120 },
364045
+ { id: "nitro", nombre: "Nitro", precioUsd: 60, creditos: 2750 }
363937
364046
  ];
363938
- PACK_IDS = PACKS.map((p) => p.id);
364047
+ PACK_IDS = PACKS_FALLBACK.map((p) => p.id);
363939
364048
  recarga = {
363940
364049
  type: "local",
363941
364050
  name: "recarga",
@@ -364070,9 +364179,9 @@ function getAllReleaseNotes(changelogContent = getStoredChangelogFromMemory()) {
364070
364179
  return [];
364071
364180
  }
364072
364181
  }
364073
- async function checkForReleaseNotes(lastSeenVersion, currentVersion = { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION) {
364182
+ async function checkForReleaseNotes(lastSeenVersion, currentVersion = { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION) {
364074
364183
  if (process.env.USER_TYPE === "ant") {
364075
- const changelog = { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION_CHANGELOG;
364184
+ const changelog = { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION_CHANGELOG;
364076
364185
  if (changelog) {
364077
364186
  const commits = changelog.trim().split(`
364078
364187
  `).filter(Boolean);
@@ -368274,7 +368383,7 @@ var init_Messages = __esm(() => {
368274
368383
  let t1;
368275
368384
  if ($2[0] === Symbol.for("react.memo_cache_sentinel")) {
368276
368385
  t1 = /* @__PURE__ */ jsx_runtime262.jsx(TheusSessionHeader, {
368277
- version: { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
368386
+ version: { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
368278
368387
  });
368279
368388
  $2[0] = t1;
368280
368389
  } else {
@@ -397098,7 +397207,7 @@ async function captureMemoryDiagnostics(trigger, dumpNumber = 0) {
397098
397207
  smapsRollup,
397099
397208
  platform: process.platform,
397100
397209
  nodeVersion: process.version,
397101
- ccVersion: { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
397210
+ ccVersion: { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
397102
397211
  };
397103
397212
  }
397104
397213
  async function performHeapDump(trigger = "manual", dumpNumber = 0) {
@@ -397917,7 +398026,7 @@ var init_bridge_kick = __esm(() => {
397917
398026
  var call64 = async () => {
397918
398027
  return {
397919
398028
  type: "text",
397920
- value: { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.BUILD_TIME ? `${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} (built ${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.BUILD_TIME})` : { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
398029
+ value: { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.BUILD_TIME ? `${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} (built ${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.BUILD_TIME})` : { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
397921
398030
  };
397922
398031
  }, version2, version_default;
397923
398032
  var init_version = __esm(() => {
@@ -400518,7 +400627,7 @@ var SECRET_NAME_PATTERN, EXTRA_ENV_ALLOWLIST, REDACTED2 = "\u2039oculto\u203A",
400518
400627
  const lines = [];
400519
400628
  lines.push("## Entorno de ejecuci\xF3n");
400520
400629
  lines.push("");
400521
- const version3 = { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION ? { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION : "desconocida";
400630
+ const version3 = { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION ? { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION : "desconocida";
400522
400631
  lines.push(`- Versi\xF3n de Theus: ${version3}`);
400523
400632
  lines.push(`- Directorio de trabajo: ${getCwd()}`);
400524
400633
  lines.push(`- \xBFRepositorio git?: ${isGit ? "s\xED" : "no"}`);
@@ -402987,13 +403096,13 @@ async function updateReleaseBundle() {
402987
403096
  await gracefulShutdown(1);
402988
403097
  return;
402989
403098
  }
402990
- if (gte({ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, latest)) {
402991
- writeToStdout(source_default.green(`Theus is up to date (${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})`) + `
403099
+ if (gte({ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, latest)) {
403100
+ writeToStdout(source_default.green(`Theus is up to date (${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})`) + `
402992
403101
  `);
402993
403102
  await gracefulShutdown(0);
402994
403103
  return;
402995
403104
  }
402996
- writeToStdout(`New version available: ${latest} (current: ${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})
403105
+ writeToStdout(`New version available: ${latest} (current: ${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})
402997
403106
  `);
402998
403107
  writeToStdout(`Installing update from theus.pe/dl...
402999
403108
  `);
@@ -403027,7 +403136,7 @@ async function updateReleaseBundle() {
403027
403136
  return;
403028
403137
  }
403029
403138
  cpSync(staged, bundleDir, { recursive: true, force: true });
403030
- writeToStdout(source_default.green(`Successfully updated from ${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} to version ${latest}`) + `
403139
+ writeToStdout(source_default.green(`Successfully updated from ${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} to version ${latest}`) + `
403031
403140
  `);
403032
403141
  await regenerateCompletionCache();
403033
403142
  } finally {
@@ -403040,7 +403149,7 @@ async function updateReleaseBundle() {
403040
403149
  async function update() {
403041
403150
  logEvent("tengu_update_check", {});
403042
403151
  await updateNaupa();
403043
- writeToStdout(`Current version: ${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}
403152
+ writeToStdout(`Current version: ${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}
403044
403153
  `);
403045
403154
  const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
403046
403155
  writeToStdout(`Checking for updates to ${channel2} version...
@@ -403119,8 +403228,8 @@ async function update() {
403119
403228
  writeToStdout(`Theus is managed by Homebrew.
403120
403229
  `);
403121
403230
  const latest = await getLatestVersion(channel2);
403122
- if (latest && !gte({ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, latest)) {
403123
- writeToStdout(`Update available: ${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} \u2192 ${latest}
403231
+ if (latest && !gte({ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, latest)) {
403232
+ writeToStdout(`Update available: ${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} \u2192 ${latest}
403124
403233
  `);
403125
403234
  writeToStdout(`
403126
403235
  `);
@@ -403136,8 +403245,8 @@ async function update() {
403136
403245
  writeToStdout(`Theus is managed by winget.
403137
403246
  `);
403138
403247
  const latest = await getLatestVersion(channel2);
403139
- if (latest && !gte({ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, latest)) {
403140
- writeToStdout(`Update available: ${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} \u2192 ${latest}
403248
+ if (latest && !gte({ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, latest)) {
403249
+ writeToStdout(`Update available: ${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} \u2192 ${latest}
403141
403250
  `);
403142
403251
  writeToStdout(`
403143
403252
  `);
@@ -403153,8 +403262,8 @@ async function update() {
403153
403262
  writeToStdout(`Theus is managed by apk.
403154
403263
  `);
403155
403264
  const latest = await getLatestVersion(channel2);
403156
- if (latest && !gte({ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, latest)) {
403157
- writeToStdout(`Update available: ${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} \u2192 ${latest}
403265
+ if (latest && !gte({ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, latest)) {
403266
+ writeToStdout(`Update available: ${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} \u2192 ${latest}
403158
403267
  `);
403159
403268
  writeToStdout(`
403160
403269
  `);
@@ -403219,11 +403328,11 @@ async function update() {
403219
403328
  `);
403220
403329
  await gracefulShutdown(1);
403221
403330
  }
403222
- if (result.latestVersion === { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION) {
403223
- writeToStdout(source_default.green(`Theus is up to date (${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})`) + `
403331
+ if (result.latestVersion === { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION) {
403332
+ writeToStdout(source_default.green(`Theus is up to date (${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})`) + `
403224
403333
  `);
403225
403334
  } else {
403226
- writeToStdout(source_default.green(`Successfully updated from ${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} to version ${result.latestVersion}`) + `
403335
+ writeToStdout(source_default.green(`Successfully updated from ${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} to version ${result.latestVersion}`) + `
403227
403336
  `);
403228
403337
  await regenerateCompletionCache();
403229
403338
  }
@@ -403242,9 +403351,9 @@ async function update() {
403242
403351
  await removeInstalledSymlink();
403243
403352
  }
403244
403353
  logForDebugging("update: Checking npm registry for latest version");
403245
- logForDebugging(`update: Package URL: ${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}`);
403354
+ logForDebugging(`update: Package URL: ${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}`);
403246
403355
  const npmTag = channel2 === "stable" ? "stable" : "latest";
403247
- const npmCommand = `npm view ${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}@${npmTag} version`;
403356
+ const npmCommand = `npm view ${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}@${npmTag} version`;
403248
403357
  logForDebugging(`update: Running: ${npmCommand}`);
403249
403358
  const latestVersion = await getLatestVersion(channel2);
403250
403359
  logForDebugging(`update: Latest version from npm: ${latestVersion || "FAILED"}`);
@@ -403264,7 +403373,7 @@ async function update() {
403264
403373
  `);
403265
403374
  process.stderr.write(` \u2022 Corporate proxy/firewall blocking npm
403266
403375
  `);
403267
- if ({ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL && !{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL.startsWith("@theus")) {
403376
+ if ({ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL && !{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL.startsWith("@theus")) {
403268
403377
  process.stderr.write(` \u2022 Internal/development build not published to npm
403269
403378
  `);
403270
403379
  }
@@ -403276,19 +403385,19 @@ async function update() {
403276
403385
  `);
403277
403386
  process.stderr.write(` \u2022 Run with --debug flag for more details
403278
403387
  `);
403279
- const packageName = { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL || (process.env.USER_TYPE === "ant" ? "@theus-ai/theus-cli" : "@theus-ai/theus-code");
403388
+ const packageName = { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL || (process.env.USER_TYPE === "ant" ? "@theus-ai/theus-cli" : "@theus-ai/theus-code");
403280
403389
  process.stderr.write(` \u2022 Manually check: npm view ${packageName} version
403281
403390
  `);
403282
403391
  process.stderr.write(` \u2022 Check if you need to login: npm whoami
403283
403392
  `);
403284
403393
  await gracefulShutdown(1);
403285
403394
  }
403286
- if (gte({ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, latestVersion)) {
403287
- writeToStdout(source_default.green(`Theus is up to date (${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})`) + `
403395
+ if (gte({ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, latestVersion)) {
403396
+ writeToStdout(source_default.green(`Theus is up to date (${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})`) + `
403288
403397
  `);
403289
403398
  await gracefulShutdown(0);
403290
403399
  }
403291
- writeToStdout(`New version available: ${latestVersion} (current: ${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})
403400
+ writeToStdout(`New version available: ${latestVersion} (current: ${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})
403292
403401
  `);
403293
403402
  writeToStdout(`Installing update...
403294
403403
  `);
@@ -403333,7 +403442,7 @@ async function update() {
403333
403442
  logForDebugging(`update: Installation status: ${status2}`);
403334
403443
  switch (status2) {
403335
403444
  case "success":
403336
- writeToStdout(source_default.green(`Successfully updated from ${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} to version ${latestVersion}`) + `
403445
+ writeToStdout(source_default.green(`Successfully updated from ${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} to version ${latestVersion}`) + `
403337
403446
  `);
403338
403447
  await regenerateCompletionCache();
403339
403448
  break;
@@ -403343,7 +403452,7 @@ async function update() {
403343
403452
  if (useLocalUpdate) {
403344
403453
  process.stderr.write(`Try manually updating with:
403345
403454
  `);
403346
- process.stderr.write(` cd ~/.theus/local && npm update ${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}
403455
+ process.stderr.write(` cd ~/.theus/local && npm update ${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}
403347
403456
  `);
403348
403457
  } else {
403349
403458
  process.stderr.write(`Try running with sudo or fix npm permissions
@@ -403359,7 +403468,7 @@ async function update() {
403359
403468
  if (useLocalUpdate) {
403360
403469
  process.stderr.write(`Try manually updating with:
403361
403470
  `);
403362
- process.stderr.write(` cd ~/.theus/local && npm update ${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}
403471
+ process.stderr.write(` cd ~/.theus/local && npm update ${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}
403363
403472
  `);
403364
403473
  } else {
403365
403474
  process.stderr.write(`Or consider using native installation with: theus install
@@ -413198,7 +413307,7 @@ var init_sessionStorage = __esm(() => {
413198
413307
  init_settings2();
413199
413308
  init_slowOperations();
413200
413309
  init_uuid();
413201
- VERSION4 = { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
413310
+ VERSION4 = { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
413202
413311
  MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
413203
413312
  SKIP_FIRST_PROMPT_PATTERN2 = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
413204
413313
  EPHEMERAL_PROGRESS_TYPES = new Set([
@@ -414403,7 +414512,7 @@ var init_filesystem = __esm(() => {
414403
414512
  });
414404
414513
  getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
414405
414514
  const nonce = randomBytes21(16).toString("hex");
414406
- return join150(getTheusTempDir(), "bundled-skills", { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, nonce);
414515
+ return join150(getTheusTempDir(), "bundled-skills", { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, nonce);
414407
414516
  });
414408
414517
  getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
414409
414518
  });
@@ -419582,7 +419691,7 @@ function getSimpleDoingTasksSection() {
419582
419691
  ];
419583
419692
  const userHelpSubitems = [
419584
419693
  `/help: Get help with using Theus`,
419585
- `To give feedback, users should ${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.ISSUES_EXPLAINER}`
419694
+ `To give feedback, users should ${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.ISSUES_EXPLAINER}`
419586
419695
  ];
419587
419696
  const items = [
419588
419697
  `The user will primarily request you to perform software engineering tasks. These may include solving bugs, adding new functionality, refactoring code, explaining code, and more. When given an unclear or generic instruction, consider it in the context of these software engineering tasks and the current working directory. For example, if the user asks you to change "methodName" to snake case, do not reply with just "method_name", instead find the method in the code and modify the code.`,
@@ -420482,7 +420591,7 @@ function computeFingerprint(messageText, version3) {
420482
420591
  }
420483
420592
  function computeFingerprintFromMessages(messages) {
420484
420593
  const firstMessageText = extractFirstMessageText(messages);
420485
- return computeFingerprint(firstMessageText, { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
420594
+ return computeFingerprint(firstMessageText, { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
420486
420595
  }
420487
420596
  var FINGERPRINT_SALT = "59cf53e54c78";
420488
420597
  var init_fingerprint = () => {};
@@ -422698,6 +422807,19 @@ function chatCompletionHeaders(provider) {
422698
422807
  ...provider.apiKey ? { authorization: `Bearer ${provider.apiKey}` } : {}
422699
422808
  };
422700
422809
  }
422810
+ function parseQuotaExceededBody(status2, detail) {
422811
+ if (status2 !== 429 && status2 !== 402)
422812
+ return;
422813
+ if (!detail)
422814
+ return;
422815
+ let body;
422816
+ try {
422817
+ body = JSON.parse(detail);
422818
+ } catch {
422819
+ return;
422820
+ }
422821
+ return isGatewayQuotaExceededBody(body) ? body : undefined;
422822
+ }
422701
422823
  async function* callOpenAICompatible({
422702
422824
  provider,
422703
422825
  messages,
@@ -422731,6 +422853,10 @@ async function* callOpenAICompatible({
422731
422853
  });
422732
422854
  if (!response.ok) {
422733
422855
  const streamDetail = await response.text().catch(() => "");
422856
+ const quotaBody = parseQuotaExceededBody(response.status, streamDetail);
422857
+ if (quotaBody !== undefined) {
422858
+ throw new GatewayQuotaExceededError(quotaBody, response.status);
422859
+ }
422734
422860
  logError2(`[Theus router] El provider '${provider.id}' rechaz\xF3 el streaming (${response.status}); reintentando sin stream.`);
422735
422861
  response = await fetch(url3, {
422736
422862
  method: "POST",
@@ -422740,6 +422866,10 @@ async function* callOpenAICompatible({
422740
422866
  });
422741
422867
  if (!response.ok) {
422742
422868
  const detail = await response.text().catch(() => "") || streamDetail;
422869
+ const retryQuota = parseQuotaExceededBody(response.status, detail);
422870
+ if (retryQuota !== undefined) {
422871
+ throw new GatewayQuotaExceededError(retryQuota, response.status);
422872
+ }
422743
422873
  throw new Error(`${provider.id} ${response.status} ${response.statusText}${detail ? `: ${detail.slice(0, 500)}` : ""}`);
422744
422874
  }
422745
422875
  }
@@ -422992,6 +423122,9 @@ async function* queryModelWithTheusProviders({
422992
423122
  if (signal.aborted) {
422993
423123
  return;
422994
423124
  }
423125
+ if (error40 instanceof GatewayQuotaExceededError) {
423126
+ throw error40;
423127
+ }
422995
423128
  if (streamStarted && !streamEnded) {
422996
423129
  for (const index of openBlocks) {
422997
423130
  yield {
@@ -423040,6 +423173,7 @@ var init_theus2 = __esm(() => {
423040
423173
  init_auth();
423041
423174
  init_oauth();
423042
423175
  init_emptyUsage();
423176
+ init_rateLimitMessages();
423043
423177
  init_theusEngine();
423044
423178
  });
423045
423179
 
@@ -423080,7 +423214,7 @@ async function sideQuery(opts) {
423080
423214
  betas.push(STRUCTURED_OUTPUTS_BETA_HEADER);
423081
423215
  }
423082
423216
  const messageText = extractFirstUserMessageText(messages);
423083
- const fingerprint = computeFingerprint(messageText, { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
423217
+ const fingerprint = computeFingerprint(messageText, { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
423084
423218
  const attributionHeader = getAttributionHeader(fingerprint);
423085
423219
  const systemBlocks = [
423086
423220
  attributionHeader ? { type: "text", text: attributionHeader } : null,
@@ -424383,7 +424517,7 @@ async function handleMemories(state) {
424383
424517
  async function runProjectContextMcpServer() {
424384
424518
  const projectRoot = process.env.THEUS_PROJECT_ROOT || process.cwd();
424385
424519
  const state = new ProjectContextState(projectRoot);
424386
- const server2 = new Server({ name: SERVER_NAME, version: { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION }, { capabilities: { tools: {} } });
424520
+ const server2 = new Server({ name: SERVER_NAME, version: { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION }, { capabilities: { tools: {} } });
424387
424521
  server2.setRequestHandler(ListToolsRequestSchema, async () => ({
424388
424522
  tools: TOOL_DEFINITIONS.map((t) => ({
424389
424523
  name: t.name,
@@ -426365,7 +426499,7 @@ function createBridgeLogger(options2) {
426365
426499
  connectUrl = buildBridgeConnectUrl(environmentId, cachedIngressUrl);
426366
426500
  regenerateQr(connectUrl);
426367
426501
  if (verbose) {
426368
- write(source_default.dim(`Remote Control`) + ` v${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}
426502
+ write(source_default.dim(`Remote Control`) + ` v${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}
426369
426503
  `);
426370
426504
  }
426371
426505
  if (verbose) {
@@ -427338,7 +427472,7 @@ function appendToLog(path19, message) {
427338
427472
  cwd: getFsImplementation().cwd(),
427339
427473
  userType: process.env.USER_TYPE,
427340
427474
  sessionId: getSessionId(),
427341
- version: { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
427475
+ version: { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
427342
427476
  };
427343
427477
  getLogWriter(path19).write(messageWithTimestamp);
427344
427478
  }
@@ -428608,7 +428742,7 @@ Spawn mode for this project:
428608
428742
  const api2 = createBridgeApiClient({
428609
428743
  baseUrl,
428610
428744
  getAccessToken: getBridgeAccessToken2,
428611
- runnerVersion: { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
428745
+ runnerVersion: { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
428612
428746
  onDebug: logForDebugging,
428613
428747
  onAuth401: handleOAuth401Error2,
428614
428748
  getTrustedDeviceToken
@@ -428846,7 +428980,7 @@ async function runBridgeHeadless(opts, signal) {
428846
428980
  const api2 = createBridgeApiClient({
428847
428981
  baseUrl,
428848
428982
  getAccessToken: opts.getAccessToken,
428849
- runnerVersion: { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
428983
+ runnerVersion: { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
428850
428984
  onDebug: log2,
428851
428985
  onAuth401: opts.onAuth401,
428852
428986
  getTrustedDeviceToken
@@ -432912,7 +433046,7 @@ function buildSystemInitMessage(inputs) {
432912
433046
  slash_commands: inputs.commands.filter((c5) => c5.userInvocable !== false).map((c5) => c5.name),
432913
433047
  apiKeySource: getTheusApiKeyWithSource().source,
432914
433048
  betas: getSdkBetas(),
432915
- theus_code_version: { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
433049
+ theus_code_version: { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
432916
433050
  output_style: outputStyle2,
432917
433051
  agents: inputs.agents.map((agent) => agent.agentType),
432918
433052
  skills: inputs.skills.filter((s) => s.userInvocable !== false).map((skill) => skill.name),
@@ -432952,8 +433086,8 @@ async function getEnvLessBridgeConfig() {
432952
433086
  }
432953
433087
  async function checkEnvLessBridgeMinVersion() {
432954
433088
  const cfg = await getEnvLessBridgeConfig();
432955
- if (cfg.min_version && lt({ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, cfg.min_version)) {
432956
- return `Your version of Theus (${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}) is too old for Remote Control.
433089
+ if (cfg.min_version && lt({ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, cfg.min_version)) {
433090
+ return `Your version of Theus (${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}) is too old for Remote Control.
432957
433091
  Version ${cfg.min_version} or higher is required. Run \`theus update\` to update.`;
432958
433092
  }
432959
433093
  return null;
@@ -435277,7 +435411,7 @@ async function initBridgeCore(params) {
435277
435411
  const rawApi = createBridgeApiClient({
435278
435412
  baseUrl,
435279
435413
  getAccessToken,
435280
- runnerVersion: { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
435414
+ runnerVersion: { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
435281
435415
  onDebug: logForDebugging,
435282
435416
  onAuth401,
435283
435417
  getTrustedDeviceToken
@@ -452020,7 +452154,7 @@ var init_useVoiceEnabled = __esm(() => {
452020
452154
  function getSemverPart(version3) {
452021
452155
  return `${import_semver14.major(version3, { loose: true })}.${import_semver14.minor(version3, { loose: true })}.${import_semver14.patch(version3, { loose: true })}`;
452022
452156
  }
452023
- function useUpdateNotification(updatedVersion, initialVersion = { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION) {
452157
+ function useUpdateNotification(updatedVersion, initialVersion = { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION) {
452024
452158
  const [lastNotifiedSemver, setLastNotifiedSemver] = import_react232.useState(() => getSemverPart(initialVersion));
452025
452159
  if (!updatedVersion) {
452026
452160
  return null;
@@ -452060,7 +452194,7 @@ function AutoUpdater({
452060
452194
  return;
452061
452195
  }
452062
452196
  if (false) {}
452063
- const currentVersion = { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
452197
+ const currentVersion = { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
452064
452198
  const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
452065
452199
  let latestVersion = await getLatestVersion(channel2);
452066
452200
  const isDisabled2 = isAutoUpdaterDisabled();
@@ -452196,7 +452330,7 @@ function AutoUpdater({
452196
452330
  " ",
452197
452331
  /* @__PURE__ */ jsx_runtime408.jsx(ThemedText, {
452198
452332
  bold: true,
452199
- children: hasLocalInstall ? `cd ~/.theus/local && npm update ${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}` : `npm i -g ${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}`
452333
+ children: hasLocalInstall ? `cd ~/.theus/local && npm update ${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}` : `npm i -g ${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}`
452200
452334
  })
452201
452335
  ]
452202
452336
  })
@@ -452273,12 +452407,12 @@ function NativeAutoUpdater({
452273
452407
  logEvent("tengu_native_auto_updater_start", {});
452274
452408
  try {
452275
452409
  const maxVersion = await getMaxVersion();
452276
- if (maxVersion && gt({ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, maxVersion)) {
452410
+ if (maxVersion && gt({ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, maxVersion)) {
452277
452411
  const msg = await getMaxVersionMessage();
452278
452412
  setMaxVersionIssue(msg ?? "affects your version");
452279
452413
  }
452280
452414
  const result = await installLatest(channel2);
452281
- const currentVersion = { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
452415
+ const currentVersion = { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
452282
452416
  const latencyMs = Date.now() - startTime2;
452283
452417
  if (result.lockFailed) {
452284
452418
  logEvent("tengu_native_auto_updater_lock_contention", {
@@ -452415,17 +452549,17 @@ function PackageManagerAutoUpdater(t0) {
452415
452549
  const maxVersion = await getMaxVersion();
452416
452550
  if (maxVersion && latest && gt(latest, maxVersion)) {
452417
452551
  logForDebugging(`PackageManagerAutoUpdater: maxVersion ${maxVersion} is set, capping update from ${latest} to ${maxVersion}`);
452418
- if (gte({ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, maxVersion)) {
452419
- logForDebugging(`PackageManagerAutoUpdater: current version ${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} is already at or above maxVersion ${maxVersion}, skipping update`);
452552
+ if (gte({ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, maxVersion)) {
452553
+ logForDebugging(`PackageManagerAutoUpdater: current version ${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} is already at or above maxVersion ${maxVersion}, skipping update`);
452420
452554
  setUpdateAvailable(false);
452421
452555
  return;
452422
452556
  }
452423
452557
  latest = maxVersion;
452424
452558
  }
452425
- const hasUpdate = latest && !gte({ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, latest) && !shouldSkipVersion(latest);
452559
+ const hasUpdate = latest && !gte({ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, latest) && !shouldSkipVersion(latest);
452426
452560
  setUpdateAvailable(!!hasUpdate);
452427
452561
  if (hasUpdate) {
452428
- logForDebugging(`PackageManagerAutoUpdater: Update available ${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} -> ${latest}`);
452562
+ logForDebugging(`PackageManagerAutoUpdater: Update available ${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} -> ${latest}`);
452429
452563
  }
452430
452564
  };
452431
452565
  $2[0] = t1;
@@ -452459,7 +452593,7 @@ function PackageManagerAutoUpdater(t0) {
452459
452593
  wrap: "truncate",
452460
452594
  children: [
452461
452595
  "currentVersion: ",
452462
- { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
452596
+ { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
452463
452597
  ]
452464
452598
  });
452465
452599
  $2[3] = verbose;
@@ -460333,7 +460467,7 @@ function buildStatusLineCommandInput(permissionMode, exceeds200kTokens, settings
460333
460467
  project_dir: getOriginalCwd(),
460334
460468
  added_dirs: addedDirs
460335
460469
  },
460336
- version: { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
460470
+ version: { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
460337
460471
  output_style: {
460338
460472
  name: outputStyleName
460339
460473
  },
@@ -484613,7 +484747,7 @@ function completeOnboarding() {
484613
484747
  saveGlobalConfig((current) => ({
484614
484748
  ...current,
484615
484749
  hasCompletedOnboarding: true,
484616
- lastOnboardingVersion: { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
484750
+ lastOnboardingVersion: { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
484617
484751
  }));
484618
484752
  }
484619
484753
  function showDialog(root2, renderer) {
@@ -495564,7 +495698,7 @@ async function startMCPServer(cwd3, debug3, verbose) {
495564
495698
  setCwd(cwd3);
495565
495699
  const server2 = new Server({
495566
495700
  name: "theus/tengu",
495567
- version: { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
495701
+ version: { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
495568
495702
  }, {
495569
495703
  capabilities: {
495570
495704
  tools: {}
@@ -497006,7 +497140,7 @@ async function setupTokenHandler(root2) {
497006
497140
  gap: 1,
497007
497141
  children: [
497008
497142
  /* @__PURE__ */ jsx_runtime494.jsx(TheusBanner, {
497009
- version: { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
497143
+ version: { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
497010
497144
  }),
497011
497145
  showAuthWarning && /* @__PURE__ */ jsx_runtime494.jsxs(ThemedBox_default, {
497012
497146
  flexDirection: "column",
@@ -498488,7 +498622,7 @@ ${assistantAddendum}` : assistantAddendum;
498488
498622
  }
498489
498623
  }
498490
498624
  logForDiagnosticsNoPII("info", "started", {
498491
- version: { VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
498625
+ version: { VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
498492
498626
  is_native_binary: isInBundledMode()
498493
498627
  });
498494
498628
  registerCleanup(async () => {
@@ -499356,7 +499490,7 @@ Usage: theus --remote "your task description"`, () => gracefulShutdown(1));
499356
499490
  pendingHookMessages
499357
499491
  }, renderAndRun);
499358
499492
  }
499359
- }).version(`${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} (Theus)`, "-v, --version", "Muestra el n\xFAmero de versi\xF3n");
499493
+ }).version(`${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} (Theus)`, "-v, --version", "Muestra el n\xFAmero de versi\xF3n");
499360
499494
  program2.option("-w, --worktree [name]", "Crea un nuevo worktree de git para esta sesi\xF3n (opcionalmente indica un nombre)");
499361
499495
  program2.option("--tmux", "Crea una sesi\xF3n de tmux para el worktree (requiere --worktree). Usa paneles nativos de iTerm2 cuando est\xE1n disponibles; usa --tmux=classic para tmux tradicional.");
499362
499496
  if (canUserConfigureAdvisor()) {
@@ -499908,7 +500042,7 @@ if (false) {}
499908
500042
  async function main2() {
499909
500043
  const args = process.argv.slice(2);
499910
500044
  if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
499911
- console.log(`${{ VERSION: "0.2.51", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} (Theus)`);
500045
+ console.log(`${{ VERSION: "0.2.53", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} (Theus)`);
499912
500046
  return;
499913
500047
  }
499914
500048
  const {