theus-cli 0.2.81 → 0.2.83

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cli.js CHANGED
@@ -3475,19 +3475,80 @@ var require_sdk = __commonJS((exports, module) => {
3475
3475
  }
3476
3476
 
3477
3477
  class APIError extends Error {
3478
- constructor(message = "Theus SDK compatibility layer is not connected") {
3479
- super(message);
3478
+ constructor(status, error, message, headers) {
3479
+ super(APIError.makeMessage(status, error, message));
3480
3480
  this.name = "APIError";
3481
+ this.status = status;
3482
+ this.headers = headers;
3483
+ this.requestID = typeof headers?.get === "function" ? headers.get("request-id") : headers?.["request-id"];
3484
+ this.error = error;
3485
+ }
3486
+ static makeMessage(status, error, message) {
3487
+ const detail = error?.message ? typeof error.message === "string" ? error.message : JSON.stringify(error.message) : error ? JSON.stringify(error) : message;
3488
+ if (status && detail)
3489
+ return `${status} ${detail}`;
3490
+ if (status)
3491
+ return `${status} status code (no body)`;
3492
+ if (detail)
3493
+ return detail;
3494
+ return "(no status code or body)";
3495
+ }
3496
+ static generate(status, errorResponse, message, headers) {
3497
+ if (!status || !headers) {
3498
+ return new APIConnectionError({
3499
+ message,
3500
+ cause: errorResponse instanceof Error ? errorResponse : new Error(String(errorResponse))
3501
+ });
3502
+ }
3503
+ const ErrorClass = status === 400 ? BadRequestError : status === 401 ? AuthenticationError : status === 403 ? PermissionDeniedError : status === 404 ? NotFoundError : status === 409 ? ConflictError : status === 422 ? UnprocessableEntityError : status === 429 ? RateLimitError : status >= 500 ? InternalServerError : APIError;
3504
+ return new ErrorClass(status, errorResponse, message, headers);
3481
3505
  }
3482
3506
  }
3483
3507
 
3484
- class APIUserAbortError extends Error {
3485
- constructor(message = "Theus request aborted") {
3486
- super(message);
3487
- this.name = "APIUserAbortError";
3508
+ class APIUserAbortError extends APIError {
3509
+ constructor({ message } = {}) {
3510
+ super(undefined, undefined, message || "Request was aborted.", undefined);
3511
+ }
3512
+ }
3513
+
3514
+ class APIConnectionError extends APIError {
3515
+ constructor({ message, cause } = {}) {
3516
+ super(undefined, undefined, message || "Connection error.", undefined);
3517
+ if (cause)
3518
+ this.cause = cause;
3519
+ }
3520
+ }
3521
+
3522
+ class APIConnectionTimeoutError extends APIConnectionError {
3523
+ constructor({ message } = {}) {
3524
+ super({ message: message ?? "Request timed out." });
3488
3525
  }
3489
3526
  }
3490
3527
 
3528
+ class BadRequestError extends APIError {
3529
+ }
3530
+
3531
+ class AuthenticationError extends APIError {
3532
+ }
3533
+
3534
+ class PermissionDeniedError extends APIError {
3535
+ }
3536
+
3537
+ class NotFoundError extends APIError {
3538
+ }
3539
+
3540
+ class ConflictError extends APIError {
3541
+ }
3542
+
3543
+ class UnprocessableEntityError extends APIError {
3544
+ }
3545
+
3546
+ class RateLimitError extends APIError {
3547
+ }
3548
+
3549
+ class InternalServerError extends APIError {
3550
+ }
3551
+
3491
3552
  class Theus {
3492
3553
  constructor(options = {}) {
3493
3554
  const Compat = loadCompat();
@@ -3508,17 +3569,17 @@ var require_sdk = __commonJS((exports, module) => {
3508
3569
  module.exports.default = Theus;
3509
3570
  module.exports.Theus = Theus;
3510
3571
  module.exports.APIError = APIError;
3511
- module.exports.APIConnectionError = Error;
3512
- module.exports.APIConnectionTimeoutError = Error;
3572
+ module.exports.APIConnectionError = APIConnectionError;
3573
+ module.exports.APIConnectionTimeoutError = APIConnectionTimeoutError;
3513
3574
  module.exports.APIUserAbortError = APIUserAbortError;
3514
- module.exports.AuthenticationError = APIError;
3515
- module.exports.BadRequestError = APIError;
3516
- module.exports.ConflictError = APIError;
3517
- module.exports.InternalServerError = APIError;
3518
- module.exports.NotFoundError = APIError;
3519
- module.exports.PermissionDeniedError = APIError;
3520
- module.exports.RateLimitError = APIError;
3521
- module.exports.UnprocessableEntityError = APIError;
3575
+ module.exports.AuthenticationError = AuthenticationError;
3576
+ module.exports.BadRequestError = BadRequestError;
3577
+ module.exports.ConflictError = ConflictError;
3578
+ module.exports.InternalServerError = InternalServerError;
3579
+ module.exports.NotFoundError = NotFoundError;
3580
+ module.exports.PermissionDeniedError = PermissionDeniedError;
3581
+ module.exports.RateLimitError = RateLimitError;
3582
+ module.exports.UnprocessableEntityError = UnprocessableEntityError;
3522
3583
  }
3523
3584
  });
3524
3585
 
@@ -48898,7 +48959,7 @@ var init_env = __esm(() => {
48898
48959
  });
48899
48960
 
48900
48961
  // constants/figures.ts
48901
- var BLACK_CIRCLE, TEARDROP_ASTERISK = "\u273B", UP_ARROW = "\u2191", DOWN_ARROW = "\u2193", LIGHTNING_BOLT = "\u21AF", EFFORT_LOW = "\u25CB", EFFORT_MEDIUM = "\u25D0", EFFORT_HIGH = "\u25CF", EFFORT_MAX = "\u25C9", PAUSE_ICON = "\u23F8", REFRESH_ARROW = "\u21BB", DIAMOND_OPEN = "\u25C7", DIAMOND_FILLED = "\u25C6", REFERENCE_MARK = "\u203B", BLOCKQUOTE_BAR = "\u258E", BRIDGE_SPINNER_FRAMES, BRIDGE_READY_INDICATOR = "\xB7\u2714\uFE0E\xB7", BRIDGE_FAILED_INDICATOR = "\xD7";
48962
+ var BLACK_CIRCLE, TEARDROP_ASTERISK = "\u273B", UP_ARROW = "\u2191", DOWN_ARROW = "\u2193", LIGHTNING_BOLT = "\u21AF", EFFORT_LOW = "\u25CB", EFFORT_MEDIUM = "\u25D0", EFFORT_HIGH = "\u25CF", EFFORT_RAPIDO = "\u21AF", EFFORT_MAX = "\u25C9", PAUSE_ICON = "\u23F8", REFRESH_ARROW = "\u21BB", DIAMOND_OPEN = "\u25C7", DIAMOND_FILLED = "\u25C6", REFERENCE_MARK = "\u203B", BLOCKQUOTE_BAR = "\u258E", BRIDGE_SPINNER_FRAMES, BRIDGE_READY_INDICATOR = "\xB7\u2714\uFE0E\xB7", BRIDGE_FAILED_INDICATOR = "\xD7";
48902
48963
  var init_figures2 = __esm(() => {
48903
48964
  init_env();
48904
48965
  BLACK_CIRCLE = env3.platform === "darwin" ? "\u23FA" : "\u25CF";
@@ -57780,7 +57841,7 @@ async function _executeApiKeyHelper(isNonInteractiveSession) {
57780
57841
  if (isApiKeyHelperFromProjectOrLocalSettings()) {
57781
57842
  const hasTrust = checkHasTrustDialogAccepted();
57782
57843
  if (!hasTrust && !isNonInteractiveSession) {
57783
- const error40 = new Error(`Security: apiKeyHelper executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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}.`);
57844
+ const error40 = new Error(`Security: apiKeyHelper executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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}.`);
57784
57845
  logAntError("apiKeyHelper invoked before trust check", error40);
57785
57846
  logEvent("theus_apiKeyHelper_missing_trust11", {});
57786
57847
  return null;
@@ -57824,7 +57885,7 @@ async function runAwsAuthRefresh() {
57824
57885
  if (isAwsAuthRefreshFromProjectSettings()) {
57825
57886
  const hasTrust = checkHasTrustDialogAccepted();
57826
57887
  if (!hasTrust && !getIsNonInteractiveSession()) {
57827
- const error40 = new Error(`Security: awsAuthRefresh executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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}.`);
57888
+ const error40 = new Error(`Security: awsAuthRefresh executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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}.`);
57828
57889
  logAntError("awsAuthRefresh invoked before trust check", error40);
57829
57890
  logEvent("theus_awsAuthRefresh_missing_trust", {});
57830
57891
  return false;
@@ -57884,7 +57945,7 @@ async function getAwsCredsFromCredentialExport() {
57884
57945
  if (isAwsCredentialExportFromProjectSettings()) {
57885
57946
  const hasTrust = checkHasTrustDialogAccepted();
57886
57947
  if (!hasTrust && !getIsNonInteractiveSession()) {
57887
- const error40 = new Error(`Security: awsCredentialExport executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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}.`);
57948
+ const error40 = new Error(`Security: awsCredentialExport executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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}.`);
57888
57949
  logAntError("awsCredentialExport invoked before trust check", error40);
57889
57950
  logEvent("theus_awsCredentialExport_missing_trust", {});
57890
57951
  return null;
@@ -57969,7 +58030,7 @@ async function runGcpAuthRefresh() {
57969
58030
  if (isGcpAuthRefreshFromProjectSettings()) {
57970
58031
  const hasTrust = checkHasTrustDialogAccepted();
57971
58032
  if (!hasTrust && !getIsNonInteractiveSession()) {
57972
- const error40 = new Error(`Security: gcpAuthRefresh executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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}.`);
58033
+ const error40 = new Error(`Security: gcpAuthRefresh executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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}.`);
57973
58034
  logAntError("gcpAuthRefresh invoked before trust check", error40);
57974
58035
  logEvent("theus_gcpAuthRefresh_missing_trust", {});
57975
58036
  return false;
@@ -58688,7 +58749,7 @@ var init_auth = __esm(() => {
58688
58749
 
58689
58750
  // utils/userAgent.ts
58690
58751
  function getTheusCodeUserAgent() {
58691
- return `theus-code/${{ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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}`;
58752
+ return `theus-code/${{ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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}`;
58692
58753
  }
58693
58754
 
58694
58755
  // utils/workloadContext.ts
@@ -58710,7 +58771,7 @@ function getUserAgent() {
58710
58771
  const clientApp = process.env.THEUS_AGENT_SDK_CLIENT_APP ? `, client-app/${process.env.THEUS_AGENT_SDK_CLIENT_APP}` : "";
58711
58772
  const workload = getWorkload();
58712
58773
  const workloadSuffix = workload ? `, workload/${workload}` : "";
58713
- return `theus-cli/${{ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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} (${"external"}, ${process.env.THEUS_CODE_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
58774
+ return `theus-cli/${{ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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} (${"external"}, ${process.env.THEUS_CODE_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
58714
58775
  }
58715
58776
  function getMCPUserAgent() {
58716
58777
  const parts = [];
@@ -58724,7 +58785,7 @@ function getMCPUserAgent() {
58724
58785
  parts.push(`client-app/${process.env.THEUS_AGENT_SDK_CLIENT_APP}`);
58725
58786
  }
58726
58787
  const suffix = parts.length > 0 ? ` (${parts.join(", ")})` : "";
58727
- return `theus-code/${{ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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}`;
58788
+ return `theus-code/${{ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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}`;
58728
58789
  }
58729
58790
  function getWebFetchUserAgent() {
58730
58791
  return `Theus-User (${getTheusCodeUserAgent()}; +https://support.theus.pe/)`;
@@ -58862,7 +58923,7 @@ var init_user = __esm(() => {
58862
58923
  deviceId,
58863
58924
  sessionId: getSessionId(),
58864
58925
  email: getEmail(),
58865
- appVersion: { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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,
58926
+ appVersion: { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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,
58866
58927
  platform: getHostPlatformForAnalytics(),
58867
58928
  organizationUuid,
58868
58929
  accountUuid,
@@ -60572,7 +60633,7 @@ var init_metadata = __esm(() => {
60572
60633
  COMPOUND_OPERATOR_REGEX = /\s*(?:&&|\|\||[;|])\s*/;
60573
60634
  WHITESPACE_REGEX = /\s+/;
60574
60635
  getVersionBase = memoize_default(() => {
60575
- const match = { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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]+)?/);
60636
+ const match = { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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]+)?/);
60576
60637
  return match ? match[0] : undefined;
60577
60638
  });
60578
60639
  buildEnvContext = memoize_default(async () => {
@@ -60612,9 +60673,9 @@ var init_metadata = __esm(() => {
60612
60673
  isGithubAction: isEnvTruthy(process.env.GITHUB_ACTIONS),
60613
60674
  isTheusCodeAction: isEnvTruthy(process.env.THEUS_CODE_ACTION),
60614
60675
  isTheusAiAuth: isTheusAISubscriber(),
60615
- version: { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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,
60676
+ version: { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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,
60616
60677
  versionBase: getVersionBase(),
60617
- buildTime: { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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,
60678
+ buildTime: { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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,
60618
60679
  deploymentEnvironment: env3.detectDeploymentEnvironment(),
60619
60680
  ...isEnvTruthy(process.env.GITHUB_ACTIONS) && {
60620
60681
  githubEventName: process.env.GITHUB_EVENT_NAME,
@@ -61230,7 +61291,7 @@ function initialize1PEventLogging() {
61230
61291
  const platform2 = getPlatform();
61231
61292
  const attributes = {
61232
61293
  [ATTR_SERVICE_NAME]: "theus-code",
61233
- [ATTR_SERVICE_VERSION]: { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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
61294
+ [ATTR_SERVICE_VERSION]: { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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
61234
61295
  };
61235
61296
  if (platform2 === "wsl") {
61236
61297
  const wslVersion = getWslVersion();
@@ -61257,7 +61318,7 @@ function initialize1PEventLogging() {
61257
61318
  })
61258
61319
  ]
61259
61320
  });
61260
- firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.theus.theus_code.events", { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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);
61321
+ firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.theus.theus_code.events", { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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);
61261
61322
  }
61262
61323
  async function reinitialize1PEventLoggingIfConfigChanged() {
61263
61324
  if (!is1PEventLoggingEnabled() || !firstPartyEventLoggerProvider) {
@@ -91096,7 +91157,7 @@ function getAttributionHeader(fingerprint) {
91096
91157
  if (!isAttributionHeaderEnabled()) {
91097
91158
  return "";
91098
91159
  }
91099
- const version2 = `${{ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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}`;
91160
+ const version2 = `${{ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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}`;
91100
91161
  const entrypoint = process.env.THEUS_CODE_ENTRYPOINT ?? "unknown";
91101
91162
  const cch = "";
91102
91163
  const workload = getWorkload();
@@ -104132,7 +104193,7 @@ Complete the user's request by providing accurate, documentation-based guidance.
104132
104193
  }
104133
104194
  function getFeedbackGuideline() {
104134
104195
  if (isUsing3PServices()) {
104135
- return `- When you cannot find an answer or the feature doesn't exist, direct the user to ${{ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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}`;
104196
+ return `- When you cannot find an answer or the feature doesn't exist, direct the user to ${{ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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}`;
104136
104197
  }
104137
104198
  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";
104138
104199
  }
@@ -107209,7 +107270,11 @@ function getAssistantMessageFromError(error40, model, options) {
107209
107270
  });
107210
107271
  }
107211
107272
  }
107212
- if (error40 instanceof Error && error40.message.toLowerCase().includes("x-api-key")) {
107273
+ const mensajeDeAutenticacion = typeof error40 === "object" && error40 !== null && "message" in error40 && typeof error40.message === "string" ? error40.message : undefined;
107274
+ const estadoDeAutenticacion = typeof error40 === "object" && error40 !== null && "status" in error40 && typeof error40.status === "number" ? error40.status : undefined;
107275
+ const mencionaCabeceraDeClave = mensajeDeAutenticacion?.toLowerCase().includes("x-api-key");
107276
+ const esFalloDeAutenticacion = mencionaCabeceraDeClave && (estadoDeAutenticacion === undefined || estadoDeAutenticacion === 401);
107277
+ if (esFalloDeAutenticacion) {
107213
107278
  if (isCCRMode()) {
107214
107279
  return createAssistantAPIErrorMessage({
107215
107280
  error: "authentication_failed",
@@ -144316,7 +144381,7 @@ function getTelemetryAttributes() {
144316
144381
  attributes["session.id"] = sessionId;
144317
144382
  }
144318
144383
  if (shouldIncludeAttribute("OTEL_METRICS_INCLUDE_VERSION")) {
144319
- attributes["app.version"] = { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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;
144384
+ attributes["app.version"] = { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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;
144320
144385
  }
144321
144386
  const oauthAccount = getOauthAccountInfo();
144322
144387
  if (oauthAccount) {
@@ -220595,7 +220660,7 @@ async function getMcpHeadersFromHelper(serverName, config2) {
220595
220660
  if ("scope" in config2 && isMcpServerFromProjectOrLocalSettings(config2) && !getIsNonInteractiveSession()) {
220596
220661
  const hasTrust = checkHasTrustDialogAccepted();
220597
220662
  if (!hasTrust) {
220598
- 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.81", BUILD_TIME: "1970-01-01T00:00:00.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}.`);
220663
+ 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.83", BUILD_TIME: "1970-01-01T00:00:00.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}.`);
220599
220664
  logAntError("MCP headersHelper invoked before trust check", error40);
220600
220665
  logEvent("theus_mcp_headersHelper_missing_trust", {});
220601
220666
  return null;
@@ -221287,7 +221352,7 @@ function computeFingerprint(messageText, version2) {
221287
221352
  }
221288
221353
  function computeFingerprintFromMessages(messages) {
221289
221354
  const firstMessageText = extractFirstMessageText(messages);
221290
- return computeFingerprint(firstMessageText, { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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);
221355
+ return computeFingerprint(firstMessageText, { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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);
221291
221356
  }
221292
221357
  var FINGERPRINT_SALT = "59cf53e54c78";
221293
221358
  var init_fingerprint = () => {};
@@ -221329,7 +221394,7 @@ async function sideQuery(opts) {
221329
221394
  betas.push(STRUCTURED_OUTPUTS_BETA_HEADER);
221330
221395
  }
221331
221396
  const messageText = extractFirstUserMessageText(messages);
221332
- const fingerprint = computeFingerprint(messageText, { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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);
221397
+ const fingerprint = computeFingerprint(messageText, { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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);
221333
221398
  const attributionHeader = getAttributionHeader(fingerprint);
221334
221399
  const systemBlocks = [
221335
221400
  attributionHeader ? { type: "text", text: attributionHeader } : null,
@@ -222453,7 +222518,7 @@ async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) {
222453
222518
  const client2 = new Client({
222454
222519
  name: "theus-code",
222455
222520
  title: "Theus",
222456
- version: { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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",
222521
+ version: { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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",
222457
222522
  description: "Theus's agentic coding tool",
222458
222523
  websiteUrl: PRODUCT_URL
222459
222524
  }, {
@@ -222807,7 +222872,7 @@ var init_client5 = __esm(() => {
222807
222872
  const client2 = new Client({
222808
222873
  name: "theus-code",
222809
222874
  title: "Theus",
222810
- version: { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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",
222875
+ version: { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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",
222811
222876
  description: "Theus's agentic coding tool",
222812
222877
  websiteUrl: PRODUCT_URL
222813
222878
  }, {
@@ -242655,7 +242720,7 @@ async function initializeBetaTracing(resource) {
242655
242720
  });
242656
242721
  logs.setGlobalLoggerProvider(loggerProvider);
242657
242722
  setLoggerProvider(loggerProvider);
242658
- const eventLogger = logs.getLogger("com.theus.theus_code.events", { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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);
242723
+ const eventLogger = logs.getLogger("com.theus.theus_code.events", { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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);
242659
242724
  setEventLogger(eventLogger);
242660
242725
  process.on("beforeExit", async () => {
242661
242726
  await loggerProvider?.forceFlush();
@@ -242695,7 +242760,7 @@ async function initializeTelemetry() {
242695
242760
  const platform4 = getPlatform();
242696
242761
  const baseAttributes = {
242697
242762
  [ATTR_SERVICE_NAME]: "theus-code",
242698
- [ATTR_SERVICE_VERSION]: { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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
242763
+ [ATTR_SERVICE_VERSION]: { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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
242699
242764
  };
242700
242765
  if (platform4 === "wsl") {
242701
242766
  const wslVersion = getWslVersion();
@@ -242740,7 +242805,7 @@ async function initializeTelemetry() {
242740
242805
  } catch {}
242741
242806
  };
242742
242807
  registerCleanup(shutdownTelemetry2);
242743
- return meterProvider2.getMeter("com.theus.theus_code", { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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);
242808
+ return meterProvider2.getMeter("com.theus.theus_code", { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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);
242744
242809
  }
242745
242810
  const meterProvider = new MeterProvider({
242746
242811
  resource,
@@ -242760,7 +242825,7 @@ async function initializeTelemetry() {
242760
242825
  });
242761
242826
  logs.setGlobalLoggerProvider(loggerProvider);
242762
242827
  setLoggerProvider(loggerProvider);
242763
- const eventLogger = logs.getLogger("com.theus.theus_code.events", { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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);
242828
+ const eventLogger = logs.getLogger("com.theus.theus_code.events", { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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);
242764
242829
  setEventLogger(eventLogger);
242765
242830
  logForDebugging("[3P telemetry] Event logger set successfully");
242766
242831
  process.on("beforeExit", async () => {
@@ -242822,7 +242887,7 @@ Current timeout: ${timeoutMs}ms
242822
242887
  }
242823
242888
  };
242824
242889
  registerCleanup(shutdownTelemetry);
242825
- return meterProvider.getMeter("com.theus.theus_code", { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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);
242890
+ return meterProvider.getMeter("com.theus.theus_code", { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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);
242826
242891
  }
242827
242892
  async function flushTelemetry() {
242828
242893
  const meterProvider = getMeterProvider();
@@ -243364,7 +243429,7 @@ async function installOrUpdateTheusPackage(channel2, specificVersion) {
243364
243429
  return "install_failed";
243365
243430
  }
243366
243431
  const versionSpec = specificVersion ? specificVersion : channel2 === "stable" ? "stable" : "latest";
243367
- const result = await execFileNoThrowWithCwd("npm", ["install", `${{ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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 });
243432
+ const result = await execFileNoThrowWithCwd("npm", ["install", `${{ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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 });
243368
243433
  if (result.code !== 0) {
243369
243434
  const error40 = new Error(`Failed to install Theus CLI package: ${result.stderr}`);
243370
243435
  logError2(error40);
@@ -243510,9 +243575,9 @@ async function assertMinVersion() {
243510
243575
  if (false) {}
243511
243576
  try {
243512
243577
  const versionConfig = await getDynamicConfig_BLOCKS_ON_INIT("theus_version_config", { minVersion: "0.0.0" });
243513
- if (versionConfig.minVersion && lt({ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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)) {
243578
+ if (versionConfig.minVersion && lt({ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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)) {
243514
243579
  console.error(`
243515
- It looks like your version of Theus (${{ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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.
243580
+ It looks like your version of Theus (${{ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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.
243516
243581
  A newer version (${versionConfig.minVersion} or higher) is required to continue.
243517
243582
 
243518
243583
  To update, please run:
@@ -243649,7 +243714,7 @@ async function getInstallationPrefix() {
243649
243714
  return prefixResult.stdout.trim();
243650
243715
  }
243651
243716
  function getGlobalInstallPackageManager() {
243652
- if ({ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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") {
243717
+ if ({ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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") {
243653
243718
  return "npm";
243654
243719
  }
243655
243720
  return env3.isRunningWithBun() ? "bun" : "npm";
@@ -243674,7 +243739,7 @@ async function checkGlobalInstallPermissions() {
243674
243739
  }
243675
243740
  async function getLatestVersion(channel2) {
243676
243741
  const npmTag = channel2 === "stable" ? "stable" : "latest";
243677
- const result = await execFileNoThrowWithCwd("npm", ["view", `${{ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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: homedir20() });
243742
+ const result = await execFileNoThrowWithCwd("npm", ["view", `${{ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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: homedir20() });
243678
243743
  if (result.code !== 0) {
243679
243744
  logForDebugging(`npm view failed with code ${result.code}`);
243680
243745
  if (result.stderr) {
@@ -243690,7 +243755,7 @@ async function getLatestVersion(channel2) {
243690
243755
  return result.stdout.trim();
243691
243756
  }
243692
243757
  async function getNpmDistTags() {
243693
- const result = await execFileNoThrowWithCwd("npm", ["view", { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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: homedir20() });
243758
+ const result = await execFileNoThrowWithCwd("npm", ["view", { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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: homedir20() });
243694
243759
  if (result.code !== 0) {
243695
243760
  logForDebugging(`npm view dist-tags failed with code ${result.code}`);
243696
243761
  return { latest: null, stable: null };
@@ -243734,7 +243799,7 @@ async function installGlobalPackage(specificVersion) {
243734
243799
  logError2(new AutoUpdaterError("Another process is currently installing an update"));
243735
243800
  logEvent("theus_auto_updater_lock_contention", {
243736
243801
  pid: process.pid,
243737
- currentVersion: { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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
243802
+ currentVersion: { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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
243738
243803
  });
243739
243804
  return "in_progress";
243740
243805
  }
@@ -243743,7 +243808,7 @@ async function installGlobalPackage(specificVersion) {
243743
243808
  if (!env3.isRunningWithBun() && env3.isNpmFromWindowsPath()) {
243744
243809
  logError2(new Error("Windows NPM detected in WSL environment"));
243745
243810
  logEvent("theus_auto_updater_windows_npm_in_wsl", {
243746
- currentVersion: { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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
243811
+ currentVersion: { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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
243747
243812
  });
243748
243813
  console.error(`
243749
243814
  Error: Windows NPM detected in WSL
@@ -243762,7 +243827,7 @@ To fix this issue:
243762
243827
  if (!hasPermissions) {
243763
243828
  return "no_permissions";
243764
243829
  }
243765
- const packageSpec = specificVersion ? `${{ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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.81", BUILD_TIME: "1970-01-01T00:00:00.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;
243830
+ const packageSpec = specificVersion ? `${{ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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.83", BUILD_TIME: "1970-01-01T00:00:00.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;
243766
243831
  const packageManager = getGlobalInstallPackageManager();
243767
243832
  const installResult = await execFileNoThrowWithCwd(packageManager, ["install", "-g", packageSpec], { cwd: homedir20() });
243768
243833
  if (installResult.code !== 0) {
@@ -244091,8 +244156,8 @@ async function detectMultipleInstallations() {
244091
244156
  installations.push({ type: "npm-local", path: localPath });
244092
244157
  }
244093
244158
  const packagesToCheck = ["@theus-ai/theus-code"];
244094
- if ({ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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.81", BUILD_TIME: "1970-01-01T00:00:00.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") {
244095
- packagesToCheck.push({ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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);
244159
+ if ({ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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.83", BUILD_TIME: "1970-01-01T00:00:00.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") {
244160
+ packagesToCheck.push({ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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);
244096
244161
  }
244097
244162
  const npmResult = await execFileNoThrow("npm", [
244098
244163
  "-g",
@@ -244275,7 +244340,7 @@ function detectLinuxGlobPatternWarnings() {
244275
244340
  }
244276
244341
  async function getDoctorDiagnostic() {
244277
244342
  const installationType = await getCurrentInstallationType();
244278
- const version2 = { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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.81", BUILD_TIME: "1970-01-01T00:00:00.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";
244343
+ const version2 = { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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.83", BUILD_TIME: "1970-01-01T00:00:00.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";
244279
244344
  const installationPath = await getInstallationPath();
244280
244345
  const invokedBinary = getInvokedBinary();
244281
244346
  const multipleInstallations = await detectMultipleInstallations();
@@ -244287,8 +244352,8 @@ async function getDoctorDiagnostic() {
244287
244352
  for (const install of npmInstalls) {
244288
244353
  if (install.type === "npm-global") {
244289
244354
  let uninstallCmd = "npm -g uninstall @theus-ai/theus-code";
244290
- if ({ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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.81", BUILD_TIME: "1970-01-01T00:00:00.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") {
244291
- uninstallCmd += ` && npm -g uninstall ${{ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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}`;
244355
+ if ({ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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.83", BUILD_TIME: "1970-01-01T00:00:00.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") {
244356
+ uninstallCmd += ` && npm -g uninstall ${{ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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}`;
244292
244357
  }
244293
244358
  warnings.push({
244294
244359
  issue: `Leftover npm global installation at ${install.path}`,
@@ -245106,8 +245171,8 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
245106
245171
  const maxVersion = await getMaxVersion();
245107
245172
  if (maxVersion && gt(version2, maxVersion)) {
245108
245173
  logForDebugging(`Native installer: maxVersion ${maxVersion} is set, capping update from ${version2} to ${maxVersion}`);
245109
- if (gte({ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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)) {
245110
- logForDebugging(`Native installer: current version ${{ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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`);
245174
+ if (gte({ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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)) {
245175
+ logForDebugging(`Native installer: current version ${{ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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`);
245111
245176
  logEvent("theus_native_update_skipped_max_version", {
245112
245177
  latency_ms: Date.now() - startTime2,
245113
245178
  max_version: maxVersion,
@@ -245118,7 +245183,7 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
245118
245183
  version2 = maxVersion;
245119
245184
  }
245120
245185
  }
245121
- if (!forceReinstall && version2 === { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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)) {
245186
+ if (!forceReinstall && version2 === { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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)) {
245122
245187
  logForDebugging(`Found ${version2} at ${executablePath}, skipping install`);
245123
245188
  logEvent("theus_native_update_complete", {
245124
245189
  latency_ms: Date.now() - startTime2,
@@ -245868,8 +245933,8 @@ async function cleanupNpmInstallations() {
245868
245933
  } else if (codePackageResult.error) {
245869
245934
  errors4.push(codePackageResult.error);
245870
245935
  }
245871
- if ({ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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.81", BUILD_TIME: "1970-01-01T00:00:00.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") {
245872
- const macroPackageResult = await attemptNpmUninstall({ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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);
245936
+ if ({ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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.83", BUILD_TIME: "1970-01-01T00:00:00.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") {
245937
+ const macroPackageResult = await attemptNpmUninstall({ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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);
245873
245938
  if (macroPackageResult.success) {
245874
245939
  removed++;
245875
245940
  if (macroPackageResult.warning) {
@@ -256286,6 +256351,17 @@ var init_ConsoleOAuthFlow = __esm(() => {
256286
256351
  var NOVEDADES;
256287
256352
  var init_data = __esm(() => {
256288
256353
  NOVEDADES = [
256354
+ {
256355
+ version: "v0.2.82",
256356
+ fecha: "2026-08-16",
256357
+ titulo: "El modelo autom\xE1tico ya no se queda atrapado en el primero que falla",
256358
+ puntos: [
256359
+ "Al iniciar sesi\xF3n, el cat\xE1logo completo empataba en la decisi\xF3n local y el orden alfab\xE9tico eleg\xEDa siempre el mismo modelo. Si ese primero estaba bloqueado, todos los turnos mor\xEDan igual. Ahora el proveedor oficial delega la elecci\xF3n a TITAN, que s\xED conoce el cat\xE1logo vivo, el plan y la salud de cada ruta.",
256360
+ "Un rechazo de acceso, una cuota temporal o un timeout de un proveedor ya no corta el turno si queda otra ruta disponible. Theus contin\xFAa con la siguiente y aparta durante quince minutos un modelo que acumule tres rechazos seguidos.",
256361
+ "Los errores que llegan al cliente quedan limpios: una p\xE1gina de bloqueo, una URL interna o el nombre t\xE9cnico del proveedor no vuelven a mezclarse con el mensaje \xFAtil.",
256362
+ "En /recarga, cerrar cualquier pantalla deja un mensaje claro. Si el servidor rechaz\xF3 la operaci\xF3n, el motivo real sobrevive al cierre; si la recarga ya se acredit\xF3, Enter y Esc muestran el mismo acuse."
256363
+ ]
256364
+ },
256289
256365
  {
256290
256366
  version: "v0.2.81",
256291
256367
  fecha: "2026-08-14",
@@ -297950,6 +298026,25 @@ var init_tokenBudget2 = __esm(() => {
297950
298026
  init_tokenBudget();
297951
298027
  });
297952
298028
 
298029
+ // services/router/routerEnv.ts
298030
+ function isRouterEnabled() {
298031
+ const raw = process.env.THEUS_ROUTER;
298032
+ if (raw === undefined)
298033
+ return true;
298034
+ const normalized = raw.toLowerCase().trim();
298035
+ if (normalized === "")
298036
+ return true;
298037
+ return !ROUTER_OFF_VALUES.has(normalized);
298038
+ }
298039
+ var ROUTER_OFF_VALUES, SERVER_SIDE_ROUTER_ALIASES;
298040
+ var init_routerEnv = __esm(() => {
298041
+ ROUTER_OFF_VALUES = new Set(["0", "false", "off", "no"]);
298042
+ SERVER_SIDE_ROUTER_ALIASES = new Set([
298043
+ "theus-router-auto",
298044
+ "titan"
298045
+ ]);
298046
+ });
298047
+
297953
298048
  // services/router/knownModels.ts
297954
298049
  function knownModelsFor(family) {
297955
298050
  return (KNOWN_MODELS[family] ?? []).map((card) => ({
@@ -298218,7 +298313,7 @@ function conservativeCard(model) {
298218
298313
  }
298219
298314
  function cardsForEntry(entry) {
298220
298315
  const options2 = readEntryOptions(entry);
298221
- const family = detectProviderFamily({
298316
+ const family = isTheusSubscription(options2) ? undefined : detectProviderFamily({
298222
298317
  id: entry.id,
298223
298318
  adapter: entry.adapter,
298224
298319
  baseURL: readString(options2.baseURL),
@@ -298248,10 +298343,26 @@ function cardsForEntry(entry) {
298248
298343
  }
298249
298344
  return cards;
298250
298345
  }
298346
+ function isRoutingDelegated(options2) {
298347
+ if (options2.routerDelegated === true)
298348
+ return true;
298349
+ if (options2.routerDelegated === false)
298350
+ return false;
298351
+ const defaultModel = readString(options2.model);
298352
+ return defaultModel !== undefined && SERVER_SIDE_ROUTER_ALIASES.has(defaultModel);
298353
+ }
298354
+ function isTheusSubscription(options2) {
298355
+ if (typeof options2.routerDelegated === "boolean")
298356
+ return true;
298357
+ const defaultModel = readString(options2.model);
298358
+ return defaultModel !== undefined && SERVER_SIDE_ROUTER_ALIASES.has(defaultModel);
298359
+ }
298251
298360
  function entryContributesModels(entry) {
298252
298361
  if (NON_LLM_ADAPTERS.has(entry.adapter))
298253
298362
  return false;
298254
298363
  const options2 = readEntryOptions(entry);
298364
+ if (isRoutingDelegated(options2))
298365
+ return false;
298255
298366
  if (Array.isArray(options2.models) && options2.models.length > 0)
298256
298367
  return true;
298257
298368
  return Boolean(detectProviderFamily({
@@ -298327,6 +298438,7 @@ var NON_LLM_ADAPTERS;
298327
298438
  var init_registry3 = __esm(() => {
298328
298439
  init_registry2();
298329
298440
  init_secretStore();
298441
+ init_routerEnv();
298330
298442
  init_knownModels();
298331
298443
  NON_LLM_ADAPTERS = new Set(["report", "chart", "video", "image", "media"]);
298332
298444
  });
@@ -298466,6 +298578,9 @@ function isDenied(card, taskKind, rules) {
298466
298578
  return rules.some((r) => ruleMatches(r, card, taskKind));
298467
298579
  }
298468
298580
  function estCostUsd(card, estInputTokens) {
298581
+ if (card.weightTt !== undefined) {
298582
+ return (estInputTokens + ASSUMED_OUTPUT_TOKENS) / 1000 * card.weightTt;
298583
+ }
298469
298584
  const inCost = estInputTokens / 1000 * card.costPer1kInputUsd;
298470
298585
  const outCost = ASSUMED_OUTPUT_TOKENS / 1000 * card.costPer1kOutputUsd;
298471
298586
  return inCost + outCost;
@@ -299106,21 +299221,6 @@ var init_telemetry = __esm(() => {
299106
299221
  MAX_BYTES_DEFAULT = 5 * 1024 * 1024;
299107
299222
  });
299108
299223
 
299109
- // services/router/routerEnv.ts
299110
- function isRouterEnabled() {
299111
- const raw = process.env.THEUS_ROUTER;
299112
- if (raw === undefined)
299113
- return true;
299114
- const normalized = raw.toLowerCase().trim();
299115
- if (normalized === "")
299116
- return true;
299117
- return !ROUTER_OFF_VALUES.has(normalized);
299118
- }
299119
- var ROUTER_OFF_VALUES;
299120
- var init_routerEnv = __esm(() => {
299121
- ROUTER_OFF_VALUES = new Set(["0", "false", "off", "no"]);
299122
- });
299123
-
299124
299224
  // services/router/planExecutor.ts
299125
299225
  var exports_planExecutor = {};
299126
299226
  __export(exports_planExecutor, {
@@ -300238,9 +300338,9 @@ function getTheusEnvMetadata() {
300238
300338
  };
300239
300339
  }
300240
300340
  function getBuildAgeMinutes() {
300241
- if (!{ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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)
300341
+ if (!{ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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)
300242
300342
  return;
300243
- const buildTime = new Date({ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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();
300343
+ const buildTime = new Date({ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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();
300244
300344
  if (isNaN(buildTime))
300245
300345
  return;
300246
300346
  return Math.floor((Date.now() - buildTime) / 60000);
@@ -318545,7 +318645,7 @@ function getSimpleDoingTasksSection() {
318545
318645
  ];
318546
318646
  const userHelpSubitems = [
318547
318647
  `/help: Get help with using Theus`,
318548
- `To give feedback, users should ${{ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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}`
318648
+ `To give feedback, users should ${{ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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}`
318549
318649
  ];
318550
318650
  const items = [
318551
318651
  `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.`,
@@ -319484,13 +319584,14 @@ var init_index_d = __esm(() => {
319484
319584
  APIError7 = class APIError7 extends Error {
319485
319585
  status;
319486
319586
  headers;
319587
+ requestID;
319487
319588
  error;
319488
319589
  };
319489
- APIConnectionError4 = class APIConnectionError4 extends Error {
319590
+ APIConnectionError4 = class APIConnectionError4 extends APIError7 {
319490
319591
  };
319491
319592
  APIConnectionTimeoutError2 = class APIConnectionTimeoutError2 extends APIConnectionError4 {
319492
319593
  };
319493
- APIUserAbortError5 = class APIUserAbortError5 extends Error {
319594
+ APIUserAbortError5 = class APIUserAbortError5 extends APIError7 {
319494
319595
  };
319495
319596
  });
319496
319597
 
@@ -321666,9 +321767,20 @@ function mapStopReason(finishReason) {
321666
321767
  function chatCompletionHeaders(provider) {
321667
321768
  return {
321668
321769
  "content-type": "application/json",
321669
- ...provider.apiKey ? { authorization: `Bearer ${provider.apiKey}` } : {}
321770
+ ...provider.apiKey ? { authorization: `Bearer ${provider.apiKey}` } : {},
321771
+ ...esGatewayTheus(provider) ? { "x-theus-router": "cliente" } : {}
321670
321772
  };
321671
321773
  }
321774
+ function esGatewayTheus(provider) {
321775
+ if (provider.id === "theus-official")
321776
+ return true;
321777
+ try {
321778
+ const host = new URL(provider.baseURL).hostname.toLowerCase();
321779
+ return host === "theus.pe" || host.endsWith(".theus.pe");
321780
+ } catch {
321781
+ return false;
321782
+ }
321783
+ }
321672
321784
  function parseQuotaExceededBody(status, detail) {
321673
321785
  if (status !== 429 && status !== 402)
321674
321786
  return;
@@ -329681,7 +329793,7 @@ async function submitTranscriptShare(messages, trigger, appearanceId) {
329681
329793
  } catch {}
329682
329794
  const data = {
329683
329795
  trigger,
329684
- version: { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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,
329796
+ version: { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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,
329685
329797
  platform: process.platform,
329686
329798
  transcript,
329687
329799
  subagentTranscripts: Object.keys(subagentTranscripts).length > 0 ? subagentTranscripts : undefined,
@@ -329886,10 +329998,10 @@ Si el usuario indic\xF3 una duraci\xF3n, p\xE1sala en el par\xE1metro \`duration
329886
329998
 
329887
329999
  // commands/issue/index.ts
329888
330000
  function getCliVersion() {
329889
- return { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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.81", BUILD_TIME: "1970-01-01T00:00:00.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";
330001
+ return { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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.83", BUILD_TIME: "1970-01-01T00:00:00.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";
329890
330002
  }
329891
330003
  function getIssuesExplainer() {
329892
- return { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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.81", BUILD_TIME: "1970-01-01T00:00:00.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";
330004
+ return { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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.83", BUILD_TIME: "1970-01-01T00:00:00.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";
329893
330005
  }
329894
330006
  function getActiveModelLabel() {
329895
330007
  try {
@@ -332675,7 +332787,7 @@ function buildPrimarySection() {
332675
332787
  });
332676
332788
  return [{
332677
332789
  label: "Version",
332678
- value: { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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
332790
+ value: { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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
332679
332791
  }, {
332680
332792
  label: "Session name",
332681
332793
  value: nameValue
@@ -333510,6 +333622,9 @@ var init_ThemePicker = __esm(() => {
333510
333622
  function getEffortNotificationText(effortValue, model) {
333511
333623
  if (!modelSupportsEffort(model))
333512
333624
  return;
333625
+ if (resolveAppliedEffort(model, effortValue) === undefined) {
333626
+ return `${EFFORT_RAPIDO} respuesta r\xE1pida \xB7 /inteligencia`;
333627
+ }
333513
333628
  const level = getDisplayedEffortLevel(model, effortValue);
333514
333629
  return `${effortLevelToSymbol(level)} ${getEffortLevelLabelEs(level)} \xB7 /inteligencia`;
333515
333630
  }
@@ -336491,7 +336606,7 @@ function Config({
336491
336606
  }
336492
336607
  })
336493
336608
  }) : showSubmenu === "ChannelDowngrade" ? /* @__PURE__ */ jsx_runtime189.jsx(ChannelDowngradeDialog, {
336494
- currentVersion: { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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,
336609
+ currentVersion: { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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,
336495
336610
  onChoice: (choice) => {
336496
336611
  setShowSubmenu(null);
336497
336612
  setTabsHidden(false);
@@ -336503,7 +336618,7 @@ function Config({
336503
336618
  autoUpdatesChannel: "stable"
336504
336619
  };
336505
336620
  if (choice === "stay") {
336506
- newSettings.minimumVersion = { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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;
336621
+ newSettings.minimumVersion = { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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;
336507
336622
  }
336508
336623
  updateSettingsForSource("userSettings", newSettings);
336509
336624
  setSettingsData((prev_27) => ({
@@ -343862,7 +343977,7 @@ function HelpV2(t0) {
343862
343977
  let t6;
343863
343978
  if ($2[31] !== tabs) {
343864
343979
  t6 = /* @__PURE__ */ jsx_runtime215.jsx(Tabs, {
343865
- title: `Theus v${{ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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}`,
343980
+ title: `Theus v${{ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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}`,
343866
343981
  color: "professionalBlue",
343867
343982
  defaultTab: "general",
343868
343983
  children: tabs
@@ -345467,6 +345582,8 @@ function buildEntry(preset, options2) {
345467
345582
  const models = options2.models && options2.models.length > 0 ? options2.models.map((m) => ({ ...m, providerId: id })) : undefined;
345468
345583
  if (models)
345469
345584
  entryOptions.models = models;
345585
+ if (options2.routerDelegated)
345586
+ entryOptions.routerDelegated = true;
345470
345587
  const entry = {
345471
345588
  id,
345472
345589
  adapter: adapter2,
@@ -345636,6 +345753,7 @@ var exports_theusWebLogin = {};
345636
345753
  __export(exports_theusWebLogin, {
345637
345754
  splitCommandArgs: () => splitCommandArgs,
345638
345755
  runTheusWebLogin: () => runTheusWebLogin,
345756
+ readRoutingMetadata: () => readRoutingMetadata,
345639
345757
  planLabelFromProfile: () => planLabelFromProfile,
345640
345758
  parseTheusWebLoginArgs: () => parseTheusWebLoginArgs
345641
345759
  });
@@ -345643,6 +345761,45 @@ import { createServer as createServer7 } from "http";
345643
345761
  import { createHash as createHash29, randomBytes as randomBytes17 } from "crypto";
345644
345762
  import { mkdir as mkdir41, writeFile as writeFile43 } from "fs/promises";
345645
345763
  import { join as join126 } from "path";
345764
+ function esEnteroPositivo(v) {
345765
+ return typeof v === "number" && Number.isFinite(v) && v > 0;
345766
+ }
345767
+ function readRoutingMetadata(raw) {
345768
+ if (!raw || typeof raw !== "object")
345769
+ return null;
345770
+ const r = raw;
345771
+ const weight = r.weight;
345772
+ const tier = r.quality_tier;
345773
+ const afinidad = r.task_affinity;
345774
+ if (typeof weight !== "number" || !Number.isFinite(weight) || weight <= 0) {
345775
+ return null;
345776
+ }
345777
+ if (typeof r.tools !== "boolean" || typeof r.vision !== "boolean")
345778
+ return null;
345779
+ if (!esEnteroPositivo(r.context_window))
345780
+ return null;
345781
+ if (!esEnteroPositivo(r.max_output_tokens))
345782
+ return null;
345783
+ if (typeof tier !== "number" || !Number.isInteger(tier) || tier < 1 || tier > 5) {
345784
+ return null;
345785
+ }
345786
+ if (!Array.isArray(afinidad) || afinidad.length === 0)
345787
+ return null;
345788
+ const tareas = afinidad.filter((t) => typeof t === "string" && TASK_KINDS_VALIDOS.has(t));
345789
+ if (tareas.length === 0)
345790
+ return null;
345791
+ const eligible2 = r.eligible === true;
345792
+ return {
345793
+ weight,
345794
+ tools: r.tools,
345795
+ vision: r.vision,
345796
+ contextWindow: r.context_window,
345797
+ maxOutputTokens: r.max_output_tokens,
345798
+ qualityTier: tier,
345799
+ taskAffinity: tareas,
345800
+ eligible: eligible2
345801
+ };
345802
+ }
345646
345803
  function parseTheusWebLoginArgs(argv) {
345647
345804
  const options2 = {};
345648
345805
  for (let i3 = 0;i3 < argv.length; i3 += 1) {
@@ -346010,6 +346167,7 @@ async function installTheusSession(payload, webUrl) {
346010
346167
  };
346011
346168
  });
346012
346169
  let models = [];
346170
+ let routableModels = 0;
346013
346171
  try {
346014
346172
  const res = await fetch(`${normalizeWebUrl(webUrl)}/v1/models`, {
346015
346173
  headers: { Authorization: `Bearer ${payload.token}` },
@@ -346017,20 +346175,45 @@ async function installTheusSession(payload, webUrl) {
346017
346175
  });
346018
346176
  if (res.ok) {
346019
346177
  const data = await res.json();
346020
- models = (data.data ?? []).filter((m) => typeof m?.id === "string" && m.id !== "theus-embed" && m.id !== "theus-router-auto").map((m) => ({
346021
- providerId: "theus-official",
346022
- model: m.id,
346023
- label: typeof m.name === "string" ? m.name : m.id,
346024
- taskAffinity: ["code", "chat"],
346025
- supportsTools: true,
346026
- supportsVision: m.modality === "multimodal",
346027
- contextWindow: 200000,
346028
- maxOutputTokens: 8192,
346029
- costPer1kInputUsd: 0,
346030
- costPer1kOutputUsd: 0,
346031
- qualityTier: 5,
346032
- latencyClass: "medium"
346033
- }));
346178
+ models = (data.data ?? []).filter((m) => typeof m?.id === "string" && m.id !== "theus-embed" && m.id !== "theus-router-auto").map((m) => {
346179
+ const id = m.id;
346180
+ const label = typeof m.name === "string" ? m.name : id;
346181
+ const routing = readRoutingMetadata(m.routing);
346182
+ if (routing) {
346183
+ return {
346184
+ providerId: "theus-official",
346185
+ model: id,
346186
+ label,
346187
+ taskAffinity: routing.taskAffinity,
346188
+ supportsTools: routing.tools,
346189
+ supportsVision: routing.vision,
346190
+ contextWindow: routing.contextWindow,
346191
+ maxOutputTokens: routing.maxOutputTokens,
346192
+ costPer1kInputUsd: 0,
346193
+ costPer1kOutputUsd: 0,
346194
+ weightTt: routing.weight,
346195
+ qualityTier: routing.qualityTier,
346196
+ latencyClass: "medium",
346197
+ enabled: routing.eligible
346198
+ };
346199
+ }
346200
+ return {
346201
+ providerId: "theus-official",
346202
+ model: id,
346203
+ label,
346204
+ taskAffinity: ["code", "chat"],
346205
+ supportsTools: true,
346206
+ supportsVision: m.modality === "multimodal",
346207
+ contextWindow: 200000,
346208
+ maxOutputTokens: 8192,
346209
+ costPer1kInputUsd: 0,
346210
+ costPer1kOutputUsd: 0,
346211
+ qualityTier: 5,
346212
+ latencyClass: "medium",
346213
+ enabled: false
346214
+ };
346215
+ });
346216
+ routableModels = models.filter((m) => m.enabled === true).length;
346034
346217
  }
346035
346218
  } catch {}
346036
346219
  const officialProvider = saveProviderSetup("custom", {
@@ -346041,6 +346224,7 @@ async function installTheusSession(payload, webUrl) {
346041
346224
  apiKey: payload.token,
346042
346225
  priority: 250,
346043
346226
  enabled: true,
346227
+ routerDelegated: routableModels === 0,
346044
346228
  ...models.length ? { models } : {}
346045
346229
  });
346046
346230
  await writeFile43(join126(configDir, "session.json"), JSON.stringify({
@@ -346090,13 +346274,25 @@ function escapeHtml2(value) {
346090
346274
  }
346091
346275
  });
346092
346276
  }
346093
- var DEFAULT_WEB_URL = "https://theus.pe", CLIENT_ID = "9d1c250a-e61b-44d9-88ed-5944d1962f5e", OAUTH_SCOPE, NOMBRE_DE_PLAN;
346277
+ var TASK_KINDS_VALIDOS, DEFAULT_WEB_URL = "https://theus.pe", CLIENT_ID = "9d1c250a-e61b-44d9-88ed-5944d1962f5e", OAUTH_SCOPE, NOMBRE_DE_PLAN;
346094
346278
  var init_theusWebLogin = __esm(() => {
346095
346279
  init_browser();
346096
346280
  init_envUtils();
346097
346281
  init_config2();
346098
346282
  init_authPortable();
346099
346283
  init_setupConfig();
346284
+ TASK_KINDS_VALIDOS = new Set([
346285
+ "code",
346286
+ "reasoning",
346287
+ "summarize",
346288
+ "chat",
346289
+ "planning",
346290
+ "tool_use",
346291
+ "vision",
346292
+ "embedding",
346293
+ "long_context",
346294
+ "cheap_bulk"
346295
+ ]);
346100
346296
  OAUTH_SCOPE = [
346101
346297
  "org:create_api_key",
346102
346298
  "user:profile",
@@ -362683,7 +362879,7 @@ function Onboarding({
362683
362879
  flexDirection: "column",
362684
362880
  children: [
362685
362881
  /* @__PURE__ */ jsx_runtime251.jsx(TheusBanner, {
362686
- version: { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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
362882
+ version: { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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
362687
362883
  }),
362688
362884
  /* @__PURE__ */ jsx_runtime251.jsxs(ThemedBox_default, {
362689
362885
  flexDirection: "column",
@@ -363109,13 +363305,38 @@ function decideTecla(faseT, tecla2, ctx) {
363109
363305
  if (tecla2.return)
363110
363306
  return { tipo: "cerrar-ok" };
363111
363307
  if (esc2)
363112
- return { tipo: "salir" };
363308
+ return { tipo: "cerrar-ok" };
363113
363309
  return null;
363114
363310
  }
363115
363311
  if (faseT === "abriendo")
363116
363312
  return null;
363117
- if (esc2)
363118
- return { tipo: "salir" };
363313
+ if (esc2) {
363314
+ if (faseT === "error") {
363315
+ return {
363316
+ tipo: "salir",
363317
+ mensaje: ctx.mensajeError ?? "No pude completar la recarga. No se cobr\xF3 nada."
363318
+ };
363319
+ }
363320
+ if (faseT === "sin-sesion") {
363321
+ return {
363322
+ tipo: "salir",
363323
+ mensaje: "Para recargar cr\xE9ditos necesitas una sesi\xF3n de Theus: inicia sesi\xF3n con /login y vuelve a ejecutar /recarga. No se cobr\xF3 nada."
363324
+ };
363325
+ }
363326
+ if (faseT === "apagado") {
363327
+ return {
363328
+ tipo: "salir",
363329
+ mensaje: "La recarga no est\xE1 disponible ahora mismo. No se cobr\xF3 nada."
363330
+ };
363331
+ }
363332
+ if (faseT === "sin-confirmar") {
363333
+ return {
363334
+ tipo: "salir",
363335
+ mensaje: `Todav\xEDa no veo el pago de ${ctx.nombrePack ?? "tu pack"}. Si lo completaste, ` + "tus cr\xE9ditos se acreditan solos: compru\xE9balo con /uso."
363336
+ };
363337
+ }
363338
+ return { tipo: "salir", mensaje: "Recarga cancelada. No se cobr\xF3 nada." };
363339
+ }
363119
363340
  return null;
363120
363341
  }
363121
363342
  function Cabecera({ estado }) {
@@ -363379,7 +363600,9 @@ function RecargaUI({
363379
363600
  total: estado?.packs.length ?? 0,
363380
363601
  packsRestantes: estado?.packsRestantes ?? null,
363381
363602
  ...pack ? { nombrePack: pack.nombre, creditos: pack.creditos } : {},
363382
- ...fase.t === "acreditado" ? { saldo: fase.saldoNuevo } : {}
363603
+ ...fase.t === "acreditado" ? { saldo: fase.saldoNuevo } : {},
363604
+ ...fase.t === "error" ? { mensajeError: fase.mensaje } : {},
363605
+ ...fase.t === "sin-confirmar" ? { nombrePack: fase.pack.nombre } : {}
363383
363606
  });
363384
363607
  if (!accion)
363385
363608
  return;
@@ -368070,7 +368293,7 @@ var init_Messages = __esm(() => {
368070
368293
  let t1;
368071
368294
  if ($2[0] === Symbol.for("react.memo_cache_sentinel")) {
368072
368295
  t1 = /* @__PURE__ */ jsx_runtime264.jsx(TheusSessionHeader, {
368073
- version: { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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
368296
+ version: { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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
368074
368297
  });
368075
368298
  $2[0] = t1;
368076
368299
  } else {
@@ -399939,7 +400162,7 @@ async function captureMemoryDiagnostics(trigger, dumpNumber = 0) {
399939
400162
  smapsRollup,
399940
400163
  platform: process.platform,
399941
400164
  nodeVersion: process.version,
399942
- ccVersion: { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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
400165
+ ccVersion: { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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
399943
400166
  };
399944
400167
  }
399945
400168
  async function performHeapDump(trigger = "manual", dumpNumber = 0) {
@@ -400700,7 +400923,7 @@ var init_bridge_kick = __esm(() => {
400700
400923
  var call69 = async () => {
400701
400924
  return {
400702
400925
  type: "text",
400703
- value: { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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.81", BUILD_TIME: "1970-01-01T00:00:00.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.81", BUILD_TIME: "1970-01-01T00:00:00.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.81", BUILD_TIME: "1970-01-01T00:00:00.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
400926
+ value: { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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.83", BUILD_TIME: "1970-01-01T00:00:00.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.83", BUILD_TIME: "1970-01-01T00:00:00.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.83", BUILD_TIME: "1970-01-01T00:00:00.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
400704
400927
  };
400705
400928
  }, version2, version_default;
400706
400929
  var init_version = __esm(() => {
@@ -403301,7 +403524,7 @@ var SECRET_NAME_PATTERN, EXTRA_ENV_ALLOWLIST, REDACTED2 = "\u2039oculto\u203A",
403301
403524
  const lines = [];
403302
403525
  lines.push("## Entorno de ejecuci\xF3n");
403303
403526
  lines.push("");
403304
- const version3 = { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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.81", BUILD_TIME: "1970-01-01T00:00:00.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";
403527
+ const version3 = { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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.83", BUILD_TIME: "1970-01-01T00:00:00.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";
403305
403528
  lines.push(`- Versi\xF3n de Theus: ${version3}`);
403306
403529
  lines.push(`- Directorio de trabajo: ${getCwd()}`);
403307
403530
  lines.push(`- \xBFRepositorio git?: ${isGit ? "s\xED" : "no"}`);
@@ -405842,13 +406065,13 @@ async function updateReleaseBundle() {
405842
406065
  await gracefulShutdown(1);
405843
406066
  return;
405844
406067
  }
405845
- if (gte({ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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)) {
405846
- writeToStdout(source_default.green(`Theus ya est\xE1 al d\xEDa (${{ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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})`) + `
406068
+ if (gte({ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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)) {
406069
+ writeToStdout(source_default.green(`Theus ya est\xE1 al d\xEDa (${{ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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})`) + `
405847
406070
  `);
405848
406071
  await gracefulShutdown(0);
405849
406072
  return;
405850
406073
  }
405851
- writeToStdout(`Nueva versi\xF3n disponible: ${latest} (actual: ${{ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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})
406074
+ writeToStdout(`Nueva versi\xF3n disponible: ${latest} (actual: ${{ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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})
405852
406075
  `);
405853
406076
  writeToStdout(`Instalando la actualizaci\xF3n desde theus.pe/dl...
405854
406077
  `);
@@ -405882,7 +406105,7 @@ async function updateReleaseBundle() {
405882
406105
  return;
405883
406106
  }
405884
406107
  cpSync(staged, bundleDir, { recursive: true, force: true });
405885
- writeToStdout(source_default.green(`Actualizado correctamente de ${{ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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} a la versi\xF3n ${latest}`) + `
406108
+ writeToStdout(source_default.green(`Actualizado correctamente de ${{ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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} a la versi\xF3n ${latest}`) + `
405886
406109
  `);
405887
406110
  await regenerateCompletionCache();
405888
406111
  } finally {
@@ -405895,7 +406118,7 @@ async function updateReleaseBundle() {
405895
406118
  async function update() {
405896
406119
  logEvent("theus_update_check", {});
405897
406120
  await updateNaupa();
405898
- writeToStdout(`Versi\xF3n actual: ${{ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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}
406121
+ writeToStdout(`Versi\xF3n actual: ${{ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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}
405899
406122
  `);
405900
406123
  const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
405901
406124
  writeToStdout(`Buscando actualizaciones en el canal ${channel2}...
@@ -405974,8 +406197,8 @@ async function update() {
405974
406197
  writeToStdout(`Theus est\xE1 gestionado por Homebrew.
405975
406198
  `);
405976
406199
  const latest = await getLatestVersion(channel2);
405977
- if (latest && !gte({ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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)) {
405978
- writeToStdout(`Actualizaci\xF3n disponible: ${{ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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}
406200
+ if (latest && !gte({ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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)) {
406201
+ writeToStdout(`Actualizaci\xF3n disponible: ${{ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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}
405979
406202
  `);
405980
406203
  writeToStdout(`
405981
406204
  `);
@@ -405991,8 +406214,8 @@ async function update() {
405991
406214
  writeToStdout(`Theus est\xE1 gestionado por winget.
405992
406215
  `);
405993
406216
  const latest = await getLatestVersion(channel2);
405994
- if (latest && !gte({ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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)) {
405995
- writeToStdout(`Actualizaci\xF3n disponible: ${{ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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}
406217
+ if (latest && !gte({ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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)) {
406218
+ writeToStdout(`Actualizaci\xF3n disponible: ${{ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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}
405996
406219
  `);
405997
406220
  writeToStdout(`
405998
406221
  `);
@@ -406008,8 +406231,8 @@ async function update() {
406008
406231
  writeToStdout(`Theus est\xE1 gestionado por apk.
406009
406232
  `);
406010
406233
  const latest = await getLatestVersion(channel2);
406011
- if (latest && !gte({ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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)) {
406012
- writeToStdout(`Actualizaci\xF3n disponible: ${{ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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}
406234
+ if (latest && !gte({ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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)) {
406235
+ writeToStdout(`Actualizaci\xF3n disponible: ${{ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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}
406013
406236
  `);
406014
406237
  writeToStdout(`
406015
406238
  `);
@@ -406074,11 +406297,11 @@ async function update() {
406074
406297
  `);
406075
406298
  await gracefulShutdown(1);
406076
406299
  }
406077
- if (result.latestVersion === { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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) {
406078
- writeToStdout(source_default.green(`Theus ya est\xE1 al d\xEDa (${{ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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})`) + `
406300
+ if (result.latestVersion === { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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) {
406301
+ writeToStdout(source_default.green(`Theus ya est\xE1 al d\xEDa (${{ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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})`) + `
406079
406302
  `);
406080
406303
  } else {
406081
- writeToStdout(source_default.green(`Actualizado correctamente de ${{ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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} a la versi\xF3n ${result.latestVersion}`) + `
406304
+ writeToStdout(source_default.green(`Actualizado correctamente de ${{ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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} a la versi\xF3n ${result.latestVersion}`) + `
406082
406305
  `);
406083
406306
  await regenerateCompletionCache();
406084
406307
  }
@@ -406097,9 +406320,9 @@ async function update() {
406097
406320
  await removeInstalledSymlink();
406098
406321
  }
406099
406322
  logForDebugging("update: Checking npm registry for latest version");
406100
- logForDebugging(`update: Package URL: ${{ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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}`);
406323
+ logForDebugging(`update: Package URL: ${{ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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}`);
406101
406324
  const npmTag = channel2 === "stable" ? "stable" : "latest";
406102
- const npmCommand = `npm view ${{ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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`;
406325
+ const npmCommand = `npm view ${{ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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`;
406103
406326
  logForDebugging(`update: Running: ${npmCommand}`);
406104
406327
  const latestVersion = await getLatestVersion(channel2);
406105
406328
  logForDebugging(`update: Latest version from npm: ${latestVersion || "FAILED"}`);
@@ -406119,7 +406342,7 @@ async function update() {
406119
406342
  `);
406120
406343
  process.stderr.write(` \u2022 Un proxy o firewall corporativo bloquea npm
406121
406344
  `);
406122
- if ({ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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.81", BUILD_TIME: "1970-01-01T00:00:00.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")) {
406345
+ if ({ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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.83", BUILD_TIME: "1970-01-01T00:00:00.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")) {
406123
406346
  process.stderr.write(` \u2022 Compilaci\xF3n interna/de desarrollo no publicada en npm
406124
406347
  `);
406125
406348
  }
@@ -406131,19 +406354,19 @@ async function update() {
406131
406354
  `);
406132
406355
  process.stderr.write(` \u2022 Ejecuta con el flag --debug para m\xE1s detalle
406133
406356
  `);
406134
- const packageName = { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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";
406357
+ const packageName = { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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";
406135
406358
  process.stderr.write(` \u2022 Comprueba a mano: npm view ${packageName} version
406136
406359
  `);
406137
406360
  process.stderr.write(` \u2022 Comprueba si te falta iniciar sesi\xF3n: npm whoami
406138
406361
  `);
406139
406362
  await gracefulShutdown(1);
406140
406363
  }
406141
- if (gte({ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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)) {
406142
- writeToStdout(source_default.green(`Theus ya est\xE1 al d\xEDa (${{ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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})`) + `
406364
+ if (gte({ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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)) {
406365
+ writeToStdout(source_default.green(`Theus ya est\xE1 al d\xEDa (${{ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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})`) + `
406143
406366
  `);
406144
406367
  await gracefulShutdown(0);
406145
406368
  }
406146
- writeToStdout(`Nueva versi\xF3n disponible: ${latestVersion} (actual: ${{ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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})
406369
+ writeToStdout(`Nueva versi\xF3n disponible: ${latestVersion} (actual: ${{ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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})
406147
406370
  `);
406148
406371
  writeToStdout(`Instalando la actualizaci\xF3n...
406149
406372
  `);
@@ -406188,7 +406411,7 @@ async function update() {
406188
406411
  logForDebugging(`update: Installation status: ${status2}`);
406189
406412
  switch (status2) {
406190
406413
  case "success":
406191
- writeToStdout(source_default.green(`Actualizado correctamente de ${{ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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} a la versi\xF3n ${latestVersion}`) + `
406414
+ writeToStdout(source_default.green(`Actualizado correctamente de ${{ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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} a la versi\xF3n ${latestVersion}`) + `
406192
406415
  `);
406193
406416
  await regenerateCompletionCache();
406194
406417
  break;
@@ -406198,7 +406421,7 @@ async function update() {
406198
406421
  if (useLocalUpdate) {
406199
406422
  process.stderr.write(`Prueba a actualizar a mano con:
406200
406423
  `);
406201
- process.stderr.write(` cd ~/.theus/local && npm update ${{ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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}
406424
+ process.stderr.write(` cd ~/.theus/local && npm update ${{ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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}
406202
406425
  `);
406203
406426
  } else {
406204
406427
  process.stderr.write(`Prueba con sudo o corrige los permisos de npm
@@ -406214,7 +406437,7 @@ async function update() {
406214
406437
  if (useLocalUpdate) {
406215
406438
  process.stderr.write(`Prueba a actualizar a mano con:
406216
406439
  `);
406217
- process.stderr.write(` cd ~/.theus/local && npm update ${{ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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}
406440
+ process.stderr.write(` cd ~/.theus/local && npm update ${{ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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}
406218
406441
  `);
406219
406442
  } else {
406220
406443
  process.stderr.write(`O p\xE1sate a la instalaci\xF3n nativa con: theus install
@@ -415639,7 +415862,7 @@ var init_sessionStorage = __esm(() => {
415639
415862
  init_settings2();
415640
415863
  init_slowOperations();
415641
415864
  init_uuid();
415642
- VERSION4 = { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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;
415865
+ VERSION4 = { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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;
415643
415866
  MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
415644
415867
  SKIP_FIRST_PROMPT_PATTERN2 = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
415645
415868
  EPHEMERAL_PROGRESS_TYPES = new Set([
@@ -416844,7 +417067,7 @@ var init_filesystem = __esm(() => {
416844
417067
  });
416845
417068
  getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
416846
417069
  const nonce = randomBytes21(16).toString("hex");
416847
- return join154(getTheusTempDir(), "bundled-skills", { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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);
417070
+ return join154(getTheusTempDir(), "bundled-skills", { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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);
416848
417071
  });
416849
417072
  getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
416850
417073
  });
@@ -427160,6 +427383,62 @@ var init_managedEnv = __esm(() => {
427160
427383
  ];
427161
427384
  });
427162
427385
 
427386
+ // utils/instalacionTapada.ts
427387
+ import { accessSync as accessSync2, constants as constants5, realpathSync as realpathSync6 } from "fs";
427388
+ import { delimiter as delimiter4, join as join159 } from "path";
427389
+ function esEjecutable(ruta) {
427390
+ try {
427391
+ accessSync2(ruta, constants5.X_OK);
427392
+ return true;
427393
+ } catch {
427394
+ return false;
427395
+ }
427396
+ }
427397
+ function canonico(ruta) {
427398
+ try {
427399
+ return realpathSync6(ruta);
427400
+ } catch {
427401
+ return ruta;
427402
+ }
427403
+ }
427404
+ function detectarInstalacionTapada(ejecutable, path19, nombres = ["theus"]) {
427405
+ if (!path19)
427406
+ return null;
427407
+ const base2 = ejecutable.split(/[\\/]/).pop()?.toLowerCase() ?? "";
427408
+ const esBinarioTheus = nombres.some((n3) => base2 === n3.toLowerCase());
427409
+ if (!esBinarioTheus)
427410
+ return null;
427411
+ const actualCanonico = canonico(ejecutable);
427412
+ const carpetas = path19.split(delimiter4).filter(Boolean);
427413
+ for (const carpeta of carpetas) {
427414
+ for (const nombre of nombres) {
427415
+ const candidato = join159(carpeta, nombre);
427416
+ if (!esEjecutable(candidato))
427417
+ continue;
427418
+ if (canonico(candidato) === actualCanonico)
427419
+ return null;
427420
+ return { ganador: candidato, actual: ejecutable };
427421
+ }
427422
+ }
427423
+ return null;
427424
+ }
427425
+ function mensajeInstalacionTapada(c5) {
427426
+ return [
427427
+ "Tienes dos instalaciones de Theus y el sistema esta usando la otra.",
427428
+ "",
427429
+ ` se ejecuta: ${c5.ganador}`,
427430
+ ` esta version: ${c5.actual}`,
427431
+ "",
427432
+ "El sistema elige la primera que encuentra en el PATH, no la mas reciente.",
427433
+ "Para quedarte solo con una:",
427434
+ "",
427435
+ " npm rm -g theus-cli si la vieja vino del gestor de paquetes",
427436
+ ` rm ${c5.ganador} si la pusiste a mano`
427437
+ ].join(`
427438
+ `);
427439
+ }
427440
+ var init_instalacionTapada = () => {};
427441
+
427163
427442
  // upstreamproxy/relay.ts
427164
427443
  import { createServer as createServer8 } from "net";
427165
427444
  function encodeChunk(data) {
@@ -427447,7 +427726,7 @@ __export(exports_upstreamproxy, {
427447
427726
  });
427448
427727
  import { mkdir as mkdir49, readFile as readFile61, unlink as unlink24, writeFile as writeFile50 } from "fs/promises";
427449
427728
  import { homedir as homedir41 } from "os";
427450
- import { join as join159 } from "path";
427729
+ import { join as join160 } from "path";
427451
427730
  async function initUpstreamProxy(opts) {
427452
427731
  if (!isEnvTruthy(process.env.THEUS_CODE_REMOTE)) {
427453
427732
  return state;
@@ -427468,7 +427747,7 @@ async function initUpstreamProxy(opts) {
427468
427747
  }
427469
427748
  setNonDumpable();
427470
427749
  const baseUrl = opts?.ccrBaseUrl ?? process.env.THEUS_BASE_URL ?? "https://api.theus.pe";
427471
- const caBundlePath = opts?.caBundlePath ?? join159(homedir41(), ".ccr", "ca-bundle.crt");
427750
+ const caBundlePath = opts?.caBundlePath ?? join160(homedir41(), ".ccr", "ca-bundle.crt");
427472
427751
  const caOk = await downloadCaBundle(baseUrl, opts?.systemCaPath ?? SYSTEM_CA_BUNDLE, caBundlePath);
427473
427752
  if (!caOk)
427474
427753
  return state;
@@ -427569,7 +427848,7 @@ async function downloadCaBundle(baseUrl, systemCaPath, outPath) {
427569
427848
  }
427570
427849
  const ccrCa = await resp.text();
427571
427850
  const systemCa = await readFile61(systemCaPath, "utf8").catch(() => "");
427572
- await mkdir49(join159(outPath, ".."), { recursive: true });
427851
+ await mkdir49(join160(outPath, ".."), { recursive: true });
427573
427852
  await writeFile50(outPath, systemCa + `
427574
427853
  ` + ccrCa, "utf8");
427575
427854
  return true;
@@ -427879,6 +428158,7 @@ var init_init2 = __esm(() => {
427879
428158
  init_proxy();
427880
428159
  init_betaSessionTracing();
427881
428160
  init_telemetryAttributes();
428161
+ init_instalacionTapada();
427882
428162
  init_windowsPaths();
427883
428163
  init = memoize_default(async () => {
427884
428164
  const initStartTime = Date.now();
@@ -427950,6 +428230,14 @@ var init_init2 = __esm(() => {
427950
428230
  }
427951
428231
  }
427952
428232
  setShellIfWindows();
428233
+ try {
428234
+ const tapada = detectarInstalacionTapada(process.execPath, process.env.PATH, process.platform === "win32" ? ["theus.exe", "theus.cmd", "theus"] : ["theus"]);
428235
+ if (tapada) {
428236
+ console.error(`
428237
+ ${mensajeInstalacionTapada(tapada)}
428238
+ `);
428239
+ }
428240
+ } catch {}
427953
428241
  registerCleanup(shutdownLspServerManager);
427954
428242
  registerCleanup(async () => {
427955
428243
  const { cleanupSessionTeams: cleanupSessionTeams2 } = await Promise.resolve().then(() => (init_teamHelpers(), exports_teamHelpers));
@@ -428005,7 +428293,7 @@ import {
428005
428293
  } from "fs/promises";
428006
428294
  import { createServer as createServer9 } from "net";
428007
428295
  import { platform as platform6 } from "os";
428008
- import { join as join160 } from "path";
428296
+ import { join as join161 } from "path";
428009
428297
  function log(message, ...args) {
428010
428298
  if (LOG_FILE) {
428011
428299
  const timestamp2 = new Date().toISOString();
@@ -428072,7 +428360,7 @@ class ChromeNativeHost {
428072
428360
  try {
428073
428361
  process.kill(pid, 0);
428074
428362
  } catch {
428075
- await unlink25(join160(socketDir, file2)).catch(() => {});
428363
+ await unlink25(join161(socketDir, file2)).catch(() => {});
428076
428364
  log(`Removed stale socket for PID ${pid}`);
428077
428365
  }
428078
428366
  }
@@ -429021,7 +429309,7 @@ async function handleMemories(state2) {
429021
429309
  async function runProjectContextMcpServer() {
429022
429310
  const projectRoot = process.env.THEUS_PROJECT_ROOT || process.cwd();
429023
429311
  const state2 = new ProjectContextState(projectRoot);
429024
- const server2 = new Server({ name: SERVER_NAME, version: { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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: {} } });
429312
+ const server2 = new Server({ name: SERVER_NAME, version: { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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: {} } });
429025
429313
  server2.setRequestHandler(ListToolsRequestSchema, async () => ({
429026
429314
  tools: TOOL_DEFINITIONS.map((t) => ({
429027
429315
  name: t.name,
@@ -429149,10 +429437,10 @@ var init_server3 = __esm(() => {
429149
429437
  import { execFile as execFile8 } from "child_process";
429150
429438
  import { existsSync as existsSync26, mkdirSync as mkdirSync12, readFileSync as readFileSync30, statSync as statSync14, unlinkSync as unlinkSync3, writeFileSync as writeFileSync10 } from "fs";
429151
429439
  import { homedir as homedir43, tmpdir as tmpdir13 } from "os";
429152
- import { join as join161 } from "path";
429440
+ import { join as join162 } from "path";
429153
429441
  import { promisify as promisify6 } from "util";
429154
429442
  function cuDir() {
429155
- const dir = join161(homedir43(), ".theus", "cu");
429443
+ const dir = join162(homedir43(), ".theus", "cu");
429156
429444
  if (!existsSync26(dir))
429157
429445
  mkdirSync12(dir, { recursive: true });
429158
429446
  return dir;
@@ -429200,7 +429488,7 @@ async function getScreenGeometry(force = false) {
429200
429488
  return cachedGeometry;
429201
429489
  }
429202
429490
  async function checkPermissions() {
429203
- const probe = join161(tmpdir13(), `theus-cu-probe-${process.pid}.jpg`);
429491
+ const probe = join162(tmpdir13(), `theus-cu-probe-${process.pid}.jpg`);
429204
429492
  const cap = await run6(SCREENCAPTURE, ["-x", "-t", "jpg", probe], { timeoutMs: 8000 });
429205
429493
  const screenRecording = existsSync26(probe) && (() => {
429206
429494
  try {
@@ -429229,8 +429517,8 @@ async function checkPermissions() {
429229
429517
  async function captureScreenshot(opts = {}) {
429230
429518
  const maxSide = opts.maxSide ?? 1400;
429231
429519
  const quality = Math.min(Math.max(opts.quality ?? 72, 1), 100);
429232
- const raw = join161(cuDir(), `shot-${process.pid}.png`);
429233
- const out = join161(cuDir(), `shot-${process.pid}.jpg`);
429520
+ const raw = join162(cuDir(), `shot-${process.pid}.png`);
429521
+ const out = join162(cuDir(), `shot-${process.pid}.jpg`);
429234
429522
  const capArgs = ["-x", "-t", "png", "-o"];
429235
429523
  if (opts.displayIndex && opts.displayIndex > 0)
429236
429524
  capArgs.push("-D", String(opts.displayIndex));
@@ -429394,8 +429682,8 @@ async function ensureScrollHelper() {
429394
429682
  return scrollBinPromise;
429395
429683
  scrollBinPromise = (async () => {
429396
429684
  if (!existsSync26(SWIFTC) && SWIFTC === "swiftc") {}
429397
- const src = join161(cuDir(), "scroll.swift");
429398
- const bin = join161(cuDir(), "theus-cu-scroll");
429685
+ const src = join162(cuDir(), "scroll.swift");
429686
+ const bin = join162(cuDir(), "theus-cu-scroll");
429399
429687
  if (existsSync26(bin))
429400
429688
  return bin;
429401
429689
  try {
@@ -429726,7 +430014,7 @@ __export(exports_selftest, {
429726
430014
  runComputerUseSelfTest: () => runComputerUseSelfTest
429727
430015
  });
429728
430016
  import { existsSync as existsSync27, writeFileSync as writeFileSync11 } from "fs";
429729
- import { join as join162 } from "path";
430017
+ import { join as join163 } from "path";
429730
430018
  import { homedir as homedir44 } from "os";
429731
430019
  async function runComputerUseSelfTest() {
429732
430020
  let pass = 0;
@@ -429778,7 +430066,7 @@ Geometr\xEDa y captura:`);
429778
430066
  let captureOk = false;
429779
430067
  try {
429780
430068
  const shot = await captureScreenshot();
429781
- const outPath = join162(homedir44(), ".theus", "cu", "selftest-shot.jpg");
430069
+ const outPath = join163(homedir44(), ".theus", "cu", "selftest-shot.jpg");
429782
430070
  writeFileSync11(outPath, Buffer.from(shot.base64, "base64"));
429783
430071
  ok2(`Captura ${shot.width}\xD7${shot.height} px, ${Math.round(shot.base64.length * 0.75 / 1024)} KB \u2192 ${outPath}`);
429784
430072
  captureOk = true;
@@ -430624,7 +430912,7 @@ var init_executor = __esm(() => {
430624
430912
  });
430625
430913
 
430626
430914
  // services/titanFleet/tokenStore.ts
430627
- import { constants as constants5 } from "fs";
430915
+ import { constants as constants6 } from "fs";
430628
430916
  import { randomUUID as randomUUID38 } from "crypto";
430629
430917
  import {
430630
430918
  chmod as chmod13,
@@ -430680,7 +430968,7 @@ async function saveFleetCredentials(value, path19 = defaultFleetCredentialsPath(
430680
430968
  await chmod13(directory, 448);
430681
430969
  await rejectSymlink(path19);
430682
430970
  const temp = `${path19}.tmp-${process.pid}-${randomUUID38()}`;
430683
- const flags = constants5.O_WRONLY | constants5.O_CREAT | constants5.O_EXCL | (constants5.O_NOFOLLOW ?? 0);
430971
+ const flags = constants6.O_WRONLY | constants6.O_CREAT | constants6.O_EXCL | (constants6.O_NOFOLLOW ?? 0);
430684
430972
  const handle2 = await open23(temp, flags, 384);
430685
430973
  try {
430686
430974
  await handle2.writeFile(`${JSON.stringify(parsed, null, 2)}
@@ -430712,7 +431000,7 @@ var init_tokenStore = __esm(() => {
430712
431000
  });
430713
431001
 
430714
431002
  // services/titanFleet/outbox.ts
430715
- import { constants as constants6 } from "fs";
431003
+ import { constants as constants7 } from "fs";
430716
431004
  import { createHash as createHash33, randomUUID as randomUUID39 } from "crypto";
430717
431005
  import {
430718
431006
  chmod as chmod14,
@@ -430848,7 +431136,7 @@ async function writeRecords(path19, records) {
430848
431136
  await chmod14(directory, 448);
430849
431137
  await rejectSymlink2(path19);
430850
431138
  const temp = `${path19}.tmp-${process.pid}-${randomUUID39()}`;
430851
- const handle2 = await open24(temp, constants6.O_WRONLY | constants6.O_CREAT | constants6.O_EXCL | (constants6.O_NOFOLLOW ?? 0), 384);
431139
+ const handle2 = await open24(temp, constants7.O_WRONLY | constants7.O_CREAT | constants7.O_EXCL | (constants7.O_NOFOLLOW ?? 0), 384);
430852
431140
  try {
430853
431141
  await handle2.writeFile(serialized, "utf8");
430854
431142
  await handle2.sync();
@@ -430859,7 +431147,7 @@ async function writeRecords(path19, records) {
430859
431147
  await chmod14(temp, 384);
430860
431148
  await rename11(temp, path19);
430861
431149
  await chmod14(path19, 384);
430862
- const directoryHandle = await open24(directory, constants6.O_RDONLY);
431150
+ const directoryHandle = await open24(directory, constants7.O_RDONLY);
430863
431151
  try {
430864
431152
  await directoryHandle.sync();
430865
431153
  } finally {
@@ -431698,7 +431986,7 @@ async function runTitanFleetWorker(args) {
431698
431986
  max_concurrency: maxConcurrency,
431699
431987
  runtime: {
431700
431988
  name: "theus-cli",
431701
- version: { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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
431989
+ version: { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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
431702
431990
  }
431703
431991
  });
431704
431992
  const client2 = new TitanFleetClient({
@@ -432420,9 +432708,9 @@ var init_titan_fleet_run = __esm(() => {
432420
432708
 
432421
432709
  // utils/cronTasksLock.ts
432422
432710
  import { mkdir as mkdir53, readFile as readFile65, unlink as unlink28, writeFile as writeFile51 } from "fs/promises";
432423
- import { dirname as dirname67, join as join163 } from "path";
432711
+ import { dirname as dirname67, join as join164 } from "path";
432424
432712
  function getLockPath(dir) {
432425
- return join163(dir ?? getProjectRoot(), LOCK_FILE_REL);
432713
+ return join164(dir ?? getProjectRoot(), LOCK_FILE_REL);
432426
432714
  }
432427
432715
  async function readLock(dir) {
432428
432716
  let raw;
@@ -432528,7 +432816,7 @@ var init_cronTasksLock = __esm(() => {
432528
432816
  init_genericProcessUtils();
432529
432817
  init_json();
432530
432818
  init_slowOperations();
432531
- LOCK_FILE_REL = join163(".theus", "scheduled_tasks.lock");
432819
+ LOCK_FILE_REL = join164(".theus", "scheduled_tasks.lock");
432532
432820
  schedulerLockSchema = lazySchema(() => exports_external.object({
432533
432821
  sessionId: exports_external.string(),
432534
432822
  pid: exports_external.number(),
@@ -432836,10 +433124,10 @@ import {
432836
433124
  writeFileSync as writeFileSync12
432837
433125
  } from "fs";
432838
433126
  import { homedir as homedir47 } from "os";
432839
- import { dirname as dirname68, join as join164 } from "path";
433127
+ import { dirname as dirname68, join as join165 } from "path";
432840
433128
  import { fileURLToPath as fileURLToPath7 } from "url";
432841
433129
  function projectsConfigPath() {
432842
- return join164(homedir47(), ".theus", "daemon", "projects.json");
433130
+ return join165(homedir47(), ".theus", "daemon", "projects.json");
432843
433131
  }
432844
433132
  function readEnabledProjects() {
432845
433133
  let raw;
@@ -432858,17 +433146,17 @@ function readEnabledProjects() {
432858
433146
  return list3.filter((p) => p && typeof p.dir === "string" && p.enabled !== false);
432859
433147
  }
432860
433148
  function daemonDir2() {
432861
- return join164(homedir47(), ".theus", "daemon");
433149
+ return join165(homedir47(), ".theus", "daemon");
432862
433150
  }
432863
433151
  function daemonLogPath() {
432864
- return join164(daemonDir2(), "daemon.log");
433152
+ return join165(daemonDir2(), "daemon.log");
432865
433153
  }
432866
433154
  function resolveWorkerBin() {
432867
433155
  const override = process.env.THEUS_DAEMON_WORKER_BIN;
432868
433156
  if (typeof override === "string" && override.length > 0)
432869
433157
  return override;
432870
433158
  const here = dirname68(fileURLToPath7(import.meta.url));
432871
- return join164(here, "..", "bin", "theus");
433159
+ return join165(here, "..", "bin", "theus");
432872
433160
  }
432873
433161
  function turnTimeoutMs() {
432874
433162
  const raw = process.env.THEUS_DAEMON_TURN_TIMEOUT_MS;
@@ -432901,10 +433189,10 @@ function logDaemonLine(line) {
432901
433189
  }
432902
433190
  function writeRunHistory(record3) {
432903
433191
  try {
432904
- const dir = join164(daemonDir2(), "runs", record3.taskId);
433192
+ const dir = join165(daemonDir2(), "runs", record3.taskId);
432905
433193
  mkdirSync13(dir, { recursive: true });
432906
433194
  const stamp2 = record3.startedAt.replace(/:/g, "-");
432907
- writeFileSync12(join164(dir, `${stamp2}.json`), JSON.stringify(record3, null, 2), "utf8");
433195
+ writeFileSync12(join165(dir, `${stamp2}.json`), JSON.stringify(record3, null, 2), "utf8");
432908
433196
  pruneRunHistory(record3.taskId);
432909
433197
  } catch (e) {
432910
433198
  logDaemonLine(`[daemon:cron] ERROR guardando historial task=${record3.taskId}: ${e?.message}`);
@@ -432915,13 +433203,13 @@ function pruneRunHistory(taskId) {
432915
433203
  const raw = process.env.THEUS_DAEMON_RUNS_KEEP;
432916
433204
  const parsed = raw ? Number.parseInt(raw, 10) : NaN;
432917
433205
  const keep = Number.isInteger(parsed) && parsed > 0 ? parsed : 50;
432918
- const dir = join164(daemonDir2(), "runs", taskId);
433206
+ const dir = join165(daemonDir2(), "runs", taskId);
432919
433207
  const files2 = readdirSync5(dir).filter((f) => f.endsWith(".json")).sort();
432920
433208
  if (files2.length <= keep)
432921
433209
  return;
432922
433210
  for (const f of files2.slice(0, files2.length - keep)) {
432923
433211
  try {
432924
- unlinkSync4(join164(dir, f));
433212
+ unlinkSync4(join165(dir, f));
432925
433213
  } catch {}
432926
433214
  }
432927
433215
  } catch {}
@@ -433111,15 +433399,15 @@ import {
433111
433399
  writeFileSync as writeFileSync13
433112
433400
  } from "fs";
433113
433401
  import { homedir as homedir48 } from "os";
433114
- import { dirname as dirname69, join as join165 } from "path";
433402
+ import { dirname as dirname69, join as join166 } from "path";
433115
433403
  function daemonDir3() {
433116
- return join165(homedir48(), ".theus", "daemon");
433404
+ return join166(homedir48(), ".theus", "daemon");
433117
433405
  }
433118
433406
  function pidFilePath() {
433119
- return join165(daemonDir3(), "theus-daemon.pid");
433407
+ return join166(daemonDir3(), "theus-daemon.pid");
433120
433408
  }
433121
433409
  function logFilePath() {
433122
- return join165(daemonDir3(), "daemon.log");
433410
+ return join166(daemonDir3(), "daemon.log");
433123
433411
  }
433124
433412
  function ensureDaemonDir() {
433125
433413
  mkdirSync14(daemonDir3(), { recursive: true });
@@ -433217,7 +433505,7 @@ function resolveTheusBin() {
433217
433505
  return "theus";
433218
433506
  }
433219
433507
  function macosServiceSpec() {
433220
- const path19 = join165(homedir48(), "Library", "LaunchAgents", "pe.theus.daemon.plist");
433508
+ const path19 = join166(homedir48(), "Library", "LaunchAgents", "pe.theus.daemon.plist");
433221
433509
  const bin = resolveTheusBin();
433222
433510
  const logDir = daemonDir3();
433223
433511
  const content = `<?xml version="1.0" encoding="UTF-8"?>
@@ -433244,9 +433532,9 @@ function macosServiceSpec() {
433244
433532
  <key>KeepAlive</key>
433245
433533
  <true/>
433246
433534
  <key>StandardOutPath</key>
433247
- <string>${join165(logDir, "launchd.out.log")}</string>
433535
+ <string>${join166(logDir, "launchd.out.log")}</string>
433248
433536
  <key>StandardErrorPath</key>
433249
- <string>${join165(logDir, "launchd.err.log")}</string>
433537
+ <string>${join166(logDir, "launchd.err.log")}</string>
433250
433538
  </dict>
433251
433539
  </plist>
433252
433540
  `;
@@ -433261,7 +433549,7 @@ function macosServiceSpec() {
433261
433549
  };
433262
433550
  }
433263
433551
  function linuxServiceSpec() {
433264
- const path19 = join165(homedir48(), ".config", "systemd", "user", "theus-daemon.service");
433552
+ const path19 = join166(homedir48(), ".config", "systemd", "user", "theus-daemon.service");
433265
433553
  const bin = resolveTheusBin();
433266
433554
  const content = `[Unit]
433267
433555
  Description=Theus daemon (cron/agent supervisor)
@@ -433589,7 +433877,7 @@ function createBridgeLogger(options2) {
433589
433877
  connectUrl = buildBridgeConnectUrl(environmentId, cachedIngressUrl);
433590
433878
  regenerateQr(connectUrl);
433591
433879
  if (verbose) {
433592
- write(source_default.dim(`Remote Control`) + ` v${{ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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}
433880
+ write(source_default.dim(`Remote Control`) + ` v${{ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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}
433593
433881
  `);
433594
433882
  }
433595
433883
  if (verbose) {
@@ -433997,7 +434285,7 @@ var init_pollConfig = __esm(() => {
433997
434285
  import { spawn as spawn13 } from "child_process";
433998
434286
  import { createWriteStream as createWriteStream4 } from "fs";
433999
434287
  import { tmpdir as tmpdir14 } from "os";
434000
- import { dirname as dirname70, join as join166 } from "path";
434288
+ import { dirname as dirname70, join as join167 } from "path";
434001
434289
  import { createInterface } from "readline";
434002
434290
  function safeFilenameId(id2) {
434003
434291
  return id2.replace(/[^a-zA-Z0-9_-]/g, "_");
@@ -434130,12 +434418,12 @@ function createSessionSpawner(deps) {
434130
434418
  debugFile = `${deps.debugFile}-${safeId}`;
434131
434419
  }
434132
434420
  } else if (deps.verbose || false) {
434133
- debugFile = join166(tmpdir14(), "theus", `bridge-session-${safeId}.log`);
434421
+ debugFile = join167(tmpdir14(), "theus", `bridge-session-${safeId}.log`);
434134
434422
  }
434135
434423
  let transcriptStream = null;
434136
434424
  let transcriptPath;
434137
434425
  if (deps.debugFile) {
434138
- transcriptPath = join166(dirname70(deps.debugFile), `bridge-transcript-${safeId}.jsonl`);
434426
+ transcriptPath = join167(dirname70(deps.debugFile), `bridge-transcript-${safeId}.jsonl`);
434139
434427
  transcriptStream = createWriteStream4(transcriptPath, { flags: "a" });
434140
434428
  transcriptStream.on("error", (err2) => {
434141
434429
  deps.onDebug(`[bridge:session] Transcript write error: ${err2.message}`);
@@ -434409,9 +434697,9 @@ __export(exports_bridgePointer, {
434409
434697
  BRIDGE_POINTER_TTL_MS: () => BRIDGE_POINTER_TTL_MS
434410
434698
  });
434411
434699
  import { mkdir as mkdir54, readFile as readFile66, stat as stat56, unlink as unlink29, writeFile as writeFile52 } from "fs/promises";
434412
- import { dirname as dirname71, join as join167 } from "path";
434700
+ import { dirname as dirname71, join as join168 } from "path";
434413
434701
  function getBridgePointerPath(dir) {
434414
- return join167(getProjectsDir(), sanitizePath2(dir), "bridge-pointer.json");
434702
+ return join168(getProjectsDir(), sanitizePath2(dir), "bridge-pointer.json");
434415
434703
  }
434416
434704
  async function writeBridgePointer(dir, pointer) {
434417
434705
  const path19 = getBridgePointerPath(dir);
@@ -434513,12 +434801,12 @@ var init_bridgePointer = __esm(() => {
434513
434801
  });
434514
434802
 
434515
434803
  // utils/errorLogSink.ts
434516
- import { dirname as dirname72, join as join168 } from "path";
434804
+ import { dirname as dirname72, join as join169 } from "path";
434517
434805
  function getErrorsPath() {
434518
- return join168(CACHE_PATHS.errors(), DATE + ".jsonl");
434806
+ return join169(CACHE_PATHS.errors(), DATE + ".jsonl");
434519
434807
  }
434520
434808
  function getMCPLogsPath(serverName) {
434521
- return join168(CACHE_PATHS.mcpLogs(serverName), DATE + ".jsonl");
434809
+ return join169(CACHE_PATHS.mcpLogs(serverName), DATE + ".jsonl");
434522
434810
  }
434523
434811
  function createJsonlWriter(options2) {
434524
434812
  const writer = createBufferedWriter(options2);
@@ -434562,7 +434850,7 @@ function appendToLog(path19, message) {
434562
434850
  cwd: getFsImplementation().cwd(),
434563
434851
  userType: "external",
434564
434852
  sessionId: getSessionId(),
434565
- version: { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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
434853
+ version: { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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
434566
434854
  };
434567
434855
  getLogWriter(path19).write(messageWithTimestamp);
434568
434856
  }
@@ -434674,7 +434962,7 @@ __export(exports_bridgeMain, {
434674
434962
  });
434675
434963
  import { randomUUID as randomUUID42 } from "crypto";
434676
434964
  import { hostname as hostname4, tmpdir as tmpdir15 } from "os";
434677
- import { basename as basename51, join as join169, resolve as resolve57 } from "path";
434965
+ import { basename as basename51, join as join170, resolve as resolve57 } from "path";
434678
434966
  async function isMultiSessionSpawnEnabled() {
434679
434967
  return checkGate_CACHED_OR_BLOCKING("theus_ccr_bridge_multi_session");
434680
434968
  }
@@ -435187,7 +435475,7 @@ async function runBridgeLoop(config3, environmentId, environmentSecret, api2, sp
435187
435475
  sessionDebugFile = `${config3.debugFile}-${safeId}`;
435188
435476
  }
435189
435477
  } else if (config3.verbose || false) {
435190
- sessionDebugFile = join169(tmpdir15(), "theus", `bridge-session-${safeId}.log`);
435478
+ sessionDebugFile = join170(tmpdir15(), "theus", `bridge-session-${safeId}.log`);
435191
435479
  }
435192
435480
  if (sessionDebugFile) {
435193
435481
  logger.logVerbose(`Debug log: ${sessionDebugFile}`);
@@ -435823,7 +436111,7 @@ Spawn mode for this project:
435823
436111
  const api2 = createBridgeApiClient({
435824
436112
  baseUrl,
435825
436113
  getAccessToken: getBridgeAccessToken2,
435826
- runnerVersion: { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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,
436114
+ runnerVersion: { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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,
435827
436115
  onDebug: logForDebugging,
435828
436116
  onAuth401: handleOAuth401Error2,
435829
436117
  getTrustedDeviceToken
@@ -436061,7 +436349,7 @@ async function runBridgeHeadless(opts, signal) {
436061
436349
  const api2 = createBridgeApiClient({
436062
436350
  baseUrl,
436063
436351
  getAccessToken: opts.getAccessToken,
436064
- runnerVersion: { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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,
436352
+ runnerVersion: { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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,
436065
436353
  onDebug: log2,
436066
436354
  onAuth401: opts.onAuth401,
436067
436355
  getTrustedDeviceToken
@@ -439353,7 +439641,7 @@ function buildSystemInitMessage(inputs) {
439353
439641
  slash_commands: inputs.commands.filter((c5) => c5.userInvocable !== false).map((c5) => c5.name),
439354
439642
  apiKeySource: getTheusApiKeyWithSource().source,
439355
439643
  betas: getSdkBetas(),
439356
- theus_code_version: { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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,
439644
+ theus_code_version: { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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,
439357
439645
  output_style: outputStyle2,
439358
439646
  agents: inputs.agents.map((agent) => agent.agentType),
439359
439647
  skills: inputs.skills.filter((s) => s.userInvocable !== false).map((skill) => skill.name),
@@ -439393,8 +439681,8 @@ async function getEnvLessBridgeConfig() {
439393
439681
  }
439394
439682
  async function checkEnvLessBridgeMinVersion() {
439395
439683
  const cfg = await getEnvLessBridgeConfig();
439396
- if (cfg.min_version && lt({ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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)) {
439397
- return `Your version of Theus (${{ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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.
439684
+ if (cfg.min_version && lt({ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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)) {
439685
+ return `Your version of Theus (${{ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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.
439398
439686
  Version ${cfg.min_version} or higher is required. Run \`theus update\` to update.`;
439399
439687
  }
439400
439688
  return null;
@@ -441718,7 +442006,7 @@ async function initBridgeCore(params) {
441718
442006
  const rawApi = createBridgeApiClient({
441719
442007
  baseUrl,
441720
442008
  getAccessToken,
441721
- runnerVersion: { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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,
442009
+ runnerVersion: { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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,
441722
442010
  onDebug: logForDebugging,
441723
442011
  onAuth401,
441724
442012
  getTrustedDeviceToken
@@ -443552,7 +443840,7 @@ __export(exports_inboundAttachments, {
443552
443840
  });
443553
443841
  import { randomUUID as randomUUID47 } from "crypto";
443554
443842
  import { mkdir as mkdir55, writeFile as writeFile53 } from "fs/promises";
443555
- import { basename as basename52, join as join170 } from "path";
443843
+ import { basename as basename52, join as join171 } from "path";
443556
443844
  function debug2(msg) {
443557
443845
  logForDebugging(`[bridge:inbound-attach] ${msg}`);
443558
443846
  }
@@ -443568,7 +443856,7 @@ function sanitizeFileName(name) {
443568
443856
  return base2 || "attachment";
443569
443857
  }
443570
443858
  function uploadsDir() {
443571
- return join170(getTheusConfigHomeDir(), "uploads", getSessionId());
443859
+ return join171(getTheusConfigHomeDir(), "uploads", getSessionId());
443572
443860
  }
443573
443861
  async function resolveOne(att) {
443574
443862
  const token = getBridgeAccessToken();
@@ -443597,7 +443885,7 @@ async function resolveOne(att) {
443597
443885
  const safeName = sanitizeFileName(att.file_name);
443598
443886
  const prefix = (att.file_uuid.slice(0, 8) || randomUUID47().slice(0, 8)).replace(/[^a-zA-Z0-9_-]/g, "_");
443599
443887
  const dir = uploadsDir();
443600
- const outPath = join170(dir, `${prefix}-${safeName}`);
443888
+ const outPath = join171(dir, `${prefix}-${safeName}`);
443601
443889
  try {
443602
443890
  await mkdir55(dir, { recursive: true });
443603
443891
  await writeFile53(outPath, data);
@@ -450457,7 +450745,7 @@ var init_ShowInIDEPrompt = __esm(() => {
450457
450745
 
450458
450746
  // components/permissions/FilePermissionDialog/permissionOptions.tsx
450459
450747
  import { homedir as homedir49 } from "os";
450460
- import { basename as basename56, join as join171, sep as sep34 } from "path";
450748
+ import { basename as basename56, join as join172, sep as sep34 } from "path";
450461
450749
  function isInTheusFolder(filePath) {
450462
450750
  const absolutePath = expandPath(filePath);
450463
450751
  const theusFolderPath = expandPath(`${getOriginalCwd()}/.theus`);
@@ -450467,7 +450755,7 @@ function isInTheusFolder(filePath) {
450467
450755
  }
450468
450756
  function isInGlobalTheusFolder(filePath) {
450469
450757
  const absolutePath = expandPath(filePath);
450470
- const globalTheusFolderPath = join171(homedir49(), ".theus");
450758
+ const globalTheusFolderPath = join172(homedir49(), ".theus");
450471
450759
  const normalizedAbsolutePath = normalizeCaseForComparison(absolutePath);
450472
450760
  const normalizedGlobalTheusFolderPath = normalizeCaseForComparison(globalTheusFolderPath);
450473
450761
  return normalizedAbsolutePath.startsWith(normalizedGlobalTheusFolderPath + sep34.toLowerCase()) || normalizedAbsolutePath.startsWith(normalizedGlobalTheusFolderPath + "/");
@@ -458359,7 +458647,7 @@ var init_useVoiceEnabled = __esm(() => {
458359
458647
  function getSemverPart(version3) {
458360
458648
  return `${import_semver11.major(version3, { loose: true })}.${import_semver11.minor(version3, { loose: true })}.${import_semver11.patch(version3, { loose: true })}`;
458361
458649
  }
458362
- function useUpdateNotification(updatedVersion, initialVersion = { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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) {
458650
+ function useUpdateNotification(updatedVersion, initialVersion = { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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) {
458363
458651
  const [lastNotifiedSemver, setLastNotifiedSemver] = import_react235.useState(() => getSemverPart(initialVersion));
458364
458652
  if (!updatedVersion) {
458365
458653
  return null;
@@ -458399,7 +458687,7 @@ function AutoUpdater({
458399
458687
  return;
458400
458688
  }
458401
458689
  if (false) {}
458402
- const currentVersion = { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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;
458690
+ const currentVersion = { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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;
458403
458691
  const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
458404
458692
  let latestVersion = await getLatestVersion(channel2);
458405
458693
  const isDisabled2 = isAutoUpdaterDisabled();
@@ -458534,7 +458822,7 @@ function AutoUpdater({
458534
458822
  " ",
458535
458823
  /* @__PURE__ */ jsx_runtime415.jsx(ThemedText, {
458536
458824
  bold: true,
458537
- children: hasLocalInstall ? `cd ~/.theus/local && npm update ${{ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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.81", BUILD_TIME: "1970-01-01T00:00:00.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}`
458825
+ children: hasLocalInstall ? `cd ~/.theus/local && npm update ${{ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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.83", BUILD_TIME: "1970-01-01T00:00:00.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}`
458538
458826
  })
458539
458827
  ]
458540
458828
  })
@@ -458611,12 +458899,12 @@ function NativeAutoUpdater({
458611
458899
  logEvent("theus_native_auto_updater_start", {});
458612
458900
  try {
458613
458901
  const maxVersion = await getMaxVersion();
458614
- if (maxVersion && gt({ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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)) {
458902
+ if (maxVersion && gt({ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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)) {
458615
458903
  const msg = await getMaxVersionMessage();
458616
458904
  setMaxVersionIssue(msg ?? "affects your version");
458617
458905
  }
458618
458906
  const result = await installLatest(channel2);
458619
- const currentVersion = { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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;
458907
+ const currentVersion = { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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;
458620
458908
  const latencyMs = Date.now() - startTime2;
458621
458909
  if (result.lockFailed) {
458622
458910
  logEvent("theus_native_auto_updater_lock_contention", {
@@ -458753,17 +459041,17 @@ function PackageManagerAutoUpdater(t0) {
458753
459041
  const maxVersion = await getMaxVersion();
458754
459042
  if (maxVersion && latest && gt(latest, maxVersion)) {
458755
459043
  logForDebugging(`PackageManagerAutoUpdater: maxVersion ${maxVersion} is set, capping update from ${latest} to ${maxVersion}`);
458756
- if (gte({ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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)) {
458757
- logForDebugging(`PackageManagerAutoUpdater: current version ${{ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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`);
459044
+ if (gte({ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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)) {
459045
+ logForDebugging(`PackageManagerAutoUpdater: current version ${{ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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`);
458758
459046
  setUpdateAvailable(false);
458759
459047
  return;
458760
459048
  }
458761
459049
  latest = maxVersion;
458762
459050
  }
458763
- const hasUpdate = latest && !gte({ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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);
459051
+ const hasUpdate = latest && !gte({ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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);
458764
459052
  setUpdateAvailable(!!hasUpdate);
458765
459053
  if (hasUpdate) {
458766
- logForDebugging(`PackageManagerAutoUpdater: Update available ${{ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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}`);
459054
+ logForDebugging(`PackageManagerAutoUpdater: Update available ${{ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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}`);
458767
459055
  }
458768
459056
  };
458769
459057
  $2[0] = t1;
@@ -458797,7 +459085,7 @@ function PackageManagerAutoUpdater(t0) {
458797
459085
  wrap: "truncate",
458798
459086
  children: [
458799
459087
  "versi\xF3n actual: ",
458800
- { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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
459088
+ { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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
458801
459089
  ]
458802
459090
  });
458803
459091
  $2[3] = verbose;
@@ -466660,7 +466948,7 @@ function buildStatusLineCommandInput(permissionMode2, exceeds200kTokens, setting
466660
466948
  project_dir: getOriginalCwd(),
466661
466949
  added_dirs: addedDirs
466662
466950
  },
466663
- version: { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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,
466951
+ version: { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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,
466664
466952
  output_style: {
466665
466953
  name: outputStyleName
466666
466954
  },
@@ -472648,9 +472936,9 @@ function initSkillImprovement() {
472648
472936
  async function applySkillImprovement(skillName, updates) {
472649
472937
  if (!skillName)
472650
472938
  return;
472651
- const { join: join172 } = await import("path");
472939
+ const { join: join173 } = await import("path");
472652
472940
  const fs5 = await import("fs/promises");
472653
- const filePath = join172(getCwd(), ".theus", "skills", skillName, "SKILL.md");
472941
+ const filePath = join173(getCwd(), ".theus", "skills", skillName, "SKILL.md");
472654
472942
  let currentContent;
472655
472943
  try {
472656
472944
  currentContent = await fs5.readFile(filePath, "utf-8");
@@ -472802,7 +473090,7 @@ function useMoreRight(_args) {
472802
473090
  }
472803
473091
 
472804
473092
  // utils/cleanup.ts
472805
- import { join as join172 } from "path";
473093
+ import { join as join173 } from "path";
472806
473094
  function getCutoffDate() {
472807
473095
  const settings = getSettings_DEPRECATED() || {};
472808
473096
  const cleanupPeriodDays = settings.cleanupPeriodDays ?? DEFAULT_CLEANUP_PERIOD_DAYS;
@@ -472827,7 +473115,7 @@ async function cleanupOldFilesInDirectory(dirPath, cutoffDate, isMessagePath) {
472827
473115
  try {
472828
473116
  const timestamp2 = convertFileNameToDate(file2.name);
472829
473117
  if (timestamp2 < cutoffDate) {
472830
- await getFsImplementation().unlink(join172(dirPath, file2.name));
473118
+ await getFsImplementation().unlink(join173(dirPath, file2.name));
472831
473119
  if (isMessagePath) {
472832
473120
  result.messages++;
472833
473121
  } else {
@@ -472858,7 +473146,7 @@ async function cleanupOldMessageFiles() {
472858
473146
  } catch {
472859
473147
  return result;
472860
473148
  }
472861
- const mcpLogDirs = dirents.filter((dirent) => dirent.isDirectory() && dirent.name.startsWith("mcp-logs-")).map((dirent) => join172(baseCachePath, dirent.name));
473149
+ const mcpLogDirs = dirents.filter((dirent) => dirent.isDirectory() && dirent.name.startsWith("mcp-logs-")).map((dirent) => join173(baseCachePath, dirent.name));
472862
473150
  for (const mcpLogDir of mcpLogDirs) {
472863
473151
  result = addCleanupResults(result, await cleanupOldFilesInDirectory(mcpLogDir, cutoffDate, true));
472864
473152
  await tryRmdir(mcpLogDir, fsImpl);
@@ -472897,7 +473185,7 @@ async function cleanupOldSessionFiles() {
472897
473185
  for (const projectDirent of projectDirents) {
472898
473186
  if (!projectDirent.isDirectory())
472899
473187
  continue;
472900
- const projectDir = join172(projectsDir, projectDirent.name);
473188
+ const projectDir = join173(projectsDir, projectDirent.name);
472901
473189
  let entries;
472902
473190
  try {
472903
473191
  entries = await fsImpl.readdir(projectDir);
@@ -472911,15 +473199,15 @@ async function cleanupOldSessionFiles() {
472911
473199
  continue;
472912
473200
  }
472913
473201
  try {
472914
- if (await unlinkIfOld(join172(projectDir, entry.name), cutoffDate, fsImpl)) {
473202
+ if (await unlinkIfOld(join173(projectDir, entry.name), cutoffDate, fsImpl)) {
472915
473203
  result.messages++;
472916
473204
  }
472917
473205
  } catch {
472918
473206
  result.errors++;
472919
473207
  }
472920
473208
  } else if (entry.isDirectory()) {
472921
- const sessionDir = join172(projectDir, entry.name);
472922
- const toolResultsDir = join172(sessionDir, TOOL_RESULTS_SUBDIR);
473209
+ const sessionDir = join173(projectDir, entry.name);
473210
+ const toolResultsDir = join173(sessionDir, TOOL_RESULTS_SUBDIR);
472923
473211
  let toolDirs;
472924
473212
  try {
472925
473213
  toolDirs = await fsImpl.readdir(toolResultsDir);
@@ -472930,14 +473218,14 @@ async function cleanupOldSessionFiles() {
472930
473218
  for (const toolEntry of toolDirs) {
472931
473219
  if (toolEntry.isFile()) {
472932
473220
  try {
472933
- if (await unlinkIfOld(join172(toolResultsDir, toolEntry.name), cutoffDate, fsImpl)) {
473221
+ if (await unlinkIfOld(join173(toolResultsDir, toolEntry.name), cutoffDate, fsImpl)) {
472934
473222
  result.messages++;
472935
473223
  }
472936
473224
  } catch {
472937
473225
  result.errors++;
472938
473226
  }
472939
473227
  } else if (toolEntry.isDirectory()) {
472940
- const toolDirPath = join172(toolResultsDir, toolEntry.name);
473228
+ const toolDirPath = join173(toolResultsDir, toolEntry.name);
472941
473229
  let toolFiles;
472942
473230
  try {
472943
473231
  toolFiles = await fsImpl.readdir(toolDirPath);
@@ -472948,7 +473236,7 @@ async function cleanupOldSessionFiles() {
472948
473236
  if (!tf.isFile())
472949
473237
  continue;
472950
473238
  try {
472951
- if (await unlinkIfOld(join172(toolDirPath, tf.name), cutoffDate, fsImpl)) {
473239
+ if (await unlinkIfOld(join173(toolDirPath, tf.name), cutoffDate, fsImpl)) {
472952
473240
  result.messages++;
472953
473241
  }
472954
473242
  } catch {
@@ -472980,7 +473268,7 @@ async function cleanupSingleDirectory(dirPath, extension, removeEmptyDir = true)
472980
473268
  if (!dirent.isFile() || !dirent.name.endsWith(extension))
472981
473269
  continue;
472982
473270
  try {
472983
- if (await unlinkIfOld(join172(dirPath, dirent.name), cutoffDate, fsImpl)) {
473271
+ if (await unlinkIfOld(join173(dirPath, dirent.name), cutoffDate, fsImpl)) {
472984
473272
  result.messages++;
472985
473273
  }
472986
473274
  } catch {
@@ -472993,7 +473281,7 @@ async function cleanupSingleDirectory(dirPath, extension, removeEmptyDir = true)
472993
473281
  return result;
472994
473282
  }
472995
473283
  function cleanupOldPlanFiles() {
472996
- const plansDir = join172(getTheusConfigHomeDir(), "plans");
473284
+ const plansDir = join173(getTheusConfigHomeDir(), "plans");
472997
473285
  return cleanupSingleDirectory(plansDir, ".md");
472998
473286
  }
472999
473287
  async function cleanupOldFileHistoryBackups() {
@@ -473002,14 +473290,14 @@ async function cleanupOldFileHistoryBackups() {
473002
473290
  const fsImpl = getFsImplementation();
473003
473291
  try {
473004
473292
  const configDir = getTheusConfigHomeDir();
473005
- const fileHistoryStorageDir = join172(configDir, "file-history");
473293
+ const fileHistoryStorageDir = join173(configDir, "file-history");
473006
473294
  let dirents;
473007
473295
  try {
473008
473296
  dirents = await fsImpl.readdir(fileHistoryStorageDir);
473009
473297
  } catch {
473010
473298
  return result;
473011
473299
  }
473012
- const fileHistorySessionsDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join172(fileHistoryStorageDir, dirent.name));
473300
+ const fileHistorySessionsDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join173(fileHistoryStorageDir, dirent.name));
473013
473301
  await Promise.all(fileHistorySessionsDirs.map(async (fileHistorySessionDir) => {
473014
473302
  try {
473015
473303
  const stats2 = await fsImpl.stat(fileHistorySessionDir);
@@ -473036,14 +473324,14 @@ async function cleanupOldSessionEnvDirs() {
473036
473324
  const fsImpl = getFsImplementation();
473037
473325
  try {
473038
473326
  const configDir = getTheusConfigHomeDir();
473039
- const sessionEnvBaseDir = join172(configDir, "session-env");
473327
+ const sessionEnvBaseDir = join173(configDir, "session-env");
473040
473328
  let dirents;
473041
473329
  try {
473042
473330
  dirents = await fsImpl.readdir(sessionEnvBaseDir);
473043
473331
  } catch {
473044
473332
  return result;
473045
473333
  }
473046
- const sessionEnvDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join172(sessionEnvBaseDir, dirent.name));
473334
+ const sessionEnvDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join173(sessionEnvBaseDir, dirent.name));
473047
473335
  for (const sessionEnvDir of sessionEnvDirs) {
473048
473336
  try {
473049
473337
  const stats2 = await fsImpl.stat(sessionEnvDir);
@@ -473065,7 +473353,7 @@ async function cleanupOldDebugLogs() {
473065
473353
  const cutoffDate = getCutoffDate();
473066
473354
  const result = { messages: 0, errors: 0 };
473067
473355
  const fsImpl = getFsImplementation();
473068
- const debugDir = join172(getTheusConfigHomeDir(), "debug");
473356
+ const debugDir = join173(getTheusConfigHomeDir(), "debug");
473069
473357
  let dirents;
473070
473358
  try {
473071
473359
  dirents = await fsImpl.readdir(debugDir);
@@ -473077,7 +473365,7 @@ async function cleanupOldDebugLogs() {
473077
473365
  continue;
473078
473366
  }
473079
473367
  try {
473080
- if (await unlinkIfOld(join172(debugDir, dirent.name), cutoffDate, fsImpl)) {
473368
+ if (await unlinkIfOld(join173(debugDir, dirent.name), cutoffDate, fsImpl)) {
473081
473369
  result.messages++;
473082
473370
  }
473083
473371
  } catch {
@@ -476289,7 +476577,7 @@ __export(exports_asciicast, {
476289
476577
  _resetRecordingStateForTesting: () => _resetRecordingStateForTesting
476290
476578
  });
476291
476579
  import { appendFile as appendFile9, rename as rename12 } from "fs/promises";
476292
- import { basename as basename65, dirname as dirname73, join as join174 } from "path";
476580
+ import { basename as basename65, dirname as dirname73, join as join175 } from "path";
476293
476581
  function getRecordFilePath() {
476294
476582
  if (recordingState.filePath !== null) {
476295
476583
  return recordingState.filePath;
@@ -476300,10 +476588,10 @@ function getRecordFilePath() {
476300
476588
  if (!isEnvTruthy(process.env.THEUS_CODE_TERMINAL_RECORDING)) {
476301
476589
  return null;
476302
476590
  }
476303
- const projectsDir = join174(getTheusConfigHomeDir(), "projects");
476304
- const projectDir = join174(projectsDir, sanitizePath2(getOriginalCwd()));
476591
+ const projectsDir = join175(getTheusConfigHomeDir(), "projects");
476592
+ const projectDir = join175(projectsDir, sanitizePath2(getOriginalCwd()));
476305
476593
  recordingState.timestamp = Date.now();
476306
- recordingState.filePath = join174(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
476594
+ recordingState.filePath = join175(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
476307
476595
  return recordingState.filePath;
476308
476596
  }
476309
476597
  function _resetRecordingStateForTesting() {
@@ -476312,13 +476600,13 @@ function _resetRecordingStateForTesting() {
476312
476600
  }
476313
476601
  function getSessionRecordingPaths() {
476314
476602
  const sessionId = getSessionId();
476315
- const projectsDir = join174(getTheusConfigHomeDir(), "projects");
476316
- const projectDir = join174(projectsDir, sanitizePath2(getOriginalCwd()));
476603
+ const projectsDir = join175(getTheusConfigHomeDir(), "projects");
476604
+ const projectDir = join175(projectsDir, sanitizePath2(getOriginalCwd()));
476317
476605
  try {
476318
476606
  const entries = getFsImplementation().readdirSync(projectDir);
476319
476607
  const names = typeof entries[0] === "string" ? entries : entries.map((e) => e.name);
476320
476608
  const files2 = names.filter((f) => f.startsWith(sessionId) && f.endsWith(".cast")).sort();
476321
- return files2.map((f) => join174(projectDir, f));
476609
+ return files2.map((f) => join175(projectDir, f));
476322
476610
  } catch {
476323
476611
  return [];
476324
476612
  }
@@ -476328,9 +476616,9 @@ async function renameRecordingForSession() {
476328
476616
  if (!oldPath || recordingState.timestamp === 0) {
476329
476617
  return;
476330
476618
  }
476331
- const projectsDir = join174(getTheusConfigHomeDir(), "projects");
476332
- const projectDir = join174(projectsDir, sanitizePath2(getOriginalCwd()));
476333
- const newPath = join174(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
476619
+ const projectsDir = join175(getTheusConfigHomeDir(), "projects");
476620
+ const projectDir = join175(projectsDir, sanitizePath2(getOriginalCwd()));
476621
+ const newPath = join175(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
476334
476622
  if (oldPath === newPath) {
476335
476623
  return;
476336
476624
  }
@@ -479093,7 +479381,7 @@ var init_useAwaySummary = __esm(() => {
479093
479381
 
479094
479382
  // utils/theusInChrome/setupPortable.ts
479095
479383
  import { readdir as readdir37 } from "fs/promises";
479096
- import { join as join175 } from "path";
479384
+ import { join as join176 } from "path";
479097
479385
  function getExtensionIds() {
479098
479386
  return [THEUS_BROWSER_EXTENSION_ID];
479099
479387
  }
@@ -479120,7 +479408,7 @@ async function detectExtensionInstallationPortable(browserPaths, log2) {
479120
479408
  }
479121
479409
  for (const profile of profileDirs) {
479122
479410
  for (const extensionId of extensionIds) {
479123
- const extensionPath = join175(browserBasePath, profile, "Extensions", extensionId);
479411
+ const extensionPath = join176(browserBasePath, profile, "Extensions", extensionId);
479124
479412
  try {
479125
479413
  await readdir37(extensionPath);
479126
479414
  log2?.(`[Theus in Chrome] Extension ${extensionId} found in ${browser} ${profile}`);
@@ -479144,7 +479432,7 @@ var init_setupPortable = __esm(() => {
479144
479432
  // utils/theusInChrome/setup.ts
479145
479433
  import { chmod as chmod15, mkdir as mkdir56, readFile as readFile67, writeFile as writeFile54 } from "fs/promises";
479146
479434
  import { homedir as homedir50 } from "os";
479147
- import { join as join176 } from "path";
479435
+ import { join as join177 } from "path";
479148
479436
  import { fileURLToPath as fileURLToPath8 } from "url";
479149
479437
  function isTheusInChromeEngineAvailable() {
479150
479438
  return Array.isArray(BROWSER_TOOLS);
@@ -479208,8 +479496,8 @@ function setupTheusInChrome() {
479208
479496
  };
479209
479497
  } else {
479210
479498
  const __filename3 = fileURLToPath8(import.meta.url);
479211
- const __dirname3 = join176(__filename3, "..");
479212
- const cliPath = join176(__dirname3, "cli.js");
479499
+ const __dirname3 = join177(__filename3, "..");
479500
+ const cliPath = join177(__dirname3, "cli.js");
479213
479501
  createWrapperScript(`"${process.execPath}" "${cliPath}" --chrome-native-host`).then((manifestBinaryPath) => installChromeNativeHostManifest(manifestBinaryPath)).catch((e) => logForDebugging(`[Theus in Chrome] Failed to install native host: ${e}`, { level: "error" }));
479214
479502
  const mcpConfig = {
479215
479503
  [THEUS_IN_CHROME_MCP_SERVER_NAME]: {
@@ -479231,8 +479519,8 @@ function getNativeMessagingHostsDirs() {
479231
479519
  const platform7 = getPlatform();
479232
479520
  if (platform7 === "windows") {
479233
479521
  const home = homedir50();
479234
- const appData = process.env.APPDATA || join176(home, "AppData", "Local");
479235
- return [join176(appData, "Theus", "ChromeNativeHost")];
479522
+ const appData = process.env.APPDATA || join177(home, "AppData", "Local");
479523
+ return [join177(appData, "Theus", "ChromeNativeHost")];
479236
479524
  }
479237
479525
  return getAllNativeMessagingHostsDirs().map(({ path: path21 }) => path21);
479238
479526
  }
@@ -479251,7 +479539,7 @@ async function installChromeNativeHostManifest(manifestBinaryPath) {
479251
479539
  const manifestContent = jsonStringify(manifest, null, 2);
479252
479540
  let anyManifestUpdated = false;
479253
479541
  for (const manifestDir of manifestDirs) {
479254
- const manifestPath = join176(manifestDir, NATIVE_HOST_MANIFEST_NAME);
479542
+ const manifestPath = join177(manifestDir, NATIVE_HOST_MANIFEST_NAME);
479255
479543
  const existingContent = await readFile67(manifestPath, "utf-8").catch(() => null);
479256
479544
  if (existingContent === manifestContent) {
479257
479545
  continue;
@@ -479266,7 +479554,7 @@ async function installChromeNativeHostManifest(manifestBinaryPath) {
479266
479554
  }
479267
479555
  }
479268
479556
  if (getPlatform() === "windows") {
479269
- const manifestPath = join176(manifestDirs[0], NATIVE_HOST_MANIFEST_NAME);
479557
+ const manifestPath = join177(manifestDirs[0], NATIVE_HOST_MANIFEST_NAME);
479270
479558
  registerWindowsNativeHosts(manifestPath);
479271
479559
  }
479272
479560
  if (anyManifestUpdated) {
@@ -479304,8 +479592,8 @@ function registerWindowsNativeHosts(manifestPath) {
479304
479592
  }
479305
479593
  async function createWrapperScript(command9) {
479306
479594
  const platform7 = getPlatform();
479307
- const chromeDir = join176(getTheusConfigHomeDir(), "chrome");
479308
- const wrapperPath = platform7 === "windows" ? join176(chromeDir, "chrome-native-host.bat") : join176(chromeDir, "chrome-native-host");
479595
+ const chromeDir = join177(getTheusConfigHomeDir(), "chrome");
479596
+ const wrapperPath = platform7 === "windows" ? join177(chromeDir, "chrome-native-host.bat") : join177(chromeDir, "chrome-native-host");
479309
479597
  const scriptContent = platform7 === "windows" ? `@echo off
479310
479598
  REM Chrome native host wrapper script
479311
479599
  REM Generated by Theus - do not edit manually
@@ -479434,7 +479722,7 @@ var init_useChromeExtensionNotification = __esm(() => {
479434
479722
  });
479435
479723
 
479436
479724
  // utils/plugins/officialMarketplaceStartupCheck.ts
479437
- import { join as join177 } from "path";
479725
+ import { join as join178 } from "path";
479438
479726
  function isOfficialMarketplaceAutoInstallDisabled() {
479439
479727
  if (isEnvTruthy(process.env.THEUS_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL)) {
479440
479728
  return true;
@@ -479512,7 +479800,7 @@ async function checkAndInstallOfficialMarketplace() {
479512
479800
  return { installed: false, skipped: true, reason: "policy_blocked" };
479513
479801
  }
479514
479802
  const cacheDir = getMarketplacesCacheDir();
479515
- const installLocation = join177(cacheDir, OFFICIAL_MARKETPLACE_NAME);
479803
+ const installLocation = join178(cacheDir, OFFICIAL_MARKETPLACE_NAME);
479516
479804
  const gcsSha = await fetchOfficialMarketplaceFromGcs(installLocation, cacheDir);
479517
479805
  if (gcsSha !== null) {
479518
479806
  const known = await loadKnownMarketplacesConfig();
@@ -482296,7 +482584,7 @@ var init_usePluginRecommendationBase = __esm(() => {
482296
482584
  });
482297
482585
 
482298
482586
  // hooks/useLspPluginRecommendation.tsx
482299
- import { extname as extname20, join as join178 } from "path";
482587
+ import { extname as extname20, join as join179 } from "path";
482300
482588
  function useLspPluginRecommendation() {
482301
482589
  const $2 = c3(12);
482302
482590
  const trackedFiles = useAppState(_temp202);
@@ -482381,7 +482669,7 @@ function useLspPluginRecommendation() {
482381
482669
  case "yes": {
482382
482670
  installPluginAndNotify(pluginId, pluginName, "lsp-plugin", addNotification, async (pluginData) => {
482383
482671
  logForDebugging(`[useLspPluginRecommendation] Installing plugin: ${pluginId}`);
482384
- const localSourcePath = typeof pluginData.entry.source === "string" ? join178(pluginData.marketplaceInstallLocation, pluginData.entry.source) : undefined;
482672
+ const localSourcePath = typeof pluginData.entry.source === "string" ? join179(pluginData.marketplaceInstallLocation, pluginData.entry.source) : undefined;
482385
482673
  await cacheAndRegisterPlugin(pluginId, pluginData.entry, "user", undefined, localSourcePath);
482386
482674
  const settings = getSettingsForSource("userSettings");
482387
482675
  updateSettingsForSource("userSettings", {
@@ -485585,7 +485873,7 @@ var exports_REPL = {};
485585
485873
  __export(exports_REPL, {
485586
485874
  REPL: () => REPL
485587
485875
  });
485588
- import { dirname as dirname75, join as join179 } from "path";
485876
+ import { dirname as dirname75, join as join180 } from "path";
485589
485877
  import { tmpdir as tmpdir16 } from "os";
485590
485878
  import { writeFile as writeFile55 } from "fs/promises";
485591
485879
  import { randomUUID as randomUUID61 } from "crypto";
@@ -488219,7 +488507,7 @@ Note: ctrl + z now suspends Theus, ctrl + _ undoes input.
488219
488507
  const w = Math.max(80, (process.stdout.columns ?? 80) - 6);
488220
488508
  const raw = await renderMessagesToPlainText(deferredMessages, tools, w);
488221
488509
  const text2 = raw.replace(/[ \t]+$/gm, "");
488222
- const path21 = join179(tmpdir16(), `cc-transcript-${Date.now()}.txt`);
488510
+ const path21 = join180(tmpdir16(), `cc-transcript-${Date.now()}.txt`);
488223
488511
  await writeFile55(path21, text2);
488224
488512
  const opened = openFileInExternalEditor(path21);
488225
488513
  setStatus(opened ? `opening ${path21}` : `wrote ${path21} \xB7 no $VISUAL/$EDITOR set`);
@@ -490561,6 +490849,7 @@ function TrustDialog(t0) {
490561
490849
  if ($2[25] !== onChange) {
490562
490850
  t21 = /* @__PURE__ */ jsx_runtime485.jsx(Select, {
490563
490851
  options: t20,
490852
+ defaultFocusValue: "exit",
490564
490853
  onChange: (value_0) => onChange(value_0),
490565
490854
  onCancel: () => onChange("exit")
490566
490855
  });
@@ -490983,7 +491272,7 @@ function completeOnboarding() {
490983
491272
  saveGlobalConfig((current) => ({
490984
491273
  ...current,
490985
491274
  hasCompletedOnboarding: true,
490986
- lastOnboardingVersion: { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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
491275
+ lastOnboardingVersion: { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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
490987
491276
  }));
490988
491277
  }
490989
491278
  function showDialog(root2, renderer) {
@@ -491214,15 +491503,15 @@ var init_interactiveHelpers = __esm(() => {
491214
491503
 
491215
491504
  // components/Theus/arsenalStats.ts
491216
491505
  import { existsSync as existsSync30, readdirSync as readdirSync6 } from "fs";
491217
- import { dirname as dirname76, join as join180 } from "path";
491506
+ import { dirname as dirname76, join as join181 } from "path";
491218
491507
  import { fileURLToPath as fileURLToPath9 } from "url";
491219
491508
  function countBundledArsenalSkills() {
491220
491509
  try {
491221
491510
  const here = dirname76(fileURLToPath9(import.meta.url));
491222
491511
  for (const dir of [
491223
- join180(here, "..", "..", "vendor", "theus-arsenal", "skills"),
491224
- join180(here, "vendor", "theus-arsenal", "skills"),
491225
- join180(here, "..", "vendor", "theus-arsenal", "skills")
491512
+ join181(here, "..", "..", "vendor", "theus-arsenal", "skills"),
491513
+ join181(here, "vendor", "theus-arsenal", "skills"),
491514
+ join181(here, "..", "vendor", "theus-arsenal", "skills")
491226
491515
  ]) {
491227
491516
  if (!existsSync30(dir))
491228
491517
  continue;
@@ -491306,7 +491595,7 @@ var init_arsenalStats = __esm(() => {
491306
491595
  // services/import/detect/global.ts
491307
491596
  import { existsSync as existsSync31 } from "fs";
491308
491597
  import { open as open25, readdir as readdir38, stat as stat57 } from "fs/promises";
491309
- import { join as join181 } from "path";
491598
+ import { join as join182 } from "path";
491310
491599
  async function rutaDelTranscript(fichero) {
491311
491600
  let crudo;
491312
491601
  try {
@@ -491337,7 +491626,7 @@ async function rutaDelTranscript(fichero) {
491337
491626
  return null;
491338
491627
  }
491339
491628
  async function explorarTodoElTrabajo(entorno) {
491340
- const raiz = join181(directorioConfig(entorno), "projects");
491629
+ const raiz = join182(directorioConfig(entorno), "projects");
491341
491630
  let directorios;
491342
491631
  try {
491343
491632
  directorios = await readdir38(raiz);
@@ -491346,7 +491635,7 @@ async function explorarTodoElTrabajo(entorno) {
491346
491635
  }
491347
491636
  const salida = [];
491348
491637
  for (const dir of directorios) {
491349
- const ruta = join181(raiz, dir);
491638
+ const ruta = join182(raiz, dir);
491350
491639
  let sesiones;
491351
491640
  try {
491352
491641
  sesiones = (await readdir38(ruta)).filter((n3) => n3.endsWith(".jsonl"));
@@ -491360,7 +491649,7 @@ async function explorarTodoElTrabajo(entorno) {
491360
491649
  let ficheroMasReciente = sesiones[0];
491361
491650
  for (const nombre of sesiones) {
491362
491651
  try {
491363
- const info = await stat57(join181(ruta, nombre));
491652
+ const info = await stat57(join182(ruta, nombre));
491364
491653
  bytes += info.size;
491365
491654
  if (info.mtimeMs > masReciente) {
491366
491655
  masReciente = info.mtimeMs;
@@ -491368,7 +491657,7 @@ async function explorarTodoElTrabajo(entorno) {
491368
491657
  }
491369
491658
  } catch {}
491370
491659
  }
491371
- const proyecto = await rutaDelTranscript(join181(ruta, ficheroMasReciente));
491660
+ const proyecto = await rutaDelTranscript(join182(ruta, ficheroMasReciente));
491372
491661
  if (!proyecto)
491373
491662
  continue;
491374
491663
  salida.push({
@@ -491472,7 +491761,7 @@ __export(exports_OnboardingWizard, {
491472
491761
  OnboardingWizard: () => OnboardingWizard
491473
491762
  });
491474
491763
  import { existsSync as existsSync32, mkdirSync as mkdirSync15, writeFileSync as writeFileSync14 } from "fs";
491475
- import { join as join182 } from "path";
491764
+ import { join as join183 } from "path";
491476
491765
  function hasSeenOnboardingWizard() {
491477
491766
  if (isEnvTruthy(process.env.THEUS_FORCE_ONBOARDING_WIZARD))
491478
491767
  return false;
@@ -491480,7 +491769,7 @@ function hasSeenOnboardingWizard() {
491480
491769
  return true;
491481
491770
  }
491482
491771
  try {
491483
- return existsSync32(join182(getTheusConfigHome(), WIZARD_MARKER));
491772
+ return existsSync32(join183(getTheusConfigHome(), WIZARD_MARKER));
491484
491773
  } catch {
491485
491774
  return true;
491486
491775
  }
@@ -491489,7 +491778,7 @@ function markOnboardingWizardSeen() {
491489
491778
  try {
491490
491779
  const home = getTheusConfigHome();
491491
491780
  mkdirSync15(home, { recursive: true });
491492
- writeFileSync14(join182(home, WIZARD_MARKER), `${JSON.stringify({
491781
+ writeFileSync14(join183(home, WIZARD_MARKER), `${JSON.stringify({
491493
491782
  seenAt: new Date().toISOString(),
491494
491783
  version: globalThis.MACRO?.VERSION ?? null
491495
491784
  })}
@@ -497577,9 +497866,9 @@ var init_createDirectConnectSession = __esm(() => {
497577
497866
 
497578
497867
  // utils/releaseNotes.ts
497579
497868
  import { mkdir as mkdir57, readFile as readFile69, writeFile as writeFile56 } from "fs/promises";
497580
- import { dirname as dirname78, join as join183 } from "path";
497869
+ import { dirname as dirname78, join as join184 } from "path";
497581
497870
  function getChangelogCachePath() {
497582
- return join183(getTheusConfigHomeDir(), "cache", "changelog.md");
497871
+ return join184(getTheusConfigHomeDir(), "cache", "changelog.md");
497583
497872
  }
497584
497873
  async function migrateChangelogFromConfig() {
497585
497874
  const config3 = getGlobalConfig();
@@ -497679,7 +497968,7 @@ function getRecentReleaseNotes(currentVersion, previousVersion, changelogContent
497679
497968
  }
497680
497969
  return [];
497681
497970
  }
497682
- async function checkForReleaseNotes(lastSeenVersion, currentVersion = { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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) {
497971
+ async function checkForReleaseNotes(lastSeenVersion, currentVersion = { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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) {
497683
497972
  if (false) {}
497684
497973
  const cachedChangelog = await getStoredChangelog();
497685
497974
  if (lastSeenVersion !== currentVersion || !cachedChangelog) {
@@ -497777,7 +498066,7 @@ __export(exports_setup2, {
497777
498066
  setupComputerUse: () => setupComputerUse,
497778
498067
  COMPUTER_USE_SYSTEM_HINT: () => COMPUTER_USE_SYSTEM_HINT
497779
498068
  });
497780
- import { dirname as dirname79, join as join184 } from "path";
498069
+ import { dirname as dirname79, join as join185 } from "path";
497781
498070
  import { fileURLToPath as fileURLToPath10 } from "url";
497782
498071
  function setupComputerUse() {
497783
498072
  const allowedTools = COMPUTER_USE_TOOL_NAMES.map((name) => buildMcpToolName(COMPUTER_USE_SERVER_NAME, name));
@@ -497804,11 +498093,11 @@ function resolveComputerUseLauncher() {
497804
498093
  return { command: process.execPath, args: [entry, COMPUTER_USE_FLAG] };
497805
498094
  }
497806
498095
  if (entry) {
497807
- const launcher = join184(dirname79(entry), "..", "bin", "theus");
498096
+ const launcher = join185(dirname79(entry), "..", "bin", "theus");
497808
498097
  return { command: launcher, args: [COMPUTER_USE_FLAG] };
497809
498098
  }
497810
498099
  return {
497811
- command: join184(fileURLToPath10(import.meta.url), "..", "..", "..", "bin", "theus"),
498100
+ command: join185(fileURLToPath10(import.meta.url), "..", "..", "..", "bin", "theus"),
497812
498101
  args: [COMPUTER_USE_FLAG]
497813
498102
  };
497814
498103
  }
@@ -497826,7 +498115,7 @@ __export(exports_arsenalBundled, {
497826
498115
  ensureBundledArsenalInstalled: () => ensureBundledArsenalInstalled
497827
498116
  });
497828
498117
  import { existsSync as existsSync33, readFileSync as readFileSync33 } from "fs";
497829
- import { dirname as dirname80, join as join185 } from "path";
498118
+ import { dirname as dirname80, join as join186 } from "path";
497830
498119
  import { fileURLToPath as fileURLToPath11 } from "url";
497831
498120
  function isArsenalAutoInstallEnabled() {
497832
498121
  return process.env.THEUS_NO_ARSENAL !== "1";
@@ -497834,10 +498123,10 @@ function isArsenalAutoInstallEnabled() {
497834
498123
  function findBundledArsenalDir() {
497835
498124
  const here = dirname80(fileURLToPath11(import.meta.url));
497836
498125
  for (const candidate of [
497837
- join185(here, "vendor", "theus-arsenal"),
497838
- join185(here, "..", "vendor", "theus-arsenal")
498126
+ join186(here, "vendor", "theus-arsenal"),
498127
+ join186(here, "..", "vendor", "theus-arsenal")
497839
498128
  ]) {
497840
- if (existsSync33(join185(candidate, ".theus-plugin", "plugin.json"))) {
498129
+ if (existsSync33(join186(candidate, ".theus-plugin", "plugin.json"))) {
497841
498130
  return candidate;
497842
498131
  }
497843
498132
  }
@@ -497845,7 +498134,7 @@ function findBundledArsenalDir() {
497845
498134
  }
497846
498135
  function readBundledVersion(bundledDir) {
497847
498136
  try {
497848
- const manifest = JSON.parse(readFileSync33(join185(bundledDir, ".theus-plugin", "plugin.json"), "utf8"));
498137
+ const manifest = JSON.parse(readFileSync33(join186(bundledDir, ".theus-plugin", "plugin.json"), "utf8"));
497849
498138
  return typeof manifest.version === "string" ? manifest.version : null;
497850
498139
  } catch {
497851
498140
  return null;
@@ -498085,7 +498374,7 @@ var init_sessionMemory = __esm(() => {
498085
498374
  // utils/iTermBackup.ts
498086
498375
  import { copyFile as copyFile10, stat as stat59 } from "fs/promises";
498087
498376
  import { homedir as homedir52 } from "os";
498088
- import { join as join186 } from "path";
498377
+ import { join as join187 } from "path";
498089
498378
  function markITerm2SetupComplete() {
498090
498379
  saveGlobalConfig((current) => ({
498091
498380
  ...current,
@@ -498100,7 +498389,7 @@ function getIterm2RecoveryInfo() {
498100
498389
  };
498101
498390
  }
498102
498391
  function getITerm2PlistPath() {
498103
- return join186(homedir52(), "Library", "Preferences", "com.googlecode.iterm2.plist");
498392
+ return join187(homedir52(), "Library", "Preferences", "com.googlecode.iterm2.plist");
498104
498393
  }
498105
498394
  async function checkAndRestoreITerm2Backup() {
498106
498395
  const { inProgress, backupPath } = getIterm2RecoveryInfo();
@@ -499608,7 +499897,7 @@ var init_sessionUrl = __esm(() => {
499608
499897
 
499609
499898
  // utils/plugins/zipCacheAdapters.ts
499610
499899
  import { readFile as readFile70 } from "fs/promises";
499611
- import { join as join187 } from "path";
499900
+ import { join as join188 } from "path";
499612
499901
  async function readZipCacheKnownMarketplaces() {
499613
499902
  try {
499614
499903
  const content = await readFile70(getZipCacheKnownMarketplacesPath(), "utf-8");
@@ -499633,13 +499922,13 @@ async function saveMarketplaceJsonToZipCache(marketplaceName, installLocation) {
499633
499922
  const content = await readMarketplaceJsonContent(installLocation);
499634
499923
  if (content !== null) {
499635
499924
  const relPath = getMarketplaceJsonRelativePath(marketplaceName);
499636
- await atomicWriteToZipCache(join187(zipCachePath, relPath), content);
499925
+ await atomicWriteToZipCache(join188(zipCachePath, relPath), content);
499637
499926
  }
499638
499927
  }
499639
499928
  async function readMarketplaceJsonContent(dir) {
499640
499929
  const candidates = [
499641
- join187(dir, ".theus-plugin", "marketplace.json"),
499642
- join187(dir, "marketplace.json"),
499930
+ join188(dir, ".theus-plugin", "marketplace.json"),
499931
+ join188(dir, "marketplace.json"),
499643
499932
  dir
499644
499933
  ];
499645
499934
  for (const candidate of candidates) {
@@ -503212,7 +503501,7 @@ async function startMCPServer(cwd3, debug3, verbose) {
503212
503501
  setCwd(cwd3);
503213
503502
  const server2 = new Server({
503214
503503
  name: "theus/tengu",
503215
- version: { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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
503504
+ version: { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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
503216
503505
  }, {
503217
503506
  capabilities: {
503218
503507
  tools: {}
@@ -503344,14 +503633,14 @@ __export(exports_theusDesktop, {
503344
503633
  });
503345
503634
  import { readdir as readdir39, readFile as readFile72, stat as stat61 } from "fs/promises";
503346
503635
  import { homedir as homedir53 } from "os";
503347
- import { join as join188 } from "path";
503636
+ import { join as join189 } from "path";
503348
503637
  async function getTheusDesktopConfigPath() {
503349
503638
  const platform7 = getPlatform();
503350
503639
  if (!SUPPORTED_PLATFORMS.includes(platform7)) {
503351
503640
  throw new Error(`Unsupported platform: ${platform7} - Theus Desktop integration only works on macOS and WSL.`);
503352
503641
  }
503353
503642
  if (platform7 === "macos") {
503354
- return join188(homedir53(), "Library", "Application Support", "Theus", "theus_desktop_config.json");
503643
+ return join189(homedir53(), "Library", "Application Support", "Theus", "theus_desktop_config.json");
503355
503644
  }
503356
503645
  const windowsHome = process.env.USERPROFILE ? process.env.USERPROFILE.replace(/\\/g, "/") : null;
503357
503646
  if (windowsHome) {
@@ -503370,7 +503659,7 @@ async function getTheusDesktopConfigPath() {
503370
503659
  if (user.name === "Public" || user.name === "Default" || user.name === "Default User" || user.name === "All Users") {
503371
503660
  continue;
503372
503661
  }
503373
- const potentialConfigPath = join188(usersDir, user.name, "AppData", "Roaming", "Theus", "theus_desktop_config.json");
503662
+ const potentialConfigPath = join189(usersDir, user.name, "AppData", "Roaming", "Theus", "theus_desktop_config.json");
503374
503663
  try {
503375
503664
  await stat61(potentialConfigPath);
503376
503665
  return potentialConfigPath;
@@ -504279,12 +504568,12 @@ __export(exports_install, {
504279
504568
  install: () => install
504280
504569
  });
504281
504570
  import { homedir as homedir54 } from "os";
504282
- import { join as join189 } from "path";
504571
+ import { join as join190 } from "path";
504283
504572
  function getInstallationPath2() {
504284
504573
  const isWindows2 = env3.platform === "win32";
504285
504574
  const homeDir = homedir54();
504286
504575
  if (isWindows2) {
504287
- const windowsPath = join189(homeDir, ".local", "bin", "theus.exe");
504576
+ const windowsPath = join190(homeDir, ".local", "bin", "theus.exe");
504288
504577
  return windowsPath.replace(/\//g, "\\");
504289
504578
  }
504290
504579
  return "~/.local/bin/theus";
@@ -504654,7 +504943,7 @@ async function setupTokenHandler(root2) {
504654
504943
  gap: 1,
504655
504944
  children: [
504656
504945
  /* @__PURE__ */ jsx_runtime503.jsx(TheusBanner, {
504657
- version: { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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
504946
+ version: { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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
504658
504947
  }),
504659
504948
  showAuthWarning && /* @__PURE__ */ jsx_runtime503.jsxs(ThemedBox_default, {
504660
504949
  flexDirection: "column",
@@ -505257,7 +505546,8 @@ async function run7() {
505257
505546
  sortSubcommands: true,
505258
505547
  sortOptions: true
505259
505548
  }, {
505260
- compareOptions: (a2, b) => getOptionSortKey(a2).localeCompare(getOptionSortKey(b))
505549
+ compareOptions: (a2, b) => getOptionSortKey(a2).localeCompare(getOptionSortKey(b)),
505550
+ helpWidth: Math.max(95, Math.min(100, process.stdout.columns || 95))
505261
505551
  });
505262
505552
  }
505263
505553
  const program2 = new Command().configureHelp(createSortedHelpConfig()).enablePositionalOptions();
@@ -505291,7 +505581,7 @@ async function run7() {
505291
505581
  });
505292
505582
  program2.name("theus").description(`Theus - inicia una sesi\xF3n interactiva por defecto; usa -p/--print para salida no interactiva`).argument("[prompt]", "Tu prompt", String).helpOption("-h, --help", "Muestra la ayuda del comando").option("-d, --debug [filter]", 'Activa el modo de depuraci\xF3n con filtrado opcional por categor\xEDas (p. ej., "api,hooks" o "!1p,!file")', (_value) => {
505293
505583
  return true;
505294
- }).addOption(new Option("--debug-to-stderr", "Enable debug mode (to stderr)").argParser(Boolean).hideHelp()).option("--debug-file <path>", "Escribe los registros de depuraci\xF3n en una ruta de archivo espec\xEDfica (activa impl\xEDcitamente el modo de depuraci\xF3n)", () => true).option("--verbose", "Anula el ajuste de modo detallado de la configuraci\xF3n", () => true).option("-p, --print", "Imprime la respuesta y sale (\xFAtil para pipes). Nota: el di\xE1logo de confianza del espacio de trabajo se omite cuando Theus se ejecuta en modo -p. Usa esta opci\xF3n solo en directorios de confianza.", () => true).option("--bare", "Modo m\xEDnimo: omite hooks, LSP, sincronizaci\xF3n de plugins, atribuci\xF3n, memoria autom\xE1tica, precargas en segundo plano, lecturas del llavero y autodescubrimiento de memoria del proyecto. La autenticaci\xF3n del proveedor usa claves de API configuradas o apiKeyHelper v\xEDa --settings; nunca se leen OAuth ni el llavero. Las skills siguen resolvi\xE9ndose v\xEDa /nombre-de-skill. Proporciona contexto expl\xEDcitamente v\xEDa: --system-prompt[-file], --append-system-prompt[-file], --add-dir (directorios de memoria del proyecto), --mcp-config, --settings, --agents, --plugin-dir.", () => true).addOption(new Option("--init", "Run Setup hooks with init trigger, then continue").hideHelp()).addOption(new Option("--init-only", "Run Setup and SessionStart:startup hooks, then exit").hideHelp()).addOption(new Option("--maintenance", "Run Setup hooks with maintenance trigger, then continue").hideHelp()).addOption(new Option("--output-format <format>", 'Formato de salida (solo funciona con --print): "text" (por defecto), "json" (resultado \xFAnico) o "stream-json" (transmisi\xF3n en tiempo real)').choices(["text", "json", "stream-json"])).addOption(new Option("--json-schema <schema>", 'Esquema JSON para validar la salida estructurada. Ejemplo: {"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}').argParser(String)).option("--include-hook-events", "Incluye todos los eventos del ciclo de vida de los hooks en el flujo de salida (solo funciona con --output-format=stream-json)", () => true).option("--include-partial-messages", "Incluye fragmentos parciales de mensajes a medida que llegan (solo funciona con --print y --output-format=stream-json)", () => true).addOption(new Option("--input-format <format>", 'Formato de entrada (solo funciona con --print): "text" (por defecto) o "stream-json" (entrada en streaming en tiempo real)').choices(["text", "stream-json"])).option("--mcp-debug", "[OBSOLETO. Usa --debug en su lugar] Activa el modo de depuraci\xF3n de MCP (muestra errores de los servidores MCP)", () => true).option("--dangerously-skip-permissions", "Omite todas las verificaciones de permisos. Recomendado solo para sandboxes sin acceso a internet.", () => true).option("--allow-dangerously-skip-permissions", "Permite omitir todas las verificaciones de permisos como opci\xF3n, sin activarla por defecto. Recomendado solo para sandboxes sin acceso a internet.", () => true).addOption(new Option("--thinking <mode>", "Thinking mode: enabled (equivalent to adaptive), disabled").choices(["enabled", "adaptive", "disabled"]).hideHelp()).addOption(new Option("--max-thinking-tokens <tokens>", "[DEPRECATED. Use --thinking instead for newer models] Maximum number of thinking tokens (only works with --print)").argParser(Number).hideHelp()).addOption(new Option("--max-turns <turns>", "Maximum number of agentic turns in non-interactive mode. This will early exit the conversation after the specified number of turns. (only works with --print)").argParser(Number).hideHelp()).addOption(new Option("--max-budget-usd <amount>", "Monto m\xE1ximo en d\xF3lares a gastar en llamadas a la API (solo funciona con --print)").argParser((value) => {
505584
+ }).addOption(new Option("--debug-to-stderr", "Enable debug mode (to stderr)").argParser(Boolean).hideHelp()).option("--debug-file <path>", "Escribe los registros de depuraci\xF3n en una ruta de archivo espec\xEDfica (activa impl\xEDcitamente el modo de depuraci\xF3n)", () => true).option("--verbose", "Anula el ajuste de modo detallado de la configuraci\xF3n", () => true).option("-p, --print", "Imprime la respuesta y sale (\xFAtil para pipes). Nota: el di\xE1logo de confianza del espacio de trabajo se omite cuando Theus se ejecuta en modo -p. Usa esta opci\xF3n solo en directorios de confianza.", () => true).option("--bare", "Modo minimo para automatizacion: omite hooks, LSP, plugins, memoria y lecturas del llavero. Autentica solo con clave de API o apiKeyHelper. Detalle en docs.theus.pe/docs/cli-reference", () => true).addOption(new Option("--init", "Run Setup hooks with init trigger, then continue").hideHelp()).addOption(new Option("--init-only", "Run Setup and SessionStart:startup hooks, then exit").hideHelp()).addOption(new Option("--maintenance", "Run Setup hooks with maintenance trigger, then continue").hideHelp()).addOption(new Option("--output-format <format>", 'Formato de salida (solo funciona con --print): "text" (por defecto), "json" (resultado \xFAnico) o "stream-json" (transmisi\xF3n en tiempo real)').choices(["text", "json", "stream-json"])).addOption(new Option("--json-schema <schema>", 'Esquema JSON para validar la salida estructurada. Ejemplo: {"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}').argParser(String)).option("--include-hook-events", "Incluye todos los eventos del ciclo de vida de los hooks en el flujo de salida (solo funciona con --output-format=stream-json)", () => true).option("--include-partial-messages", "Incluye fragmentos parciales de mensajes a medida que llegan (solo funciona con --print y --output-format=stream-json)", () => true).addOption(new Option("--input-format <format>", 'Formato de entrada (solo funciona con --print): "text" (por defecto) o "stream-json" (entrada en streaming en tiempo real)').choices(["text", "stream-json"])).option("--mcp-debug", "[OBSOLETO. Usa --debug en su lugar] Activa el modo de depuraci\xF3n de MCP (muestra errores de los servidores MCP)", () => true).option("--dangerously-skip-permissions", "Omite todas las verificaciones de permisos. Recomendado solo para sandboxes sin acceso a internet.", () => true).option("--allow-dangerously-skip-permissions", "Permite omitir todas las verificaciones de permisos como opci\xF3n, sin activarla por defecto. Recomendado solo para sandboxes sin acceso a internet.", () => true).addOption(new Option("--thinking <mode>", "Thinking mode: enabled (equivalent to adaptive), disabled").choices(["enabled", "adaptive", "disabled"]).hideHelp()).addOption(new Option("--max-thinking-tokens <tokens>", "[DEPRECATED. Use --thinking instead for newer models] Maximum number of thinking tokens (only works with --print)").argParser(Number).hideHelp()).addOption(new Option("--max-turns <turns>", "Maximum number of agentic turns in non-interactive mode. This will early exit the conversation after the specified number of turns. (only works with --print)").argParser(Number).hideHelp()).addOption(new Option("--max-budget-usd <amount>", "Monto m\xE1ximo en d\xF3lares a gastar en llamadas a la API (solo funciona con --print)").argParser((value) => {
505295
505585
  const amount = Number(value);
505296
505586
  if (isNaN(amount) || amount <= 0) {
505297
505587
  throw new Error("--max-budget-usd must be a positive number greater than 0");
@@ -506239,7 +506529,7 @@ ${assistantAddendum}` : assistantAddendum;
506239
506529
  }
506240
506530
  }
506241
506531
  logForDiagnosticsNoPII("info", "started", {
506242
- version: { VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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,
506532
+ version: { VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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,
506243
506533
  is_native_binary: isInBundledMode()
506244
506534
  });
506245
506535
  registerCleanup(async () => {
@@ -507107,7 +507397,7 @@ Usage: theus --remote "your task description"`, () => gracefulShutdown(1));
507107
507397
  pendingHookMessages
507108
507398
  }, renderAndRun);
507109
507399
  }
507110
- }).version(`${{ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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");
507400
+ }).version(`${{ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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");
507111
507401
  program2.option("-w, --worktree [name]", "Crea un nuevo worktree de git para esta sesi\xF3n (opcionalmente indica un nombre)");
507112
507402
  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.");
507113
507403
  if (canUserConfigureAdvisor()) {
@@ -507708,7 +507998,7 @@ if (false) {}
507708
507998
  async function main2() {
507709
507999
  const args = process.argv.slice(2);
507710
508000
  if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
507711
- console.log(`${{ VERSION: "0.2.81", BUILD_TIME: "1970-01-01T00:00:00.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)`);
508001
+ console.log(`${{ VERSION: "0.2.83", BUILD_TIME: "1970-01-01T00:00:00.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)`);
507712
508002
  return;
507713
508003
  }
507714
508004
  if (args[0] === "login" || args[0] === "signin" || args[0] === "entrar" || args[0] === "iniciar-sesion") {