theus-cli 0.1.17 → 0.1.18

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 +507 -377
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -58283,7 +58283,7 @@ async function _executeApiKeyHelper(isNonInteractiveSession) {
58283
58283
  if (isApiKeyHelperFromProjectOrLocalSettings()) {
58284
58284
  const hasTrust = checkHasTrustDialogAccepted();
58285
58285
  if (!hasTrust && !isNonInteractiveSession) {
58286
- const error40 = new Error(`Security: apiKeyHelper executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.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}.`);
58286
+ const error40 = new Error(`Security: apiKeyHelper executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.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}.`);
58287
58287
  logAntError("apiKeyHelper invoked before trust check", error40);
58288
58288
  logEvent("tengu_apiKeyHelper_missing_trust11", {});
58289
58289
  return null;
@@ -58327,7 +58327,7 @@ async function runAwsAuthRefresh() {
58327
58327
  if (isAwsAuthRefreshFromProjectSettings()) {
58328
58328
  const hasTrust = checkHasTrustDialogAccepted();
58329
58329
  if (!hasTrust && !getIsNonInteractiveSession()) {
58330
- const error40 = new Error(`Security: awsAuthRefresh executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.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}.`);
58330
+ const error40 = new Error(`Security: awsAuthRefresh executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.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}.`);
58331
58331
  logAntError("awsAuthRefresh invoked before trust check", error40);
58332
58332
  logEvent("tengu_awsAuthRefresh_missing_trust", {});
58333
58333
  return false;
@@ -58387,7 +58387,7 @@ async function getAwsCredsFromCredentialExport() {
58387
58387
  if (isAwsCredentialExportFromProjectSettings()) {
58388
58388
  const hasTrust = checkHasTrustDialogAccepted();
58389
58389
  if (!hasTrust && !getIsNonInteractiveSession()) {
58390
- const error40 = new Error(`Security: awsCredentialExport executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.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}.`);
58390
+ const error40 = new Error(`Security: awsCredentialExport executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.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}.`);
58391
58391
  logAntError("awsCredentialExport invoked before trust check", error40);
58392
58392
  logEvent("tengu_awsCredentialExport_missing_trust", {});
58393
58393
  return null;
@@ -58472,7 +58472,7 @@ async function runGcpAuthRefresh() {
58472
58472
  if (isGcpAuthRefreshFromProjectSettings()) {
58473
58473
  const hasTrust = checkHasTrustDialogAccepted();
58474
58474
  if (!hasTrust && !getIsNonInteractiveSession()) {
58475
- const error40 = new Error(`Security: gcpAuthRefresh executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.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}.`);
58475
+ const error40 = new Error(`Security: gcpAuthRefresh executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.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}.`);
58476
58476
  logAntError("gcpAuthRefresh invoked before trust check", error40);
58477
58477
  logEvent("tengu_gcpAuthRefresh_missing_trust", {});
58478
58478
  return false;
@@ -59167,7 +59167,7 @@ var init_auth = __esm(() => {
59167
59167
 
59168
59168
  // utils/userAgent.ts
59169
59169
  function getTheusCodeUserAgent() {
59170
- return `theus-code/${{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}`;
59170
+ return `theus-code/${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}`;
59171
59171
  }
59172
59172
 
59173
59173
  // utils/workloadContext.ts
@@ -59189,7 +59189,7 @@ function getUserAgent() {
59189
59189
  const clientApp = process.env.THEUS_AGENT_SDK_CLIENT_APP ? `, client-app/${process.env.THEUS_AGENT_SDK_CLIENT_APP}` : "";
59190
59190
  const workload = getWorkload();
59191
59191
  const workloadSuffix = workload ? `, workload/${workload}` : "";
59192
- return `theus-cli/${{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} (${process.env.USER_TYPE}, ${process.env.THEUS_CODE_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
59192
+ return `theus-cli/${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} (${process.env.USER_TYPE}, ${process.env.THEUS_CODE_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
59193
59193
  }
59194
59194
  function getMCPUserAgent() {
59195
59195
  const parts = [];
@@ -59203,7 +59203,7 @@ function getMCPUserAgent() {
59203
59203
  parts.push(`client-app/${process.env.THEUS_AGENT_SDK_CLIENT_APP}`);
59204
59204
  }
59205
59205
  const suffix = parts.length > 0 ? ` (${parts.join(", ")})` : "";
59206
- return `theus-code/${{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}`;
59206
+ return `theus-code/${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}`;
59207
59207
  }
59208
59208
  function getWebFetchUserAgent() {
59209
59209
  return `Theus-User (${getTheusCodeUserAgent()}; +https://support.theus.pe/)`;
@@ -59341,7 +59341,7 @@ var init_user = __esm(() => {
59341
59341
  deviceId,
59342
59342
  sessionId: getSessionId(),
59343
59343
  email: getEmail(),
59344
- appVersion: { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
59344
+ appVersion: { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
59345
59345
  platform: getHostPlatformForAnalytics(),
59346
59346
  organizationUuid,
59347
59347
  accountUuid,
@@ -61056,7 +61056,7 @@ var init_metadata = __esm(() => {
61056
61056
  COMPOUND_OPERATOR_REGEX = /\s*(?:&&|\|\||[;|])\s*/;
61057
61057
  WHITESPACE_REGEX = /\s+/;
61058
61058
  getVersionBase = memoize_default(() => {
61059
- const match = { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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]+)?/);
61059
+ const match = { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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]+)?/);
61060
61060
  return match ? match[0] : undefined;
61061
61061
  });
61062
61062
  buildEnvContext = memoize_default(async () => {
@@ -61096,9 +61096,9 @@ var init_metadata = __esm(() => {
61096
61096
  isGithubAction: isEnvTruthy(process.env.GITHUB_ACTIONS),
61097
61097
  isTheusCodeAction: isEnvTruthy(process.env.THEUS_CODE_ACTION),
61098
61098
  isTheusAiAuth: isTheusAISubscriber(),
61099
- version: { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
61099
+ version: { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
61100
61100
  versionBase: getVersionBase(),
61101
- buildTime: { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.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,
61101
+ buildTime: { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.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,
61102
61102
  deploymentEnvironment: env3.detectDeploymentEnvironment(),
61103
61103
  ...isEnvTruthy(process.env.GITHUB_ACTIONS) && {
61104
61104
  githubEventName: process.env.GITHUB_EVENT_NAME,
@@ -61764,7 +61764,7 @@ function initialize1PEventLogging() {
61764
61764
  const platform2 = getPlatform();
61765
61765
  const attributes = {
61766
61766
  [ATTR_SERVICE_NAME]: "theus-code",
61767
- [ATTR_SERVICE_VERSION]: { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
61767
+ [ATTR_SERVICE_VERSION]: { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
61768
61768
  };
61769
61769
  if (platform2 === "wsl") {
61770
61770
  const wslVersion = getWslVersion();
@@ -61791,7 +61791,7 @@ function initialize1PEventLogging() {
61791
61791
  })
61792
61792
  ]
61793
61793
  });
61794
- firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.theus.theus_code.events", { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
61794
+ firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.theus.theus_code.events", { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
61795
61795
  }
61796
61796
  async function reinitialize1PEventLoggingIfConfigChanged() {
61797
61797
  if (!is1PEventLoggingEnabled() || !firstPartyEventLoggerProvider) {
@@ -63662,7 +63662,7 @@ function getAttributionHeader(fingerprint) {
63662
63662
  if (!isAttributionHeaderEnabled()) {
63663
63663
  return "";
63664
63664
  }
63665
- const version2 = `${{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}`;
63665
+ const version2 = `${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}`;
63666
63666
  const entrypoint = process.env.THEUS_CODE_ENTRYPOINT ?? "unknown";
63667
63667
  const cch = "";
63668
63668
  const workload = getWorkload();
@@ -107180,7 +107180,7 @@ Complete the user's request by providing accurate, documentation-based guidance.
107180
107180
  }
107181
107181
  function getFeedbackGuideline() {
107182
107182
  if (isUsing3PServices()) {
107183
- return `- When you cannot find an answer or the feature doesn't exist, direct the user to ${{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.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}`;
107183
+ return `- When you cannot find an answer or the feature doesn't exist, direct the user to ${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.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}`;
107184
107184
  }
107185
107185
  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";
107186
107186
  }
@@ -165877,7 +165877,7 @@ function getTelemetryAttributes() {
165877
165877
  attributes["session.id"] = sessionId;
165878
165878
  }
165879
165879
  if (shouldIncludeAttribute("OTEL_METRICS_INCLUDE_VERSION")) {
165880
- attributes["app.version"] = { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
165880
+ attributes["app.version"] = { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
165881
165881
  }
165882
165882
  const oauthAccount = getOauthAccountInfo();
165883
165883
  if (oauthAccount) {
@@ -201923,7 +201923,7 @@ function getInstallationEnv() {
201923
201923
  return;
201924
201924
  }
201925
201925
  function getTheusCodeVersion() {
201926
- return { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
201926
+ return { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
201927
201927
  }
201928
201928
  async function getInstalledVSCodeExtensionVersion(command) {
201929
201929
  const { stdout } = await execFileNoThrow(command, ["--list-extensions", "--show-versions"], {
@@ -203441,7 +203441,7 @@ async function getMcpHeadersFromHelper(serverName, config2) {
203441
203441
  if ("scope" in config2 && isMcpServerFromProjectOrLocalSettings(config2) && !getIsNonInteractiveSession()) {
203442
203442
  const hasTrust = checkHasTrustDialogAccepted();
203443
203443
  if (!hasTrust) {
203444
- 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.1.17", BUILD_TIME: "1970-01-01T00:00:00.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}.`);
203444
+ 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.1.18", BUILD_TIME: "1970-01-01T00:00:00.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}.`);
203445
203445
  logAntError("MCP headersHelper invoked before trust check", error40);
203446
203446
  logEvent("tengu_mcp_headersHelper_missing_trust", {});
203447
203447
  return null;
@@ -204651,7 +204651,7 @@ async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) {
204651
204651
  const client2 = new Client({
204652
204652
  name: "theus-code",
204653
204653
  title: "Theus",
204654
- version: { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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",
204654
+ version: { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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",
204655
204655
  description: "Theus's agentic coding tool",
204656
204656
  websiteUrl: PRODUCT_URL
204657
204657
  }, {
@@ -205005,7 +205005,7 @@ var init_client5 = __esm(() => {
205005
205005
  const client2 = new Client({
205006
205006
  name: "theus-code",
205007
205007
  title: "Theus",
205008
- version: { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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",
205008
+ version: { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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",
205009
205009
  description: "Theus's agentic coding tool",
205010
205010
  websiteUrl: PRODUCT_URL
205011
205011
  }, {
@@ -215564,7 +215564,7 @@ async function initializeBetaTracing(resource) {
215564
215564
  });
215565
215565
  logs.setGlobalLoggerProvider(loggerProvider);
215566
215566
  setLoggerProvider(loggerProvider);
215567
- const eventLogger = logs.getLogger("com.theus.theus_code.events", { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
215567
+ const eventLogger = logs.getLogger("com.theus.theus_code.events", { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
215568
215568
  setEventLogger(eventLogger);
215569
215569
  process.on("beforeExit", async () => {
215570
215570
  await loggerProvider?.forceFlush();
@@ -215604,7 +215604,7 @@ async function initializeTelemetry() {
215604
215604
  const platform4 = getPlatform();
215605
215605
  const baseAttributes = {
215606
215606
  [ATTR_SERVICE_NAME]: "theus-code",
215607
- [ATTR_SERVICE_VERSION]: { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
215607
+ [ATTR_SERVICE_VERSION]: { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
215608
215608
  };
215609
215609
  if (platform4 === "wsl") {
215610
215610
  const wslVersion = getWslVersion();
@@ -215649,7 +215649,7 @@ async function initializeTelemetry() {
215649
215649
  } catch {}
215650
215650
  };
215651
215651
  registerCleanup(shutdownTelemetry2);
215652
- return meterProvider2.getMeter("com.theus.theus_code", { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
215652
+ return meterProvider2.getMeter("com.theus.theus_code", { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
215653
215653
  }
215654
215654
  const meterProvider = new MeterProvider({
215655
215655
  resource,
@@ -215669,7 +215669,7 @@ async function initializeTelemetry() {
215669
215669
  });
215670
215670
  logs.setGlobalLoggerProvider(loggerProvider);
215671
215671
  setLoggerProvider(loggerProvider);
215672
- const eventLogger = logs.getLogger("com.theus.theus_code.events", { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
215672
+ const eventLogger = logs.getLogger("com.theus.theus_code.events", { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
215673
215673
  setEventLogger(eventLogger);
215674
215674
  logForDebugging("[3P telemetry] Event logger set successfully");
215675
215675
  process.on("beforeExit", async () => {
@@ -215731,7 +215731,7 @@ Current timeout: ${timeoutMs}ms
215731
215731
  }
215732
215732
  };
215733
215733
  registerCleanup(shutdownTelemetry);
215734
- return meterProvider.getMeter("com.theus.theus_code", { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
215734
+ return meterProvider.getMeter("com.theus.theus_code", { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
215735
215735
  }
215736
215736
  async function flushTelemetry() {
215737
215737
  const meterProvider = getMeterProvider();
@@ -216271,7 +216271,7 @@ async function installOrUpdateTheusPackage(channel2, specificVersion) {
216271
216271
  return "install_failed";
216272
216272
  }
216273
216273
  const versionSpec = specificVersion ? specificVersion : channel2 === "stable" ? "stable" : "latest";
216274
- const result = await execFileNoThrowWithCwd("npm", ["install", `${{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.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 });
216274
+ const result = await execFileNoThrowWithCwd("npm", ["install", `${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.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 });
216275
216275
  if (result.code !== 0) {
216276
216276
  const error40 = new Error(`Failed to install Theus CLI package: ${result.stderr}`);
216277
216277
  logError2(error40);
@@ -216417,9 +216417,9 @@ async function assertMinVersion() {
216417
216417
  if (false) {}
216418
216418
  try {
216419
216419
  const versionConfig = await getDynamicConfig_BLOCKS_ON_INIT("tengu_version_config", { minVersion: "0.0.0" });
216420
- if (versionConfig.minVersion && lt({ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
216420
+ if (versionConfig.minVersion && lt({ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
216421
216421
  console.error(`
216422
- It looks like your version of Theus (${{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.
216422
+ It looks like your version of Theus (${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.
216423
216423
  A newer version (${versionConfig.minVersion} or higher) is required to continue.
216424
216424
 
216425
216425
  To update, please run:
@@ -216560,7 +216560,7 @@ async function getInstallationPrefix() {
216560
216560
  return prefixResult.stdout.trim();
216561
216561
  }
216562
216562
  function getGlobalInstallPackageManager() {
216563
- if ({ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.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") {
216563
+ if ({ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.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") {
216564
216564
  return "npm";
216565
216565
  }
216566
216566
  return env3.isRunningWithBun() ? "bun" : "npm";
@@ -216585,7 +216585,7 @@ async function checkGlobalInstallPermissions() {
216585
216585
  }
216586
216586
  async function getLatestVersion(channel2) {
216587
216587
  const npmTag = channel2 === "stable" ? "stable" : "latest";
216588
- const result = await execFileNoThrowWithCwd("npm", ["view", `${{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}@${npmTag}`, "version", "--prefer-online"], { abortSignal: AbortSignal.timeout(5000), cwd: homedir18() });
216588
+ const result = await execFileNoThrowWithCwd("npm", ["view", `${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}@${npmTag}`, "version", "--prefer-online"], { abortSignal: AbortSignal.timeout(5000), cwd: homedir18() });
216589
216589
  if (result.code !== 0) {
216590
216590
  logForDebugging(`npm view failed with code ${result.code}`);
216591
216591
  if (result.stderr) {
@@ -216601,7 +216601,7 @@ async function getLatestVersion(channel2) {
216601
216601
  return result.stdout.trim();
216602
216602
  }
216603
216603
  async function getNpmDistTags() {
216604
- const result = await execFileNoThrowWithCwd("npm", ["view", { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL, "dist-tags", "--json", "--prefer-online"], { abortSignal: AbortSignal.timeout(5000), cwd: homedir18() });
216604
+ const result = await execFileNoThrowWithCwd("npm", ["view", { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL, "dist-tags", "--json", "--prefer-online"], { abortSignal: AbortSignal.timeout(5000), cwd: homedir18() });
216605
216605
  if (result.code !== 0) {
216606
216606
  logForDebugging(`npm view dist-tags failed with code ${result.code}`);
216607
216607
  return { latest: null, stable: null };
@@ -216641,7 +216641,7 @@ async function installGlobalPackage(specificVersion) {
216641
216641
  logError2(new AutoUpdaterError("Another process is currently installing an update"));
216642
216642
  logEvent("tengu_auto_updater_lock_contention", {
216643
216643
  pid: process.pid,
216644
- currentVersion: { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
216644
+ currentVersion: { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
216645
216645
  });
216646
216646
  return "in_progress";
216647
216647
  }
@@ -216650,7 +216650,7 @@ async function installGlobalPackage(specificVersion) {
216650
216650
  if (!env3.isRunningWithBun() && env3.isNpmFromWindowsPath()) {
216651
216651
  logError2(new Error("Windows NPM detected in WSL environment"));
216652
216652
  logEvent("tengu_auto_updater_windows_npm_in_wsl", {
216653
- currentVersion: { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
216653
+ currentVersion: { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
216654
216654
  });
216655
216655
  console.error(`
216656
216656
  Error: Windows NPM detected in WSL
@@ -216669,7 +216669,7 @@ To fix this issue:
216669
216669
  if (!hasPermissions) {
216670
216670
  return "no_permissions";
216671
216671
  }
216672
- const packageSpec = specificVersion ? `${{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.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.1.17", BUILD_TIME: "1970-01-01T00:00:00.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;
216672
+ const packageSpec = specificVersion ? `${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.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.1.18", BUILD_TIME: "1970-01-01T00:00:00.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;
216673
216673
  const packageManager = getGlobalInstallPackageManager();
216674
216674
  const installResult = await execFileNoThrowWithCwd(packageManager, ["install", "-g", packageSpec], { cwd: homedir18() });
216675
216675
  if (installResult.code !== 0) {
@@ -216997,8 +216997,8 @@ async function detectMultipleInstallations() {
216997
216997
  installations.push({ type: "npm-local", path: localPath });
216998
216998
  }
216999
216999
  const packagesToCheck = ["@theus-ai/theus-code"];
217000
- if ({ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.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.1.17", BUILD_TIME: "1970-01-01T00:00:00.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") {
217001
- packagesToCheck.push({ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.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);
217000
+ if ({ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.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.1.18", BUILD_TIME: "1970-01-01T00:00:00.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") {
217001
+ packagesToCheck.push({ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.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);
217002
217002
  }
217003
217003
  const npmResult = await execFileNoThrow("npm", [
217004
217004
  "-g",
@@ -217181,7 +217181,7 @@ function detectLinuxGlobPatternWarnings() {
217181
217181
  }
217182
217182
  async function getDoctorDiagnostic() {
217183
217183
  const installationType = await getCurrentInstallationType();
217184
- const version2 = { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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";
217184
+ const version2 = { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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";
217185
217185
  const installationPath = await getInstallationPath();
217186
217186
  const invokedBinary = getInvokedBinary();
217187
217187
  const multipleInstallations = await detectMultipleInstallations();
@@ -217193,8 +217193,8 @@ async function getDoctorDiagnostic() {
217193
217193
  for (const install of npmInstalls) {
217194
217194
  if (install.type === "npm-global") {
217195
217195
  let uninstallCmd = "npm -g uninstall @theus-ai/theus-code";
217196
- if ({ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.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.1.17", BUILD_TIME: "1970-01-01T00:00:00.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") {
217197
- uninstallCmd += ` && npm -g uninstall ${{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.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}`;
217196
+ if ({ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.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.1.18", BUILD_TIME: "1970-01-01T00:00:00.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") {
217197
+ uninstallCmd += ` && npm -g uninstall ${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.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}`;
217198
217198
  }
217199
217199
  warnings.push({
217200
217200
  issue: `Leftover npm global installation at ${install.path}`,
@@ -217306,7 +217306,7 @@ async function getLatestVersionFromArtifactory(tag2 = "latest") {
217306
217306
  const startTime2 = Date.now();
217307
217307
  const { stdout, code, stderr } = await execFileNoThrowWithCwd("npm", [
217308
217308
  "view",
217309
- `${{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.NATIVE_PACKAGE_URL}@${tag2}`,
217309
+ `${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.NATIVE_PACKAGE_URL}@${tag2}`,
217310
217310
  "version",
217311
217311
  "--prefer-online",
217312
217312
  "--registry",
@@ -217330,7 +217330,7 @@ async function getLatestVersionFromArtifactory(tag2 = "latest") {
217330
217330
  latency_ms: latencyMs,
217331
217331
  source_npm: true
217332
217332
  });
217333
- logForDebugging(`npm view ${{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.NATIVE_PACKAGE_URL}@${tag2} version: ${stdout}`);
217333
+ logForDebugging(`npm view ${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.NATIVE_PACKAGE_URL}@${tag2} version: ${stdout}`);
217334
217334
  const latestVersion = stdout.trim();
217335
217335
  return latestVersion;
217336
217336
  }
@@ -217386,7 +217386,7 @@ async function downloadVersionFromArtifactory(version2, stagingPath) {
217386
217386
  const fs3 = getFsImplementation();
217387
217387
  await fs3.rm(stagingPath, { recursive: true, force: true });
217388
217388
  const platform4 = getPlatform2();
217389
- const platformPackageName = `${{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.NATIVE_PACKAGE_URL}-${platform4}`;
217389
+ const platformPackageName = `${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.NATIVE_PACKAGE_URL}-${platform4}`;
217390
217390
  logForDebugging(`Fetching integrity hash for ${platformPackageName}@${version2}`);
217391
217391
  const {
217392
217392
  stdout: integrityOutput,
@@ -217415,7 +217415,7 @@ async function downloadVersionFromArtifactory(version2, stagingPath) {
217415
217415
  name: "theus-native-installer",
217416
217416
  version: "0.0.1",
217417
217417
  dependencies: {
217418
- [{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.NATIVE_PACKAGE_URL]: version2
217418
+ [{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.NATIVE_PACKAGE_URL]: version2
217419
217419
  }
217420
217420
  };
217421
217421
  const packageLock = {
@@ -217428,10 +217428,10 @@ async function downloadVersionFromArtifactory(version2, stagingPath) {
217428
217428
  name: "theus-native-installer",
217429
217429
  version: "0.0.1",
217430
217430
  dependencies: {
217431
- [{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.NATIVE_PACKAGE_URL]: version2
217431
+ [{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.NATIVE_PACKAGE_URL]: version2
217432
217432
  }
217433
217433
  },
217434
- [`node_modules/${{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.NATIVE_PACKAGE_URL}`]: {
217434
+ [`node_modules/${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.NATIVE_PACKAGE_URL}`]: {
217435
217435
  version: version2,
217436
217436
  optionalDependencies: {
217437
217437
  [platformPackageName]: version2
@@ -217453,7 +217453,7 @@ async function downloadVersionFromArtifactory(version2, stagingPath) {
217453
217453
  if (result.code !== 0) {
217454
217454
  throw new Error(`npm ci failed with code ${result.code}: ${result.stderr}`);
217455
217455
  }
217456
- logForDebugging(`Successfully downloaded and verified ${{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.NATIVE_PACKAGE_URL}@${version2}`);
217456
+ logForDebugging(`Successfully downloaded and verified ${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.NATIVE_PACKAGE_URL}@${version2}`);
217457
217457
  }
217458
217458
  function getStallTimeoutMs() {
217459
217459
  return Number(process.env.THEUS_CODE_STALL_TIMEOUT_MS_FOR_TESTING) || DEFAULT_STALL_TIMEOUT_MS;
@@ -218116,8 +218116,8 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
218116
218116
  const maxVersion = await getMaxVersion();
218117
218117
  if (maxVersion && gt(version2, maxVersion)) {
218118
218118
  logForDebugging(`Native installer: maxVersion ${maxVersion} is set, capping update from ${version2} to ${maxVersion}`);
218119
- if (gte({ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
218120
- logForDebugging(`Native installer: current version ${{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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`);
218119
+ if (gte({ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
218120
+ logForDebugging(`Native installer: current version ${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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`);
218121
218121
  logEvent("tengu_native_update_skipped_max_version", {
218122
218122
  latency_ms: Date.now() - startTime2,
218123
218123
  max_version: maxVersion,
@@ -218128,7 +218128,7 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
218128
218128
  version2 = maxVersion;
218129
218129
  }
218130
218130
  }
218131
- if (!forceReinstall && version2 === { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
218131
+ if (!forceReinstall && version2 === { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
218132
218132
  logForDebugging(`Found ${version2} at ${executablePath}, skipping install`);
218133
218133
  logEvent("tengu_native_update_complete", {
218134
218134
  latency_ms: Date.now() - startTime2,
@@ -218729,6 +218729,14 @@ async function removeInstalledSymlink() {
218729
218729
  logForDebugging(`Skipping removal of ${dirs.executable} - appears to be npm-managed`);
218730
218730
  return;
218731
218731
  }
218732
+ try {
218733
+ const st = await lstat4(dirs.executable);
218734
+ const target = st.isSymbolicLink() ? await realpath7(dirs.executable) : dirs.executable;
218735
+ if (target.includes("/.theus/")) {
218736
+ logForDebugging(`Skipping removal of ${dirs.executable} - theus.pe bundle launcher`);
218737
+ return;
218738
+ }
218739
+ } catch {}
218732
218740
  await unlink7(dirs.executable);
218733
218741
  logForDebugging(`Removed theus symlink at ${dirs.executable}`);
218734
218742
  } catch (error40) {
@@ -218870,8 +218878,8 @@ async function cleanupNpmInstallations() {
218870
218878
  } else if (codePackageResult.error) {
218871
218879
  errors4.push(codePackageResult.error);
218872
218880
  }
218873
- if ({ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.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.1.17", BUILD_TIME: "1970-01-01T00:00:00.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") {
218874
- const macroPackageResult = await attemptNpmUninstall({ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.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);
218881
+ if ({ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.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.1.18", BUILD_TIME: "1970-01-01T00:00:00.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") {
218882
+ const macroPackageResult = await attemptNpmUninstall({ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.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);
218875
218883
  if (macroPackageResult.success) {
218876
218884
  removed++;
218877
218885
  if (macroPackageResult.warning) {
@@ -295643,9 +295651,9 @@ function getTheusEnvMetadata() {
295643
295651
  };
295644
295652
  }
295645
295653
  function getBuildAgeMinutes() {
295646
- if (!{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.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)
295654
+ if (!{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.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)
295647
295655
  return;
295648
- const buildTime = new Date({ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.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();
295656
+ const buildTime = new Date({ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.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();
295649
295657
  if (isNaN(buildTime))
295650
295658
  return;
295651
295659
  return Math.floor((Date.now() - buildTime) / 60000);
@@ -311875,7 +311883,7 @@ function getAssistantMessageFromError(error40, model, options2) {
311875
311883
  if (process.env.USER_TYPE === "ant") {
311876
311884
  const baseMessage = `API Error: 400 ${error40.message}
311877
311885
 
311878
- Run /share and post the JSON file to ${{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.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}.`;
311886
+ Run /share and post the JSON file to ${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.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}.`;
311879
311887
  const rewindInstruction = getIsNonInteractiveSession() ? "" : " Then, use /rewind to recover the conversation.";
311880
311888
  return createAssistantAPIErrorMessage({
311881
311889
  content: baseMessage + rewindInstruction,
@@ -311911,7 +311919,7 @@ Run /share and post the JSON file to ${{ VERSION: "0.1.17", BUILD_TIME: "1970-01
311911
311919
  if (process.env.USER_TYPE === "ant" && !process.env.THEUS_MODEL && error40 instanceof Error && error40.message.toLowerCase().includes("invalid model name")) {
311912
311920
  const orgId = getOauthAccountInfo()?.organizationUuid;
311913
311921
  const baseMsg = `[THEUS-INTERNAL] Your org isn't gated into the \`${model}\` model. Either run \`theus\` with \`THEUS_MODEL=${getDefaultMainLoopModelSetting()}\``;
311914
- const msg = orgId ? `${baseMsg} or share your orgId (${orgId}) in ${{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.FEEDBACK_CHANNEL} for help getting access.` : `${baseMsg} or reach out in ${{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.FEEDBACK_CHANNEL} for help getting access.`;
311922
+ const msg = orgId ? `${baseMsg} or share your orgId (${orgId}) in ${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.FEEDBACK_CHANNEL} for help getting access.` : `${baseMsg} or reach out in ${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.FEEDBACK_CHANNEL} for help getting access.`;
311915
311923
  return createAssistantAPIErrorMessage({
311916
311924
  content: msg,
311917
311925
  error: "invalid_request"
@@ -322011,7 +322019,7 @@ function buildPrimarySection() {
322011
322019
  });
322012
322020
  return [{
322013
322021
  label: "Version",
322014
- value: { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
322022
+ value: { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
322015
322023
  }, {
322016
322024
  label: "Session name",
322017
322025
  value: nameValue
@@ -325762,7 +325770,7 @@ function Config({
325762
325770
  }
325763
325771
  })
325764
325772
  }) : showSubmenu === "ChannelDowngrade" ? /* @__PURE__ */ jsx_runtime180.jsx(ChannelDowngradeDialog, {
325765
- currentVersion: { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
325773
+ currentVersion: { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
325766
325774
  onChoice: (choice) => {
325767
325775
  setShowSubmenu(null);
325768
325776
  setTabsHidden(false);
@@ -325774,7 +325782,7 @@ function Config({
325774
325782
  autoUpdatesChannel: "stable"
325775
325783
  };
325776
325784
  if (choice === "stay") {
325777
- newSettings.minimumVersion = { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
325785
+ newSettings.minimumVersion = { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
325778
325786
  }
325779
325787
  updateSettingsForSource("userSettings", newSettings);
325780
325788
  setSettingsData((prev_27) => ({
@@ -333808,7 +333816,7 @@ function HelpV2(t0) {
333808
333816
  let t6;
333809
333817
  if ($2[31] !== tabs) {
333810
333818
  t6 = /* @__PURE__ */ jsx_runtime207.jsx(Tabs, {
333811
- title: `Theus v${{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}`,
333819
+ title: `Theus v${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}`,
333812
333820
  color: "professionalBlue",
333813
333821
  defaultTab: "general",
333814
333822
  children: tabs
@@ -351239,9 +351247,9 @@ function getAllReleaseNotes(changelogContent = getStoredChangelogFromMemory()) {
351239
351247
  return [];
351240
351248
  }
351241
351249
  }
351242
- async function checkForReleaseNotes(lastSeenVersion, currentVersion = { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION) {
351250
+ async function checkForReleaseNotes(lastSeenVersion, currentVersion = { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION) {
351243
351251
  if (process.env.USER_TYPE === "ant") {
351244
- const changelog = { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION_CHANGELOG;
351252
+ const changelog = { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION_CHANGELOG;
351245
351253
  if (changelog) {
351246
351254
  const commits = changelog.trim().split(`
351247
351255
  `).filter(Boolean);
@@ -355435,7 +355443,7 @@ var init_Messages = __esm(() => {
355435
355443
  let t1;
355436
355444
  if ($2[0] === Symbol.for("react.memo_cache_sentinel")) {
355437
355445
  t1 = /* @__PURE__ */ jsx_runtime245.jsx(TheusBanner, {
355438
- version: { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
355446
+ version: { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
355439
355447
  });
355440
355448
  $2[0] = t1;
355441
355449
  } else {
@@ -382975,7 +382983,7 @@ async function captureMemoryDiagnostics(trigger, dumpNumber = 0) {
382975
382983
  smapsRollup,
382976
382984
  platform: process.platform,
382977
382985
  nodeVersion: process.version,
382978
- ccVersion: { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
382986
+ ccVersion: { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
382979
382987
  };
382980
382988
  }
382981
382989
  async function performHeapDump(trigger = "manual", dumpNumber = 0) {
@@ -383561,7 +383569,7 @@ var init_bridge_kick = __esm(() => {
383561
383569
  var call54 = async () => {
383562
383570
  return {
383563
383571
  type: "text",
383564
- value: { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.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.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.1.17", BUILD_TIME: "1970-01-01T00:00:00.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.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
383572
+ value: { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.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.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.1.18", BUILD_TIME: "1970-01-01T00:00:00.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.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
383565
383573
  };
383566
383574
  }, version2, version_default;
383567
383575
  var init_version = __esm(() => {
@@ -387294,7 +387302,19 @@ var exports_update = {};
387294
387302
  __export(exports_update, {
387295
387303
  update: () => update
387296
387304
  });
387297
- import { spawn as spawn8 } from "child_process";
387305
+ import { spawn as spawn8, spawnSync as spawnSync5 } from "child_process";
387306
+ import { createHash as createHash27 } from "crypto";
387307
+ import {
387308
+ cpSync,
387309
+ existsSync as existsSync14,
387310
+ mkdtempSync,
387311
+ readFileSync as readFileSync21,
387312
+ realpathSync as realpathSync4,
387313
+ rmSync as rmSync4,
387314
+ writeFileSync as writeFileSync7
387315
+ } from "fs";
387316
+ import { tmpdir as tmpdir8 } from "os";
387317
+ import { dirname as dirname57, join as join137 } from "path";
387298
387318
  async function updateNaupa() {
387299
387319
  if (process.env.THEUS_NO_NAUPA_UPDATE === "1")
387300
387320
  return;
@@ -387340,14 +387360,122 @@ async function updateNaupa() {
387340
387360
  });
387341
387361
  });
387342
387362
  }
387363
+ function isReleaseBundleInstall() {
387364
+ try {
387365
+ const entry = process.argv[1];
387366
+ if (!entry)
387367
+ return false;
387368
+ const real = realpathSync4(entry);
387369
+ if (!real.endsWith("cli.js"))
387370
+ return false;
387371
+ if (real.includes("node_modules"))
387372
+ return false;
387373
+ return existsSync14(join137(dirname57(real), "bin", "theus"));
387374
+ } catch {
387375
+ return false;
387376
+ }
387377
+ }
387378
+ function sha256File(path19) {
387379
+ return createHash27("sha256").update(readFileSync21(path19)).digest("hex");
387380
+ }
387381
+ async function fetchReleaseChannelVersion() {
387382
+ try {
387383
+ const res = await fetch(`${DL_BASE}/latest.json`, {
387384
+ signal: AbortSignal.timeout(15000)
387385
+ });
387386
+ if (!res.ok)
387387
+ return null;
387388
+ const data = await res.json();
387389
+ const v = (data.version ?? data.tag_name ?? "").replace(/^v/, "").trim();
387390
+ return /^\d+\.\d+\.\d+/.test(v) ? v : null;
387391
+ } catch {
387392
+ return null;
387393
+ }
387394
+ }
387395
+ async function downloadToFile(url3, dest) {
387396
+ try {
387397
+ const res = await fetch(url3, { signal: AbortSignal.timeout(120000) });
387398
+ if (!res.ok)
387399
+ return false;
387400
+ writeFileSync7(dest, Buffer.from(await res.arrayBuffer()));
387401
+ return true;
387402
+ } catch {
387403
+ return false;
387404
+ }
387405
+ }
387406
+ async function updateReleaseBundle() {
387407
+ const bundleDir = dirname57(realpathSync4(process.argv[1]));
387408
+ const latest = await fetchReleaseChannelVersion();
387409
+ if (!latest) {
387410
+ process.stderr.write(source_default.red(`No pude comprobar la \xFAltima versi\xF3n en theus.pe/dl.
387411
+ `));
387412
+ process.stderr.write(`Reintenta luego, o reinstala con: curl -fsSL https://theus.pe/install.sh | bash
387413
+ `);
387414
+ await gracefulShutdown(1);
387415
+ return;
387416
+ }
387417
+ if (gte({ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
387418
+ writeToStdout(source_default.green(`Theus is up to date (${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})`) + `
387419
+ `);
387420
+ await gracefulShutdown(0);
387421
+ return;
387422
+ }
387423
+ writeToStdout(`New version available: ${latest} (current: ${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})
387424
+ `);
387425
+ writeToStdout(`Installing update from theus.pe/dl...
387426
+ `);
387427
+ const tmp = mkdtempSync(join137(tmpdir8(), "theus-update-"));
387428
+ try {
387429
+ const tarPath = join137(tmp, "theus-cli.tar.gz");
387430
+ const sumsPath = join137(tmp, "SHA256SUMS");
387431
+ if (!await downloadToFile(`${DL_BASE}/theus-cli.tar.gz`, tarPath) || !await downloadToFile(`${DL_BASE}/SHA256SUMS`, sumsPath)) {
387432
+ process.stderr.write(source_default.red(`Fall\xF3 la descarga del release desde theus.pe/dl.
387433
+ `));
387434
+ await gracefulShutdown(1);
387435
+ return;
387436
+ }
387437
+ const expected = readFileSync21(sumsPath, "utf8").split(`
387438
+ `).map((line) => line.trim().split(/\s+/)).find((parts) => parts[1] === "theus-cli.tar.gz" || parts[1] === "*theus-cli.tar.gz")?.[0];
387439
+ const actual = sha256File(tarPath);
387440
+ if (!expected || expected !== actual) {
387441
+ process.stderr.write(source_default.red(`Checksum SHA-256 inv\xE1lido del release (esperado ${expected ?? "n/a"}, obtenido ${actual}). Abortado.
387442
+ `));
387443
+ await gracefulShutdown(1);
387444
+ return;
387445
+ }
387446
+ const ex = spawnSync5("tar", ["-xzf", tarPath, "-C", tmp], {
387447
+ stdio: "ignore"
387448
+ });
387449
+ const staged = join137(tmp, "theus-cli");
387450
+ if (ex.status !== 0 || !existsSync14(join137(staged, "cli.js"))) {
387451
+ process.stderr.write(source_default.red(`No pude extraer el release descargado (o vino incompleto).
387452
+ `));
387453
+ await gracefulShutdown(1);
387454
+ return;
387455
+ }
387456
+ cpSync(staged, bundleDir, { recursive: true, force: true });
387457
+ writeToStdout(source_default.green(`Successfully updated from ${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} to version ${latest}`) + `
387458
+ `);
387459
+ await regenerateCompletionCache();
387460
+ } finally {
387461
+ try {
387462
+ rmSync4(tmp, { recursive: true, force: true });
387463
+ } catch {}
387464
+ }
387465
+ await gracefulShutdown(0);
387466
+ }
387343
387467
  async function update() {
387344
387468
  logEvent("tengu_update_check", {});
387345
387469
  await updateNaupa();
387346
- writeToStdout(`Current version: ${{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}
387470
+ writeToStdout(`Current version: ${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}
387347
387471
  `);
387348
387472
  const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
387349
387473
  writeToStdout(`Checking for updates to ${channel2} version...
387350
387474
  `);
387475
+ if (isReleaseBundleInstall()) {
387476
+ await updateReleaseBundle();
387477
+ return;
387478
+ }
387351
387479
  logForDebugging("update: Starting update check");
387352
387480
  logForDebugging("update: Running diagnostic");
387353
387481
  const diagnostic = await getDoctorDiagnostic();
@@ -387418,8 +387546,8 @@ async function update() {
387418
387546
  writeToStdout(`Theus is managed by Homebrew.
387419
387547
  `);
387420
387548
  const latest = await getLatestVersion(channel2);
387421
- if (latest && !gte({ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
387422
- writeToStdout(`Update available: ${{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}
387549
+ if (latest && !gte({ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
387550
+ writeToStdout(`Update available: ${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}
387423
387551
  `);
387424
387552
  writeToStdout(`
387425
387553
  `);
@@ -387435,8 +387563,8 @@ async function update() {
387435
387563
  writeToStdout(`Theus is managed by winget.
387436
387564
  `);
387437
387565
  const latest = await getLatestVersion(channel2);
387438
- if (latest && !gte({ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
387439
- writeToStdout(`Update available: ${{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}
387566
+ if (latest && !gte({ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
387567
+ writeToStdout(`Update available: ${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}
387440
387568
  `);
387441
387569
  writeToStdout(`
387442
387570
  `);
@@ -387452,8 +387580,8 @@ async function update() {
387452
387580
  writeToStdout(`Theus is managed by apk.
387453
387581
  `);
387454
387582
  const latest = await getLatestVersion(channel2);
387455
- if (latest && !gte({ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
387456
- writeToStdout(`Update available: ${{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}
387583
+ if (latest && !gte({ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
387584
+ writeToStdout(`Update available: ${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}
387457
387585
  `);
387458
387586
  writeToStdout(`
387459
387587
  `);
@@ -387518,11 +387646,11 @@ async function update() {
387518
387646
  `);
387519
387647
  await gracefulShutdown(1);
387520
387648
  }
387521
- if (result.latestVersion === { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION) {
387522
- writeToStdout(source_default.green(`Theus is up to date (${{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})`) + `
387649
+ if (result.latestVersion === { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION) {
387650
+ writeToStdout(source_default.green(`Theus is up to date (${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})`) + `
387523
387651
  `);
387524
387652
  } else {
387525
- writeToStdout(source_default.green(`Successfully updated from ${{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} to version ${result.latestVersion}`) + `
387653
+ writeToStdout(source_default.green(`Successfully updated from ${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} to version ${result.latestVersion}`) + `
387526
387654
  `);
387527
387655
  await regenerateCompletionCache();
387528
387656
  }
@@ -387541,9 +387669,9 @@ async function update() {
387541
387669
  await removeInstalledSymlink();
387542
387670
  }
387543
387671
  logForDebugging("update: Checking npm registry for latest version");
387544
- logForDebugging(`update: Package URL: ${{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.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}`);
387672
+ logForDebugging(`update: Package URL: ${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.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}`);
387545
387673
  const npmTag = channel2 === "stable" ? "stable" : "latest";
387546
- const npmCommand = `npm view ${{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.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`;
387674
+ const npmCommand = `npm view ${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.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`;
387547
387675
  logForDebugging(`update: Running: ${npmCommand}`);
387548
387676
  const latestVersion = await getLatestVersion(channel2);
387549
387677
  logForDebugging(`update: Latest version from npm: ${latestVersion || "FAILED"}`);
@@ -387563,7 +387691,7 @@ async function update() {
387563
387691
  `);
387564
387692
  process.stderr.write(` \u2022 Corporate proxy/firewall blocking npm
387565
387693
  `);
387566
- if ({ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.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.1.17", BUILD_TIME: "1970-01-01T00:00:00.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")) {
387694
+ if ({ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.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.1.18", BUILD_TIME: "1970-01-01T00:00:00.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")) {
387567
387695
  process.stderr.write(` \u2022 Internal/development build not published to npm
387568
387696
  `);
387569
387697
  }
@@ -387575,19 +387703,19 @@ async function update() {
387575
387703
  `);
387576
387704
  process.stderr.write(` \u2022 Run with --debug flag for more details
387577
387705
  `);
387578
- const packageName = { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL || (process.env.USER_TYPE === "ant" ? "@theus-ai/theus-cli" : "@theus-ai/theus-code");
387706
+ const packageName = { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL || (process.env.USER_TYPE === "ant" ? "@theus-ai/theus-cli" : "@theus-ai/theus-code");
387579
387707
  process.stderr.write(` \u2022 Manually check: npm view ${packageName} version
387580
387708
  `);
387581
387709
  process.stderr.write(` \u2022 Check if you need to login: npm whoami
387582
387710
  `);
387583
387711
  await gracefulShutdown(1);
387584
387712
  }
387585
- if (gte({ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
387586
- writeToStdout(source_default.green(`Theus is up to date (${{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})`) + `
387713
+ if (gte({ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
387714
+ writeToStdout(source_default.green(`Theus is up to date (${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})`) + `
387587
387715
  `);
387588
387716
  await gracefulShutdown(0);
387589
387717
  }
387590
- writeToStdout(`New version available: ${latestVersion} (current: ${{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})
387718
+ writeToStdout(`New version available: ${latestVersion} (current: ${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})
387591
387719
  `);
387592
387720
  writeToStdout(`Installing update...
387593
387721
  `);
@@ -387632,7 +387760,7 @@ async function update() {
387632
387760
  logForDebugging(`update: Installation status: ${status2}`);
387633
387761
  switch (status2) {
387634
387762
  case "success":
387635
- writeToStdout(source_default.green(`Successfully updated from ${{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} to version ${latestVersion}`) + `
387763
+ writeToStdout(source_default.green(`Successfully updated from ${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} to version ${latestVersion}`) + `
387636
387764
  `);
387637
387765
  await regenerateCompletionCache();
387638
387766
  break;
@@ -387642,7 +387770,7 @@ async function update() {
387642
387770
  if (useLocalUpdate) {
387643
387771
  process.stderr.write(`Try manually updating with:
387644
387772
  `);
387645
- process.stderr.write(` cd ~/.theus/local && npm update ${{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.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}
387773
+ process.stderr.write(` cd ~/.theus/local && npm update ${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.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}
387646
387774
  `);
387647
387775
  } else {
387648
387776
  process.stderr.write(`Try running with sudo or fix npm permissions
@@ -387658,7 +387786,7 @@ async function update() {
387658
387786
  if (useLocalUpdate) {
387659
387787
  process.stderr.write(`Try manually updating with:
387660
387788
  `);
387661
- process.stderr.write(` cd ~/.theus/local && npm update ${{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.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}
387789
+ process.stderr.write(` cd ~/.theus/local && npm update ${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.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}
387662
387790
  `);
387663
387791
  } else {
387664
387792
  process.stderr.write(`Or consider using native installation with: theus install
@@ -387676,6 +387804,7 @@ async function update() {
387676
387804
  }
387677
387805
  await gracefulShutdown(0);
387678
387806
  }
387807
+ var DL_BASE;
387679
387808
  var init_update = __esm(() => {
387680
387809
  init_source();
387681
387810
  init_analytics();
@@ -387690,6 +387819,7 @@ var init_update = __esm(() => {
387690
387819
  init_nativeInstaller();
387691
387820
  init_packageManagers();
387692
387821
  init_settings2();
387822
+ DL_BASE = (process.env.THEUS_DL_BASE ?? "https://theus.pe/dl").replace(/\/+$/, "");
387693
387823
  });
387694
387824
 
387695
387825
  // commands/update/update.ts
@@ -388356,7 +388486,7 @@ var require_asciichart = __commonJS((exports) => {
388356
388486
  // utils/statsCache.ts
388357
388487
  import { randomBytes as randomBytes20 } from "crypto";
388358
388488
  import { open as open14 } from "fs/promises";
388359
- import { join as join137 } from "path";
388489
+ import { join as join138 } from "path";
388360
388490
  async function withStatsCacheLock(fn) {
388361
388491
  while (statsCacheLockPromise) {
388362
388492
  await statsCacheLockPromise;
@@ -388373,7 +388503,7 @@ async function withStatsCacheLock(fn) {
388373
388503
  }
388374
388504
  }
388375
388505
  function getStatsCachePath() {
388376
- return join137(getTheusConfigHomeDir(), STATS_CACHE_FILENAME);
388506
+ return join138(getTheusConfigHomeDir(), STATS_CACHE_FILENAME);
388377
388507
  }
388378
388508
  function getEmptyCache() {
388379
388509
  return {
@@ -389040,13 +389170,13 @@ var init_ansiToPng = __esm(() => {
389040
389170
 
389041
389171
  // utils/screenshotClipboard.ts
389042
389172
  import { mkdir as mkdir41, unlink as unlink19, writeFile as writeFile45 } from "fs/promises";
389043
- import { tmpdir as tmpdir8 } from "os";
389044
- import { join as join138 } from "path";
389173
+ import { tmpdir as tmpdir9 } from "os";
389174
+ import { join as join139 } from "path";
389045
389175
  async function copyAnsiToClipboard(ansiText, options2) {
389046
389176
  try {
389047
- const tempDir = join138(tmpdir8(), "theus-code-screenshots");
389177
+ const tempDir = join139(tmpdir9(), "theus-code-screenshots");
389048
389178
  await mkdir41(tempDir, { recursive: true });
389049
- const pngPath = join138(tempDir, `screenshot-${Date.now()}.png`);
389179
+ const pngPath = join139(tempDir, `screenshot-${Date.now()}.png`);
389050
389180
  const pngBuffer = ansiToPng(ansiText, options2);
389051
389181
  await writeFile45(pngPath, pngBuffer);
389052
389182
  const result = await copyPngToClipboard(pngPath);
@@ -389117,7 +389247,7 @@ var init_screenshotClipboard = __esm(() => {
389117
389247
 
389118
389248
  // utils/stats.ts
389119
389249
  import { open as open15 } from "fs/promises";
389120
- import { basename as basename40, join as join139, sep as sep31 } from "path";
389250
+ import { basename as basename40, join as join140, sep as sep31 } from "path";
389121
389251
  async function processSessionFiles(sessionFiles, options2 = {}) {
389122
389252
  const { fromDate, toDate } = options2;
389123
389253
  const fs5 = getFsImplementation();
@@ -389295,17 +389425,17 @@ async function getAllSessionFiles() {
389295
389425
  return [];
389296
389426
  throw e;
389297
389427
  }
389298
- const projectDirs = allEntries.filter((dirent) => dirent.isDirectory()).map((dirent) => join139(projectsDir, dirent.name));
389428
+ const projectDirs = allEntries.filter((dirent) => dirent.isDirectory()).map((dirent) => join140(projectsDir, dirent.name));
389299
389429
  const projectResults = await Promise.all(projectDirs.map(async (projectDir) => {
389300
389430
  try {
389301
389431
  const entries = await fs5.readdir(projectDir);
389302
- const mainFiles = entries.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".jsonl")).map((dirent) => join139(projectDir, dirent.name));
389432
+ const mainFiles = entries.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".jsonl")).map((dirent) => join140(projectDir, dirent.name));
389303
389433
  const sessionDirs = entries.filter((dirent) => dirent.isDirectory());
389304
389434
  const subagentResults = await Promise.all(sessionDirs.map(async (sessionDir) => {
389305
- const subagentsDir = join139(projectDir, sessionDir.name, "subagents");
389435
+ const subagentsDir = join140(projectDir, sessionDir.name, "subagents");
389306
389436
  try {
389307
389437
  const subagentEntries = await fs5.readdir(subagentsDir);
389308
- return subagentEntries.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".jsonl") && dirent.name.startsWith("agent-")).map((dirent) => join139(subagentsDir, dirent.name));
389438
+ return subagentEntries.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".jsonl") && dirent.name.startsWith("agent-")).map((dirent) => join140(subagentsDir, dirent.name));
389309
389439
  } catch {
389310
389440
  return [];
389311
389441
  }
@@ -391731,7 +391861,7 @@ import {
391731
391861
  unlink as unlink20,
391732
391862
  writeFile as writeFile46
391733
391863
  } from "fs/promises";
391734
- import { basename as basename41, dirname as dirname58, join as join140 } from "path";
391864
+ import { basename as basename41, dirname as dirname59, join as join141 } from "path";
391735
391865
  function isTranscriptMessage(entry) {
391736
391866
  return entry.type === "user" || entry.type === "assistant" || entry.type === "attachment" || entry.type === "system";
391737
391867
  }
@@ -391745,18 +391875,18 @@ function isEphemeralToolProgress(dataType) {
391745
391875
  return typeof dataType === "string" && EPHEMERAL_PROGRESS_TYPES.has(dataType);
391746
391876
  }
391747
391877
  function getProjectsDir2() {
391748
- return join140(getTheusConfigHomeDir(), "projects");
391878
+ return join141(getTheusConfigHomeDir(), "projects");
391749
391879
  }
391750
391880
  function getTranscriptPath() {
391751
391881
  const projectDir = getSessionProjectDir() ?? getProjectDir2(getOriginalCwd());
391752
- return join140(projectDir, `${getSessionId()}.jsonl`);
391882
+ return join141(projectDir, `${getSessionId()}.jsonl`);
391753
391883
  }
391754
391884
  function getTranscriptPathForSession(sessionId) {
391755
391885
  if (sessionId === getSessionId()) {
391756
391886
  return getTranscriptPath();
391757
391887
  }
391758
391888
  const projectDir = getProjectDir2(getOriginalCwd());
391759
- return join140(projectDir, `${sessionId}.jsonl`);
391889
+ return join141(projectDir, `${sessionId}.jsonl`);
391760
391890
  }
391761
391891
  function setAgentTranscriptSubdir(agentId, subdir) {
391762
391892
  agentTranscriptSubdirs.set(agentId, subdir);
@@ -391768,15 +391898,15 @@ function getAgentTranscriptPath(agentId) {
391768
391898
  const projectDir = getSessionProjectDir() ?? getProjectDir2(getOriginalCwd());
391769
391899
  const sessionId = getSessionId();
391770
391900
  const subdir = agentTranscriptSubdirs.get(agentId);
391771
- const base2 = subdir ? join140(projectDir, sessionId, "subagents", subdir) : join140(projectDir, sessionId, "subagents");
391772
- return join140(base2, `agent-${agentId}.jsonl`);
391901
+ const base2 = subdir ? join141(projectDir, sessionId, "subagents", subdir) : join141(projectDir, sessionId, "subagents");
391902
+ return join141(base2, `agent-${agentId}.jsonl`);
391773
391903
  }
391774
391904
  function getAgentMetadataPath(agentId) {
391775
391905
  return getAgentTranscriptPath(agentId).replace(/\.jsonl$/, ".meta.json");
391776
391906
  }
391777
391907
  async function writeAgentMetadata(agentId, metadata) {
391778
391908
  const path19 = getAgentMetadataPath(agentId);
391779
- await mkdir42(dirname58(path19), { recursive: true });
391909
+ await mkdir42(dirname59(path19), { recursive: true });
391780
391910
  await writeFile46(path19, JSON.stringify(metadata));
391781
391911
  }
391782
391912
  async function readAgentMetadata(agentId) {
@@ -391792,14 +391922,14 @@ async function readAgentMetadata(agentId) {
391792
391922
  }
391793
391923
  function getRemoteAgentsDir() {
391794
391924
  const projectDir = getSessionProjectDir() ?? getProjectDir2(getOriginalCwd());
391795
- return join140(projectDir, getSessionId(), "remote-agents");
391925
+ return join141(projectDir, getSessionId(), "remote-agents");
391796
391926
  }
391797
391927
  function getRemoteAgentMetadataPath(taskId) {
391798
- return join140(getRemoteAgentsDir(), `remote-agent-${taskId}.meta.json`);
391928
+ return join141(getRemoteAgentsDir(), `remote-agent-${taskId}.meta.json`);
391799
391929
  }
391800
391930
  async function writeRemoteAgentMetadata(taskId, metadata) {
391801
391931
  const path19 = getRemoteAgentMetadataPath(taskId);
391802
- await mkdir42(dirname58(path19), { recursive: true });
391932
+ await mkdir42(dirname59(path19), { recursive: true });
391803
391933
  await writeFile46(path19, JSON.stringify(metadata));
391804
391934
  }
391805
391935
  async function readRemoteAgentMetadata(taskId) {
@@ -391838,7 +391968,7 @@ async function listRemoteAgentMetadata() {
391838
391968
  if (!entry.isFile() || !entry.name.endsWith(".meta.json"))
391839
391969
  continue;
391840
391970
  try {
391841
- const raw = await readFile48(join140(dir, entry.name), "utf-8");
391971
+ const raw = await readFile48(join141(dir, entry.name), "utf-8");
391842
391972
  results.push(JSON.parse(raw));
391843
391973
  } catch (e) {
391844
391974
  logForDebugging(`listRemoteAgentMetadata: skipping ${entry.name}: ${String(e)}`);
@@ -391848,7 +391978,7 @@ async function listRemoteAgentMetadata() {
391848
391978
  }
391849
391979
  function sessionIdExists(sessionId) {
391850
391980
  const projectDir = getProjectDir2(getOriginalCwd());
391851
- const sessionFile = join140(projectDir, `${sessionId}.jsonl`);
391981
+ const sessionFile = join141(projectDir, `${sessionId}.jsonl`);
391852
391982
  const fs5 = getFsImplementation();
391853
391983
  try {
391854
391984
  fs5.statSync(sessionFile);
@@ -391988,7 +392118,7 @@ class Project {
391988
392118
  try {
391989
392119
  await fsAppendFile(filePath, data, { mode: 384 });
391990
392120
  } catch {
391991
- await mkdir42(dirname58(filePath), { recursive: true, mode: 448 });
392121
+ await mkdir42(dirname59(filePath), { recursive: true, mode: 448 });
391992
392122
  await fsAppendFile(filePath, data, { mode: 384 });
391993
392123
  }
391994
392124
  }
@@ -392587,7 +392717,7 @@ async function hydrateFromCCRv2InternalEvents(sessionId) {
392587
392717
  }
392588
392718
  for (const [agentId, entries] of byAgent) {
392589
392719
  const agentFile = getAgentTranscriptPath(asAgentId(agentId));
392590
- await mkdir42(dirname58(agentFile), { recursive: true, mode: 448 });
392720
+ await mkdir42(dirname59(agentFile), { recursive: true, mode: 448 });
392591
392721
  const agentContent = entries.map((p) => jsonStringify(p) + `
392592
392722
  `).join("");
392593
392723
  await writeFile46(agentFile, agentContent, {
@@ -393124,7 +393254,7 @@ function appendEntryToFile(fullPath, entry) {
393124
393254
  try {
393125
393255
  fs5.appendFileSync(fullPath, line, { mode: 384 });
393126
393256
  } catch {
393127
- fs5.mkdirSync(dirname58(fullPath), { mode: 448 });
393257
+ fs5.mkdirSync(dirname59(fullPath), { mode: 448 });
393128
393258
  fs5.appendFileSync(fullPath, line, { mode: 384 });
393129
393259
  }
393130
393260
  }
@@ -393817,7 +393947,7 @@ async function loadTranscriptFile(filePath, opts) {
393817
393947
  };
393818
393948
  }
393819
393949
  async function loadSessionFile(sessionId) {
393820
- const sessionFile = join140(getSessionProjectDir() ?? getProjectDir2(getOriginalCwd()), `${sessionId}.jsonl`);
393950
+ const sessionFile = join141(getSessionProjectDir() ?? getProjectDir2(getOriginalCwd()), `${sessionId}.jsonl`);
393821
393951
  return loadTranscriptFile(sessionFile);
393822
393952
  }
393823
393953
  function clearSessionMessagesCache() {
@@ -393885,7 +394015,7 @@ async function loadAllProjectsMessageLogsFull(limit) {
393885
394015
  } catch {
393886
394016
  return [];
393887
394017
  }
393888
- const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join140(projectsDir, dirent.name));
394018
+ const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join141(projectsDir, dirent.name));
393889
394019
  const logsPerProject = await Promise.all(projectDirs.map((projectDir) => getLogsWithoutIndex(projectDir, limit)));
393890
394020
  const allLogs = logsPerProject.flat();
393891
394021
  const deduped = new Map;
@@ -393910,7 +394040,7 @@ async function loadAllProjectsMessageLogsProgressive(limit, initialEnrichCount =
393910
394040
  } catch {
393911
394041
  return { logs: [], allStatLogs: [], nextIndex: 0 };
393912
394042
  }
393913
- const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join140(projectsDir, dirent.name));
394043
+ const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join141(projectsDir, dirent.name));
393914
394044
  const rawLogs = [];
393915
394045
  for (const projectDir of projectDirs) {
393916
394046
  rawLogs.push(...await getSessionFilesLite(projectDir, limit));
@@ -393971,7 +394101,7 @@ async function getStatOnlyLogsForWorktrees(worktreePaths, limit) {
393971
394101
  for (const { path: wtPath, prefix } of indexed) {
393972
394102
  if (dirName === prefix || dirName.startsWith(prefix + "-")) {
393973
394103
  seenDirs.add(dirName);
393974
- allLogs.push(...await getSessionFilesLite(join140(projectsDir, dirent.name), undefined, wtPath));
394104
+ allLogs.push(...await getSessionFilesLite(join141(projectsDir, dirent.name), undefined, wtPath));
393975
394105
  break;
393976
394106
  }
393977
394107
  }
@@ -394040,7 +394170,7 @@ async function loadSubagentTranscripts(agentIds) {
394040
394170
  return transcripts;
394041
394171
  }
394042
394172
  async function loadAllSubagentTranscriptsFromDisk() {
394043
- const subagentsDir = join140(getSessionProjectDir() ?? getProjectDir2(getOriginalCwd()), getSessionId(), "subagents");
394173
+ const subagentsDir = join141(getSessionProjectDir() ?? getProjectDir2(getOriginalCwd()), getSessionId(), "subagents");
394044
394174
  let entries;
394045
394175
  try {
394046
394176
  entries = await readdir28(subagentsDir, { withFileTypes: true });
@@ -394168,7 +394298,7 @@ async function getSessionFilesWithMtime(projectDir) {
394168
394298
  const sessionId = validateUuid2(basename41(dirent.name, ".jsonl"));
394169
394299
  if (!sessionId)
394170
394300
  continue;
394171
- candidates.push({ sessionId, filePath: join140(projectDir, dirent.name) });
394301
+ candidates.push({ sessionId, filePath: join141(projectDir, dirent.name) });
394172
394302
  }
394173
394303
  await Promise.all(candidates.map(async ({ sessionId, filePath }) => {
394174
394304
  try {
@@ -394554,7 +394684,7 @@ var init_sessionStorage = __esm(() => {
394554
394684
  init_settings2();
394555
394685
  init_slowOperations();
394556
394686
  init_uuid();
394557
- VERSION4 = { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
394687
+ VERSION4 = { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
394558
394688
  MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
394559
394689
  SKIP_FIRST_PROMPT_PATTERN = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
394560
394690
  EPHEMERAL_PROGRESS_TYPES = new Set([
@@ -394566,7 +394696,7 @@ var init_sessionStorage = __esm(() => {
394566
394696
  MAX_TRANSCRIPT_READ_BYTES = 50 * 1024 * 1024;
394567
394697
  agentTranscriptSubdirs = new Map;
394568
394698
  getProjectDir2 = memoize_default((projectDir) => {
394569
- return join140(getProjectsDir2(), sanitizePath2(projectDir));
394699
+ return join141(getProjectsDir2(), sanitizePath2(projectDir));
394570
394700
  });
394571
394701
  METADATA_TYPE_MARKERS = [
394572
394702
  '"type":"summary"',
@@ -394804,41 +394934,41 @@ var init_memdir = __esm(() => {
394804
394934
  });
394805
394935
 
394806
394936
  // tools/AgentTool/agentMemory.ts
394807
- import { join as join141, normalize as normalize13, sep as sep32 } from "path";
394937
+ import { join as join142, normalize as normalize13, sep as sep32 } from "path";
394808
394938
  function sanitizeAgentTypeForPath(agentType) {
394809
394939
  return agentType.replace(/:/g, "-");
394810
394940
  }
394811
394941
  function getLocalAgentMemoryDir(dirName) {
394812
394942
  if (process.env.THEUS_CODE_REMOTE_MEMORY_DIR) {
394813
- return join141(process.env.THEUS_CODE_REMOTE_MEMORY_DIR, "projects", sanitizePath2(findCanonicalGitRoot(getProjectRoot()) ?? getProjectRoot()), "agent-memory-local", dirName) + sep32;
394943
+ return join142(process.env.THEUS_CODE_REMOTE_MEMORY_DIR, "projects", sanitizePath2(findCanonicalGitRoot(getProjectRoot()) ?? getProjectRoot()), "agent-memory-local", dirName) + sep32;
394814
394944
  }
394815
- return join141(getCwd(), ".theus", "agent-memory-local", dirName) + sep32;
394945
+ return join142(getCwd(), ".theus", "agent-memory-local", dirName) + sep32;
394816
394946
  }
394817
394947
  function getAgentMemoryDir(agentType, scope) {
394818
394948
  const dirName = sanitizeAgentTypeForPath(agentType);
394819
394949
  switch (scope) {
394820
394950
  case "project":
394821
- return join141(getCwd(), ".theus", "agent-memory", dirName) + sep32;
394951
+ return join142(getCwd(), ".theus", "agent-memory", dirName) + sep32;
394822
394952
  case "local":
394823
394953
  return getLocalAgentMemoryDir(dirName);
394824
394954
  case "user":
394825
- return join141(getMemoryBaseDir(), "agent-memory", dirName) + sep32;
394955
+ return join142(getMemoryBaseDir(), "agent-memory", dirName) + sep32;
394826
394956
  }
394827
394957
  }
394828
394958
  function isAgentMemoryPath(absolutePath) {
394829
394959
  const normalizedPath = normalize13(absolutePath);
394830
394960
  const memoryBase = getMemoryBaseDir();
394831
- if (normalizedPath.startsWith(join141(memoryBase, "agent-memory") + sep32)) {
394961
+ if (normalizedPath.startsWith(join142(memoryBase, "agent-memory") + sep32)) {
394832
394962
  return true;
394833
394963
  }
394834
- if (normalizedPath.startsWith(join141(getCwd(), ".theus", "agent-memory") + sep32)) {
394964
+ if (normalizedPath.startsWith(join142(getCwd(), ".theus", "agent-memory") + sep32)) {
394835
394965
  return true;
394836
394966
  }
394837
394967
  if (process.env.THEUS_CODE_REMOTE_MEMORY_DIR) {
394838
- if (normalizedPath.includes(sep32 + "agent-memory-local" + sep32) && normalizedPath.startsWith(join141(process.env.THEUS_CODE_REMOTE_MEMORY_DIR, "projects") + sep32)) {
394968
+ if (normalizedPath.includes(sep32 + "agent-memory-local" + sep32) && normalizedPath.startsWith(join142(process.env.THEUS_CODE_REMOTE_MEMORY_DIR, "projects") + sep32)) {
394839
394969
  return true;
394840
394970
  }
394841
- } else if (normalizedPath.startsWith(join141(getCwd(), ".theus", "agent-memory-local") + sep32)) {
394971
+ } else if (normalizedPath.startsWith(join142(getCwd(), ".theus", "agent-memory-local") + sep32)) {
394842
394972
  return true;
394843
394973
  }
394844
394974
  return false;
@@ -394846,7 +394976,7 @@ function isAgentMemoryPath(absolutePath) {
394846
394976
  function getMemoryScopeDisplay(memory2) {
394847
394977
  switch (memory2) {
394848
394978
  case "user":
394849
- return `User (${join141(getMemoryBaseDir(), "agent-memory")}/)`;
394979
+ return `User (${join142(getMemoryBaseDir(), "agent-memory")}/)`;
394850
394980
  case "project":
394851
394981
  return "Project (.theus/agent-memory/)";
394852
394982
  case "local":
@@ -394888,8 +395018,8 @@ var init_agentMemory = __esm(() => {
394888
395018
 
394889
395019
  // utils/permissions/filesystem.ts
394890
395020
  import { randomBytes as randomBytes21 } from "crypto";
394891
- import { homedir as homedir35, tmpdir as tmpdir9 } from "os";
394892
- import { join as join142, normalize as normalize14, posix as posix8, sep as sep33 } from "path";
395021
+ import { homedir as homedir35, tmpdir as tmpdir10 } from "os";
395022
+ import { join as join143, normalize as normalize14, posix as posix8, sep as sep33 } from "path";
394893
395023
  function normalizeCaseForComparison(path19) {
394894
395024
  return path19.toLowerCase();
394895
395025
  }
@@ -394898,11 +395028,11 @@ function getTheusSkillScope(filePath) {
394898
395028
  const absolutePathLower = normalizeCaseForComparison(absolutePath);
394899
395029
  const bases = [
394900
395030
  {
394901
- dir: expandPath(join142(getOriginalCwd(), ".theus", "skills")),
395031
+ dir: expandPath(join143(getOriginalCwd(), ".theus", "skills")),
394902
395032
  prefix: "/.theus/skills/"
394903
395033
  },
394904
395034
  {
394905
- dir: expandPath(join142(homedir35(), ".theus", "skills")),
395035
+ dir: expandPath(join143(homedir35(), ".theus", "skills")),
394906
395036
  prefix: "~/.theus/skills/"
394907
395037
  }
394908
395038
  ];
@@ -394957,21 +395087,21 @@ function isTheusConfigFilePath(filePath) {
394957
395087
  if (isTheusSettingsPath(filePath)) {
394958
395088
  return true;
394959
395089
  }
394960
- const commandsDir = join142(getOriginalCwd(), ".theus", "commands");
394961
- const agentsDir = join142(getOriginalCwd(), ".theus", "agents");
394962
- const skillsDir = join142(getOriginalCwd(), ".theus", "skills");
395090
+ const commandsDir = join143(getOriginalCwd(), ".theus", "commands");
395091
+ const agentsDir = join143(getOriginalCwd(), ".theus", "agents");
395092
+ const skillsDir = join143(getOriginalCwd(), ".theus", "skills");
394963
395093
  return pathInWorkingPath(filePath, commandsDir) || pathInWorkingPath(filePath, agentsDir) || pathInWorkingPath(filePath, skillsDir);
394964
395094
  }
394965
395095
  function isSessionPlanFile(absolutePath) {
394966
- const expectedPrefix = join142(getPlansDirectory(), getPlanSlug());
395096
+ const expectedPrefix = join143(getPlansDirectory(), getPlanSlug());
394967
395097
  const normalizedPath = normalize14(absolutePath);
394968
395098
  return normalizedPath.startsWith(expectedPrefix) && normalizedPath.endsWith(".md");
394969
395099
  }
394970
395100
  function getSessionMemoryDir() {
394971
- return join142(getProjectDir2(getCwd()), getSessionId(), "session-memory") + sep33;
395101
+ return join143(getProjectDir2(getCwd()), getSessionId(), "session-memory") + sep33;
394972
395102
  }
394973
395103
  function getSessionMemoryPath() {
394974
- return join142(getSessionMemoryDir(), "summary.md");
395104
+ return join143(getSessionMemoryDir(), "summary.md");
394975
395105
  }
394976
395106
  function isSessionMemoryPath(absolutePath) {
394977
395107
  const normalizedPath = normalize14(absolutePath);
@@ -394993,10 +395123,10 @@ function getTheusTempDirName() {
394993
395123
  return `theus-${uid}`;
394994
395124
  }
394995
395125
  function getProjectTempDir() {
394996
- return join142(getTheusTempDir(), sanitizePath2(getOriginalCwd())) + sep33;
395126
+ return join143(getTheusTempDir(), sanitizePath2(getOriginalCwd())) + sep33;
394997
395127
  }
394998
395128
  function getScratchpadDir() {
394999
- return join142(getProjectTempDir(), getSessionId(), "scratchpad");
395129
+ return join143(getProjectTempDir(), getSessionId(), "scratchpad");
395000
395130
  }
395001
395131
  async function ensureScratchpadDir() {
395002
395132
  if (!isScratchpadEnabled()) {
@@ -395574,7 +395704,7 @@ function checkEditableInternalPath(absolutePath, input) {
395574
395704
  }
395575
395705
  };
395576
395706
  }
395577
- if (normalizeCaseForComparison(normalizedPath) === normalizeCaseForComparison(join142(getOriginalCwd(), ".theus", "launch.json"))) {
395707
+ if (normalizeCaseForComparison(normalizedPath) === normalizeCaseForComparison(join143(getOriginalCwd(), ".theus", "launch.json"))) {
395578
395708
  return {
395579
395709
  behavior: "allow",
395580
395710
  updatedInput: input,
@@ -395671,7 +395801,7 @@ function checkReadableInternalPath(absolutePath, input) {
395671
395801
  }
395672
395802
  };
395673
395803
  }
395674
- const tasksDir = join142(getTheusConfigHomeDir(), "tasks") + sep33;
395804
+ const tasksDir = join143(getTheusConfigHomeDir(), "tasks") + sep33;
395675
395805
  if (normalizedPath === tasksDir.slice(0, -1) || normalizedPath.startsWith(tasksDir)) {
395676
395806
  return {
395677
395807
  behavior: "allow",
@@ -395682,7 +395812,7 @@ function checkReadableInternalPath(absolutePath, input) {
395682
395812
  }
395683
395813
  };
395684
395814
  }
395685
- const teamsReadDir = join142(getTheusConfigHomeDir(), "teams") + sep33;
395815
+ const teamsReadDir = join143(getTheusConfigHomeDir(), "teams") + sep33;
395686
395816
  if (normalizedPath === teamsReadDir.slice(0, -1) || normalizedPath.startsWith(teamsReadDir)) {
395687
395817
  return {
395688
395818
  behavior: "allow",
@@ -395749,17 +395879,17 @@ var init_filesystem = __esm(() => {
395749
395879
  ];
395750
395880
  DIR_SEP = posix8.sep;
395751
395881
  getTheusTempDir = memoize_default(function getTheusTempDir2() {
395752
- const baseTmpDir = process.env.THEUS_CODE_TMPDIR || (getPlatform() === "windows" ? tmpdir9() : "/tmp");
395882
+ const baseTmpDir = process.env.THEUS_CODE_TMPDIR || (getPlatform() === "windows" ? tmpdir10() : "/tmp");
395753
395883
  const fs5 = getFsImplementation();
395754
395884
  let resolvedBaseTmpDir = baseTmpDir;
395755
395885
  try {
395756
395886
  resolvedBaseTmpDir = fs5.realpathSync(baseTmpDir);
395757
395887
  } catch {}
395758
- return join142(resolvedBaseTmpDir, getTheusTempDirName()) + sep33;
395888
+ return join143(resolvedBaseTmpDir, getTheusTempDirName()) + sep33;
395759
395889
  });
395760
395890
  getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
395761
395891
  const nonce = randomBytes21(16).toString("hex");
395762
- return join142(getTheusTempDir(), "bundled-skills", { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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);
395892
+ return join143(getTheusTempDir(), "bundled-skills", { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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);
395763
395893
  });
395764
395894
  getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
395765
395895
  });
@@ -395773,10 +395903,10 @@ import {
395773
395903
  symlink as symlink4,
395774
395904
  unlink as unlink21
395775
395905
  } from "fs/promises";
395776
- import { join as join143 } from "path";
395906
+ import { join as join144 } from "path";
395777
395907
  function getTaskOutputDir() {
395778
395908
  if (_taskOutputDir === undefined) {
395779
- _taskOutputDir = join143(getProjectTempDir(), getSessionId(), "tasks");
395909
+ _taskOutputDir = join144(getProjectTempDir(), getSessionId(), "tasks");
395780
395910
  }
395781
395911
  return _taskOutputDir;
395782
395912
  }
@@ -395784,7 +395914,7 @@ async function ensureOutputDir() {
395784
395914
  await mkdir43(getTaskOutputDir(), { recursive: true });
395785
395915
  }
395786
395916
  function getTaskOutputPath(taskId) {
395787
- return join143(getTaskOutputDir(), `${taskId}.output`);
395917
+ return join144(getTaskOutputDir(), `${taskId}.output`);
395788
395918
  }
395789
395919
  function track(p) {
395790
395920
  _pendingOps.add(p);
@@ -400042,7 +400172,7 @@ __export(exports_worktree, {
400042
400172
  cleanupWorktree: () => cleanupWorktree,
400043
400173
  cleanupStaleAgentWorktrees: () => cleanupStaleAgentWorktrees
400044
400174
  });
400045
- import { spawnSync as spawnSync5 } from "child_process";
400175
+ import { spawnSync as spawnSync6 } from "child_process";
400046
400176
  import {
400047
400177
  copyFile as copyFile9,
400048
400178
  mkdir as mkdir44,
@@ -400052,7 +400182,7 @@ import {
400052
400182
  symlink as symlink5,
400053
400183
  utimes as utimes2
400054
400184
  } from "fs/promises";
400055
- import { basename as basename43, dirname as dirname59, join as join144 } from "path";
400185
+ import { basename as basename43, dirname as dirname60, join as join145 } from "path";
400056
400186
  function validateWorktreeSlug(slug) {
400057
400187
  if (slug.length > MAX_WORKTREE_SLUG_LENGTH) {
400058
400188
  throw new Error(`Invalid worktree name: must be ${MAX_WORKTREE_SLUG_LENGTH} characters or fewer (got ${slug.length})`);
@@ -400075,8 +400205,8 @@ async function symlinkDirectories(repoRootPath, worktreePath, dirsToSymlink) {
400075
400205
  logForDebugging(`Skipping symlink for "${dir}": path traversal detected`, { level: "warn" });
400076
400206
  continue;
400077
400207
  }
400078
- const sourcePath = join144(repoRootPath, dir);
400079
- const destPath = join144(worktreePath, dir);
400208
+ const sourcePath = join145(repoRootPath, dir);
400209
+ const destPath = join145(worktreePath, dir);
400080
400210
  try {
400081
400211
  await symlink5(sourcePath, destPath, "dir");
400082
400212
  logForDebugging(`Symlinked ${dir} from main repository to worktree to avoid disk bloat`);
@@ -400100,7 +400230,7 @@ function generateTmuxSessionName(repoPath, branch2) {
400100
400230
  return combined.replace(/[/.]/g, "_");
400101
400231
  }
400102
400232
  function worktreesDir(repoRoot) {
400103
- return join144(repoRoot, ".theus", "worktrees");
400233
+ return join145(repoRoot, ".theus", "worktrees");
400104
400234
  }
400105
400235
  function flattenSlug(slug) {
400106
400236
  return slug.replaceAll("/", "+");
@@ -400109,7 +400239,7 @@ function worktreeBranchName(slug) {
400109
400239
  return `worktree-${flattenSlug(slug)}`;
400110
400240
  }
400111
400241
  function worktreePathFor(repoRoot, slug) {
400112
- return join144(worktreesDir(repoRoot), flattenSlug(slug));
400242
+ return join145(worktreesDir(repoRoot), flattenSlug(slug));
400113
400243
  }
400114
400244
  async function getOrCreateWorktree(repoRoot, slug, options2) {
400115
400245
  const worktreePath = worktreePathFor(repoRoot, slug);
@@ -400190,7 +400320,7 @@ async function getOrCreateWorktree(repoRoot, slug, options2) {
400190
400320
  async function copyWorktreeIncludeFiles(repoRoot, worktreePath) {
400191
400321
  let includeContent;
400192
400322
  try {
400193
- includeContent = await readFile49(join144(repoRoot, ".worktreeinclude"), "utf-8");
400323
+ includeContent = await readFile49(join145(repoRoot, ".worktreeinclude"), "utf-8");
400194
400324
  } catch {
400195
400325
  return [];
400196
400326
  }
@@ -400245,10 +400375,10 @@ async function copyWorktreeIncludeFiles(repoRoot, worktreePath) {
400245
400375
  }
400246
400376
  const copied = [];
400247
400377
  for (const relativePath2 of files2) {
400248
- const srcPath = join144(repoRoot, relativePath2);
400249
- const destPath = join144(worktreePath, relativePath2);
400378
+ const srcPath = join145(repoRoot, relativePath2);
400379
+ const destPath = join145(worktreePath, relativePath2);
400250
400380
  try {
400251
- await mkdir44(dirname59(destPath), { recursive: true });
400381
+ await mkdir44(dirname60(destPath), { recursive: true });
400252
400382
  await copyFile9(srcPath, destPath);
400253
400383
  copied.push(relativePath2);
400254
400384
  } catch (e) {
@@ -400262,10 +400392,10 @@ async function copyWorktreeIncludeFiles(repoRoot, worktreePath) {
400262
400392
  }
400263
400393
  async function performPostCreationSetup(repoRoot, worktreePath) {
400264
400394
  const localSettingsRelativePath = getRelativeSettingsFilePathForSource("localSettings");
400265
- const sourceSettingsLocal = join144(repoRoot, localSettingsRelativePath);
400395
+ const sourceSettingsLocal = join145(repoRoot, localSettingsRelativePath);
400266
400396
  try {
400267
- const destSettingsLocal = join144(worktreePath, localSettingsRelativePath);
400268
- await mkdirRecursive(dirname59(destSettingsLocal));
400397
+ const destSettingsLocal = join145(worktreePath, localSettingsRelativePath);
400398
+ await mkdirRecursive(dirname60(destSettingsLocal));
400269
400399
  await copyFile9(sourceSettingsLocal, destSettingsLocal);
400270
400400
  logForDebugging(`Copied settings.local.json to worktree: ${destSettingsLocal}`);
400271
400401
  } catch (e) {
@@ -400274,8 +400404,8 @@ async function performPostCreationSetup(repoRoot, worktreePath) {
400274
400404
  logForDebugging(`Failed to copy settings.local.json: ${e.message}`, { level: "warn" });
400275
400405
  }
400276
400406
  }
400277
- const huskyPath = join144(repoRoot, ".husky");
400278
- const gitHooksPath = join144(repoRoot, ".git", "hooks");
400407
+ const huskyPath = join145(repoRoot, ".husky");
400408
+ const gitHooksPath = join145(repoRoot, ".git", "hooks");
400279
400409
  let hooksPath = null;
400280
400410
  for (const candidatePath of [huskyPath, gitHooksPath]) {
400281
400411
  try {
@@ -400550,7 +400680,7 @@ async function cleanupStaleAgentWorktrees(cutoffDate) {
400550
400680
  if (!EPHEMERAL_WORKTREE_PATTERNS.some((p) => p.test(slug))) {
400551
400681
  continue;
400552
400682
  }
400553
- const worktreePath = join144(dir, slug);
400683
+ const worktreePath = join145(dir, slug);
400554
400684
  if (currentPath === worktreePath) {
400555
400685
  continue;
400556
400686
  }
@@ -400611,7 +400741,7 @@ async function execIntoTmuxWorktree(args) {
400611
400741
  error: "Error: --tmux is not supported on Windows"
400612
400742
  };
400613
400743
  }
400614
- const tmuxCheck = spawnSync5("tmux", ["-V"], { encoding: "utf-8" });
400744
+ const tmuxCheck = spawnSync6("tmux", ["-V"], { encoding: "utf-8" });
400615
400745
  if (tmuxCheck.status !== 0) {
400616
400746
  const installHint = process.platform === "darwin" ? "Install tmux with: brew install tmux" : "Install tmux with: sudo apt install tmux";
400617
400747
  return {
@@ -400716,7 +400846,7 @@ async function execIntoTmuxWorktree(args) {
400716
400846
  newArgs.push(arg);
400717
400847
  }
400718
400848
  let tmuxPrefix = "C-b";
400719
- const prefixResult = spawnSync5("tmux", ["show-options", "-g", "prefix"], {
400849
+ const prefixResult = spawnSync6("tmux", ["show-options", "-g", "prefix"], {
400720
400850
  encoding: "utf-8"
400721
400851
  });
400722
400852
  if (prefixResult.status === 0 && prefixResult.stdout) {
@@ -400743,7 +400873,7 @@ async function execIntoTmuxWorktree(args) {
400743
400873
  THEUS_CODE_TMUX_PREFIX: tmuxPrefix,
400744
400874
  THEUS_CODE_TMUX_PREFIX_CONFLICTS: prefixConflicts ? "1" : ""
400745
400875
  };
400746
- const hasSessionResult = spawnSync5("tmux", ["has-session", "-t", tmuxSessionName], { encoding: "utf-8" });
400876
+ const hasSessionResult = spawnSync6("tmux", ["has-session", "-t", tmuxSessionName], { encoding: "utf-8" });
400747
400877
  const sessionExists = hasSessionResult.status === 0;
400748
400878
  const isAlreadyInTmux = Boolean(process.env.TMUX);
400749
400879
  const useControlMode = isInITerm2() && !forceClassicTmux && !isAlreadyInTmux;
@@ -400761,7 +400891,7 @@ ${y("\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2
400761
400891
  const isTheusCliInternal = repoName === "theus-cli-internal";
400762
400892
  const shouldSetupDevPanes = isAnt && isTheusCliInternal && !sessionExists;
400763
400893
  if (shouldSetupDevPanes) {
400764
- spawnSync5("tmux", [
400894
+ spawnSync6("tmux", [
400765
400895
  "new-session",
400766
400896
  "-d",
400767
400897
  "-s",
@@ -400772,21 +400902,21 @@ ${y("\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2
400772
400902
  process.execPath,
400773
400903
  ...newArgs
400774
400904
  ], { cwd: worktreeDir, env: tmuxEnv });
400775
- spawnSync5("tmux", ["split-window", "-h", "-t", tmuxSessionName, "-c", worktreeDir], { cwd: worktreeDir });
400776
- spawnSync5("tmux", ["send-keys", "-t", tmuxSessionName, "bun run watch", "Enter"], { cwd: worktreeDir });
400777
- spawnSync5("tmux", ["split-window", "-v", "-t", tmuxSessionName, "-c", worktreeDir], { cwd: worktreeDir });
400778
- spawnSync5("tmux", ["send-keys", "-t", tmuxSessionName, "bun run start"], {
400905
+ spawnSync6("tmux", ["split-window", "-h", "-t", tmuxSessionName, "-c", worktreeDir], { cwd: worktreeDir });
400906
+ spawnSync6("tmux", ["send-keys", "-t", tmuxSessionName, "bun run watch", "Enter"], { cwd: worktreeDir });
400907
+ spawnSync6("tmux", ["split-window", "-v", "-t", tmuxSessionName, "-c", worktreeDir], { cwd: worktreeDir });
400908
+ spawnSync6("tmux", ["send-keys", "-t", tmuxSessionName, "bun run start"], {
400779
400909
  cwd: worktreeDir
400780
400910
  });
400781
- spawnSync5("tmux", ["select-pane", "-t", `${tmuxSessionName}:0.0`], {
400911
+ spawnSync6("tmux", ["select-pane", "-t", `${tmuxSessionName}:0.0`], {
400782
400912
  cwd: worktreeDir
400783
400913
  });
400784
400914
  if (isAlreadyInTmux) {
400785
- spawnSync5("tmux", ["switch-client", "-t", tmuxSessionName], {
400915
+ spawnSync6("tmux", ["switch-client", "-t", tmuxSessionName], {
400786
400916
  stdio: "inherit"
400787
400917
  });
400788
400918
  } else {
400789
- spawnSync5("tmux", [...tmuxGlobalArgs, "attach-session", "-t", tmuxSessionName], {
400919
+ spawnSync6("tmux", [...tmuxGlobalArgs, "attach-session", "-t", tmuxSessionName], {
400790
400920
  stdio: "inherit",
400791
400921
  cwd: worktreeDir
400792
400922
  });
@@ -400794,11 +400924,11 @@ ${y("\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2
400794
400924
  } else {
400795
400925
  if (isAlreadyInTmux) {
400796
400926
  if (sessionExists) {
400797
- spawnSync5("tmux", ["switch-client", "-t", tmuxSessionName], {
400927
+ spawnSync6("tmux", ["switch-client", "-t", tmuxSessionName], {
400798
400928
  stdio: "inherit"
400799
400929
  });
400800
400930
  } else {
400801
- spawnSync5("tmux", [
400931
+ spawnSync6("tmux", [
400802
400932
  "new-session",
400803
400933
  "-d",
400804
400934
  "-s",
@@ -400809,7 +400939,7 @@ ${y("\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2
400809
400939
  process.execPath,
400810
400940
  ...newArgs
400811
400941
  ], { cwd: worktreeDir, env: tmuxEnv });
400812
- spawnSync5("tmux", ["switch-client", "-t", tmuxSessionName], {
400942
+ spawnSync6("tmux", ["switch-client", "-t", tmuxSessionName], {
400813
400943
  stdio: "inherit"
400814
400944
  });
400815
400945
  }
@@ -400826,7 +400956,7 @@ ${y("\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2
400826
400956
  process.execPath,
400827
400957
  ...newArgs
400828
400958
  ];
400829
- spawnSync5("tmux", tmuxArgs, {
400959
+ spawnSync6("tmux", tmuxArgs, {
400830
400960
  stdio: "inherit",
400831
400961
  cwd: worktreeDir,
400832
400962
  env: tmuxEnv
@@ -400934,7 +401064,7 @@ function getSimpleDoingTasksSection() {
400934
401064
  ];
400935
401065
  const userHelpSubitems = [
400936
401066
  `/help: Get help with using Theus`,
400937
- `To give feedback, users should ${{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.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}`
401067
+ `To give feedback, users should ${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.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}`
400938
401068
  ];
400939
401069
  const items = [
400940
401070
  `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.`,
@@ -401314,7 +401444,7 @@ var init_prompts4 = __esm(() => {
401314
401444
  });
401315
401445
 
401316
401446
  // utils/api.ts
401317
- import { createHash as createHash27 } from "crypto";
401447
+ import { createHash as createHash28 } from "crypto";
401318
401448
  function filterSwarmFieldsFromSchema(toolName, schema) {
401319
401449
  const fieldsToRemove = SWARM_FIELDS_BY_TOOL[toolName];
401320
401450
  if (!fieldsToRemove || fieldsToRemove.length === 0) {
@@ -401404,7 +401534,7 @@ function logAPIPrefix(systemPrompt) {
401404
401534
  logEvent("tengu_sysprompt_block", {
401405
401535
  snippet: firstSystemPrompt?.slice(0, 20),
401406
401536
  length: firstSystemPrompt?.length ?? 0,
401407
- hash: firstSystemPrompt ? createHash27("sha256").update(firstSystemPrompt).digest("hex") : ""
401537
+ hash: firstSystemPrompt ? createHash28("sha256").update(firstSystemPrompt).digest("hex") : ""
401408
401538
  });
401409
401539
  }
401410
401540
  function splitSysPromptPrefix(systemPrompt, options2) {
@@ -401730,7 +401860,7 @@ var init_api4 = __esm(() => {
401730
401860
  });
401731
401861
 
401732
401862
  // utils/fingerprint.ts
401733
- import { createHash as createHash28 } from "crypto";
401863
+ import { createHash as createHash29 } from "crypto";
401734
401864
  function extractFirstMessageText(messages) {
401735
401865
  const firstUserMessage = messages.find((msg) => msg.type === "user");
401736
401866
  if (!firstUserMessage) {
@@ -401752,12 +401882,12 @@ function computeFingerprint(messageText, version3) {
401752
401882
  const indices = [4, 7, 20];
401753
401883
  const chars = indices.map((i3) => messageText[i3] || "0").join("");
401754
401884
  const fingerprintInput = `${FINGERPRINT_SALT}${chars}${version3}`;
401755
- const hash = createHash28("sha256").update(fingerprintInput).digest("hex");
401885
+ const hash = createHash29("sha256").update(fingerprintInput).digest("hex");
401756
401886
  return hash.slice(0, 3);
401757
401887
  }
401758
401888
  function computeFingerprintFromMessages(messages) {
401759
401889
  const firstMessageText = extractFirstMessageText(messages);
401760
- return computeFingerprint(firstMessageText, { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
401890
+ return computeFingerprint(firstMessageText, { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
401761
401891
  }
401762
401892
  var FINGERPRINT_SALT = "59cf53e54c78";
401763
401893
  var init_fingerprint = () => {};
@@ -403557,7 +403687,7 @@ var init_theusEngine = __esm(() => {
403557
403687
  });
403558
403688
 
403559
403689
  // services/api/theus.ts
403560
- import { existsSync as existsSync14, readFileSync as readFileSync21 } from "fs";
403690
+ import { existsSync as existsSync15, readFileSync as readFileSync22 } from "fs";
403561
403691
  import { randomUUID as randomUUID33 } from "crypto";
403562
403692
  function env5(name) {
403563
403693
  const value = process.env[name];
@@ -403568,10 +403698,10 @@ function trimBaseURL2(baseURL) {
403568
403698
  }
403569
403699
  function loadProvidersConfig3() {
403570
403700
  const path19 = defaultProvidersConfigPath();
403571
- if (!existsSync14(path19))
403701
+ if (!existsSync15(path19))
403572
403702
  return null;
403573
403703
  try {
403574
- return JSON.parse(readFileSync21(path19, "utf8"));
403704
+ return JSON.parse(readFileSync22(path19, "utf8"));
403575
403705
  } catch {
403576
403706
  return null;
403577
403707
  }
@@ -404283,7 +404413,7 @@ async function sideQuery(opts) {
404283
404413
  betas.push(STRUCTURED_OUTPUTS_BETA_HEADER);
404284
404414
  }
404285
404415
  const messageText = extractFirstUserMessageText(messages);
404286
- const fingerprint = computeFingerprint(messageText, { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
404416
+ const fingerprint = computeFingerprint(messageText, { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
404287
404417
  const attributionHeader = getAttributionHeader(fingerprint);
404288
404418
  const systemBlocks = [
404289
404419
  attributionHeader ? { type: "text", text: attributionHeader } : null,
@@ -404569,7 +404699,7 @@ import {
404569
404699
  } from "fs/promises";
404570
404700
  import { createServer as createServer7 } from "net";
404571
404701
  import { homedir as homedir36, platform as platform5 } from "os";
404572
- import { join as join145 } from "path";
404702
+ import { join as join146 } from "path";
404573
404703
  function log(message, ...args) {
404574
404704
  if (LOG_FILE) {
404575
404705
  const timestamp = new Date().toISOString();
@@ -404636,7 +404766,7 @@ class ChromeNativeHost {
404636
404766
  try {
404637
404767
  process.kill(pid, 0);
404638
404768
  } catch {
404639
- await unlink22(join145(socketDir, file2)).catch(() => {});
404769
+ await unlink22(join146(socketDir, file2)).catch(() => {});
404640
404770
  log(`Removed stale socket for PID ${pid}`);
404641
404771
  }
404642
404772
  }
@@ -404907,7 +405037,7 @@ var init_chromeNativeHost = __esm(() => {
404907
405037
  init_slowOperations();
404908
405038
  init_common2();
404909
405039
  MAX_MESSAGE_SIZE = 1024 * 1024;
404910
- LOG_FILE = process.env.USER_TYPE === "ant" ? join145(homedir36(), ".theus", "debug", "chrome-native-host.txt") : undefined;
405040
+ LOG_FILE = process.env.USER_TYPE === "ant" ? join146(homedir36(), ".theus", "debug", "chrome-native-host.txt") : undefined;
404911
405041
  messageSchema = lazySchema(() => exports_external2.object({
404912
405042
  type: exports_external2.string()
404913
405043
  }).passthrough());
@@ -405586,7 +405716,7 @@ async function handleMemories(state) {
405586
405716
  async function runProjectContextMcpServer() {
405587
405717
  const projectRoot = process.env.THEUS_PROJECT_ROOT || process.cwd();
405588
405718
  const state = new ProjectContextState(projectRoot);
405589
- const server = new Server({ name: SERVER_NAME, version: { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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: {} } });
405719
+ const server = new Server({ name: SERVER_NAME, version: { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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: {} } });
405590
405720
  server.setRequestHandler(ListToolsRequestSchema, async () => ({
405591
405721
  tools: TOOL_DEFINITIONS.map((t) => ({
405592
405722
  name: t.name,
@@ -405712,13 +405842,13 @@ var init_server4 = __esm(() => {
405712
405842
 
405713
405843
  // services/mcpComputerUse/macos.ts
405714
405844
  import { execFile as execFile6 } from "child_process";
405715
- import { existsSync as existsSync15, mkdirSync as mkdirSync9, readFileSync as readFileSync22, statSync as statSync10, unlinkSync as unlinkSync3, writeFileSync as writeFileSync7 } from "fs";
405716
- import { homedir as homedir37, tmpdir as tmpdir10 } from "os";
405717
- import { join as join146 } from "path";
405845
+ import { existsSync as existsSync16, mkdirSync as mkdirSync9, readFileSync as readFileSync23, statSync as statSync10, unlinkSync as unlinkSync3, writeFileSync as writeFileSync8 } from "fs";
405846
+ import { homedir as homedir37, tmpdir as tmpdir11 } from "os";
405847
+ import { join as join147 } from "path";
405718
405848
  import { promisify as promisify4 } from "util";
405719
405849
  function cuDir() {
405720
- const dir = join146(homedir37(), ".theus", "cu");
405721
- if (!existsSync15(dir))
405850
+ const dir = join147(homedir37(), ".theus", "cu");
405851
+ if (!existsSync16(dir))
405722
405852
  mkdirSync9(dir, { recursive: true });
405723
405853
  return dir;
405724
405854
  }
@@ -405731,7 +405861,7 @@ function resolveBin(name, extra = []) {
405731
405861
  `/usr/sbin/${name}`
405732
405862
  ];
405733
405863
  for (const candidate of candidates) {
405734
- if (existsSync15(candidate))
405864
+ if (existsSync16(candidate))
405735
405865
  return candidate;
405736
405866
  }
405737
405867
  return name;
@@ -405765,9 +405895,9 @@ async function getScreenGeometry(force = false) {
405765
405895
  return cachedGeometry;
405766
405896
  }
405767
405897
  async function checkPermissions() {
405768
- const probe = join146(tmpdir10(), `theus-cu-probe-${process.pid}.jpg`);
405898
+ const probe = join147(tmpdir11(), `theus-cu-probe-${process.pid}.jpg`);
405769
405899
  const cap = await run2(SCREENCAPTURE, ["-x", "-t", "jpg", probe], { timeoutMs: 8000 });
405770
- const screenRecording = existsSync15(probe) && (() => {
405900
+ const screenRecording = existsSync16(probe) && (() => {
405771
405901
  try {
405772
405902
  return statSync10(probe).size > 0;
405773
405903
  } catch {
@@ -405775,7 +405905,7 @@ async function checkPermissions() {
405775
405905
  }
405776
405906
  })();
405777
405907
  try {
405778
- if (existsSync15(probe))
405908
+ if (existsSync16(probe))
405779
405909
  unlinkSync3(probe);
405780
405910
  } catch {}
405781
405911
  const cc = await run2(CLICLICK, ["p"], { timeoutMs: 5000 });
@@ -405794,14 +405924,14 @@ async function checkPermissions() {
405794
405924
  async function captureScreenshot(opts = {}) {
405795
405925
  const maxSide = opts.maxSide ?? 1400;
405796
405926
  const quality = Math.min(Math.max(opts.quality ?? 72, 1), 100);
405797
- const raw = join146(cuDir(), `shot-${process.pid}.png`);
405798
- const out = join146(cuDir(), `shot-${process.pid}.jpg`);
405927
+ const raw = join147(cuDir(), `shot-${process.pid}.png`);
405928
+ const out = join147(cuDir(), `shot-${process.pid}.jpg`);
405799
405929
  const capArgs = ["-x", "-t", "png", "-o"];
405800
405930
  if (opts.displayIndex && opts.displayIndex > 0)
405801
405931
  capArgs.push("-D", String(opts.displayIndex));
405802
405932
  capArgs.push(raw);
405803
405933
  const cap = await run2(SCREENCAPTURE, capArgs, { timeoutMs: 12000 });
405804
- if (!existsSync15(raw) || statSync10(raw).size === 0) {
405934
+ if (!existsSync16(raw) || statSync10(raw).size === 0) {
405805
405935
  throw new ComputerUseError("No se pudo capturar la pantalla (" + (cap.stderr.trim() || "screencapture no produjo imagen") + "). Falta el permiso de Grabaci\xF3n de pantalla para el app que corre Theus.");
405806
405936
  }
405807
405937
  await run2(SIPS, [
@@ -405817,14 +405947,14 @@ async function captureScreenshot(opts = {}) {
405817
405947
  "--out",
405818
405948
  out
405819
405949
  ], { timeoutMs: 12000 });
405820
- if (!existsSync15(out) || statSync10(out).size === 0) {
405950
+ if (!existsSync16(out) || statSync10(out).size === 0) {
405821
405951
  throw new ComputerUseError("sips no pudo reescalar la captura a JPEG.");
405822
405952
  }
405823
405953
  const dims = await run2(SIPS, ["-g", "pixelWidth", "-g", "pixelHeight", out]);
405824
405954
  const width = Number.parseInt(/pixelWidth:\s*(\d+)/.exec(dims.stdout)?.[1] ?? "0", 10);
405825
405955
  const height = Number.parseInt(/pixelHeight:\s*(\d+)/.exec(dims.stdout)?.[1] ?? "0", 10);
405826
405956
  const geometry = await getScreenGeometry();
405827
- const base643 = readFileSync22(out).toString("base64");
405957
+ const base643 = readFileSync23(out).toString("base64");
405828
405958
  return {
405829
405959
  base64: base643,
405830
405960
  mimeType: "image/jpeg",
@@ -405958,15 +406088,15 @@ async function ensureScrollHelper() {
405958
406088
  if (scrollBinPromise)
405959
406089
  return scrollBinPromise;
405960
406090
  scrollBinPromise = (async () => {
405961
- if (!existsSync15(SWIFTC) && SWIFTC === "swiftc") {}
405962
- const src = join146(cuDir(), "scroll.swift");
405963
- const bin = join146(cuDir(), "theus-cu-scroll");
405964
- if (existsSync15(bin))
406091
+ if (!existsSync16(SWIFTC) && SWIFTC === "swiftc") {}
406092
+ const src = join147(cuDir(), "scroll.swift");
406093
+ const bin = join147(cuDir(), "theus-cu-scroll");
406094
+ if (existsSync16(bin))
405965
406095
  return bin;
405966
406096
  try {
405967
- writeFileSync7(src, SCROLL_SWIFT, "utf8");
406097
+ writeFileSync8(src, SCROLL_SWIFT, "utf8");
405968
406098
  const res = await run2(SWIFTC, ["-O", "-o", bin, src], { timeoutMs: 60000 });
405969
- if (existsSync15(bin))
406099
+ if (existsSync16(bin))
405970
406100
  return bin;
405971
406101
  process.stderr.write(`[computer-use] no se pudo compilar el helper de scroll: ${res.stderr}
405972
406102
  `);
@@ -406290,8 +406420,8 @@ var exports_selftest = {};
406290
406420
  __export(exports_selftest, {
406291
406421
  runComputerUseSelfTest: () => runComputerUseSelfTest
406292
406422
  });
406293
- import { existsSync as existsSync16, writeFileSync as writeFileSync8 } from "fs";
406294
- import { join as join147 } from "path";
406423
+ import { existsSync as existsSync17, writeFileSync as writeFileSync9 } from "fs";
406424
+ import { join as join148 } from "path";
406295
406425
  import { homedir as homedir38 } from "os";
406296
406426
  async function runComputerUseSelfTest() {
406297
406427
  let pass = 0;
@@ -406312,7 +406442,7 @@ Theus computer-use \u2014 self-test (macOS)
406312
406442
  `);
406313
406443
  const tools = toolingReport();
406314
406444
  for (const [name, path19] of Object.entries(tools)) {
406315
- if (existsSync16(path19))
406445
+ if (existsSync17(path19))
406316
406446
  ok(`${name}: ${path19}`);
406317
406447
  else if (name === "swiftc")
406318
406448
  warn(`${name}: no encontrado (scroll quedar\xE1 deshabilitado; el resto funciona)`);
@@ -406341,8 +406471,8 @@ Geometr\xEDa y captura:`);
406341
406471
  let captureOk = false;
406342
406472
  try {
406343
406473
  const shot = await captureScreenshot();
406344
- const outPath = join147(homedir38(), ".theus", "cu", "selftest-shot.jpg");
406345
- writeFileSync8(outPath, Buffer.from(shot.base64, "base64"));
406474
+ const outPath = join148(homedir38(), ".theus", "cu", "selftest-shot.jpg");
406475
+ writeFileSync9(outPath, Buffer.from(shot.base64, "base64"));
406346
406476
  ok(`Captura ${shot.width}\xD7${shot.height} px, ${Math.round(shot.base64.length * 0.75 / 1024)} KB \u2192 ${outPath}`);
406347
406477
  captureOk = true;
406348
406478
  } catch (e) {
@@ -406394,9 +406524,9 @@ var init_selftest = __esm(() => {
406394
406524
 
406395
406525
  // utils/cronTasksLock.ts
406396
406526
  import { mkdir as mkdir46, readFile as readFile50, unlink as unlink23, writeFile as writeFile47 } from "fs/promises";
406397
- import { dirname as dirname60, join as join148 } from "path";
406527
+ import { dirname as dirname61, join as join149 } from "path";
406398
406528
  function getLockPath(dir) {
406399
- return join148(dir ?? getProjectRoot(), LOCK_FILE_REL);
406529
+ return join149(dir ?? getProjectRoot(), LOCK_FILE_REL);
406400
406530
  }
406401
406531
  async function readLock(dir) {
406402
406532
  let raw;
@@ -406419,7 +406549,7 @@ async function tryCreateExclusive(lock2, dir) {
406419
406549
  if (code === "EEXIST")
406420
406550
  return false;
406421
406551
  if (code === "ENOENT") {
406422
- await mkdir46(dirname60(path19), { recursive: true });
406552
+ await mkdir46(dirname61(path19), { recursive: true });
406423
406553
  try {
406424
406554
  await writeFile47(path19, body, { flag: "wx" });
406425
406555
  return true;
@@ -406502,7 +406632,7 @@ var init_cronTasksLock = __esm(() => {
406502
406632
  init_genericProcessUtils();
406503
406633
  init_json();
406504
406634
  init_slowOperations();
406505
- LOCK_FILE_REL = join148(".theus", "scheduled_tasks.lock");
406635
+ LOCK_FILE_REL = join149(".theus", "scheduled_tasks.lock");
406506
406636
  schedulerLockSchema = lazySchema(() => exports_external.object({
406507
406637
  sessionId: exports_external.string(),
406508
406638
  pid: exports_external.number(),
@@ -406801,17 +406931,17 @@ __export(exports_workerRegistry, {
406801
406931
  });
406802
406932
  import { spawn as spawn10 } from "child_process";
406803
406933
  import { randomUUID as randomUUID34 } from "crypto";
406804
- import { appendFileSync as appendFileSync5, mkdirSync as mkdirSync10, readFileSync as readFileSync23, writeFileSync as writeFileSync9 } from "fs";
406934
+ import { appendFileSync as appendFileSync5, mkdirSync as mkdirSync10, readFileSync as readFileSync24, writeFileSync as writeFileSync10 } from "fs";
406805
406935
  import { homedir as homedir39 } from "os";
406806
- import { dirname as dirname61, join as join149 } from "path";
406936
+ import { dirname as dirname62, join as join150 } from "path";
406807
406937
  import { fileURLToPath as fileURLToPath6 } from "url";
406808
406938
  function projectsConfigPath() {
406809
- return join149(homedir39(), ".theus", "daemon", "projects.json");
406939
+ return join150(homedir39(), ".theus", "daemon", "projects.json");
406810
406940
  }
406811
406941
  function readEnabledProjects() {
406812
406942
  let raw;
406813
406943
  try {
406814
- raw = readFileSync23(projectsConfigPath(), "utf8");
406944
+ raw = readFileSync24(projectsConfigPath(), "utf8");
406815
406945
  } catch {
406816
406946
  return [];
406817
406947
  }
@@ -406825,17 +406955,17 @@ function readEnabledProjects() {
406825
406955
  return list2.filter((p) => p && typeof p.dir === "string" && p.enabled !== false);
406826
406956
  }
406827
406957
  function daemonDir2() {
406828
- return join149(homedir39(), ".theus", "daemon");
406958
+ return join150(homedir39(), ".theus", "daemon");
406829
406959
  }
406830
406960
  function daemonLogPath() {
406831
- return join149(daemonDir2(), "daemon.log");
406961
+ return join150(daemonDir2(), "daemon.log");
406832
406962
  }
406833
406963
  function resolveWorkerBin() {
406834
406964
  const override = process.env.THEUS_DAEMON_WORKER_BIN;
406835
406965
  if (typeof override === "string" && override.length > 0)
406836
406966
  return override;
406837
- const here = dirname61(fileURLToPath6(import.meta.url));
406838
- return join149(here, "..", "bin", "theus");
406967
+ const here = dirname62(fileURLToPath6(import.meta.url));
406968
+ return join150(here, "..", "bin", "theus");
406839
406969
  }
406840
406970
  function turnTimeoutMs() {
406841
406971
  const raw = process.env.THEUS_DAEMON_TURN_TIMEOUT_MS;
@@ -406868,10 +406998,10 @@ function logDaemonLine(line) {
406868
406998
  }
406869
406999
  function writeRunHistory(record3) {
406870
407000
  try {
406871
- const dir = join149(daemonDir2(), "runs", record3.taskId);
407001
+ const dir = join150(daemonDir2(), "runs", record3.taskId);
406872
407002
  mkdirSync10(dir, { recursive: true });
406873
407003
  const stamp = record3.startedAt.replace(/:/g, "-");
406874
- writeFileSync9(join149(dir, `${stamp}.json`), JSON.stringify(record3, null, 2), "utf8");
407004
+ writeFileSync10(join150(dir, `${stamp}.json`), JSON.stringify(record3, null, 2), "utf8");
406875
407005
  } catch (e) {
406876
407006
  logDaemonLine(`[daemon:cron] ERROR guardando historial task=${record3.taskId}: ${e?.message}`);
406877
407007
  }
@@ -407013,29 +407143,29 @@ __export(exports_main, {
407013
407143
  daemonMain: () => daemonMain
407014
407144
  });
407015
407145
  import {
407016
- existsSync as existsSync17,
407146
+ existsSync as existsSync18,
407017
407147
  mkdirSync as mkdirSync11,
407018
- readFileSync as readFileSync24,
407019
- rmSync as rmSync4,
407020
- writeFileSync as writeFileSync10
407148
+ readFileSync as readFileSync25,
407149
+ rmSync as rmSync5,
407150
+ writeFileSync as writeFileSync11
407021
407151
  } from "fs";
407022
407152
  import { homedir as homedir40 } from "os";
407023
- import { dirname as dirname62, join as join150 } from "path";
407153
+ import { dirname as dirname63, join as join151 } from "path";
407024
407154
  function daemonDir3() {
407025
- return join150(homedir40(), ".theus", "daemon");
407155
+ return join151(homedir40(), ".theus", "daemon");
407026
407156
  }
407027
407157
  function pidFilePath() {
407028
- return join150(daemonDir3(), "theus-daemon.pid");
407158
+ return join151(daemonDir3(), "theus-daemon.pid");
407029
407159
  }
407030
407160
  function logFilePath() {
407031
- return join150(daemonDir3(), "daemon.log");
407161
+ return join151(daemonDir3(), "daemon.log");
407032
407162
  }
407033
407163
  function ensureDaemonDir() {
407034
407164
  mkdirSync11(daemonDir3(), { recursive: true });
407035
407165
  }
407036
407166
  function readPid() {
407037
407167
  try {
407038
- const raw = readFileSync24(pidFilePath(), "utf8").trim();
407168
+ const raw = readFileSync25(pidFilePath(), "utf8").trim();
407039
407169
  const pid = Number.parseInt(raw, 10);
407040
407170
  return Number.isInteger(pid) && pid > 0 ? pid : null;
407041
407171
  } catch {
@@ -407057,13 +407187,13 @@ async function doStart() {
407057
407187
  console.log(`El daemon de Theus ya est\xE1 corriendo (PID ${existing}).`);
407058
407188
  return;
407059
407189
  }
407060
- writeFileSync10(pidFilePath(), String(process.pid), "utf8");
407190
+ writeFileSync11(pidFilePath(), String(process.pid), "utf8");
407061
407191
  console.log(`Daemon de Theus iniciado (PID ${process.pid}).`);
407062
407192
  const cleanup = () => {
407063
407193
  try {
407064
407194
  const current = readPid();
407065
407195
  if (current === process.pid)
407066
- rmSync4(pidFilePath(), { force: true });
407196
+ rmSync5(pidFilePath(), { force: true });
407067
407197
  } catch {}
407068
407198
  };
407069
407199
  process.on("exit", cleanup);
@@ -407078,7 +407208,7 @@ function doStop() {
407078
407208
  }
407079
407209
  if (!isAlive(pid)) {
407080
407210
  console.log(`El daemon de Theus no est\xE1 corriendo (PID ${pid} muerto). Limpiando pidfile.`);
407081
- rmSync4(pidFilePath(), { force: true });
407211
+ rmSync5(pidFilePath(), { force: true });
407082
407212
  return;
407083
407213
  }
407084
407214
  try {
@@ -407102,13 +407232,13 @@ function doStatus() {
407102
407232
  }
407103
407233
  function doLogs() {
407104
407234
  const path19 = logFilePath();
407105
- if (!existsSync17(path19)) {
407235
+ if (!existsSync18(path19)) {
407106
407236
  console.log(`Sin registro de daemon todav\xEDa (${path19}).`);
407107
407237
  return;
407108
407238
  }
407109
407239
  let content;
407110
407240
  try {
407111
- content = readFileSync24(path19, "utf8");
407241
+ content = readFileSync25(path19, "utf8");
407112
407242
  } catch (e) {
407113
407243
  console.error(`No se pudo leer el registro: ${e?.message}`);
407114
407244
  return;
@@ -407126,7 +407256,7 @@ function resolveTheusBin() {
407126
407256
  return "theus";
407127
407257
  }
407128
407258
  function macosServiceSpec() {
407129
- const path19 = join150(homedir40(), "Library", "LaunchAgents", "pe.theus.daemon.plist");
407259
+ const path19 = join151(homedir40(), "Library", "LaunchAgents", "pe.theus.daemon.plist");
407130
407260
  const bin = resolveTheusBin();
407131
407261
  const logDir = daemonDir3();
407132
407262
  const content = `<?xml version="1.0" encoding="UTF-8"?>
@@ -407153,9 +407283,9 @@ function macosServiceSpec() {
407153
407283
  <key>KeepAlive</key>
407154
407284
  <true/>
407155
407285
  <key>StandardOutPath</key>
407156
- <string>${join150(logDir, "launchd.out.log")}</string>
407286
+ <string>${join151(logDir, "launchd.out.log")}</string>
407157
407287
  <key>StandardErrorPath</key>
407158
- <string>${join150(logDir, "launchd.err.log")}</string>
407288
+ <string>${join151(logDir, "launchd.err.log")}</string>
407159
407289
  </dict>
407160
407290
  </plist>
407161
407291
  `;
@@ -407170,7 +407300,7 @@ function macosServiceSpec() {
407170
407300
  };
407171
407301
  }
407172
407302
  function linuxServiceSpec() {
407173
- const path19 = join150(homedir40(), ".config", "systemd", "user", "theus-daemon.service");
407303
+ const path19 = join151(homedir40(), ".config", "systemd", "user", "theus-daemon.service");
407174
407304
  const bin = resolveTheusBin();
407175
407305
  const content = `[Unit]
407176
407306
  Description=Theus daemon (cron/agent supervisor)
@@ -407232,8 +407362,8 @@ Pasos posteriores:
407232
407362
  return;
407233
407363
  }
407234
407364
  try {
407235
- mkdirSync11(dirname62(spec.path), { recursive: true });
407236
- writeFileSync10(spec.path, spec.content, "utf8");
407365
+ mkdirSync11(dirname63(spec.path), { recursive: true });
407366
+ writeFileSync11(spec.path, spec.content, "utf8");
407237
407367
  console.log(`Archivo de servicio escrito en: ${spec.path}`);
407238
407368
  if (spec.notes.length > 0) {
407239
407369
  console.log(`
@@ -407254,16 +407384,16 @@ function doUninstall(args) {
407254
407384
  if (!hasConfirm(args)) {
407255
407385
  console.log(`[dry-run] Desinstalaci\xF3n del daemon de Theus (${spec.platform}).
407256
407386
  ` + `Se eliminar\xEDa: ${spec.path}
407257
- ` + (existsSync17(spec.path) ? "El archivo existe y ser\xEDa borrado." : "El archivo no existe actualmente (nada que borrar).") + `
407387
+ ` + (existsSync18(spec.path) ? "El archivo existe y ser\xEDa borrado." : "El archivo no existe actualmente (nada que borrar).") + `
407258
407388
  Vuelve a ejecutar con --confirm para eliminarlo.`);
407259
407389
  return;
407260
407390
  }
407261
- if (!existsSync17(spec.path)) {
407391
+ if (!existsSync18(spec.path)) {
407262
407392
  console.log(`No hay archivo de servicio que eliminar en: ${spec.path}`);
407263
407393
  return;
407264
407394
  }
407265
407395
  try {
407266
- rmSync4(spec.path, { force: true });
407396
+ rmSync5(spec.path, { force: true });
407267
407397
  console.log(`Archivo de servicio eliminado: ${spec.path}`);
407268
407398
  } catch (e) {
407269
407399
  console.error(`No se pudo eliminar el servicio: ${e?.message}`);
@@ -409639,7 +409769,7 @@ __export(exports_upstreamproxy, {
409639
409769
  });
409640
409770
  import { mkdir as mkdir47, readFile as readFile51, unlink as unlink24, writeFile as writeFile48 } from "fs/promises";
409641
409771
  import { homedir as homedir41 } from "os";
409642
- import { join as join151 } from "path";
409772
+ import { join as join152 } from "path";
409643
409773
  async function initUpstreamProxy(opts) {
409644
409774
  if (!isEnvTruthy(process.env.THEUS_CODE_REMOTE)) {
409645
409775
  return state;
@@ -409660,7 +409790,7 @@ async function initUpstreamProxy(opts) {
409660
409790
  }
409661
409791
  setNonDumpable();
409662
409792
  const baseUrl = opts?.ccrBaseUrl ?? process.env.THEUS_BASE_URL ?? "https://api.theus.pe";
409663
- const caBundlePath = opts?.caBundlePath ?? join151(homedir41(), ".ccr", "ca-bundle.crt");
409793
+ const caBundlePath = opts?.caBundlePath ?? join152(homedir41(), ".ccr", "ca-bundle.crt");
409664
409794
  const caOk = await downloadCaBundle(baseUrl, opts?.systemCaPath ?? SYSTEM_CA_BUNDLE, caBundlePath);
409665
409795
  if (!caOk)
409666
409796
  return state;
@@ -409760,7 +409890,7 @@ async function downloadCaBundle(baseUrl, systemCaPath, outPath) {
409760
409890
  }
409761
409891
  const ccrCa = await resp.text();
409762
409892
  const systemCa = await readFile51(systemCaPath, "utf8").catch(() => "");
409763
- await mkdir47(join151(outPath, ".."), { recursive: true });
409893
+ await mkdir47(join152(outPath, ".."), { recursive: true });
409764
409894
  await writeFile48(outPath, systemCa + `
409765
409895
  ` + ccrCa, "utf8");
409766
409896
  return true;
@@ -411263,7 +411393,7 @@ function buildSystemInitMessage(inputs) {
411263
411393
  slash_commands: inputs.commands.filter((c5) => c5.userInvocable !== false).map((c5) => c5.name),
411264
411394
  apiKeySource: getTheusApiKeyWithSource().source,
411265
411395
  betas: getSdkBetas(),
411266
- theus_code_version: { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
411396
+ theus_code_version: { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
411267
411397
  output_style: outputStyle2,
411268
411398
  agents: inputs.agents.map((agent) => agent.agentType),
411269
411399
  skills: inputs.skills.filter((s) => s.userInvocable !== false).map((skill) => skill.name),
@@ -417649,7 +417779,7 @@ var init_ShowInIDEPrompt = __esm(() => {
417649
417779
 
417650
417780
  // components/permissions/FilePermissionDialog/permissionOptions.tsx
417651
417781
  import { homedir as homedir42 } from "os";
417652
- import { basename as basename47, join as join152, sep as sep34 } from "path";
417782
+ import { basename as basename47, join as join153, sep as sep34 } from "path";
417653
417783
  function isInTheusFolder(filePath) {
417654
417784
  const absolutePath = expandPath(filePath);
417655
417785
  const theusFolderPath = expandPath(`${getOriginalCwd()}/.theus`);
@@ -417659,7 +417789,7 @@ function isInTheusFolder(filePath) {
417659
417789
  }
417660
417790
  function isInGlobalTheusFolder(filePath) {
417661
417791
  const absolutePath = expandPath(filePath);
417662
- const globalTheusFolderPath = join152(homedir42(), ".theus");
417792
+ const globalTheusFolderPath = join153(homedir42(), ".theus");
417663
417793
  const normalizedAbsolutePath = normalizeCaseForComparison(absolutePath);
417664
417794
  const normalizedGlobalTheusFolderPath = normalizeCaseForComparison(globalTheusFolderPath);
417665
417795
  return normalizedAbsolutePath.startsWith(normalizedGlobalTheusFolderPath + sep34.toLowerCase()) || normalizedAbsolutePath.startsWith(normalizedGlobalTheusFolderPath + "/");
@@ -425897,7 +426027,7 @@ var init_useVoiceEnabled = __esm(() => {
425897
426027
  function getSemverPart(version3) {
425898
426028
  return `${import_semver13.major(version3, { loose: true })}.${import_semver13.minor(version3, { loose: true })}.${import_semver13.patch(version3, { loose: true })}`;
425899
426029
  }
425900
- function useUpdateNotification(updatedVersion, initialVersion = { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION) {
426030
+ function useUpdateNotification(updatedVersion, initialVersion = { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION) {
425901
426031
  const [lastNotifiedSemver, setLastNotifiedSemver] = import_react215.useState(() => getSemverPart(initialVersion));
425902
426032
  if (!updatedVersion) {
425903
426033
  return null;
@@ -425937,7 +426067,7 @@ function AutoUpdater({
425937
426067
  return;
425938
426068
  }
425939
426069
  if (false) {}
425940
- const currentVersion = { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
426070
+ const currentVersion = { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
425941
426071
  const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
425942
426072
  let latestVersion = await getLatestVersion(channel2);
425943
426073
  const isDisabled2 = isAutoUpdaterDisabled();
@@ -426073,7 +426203,7 @@ function AutoUpdater({
426073
426203
  " ",
426074
426204
  /* @__PURE__ */ jsx_runtime383.jsx(ThemedText, {
426075
426205
  bold: true,
426076
- children: hasLocalInstall ? `cd ~/.theus/local && npm update ${{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.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.1.17", BUILD_TIME: "1970-01-01T00:00:00.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}`
426206
+ children: hasLocalInstall ? `cd ~/.theus/local && npm update ${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.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.1.18", BUILD_TIME: "1970-01-01T00:00:00.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}`
426077
426207
  })
426078
426208
  ]
426079
426209
  })
@@ -426150,12 +426280,12 @@ function NativeAutoUpdater({
426150
426280
  logEvent("tengu_native_auto_updater_start", {});
426151
426281
  try {
426152
426282
  const maxVersion = await getMaxVersion();
426153
- if (maxVersion && gt({ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
426283
+ if (maxVersion && gt({ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
426154
426284
  const msg = await getMaxVersionMessage();
426155
426285
  setMaxVersionIssue(msg ?? "affects your version");
426156
426286
  }
426157
426287
  const result = await installLatest(channel2);
426158
- const currentVersion = { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
426288
+ const currentVersion = { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
426159
426289
  const latencyMs = Date.now() - startTime2;
426160
426290
  if (result.lockFailed) {
426161
426291
  logEvent("tengu_native_auto_updater_lock_contention", {
@@ -426292,17 +426422,17 @@ function PackageManagerAutoUpdater(t0) {
426292
426422
  const maxVersion = await getMaxVersion();
426293
426423
  if (maxVersion && latest && gt(latest, maxVersion)) {
426294
426424
  logForDebugging(`PackageManagerAutoUpdater: maxVersion ${maxVersion} is set, capping update from ${latest} to ${maxVersion}`);
426295
- if (gte({ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
426296
- logForDebugging(`PackageManagerAutoUpdater: current version ${{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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`);
426425
+ if (gte({ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
426426
+ logForDebugging(`PackageManagerAutoUpdater: current version ${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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`);
426297
426427
  setUpdateAvailable(false);
426298
426428
  return;
426299
426429
  }
426300
426430
  latest = maxVersion;
426301
426431
  }
426302
- const hasUpdate = latest && !gte({ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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);
426432
+ const hasUpdate = latest && !gte({ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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);
426303
426433
  setUpdateAvailable(!!hasUpdate);
426304
426434
  if (hasUpdate) {
426305
- logForDebugging(`PackageManagerAutoUpdater: Update available ${{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}`);
426435
+ logForDebugging(`PackageManagerAutoUpdater: Update available ${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}`);
426306
426436
  }
426307
426437
  };
426308
426438
  $2[0] = t1;
@@ -426336,7 +426466,7 @@ function PackageManagerAutoUpdater(t0) {
426336
426466
  wrap: "truncate",
426337
426467
  children: [
426338
426468
  "currentVersion: ",
426339
- { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
426469
+ { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
426340
426470
  ]
426341
426471
  });
426342
426472
  $2[3] = verbose;
@@ -434209,7 +434339,7 @@ function buildStatusLineCommandInput(permissionMode, exceeds200kTokens, settings
434209
434339
  project_dir: getOriginalCwd(),
434210
434340
  added_dirs: addedDirs
434211
434341
  },
434212
- version: { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
434342
+ version: { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
434213
434343
  output_style: {
434214
434344
  name: outputStyleName
434215
434345
  },
@@ -440339,9 +440469,9 @@ function initSkillImprovement() {
440339
440469
  async function applySkillImprovement(skillName, updates) {
440340
440470
  if (!skillName)
440341
440471
  return;
440342
- const { join: join153 } = await import("path");
440472
+ const { join: join154 } = await import("path");
440343
440473
  const fs5 = await import("fs/promises");
440344
- const filePath = join153(getCwd(), ".theus", "skills", skillName, "SKILL.md");
440474
+ const filePath = join154(getCwd(), ".theus", "skills", skillName, "SKILL.md");
440345
440475
  let currentContent;
440346
440476
  try {
440347
440477
  currentContent = await fs5.readFile(filePath, "utf-8");
@@ -440495,7 +440625,7 @@ function useMoreRight(_args) {
440495
440625
  // utils/cleanup.ts
440496
440626
  import * as fs5 from "fs/promises";
440497
440627
  import { homedir as homedir43 } from "os";
440498
- import { join as join153 } from "path";
440628
+ import { join as join154 } from "path";
440499
440629
  function getCutoffDate() {
440500
440630
  const settings = getSettings_DEPRECATED() || {};
440501
440631
  const cleanupPeriodDays = settings.cleanupPeriodDays ?? DEFAULT_CLEANUP_PERIOD_DAYS;
@@ -440520,7 +440650,7 @@ async function cleanupOldFilesInDirectory(dirPath, cutoffDate, isMessagePath) {
440520
440650
  try {
440521
440651
  const timestamp = convertFileNameToDate(file2.name);
440522
440652
  if (timestamp < cutoffDate) {
440523
- await getFsImplementation().unlink(join153(dirPath, file2.name));
440653
+ await getFsImplementation().unlink(join154(dirPath, file2.name));
440524
440654
  if (isMessagePath) {
440525
440655
  result.messages++;
440526
440656
  } else {
@@ -440551,7 +440681,7 @@ async function cleanupOldMessageFiles() {
440551
440681
  } catch {
440552
440682
  return result;
440553
440683
  }
440554
- const mcpLogDirs = dirents.filter((dirent) => dirent.isDirectory() && dirent.name.startsWith("mcp-logs-")).map((dirent) => join153(baseCachePath, dirent.name));
440684
+ const mcpLogDirs = dirents.filter((dirent) => dirent.isDirectory() && dirent.name.startsWith("mcp-logs-")).map((dirent) => join154(baseCachePath, dirent.name));
440555
440685
  for (const mcpLogDir of mcpLogDirs) {
440556
440686
  result = addCleanupResults(result, await cleanupOldFilesInDirectory(mcpLogDir, cutoffDate, true));
440557
440687
  await tryRmdir(mcpLogDir, fsImpl);
@@ -440590,7 +440720,7 @@ async function cleanupOldSessionFiles() {
440590
440720
  for (const projectDirent of projectDirents) {
440591
440721
  if (!projectDirent.isDirectory())
440592
440722
  continue;
440593
- const projectDir = join153(projectsDir, projectDirent.name);
440723
+ const projectDir = join154(projectsDir, projectDirent.name);
440594
440724
  let entries;
440595
440725
  try {
440596
440726
  entries = await fsImpl.readdir(projectDir);
@@ -440604,15 +440734,15 @@ async function cleanupOldSessionFiles() {
440604
440734
  continue;
440605
440735
  }
440606
440736
  try {
440607
- if (await unlinkIfOld(join153(projectDir, entry.name), cutoffDate, fsImpl)) {
440737
+ if (await unlinkIfOld(join154(projectDir, entry.name), cutoffDate, fsImpl)) {
440608
440738
  result.messages++;
440609
440739
  }
440610
440740
  } catch {
440611
440741
  result.errors++;
440612
440742
  }
440613
440743
  } else if (entry.isDirectory()) {
440614
- const sessionDir = join153(projectDir, entry.name);
440615
- const toolResultsDir = join153(sessionDir, TOOL_RESULTS_SUBDIR);
440744
+ const sessionDir = join154(projectDir, entry.name);
440745
+ const toolResultsDir = join154(sessionDir, TOOL_RESULTS_SUBDIR);
440616
440746
  let toolDirs;
440617
440747
  try {
440618
440748
  toolDirs = await fsImpl.readdir(toolResultsDir);
@@ -440623,14 +440753,14 @@ async function cleanupOldSessionFiles() {
440623
440753
  for (const toolEntry of toolDirs) {
440624
440754
  if (toolEntry.isFile()) {
440625
440755
  try {
440626
- if (await unlinkIfOld(join153(toolResultsDir, toolEntry.name), cutoffDate, fsImpl)) {
440756
+ if (await unlinkIfOld(join154(toolResultsDir, toolEntry.name), cutoffDate, fsImpl)) {
440627
440757
  result.messages++;
440628
440758
  }
440629
440759
  } catch {
440630
440760
  result.errors++;
440631
440761
  }
440632
440762
  } else if (toolEntry.isDirectory()) {
440633
- const toolDirPath = join153(toolResultsDir, toolEntry.name);
440763
+ const toolDirPath = join154(toolResultsDir, toolEntry.name);
440634
440764
  let toolFiles;
440635
440765
  try {
440636
440766
  toolFiles = await fsImpl.readdir(toolDirPath);
@@ -440641,7 +440771,7 @@ async function cleanupOldSessionFiles() {
440641
440771
  if (!tf.isFile())
440642
440772
  continue;
440643
440773
  try {
440644
- if (await unlinkIfOld(join153(toolDirPath, tf.name), cutoffDate, fsImpl)) {
440774
+ if (await unlinkIfOld(join154(toolDirPath, tf.name), cutoffDate, fsImpl)) {
440645
440775
  result.messages++;
440646
440776
  }
440647
440777
  } catch {
@@ -440673,7 +440803,7 @@ async function cleanupSingleDirectory(dirPath, extension, removeEmptyDir = true)
440673
440803
  if (!dirent.isFile() || !dirent.name.endsWith(extension))
440674
440804
  continue;
440675
440805
  try {
440676
- if (await unlinkIfOld(join153(dirPath, dirent.name), cutoffDate, fsImpl)) {
440806
+ if (await unlinkIfOld(join154(dirPath, dirent.name), cutoffDate, fsImpl)) {
440677
440807
  result.messages++;
440678
440808
  }
440679
440809
  } catch {
@@ -440686,7 +440816,7 @@ async function cleanupSingleDirectory(dirPath, extension, removeEmptyDir = true)
440686
440816
  return result;
440687
440817
  }
440688
440818
  function cleanupOldPlanFiles() {
440689
- const plansDir = join153(getTheusConfigHomeDir(), "plans");
440819
+ const plansDir = join154(getTheusConfigHomeDir(), "plans");
440690
440820
  return cleanupSingleDirectory(plansDir, ".md");
440691
440821
  }
440692
440822
  async function cleanupOldFileHistoryBackups() {
@@ -440695,14 +440825,14 @@ async function cleanupOldFileHistoryBackups() {
440695
440825
  const fsImpl = getFsImplementation();
440696
440826
  try {
440697
440827
  const configDir = getTheusConfigHomeDir();
440698
- const fileHistoryStorageDir = join153(configDir, "file-history");
440828
+ const fileHistoryStorageDir = join154(configDir, "file-history");
440699
440829
  let dirents;
440700
440830
  try {
440701
440831
  dirents = await fsImpl.readdir(fileHistoryStorageDir);
440702
440832
  } catch {
440703
440833
  return result;
440704
440834
  }
440705
- const fileHistorySessionsDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join153(fileHistoryStorageDir, dirent.name));
440835
+ const fileHistorySessionsDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join154(fileHistoryStorageDir, dirent.name));
440706
440836
  await Promise.all(fileHistorySessionsDirs.map(async (fileHistorySessionDir) => {
440707
440837
  try {
440708
440838
  const stats2 = await fsImpl.stat(fileHistorySessionDir);
@@ -440729,14 +440859,14 @@ async function cleanupOldSessionEnvDirs() {
440729
440859
  const fsImpl = getFsImplementation();
440730
440860
  try {
440731
440861
  const configDir = getTheusConfigHomeDir();
440732
- const sessionEnvBaseDir = join153(configDir, "session-env");
440862
+ const sessionEnvBaseDir = join154(configDir, "session-env");
440733
440863
  let dirents;
440734
440864
  try {
440735
440865
  dirents = await fsImpl.readdir(sessionEnvBaseDir);
440736
440866
  } catch {
440737
440867
  return result;
440738
440868
  }
440739
- const sessionEnvDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join153(sessionEnvBaseDir, dirent.name));
440869
+ const sessionEnvDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join154(sessionEnvBaseDir, dirent.name));
440740
440870
  for (const sessionEnvDir of sessionEnvDirs) {
440741
440871
  try {
440742
440872
  const stats2 = await fsImpl.stat(sessionEnvDir);
@@ -440758,7 +440888,7 @@ async function cleanupOldDebugLogs() {
440758
440888
  const cutoffDate = getCutoffDate();
440759
440889
  const result = { messages: 0, errors: 0 };
440760
440890
  const fsImpl = getFsImplementation();
440761
- const debugDir = join153(getTheusConfigHomeDir(), "debug");
440891
+ const debugDir = join154(getTheusConfigHomeDir(), "debug");
440762
440892
  let dirents;
440763
440893
  try {
440764
440894
  dirents = await fsImpl.readdir(debugDir);
@@ -440770,7 +440900,7 @@ async function cleanupOldDebugLogs() {
440770
440900
  continue;
440771
440901
  }
440772
440902
  try {
440773
- if (await unlinkIfOld(join153(debugDir, dirent.name), cutoffDate, fsImpl)) {
440903
+ if (await unlinkIfOld(join154(debugDir, dirent.name), cutoffDate, fsImpl)) {
440774
440904
  result.messages++;
440775
440905
  }
440776
440906
  } catch {
@@ -440780,7 +440910,7 @@ async function cleanupOldDebugLogs() {
440780
440910
  return result;
440781
440911
  }
440782
440912
  async function cleanupNpmCacheForTheusPackages() {
440783
- const markerPath = join153(getTheusConfigHomeDir(), ".npm-cache-cleanup");
440913
+ const markerPath = join154(getTheusConfigHomeDir(), ".npm-cache-cleanup");
440784
440914
  try {
440785
440915
  const stat46 = await fs5.stat(markerPath);
440786
440916
  if (Date.now() - stat46.mtimeMs < ONE_DAY_MS) {
@@ -440795,7 +440925,7 @@ async function cleanupNpmCacheForTheusPackages() {
440795
440925
  return;
440796
440926
  }
440797
440927
  logForDebugging("npm cache cleanup: starting");
440798
- const npmCachePath = join153(homedir43(), ".npm", "_cacache");
440928
+ const npmCachePath = join154(homedir43(), ".npm", "_cacache");
440799
440929
  const NPM_CACHE_RETENTION_COUNT = 5;
440800
440930
  const startTime2 = Date.now();
440801
440931
  try {
@@ -440850,7 +440980,7 @@ async function cleanupNpmCacheForTheusPackages() {
440850
440980
  }
440851
440981
  }
440852
440982
  async function cleanupOldVersionsThrottled() {
440853
- const markerPath = join153(getTheusConfigHomeDir(), ".version-cleanup");
440983
+ const markerPath = join154(getTheusConfigHomeDir(), ".version-cleanup");
440854
440984
  try {
440855
440985
  const stat46 = await fs5.stat(markerPath);
440856
440986
  if (Date.now() - stat46.mtimeMs < ONE_DAY_MS) {
@@ -444081,7 +444211,7 @@ __export(exports_asciicast, {
444081
444211
  _resetRecordingStateForTesting: () => _resetRecordingStateForTesting
444082
444212
  });
444083
444213
  import { appendFile as appendFile7, rename as rename10 } from "fs/promises";
444084
- import { basename as basename56, dirname as dirname63, join as join155 } from "path";
444214
+ import { basename as basename56, dirname as dirname64, join as join156 } from "path";
444085
444215
  function getRecordFilePath() {
444086
444216
  if (recordingState.filePath !== null) {
444087
444217
  return recordingState.filePath;
@@ -444092,10 +444222,10 @@ function getRecordFilePath() {
444092
444222
  if (!isEnvTruthy(process.env.THEUS_CODE_TERMINAL_RECORDING)) {
444093
444223
  return null;
444094
444224
  }
444095
- const projectsDir = join155(getTheusConfigHomeDir(), "projects");
444096
- const projectDir = join155(projectsDir, sanitizePath2(getOriginalCwd()));
444225
+ const projectsDir = join156(getTheusConfigHomeDir(), "projects");
444226
+ const projectDir = join156(projectsDir, sanitizePath2(getOriginalCwd()));
444097
444227
  recordingState.timestamp = Date.now();
444098
- recordingState.filePath = join155(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
444228
+ recordingState.filePath = join156(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
444099
444229
  return recordingState.filePath;
444100
444230
  }
444101
444231
  function _resetRecordingStateForTesting() {
@@ -444104,13 +444234,13 @@ function _resetRecordingStateForTesting() {
444104
444234
  }
444105
444235
  function getSessionRecordingPaths() {
444106
444236
  const sessionId = getSessionId();
444107
- const projectsDir = join155(getTheusConfigHomeDir(), "projects");
444108
- const projectDir = join155(projectsDir, sanitizePath2(getOriginalCwd()));
444237
+ const projectsDir = join156(getTheusConfigHomeDir(), "projects");
444238
+ const projectDir = join156(projectsDir, sanitizePath2(getOriginalCwd()));
444109
444239
  try {
444110
444240
  const entries = getFsImplementation().readdirSync(projectDir);
444111
444241
  const names = typeof entries[0] === "string" ? entries : entries.map((e) => e.name);
444112
444242
  const files2 = names.filter((f) => f.startsWith(sessionId) && f.endsWith(".cast")).sort();
444113
- return files2.map((f) => join155(projectDir, f));
444243
+ return files2.map((f) => join156(projectDir, f));
444114
444244
  } catch {
444115
444245
  return [];
444116
444246
  }
@@ -444120,9 +444250,9 @@ async function renameRecordingForSession() {
444120
444250
  if (!oldPath || recordingState.timestamp === 0) {
444121
444251
  return;
444122
444252
  }
444123
- const projectsDir = join155(getTheusConfigHomeDir(), "projects");
444124
- const projectDir = join155(projectsDir, sanitizePath2(getOriginalCwd()));
444125
- const newPath = join155(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
444253
+ const projectsDir = join156(getTheusConfigHomeDir(), "projects");
444254
+ const projectDir = join156(projectsDir, sanitizePath2(getOriginalCwd()));
444255
+ const newPath = join156(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
444126
444256
  if (oldPath === newPath) {
444127
444257
  return;
444128
444258
  }
@@ -444163,7 +444293,7 @@ function installAsciicastRecorder() {
444163
444293
  }
444164
444294
  });
444165
444295
  try {
444166
- getFsImplementation().mkdirSync(dirname63(filePath));
444296
+ getFsImplementation().mkdirSync(dirname64(filePath));
444167
444297
  } catch {}
444168
444298
  getFsImplementation().appendFileSync(filePath, header + `
444169
444299
  `, { mode: 384 });
@@ -444232,7 +444362,7 @@ var init_asciicast = __esm(() => {
444232
444362
  });
444233
444363
 
444234
444364
  // utils/sessionRestore.ts
444235
- import { dirname as dirname64 } from "path";
444365
+ import { dirname as dirname65 } from "path";
444236
444366
  function extractTodosFromTranscript(messages) {
444237
444367
  for (let i3 = messages.length - 1;i3 >= 0; i3--) {
444238
444368
  const msg = messages[i3];
@@ -444357,7 +444487,7 @@ async function processResumedConversation(result, opts, context3) {
444357
444487
  if (!opts.forkSession) {
444358
444488
  const sid = opts.sessionIdOverride ?? result.sessionId;
444359
444489
  if (sid) {
444360
- switchSession(asSessionId(sid), opts.transcriptPath ? dirname64(opts.transcriptPath) : null);
444490
+ switchSession(asSessionId(sid), opts.transcriptPath ? dirname65(opts.transcriptPath) : null);
444361
444491
  await renameRecordingForSession();
444362
444492
  await resetSessionFilePointer();
444363
444493
  restoreCostStateForSession(sid);
@@ -445772,7 +445902,7 @@ async function submitTranscriptShare(messages, trigger, appearanceId) {
445772
445902
  } catch {}
445773
445903
  const data = {
445774
445904
  trigger,
445775
- version: { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
445905
+ version: { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
445776
445906
  platform: process.platform,
445777
445907
  transcript,
445778
445908
  subagentTranscripts: Object.keys(subagentTranscripts).length > 0 ? subagentTranscripts : undefined,
@@ -446999,7 +447129,7 @@ var init_useAwaySummary = __esm(() => {
446999
447129
 
447000
447130
  // utils/theusInChrome/setupPortable.ts
447001
447131
  import { readdir as readdir31 } from "fs/promises";
447002
- import { join as join156 } from "path";
447132
+ import { join as join157 } from "path";
447003
447133
  function getExtensionIds() {
447004
447134
  return process.env.USER_TYPE === "ant" ? [PROD_EXTENSION_ID, DEV_EXTENSION_ID, ANT_EXTENSION_ID] : [PROD_EXTENSION_ID];
447005
447135
  }
@@ -447026,7 +447156,7 @@ async function detectExtensionInstallationPortable(browserPaths, log2) {
447026
447156
  }
447027
447157
  for (const profile of profileDirs) {
447028
447158
  for (const extensionId of extensionIds) {
447029
- const extensionPath = join156(browserBasePath, profile, "Extensions", extensionId);
447159
+ const extensionPath = join157(browserBasePath, profile, "Extensions", extensionId);
447030
447160
  try {
447031
447161
  await readdir31(extensionPath);
447032
447162
  log2?.(`[Theus in Chrome] Extension ${extensionId} found in ${browser} ${profile}`);
@@ -447050,7 +447180,7 @@ var init_setupPortable = __esm(() => {
447050
447180
  // utils/theusInChrome/setup.ts
447051
447181
  import { chmod as chmod11, mkdir as mkdir48, readFile as readFile53, writeFile as writeFile50 } from "fs/promises";
447052
447182
  import { homedir as homedir44 } from "os";
447053
- import { join as join157 } from "path";
447183
+ import { join as join158 } from "path";
447054
447184
  import { fileURLToPath as fileURLToPath7 } from "url";
447055
447185
  function shouldEnableTheusInChrome(chromeFlag) {
447056
447186
  if (getIsNonInteractiveSession() && chromeFlag !== true) {
@@ -447107,8 +447237,8 @@ function setupTheusInChrome() {
447107
447237
  };
447108
447238
  } else {
447109
447239
  const __filename3 = fileURLToPath7(import.meta.url);
447110
- const __dirname3 = join157(__filename3, "..");
447111
- const cliPath = join157(__dirname3, "cli.js");
447240
+ const __dirname3 = join158(__filename3, "..");
447241
+ const cliPath = join158(__dirname3, "cli.js");
447112
447242
  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" }));
447113
447243
  const mcpConfig = {
447114
447244
  [THEUS_IN_CHROME_MCP_SERVER_NAME]: {
@@ -447130,8 +447260,8 @@ function getNativeMessagingHostsDirs() {
447130
447260
  const platform6 = getPlatform();
447131
447261
  if (platform6 === "windows") {
447132
447262
  const home = homedir44();
447133
- const appData = process.env.APPDATA || join157(home, "AppData", "Local");
447134
- return [join157(appData, "Theus", "ChromeNativeHost")];
447263
+ const appData = process.env.APPDATA || join158(home, "AppData", "Local");
447264
+ return [join158(appData, "Theus", "ChromeNativeHost")];
447135
447265
  }
447136
447266
  return getAllNativeMessagingHostsDirs().map(({ path: path21 }) => path21);
447137
447267
  }
@@ -447156,7 +447286,7 @@ async function installChromeNativeHostManifest(manifestBinaryPath) {
447156
447286
  const manifestContent = jsonStringify(manifest, null, 2);
447157
447287
  let anyManifestUpdated = false;
447158
447288
  for (const manifestDir of manifestDirs) {
447159
- const manifestPath = join157(manifestDir, NATIVE_HOST_MANIFEST_NAME);
447289
+ const manifestPath = join158(manifestDir, NATIVE_HOST_MANIFEST_NAME);
447160
447290
  const existingContent = await readFile53(manifestPath, "utf-8").catch(() => null);
447161
447291
  if (existingContent === manifestContent) {
447162
447292
  continue;
@@ -447171,7 +447301,7 @@ async function installChromeNativeHostManifest(manifestBinaryPath) {
447171
447301
  }
447172
447302
  }
447173
447303
  if (getPlatform() === "windows") {
447174
- const manifestPath = join157(manifestDirs[0], NATIVE_HOST_MANIFEST_NAME);
447304
+ const manifestPath = join158(manifestDirs[0], NATIVE_HOST_MANIFEST_NAME);
447175
447305
  registerWindowsNativeHosts(manifestPath);
447176
447306
  }
447177
447307
  if (anyManifestUpdated) {
@@ -447209,8 +447339,8 @@ function registerWindowsNativeHosts(manifestPath) {
447209
447339
  }
447210
447340
  async function createWrapperScript(command7) {
447211
447341
  const platform6 = getPlatform();
447212
- const chromeDir = join157(getTheusConfigHomeDir(), "chrome");
447213
- const wrapperPath = platform6 === "windows" ? join157(chromeDir, "chrome-native-host.bat") : join157(chromeDir, "chrome-native-host");
447342
+ const chromeDir = join158(getTheusConfigHomeDir(), "chrome");
447343
+ const wrapperPath = platform6 === "windows" ? join158(chromeDir, "chrome-native-host.bat") : join158(chromeDir, "chrome-native-host");
447214
447344
  const scriptContent = platform6 === "windows" ? `@echo off
447215
447345
  REM Chrome native host wrapper script
447216
447346
  REM Generated by Theus - do not edit manually
@@ -447333,7 +447463,7 @@ var init_useChromeExtensionNotification = __esm(() => {
447333
447463
  });
447334
447464
 
447335
447465
  // utils/plugins/officialMarketplaceStartupCheck.ts
447336
- import { join as join158 } from "path";
447466
+ import { join as join159 } from "path";
447337
447467
  function isOfficialMarketplaceAutoInstallDisabled() {
447338
447468
  if (isEnvTruthy(process.env.THEUS_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL)) {
447339
447469
  return true;
@@ -447408,7 +447538,7 @@ async function checkAndInstallOfficialMarketplace() {
447408
447538
  return { installed: false, skipped: true, reason: "policy_blocked" };
447409
447539
  }
447410
447540
  const cacheDir = getMarketplacesCacheDir();
447411
- const installLocation = join158(cacheDir, OFFICIAL_MARKETPLACE_NAME);
447541
+ const installLocation = join159(cacheDir, OFFICIAL_MARKETPLACE_NAME);
447412
447542
  const gcsSha = await fetchOfficialMarketplaceFromGcs(installLocation, cacheDir);
447413
447543
  if (gcsSha !== null) {
447414
447544
  const known = await loadKnownMarketplacesConfig();
@@ -450387,7 +450517,7 @@ var init_usePluginRecommendationBase = __esm(() => {
450387
450517
  });
450388
450518
 
450389
450519
  // hooks/useLspPluginRecommendation.tsx
450390
- import { extname as extname16, join as join159 } from "path";
450520
+ import { extname as extname16, join as join160 } from "path";
450391
450521
  function useLspPluginRecommendation() {
450392
450522
  const $2 = c3(12);
450393
450523
  const trackedFiles = useAppState(_temp200);
@@ -450472,7 +450602,7 @@ function useLspPluginRecommendation() {
450472
450602
  case "yes": {
450473
450603
  installPluginAndNotify(pluginId, pluginName, "lsp-plugin", addNotification, async (pluginData) => {
450474
450604
  logForDebugging(`[useLspPluginRecommendation] Installing plugin: ${pluginId}`);
450475
- const localSourcePath = typeof pluginData.entry.source === "string" ? join159(pluginData.marketplaceInstallLocation, pluginData.entry.source) : undefined;
450605
+ const localSourcePath = typeof pluginData.entry.source === "string" ? join160(pluginData.marketplaceInstallLocation, pluginData.entry.source) : undefined;
450476
450606
  await cacheAndRegisterPlugin(pluginId, pluginData.entry, "user", undefined, localSourcePath);
450477
450607
  const settings = getSettingsForSource("userSettings");
450478
450608
  updateSettingsForSource("userSettings", {
@@ -453467,8 +453597,8 @@ var exports_REPL = {};
453467
453597
  __export(exports_REPL, {
453468
453598
  REPL: () => REPL
453469
453599
  });
453470
- import { dirname as dirname65, join as join160 } from "path";
453471
- import { tmpdir as tmpdir11 } from "os";
453600
+ import { dirname as dirname66, join as join161 } from "path";
453601
+ import { tmpdir as tmpdir12 } from "os";
453472
453602
  import { writeFile as writeFile51 } from "fs/promises";
453473
453603
  import { randomUUID as randomUUID50 } from "crypto";
453474
453604
  function TranscriptModeFooter(t0) {
@@ -454407,7 +454537,7 @@ function REPL({
454407
454537
  const targetSessionCosts = getStoredSessionCosts(sessionId);
454408
454538
  saveCurrentSessionCosts();
454409
454539
  resetCostState();
454410
- switchSession(asSessionId(sessionId), log2.fullPath ? dirname65(log2.fullPath) : null);
454540
+ switchSession(asSessionId(sessionId), log2.fullPath ? dirname66(log2.fullPath) : null);
454411
454541
  const {
454412
454542
  renameRecordingForSession: renameRecordingForSession2
454413
454543
  } = await Promise.resolve().then(() => (init_asciicast(), exports_asciicast));
@@ -456046,7 +456176,7 @@ Note: ctrl + z now suspends Theus, ctrl + _ undoes input.
456046
456176
  const w = Math.max(80, (process.stdout.columns ?? 80) - 6);
456047
456177
  const raw = await renderMessagesToPlainText(deferredMessages, tools, w);
456048
456178
  const text2 = raw.replace(/[ \t]+$/gm, "");
456049
- const path21 = join160(tmpdir11(), `cc-transcript-${Date.now()}.txt`);
456179
+ const path21 = join161(tmpdir12(), `cc-transcript-${Date.now()}.txt`);
456050
456180
  await writeFile51(path21, text2);
456051
456181
  const opened = openFileInExternalEditor(path21);
456052
456182
  setStatus(opened ? `opening ${path21}` : `wrote ${path21} \xB7 no $VISUAL/$EDITOR set`);
@@ -458562,7 +458692,7 @@ function Onboarding({
458562
458692
  flexDirection: "column",
458563
458693
  children: [
458564
458694
  /* @__PURE__ */ jsx_runtime457.jsx(TheusBanner, {
458565
- version: { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
458695
+ version: { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
458566
458696
  }),
458567
458697
  /* @__PURE__ */ jsx_runtime457.jsxs(ThemedBox_default, {
458568
458698
  flexDirection: "column",
@@ -459433,7 +459563,7 @@ function completeOnboarding() {
459433
459563
  saveGlobalConfig((current) => ({
459434
459564
  ...current,
459435
459565
  hasCompletedOnboarding: true,
459436
- lastOnboardingVersion: { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
459566
+ lastOnboardingVersion: { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
459437
459567
  }));
459438
459568
  }
459439
459569
  function showDialog(root2, renderer) {
@@ -460840,7 +460970,7 @@ var exports_ResumeConversation = {};
460840
460970
  __export(exports_ResumeConversation, {
460841
460971
  ResumeConversation: () => ResumeConversation
460842
460972
  });
460843
- import { dirname as dirname66 } from "path";
460973
+ import { dirname as dirname67 } from "path";
460844
460974
  function parsePrIdentifier(value) {
460845
460975
  const directNumber = parseInt(value, 10);
460846
460976
  if (!isNaN(directNumber) && directNumber > 0) {
@@ -460972,7 +461102,7 @@ function ResumeConversation({
460972
461102
  }
460973
461103
  if (false) {}
460974
461104
  if (result_3.sessionId && !forkSession) {
460975
- switchSession(asSessionId(result_3.sessionId), log_0.fullPath ? dirname66(log_0.fullPath) : null);
461105
+ switchSession(asSessionId(result_3.sessionId), log_0.fullPath ? dirname67(log_0.fullPath) : null);
460976
461106
  await renameRecordingForSession();
460977
461107
  await resetSessionFilePointer();
460978
461108
  restoreCostStateForSession(result_3.sessionId);
@@ -464106,12 +464236,12 @@ var init_createDirectConnectSession = __esm(() => {
464106
464236
  });
464107
464237
 
464108
464238
  // utils/errorLogSink.ts
464109
- import { dirname as dirname67, join as join161 } from "path";
464239
+ import { dirname as dirname68, join as join162 } from "path";
464110
464240
  function getErrorsPath() {
464111
- return join161(CACHE_PATHS.errors(), DATE + ".jsonl");
464241
+ return join162(CACHE_PATHS.errors(), DATE + ".jsonl");
464112
464242
  }
464113
464243
  function getMCPLogsPath(serverName) {
464114
- return join161(CACHE_PATHS.mcpLogs(serverName), DATE + ".jsonl");
464244
+ return join162(CACHE_PATHS.mcpLogs(serverName), DATE + ".jsonl");
464115
464245
  }
464116
464246
  function createJsonlWriter(options2) {
464117
464247
  const writer = createBufferedWriter(options2);
@@ -464127,7 +464257,7 @@ function createJsonlWriter(options2) {
464127
464257
  function getLogWriter(path21) {
464128
464258
  let writer = logWriters.get(path21);
464129
464259
  if (!writer) {
464130
- const dir = dirname67(path21);
464260
+ const dir = dirname68(path21);
464131
464261
  writer = createJsonlWriter({
464132
464262
  writeFn: (content) => {
464133
464263
  try {
@@ -464155,7 +464285,7 @@ function appendToLog(path21, message) {
464155
464285
  cwd: getFsImplementation().cwd(),
464156
464286
  userType: process.env.USER_TYPE,
464157
464287
  sessionId: getSessionId(),
464158
- version: { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
464288
+ version: { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
464159
464289
  };
464160
464290
  getLogWriter(path21).write(messageWithTimestamp);
464161
464291
  }
@@ -464260,7 +464390,7 @@ __export(exports_setup2, {
464260
464390
  setupComputerUse: () => setupComputerUse,
464261
464391
  COMPUTER_USE_SYSTEM_HINT: () => COMPUTER_USE_SYSTEM_HINT
464262
464392
  });
464263
- import { dirname as dirname68, join as join162 } from "path";
464393
+ import { dirname as dirname69, join as join163 } from "path";
464264
464394
  import { fileURLToPath as fileURLToPath8 } from "url";
464265
464395
  function setupComputerUse() {
464266
464396
  const allowedTools = COMPUTER_USE_TOOL_NAMES.map((name) => buildMcpToolName(COMPUTER_USE_SERVER_NAME, name));
@@ -464287,11 +464417,11 @@ function resolveComputerUseLauncher() {
464287
464417
  return { command: process.execPath, args: [entry, COMPUTER_USE_FLAG] };
464288
464418
  }
464289
464419
  if (entry) {
464290
- const launcher = join162(dirname68(entry), "..", "bin", "theus");
464420
+ const launcher = join163(dirname69(entry), "..", "bin", "theus");
464291
464421
  return { command: launcher, args: [COMPUTER_USE_FLAG] };
464292
464422
  }
464293
464423
  return {
464294
- command: join162(fileURLToPath8(import.meta.url), "..", "..", "..", "bin", "theus"),
464424
+ command: join163(fileURLToPath8(import.meta.url), "..", "..", "..", "bin", "theus"),
464295
464425
  args: [COMPUTER_USE_FLAG]
464296
464426
  };
464297
464427
  }
@@ -464502,7 +464632,7 @@ var init_sessionMemory = __esm(() => {
464502
464632
  // utils/iTermBackup.ts
464503
464633
  import { copyFile as copyFile10, stat as stat48 } from "fs/promises";
464504
464634
  import { homedir as homedir46 } from "os";
464505
- import { join as join163 } from "path";
464635
+ import { join as join164 } from "path";
464506
464636
  function markITerm2SetupComplete() {
464507
464637
  saveGlobalConfig((current) => ({
464508
464638
  ...current,
@@ -464517,7 +464647,7 @@ function getIterm2RecoveryInfo() {
464517
464647
  };
464518
464648
  }
464519
464649
  function getITerm2PlistPath() {
464520
- return join163(homedir46(), "Library", "Preferences", "com.googlecode.iterm2.plist");
464650
+ return join164(homedir46(), "Library", "Preferences", "com.googlecode.iterm2.plist");
464521
464651
  }
464522
464652
  async function checkAndRestoreITerm2Backup() {
464523
464653
  const { inProgress, backupPath } = getIterm2RecoveryInfo();
@@ -467983,7 +468113,7 @@ var init_idleTimeout = __esm(() => {
467983
468113
  // bridge/inboundAttachments.ts
467984
468114
  import { randomUUID as randomUUID53 } from "crypto";
467985
468115
  import { mkdir as mkdir49, writeFile as writeFile53 } from "fs/promises";
467986
- import { basename as basename57, join as join164 } from "path";
468116
+ import { basename as basename57, join as join165 } from "path";
467987
468117
  function debug(msg) {
467988
468118
  logForDebugging(`[bridge:inbound-attach] ${msg}`);
467989
468119
  }
@@ -467999,7 +468129,7 @@ function sanitizeFileName(name) {
467999
468129
  return base2 || "attachment";
468000
468130
  }
468001
468131
  function uploadsDir() {
468002
- return join164(getTheusConfigHomeDir(), "uploads", getSessionId());
468132
+ return join165(getTheusConfigHomeDir(), "uploads", getSessionId());
468003
468133
  }
468004
468134
  async function resolveOne(att) {
468005
468135
  const token = getBridgeAccessToken();
@@ -468028,7 +468158,7 @@ async function resolveOne(att) {
468028
468158
  const safeName = sanitizeFileName(att.file_name);
468029
468159
  const prefix = (att.file_uuid.slice(0, 8) || randomUUID53().slice(0, 8)).replace(/[^a-zA-Z0-9_-]/g, "_");
468030
468160
  const dir = uploadsDir();
468031
- const outPath = join164(dir, `${prefix}-${safeName}`);
468161
+ const outPath = join165(dir, `${prefix}-${safeName}`);
468032
468162
  try {
468033
468163
  await mkdir49(dir, { recursive: true });
468034
468164
  await writeFile53(outPath, data);
@@ -468128,7 +468258,7 @@ var init_sessionUrl = __esm(() => {
468128
468258
 
468129
468259
  // utils/plugins/zipCacheAdapters.ts
468130
468260
  import { readFile as readFile54 } from "fs/promises";
468131
- import { join as join165 } from "path";
468261
+ import { join as join166 } from "path";
468132
468262
  async function readZipCacheKnownMarketplaces() {
468133
468263
  try {
468134
468264
  const content = await readFile54(getZipCacheKnownMarketplacesPath(), "utf-8");
@@ -468153,13 +468283,13 @@ async function saveMarketplaceJsonToZipCache(marketplaceName, installLocation) {
468153
468283
  const content = await readMarketplaceJsonContent(installLocation);
468154
468284
  if (content !== null) {
468155
468285
  const relPath = getMarketplaceJsonRelativePath(marketplaceName);
468156
- await atomicWriteToZipCache(join165(zipCachePath, relPath), content);
468286
+ await atomicWriteToZipCache(join166(zipCachePath, relPath), content);
468157
468287
  }
468158
468288
  }
468159
468289
  async function readMarketplaceJsonContent(dir) {
468160
468290
  const candidates = [
468161
- join165(dir, ".theus-plugin", "marketplace.json"),
468162
- join165(dir, "marketplace.json"),
468291
+ join166(dir, ".theus-plugin", "marketplace.json"),
468292
+ join166(dir, "marketplace.json"),
468163
468293
  dir
468164
468294
  ];
468165
468295
  for (const candidate of candidates) {
@@ -468289,8 +468419,8 @@ async function getEnvLessBridgeConfig() {
468289
468419
  }
468290
468420
  async function checkEnvLessBridgeMinVersion() {
468291
468421
  const cfg = await getEnvLessBridgeConfig();
468292
- if (cfg.min_version && lt({ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
468293
- return `Your version of Theus (${{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.
468422
+ if (cfg.min_version && lt({ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
468423
+ return `Your version of Theus (${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.
468294
468424
  Version ${cfg.min_version} or higher is required. Run \`theus update\` to update.`;
468295
468425
  }
468296
468426
  return null;
@@ -468618,14 +468748,14 @@ __export(exports_bridgePointer, {
468618
468748
  BRIDGE_POINTER_TTL_MS: () => BRIDGE_POINTER_TTL_MS
468619
468749
  });
468620
468750
  import { mkdir as mkdir50, readFile as readFile55, stat as stat49, unlink as unlink25, writeFile as writeFile54 } from "fs/promises";
468621
- import { dirname as dirname69, join as join166 } from "path";
468751
+ import { dirname as dirname70, join as join167 } from "path";
468622
468752
  function getBridgePointerPath(dir) {
468623
- return join166(getProjectsDir(), sanitizePath2(dir), "bridge-pointer.json");
468753
+ return join167(getProjectsDir(), sanitizePath2(dir), "bridge-pointer.json");
468624
468754
  }
468625
468755
  async function writeBridgePointer(dir, pointer) {
468626
468756
  const path21 = getBridgePointerPath(dir);
468627
468757
  try {
468628
- await mkdir50(dirname69(path21), { recursive: true });
468758
+ await mkdir50(dirname70(path21), { recursive: true });
468629
468759
  await writeFile54(path21, jsonStringify(pointer), "utf8");
468630
468760
  logForDebugging(`[bridge:pointer] wrote ${path21}`);
468631
468761
  } catch (err2) {
@@ -468764,7 +468894,7 @@ async function initBridgeCore(params) {
468764
468894
  const rawApi = createBridgeApiClient({
468765
468895
  baseUrl,
468766
468896
  getAccessToken,
468767
- runnerVersion: { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
468897
+ runnerVersion: { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
468768
468898
  onDebug: logForDebugging,
468769
468899
  onAuth401,
468770
468900
  getTrustedDeviceToken
@@ -470629,7 +470759,7 @@ __export(exports_print, {
470629
470759
  canBatchWith: () => canBatchWith
470630
470760
  });
470631
470761
  import { readFile as readFile56, stat as stat50 } from "fs/promises";
470632
- import { dirname as dirname70 } from "path";
470762
+ import { dirname as dirname71 } from "path";
470633
470763
  import { cwd as cwd2 } from "process";
470634
470764
  import { randomUUID as randomUUID56 } from "crypto";
470635
470765
  function trackReceivedMessageUuid(uuid3) {
@@ -473084,7 +473214,7 @@ async function loadInitialMessages(setAppState, options2) {
473084
473214
  if (false) {}
473085
473215
  if (!options2.forkSession) {
473086
473216
  if (result.sessionId) {
473087
- switchSession(asSessionId(result.sessionId), result.fullPath ? dirname70(result.fullPath) : null);
473217
+ switchSession(asSessionId(result.sessionId), result.fullPath ? dirname71(result.fullPath) : null);
473088
473218
  if (persistSession) {
473089
473219
  await resetSessionFilePointer();
473090
473220
  }
@@ -473182,7 +473312,7 @@ async function loadInitialMessages(setAppState, options2) {
473182
473312
  }
473183
473313
  if (false) {}
473184
473314
  if (!options2.forkSession && result.sessionId) {
473185
- switchSession(asSessionId(result.sessionId), result.fullPath ? dirname70(result.fullPath) : null);
473315
+ switchSession(asSessionId(result.sessionId), result.fullPath ? dirname71(result.fullPath) : null);
473186
473316
  if (persistSession) {
473187
473317
  await resetSessionFilePointer();
473188
473318
  }
@@ -474030,7 +474160,7 @@ async function startMCPServer(cwd3, debug2, verbose) {
474030
474160
  setCwd(cwd3);
474031
474161
  const server = new Server({
474032
474162
  name: "theus/tengu",
474033
- version: { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
474163
+ version: { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
474034
474164
  }, {
474035
474165
  capabilities: {
474036
474166
  tools: {}
@@ -474162,14 +474292,14 @@ __export(exports_theusDesktop, {
474162
474292
  });
474163
474293
  import { readdir as readdir32, readFile as readFile57, stat as stat51 } from "fs/promises";
474164
474294
  import { homedir as homedir47 } from "os";
474165
- import { join as join167 } from "path";
474295
+ import { join as join168 } from "path";
474166
474296
  async function getTheusDesktopConfigPath() {
474167
474297
  const platform6 = getPlatform();
474168
474298
  if (!SUPPORTED_PLATFORMS.includes(platform6)) {
474169
474299
  throw new Error(`Unsupported platform: ${platform6} - Theus Desktop integration only works on macOS and WSL.`);
474170
474300
  }
474171
474301
  if (platform6 === "macos") {
474172
- return join167(homedir47(), "Library", "Application Support", "Theus", "theus_desktop_config.json");
474302
+ return join168(homedir47(), "Library", "Application Support", "Theus", "theus_desktop_config.json");
474173
474303
  }
474174
474304
  const windowsHome = process.env.USERPROFILE ? process.env.USERPROFILE.replace(/\\/g, "/") : null;
474175
474305
  if (windowsHome) {
@@ -474188,7 +474318,7 @@ async function getTheusDesktopConfigPath() {
474188
474318
  if (user.name === "Public" || user.name === "Default" || user.name === "Default User" || user.name === "All Users") {
474189
474319
  continue;
474190
474320
  }
474191
- const potentialConfigPath = join167(usersDir, user.name, "AppData", "Roaming", "Theus", "theus_desktop_config.json");
474321
+ const potentialConfigPath = join168(usersDir, user.name, "AppData", "Roaming", "Theus", "theus_desktop_config.json");
474192
474322
  try {
474193
474323
  await stat51(potentialConfigPath);
474194
474324
  return potentialConfigPath;
@@ -474584,7 +474714,7 @@ __export(exports_plugins, {
474584
474714
  VALID_UPDATE_SCOPES: () => VALID_UPDATE_SCOPES,
474585
474715
  VALID_INSTALLABLE_SCOPES: () => VALID_INSTALLABLE_SCOPES
474586
474716
  });
474587
- import { basename as basename58, dirname as dirname71 } from "path";
474717
+ import { basename as basename58, dirname as dirname72 } from "path";
474588
474718
  function handleMarketplaceError(error40, action2) {
474589
474719
  logError2(error40);
474590
474720
  cliError(`${figures_default.cross} Failed to ${action2}: ${errorMessage(error40)}`);
@@ -474617,9 +474747,9 @@ async function pluginValidateHandler(manifestPath, options2) {
474617
474747
  printValidationResult(result);
474618
474748
  let contentResults = [];
474619
474749
  if (result.fileType === "plugin") {
474620
- const manifestDir = dirname71(result.filePath);
474750
+ const manifestDir = dirname72(result.filePath);
474621
474751
  if (basename58(manifestDir) === ".theus-plugin") {
474622
- contentResults = await validatePluginContents(dirname71(manifestDir));
474752
+ contentResults = await validatePluginContents(dirname72(manifestDir));
474623
474753
  for (const r of contentResults) {
474624
474754
  console.log(`Validating ${r.fileType}: ${r.filePath}
474625
474755
  `);
@@ -475097,12 +475227,12 @@ __export(exports_install, {
475097
475227
  install: () => install
475098
475228
  });
475099
475229
  import { homedir as homedir48 } from "os";
475100
- import { join as join168 } from "path";
475230
+ import { join as join169 } from "path";
475101
475231
  function getInstallationPath2() {
475102
475232
  const isWindows2 = env3.platform === "win32";
475103
475233
  const homeDir = homedir48();
475104
475234
  if (isWindows2) {
475105
- const windowsPath = join168(homeDir, ".local", "bin", "theus.exe");
475235
+ const windowsPath = join169(homeDir, ".local", "bin", "theus.exe");
475106
475236
  return windowsPath.replace(/\//g, "\\");
475107
475237
  }
475108
475238
  return "~/.local/bin/theus";
@@ -475472,7 +475602,7 @@ async function setupTokenHandler(root2) {
475472
475602
  gap: 1,
475473
475603
  children: [
475474
475604
  /* @__PURE__ */ jsx_runtime473.jsx(TheusBanner, {
475475
- version: { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
475605
+ version: { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
475476
475606
  }),
475477
475607
  showAuthWarning && /* @__PURE__ */ jsx_runtime473.jsxs(ThemedBox_default, {
475478
475608
  flexDirection: "column",
@@ -475642,7 +475772,7 @@ __export(exports_main2, {
475642
475772
  startDeferredPrefetches: () => startDeferredPrefetches,
475643
475773
  main: () => main
475644
475774
  });
475645
- import { readFileSync as readFileSync25 } from "fs";
475775
+ import { readFileSync as readFileSync26 } from "fs";
475646
475776
  import { resolve as resolve46 } from "path";
475647
475777
  function logManagedSettings() {
475648
475778
  try {
@@ -475798,7 +475928,7 @@ function loadSettingsFromFlag(settingsFile) {
475798
475928
  resolvedPath: resolvedSettingsPath
475799
475929
  } = safeResolvePath(getFsImplementation(), settingsFile);
475800
475930
  try {
475801
- readFileSync25(resolvedSettingsPath, "utf8");
475931
+ readFileSync26(resolvedSettingsPath, "utf8");
475802
475932
  } catch (e) {
475803
475933
  if (isENOENT(e)) {
475804
475934
  process.stderr.write(source_default.red(`Error: Settings file not found: ${resolvedSettingsPath}
@@ -476203,7 +476333,7 @@ ${getTmuxInstallInstructions2()}
476203
476333
  }
476204
476334
  try {
476205
476335
  const filePath = resolve46(options2.systemPromptFile);
476206
- systemPrompt = readFileSync25(filePath, "utf8");
476336
+ systemPrompt = readFileSync26(filePath, "utf8");
476207
476337
  } catch (error40) {
476208
476338
  const code = getErrnoCode(error40);
476209
476339
  if (code === "ENOENT") {
@@ -476225,7 +476355,7 @@ ${getTmuxInstallInstructions2()}
476225
476355
  }
476226
476356
  try {
476227
476357
  const filePath = resolve46(options2.appendSystemPromptFile);
476228
- appendSystemPrompt = readFileSync25(filePath, "utf8");
476358
+ appendSystemPrompt = readFileSync26(filePath, "utf8");
476229
476359
  } catch (error40) {
476230
476360
  const code = getErrnoCode(error40);
476231
476361
  if (code === "ENOENT") {
@@ -476877,7 +477007,7 @@ ${customInstructions}` : customInstructions;
476877
477007
  }
476878
477008
  }
476879
477009
  logForDiagnosticsNoPII("info", "started", {
476880
- version: { VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
477010
+ version: { VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
476881
477011
  is_native_binary: isInBundledMode()
476882
477012
  });
476883
477013
  registerCleanup(async () => {
@@ -477661,7 +477791,7 @@ Usage: theus --remote "your task description"`, () => gracefulShutdown(1));
477661
477791
  pendingHookMessages
477662
477792
  }, renderAndRun);
477663
477793
  }
477664
- }).version(`${{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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");
477794
+ }).version(`${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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");
477665
477795
  program2.option("-w, --worktree [name]", "Crea un nuevo worktree de git para esta sesi\xF3n (opcionalmente indica un nombre)");
477666
477796
  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.");
477667
477797
  if (canUserConfigureAdvisor()) {
@@ -478175,7 +478305,7 @@ if (false) {}
478175
478305
  async function main2() {
478176
478306
  const args = process.argv.slice(2);
478177
478307
  if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
478178
- console.log(`${{ VERSION: "0.1.17", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)`);
478308
+ console.log(`${{ VERSION: "0.1.18", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)`);
478179
478309
  return;
478180
478310
  }
478181
478311
  const {