theus-cli 0.2.70 → 0.2.71

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/cli.js +891 -466
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -57765,7 +57765,7 @@ async function _executeApiKeyHelper(isNonInteractiveSession) {
57765
57765
  if (isApiKeyHelperFromProjectOrLocalSettings()) {
57766
57766
  const hasTrust = checkHasTrustDialogAccepted();
57767
57767
  if (!hasTrust && !isNonInteractiveSession) {
57768
- const error40 = new Error(`Security: apiKeyHelper executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.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}.`);
57768
+ const error40 = new Error(`Security: apiKeyHelper executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.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}.`);
57769
57769
  logAntError("apiKeyHelper invoked before trust check", error40);
57770
57770
  logEvent("theus_apiKeyHelper_missing_trust11", {});
57771
57771
  return null;
@@ -57809,7 +57809,7 @@ async function runAwsAuthRefresh() {
57809
57809
  if (isAwsAuthRefreshFromProjectSettings()) {
57810
57810
  const hasTrust = checkHasTrustDialogAccepted();
57811
57811
  if (!hasTrust && !getIsNonInteractiveSession()) {
57812
- const error40 = new Error(`Security: awsAuthRefresh executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.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}.`);
57812
+ const error40 = new Error(`Security: awsAuthRefresh executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.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}.`);
57813
57813
  logAntError("awsAuthRefresh invoked before trust check", error40);
57814
57814
  logEvent("theus_awsAuthRefresh_missing_trust", {});
57815
57815
  return false;
@@ -57869,7 +57869,7 @@ async function getAwsCredsFromCredentialExport() {
57869
57869
  if (isAwsCredentialExportFromProjectSettings()) {
57870
57870
  const hasTrust = checkHasTrustDialogAccepted();
57871
57871
  if (!hasTrust && !getIsNonInteractiveSession()) {
57872
- const error40 = new Error(`Security: awsCredentialExport executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.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}.`);
57872
+ const error40 = new Error(`Security: awsCredentialExport executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.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}.`);
57873
57873
  logAntError("awsCredentialExport invoked before trust check", error40);
57874
57874
  logEvent("theus_awsCredentialExport_missing_trust", {});
57875
57875
  return null;
@@ -57954,7 +57954,7 @@ async function runGcpAuthRefresh() {
57954
57954
  if (isGcpAuthRefreshFromProjectSettings()) {
57955
57955
  const hasTrust = checkHasTrustDialogAccepted();
57956
57956
  if (!hasTrust && !getIsNonInteractiveSession()) {
57957
- const error40 = new Error(`Security: gcpAuthRefresh executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.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}.`);
57957
+ const error40 = new Error(`Security: gcpAuthRefresh executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.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}.`);
57958
57958
  logAntError("gcpAuthRefresh invoked before trust check", error40);
57959
57959
  logEvent("theus_gcpAuthRefresh_missing_trust", {});
57960
57960
  return false;
@@ -58673,7 +58673,7 @@ var init_auth = __esm(() => {
58673
58673
 
58674
58674
  // utils/userAgent.ts
58675
58675
  function getTheusCodeUserAgent() {
58676
- return `theus-code/${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}`;
58676
+ return `theus-code/${{ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}`;
58677
58677
  }
58678
58678
 
58679
58679
  // utils/workloadContext.ts
@@ -58695,7 +58695,7 @@ function getUserAgent() {
58695
58695
  const clientApp = process.env.THEUS_AGENT_SDK_CLIENT_APP ? `, client-app/${process.env.THEUS_AGENT_SDK_CLIENT_APP}` : "";
58696
58696
  const workload = getWorkload();
58697
58697
  const workloadSuffix = workload ? `, workload/${workload}` : "";
58698
- return `theus-cli/${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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})`;
58698
+ return `theus-cli/${{ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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})`;
58699
58699
  }
58700
58700
  function getMCPUserAgent() {
58701
58701
  const parts = [];
@@ -58709,7 +58709,7 @@ function getMCPUserAgent() {
58709
58709
  parts.push(`client-app/${process.env.THEUS_AGENT_SDK_CLIENT_APP}`);
58710
58710
  }
58711
58711
  const suffix = parts.length > 0 ? ` (${parts.join(", ")})` : "";
58712
- return `theus-code/${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}`;
58712
+ return `theus-code/${{ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}`;
58713
58713
  }
58714
58714
  function getWebFetchUserAgent() {
58715
58715
  return `Theus-User (${getTheusCodeUserAgent()}; +https://support.theus.pe/)`;
@@ -58847,7 +58847,7 @@ var init_user = __esm(() => {
58847
58847
  deviceId,
58848
58848
  sessionId: getSessionId(),
58849
58849
  email: getEmail(),
58850
- appVersion: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
58850
+ appVersion: { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
58851
58851
  platform: getHostPlatformForAnalytics(),
58852
58852
  organizationUuid,
58853
58853
  accountUuid,
@@ -60557,7 +60557,7 @@ var init_metadata = __esm(() => {
60557
60557
  COMPOUND_OPERATOR_REGEX = /\s*(?:&&|\|\||[;|])\s*/;
60558
60558
  WHITESPACE_REGEX = /\s+/;
60559
60559
  getVersionBase = memoize_default(() => {
60560
- const match = { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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]+)?/);
60560
+ const match = { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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]+)?/);
60561
60561
  return match ? match[0] : undefined;
60562
60562
  });
60563
60563
  buildEnvContext = memoize_default(async () => {
@@ -60597,9 +60597,9 @@ var init_metadata = __esm(() => {
60597
60597
  isGithubAction: isEnvTruthy(process.env.GITHUB_ACTIONS),
60598
60598
  isTheusCodeAction: isEnvTruthy(process.env.THEUS_CODE_ACTION),
60599
60599
  isTheusAiAuth: isTheusAISubscriber(),
60600
- version: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
60600
+ version: { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
60601
60601
  versionBase: getVersionBase(),
60602
- buildTime: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.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,
60602
+ buildTime: { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.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,
60603
60603
  deploymentEnvironment: env3.detectDeploymentEnvironment(),
60604
60604
  ...isEnvTruthy(process.env.GITHUB_ACTIONS) && {
60605
60605
  githubEventName: process.env.GITHUB_EVENT_NAME,
@@ -61215,7 +61215,7 @@ function initialize1PEventLogging() {
61215
61215
  const platform2 = getPlatform();
61216
61216
  const attributes = {
61217
61217
  [ATTR_SERVICE_NAME]: "theus-code",
61218
- [ATTR_SERVICE_VERSION]: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
61218
+ [ATTR_SERVICE_VERSION]: { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
61219
61219
  };
61220
61220
  if (platform2 === "wsl") {
61221
61221
  const wslVersion = getWslVersion();
@@ -61242,7 +61242,7 @@ function initialize1PEventLogging() {
61242
61242
  })
61243
61243
  ]
61244
61244
  });
61245
- firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.theus.theus_code.events", { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
61245
+ firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.theus.theus_code.events", { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
61246
61246
  }
61247
61247
  async function reinitialize1PEventLoggingIfConfigChanged() {
61248
61248
  if (!is1PEventLoggingEnabled() || !firstPartyEventLoggerProvider) {
@@ -91081,7 +91081,7 @@ function getAttributionHeader(fingerprint) {
91081
91081
  if (!isAttributionHeaderEnabled()) {
91082
91082
  return "";
91083
91083
  }
91084
- const version2 = `${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}`;
91084
+ const version2 = `${{ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}`;
91085
91085
  const entrypoint = process.env.THEUS_CODE_ENTRYPOINT ?? "unknown";
91086
91086
  const cch = "";
91087
91087
  const workload = getWorkload();
@@ -104117,7 +104117,7 @@ Complete the user's request by providing accurate, documentation-based guidance.
104117
104117
  }
104118
104118
  function getFeedbackGuideline() {
104119
104119
  if (isUsing3PServices()) {
104120
- return `- When you cannot find an answer or the feature doesn't exist, direct the user to ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.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}`;
104120
+ return `- When you cannot find an answer or the feature doesn't exist, direct the user to ${{ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.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}`;
104121
104121
  }
104122
104122
  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";
104123
104123
  }
@@ -144301,7 +144301,7 @@ function getTelemetryAttributes() {
144301
144301
  attributes["session.id"] = sessionId;
144302
144302
  }
144303
144303
  if (shouldIncludeAttribute("OTEL_METRICS_INCLUDE_VERSION")) {
144304
- attributes["app.version"] = { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
144304
+ attributes["app.version"] = { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
144305
144305
  }
144306
144306
  const oauthAccount = getOauthAccountInfo();
144307
144307
  if (oauthAccount) {
@@ -220580,7 +220580,7 @@ async function getMcpHeadersFromHelper(serverName, config2) {
220580
220580
  if ("scope" in config2 && isMcpServerFromProjectOrLocalSettings(config2) && !getIsNonInteractiveSession()) {
220581
220581
  const hasTrust = checkHasTrustDialogAccepted();
220582
220582
  if (!hasTrust) {
220583
- 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.70", BUILD_TIME: "1970-01-01T00:00:00.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}.`);
220583
+ 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.71", BUILD_TIME: "1970-01-01T00:00:00.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}.`);
220584
220584
  logAntError("MCP headersHelper invoked before trust check", error40);
220585
220585
  logEvent("theus_mcp_headersHelper_missing_trust", {});
220586
220586
  return null;
@@ -221272,7 +221272,7 @@ function computeFingerprint(messageText, version2) {
221272
221272
  }
221273
221273
  function computeFingerprintFromMessages(messages) {
221274
221274
  const firstMessageText = extractFirstMessageText(messages);
221275
- return computeFingerprint(firstMessageText, { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
221275
+ return computeFingerprint(firstMessageText, { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
221276
221276
  }
221277
221277
  var FINGERPRINT_SALT = "59cf53e54c78";
221278
221278
  var init_fingerprint = () => {};
@@ -221314,7 +221314,7 @@ async function sideQuery(opts) {
221314
221314
  betas.push(STRUCTURED_OUTPUTS_BETA_HEADER);
221315
221315
  }
221316
221316
  const messageText = extractFirstUserMessageText(messages);
221317
- const fingerprint = computeFingerprint(messageText, { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
221317
+ const fingerprint = computeFingerprint(messageText, { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
221318
221318
  const attributionHeader = getAttributionHeader(fingerprint);
221319
221319
  const systemBlocks = [
221320
221320
  attributionHeader ? { type: "text", text: attributionHeader } : null,
@@ -222438,7 +222438,7 @@ async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) {
222438
222438
  const client2 = new Client({
222439
222439
  name: "theus-code",
222440
222440
  title: "Theus",
222441
- version: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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",
222441
+ version: { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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",
222442
222442
  description: "Theus's agentic coding tool",
222443
222443
  websiteUrl: PRODUCT_URL
222444
222444
  }, {
@@ -222792,7 +222792,7 @@ var init_client5 = __esm(() => {
222792
222792
  const client2 = new Client({
222793
222793
  name: "theus-code",
222794
222794
  title: "Theus",
222795
- version: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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",
222795
+ version: { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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",
222796
222796
  description: "Theus's agentic coding tool",
222797
222797
  websiteUrl: PRODUCT_URL
222798
222798
  }, {
@@ -242640,7 +242640,7 @@ async function initializeBetaTracing(resource) {
242640
242640
  });
242641
242641
  logs.setGlobalLoggerProvider(loggerProvider);
242642
242642
  setLoggerProvider(loggerProvider);
242643
- const eventLogger = logs.getLogger("com.theus.theus_code.events", { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
242643
+ const eventLogger = logs.getLogger("com.theus.theus_code.events", { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
242644
242644
  setEventLogger(eventLogger);
242645
242645
  process.on("beforeExit", async () => {
242646
242646
  await loggerProvider?.forceFlush();
@@ -242680,7 +242680,7 @@ async function initializeTelemetry() {
242680
242680
  const platform4 = getPlatform();
242681
242681
  const baseAttributes = {
242682
242682
  [ATTR_SERVICE_NAME]: "theus-code",
242683
- [ATTR_SERVICE_VERSION]: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
242683
+ [ATTR_SERVICE_VERSION]: { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
242684
242684
  };
242685
242685
  if (platform4 === "wsl") {
242686
242686
  const wslVersion = getWslVersion();
@@ -242725,7 +242725,7 @@ async function initializeTelemetry() {
242725
242725
  } catch {}
242726
242726
  };
242727
242727
  registerCleanup(shutdownTelemetry2);
242728
- return meterProvider2.getMeter("com.theus.theus_code", { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
242728
+ return meterProvider2.getMeter("com.theus.theus_code", { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
242729
242729
  }
242730
242730
  const meterProvider = new MeterProvider({
242731
242731
  resource,
@@ -242745,7 +242745,7 @@ async function initializeTelemetry() {
242745
242745
  });
242746
242746
  logs.setGlobalLoggerProvider(loggerProvider);
242747
242747
  setLoggerProvider(loggerProvider);
242748
- const eventLogger = logs.getLogger("com.theus.theus_code.events", { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
242748
+ const eventLogger = logs.getLogger("com.theus.theus_code.events", { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
242749
242749
  setEventLogger(eventLogger);
242750
242750
  logForDebugging("[3P telemetry] Event logger set successfully");
242751
242751
  process.on("beforeExit", async () => {
@@ -242807,7 +242807,7 @@ Current timeout: ${timeoutMs}ms
242807
242807
  }
242808
242808
  };
242809
242809
  registerCleanup(shutdownTelemetry);
242810
- return meterProvider.getMeter("com.theus.theus_code", { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
242810
+ return meterProvider.getMeter("com.theus.theus_code", { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
242811
242811
  }
242812
242812
  async function flushTelemetry() {
242813
242813
  const meterProvider = getMeterProvider();
@@ -243349,7 +243349,7 @@ async function installOrUpdateTheusPackage(channel2, specificVersion) {
243349
243349
  return "install_failed";
243350
243350
  }
243351
243351
  const versionSpec = specificVersion ? specificVersion : channel2 === "stable" ? "stable" : "latest";
243352
- const result = await execFileNoThrowWithCwd("npm", ["install", `${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.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 });
243352
+ const result = await execFileNoThrowWithCwd("npm", ["install", `${{ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.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 });
243353
243353
  if (result.code !== 0) {
243354
243354
  const error40 = new Error(`Failed to install Theus CLI package: ${result.stderr}`);
243355
243355
  logError2(error40);
@@ -243495,9 +243495,9 @@ async function assertMinVersion() {
243495
243495
  if (false) {}
243496
243496
  try {
243497
243497
  const versionConfig = await getDynamicConfig_BLOCKS_ON_INIT("theus_version_config", { minVersion: "0.0.0" });
243498
- if (versionConfig.minVersion && lt({ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
243498
+ if (versionConfig.minVersion && lt({ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
243499
243499
  console.error(`
243500
- It looks like your version of Theus (${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.
243500
+ It looks like your version of Theus (${{ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.
243501
243501
  A newer version (${versionConfig.minVersion} or higher) is required to continue.
243502
243502
 
243503
243503
  To update, please run:
@@ -243634,7 +243634,7 @@ async function getInstallationPrefix() {
243634
243634
  return prefixResult.stdout.trim();
243635
243635
  }
243636
243636
  function getGlobalInstallPackageManager() {
243637
- if ({ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.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") {
243637
+ if ({ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.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") {
243638
243638
  return "npm";
243639
243639
  }
243640
243640
  return env3.isRunningWithBun() ? "bun" : "npm";
@@ -243659,7 +243659,7 @@ async function checkGlobalInstallPermissions() {
243659
243659
  }
243660
243660
  async function getLatestVersion(channel2) {
243661
243661
  const npmTag = channel2 === "stable" ? "stable" : "latest";
243662
- const result = await execFileNoThrowWithCwd("npm", ["view", `${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.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() });
243662
+ const result = await execFileNoThrowWithCwd("npm", ["view", `${{ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.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() });
243663
243663
  if (result.code !== 0) {
243664
243664
  logForDebugging(`npm view failed with code ${result.code}`);
243665
243665
  if (result.stderr) {
@@ -243675,7 +243675,7 @@ async function getLatestVersion(channel2) {
243675
243675
  return result.stdout.trim();
243676
243676
  }
243677
243677
  async function getNpmDistTags() {
243678
- const result = await execFileNoThrowWithCwd("npm", ["view", { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.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() });
243678
+ const result = await execFileNoThrowWithCwd("npm", ["view", { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.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() });
243679
243679
  if (result.code !== 0) {
243680
243680
  logForDebugging(`npm view dist-tags failed with code ${result.code}`);
243681
243681
  return { latest: null, stable: null };
@@ -243715,7 +243715,7 @@ async function installGlobalPackage(specificVersion) {
243715
243715
  logError2(new AutoUpdaterError("Another process is currently installing an update"));
243716
243716
  logEvent("theus_auto_updater_lock_contention", {
243717
243717
  pid: process.pid,
243718
- currentVersion: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
243718
+ currentVersion: { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
243719
243719
  });
243720
243720
  return "in_progress";
243721
243721
  }
@@ -243724,7 +243724,7 @@ async function installGlobalPackage(specificVersion) {
243724
243724
  if (!env3.isRunningWithBun() && env3.isNpmFromWindowsPath()) {
243725
243725
  logError2(new Error("Windows NPM detected in WSL environment"));
243726
243726
  logEvent("theus_auto_updater_windows_npm_in_wsl", {
243727
- currentVersion: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
243727
+ currentVersion: { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
243728
243728
  });
243729
243729
  console.error(`
243730
243730
  Error: Windows NPM detected in WSL
@@ -243743,7 +243743,7 @@ To fix this issue:
243743
243743
  if (!hasPermissions) {
243744
243744
  return "no_permissions";
243745
243745
  }
243746
- const packageSpec = specificVersion ? `${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.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.70", BUILD_TIME: "1970-01-01T00:00:00.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;
243746
+ const packageSpec = specificVersion ? `${{ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.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.71", BUILD_TIME: "1970-01-01T00:00:00.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;
243747
243747
  const packageManager = getGlobalInstallPackageManager();
243748
243748
  const installResult = await execFileNoThrowWithCwd(packageManager, ["install", "-g", packageSpec], { cwd: homedir20() });
243749
243749
  if (installResult.code !== 0) {
@@ -244071,8 +244071,8 @@ async function detectMultipleInstallations() {
244071
244071
  installations.push({ type: "npm-local", path: localPath });
244072
244072
  }
244073
244073
  const packagesToCheck = ["@theus-ai/theus-code"];
244074
- if ({ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.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.70", BUILD_TIME: "1970-01-01T00:00:00.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") {
244075
- packagesToCheck.push({ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.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);
244074
+ if ({ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.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.71", BUILD_TIME: "1970-01-01T00:00:00.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") {
244075
+ packagesToCheck.push({ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.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);
244076
244076
  }
244077
244077
  const npmResult = await execFileNoThrow("npm", [
244078
244078
  "-g",
@@ -244255,7 +244255,7 @@ function detectLinuxGlobPatternWarnings() {
244255
244255
  }
244256
244256
  async function getDoctorDiagnostic() {
244257
244257
  const installationType = await getCurrentInstallationType();
244258
- const version2 = { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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";
244258
+ const version2 = { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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";
244259
244259
  const installationPath = await getInstallationPath();
244260
244260
  const invokedBinary = getInvokedBinary();
244261
244261
  const multipleInstallations = await detectMultipleInstallations();
@@ -244267,8 +244267,8 @@ async function getDoctorDiagnostic() {
244267
244267
  for (const install of npmInstalls) {
244268
244268
  if (install.type === "npm-global") {
244269
244269
  let uninstallCmd = "npm -g uninstall @theus-ai/theus-code";
244270
- if ({ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.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.70", BUILD_TIME: "1970-01-01T00:00:00.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") {
244271
- uninstallCmd += ` && npm -g uninstall ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.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}`;
244270
+ if ({ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.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.71", BUILD_TIME: "1970-01-01T00:00:00.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") {
244271
+ uninstallCmd += ` && npm -g uninstall ${{ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.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}`;
244272
244272
  }
244273
244273
  warnings.push({
244274
244274
  issue: `Leftover npm global installation at ${install.path}`,
@@ -245079,8 +245079,8 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
245079
245079
  const maxVersion = await getMaxVersion();
245080
245080
  if (maxVersion && gt(version2, maxVersion)) {
245081
245081
  logForDebugging(`Native installer: maxVersion ${maxVersion} is set, capping update from ${version2} to ${maxVersion}`);
245082
- if (gte({ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
245083
- logForDebugging(`Native installer: current version ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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`);
245082
+ if (gte({ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
245083
+ logForDebugging(`Native installer: current version ${{ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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`);
245084
245084
  logEvent("theus_native_update_skipped_max_version", {
245085
245085
  latency_ms: Date.now() - startTime2,
245086
245086
  max_version: maxVersion,
@@ -245091,7 +245091,7 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
245091
245091
  version2 = maxVersion;
245092
245092
  }
245093
245093
  }
245094
- if (!forceReinstall && version2 === { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
245094
+ if (!forceReinstall && version2 === { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
245095
245095
  logForDebugging(`Found ${version2} at ${executablePath}, skipping install`);
245096
245096
  logEvent("theus_native_update_complete", {
245097
245097
  latency_ms: Date.now() - startTime2,
@@ -245841,8 +245841,8 @@ async function cleanupNpmInstallations() {
245841
245841
  } else if (codePackageResult.error) {
245842
245842
  errors4.push(codePackageResult.error);
245843
245843
  }
245844
- if ({ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.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.70", BUILD_TIME: "1970-01-01T00:00:00.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") {
245845
- const macroPackageResult = await attemptNpmUninstall({ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.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);
245844
+ if ({ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.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.71", BUILD_TIME: "1970-01-01T00:00:00.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") {
245845
+ const macroPackageResult = await attemptNpmUninstall({ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.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);
245846
245846
  if (macroPackageResult.success) {
245847
245847
  removed++;
245848
245848
  if (macroPackageResult.warning) {
@@ -256259,6 +256259,17 @@ var init_ConsoleOAuthFlow = __esm(() => {
256259
256259
  var NOVEDADES;
256260
256260
  var init_data = __esm(() => {
256261
256261
  NOVEDADES = [
256262
+ {
256263
+ version: "v0.2.71",
256264
+ fecha: "2026-08-13",
256265
+ titulo: "Trae tu trabajo de otras IAs: todos tus proyectos, cada uno con su memoria",
256266
+ puntos: [
256267
+ "Al instalar Theus, ahora te ofrece traerte el trabajo que ya hiciste con otras IAs en este equipo. Te dice cu\xE1ntos proyectos y cu\xE1ntas notas encontr\xF3 ANTES de abrir nada, y solo las trae si aceptas.",
256268
+ "Cada proyecto guarda lo suyo: la memoria de cada carpeta aterriza en la memoria de esa carpeta. Al abrir cualquiera de tus proyectos, Theus ya sabe en qu\xE9 andabas ah\xED \u2014 no en un saco com\xFAn donde todo se mezcla.",
256269
+ "No te cuesta plan. Como esas notas ya ven\xEDan resumidas, traerlas no consulta al modelo: ni un token, y el contenido no sale de tu equipo. Importar cuarenta proyectos tarda milisegundos.",
256270
+ "Y dentro de un proyecto, /import detecta tambi\xE9n las conversaciones en crudo que tengas de esa carpeta, por si quieres exprimirlas \u2014 eso s\xED consulta al modelo, y te lo decimos antes."
256271
+ ]
256272
+ },
256262
256273
  {
256263
256274
  version: "v0.2.70",
256264
256275
  fecha: "2026-08-13",
@@ -300100,9 +300111,9 @@ function getTheusEnvMetadata() {
300100
300111
  };
300101
300112
  }
300102
300113
  function getBuildAgeMinutes() {
300103
- if (!{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.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)
300114
+ if (!{ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.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)
300104
300115
  return;
300105
- const buildTime = new Date({ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.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();
300116
+ const buildTime = new Date({ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.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();
300106
300117
  if (isNaN(buildTime))
300107
300118
  return;
300108
300119
  return Math.floor((Date.now() - buildTime) / 60000);
@@ -318407,7 +318418,7 @@ function getSimpleDoingTasksSection() {
318407
318418
  ];
318408
318419
  const userHelpSubitems = [
318409
318420
  `/help: Get help with using Theus`,
318410
- `To give feedback, users should ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.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}`
318421
+ `To give feedback, users should ${{ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.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}`
318411
318422
  ];
318412
318423
  const items = [
318413
318424
  `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.`,
@@ -329543,7 +329554,7 @@ async function submitTranscriptShare(messages, trigger, appearanceId) {
329543
329554
  } catch {}
329544
329555
  const data = {
329545
329556
  trigger,
329546
- version: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
329557
+ version: { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
329547
329558
  platform: process.platform,
329548
329559
  transcript,
329549
329560
  subagentTranscripts: Object.keys(subagentTranscripts).length > 0 ? subagentTranscripts : undefined,
@@ -329748,10 +329759,10 @@ Si el usuario indic\xF3 una duraci\xF3n, p\xE1sala en el par\xE1metro \`duration
329748
329759
 
329749
329760
  // commands/issue/index.ts
329750
329761
  function getCliVersion() {
329751
- return { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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";
329762
+ return { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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";
329752
329763
  }
329753
329764
  function getIssuesExplainer() {
329754
- return { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.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.70", BUILD_TIME: "1970-01-01T00:00:00.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";
329765
+ return { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.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.71", BUILD_TIME: "1970-01-01T00:00:00.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";
329755
329766
  }
329756
329767
  function getActiveModelLabel() {
329757
329768
  try {
@@ -332537,7 +332548,7 @@ function buildPrimarySection() {
332537
332548
  });
332538
332549
  return [{
332539
332550
  label: "Version",
332540
- value: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
332551
+ value: { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
332541
332552
  }, {
332542
332553
  label: "Session name",
332543
332554
  value: nameValue
@@ -336353,7 +336364,7 @@ function Config({
336353
336364
  }
336354
336365
  })
336355
336366
  }) : showSubmenu === "ChannelDowngrade" ? /* @__PURE__ */ jsx_runtime189.jsx(ChannelDowngradeDialog, {
336356
- currentVersion: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
336367
+ currentVersion: { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
336357
336368
  onChoice: (choice) => {
336358
336369
  setShowSubmenu(null);
336359
336370
  setTabsHidden(false);
@@ -336365,7 +336376,7 @@ function Config({
336365
336376
  autoUpdatesChannel: "stable"
336366
336377
  };
336367
336378
  if (choice === "stay") {
336368
- newSettings.minimumVersion = { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
336379
+ newSettings.minimumVersion = { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
336369
336380
  }
336370
336381
  updateSettingsForSource("userSettings", newSettings);
336371
336382
  setSettingsData((prev_27) => ({
@@ -343569,7 +343580,7 @@ function HelpV2(t0) {
343569
343580
  let t6;
343570
343581
  if ($2[31] !== tabs) {
343571
343582
  t6 = /* @__PURE__ */ jsx_runtime215.jsx(Tabs, {
343572
- title: `Theus v${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}`,
343583
+ title: `Theus v${{ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}`,
343573
343584
  color: "professionalBlue",
343574
343585
  defaultTab: "general",
343575
343586
  children: tabs
@@ -362173,7 +362184,7 @@ function Onboarding({
362173
362184
  flexDirection: "column",
362174
362185
  children: [
362175
362186
  /* @__PURE__ */ jsx_runtime250.jsx(TheusBanner, {
362176
- version: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
362187
+ version: { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
362177
362188
  }),
362178
362189
  /* @__PURE__ */ jsx_runtime250.jsxs(ThemedBox_default, {
362179
362190
  flexDirection: "column",
@@ -367560,7 +367571,7 @@ var init_Messages = __esm(() => {
367560
367571
  let t1;
367561
367572
  if ($2[0] === Symbol.for("react.memo_cache_sentinel")) {
367562
367573
  t1 = /* @__PURE__ */ jsx_runtime263.jsx(TheusSessionHeader, {
367563
- version: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
367574
+ version: { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
367564
367575
  });
367565
367576
  $2[0] = t1;
367566
367577
  } else {
@@ -377270,7 +377281,104 @@ var init_claudeCode = __esm(() => {
377270
377281
  };
377271
377282
  });
377272
377283
 
377284
+ // services/import/detect/sources/memoriaAgente.ts
377285
+ import { readdir as readdir30, readFile as readFile48, stat as stat44 } from "fs/promises";
377286
+ import { join as join134 } from "path";
377287
+ function parsearFicheroMemoria(crudo, nombreFichero) {
377288
+ const texto = crudo.trim();
377289
+ if (!texto)
377290
+ return null;
377291
+ let cuerpo = texto;
377292
+ let titulo = nombreFichero.replace(/\.md$/i, "").replace(/-/g, " ");
377293
+ let categoria;
377294
+ const cierre = texto.startsWith("---") ? texto.indexOf(`
377295
+ ---`, 3) : -1;
377296
+ if (cierre !== -1) {
377297
+ const frontmatter = texto.slice(3, cierre);
377298
+ cuerpo = texto.slice(cierre + 4).trim();
377299
+ for (const linea of frontmatter.split(`
377300
+ `)) {
377301
+ const desc = /^\s*description:\s*(.+)$/.exec(linea);
377302
+ if (desc?.[1])
377303
+ titulo = desc[1].trim().replace(/^["']|["']$/g, "");
377304
+ const tipo = /^\s*type:\s*(.+)$/.exec(linea);
377305
+ if (tipo?.[1])
377306
+ categoria = tipo[1].trim();
377307
+ }
377308
+ }
377309
+ if (!cuerpo)
377310
+ return null;
377311
+ return { titulo, texto: cuerpo, ...categoria ? { categoria } : {} };
377312
+ }
377313
+ async function explorarMemoria(entorno) {
377314
+ const ruta = join134(directorioConfig(entorno), "projects", slugDeProyecto(entorno.proyecto), "memory");
377315
+ let ficheros;
377316
+ try {
377317
+ ficheros = (await readdir30(ruta)).filter((n2) => n2.toLowerCase().endsWith(".md"));
377318
+ } catch {
377319
+ return null;
377320
+ }
377321
+ if (ficheros.length === 0)
377322
+ return null;
377323
+ let bytes = 0;
377324
+ let masReciente = 0;
377325
+ for (const nombre of ficheros) {
377326
+ try {
377327
+ const info = await stat44(join134(ruta, nombre));
377328
+ bytes += info.size;
377329
+ if (info.mtimeMs > masReciente)
377330
+ masReciente = info.mtimeMs;
377331
+ } catch {}
377332
+ }
377333
+ return {
377334
+ herramienta: "claude-code",
377335
+ etiqueta: "Tu memoria de trabajo anterior",
377336
+ ruta,
377337
+ sesiones: ficheros.length,
377338
+ masReciente,
377339
+ bytes,
377340
+ yaDestilado: true
377341
+ };
377342
+ }
377343
+ async function leerMemoria(fuente, maxHechos = 60) {
377344
+ let ficheros;
377345
+ try {
377346
+ ficheros = (await readdir30(fuente.ruta)).filter((n2) => n2.toLowerCase().endsWith(".md"));
377347
+ } catch {
377348
+ return [];
377349
+ }
377350
+ const hechos = [];
377351
+ for (const nombre of ficheros) {
377352
+ if (nombre.toUpperCase() === "MEMORY.MD")
377353
+ continue;
377354
+ if (hechos.length >= maxHechos)
377355
+ break;
377356
+ let crudo;
377357
+ try {
377358
+ crudo = await readFile48(join134(fuente.ruta, nombre), "utf8");
377359
+ } catch {
377360
+ continue;
377361
+ }
377362
+ const hecho = parsearFicheroMemoria(crudo, nombre);
377363
+ if (hecho)
377364
+ hechos.push(hecho);
377365
+ }
377366
+ return hechos;
377367
+ }
377368
+ var init_memoriaAgente = __esm(() => {
377369
+ init_claudeCode();
377370
+ });
377371
+
377273
377372
  // services/import/detect/registry.ts
377373
+ var exports_registry2 = {};
377374
+ __export(exports_registry2, {
377375
+ leerHechosDirectos: () => leerHechosDirectos,
377376
+ leerFuentes: () => leerFuentes,
377377
+ fechaRelativa: () => fechaRelativa,
377378
+ explorarFuentes: () => explorarFuentes,
377379
+ entornoActual: () => entornoActual,
377380
+ describirFuente: () => describirFuente
377381
+ });
377274
377382
  import { homedir as homedir35 } from "os";
377275
377383
  import { realpathSync as realpathSync4 } from "fs";
377276
377384
  function entornoActual(cwd2) {
@@ -377281,13 +377389,16 @@ function entornoActual(cwd2) {
377281
377389
  return { proyecto, home: homedir35(), env: process.env };
377282
377390
  }
377283
377391
  async function explorarFuentes(entorno) {
377284
- const resultados = await Promise.all(DETECTORES.map(async (d) => {
377285
- try {
377286
- return await d.explorar(entorno);
377287
- } catch {
377288
- return null;
377289
- }
377290
- }));
377392
+ const resultados = await Promise.all([
377393
+ explorarMemoria(entorno).catch(() => null),
377394
+ ...DETECTORES.map(async (d) => {
377395
+ try {
377396
+ return await d.explorar(entorno);
377397
+ } catch {
377398
+ return null;
377399
+ }
377400
+ })
377401
+ ]);
377291
377402
  return resultados.filter((f) => f !== null).sort((a2, b) => b.masReciente - a2.masReciente);
377292
377403
  }
377293
377404
  async function leerFuentes(fuentes, limites = LIMITES_POR_DEFECTO) {
@@ -377316,9 +377427,26 @@ async function leerFuentes(fuentes, limites = LIMITES_POR_DEFECTO) {
377316
377427
  totalConversations: conversaciones.length
377317
377428
  };
377318
377429
  }
377430
+ async function leerHechosDirectos(fuentes) {
377431
+ const hechos = [];
377432
+ for (const fuente of fuentes) {
377433
+ if (!fuente.yaDestilado)
377434
+ continue;
377435
+ try {
377436
+ hechos.push(...await leerMemoria(fuente));
377437
+ } catch {
377438
+ continue;
377439
+ }
377440
+ }
377441
+ return hechos;
377442
+ }
377319
377443
  function describirFuente(fuente) {
377320
- const sesiones = fuente.sesiones === 1 ? "1 sesi\xF3n" : `${fuente.sesiones} sesiones`;
377321
377444
  const cuando = fechaRelativa(fuente.masReciente);
377445
+ if (fuente.yaDestilado) {
377446
+ const n2 = fuente.sesiones === 1 ? "1 nota" : `${fuente.sesiones} notas`;
377447
+ return `${n2} ya resumidas \xB7 la \xFAltima, ${cuando} \xB7 no pasa por el modelo`;
377448
+ }
377449
+ const sesiones = fuente.sesiones === 1 ? "1 sesi\xF3n" : `${fuente.sesiones} sesiones`;
377322
377450
  return `${sesiones} de este proyecto \xB7 la \xFAltima, ${cuando}`;
377323
377451
  }
377324
377452
  function fechaRelativa(epochMs, ahora = Date.now()) {
@@ -377342,6 +377470,7 @@ var DETECTORES;
377342
377470
  var init_registry4 = __esm(() => {
377343
377471
  init_types12();
377344
377472
  init_claudeCode();
377473
+ init_memoriaAgente();
377345
377474
  DETECTORES = [detectorClaudeCode];
377346
377475
  });
377347
377476
 
@@ -377351,7 +377480,7 @@ __export(exports_import, {
377351
377480
  call: () => call42,
377352
377481
  ImportContext: () => ImportContext
377353
377482
  });
377354
- import { readFile as readFile48 } from "fs/promises";
377483
+ import { readFile as readFile49 } from "fs/promises";
377355
377484
  import { homedir as homedir36 } from "os";
377356
377485
  import { resolve as resolve42 } from "path";
377357
377486
  function resolvePath3(raw) {
@@ -377414,6 +377543,20 @@ function ImportContext({
377414
377543
  try {
377415
377544
  setStep("working");
377416
377545
  setSource("agente-local");
377546
+ const yaDestiladas = aceptadas.filter((f) => f.yaDestilado);
377547
+ if (yaDestiladas.length > 0) {
377548
+ setStatusLine("Leyendo tu memoria de trabajo anterior\u2026");
377549
+ const directos = await leerHechosDirectos(yaDestiladas);
377550
+ if (directos.length > 0) {
377551
+ setFacts(directos.map((h2) => ({
377552
+ text: h2.texto,
377553
+ ...h2.categoria ? { category: h2.categoria } : {},
377554
+ kept: true
377555
+ })));
377556
+ setStep("review");
377557
+ return;
377558
+ }
377559
+ }
377417
377560
  setStatusLine("Leyendo el contexto de este proyecto\u2026");
377418
377561
  const parsedExport = await leerFuentes(aceptadas);
377419
377562
  setParsed(parsedExport);
@@ -377448,7 +377591,7 @@ function ImportContext({
377448
377591
  const abs = resolvePath3(filePath);
377449
377592
  let bytes;
377450
377593
  try {
377451
- bytes = await readFile48(abs);
377594
+ bytes = await readFile49(abs);
377452
377595
  } catch {
377453
377596
  setError(`No pude leer el archivo: ${abs}`);
377454
377597
  setStep("error");
@@ -384430,7 +384573,7 @@ __export(exports_TheusHome, {
384430
384573
  default: () => TheusHome_default,
384431
384574
  TheusHome: () => TheusHome
384432
384575
  });
384433
- import { readFile as readFile49 } from "fs/promises";
384576
+ import { readFile as readFile50 } from "fs/promises";
384434
384577
  function firstName() {
384435
384578
  const info = getOauthAccountInfo();
384436
384579
  if (info?.displayName)
@@ -384473,7 +384616,7 @@ function relativeWhen(iso) {
384473
384616
  }
384474
384617
  async function readMemory() {
384475
384618
  try {
384476
- const raw = await readFile49(getGraphPath(getCwd()), "utf8");
384619
+ const raw = await readFile50(getGraphPath(getCwd()), "utf8");
384477
384620
  const data = JSON.parse(raw);
384478
384621
  const nodes = Array.isArray(data.nodes) ? data.nodes : [];
384479
384622
  let facts = 0;
@@ -385255,8 +385398,8 @@ __export(exports_thinkback, {
385255
385398
  playAnimation: () => playAnimation,
385256
385399
  call: () => call51
385257
385400
  });
385258
- import { readFile as readFile50 } from "fs/promises";
385259
- import { join as join134 } from "path";
385401
+ import { readFile as readFile51 } from "fs/promises";
385402
+ import { join as join135 } from "path";
385260
385403
  function getMarketplaceName() {
385261
385404
  return OFFICIAL_MARKETPLACE_NAME;
385262
385405
  }
@@ -385274,17 +385417,17 @@ async function getThinkbackSkillDir() {
385274
385417
  if (!thinkbackPlugin) {
385275
385418
  return null;
385276
385419
  }
385277
- const skillDir = join134(thinkbackPlugin.path, "skills", SKILL_NAME);
385420
+ const skillDir = join135(thinkbackPlugin.path, "skills", SKILL_NAME);
385278
385421
  if (await pathExists(skillDir)) {
385279
385422
  return skillDir;
385280
385423
  }
385281
385424
  return null;
385282
385425
  }
385283
385426
  async function playAnimation(skillDir) {
385284
- const dataPath = join134(skillDir, "year_in_review.js");
385285
- const playerPath = join134(skillDir, "player.js");
385427
+ const dataPath = join135(skillDir, "year_in_review.js");
385428
+ const playerPath = join135(skillDir, "player.js");
385286
385429
  try {
385287
- await readFile50(dataPath);
385430
+ await readFile51(dataPath);
385288
385431
  } catch (e) {
385289
385432
  if (isENOENT(e)) {
385290
385433
  return {
@@ -385299,7 +385442,7 @@ async function playAnimation(skillDir) {
385299
385442
  };
385300
385443
  }
385301
385444
  try {
385302
- await readFile50(playerPath);
385445
+ await readFile51(playerPath);
385303
385446
  } catch (e) {
385304
385447
  if (isENOENT(e)) {
385305
385448
  return {
@@ -385330,7 +385473,7 @@ async function playAnimation(skillDir) {
385330
385473
  } catch {} finally {
385331
385474
  inkInstance.exitAlternateScreen();
385332
385475
  }
385333
- const htmlPath = join134(skillDir, "year_in_review.html");
385476
+ const htmlPath = join135(skillDir, "year_in_review.html");
385334
385477
  if (await pathExists(htmlPath)) {
385335
385478
  const platform6 = getPlatform();
385336
385479
  const openCmd = platform6 === "macos" ? "open" : platform6 === "windows" ? "start" : "xdg-open";
@@ -385666,7 +385809,7 @@ function ThinkbackFlow(t0) {
385666
385809
  if (!skillDir) {
385667
385810
  return;
385668
385811
  }
385669
- const dataPath = join134(skillDir, "year_in_review.js");
385812
+ const dataPath = join135(skillDir, "year_in_review.js");
385670
385813
  pathExists(dataPath).then((exists) => {
385671
385814
  logForDebugging(`Checking for ${dataPath}: ${exists ? "found" : "not found"}`);
385672
385815
  setHasGenerated(exists);
@@ -385840,7 +385983,7 @@ var exports_thinkback_play = {};
385840
385983
  __export(exports_thinkback_play, {
385841
385984
  call: () => call52
385842
385985
  });
385843
- import { join as join135 } from "path";
385986
+ import { join as join136 } from "path";
385844
385987
  function getPluginId2() {
385845
385988
  const marketplaceName = OFFICIAL_MARKETPLACE_NAME;
385846
385989
  return `thinkback@${marketplaceName}`;
@@ -385862,7 +386005,7 @@ async function call52() {
385862
386005
  value: "Thinkback plugin installation path not found."
385863
386006
  };
385864
386007
  }
385865
- const skillDir = join135(firstInstall.installPath, "skills", SKILL_NAME2);
386008
+ const skillDir = join136(firstInstall.installPath, "skills", SKILL_NAME2);
385866
386009
  const result = await playAnimation(skillDir);
385867
386010
  return { type: "text", value: result.message };
385868
386011
  }
@@ -392092,7 +392235,7 @@ __export(exports_branch, {
392092
392235
  call: () => call60
392093
392236
  });
392094
392237
  import { randomUUID as randomUUID33 } from "crypto";
392095
- import { mkdir as mkdir42, readFile as readFile51, writeFile as writeFile46 } from "fs/promises";
392238
+ import { mkdir as mkdir42, readFile as readFile52, writeFile as writeFile46 } from "fs/promises";
392096
392239
  function deriveFirstPrompt(firstUserMessage) {
392097
392240
  const content = firstUserMessage?.message?.content;
392098
392241
  if (!content)
@@ -392111,7 +392254,7 @@ async function createFork(customTitle) {
392111
392254
  await mkdir42(projectDir, { recursive: true, mode: 448 });
392112
392255
  let transcriptContent;
392113
392256
  try {
392114
- transcriptContent = await readFile51(currentTranscriptPath);
392257
+ transcriptContent = await readFile52(currentTranscriptPath);
392115
392258
  } catch {
392116
392259
  throw new Error("No hay conversaci\xF3n que ramificar");
392117
392260
  }
@@ -392365,7 +392508,7 @@ var init_types14 = __esm(() => {
392365
392508
 
392366
392509
  // components/agents/agentFileUtils.ts
392367
392510
  import { mkdir as mkdir43, open as open15, unlink as unlink20 } from "fs/promises";
392368
- import { join as join136 } from "path";
392511
+ import { join as join137 } from "path";
392369
392512
  function formatAgentAsMarkdown(agentType, whenToUse, tools, systemPrompt, color3, model, memory2, effort) {
392370
392513
  const escapedWhenToUse = whenToUse.replace(/\\/g, "\\\\").replace(/"/g, "\\\"").replace(/\n/g, "\\\\n");
392371
392514
  const isAllTools = tools === undefined || tools.length === 1 && tools[0] === "*";
@@ -392392,26 +392535,26 @@ function getAgentDirectoryPath(location) {
392392
392535
  case "flagSettings":
392393
392536
  throw new Error(`Cannot get directory path for ${location} agents`);
392394
392537
  case "userSettings":
392395
- return join136(getTheusConfigHomeDir(), AGENT_PATHS.AGENTS_DIR);
392538
+ return join137(getTheusConfigHomeDir(), AGENT_PATHS.AGENTS_DIR);
392396
392539
  case "projectSettings":
392397
- return join136(getCwd(), AGENT_PATHS.FOLDER_NAME, AGENT_PATHS.AGENTS_DIR);
392540
+ return join137(getCwd(), AGENT_PATHS.FOLDER_NAME, AGENT_PATHS.AGENTS_DIR);
392398
392541
  case "policySettings":
392399
- return join136(getManagedFilePath(), AGENT_PATHS.FOLDER_NAME, AGENT_PATHS.AGENTS_DIR);
392542
+ return join137(getManagedFilePath(), AGENT_PATHS.FOLDER_NAME, AGENT_PATHS.AGENTS_DIR);
392400
392543
  case "localSettings":
392401
- return join136(getCwd(), AGENT_PATHS.FOLDER_NAME, AGENT_PATHS.AGENTS_DIR);
392544
+ return join137(getCwd(), AGENT_PATHS.FOLDER_NAME, AGENT_PATHS.AGENTS_DIR);
392402
392545
  }
392403
392546
  }
392404
392547
  function getRelativeAgentDirectoryPath(location) {
392405
392548
  switch (location) {
392406
392549
  case "projectSettings":
392407
- return join136(".", AGENT_PATHS.FOLDER_NAME, AGENT_PATHS.AGENTS_DIR);
392550
+ return join137(".", AGENT_PATHS.FOLDER_NAME, AGENT_PATHS.AGENTS_DIR);
392408
392551
  default:
392409
392552
  return getAgentDirectoryPath(location);
392410
392553
  }
392411
392554
  }
392412
392555
  function getNewAgentFilePath(agent) {
392413
392556
  const dirPath = getAgentDirectoryPath(agent.source);
392414
- return join136(dirPath, `${agent.agentType}.md`);
392557
+ return join137(dirPath, `${agent.agentType}.md`);
392415
392558
  }
392416
392559
  function getActualAgentFilePath(agent) {
392417
392560
  if (agent.source === "built-in") {
@@ -392422,14 +392565,14 @@ function getActualAgentFilePath(agent) {
392422
392565
  }
392423
392566
  const dirPath = getAgentDirectoryPath(agent.source);
392424
392567
  const filename = agent.filename || agent.agentType;
392425
- return join136(dirPath, `${filename}.md`);
392568
+ return join137(dirPath, `${filename}.md`);
392426
392569
  }
392427
392570
  function getNewRelativeAgentFilePath(agent) {
392428
392571
  if (agent.source === "built-in") {
392429
392572
  return "Built-in";
392430
392573
  }
392431
392574
  const dirPath = getRelativeAgentDirectoryPath(agent.source);
392432
- return join136(dirPath, `${agent.agentType}.md`);
392575
+ return join137(dirPath, `${agent.agentType}.md`);
392433
392576
  }
392434
392577
  function getActualRelativeAgentFilePath(agent) {
392435
392578
  if (isBuiltInAgent(agent)) {
@@ -392443,7 +392586,7 @@ function getActualRelativeAgentFilePath(agent) {
392443
392586
  }
392444
392587
  const dirPath = getRelativeAgentDirectoryPath(agent.source);
392445
392588
  const filename = agent.filename || agent.agentType;
392446
- return join136(dirPath, `${filename}.md`);
392589
+ return join137(dirPath, `${filename}.md`);
392447
392590
  }
392448
392591
  async function ensureAgentDirectoryExists(source) {
392449
392592
  const dirPath = getAgentDirectoryPath(source);
@@ -398455,8 +398598,8 @@ var init_rewind = __esm(() => {
398455
398598
 
398456
398599
  // utils/heapDumpService.ts
398457
398600
  import { createWriteStream as createWriteStream3, writeFileSync as writeFileSync7 } from "fs";
398458
- import { readdir as readdir30, readFile as readFile52, writeFile as writeFile47 } from "fs/promises";
398459
- import { join as join137 } from "path";
398601
+ import { readdir as readdir31, readFile as readFile53, writeFile as writeFile47 } from "fs/promises";
398602
+ import { join as join138 } from "path";
398460
398603
  import { pipeline as pipeline2 } from "stream/promises";
398461
398604
  import {
398462
398605
  getHeapSnapshot,
@@ -398476,11 +398619,11 @@ async function captureMemoryDiagnostics(trigger, dumpNumber = 0) {
398476
398619
  const activeRequests = process._getActiveRequests().length;
398477
398620
  let openFileDescriptors;
398478
398621
  try {
398479
- openFileDescriptors = (await readdir30("/proc/self/fd")).length;
398622
+ openFileDescriptors = (await readdir31("/proc/self/fd")).length;
398480
398623
  } catch {}
398481
398624
  let smapsRollup;
398482
398625
  try {
398483
- smapsRollup = await readFile52("/proc/self/smaps_rollup", "utf8");
398626
+ smapsRollup = await readFile53("/proc/self/smaps_rollup", "utf8");
398484
398627
  } catch {}
398485
398628
  const nativeMemory = usage2.rss - usage2.heapUsed;
398486
398629
  const bytesPerSecond = uptimeSeconds > 0 ? usage2.rss / uptimeSeconds : 0;
@@ -398546,7 +398689,7 @@ async function captureMemoryDiagnostics(trigger, dumpNumber = 0) {
398546
398689
  smapsRollup,
398547
398690
  platform: process.platform,
398548
398691
  nodeVersion: process.version,
398549
- ccVersion: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
398692
+ ccVersion: { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
398550
398693
  };
398551
398694
  }
398552
398695
  async function performHeapDump(trigger = "manual", dumpNumber = 0) {
@@ -398564,8 +398707,8 @@ async function performHeapDump(trigger = "manual", dumpNumber = 0) {
398564
398707
  const suffix = dumpNumber > 0 ? `-dump${dumpNumber}` : "";
398565
398708
  const heapFilename = `${sessionId}${suffix}.heapsnapshot`;
398566
398709
  const diagFilename = `${sessionId}${suffix}-diagnostics.json`;
398567
- const heapPath = join137(dumpDir, heapFilename);
398568
- const diagPath = join137(dumpDir, diagFilename);
398710
+ const heapPath = join138(dumpDir, heapFilename);
398711
+ const diagPath = join138(dumpDir, diagFilename);
398569
398712
  await writeFile47(diagPath, jsonStringify(diagnostics, null, 2), {
398570
398713
  mode: 384
398571
398714
  });
@@ -399307,7 +399450,7 @@ var init_bridge_kick = __esm(() => {
399307
399450
  var call68 = async () => {
399308
399451
  return {
399309
399452
  type: "text",
399310
- value: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.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.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.70", BUILD_TIME: "1970-01-01T00:00:00.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.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
399453
+ value: { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.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.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.71", BUILD_TIME: "1970-01-01T00:00:00.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.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
399311
399454
  };
399312
399455
  }, version2, version_default;
399313
399456
  var init_version = __esm(() => {
@@ -401748,7 +401891,7 @@ var init_advisor2 = __esm(() => {
401748
401891
  // skills/bundledSkills.ts
401749
401892
  import { constants as fsConstants5 } from "fs";
401750
401893
  import { mkdir as mkdir44, open as open16 } from "fs/promises";
401751
- import { dirname as dirname57, isAbsolute as isAbsolute28, join as join138, normalize as normalize13, sep as pathSep2 } from "path";
401894
+ import { dirname as dirname57, isAbsolute as isAbsolute28, join as join139, normalize as normalize13, sep as pathSep2 } from "path";
401752
401895
  function registerBundledSkill(definition) {
401753
401896
  const { files: files2 } = definition;
401754
401897
  let skillRoot;
@@ -401796,7 +401939,7 @@ function getBundledSkills() {
401796
401939
  return [...bundledSkills];
401797
401940
  }
401798
401941
  function getBundledSkillExtractDir(skillName) {
401799
- return join138(getBundledSkillsRoot(), skillName);
401942
+ return join139(getBundledSkillsRoot(), skillName);
401800
401943
  }
401801
401944
  async function extractBundledSkillFiles(skillName, files2) {
401802
401945
  const dir = getBundledSkillExtractDir(skillName);
@@ -401838,7 +401981,7 @@ function resolveSkillFilePath(baseDir, relPath) {
401838
401981
  if (isAbsolute28(normalized) || normalized.split(pathSep2).includes("..") || normalized.split("/").includes("..")) {
401839
401982
  throw new Error(`bundled skill file path escapes skill dir: ${relPath}`);
401840
401983
  }
401841
- return join138(baseDir, normalized);
401984
+ return join139(baseDir, normalized);
401842
401985
  }
401843
401986
  function prependBaseDir(blocks, baseDir) {
401844
401987
  const prefix = `Base directory for this skill: ${baseDir}
@@ -401908,7 +402051,7 @@ var SECRET_NAME_PATTERN, EXTRA_ENV_ALLOWLIST, REDACTED2 = "\u2039oculto\u203A",
401908
402051
  const lines = [];
401909
402052
  lines.push("## Entorno de ejecuci\xF3n");
401910
402053
  lines.push("");
401911
- const version3 = { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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";
402054
+ const version3 = { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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";
401912
402055
  lines.push(`- Versi\xF3n de Theus: ${version3}`);
401913
402056
  lines.push(`- Directorio de trabajo: ${getCwd()}`);
401914
402057
  lines.push(`- \xBFRepositorio git?: ${isGit ? "s\xED" : "no"}`);
@@ -402349,7 +402492,7 @@ var init_exit2 = __esm(() => {
402349
402492
  });
402350
402493
 
402351
402494
  // components/ExportDialog.tsx
402352
- import { join as join139 } from "path";
402495
+ import { join as join140 } from "path";
402353
402496
  function ExportDialog({
402354
402497
  content,
402355
402498
  defaultFilename,
@@ -402382,7 +402525,7 @@ function ExportDialog({
402382
402525
  };
402383
402526
  const handleFilenameSubmit = () => {
402384
402527
  const finalFilename = filename.endsWith(".txt") ? filename : filename.replace(/\.[^.]+$/, "") + ".txt";
402385
- const filepath = join139(getCwd(), finalFilename);
402528
+ const filepath = join140(getCwd(), finalFilename);
402386
402529
  try {
402387
402530
  writeFileSync_DEPRECATED(filepath, content, {
402388
402531
  encoding: "utf-8",
@@ -402605,7 +402748,7 @@ __export(exports_export, {
402605
402748
  extractFirstPrompt: () => extractFirstPrompt,
402606
402749
  call: () => call80
402607
402750
  });
402608
- import { join as join140 } from "path";
402751
+ import { join as join141 } from "path";
402609
402752
  function formatTimestamp(date6) {
402610
402753
  const year = date6.getFullYear();
402611
402754
  const month = String(date6.getMonth() + 1).padStart(2, "0");
@@ -402649,7 +402792,7 @@ async function call80(onDone, context3, args) {
402649
402792
  const filename = args.trim();
402650
402793
  if (filename) {
402651
402794
  const finalFilename = filename.endsWith(".txt") ? filename : filename.replace(/\.[^.]+$/, "") + ".txt";
402652
- const filepath = join140(getCwd(), finalFilename);
402795
+ const filepath = join141(getCwd(), finalFilename);
402653
402796
  try {
402654
402797
  writeFileSync_DEPRECATED(filepath, content, {
402655
402798
  encoding: "utf-8",
@@ -404279,7 +404422,7 @@ import {
404279
404422
  writeFileSync as writeFileSync8
404280
404423
  } from "fs";
404281
404424
  import { tmpdir as tmpdir10 } from "os";
404282
- import { dirname as dirname58, join as join141 } from "path";
404425
+ import { dirname as dirname58, join as join142 } from "path";
404283
404426
  function naupaVersionOf(bin) {
404284
404427
  try {
404285
404428
  const out = spawnSync9(bin, ["--version"], {
@@ -404315,7 +404458,7 @@ function rescatarNaupaMalUbicado(binEnUso, options2 = {}) {
404315
404458
  const platform6 = options2.platform ?? process.platform;
404316
404459
  const versionOf = options2.versionOf ?? naupaVersionOf;
404317
404460
  const nombre = platform6 === "win32" ? "naupa.exe" : "naupa";
404318
- const rutaFija = join141(home, ".local", "bin", nombre);
404461
+ const rutaFija = join142(home, ".local", "bin", nombre);
404319
404462
  if (!existsSync21(rutaFija))
404320
404463
  return;
404321
404464
  try {
@@ -404405,7 +404548,7 @@ function isReleaseBundleInstall() {
404405
404548
  return false;
404406
404549
  if (real.includes("node_modules"))
404407
404550
  return false;
404408
- return existsSync21(join141(dirname58(real), "bin", "theus"));
404551
+ return existsSync21(join142(dirname58(real), "bin", "theus"));
404409
404552
  } catch {
404410
404553
  return false;
404411
404554
  }
@@ -404449,20 +404592,20 @@ async function updateReleaseBundle() {
404449
404592
  await gracefulShutdown(1);
404450
404593
  return;
404451
404594
  }
404452
- if (gte({ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
404453
- writeToStdout(source_default.green(`Theus ya est\xE1 al d\xEDa (${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})`) + `
404595
+ if (gte({ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
404596
+ writeToStdout(source_default.green(`Theus ya est\xE1 al d\xEDa (${{ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})`) + `
404454
404597
  `);
404455
404598
  await gracefulShutdown(0);
404456
404599
  return;
404457
404600
  }
404458
- writeToStdout(`Nueva versi\xF3n disponible: ${latest} (actual: ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})
404601
+ writeToStdout(`Nueva versi\xF3n disponible: ${latest} (actual: ${{ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})
404459
404602
  `);
404460
404603
  writeToStdout(`Instalando la actualizaci\xF3n desde theus.pe/dl...
404461
404604
  `);
404462
- const tmp = mkdtempSync(join141(tmpdir10(), "theus-update-"));
404605
+ const tmp = mkdtempSync(join142(tmpdir10(), "theus-update-"));
404463
404606
  try {
404464
- const tarPath = join141(tmp, "theus-cli.tar.gz");
404465
- const sumsPath = join141(tmp, "SHA256SUMS");
404607
+ const tarPath = join142(tmp, "theus-cli.tar.gz");
404608
+ const sumsPath = join142(tmp, "SHA256SUMS");
404466
404609
  if (!await downloadToFile(`${DL_BASE}/theus-cli.tar.gz`, tarPath) || !await downloadToFile(`${DL_BASE}/SHA256SUMS`, sumsPath)) {
404467
404610
  process.stderr.write(source_default.red(`Fall\xF3 la descarga del release desde theus.pe/dl.
404468
404611
  `));
@@ -404481,15 +404624,15 @@ async function updateReleaseBundle() {
404481
404624
  const ex = spawnSync9("tar", ["-xzf", tarPath, "-C", tmp], {
404482
404625
  stdio: "ignore"
404483
404626
  });
404484
- const staged = join141(tmp, "theus-cli");
404485
- if (ex.status !== 0 || !existsSync21(join141(staged, "cli.js"))) {
404627
+ const staged = join142(tmp, "theus-cli");
404628
+ if (ex.status !== 0 || !existsSync21(join142(staged, "cli.js"))) {
404486
404629
  process.stderr.write(source_default.red(`No pude extraer el release descargado (o vino incompleto).
404487
404630
  `));
404488
404631
  await gracefulShutdown(1);
404489
404632
  return;
404490
404633
  }
404491
404634
  cpSync(staged, bundleDir, { recursive: true, force: true });
404492
- writeToStdout(source_default.green(`Actualizado correctamente de ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}`) + `
404635
+ writeToStdout(source_default.green(`Actualizado correctamente de ${{ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}`) + `
404493
404636
  `);
404494
404637
  await regenerateCompletionCache();
404495
404638
  } finally {
@@ -404502,7 +404645,7 @@ async function updateReleaseBundle() {
404502
404645
  async function update() {
404503
404646
  logEvent("theus_update_check", {});
404504
404647
  await updateNaupa();
404505
- writeToStdout(`Versi\xF3n actual: ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}
404648
+ writeToStdout(`Versi\xF3n actual: ${{ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}
404506
404649
  `);
404507
404650
  const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
404508
404651
  writeToStdout(`Buscando actualizaciones en el canal ${channel2}...
@@ -404581,8 +404724,8 @@ async function update() {
404581
404724
  writeToStdout(`Theus est\xE1 gestionado por Homebrew.
404582
404725
  `);
404583
404726
  const latest = await getLatestVersion(channel2);
404584
- if (latest && !gte({ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
404585
- writeToStdout(`Actualizaci\xF3n disponible: ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}
404727
+ if (latest && !gte({ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
404728
+ writeToStdout(`Actualizaci\xF3n disponible: ${{ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}
404586
404729
  `);
404587
404730
  writeToStdout(`
404588
404731
  `);
@@ -404598,8 +404741,8 @@ async function update() {
404598
404741
  writeToStdout(`Theus est\xE1 gestionado por winget.
404599
404742
  `);
404600
404743
  const latest = await getLatestVersion(channel2);
404601
- if (latest && !gte({ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
404602
- writeToStdout(`Actualizaci\xF3n disponible: ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}
404744
+ if (latest && !gte({ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
404745
+ writeToStdout(`Actualizaci\xF3n disponible: ${{ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}
404603
404746
  `);
404604
404747
  writeToStdout(`
404605
404748
  `);
@@ -404615,8 +404758,8 @@ async function update() {
404615
404758
  writeToStdout(`Theus est\xE1 gestionado por apk.
404616
404759
  `);
404617
404760
  const latest = await getLatestVersion(channel2);
404618
- if (latest && !gte({ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
404619
- writeToStdout(`Actualizaci\xF3n disponible: ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}
404761
+ if (latest && !gte({ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
404762
+ writeToStdout(`Actualizaci\xF3n disponible: ${{ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}
404620
404763
  `);
404621
404764
  writeToStdout(`
404622
404765
  `);
@@ -404681,11 +404824,11 @@ async function update() {
404681
404824
  `);
404682
404825
  await gracefulShutdown(1);
404683
404826
  }
404684
- if (result.latestVersion === { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION) {
404685
- writeToStdout(source_default.green(`Theus ya est\xE1 al d\xEDa (${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})`) + `
404827
+ if (result.latestVersion === { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION) {
404828
+ writeToStdout(source_default.green(`Theus ya est\xE1 al d\xEDa (${{ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})`) + `
404686
404829
  `);
404687
404830
  } else {
404688
- writeToStdout(source_default.green(`Actualizado correctamente de ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}`) + `
404831
+ writeToStdout(source_default.green(`Actualizado correctamente de ${{ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}`) + `
404689
404832
  `);
404690
404833
  await regenerateCompletionCache();
404691
404834
  }
@@ -404704,9 +404847,9 @@ async function update() {
404704
404847
  await removeInstalledSymlink();
404705
404848
  }
404706
404849
  logForDebugging("update: Checking npm registry for latest version");
404707
- logForDebugging(`update: Package URL: ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.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}`);
404850
+ logForDebugging(`update: Package URL: ${{ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.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}`);
404708
404851
  const npmTag = channel2 === "stable" ? "stable" : "latest";
404709
- const npmCommand = `npm view ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.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`;
404852
+ const npmCommand = `npm view ${{ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.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`;
404710
404853
  logForDebugging(`update: Running: ${npmCommand}`);
404711
404854
  const latestVersion = await getLatestVersion(channel2);
404712
404855
  logForDebugging(`update: Latest version from npm: ${latestVersion || "FAILED"}`);
@@ -404726,7 +404869,7 @@ async function update() {
404726
404869
  `);
404727
404870
  process.stderr.write(` \u2022 Un proxy o firewall corporativo bloquea npm
404728
404871
  `);
404729
- if ({ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.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.70", BUILD_TIME: "1970-01-01T00:00:00.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")) {
404872
+ if ({ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.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.71", BUILD_TIME: "1970-01-01T00:00:00.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")) {
404730
404873
  process.stderr.write(` \u2022 Compilaci\xF3n interna/de desarrollo no publicada en npm
404731
404874
  `);
404732
404875
  }
@@ -404738,19 +404881,19 @@ async function update() {
404738
404881
  `);
404739
404882
  process.stderr.write(` \u2022 Ejecuta con el flag --debug para m\xE1s detalle
404740
404883
  `);
404741
- const packageName = { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.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";
404884
+ const packageName = { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.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";
404742
404885
  process.stderr.write(` \u2022 Comprueba a mano: npm view ${packageName} version
404743
404886
  `);
404744
404887
  process.stderr.write(` \u2022 Comprueba si te falta iniciar sesi\xF3n: npm whoami
404745
404888
  `);
404746
404889
  await gracefulShutdown(1);
404747
404890
  }
404748
- if (gte({ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
404749
- writeToStdout(source_default.green(`Theus ya est\xE1 al d\xEDa (${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})`) + `
404891
+ if (gte({ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
404892
+ writeToStdout(source_default.green(`Theus ya est\xE1 al d\xEDa (${{ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})`) + `
404750
404893
  `);
404751
404894
  await gracefulShutdown(0);
404752
404895
  }
404753
- writeToStdout(`Nueva versi\xF3n disponible: ${latestVersion} (actual: ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})
404896
+ writeToStdout(`Nueva versi\xF3n disponible: ${latestVersion} (actual: ${{ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})
404754
404897
  `);
404755
404898
  writeToStdout(`Instalando la actualizaci\xF3n...
404756
404899
  `);
@@ -404795,7 +404938,7 @@ async function update() {
404795
404938
  logForDebugging(`update: Installation status: ${status2}`);
404796
404939
  switch (status2) {
404797
404940
  case "success":
404798
- writeToStdout(source_default.green(`Actualizado correctamente de ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}`) + `
404941
+ writeToStdout(source_default.green(`Actualizado correctamente de ${{ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}`) + `
404799
404942
  `);
404800
404943
  await regenerateCompletionCache();
404801
404944
  break;
@@ -404805,7 +404948,7 @@ async function update() {
404805
404948
  if (useLocalUpdate) {
404806
404949
  process.stderr.write(`Prueba a actualizar a mano con:
404807
404950
  `);
404808
- process.stderr.write(` cd ~/.theus/local && npm update ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.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}
404951
+ process.stderr.write(` cd ~/.theus/local && npm update ${{ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.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}
404809
404952
  `);
404810
404953
  } else {
404811
404954
  process.stderr.write(`Prueba con sudo o corrige los permisos de npm
@@ -404821,7 +404964,7 @@ async function update() {
404821
404964
  if (useLocalUpdate) {
404822
404965
  process.stderr.write(`Prueba a actualizar a mano con:
404823
404966
  `);
404824
- process.stderr.write(` cd ~/.theus/local && npm update ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.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}
404967
+ process.stderr.write(` cd ~/.theus/local && npm update ${{ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.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}
404825
404968
  `);
404826
404969
  } else {
404827
404970
  process.stderr.write(`O p\xE1sate a la instalaci\xF3n nativa con: theus install
@@ -405290,7 +405433,7 @@ var init_effort3 = __esm(() => {
405290
405433
  // utils/statsCache.ts
405291
405434
  import { randomBytes as randomBytes20 } from "crypto";
405292
405435
  import { open as open17 } from "fs/promises";
405293
- import { join as join142 } from "path";
405436
+ import { join as join143 } from "path";
405294
405437
  async function withStatsCacheLock(fn) {
405295
405438
  while (statsCacheLockPromise) {
405296
405439
  await statsCacheLockPromise;
@@ -405307,7 +405450,7 @@ async function withStatsCacheLock(fn) {
405307
405450
  }
405308
405451
  }
405309
405452
  function getStatsCachePath() {
405310
- return join142(getTheusConfigHomeDir(), STATS_CACHE_FILENAME);
405453
+ return join143(getTheusConfigHomeDir(), STATS_CACHE_FILENAME);
405311
405454
  }
405312
405455
  function getEmptyCache() {
405313
405456
  return {
@@ -405977,12 +406120,12 @@ var init_ansiToPng = __esm(() => {
405977
406120
  // utils/screenshotClipboard.ts
405978
406121
  import { mkdir as mkdir45, unlink as unlink21, writeFile as writeFile48 } from "fs/promises";
405979
406122
  import { tmpdir as tmpdir11 } from "os";
405980
- import { join as join143 } from "path";
406123
+ import { join as join144 } from "path";
405981
406124
  async function copyAnsiToClipboard(ansiText, options2) {
405982
406125
  try {
405983
- const tempDir = join143(tmpdir11(), "theus-code-screenshots");
406126
+ const tempDir = join144(tmpdir11(), "theus-code-screenshots");
405984
406127
  await mkdir45(tempDir, { recursive: true });
405985
- const pngPath = join143(tempDir, `screenshot-${Date.now()}.png`);
406128
+ const pngPath = join144(tempDir, `screenshot-${Date.now()}.png`);
405986
406129
  const pngBuffer = ansiToPng(ansiText, options2);
405987
406130
  await writeFile48(pngPath, pngBuffer);
405988
406131
  const result = await copyPngToClipboard(pngPath);
@@ -406053,7 +406196,7 @@ var init_screenshotClipboard = __esm(() => {
406053
406196
 
406054
406197
  // utils/stats.ts
406055
406198
  import { open as open18 } from "fs/promises";
406056
- import { basename as basename45, join as join144, sep as sep29 } from "path";
406199
+ import { basename as basename45, join as join145, sep as sep29 } from "path";
406057
406200
  async function processSessionFiles(sessionFiles, options2 = {}) {
406058
406201
  const { fromDate, toDate } = options2;
406059
406202
  const fs5 = getFsImplementation();
@@ -406231,17 +406374,17 @@ async function getAllSessionFiles() {
406231
406374
  return [];
406232
406375
  throw e;
406233
406376
  }
406234
- const projectDirs = allEntries.filter((dirent) => dirent.isDirectory()).map((dirent) => join144(projectsDir, dirent.name));
406377
+ const projectDirs = allEntries.filter((dirent) => dirent.isDirectory()).map((dirent) => join145(projectsDir, dirent.name));
406235
406378
  const projectResults = await Promise.all(projectDirs.map(async (projectDir) => {
406236
406379
  try {
406237
406380
  const entries = await fs5.readdir(projectDir);
406238
- const mainFiles = entries.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".jsonl")).map((dirent) => join144(projectDir, dirent.name));
406381
+ const mainFiles = entries.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".jsonl")).map((dirent) => join145(projectDir, dirent.name));
406239
406382
  const sessionDirs = entries.filter((dirent) => dirent.isDirectory());
406240
406383
  const subagentResults = await Promise.all(sessionDirs.map(async (sessionDir) => {
406241
- const subagentsDir = join144(projectDir, sessionDir.name, "subagents");
406384
+ const subagentsDir = join145(projectDir, sessionDir.name, "subagents");
406242
406385
  try {
406243
406386
  const subagentEntries = await fs5.readdir(subagentsDir);
406244
- return subagentEntries.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".jsonl") && dirent.name.startsWith("agent-")).map((dirent) => join144(subagentsDir, dirent.name));
406387
+ return subagentEntries.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".jsonl") && dirent.name.startsWith("agent-")).map((dirent) => join145(subagentsDir, dirent.name));
406245
406388
  } catch {
406246
406389
  return [];
406247
406390
  }
@@ -408996,7 +409139,7 @@ __export(exports_assistant, {
408996
409139
  NewInstallWizard: () => NewInstallWizard
408997
409140
  });
408998
409141
  import { existsSync as existsSync22, mkdirSync as mkdirSync10, readFileSync as readFileSync29, writeFileSync as writeFileSync9 } from "fs";
408999
- import { dirname as dirname60, join as join145, resolve as resolve43 } from "path";
409142
+ import { dirname as dirname60, join as join146, resolve as resolve43 } from "path";
409000
409143
  async function computeDefaultInstallDir() {
409001
409144
  try {
409002
409145
  return getOriginalCwd();
@@ -409021,16 +409164,16 @@ function writeJson(path17, value) {
409021
409164
  }
409022
409165
  function installAssistant(dir) {
409023
409166
  const root2 = resolve43(dir);
409024
- const theusDir = join145(root2, ".theus");
409025
- const settingsPath = join145(theusDir, "settings.json");
409167
+ const theusDir = join146(root2, ".theus");
409168
+ const settingsPath = join146(theusDir, "settings.json");
409026
409169
  const settings = readJsonSafe(settingsPath);
409027
409170
  settings.assistant = true;
409028
409171
  writeJson(settingsPath, settings);
409029
- const localPath = join145(theusDir, "settings.local.json");
409172
+ const localPath = join146(theusDir, "settings.local.json");
409030
409173
  const local = readJsonSafe(localPath);
409031
409174
  local.defaultView = "chat";
409032
409175
  writeJson(localPath, local);
409033
- const agentPath = join145(theusDir, "agents", "assistant.md");
409176
+ const agentPath = join146(theusDir, "agents", "assistant.md");
409034
409177
  mkdirSync10(dirname60(agentPath), { recursive: true });
409035
409178
  writeFileSync9(agentPath, ASSISTANT_AGENT_MD, "utf8");
409036
409179
  return root2;
@@ -410693,11 +410836,11 @@ function BuddyPanel({
410693
410836
  /* @__PURE__ */ jsx_runtime369.jsx(ThemedBox_default, {
410694
410837
  flexDirection: "column",
410695
410838
  marginTop: 1,
410696
- children: STAT_NAMES.map((stat44) => /* @__PURE__ */ jsx_runtime369.jsx(StatRow, {
410697
- label: STAT_ES[stat44],
410698
- value: companion.stats[stat44],
410839
+ children: STAT_NAMES.map((stat45) => /* @__PURE__ */ jsx_runtime369.jsx(StatRow, {
410840
+ label: STAT_ES[stat45],
410841
+ value: companion.stats[stat45],
410699
410842
  color: color3
410700
- }, stat44))
410843
+ }, stat45))
410701
410844
  }),
410702
410845
  muted && /* @__PURE__ */ jsx_runtime369.jsx(ThemedBox_default, {
410703
410846
  marginTop: 1,
@@ -411414,13 +411557,13 @@ import {
411414
411557
  appendFile as fsAppendFile,
411415
411558
  open as fsOpen2,
411416
411559
  mkdir as mkdir46,
411417
- readdir as readdir31,
411418
- readFile as readFile53,
411419
- stat as stat44,
411560
+ readdir as readdir32,
411561
+ readFile as readFile54,
411562
+ stat as stat45,
411420
411563
  unlink as unlink22,
411421
411564
  writeFile as writeFile49
411422
411565
  } from "fs/promises";
411423
- import { basename as basename48, dirname as dirname61, join as join146 } from "path";
411566
+ import { basename as basename48, dirname as dirname61, join as join147 } from "path";
411424
411567
  function isTranscriptMessage(entry) {
411425
411568
  return entry.type === "user" || entry.type === "assistant" || entry.type === "attachment" || entry.type === "system";
411426
411569
  }
@@ -411434,18 +411577,18 @@ function isEphemeralToolProgress(dataType) {
411434
411577
  return typeof dataType === "string" && EPHEMERAL_PROGRESS_TYPES.has(dataType);
411435
411578
  }
411436
411579
  function getProjectsDir2() {
411437
- return join146(getTheusConfigHomeDir(), "projects");
411580
+ return join147(getTheusConfigHomeDir(), "projects");
411438
411581
  }
411439
411582
  function getTranscriptPath() {
411440
411583
  const projectDir = getSessionProjectDir() ?? getProjectDir3(getOriginalCwd());
411441
- return join146(projectDir, `${getSessionId()}.jsonl`);
411584
+ return join147(projectDir, `${getSessionId()}.jsonl`);
411442
411585
  }
411443
411586
  function getTranscriptPathForSession(sessionId) {
411444
411587
  if (sessionId === getSessionId()) {
411445
411588
  return getTranscriptPath();
411446
411589
  }
411447
411590
  const projectDir = getProjectDir3(getOriginalCwd());
411448
- return join146(projectDir, `${sessionId}.jsonl`);
411591
+ return join147(projectDir, `${sessionId}.jsonl`);
411449
411592
  }
411450
411593
  function setAgentTranscriptSubdir(agentId, subdir) {
411451
411594
  agentTranscriptSubdirs.set(agentId, subdir);
@@ -411457,8 +411600,8 @@ function getAgentTranscriptPath(agentId) {
411457
411600
  const projectDir = getSessionProjectDir() ?? getProjectDir3(getOriginalCwd());
411458
411601
  const sessionId = getSessionId();
411459
411602
  const subdir = agentTranscriptSubdirs.get(agentId);
411460
- const base2 = subdir ? join146(projectDir, sessionId, "subagents", subdir) : join146(projectDir, sessionId, "subagents");
411461
- return join146(base2, `agent-${agentId}.jsonl`);
411603
+ const base2 = subdir ? join147(projectDir, sessionId, "subagents", subdir) : join147(projectDir, sessionId, "subagents");
411604
+ return join147(base2, `agent-${agentId}.jsonl`);
411462
411605
  }
411463
411606
  function getAgentMetadataPath(agentId) {
411464
411607
  return getAgentTranscriptPath(agentId).replace(/\.jsonl$/, ".meta.json");
@@ -411471,7 +411614,7 @@ async function writeAgentMetadata(agentId, metadata) {
411471
411614
  async function readAgentMetadata(agentId) {
411472
411615
  const path17 = getAgentMetadataPath(agentId);
411473
411616
  try {
411474
- const raw = await readFile53(path17, "utf-8");
411617
+ const raw = await readFile54(path17, "utf-8");
411475
411618
  return JSON.parse(raw);
411476
411619
  } catch (e) {
411477
411620
  if (isFsInaccessible(e))
@@ -411481,10 +411624,10 @@ async function readAgentMetadata(agentId) {
411481
411624
  }
411482
411625
  function getRemoteAgentsDir() {
411483
411626
  const projectDir = getSessionProjectDir() ?? getProjectDir3(getOriginalCwd());
411484
- return join146(projectDir, getSessionId(), "remote-agents");
411627
+ return join147(projectDir, getSessionId(), "remote-agents");
411485
411628
  }
411486
411629
  function getRemoteAgentMetadataPath(taskId) {
411487
- return join146(getRemoteAgentsDir(), `remote-agent-${taskId}.meta.json`);
411630
+ return join147(getRemoteAgentsDir(), `remote-agent-${taskId}.meta.json`);
411488
411631
  }
411489
411632
  async function writeRemoteAgentMetadata(taskId, metadata) {
411490
411633
  const path17 = getRemoteAgentMetadataPath(taskId);
@@ -411494,7 +411637,7 @@ async function writeRemoteAgentMetadata(taskId, metadata) {
411494
411637
  async function readRemoteAgentMetadata(taskId) {
411495
411638
  const path17 = getRemoteAgentMetadataPath(taskId);
411496
411639
  try {
411497
- const raw = await readFile53(path17, "utf-8");
411640
+ const raw = await readFile54(path17, "utf-8");
411498
411641
  return JSON.parse(raw);
411499
411642
  } catch (e) {
411500
411643
  if (isFsInaccessible(e))
@@ -411516,7 +411659,7 @@ async function listRemoteAgentMetadata() {
411516
411659
  const dir = getRemoteAgentsDir();
411517
411660
  let entries;
411518
411661
  try {
411519
- entries = await readdir31(dir, { withFileTypes: true });
411662
+ entries = await readdir32(dir, { withFileTypes: true });
411520
411663
  } catch (e) {
411521
411664
  if (isFsInaccessible(e))
411522
411665
  return [];
@@ -411527,7 +411670,7 @@ async function listRemoteAgentMetadata() {
411527
411670
  if (!entry.isFile() || !entry.name.endsWith(".meta.json"))
411528
411671
  continue;
411529
411672
  try {
411530
- const raw = await readFile53(join146(dir, entry.name), "utf-8");
411673
+ const raw = await readFile54(join147(dir, entry.name), "utf-8");
411531
411674
  results.push(JSON.parse(raw));
411532
411675
  } catch (e) {
411533
411676
  logForDebugging(`listRemoteAgentMetadata: skipping ${entry.name}: ${String(e)}`);
@@ -411537,7 +411680,7 @@ async function listRemoteAgentMetadata() {
411537
411680
  }
411538
411681
  function sessionIdExists(sessionId) {
411539
411682
  const projectDir = getProjectDir3(getOriginalCwd());
411540
- const sessionFile = join146(projectDir, `${sessionId}.jsonl`);
411683
+ const sessionFile = join147(projectDir, `${sessionId}.jsonl`);
411541
411684
  const fs5 = getFsImplementation();
411542
411685
  try {
411543
411686
  fs5.statSync(sessionFile);
@@ -411869,7 +412012,7 @@ class Project {
411869
412012
  logForDebugging(`Skipping tombstone removal: session file too large (${formatFileSize(fileSize)})`, { level: "warn" });
411870
412013
  return;
411871
412014
  }
411872
- const content = await readFile53(this.sessionFile, { encoding: "utf-8" });
412015
+ const content = await readFile54(this.sessionFile, { encoding: "utf-8" });
411873
412016
  const lines = content.split(`
411874
412017
  `).filter((line) => {
411875
412018
  if (!line.trim())
@@ -412079,7 +412222,7 @@ class Project {
412079
412222
  return cached3;
412080
412223
  const targetFile = getTranscriptPathForSession(sessionId);
412081
412224
  try {
412082
- await stat44(targetFile);
412225
+ await stat45(targetFile);
412083
412226
  this.existingSessionFiles.set(sessionId, targetFile);
412084
412227
  return targetFile;
412085
412228
  } catch (e) {
@@ -412679,7 +412822,7 @@ async function loadTranscriptFromFile(filePath) {
412679
412822
  worktreeSession: worktreeStates.has(sessionId) ? worktreeStates.get(sessionId) : undefined
412680
412823
  };
412681
412824
  }
412682
- const content = await readFile53(filePath, { encoding: "utf-8" });
412825
+ const content = await readFile54(filePath, { encoding: "utf-8" });
412683
412826
  let parsed;
412684
412827
  try {
412685
412828
  parsed = jsonParse(content);
@@ -413331,7 +413474,7 @@ async function loadTranscriptFile(filePath, opts) {
413331
413474
  let metadataLines = null;
413332
413475
  let hasPreservedSegment = false;
413333
413476
  if (!isEnvTruthy(process.env.THEUS_CODE_DISABLE_PRECOMPACT_SKIP)) {
413334
- const { size } = await stat44(filePath);
413477
+ const { size } = await stat45(filePath);
413335
413478
  if (size > SKIP_PRECOMPACT_THRESHOLD) {
413336
413479
  const scan = await readTranscriptForLoad(filePath, size);
413337
413480
  buf = scan.postBoundaryBuf;
@@ -413341,7 +413484,7 @@ async function loadTranscriptFile(filePath, opts) {
413341
413484
  }
413342
413485
  }
413343
413486
  }
413344
- buf ??= await readFile53(filePath);
413487
+ buf ??= await readFile54(filePath);
413345
413488
  if (!opts?.keepAllLeaves && !hasPreservedSegment && !isEnvTruthy(process.env.THEUS_CODE_DISABLE_PRECOMPACT_SKIP) && buf.length > SKIP_PRECOMPACT_THRESHOLD) {
413346
413489
  buf = walkChainBeforeParse(buf);
413347
413490
  }
@@ -413506,7 +413649,7 @@ async function loadTranscriptFile(filePath, opts) {
413506
413649
  };
413507
413650
  }
413508
413651
  async function loadSessionFile(sessionId) {
413509
- const sessionFile = join146(getSessionProjectDir() ?? getProjectDir3(getOriginalCwd()), `${sessionId}.jsonl`);
413652
+ const sessionFile = join147(getSessionProjectDir() ?? getProjectDir3(getOriginalCwd()), `${sessionId}.jsonl`);
413510
413653
  return loadTranscriptFile(sessionFile);
413511
413654
  }
413512
413655
  function clearSessionMessagesCache() {
@@ -413570,11 +413713,11 @@ async function loadAllProjectsMessageLogsFull(limit) {
413570
413713
  const projectsDir = getProjectsDir2();
413571
413714
  let dirents;
413572
413715
  try {
413573
- dirents = await readdir31(projectsDir, { withFileTypes: true });
413716
+ dirents = await readdir32(projectsDir, { withFileTypes: true });
413574
413717
  } catch {
413575
413718
  return [];
413576
413719
  }
413577
- const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join146(projectsDir, dirent.name));
413720
+ const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join147(projectsDir, dirent.name));
413578
413721
  const logsPerProject = await Promise.all(projectDirs.map((projectDir) => getLogsWithoutIndex(projectDir, limit)));
413579
413722
  const allLogs = logsPerProject.flat();
413580
413723
  const deduped = new Map;
@@ -413595,11 +413738,11 @@ async function loadAllProjectsMessageLogsProgressive(limit, initialEnrichCount =
413595
413738
  const projectsDir = getProjectsDir2();
413596
413739
  let dirents;
413597
413740
  try {
413598
- dirents = await readdir31(projectsDir, { withFileTypes: true });
413741
+ dirents = await readdir32(projectsDir, { withFileTypes: true });
413599
413742
  } catch {
413600
413743
  return { logs: [], allStatLogs: [], nextIndex: 0 };
413601
413744
  }
413602
- const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join146(projectsDir, dirent.name));
413745
+ const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join147(projectsDir, dirent.name));
413603
413746
  const rawLogs = [];
413604
413747
  for (const projectDir of projectDirs) {
413605
413748
  rawLogs.push(...await getSessionFilesLite(projectDir, limit));
@@ -413645,7 +413788,7 @@ async function getStatOnlyLogsForWorktrees(worktreePaths, limit) {
413645
413788
  const seenDirs = new Set;
413646
413789
  let allDirents;
413647
413790
  try {
413648
- allDirents = await readdir31(projectsDir, { withFileTypes: true });
413791
+ allDirents = await readdir32(projectsDir, { withFileTypes: true });
413649
413792
  } catch (e) {
413650
413793
  logForDebugging(`Failed to read projects dir ${projectsDir}, falling back to current project: ${e}`);
413651
413794
  const projectDir = getProjectDir3(getOriginalCwd());
@@ -413660,7 +413803,7 @@ async function getStatOnlyLogsForWorktrees(worktreePaths, limit) {
413660
413803
  for (const { path: wtPath, prefix } of indexed) {
413661
413804
  if (dirName === prefix || dirName.startsWith(prefix + "-")) {
413662
413805
  seenDirs.add(dirName);
413663
- allLogs.push(...await getSessionFilesLite(join146(projectsDir, dirent.name), undefined, wtPath));
413806
+ allLogs.push(...await getSessionFilesLite(join147(projectsDir, dirent.name), undefined, wtPath));
413664
413807
  break;
413665
413808
  }
413666
413809
  }
@@ -413729,10 +413872,10 @@ async function loadSubagentTranscripts(agentIds) {
413729
413872
  return transcripts;
413730
413873
  }
413731
413874
  async function loadAllSubagentTranscriptsFromDisk() {
413732
- const subagentsDir = join146(getSessionProjectDir() ?? getProjectDir3(getOriginalCwd()), getSessionId(), "subagents");
413875
+ const subagentsDir = join147(getSessionProjectDir() ?? getProjectDir3(getOriginalCwd()), getSessionId(), "subagents");
413733
413876
  let entries;
413734
413877
  try {
413735
- entries = await readdir31(subagentsDir, { withFileTypes: true });
413878
+ entries = await readdir32(subagentsDir, { withFileTypes: true });
413736
413879
  } catch {
413737
413880
  return {};
413738
413881
  }
@@ -413846,7 +413989,7 @@ async function getSessionFilesWithMtime(projectDir) {
413846
413989
  const sessionFilesMap = new Map;
413847
413990
  let dirents;
413848
413991
  try {
413849
- dirents = await readdir31(projectDir, { withFileTypes: true });
413992
+ dirents = await readdir32(projectDir, { withFileTypes: true });
413850
413993
  } catch {
413851
413994
  return sessionFilesMap;
413852
413995
  }
@@ -413857,11 +414000,11 @@ async function getSessionFilesWithMtime(projectDir) {
413857
414000
  const sessionId = validateUuid2(basename48(dirent.name, ".jsonl"));
413858
414001
  if (!sessionId)
413859
414002
  continue;
413860
- candidates.push({ sessionId, filePath: join146(projectDir, dirent.name) });
414003
+ candidates.push({ sessionId, filePath: join147(projectDir, dirent.name) });
413861
414004
  }
413862
414005
  await Promise.all(candidates.map(async ({ sessionId, filePath }) => {
413863
414006
  try {
413864
- const st = await stat44(filePath);
414007
+ const st = await stat45(filePath);
413865
414008
  sessionFilesMap.set(sessionId, {
413866
414009
  path: filePath,
413867
414010
  mtime: st.mtime.getTime(),
@@ -414244,7 +414387,7 @@ var init_sessionStorage = __esm(() => {
414244
414387
  init_settings2();
414245
414388
  init_slowOperations();
414246
414389
  init_uuid();
414247
- VERSION4 = { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
414390
+ VERSION4 = { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
414248
414391
  MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
414249
414392
  SKIP_FIRST_PROMPT_PATTERN2 = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
414250
414393
  EPHEMERAL_PROGRESS_TYPES = new Set([
@@ -414256,7 +414399,7 @@ var init_sessionStorage = __esm(() => {
414256
414399
  MAX_TRANSCRIPT_READ_BYTES = 50 * 1024 * 1024;
414257
414400
  agentTranscriptSubdirs = new Map;
414258
414401
  getProjectDir3 = memoize_default((projectDir) => {
414259
- return join146(getProjectsDir2(), sanitizePath2(projectDir));
414402
+ return join147(getProjectsDir2(), sanitizePath2(projectDir));
414260
414403
  });
414261
414404
  METADATA_TYPE_MARKERS = [
414262
414405
  '"type":"summary"',
@@ -414494,41 +414637,41 @@ var init_memdir = __esm(() => {
414494
414637
  });
414495
414638
 
414496
414639
  // tools/AgentTool/agentMemory.ts
414497
- import { join as join147, normalize as normalize14, sep as sep30 } from "path";
414640
+ import { join as join148, normalize as normalize14, sep as sep30 } from "path";
414498
414641
  function sanitizeAgentTypeForPath(agentType) {
414499
414642
  return agentType.replace(/:/g, "-");
414500
414643
  }
414501
414644
  function getLocalAgentMemoryDir(dirName) {
414502
414645
  if (process.env.THEUS_CODE_REMOTE_MEMORY_DIR) {
414503
- return join147(process.env.THEUS_CODE_REMOTE_MEMORY_DIR, "projects", sanitizePath2(findCanonicalGitRoot(getProjectRoot()) ?? getProjectRoot()), "agent-memory-local", dirName) + sep30;
414646
+ return join148(process.env.THEUS_CODE_REMOTE_MEMORY_DIR, "projects", sanitizePath2(findCanonicalGitRoot(getProjectRoot()) ?? getProjectRoot()), "agent-memory-local", dirName) + sep30;
414504
414647
  }
414505
- return join147(getCwd(), ".theus", "agent-memory-local", dirName) + sep30;
414648
+ return join148(getCwd(), ".theus", "agent-memory-local", dirName) + sep30;
414506
414649
  }
414507
414650
  function getAgentMemoryDir(agentType, scope) {
414508
414651
  const dirName = sanitizeAgentTypeForPath(agentType);
414509
414652
  switch (scope) {
414510
414653
  case "project":
414511
- return join147(getCwd(), ".theus", "agent-memory", dirName) + sep30;
414654
+ return join148(getCwd(), ".theus", "agent-memory", dirName) + sep30;
414512
414655
  case "local":
414513
414656
  return getLocalAgentMemoryDir(dirName);
414514
414657
  case "user":
414515
- return join147(getMemoryBaseDir(), "agent-memory", dirName) + sep30;
414658
+ return join148(getMemoryBaseDir(), "agent-memory", dirName) + sep30;
414516
414659
  }
414517
414660
  }
414518
414661
  function isAgentMemoryPath(absolutePath) {
414519
414662
  const normalizedPath = normalize14(absolutePath);
414520
414663
  const memoryBase = getMemoryBaseDir();
414521
- if (normalizedPath.startsWith(join147(memoryBase, "agent-memory") + sep30)) {
414664
+ if (normalizedPath.startsWith(join148(memoryBase, "agent-memory") + sep30)) {
414522
414665
  return true;
414523
414666
  }
414524
- if (normalizedPath.startsWith(join147(getCwd(), ".theus", "agent-memory") + sep30)) {
414667
+ if (normalizedPath.startsWith(join148(getCwd(), ".theus", "agent-memory") + sep30)) {
414525
414668
  return true;
414526
414669
  }
414527
414670
  if (process.env.THEUS_CODE_REMOTE_MEMORY_DIR) {
414528
- if (normalizedPath.includes(sep30 + "agent-memory-local" + sep30) && normalizedPath.startsWith(join147(process.env.THEUS_CODE_REMOTE_MEMORY_DIR, "projects") + sep30)) {
414671
+ if (normalizedPath.includes(sep30 + "agent-memory-local" + sep30) && normalizedPath.startsWith(join148(process.env.THEUS_CODE_REMOTE_MEMORY_DIR, "projects") + sep30)) {
414529
414672
  return true;
414530
414673
  }
414531
- } else if (normalizedPath.startsWith(join147(getCwd(), ".theus", "agent-memory-local") + sep30)) {
414674
+ } else if (normalizedPath.startsWith(join148(getCwd(), ".theus", "agent-memory-local") + sep30)) {
414532
414675
  return true;
414533
414676
  }
414534
414677
  return false;
@@ -414536,7 +414679,7 @@ function isAgentMemoryPath(absolutePath) {
414536
414679
  function getMemoryScopeDisplay(memory2) {
414537
414680
  switch (memory2) {
414538
414681
  case "user":
414539
- return `User (${join147(getMemoryBaseDir(), "agent-memory")}/)`;
414682
+ return `User (${join148(getMemoryBaseDir(), "agent-memory")}/)`;
414540
414683
  case "project":
414541
414684
  return "Project (.theus/agent-memory/)";
414542
414685
  case "local":
@@ -414579,7 +414722,7 @@ var init_agentMemory = __esm(() => {
414579
414722
  // utils/permissions/filesystem.ts
414580
414723
  import { randomBytes as randomBytes21 } from "crypto";
414581
414724
  import { homedir as homedir39, tmpdir as tmpdir12 } from "os";
414582
- import { join as join148, normalize as normalize15, posix as posix7, sep as sep31 } from "path";
414725
+ import { join as join149, normalize as normalize15, posix as posix7, sep as sep31 } from "path";
414583
414726
  function normalizeCaseForComparison(path17) {
414584
414727
  return path17.toLowerCase();
414585
414728
  }
@@ -414588,11 +414731,11 @@ function getTheusSkillScope(filePath) {
414588
414731
  const absolutePathLower = normalizeCaseForComparison(absolutePath);
414589
414732
  const bases = [
414590
414733
  {
414591
- dir: expandPath(join148(getOriginalCwd(), ".theus", "skills")),
414734
+ dir: expandPath(join149(getOriginalCwd(), ".theus", "skills")),
414592
414735
  prefix: "/.theus/skills/"
414593
414736
  },
414594
414737
  {
414595
- dir: expandPath(join148(homedir39(), ".theus", "skills")),
414738
+ dir: expandPath(join149(homedir39(), ".theus", "skills")),
414596
414739
  prefix: "~/.theus/skills/"
414597
414740
  }
414598
414741
  ];
@@ -414647,21 +414790,21 @@ function isTheusConfigFilePath(filePath) {
414647
414790
  if (isTheusSettingsPath(filePath)) {
414648
414791
  return true;
414649
414792
  }
414650
- const commandsDir = join148(getOriginalCwd(), ".theus", "commands");
414651
- const agentsDir = join148(getOriginalCwd(), ".theus", "agents");
414652
- const skillsDir = join148(getOriginalCwd(), ".theus", "skills");
414793
+ const commandsDir = join149(getOriginalCwd(), ".theus", "commands");
414794
+ const agentsDir = join149(getOriginalCwd(), ".theus", "agents");
414795
+ const skillsDir = join149(getOriginalCwd(), ".theus", "skills");
414653
414796
  return pathInWorkingPath(filePath, commandsDir) || pathInWorkingPath(filePath, agentsDir) || pathInWorkingPath(filePath, skillsDir);
414654
414797
  }
414655
414798
  function isSessionPlanFile(absolutePath) {
414656
- const expectedPrefix = join148(getPlansDirectory(), getPlanSlug());
414799
+ const expectedPrefix = join149(getPlansDirectory(), getPlanSlug());
414657
414800
  const normalizedPath = normalize15(absolutePath);
414658
414801
  return normalizedPath.startsWith(expectedPrefix) && normalizedPath.endsWith(".md");
414659
414802
  }
414660
414803
  function getSessionMemoryDir() {
414661
- return join148(getProjectDir3(getCwd()), getSessionId(), "session-memory") + sep31;
414804
+ return join149(getProjectDir3(getCwd()), getSessionId(), "session-memory") + sep31;
414662
414805
  }
414663
414806
  function getSessionMemoryPath() {
414664
- return join148(getSessionMemoryDir(), "summary.md");
414807
+ return join149(getSessionMemoryDir(), "summary.md");
414665
414808
  }
414666
414809
  function isSessionMemoryPath(absolutePath) {
414667
414810
  const normalizedPath = normalize15(absolutePath);
@@ -414683,10 +414826,10 @@ function getTheusTempDirName() {
414683
414826
  return `theus-${uid}`;
414684
414827
  }
414685
414828
  function getProjectTempDir() {
414686
- return join148(getTheusTempDir(), sanitizePath2(getOriginalCwd())) + sep31;
414829
+ return join149(getTheusTempDir(), sanitizePath2(getOriginalCwd())) + sep31;
414687
414830
  }
414688
414831
  function getScratchpadDir() {
414689
- return join148(getProjectTempDir(), getSessionId(), "scratchpad");
414832
+ return join149(getProjectTempDir(), getSessionId(), "scratchpad");
414690
414833
  }
414691
414834
  async function ensureScratchpadDir() {
414692
414835
  if (!isScratchpadEnabled()) {
@@ -415264,7 +415407,7 @@ function checkEditableInternalPath(absolutePath, input) {
415264
415407
  }
415265
415408
  };
415266
415409
  }
415267
- if (normalizeCaseForComparison(normalizedPath) === normalizeCaseForComparison(join148(getOriginalCwd(), ".theus", "launch.json"))) {
415410
+ if (normalizeCaseForComparison(normalizedPath) === normalizeCaseForComparison(join149(getOriginalCwd(), ".theus", "launch.json"))) {
415268
415411
  return {
415269
415412
  behavior: "allow",
415270
415413
  updatedInput: input,
@@ -415361,7 +415504,7 @@ function checkReadableInternalPath(absolutePath, input) {
415361
415504
  }
415362
415505
  };
415363
415506
  }
415364
- const tasksDir = join148(getTheusConfigHomeDir(), "tasks") + sep31;
415507
+ const tasksDir = join149(getTheusConfigHomeDir(), "tasks") + sep31;
415365
415508
  if (normalizedPath === tasksDir.slice(0, -1) || normalizedPath.startsWith(tasksDir)) {
415366
415509
  return {
415367
415510
  behavior: "allow",
@@ -415372,7 +415515,7 @@ function checkReadableInternalPath(absolutePath, input) {
415372
415515
  }
415373
415516
  };
415374
415517
  }
415375
- const teamsReadDir = join148(getTheusConfigHomeDir(), "teams") + sep31;
415518
+ const teamsReadDir = join149(getTheusConfigHomeDir(), "teams") + sep31;
415376
415519
  if (normalizedPath === teamsReadDir.slice(0, -1) || normalizedPath.startsWith(teamsReadDir)) {
415377
415520
  return {
415378
415521
  behavior: "allow",
@@ -415445,11 +415588,11 @@ var init_filesystem = __esm(() => {
415445
415588
  try {
415446
415589
  resolvedBaseTmpDir = fs5.realpathSync(baseTmpDir);
415447
415590
  } catch {}
415448
- return join148(resolvedBaseTmpDir, getTheusTempDirName()) + sep31;
415591
+ return join149(resolvedBaseTmpDir, getTheusTempDirName()) + sep31;
415449
415592
  });
415450
415593
  getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
415451
415594
  const nonce = randomBytes21(16).toString("hex");
415452
- return join148(getTheusTempDir(), "bundled-skills", { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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);
415595
+ return join149(getTheusTempDir(), "bundled-skills", { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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);
415453
415596
  });
415454
415597
  getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
415455
415598
  });
@@ -415459,14 +415602,14 @@ import { constants as fsConstants6 } from "fs";
415459
415602
  import {
415460
415603
  mkdir as mkdir47,
415461
415604
  open as open19,
415462
- stat as stat45,
415605
+ stat as stat46,
415463
415606
  symlink as symlink6,
415464
415607
  unlink as unlink23
415465
415608
  } from "fs/promises";
415466
- import { join as join149 } from "path";
415609
+ import { join as join150 } from "path";
415467
415610
  function getTaskOutputDir() {
415468
415611
  if (_taskOutputDir === undefined) {
415469
- _taskOutputDir = join149(getProjectTempDir(), getSessionId(), "tasks");
415612
+ _taskOutputDir = join150(getProjectTempDir(), getSessionId(), "tasks");
415470
415613
  }
415471
415614
  return _taskOutputDir;
415472
415615
  }
@@ -415474,7 +415617,7 @@ async function ensureOutputDir() {
415474
415617
  await mkdir47(getTaskOutputDir(), { recursive: true });
415475
415618
  }
415476
415619
  function getTaskOutputPath(taskId) {
415477
- return join149(getTaskOutputDir(), `${taskId}.output`);
415620
+ return join150(getTaskOutputDir(), `${taskId}.output`);
415478
415621
  }
415479
415622
  function track(p) {
415480
415623
  _pendingOps.add(p);
@@ -415723,7 +415866,7 @@ var init_Task = __esm(() => {
415723
415866
  });
415724
415867
 
415725
415868
  // utils/ShellCommand.ts
415726
- import { stat as stat46 } from "fs/promises";
415869
+ import { stat as stat47 } from "fs/promises";
415727
415870
  function prependStderr(prefix, stderr) {
415728
415871
  return stderr ? `${prefix} ${stderr}` : prefix;
415729
415872
  }
@@ -415847,7 +415990,7 @@ class ShellCommandImpl {
415847
415990
  }
415848
415991
  #startSizeWatchdog() {
415849
415992
  this.#sizeWatchdog = setInterval(() => {
415850
- stat46(this.taskOutput.path).then((s) => {
415993
+ stat47(this.taskOutput.path).then((s) => {
415851
415994
  if (s.size > this.#maxOutputBytes && this.#status === "backgrounded" && this.#sizeWatchdog !== null) {
415852
415995
  this.#killedForSize = true;
415853
415996
  this.#clearSizeWatchdog();
@@ -419710,7 +419853,7 @@ var init_hooks5 = __esm(() => {
419710
419853
  });
419711
419854
 
419712
419855
  // utils/settings/changeDetector.ts
419713
- import { stat as stat47 } from "fs/promises";
419856
+ import { stat as stat48 } from "fs/promises";
419714
419857
  import * as platformPath from "path";
419715
419858
  async function initialize() {
419716
419859
  if (getIsRemoteMode())
@@ -419790,7 +419933,7 @@ async function getWatchTargets() {
419790
419933
  }
419791
419934
  dirToSettingsFiles.get(dir).add(path17);
419792
419935
  try {
419793
- const stats2 = await stat47(path17);
419936
+ const stats2 = await stat48(path17);
419794
419937
  if (stats2.isFile()) {
419795
419938
  dirsWithExistingFiles.add(dir);
419796
419939
  }
@@ -419808,7 +419951,7 @@ async function getWatchTargets() {
419808
419951
  let dropInDir = null;
419809
419952
  const managedDropIn = getManagedSettingsDropInDir();
419810
419953
  try {
419811
- const stats2 = await stat47(managedDropIn);
419954
+ const stats2 = await stat48(managedDropIn);
419812
419955
  if (stats2.isDirectory()) {
419813
419956
  dirsWithExistingFiles.add(managedDropIn);
419814
419957
  dropInDir = managedDropIn;
@@ -419988,8 +420131,8 @@ __export(exports_sandbox_adapter, {
419988
420131
  SandboxManager: () => SandboxManager2
419989
420132
  });
419990
420133
  import { rmSync as rmSync5, statSync as statSync13 } from "fs";
419991
- import { readFile as readFile54 } from "fs/promises";
419992
- import { join as join150, resolve as resolve46, sep as sep33 } from "path";
420134
+ import { readFile as readFile55 } from "fs/promises";
420135
+ import { join as join151, resolve as resolve46, sep as sep33 } from "path";
419993
420136
  function permissionRuleValueFromString2(ruleString) {
419994
420137
  const matches = ruleString.match(/^([^(]+)\(([^)]+)\)$/);
419995
420138
  if (!matches) {
@@ -420171,9 +420314,9 @@ function scrubBareGitRepoFiles() {
420171
420314
  }
420172
420315
  }
420173
420316
  async function detectWorktreeMainRepoPath(cwd2) {
420174
- const gitPath = join150(cwd2, ".git");
420317
+ const gitPath = join151(cwd2, ".git");
420175
420318
  try {
420176
- const gitContent = await readFile54(gitPath, { encoding: "utf8" });
420319
+ const gitContent = await readFile55(gitPath, { encoding: "utf8" });
420177
420320
  const gitdirMatch = gitContent.match(/^gitdir:\s*(.+)$/m);
420178
420321
  if (!gitdirMatch?.[1]) {
420179
420322
  return null;
@@ -420698,8 +420841,8 @@ var init_pathValidation3 = __esm(() => {
420698
420841
 
420699
420842
  // utils/plugins/pluginDirectories.ts
420700
420843
  import { mkdirSync as mkdirSync11 } from "fs";
420701
- import { readdir as readdir32, rm as rm10, stat as stat48 } from "fs/promises";
420702
- import { delimiter as delimiter3, join as join151 } from "path";
420844
+ import { readdir as readdir33, rm as rm10, stat as stat49 } from "fs/promises";
420845
+ import { delimiter as delimiter3, join as join152 } from "path";
420703
420846
  function getPluginsDirectoryName() {
420704
420847
  if (getUseCoworkPlugins()) {
420705
420848
  return COWORK_PLUGINS_DIR;
@@ -420714,7 +420857,7 @@ function getPluginsDirectory() {
420714
420857
  if (envOverride) {
420715
420858
  return expandTilde2(envOverride);
420716
420859
  }
420717
- return join151(getTheusConfigHomeDir(), getPluginsDirectoryName());
420860
+ return join152(getTheusConfigHomeDir(), getPluginsDirectoryName());
420718
420861
  }
420719
420862
  function getPluginSeedDirs() {
420720
420863
  const raw = process.env.THEUS_CODE_PLUGIN_SEED_DIR;
@@ -420726,7 +420869,7 @@ function sanitizePluginId(pluginId) {
420726
420869
  return pluginId.replace(/[^a-zA-Z0-9\-_]/g, "-");
420727
420870
  }
420728
420871
  function pluginDataDirPath(pluginId) {
420729
- return join151(getPluginsDirectory(), "data", sanitizePluginId(pluginId));
420872
+ return join152(getPluginsDirectory(), "data", sanitizePluginId(pluginId));
420730
420873
  }
420731
420874
  function getPluginDataDir(pluginId) {
420732
420875
  const dir = pluginDataDirPath(pluginId);
@@ -420737,13 +420880,13 @@ async function getPluginDataDirSize(pluginId) {
420737
420880
  const dir = pluginDataDirPath(pluginId);
420738
420881
  let bytes = 0;
420739
420882
  const walk = async (p) => {
420740
- for (const entry of await readdir32(p, { withFileTypes: true })) {
420741
- const full = join151(p, entry.name);
420883
+ for (const entry of await readdir33(p, { withFileTypes: true })) {
420884
+ const full = join152(p, entry.name);
420742
420885
  if (entry.isDirectory()) {
420743
420886
  await walk(full);
420744
420887
  } else {
420745
420888
  try {
420746
- bytes += (await stat48(full)).size;
420889
+ bytes += (await stat49(full)).size;
420747
420890
  } catch {}
420748
420891
  }
420749
420892
  }
@@ -420778,8 +420921,8 @@ var init_pluginDirectories = __esm(() => {
420778
420921
  });
420779
420922
 
420780
420923
  // utils/plugins/lspPluginIntegration.ts
420781
- import { readFile as readFile55 } from "fs/promises";
420782
- import { join as join152, relative as relative31, resolve as resolve48 } from "path";
420924
+ import { readFile as readFile56 } from "fs/promises";
420925
+ import { join as join153, relative as relative31, resolve as resolve48 } from "path";
420783
420926
  function validatePathWithinPlugin(pluginPath, relativePath2) {
420784
420927
  const resolvedPluginPath = resolve48(pluginPath);
420785
420928
  const resolvedFilePath = resolve48(pluginPath, relativePath2);
@@ -420791,9 +420934,9 @@ function validatePathWithinPlugin(pluginPath, relativePath2) {
420791
420934
  }
420792
420935
  async function loadPluginLspServers(plugin2, errors4 = []) {
420793
420936
  const servers = {};
420794
- const lspJsonPath = join152(plugin2.path, ".lsp.json");
420937
+ const lspJsonPath = join153(plugin2.path, ".lsp.json");
420795
420938
  try {
420796
- const content = await readFile55(lspJsonPath, "utf-8");
420939
+ const content = await readFile56(lspJsonPath, "utf-8");
420797
420940
  const parsed = jsonParse(content);
420798
420941
  const result = exports_external.record(exports_external.string(), LspServerConfigSchema()).safeParse(parsed);
420799
420942
  if (result.success) {
@@ -420850,7 +420993,7 @@ async function loadLspServersFromManifest(declaration, pluginPath, pluginName, e
420850
420993
  continue;
420851
420994
  }
420852
420995
  try {
420853
- const content = await readFile55(validatedPath, "utf-8");
420996
+ const content = await readFile56(validatedPath, "utf-8");
420854
420997
  const parsed = jsonParse(content);
420855
420998
  const result = exports_external.record(exports_external.string(), LspServerConfigSchema()).safeParse(parsed);
420856
420999
  if (result.success) {
@@ -426050,9 +426193,9 @@ __export(exports_upstreamproxy, {
426050
426193
  getUpstreamProxyEnv: () => getUpstreamProxyEnv,
426051
426194
  SESSION_TOKEN_PATH: () => SESSION_TOKEN_PATH
426052
426195
  });
426053
- import { mkdir as mkdir48, readFile as readFile56, unlink as unlink24, writeFile as writeFile50 } from "fs/promises";
426196
+ import { mkdir as mkdir48, readFile as readFile57, unlink as unlink24, writeFile as writeFile50 } from "fs/promises";
426054
426197
  import { homedir as homedir41 } from "os";
426055
- import { join as join153 } from "path";
426198
+ import { join as join154 } from "path";
426056
426199
  async function initUpstreamProxy(opts) {
426057
426200
  if (!isEnvTruthy(process.env.THEUS_CODE_REMOTE)) {
426058
426201
  return state;
@@ -426073,7 +426216,7 @@ async function initUpstreamProxy(opts) {
426073
426216
  }
426074
426217
  setNonDumpable();
426075
426218
  const baseUrl = opts?.ccrBaseUrl ?? process.env.THEUS_BASE_URL ?? "https://api.theus.pe";
426076
- const caBundlePath = opts?.caBundlePath ?? join153(homedir41(), ".ccr", "ca-bundle.crt");
426219
+ const caBundlePath = opts?.caBundlePath ?? join154(homedir41(), ".ccr", "ca-bundle.crt");
426077
426220
  const caOk = await downloadCaBundle(baseUrl, opts?.systemCaPath ?? SYSTEM_CA_BUNDLE, caBundlePath);
426078
426221
  if (!caOk)
426079
426222
  return state;
@@ -426131,7 +426274,7 @@ function resetUpstreamProxyForTests() {
426131
426274
  }
426132
426275
  async function readToken(path19) {
426133
426276
  try {
426134
- const raw = await readFile56(path19, "utf8");
426277
+ const raw = await readFile57(path19, "utf8");
426135
426278
  return raw.trim() || null;
426136
426279
  } catch (err2) {
426137
426280
  if (isENOENT(err2))
@@ -426173,8 +426316,8 @@ async function downloadCaBundle(baseUrl, systemCaPath, outPath) {
426173
426316
  return false;
426174
426317
  }
426175
426318
  const ccrCa = await resp.text();
426176
- const systemCa = await readFile56(systemCaPath, "utf8").catch(() => "");
426177
- await mkdir48(join153(outPath, ".."), { recursive: true });
426319
+ const systemCa = await readFile57(systemCaPath, "utf8").catch(() => "");
426320
+ await mkdir48(join154(outPath, ".."), { recursive: true });
426178
426321
  await writeFile50(outPath, systemCa + `
426179
426322
  ` + ccrCa, "utf8");
426180
426323
  return true;
@@ -426603,14 +426746,14 @@ import {
426603
426746
  appendFile as appendFile7,
426604
426747
  chmod as chmod12,
426605
426748
  mkdir as mkdir49,
426606
- readdir as readdir33,
426749
+ readdir as readdir34,
426607
426750
  rmdir as rmdir3,
426608
- stat as stat49,
426751
+ stat as stat50,
426609
426752
  unlink as unlink25
426610
426753
  } from "fs/promises";
426611
426754
  import { createServer as createServer9 } from "net";
426612
426755
  import { platform as platform6 } from "os";
426613
- import { join as join154 } from "path";
426756
+ import { join as join155 } from "path";
426614
426757
  function log(message, ...args) {
426615
426758
  if (LOG_FILE) {
426616
426759
  const timestamp2 = new Date().toISOString();
@@ -426657,7 +426800,7 @@ class ChromeNativeHost {
426657
426800
  if (platform6() !== "win32") {
426658
426801
  const socketDir = getSocketDir();
426659
426802
  try {
426660
- const dirStats = await stat49(socketDir);
426803
+ const dirStats = await stat50(socketDir);
426661
426804
  if (!dirStats.isDirectory()) {
426662
426805
  await unlink25(socketDir);
426663
426806
  }
@@ -426665,7 +426808,7 @@ class ChromeNativeHost {
426665
426808
  await mkdir49(socketDir, { recursive: true, mode: 448 });
426666
426809
  await chmod12(socketDir, 448).catch(() => {});
426667
426810
  try {
426668
- const files2 = await readdir33(socketDir);
426811
+ const files2 = await readdir34(socketDir);
426669
426812
  for (const file2 of files2) {
426670
426813
  if (!file2.endsWith(".sock")) {
426671
426814
  continue;
@@ -426677,7 +426820,7 @@ class ChromeNativeHost {
426677
426820
  try {
426678
426821
  process.kill(pid, 0);
426679
426822
  } catch {
426680
- await unlink25(join154(socketDir, file2)).catch(() => {});
426823
+ await unlink25(join155(socketDir, file2)).catch(() => {});
426681
426824
  log(`Removed stale socket for PID ${pid}`);
426682
426825
  }
426683
426826
  }
@@ -426726,7 +426869,7 @@ class ChromeNativeHost {
426726
426869
  } catch {}
426727
426870
  try {
426728
426871
  const socketDir = getSocketDir();
426729
- const remaining = await readdir33(socketDir);
426872
+ const remaining = await readdir34(socketDir);
426730
426873
  if (remaining.length === 0) {
426731
426874
  await rmdir3(socketDir);
426732
426875
  log("Removed empty socket directory");
@@ -427626,7 +427769,7 @@ async function handleMemories(state2) {
427626
427769
  async function runProjectContextMcpServer() {
427627
427770
  const projectRoot = process.env.THEUS_PROJECT_ROOT || process.cwd();
427628
427771
  const state2 = new ProjectContextState(projectRoot);
427629
- const server2 = new Server({ name: SERVER_NAME, version: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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: {} } });
427772
+ const server2 = new Server({ name: SERVER_NAME, version: { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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: {} } });
427630
427773
  server2.setRequestHandler(ListToolsRequestSchema, async () => ({
427631
427774
  tools: TOOL_DEFINITIONS.map((t) => ({
427632
427775
  name: t.name,
@@ -427754,10 +427897,10 @@ var init_server3 = __esm(() => {
427754
427897
  import { execFile as execFile8 } from "child_process";
427755
427898
  import { existsSync as existsSync25, mkdirSync as mkdirSync12, readFileSync as readFileSync30, statSync as statSync14, unlinkSync as unlinkSync3, writeFileSync as writeFileSync10 } from "fs";
427756
427899
  import { homedir as homedir43, tmpdir as tmpdir13 } from "os";
427757
- import { join as join155 } from "path";
427900
+ import { join as join156 } from "path";
427758
427901
  import { promisify as promisify6 } from "util";
427759
427902
  function cuDir() {
427760
- const dir = join155(homedir43(), ".theus", "cu");
427903
+ const dir = join156(homedir43(), ".theus", "cu");
427761
427904
  if (!existsSync25(dir))
427762
427905
  mkdirSync12(dir, { recursive: true });
427763
427906
  return dir;
@@ -427805,7 +427948,7 @@ async function getScreenGeometry(force = false) {
427805
427948
  return cachedGeometry;
427806
427949
  }
427807
427950
  async function checkPermissions() {
427808
- const probe = join155(tmpdir13(), `theus-cu-probe-${process.pid}.jpg`);
427951
+ const probe = join156(tmpdir13(), `theus-cu-probe-${process.pid}.jpg`);
427809
427952
  const cap = await run6(SCREENCAPTURE, ["-x", "-t", "jpg", probe], { timeoutMs: 8000 });
427810
427953
  const screenRecording = existsSync25(probe) && (() => {
427811
427954
  try {
@@ -427834,8 +427977,8 @@ async function checkPermissions() {
427834
427977
  async function captureScreenshot(opts = {}) {
427835
427978
  const maxSide = opts.maxSide ?? 1400;
427836
427979
  const quality = Math.min(Math.max(opts.quality ?? 72, 1), 100);
427837
- const raw = join155(cuDir(), `shot-${process.pid}.png`);
427838
- const out = join155(cuDir(), `shot-${process.pid}.jpg`);
427980
+ const raw = join156(cuDir(), `shot-${process.pid}.png`);
427981
+ const out = join156(cuDir(), `shot-${process.pid}.jpg`);
427839
427982
  const capArgs = ["-x", "-t", "png", "-o"];
427840
427983
  if (opts.displayIndex && opts.displayIndex > 0)
427841
427984
  capArgs.push("-D", String(opts.displayIndex));
@@ -427999,8 +428142,8 @@ async function ensureScrollHelper() {
427999
428142
  return scrollBinPromise;
428000
428143
  scrollBinPromise = (async () => {
428001
428144
  if (!existsSync25(SWIFTC) && SWIFTC === "swiftc") {}
428002
- const src = join155(cuDir(), "scroll.swift");
428003
- const bin = join155(cuDir(), "theus-cu-scroll");
428145
+ const src = join156(cuDir(), "scroll.swift");
428146
+ const bin = join156(cuDir(), "theus-cu-scroll");
428004
428147
  if (existsSync25(bin))
428005
428148
  return bin;
428006
428149
  try {
@@ -428331,7 +428474,7 @@ __export(exports_selftest, {
428331
428474
  runComputerUseSelfTest: () => runComputerUseSelfTest
428332
428475
  });
428333
428476
  import { existsSync as existsSync26, writeFileSync as writeFileSync11 } from "fs";
428334
- import { join as join156 } from "path";
428477
+ import { join as join157 } from "path";
428335
428478
  import { homedir as homedir44 } from "os";
428336
428479
  async function runComputerUseSelfTest() {
428337
428480
  let pass = 0;
@@ -428383,7 +428526,7 @@ Geometr\xEDa y captura:`);
428383
428526
  let captureOk = false;
428384
428527
  try {
428385
428528
  const shot = await captureScreenshot();
428386
- const outPath = join156(homedir44(), ".theus", "cu", "selftest-shot.jpg");
428529
+ const outPath = join157(homedir44(), ".theus", "cu", "selftest-shot.jpg");
428387
428530
  writeFileSync11(outPath, Buffer.from(shot.base64, "base64"));
428388
428531
  ok2(`Captura ${shot.width}\xD7${shot.height} px, ${Math.round(shot.base64.length * 0.75 / 1024)} KB \u2192 ${outPath}`);
428389
428532
  captureOk = true;
@@ -429236,7 +429379,7 @@ import {
429236
429379
  lstat as lstat7,
429237
429380
  mkdir as mkdir50,
429238
429381
  open as open20,
429239
- readFile as readFile57,
429382
+ readFile as readFile58,
429240
429383
  rename as rename10,
429241
429384
  unlink as unlink26
429242
429385
  } from "fs/promises";
@@ -429246,21 +429389,21 @@ function defaultFleetCredentialsPath() {
429246
429389
  return resolve52(homedir45(), ".theus", "titan", "fleet-worker.json");
429247
429390
  }
429248
429391
  async function rejectSymlink(path19) {
429249
- const stat50 = await lstat7(path19).catch((error40) => {
429392
+ const stat51 = await lstat7(path19).catch((error40) => {
429250
429393
  if (error40.code === "ENOENT")
429251
429394
  return;
429252
429395
  throw error40;
429253
429396
  });
429254
- if (stat50?.isSymbolicLink()) {
429397
+ if (stat51?.isSymbolicLink()) {
429255
429398
  throw new Error("Se rechaz\xF3 un symlink como almac\xE9n de credenciales Fleet");
429256
429399
  }
429257
- if (stat50 && !stat50.isFile()) {
429400
+ if (stat51 && !stat51.isFile()) {
429258
429401
  throw new Error("El almac\xE9n de credenciales Fleet no es un archivo regular");
429259
429402
  }
429260
429403
  }
429261
429404
  async function loadFleetCredentials(path19 = defaultFleetCredentialsPath()) {
429262
429405
  await rejectSymlink(path19);
429263
- const raw = await readFile57(path19, "utf8").catch((error40) => {
429406
+ const raw = await readFile58(path19, "utf8").catch((error40) => {
429264
429407
  if (error40.code === "ENOENT")
429265
429408
  return;
429266
429409
  throw error40;
@@ -429324,9 +429467,9 @@ import {
429324
429467
  lstat as lstat8,
429325
429468
  mkdir as mkdir51,
429326
429469
  open as open21,
429327
- readFile as readFile58,
429470
+ readFile as readFile59,
429328
429471
  rename as rename11,
429329
- stat as stat50,
429472
+ stat as stat51,
429330
429473
  unlink as unlink27
429331
429474
  } from "fs/promises";
429332
429475
  import { homedir as homedir46 } from "os";
@@ -429396,7 +429539,7 @@ async function rejectSymlink2(path19) {
429396
429539
  }
429397
429540
  async function readRecords(path19) {
429398
429541
  await rejectSymlink2(path19);
429399
- const info = await stat50(path19).catch((error40) => {
429542
+ const info = await stat51(path19).catch((error40) => {
429400
429543
  if (error40.code === "ENOENT")
429401
429544
  return;
429402
429545
  throw error40;
@@ -429413,7 +429556,7 @@ async function readRecords(path19) {
429413
429556
  throw new FleetOutboxCorruptError("El outbox Fleet excede el l\xEDmite de bytes");
429414
429557
  }
429415
429558
  try {
429416
- const parsed = outboxFileSchema.parse(JSON.parse(await readFile58(path19, "utf8")));
429559
+ const parsed = outboxFileSchema.parse(JSON.parse(await readFile59(path19, "utf8")));
429417
429560
  const ids = new Set;
429418
429561
  return parsed.records.map((record3) => {
429419
429562
  const checked = validateRecord(record3);
@@ -430303,7 +430446,7 @@ async function runTitanFleetWorker(args) {
430303
430446
  max_concurrency: maxConcurrency,
430304
430447
  runtime: {
430305
430448
  name: "theus-cli",
430306
- version: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
430449
+ version: { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
430307
430450
  }
430308
430451
  });
430309
430452
  const client2 = new TitanFleetClient({
@@ -430831,7 +430974,7 @@ __export(exports_titan_fleet_run, {
430831
430974
  parseFleetPlanFile: () => parseFleetPlanFile,
430832
430975
  describeFleetRunError: () => describeFleetRunError
430833
430976
  });
430834
- import { readFile as readFile59 } from "fs/promises";
430977
+ import { readFile as readFile60 } from "fs/promises";
430835
430978
  import { resolve as resolve55 } from "path";
430836
430979
  function valuesAfter(args, name) {
430837
430980
  const found = [];
@@ -430942,7 +431085,7 @@ async function runTitanFleetRun(args) {
430942
431085
  process.stdout.write(HELP3);
430943
431086
  return;
430944
431087
  }
430945
- const build = options2.planPath ? parseFleetPlanFile(await readFile59(resolve55(options2.planPath), "utf8")) : options2.build;
431088
+ const build = options2.planPath ? parseFleetPlanFile(await readFile60(resolve55(options2.planPath), "utf8")) : options2.build;
430946
431089
  if (!build) {
430947
431090
  throw new FleetProducerError("No hay nada que encolar");
430948
431091
  }
@@ -431024,15 +431167,15 @@ var init_titan_fleet_run = __esm(() => {
431024
431167
  });
431025
431168
 
431026
431169
  // utils/cronTasksLock.ts
431027
- import { mkdir as mkdir52, readFile as readFile60, unlink as unlink28, writeFile as writeFile51 } from "fs/promises";
431028
- import { dirname as dirname66, join as join157 } from "path";
431170
+ import { mkdir as mkdir52, readFile as readFile61, unlink as unlink28, writeFile as writeFile51 } from "fs/promises";
431171
+ import { dirname as dirname66, join as join158 } from "path";
431029
431172
  function getLockPath(dir) {
431030
- return join157(dir ?? getProjectRoot(), LOCK_FILE_REL);
431173
+ return join158(dir ?? getProjectRoot(), LOCK_FILE_REL);
431031
431174
  }
431032
431175
  async function readLock(dir) {
431033
431176
  let raw;
431034
431177
  try {
431035
- raw = await readFile60(getLockPath(dir), "utf8");
431178
+ raw = await readFile61(getLockPath(dir), "utf8");
431036
431179
  } catch {
431037
431180
  return;
431038
431181
  }
@@ -431133,7 +431276,7 @@ var init_cronTasksLock = __esm(() => {
431133
431276
  init_genericProcessUtils();
431134
431277
  init_json();
431135
431278
  init_slowOperations();
431136
- LOCK_FILE_REL = join157(".theus", "scheduled_tasks.lock");
431279
+ LOCK_FILE_REL = join158(".theus", "scheduled_tasks.lock");
431137
431280
  schedulerLockSchema = lazySchema(() => exports_external.object({
431138
431281
  sessionId: exports_external.string(),
431139
431282
  pid: exports_external.number(),
@@ -431441,10 +431584,10 @@ import {
431441
431584
  writeFileSync as writeFileSync12
431442
431585
  } from "fs";
431443
431586
  import { homedir as homedir47 } from "os";
431444
- import { dirname as dirname67, join as join158 } from "path";
431587
+ import { dirname as dirname67, join as join159 } from "path";
431445
431588
  import { fileURLToPath as fileURLToPath7 } from "url";
431446
431589
  function projectsConfigPath() {
431447
- return join158(homedir47(), ".theus", "daemon", "projects.json");
431590
+ return join159(homedir47(), ".theus", "daemon", "projects.json");
431448
431591
  }
431449
431592
  function readEnabledProjects() {
431450
431593
  let raw;
@@ -431463,17 +431606,17 @@ function readEnabledProjects() {
431463
431606
  return list3.filter((p) => p && typeof p.dir === "string" && p.enabled !== false);
431464
431607
  }
431465
431608
  function daemonDir2() {
431466
- return join158(homedir47(), ".theus", "daemon");
431609
+ return join159(homedir47(), ".theus", "daemon");
431467
431610
  }
431468
431611
  function daemonLogPath() {
431469
- return join158(daemonDir2(), "daemon.log");
431612
+ return join159(daemonDir2(), "daemon.log");
431470
431613
  }
431471
431614
  function resolveWorkerBin() {
431472
431615
  const override = process.env.THEUS_DAEMON_WORKER_BIN;
431473
431616
  if (typeof override === "string" && override.length > 0)
431474
431617
  return override;
431475
431618
  const here = dirname67(fileURLToPath7(import.meta.url));
431476
- return join158(here, "..", "bin", "theus");
431619
+ return join159(here, "..", "bin", "theus");
431477
431620
  }
431478
431621
  function turnTimeoutMs() {
431479
431622
  const raw = process.env.THEUS_DAEMON_TURN_TIMEOUT_MS;
@@ -431506,10 +431649,10 @@ function logDaemonLine(line) {
431506
431649
  }
431507
431650
  function writeRunHistory(record3) {
431508
431651
  try {
431509
- const dir = join158(daemonDir2(), "runs", record3.taskId);
431652
+ const dir = join159(daemonDir2(), "runs", record3.taskId);
431510
431653
  mkdirSync13(dir, { recursive: true });
431511
431654
  const stamp2 = record3.startedAt.replace(/:/g, "-");
431512
- writeFileSync12(join158(dir, `${stamp2}.json`), JSON.stringify(record3, null, 2), "utf8");
431655
+ writeFileSync12(join159(dir, `${stamp2}.json`), JSON.stringify(record3, null, 2), "utf8");
431513
431656
  pruneRunHistory(record3.taskId);
431514
431657
  } catch (e) {
431515
431658
  logDaemonLine(`[daemon:cron] ERROR guardando historial task=${record3.taskId}: ${e?.message}`);
@@ -431520,13 +431663,13 @@ function pruneRunHistory(taskId) {
431520
431663
  const raw = process.env.THEUS_DAEMON_RUNS_KEEP;
431521
431664
  const parsed = raw ? Number.parseInt(raw, 10) : NaN;
431522
431665
  const keep = Number.isInteger(parsed) && parsed > 0 ? parsed : 50;
431523
- const dir = join158(daemonDir2(), "runs", taskId);
431666
+ const dir = join159(daemonDir2(), "runs", taskId);
431524
431667
  const files2 = readdirSync5(dir).filter((f) => f.endsWith(".json")).sort();
431525
431668
  if (files2.length <= keep)
431526
431669
  return;
431527
431670
  for (const f of files2.slice(0, files2.length - keep)) {
431528
431671
  try {
431529
- unlinkSync4(join158(dir, f));
431672
+ unlinkSync4(join159(dir, f));
431530
431673
  } catch {}
431531
431674
  }
431532
431675
  } catch {}
@@ -431716,15 +431859,15 @@ import {
431716
431859
  writeFileSync as writeFileSync13
431717
431860
  } from "fs";
431718
431861
  import { homedir as homedir48 } from "os";
431719
- import { dirname as dirname68, join as join159 } from "path";
431862
+ import { dirname as dirname68, join as join160 } from "path";
431720
431863
  function daemonDir3() {
431721
- return join159(homedir48(), ".theus", "daemon");
431864
+ return join160(homedir48(), ".theus", "daemon");
431722
431865
  }
431723
431866
  function pidFilePath() {
431724
- return join159(daemonDir3(), "theus-daemon.pid");
431867
+ return join160(daemonDir3(), "theus-daemon.pid");
431725
431868
  }
431726
431869
  function logFilePath() {
431727
- return join159(daemonDir3(), "daemon.log");
431870
+ return join160(daemonDir3(), "daemon.log");
431728
431871
  }
431729
431872
  function ensureDaemonDir() {
431730
431873
  mkdirSync14(daemonDir3(), { recursive: true });
@@ -431822,7 +431965,7 @@ function resolveTheusBin() {
431822
431965
  return "theus";
431823
431966
  }
431824
431967
  function macosServiceSpec() {
431825
- const path19 = join159(homedir48(), "Library", "LaunchAgents", "pe.theus.daemon.plist");
431968
+ const path19 = join160(homedir48(), "Library", "LaunchAgents", "pe.theus.daemon.plist");
431826
431969
  const bin = resolveTheusBin();
431827
431970
  const logDir = daemonDir3();
431828
431971
  const content = `<?xml version="1.0" encoding="UTF-8"?>
@@ -431849,9 +431992,9 @@ function macosServiceSpec() {
431849
431992
  <key>KeepAlive</key>
431850
431993
  <true/>
431851
431994
  <key>StandardOutPath</key>
431852
- <string>${join159(logDir, "launchd.out.log")}</string>
431995
+ <string>${join160(logDir, "launchd.out.log")}</string>
431853
431996
  <key>StandardErrorPath</key>
431854
- <string>${join159(logDir, "launchd.err.log")}</string>
431997
+ <string>${join160(logDir, "launchd.err.log")}</string>
431855
431998
  </dict>
431856
431999
  </plist>
431857
432000
  `;
@@ -431866,7 +432009,7 @@ function macosServiceSpec() {
431866
432009
  };
431867
432010
  }
431868
432011
  function linuxServiceSpec() {
431869
- const path19 = join159(homedir48(), ".config", "systemd", "user", "theus-daemon.service");
432012
+ const path19 = join160(homedir48(), ".config", "systemd", "user", "theus-daemon.service");
431870
432013
  const bin = resolveTheusBin();
431871
432014
  const content = `[Unit]
431872
432015
  Description=Theus daemon (cron/agent supervisor)
@@ -432194,7 +432337,7 @@ function createBridgeLogger(options2) {
432194
432337
  connectUrl = buildBridgeConnectUrl(environmentId, cachedIngressUrl);
432195
432338
  regenerateQr(connectUrl);
432196
432339
  if (verbose) {
432197
- write(source_default.dim(`Remote Control`) + ` v${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}
432340
+ write(source_default.dim(`Remote Control`) + ` v${{ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}
432198
432341
  `);
432199
432342
  }
432200
432343
  if (verbose) {
@@ -432602,7 +432745,7 @@ var init_pollConfig = __esm(() => {
432602
432745
  import { spawn as spawn13 } from "child_process";
432603
432746
  import { createWriteStream as createWriteStream4 } from "fs";
432604
432747
  import { tmpdir as tmpdir14 } from "os";
432605
- import { dirname as dirname69, join as join160 } from "path";
432748
+ import { dirname as dirname69, join as join161 } from "path";
432606
432749
  import { createInterface } from "readline";
432607
432750
  function safeFilenameId(id2) {
432608
432751
  return id2.replace(/[^a-zA-Z0-9_-]/g, "_");
@@ -432735,12 +432878,12 @@ function createSessionSpawner(deps) {
432735
432878
  debugFile = `${deps.debugFile}-${safeId}`;
432736
432879
  }
432737
432880
  } else if (deps.verbose || false) {
432738
- debugFile = join160(tmpdir14(), "theus", `bridge-session-${safeId}.log`);
432881
+ debugFile = join161(tmpdir14(), "theus", `bridge-session-${safeId}.log`);
432739
432882
  }
432740
432883
  let transcriptStream = null;
432741
432884
  let transcriptPath;
432742
432885
  if (deps.debugFile) {
432743
- transcriptPath = join160(dirname69(deps.debugFile), `bridge-transcript-${safeId}.jsonl`);
432886
+ transcriptPath = join161(dirname69(deps.debugFile), `bridge-transcript-${safeId}.jsonl`);
432744
432887
  transcriptStream = createWriteStream4(transcriptPath, { flags: "a" });
432745
432888
  transcriptStream.on("error", (err2) => {
432746
432889
  deps.onDebug(`[bridge:session] Transcript write error: ${err2.message}`);
@@ -433013,10 +433156,10 @@ __export(exports_bridgePointer, {
433013
433156
  clearBridgePointer: () => clearBridgePointer,
433014
433157
  BRIDGE_POINTER_TTL_MS: () => BRIDGE_POINTER_TTL_MS
433015
433158
  });
433016
- import { mkdir as mkdir53, readFile as readFile61, stat as stat51, unlink as unlink29, writeFile as writeFile52 } from "fs/promises";
433017
- import { dirname as dirname70, join as join161 } from "path";
433159
+ import { mkdir as mkdir53, readFile as readFile62, stat as stat52, unlink as unlink29, writeFile as writeFile52 } from "fs/promises";
433160
+ import { dirname as dirname70, join as join162 } from "path";
433018
433161
  function getBridgePointerPath(dir) {
433019
- return join161(getProjectsDir(), sanitizePath2(dir), "bridge-pointer.json");
433162
+ return join162(getProjectsDir(), sanitizePath2(dir), "bridge-pointer.json");
433020
433163
  }
433021
433164
  async function writeBridgePointer(dir, pointer) {
433022
433165
  const path19 = getBridgePointerPath(dir);
@@ -433033,8 +433176,8 @@ async function readBridgePointer(dir) {
433033
433176
  let raw;
433034
433177
  let mtimeMs;
433035
433178
  try {
433036
- mtimeMs = (await stat51(path19)).mtimeMs;
433037
- raw = await readFile61(path19, "utf8");
433179
+ mtimeMs = (await stat52(path19)).mtimeMs;
433180
+ raw = await readFile62(path19, "utf8");
433038
433181
  } catch {
433039
433182
  return null;
433040
433183
  }
@@ -433118,12 +433261,12 @@ var init_bridgePointer = __esm(() => {
433118
433261
  });
433119
433262
 
433120
433263
  // utils/errorLogSink.ts
433121
- import { dirname as dirname71, join as join162 } from "path";
433264
+ import { dirname as dirname71, join as join163 } from "path";
433122
433265
  function getErrorsPath() {
433123
- return join162(CACHE_PATHS.errors(), DATE + ".jsonl");
433266
+ return join163(CACHE_PATHS.errors(), DATE + ".jsonl");
433124
433267
  }
433125
433268
  function getMCPLogsPath(serverName) {
433126
- return join162(CACHE_PATHS.mcpLogs(serverName), DATE + ".jsonl");
433269
+ return join163(CACHE_PATHS.mcpLogs(serverName), DATE + ".jsonl");
433127
433270
  }
433128
433271
  function createJsonlWriter(options2) {
433129
433272
  const writer = createBufferedWriter(options2);
@@ -433167,7 +433310,7 @@ function appendToLog(path19, message) {
433167
433310
  cwd: getFsImplementation().cwd(),
433168
433311
  userType: "external",
433169
433312
  sessionId: getSessionId(),
433170
- version: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
433313
+ version: { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
433171
433314
  };
433172
433315
  getLogWriter(path19).write(messageWithTimestamp);
433173
433316
  }
@@ -433279,7 +433422,7 @@ __export(exports_bridgeMain, {
433279
433422
  });
433280
433423
  import { randomUUID as randomUUID42 } from "crypto";
433281
433424
  import { hostname as hostname4, tmpdir as tmpdir15 } from "os";
433282
- import { basename as basename51, join as join163, resolve as resolve56 } from "path";
433425
+ import { basename as basename51, join as join164, resolve as resolve56 } from "path";
433283
433426
  async function isMultiSessionSpawnEnabled() {
433284
433427
  return checkGate_CACHED_OR_BLOCKING("theus_ccr_bridge_multi_session");
433285
433428
  }
@@ -433792,7 +433935,7 @@ async function runBridgeLoop(config3, environmentId, environmentSecret, api2, sp
433792
433935
  sessionDebugFile = `${config3.debugFile}-${safeId}`;
433793
433936
  }
433794
433937
  } else if (config3.verbose || false) {
433795
- sessionDebugFile = join163(tmpdir15(), "theus", `bridge-session-${safeId}.log`);
433938
+ sessionDebugFile = join164(tmpdir15(), "theus", `bridge-session-${safeId}.log`);
433796
433939
  }
433797
433940
  if (sessionDebugFile) {
433798
433941
  logger.logVerbose(`Debug log: ${sessionDebugFile}`);
@@ -434428,7 +434571,7 @@ Spawn mode for this project:
434428
434571
  const api2 = createBridgeApiClient({
434429
434572
  baseUrl,
434430
434573
  getAccessToken: getBridgeAccessToken2,
434431
- runnerVersion: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
434574
+ runnerVersion: { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
434432
434575
  onDebug: logForDebugging,
434433
434576
  onAuth401: handleOAuth401Error2,
434434
434577
  getTrustedDeviceToken
@@ -434666,7 +434809,7 @@ async function runBridgeHeadless(opts, signal) {
434666
434809
  const api2 = createBridgeApiClient({
434667
434810
  baseUrl,
434668
434811
  getAccessToken: opts.getAccessToken,
434669
- runnerVersion: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
434812
+ runnerVersion: { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
434670
434813
  onDebug: log2,
434671
434814
  onAuth401: opts.onAuth401,
434672
434815
  getTrustedDeviceToken
@@ -437763,7 +437906,7 @@ function buildSystemInitMessage(inputs) {
437763
437906
  slash_commands: inputs.commands.filter((c5) => c5.userInvocable !== false).map((c5) => c5.name),
437764
437907
  apiKeySource: getTheusApiKeyWithSource().source,
437765
437908
  betas: getSdkBetas(),
437766
- theus_code_version: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
437909
+ theus_code_version: { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
437767
437910
  output_style: outputStyle2,
437768
437911
  agents: inputs.agents.map((agent) => agent.agentType),
437769
437912
  skills: inputs.skills.filter((s) => s.userInvocable !== false).map((skill) => skill.name),
@@ -437803,8 +437946,8 @@ async function getEnvLessBridgeConfig() {
437803
437946
  }
437804
437947
  async function checkEnvLessBridgeMinVersion() {
437805
437948
  const cfg = await getEnvLessBridgeConfig();
437806
- if (cfg.min_version && lt({ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
437807
- return `Your version of Theus (${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.
437949
+ if (cfg.min_version && lt({ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
437950
+ return `Your version of Theus (${{ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.
437808
437951
  Version ${cfg.min_version} or higher is required. Run \`theus update\` to update.`;
437809
437952
  }
437810
437953
  return null;
@@ -440128,7 +440271,7 @@ async function initBridgeCore(params) {
440128
440271
  const rawApi = createBridgeApiClient({
440129
440272
  baseUrl,
440130
440273
  getAccessToken,
440131
- runnerVersion: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
440274
+ runnerVersion: { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
440132
440275
  onDebug: logForDebugging,
440133
440276
  onAuth401,
440134
440277
  getTrustedDeviceToken
@@ -441962,7 +442105,7 @@ __export(exports_inboundAttachments, {
441962
442105
  });
441963
442106
  import { randomUUID as randomUUID47 } from "crypto";
441964
442107
  import { mkdir as mkdir54, writeFile as writeFile53 } from "fs/promises";
441965
- import { basename as basename52, join as join164 } from "path";
442108
+ import { basename as basename52, join as join165 } from "path";
441966
442109
  function debug2(msg) {
441967
442110
  logForDebugging(`[bridge:inbound-attach] ${msg}`);
441968
442111
  }
@@ -441978,7 +442121,7 @@ function sanitizeFileName(name) {
441978
442121
  return base2 || "attachment";
441979
442122
  }
441980
442123
  function uploadsDir() {
441981
- return join164(getTheusConfigHomeDir(), "uploads", getSessionId());
442124
+ return join165(getTheusConfigHomeDir(), "uploads", getSessionId());
441982
442125
  }
441983
442126
  async function resolveOne(att) {
441984
442127
  const token = getBridgeAccessToken();
@@ -442007,7 +442150,7 @@ async function resolveOne(att) {
442007
442150
  const safeName = sanitizeFileName(att.file_name);
442008
442151
  const prefix = (att.file_uuid.slice(0, 8) || randomUUID47().slice(0, 8)).replace(/[^a-zA-Z0-9_-]/g, "_");
442009
442152
  const dir = uploadsDir();
442010
- const outPath = join164(dir, `${prefix}-${safeName}`);
442153
+ const outPath = join165(dir, `${prefix}-${safeName}`);
442011
442154
  try {
442012
442155
  await mkdir54(dir, { recursive: true });
442013
442156
  await writeFile53(outPath, data);
@@ -448867,7 +449010,7 @@ var init_ShowInIDEPrompt = __esm(() => {
448867
449010
 
448868
449011
  // components/permissions/FilePermissionDialog/permissionOptions.tsx
448869
449012
  import { homedir as homedir49 } from "os";
448870
- import { basename as basename56, join as join165, sep as sep34 } from "path";
449013
+ import { basename as basename56, join as join166, sep as sep34 } from "path";
448871
449014
  function isInTheusFolder(filePath) {
448872
449015
  const absolutePath = expandPath(filePath);
448873
449016
  const theusFolderPath = expandPath(`${getOriginalCwd()}/.theus`);
@@ -448877,7 +449020,7 @@ function isInTheusFolder(filePath) {
448877
449020
  }
448878
449021
  function isInGlobalTheusFolder(filePath) {
448879
449022
  const absolutePath = expandPath(filePath);
448880
- const globalTheusFolderPath = join165(homedir49(), ".theus");
449023
+ const globalTheusFolderPath = join166(homedir49(), ".theus");
448881
449024
  const normalizedAbsolutePath = normalizeCaseForComparison(absolutePath);
448882
449025
  const normalizedGlobalTheusFolderPath = normalizeCaseForComparison(globalTheusFolderPath);
448883
449026
  return normalizedAbsolutePath.startsWith(normalizedGlobalTheusFolderPath + sep34.toLowerCase()) || normalizedAbsolutePath.startsWith(normalizedGlobalTheusFolderPath + "/");
@@ -456769,7 +456912,7 @@ var init_useVoiceEnabled = __esm(() => {
456769
456912
  function getSemverPart(version3) {
456770
456913
  return `${import_semver11.major(version3, { loose: true })}.${import_semver11.minor(version3, { loose: true })}.${import_semver11.patch(version3, { loose: true })}`;
456771
456914
  }
456772
- function useUpdateNotification(updatedVersion, initialVersion = { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION) {
456915
+ function useUpdateNotification(updatedVersion, initialVersion = { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION) {
456773
456916
  const [lastNotifiedSemver, setLastNotifiedSemver] = import_react235.useState(() => getSemverPart(initialVersion));
456774
456917
  if (!updatedVersion) {
456775
456918
  return null;
@@ -456809,7 +456952,7 @@ function AutoUpdater({
456809
456952
  return;
456810
456953
  }
456811
456954
  if (false) {}
456812
- const currentVersion = { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
456955
+ const currentVersion = { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
456813
456956
  const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
456814
456957
  let latestVersion = await getLatestVersion(channel2);
456815
456958
  const isDisabled2 = isAutoUpdaterDisabled();
@@ -456944,7 +457087,7 @@ function AutoUpdater({
456944
457087
  " ",
456945
457088
  /* @__PURE__ */ jsx_runtime414.jsx(ThemedText, {
456946
457089
  bold: true,
456947
- children: hasLocalInstall ? `cd ~/.theus/local && npm update ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.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.70", BUILD_TIME: "1970-01-01T00:00:00.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}`
457090
+ children: hasLocalInstall ? `cd ~/.theus/local && npm update ${{ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.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.71", BUILD_TIME: "1970-01-01T00:00:00.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}`
456948
457091
  })
456949
457092
  ]
456950
457093
  })
@@ -457021,12 +457164,12 @@ function NativeAutoUpdater({
457021
457164
  logEvent("theus_native_auto_updater_start", {});
457022
457165
  try {
457023
457166
  const maxVersion = await getMaxVersion();
457024
- if (maxVersion && gt({ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
457167
+ if (maxVersion && gt({ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
457025
457168
  const msg = await getMaxVersionMessage();
457026
457169
  setMaxVersionIssue(msg ?? "affects your version");
457027
457170
  }
457028
457171
  const result = await installLatest(channel2);
457029
- const currentVersion = { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
457172
+ const currentVersion = { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
457030
457173
  const latencyMs = Date.now() - startTime2;
457031
457174
  if (result.lockFailed) {
457032
457175
  logEvent("theus_native_auto_updater_lock_contention", {
@@ -457163,17 +457306,17 @@ function PackageManagerAutoUpdater(t0) {
457163
457306
  const maxVersion = await getMaxVersion();
457164
457307
  if (maxVersion && latest && gt(latest, maxVersion)) {
457165
457308
  logForDebugging(`PackageManagerAutoUpdater: maxVersion ${maxVersion} is set, capping update from ${latest} to ${maxVersion}`);
457166
- if (gte({ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
457167
- logForDebugging(`PackageManagerAutoUpdater: current version ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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`);
457309
+ if (gte({ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
457310
+ logForDebugging(`PackageManagerAutoUpdater: current version ${{ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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`);
457168
457311
  setUpdateAvailable(false);
457169
457312
  return;
457170
457313
  }
457171
457314
  latest = maxVersion;
457172
457315
  }
457173
- const hasUpdate = latest && !gte({ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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);
457316
+ const hasUpdate = latest && !gte({ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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);
457174
457317
  setUpdateAvailable(!!hasUpdate);
457175
457318
  if (hasUpdate) {
457176
- logForDebugging(`PackageManagerAutoUpdater: Update available ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}`);
457319
+ logForDebugging(`PackageManagerAutoUpdater: Update available ${{ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}`);
457177
457320
  }
457178
457321
  };
457179
457322
  $2[0] = t1;
@@ -457207,7 +457350,7 @@ function PackageManagerAutoUpdater(t0) {
457207
457350
  wrap: "truncate",
457208
457351
  children: [
457209
457352
  "versi\xF3n actual: ",
457210
- { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
457353
+ { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
457211
457354
  ]
457212
457355
  });
457213
457356
  $2[3] = verbose;
@@ -465070,7 +465213,7 @@ function buildStatusLineCommandInput(permissionMode2, exceeds200kTokens, setting
465070
465213
  project_dir: getOriginalCwd(),
465071
465214
  added_dirs: addedDirs
465072
465215
  },
465073
- version: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
465216
+ version: { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
465074
465217
  output_style: {
465075
465218
  name: outputStyleName
465076
465219
  },
@@ -471058,9 +471201,9 @@ function initSkillImprovement() {
471058
471201
  async function applySkillImprovement(skillName, updates) {
471059
471202
  if (!skillName)
471060
471203
  return;
471061
- const { join: join166 } = await import("path");
471204
+ const { join: join167 } = await import("path");
471062
471205
  const fs5 = await import("fs/promises");
471063
- const filePath = join166(getCwd(), ".theus", "skills", skillName, "SKILL.md");
471206
+ const filePath = join167(getCwd(), ".theus", "skills", skillName, "SKILL.md");
471064
471207
  let currentContent;
471065
471208
  try {
471066
471209
  currentContent = await fs5.readFile(filePath, "utf-8");
@@ -471212,7 +471355,7 @@ function useMoreRight(_args) {
471212
471355
  }
471213
471356
 
471214
471357
  // utils/cleanup.ts
471215
- import { join as join166 } from "path";
471358
+ import { join as join167 } from "path";
471216
471359
  function getCutoffDate() {
471217
471360
  const settings = getSettings_DEPRECATED() || {};
471218
471361
  const cleanupPeriodDays = settings.cleanupPeriodDays ?? DEFAULT_CLEANUP_PERIOD_DAYS;
@@ -471237,7 +471380,7 @@ async function cleanupOldFilesInDirectory(dirPath, cutoffDate, isMessagePath) {
471237
471380
  try {
471238
471381
  const timestamp2 = convertFileNameToDate(file2.name);
471239
471382
  if (timestamp2 < cutoffDate) {
471240
- await getFsImplementation().unlink(join166(dirPath, file2.name));
471383
+ await getFsImplementation().unlink(join167(dirPath, file2.name));
471241
471384
  if (isMessagePath) {
471242
471385
  result.messages++;
471243
471386
  } else {
@@ -471268,7 +471411,7 @@ async function cleanupOldMessageFiles() {
471268
471411
  } catch {
471269
471412
  return result;
471270
471413
  }
471271
- const mcpLogDirs = dirents.filter((dirent) => dirent.isDirectory() && dirent.name.startsWith("mcp-logs-")).map((dirent) => join166(baseCachePath, dirent.name));
471414
+ const mcpLogDirs = dirents.filter((dirent) => dirent.isDirectory() && dirent.name.startsWith("mcp-logs-")).map((dirent) => join167(baseCachePath, dirent.name));
471272
471415
  for (const mcpLogDir of mcpLogDirs) {
471273
471416
  result = addCleanupResults(result, await cleanupOldFilesInDirectory(mcpLogDir, cutoffDate, true));
471274
471417
  await tryRmdir(mcpLogDir, fsImpl);
@@ -471307,7 +471450,7 @@ async function cleanupOldSessionFiles() {
471307
471450
  for (const projectDirent of projectDirents) {
471308
471451
  if (!projectDirent.isDirectory())
471309
471452
  continue;
471310
- const projectDir = join166(projectsDir, projectDirent.name);
471453
+ const projectDir = join167(projectsDir, projectDirent.name);
471311
471454
  let entries;
471312
471455
  try {
471313
471456
  entries = await fsImpl.readdir(projectDir);
@@ -471321,15 +471464,15 @@ async function cleanupOldSessionFiles() {
471321
471464
  continue;
471322
471465
  }
471323
471466
  try {
471324
- if (await unlinkIfOld(join166(projectDir, entry.name), cutoffDate, fsImpl)) {
471467
+ if (await unlinkIfOld(join167(projectDir, entry.name), cutoffDate, fsImpl)) {
471325
471468
  result.messages++;
471326
471469
  }
471327
471470
  } catch {
471328
471471
  result.errors++;
471329
471472
  }
471330
471473
  } else if (entry.isDirectory()) {
471331
- const sessionDir = join166(projectDir, entry.name);
471332
- const toolResultsDir = join166(sessionDir, TOOL_RESULTS_SUBDIR);
471474
+ const sessionDir = join167(projectDir, entry.name);
471475
+ const toolResultsDir = join167(sessionDir, TOOL_RESULTS_SUBDIR);
471333
471476
  let toolDirs;
471334
471477
  try {
471335
471478
  toolDirs = await fsImpl.readdir(toolResultsDir);
@@ -471340,14 +471483,14 @@ async function cleanupOldSessionFiles() {
471340
471483
  for (const toolEntry of toolDirs) {
471341
471484
  if (toolEntry.isFile()) {
471342
471485
  try {
471343
- if (await unlinkIfOld(join166(toolResultsDir, toolEntry.name), cutoffDate, fsImpl)) {
471486
+ if (await unlinkIfOld(join167(toolResultsDir, toolEntry.name), cutoffDate, fsImpl)) {
471344
471487
  result.messages++;
471345
471488
  }
471346
471489
  } catch {
471347
471490
  result.errors++;
471348
471491
  }
471349
471492
  } else if (toolEntry.isDirectory()) {
471350
- const toolDirPath = join166(toolResultsDir, toolEntry.name);
471493
+ const toolDirPath = join167(toolResultsDir, toolEntry.name);
471351
471494
  let toolFiles;
471352
471495
  try {
471353
471496
  toolFiles = await fsImpl.readdir(toolDirPath);
@@ -471358,7 +471501,7 @@ async function cleanupOldSessionFiles() {
471358
471501
  if (!tf.isFile())
471359
471502
  continue;
471360
471503
  try {
471361
- if (await unlinkIfOld(join166(toolDirPath, tf.name), cutoffDate, fsImpl)) {
471504
+ if (await unlinkIfOld(join167(toolDirPath, tf.name), cutoffDate, fsImpl)) {
471362
471505
  result.messages++;
471363
471506
  }
471364
471507
  } catch {
@@ -471390,7 +471533,7 @@ async function cleanupSingleDirectory(dirPath, extension, removeEmptyDir = true)
471390
471533
  if (!dirent.isFile() || !dirent.name.endsWith(extension))
471391
471534
  continue;
471392
471535
  try {
471393
- if (await unlinkIfOld(join166(dirPath, dirent.name), cutoffDate, fsImpl)) {
471536
+ if (await unlinkIfOld(join167(dirPath, dirent.name), cutoffDate, fsImpl)) {
471394
471537
  result.messages++;
471395
471538
  }
471396
471539
  } catch {
@@ -471403,7 +471546,7 @@ async function cleanupSingleDirectory(dirPath, extension, removeEmptyDir = true)
471403
471546
  return result;
471404
471547
  }
471405
471548
  function cleanupOldPlanFiles() {
471406
- const plansDir = join166(getTheusConfigHomeDir(), "plans");
471549
+ const plansDir = join167(getTheusConfigHomeDir(), "plans");
471407
471550
  return cleanupSingleDirectory(plansDir, ".md");
471408
471551
  }
471409
471552
  async function cleanupOldFileHistoryBackups() {
@@ -471412,14 +471555,14 @@ async function cleanupOldFileHistoryBackups() {
471412
471555
  const fsImpl = getFsImplementation();
471413
471556
  try {
471414
471557
  const configDir = getTheusConfigHomeDir();
471415
- const fileHistoryStorageDir = join166(configDir, "file-history");
471558
+ const fileHistoryStorageDir = join167(configDir, "file-history");
471416
471559
  let dirents;
471417
471560
  try {
471418
471561
  dirents = await fsImpl.readdir(fileHistoryStorageDir);
471419
471562
  } catch {
471420
471563
  return result;
471421
471564
  }
471422
- const fileHistorySessionsDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join166(fileHistoryStorageDir, dirent.name));
471565
+ const fileHistorySessionsDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join167(fileHistoryStorageDir, dirent.name));
471423
471566
  await Promise.all(fileHistorySessionsDirs.map(async (fileHistorySessionDir) => {
471424
471567
  try {
471425
471568
  const stats2 = await fsImpl.stat(fileHistorySessionDir);
@@ -471446,14 +471589,14 @@ async function cleanupOldSessionEnvDirs() {
471446
471589
  const fsImpl = getFsImplementation();
471447
471590
  try {
471448
471591
  const configDir = getTheusConfigHomeDir();
471449
- const sessionEnvBaseDir = join166(configDir, "session-env");
471592
+ const sessionEnvBaseDir = join167(configDir, "session-env");
471450
471593
  let dirents;
471451
471594
  try {
471452
471595
  dirents = await fsImpl.readdir(sessionEnvBaseDir);
471453
471596
  } catch {
471454
471597
  return result;
471455
471598
  }
471456
- const sessionEnvDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join166(sessionEnvBaseDir, dirent.name));
471599
+ const sessionEnvDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join167(sessionEnvBaseDir, dirent.name));
471457
471600
  for (const sessionEnvDir of sessionEnvDirs) {
471458
471601
  try {
471459
471602
  const stats2 = await fsImpl.stat(sessionEnvDir);
@@ -471475,7 +471618,7 @@ async function cleanupOldDebugLogs() {
471475
471618
  const cutoffDate = getCutoffDate();
471476
471619
  const result = { messages: 0, errors: 0 };
471477
471620
  const fsImpl = getFsImplementation();
471478
- const debugDir = join166(getTheusConfigHomeDir(), "debug");
471621
+ const debugDir = join167(getTheusConfigHomeDir(), "debug");
471479
471622
  let dirents;
471480
471623
  try {
471481
471624
  dirents = await fsImpl.readdir(debugDir);
@@ -471487,7 +471630,7 @@ async function cleanupOldDebugLogs() {
471487
471630
  continue;
471488
471631
  }
471489
471632
  try {
471490
- if (await unlinkIfOld(join166(debugDir, dirent.name), cutoffDate, fsImpl)) {
471633
+ if (await unlinkIfOld(join167(debugDir, dirent.name), cutoffDate, fsImpl)) {
471491
471634
  result.messages++;
471492
471635
  }
471493
471636
  } catch {
@@ -474699,7 +474842,7 @@ __export(exports_asciicast, {
474699
474842
  _resetRecordingStateForTesting: () => _resetRecordingStateForTesting
474700
474843
  });
474701
474844
  import { appendFile as appendFile8, rename as rename12 } from "fs/promises";
474702
- import { basename as basename65, dirname as dirname72, join as join168 } from "path";
474845
+ import { basename as basename65, dirname as dirname72, join as join169 } from "path";
474703
474846
  function getRecordFilePath() {
474704
474847
  if (recordingState.filePath !== null) {
474705
474848
  return recordingState.filePath;
@@ -474710,10 +474853,10 @@ function getRecordFilePath() {
474710
474853
  if (!isEnvTruthy(process.env.THEUS_CODE_TERMINAL_RECORDING)) {
474711
474854
  return null;
474712
474855
  }
474713
- const projectsDir = join168(getTheusConfigHomeDir(), "projects");
474714
- const projectDir = join168(projectsDir, sanitizePath2(getOriginalCwd()));
474856
+ const projectsDir = join169(getTheusConfigHomeDir(), "projects");
474857
+ const projectDir = join169(projectsDir, sanitizePath2(getOriginalCwd()));
474715
474858
  recordingState.timestamp = Date.now();
474716
- recordingState.filePath = join168(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
474859
+ recordingState.filePath = join169(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
474717
474860
  return recordingState.filePath;
474718
474861
  }
474719
474862
  function _resetRecordingStateForTesting() {
@@ -474722,13 +474865,13 @@ function _resetRecordingStateForTesting() {
474722
474865
  }
474723
474866
  function getSessionRecordingPaths() {
474724
474867
  const sessionId = getSessionId();
474725
- const projectsDir = join168(getTheusConfigHomeDir(), "projects");
474726
- const projectDir = join168(projectsDir, sanitizePath2(getOriginalCwd()));
474868
+ const projectsDir = join169(getTheusConfigHomeDir(), "projects");
474869
+ const projectDir = join169(projectsDir, sanitizePath2(getOriginalCwd()));
474727
474870
  try {
474728
474871
  const entries = getFsImplementation().readdirSync(projectDir);
474729
474872
  const names = typeof entries[0] === "string" ? entries : entries.map((e) => e.name);
474730
474873
  const files2 = names.filter((f) => f.startsWith(sessionId) && f.endsWith(".cast")).sort();
474731
- return files2.map((f) => join168(projectDir, f));
474874
+ return files2.map((f) => join169(projectDir, f));
474732
474875
  } catch {
474733
474876
  return [];
474734
474877
  }
@@ -474738,9 +474881,9 @@ async function renameRecordingForSession() {
474738
474881
  if (!oldPath || recordingState.timestamp === 0) {
474739
474882
  return;
474740
474883
  }
474741
- const projectsDir = join168(getTheusConfigHomeDir(), "projects");
474742
- const projectDir = join168(projectsDir, sanitizePath2(getOriginalCwd()));
474743
- const newPath = join168(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
474884
+ const projectsDir = join169(getTheusConfigHomeDir(), "projects");
474885
+ const projectDir = join169(projectsDir, sanitizePath2(getOriginalCwd()));
474886
+ const newPath = join169(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
474744
474887
  if (oldPath === newPath) {
474745
474888
  return;
474746
474889
  }
@@ -477502,8 +477645,8 @@ var init_useAwaySummary = __esm(() => {
477502
477645
  });
477503
477646
 
477504
477647
  // utils/theusInChrome/setupPortable.ts
477505
- import { readdir as readdir34 } from "fs/promises";
477506
- import { join as join169 } from "path";
477648
+ import { readdir as readdir35 } from "fs/promises";
477649
+ import { join as join170 } from "path";
477507
477650
  function getExtensionIds() {
477508
477651
  return [THEUS_BROWSER_EXTENSION_ID];
477509
477652
  }
@@ -477516,7 +477659,7 @@ async function detectExtensionInstallationPortable(browserPaths, log2) {
477516
477659
  for (const { browser, path: browserBasePath } of browserPaths) {
477517
477660
  let browserProfileEntries = [];
477518
477661
  try {
477519
- browserProfileEntries = await readdir34(browserBasePath, {
477662
+ browserProfileEntries = await readdir35(browserBasePath, {
477520
477663
  withFileTypes: true
477521
477664
  });
477522
477665
  } catch (e) {
@@ -477530,9 +477673,9 @@ async function detectExtensionInstallationPortable(browserPaths, log2) {
477530
477673
  }
477531
477674
  for (const profile of profileDirs) {
477532
477675
  for (const extensionId of extensionIds) {
477533
- const extensionPath = join169(browserBasePath, profile, "Extensions", extensionId);
477676
+ const extensionPath = join170(browserBasePath, profile, "Extensions", extensionId);
477534
477677
  try {
477535
- await readdir34(extensionPath);
477678
+ await readdir35(extensionPath);
477536
477679
  log2?.(`[Theus in Chrome] Extension ${extensionId} found in ${browser} ${profile}`);
477537
477680
  return { isInstalled: true, browser };
477538
477681
  } catch {}
@@ -477552,9 +477695,9 @@ var init_setupPortable = __esm(() => {
477552
477695
  });
477553
477696
 
477554
477697
  // utils/theusInChrome/setup.ts
477555
- import { chmod as chmod15, mkdir as mkdir55, readFile as readFile62, writeFile as writeFile54 } from "fs/promises";
477698
+ import { chmod as chmod15, mkdir as mkdir55, readFile as readFile63, writeFile as writeFile54 } from "fs/promises";
477556
477699
  import { homedir as homedir50 } from "os";
477557
- import { join as join170 } from "path";
477700
+ import { join as join171 } from "path";
477558
477701
  import { fileURLToPath as fileURLToPath8 } from "url";
477559
477702
  function isTheusInChromeEngineAvailable() {
477560
477703
  return Array.isArray(BROWSER_TOOLS);
@@ -477618,8 +477761,8 @@ function setupTheusInChrome() {
477618
477761
  };
477619
477762
  } else {
477620
477763
  const __filename3 = fileURLToPath8(import.meta.url);
477621
- const __dirname3 = join170(__filename3, "..");
477622
- const cliPath = join170(__dirname3, "cli.js");
477764
+ const __dirname3 = join171(__filename3, "..");
477765
+ const cliPath = join171(__dirname3, "cli.js");
477623
477766
  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" }));
477624
477767
  const mcpConfig = {
477625
477768
  [THEUS_IN_CHROME_MCP_SERVER_NAME]: {
@@ -477641,8 +477784,8 @@ function getNativeMessagingHostsDirs() {
477641
477784
  const platform7 = getPlatform();
477642
477785
  if (platform7 === "windows") {
477643
477786
  const home = homedir50();
477644
- const appData = process.env.APPDATA || join170(home, "AppData", "Local");
477645
- return [join170(appData, "Theus", "ChromeNativeHost")];
477787
+ const appData = process.env.APPDATA || join171(home, "AppData", "Local");
477788
+ return [join171(appData, "Theus", "ChromeNativeHost")];
477646
477789
  }
477647
477790
  return getAllNativeMessagingHostsDirs().map(({ path: path21 }) => path21);
477648
477791
  }
@@ -477661,8 +477804,8 @@ async function installChromeNativeHostManifest(manifestBinaryPath) {
477661
477804
  const manifestContent = jsonStringify(manifest, null, 2);
477662
477805
  let anyManifestUpdated = false;
477663
477806
  for (const manifestDir of manifestDirs) {
477664
- const manifestPath = join170(manifestDir, NATIVE_HOST_MANIFEST_NAME);
477665
- const existingContent = await readFile62(manifestPath, "utf-8").catch(() => null);
477807
+ const manifestPath = join171(manifestDir, NATIVE_HOST_MANIFEST_NAME);
477808
+ const existingContent = await readFile63(manifestPath, "utf-8").catch(() => null);
477666
477809
  if (existingContent === manifestContent) {
477667
477810
  continue;
477668
477811
  }
@@ -477676,7 +477819,7 @@ async function installChromeNativeHostManifest(manifestBinaryPath) {
477676
477819
  }
477677
477820
  }
477678
477821
  if (getPlatform() === "windows") {
477679
- const manifestPath = join170(manifestDirs[0], NATIVE_HOST_MANIFEST_NAME);
477822
+ const manifestPath = join171(manifestDirs[0], NATIVE_HOST_MANIFEST_NAME);
477680
477823
  registerWindowsNativeHosts(manifestPath);
477681
477824
  }
477682
477825
  if (anyManifestUpdated) {
@@ -477714,8 +477857,8 @@ function registerWindowsNativeHosts(manifestPath) {
477714
477857
  }
477715
477858
  async function createWrapperScript(command9) {
477716
477859
  const platform7 = getPlatform();
477717
- const chromeDir = join170(getTheusConfigHomeDir(), "chrome");
477718
- const wrapperPath = platform7 === "windows" ? join170(chromeDir, "chrome-native-host.bat") : join170(chromeDir, "chrome-native-host");
477860
+ const chromeDir = join171(getTheusConfigHomeDir(), "chrome");
477861
+ const wrapperPath = platform7 === "windows" ? join171(chromeDir, "chrome-native-host.bat") : join171(chromeDir, "chrome-native-host");
477719
477862
  const scriptContent = platform7 === "windows" ? `@echo off
477720
477863
  REM Chrome native host wrapper script
477721
477864
  REM Generated by Theus - do not edit manually
@@ -477725,7 +477868,7 @@ ${command9}
477725
477868
  # Generated by Theus - do not edit manually
477726
477869
  exec ${command9}
477727
477870
  `;
477728
- const existingContent = await readFile62(wrapperPath, "utf-8").catch(() => null);
477871
+ const existingContent = await readFile63(wrapperPath, "utf-8").catch(() => null);
477729
477872
  if (existingContent === scriptContent) {
477730
477873
  return wrapperPath;
477731
477874
  }
@@ -477844,7 +477987,7 @@ var init_useChromeExtensionNotification = __esm(() => {
477844
477987
  });
477845
477988
 
477846
477989
  // utils/plugins/officialMarketplaceStartupCheck.ts
477847
- import { join as join171 } from "path";
477990
+ import { join as join172 } from "path";
477848
477991
  function isOfficialMarketplaceAutoInstallDisabled() {
477849
477992
  if (isEnvTruthy(process.env.THEUS_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL)) {
477850
477993
  return true;
@@ -477922,7 +478065,7 @@ async function checkAndInstallOfficialMarketplace() {
477922
478065
  return { installed: false, skipped: true, reason: "policy_blocked" };
477923
478066
  }
477924
478067
  const cacheDir = getMarketplacesCacheDir();
477925
- const installLocation = join171(cacheDir, OFFICIAL_MARKETPLACE_NAME);
478068
+ const installLocation = join172(cacheDir, OFFICIAL_MARKETPLACE_NAME);
477926
478069
  const gcsSha = await fetchOfficialMarketplaceFromGcs(installLocation, cacheDir);
477927
478070
  if (gcsSha !== null) {
477928
478071
  const known = await loadKnownMarketplacesConfig();
@@ -480706,7 +480849,7 @@ var init_usePluginRecommendationBase = __esm(() => {
480706
480849
  });
480707
480850
 
480708
480851
  // hooks/useLspPluginRecommendation.tsx
480709
- import { extname as extname20, join as join172 } from "path";
480852
+ import { extname as extname20, join as join173 } from "path";
480710
480853
  function useLspPluginRecommendation() {
480711
480854
  const $2 = c3(12);
480712
480855
  const trackedFiles = useAppState(_temp202);
@@ -480791,7 +480934,7 @@ function useLspPluginRecommendation() {
480791
480934
  case "yes": {
480792
480935
  installPluginAndNotify(pluginId, pluginName, "lsp-plugin", addNotification, async (pluginData) => {
480793
480936
  logForDebugging(`[useLspPluginRecommendation] Installing plugin: ${pluginId}`);
480794
- const localSourcePath = typeof pluginData.entry.source === "string" ? join172(pluginData.marketplaceInstallLocation, pluginData.entry.source) : undefined;
480937
+ const localSourcePath = typeof pluginData.entry.source === "string" ? join173(pluginData.marketplaceInstallLocation, pluginData.entry.source) : undefined;
480795
480938
  await cacheAndRegisterPlugin(pluginId, pluginData.entry, "user", undefined, localSourcePath);
480796
480939
  const settings = getSettingsForSource("userSettings");
480797
480940
  updateSettingsForSource("userSettings", {
@@ -483995,7 +484138,7 @@ var exports_REPL = {};
483995
484138
  __export(exports_REPL, {
483996
484139
  REPL: () => REPL
483997
484140
  });
483998
- import { dirname as dirname74, join as join173 } from "path";
484141
+ import { dirname as dirname74, join as join174 } from "path";
483999
484142
  import { tmpdir as tmpdir16 } from "os";
484000
484143
  import { writeFile as writeFile55 } from "fs/promises";
484001
484144
  import { randomUUID as randomUUID61 } from "crypto";
@@ -486629,7 +486772,7 @@ Note: ctrl + z now suspends Theus, ctrl + _ undoes input.
486629
486772
  const w = Math.max(80, (process.stdout.columns ?? 80) - 6);
486630
486773
  const raw = await renderMessagesToPlainText(deferredMessages, tools, w);
486631
486774
  const text2 = raw.replace(/[ \t]+$/gm, "");
486632
- const path21 = join173(tmpdir16(), `cc-transcript-${Date.now()}.txt`);
486775
+ const path21 = join174(tmpdir16(), `cc-transcript-${Date.now()}.txt`);
486633
486776
  await writeFile55(path21, text2);
486634
486777
  const opened = openFileInExternalEditor(path21);
486635
486778
  setStatus(opened ? `opening ${path21}` : `wrote ${path21} \xB7 no $VISUAL/$EDITOR set`);
@@ -489393,7 +489536,7 @@ function completeOnboarding() {
489393
489536
  saveGlobalConfig((current) => ({
489394
489537
  ...current,
489395
489538
  hasCompletedOnboarding: true,
489396
- lastOnboardingVersion: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
489539
+ lastOnboardingVersion: { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
489397
489540
  }));
489398
489541
  }
489399
489542
  function showDialog(root2, renderer) {
@@ -489624,15 +489767,15 @@ var init_interactiveHelpers = __esm(() => {
489624
489767
 
489625
489768
  // components/Theus/arsenalStats.ts
489626
489769
  import { existsSync as existsSync29, readdirSync as readdirSync6 } from "fs";
489627
- import { dirname as dirname75, join as join174 } from "path";
489770
+ import { dirname as dirname75, join as join175 } from "path";
489628
489771
  import { fileURLToPath as fileURLToPath9 } from "url";
489629
489772
  function countBundledArsenalSkills() {
489630
489773
  try {
489631
489774
  const here = dirname75(fileURLToPath9(import.meta.url));
489632
489775
  for (const dir of [
489633
- join174(here, "..", "..", "vendor", "theus-arsenal", "skills"),
489634
- join174(here, "vendor", "theus-arsenal", "skills"),
489635
- join174(here, "..", "vendor", "theus-arsenal", "skills")
489776
+ join175(here, "..", "..", "vendor", "theus-arsenal", "skills"),
489777
+ join175(here, "vendor", "theus-arsenal", "skills"),
489778
+ join175(here, "..", "vendor", "theus-arsenal", "skills")
489636
489779
  ]) {
489637
489780
  if (!existsSync29(dir))
489638
489781
  continue;
@@ -489713,6 +489856,166 @@ var init_arsenalStats = __esm(() => {
489713
489856
  };
489714
489857
  });
489715
489858
 
489859
+ // services/import/detect/global.ts
489860
+ import { existsSync as existsSync30 } from "fs";
489861
+ import { open as open22, readdir as readdir36, stat as stat53 } from "fs/promises";
489862
+ import { join as join176 } from "path";
489863
+ async function rutaDelTranscript(fichero) {
489864
+ let crudo;
489865
+ try {
489866
+ const fh = await open22(fichero, "r");
489867
+ try {
489868
+ const buf = Buffer.alloc(65536);
489869
+ const { bytesRead } = await fh.read(buf, 0, buf.length, 0);
489870
+ crudo = buf.subarray(0, bytesRead).toString("utf8");
489871
+ } finally {
489872
+ await fh.close();
489873
+ }
489874
+ } catch {
489875
+ return null;
489876
+ }
489877
+ for (const linea of crudo.split(`
489878
+ `)) {
489879
+ if (!linea.trim())
489880
+ continue;
489881
+ try {
489882
+ const obj = JSON.parse(linea);
489883
+ const ruta = obj.relocatedCwd ?? obj.cwd;
489884
+ if (typeof ruta === "string" && ruta.startsWith("/"))
489885
+ return ruta;
489886
+ } catch {
489887
+ continue;
489888
+ }
489889
+ }
489890
+ return null;
489891
+ }
489892
+ async function explorarTodoElTrabajo(entorno) {
489893
+ const raiz = join176(directorioConfig(entorno), "projects");
489894
+ let directorios;
489895
+ try {
489896
+ directorios = await readdir36(raiz);
489897
+ } catch {
489898
+ return [];
489899
+ }
489900
+ const salida = [];
489901
+ for (const dir of directorios) {
489902
+ const ruta = join176(raiz, dir);
489903
+ let sesiones;
489904
+ try {
489905
+ sesiones = (await readdir36(ruta)).filter((n3) => n3.endsWith(".jsonl"));
489906
+ } catch {
489907
+ continue;
489908
+ }
489909
+ if (sesiones.length === 0)
489910
+ continue;
489911
+ let bytes = 0;
489912
+ let masReciente = 0;
489913
+ let ficheroMasReciente = sesiones[0];
489914
+ for (const nombre of sesiones) {
489915
+ try {
489916
+ const info = await stat53(join176(ruta, nombre));
489917
+ bytes += info.size;
489918
+ if (info.mtimeMs > masReciente) {
489919
+ masReciente = info.mtimeMs;
489920
+ ficheroMasReciente = nombre;
489921
+ }
489922
+ } catch {}
489923
+ }
489924
+ const proyecto = await rutaDelTranscript(join176(ruta, ficheroMasReciente));
489925
+ if (!proyecto)
489926
+ continue;
489927
+ salida.push({
489928
+ herramienta: "claude-code",
489929
+ etiqueta: nombreCorto(proyecto),
489930
+ ruta,
489931
+ sesiones: sesiones.length,
489932
+ masReciente,
489933
+ bytes,
489934
+ proyecto,
489935
+ existe: existsSync30(proyecto)
489936
+ });
489937
+ }
489938
+ return salida.sort((a2, b) => {
489939
+ if (a2.existe !== b.existe)
489940
+ return a2.existe ? -1 : 1;
489941
+ return b.masReciente - a2.masReciente;
489942
+ });
489943
+ }
489944
+ function nombreCorto(rutaAbsoluta) {
489945
+ const partes = rutaAbsoluta.split("/").filter(Boolean);
489946
+ return partes[partes.length - 1] ?? rutaAbsoluta;
489947
+ }
489948
+ var init_global = __esm(() => {
489949
+ init_claudeCode();
489950
+ });
489951
+
489952
+ // services/import/detect/importarTodo.ts
489953
+ var exports_importarTodo = {};
489954
+ __export(exports_importarTodo, {
489955
+ resumirTrabajo: () => resumirTrabajo,
489956
+ importarTrabajoCompleto: () => importarTrabajoCompleto,
489957
+ explorarTrabajoConMemoria: () => explorarTrabajoConMemoria
489958
+ });
489959
+ function aHecho(nota) {
489960
+ return {
489961
+ title: nota.titulo.slice(0, 120),
489962
+ text: nota.texto,
489963
+ ...nota.categoria ? { category: nota.categoria } : {}
489964
+ };
489965
+ }
489966
+ async function explorarTrabajoConMemoria(entorno) {
489967
+ const proyectos = await explorarTodoElTrabajo(entorno);
489968
+ const salida = [];
489969
+ for (const p of proyectos) {
489970
+ if (!p.existe)
489971
+ continue;
489972
+ const fuente = await explorarMemoria({
489973
+ ...entorno,
489974
+ proyecto: p.proyecto
489975
+ }).catch(() => null);
489976
+ if (!fuente || fuente.sesiones === 0)
489977
+ continue;
489978
+ salida.push({ ...p, notas: fuente.sesiones });
489979
+ }
489980
+ return salida;
489981
+ }
489982
+ async function importarTrabajoCompleto(entorno, proyectos, alAvanzar) {
489983
+ let hechosGuardados = 0;
489984
+ let proyectosImportados = 0;
489985
+ const fallidos = [];
489986
+ for (let i3 = 0;i3 < proyectos.length; i3++) {
489987
+ const p = proyectos[i3];
489988
+ try {
489989
+ const fuente = await explorarMemoria({ ...entorno, proyecto: p.proyecto });
489990
+ if (!fuente)
489991
+ continue;
489992
+ const notas = await leerMemoria(fuente);
489993
+ if (notas.length === 0)
489994
+ continue;
489995
+ const resultado = await persistImportedFacts(notas.map(aHecho), "agente-local", p.proyecto);
489996
+ if (resultado.saved > 0) {
489997
+ hechosGuardados += resultado.saved;
489998
+ proyectosImportados++;
489999
+ }
490000
+ } catch {
490001
+ fallidos.push(p.etiqueta);
490002
+ }
490003
+ alAvanzar?.(hechosGuardados, i3 + 1, proyectos.length);
490004
+ }
490005
+ return { proyectosImportados, hechosGuardados, fallidos };
490006
+ }
490007
+ function resumirTrabajo(proyectos) {
490008
+ const notas = proyectos.reduce((n3, p) => n3 + p.notas, 0);
490009
+ const pl2 = proyectos.length === 1 ? "1 proyecto" : `${proyectos.length} proyectos`;
490010
+ const nl = notas === 1 ? "1 nota" : `${notas} notas`;
490011
+ return `${pl2} \xB7 ${nl} ya resumidas`;
490012
+ }
490013
+ var init_importarTodo = __esm(() => {
490014
+ init_global();
490015
+ init_memoriaAgente();
490016
+ init_persist();
490017
+ });
490018
+
489716
490019
  // components/Theus/OnboardingWizard.tsx
489717
490020
  var exports_OnboardingWizard = {};
489718
490021
  __export(exports_OnboardingWizard, {
@@ -489721,8 +490024,8 @@ __export(exports_OnboardingWizard, {
489721
490024
  default: () => OnboardingWizard_default,
489722
490025
  OnboardingWizard: () => OnboardingWizard
489723
490026
  });
489724
- import { existsSync as existsSync30, mkdirSync as mkdirSync15, writeFileSync as writeFileSync14 } from "fs";
489725
- import { join as join175 } from "path";
490027
+ import { existsSync as existsSync31, mkdirSync as mkdirSync15, writeFileSync as writeFileSync14 } from "fs";
490028
+ import { join as join177 } from "path";
489726
490029
  function hasSeenOnboardingWizard() {
489727
490030
  if (isEnvTruthy(process.env.THEUS_FORCE_ONBOARDING_WIZARD))
489728
490031
  return false;
@@ -489730,7 +490033,7 @@ function hasSeenOnboardingWizard() {
489730
490033
  return true;
489731
490034
  }
489732
490035
  try {
489733
- return existsSync30(join175(getTheusConfigHome(), WIZARD_MARKER));
490036
+ return existsSync31(join177(getTheusConfigHome(), WIZARD_MARKER));
489734
490037
  } catch {
489735
490038
  return true;
489736
490039
  }
@@ -489739,7 +490042,7 @@ function markOnboardingWizardSeen() {
489739
490042
  try {
489740
490043
  const home = getTheusConfigHome();
489741
490044
  mkdirSync15(home, { recursive: true });
489742
- writeFileSync14(join175(home, WIZARD_MARKER), `${JSON.stringify({
490045
+ writeFileSync14(join177(home, WIZARD_MARKER), `${JSON.stringify({
489743
490046
  seenAt: new Date().toISOString(),
489744
490047
  version: globalThis.MACRO?.VERSION ?? null
489745
490048
  })}
@@ -490066,6 +490369,21 @@ function StepImport() {
490066
490369
  const mono = policy.colorMode === "mono";
490067
490370
  const ascii = policy.glyphMode === "ascii";
490068
490371
  const [mode, setMode] = import_react335.useState("intro");
490372
+ const [trabajo, setTrabajo] = import_react335.useState([]);
490373
+ const [progreso, setProgreso] = import_react335.useState(null);
490374
+ const [resultado, setResultado] = import_react335.useState(null);
490375
+ import_react335.useEffect(() => {
490376
+ let vivo = true;
490377
+ Promise.resolve().then(() => (init_importarTodo(), exports_importarTodo)).then(async (m) => {
490378
+ const { entornoActual: entornoActual2 } = await Promise.resolve().then(() => (init_registry4(), exports_registry2));
490379
+ const encontrado = await m.explorarTrabajoConMemoria(entornoActual2(getCwd()));
490380
+ if (vivo)
490381
+ setTrabajo(encontrado);
490382
+ }).catch(() => {});
490383
+ return () => {
490384
+ vivo = false;
490385
+ };
490386
+ }, []);
490069
490387
  const [Importer, setImporter] = import_react335.useState(null);
490070
490388
  const [loadError, setLoadError] = import_react335.useState(false);
490071
490389
  const abortRef = import_react335.useRef(null);
@@ -490139,36 +490457,142 @@ function StepImport() {
490139
490457
  })
490140
490458
  });
490141
490459
  }
490460
+ if (mode === "todo") {
490461
+ return /* @__PURE__ */ jsx_runtime488.jsx(WizardChrome, {
490462
+ title: "Trayendo tu trabajo",
490463
+ footer: "",
490464
+ children: /* @__PURE__ */ jsx_runtime488.jsx(ThemedBox_default, {
490465
+ flexDirection: "column",
490466
+ gap: 1,
490467
+ children: resultado ? /* @__PURE__ */ jsx_runtime488.jsxs(jsx_runtime488.Fragment, {
490468
+ children: [
490469
+ /* @__PURE__ */ jsx_runtime488.jsxs(ThemedText, {
490470
+ children: [
490471
+ "Listo: ",
490472
+ /* @__PURE__ */ jsx_runtime488.jsx(ThemedText, {
490473
+ bold: true,
490474
+ children: resultado.hechosGuardados
490475
+ }),
490476
+ " ",
490477
+ resultado.hechosGuardados === 1 ? "nota tra\xEDda" : "notas tra\xEDdas",
490478
+ " de",
490479
+ " ",
490480
+ /* @__PURE__ */ jsx_runtime488.jsx(ThemedText, {
490481
+ bold: true,
490482
+ children: resultado.proyectosImportados
490483
+ }),
490484
+ " ",
490485
+ resultado.proyectosImportados === 1 ? "proyecto" : "proyectos",
490486
+ "."
490487
+ ]
490488
+ }),
490489
+ /* @__PURE__ */ jsx_runtime488.jsx(Text, {
490490
+ dim: true,
490491
+ children: "Cada proyecto guarda lo suyo: al abrir cualquiera de esas carpetas, Theus ya sabr\xE1 en qu\xE9 andabas."
490492
+ }),
490493
+ /* @__PURE__ */ jsx_runtime488.jsx(Select, {
490494
+ options: [{ label: "Continuar", value: "next" }],
490495
+ layout: "compact",
490496
+ onChange: () => goNext(),
490497
+ onCancel: () => goNext()
490498
+ })
490499
+ ]
490500
+ }) : /* @__PURE__ */ jsx_runtime488.jsxs(ThemedText, {
490501
+ children: [
490502
+ "Trayendo tu memoria\u2026",
490503
+ " ",
490504
+ progreso ? `${progreso.i} de ${progreso.total}` : ""
490505
+ ]
490506
+ })
490507
+ })
490508
+ });
490509
+ }
490510
+ const totalNotas = trabajo.reduce((n3, p) => n3 + p.notas, 0);
490142
490511
  return /* @__PURE__ */ jsx_runtime488.jsxs(WizardChrome, {
490143
490512
  title: "Trae tu contexto",
490144
490513
  footer: ascii ? "Enter importar | s Omitir | Esc atras" : "Enter importar \xB7 Omitir este paso \xB7 Esc atr\xE1s",
490145
490514
  children: [
490146
- /* @__PURE__ */ jsx_runtime488.jsxs(ThemedBox_default, {
490515
+ /* @__PURE__ */ jsx_runtime488.jsx(ThemedBox_default, {
490147
490516
  flexDirection: "column",
490148
- children: [
490149
- /* @__PURE__ */ jsx_runtime488.jsx(ThemedText, {
490150
- children: "Sube el export de otra IA y Theus arrancar\xE1 conoci\xE9ndote."
490151
- }),
490152
- /* @__PURE__ */ jsx_runtime488.jsx(Text, {
490153
- dim: true,
490154
- children: "Se procesa de forma ef\xEDmera; nunca guardamos tu export."
490155
- })
490156
- ]
490517
+ children: trabajo.length > 0 ? /* @__PURE__ */ jsx_runtime488.jsxs(jsx_runtime488.Fragment, {
490518
+ children: [
490519
+ /* @__PURE__ */ jsx_runtime488.jsxs(ThemedText, {
490520
+ children: [
490521
+ "Ya trabajaste con otra IA en",
490522
+ " ",
490523
+ /* @__PURE__ */ jsx_runtime488.jsxs(ThemedText, {
490524
+ bold: true,
490525
+ children: [
490526
+ trabajo.length,
490527
+ " ",
490528
+ trabajo.length === 1 ? "proyecto" : "proyectos"
490529
+ ]
490530
+ }),
490531
+ " ",
490532
+ "de este equipo, con ",
490533
+ /* @__PURE__ */ jsx_runtime488.jsx(ThemedText, {
490534
+ bold: true,
490535
+ children: totalNotas
490536
+ }),
490537
+ " notas ya resumidas. Puedo tra\xE9rtelas."
490538
+ ]
490539
+ }),
490540
+ /* @__PURE__ */ jsx_runtime488.jsx(Text, {
490541
+ dim: true,
490542
+ children: "Todav\xEDa no he abierto ninguna: solo he mirado cu\xE1ntas hay. Como ya est\xE1n resumidas, traerlas no consulta al modelo \u2014 no gasta nada de tu plan y no sale nada de tu equipo."
490543
+ })
490544
+ ]
490545
+ }) : /* @__PURE__ */ jsx_runtime488.jsxs(jsx_runtime488.Fragment, {
490546
+ children: [
490547
+ /* @__PURE__ */ jsx_runtime488.jsx(ThemedText, {
490548
+ children: "Sube el export de otra IA y Theus arrancar\xE1 conoci\xE9ndote."
490549
+ }),
490550
+ /* @__PURE__ */ jsx_runtime488.jsx(Text, {
490551
+ dim: true,
490552
+ children: "El archivo se lee de forma ef\xEDmera: no se copia ni se guarda."
490553
+ })
490554
+ ]
490555
+ })
490157
490556
  }),
490158
490557
  /* @__PURE__ */ jsx_runtime488.jsx(ThemedBox_default, {
490159
490558
  marginTop: 1,
490160
490559
  flexDirection: "column",
490161
490560
  children: /* @__PURE__ */ jsx_runtime488.jsx(Select, {
490162
490561
  options: [
490562
+ ...trabajo.length > 0 ? [
490563
+ {
490564
+ label: "S\xED, trae mi trabajo",
490565
+ value: "todo",
490566
+ description: `${trabajo.length} ${trabajo.length === 1 ? "proyecto" : "proyectos"} \xB7 ${totalNotas} notas \xB7 sin gastar plan`
490567
+ }
490568
+ ] : [],
490163
490569
  {
490164
- label: "Importar ahora",
490570
+ label: trabajo.length > 0 ? "Subir un export a mano" : "Importar ahora",
490165
490571
  value: "import",
490166
- description: "ChatGPT \xB7 Claude \xB7 Gemini \u2192 tu memoria del proyecto"
490572
+ description: "Elegir un archivo exportado de otra IA"
490167
490573
  },
490168
490574
  { label: "Omitir este paso", value: "skip" }
490169
490575
  ],
490170
490576
  layout: "compact",
490171
- onChange: (value) => value === "import" ? setMode("running") : goNext(),
490577
+ onChange: (value) => {
490578
+ if (value === "todo") {
490579
+ setMode("todo");
490580
+ Promise.resolve().then(() => (init_importarTodo(), exports_importarTodo)).then(async (m) => {
490581
+ const { entornoActual: entornoActual2 } = await Promise.resolve().then(() => (init_registry4(), exports_registry2));
490582
+ const res = await m.importarTrabajoCompleto(entornoActual2(getCwd()), trabajo, (_hechos, i3, total) => setProgreso({ i: i3, total }));
490583
+ setResultado(res);
490584
+ }).catch(() => {
490585
+ setResultado({
490586
+ proyectosImportados: 0,
490587
+ hechosGuardados: 0,
490588
+ fallidos: []
490589
+ });
490590
+ });
490591
+ } else if (value === "import")
490592
+ setMode("running");
490593
+ else
490594
+ goNext();
490595
+ },
490172
490596
  onCancel: () => goBack()
490173
490597
  })
490174
490598
  })
@@ -490311,6 +490735,7 @@ var init_OnboardingWizard = __esm(() => {
490311
490735
  init_ink2();
490312
490736
  init_useTerminalSize();
490313
490737
  init_theme();
490738
+ init_cwd2();
490314
490739
  init_config2();
490315
490740
  init_envUtils();
490316
490741
  init_paths2();
@@ -490983,7 +491408,7 @@ var init_TheusMissionLaunch = __esm(() => {
490983
491408
  });
490984
491409
 
490985
491410
  // replLauncher.tsx
490986
- import { readFile as readFile63 } from "fs/promises";
491411
+ import { readFile as readFile64 } from "fs/promises";
490987
491412
  function shouldShowStartMenu(replProps) {
490988
491413
  return !!process.stdin.isTTY && !!process.stdout.isTTY && process.env.THEUS_START_MENU !== "0" && process.env.THEUS_NO_START_MENU !== "1" && !replProps.disabled && !(replProps.initialMessages && replProps.initialMessages.length > 0) && !replProps.taskListId && !replProps.remoteSessionConfig && !replProps.directConnectConfig;
490989
491414
  }
@@ -491015,7 +491440,7 @@ function withTimeout2(promise3, ms, fallback) {
491015
491440
  async function readMemoryFacts() {
491016
491441
  try {
491017
491442
  const { getGraphPath: getGraphPath2 } = await Promise.resolve().then(() => (init_paths2(), exports_paths));
491018
- const raw = await readFile63(getGraphPath2(getCwd()), "utf8");
491443
+ const raw = await readFile64(getGraphPath2(getCwd()), "utf8");
491019
491444
  const data = JSON.parse(raw);
491020
491445
  const nodes = Array.isArray(data.nodes) ? data.nodes : [];
491021
491446
  let facts = 0;
@@ -493097,7 +493522,7 @@ var init_theusInChrome = __esm(() => {
493097
493522
  });
493098
493523
 
493099
493524
  // skills/bundled/debug.ts
493100
- import { open as open22, stat as stat52 } from "fs/promises";
493525
+ import { open as open23, stat as stat54 } from "fs/promises";
493101
493526
  function registerDebugSkill() {
493102
493527
  registerBundledSkill({
493103
493528
  name: "debug",
@@ -493111,10 +493536,10 @@ function registerDebugSkill() {
493111
493536
  const debugLogPath = getDebugLogPath();
493112
493537
  let logInfo;
493113
493538
  try {
493114
- const stats2 = await stat52(debugLogPath);
493539
+ const stats2 = await stat54(debugLogPath);
493115
493540
  const readSize = Math.min(stats2.size, TAIL_READ_BYTES);
493116
493541
  const startOffset = stats2.size - readSize;
493117
- const fd2 = await open22(debugLogPath, "r");
493542
+ const fd2 = await open23(debugLogPath, "r");
493118
493543
  try {
493119
493544
  const { buffer, bytesRead } = await fd2.read({
493120
493545
  buffer: Buffer.alloc(readSize),
@@ -495697,10 +496122,10 @@ var init_createDirectConnectSession = __esm(() => {
495697
496122
  });
495698
496123
 
495699
496124
  // utils/releaseNotes.ts
495700
- import { mkdir as mkdir56, readFile as readFile64, writeFile as writeFile56 } from "fs/promises";
495701
- import { dirname as dirname77, join as join176 } from "path";
496125
+ import { mkdir as mkdir56, readFile as readFile65, writeFile as writeFile56 } from "fs/promises";
496126
+ import { dirname as dirname77, join as join178 } from "path";
495702
496127
  function getChangelogCachePath() {
495703
- return join176(getTheusConfigHomeDir(), "cache", "changelog.md");
496128
+ return join178(getTheusConfigHomeDir(), "cache", "changelog.md");
495704
496129
  }
495705
496130
  async function migrateChangelogFromConfig() {
495706
496131
  const config3 = getGlobalConfig();
@@ -495747,7 +496172,7 @@ async function getStoredChangelog() {
495747
496172
  }
495748
496173
  const cachePath2 = getChangelogCachePath();
495749
496174
  try {
495750
- const content = await readFile64(cachePath2, "utf-8");
496175
+ const content = await readFile65(cachePath2, "utf-8");
495751
496176
  changelogMemoryCache = content;
495752
496177
  return content;
495753
496178
  } catch {
@@ -495800,7 +496225,7 @@ function getRecentReleaseNotes(currentVersion, previousVersion, changelogContent
495800
496225
  }
495801
496226
  return [];
495802
496227
  }
495803
- async function checkForReleaseNotes(lastSeenVersion, currentVersion = { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION) {
496228
+ async function checkForReleaseNotes(lastSeenVersion, currentVersion = { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION) {
495804
496229
  if (false) {}
495805
496230
  const cachedChangelog = await getStoredChangelog();
495806
496231
  if (lastSeenVersion !== currentVersion || !cachedChangelog) {
@@ -495898,7 +496323,7 @@ __export(exports_setup2, {
495898
496323
  setupComputerUse: () => setupComputerUse,
495899
496324
  COMPUTER_USE_SYSTEM_HINT: () => COMPUTER_USE_SYSTEM_HINT
495900
496325
  });
495901
- import { dirname as dirname78, join as join177 } from "path";
496326
+ import { dirname as dirname78, join as join179 } from "path";
495902
496327
  import { fileURLToPath as fileURLToPath10 } from "url";
495903
496328
  function setupComputerUse() {
495904
496329
  const allowedTools = COMPUTER_USE_TOOL_NAMES.map((name) => buildMcpToolName(COMPUTER_USE_SERVER_NAME, name));
@@ -495925,11 +496350,11 @@ function resolveComputerUseLauncher() {
495925
496350
  return { command: process.execPath, args: [entry, COMPUTER_USE_FLAG] };
495926
496351
  }
495927
496352
  if (entry) {
495928
- const launcher = join177(dirname78(entry), "..", "bin", "theus");
496353
+ const launcher = join179(dirname78(entry), "..", "bin", "theus");
495929
496354
  return { command: launcher, args: [COMPUTER_USE_FLAG] };
495930
496355
  }
495931
496356
  return {
495932
- command: join177(fileURLToPath10(import.meta.url), "..", "..", "..", "bin", "theus"),
496357
+ command: join179(fileURLToPath10(import.meta.url), "..", "..", "..", "bin", "theus"),
495933
496358
  args: [COMPUTER_USE_FLAG]
495934
496359
  };
495935
496360
  }
@@ -495946,8 +496371,8 @@ __export(exports_arsenalBundled, {
495946
496371
  isArsenalAutoInstallEnabled: () => isArsenalAutoInstallEnabled,
495947
496372
  ensureBundledArsenalInstalled: () => ensureBundledArsenalInstalled
495948
496373
  });
495949
- import { existsSync as existsSync31, readFileSync as readFileSync33 } from "fs";
495950
- import { dirname as dirname79, join as join178 } from "path";
496374
+ import { existsSync as existsSync32, readFileSync as readFileSync33 } from "fs";
496375
+ import { dirname as dirname79, join as join180 } from "path";
495951
496376
  import { fileURLToPath as fileURLToPath11 } from "url";
495952
496377
  function isArsenalAutoInstallEnabled() {
495953
496378
  return process.env.THEUS_NO_ARSENAL !== "1";
@@ -495955,10 +496380,10 @@ function isArsenalAutoInstallEnabled() {
495955
496380
  function findBundledArsenalDir() {
495956
496381
  const here = dirname79(fileURLToPath11(import.meta.url));
495957
496382
  for (const candidate of [
495958
- join178(here, "vendor", "theus-arsenal"),
495959
- join178(here, "..", "vendor", "theus-arsenal")
496383
+ join180(here, "vendor", "theus-arsenal"),
496384
+ join180(here, "..", "vendor", "theus-arsenal")
495960
496385
  ]) {
495961
- if (existsSync31(join178(candidate, ".theus-plugin", "plugin.json"))) {
496386
+ if (existsSync32(join180(candidate, ".theus-plugin", "plugin.json"))) {
495962
496387
  return candidate;
495963
496388
  }
495964
496389
  }
@@ -495966,7 +496391,7 @@ function findBundledArsenalDir() {
495966
496391
  }
495967
496392
  function readBundledVersion(bundledDir) {
495968
496393
  try {
495969
- const manifest = JSON.parse(readFileSync33(join178(bundledDir, ".theus-plugin", "plugin.json"), "utf8"));
496394
+ const manifest = JSON.parse(readFileSync33(join180(bundledDir, ".theus-plugin", "plugin.json"), "utf8"));
495970
496395
  return typeof manifest.version === "string" ? manifest.version : null;
495971
496396
  } catch {
495972
496397
  return null;
@@ -496204,9 +496629,9 @@ var init_sessionMemory = __esm(() => {
496204
496629
  });
496205
496630
 
496206
496631
  // utils/iTermBackup.ts
496207
- import { copyFile as copyFile10, stat as stat53 } from "fs/promises";
496632
+ import { copyFile as copyFile10, stat as stat55 } from "fs/promises";
496208
496633
  import { homedir as homedir52 } from "os";
496209
- import { join as join179 } from "path";
496634
+ import { join as join181 } from "path";
496210
496635
  function markITerm2SetupComplete() {
496211
496636
  saveGlobalConfig((current) => ({
496212
496637
  ...current,
@@ -496221,7 +496646,7 @@ function getIterm2RecoveryInfo() {
496221
496646
  };
496222
496647
  }
496223
496648
  function getITerm2PlistPath() {
496224
- return join179(homedir52(), "Library", "Preferences", "com.googlecode.iterm2.plist");
496649
+ return join181(homedir52(), "Library", "Preferences", "com.googlecode.iterm2.plist");
496225
496650
  }
496226
496651
  async function checkAndRestoreITerm2Backup() {
496227
496652
  const { inProgress, backupPath } = getIterm2RecoveryInfo();
@@ -496233,7 +496658,7 @@ async function checkAndRestoreITerm2Backup() {
496233
496658
  return { status: "no_backup" };
496234
496659
  }
496235
496660
  try {
496236
- await stat53(backupPath);
496661
+ await stat55(backupPath);
496237
496662
  } catch {
496238
496663
  markITerm2SetupComplete();
496239
496664
  return { status: "no_backup" };
@@ -497728,11 +498153,11 @@ var init_sessionUrl = __esm(() => {
497728
498153
  });
497729
498154
 
497730
498155
  // utils/plugins/zipCacheAdapters.ts
497731
- import { readFile as readFile65 } from "fs/promises";
497732
- import { join as join180 } from "path";
498156
+ import { readFile as readFile66 } from "fs/promises";
498157
+ import { join as join182 } from "path";
497733
498158
  async function readZipCacheKnownMarketplaces() {
497734
498159
  try {
497735
- const content = await readFile65(getZipCacheKnownMarketplacesPath(), "utf-8");
498160
+ const content = await readFile66(getZipCacheKnownMarketplacesPath(), "utf-8");
497736
498161
  const parsed = KnownMarketplacesFileSchema().safeParse(jsonParse(content));
497737
498162
  if (!parsed.success) {
497738
498163
  logForDebugging(`Invalid known_marketplaces.json in zip cache: ${parsed.error.message}`, { level: "error" });
@@ -497754,18 +498179,18 @@ async function saveMarketplaceJsonToZipCache(marketplaceName, installLocation) {
497754
498179
  const content = await readMarketplaceJsonContent(installLocation);
497755
498180
  if (content !== null) {
497756
498181
  const relPath = getMarketplaceJsonRelativePath(marketplaceName);
497757
- await atomicWriteToZipCache(join180(zipCachePath, relPath), content);
498182
+ await atomicWriteToZipCache(join182(zipCachePath, relPath), content);
497758
498183
  }
497759
498184
  }
497760
498185
  async function readMarketplaceJsonContent(dir) {
497761
498186
  const candidates = [
497762
- join180(dir, ".theus-plugin", "marketplace.json"),
497763
- join180(dir, "marketplace.json"),
498187
+ join182(dir, ".theus-plugin", "marketplace.json"),
498188
+ join182(dir, "marketplace.json"),
497764
498189
  dir
497765
498190
  ];
497766
498191
  for (const candidate of candidates) {
497767
498192
  try {
497768
- return await readFile65(candidate, "utf-8");
498193
+ return await readFile66(candidate, "utf-8");
497769
498194
  } catch {}
497770
498195
  }
497771
498196
  return null;
@@ -497895,7 +498320,7 @@ __export(exports_print, {
497895
498320
  createCanUseToolWithPermissionPrompt: () => createCanUseToolWithPermissionPrompt,
497896
498321
  canBatchWith: () => canBatchWith
497897
498322
  });
497898
- import { readFile as readFile66, stat as stat54 } from "fs/promises";
498323
+ import { readFile as readFile67, stat as stat56 } from "fs/promises";
497899
498324
  import { dirname as dirname80 } from "path";
497900
498325
  import { cwd as cwd2 } from "process";
497901
498326
  import { randomUUID as randomUUID64 } from "crypto";
@@ -499284,9 +499709,9 @@ ${m.text}
499284
499709
  } else if (request.subtype === "seed_read_state") {
499285
499710
  try {
499286
499711
  const normalizedPath = expandPath(request.path);
499287
- const diskMtime = Math.floor((await stat54(normalizedPath)).mtimeMs);
499712
+ const diskMtime = Math.floor((await stat56(normalizedPath)).mtimeMs);
499288
499713
  if (diskMtime <= request.mtime) {
499289
- const raw = await readFile66(normalizedPath, "utf-8");
499714
+ const raw = await readFile67(normalizedPath, "utf-8");
499290
499715
  const content = (raw.charCodeAt(0) === 65279 ? raw.slice(1) : raw).replaceAll(`\r
499291
499716
  `, `
499292
499717
  `);
@@ -501333,7 +501758,7 @@ async function startMCPServer(cwd3, debug3, verbose) {
501333
501758
  setCwd(cwd3);
501334
501759
  const server2 = new Server({
501335
501760
  name: "theus/tengu",
501336
- version: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
501761
+ version: { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
501337
501762
  }, {
501338
501763
  capabilities: {
501339
501764
  tools: {}
@@ -501463,37 +501888,37 @@ __export(exports_theusDesktop, {
501463
501888
  readTheusDesktopMcpServers: () => readTheusDesktopMcpServers,
501464
501889
  getTheusDesktopConfigPath: () => getTheusDesktopConfigPath
501465
501890
  });
501466
- import { readdir as readdir35, readFile as readFile67, stat as stat55 } from "fs/promises";
501891
+ import { readdir as readdir37, readFile as readFile68, stat as stat57 } from "fs/promises";
501467
501892
  import { homedir as homedir53 } from "os";
501468
- import { join as join181 } from "path";
501893
+ import { join as join183 } from "path";
501469
501894
  async function getTheusDesktopConfigPath() {
501470
501895
  const platform7 = getPlatform();
501471
501896
  if (!SUPPORTED_PLATFORMS.includes(platform7)) {
501472
501897
  throw new Error(`Unsupported platform: ${platform7} - Theus Desktop integration only works on macOS and WSL.`);
501473
501898
  }
501474
501899
  if (platform7 === "macos") {
501475
- return join181(homedir53(), "Library", "Application Support", "Theus", "theus_desktop_config.json");
501900
+ return join183(homedir53(), "Library", "Application Support", "Theus", "theus_desktop_config.json");
501476
501901
  }
501477
501902
  const windowsHome = process.env.USERPROFILE ? process.env.USERPROFILE.replace(/\\/g, "/") : null;
501478
501903
  if (windowsHome) {
501479
501904
  const wslPath = windowsHome.replace(/^[A-Z]:/, "");
501480
501905
  const configPath2 = `/mnt/c${wslPath}/AppData/Roaming/Theus/theus_desktop_config.json`;
501481
501906
  try {
501482
- await stat55(configPath2);
501907
+ await stat57(configPath2);
501483
501908
  return configPath2;
501484
501909
  } catch {}
501485
501910
  }
501486
501911
  try {
501487
501912
  const usersDir = "/mnt/c/Users";
501488
501913
  try {
501489
- const userDirs = await readdir35(usersDir, { withFileTypes: true });
501914
+ const userDirs = await readdir37(usersDir, { withFileTypes: true });
501490
501915
  for (const user of userDirs) {
501491
501916
  if (user.name === "Public" || user.name === "Default" || user.name === "Default User" || user.name === "All Users") {
501492
501917
  continue;
501493
501918
  }
501494
- const potentialConfigPath = join181(usersDir, user.name, "AppData", "Roaming", "Theus", "theus_desktop_config.json");
501919
+ const potentialConfigPath = join183(usersDir, user.name, "AppData", "Roaming", "Theus", "theus_desktop_config.json");
501495
501920
  try {
501496
- await stat55(potentialConfigPath);
501921
+ await stat57(potentialConfigPath);
501497
501922
  return potentialConfigPath;
501498
501923
  } catch {}
501499
501924
  }
@@ -501511,7 +501936,7 @@ async function readTheusDesktopMcpServers() {
501511
501936
  const configPath2 = await getTheusDesktopConfigPath();
501512
501937
  let configContent;
501513
501938
  try {
501514
- configContent = await readFile67(configPath2, { encoding: "utf8" });
501939
+ configContent = await readFile68(configPath2, { encoding: "utf8" });
501515
501940
  } catch (e) {
501516
501941
  const code = getErrnoCode(e);
501517
501942
  if (code === "ENOENT") {
@@ -501562,7 +501987,7 @@ __export(exports_mcp3, {
501562
501987
  mcpAddJsonHandler: () => mcpAddJsonHandler,
501563
501988
  mcpAddFromDesktopHandler: () => mcpAddFromDesktopHandler
501564
501989
  });
501565
- import { stat as stat56 } from "fs/promises";
501990
+ import { stat as stat58 } from "fs/promises";
501566
501991
  import { cwd as cwd3 } from "process";
501567
501992
  async function checkMcpServerHealth(name, server2) {
501568
501993
  try {
@@ -501585,7 +502010,7 @@ async function mcpServeHandler({
501585
502010
  const providedCwd = cwd3();
501586
502011
  logEvent("theus_mcp_start", {});
501587
502012
  try {
501588
- await stat56(providedCwd);
502013
+ await stat58(providedCwd);
501589
502014
  } catch (error40) {
501590
502015
  if (isFsInaccessible(error40)) {
501591
502016
  cliError(`Error: Directory ${providedCwd} does not exist`);
@@ -502400,12 +502825,12 @@ __export(exports_install, {
502400
502825
  install: () => install
502401
502826
  });
502402
502827
  import { homedir as homedir54 } from "os";
502403
- import { join as join182 } from "path";
502828
+ import { join as join184 } from "path";
502404
502829
  function getInstallationPath2() {
502405
502830
  const isWindows2 = env3.platform === "win32";
502406
502831
  const homeDir = homedir54();
502407
502832
  if (isWindows2) {
502408
- const windowsPath = join182(homeDir, ".local", "bin", "theus.exe");
502833
+ const windowsPath = join184(homeDir, ".local", "bin", "theus.exe");
502409
502834
  return windowsPath.replace(/\//g, "\\");
502410
502835
  }
502411
502836
  return "~/.local/bin/theus";
@@ -502775,7 +503200,7 @@ async function setupTokenHandler(root2) {
502775
503200
  gap: 1,
502776
503201
  children: [
502777
503202
  /* @__PURE__ */ jsx_runtime502.jsx(TheusBanner, {
502778
- version: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
503203
+ version: { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
502779
503204
  }),
502780
503205
  showAuthWarning && /* @__PURE__ */ jsx_runtime502.jsxs(ThemedBox_default, {
502781
503206
  flexDirection: "column",
@@ -502944,7 +503369,7 @@ var exports_import2 = {};
502944
503369
  __export(exports_import2, {
502945
503370
  importHandler: () => importHandler
502946
503371
  });
502947
- import { readFile as readFile68 } from "fs/promises";
503372
+ import { readFile as readFile69 } from "fs/promises";
502948
503373
  import { homedir as homedir55 } from "os";
502949
503374
  import { resolve as resolve59 } from "path";
502950
503375
  function resolvePath4(raw) {
@@ -502966,7 +503391,7 @@ async function importHandler(file2, options2 = {}) {
502966
503391
  const abs = resolvePath4(file2);
502967
503392
  let bytes;
502968
503393
  try {
502969
- bytes = await readFile68(abs);
503394
+ bytes = await readFile69(abs);
502970
503395
  } catch {
502971
503396
  process.stderr.write(`\u2717 No pude leer el archivo: ${abs}
502972
503397
  `);
@@ -504360,7 +504785,7 @@ ${assistantAddendum}` : assistantAddendum;
504360
504785
  }
504361
504786
  }
504362
504787
  logForDiagnosticsNoPII("info", "started", {
504363
- version: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
504788
+ version: { VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
504364
504789
  is_native_binary: isInBundledMode()
504365
504790
  });
504366
504791
  registerCleanup(async () => {
@@ -505228,7 +505653,7 @@ Usage: theus --remote "your task description"`, () => gracefulShutdown(1));
505228
505653
  pendingHookMessages
505229
505654
  }, renderAndRun);
505230
505655
  }
505231
- }).version(`${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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");
505656
+ }).version(`${{ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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");
505232
505657
  program2.option("-w, --worktree [name]", "Crea un nuevo worktree de git para esta sesi\xF3n (opcionalmente indica un nombre)");
505233
505658
  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.");
505234
505659
  if (canUserConfigureAdvisor()) {
@@ -505829,7 +506254,7 @@ if (false) {}
505829
506254
  async function main2() {
505830
506255
  const args = process.argv.slice(2);
505831
506256
  if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
505832
- console.log(`${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)`);
506257
+ console.log(`${{ VERSION: "0.2.71", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)`);
505833
506258
  return;
505834
506259
  }
505835
506260
  if (args[0] === "login" || args[0] === "signin" || args[0] === "entrar" || args[0] === "iniciar-sesion") {