theus-cli 0.2.81 → 0.2.82

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;
3488
3519
  }
3489
3520
  }
3490
3521
 
3522
+ class APIConnectionTimeoutError extends APIConnectionError {
3523
+ constructor({ message } = {}) {
3524
+ super({ message: message ?? "Request timed out." });
3525
+ }
3526
+ }
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.82", BUILD_TIME: "1970-01-01T00:00:00.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.82", BUILD_TIME: "1970-01-01T00:00:00.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.82", BUILD_TIME: "1970-01-01T00:00:00.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.82", BUILD_TIME: "1970-01-01T00:00:00.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.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.82", BUILD_TIME: "1970-01-01T00:00:00.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.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.82", BUILD_TIME: "1970-01-01T00:00:00.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.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.82", BUILD_TIME: "1970-01-01T00:00:00.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.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.82", BUILD_TIME: "1970-01-01T00:00:00.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.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.82", BUILD_TIME: "1970-01-01T00:00:00.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.82", BUILD_TIME: "1970-01-01T00:00:00.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.82", BUILD_TIME: "1970-01-01T00:00:00.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.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.82", BUILD_TIME: "1970-01-01T00:00:00.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.82", BUILD_TIME: "1970-01-01T00:00:00.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.82", BUILD_TIME: "1970-01-01T00:00:00.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.82", BUILD_TIME: "1970-01-01T00:00:00.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.82", BUILD_TIME: "1970-01-01T00:00:00.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.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.82", BUILD_TIME: "1970-01-01T00:00:00.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.82", BUILD_TIME: "1970-01-01T00:00:00.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.82", BUILD_TIME: "1970-01-01T00:00:00.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.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.82", BUILD_TIME: "1970-01-01T00:00:00.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.82", BUILD_TIME: "1970-01-01T00:00:00.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.82", BUILD_TIME: "1970-01-01T00:00:00.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) => ({
@@ -298248,10 +298343,18 @@ function cardsForEntry(entry) {
298248
298343
  }
298249
298344
  return cards;
298250
298345
  }
298346
+ function isRoutingDelegated(options2) {
298347
+ if (options2.routerDelegated === true)
298348
+ return true;
298349
+ const defaultModel = readString(options2.model);
298350
+ return defaultModel !== undefined && SERVER_SIDE_ROUTER_ALIASES.has(defaultModel);
298351
+ }
298251
298352
  function entryContributesModels(entry) {
298252
298353
  if (NON_LLM_ADAPTERS.has(entry.adapter))
298253
298354
  return false;
298254
298355
  const options2 = readEntryOptions(entry);
298356
+ if (isRoutingDelegated(options2))
298357
+ return false;
298255
298358
  if (Array.isArray(options2.models) && options2.models.length > 0)
298256
298359
  return true;
298257
298360
  return Boolean(detectProviderFamily({
@@ -298327,6 +298430,7 @@ var NON_LLM_ADAPTERS;
298327
298430
  var init_registry3 = __esm(() => {
298328
298431
  init_registry2();
298329
298432
  init_secretStore();
298433
+ init_routerEnv();
298330
298434
  init_knownModels();
298331
298435
  NON_LLM_ADAPTERS = new Set(["report", "chart", "video", "image", "media"]);
298332
298436
  });
@@ -299106,21 +299210,6 @@ var init_telemetry = __esm(() => {
299106
299210
  MAX_BYTES_DEFAULT = 5 * 1024 * 1024;
299107
299211
  });
299108
299212
 
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
299213
  // services/router/planExecutor.ts
299125
299214
  var exports_planExecutor = {};
299126
299215
  __export(exports_planExecutor, {
@@ -300238,9 +300327,9 @@ function getTheusEnvMetadata() {
300238
300327
  };
300239
300328
  }
300240
300329
  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)
300330
+ if (!{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.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
300331
  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();
300332
+ const buildTime = new Date({ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.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
300333
  if (isNaN(buildTime))
300245
300334
  return;
300246
300335
  return Math.floor((Date.now() - buildTime) / 60000);
@@ -318545,7 +318634,7 @@ function getSimpleDoingTasksSection() {
318545
318634
  ];
318546
318635
  const userHelpSubitems = [
318547
318636
  `/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}`
318637
+ `To give feedback, users should ${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.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
318638
  ];
318550
318639
  const items = [
318551
318640
  `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 +319573,14 @@ var init_index_d = __esm(() => {
319484
319573
  APIError7 = class APIError7 extends Error {
319485
319574
  status;
319486
319575
  headers;
319576
+ requestID;
319487
319577
  error;
319488
319578
  };
319489
- APIConnectionError4 = class APIConnectionError4 extends Error {
319579
+ APIConnectionError4 = class APIConnectionError4 extends APIError7 {
319490
319580
  };
319491
319581
  APIConnectionTimeoutError2 = class APIConnectionTimeoutError2 extends APIConnectionError4 {
319492
319582
  };
319493
- APIUserAbortError5 = class APIUserAbortError5 extends Error {
319583
+ APIUserAbortError5 = class APIUserAbortError5 extends APIError7 {
319494
319584
  };
319495
319585
  });
319496
319586
 
@@ -329681,7 +329771,7 @@ async function submitTranscriptShare(messages, trigger, appearanceId) {
329681
329771
  } catch {}
329682
329772
  const data = {
329683
329773
  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,
329774
+ version: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
329775
  platform: process.platform,
329686
329776
  transcript,
329687
329777
  subagentTranscripts: Object.keys(subagentTranscripts).length > 0 ? subagentTranscripts : undefined,
@@ -329886,10 +329976,10 @@ Si el usuario indic\xF3 una duraci\xF3n, p\xE1sala en el par\xE1metro \`duration
329886
329976
 
329887
329977
  // commands/issue/index.ts
329888
329978
  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";
329979
+ return { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
329980
  }
329891
329981
  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";
329982
+ return { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.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.82", BUILD_TIME: "1970-01-01T00:00:00.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
329983
  }
329894
329984
  function getActiveModelLabel() {
329895
329985
  try {
@@ -332675,7 +332765,7 @@ function buildPrimarySection() {
332675
332765
  });
332676
332766
  return [{
332677
332767
  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
332768
+ value: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
332769
  }, {
332680
332770
  label: "Session name",
332681
332771
  value: nameValue
@@ -333510,6 +333600,9 @@ var init_ThemePicker = __esm(() => {
333510
333600
  function getEffortNotificationText(effortValue, model) {
333511
333601
  if (!modelSupportsEffort(model))
333512
333602
  return;
333603
+ if (resolveAppliedEffort(model, effortValue) === undefined) {
333604
+ return `${EFFORT_RAPIDO} respuesta r\xE1pida \xB7 /inteligencia`;
333605
+ }
333513
333606
  const level = getDisplayedEffortLevel(model, effortValue);
333514
333607
  return `${effortLevelToSymbol(level)} ${getEffortLevelLabelEs(level)} \xB7 /inteligencia`;
333515
333608
  }
@@ -336491,7 +336584,7 @@ function Config({
336491
336584
  }
336492
336585
  })
336493
336586
  }) : 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,
336587
+ currentVersion: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
336588
  onChoice: (choice) => {
336496
336589
  setShowSubmenu(null);
336497
336590
  setTabsHidden(false);
@@ -336503,7 +336596,7 @@ function Config({
336503
336596
  autoUpdatesChannel: "stable"
336504
336597
  };
336505
336598
  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;
336599
+ newSettings.minimumVersion = { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
336600
  }
336508
336601
  updateSettingsForSource("userSettings", newSettings);
336509
336602
  setSettingsData((prev_27) => ({
@@ -343862,7 +343955,7 @@ function HelpV2(t0) {
343862
343955
  let t6;
343863
343956
  if ($2[31] !== tabs) {
343864
343957
  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}`,
343958
+ title: `Theus v${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
343959
  color: "professionalBlue",
343867
343960
  defaultTab: "general",
343868
343961
  children: tabs
@@ -345467,6 +345560,8 @@ function buildEntry(preset, options2) {
345467
345560
  const models = options2.models && options2.models.length > 0 ? options2.models.map((m) => ({ ...m, providerId: id })) : undefined;
345468
345561
  if (models)
345469
345562
  entryOptions.models = models;
345563
+ if (options2.routerDelegated)
345564
+ entryOptions.routerDelegated = true;
345470
345565
  const entry = {
345471
345566
  id,
345472
345567
  adapter: adapter2,
@@ -346041,6 +346136,7 @@ async function installTheusSession(payload, webUrl) {
346041
346136
  apiKey: payload.token,
346042
346137
  priority: 250,
346043
346138
  enabled: true,
346139
+ routerDelegated: true,
346044
346140
  ...models.length ? { models } : {}
346045
346141
  });
346046
346142
  await writeFile43(join126(configDir, "session.json"), JSON.stringify({
@@ -362683,7 +362779,7 @@ function Onboarding({
362683
362779
  flexDirection: "column",
362684
362780
  children: [
362685
362781
  /* @__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
362782
+ version: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
362783
  }),
362688
362784
  /* @__PURE__ */ jsx_runtime251.jsxs(ThemedBox_default, {
362689
362785
  flexDirection: "column",
@@ -363109,13 +363205,38 @@ function decideTecla(faseT, tecla2, ctx) {
363109
363205
  if (tecla2.return)
363110
363206
  return { tipo: "cerrar-ok" };
363111
363207
  if (esc2)
363112
- return { tipo: "salir" };
363208
+ return { tipo: "cerrar-ok" };
363113
363209
  return null;
363114
363210
  }
363115
363211
  if (faseT === "abriendo")
363116
363212
  return null;
363117
- if (esc2)
363118
- return { tipo: "salir" };
363213
+ if (esc2) {
363214
+ if (faseT === "error") {
363215
+ return {
363216
+ tipo: "salir",
363217
+ mensaje: ctx.mensajeError ?? "No pude completar la recarga. No se cobr\xF3 nada."
363218
+ };
363219
+ }
363220
+ if (faseT === "sin-sesion") {
363221
+ return {
363222
+ tipo: "salir",
363223
+ 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."
363224
+ };
363225
+ }
363226
+ if (faseT === "apagado") {
363227
+ return {
363228
+ tipo: "salir",
363229
+ mensaje: "La recarga no est\xE1 disponible ahora mismo. No se cobr\xF3 nada."
363230
+ };
363231
+ }
363232
+ if (faseT === "sin-confirmar") {
363233
+ return {
363234
+ tipo: "salir",
363235
+ 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."
363236
+ };
363237
+ }
363238
+ return { tipo: "salir", mensaje: "Recarga cancelada. No se cobr\xF3 nada." };
363239
+ }
363119
363240
  return null;
363120
363241
  }
363121
363242
  function Cabecera({ estado }) {
@@ -363379,7 +363500,9 @@ function RecargaUI({
363379
363500
  total: estado?.packs.length ?? 0,
363380
363501
  packsRestantes: estado?.packsRestantes ?? null,
363381
363502
  ...pack ? { nombrePack: pack.nombre, creditos: pack.creditos } : {},
363382
- ...fase.t === "acreditado" ? { saldo: fase.saldoNuevo } : {}
363503
+ ...fase.t === "acreditado" ? { saldo: fase.saldoNuevo } : {},
363504
+ ...fase.t === "error" ? { mensajeError: fase.mensaje } : {},
363505
+ ...fase.t === "sin-confirmar" ? { nombrePack: fase.pack.nombre } : {}
363383
363506
  });
363384
363507
  if (!accion)
363385
363508
  return;
@@ -368070,7 +368193,7 @@ var init_Messages = __esm(() => {
368070
368193
  let t1;
368071
368194
  if ($2[0] === Symbol.for("react.memo_cache_sentinel")) {
368072
368195
  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
368196
+ version: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
368197
  });
368075
368198
  $2[0] = t1;
368076
368199
  } else {
@@ -399939,7 +400062,7 @@ async function captureMemoryDiagnostics(trigger, dumpNumber = 0) {
399939
400062
  smapsRollup,
399940
400063
  platform: process.platform,
399941
400064
  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
400065
+ ccVersion: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
400066
  };
399944
400067
  }
399945
400068
  async function performHeapDump(trigger = "manual", dumpNumber = 0) {
@@ -400700,7 +400823,7 @@ var init_bridge_kick = __esm(() => {
400700
400823
  var call69 = async () => {
400701
400824
  return {
400702
400825
  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
400826
+ value: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.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.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.82", BUILD_TIME: "1970-01-01T00:00:00.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.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
400827
  };
400705
400828
  }, version2, version_default;
400706
400829
  var init_version = __esm(() => {
@@ -403301,7 +403424,7 @@ var SECRET_NAME_PATTERN, EXTRA_ENV_ALLOWLIST, REDACTED2 = "\u2039oculto\u203A",
403301
403424
  const lines = [];
403302
403425
  lines.push("## Entorno de ejecuci\xF3n");
403303
403426
  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";
403427
+ const version3 = { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
403428
  lines.push(`- Versi\xF3n de Theus: ${version3}`);
403306
403429
  lines.push(`- Directorio de trabajo: ${getCwd()}`);
403307
403430
  lines.push(`- \xBFRepositorio git?: ${isGit ? "s\xED" : "no"}`);
@@ -405842,13 +405965,13 @@ async function updateReleaseBundle() {
405842
405965
  await gracefulShutdown(1);
405843
405966
  return;
405844
405967
  }
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})`) + `
405968
+ if (gte({ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
405969
+ writeToStdout(source_default.green(`Theus ya est\xE1 al d\xEDa (${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
405970
  `);
405848
405971
  await gracefulShutdown(0);
405849
405972
  return;
405850
405973
  }
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})
405974
+ writeToStdout(`Nueva versi\xF3n disponible: ${latest} (actual: ${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
405975
  `);
405853
405976
  writeToStdout(`Instalando la actualizaci\xF3n desde theus.pe/dl...
405854
405977
  `);
@@ -405882,7 +406005,7 @@ async function updateReleaseBundle() {
405882
406005
  return;
405883
406006
  }
405884
406007
  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}`) + `
406008
+ writeToStdout(source_default.green(`Actualizado correctamente de ${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
406009
  `);
405887
406010
  await regenerateCompletionCache();
405888
406011
  } finally {
@@ -405895,7 +406018,7 @@ async function updateReleaseBundle() {
405895
406018
  async function update() {
405896
406019
  logEvent("theus_update_check", {});
405897
406020
  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}
406021
+ writeToStdout(`Versi\xF3n actual: ${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
406022
  `);
405900
406023
  const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
405901
406024
  writeToStdout(`Buscando actualizaciones en el canal ${channel2}...
@@ -405974,8 +406097,8 @@ async function update() {
405974
406097
  writeToStdout(`Theus est\xE1 gestionado por Homebrew.
405975
406098
  `);
405976
406099
  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}
406100
+ if (latest && !gte({ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
406101
+ writeToStdout(`Actualizaci\xF3n disponible: ${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
406102
  `);
405980
406103
  writeToStdout(`
405981
406104
  `);
@@ -405991,8 +406114,8 @@ async function update() {
405991
406114
  writeToStdout(`Theus est\xE1 gestionado por winget.
405992
406115
  `);
405993
406116
  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}
406117
+ if (latest && !gte({ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
406118
+ writeToStdout(`Actualizaci\xF3n disponible: ${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
406119
  `);
405997
406120
  writeToStdout(`
405998
406121
  `);
@@ -406008,8 +406131,8 @@ async function update() {
406008
406131
  writeToStdout(`Theus est\xE1 gestionado por apk.
406009
406132
  `);
406010
406133
  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}
406134
+ if (latest && !gte({ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
406135
+ writeToStdout(`Actualizaci\xF3n disponible: ${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
406136
  `);
406014
406137
  writeToStdout(`
406015
406138
  `);
@@ -406074,11 +406197,11 @@ async function update() {
406074
406197
  `);
406075
406198
  await gracefulShutdown(1);
406076
406199
  }
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})`) + `
406200
+ if (result.latestVersion === { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION) {
406201
+ writeToStdout(source_default.green(`Theus ya est\xE1 al d\xEDa (${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
406202
  `);
406080
406203
  } 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}`) + `
406204
+ writeToStdout(source_default.green(`Actualizado correctamente de ${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
406205
  `);
406083
406206
  await regenerateCompletionCache();
406084
406207
  }
@@ -406097,9 +406220,9 @@ async function update() {
406097
406220
  await removeInstalledSymlink();
406098
406221
  }
406099
406222
  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}`);
406223
+ logForDebugging(`update: Package URL: ${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.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
406224
  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`;
406225
+ const npmCommand = `npm view ${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.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
406226
  logForDebugging(`update: Running: ${npmCommand}`);
406104
406227
  const latestVersion = await getLatestVersion(channel2);
406105
406228
  logForDebugging(`update: Latest version from npm: ${latestVersion || "FAILED"}`);
@@ -406119,7 +406242,7 @@ async function update() {
406119
406242
  `);
406120
406243
  process.stderr.write(` \u2022 Un proxy o firewall corporativo bloquea npm
406121
406244
  `);
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")) {
406245
+ if ({ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.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.82", BUILD_TIME: "1970-01-01T00:00:00.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
406246
  process.stderr.write(` \u2022 Compilaci\xF3n interna/de desarrollo no publicada en npm
406124
406247
  `);
406125
406248
  }
@@ -406131,19 +406254,19 @@ async function update() {
406131
406254
  `);
406132
406255
  process.stderr.write(` \u2022 Ejecuta con el flag --debug para m\xE1s detalle
406133
406256
  `);
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";
406257
+ const packageName = { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.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
406258
  process.stderr.write(` \u2022 Comprueba a mano: npm view ${packageName} version
406136
406259
  `);
406137
406260
  process.stderr.write(` \u2022 Comprueba si te falta iniciar sesi\xF3n: npm whoami
406138
406261
  `);
406139
406262
  await gracefulShutdown(1);
406140
406263
  }
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})`) + `
406264
+ if (gte({ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
406265
+ writeToStdout(source_default.green(`Theus ya est\xE1 al d\xEDa (${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
406266
  `);
406144
406267
  await gracefulShutdown(0);
406145
406268
  }
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})
406269
+ writeToStdout(`Nueva versi\xF3n disponible: ${latestVersion} (actual: ${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
406270
  `);
406148
406271
  writeToStdout(`Instalando la actualizaci\xF3n...
406149
406272
  `);
@@ -406188,7 +406311,7 @@ async function update() {
406188
406311
  logForDebugging(`update: Installation status: ${status2}`);
406189
406312
  switch (status2) {
406190
406313
  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}`) + `
406314
+ writeToStdout(source_default.green(`Actualizado correctamente de ${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
406315
  `);
406193
406316
  await regenerateCompletionCache();
406194
406317
  break;
@@ -406198,7 +406321,7 @@ async function update() {
406198
406321
  if (useLocalUpdate) {
406199
406322
  process.stderr.write(`Prueba a actualizar a mano con:
406200
406323
  `);
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}
406324
+ process.stderr.write(` cd ~/.theus/local && npm update ${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.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
406325
  `);
406203
406326
  } else {
406204
406327
  process.stderr.write(`Prueba con sudo o corrige los permisos de npm
@@ -406214,7 +406337,7 @@ async function update() {
406214
406337
  if (useLocalUpdate) {
406215
406338
  process.stderr.write(`Prueba a actualizar a mano con:
406216
406339
  `);
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}
406340
+ process.stderr.write(` cd ~/.theus/local && npm update ${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.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
406341
  `);
406219
406342
  } else {
406220
406343
  process.stderr.write(`O p\xE1sate a la instalaci\xF3n nativa con: theus install
@@ -415639,7 +415762,7 @@ var init_sessionStorage = __esm(() => {
415639
415762
  init_settings2();
415640
415763
  init_slowOperations();
415641
415764
  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;
415765
+ VERSION4 = { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
415766
  MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
415644
415767
  SKIP_FIRST_PROMPT_PATTERN2 = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
415645
415768
  EPHEMERAL_PROGRESS_TYPES = new Set([
@@ -416844,7 +416967,7 @@ var init_filesystem = __esm(() => {
416844
416967
  });
416845
416968
  getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
416846
416969
  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);
416970
+ return join154(getTheusTempDir(), "bundled-skills", { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
416971
  });
416849
416972
  getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
416850
416973
  });
@@ -427160,6 +427283,62 @@ var init_managedEnv = __esm(() => {
427160
427283
  ];
427161
427284
  });
427162
427285
 
427286
+ // utils/instalacionTapada.ts
427287
+ import { accessSync as accessSync2, constants as constants5, realpathSync as realpathSync6 } from "fs";
427288
+ import { delimiter as delimiter4, join as join159 } from "path";
427289
+ function esEjecutable(ruta) {
427290
+ try {
427291
+ accessSync2(ruta, constants5.X_OK);
427292
+ return true;
427293
+ } catch {
427294
+ return false;
427295
+ }
427296
+ }
427297
+ function canonico(ruta) {
427298
+ try {
427299
+ return realpathSync6(ruta);
427300
+ } catch {
427301
+ return ruta;
427302
+ }
427303
+ }
427304
+ function detectarInstalacionTapada(ejecutable, path19, nombres = ["theus"]) {
427305
+ if (!path19)
427306
+ return null;
427307
+ const base2 = ejecutable.split(/[\\/]/).pop()?.toLowerCase() ?? "";
427308
+ const esBinarioTheus = nombres.some((n3) => base2 === n3.toLowerCase());
427309
+ if (!esBinarioTheus)
427310
+ return null;
427311
+ const actualCanonico = canonico(ejecutable);
427312
+ const carpetas = path19.split(delimiter4).filter(Boolean);
427313
+ for (const carpeta of carpetas) {
427314
+ for (const nombre of nombres) {
427315
+ const candidato = join159(carpeta, nombre);
427316
+ if (!esEjecutable(candidato))
427317
+ continue;
427318
+ if (canonico(candidato) === actualCanonico)
427319
+ return null;
427320
+ return { ganador: candidato, actual: ejecutable };
427321
+ }
427322
+ }
427323
+ return null;
427324
+ }
427325
+ function mensajeInstalacionTapada(c5) {
427326
+ return [
427327
+ "Tienes dos instalaciones de Theus y el sistema esta usando la otra.",
427328
+ "",
427329
+ ` se ejecuta: ${c5.ganador}`,
427330
+ ` esta version: ${c5.actual}`,
427331
+ "",
427332
+ "El sistema elige la primera que encuentra en el PATH, no la mas reciente.",
427333
+ "Para quedarte solo con una:",
427334
+ "",
427335
+ " npm rm -g theus-cli si la vieja vino del gestor de paquetes",
427336
+ ` rm ${c5.ganador} si la pusiste a mano`
427337
+ ].join(`
427338
+ `);
427339
+ }
427340
+ var init_instalacionTapada = () => {};
427341
+
427163
427342
  // upstreamproxy/relay.ts
427164
427343
  import { createServer as createServer8 } from "net";
427165
427344
  function encodeChunk(data) {
@@ -427447,7 +427626,7 @@ __export(exports_upstreamproxy, {
427447
427626
  });
427448
427627
  import { mkdir as mkdir49, readFile as readFile61, unlink as unlink24, writeFile as writeFile50 } from "fs/promises";
427449
427628
  import { homedir as homedir41 } from "os";
427450
- import { join as join159 } from "path";
427629
+ import { join as join160 } from "path";
427451
427630
  async function initUpstreamProxy(opts) {
427452
427631
  if (!isEnvTruthy(process.env.THEUS_CODE_REMOTE)) {
427453
427632
  return state;
@@ -427468,7 +427647,7 @@ async function initUpstreamProxy(opts) {
427468
427647
  }
427469
427648
  setNonDumpable();
427470
427649
  const baseUrl = opts?.ccrBaseUrl ?? process.env.THEUS_BASE_URL ?? "https://api.theus.pe";
427471
- const caBundlePath = opts?.caBundlePath ?? join159(homedir41(), ".ccr", "ca-bundle.crt");
427650
+ const caBundlePath = opts?.caBundlePath ?? join160(homedir41(), ".ccr", "ca-bundle.crt");
427472
427651
  const caOk = await downloadCaBundle(baseUrl, opts?.systemCaPath ?? SYSTEM_CA_BUNDLE, caBundlePath);
427473
427652
  if (!caOk)
427474
427653
  return state;
@@ -427569,7 +427748,7 @@ async function downloadCaBundle(baseUrl, systemCaPath, outPath) {
427569
427748
  }
427570
427749
  const ccrCa = await resp.text();
427571
427750
  const systemCa = await readFile61(systemCaPath, "utf8").catch(() => "");
427572
- await mkdir49(join159(outPath, ".."), { recursive: true });
427751
+ await mkdir49(join160(outPath, ".."), { recursive: true });
427573
427752
  await writeFile50(outPath, systemCa + `
427574
427753
  ` + ccrCa, "utf8");
427575
427754
  return true;
@@ -427879,6 +428058,7 @@ var init_init2 = __esm(() => {
427879
428058
  init_proxy();
427880
428059
  init_betaSessionTracing();
427881
428060
  init_telemetryAttributes();
428061
+ init_instalacionTapada();
427882
428062
  init_windowsPaths();
427883
428063
  init = memoize_default(async () => {
427884
428064
  const initStartTime = Date.now();
@@ -427950,6 +428130,14 @@ var init_init2 = __esm(() => {
427950
428130
  }
427951
428131
  }
427952
428132
  setShellIfWindows();
428133
+ try {
428134
+ const tapada = detectarInstalacionTapada(process.execPath, process.env.PATH, process.platform === "win32" ? ["theus.exe", "theus.cmd", "theus"] : ["theus"]);
428135
+ if (tapada) {
428136
+ console.error(`
428137
+ ${mensajeInstalacionTapada(tapada)}
428138
+ `);
428139
+ }
428140
+ } catch {}
427953
428141
  registerCleanup(shutdownLspServerManager);
427954
428142
  registerCleanup(async () => {
427955
428143
  const { cleanupSessionTeams: cleanupSessionTeams2 } = await Promise.resolve().then(() => (init_teamHelpers(), exports_teamHelpers));
@@ -428005,7 +428193,7 @@ import {
428005
428193
  } from "fs/promises";
428006
428194
  import { createServer as createServer9 } from "net";
428007
428195
  import { platform as platform6 } from "os";
428008
- import { join as join160 } from "path";
428196
+ import { join as join161 } from "path";
428009
428197
  function log(message, ...args) {
428010
428198
  if (LOG_FILE) {
428011
428199
  const timestamp2 = new Date().toISOString();
@@ -428072,7 +428260,7 @@ class ChromeNativeHost {
428072
428260
  try {
428073
428261
  process.kill(pid, 0);
428074
428262
  } catch {
428075
- await unlink25(join160(socketDir, file2)).catch(() => {});
428263
+ await unlink25(join161(socketDir, file2)).catch(() => {});
428076
428264
  log(`Removed stale socket for PID ${pid}`);
428077
428265
  }
428078
428266
  }
@@ -429021,7 +429209,7 @@ async function handleMemories(state2) {
429021
429209
  async function runProjectContextMcpServer() {
429022
429210
  const projectRoot = process.env.THEUS_PROJECT_ROOT || process.cwd();
429023
429211
  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: {} } });
429212
+ const server2 = new Server({ name: SERVER_NAME, version: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
429213
  server2.setRequestHandler(ListToolsRequestSchema, async () => ({
429026
429214
  tools: TOOL_DEFINITIONS.map((t) => ({
429027
429215
  name: t.name,
@@ -429149,10 +429337,10 @@ var init_server3 = __esm(() => {
429149
429337
  import { execFile as execFile8 } from "child_process";
429150
429338
  import { existsSync as existsSync26, mkdirSync as mkdirSync12, readFileSync as readFileSync30, statSync as statSync14, unlinkSync as unlinkSync3, writeFileSync as writeFileSync10 } from "fs";
429151
429339
  import { homedir as homedir43, tmpdir as tmpdir13 } from "os";
429152
- import { join as join161 } from "path";
429340
+ import { join as join162 } from "path";
429153
429341
  import { promisify as promisify6 } from "util";
429154
429342
  function cuDir() {
429155
- const dir = join161(homedir43(), ".theus", "cu");
429343
+ const dir = join162(homedir43(), ".theus", "cu");
429156
429344
  if (!existsSync26(dir))
429157
429345
  mkdirSync12(dir, { recursive: true });
429158
429346
  return dir;
@@ -429200,7 +429388,7 @@ async function getScreenGeometry(force = false) {
429200
429388
  return cachedGeometry;
429201
429389
  }
429202
429390
  async function checkPermissions() {
429203
- const probe = join161(tmpdir13(), `theus-cu-probe-${process.pid}.jpg`);
429391
+ const probe = join162(tmpdir13(), `theus-cu-probe-${process.pid}.jpg`);
429204
429392
  const cap = await run6(SCREENCAPTURE, ["-x", "-t", "jpg", probe], { timeoutMs: 8000 });
429205
429393
  const screenRecording = existsSync26(probe) && (() => {
429206
429394
  try {
@@ -429229,8 +429417,8 @@ async function checkPermissions() {
429229
429417
  async function captureScreenshot(opts = {}) {
429230
429418
  const maxSide = opts.maxSide ?? 1400;
429231
429419
  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`);
429420
+ const raw = join162(cuDir(), `shot-${process.pid}.png`);
429421
+ const out = join162(cuDir(), `shot-${process.pid}.jpg`);
429234
429422
  const capArgs = ["-x", "-t", "png", "-o"];
429235
429423
  if (opts.displayIndex && opts.displayIndex > 0)
429236
429424
  capArgs.push("-D", String(opts.displayIndex));
@@ -429394,8 +429582,8 @@ async function ensureScrollHelper() {
429394
429582
  return scrollBinPromise;
429395
429583
  scrollBinPromise = (async () => {
429396
429584
  if (!existsSync26(SWIFTC) && SWIFTC === "swiftc") {}
429397
- const src = join161(cuDir(), "scroll.swift");
429398
- const bin = join161(cuDir(), "theus-cu-scroll");
429585
+ const src = join162(cuDir(), "scroll.swift");
429586
+ const bin = join162(cuDir(), "theus-cu-scroll");
429399
429587
  if (existsSync26(bin))
429400
429588
  return bin;
429401
429589
  try {
@@ -429726,7 +429914,7 @@ __export(exports_selftest, {
429726
429914
  runComputerUseSelfTest: () => runComputerUseSelfTest
429727
429915
  });
429728
429916
  import { existsSync as existsSync27, writeFileSync as writeFileSync11 } from "fs";
429729
- import { join as join162 } from "path";
429917
+ import { join as join163 } from "path";
429730
429918
  import { homedir as homedir44 } from "os";
429731
429919
  async function runComputerUseSelfTest() {
429732
429920
  let pass = 0;
@@ -429778,7 +429966,7 @@ Geometr\xEDa y captura:`);
429778
429966
  let captureOk = false;
429779
429967
  try {
429780
429968
  const shot = await captureScreenshot();
429781
- const outPath = join162(homedir44(), ".theus", "cu", "selftest-shot.jpg");
429969
+ const outPath = join163(homedir44(), ".theus", "cu", "selftest-shot.jpg");
429782
429970
  writeFileSync11(outPath, Buffer.from(shot.base64, "base64"));
429783
429971
  ok2(`Captura ${shot.width}\xD7${shot.height} px, ${Math.round(shot.base64.length * 0.75 / 1024)} KB \u2192 ${outPath}`);
429784
429972
  captureOk = true;
@@ -430624,7 +430812,7 @@ var init_executor = __esm(() => {
430624
430812
  });
430625
430813
 
430626
430814
  // services/titanFleet/tokenStore.ts
430627
- import { constants as constants5 } from "fs";
430815
+ import { constants as constants6 } from "fs";
430628
430816
  import { randomUUID as randomUUID38 } from "crypto";
430629
430817
  import {
430630
430818
  chmod as chmod13,
@@ -430680,7 +430868,7 @@ async function saveFleetCredentials(value, path19 = defaultFleetCredentialsPath(
430680
430868
  await chmod13(directory, 448);
430681
430869
  await rejectSymlink(path19);
430682
430870
  const temp = `${path19}.tmp-${process.pid}-${randomUUID38()}`;
430683
- const flags = constants5.O_WRONLY | constants5.O_CREAT | constants5.O_EXCL | (constants5.O_NOFOLLOW ?? 0);
430871
+ const flags = constants6.O_WRONLY | constants6.O_CREAT | constants6.O_EXCL | (constants6.O_NOFOLLOW ?? 0);
430684
430872
  const handle2 = await open23(temp, flags, 384);
430685
430873
  try {
430686
430874
  await handle2.writeFile(`${JSON.stringify(parsed, null, 2)}
@@ -430712,7 +430900,7 @@ var init_tokenStore = __esm(() => {
430712
430900
  });
430713
430901
 
430714
430902
  // services/titanFleet/outbox.ts
430715
- import { constants as constants6 } from "fs";
430903
+ import { constants as constants7 } from "fs";
430716
430904
  import { createHash as createHash33, randomUUID as randomUUID39 } from "crypto";
430717
430905
  import {
430718
430906
  chmod as chmod14,
@@ -430848,7 +431036,7 @@ async function writeRecords(path19, records) {
430848
431036
  await chmod14(directory, 448);
430849
431037
  await rejectSymlink2(path19);
430850
431038
  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);
431039
+ const handle2 = await open24(temp, constants7.O_WRONLY | constants7.O_CREAT | constants7.O_EXCL | (constants7.O_NOFOLLOW ?? 0), 384);
430852
431040
  try {
430853
431041
  await handle2.writeFile(serialized, "utf8");
430854
431042
  await handle2.sync();
@@ -430859,7 +431047,7 @@ async function writeRecords(path19, records) {
430859
431047
  await chmod14(temp, 384);
430860
431048
  await rename11(temp, path19);
430861
431049
  await chmod14(path19, 384);
430862
- const directoryHandle = await open24(directory, constants6.O_RDONLY);
431050
+ const directoryHandle = await open24(directory, constants7.O_RDONLY);
430863
431051
  try {
430864
431052
  await directoryHandle.sync();
430865
431053
  } finally {
@@ -431698,7 +431886,7 @@ async function runTitanFleetWorker(args) {
431698
431886
  max_concurrency: maxConcurrency,
431699
431887
  runtime: {
431700
431888
  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
431889
+ version: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
431890
  }
431703
431891
  });
431704
431892
  const client2 = new TitanFleetClient({
@@ -432420,9 +432608,9 @@ var init_titan_fleet_run = __esm(() => {
432420
432608
 
432421
432609
  // utils/cronTasksLock.ts
432422
432610
  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";
432611
+ import { dirname as dirname67, join as join164 } from "path";
432424
432612
  function getLockPath(dir) {
432425
- return join163(dir ?? getProjectRoot(), LOCK_FILE_REL);
432613
+ return join164(dir ?? getProjectRoot(), LOCK_FILE_REL);
432426
432614
  }
432427
432615
  async function readLock(dir) {
432428
432616
  let raw;
@@ -432528,7 +432716,7 @@ var init_cronTasksLock = __esm(() => {
432528
432716
  init_genericProcessUtils();
432529
432717
  init_json();
432530
432718
  init_slowOperations();
432531
- LOCK_FILE_REL = join163(".theus", "scheduled_tasks.lock");
432719
+ LOCK_FILE_REL = join164(".theus", "scheduled_tasks.lock");
432532
432720
  schedulerLockSchema = lazySchema(() => exports_external.object({
432533
432721
  sessionId: exports_external.string(),
432534
432722
  pid: exports_external.number(),
@@ -432836,10 +433024,10 @@ import {
432836
433024
  writeFileSync as writeFileSync12
432837
433025
  } from "fs";
432838
433026
  import { homedir as homedir47 } from "os";
432839
- import { dirname as dirname68, join as join164 } from "path";
433027
+ import { dirname as dirname68, join as join165 } from "path";
432840
433028
  import { fileURLToPath as fileURLToPath7 } from "url";
432841
433029
  function projectsConfigPath() {
432842
- return join164(homedir47(), ".theus", "daemon", "projects.json");
433030
+ return join165(homedir47(), ".theus", "daemon", "projects.json");
432843
433031
  }
432844
433032
  function readEnabledProjects() {
432845
433033
  let raw;
@@ -432858,17 +433046,17 @@ function readEnabledProjects() {
432858
433046
  return list3.filter((p) => p && typeof p.dir === "string" && p.enabled !== false);
432859
433047
  }
432860
433048
  function daemonDir2() {
432861
- return join164(homedir47(), ".theus", "daemon");
433049
+ return join165(homedir47(), ".theus", "daemon");
432862
433050
  }
432863
433051
  function daemonLogPath() {
432864
- return join164(daemonDir2(), "daemon.log");
433052
+ return join165(daemonDir2(), "daemon.log");
432865
433053
  }
432866
433054
  function resolveWorkerBin() {
432867
433055
  const override = process.env.THEUS_DAEMON_WORKER_BIN;
432868
433056
  if (typeof override === "string" && override.length > 0)
432869
433057
  return override;
432870
433058
  const here = dirname68(fileURLToPath7(import.meta.url));
432871
- return join164(here, "..", "bin", "theus");
433059
+ return join165(here, "..", "bin", "theus");
432872
433060
  }
432873
433061
  function turnTimeoutMs() {
432874
433062
  const raw = process.env.THEUS_DAEMON_TURN_TIMEOUT_MS;
@@ -432901,10 +433089,10 @@ function logDaemonLine(line) {
432901
433089
  }
432902
433090
  function writeRunHistory(record3) {
432903
433091
  try {
432904
- const dir = join164(daemonDir2(), "runs", record3.taskId);
433092
+ const dir = join165(daemonDir2(), "runs", record3.taskId);
432905
433093
  mkdirSync13(dir, { recursive: true });
432906
433094
  const stamp2 = record3.startedAt.replace(/:/g, "-");
432907
- writeFileSync12(join164(dir, `${stamp2}.json`), JSON.stringify(record3, null, 2), "utf8");
433095
+ writeFileSync12(join165(dir, `${stamp2}.json`), JSON.stringify(record3, null, 2), "utf8");
432908
433096
  pruneRunHistory(record3.taskId);
432909
433097
  } catch (e) {
432910
433098
  logDaemonLine(`[daemon:cron] ERROR guardando historial task=${record3.taskId}: ${e?.message}`);
@@ -432915,13 +433103,13 @@ function pruneRunHistory(taskId) {
432915
433103
  const raw = process.env.THEUS_DAEMON_RUNS_KEEP;
432916
433104
  const parsed = raw ? Number.parseInt(raw, 10) : NaN;
432917
433105
  const keep = Number.isInteger(parsed) && parsed > 0 ? parsed : 50;
432918
- const dir = join164(daemonDir2(), "runs", taskId);
433106
+ const dir = join165(daemonDir2(), "runs", taskId);
432919
433107
  const files2 = readdirSync5(dir).filter((f) => f.endsWith(".json")).sort();
432920
433108
  if (files2.length <= keep)
432921
433109
  return;
432922
433110
  for (const f of files2.slice(0, files2.length - keep)) {
432923
433111
  try {
432924
- unlinkSync4(join164(dir, f));
433112
+ unlinkSync4(join165(dir, f));
432925
433113
  } catch {}
432926
433114
  }
432927
433115
  } catch {}
@@ -433111,15 +433299,15 @@ import {
433111
433299
  writeFileSync as writeFileSync13
433112
433300
  } from "fs";
433113
433301
  import { homedir as homedir48 } from "os";
433114
- import { dirname as dirname69, join as join165 } from "path";
433302
+ import { dirname as dirname69, join as join166 } from "path";
433115
433303
  function daemonDir3() {
433116
- return join165(homedir48(), ".theus", "daemon");
433304
+ return join166(homedir48(), ".theus", "daemon");
433117
433305
  }
433118
433306
  function pidFilePath() {
433119
- return join165(daemonDir3(), "theus-daemon.pid");
433307
+ return join166(daemonDir3(), "theus-daemon.pid");
433120
433308
  }
433121
433309
  function logFilePath() {
433122
- return join165(daemonDir3(), "daemon.log");
433310
+ return join166(daemonDir3(), "daemon.log");
433123
433311
  }
433124
433312
  function ensureDaemonDir() {
433125
433313
  mkdirSync14(daemonDir3(), { recursive: true });
@@ -433217,7 +433405,7 @@ function resolveTheusBin() {
433217
433405
  return "theus";
433218
433406
  }
433219
433407
  function macosServiceSpec() {
433220
- const path19 = join165(homedir48(), "Library", "LaunchAgents", "pe.theus.daemon.plist");
433408
+ const path19 = join166(homedir48(), "Library", "LaunchAgents", "pe.theus.daemon.plist");
433221
433409
  const bin = resolveTheusBin();
433222
433410
  const logDir = daemonDir3();
433223
433411
  const content = `<?xml version="1.0" encoding="UTF-8"?>
@@ -433244,9 +433432,9 @@ function macosServiceSpec() {
433244
433432
  <key>KeepAlive</key>
433245
433433
  <true/>
433246
433434
  <key>StandardOutPath</key>
433247
- <string>${join165(logDir, "launchd.out.log")}</string>
433435
+ <string>${join166(logDir, "launchd.out.log")}</string>
433248
433436
  <key>StandardErrorPath</key>
433249
- <string>${join165(logDir, "launchd.err.log")}</string>
433437
+ <string>${join166(logDir, "launchd.err.log")}</string>
433250
433438
  </dict>
433251
433439
  </plist>
433252
433440
  `;
@@ -433261,7 +433449,7 @@ function macosServiceSpec() {
433261
433449
  };
433262
433450
  }
433263
433451
  function linuxServiceSpec() {
433264
- const path19 = join165(homedir48(), ".config", "systemd", "user", "theus-daemon.service");
433452
+ const path19 = join166(homedir48(), ".config", "systemd", "user", "theus-daemon.service");
433265
433453
  const bin = resolveTheusBin();
433266
433454
  const content = `[Unit]
433267
433455
  Description=Theus daemon (cron/agent supervisor)
@@ -433589,7 +433777,7 @@ function createBridgeLogger(options2) {
433589
433777
  connectUrl = buildBridgeConnectUrl(environmentId, cachedIngressUrl);
433590
433778
  regenerateQr(connectUrl);
433591
433779
  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}
433780
+ write(source_default.dim(`Remote Control`) + ` v${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
433781
  `);
433594
433782
  }
433595
433783
  if (verbose) {
@@ -433997,7 +434185,7 @@ var init_pollConfig = __esm(() => {
433997
434185
  import { spawn as spawn13 } from "child_process";
433998
434186
  import { createWriteStream as createWriteStream4 } from "fs";
433999
434187
  import { tmpdir as tmpdir14 } from "os";
434000
- import { dirname as dirname70, join as join166 } from "path";
434188
+ import { dirname as dirname70, join as join167 } from "path";
434001
434189
  import { createInterface } from "readline";
434002
434190
  function safeFilenameId(id2) {
434003
434191
  return id2.replace(/[^a-zA-Z0-9_-]/g, "_");
@@ -434130,12 +434318,12 @@ function createSessionSpawner(deps) {
434130
434318
  debugFile = `${deps.debugFile}-${safeId}`;
434131
434319
  }
434132
434320
  } else if (deps.verbose || false) {
434133
- debugFile = join166(tmpdir14(), "theus", `bridge-session-${safeId}.log`);
434321
+ debugFile = join167(tmpdir14(), "theus", `bridge-session-${safeId}.log`);
434134
434322
  }
434135
434323
  let transcriptStream = null;
434136
434324
  let transcriptPath;
434137
434325
  if (deps.debugFile) {
434138
- transcriptPath = join166(dirname70(deps.debugFile), `bridge-transcript-${safeId}.jsonl`);
434326
+ transcriptPath = join167(dirname70(deps.debugFile), `bridge-transcript-${safeId}.jsonl`);
434139
434327
  transcriptStream = createWriteStream4(transcriptPath, { flags: "a" });
434140
434328
  transcriptStream.on("error", (err2) => {
434141
434329
  deps.onDebug(`[bridge:session] Transcript write error: ${err2.message}`);
@@ -434409,9 +434597,9 @@ __export(exports_bridgePointer, {
434409
434597
  BRIDGE_POINTER_TTL_MS: () => BRIDGE_POINTER_TTL_MS
434410
434598
  });
434411
434599
  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";
434600
+ import { dirname as dirname71, join as join168 } from "path";
434413
434601
  function getBridgePointerPath(dir) {
434414
- return join167(getProjectsDir(), sanitizePath2(dir), "bridge-pointer.json");
434602
+ return join168(getProjectsDir(), sanitizePath2(dir), "bridge-pointer.json");
434415
434603
  }
434416
434604
  async function writeBridgePointer(dir, pointer) {
434417
434605
  const path19 = getBridgePointerPath(dir);
@@ -434513,12 +434701,12 @@ var init_bridgePointer = __esm(() => {
434513
434701
  });
434514
434702
 
434515
434703
  // utils/errorLogSink.ts
434516
- import { dirname as dirname72, join as join168 } from "path";
434704
+ import { dirname as dirname72, join as join169 } from "path";
434517
434705
  function getErrorsPath() {
434518
- return join168(CACHE_PATHS.errors(), DATE + ".jsonl");
434706
+ return join169(CACHE_PATHS.errors(), DATE + ".jsonl");
434519
434707
  }
434520
434708
  function getMCPLogsPath(serverName) {
434521
- return join168(CACHE_PATHS.mcpLogs(serverName), DATE + ".jsonl");
434709
+ return join169(CACHE_PATHS.mcpLogs(serverName), DATE + ".jsonl");
434522
434710
  }
434523
434711
  function createJsonlWriter(options2) {
434524
434712
  const writer = createBufferedWriter(options2);
@@ -434562,7 +434750,7 @@ function appendToLog(path19, message) {
434562
434750
  cwd: getFsImplementation().cwd(),
434563
434751
  userType: "external",
434564
434752
  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
434753
+ version: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
434754
  };
434567
434755
  getLogWriter(path19).write(messageWithTimestamp);
434568
434756
  }
@@ -434674,7 +434862,7 @@ __export(exports_bridgeMain, {
434674
434862
  });
434675
434863
  import { randomUUID as randomUUID42 } from "crypto";
434676
434864
  import { hostname as hostname4, tmpdir as tmpdir15 } from "os";
434677
- import { basename as basename51, join as join169, resolve as resolve57 } from "path";
434865
+ import { basename as basename51, join as join170, resolve as resolve57 } from "path";
434678
434866
  async function isMultiSessionSpawnEnabled() {
434679
434867
  return checkGate_CACHED_OR_BLOCKING("theus_ccr_bridge_multi_session");
434680
434868
  }
@@ -435187,7 +435375,7 @@ async function runBridgeLoop(config3, environmentId, environmentSecret, api2, sp
435187
435375
  sessionDebugFile = `${config3.debugFile}-${safeId}`;
435188
435376
  }
435189
435377
  } else if (config3.verbose || false) {
435190
- sessionDebugFile = join169(tmpdir15(), "theus", `bridge-session-${safeId}.log`);
435378
+ sessionDebugFile = join170(tmpdir15(), "theus", `bridge-session-${safeId}.log`);
435191
435379
  }
435192
435380
  if (sessionDebugFile) {
435193
435381
  logger.logVerbose(`Debug log: ${sessionDebugFile}`);
@@ -435823,7 +436011,7 @@ Spawn mode for this project:
435823
436011
  const api2 = createBridgeApiClient({
435824
436012
  baseUrl,
435825
436013
  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,
436014
+ runnerVersion: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
436015
  onDebug: logForDebugging,
435828
436016
  onAuth401: handleOAuth401Error2,
435829
436017
  getTrustedDeviceToken
@@ -436061,7 +436249,7 @@ async function runBridgeHeadless(opts, signal) {
436061
436249
  const api2 = createBridgeApiClient({
436062
436250
  baseUrl,
436063
436251
  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,
436252
+ runnerVersion: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
436253
  onDebug: log2,
436066
436254
  onAuth401: opts.onAuth401,
436067
436255
  getTrustedDeviceToken
@@ -439353,7 +439541,7 @@ function buildSystemInitMessage(inputs) {
439353
439541
  slash_commands: inputs.commands.filter((c5) => c5.userInvocable !== false).map((c5) => c5.name),
439354
439542
  apiKeySource: getTheusApiKeyWithSource().source,
439355
439543
  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,
439544
+ theus_code_version: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
439545
  output_style: outputStyle2,
439358
439546
  agents: inputs.agents.map((agent) => agent.agentType),
439359
439547
  skills: inputs.skills.filter((s) => s.userInvocable !== false).map((skill) => skill.name),
@@ -439393,8 +439581,8 @@ async function getEnvLessBridgeConfig() {
439393
439581
  }
439394
439582
  async function checkEnvLessBridgeMinVersion() {
439395
439583
  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.
439584
+ if (cfg.min_version && lt({ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
439585
+ return `Your version of Theus (${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
439586
  Version ${cfg.min_version} or higher is required. Run \`theus update\` to update.`;
439399
439587
  }
439400
439588
  return null;
@@ -441718,7 +441906,7 @@ async function initBridgeCore(params) {
441718
441906
  const rawApi = createBridgeApiClient({
441719
441907
  baseUrl,
441720
441908
  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,
441909
+ runnerVersion: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
441910
  onDebug: logForDebugging,
441723
441911
  onAuth401,
441724
441912
  getTrustedDeviceToken
@@ -443552,7 +443740,7 @@ __export(exports_inboundAttachments, {
443552
443740
  });
443553
443741
  import { randomUUID as randomUUID47 } from "crypto";
443554
443742
  import { mkdir as mkdir55, writeFile as writeFile53 } from "fs/promises";
443555
- import { basename as basename52, join as join170 } from "path";
443743
+ import { basename as basename52, join as join171 } from "path";
443556
443744
  function debug2(msg) {
443557
443745
  logForDebugging(`[bridge:inbound-attach] ${msg}`);
443558
443746
  }
@@ -443568,7 +443756,7 @@ function sanitizeFileName(name) {
443568
443756
  return base2 || "attachment";
443569
443757
  }
443570
443758
  function uploadsDir() {
443571
- return join170(getTheusConfigHomeDir(), "uploads", getSessionId());
443759
+ return join171(getTheusConfigHomeDir(), "uploads", getSessionId());
443572
443760
  }
443573
443761
  async function resolveOne(att) {
443574
443762
  const token = getBridgeAccessToken();
@@ -443597,7 +443785,7 @@ async function resolveOne(att) {
443597
443785
  const safeName = sanitizeFileName(att.file_name);
443598
443786
  const prefix = (att.file_uuid.slice(0, 8) || randomUUID47().slice(0, 8)).replace(/[^a-zA-Z0-9_-]/g, "_");
443599
443787
  const dir = uploadsDir();
443600
- const outPath = join170(dir, `${prefix}-${safeName}`);
443788
+ const outPath = join171(dir, `${prefix}-${safeName}`);
443601
443789
  try {
443602
443790
  await mkdir55(dir, { recursive: true });
443603
443791
  await writeFile53(outPath, data);
@@ -450457,7 +450645,7 @@ var init_ShowInIDEPrompt = __esm(() => {
450457
450645
 
450458
450646
  // components/permissions/FilePermissionDialog/permissionOptions.tsx
450459
450647
  import { homedir as homedir49 } from "os";
450460
- import { basename as basename56, join as join171, sep as sep34 } from "path";
450648
+ import { basename as basename56, join as join172, sep as sep34 } from "path";
450461
450649
  function isInTheusFolder(filePath) {
450462
450650
  const absolutePath = expandPath(filePath);
450463
450651
  const theusFolderPath = expandPath(`${getOriginalCwd()}/.theus`);
@@ -450467,7 +450655,7 @@ function isInTheusFolder(filePath) {
450467
450655
  }
450468
450656
  function isInGlobalTheusFolder(filePath) {
450469
450657
  const absolutePath = expandPath(filePath);
450470
- const globalTheusFolderPath = join171(homedir49(), ".theus");
450658
+ const globalTheusFolderPath = join172(homedir49(), ".theus");
450471
450659
  const normalizedAbsolutePath = normalizeCaseForComparison(absolutePath);
450472
450660
  const normalizedGlobalTheusFolderPath = normalizeCaseForComparison(globalTheusFolderPath);
450473
450661
  return normalizedAbsolutePath.startsWith(normalizedGlobalTheusFolderPath + sep34.toLowerCase()) || normalizedAbsolutePath.startsWith(normalizedGlobalTheusFolderPath + "/");
@@ -458359,7 +458547,7 @@ var init_useVoiceEnabled = __esm(() => {
458359
458547
  function getSemverPart(version3) {
458360
458548
  return `${import_semver11.major(version3, { loose: true })}.${import_semver11.minor(version3, { loose: true })}.${import_semver11.patch(version3, { loose: true })}`;
458361
458549
  }
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) {
458550
+ function useUpdateNotification(updatedVersion, initialVersion = { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
458551
  const [lastNotifiedSemver, setLastNotifiedSemver] = import_react235.useState(() => getSemverPart(initialVersion));
458364
458552
  if (!updatedVersion) {
458365
458553
  return null;
@@ -458399,7 +458587,7 @@ function AutoUpdater({
458399
458587
  return;
458400
458588
  }
458401
458589
  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;
458590
+ const currentVersion = { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
458591
  const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
458404
458592
  let latestVersion = await getLatestVersion(channel2);
458405
458593
  const isDisabled2 = isAutoUpdaterDisabled();
@@ -458534,7 +458722,7 @@ function AutoUpdater({
458534
458722
  " ",
458535
458723
  /* @__PURE__ */ jsx_runtime415.jsx(ThemedText, {
458536
458724
  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}`
458725
+ children: hasLocalInstall ? `cd ~/.theus/local && npm update ${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.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.82", BUILD_TIME: "1970-01-01T00:00:00.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
458726
  })
458539
458727
  ]
458540
458728
  })
@@ -458611,12 +458799,12 @@ function NativeAutoUpdater({
458611
458799
  logEvent("theus_native_auto_updater_start", {});
458612
458800
  try {
458613
458801
  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)) {
458802
+ if (maxVersion && gt({ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
458803
  const msg = await getMaxVersionMessage();
458616
458804
  setMaxVersionIssue(msg ?? "affects your version");
458617
458805
  }
458618
458806
  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;
458807
+ const currentVersion = { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
458808
  const latencyMs = Date.now() - startTime2;
458621
458809
  if (result.lockFailed) {
458622
458810
  logEvent("theus_native_auto_updater_lock_contention", {
@@ -458753,17 +458941,17 @@ function PackageManagerAutoUpdater(t0) {
458753
458941
  const maxVersion = await getMaxVersion();
458754
458942
  if (maxVersion && latest && gt(latest, maxVersion)) {
458755
458943
  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`);
458944
+ if (gte({ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
458945
+ logForDebugging(`PackageManagerAutoUpdater: current version ${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
458946
  setUpdateAvailable(false);
458759
458947
  return;
458760
458948
  }
458761
458949
  latest = maxVersion;
458762
458950
  }
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);
458951
+ const hasUpdate = latest && !gte({ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
458952
  setUpdateAvailable(!!hasUpdate);
458765
458953
  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}`);
458954
+ logForDebugging(`PackageManagerAutoUpdater: Update available ${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
458955
  }
458768
458956
  };
458769
458957
  $2[0] = t1;
@@ -458797,7 +458985,7 @@ function PackageManagerAutoUpdater(t0) {
458797
458985
  wrap: "truncate",
458798
458986
  children: [
458799
458987
  "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
458988
+ { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
458989
  ]
458802
458990
  });
458803
458991
  $2[3] = verbose;
@@ -466660,7 +466848,7 @@ function buildStatusLineCommandInput(permissionMode2, exceeds200kTokens, setting
466660
466848
  project_dir: getOriginalCwd(),
466661
466849
  added_dirs: addedDirs
466662
466850
  },
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,
466851
+ version: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
466852
  output_style: {
466665
466853
  name: outputStyleName
466666
466854
  },
@@ -472648,9 +472836,9 @@ function initSkillImprovement() {
472648
472836
  async function applySkillImprovement(skillName, updates) {
472649
472837
  if (!skillName)
472650
472838
  return;
472651
- const { join: join172 } = await import("path");
472839
+ const { join: join173 } = await import("path");
472652
472840
  const fs5 = await import("fs/promises");
472653
- const filePath = join172(getCwd(), ".theus", "skills", skillName, "SKILL.md");
472841
+ const filePath = join173(getCwd(), ".theus", "skills", skillName, "SKILL.md");
472654
472842
  let currentContent;
472655
472843
  try {
472656
472844
  currentContent = await fs5.readFile(filePath, "utf-8");
@@ -472802,7 +472990,7 @@ function useMoreRight(_args) {
472802
472990
  }
472803
472991
 
472804
472992
  // utils/cleanup.ts
472805
- import { join as join172 } from "path";
472993
+ import { join as join173 } from "path";
472806
472994
  function getCutoffDate() {
472807
472995
  const settings = getSettings_DEPRECATED() || {};
472808
472996
  const cleanupPeriodDays = settings.cleanupPeriodDays ?? DEFAULT_CLEANUP_PERIOD_DAYS;
@@ -472827,7 +473015,7 @@ async function cleanupOldFilesInDirectory(dirPath, cutoffDate, isMessagePath) {
472827
473015
  try {
472828
473016
  const timestamp2 = convertFileNameToDate(file2.name);
472829
473017
  if (timestamp2 < cutoffDate) {
472830
- await getFsImplementation().unlink(join172(dirPath, file2.name));
473018
+ await getFsImplementation().unlink(join173(dirPath, file2.name));
472831
473019
  if (isMessagePath) {
472832
473020
  result.messages++;
472833
473021
  } else {
@@ -472858,7 +473046,7 @@ async function cleanupOldMessageFiles() {
472858
473046
  } catch {
472859
473047
  return result;
472860
473048
  }
472861
- const mcpLogDirs = dirents.filter((dirent) => dirent.isDirectory() && dirent.name.startsWith("mcp-logs-")).map((dirent) => join172(baseCachePath, dirent.name));
473049
+ const mcpLogDirs = dirents.filter((dirent) => dirent.isDirectory() && dirent.name.startsWith("mcp-logs-")).map((dirent) => join173(baseCachePath, dirent.name));
472862
473050
  for (const mcpLogDir of mcpLogDirs) {
472863
473051
  result = addCleanupResults(result, await cleanupOldFilesInDirectory(mcpLogDir, cutoffDate, true));
472864
473052
  await tryRmdir(mcpLogDir, fsImpl);
@@ -472897,7 +473085,7 @@ async function cleanupOldSessionFiles() {
472897
473085
  for (const projectDirent of projectDirents) {
472898
473086
  if (!projectDirent.isDirectory())
472899
473087
  continue;
472900
- const projectDir = join172(projectsDir, projectDirent.name);
473088
+ const projectDir = join173(projectsDir, projectDirent.name);
472901
473089
  let entries;
472902
473090
  try {
472903
473091
  entries = await fsImpl.readdir(projectDir);
@@ -472911,15 +473099,15 @@ async function cleanupOldSessionFiles() {
472911
473099
  continue;
472912
473100
  }
472913
473101
  try {
472914
- if (await unlinkIfOld(join172(projectDir, entry.name), cutoffDate, fsImpl)) {
473102
+ if (await unlinkIfOld(join173(projectDir, entry.name), cutoffDate, fsImpl)) {
472915
473103
  result.messages++;
472916
473104
  }
472917
473105
  } catch {
472918
473106
  result.errors++;
472919
473107
  }
472920
473108
  } else if (entry.isDirectory()) {
472921
- const sessionDir = join172(projectDir, entry.name);
472922
- const toolResultsDir = join172(sessionDir, TOOL_RESULTS_SUBDIR);
473109
+ const sessionDir = join173(projectDir, entry.name);
473110
+ const toolResultsDir = join173(sessionDir, TOOL_RESULTS_SUBDIR);
472923
473111
  let toolDirs;
472924
473112
  try {
472925
473113
  toolDirs = await fsImpl.readdir(toolResultsDir);
@@ -472930,14 +473118,14 @@ async function cleanupOldSessionFiles() {
472930
473118
  for (const toolEntry of toolDirs) {
472931
473119
  if (toolEntry.isFile()) {
472932
473120
  try {
472933
- if (await unlinkIfOld(join172(toolResultsDir, toolEntry.name), cutoffDate, fsImpl)) {
473121
+ if (await unlinkIfOld(join173(toolResultsDir, toolEntry.name), cutoffDate, fsImpl)) {
472934
473122
  result.messages++;
472935
473123
  }
472936
473124
  } catch {
472937
473125
  result.errors++;
472938
473126
  }
472939
473127
  } else if (toolEntry.isDirectory()) {
472940
- const toolDirPath = join172(toolResultsDir, toolEntry.name);
473128
+ const toolDirPath = join173(toolResultsDir, toolEntry.name);
472941
473129
  let toolFiles;
472942
473130
  try {
472943
473131
  toolFiles = await fsImpl.readdir(toolDirPath);
@@ -472948,7 +473136,7 @@ async function cleanupOldSessionFiles() {
472948
473136
  if (!tf.isFile())
472949
473137
  continue;
472950
473138
  try {
472951
- if (await unlinkIfOld(join172(toolDirPath, tf.name), cutoffDate, fsImpl)) {
473139
+ if (await unlinkIfOld(join173(toolDirPath, tf.name), cutoffDate, fsImpl)) {
472952
473140
  result.messages++;
472953
473141
  }
472954
473142
  } catch {
@@ -472980,7 +473168,7 @@ async function cleanupSingleDirectory(dirPath, extension, removeEmptyDir = true)
472980
473168
  if (!dirent.isFile() || !dirent.name.endsWith(extension))
472981
473169
  continue;
472982
473170
  try {
472983
- if (await unlinkIfOld(join172(dirPath, dirent.name), cutoffDate, fsImpl)) {
473171
+ if (await unlinkIfOld(join173(dirPath, dirent.name), cutoffDate, fsImpl)) {
472984
473172
  result.messages++;
472985
473173
  }
472986
473174
  } catch {
@@ -472993,7 +473181,7 @@ async function cleanupSingleDirectory(dirPath, extension, removeEmptyDir = true)
472993
473181
  return result;
472994
473182
  }
472995
473183
  function cleanupOldPlanFiles() {
472996
- const plansDir = join172(getTheusConfigHomeDir(), "plans");
473184
+ const plansDir = join173(getTheusConfigHomeDir(), "plans");
472997
473185
  return cleanupSingleDirectory(plansDir, ".md");
472998
473186
  }
472999
473187
  async function cleanupOldFileHistoryBackups() {
@@ -473002,14 +473190,14 @@ async function cleanupOldFileHistoryBackups() {
473002
473190
  const fsImpl = getFsImplementation();
473003
473191
  try {
473004
473192
  const configDir = getTheusConfigHomeDir();
473005
- const fileHistoryStorageDir = join172(configDir, "file-history");
473193
+ const fileHistoryStorageDir = join173(configDir, "file-history");
473006
473194
  let dirents;
473007
473195
  try {
473008
473196
  dirents = await fsImpl.readdir(fileHistoryStorageDir);
473009
473197
  } catch {
473010
473198
  return result;
473011
473199
  }
473012
- const fileHistorySessionsDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join172(fileHistoryStorageDir, dirent.name));
473200
+ const fileHistorySessionsDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join173(fileHistoryStorageDir, dirent.name));
473013
473201
  await Promise.all(fileHistorySessionsDirs.map(async (fileHistorySessionDir) => {
473014
473202
  try {
473015
473203
  const stats2 = await fsImpl.stat(fileHistorySessionDir);
@@ -473036,14 +473224,14 @@ async function cleanupOldSessionEnvDirs() {
473036
473224
  const fsImpl = getFsImplementation();
473037
473225
  try {
473038
473226
  const configDir = getTheusConfigHomeDir();
473039
- const sessionEnvBaseDir = join172(configDir, "session-env");
473227
+ const sessionEnvBaseDir = join173(configDir, "session-env");
473040
473228
  let dirents;
473041
473229
  try {
473042
473230
  dirents = await fsImpl.readdir(sessionEnvBaseDir);
473043
473231
  } catch {
473044
473232
  return result;
473045
473233
  }
473046
- const sessionEnvDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join172(sessionEnvBaseDir, dirent.name));
473234
+ const sessionEnvDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join173(sessionEnvBaseDir, dirent.name));
473047
473235
  for (const sessionEnvDir of sessionEnvDirs) {
473048
473236
  try {
473049
473237
  const stats2 = await fsImpl.stat(sessionEnvDir);
@@ -473065,7 +473253,7 @@ async function cleanupOldDebugLogs() {
473065
473253
  const cutoffDate = getCutoffDate();
473066
473254
  const result = { messages: 0, errors: 0 };
473067
473255
  const fsImpl = getFsImplementation();
473068
- const debugDir = join172(getTheusConfigHomeDir(), "debug");
473256
+ const debugDir = join173(getTheusConfigHomeDir(), "debug");
473069
473257
  let dirents;
473070
473258
  try {
473071
473259
  dirents = await fsImpl.readdir(debugDir);
@@ -473077,7 +473265,7 @@ async function cleanupOldDebugLogs() {
473077
473265
  continue;
473078
473266
  }
473079
473267
  try {
473080
- if (await unlinkIfOld(join172(debugDir, dirent.name), cutoffDate, fsImpl)) {
473268
+ if (await unlinkIfOld(join173(debugDir, dirent.name), cutoffDate, fsImpl)) {
473081
473269
  result.messages++;
473082
473270
  }
473083
473271
  } catch {
@@ -476289,7 +476477,7 @@ __export(exports_asciicast, {
476289
476477
  _resetRecordingStateForTesting: () => _resetRecordingStateForTesting
476290
476478
  });
476291
476479
  import { appendFile as appendFile9, rename as rename12 } from "fs/promises";
476292
- import { basename as basename65, dirname as dirname73, join as join174 } from "path";
476480
+ import { basename as basename65, dirname as dirname73, join as join175 } from "path";
476293
476481
  function getRecordFilePath() {
476294
476482
  if (recordingState.filePath !== null) {
476295
476483
  return recordingState.filePath;
@@ -476300,10 +476488,10 @@ function getRecordFilePath() {
476300
476488
  if (!isEnvTruthy(process.env.THEUS_CODE_TERMINAL_RECORDING)) {
476301
476489
  return null;
476302
476490
  }
476303
- const projectsDir = join174(getTheusConfigHomeDir(), "projects");
476304
- const projectDir = join174(projectsDir, sanitizePath2(getOriginalCwd()));
476491
+ const projectsDir = join175(getTheusConfigHomeDir(), "projects");
476492
+ const projectDir = join175(projectsDir, sanitizePath2(getOriginalCwd()));
476305
476493
  recordingState.timestamp = Date.now();
476306
- recordingState.filePath = join174(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
476494
+ recordingState.filePath = join175(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
476307
476495
  return recordingState.filePath;
476308
476496
  }
476309
476497
  function _resetRecordingStateForTesting() {
@@ -476312,13 +476500,13 @@ function _resetRecordingStateForTesting() {
476312
476500
  }
476313
476501
  function getSessionRecordingPaths() {
476314
476502
  const sessionId = getSessionId();
476315
- const projectsDir = join174(getTheusConfigHomeDir(), "projects");
476316
- const projectDir = join174(projectsDir, sanitizePath2(getOriginalCwd()));
476503
+ const projectsDir = join175(getTheusConfigHomeDir(), "projects");
476504
+ const projectDir = join175(projectsDir, sanitizePath2(getOriginalCwd()));
476317
476505
  try {
476318
476506
  const entries = getFsImplementation().readdirSync(projectDir);
476319
476507
  const names = typeof entries[0] === "string" ? entries : entries.map((e) => e.name);
476320
476508
  const files2 = names.filter((f) => f.startsWith(sessionId) && f.endsWith(".cast")).sort();
476321
- return files2.map((f) => join174(projectDir, f));
476509
+ return files2.map((f) => join175(projectDir, f));
476322
476510
  } catch {
476323
476511
  return [];
476324
476512
  }
@@ -476328,9 +476516,9 @@ async function renameRecordingForSession() {
476328
476516
  if (!oldPath || recordingState.timestamp === 0) {
476329
476517
  return;
476330
476518
  }
476331
- const projectsDir = join174(getTheusConfigHomeDir(), "projects");
476332
- const projectDir = join174(projectsDir, sanitizePath2(getOriginalCwd()));
476333
- const newPath = join174(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
476519
+ const projectsDir = join175(getTheusConfigHomeDir(), "projects");
476520
+ const projectDir = join175(projectsDir, sanitizePath2(getOriginalCwd()));
476521
+ const newPath = join175(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
476334
476522
  if (oldPath === newPath) {
476335
476523
  return;
476336
476524
  }
@@ -479093,7 +479281,7 @@ var init_useAwaySummary = __esm(() => {
479093
479281
 
479094
479282
  // utils/theusInChrome/setupPortable.ts
479095
479283
  import { readdir as readdir37 } from "fs/promises";
479096
- import { join as join175 } from "path";
479284
+ import { join as join176 } from "path";
479097
479285
  function getExtensionIds() {
479098
479286
  return [THEUS_BROWSER_EXTENSION_ID];
479099
479287
  }
@@ -479120,7 +479308,7 @@ async function detectExtensionInstallationPortable(browserPaths, log2) {
479120
479308
  }
479121
479309
  for (const profile of profileDirs) {
479122
479310
  for (const extensionId of extensionIds) {
479123
- const extensionPath = join175(browserBasePath, profile, "Extensions", extensionId);
479311
+ const extensionPath = join176(browserBasePath, profile, "Extensions", extensionId);
479124
479312
  try {
479125
479313
  await readdir37(extensionPath);
479126
479314
  log2?.(`[Theus in Chrome] Extension ${extensionId} found in ${browser} ${profile}`);
@@ -479144,7 +479332,7 @@ var init_setupPortable = __esm(() => {
479144
479332
  // utils/theusInChrome/setup.ts
479145
479333
  import { chmod as chmod15, mkdir as mkdir56, readFile as readFile67, writeFile as writeFile54 } from "fs/promises";
479146
479334
  import { homedir as homedir50 } from "os";
479147
- import { join as join176 } from "path";
479335
+ import { join as join177 } from "path";
479148
479336
  import { fileURLToPath as fileURLToPath8 } from "url";
479149
479337
  function isTheusInChromeEngineAvailable() {
479150
479338
  return Array.isArray(BROWSER_TOOLS);
@@ -479208,8 +479396,8 @@ function setupTheusInChrome() {
479208
479396
  };
479209
479397
  } else {
479210
479398
  const __filename3 = fileURLToPath8(import.meta.url);
479211
- const __dirname3 = join176(__filename3, "..");
479212
- const cliPath = join176(__dirname3, "cli.js");
479399
+ const __dirname3 = join177(__filename3, "..");
479400
+ const cliPath = join177(__dirname3, "cli.js");
479213
479401
  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
479402
  const mcpConfig = {
479215
479403
  [THEUS_IN_CHROME_MCP_SERVER_NAME]: {
@@ -479231,8 +479419,8 @@ function getNativeMessagingHostsDirs() {
479231
479419
  const platform7 = getPlatform();
479232
479420
  if (platform7 === "windows") {
479233
479421
  const home = homedir50();
479234
- const appData = process.env.APPDATA || join176(home, "AppData", "Local");
479235
- return [join176(appData, "Theus", "ChromeNativeHost")];
479422
+ const appData = process.env.APPDATA || join177(home, "AppData", "Local");
479423
+ return [join177(appData, "Theus", "ChromeNativeHost")];
479236
479424
  }
479237
479425
  return getAllNativeMessagingHostsDirs().map(({ path: path21 }) => path21);
479238
479426
  }
@@ -479251,7 +479439,7 @@ async function installChromeNativeHostManifest(manifestBinaryPath) {
479251
479439
  const manifestContent = jsonStringify(manifest, null, 2);
479252
479440
  let anyManifestUpdated = false;
479253
479441
  for (const manifestDir of manifestDirs) {
479254
- const manifestPath = join176(manifestDir, NATIVE_HOST_MANIFEST_NAME);
479442
+ const manifestPath = join177(manifestDir, NATIVE_HOST_MANIFEST_NAME);
479255
479443
  const existingContent = await readFile67(manifestPath, "utf-8").catch(() => null);
479256
479444
  if (existingContent === manifestContent) {
479257
479445
  continue;
@@ -479266,7 +479454,7 @@ async function installChromeNativeHostManifest(manifestBinaryPath) {
479266
479454
  }
479267
479455
  }
479268
479456
  if (getPlatform() === "windows") {
479269
- const manifestPath = join176(manifestDirs[0], NATIVE_HOST_MANIFEST_NAME);
479457
+ const manifestPath = join177(manifestDirs[0], NATIVE_HOST_MANIFEST_NAME);
479270
479458
  registerWindowsNativeHosts(manifestPath);
479271
479459
  }
479272
479460
  if (anyManifestUpdated) {
@@ -479304,8 +479492,8 @@ function registerWindowsNativeHosts(manifestPath) {
479304
479492
  }
479305
479493
  async function createWrapperScript(command9) {
479306
479494
  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");
479495
+ const chromeDir = join177(getTheusConfigHomeDir(), "chrome");
479496
+ const wrapperPath = platform7 === "windows" ? join177(chromeDir, "chrome-native-host.bat") : join177(chromeDir, "chrome-native-host");
479309
479497
  const scriptContent = platform7 === "windows" ? `@echo off
479310
479498
  REM Chrome native host wrapper script
479311
479499
  REM Generated by Theus - do not edit manually
@@ -479434,7 +479622,7 @@ var init_useChromeExtensionNotification = __esm(() => {
479434
479622
  });
479435
479623
 
479436
479624
  // utils/plugins/officialMarketplaceStartupCheck.ts
479437
- import { join as join177 } from "path";
479625
+ import { join as join178 } from "path";
479438
479626
  function isOfficialMarketplaceAutoInstallDisabled() {
479439
479627
  if (isEnvTruthy(process.env.THEUS_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL)) {
479440
479628
  return true;
@@ -479512,7 +479700,7 @@ async function checkAndInstallOfficialMarketplace() {
479512
479700
  return { installed: false, skipped: true, reason: "policy_blocked" };
479513
479701
  }
479514
479702
  const cacheDir = getMarketplacesCacheDir();
479515
- const installLocation = join177(cacheDir, OFFICIAL_MARKETPLACE_NAME);
479703
+ const installLocation = join178(cacheDir, OFFICIAL_MARKETPLACE_NAME);
479516
479704
  const gcsSha = await fetchOfficialMarketplaceFromGcs(installLocation, cacheDir);
479517
479705
  if (gcsSha !== null) {
479518
479706
  const known = await loadKnownMarketplacesConfig();
@@ -482296,7 +482484,7 @@ var init_usePluginRecommendationBase = __esm(() => {
482296
482484
  });
482297
482485
 
482298
482486
  // hooks/useLspPluginRecommendation.tsx
482299
- import { extname as extname20, join as join178 } from "path";
482487
+ import { extname as extname20, join as join179 } from "path";
482300
482488
  function useLspPluginRecommendation() {
482301
482489
  const $2 = c3(12);
482302
482490
  const trackedFiles = useAppState(_temp202);
@@ -482381,7 +482569,7 @@ function useLspPluginRecommendation() {
482381
482569
  case "yes": {
482382
482570
  installPluginAndNotify(pluginId, pluginName, "lsp-plugin", addNotification, async (pluginData) => {
482383
482571
  logForDebugging(`[useLspPluginRecommendation] Installing plugin: ${pluginId}`);
482384
- const localSourcePath = typeof pluginData.entry.source === "string" ? join178(pluginData.marketplaceInstallLocation, pluginData.entry.source) : undefined;
482572
+ const localSourcePath = typeof pluginData.entry.source === "string" ? join179(pluginData.marketplaceInstallLocation, pluginData.entry.source) : undefined;
482385
482573
  await cacheAndRegisterPlugin(pluginId, pluginData.entry, "user", undefined, localSourcePath);
482386
482574
  const settings = getSettingsForSource("userSettings");
482387
482575
  updateSettingsForSource("userSettings", {
@@ -485585,7 +485773,7 @@ var exports_REPL = {};
485585
485773
  __export(exports_REPL, {
485586
485774
  REPL: () => REPL
485587
485775
  });
485588
- import { dirname as dirname75, join as join179 } from "path";
485776
+ import { dirname as dirname75, join as join180 } from "path";
485589
485777
  import { tmpdir as tmpdir16 } from "os";
485590
485778
  import { writeFile as writeFile55 } from "fs/promises";
485591
485779
  import { randomUUID as randomUUID61 } from "crypto";
@@ -488219,7 +488407,7 @@ Note: ctrl + z now suspends Theus, ctrl + _ undoes input.
488219
488407
  const w = Math.max(80, (process.stdout.columns ?? 80) - 6);
488220
488408
  const raw = await renderMessagesToPlainText(deferredMessages, tools, w);
488221
488409
  const text2 = raw.replace(/[ \t]+$/gm, "");
488222
- const path21 = join179(tmpdir16(), `cc-transcript-${Date.now()}.txt`);
488410
+ const path21 = join180(tmpdir16(), `cc-transcript-${Date.now()}.txt`);
488223
488411
  await writeFile55(path21, text2);
488224
488412
  const opened = openFileInExternalEditor(path21);
488225
488413
  setStatus(opened ? `opening ${path21}` : `wrote ${path21} \xB7 no $VISUAL/$EDITOR set`);
@@ -490561,6 +490749,7 @@ function TrustDialog(t0) {
490561
490749
  if ($2[25] !== onChange) {
490562
490750
  t21 = /* @__PURE__ */ jsx_runtime485.jsx(Select, {
490563
490751
  options: t20,
490752
+ defaultFocusValue: "exit",
490564
490753
  onChange: (value_0) => onChange(value_0),
490565
490754
  onCancel: () => onChange("exit")
490566
490755
  });
@@ -490983,7 +491172,7 @@ function completeOnboarding() {
490983
491172
  saveGlobalConfig((current) => ({
490984
491173
  ...current,
490985
491174
  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
491175
+ lastOnboardingVersion: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
491176
  }));
490988
491177
  }
490989
491178
  function showDialog(root2, renderer) {
@@ -491214,15 +491403,15 @@ var init_interactiveHelpers = __esm(() => {
491214
491403
 
491215
491404
  // components/Theus/arsenalStats.ts
491216
491405
  import { existsSync as existsSync30, readdirSync as readdirSync6 } from "fs";
491217
- import { dirname as dirname76, join as join180 } from "path";
491406
+ import { dirname as dirname76, join as join181 } from "path";
491218
491407
  import { fileURLToPath as fileURLToPath9 } from "url";
491219
491408
  function countBundledArsenalSkills() {
491220
491409
  try {
491221
491410
  const here = dirname76(fileURLToPath9(import.meta.url));
491222
491411
  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")
491412
+ join181(here, "..", "..", "vendor", "theus-arsenal", "skills"),
491413
+ join181(here, "vendor", "theus-arsenal", "skills"),
491414
+ join181(here, "..", "vendor", "theus-arsenal", "skills")
491226
491415
  ]) {
491227
491416
  if (!existsSync30(dir))
491228
491417
  continue;
@@ -491306,7 +491495,7 @@ var init_arsenalStats = __esm(() => {
491306
491495
  // services/import/detect/global.ts
491307
491496
  import { existsSync as existsSync31 } from "fs";
491308
491497
  import { open as open25, readdir as readdir38, stat as stat57 } from "fs/promises";
491309
- import { join as join181 } from "path";
491498
+ import { join as join182 } from "path";
491310
491499
  async function rutaDelTranscript(fichero) {
491311
491500
  let crudo;
491312
491501
  try {
@@ -491337,7 +491526,7 @@ async function rutaDelTranscript(fichero) {
491337
491526
  return null;
491338
491527
  }
491339
491528
  async function explorarTodoElTrabajo(entorno) {
491340
- const raiz = join181(directorioConfig(entorno), "projects");
491529
+ const raiz = join182(directorioConfig(entorno), "projects");
491341
491530
  let directorios;
491342
491531
  try {
491343
491532
  directorios = await readdir38(raiz);
@@ -491346,7 +491535,7 @@ async function explorarTodoElTrabajo(entorno) {
491346
491535
  }
491347
491536
  const salida = [];
491348
491537
  for (const dir of directorios) {
491349
- const ruta = join181(raiz, dir);
491538
+ const ruta = join182(raiz, dir);
491350
491539
  let sesiones;
491351
491540
  try {
491352
491541
  sesiones = (await readdir38(ruta)).filter((n3) => n3.endsWith(".jsonl"));
@@ -491360,7 +491549,7 @@ async function explorarTodoElTrabajo(entorno) {
491360
491549
  let ficheroMasReciente = sesiones[0];
491361
491550
  for (const nombre of sesiones) {
491362
491551
  try {
491363
- const info = await stat57(join181(ruta, nombre));
491552
+ const info = await stat57(join182(ruta, nombre));
491364
491553
  bytes += info.size;
491365
491554
  if (info.mtimeMs > masReciente) {
491366
491555
  masReciente = info.mtimeMs;
@@ -491368,7 +491557,7 @@ async function explorarTodoElTrabajo(entorno) {
491368
491557
  }
491369
491558
  } catch {}
491370
491559
  }
491371
- const proyecto = await rutaDelTranscript(join181(ruta, ficheroMasReciente));
491560
+ const proyecto = await rutaDelTranscript(join182(ruta, ficheroMasReciente));
491372
491561
  if (!proyecto)
491373
491562
  continue;
491374
491563
  salida.push({
@@ -491472,7 +491661,7 @@ __export(exports_OnboardingWizard, {
491472
491661
  OnboardingWizard: () => OnboardingWizard
491473
491662
  });
491474
491663
  import { existsSync as existsSync32, mkdirSync as mkdirSync15, writeFileSync as writeFileSync14 } from "fs";
491475
- import { join as join182 } from "path";
491664
+ import { join as join183 } from "path";
491476
491665
  function hasSeenOnboardingWizard() {
491477
491666
  if (isEnvTruthy(process.env.THEUS_FORCE_ONBOARDING_WIZARD))
491478
491667
  return false;
@@ -491480,7 +491669,7 @@ function hasSeenOnboardingWizard() {
491480
491669
  return true;
491481
491670
  }
491482
491671
  try {
491483
- return existsSync32(join182(getTheusConfigHome(), WIZARD_MARKER));
491672
+ return existsSync32(join183(getTheusConfigHome(), WIZARD_MARKER));
491484
491673
  } catch {
491485
491674
  return true;
491486
491675
  }
@@ -491489,7 +491678,7 @@ function markOnboardingWizardSeen() {
491489
491678
  try {
491490
491679
  const home = getTheusConfigHome();
491491
491680
  mkdirSync15(home, { recursive: true });
491492
- writeFileSync14(join182(home, WIZARD_MARKER), `${JSON.stringify({
491681
+ writeFileSync14(join183(home, WIZARD_MARKER), `${JSON.stringify({
491493
491682
  seenAt: new Date().toISOString(),
491494
491683
  version: globalThis.MACRO?.VERSION ?? null
491495
491684
  })}
@@ -497577,9 +497766,9 @@ var init_createDirectConnectSession = __esm(() => {
497577
497766
 
497578
497767
  // utils/releaseNotes.ts
497579
497768
  import { mkdir as mkdir57, readFile as readFile69, writeFile as writeFile56 } from "fs/promises";
497580
- import { dirname as dirname78, join as join183 } from "path";
497769
+ import { dirname as dirname78, join as join184 } from "path";
497581
497770
  function getChangelogCachePath() {
497582
- return join183(getTheusConfigHomeDir(), "cache", "changelog.md");
497771
+ return join184(getTheusConfigHomeDir(), "cache", "changelog.md");
497583
497772
  }
497584
497773
  async function migrateChangelogFromConfig() {
497585
497774
  const config3 = getGlobalConfig();
@@ -497679,7 +497868,7 @@ function getRecentReleaseNotes(currentVersion, previousVersion, changelogContent
497679
497868
  }
497680
497869
  return [];
497681
497870
  }
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) {
497871
+ async function checkForReleaseNotes(lastSeenVersion, currentVersion = { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
497872
  if (false) {}
497684
497873
  const cachedChangelog = await getStoredChangelog();
497685
497874
  if (lastSeenVersion !== currentVersion || !cachedChangelog) {
@@ -497777,7 +497966,7 @@ __export(exports_setup2, {
497777
497966
  setupComputerUse: () => setupComputerUse,
497778
497967
  COMPUTER_USE_SYSTEM_HINT: () => COMPUTER_USE_SYSTEM_HINT
497779
497968
  });
497780
- import { dirname as dirname79, join as join184 } from "path";
497969
+ import { dirname as dirname79, join as join185 } from "path";
497781
497970
  import { fileURLToPath as fileURLToPath10 } from "url";
497782
497971
  function setupComputerUse() {
497783
497972
  const allowedTools = COMPUTER_USE_TOOL_NAMES.map((name) => buildMcpToolName(COMPUTER_USE_SERVER_NAME, name));
@@ -497804,11 +497993,11 @@ function resolveComputerUseLauncher() {
497804
497993
  return { command: process.execPath, args: [entry, COMPUTER_USE_FLAG] };
497805
497994
  }
497806
497995
  if (entry) {
497807
- const launcher = join184(dirname79(entry), "..", "bin", "theus");
497996
+ const launcher = join185(dirname79(entry), "..", "bin", "theus");
497808
497997
  return { command: launcher, args: [COMPUTER_USE_FLAG] };
497809
497998
  }
497810
497999
  return {
497811
- command: join184(fileURLToPath10(import.meta.url), "..", "..", "..", "bin", "theus"),
498000
+ command: join185(fileURLToPath10(import.meta.url), "..", "..", "..", "bin", "theus"),
497812
498001
  args: [COMPUTER_USE_FLAG]
497813
498002
  };
497814
498003
  }
@@ -497826,7 +498015,7 @@ __export(exports_arsenalBundled, {
497826
498015
  ensureBundledArsenalInstalled: () => ensureBundledArsenalInstalled
497827
498016
  });
497828
498017
  import { existsSync as existsSync33, readFileSync as readFileSync33 } from "fs";
497829
- import { dirname as dirname80, join as join185 } from "path";
498018
+ import { dirname as dirname80, join as join186 } from "path";
497830
498019
  import { fileURLToPath as fileURLToPath11 } from "url";
497831
498020
  function isArsenalAutoInstallEnabled() {
497832
498021
  return process.env.THEUS_NO_ARSENAL !== "1";
@@ -497834,10 +498023,10 @@ function isArsenalAutoInstallEnabled() {
497834
498023
  function findBundledArsenalDir() {
497835
498024
  const here = dirname80(fileURLToPath11(import.meta.url));
497836
498025
  for (const candidate of [
497837
- join185(here, "vendor", "theus-arsenal"),
497838
- join185(here, "..", "vendor", "theus-arsenal")
498026
+ join186(here, "vendor", "theus-arsenal"),
498027
+ join186(here, "..", "vendor", "theus-arsenal")
497839
498028
  ]) {
497840
- if (existsSync33(join185(candidate, ".theus-plugin", "plugin.json"))) {
498029
+ if (existsSync33(join186(candidate, ".theus-plugin", "plugin.json"))) {
497841
498030
  return candidate;
497842
498031
  }
497843
498032
  }
@@ -497845,7 +498034,7 @@ function findBundledArsenalDir() {
497845
498034
  }
497846
498035
  function readBundledVersion(bundledDir) {
497847
498036
  try {
497848
- const manifest = JSON.parse(readFileSync33(join185(bundledDir, ".theus-plugin", "plugin.json"), "utf8"));
498037
+ const manifest = JSON.parse(readFileSync33(join186(bundledDir, ".theus-plugin", "plugin.json"), "utf8"));
497849
498038
  return typeof manifest.version === "string" ? manifest.version : null;
497850
498039
  } catch {
497851
498040
  return null;
@@ -498085,7 +498274,7 @@ var init_sessionMemory = __esm(() => {
498085
498274
  // utils/iTermBackup.ts
498086
498275
  import { copyFile as copyFile10, stat as stat59 } from "fs/promises";
498087
498276
  import { homedir as homedir52 } from "os";
498088
- import { join as join186 } from "path";
498277
+ import { join as join187 } from "path";
498089
498278
  function markITerm2SetupComplete() {
498090
498279
  saveGlobalConfig((current) => ({
498091
498280
  ...current,
@@ -498100,7 +498289,7 @@ function getIterm2RecoveryInfo() {
498100
498289
  };
498101
498290
  }
498102
498291
  function getITerm2PlistPath() {
498103
- return join186(homedir52(), "Library", "Preferences", "com.googlecode.iterm2.plist");
498292
+ return join187(homedir52(), "Library", "Preferences", "com.googlecode.iterm2.plist");
498104
498293
  }
498105
498294
  async function checkAndRestoreITerm2Backup() {
498106
498295
  const { inProgress, backupPath } = getIterm2RecoveryInfo();
@@ -499608,7 +499797,7 @@ var init_sessionUrl = __esm(() => {
499608
499797
 
499609
499798
  // utils/plugins/zipCacheAdapters.ts
499610
499799
  import { readFile as readFile70 } from "fs/promises";
499611
- import { join as join187 } from "path";
499800
+ import { join as join188 } from "path";
499612
499801
  async function readZipCacheKnownMarketplaces() {
499613
499802
  try {
499614
499803
  const content = await readFile70(getZipCacheKnownMarketplacesPath(), "utf-8");
@@ -499633,13 +499822,13 @@ async function saveMarketplaceJsonToZipCache(marketplaceName, installLocation) {
499633
499822
  const content = await readMarketplaceJsonContent(installLocation);
499634
499823
  if (content !== null) {
499635
499824
  const relPath = getMarketplaceJsonRelativePath(marketplaceName);
499636
- await atomicWriteToZipCache(join187(zipCachePath, relPath), content);
499825
+ await atomicWriteToZipCache(join188(zipCachePath, relPath), content);
499637
499826
  }
499638
499827
  }
499639
499828
  async function readMarketplaceJsonContent(dir) {
499640
499829
  const candidates = [
499641
- join187(dir, ".theus-plugin", "marketplace.json"),
499642
- join187(dir, "marketplace.json"),
499830
+ join188(dir, ".theus-plugin", "marketplace.json"),
499831
+ join188(dir, "marketplace.json"),
499643
499832
  dir
499644
499833
  ];
499645
499834
  for (const candidate of candidates) {
@@ -503212,7 +503401,7 @@ async function startMCPServer(cwd3, debug3, verbose) {
503212
503401
  setCwd(cwd3);
503213
503402
  const server2 = new Server({
503214
503403
  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
503404
+ version: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
503405
  }, {
503217
503406
  capabilities: {
503218
503407
  tools: {}
@@ -503344,14 +503533,14 @@ __export(exports_theusDesktop, {
503344
503533
  });
503345
503534
  import { readdir as readdir39, readFile as readFile72, stat as stat61 } from "fs/promises";
503346
503535
  import { homedir as homedir53 } from "os";
503347
- import { join as join188 } from "path";
503536
+ import { join as join189 } from "path";
503348
503537
  async function getTheusDesktopConfigPath() {
503349
503538
  const platform7 = getPlatform();
503350
503539
  if (!SUPPORTED_PLATFORMS.includes(platform7)) {
503351
503540
  throw new Error(`Unsupported platform: ${platform7} - Theus Desktop integration only works on macOS and WSL.`);
503352
503541
  }
503353
503542
  if (platform7 === "macos") {
503354
- return join188(homedir53(), "Library", "Application Support", "Theus", "theus_desktop_config.json");
503543
+ return join189(homedir53(), "Library", "Application Support", "Theus", "theus_desktop_config.json");
503355
503544
  }
503356
503545
  const windowsHome = process.env.USERPROFILE ? process.env.USERPROFILE.replace(/\\/g, "/") : null;
503357
503546
  if (windowsHome) {
@@ -503370,7 +503559,7 @@ async function getTheusDesktopConfigPath() {
503370
503559
  if (user.name === "Public" || user.name === "Default" || user.name === "Default User" || user.name === "All Users") {
503371
503560
  continue;
503372
503561
  }
503373
- const potentialConfigPath = join188(usersDir, user.name, "AppData", "Roaming", "Theus", "theus_desktop_config.json");
503562
+ const potentialConfigPath = join189(usersDir, user.name, "AppData", "Roaming", "Theus", "theus_desktop_config.json");
503374
503563
  try {
503375
503564
  await stat61(potentialConfigPath);
503376
503565
  return potentialConfigPath;
@@ -504279,12 +504468,12 @@ __export(exports_install, {
504279
504468
  install: () => install
504280
504469
  });
504281
504470
  import { homedir as homedir54 } from "os";
504282
- import { join as join189 } from "path";
504471
+ import { join as join190 } from "path";
504283
504472
  function getInstallationPath2() {
504284
504473
  const isWindows2 = env3.platform === "win32";
504285
504474
  const homeDir = homedir54();
504286
504475
  if (isWindows2) {
504287
- const windowsPath = join189(homeDir, ".local", "bin", "theus.exe");
504476
+ const windowsPath = join190(homeDir, ".local", "bin", "theus.exe");
504288
504477
  return windowsPath.replace(/\//g, "\\");
504289
504478
  }
504290
504479
  return "~/.local/bin/theus";
@@ -504654,7 +504843,7 @@ async function setupTokenHandler(root2) {
504654
504843
  gap: 1,
504655
504844
  children: [
504656
504845
  /* @__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
504846
+ version: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
504847
  }),
504659
504848
  showAuthWarning && /* @__PURE__ */ jsx_runtime503.jsxs(ThemedBox_default, {
504660
504849
  flexDirection: "column",
@@ -505257,7 +505446,8 @@ async function run7() {
505257
505446
  sortSubcommands: true,
505258
505447
  sortOptions: true
505259
505448
  }, {
505260
- compareOptions: (a2, b) => getOptionSortKey(a2).localeCompare(getOptionSortKey(b))
505449
+ compareOptions: (a2, b) => getOptionSortKey(a2).localeCompare(getOptionSortKey(b)),
505450
+ helpWidth: Math.max(95, Math.min(100, process.stdout.columns || 95))
505261
505451
  });
505262
505452
  }
505263
505453
  const program2 = new Command().configureHelp(createSortedHelpConfig()).enablePositionalOptions();
@@ -505291,7 +505481,7 @@ async function run7() {
505291
505481
  });
505292
505482
  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
505483
  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) => {
505484
+ }).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
505485
  const amount = Number(value);
505296
505486
  if (isNaN(amount) || amount <= 0) {
505297
505487
  throw new Error("--max-budget-usd must be a positive number greater than 0");
@@ -506239,7 +506429,7 @@ ${assistantAddendum}` : assistantAddendum;
506239
506429
  }
506240
506430
  }
506241
506431
  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,
506432
+ version: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
506433
  is_native_binary: isInBundledMode()
506244
506434
  });
506245
506435
  registerCleanup(async () => {
@@ -507107,7 +507297,7 @@ Usage: theus --remote "your task description"`, () => gracefulShutdown(1));
507107
507297
  pendingHookMessages
507108
507298
  }, renderAndRun);
507109
507299
  }
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");
507300
+ }).version(`${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
507301
  program2.option("-w, --worktree [name]", "Crea un nuevo worktree de git para esta sesi\xF3n (opcionalmente indica un nombre)");
507112
507302
  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
507303
  if (canUserConfigureAdvisor()) {
@@ -507708,7 +507898,7 @@ if (false) {}
507708
507898
  async function main2() {
507709
507899
  const args = process.argv.slice(2);
507710
507900
  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)`);
507901
+ console.log(`${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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
507902
  return;
507713
507903
  }
507714
507904
  if (args[0] === "login" || args[0] === "signin" || args[0] === "entrar" || args[0] === "iniciar-sesion") {