theus-cli 0.2.80 → 0.2.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli.js +490 -289
- package/package.json +2 -1
- package/vendor/theus-arsenal/package.json +6 -0
package/cli.js
CHANGED
|
@@ -3475,19 +3475,80 @@ var require_sdk = __commonJS((exports, module) => {
|
|
|
3475
3475
|
}
|
|
3476
3476
|
|
|
3477
3477
|
class APIError extends Error {
|
|
3478
|
-
constructor(
|
|
3479
|
-
super(message);
|
|
3478
|
+
constructor(status, error, message, headers) {
|
|
3479
|
+
super(APIError.makeMessage(status, error, message));
|
|
3480
3480
|
this.name = "APIError";
|
|
3481
|
+
this.status = status;
|
|
3482
|
+
this.headers = headers;
|
|
3483
|
+
this.requestID = typeof headers?.get === "function" ? headers.get("request-id") : headers?.["request-id"];
|
|
3484
|
+
this.error = error;
|
|
3485
|
+
}
|
|
3486
|
+
static makeMessage(status, error, message) {
|
|
3487
|
+
const detail = error?.message ? typeof error.message === "string" ? error.message : JSON.stringify(error.message) : error ? JSON.stringify(error) : message;
|
|
3488
|
+
if (status && detail)
|
|
3489
|
+
return `${status} ${detail}`;
|
|
3490
|
+
if (status)
|
|
3491
|
+
return `${status} status code (no body)`;
|
|
3492
|
+
if (detail)
|
|
3493
|
+
return detail;
|
|
3494
|
+
return "(no status code or body)";
|
|
3495
|
+
}
|
|
3496
|
+
static generate(status, errorResponse, message, headers) {
|
|
3497
|
+
if (!status || !headers) {
|
|
3498
|
+
return new APIConnectionError({
|
|
3499
|
+
message,
|
|
3500
|
+
cause: errorResponse instanceof Error ? errorResponse : new Error(String(errorResponse))
|
|
3501
|
+
});
|
|
3502
|
+
}
|
|
3503
|
+
const ErrorClass = status === 400 ? BadRequestError : status === 401 ? AuthenticationError : status === 403 ? PermissionDeniedError : status === 404 ? NotFoundError : status === 409 ? ConflictError : status === 422 ? UnprocessableEntityError : status === 429 ? RateLimitError : status >= 500 ? InternalServerError : APIError;
|
|
3504
|
+
return new ErrorClass(status, errorResponse, message, headers);
|
|
3481
3505
|
}
|
|
3482
3506
|
}
|
|
3483
3507
|
|
|
3484
|
-
class APIUserAbortError extends
|
|
3485
|
-
constructor(message =
|
|
3486
|
-
super(message);
|
|
3487
|
-
|
|
3508
|
+
class APIUserAbortError extends APIError {
|
|
3509
|
+
constructor({ message } = {}) {
|
|
3510
|
+
super(undefined, undefined, message || "Request was aborted.", undefined);
|
|
3511
|
+
}
|
|
3512
|
+
}
|
|
3513
|
+
|
|
3514
|
+
class APIConnectionError extends APIError {
|
|
3515
|
+
constructor({ message, cause } = {}) {
|
|
3516
|
+
super(undefined, undefined, message || "Connection error.", undefined);
|
|
3517
|
+
if (cause)
|
|
3518
|
+
this.cause = cause;
|
|
3488
3519
|
}
|
|
3489
3520
|
}
|
|
3490
3521
|
|
|
3522
|
+
class APIConnectionTimeoutError extends APIConnectionError {
|
|
3523
|
+
constructor({ message } = {}) {
|
|
3524
|
+
super({ message: message ?? "Request timed out." });
|
|
3525
|
+
}
|
|
3526
|
+
}
|
|
3527
|
+
|
|
3528
|
+
class BadRequestError extends APIError {
|
|
3529
|
+
}
|
|
3530
|
+
|
|
3531
|
+
class AuthenticationError extends APIError {
|
|
3532
|
+
}
|
|
3533
|
+
|
|
3534
|
+
class PermissionDeniedError extends APIError {
|
|
3535
|
+
}
|
|
3536
|
+
|
|
3537
|
+
class NotFoundError extends APIError {
|
|
3538
|
+
}
|
|
3539
|
+
|
|
3540
|
+
class ConflictError extends APIError {
|
|
3541
|
+
}
|
|
3542
|
+
|
|
3543
|
+
class UnprocessableEntityError extends APIError {
|
|
3544
|
+
}
|
|
3545
|
+
|
|
3546
|
+
class RateLimitError extends APIError {
|
|
3547
|
+
}
|
|
3548
|
+
|
|
3549
|
+
class InternalServerError extends APIError {
|
|
3550
|
+
}
|
|
3551
|
+
|
|
3491
3552
|
class Theus {
|
|
3492
3553
|
constructor(options = {}) {
|
|
3493
3554
|
const Compat = loadCompat();
|
|
@@ -3508,17 +3569,17 @@ var require_sdk = __commonJS((exports, module) => {
|
|
|
3508
3569
|
module.exports.default = Theus;
|
|
3509
3570
|
module.exports.Theus = Theus;
|
|
3510
3571
|
module.exports.APIError = APIError;
|
|
3511
|
-
module.exports.APIConnectionError =
|
|
3512
|
-
module.exports.APIConnectionTimeoutError =
|
|
3572
|
+
module.exports.APIConnectionError = APIConnectionError;
|
|
3573
|
+
module.exports.APIConnectionTimeoutError = APIConnectionTimeoutError;
|
|
3513
3574
|
module.exports.APIUserAbortError = APIUserAbortError;
|
|
3514
|
-
module.exports.AuthenticationError =
|
|
3515
|
-
module.exports.BadRequestError =
|
|
3516
|
-
module.exports.ConflictError =
|
|
3517
|
-
module.exports.InternalServerError =
|
|
3518
|
-
module.exports.NotFoundError =
|
|
3519
|
-
module.exports.PermissionDeniedError =
|
|
3520
|
-
module.exports.RateLimitError =
|
|
3521
|
-
module.exports.UnprocessableEntityError =
|
|
3575
|
+
module.exports.AuthenticationError = AuthenticationError;
|
|
3576
|
+
module.exports.BadRequestError = BadRequestError;
|
|
3577
|
+
module.exports.ConflictError = ConflictError;
|
|
3578
|
+
module.exports.InternalServerError = InternalServerError;
|
|
3579
|
+
module.exports.NotFoundError = NotFoundError;
|
|
3580
|
+
module.exports.PermissionDeniedError = PermissionDeniedError;
|
|
3581
|
+
module.exports.RateLimitError = RateLimitError;
|
|
3582
|
+
module.exports.UnprocessableEntityError = UnprocessableEntityError;
|
|
3522
3583
|
}
|
|
3523
3584
|
});
|
|
3524
3585
|
|
|
@@ -48898,7 +48959,7 @@ var init_env = __esm(() => {
|
|
|
48898
48959
|
});
|
|
48899
48960
|
|
|
48900
48961
|
// constants/figures.ts
|
|
48901
|
-
var BLACK_CIRCLE, TEARDROP_ASTERISK = "\u273B", UP_ARROW = "\u2191", DOWN_ARROW = "\u2193", LIGHTNING_BOLT = "\u21AF", EFFORT_LOW = "\u25CB", EFFORT_MEDIUM = "\u25D0", EFFORT_HIGH = "\u25CF", EFFORT_MAX = "\u25C9", PAUSE_ICON = "\u23F8", REFRESH_ARROW = "\u21BB", DIAMOND_OPEN = "\u25C7", DIAMOND_FILLED = "\u25C6", REFERENCE_MARK = "\u203B", BLOCKQUOTE_BAR = "\u258E", BRIDGE_SPINNER_FRAMES, BRIDGE_READY_INDICATOR = "\xB7\u2714\uFE0E\xB7", BRIDGE_FAILED_INDICATOR = "\xD7";
|
|
48962
|
+
var BLACK_CIRCLE, TEARDROP_ASTERISK = "\u273B", UP_ARROW = "\u2191", DOWN_ARROW = "\u2193", LIGHTNING_BOLT = "\u21AF", EFFORT_LOW = "\u25CB", EFFORT_MEDIUM = "\u25D0", EFFORT_HIGH = "\u25CF", EFFORT_RAPIDO = "\u21AF", EFFORT_MAX = "\u25C9", PAUSE_ICON = "\u23F8", REFRESH_ARROW = "\u21BB", DIAMOND_OPEN = "\u25C7", DIAMOND_FILLED = "\u25C6", REFERENCE_MARK = "\u203B", BLOCKQUOTE_BAR = "\u258E", BRIDGE_SPINNER_FRAMES, BRIDGE_READY_INDICATOR = "\xB7\u2714\uFE0E\xB7", BRIDGE_FAILED_INDICATOR = "\xD7";
|
|
48902
48963
|
var init_figures2 = __esm(() => {
|
|
48903
48964
|
init_env();
|
|
48904
48965
|
BLACK_CIRCLE = env3.platform === "darwin" ? "\u23FA" : "\u25CF";
|
|
@@ -57780,7 +57841,7 @@ async function _executeApiKeyHelper(isNonInteractiveSession) {
|
|
|
57780
57841
|
if (isApiKeyHelperFromProjectOrLocalSettings()) {
|
|
57781
57842
|
const hasTrust = checkHasTrustDialogAccepted();
|
|
57782
57843
|
if (!hasTrust && !isNonInteractiveSession) {
|
|
57783
|
-
const error40 = new Error(`Security: apiKeyHelper executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.
|
|
57844
|
+
const error40 = new Error(`Security: apiKeyHelper executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.FEEDBACK_CHANNEL}.`);
|
|
57784
57845
|
logAntError("apiKeyHelper invoked before trust check", error40);
|
|
57785
57846
|
logEvent("theus_apiKeyHelper_missing_trust11", {});
|
|
57786
57847
|
return null;
|
|
@@ -57824,7 +57885,7 @@ async function runAwsAuthRefresh() {
|
|
|
57824
57885
|
if (isAwsAuthRefreshFromProjectSettings()) {
|
|
57825
57886
|
const hasTrust = checkHasTrustDialogAccepted();
|
|
57826
57887
|
if (!hasTrust && !getIsNonInteractiveSession()) {
|
|
57827
|
-
const error40 = new Error(`Security: awsAuthRefresh executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.
|
|
57888
|
+
const error40 = new Error(`Security: awsAuthRefresh executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.FEEDBACK_CHANNEL}.`);
|
|
57828
57889
|
logAntError("awsAuthRefresh invoked before trust check", error40);
|
|
57829
57890
|
logEvent("theus_awsAuthRefresh_missing_trust", {});
|
|
57830
57891
|
return false;
|
|
@@ -57884,7 +57945,7 @@ async function getAwsCredsFromCredentialExport() {
|
|
|
57884
57945
|
if (isAwsCredentialExportFromProjectSettings()) {
|
|
57885
57946
|
const hasTrust = checkHasTrustDialogAccepted();
|
|
57886
57947
|
if (!hasTrust && !getIsNonInteractiveSession()) {
|
|
57887
|
-
const error40 = new Error(`Security: awsCredentialExport executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.
|
|
57948
|
+
const error40 = new Error(`Security: awsCredentialExport executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.FEEDBACK_CHANNEL}.`);
|
|
57888
57949
|
logAntError("awsCredentialExport invoked before trust check", error40);
|
|
57889
57950
|
logEvent("theus_awsCredentialExport_missing_trust", {});
|
|
57890
57951
|
return null;
|
|
@@ -57969,7 +58030,7 @@ async function runGcpAuthRefresh() {
|
|
|
57969
58030
|
if (isGcpAuthRefreshFromProjectSettings()) {
|
|
57970
58031
|
const hasTrust = checkHasTrustDialogAccepted();
|
|
57971
58032
|
if (!hasTrust && !getIsNonInteractiveSession()) {
|
|
57972
|
-
const error40 = new Error(`Security: gcpAuthRefresh executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.
|
|
58033
|
+
const error40 = new Error(`Security: gcpAuthRefresh executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.FEEDBACK_CHANNEL}.`);
|
|
57973
58034
|
logAntError("gcpAuthRefresh invoked before trust check", error40);
|
|
57974
58035
|
logEvent("theus_gcpAuthRefresh_missing_trust", {});
|
|
57975
58036
|
return false;
|
|
@@ -58688,7 +58749,7 @@ var init_auth = __esm(() => {
|
|
|
58688
58749
|
|
|
58689
58750
|
// utils/userAgent.ts
|
|
58690
58751
|
function getTheusCodeUserAgent() {
|
|
58691
|
-
return `theus-code/${{ VERSION: "0.2.
|
|
58752
|
+
return `theus-code/${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}`;
|
|
58692
58753
|
}
|
|
58693
58754
|
|
|
58694
58755
|
// utils/workloadContext.ts
|
|
@@ -58710,7 +58771,7 @@ function getUserAgent() {
|
|
|
58710
58771
|
const clientApp = process.env.THEUS_AGENT_SDK_CLIENT_APP ? `, client-app/${process.env.THEUS_AGENT_SDK_CLIENT_APP}` : "";
|
|
58711
58772
|
const workload = getWorkload();
|
|
58712
58773
|
const workloadSuffix = workload ? `, workload/${workload}` : "";
|
|
58713
|
-
return `theus-cli/${{ VERSION: "0.2.
|
|
58774
|
+
return `theus-cli/${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} (${"external"}, ${process.env.THEUS_CODE_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
|
|
58714
58775
|
}
|
|
58715
58776
|
function getMCPUserAgent() {
|
|
58716
58777
|
const parts = [];
|
|
@@ -58724,7 +58785,7 @@ function getMCPUserAgent() {
|
|
|
58724
58785
|
parts.push(`client-app/${process.env.THEUS_AGENT_SDK_CLIENT_APP}`);
|
|
58725
58786
|
}
|
|
58726
58787
|
const suffix = parts.length > 0 ? ` (${parts.join(", ")})` : "";
|
|
58727
|
-
return `theus-code/${{ VERSION: "0.2.
|
|
58788
|
+
return `theus-code/${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}${suffix}`;
|
|
58728
58789
|
}
|
|
58729
58790
|
function getWebFetchUserAgent() {
|
|
58730
58791
|
return `Theus-User (${getTheusCodeUserAgent()}; +https://support.theus.pe/)`;
|
|
@@ -58862,7 +58923,7 @@ var init_user = __esm(() => {
|
|
|
58862
58923
|
deviceId,
|
|
58863
58924
|
sessionId: getSessionId(),
|
|
58864
58925
|
email: getEmail(),
|
|
58865
|
-
appVersion: { VERSION: "0.2.
|
|
58926
|
+
appVersion: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
58866
58927
|
platform: getHostPlatformForAnalytics(),
|
|
58867
58928
|
organizationUuid,
|
|
58868
58929
|
accountUuid,
|
|
@@ -60572,7 +60633,7 @@ var init_metadata = __esm(() => {
|
|
|
60572
60633
|
COMPOUND_OPERATOR_REGEX = /\s*(?:&&|\|\||[;|])\s*/;
|
|
60573
60634
|
WHITESPACE_REGEX = /\s+/;
|
|
60574
60635
|
getVersionBase = memoize_default(() => {
|
|
60575
|
-
const match = { VERSION: "0.2.
|
|
60636
|
+
const match = { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION.match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
|
|
60576
60637
|
return match ? match[0] : undefined;
|
|
60577
60638
|
});
|
|
60578
60639
|
buildEnvContext = memoize_default(async () => {
|
|
@@ -60612,9 +60673,9 @@ var init_metadata = __esm(() => {
|
|
|
60612
60673
|
isGithubAction: isEnvTruthy(process.env.GITHUB_ACTIONS),
|
|
60613
60674
|
isTheusCodeAction: isEnvTruthy(process.env.THEUS_CODE_ACTION),
|
|
60614
60675
|
isTheusAiAuth: isTheusAISubscriber(),
|
|
60615
|
-
version: { VERSION: "0.2.
|
|
60676
|
+
version: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
60616
60677
|
versionBase: getVersionBase(),
|
|
60617
|
-
buildTime: { VERSION: "0.2.
|
|
60678
|
+
buildTime: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.BUILD_TIME,
|
|
60618
60679
|
deploymentEnvironment: env3.detectDeploymentEnvironment(),
|
|
60619
60680
|
...isEnvTruthy(process.env.GITHUB_ACTIONS) && {
|
|
60620
60681
|
githubEventName: process.env.GITHUB_EVENT_NAME,
|
|
@@ -61230,7 +61291,7 @@ function initialize1PEventLogging() {
|
|
|
61230
61291
|
const platform2 = getPlatform();
|
|
61231
61292
|
const attributes = {
|
|
61232
61293
|
[ATTR_SERVICE_NAME]: "theus-code",
|
|
61233
|
-
[ATTR_SERVICE_VERSION]: { VERSION: "0.2.
|
|
61294
|
+
[ATTR_SERVICE_VERSION]: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
61234
61295
|
};
|
|
61235
61296
|
if (platform2 === "wsl") {
|
|
61236
61297
|
const wslVersion = getWslVersion();
|
|
@@ -61257,7 +61318,7 @@ function initialize1PEventLogging() {
|
|
|
61257
61318
|
})
|
|
61258
61319
|
]
|
|
61259
61320
|
});
|
|
61260
|
-
firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.theus.theus_code.events", { VERSION: "0.2.
|
|
61321
|
+
firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.theus.theus_code.events", { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
|
|
61261
61322
|
}
|
|
61262
61323
|
async function reinitialize1PEventLoggingIfConfigChanged() {
|
|
61263
61324
|
if (!is1PEventLoggingEnabled() || !firstPartyEventLoggerProvider) {
|
|
@@ -91096,7 +91157,7 @@ function getAttributionHeader(fingerprint) {
|
|
|
91096
91157
|
if (!isAttributionHeaderEnabled()) {
|
|
91097
91158
|
return "";
|
|
91098
91159
|
}
|
|
91099
|
-
const version2 = `${{ VERSION: "0.2.
|
|
91160
|
+
const version2 = `${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}.${fingerprint}`;
|
|
91100
91161
|
const entrypoint = process.env.THEUS_CODE_ENTRYPOINT ?? "unknown";
|
|
91101
91162
|
const cch = "";
|
|
91102
91163
|
const workload = getWorkload();
|
|
@@ -104132,7 +104193,7 @@ Complete the user's request by providing accurate, documentation-based guidance.
|
|
|
104132
104193
|
}
|
|
104133
104194
|
function getFeedbackGuideline() {
|
|
104134
104195
|
if (isUsing3PServices()) {
|
|
104135
|
-
return `- When you cannot find an answer or the feature doesn't exist, direct the user to ${{ VERSION: "0.2.
|
|
104196
|
+
return `- When you cannot find an answer or the feature doesn't exist, direct the user to ${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.ISSUES_EXPLAINER}`;
|
|
104136
104197
|
}
|
|
104137
104198
|
return "- When you cannot find an answer or the feature doesn't exist, direct the user to use /feedback to report a feature request or bug";
|
|
104138
104199
|
}
|
|
@@ -107209,7 +107270,11 @@ function getAssistantMessageFromError(error40, model, options) {
|
|
|
107209
107270
|
});
|
|
107210
107271
|
}
|
|
107211
107272
|
}
|
|
107212
|
-
|
|
107273
|
+
const mensajeDeAutenticacion = typeof error40 === "object" && error40 !== null && "message" in error40 && typeof error40.message === "string" ? error40.message : undefined;
|
|
107274
|
+
const estadoDeAutenticacion = typeof error40 === "object" && error40 !== null && "status" in error40 && typeof error40.status === "number" ? error40.status : undefined;
|
|
107275
|
+
const mencionaCabeceraDeClave = mensajeDeAutenticacion?.toLowerCase().includes("x-api-key");
|
|
107276
|
+
const esFalloDeAutenticacion = mencionaCabeceraDeClave && (estadoDeAutenticacion === undefined || estadoDeAutenticacion === 401);
|
|
107277
|
+
if (esFalloDeAutenticacion) {
|
|
107213
107278
|
if (isCCRMode()) {
|
|
107214
107279
|
return createAssistantAPIErrorMessage({
|
|
107215
107280
|
error: "authentication_failed",
|
|
@@ -144316,7 +144381,7 @@ function getTelemetryAttributes() {
|
|
|
144316
144381
|
attributes["session.id"] = sessionId;
|
|
144317
144382
|
}
|
|
144318
144383
|
if (shouldIncludeAttribute("OTEL_METRICS_INCLUDE_VERSION")) {
|
|
144319
|
-
attributes["app.version"] = { VERSION: "0.2.
|
|
144384
|
+
attributes["app.version"] = { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
|
|
144320
144385
|
}
|
|
144321
144386
|
const oauthAccount = getOauthAccountInfo();
|
|
144322
144387
|
if (oauthAccount) {
|
|
@@ -220595,7 +220660,7 @@ async function getMcpHeadersFromHelper(serverName, config2) {
|
|
|
220595
220660
|
if ("scope" in config2 && isMcpServerFromProjectOrLocalSettings(config2) && !getIsNonInteractiveSession()) {
|
|
220596
220661
|
const hasTrust = checkHasTrustDialogAccepted();
|
|
220597
220662
|
if (!hasTrust) {
|
|
220598
|
-
const error40 = new Error(`Security: headersHelper for MCP server '${serverName}' executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.
|
|
220663
|
+
const error40 = new Error(`Security: headersHelper for MCP server '${serverName}' executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.FEEDBACK_CHANNEL}.`);
|
|
220599
220664
|
logAntError("MCP headersHelper invoked before trust check", error40);
|
|
220600
220665
|
logEvent("theus_mcp_headersHelper_missing_trust", {});
|
|
220601
220666
|
return null;
|
|
@@ -221287,7 +221352,7 @@ function computeFingerprint(messageText, version2) {
|
|
|
221287
221352
|
}
|
|
221288
221353
|
function computeFingerprintFromMessages(messages) {
|
|
221289
221354
|
const firstMessageText = extractFirstMessageText(messages);
|
|
221290
|
-
return computeFingerprint(firstMessageText, { VERSION: "0.2.
|
|
221355
|
+
return computeFingerprint(firstMessageText, { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
|
|
221291
221356
|
}
|
|
221292
221357
|
var FINGERPRINT_SALT = "59cf53e54c78";
|
|
221293
221358
|
var init_fingerprint = () => {};
|
|
@@ -221329,7 +221394,7 @@ async function sideQuery(opts) {
|
|
|
221329
221394
|
betas.push(STRUCTURED_OUTPUTS_BETA_HEADER);
|
|
221330
221395
|
}
|
|
221331
221396
|
const messageText = extractFirstUserMessageText(messages);
|
|
221332
|
-
const fingerprint = computeFingerprint(messageText, { VERSION: "0.2.
|
|
221397
|
+
const fingerprint = computeFingerprint(messageText, { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
|
|
221333
221398
|
const attributionHeader = getAttributionHeader(fingerprint);
|
|
221334
221399
|
const systemBlocks = [
|
|
221335
221400
|
attributionHeader ? { type: "text", text: attributionHeader } : null,
|
|
@@ -222453,7 +222518,7 @@ async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) {
|
|
|
222453
222518
|
const client2 = new Client({
|
|
222454
222519
|
name: "theus-code",
|
|
222455
222520
|
title: "Theus",
|
|
222456
|
-
version: { VERSION: "0.2.
|
|
222521
|
+
version: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION ?? "unknown",
|
|
222457
222522
|
description: "Theus's agentic coding tool",
|
|
222458
222523
|
websiteUrl: PRODUCT_URL
|
|
222459
222524
|
}, {
|
|
@@ -222807,7 +222872,7 @@ var init_client5 = __esm(() => {
|
|
|
222807
222872
|
const client2 = new Client({
|
|
222808
222873
|
name: "theus-code",
|
|
222809
222874
|
title: "Theus",
|
|
222810
|
-
version: { VERSION: "0.2.
|
|
222875
|
+
version: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION ?? "unknown",
|
|
222811
222876
|
description: "Theus's agentic coding tool",
|
|
222812
222877
|
websiteUrl: PRODUCT_URL
|
|
222813
222878
|
}, {
|
|
@@ -242655,7 +242720,7 @@ async function initializeBetaTracing(resource) {
|
|
|
242655
242720
|
});
|
|
242656
242721
|
logs.setGlobalLoggerProvider(loggerProvider);
|
|
242657
242722
|
setLoggerProvider(loggerProvider);
|
|
242658
|
-
const eventLogger = logs.getLogger("com.theus.theus_code.events", { VERSION: "0.2.
|
|
242723
|
+
const eventLogger = logs.getLogger("com.theus.theus_code.events", { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
|
|
242659
242724
|
setEventLogger(eventLogger);
|
|
242660
242725
|
process.on("beforeExit", async () => {
|
|
242661
242726
|
await loggerProvider?.forceFlush();
|
|
@@ -242695,7 +242760,7 @@ async function initializeTelemetry() {
|
|
|
242695
242760
|
const platform4 = getPlatform();
|
|
242696
242761
|
const baseAttributes = {
|
|
242697
242762
|
[ATTR_SERVICE_NAME]: "theus-code",
|
|
242698
|
-
[ATTR_SERVICE_VERSION]: { VERSION: "0.2.
|
|
242763
|
+
[ATTR_SERVICE_VERSION]: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
242699
242764
|
};
|
|
242700
242765
|
if (platform4 === "wsl") {
|
|
242701
242766
|
const wslVersion = getWslVersion();
|
|
@@ -242740,7 +242805,7 @@ async function initializeTelemetry() {
|
|
|
242740
242805
|
} catch {}
|
|
242741
242806
|
};
|
|
242742
242807
|
registerCleanup(shutdownTelemetry2);
|
|
242743
|
-
return meterProvider2.getMeter("com.theus.theus_code", { VERSION: "0.2.
|
|
242808
|
+
return meterProvider2.getMeter("com.theus.theus_code", { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
|
|
242744
242809
|
}
|
|
242745
242810
|
const meterProvider = new MeterProvider({
|
|
242746
242811
|
resource,
|
|
@@ -242760,7 +242825,7 @@ async function initializeTelemetry() {
|
|
|
242760
242825
|
});
|
|
242761
242826
|
logs.setGlobalLoggerProvider(loggerProvider);
|
|
242762
242827
|
setLoggerProvider(loggerProvider);
|
|
242763
|
-
const eventLogger = logs.getLogger("com.theus.theus_code.events", { VERSION: "0.2.
|
|
242828
|
+
const eventLogger = logs.getLogger("com.theus.theus_code.events", { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
|
|
242764
242829
|
setEventLogger(eventLogger);
|
|
242765
242830
|
logForDebugging("[3P telemetry] Event logger set successfully");
|
|
242766
242831
|
process.on("beforeExit", async () => {
|
|
@@ -242822,7 +242887,7 @@ Current timeout: ${timeoutMs}ms
|
|
|
242822
242887
|
}
|
|
242823
242888
|
};
|
|
242824
242889
|
registerCleanup(shutdownTelemetry);
|
|
242825
|
-
return meterProvider.getMeter("com.theus.theus_code", { VERSION: "0.2.
|
|
242890
|
+
return meterProvider.getMeter("com.theus.theus_code", { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
|
|
242826
242891
|
}
|
|
242827
242892
|
async function flushTelemetry() {
|
|
242828
242893
|
const meterProvider = getMeterProvider();
|
|
@@ -243364,7 +243429,7 @@ async function installOrUpdateTheusPackage(channel2, specificVersion) {
|
|
|
243364
243429
|
return "install_failed";
|
|
243365
243430
|
}
|
|
243366
243431
|
const versionSpec = specificVersion ? specificVersion : channel2 === "stable" ? "stable" : "latest";
|
|
243367
|
-
const result = await execFileNoThrowWithCwd("npm", ["install", `${{ VERSION: "0.2.
|
|
243432
|
+
const result = await execFileNoThrowWithCwd("npm", ["install", `${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}@${versionSpec}`], { cwd: getLocalInstallDir(), maxBuffer: 1e6 });
|
|
243368
243433
|
if (result.code !== 0) {
|
|
243369
243434
|
const error40 = new Error(`Failed to install Theus CLI package: ${result.stderr}`);
|
|
243370
243435
|
logError2(error40);
|
|
@@ -243510,9 +243575,9 @@ async function assertMinVersion() {
|
|
|
243510
243575
|
if (false) {}
|
|
243511
243576
|
try {
|
|
243512
243577
|
const versionConfig = await getDynamicConfig_BLOCKS_ON_INIT("theus_version_config", { minVersion: "0.0.0" });
|
|
243513
|
-
if (versionConfig.minVersion && lt({ VERSION: "0.2.
|
|
243578
|
+
if (versionConfig.minVersion && lt({ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, versionConfig.minVersion)) {
|
|
243514
243579
|
console.error(`
|
|
243515
|
-
It looks like your version of Theus (${{ VERSION: "0.2.
|
|
243580
|
+
It looks like your version of Theus (${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}) needs an update.
|
|
243516
243581
|
A newer version (${versionConfig.minVersion} or higher) is required to continue.
|
|
243517
243582
|
|
|
243518
243583
|
To update, please run:
|
|
@@ -243649,7 +243714,7 @@ async function getInstallationPrefix() {
|
|
|
243649
243714
|
return prefixResult.stdout.trim();
|
|
243650
243715
|
}
|
|
243651
243716
|
function getGlobalInstallPackageManager() {
|
|
243652
|
-
if ({ VERSION: "0.2.
|
|
243717
|
+
if ({ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL === "theus-cli") {
|
|
243653
243718
|
return "npm";
|
|
243654
243719
|
}
|
|
243655
243720
|
return env3.isRunningWithBun() ? "bun" : "npm";
|
|
@@ -243674,7 +243739,7 @@ async function checkGlobalInstallPermissions() {
|
|
|
243674
243739
|
}
|
|
243675
243740
|
async function getLatestVersion(channel2) {
|
|
243676
243741
|
const npmTag = channel2 === "stable" ? "stable" : "latest";
|
|
243677
|
-
const result = await execFileNoThrowWithCwd("npm", ["view", `${{ VERSION: "0.2.
|
|
243742
|
+
const result = await execFileNoThrowWithCwd("npm", ["view", `${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}@${npmTag}`, "version", "--prefer-online"], { abortSignal: AbortSignal.timeout(5000), cwd: homedir20() });
|
|
243678
243743
|
if (result.code !== 0) {
|
|
243679
243744
|
logForDebugging(`npm view failed with code ${result.code}`);
|
|
243680
243745
|
if (result.stderr) {
|
|
@@ -243690,7 +243755,7 @@ async function getLatestVersion(channel2) {
|
|
|
243690
243755
|
return result.stdout.trim();
|
|
243691
243756
|
}
|
|
243692
243757
|
async function getNpmDistTags() {
|
|
243693
|
-
const result = await execFileNoThrowWithCwd("npm", ["view", { VERSION: "0.2.
|
|
243758
|
+
const result = await execFileNoThrowWithCwd("npm", ["view", { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL, "dist-tags", "--json", "--prefer-online"], { abortSignal: AbortSignal.timeout(5000), cwd: homedir20() });
|
|
243694
243759
|
if (result.code !== 0) {
|
|
243695
243760
|
logForDebugging(`npm view dist-tags failed with code ${result.code}`);
|
|
243696
243761
|
return { latest: null, stable: null };
|
|
@@ -243734,7 +243799,7 @@ async function installGlobalPackage(specificVersion) {
|
|
|
243734
243799
|
logError2(new AutoUpdaterError("Another process is currently installing an update"));
|
|
243735
243800
|
logEvent("theus_auto_updater_lock_contention", {
|
|
243736
243801
|
pid: process.pid,
|
|
243737
|
-
currentVersion: { VERSION: "0.2.
|
|
243802
|
+
currentVersion: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
243738
243803
|
});
|
|
243739
243804
|
return "in_progress";
|
|
243740
243805
|
}
|
|
@@ -243743,7 +243808,7 @@ async function installGlobalPackage(specificVersion) {
|
|
|
243743
243808
|
if (!env3.isRunningWithBun() && env3.isNpmFromWindowsPath()) {
|
|
243744
243809
|
logError2(new Error("Windows NPM detected in WSL environment"));
|
|
243745
243810
|
logEvent("theus_auto_updater_windows_npm_in_wsl", {
|
|
243746
|
-
currentVersion: { VERSION: "0.2.
|
|
243811
|
+
currentVersion: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
243747
243812
|
});
|
|
243748
243813
|
console.error(`
|
|
243749
243814
|
Error: Windows NPM detected in WSL
|
|
@@ -243762,7 +243827,7 @@ To fix this issue:
|
|
|
243762
243827
|
if (!hasPermissions) {
|
|
243763
243828
|
return "no_permissions";
|
|
243764
243829
|
}
|
|
243765
|
-
const packageSpec = specificVersion ? `${{ VERSION: "0.2.
|
|
243830
|
+
const packageSpec = specificVersion ? `${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}@${specificVersion}` : { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL;
|
|
243766
243831
|
const packageManager = getGlobalInstallPackageManager();
|
|
243767
243832
|
const installResult = await execFileNoThrowWithCwd(packageManager, ["install", "-g", packageSpec], { cwd: homedir20() });
|
|
243768
243833
|
if (installResult.code !== 0) {
|
|
@@ -244091,8 +244156,8 @@ async function detectMultipleInstallations() {
|
|
|
244091
244156
|
installations.push({ type: "npm-local", path: localPath });
|
|
244092
244157
|
}
|
|
244093
244158
|
const packagesToCheck = ["@theus-ai/theus-code"];
|
|
244094
|
-
if ({ VERSION: "0.2.
|
|
244095
|
-
packagesToCheck.push({ VERSION: "0.2.
|
|
244159
|
+
if ({ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL && { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL !== "@theus-ai/theus-code") {
|
|
244160
|
+
packagesToCheck.push({ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL);
|
|
244096
244161
|
}
|
|
244097
244162
|
const npmResult = await execFileNoThrow("npm", [
|
|
244098
244163
|
"-g",
|
|
@@ -244275,7 +244340,7 @@ function detectLinuxGlobPatternWarnings() {
|
|
|
244275
244340
|
}
|
|
244276
244341
|
async function getDoctorDiagnostic() {
|
|
244277
244342
|
const installationType = await getCurrentInstallationType();
|
|
244278
|
-
const version2 = { VERSION: "0.2.
|
|
244343
|
+
const version2 = { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION ? { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION : "unknown";
|
|
244279
244344
|
const installationPath = await getInstallationPath();
|
|
244280
244345
|
const invokedBinary = getInvokedBinary();
|
|
244281
244346
|
const multipleInstallations = await detectMultipleInstallations();
|
|
@@ -244287,8 +244352,8 @@ async function getDoctorDiagnostic() {
|
|
|
244287
244352
|
for (const install of npmInstalls) {
|
|
244288
244353
|
if (install.type === "npm-global") {
|
|
244289
244354
|
let uninstallCmd = "npm -g uninstall @theus-ai/theus-code";
|
|
244290
|
-
if ({ VERSION: "0.2.
|
|
244291
|
-
uninstallCmd += ` && npm -g uninstall ${{ VERSION: "0.2.
|
|
244355
|
+
if ({ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL && { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL !== "@theus-ai/theus-code") {
|
|
244356
|
+
uninstallCmd += ` && npm -g uninstall ${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}`;
|
|
244292
244357
|
}
|
|
244293
244358
|
warnings.push({
|
|
244294
244359
|
issue: `Leftover npm global installation at ${install.path}`,
|
|
@@ -245106,8 +245171,8 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
|
|
|
245106
245171
|
const maxVersion = await getMaxVersion();
|
|
245107
245172
|
if (maxVersion && gt(version2, maxVersion)) {
|
|
245108
245173
|
logForDebugging(`Native installer: maxVersion ${maxVersion} is set, capping update from ${version2} to ${maxVersion}`);
|
|
245109
|
-
if (gte({ VERSION: "0.2.
|
|
245110
|
-
logForDebugging(`Native installer: current version ${{ VERSION: "0.2.
|
|
245174
|
+
if (gte({ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, maxVersion)) {
|
|
245175
|
+
logForDebugging(`Native installer: current version ${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} is already at or above maxVersion ${maxVersion}, skipping update`);
|
|
245111
245176
|
logEvent("theus_native_update_skipped_max_version", {
|
|
245112
245177
|
latency_ms: Date.now() - startTime2,
|
|
245113
245178
|
max_version: maxVersion,
|
|
@@ -245118,7 +245183,7 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
|
|
|
245118
245183
|
version2 = maxVersion;
|
|
245119
245184
|
}
|
|
245120
245185
|
}
|
|
245121
|
-
if (!forceReinstall && version2 === { VERSION: "0.2.
|
|
245186
|
+
if (!forceReinstall && version2 === { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION && await versionIsAvailable(version2) && await isPossibleTheusBinary(executablePath)) {
|
|
245122
245187
|
logForDebugging(`Found ${version2} at ${executablePath}, skipping install`);
|
|
245123
245188
|
logEvent("theus_native_update_complete", {
|
|
245124
245189
|
latency_ms: Date.now() - startTime2,
|
|
@@ -245868,8 +245933,8 @@ async function cleanupNpmInstallations() {
|
|
|
245868
245933
|
} else if (codePackageResult.error) {
|
|
245869
245934
|
errors4.push(codePackageResult.error);
|
|
245870
245935
|
}
|
|
245871
|
-
if ({ VERSION: "0.2.
|
|
245872
|
-
const macroPackageResult = await attemptNpmUninstall({ VERSION: "0.2.
|
|
245936
|
+
if ({ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL && { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL !== "@theus-ai/theus-code") {
|
|
245937
|
+
const macroPackageResult = await attemptNpmUninstall({ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL);
|
|
245873
245938
|
if (macroPackageResult.success) {
|
|
245874
245939
|
removed++;
|
|
245875
245940
|
if (macroPackageResult.warning) {
|
|
@@ -256286,6 +256351,28 @@ var init_ConsoleOAuthFlow = __esm(() => {
|
|
|
256286
256351
|
var NOVEDADES;
|
|
256287
256352
|
var init_data = __esm(() => {
|
|
256288
256353
|
NOVEDADES = [
|
|
256354
|
+
{
|
|
256355
|
+
version: "v0.2.82",
|
|
256356
|
+
fecha: "2026-08-16",
|
|
256357
|
+
titulo: "El modelo autom\xE1tico ya no se queda atrapado en el primero que falla",
|
|
256358
|
+
puntos: [
|
|
256359
|
+
"Al iniciar sesi\xF3n, el cat\xE1logo completo empataba en la decisi\xF3n local y el orden alfab\xE9tico eleg\xEDa siempre el mismo modelo. Si ese primero estaba bloqueado, todos los turnos mor\xEDan igual. Ahora el proveedor oficial delega la elecci\xF3n a TITAN, que s\xED conoce el cat\xE1logo vivo, el plan y la salud de cada ruta.",
|
|
256360
|
+
"Un rechazo de acceso, una cuota temporal o un timeout de un proveedor ya no corta el turno si queda otra ruta disponible. Theus contin\xFAa con la siguiente y aparta durante quince minutos un modelo que acumule tres rechazos seguidos.",
|
|
256361
|
+
"Los errores que llegan al cliente quedan limpios: una p\xE1gina de bloqueo, una URL interna o el nombre t\xE9cnico del proveedor no vuelven a mezclarse con el mensaje \xFAtil.",
|
|
256362
|
+
"En /recarga, cerrar cualquier pantalla deja un mensaje claro. Si el servidor rechaz\xF3 la operaci\xF3n, el motivo real sobrevive al cierre; si la recarga ya se acredit\xF3, Enter y Esc muestran el mismo acuse."
|
|
256363
|
+
]
|
|
256364
|
+
},
|
|
256365
|
+
{
|
|
256366
|
+
version: "v0.2.81",
|
|
256367
|
+
fecha: "2026-08-14",
|
|
256368
|
+
titulo: "Theus ya tiene instalador de doble clic en Mac y en Windows",
|
|
256369
|
+
puntos: [
|
|
256370
|
+
"En Mac hay un instalador de verdad: lo abres, te pide tu contrase\xF1a una vez y deja el comando listo. Va firmado y notarizado por Apple, con el permiso incrustado dentro del archivo, as\xED que se abre sin advertencias y sin necesidad de conexi\xF3n.",
|
|
256371
|
+
"Deja Theus en una carpeta que tu sistema ya consulta, as\xED que se acab\xF3 el \xABno se reconoce el comando\xBB despu\xE9s de una instalaci\xF3n que dec\xEDa haber ido bien.",
|
|
256372
|
+
"En Windows hay instalador propio: no pide permisos de administrador, se registra en \xABAplicaciones instaladas\xBB para que puedas quitarlo cuando quieras, y al desinstalarlo no borra tu \xEDndice ni tu memoria.",
|
|
256373
|
+
"Quien prefiera la terminal la sigue teniendo: los comandos de siempre funcionan igual."
|
|
256374
|
+
]
|
|
256375
|
+
},
|
|
256289
256376
|
{
|
|
256290
256377
|
version: "v0.2.80",
|
|
256291
256378
|
fecha: "2026-08-14",
|
|
@@ -297939,6 +298026,25 @@ var init_tokenBudget2 = __esm(() => {
|
|
|
297939
298026
|
init_tokenBudget();
|
|
297940
298027
|
});
|
|
297941
298028
|
|
|
298029
|
+
// services/router/routerEnv.ts
|
|
298030
|
+
function isRouterEnabled() {
|
|
298031
|
+
const raw = process.env.THEUS_ROUTER;
|
|
298032
|
+
if (raw === undefined)
|
|
298033
|
+
return true;
|
|
298034
|
+
const normalized = raw.toLowerCase().trim();
|
|
298035
|
+
if (normalized === "")
|
|
298036
|
+
return true;
|
|
298037
|
+
return !ROUTER_OFF_VALUES.has(normalized);
|
|
298038
|
+
}
|
|
298039
|
+
var ROUTER_OFF_VALUES, SERVER_SIDE_ROUTER_ALIASES;
|
|
298040
|
+
var init_routerEnv = __esm(() => {
|
|
298041
|
+
ROUTER_OFF_VALUES = new Set(["0", "false", "off", "no"]);
|
|
298042
|
+
SERVER_SIDE_ROUTER_ALIASES = new Set([
|
|
298043
|
+
"theus-router-auto",
|
|
298044
|
+
"titan"
|
|
298045
|
+
]);
|
|
298046
|
+
});
|
|
298047
|
+
|
|
297942
298048
|
// services/router/knownModels.ts
|
|
297943
298049
|
function knownModelsFor(family) {
|
|
297944
298050
|
return (KNOWN_MODELS[family] ?? []).map((card) => ({
|
|
@@ -298237,10 +298343,18 @@ function cardsForEntry(entry) {
|
|
|
298237
298343
|
}
|
|
298238
298344
|
return cards;
|
|
298239
298345
|
}
|
|
298346
|
+
function isRoutingDelegated(options2) {
|
|
298347
|
+
if (options2.routerDelegated === true)
|
|
298348
|
+
return true;
|
|
298349
|
+
const defaultModel = readString(options2.model);
|
|
298350
|
+
return defaultModel !== undefined && SERVER_SIDE_ROUTER_ALIASES.has(defaultModel);
|
|
298351
|
+
}
|
|
298240
298352
|
function entryContributesModels(entry) {
|
|
298241
298353
|
if (NON_LLM_ADAPTERS.has(entry.adapter))
|
|
298242
298354
|
return false;
|
|
298243
298355
|
const options2 = readEntryOptions(entry);
|
|
298356
|
+
if (isRoutingDelegated(options2))
|
|
298357
|
+
return false;
|
|
298244
298358
|
if (Array.isArray(options2.models) && options2.models.length > 0)
|
|
298245
298359
|
return true;
|
|
298246
298360
|
return Boolean(detectProviderFamily({
|
|
@@ -298316,6 +298430,7 @@ var NON_LLM_ADAPTERS;
|
|
|
298316
298430
|
var init_registry3 = __esm(() => {
|
|
298317
298431
|
init_registry2();
|
|
298318
298432
|
init_secretStore();
|
|
298433
|
+
init_routerEnv();
|
|
298319
298434
|
init_knownModels();
|
|
298320
298435
|
NON_LLM_ADAPTERS = new Set(["report", "chart", "video", "image", "media"]);
|
|
298321
298436
|
});
|
|
@@ -299095,21 +299210,6 @@ var init_telemetry = __esm(() => {
|
|
|
299095
299210
|
MAX_BYTES_DEFAULT = 5 * 1024 * 1024;
|
|
299096
299211
|
});
|
|
299097
299212
|
|
|
299098
|
-
// services/router/routerEnv.ts
|
|
299099
|
-
function isRouterEnabled() {
|
|
299100
|
-
const raw = process.env.THEUS_ROUTER;
|
|
299101
|
-
if (raw === undefined)
|
|
299102
|
-
return true;
|
|
299103
|
-
const normalized = raw.toLowerCase().trim();
|
|
299104
|
-
if (normalized === "")
|
|
299105
|
-
return true;
|
|
299106
|
-
return !ROUTER_OFF_VALUES.has(normalized);
|
|
299107
|
-
}
|
|
299108
|
-
var ROUTER_OFF_VALUES;
|
|
299109
|
-
var init_routerEnv = __esm(() => {
|
|
299110
|
-
ROUTER_OFF_VALUES = new Set(["0", "false", "off", "no"]);
|
|
299111
|
-
});
|
|
299112
|
-
|
|
299113
299213
|
// services/router/planExecutor.ts
|
|
299114
299214
|
var exports_planExecutor = {};
|
|
299115
299215
|
__export(exports_planExecutor, {
|
|
@@ -300227,9 +300327,9 @@ function getTheusEnvMetadata() {
|
|
|
300227
300327
|
};
|
|
300228
300328
|
}
|
|
300229
300329
|
function getBuildAgeMinutes() {
|
|
300230
|
-
if (!{ VERSION: "0.2.
|
|
300330
|
+
if (!{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.BUILD_TIME)
|
|
300231
300331
|
return;
|
|
300232
|
-
const buildTime = new Date({ VERSION: "0.2.
|
|
300332
|
+
const buildTime = new Date({ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.BUILD_TIME).getTime();
|
|
300233
300333
|
if (isNaN(buildTime))
|
|
300234
300334
|
return;
|
|
300235
300335
|
return Math.floor((Date.now() - buildTime) / 60000);
|
|
@@ -318534,7 +318634,7 @@ function getSimpleDoingTasksSection() {
|
|
|
318534
318634
|
];
|
|
318535
318635
|
const userHelpSubitems = [
|
|
318536
318636
|
`/help: Get help with using Theus`,
|
|
318537
|
-
`To give feedback, users should ${{ VERSION: "0.2.
|
|
318637
|
+
`To give feedback, users should ${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.ISSUES_EXPLAINER}`
|
|
318538
318638
|
];
|
|
318539
318639
|
const items = [
|
|
318540
318640
|
`The user will primarily request you to perform software engineering tasks. These may include solving bugs, adding new functionality, refactoring code, explaining code, and more. When given an unclear or generic instruction, consider it in the context of these software engineering tasks and the current working directory. For example, if the user asks you to change "methodName" to snake case, do not reply with just "method_name", instead find the method in the code and modify the code.`,
|
|
@@ -319473,13 +319573,14 @@ var init_index_d = __esm(() => {
|
|
|
319473
319573
|
APIError7 = class APIError7 extends Error {
|
|
319474
319574
|
status;
|
|
319475
319575
|
headers;
|
|
319576
|
+
requestID;
|
|
319476
319577
|
error;
|
|
319477
319578
|
};
|
|
319478
|
-
APIConnectionError4 = class APIConnectionError4 extends
|
|
319579
|
+
APIConnectionError4 = class APIConnectionError4 extends APIError7 {
|
|
319479
319580
|
};
|
|
319480
319581
|
APIConnectionTimeoutError2 = class APIConnectionTimeoutError2 extends APIConnectionError4 {
|
|
319481
319582
|
};
|
|
319482
|
-
APIUserAbortError5 = class APIUserAbortError5 extends
|
|
319583
|
+
APIUserAbortError5 = class APIUserAbortError5 extends APIError7 {
|
|
319483
319584
|
};
|
|
319484
319585
|
});
|
|
319485
319586
|
|
|
@@ -329670,7 +329771,7 @@ async function submitTranscriptShare(messages, trigger, appearanceId) {
|
|
|
329670
329771
|
} catch {}
|
|
329671
329772
|
const data = {
|
|
329672
329773
|
trigger,
|
|
329673
|
-
version: { VERSION: "0.2.
|
|
329774
|
+
version: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
329674
329775
|
platform: process.platform,
|
|
329675
329776
|
transcript,
|
|
329676
329777
|
subagentTranscripts: Object.keys(subagentTranscripts).length > 0 ? subagentTranscripts : undefined,
|
|
@@ -329875,10 +329976,10 @@ Si el usuario indic\xF3 una duraci\xF3n, p\xE1sala en el par\xE1metro \`duration
|
|
|
329875
329976
|
|
|
329876
329977
|
// commands/issue/index.ts
|
|
329877
329978
|
function getCliVersion() {
|
|
329878
|
-
return { VERSION: "0.2.
|
|
329979
|
+
return { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION ? { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION : "desconocida";
|
|
329879
329980
|
}
|
|
329880
329981
|
function getIssuesExplainer() {
|
|
329881
|
-
return { VERSION: "0.2.
|
|
329982
|
+
return { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.ISSUES_EXPLAINER ? { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.ISSUES_EXPLAINER : "report issues to the Theus maintainers";
|
|
329882
329983
|
}
|
|
329883
329984
|
function getActiveModelLabel() {
|
|
329884
329985
|
try {
|
|
@@ -332664,7 +332765,7 @@ function buildPrimarySection() {
|
|
|
332664
332765
|
});
|
|
332665
332766
|
return [{
|
|
332666
332767
|
label: "Version",
|
|
332667
|
-
value: { VERSION: "0.2.
|
|
332768
|
+
value: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
332668
332769
|
}, {
|
|
332669
332770
|
label: "Session name",
|
|
332670
332771
|
value: nameValue
|
|
@@ -333499,6 +333600,9 @@ var init_ThemePicker = __esm(() => {
|
|
|
333499
333600
|
function getEffortNotificationText(effortValue, model) {
|
|
333500
333601
|
if (!modelSupportsEffort(model))
|
|
333501
333602
|
return;
|
|
333603
|
+
if (resolveAppliedEffort(model, effortValue) === undefined) {
|
|
333604
|
+
return `${EFFORT_RAPIDO} respuesta r\xE1pida \xB7 /inteligencia`;
|
|
333605
|
+
}
|
|
333502
333606
|
const level = getDisplayedEffortLevel(model, effortValue);
|
|
333503
333607
|
return `${effortLevelToSymbol(level)} ${getEffortLevelLabelEs(level)} \xB7 /inteligencia`;
|
|
333504
333608
|
}
|
|
@@ -336480,7 +336584,7 @@ function Config({
|
|
|
336480
336584
|
}
|
|
336481
336585
|
})
|
|
336482
336586
|
}) : showSubmenu === "ChannelDowngrade" ? /* @__PURE__ */ jsx_runtime189.jsx(ChannelDowngradeDialog, {
|
|
336483
|
-
currentVersion: { VERSION: "0.2.
|
|
336587
|
+
currentVersion: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
336484
336588
|
onChoice: (choice) => {
|
|
336485
336589
|
setShowSubmenu(null);
|
|
336486
336590
|
setTabsHidden(false);
|
|
@@ -336492,7 +336596,7 @@ function Config({
|
|
|
336492
336596
|
autoUpdatesChannel: "stable"
|
|
336493
336597
|
};
|
|
336494
336598
|
if (choice === "stay") {
|
|
336495
|
-
newSettings.minimumVersion = { VERSION: "0.2.
|
|
336599
|
+
newSettings.minimumVersion = { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
|
|
336496
336600
|
}
|
|
336497
336601
|
updateSettingsForSource("userSettings", newSettings);
|
|
336498
336602
|
setSettingsData((prev_27) => ({
|
|
@@ -343851,7 +343955,7 @@ function HelpV2(t0) {
|
|
|
343851
343955
|
let t6;
|
|
343852
343956
|
if ($2[31] !== tabs) {
|
|
343853
343957
|
t6 = /* @__PURE__ */ jsx_runtime215.jsx(Tabs, {
|
|
343854
|
-
title: `Theus v${{ VERSION: "0.2.
|
|
343958
|
+
title: `Theus v${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}`,
|
|
343855
343959
|
color: "professionalBlue",
|
|
343856
343960
|
defaultTab: "general",
|
|
343857
343961
|
children: tabs
|
|
@@ -345456,6 +345560,8 @@ function buildEntry(preset, options2) {
|
|
|
345456
345560
|
const models = options2.models && options2.models.length > 0 ? options2.models.map((m) => ({ ...m, providerId: id })) : undefined;
|
|
345457
345561
|
if (models)
|
|
345458
345562
|
entryOptions.models = models;
|
|
345563
|
+
if (options2.routerDelegated)
|
|
345564
|
+
entryOptions.routerDelegated = true;
|
|
345459
345565
|
const entry = {
|
|
345460
345566
|
id,
|
|
345461
345567
|
adapter: adapter2,
|
|
@@ -346030,6 +346136,7 @@ async function installTheusSession(payload, webUrl) {
|
|
|
346030
346136
|
apiKey: payload.token,
|
|
346031
346137
|
priority: 250,
|
|
346032
346138
|
enabled: true,
|
|
346139
|
+
routerDelegated: true,
|
|
346033
346140
|
...models.length ? { models } : {}
|
|
346034
346141
|
});
|
|
346035
346142
|
await writeFile43(join126(configDir, "session.json"), JSON.stringify({
|
|
@@ -362672,7 +362779,7 @@ function Onboarding({
|
|
|
362672
362779
|
flexDirection: "column",
|
|
362673
362780
|
children: [
|
|
362674
362781
|
/* @__PURE__ */ jsx_runtime251.jsx(TheusBanner, {
|
|
362675
|
-
version: { VERSION: "0.2.
|
|
362782
|
+
version: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
362676
362783
|
}),
|
|
362677
362784
|
/* @__PURE__ */ jsx_runtime251.jsxs(ThemedBox_default, {
|
|
362678
362785
|
flexDirection: "column",
|
|
@@ -363098,13 +363205,38 @@ function decideTecla(faseT, tecla2, ctx) {
|
|
|
363098
363205
|
if (tecla2.return)
|
|
363099
363206
|
return { tipo: "cerrar-ok" };
|
|
363100
363207
|
if (esc2)
|
|
363101
|
-
return { tipo: "
|
|
363208
|
+
return { tipo: "cerrar-ok" };
|
|
363102
363209
|
return null;
|
|
363103
363210
|
}
|
|
363104
363211
|
if (faseT === "abriendo")
|
|
363105
363212
|
return null;
|
|
363106
|
-
if (esc2)
|
|
363107
|
-
|
|
363213
|
+
if (esc2) {
|
|
363214
|
+
if (faseT === "error") {
|
|
363215
|
+
return {
|
|
363216
|
+
tipo: "salir",
|
|
363217
|
+
mensaje: ctx.mensajeError ?? "No pude completar la recarga. No se cobr\xF3 nada."
|
|
363218
|
+
};
|
|
363219
|
+
}
|
|
363220
|
+
if (faseT === "sin-sesion") {
|
|
363221
|
+
return {
|
|
363222
|
+
tipo: "salir",
|
|
363223
|
+
mensaje: "Para recargar cr\xE9ditos necesitas una sesi\xF3n de Theus: inicia sesi\xF3n con /login y vuelve a ejecutar /recarga. No se cobr\xF3 nada."
|
|
363224
|
+
};
|
|
363225
|
+
}
|
|
363226
|
+
if (faseT === "apagado") {
|
|
363227
|
+
return {
|
|
363228
|
+
tipo: "salir",
|
|
363229
|
+
mensaje: "La recarga no est\xE1 disponible ahora mismo. No se cobr\xF3 nada."
|
|
363230
|
+
};
|
|
363231
|
+
}
|
|
363232
|
+
if (faseT === "sin-confirmar") {
|
|
363233
|
+
return {
|
|
363234
|
+
tipo: "salir",
|
|
363235
|
+
mensaje: `Todav\xEDa no veo el pago de ${ctx.nombrePack ?? "tu pack"}. Si lo completaste, ` + "tus cr\xE9ditos se acreditan solos: compru\xE9balo con /uso."
|
|
363236
|
+
};
|
|
363237
|
+
}
|
|
363238
|
+
return { tipo: "salir", mensaje: "Recarga cancelada. No se cobr\xF3 nada." };
|
|
363239
|
+
}
|
|
363108
363240
|
return null;
|
|
363109
363241
|
}
|
|
363110
363242
|
function Cabecera({ estado }) {
|
|
@@ -363368,7 +363500,9 @@ function RecargaUI({
|
|
|
363368
363500
|
total: estado?.packs.length ?? 0,
|
|
363369
363501
|
packsRestantes: estado?.packsRestantes ?? null,
|
|
363370
363502
|
...pack ? { nombrePack: pack.nombre, creditos: pack.creditos } : {},
|
|
363371
|
-
...fase.t === "acreditado" ? { saldo: fase.saldoNuevo } : {}
|
|
363503
|
+
...fase.t === "acreditado" ? { saldo: fase.saldoNuevo } : {},
|
|
363504
|
+
...fase.t === "error" ? { mensajeError: fase.mensaje } : {},
|
|
363505
|
+
...fase.t === "sin-confirmar" ? { nombrePack: fase.pack.nombre } : {}
|
|
363372
363506
|
});
|
|
363373
363507
|
if (!accion)
|
|
363374
363508
|
return;
|
|
@@ -368059,7 +368193,7 @@ var init_Messages = __esm(() => {
|
|
|
368059
368193
|
let t1;
|
|
368060
368194
|
if ($2[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
368061
368195
|
t1 = /* @__PURE__ */ jsx_runtime264.jsx(TheusSessionHeader, {
|
|
368062
|
-
version: { VERSION: "0.2.
|
|
368196
|
+
version: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
368063
368197
|
});
|
|
368064
368198
|
$2[0] = t1;
|
|
368065
368199
|
} else {
|
|
@@ -399928,7 +400062,7 @@ async function captureMemoryDiagnostics(trigger, dumpNumber = 0) {
|
|
|
399928
400062
|
smapsRollup,
|
|
399929
400063
|
platform: process.platform,
|
|
399930
400064
|
nodeVersion: process.version,
|
|
399931
|
-
ccVersion: { VERSION: "0.2.
|
|
400065
|
+
ccVersion: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
399932
400066
|
};
|
|
399933
400067
|
}
|
|
399934
400068
|
async function performHeapDump(trigger = "manual", dumpNumber = 0) {
|
|
@@ -400689,7 +400823,7 @@ var init_bridge_kick = __esm(() => {
|
|
|
400689
400823
|
var call69 = async () => {
|
|
400690
400824
|
return {
|
|
400691
400825
|
type: "text",
|
|
400692
|
-
value: { VERSION: "0.2.
|
|
400826
|
+
value: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.BUILD_TIME ? `${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} (built ${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.BUILD_TIME})` : { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
400693
400827
|
};
|
|
400694
400828
|
}, version2, version_default;
|
|
400695
400829
|
var init_version = __esm(() => {
|
|
@@ -403290,7 +403424,7 @@ var SECRET_NAME_PATTERN, EXTRA_ENV_ALLOWLIST, REDACTED2 = "\u2039oculto\u203A",
|
|
|
403290
403424
|
const lines = [];
|
|
403291
403425
|
lines.push("## Entorno de ejecuci\xF3n");
|
|
403292
403426
|
lines.push("");
|
|
403293
|
-
const version3 = { VERSION: "0.2.
|
|
403427
|
+
const version3 = { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION ? { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION : "desconocida";
|
|
403294
403428
|
lines.push(`- Versi\xF3n de Theus: ${version3}`);
|
|
403295
403429
|
lines.push(`- Directorio de trabajo: ${getCwd()}`);
|
|
403296
403430
|
lines.push(`- \xBFRepositorio git?: ${isGit ? "s\xED" : "no"}`);
|
|
@@ -405831,13 +405965,13 @@ async function updateReleaseBundle() {
|
|
|
405831
405965
|
await gracefulShutdown(1);
|
|
405832
405966
|
return;
|
|
405833
405967
|
}
|
|
405834
|
-
if (gte({ VERSION: "0.2.
|
|
405835
|
-
writeToStdout(source_default.green(`Theus ya est\xE1 al d\xEDa (${{ VERSION: "0.2.
|
|
405968
|
+
if (gte({ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, latest)) {
|
|
405969
|
+
writeToStdout(source_default.green(`Theus ya est\xE1 al d\xEDa (${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})`) + `
|
|
405836
405970
|
`);
|
|
405837
405971
|
await gracefulShutdown(0);
|
|
405838
405972
|
return;
|
|
405839
405973
|
}
|
|
405840
|
-
writeToStdout(`Nueva versi\xF3n disponible: ${latest} (actual: ${{ VERSION: "0.2.
|
|
405974
|
+
writeToStdout(`Nueva versi\xF3n disponible: ${latest} (actual: ${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})
|
|
405841
405975
|
`);
|
|
405842
405976
|
writeToStdout(`Instalando la actualizaci\xF3n desde theus.pe/dl...
|
|
405843
405977
|
`);
|
|
@@ -405871,7 +406005,7 @@ async function updateReleaseBundle() {
|
|
|
405871
406005
|
return;
|
|
405872
406006
|
}
|
|
405873
406007
|
cpSync(staged, bundleDir, { recursive: true, force: true });
|
|
405874
|
-
writeToStdout(source_default.green(`Actualizado correctamente de ${{ VERSION: "0.2.
|
|
406008
|
+
writeToStdout(source_default.green(`Actualizado correctamente de ${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} a la versi\xF3n ${latest}`) + `
|
|
405875
406009
|
`);
|
|
405876
406010
|
await regenerateCompletionCache();
|
|
405877
406011
|
} finally {
|
|
@@ -405884,7 +406018,7 @@ async function updateReleaseBundle() {
|
|
|
405884
406018
|
async function update() {
|
|
405885
406019
|
logEvent("theus_update_check", {});
|
|
405886
406020
|
await updateNaupa();
|
|
405887
|
-
writeToStdout(`Versi\xF3n actual: ${{ VERSION: "0.2.
|
|
406021
|
+
writeToStdout(`Versi\xF3n actual: ${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}
|
|
405888
406022
|
`);
|
|
405889
406023
|
const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
|
|
405890
406024
|
writeToStdout(`Buscando actualizaciones en el canal ${channel2}...
|
|
@@ -405963,8 +406097,8 @@ async function update() {
|
|
|
405963
406097
|
writeToStdout(`Theus est\xE1 gestionado por Homebrew.
|
|
405964
406098
|
`);
|
|
405965
406099
|
const latest = await getLatestVersion(channel2);
|
|
405966
|
-
if (latest && !gte({ VERSION: "0.2.
|
|
405967
|
-
writeToStdout(`Actualizaci\xF3n disponible: ${{ VERSION: "0.2.
|
|
406100
|
+
if (latest && !gte({ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, latest)) {
|
|
406101
|
+
writeToStdout(`Actualizaci\xF3n disponible: ${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} \u2192 ${latest}
|
|
405968
406102
|
`);
|
|
405969
406103
|
writeToStdout(`
|
|
405970
406104
|
`);
|
|
@@ -405980,8 +406114,8 @@ async function update() {
|
|
|
405980
406114
|
writeToStdout(`Theus est\xE1 gestionado por winget.
|
|
405981
406115
|
`);
|
|
405982
406116
|
const latest = await getLatestVersion(channel2);
|
|
405983
|
-
if (latest && !gte({ VERSION: "0.2.
|
|
405984
|
-
writeToStdout(`Actualizaci\xF3n disponible: ${{ VERSION: "0.2.
|
|
406117
|
+
if (latest && !gte({ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, latest)) {
|
|
406118
|
+
writeToStdout(`Actualizaci\xF3n disponible: ${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} \u2192 ${latest}
|
|
405985
406119
|
`);
|
|
405986
406120
|
writeToStdout(`
|
|
405987
406121
|
`);
|
|
@@ -405997,8 +406131,8 @@ async function update() {
|
|
|
405997
406131
|
writeToStdout(`Theus est\xE1 gestionado por apk.
|
|
405998
406132
|
`);
|
|
405999
406133
|
const latest = await getLatestVersion(channel2);
|
|
406000
|
-
if (latest && !gte({ VERSION: "0.2.
|
|
406001
|
-
writeToStdout(`Actualizaci\xF3n disponible: ${{ VERSION: "0.2.
|
|
406134
|
+
if (latest && !gte({ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, latest)) {
|
|
406135
|
+
writeToStdout(`Actualizaci\xF3n disponible: ${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} \u2192 ${latest}
|
|
406002
406136
|
`);
|
|
406003
406137
|
writeToStdout(`
|
|
406004
406138
|
`);
|
|
@@ -406063,11 +406197,11 @@ async function update() {
|
|
|
406063
406197
|
`);
|
|
406064
406198
|
await gracefulShutdown(1);
|
|
406065
406199
|
}
|
|
406066
|
-
if (result.latestVersion === { VERSION: "0.2.
|
|
406067
|
-
writeToStdout(source_default.green(`Theus ya est\xE1 al d\xEDa (${{ VERSION: "0.2.
|
|
406200
|
+
if (result.latestVersion === { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION) {
|
|
406201
|
+
writeToStdout(source_default.green(`Theus ya est\xE1 al d\xEDa (${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})`) + `
|
|
406068
406202
|
`);
|
|
406069
406203
|
} else {
|
|
406070
|
-
writeToStdout(source_default.green(`Actualizado correctamente de ${{ VERSION: "0.2.
|
|
406204
|
+
writeToStdout(source_default.green(`Actualizado correctamente de ${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} a la versi\xF3n ${result.latestVersion}`) + `
|
|
406071
406205
|
`);
|
|
406072
406206
|
await regenerateCompletionCache();
|
|
406073
406207
|
}
|
|
@@ -406086,9 +406220,9 @@ async function update() {
|
|
|
406086
406220
|
await removeInstalledSymlink();
|
|
406087
406221
|
}
|
|
406088
406222
|
logForDebugging("update: Checking npm registry for latest version");
|
|
406089
|
-
logForDebugging(`update: Package URL: ${{ VERSION: "0.2.
|
|
406223
|
+
logForDebugging(`update: Package URL: ${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}`);
|
|
406090
406224
|
const npmTag = channel2 === "stable" ? "stable" : "latest";
|
|
406091
|
-
const npmCommand = `npm view ${{ VERSION: "0.2.
|
|
406225
|
+
const npmCommand = `npm view ${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}@${npmTag} version`;
|
|
406092
406226
|
logForDebugging(`update: Running: ${npmCommand}`);
|
|
406093
406227
|
const latestVersion = await getLatestVersion(channel2);
|
|
406094
406228
|
logForDebugging(`update: Latest version from npm: ${latestVersion || "FAILED"}`);
|
|
@@ -406108,7 +406242,7 @@ async function update() {
|
|
|
406108
406242
|
`);
|
|
406109
406243
|
process.stderr.write(` \u2022 Un proxy o firewall corporativo bloquea npm
|
|
406110
406244
|
`);
|
|
406111
|
-
if ({ VERSION: "0.2.
|
|
406245
|
+
if ({ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL && !{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL.startsWith("@theus")) {
|
|
406112
406246
|
process.stderr.write(` \u2022 Compilaci\xF3n interna/de desarrollo no publicada en npm
|
|
406113
406247
|
`);
|
|
406114
406248
|
}
|
|
@@ -406120,19 +406254,19 @@ async function update() {
|
|
|
406120
406254
|
`);
|
|
406121
406255
|
process.stderr.write(` \u2022 Ejecuta con el flag --debug para m\xE1s detalle
|
|
406122
406256
|
`);
|
|
406123
|
-
const packageName = { VERSION: "0.2.
|
|
406257
|
+
const packageName = { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL || "@theus-ai/theus-code";
|
|
406124
406258
|
process.stderr.write(` \u2022 Comprueba a mano: npm view ${packageName} version
|
|
406125
406259
|
`);
|
|
406126
406260
|
process.stderr.write(` \u2022 Comprueba si te falta iniciar sesi\xF3n: npm whoami
|
|
406127
406261
|
`);
|
|
406128
406262
|
await gracefulShutdown(1);
|
|
406129
406263
|
}
|
|
406130
|
-
if (gte({ VERSION: "0.2.
|
|
406131
|
-
writeToStdout(source_default.green(`Theus ya est\xE1 al d\xEDa (${{ VERSION: "0.2.
|
|
406264
|
+
if (gte({ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, latestVersion)) {
|
|
406265
|
+
writeToStdout(source_default.green(`Theus ya est\xE1 al d\xEDa (${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})`) + `
|
|
406132
406266
|
`);
|
|
406133
406267
|
await gracefulShutdown(0);
|
|
406134
406268
|
}
|
|
406135
|
-
writeToStdout(`Nueva versi\xF3n disponible: ${latestVersion} (actual: ${{ VERSION: "0.2.
|
|
406269
|
+
writeToStdout(`Nueva versi\xF3n disponible: ${latestVersion} (actual: ${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})
|
|
406136
406270
|
`);
|
|
406137
406271
|
writeToStdout(`Instalando la actualizaci\xF3n...
|
|
406138
406272
|
`);
|
|
@@ -406177,7 +406311,7 @@ async function update() {
|
|
|
406177
406311
|
logForDebugging(`update: Installation status: ${status2}`);
|
|
406178
406312
|
switch (status2) {
|
|
406179
406313
|
case "success":
|
|
406180
|
-
writeToStdout(source_default.green(`Actualizado correctamente de ${{ VERSION: "0.2.
|
|
406314
|
+
writeToStdout(source_default.green(`Actualizado correctamente de ${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} a la versi\xF3n ${latestVersion}`) + `
|
|
406181
406315
|
`);
|
|
406182
406316
|
await regenerateCompletionCache();
|
|
406183
406317
|
break;
|
|
@@ -406187,7 +406321,7 @@ async function update() {
|
|
|
406187
406321
|
if (useLocalUpdate) {
|
|
406188
406322
|
process.stderr.write(`Prueba a actualizar a mano con:
|
|
406189
406323
|
`);
|
|
406190
|
-
process.stderr.write(` cd ~/.theus/local && npm update ${{ VERSION: "0.2.
|
|
406324
|
+
process.stderr.write(` cd ~/.theus/local && npm update ${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}
|
|
406191
406325
|
`);
|
|
406192
406326
|
} else {
|
|
406193
406327
|
process.stderr.write(`Prueba con sudo o corrige los permisos de npm
|
|
@@ -406203,7 +406337,7 @@ async function update() {
|
|
|
406203
406337
|
if (useLocalUpdate) {
|
|
406204
406338
|
process.stderr.write(`Prueba a actualizar a mano con:
|
|
406205
406339
|
`);
|
|
406206
|
-
process.stderr.write(` cd ~/.theus/local && npm update ${{ VERSION: "0.2.
|
|
406340
|
+
process.stderr.write(` cd ~/.theus/local && npm update ${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}
|
|
406207
406341
|
`);
|
|
406208
406342
|
} else {
|
|
406209
406343
|
process.stderr.write(`O p\xE1sate a la instalaci\xF3n nativa con: theus install
|
|
@@ -415628,7 +415762,7 @@ var init_sessionStorage = __esm(() => {
|
|
|
415628
415762
|
init_settings2();
|
|
415629
415763
|
init_slowOperations();
|
|
415630
415764
|
init_uuid();
|
|
415631
|
-
VERSION4 = { VERSION: "0.2.
|
|
415765
|
+
VERSION4 = { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
|
|
415632
415766
|
MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
|
|
415633
415767
|
SKIP_FIRST_PROMPT_PATTERN2 = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
|
|
415634
415768
|
EPHEMERAL_PROGRESS_TYPES = new Set([
|
|
@@ -416833,7 +416967,7 @@ var init_filesystem = __esm(() => {
|
|
|
416833
416967
|
});
|
|
416834
416968
|
getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
|
|
416835
416969
|
const nonce = randomBytes21(16).toString("hex");
|
|
416836
|
-
return join154(getTheusTempDir(), "bundled-skills", { VERSION: "0.2.
|
|
416970
|
+
return join154(getTheusTempDir(), "bundled-skills", { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, nonce);
|
|
416837
416971
|
});
|
|
416838
416972
|
getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
|
|
416839
416973
|
});
|
|
@@ -427149,6 +427283,62 @@ var init_managedEnv = __esm(() => {
|
|
|
427149
427283
|
];
|
|
427150
427284
|
});
|
|
427151
427285
|
|
|
427286
|
+
// utils/instalacionTapada.ts
|
|
427287
|
+
import { accessSync as accessSync2, constants as constants5, realpathSync as realpathSync6 } from "fs";
|
|
427288
|
+
import { delimiter as delimiter4, join as join159 } from "path";
|
|
427289
|
+
function esEjecutable(ruta) {
|
|
427290
|
+
try {
|
|
427291
|
+
accessSync2(ruta, constants5.X_OK);
|
|
427292
|
+
return true;
|
|
427293
|
+
} catch {
|
|
427294
|
+
return false;
|
|
427295
|
+
}
|
|
427296
|
+
}
|
|
427297
|
+
function canonico(ruta) {
|
|
427298
|
+
try {
|
|
427299
|
+
return realpathSync6(ruta);
|
|
427300
|
+
} catch {
|
|
427301
|
+
return ruta;
|
|
427302
|
+
}
|
|
427303
|
+
}
|
|
427304
|
+
function detectarInstalacionTapada(ejecutable, path19, nombres = ["theus"]) {
|
|
427305
|
+
if (!path19)
|
|
427306
|
+
return null;
|
|
427307
|
+
const base2 = ejecutable.split(/[\\/]/).pop()?.toLowerCase() ?? "";
|
|
427308
|
+
const esBinarioTheus = nombres.some((n3) => base2 === n3.toLowerCase());
|
|
427309
|
+
if (!esBinarioTheus)
|
|
427310
|
+
return null;
|
|
427311
|
+
const actualCanonico = canonico(ejecutable);
|
|
427312
|
+
const carpetas = path19.split(delimiter4).filter(Boolean);
|
|
427313
|
+
for (const carpeta of carpetas) {
|
|
427314
|
+
for (const nombre of nombres) {
|
|
427315
|
+
const candidato = join159(carpeta, nombre);
|
|
427316
|
+
if (!esEjecutable(candidato))
|
|
427317
|
+
continue;
|
|
427318
|
+
if (canonico(candidato) === actualCanonico)
|
|
427319
|
+
return null;
|
|
427320
|
+
return { ganador: candidato, actual: ejecutable };
|
|
427321
|
+
}
|
|
427322
|
+
}
|
|
427323
|
+
return null;
|
|
427324
|
+
}
|
|
427325
|
+
function mensajeInstalacionTapada(c5) {
|
|
427326
|
+
return [
|
|
427327
|
+
"Tienes dos instalaciones de Theus y el sistema esta usando la otra.",
|
|
427328
|
+
"",
|
|
427329
|
+
` se ejecuta: ${c5.ganador}`,
|
|
427330
|
+
` esta version: ${c5.actual}`,
|
|
427331
|
+
"",
|
|
427332
|
+
"El sistema elige la primera que encuentra en el PATH, no la mas reciente.",
|
|
427333
|
+
"Para quedarte solo con una:",
|
|
427334
|
+
"",
|
|
427335
|
+
" npm rm -g theus-cli si la vieja vino del gestor de paquetes",
|
|
427336
|
+
` rm ${c5.ganador} si la pusiste a mano`
|
|
427337
|
+
].join(`
|
|
427338
|
+
`);
|
|
427339
|
+
}
|
|
427340
|
+
var init_instalacionTapada = () => {};
|
|
427341
|
+
|
|
427152
427342
|
// upstreamproxy/relay.ts
|
|
427153
427343
|
import { createServer as createServer8 } from "net";
|
|
427154
427344
|
function encodeChunk(data) {
|
|
@@ -427436,7 +427626,7 @@ __export(exports_upstreamproxy, {
|
|
|
427436
427626
|
});
|
|
427437
427627
|
import { mkdir as mkdir49, readFile as readFile61, unlink as unlink24, writeFile as writeFile50 } from "fs/promises";
|
|
427438
427628
|
import { homedir as homedir41 } from "os";
|
|
427439
|
-
import { join as
|
|
427629
|
+
import { join as join160 } from "path";
|
|
427440
427630
|
async function initUpstreamProxy(opts) {
|
|
427441
427631
|
if (!isEnvTruthy(process.env.THEUS_CODE_REMOTE)) {
|
|
427442
427632
|
return state;
|
|
@@ -427457,7 +427647,7 @@ async function initUpstreamProxy(opts) {
|
|
|
427457
427647
|
}
|
|
427458
427648
|
setNonDumpable();
|
|
427459
427649
|
const baseUrl = opts?.ccrBaseUrl ?? process.env.THEUS_BASE_URL ?? "https://api.theus.pe";
|
|
427460
|
-
const caBundlePath = opts?.caBundlePath ??
|
|
427650
|
+
const caBundlePath = opts?.caBundlePath ?? join160(homedir41(), ".ccr", "ca-bundle.crt");
|
|
427461
427651
|
const caOk = await downloadCaBundle(baseUrl, opts?.systemCaPath ?? SYSTEM_CA_BUNDLE, caBundlePath);
|
|
427462
427652
|
if (!caOk)
|
|
427463
427653
|
return state;
|
|
@@ -427558,7 +427748,7 @@ async function downloadCaBundle(baseUrl, systemCaPath, outPath) {
|
|
|
427558
427748
|
}
|
|
427559
427749
|
const ccrCa = await resp.text();
|
|
427560
427750
|
const systemCa = await readFile61(systemCaPath, "utf8").catch(() => "");
|
|
427561
|
-
await mkdir49(
|
|
427751
|
+
await mkdir49(join160(outPath, ".."), { recursive: true });
|
|
427562
427752
|
await writeFile50(outPath, systemCa + `
|
|
427563
427753
|
` + ccrCa, "utf8");
|
|
427564
427754
|
return true;
|
|
@@ -427868,6 +428058,7 @@ var init_init2 = __esm(() => {
|
|
|
427868
428058
|
init_proxy();
|
|
427869
428059
|
init_betaSessionTracing();
|
|
427870
428060
|
init_telemetryAttributes();
|
|
428061
|
+
init_instalacionTapada();
|
|
427871
428062
|
init_windowsPaths();
|
|
427872
428063
|
init = memoize_default(async () => {
|
|
427873
428064
|
const initStartTime = Date.now();
|
|
@@ -427939,6 +428130,14 @@ var init_init2 = __esm(() => {
|
|
|
427939
428130
|
}
|
|
427940
428131
|
}
|
|
427941
428132
|
setShellIfWindows();
|
|
428133
|
+
try {
|
|
428134
|
+
const tapada = detectarInstalacionTapada(process.execPath, process.env.PATH, process.platform === "win32" ? ["theus.exe", "theus.cmd", "theus"] : ["theus"]);
|
|
428135
|
+
if (tapada) {
|
|
428136
|
+
console.error(`
|
|
428137
|
+
${mensajeInstalacionTapada(tapada)}
|
|
428138
|
+
`);
|
|
428139
|
+
}
|
|
428140
|
+
} catch {}
|
|
427942
428141
|
registerCleanup(shutdownLspServerManager);
|
|
427943
428142
|
registerCleanup(async () => {
|
|
427944
428143
|
const { cleanupSessionTeams: cleanupSessionTeams2 } = await Promise.resolve().then(() => (init_teamHelpers(), exports_teamHelpers));
|
|
@@ -427994,7 +428193,7 @@ import {
|
|
|
427994
428193
|
} from "fs/promises";
|
|
427995
428194
|
import { createServer as createServer9 } from "net";
|
|
427996
428195
|
import { platform as platform6 } from "os";
|
|
427997
|
-
import { join as
|
|
428196
|
+
import { join as join161 } from "path";
|
|
427998
428197
|
function log(message, ...args) {
|
|
427999
428198
|
if (LOG_FILE) {
|
|
428000
428199
|
const timestamp2 = new Date().toISOString();
|
|
@@ -428061,7 +428260,7 @@ class ChromeNativeHost {
|
|
|
428061
428260
|
try {
|
|
428062
428261
|
process.kill(pid, 0);
|
|
428063
428262
|
} catch {
|
|
428064
|
-
await unlink25(
|
|
428263
|
+
await unlink25(join161(socketDir, file2)).catch(() => {});
|
|
428065
428264
|
log(`Removed stale socket for PID ${pid}`);
|
|
428066
428265
|
}
|
|
428067
428266
|
}
|
|
@@ -429010,7 +429209,7 @@ async function handleMemories(state2) {
|
|
|
429010
429209
|
async function runProjectContextMcpServer() {
|
|
429011
429210
|
const projectRoot = process.env.THEUS_PROJECT_ROOT || process.cwd();
|
|
429012
429211
|
const state2 = new ProjectContextState(projectRoot);
|
|
429013
|
-
const server2 = new Server({ name: SERVER_NAME, version: { VERSION: "0.2.
|
|
429212
|
+
const server2 = new Server({ name: SERVER_NAME, version: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION }, { capabilities: { tools: {} } });
|
|
429014
429213
|
server2.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
429015
429214
|
tools: TOOL_DEFINITIONS.map((t) => ({
|
|
429016
429215
|
name: t.name,
|
|
@@ -429138,10 +429337,10 @@ var init_server3 = __esm(() => {
|
|
|
429138
429337
|
import { execFile as execFile8 } from "child_process";
|
|
429139
429338
|
import { existsSync as existsSync26, mkdirSync as mkdirSync12, readFileSync as readFileSync30, statSync as statSync14, unlinkSync as unlinkSync3, writeFileSync as writeFileSync10 } from "fs";
|
|
429140
429339
|
import { homedir as homedir43, tmpdir as tmpdir13 } from "os";
|
|
429141
|
-
import { join as
|
|
429340
|
+
import { join as join162 } from "path";
|
|
429142
429341
|
import { promisify as promisify6 } from "util";
|
|
429143
429342
|
function cuDir() {
|
|
429144
|
-
const dir =
|
|
429343
|
+
const dir = join162(homedir43(), ".theus", "cu");
|
|
429145
429344
|
if (!existsSync26(dir))
|
|
429146
429345
|
mkdirSync12(dir, { recursive: true });
|
|
429147
429346
|
return dir;
|
|
@@ -429189,7 +429388,7 @@ async function getScreenGeometry(force = false) {
|
|
|
429189
429388
|
return cachedGeometry;
|
|
429190
429389
|
}
|
|
429191
429390
|
async function checkPermissions() {
|
|
429192
|
-
const probe =
|
|
429391
|
+
const probe = join162(tmpdir13(), `theus-cu-probe-${process.pid}.jpg`);
|
|
429193
429392
|
const cap = await run6(SCREENCAPTURE, ["-x", "-t", "jpg", probe], { timeoutMs: 8000 });
|
|
429194
429393
|
const screenRecording = existsSync26(probe) && (() => {
|
|
429195
429394
|
try {
|
|
@@ -429218,8 +429417,8 @@ async function checkPermissions() {
|
|
|
429218
429417
|
async function captureScreenshot(opts = {}) {
|
|
429219
429418
|
const maxSide = opts.maxSide ?? 1400;
|
|
429220
429419
|
const quality = Math.min(Math.max(opts.quality ?? 72, 1), 100);
|
|
429221
|
-
const raw =
|
|
429222
|
-
const out =
|
|
429420
|
+
const raw = join162(cuDir(), `shot-${process.pid}.png`);
|
|
429421
|
+
const out = join162(cuDir(), `shot-${process.pid}.jpg`);
|
|
429223
429422
|
const capArgs = ["-x", "-t", "png", "-o"];
|
|
429224
429423
|
if (opts.displayIndex && opts.displayIndex > 0)
|
|
429225
429424
|
capArgs.push("-D", String(opts.displayIndex));
|
|
@@ -429383,8 +429582,8 @@ async function ensureScrollHelper() {
|
|
|
429383
429582
|
return scrollBinPromise;
|
|
429384
429583
|
scrollBinPromise = (async () => {
|
|
429385
429584
|
if (!existsSync26(SWIFTC) && SWIFTC === "swiftc") {}
|
|
429386
|
-
const src =
|
|
429387
|
-
const bin =
|
|
429585
|
+
const src = join162(cuDir(), "scroll.swift");
|
|
429586
|
+
const bin = join162(cuDir(), "theus-cu-scroll");
|
|
429388
429587
|
if (existsSync26(bin))
|
|
429389
429588
|
return bin;
|
|
429390
429589
|
try {
|
|
@@ -429715,7 +429914,7 @@ __export(exports_selftest, {
|
|
|
429715
429914
|
runComputerUseSelfTest: () => runComputerUseSelfTest
|
|
429716
429915
|
});
|
|
429717
429916
|
import { existsSync as existsSync27, writeFileSync as writeFileSync11 } from "fs";
|
|
429718
|
-
import { join as
|
|
429917
|
+
import { join as join163 } from "path";
|
|
429719
429918
|
import { homedir as homedir44 } from "os";
|
|
429720
429919
|
async function runComputerUseSelfTest() {
|
|
429721
429920
|
let pass = 0;
|
|
@@ -429767,7 +429966,7 @@ Geometr\xEDa y captura:`);
|
|
|
429767
429966
|
let captureOk = false;
|
|
429768
429967
|
try {
|
|
429769
429968
|
const shot = await captureScreenshot();
|
|
429770
|
-
const outPath =
|
|
429969
|
+
const outPath = join163(homedir44(), ".theus", "cu", "selftest-shot.jpg");
|
|
429771
429970
|
writeFileSync11(outPath, Buffer.from(shot.base64, "base64"));
|
|
429772
429971
|
ok2(`Captura ${shot.width}\xD7${shot.height} px, ${Math.round(shot.base64.length * 0.75 / 1024)} KB \u2192 ${outPath}`);
|
|
429773
429972
|
captureOk = true;
|
|
@@ -430613,7 +430812,7 @@ var init_executor = __esm(() => {
|
|
|
430613
430812
|
});
|
|
430614
430813
|
|
|
430615
430814
|
// services/titanFleet/tokenStore.ts
|
|
430616
|
-
import { constants as
|
|
430815
|
+
import { constants as constants6 } from "fs";
|
|
430617
430816
|
import { randomUUID as randomUUID38 } from "crypto";
|
|
430618
430817
|
import {
|
|
430619
430818
|
chmod as chmod13,
|
|
@@ -430669,7 +430868,7 @@ async function saveFleetCredentials(value, path19 = defaultFleetCredentialsPath(
|
|
|
430669
430868
|
await chmod13(directory, 448);
|
|
430670
430869
|
await rejectSymlink(path19);
|
|
430671
430870
|
const temp = `${path19}.tmp-${process.pid}-${randomUUID38()}`;
|
|
430672
|
-
const flags =
|
|
430871
|
+
const flags = constants6.O_WRONLY | constants6.O_CREAT | constants6.O_EXCL | (constants6.O_NOFOLLOW ?? 0);
|
|
430673
430872
|
const handle2 = await open23(temp, flags, 384);
|
|
430674
430873
|
try {
|
|
430675
430874
|
await handle2.writeFile(`${JSON.stringify(parsed, null, 2)}
|
|
@@ -430701,7 +430900,7 @@ var init_tokenStore = __esm(() => {
|
|
|
430701
430900
|
});
|
|
430702
430901
|
|
|
430703
430902
|
// services/titanFleet/outbox.ts
|
|
430704
|
-
import { constants as
|
|
430903
|
+
import { constants as constants7 } from "fs";
|
|
430705
430904
|
import { createHash as createHash33, randomUUID as randomUUID39 } from "crypto";
|
|
430706
430905
|
import {
|
|
430707
430906
|
chmod as chmod14,
|
|
@@ -430837,7 +431036,7 @@ async function writeRecords(path19, records) {
|
|
|
430837
431036
|
await chmod14(directory, 448);
|
|
430838
431037
|
await rejectSymlink2(path19);
|
|
430839
431038
|
const temp = `${path19}.tmp-${process.pid}-${randomUUID39()}`;
|
|
430840
|
-
const handle2 = await open24(temp,
|
|
431039
|
+
const handle2 = await open24(temp, constants7.O_WRONLY | constants7.O_CREAT | constants7.O_EXCL | (constants7.O_NOFOLLOW ?? 0), 384);
|
|
430841
431040
|
try {
|
|
430842
431041
|
await handle2.writeFile(serialized, "utf8");
|
|
430843
431042
|
await handle2.sync();
|
|
@@ -430848,7 +431047,7 @@ async function writeRecords(path19, records) {
|
|
|
430848
431047
|
await chmod14(temp, 384);
|
|
430849
431048
|
await rename11(temp, path19);
|
|
430850
431049
|
await chmod14(path19, 384);
|
|
430851
|
-
const directoryHandle = await open24(directory,
|
|
431050
|
+
const directoryHandle = await open24(directory, constants7.O_RDONLY);
|
|
430852
431051
|
try {
|
|
430853
431052
|
await directoryHandle.sync();
|
|
430854
431053
|
} finally {
|
|
@@ -431687,7 +431886,7 @@ async function runTitanFleetWorker(args) {
|
|
|
431687
431886
|
max_concurrency: maxConcurrency,
|
|
431688
431887
|
runtime: {
|
|
431689
431888
|
name: "theus-cli",
|
|
431690
|
-
version: { VERSION: "0.2.
|
|
431889
|
+
version: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
431691
431890
|
}
|
|
431692
431891
|
});
|
|
431693
431892
|
const client2 = new TitanFleetClient({
|
|
@@ -432409,9 +432608,9 @@ var init_titan_fleet_run = __esm(() => {
|
|
|
432409
432608
|
|
|
432410
432609
|
// utils/cronTasksLock.ts
|
|
432411
432610
|
import { mkdir as mkdir53, readFile as readFile65, unlink as unlink28, writeFile as writeFile51 } from "fs/promises";
|
|
432412
|
-
import { dirname as dirname67, join as
|
|
432611
|
+
import { dirname as dirname67, join as join164 } from "path";
|
|
432413
432612
|
function getLockPath(dir) {
|
|
432414
|
-
return
|
|
432613
|
+
return join164(dir ?? getProjectRoot(), LOCK_FILE_REL);
|
|
432415
432614
|
}
|
|
432416
432615
|
async function readLock(dir) {
|
|
432417
432616
|
let raw;
|
|
@@ -432517,7 +432716,7 @@ var init_cronTasksLock = __esm(() => {
|
|
|
432517
432716
|
init_genericProcessUtils();
|
|
432518
432717
|
init_json();
|
|
432519
432718
|
init_slowOperations();
|
|
432520
|
-
LOCK_FILE_REL =
|
|
432719
|
+
LOCK_FILE_REL = join164(".theus", "scheduled_tasks.lock");
|
|
432521
432720
|
schedulerLockSchema = lazySchema(() => exports_external.object({
|
|
432522
432721
|
sessionId: exports_external.string(),
|
|
432523
432722
|
pid: exports_external.number(),
|
|
@@ -432825,10 +433024,10 @@ import {
|
|
|
432825
433024
|
writeFileSync as writeFileSync12
|
|
432826
433025
|
} from "fs";
|
|
432827
433026
|
import { homedir as homedir47 } from "os";
|
|
432828
|
-
import { dirname as dirname68, join as
|
|
433027
|
+
import { dirname as dirname68, join as join165 } from "path";
|
|
432829
433028
|
import { fileURLToPath as fileURLToPath7 } from "url";
|
|
432830
433029
|
function projectsConfigPath() {
|
|
432831
|
-
return
|
|
433030
|
+
return join165(homedir47(), ".theus", "daemon", "projects.json");
|
|
432832
433031
|
}
|
|
432833
433032
|
function readEnabledProjects() {
|
|
432834
433033
|
let raw;
|
|
@@ -432847,17 +433046,17 @@ function readEnabledProjects() {
|
|
|
432847
433046
|
return list3.filter((p) => p && typeof p.dir === "string" && p.enabled !== false);
|
|
432848
433047
|
}
|
|
432849
433048
|
function daemonDir2() {
|
|
432850
|
-
return
|
|
433049
|
+
return join165(homedir47(), ".theus", "daemon");
|
|
432851
433050
|
}
|
|
432852
433051
|
function daemonLogPath() {
|
|
432853
|
-
return
|
|
433052
|
+
return join165(daemonDir2(), "daemon.log");
|
|
432854
433053
|
}
|
|
432855
433054
|
function resolveWorkerBin() {
|
|
432856
433055
|
const override = process.env.THEUS_DAEMON_WORKER_BIN;
|
|
432857
433056
|
if (typeof override === "string" && override.length > 0)
|
|
432858
433057
|
return override;
|
|
432859
433058
|
const here = dirname68(fileURLToPath7(import.meta.url));
|
|
432860
|
-
return
|
|
433059
|
+
return join165(here, "..", "bin", "theus");
|
|
432861
433060
|
}
|
|
432862
433061
|
function turnTimeoutMs() {
|
|
432863
433062
|
const raw = process.env.THEUS_DAEMON_TURN_TIMEOUT_MS;
|
|
@@ -432890,10 +433089,10 @@ function logDaemonLine(line) {
|
|
|
432890
433089
|
}
|
|
432891
433090
|
function writeRunHistory(record3) {
|
|
432892
433091
|
try {
|
|
432893
|
-
const dir =
|
|
433092
|
+
const dir = join165(daemonDir2(), "runs", record3.taskId);
|
|
432894
433093
|
mkdirSync13(dir, { recursive: true });
|
|
432895
433094
|
const stamp2 = record3.startedAt.replace(/:/g, "-");
|
|
432896
|
-
writeFileSync12(
|
|
433095
|
+
writeFileSync12(join165(dir, `${stamp2}.json`), JSON.stringify(record3, null, 2), "utf8");
|
|
432897
433096
|
pruneRunHistory(record3.taskId);
|
|
432898
433097
|
} catch (e) {
|
|
432899
433098
|
logDaemonLine(`[daemon:cron] ERROR guardando historial task=${record3.taskId}: ${e?.message}`);
|
|
@@ -432904,13 +433103,13 @@ function pruneRunHistory(taskId) {
|
|
|
432904
433103
|
const raw = process.env.THEUS_DAEMON_RUNS_KEEP;
|
|
432905
433104
|
const parsed = raw ? Number.parseInt(raw, 10) : NaN;
|
|
432906
433105
|
const keep = Number.isInteger(parsed) && parsed > 0 ? parsed : 50;
|
|
432907
|
-
const dir =
|
|
433106
|
+
const dir = join165(daemonDir2(), "runs", taskId);
|
|
432908
433107
|
const files2 = readdirSync5(dir).filter((f) => f.endsWith(".json")).sort();
|
|
432909
433108
|
if (files2.length <= keep)
|
|
432910
433109
|
return;
|
|
432911
433110
|
for (const f of files2.slice(0, files2.length - keep)) {
|
|
432912
433111
|
try {
|
|
432913
|
-
unlinkSync4(
|
|
433112
|
+
unlinkSync4(join165(dir, f));
|
|
432914
433113
|
} catch {}
|
|
432915
433114
|
}
|
|
432916
433115
|
} catch {}
|
|
@@ -433100,15 +433299,15 @@ import {
|
|
|
433100
433299
|
writeFileSync as writeFileSync13
|
|
433101
433300
|
} from "fs";
|
|
433102
433301
|
import { homedir as homedir48 } from "os";
|
|
433103
|
-
import { dirname as dirname69, join as
|
|
433302
|
+
import { dirname as dirname69, join as join166 } from "path";
|
|
433104
433303
|
function daemonDir3() {
|
|
433105
|
-
return
|
|
433304
|
+
return join166(homedir48(), ".theus", "daemon");
|
|
433106
433305
|
}
|
|
433107
433306
|
function pidFilePath() {
|
|
433108
|
-
return
|
|
433307
|
+
return join166(daemonDir3(), "theus-daemon.pid");
|
|
433109
433308
|
}
|
|
433110
433309
|
function logFilePath() {
|
|
433111
|
-
return
|
|
433310
|
+
return join166(daemonDir3(), "daemon.log");
|
|
433112
433311
|
}
|
|
433113
433312
|
function ensureDaemonDir() {
|
|
433114
433313
|
mkdirSync14(daemonDir3(), { recursive: true });
|
|
@@ -433206,7 +433405,7 @@ function resolveTheusBin() {
|
|
|
433206
433405
|
return "theus";
|
|
433207
433406
|
}
|
|
433208
433407
|
function macosServiceSpec() {
|
|
433209
|
-
const path19 =
|
|
433408
|
+
const path19 = join166(homedir48(), "Library", "LaunchAgents", "pe.theus.daemon.plist");
|
|
433210
433409
|
const bin = resolveTheusBin();
|
|
433211
433410
|
const logDir = daemonDir3();
|
|
433212
433411
|
const content = `<?xml version="1.0" encoding="UTF-8"?>
|
|
@@ -433233,9 +433432,9 @@ function macosServiceSpec() {
|
|
|
433233
433432
|
<key>KeepAlive</key>
|
|
433234
433433
|
<true/>
|
|
433235
433434
|
<key>StandardOutPath</key>
|
|
433236
|
-
<string>${
|
|
433435
|
+
<string>${join166(logDir, "launchd.out.log")}</string>
|
|
433237
433436
|
<key>StandardErrorPath</key>
|
|
433238
|
-
<string>${
|
|
433437
|
+
<string>${join166(logDir, "launchd.err.log")}</string>
|
|
433239
433438
|
</dict>
|
|
433240
433439
|
</plist>
|
|
433241
433440
|
`;
|
|
@@ -433250,7 +433449,7 @@ function macosServiceSpec() {
|
|
|
433250
433449
|
};
|
|
433251
433450
|
}
|
|
433252
433451
|
function linuxServiceSpec() {
|
|
433253
|
-
const path19 =
|
|
433452
|
+
const path19 = join166(homedir48(), ".config", "systemd", "user", "theus-daemon.service");
|
|
433254
433453
|
const bin = resolveTheusBin();
|
|
433255
433454
|
const content = `[Unit]
|
|
433256
433455
|
Description=Theus daemon (cron/agent supervisor)
|
|
@@ -433578,7 +433777,7 @@ function createBridgeLogger(options2) {
|
|
|
433578
433777
|
connectUrl = buildBridgeConnectUrl(environmentId, cachedIngressUrl);
|
|
433579
433778
|
regenerateQr(connectUrl);
|
|
433580
433779
|
if (verbose) {
|
|
433581
|
-
write(source_default.dim(`Remote Control`) + ` v${{ VERSION: "0.2.
|
|
433780
|
+
write(source_default.dim(`Remote Control`) + ` v${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}
|
|
433582
433781
|
`);
|
|
433583
433782
|
}
|
|
433584
433783
|
if (verbose) {
|
|
@@ -433986,7 +434185,7 @@ var init_pollConfig = __esm(() => {
|
|
|
433986
434185
|
import { spawn as spawn13 } from "child_process";
|
|
433987
434186
|
import { createWriteStream as createWriteStream4 } from "fs";
|
|
433988
434187
|
import { tmpdir as tmpdir14 } from "os";
|
|
433989
|
-
import { dirname as dirname70, join as
|
|
434188
|
+
import { dirname as dirname70, join as join167 } from "path";
|
|
433990
434189
|
import { createInterface } from "readline";
|
|
433991
434190
|
function safeFilenameId(id2) {
|
|
433992
434191
|
return id2.replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
@@ -434119,12 +434318,12 @@ function createSessionSpawner(deps) {
|
|
|
434119
434318
|
debugFile = `${deps.debugFile}-${safeId}`;
|
|
434120
434319
|
}
|
|
434121
434320
|
} else if (deps.verbose || false) {
|
|
434122
|
-
debugFile =
|
|
434321
|
+
debugFile = join167(tmpdir14(), "theus", `bridge-session-${safeId}.log`);
|
|
434123
434322
|
}
|
|
434124
434323
|
let transcriptStream = null;
|
|
434125
434324
|
let transcriptPath;
|
|
434126
434325
|
if (deps.debugFile) {
|
|
434127
|
-
transcriptPath =
|
|
434326
|
+
transcriptPath = join167(dirname70(deps.debugFile), `bridge-transcript-${safeId}.jsonl`);
|
|
434128
434327
|
transcriptStream = createWriteStream4(transcriptPath, { flags: "a" });
|
|
434129
434328
|
transcriptStream.on("error", (err2) => {
|
|
434130
434329
|
deps.onDebug(`[bridge:session] Transcript write error: ${err2.message}`);
|
|
@@ -434398,9 +434597,9 @@ __export(exports_bridgePointer, {
|
|
|
434398
434597
|
BRIDGE_POINTER_TTL_MS: () => BRIDGE_POINTER_TTL_MS
|
|
434399
434598
|
});
|
|
434400
434599
|
import { mkdir as mkdir54, readFile as readFile66, stat as stat56, unlink as unlink29, writeFile as writeFile52 } from "fs/promises";
|
|
434401
|
-
import { dirname as dirname71, join as
|
|
434600
|
+
import { dirname as dirname71, join as join168 } from "path";
|
|
434402
434601
|
function getBridgePointerPath(dir) {
|
|
434403
|
-
return
|
|
434602
|
+
return join168(getProjectsDir(), sanitizePath2(dir), "bridge-pointer.json");
|
|
434404
434603
|
}
|
|
434405
434604
|
async function writeBridgePointer(dir, pointer) {
|
|
434406
434605
|
const path19 = getBridgePointerPath(dir);
|
|
@@ -434502,12 +434701,12 @@ var init_bridgePointer = __esm(() => {
|
|
|
434502
434701
|
});
|
|
434503
434702
|
|
|
434504
434703
|
// utils/errorLogSink.ts
|
|
434505
|
-
import { dirname as dirname72, join as
|
|
434704
|
+
import { dirname as dirname72, join as join169 } from "path";
|
|
434506
434705
|
function getErrorsPath() {
|
|
434507
|
-
return
|
|
434706
|
+
return join169(CACHE_PATHS.errors(), DATE + ".jsonl");
|
|
434508
434707
|
}
|
|
434509
434708
|
function getMCPLogsPath(serverName) {
|
|
434510
|
-
return
|
|
434709
|
+
return join169(CACHE_PATHS.mcpLogs(serverName), DATE + ".jsonl");
|
|
434511
434710
|
}
|
|
434512
434711
|
function createJsonlWriter(options2) {
|
|
434513
434712
|
const writer = createBufferedWriter(options2);
|
|
@@ -434551,7 +434750,7 @@ function appendToLog(path19, message) {
|
|
|
434551
434750
|
cwd: getFsImplementation().cwd(),
|
|
434552
434751
|
userType: "external",
|
|
434553
434752
|
sessionId: getSessionId(),
|
|
434554
|
-
version: { VERSION: "0.2.
|
|
434753
|
+
version: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
434555
434754
|
};
|
|
434556
434755
|
getLogWriter(path19).write(messageWithTimestamp);
|
|
434557
434756
|
}
|
|
@@ -434663,7 +434862,7 @@ __export(exports_bridgeMain, {
|
|
|
434663
434862
|
});
|
|
434664
434863
|
import { randomUUID as randomUUID42 } from "crypto";
|
|
434665
434864
|
import { hostname as hostname4, tmpdir as tmpdir15 } from "os";
|
|
434666
|
-
import { basename as basename51, join as
|
|
434865
|
+
import { basename as basename51, join as join170, resolve as resolve57 } from "path";
|
|
434667
434866
|
async function isMultiSessionSpawnEnabled() {
|
|
434668
434867
|
return checkGate_CACHED_OR_BLOCKING("theus_ccr_bridge_multi_session");
|
|
434669
434868
|
}
|
|
@@ -435176,7 +435375,7 @@ async function runBridgeLoop(config3, environmentId, environmentSecret, api2, sp
|
|
|
435176
435375
|
sessionDebugFile = `${config3.debugFile}-${safeId}`;
|
|
435177
435376
|
}
|
|
435178
435377
|
} else if (config3.verbose || false) {
|
|
435179
|
-
sessionDebugFile =
|
|
435378
|
+
sessionDebugFile = join170(tmpdir15(), "theus", `bridge-session-${safeId}.log`);
|
|
435180
435379
|
}
|
|
435181
435380
|
if (sessionDebugFile) {
|
|
435182
435381
|
logger.logVerbose(`Debug log: ${sessionDebugFile}`);
|
|
@@ -435812,7 +436011,7 @@ Spawn mode for this project:
|
|
|
435812
436011
|
const api2 = createBridgeApiClient({
|
|
435813
436012
|
baseUrl,
|
|
435814
436013
|
getAccessToken: getBridgeAccessToken2,
|
|
435815
|
-
runnerVersion: { VERSION: "0.2.
|
|
436014
|
+
runnerVersion: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
435816
436015
|
onDebug: logForDebugging,
|
|
435817
436016
|
onAuth401: handleOAuth401Error2,
|
|
435818
436017
|
getTrustedDeviceToken
|
|
@@ -436050,7 +436249,7 @@ async function runBridgeHeadless(opts, signal) {
|
|
|
436050
436249
|
const api2 = createBridgeApiClient({
|
|
436051
436250
|
baseUrl,
|
|
436052
436251
|
getAccessToken: opts.getAccessToken,
|
|
436053
|
-
runnerVersion: { VERSION: "0.2.
|
|
436252
|
+
runnerVersion: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
436054
436253
|
onDebug: log2,
|
|
436055
436254
|
onAuth401: opts.onAuth401,
|
|
436056
436255
|
getTrustedDeviceToken
|
|
@@ -439342,7 +439541,7 @@ function buildSystemInitMessage(inputs) {
|
|
|
439342
439541
|
slash_commands: inputs.commands.filter((c5) => c5.userInvocable !== false).map((c5) => c5.name),
|
|
439343
439542
|
apiKeySource: getTheusApiKeyWithSource().source,
|
|
439344
439543
|
betas: getSdkBetas(),
|
|
439345
|
-
theus_code_version: { VERSION: "0.2.
|
|
439544
|
+
theus_code_version: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
439346
439545
|
output_style: outputStyle2,
|
|
439347
439546
|
agents: inputs.agents.map((agent) => agent.agentType),
|
|
439348
439547
|
skills: inputs.skills.filter((s) => s.userInvocable !== false).map((skill) => skill.name),
|
|
@@ -439382,8 +439581,8 @@ async function getEnvLessBridgeConfig() {
|
|
|
439382
439581
|
}
|
|
439383
439582
|
async function checkEnvLessBridgeMinVersion() {
|
|
439384
439583
|
const cfg = await getEnvLessBridgeConfig();
|
|
439385
|
-
if (cfg.min_version && lt({ VERSION: "0.2.
|
|
439386
|
-
return `Your version of Theus (${{ VERSION: "0.2.
|
|
439584
|
+
if (cfg.min_version && lt({ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, cfg.min_version)) {
|
|
439585
|
+
return `Your version of Theus (${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}) is too old for Remote Control.
|
|
439387
439586
|
Version ${cfg.min_version} or higher is required. Run \`theus update\` to update.`;
|
|
439388
439587
|
}
|
|
439389
439588
|
return null;
|
|
@@ -441707,7 +441906,7 @@ async function initBridgeCore(params) {
|
|
|
441707
441906
|
const rawApi = createBridgeApiClient({
|
|
441708
441907
|
baseUrl,
|
|
441709
441908
|
getAccessToken,
|
|
441710
|
-
runnerVersion: { VERSION: "0.2.
|
|
441909
|
+
runnerVersion: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
441711
441910
|
onDebug: logForDebugging,
|
|
441712
441911
|
onAuth401,
|
|
441713
441912
|
getTrustedDeviceToken
|
|
@@ -443541,7 +443740,7 @@ __export(exports_inboundAttachments, {
|
|
|
443541
443740
|
});
|
|
443542
443741
|
import { randomUUID as randomUUID47 } from "crypto";
|
|
443543
443742
|
import { mkdir as mkdir55, writeFile as writeFile53 } from "fs/promises";
|
|
443544
|
-
import { basename as basename52, join as
|
|
443743
|
+
import { basename as basename52, join as join171 } from "path";
|
|
443545
443744
|
function debug2(msg) {
|
|
443546
443745
|
logForDebugging(`[bridge:inbound-attach] ${msg}`);
|
|
443547
443746
|
}
|
|
@@ -443557,7 +443756,7 @@ function sanitizeFileName(name) {
|
|
|
443557
443756
|
return base2 || "attachment";
|
|
443558
443757
|
}
|
|
443559
443758
|
function uploadsDir() {
|
|
443560
|
-
return
|
|
443759
|
+
return join171(getTheusConfigHomeDir(), "uploads", getSessionId());
|
|
443561
443760
|
}
|
|
443562
443761
|
async function resolveOne(att) {
|
|
443563
443762
|
const token = getBridgeAccessToken();
|
|
@@ -443586,7 +443785,7 @@ async function resolveOne(att) {
|
|
|
443586
443785
|
const safeName = sanitizeFileName(att.file_name);
|
|
443587
443786
|
const prefix = (att.file_uuid.slice(0, 8) || randomUUID47().slice(0, 8)).replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
443588
443787
|
const dir = uploadsDir();
|
|
443589
|
-
const outPath =
|
|
443788
|
+
const outPath = join171(dir, `${prefix}-${safeName}`);
|
|
443590
443789
|
try {
|
|
443591
443790
|
await mkdir55(dir, { recursive: true });
|
|
443592
443791
|
await writeFile53(outPath, data);
|
|
@@ -450446,7 +450645,7 @@ var init_ShowInIDEPrompt = __esm(() => {
|
|
|
450446
450645
|
|
|
450447
450646
|
// components/permissions/FilePermissionDialog/permissionOptions.tsx
|
|
450448
450647
|
import { homedir as homedir49 } from "os";
|
|
450449
|
-
import { basename as basename56, join as
|
|
450648
|
+
import { basename as basename56, join as join172, sep as sep34 } from "path";
|
|
450450
450649
|
function isInTheusFolder(filePath) {
|
|
450451
450650
|
const absolutePath = expandPath(filePath);
|
|
450452
450651
|
const theusFolderPath = expandPath(`${getOriginalCwd()}/.theus`);
|
|
@@ -450456,7 +450655,7 @@ function isInTheusFolder(filePath) {
|
|
|
450456
450655
|
}
|
|
450457
450656
|
function isInGlobalTheusFolder(filePath) {
|
|
450458
450657
|
const absolutePath = expandPath(filePath);
|
|
450459
|
-
const globalTheusFolderPath =
|
|
450658
|
+
const globalTheusFolderPath = join172(homedir49(), ".theus");
|
|
450460
450659
|
const normalizedAbsolutePath = normalizeCaseForComparison(absolutePath);
|
|
450461
450660
|
const normalizedGlobalTheusFolderPath = normalizeCaseForComparison(globalTheusFolderPath);
|
|
450462
450661
|
return normalizedAbsolutePath.startsWith(normalizedGlobalTheusFolderPath + sep34.toLowerCase()) || normalizedAbsolutePath.startsWith(normalizedGlobalTheusFolderPath + "/");
|
|
@@ -458348,7 +458547,7 @@ var init_useVoiceEnabled = __esm(() => {
|
|
|
458348
458547
|
function getSemverPart(version3) {
|
|
458349
458548
|
return `${import_semver11.major(version3, { loose: true })}.${import_semver11.minor(version3, { loose: true })}.${import_semver11.patch(version3, { loose: true })}`;
|
|
458350
458549
|
}
|
|
458351
|
-
function useUpdateNotification(updatedVersion, initialVersion = { VERSION: "0.2.
|
|
458550
|
+
function useUpdateNotification(updatedVersion, initialVersion = { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION) {
|
|
458352
458551
|
const [lastNotifiedSemver, setLastNotifiedSemver] = import_react235.useState(() => getSemverPart(initialVersion));
|
|
458353
458552
|
if (!updatedVersion) {
|
|
458354
458553
|
return null;
|
|
@@ -458388,7 +458587,7 @@ function AutoUpdater({
|
|
|
458388
458587
|
return;
|
|
458389
458588
|
}
|
|
458390
458589
|
if (false) {}
|
|
458391
|
-
const currentVersion = { VERSION: "0.2.
|
|
458590
|
+
const currentVersion = { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
|
|
458392
458591
|
const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
|
|
458393
458592
|
let latestVersion = await getLatestVersion(channel2);
|
|
458394
458593
|
const isDisabled2 = isAutoUpdaterDisabled();
|
|
@@ -458523,7 +458722,7 @@ function AutoUpdater({
|
|
|
458523
458722
|
" ",
|
|
458524
458723
|
/* @__PURE__ */ jsx_runtime415.jsx(ThemedText, {
|
|
458525
458724
|
bold: true,
|
|
458526
|
-
children: hasLocalInstall ? `cd ~/.theus/local && npm update ${{ VERSION: "0.2.
|
|
458725
|
+
children: hasLocalInstall ? `cd ~/.theus/local && npm update ${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}` : `npm i -g ${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}`
|
|
458527
458726
|
})
|
|
458528
458727
|
]
|
|
458529
458728
|
})
|
|
@@ -458600,12 +458799,12 @@ function NativeAutoUpdater({
|
|
|
458600
458799
|
logEvent("theus_native_auto_updater_start", {});
|
|
458601
458800
|
try {
|
|
458602
458801
|
const maxVersion = await getMaxVersion();
|
|
458603
|
-
if (maxVersion && gt({ VERSION: "0.2.
|
|
458802
|
+
if (maxVersion && gt({ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, maxVersion)) {
|
|
458604
458803
|
const msg = await getMaxVersionMessage();
|
|
458605
458804
|
setMaxVersionIssue(msg ?? "affects your version");
|
|
458606
458805
|
}
|
|
458607
458806
|
const result = await installLatest(channel2);
|
|
458608
|
-
const currentVersion = { VERSION: "0.2.
|
|
458807
|
+
const currentVersion = { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
|
|
458609
458808
|
const latencyMs = Date.now() - startTime2;
|
|
458610
458809
|
if (result.lockFailed) {
|
|
458611
458810
|
logEvent("theus_native_auto_updater_lock_contention", {
|
|
@@ -458742,17 +458941,17 @@ function PackageManagerAutoUpdater(t0) {
|
|
|
458742
458941
|
const maxVersion = await getMaxVersion();
|
|
458743
458942
|
if (maxVersion && latest && gt(latest, maxVersion)) {
|
|
458744
458943
|
logForDebugging(`PackageManagerAutoUpdater: maxVersion ${maxVersion} is set, capping update from ${latest} to ${maxVersion}`);
|
|
458745
|
-
if (gte({ VERSION: "0.2.
|
|
458746
|
-
logForDebugging(`PackageManagerAutoUpdater: current version ${{ VERSION: "0.2.
|
|
458944
|
+
if (gte({ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, maxVersion)) {
|
|
458945
|
+
logForDebugging(`PackageManagerAutoUpdater: current version ${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} is already at or above maxVersion ${maxVersion}, skipping update`);
|
|
458747
458946
|
setUpdateAvailable(false);
|
|
458748
458947
|
return;
|
|
458749
458948
|
}
|
|
458750
458949
|
latest = maxVersion;
|
|
458751
458950
|
}
|
|
458752
|
-
const hasUpdate = latest && !gte({ VERSION: "0.2.
|
|
458951
|
+
const hasUpdate = latest && !gte({ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, latest) && !shouldSkipVersion(latest);
|
|
458753
458952
|
setUpdateAvailable(!!hasUpdate);
|
|
458754
458953
|
if (hasUpdate) {
|
|
458755
|
-
logForDebugging(`PackageManagerAutoUpdater: Update available ${{ VERSION: "0.2.
|
|
458954
|
+
logForDebugging(`PackageManagerAutoUpdater: Update available ${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} -> ${latest}`);
|
|
458756
458955
|
}
|
|
458757
458956
|
};
|
|
458758
458957
|
$2[0] = t1;
|
|
@@ -458786,7 +458985,7 @@ function PackageManagerAutoUpdater(t0) {
|
|
|
458786
458985
|
wrap: "truncate",
|
|
458787
458986
|
children: [
|
|
458788
458987
|
"versi\xF3n actual: ",
|
|
458789
|
-
{ VERSION: "0.2.
|
|
458988
|
+
{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
458790
458989
|
]
|
|
458791
458990
|
});
|
|
458792
458991
|
$2[3] = verbose;
|
|
@@ -466649,7 +466848,7 @@ function buildStatusLineCommandInput(permissionMode2, exceeds200kTokens, setting
|
|
|
466649
466848
|
project_dir: getOriginalCwd(),
|
|
466650
466849
|
added_dirs: addedDirs
|
|
466651
466850
|
},
|
|
466652
|
-
version: { VERSION: "0.2.
|
|
466851
|
+
version: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
466653
466852
|
output_style: {
|
|
466654
466853
|
name: outputStyleName
|
|
466655
466854
|
},
|
|
@@ -472637,9 +472836,9 @@ function initSkillImprovement() {
|
|
|
472637
472836
|
async function applySkillImprovement(skillName, updates) {
|
|
472638
472837
|
if (!skillName)
|
|
472639
472838
|
return;
|
|
472640
|
-
const { join:
|
|
472839
|
+
const { join: join173 } = await import("path");
|
|
472641
472840
|
const fs5 = await import("fs/promises");
|
|
472642
|
-
const filePath =
|
|
472841
|
+
const filePath = join173(getCwd(), ".theus", "skills", skillName, "SKILL.md");
|
|
472643
472842
|
let currentContent;
|
|
472644
472843
|
try {
|
|
472645
472844
|
currentContent = await fs5.readFile(filePath, "utf-8");
|
|
@@ -472791,7 +472990,7 @@ function useMoreRight(_args) {
|
|
|
472791
472990
|
}
|
|
472792
472991
|
|
|
472793
472992
|
// utils/cleanup.ts
|
|
472794
|
-
import { join as
|
|
472993
|
+
import { join as join173 } from "path";
|
|
472795
472994
|
function getCutoffDate() {
|
|
472796
472995
|
const settings = getSettings_DEPRECATED() || {};
|
|
472797
472996
|
const cleanupPeriodDays = settings.cleanupPeriodDays ?? DEFAULT_CLEANUP_PERIOD_DAYS;
|
|
@@ -472816,7 +473015,7 @@ async function cleanupOldFilesInDirectory(dirPath, cutoffDate, isMessagePath) {
|
|
|
472816
473015
|
try {
|
|
472817
473016
|
const timestamp2 = convertFileNameToDate(file2.name);
|
|
472818
473017
|
if (timestamp2 < cutoffDate) {
|
|
472819
|
-
await getFsImplementation().unlink(
|
|
473018
|
+
await getFsImplementation().unlink(join173(dirPath, file2.name));
|
|
472820
473019
|
if (isMessagePath) {
|
|
472821
473020
|
result.messages++;
|
|
472822
473021
|
} else {
|
|
@@ -472847,7 +473046,7 @@ async function cleanupOldMessageFiles() {
|
|
|
472847
473046
|
} catch {
|
|
472848
473047
|
return result;
|
|
472849
473048
|
}
|
|
472850
|
-
const mcpLogDirs = dirents.filter((dirent) => dirent.isDirectory() && dirent.name.startsWith("mcp-logs-")).map((dirent) =>
|
|
473049
|
+
const mcpLogDirs = dirents.filter((dirent) => dirent.isDirectory() && dirent.name.startsWith("mcp-logs-")).map((dirent) => join173(baseCachePath, dirent.name));
|
|
472851
473050
|
for (const mcpLogDir of mcpLogDirs) {
|
|
472852
473051
|
result = addCleanupResults(result, await cleanupOldFilesInDirectory(mcpLogDir, cutoffDate, true));
|
|
472853
473052
|
await tryRmdir(mcpLogDir, fsImpl);
|
|
@@ -472886,7 +473085,7 @@ async function cleanupOldSessionFiles() {
|
|
|
472886
473085
|
for (const projectDirent of projectDirents) {
|
|
472887
473086
|
if (!projectDirent.isDirectory())
|
|
472888
473087
|
continue;
|
|
472889
|
-
const projectDir =
|
|
473088
|
+
const projectDir = join173(projectsDir, projectDirent.name);
|
|
472890
473089
|
let entries;
|
|
472891
473090
|
try {
|
|
472892
473091
|
entries = await fsImpl.readdir(projectDir);
|
|
@@ -472900,15 +473099,15 @@ async function cleanupOldSessionFiles() {
|
|
|
472900
473099
|
continue;
|
|
472901
473100
|
}
|
|
472902
473101
|
try {
|
|
472903
|
-
if (await unlinkIfOld(
|
|
473102
|
+
if (await unlinkIfOld(join173(projectDir, entry.name), cutoffDate, fsImpl)) {
|
|
472904
473103
|
result.messages++;
|
|
472905
473104
|
}
|
|
472906
473105
|
} catch {
|
|
472907
473106
|
result.errors++;
|
|
472908
473107
|
}
|
|
472909
473108
|
} else if (entry.isDirectory()) {
|
|
472910
|
-
const sessionDir =
|
|
472911
|
-
const toolResultsDir =
|
|
473109
|
+
const sessionDir = join173(projectDir, entry.name);
|
|
473110
|
+
const toolResultsDir = join173(sessionDir, TOOL_RESULTS_SUBDIR);
|
|
472912
473111
|
let toolDirs;
|
|
472913
473112
|
try {
|
|
472914
473113
|
toolDirs = await fsImpl.readdir(toolResultsDir);
|
|
@@ -472919,14 +473118,14 @@ async function cleanupOldSessionFiles() {
|
|
|
472919
473118
|
for (const toolEntry of toolDirs) {
|
|
472920
473119
|
if (toolEntry.isFile()) {
|
|
472921
473120
|
try {
|
|
472922
|
-
if (await unlinkIfOld(
|
|
473121
|
+
if (await unlinkIfOld(join173(toolResultsDir, toolEntry.name), cutoffDate, fsImpl)) {
|
|
472923
473122
|
result.messages++;
|
|
472924
473123
|
}
|
|
472925
473124
|
} catch {
|
|
472926
473125
|
result.errors++;
|
|
472927
473126
|
}
|
|
472928
473127
|
} else if (toolEntry.isDirectory()) {
|
|
472929
|
-
const toolDirPath =
|
|
473128
|
+
const toolDirPath = join173(toolResultsDir, toolEntry.name);
|
|
472930
473129
|
let toolFiles;
|
|
472931
473130
|
try {
|
|
472932
473131
|
toolFiles = await fsImpl.readdir(toolDirPath);
|
|
@@ -472937,7 +473136,7 @@ async function cleanupOldSessionFiles() {
|
|
|
472937
473136
|
if (!tf.isFile())
|
|
472938
473137
|
continue;
|
|
472939
473138
|
try {
|
|
472940
|
-
if (await unlinkIfOld(
|
|
473139
|
+
if (await unlinkIfOld(join173(toolDirPath, tf.name), cutoffDate, fsImpl)) {
|
|
472941
473140
|
result.messages++;
|
|
472942
473141
|
}
|
|
472943
473142
|
} catch {
|
|
@@ -472969,7 +473168,7 @@ async function cleanupSingleDirectory(dirPath, extension, removeEmptyDir = true)
|
|
|
472969
473168
|
if (!dirent.isFile() || !dirent.name.endsWith(extension))
|
|
472970
473169
|
continue;
|
|
472971
473170
|
try {
|
|
472972
|
-
if (await unlinkIfOld(
|
|
473171
|
+
if (await unlinkIfOld(join173(dirPath, dirent.name), cutoffDate, fsImpl)) {
|
|
472973
473172
|
result.messages++;
|
|
472974
473173
|
}
|
|
472975
473174
|
} catch {
|
|
@@ -472982,7 +473181,7 @@ async function cleanupSingleDirectory(dirPath, extension, removeEmptyDir = true)
|
|
|
472982
473181
|
return result;
|
|
472983
473182
|
}
|
|
472984
473183
|
function cleanupOldPlanFiles() {
|
|
472985
|
-
const plansDir =
|
|
473184
|
+
const plansDir = join173(getTheusConfigHomeDir(), "plans");
|
|
472986
473185
|
return cleanupSingleDirectory(plansDir, ".md");
|
|
472987
473186
|
}
|
|
472988
473187
|
async function cleanupOldFileHistoryBackups() {
|
|
@@ -472991,14 +473190,14 @@ async function cleanupOldFileHistoryBackups() {
|
|
|
472991
473190
|
const fsImpl = getFsImplementation();
|
|
472992
473191
|
try {
|
|
472993
473192
|
const configDir = getTheusConfigHomeDir();
|
|
472994
|
-
const fileHistoryStorageDir =
|
|
473193
|
+
const fileHistoryStorageDir = join173(configDir, "file-history");
|
|
472995
473194
|
let dirents;
|
|
472996
473195
|
try {
|
|
472997
473196
|
dirents = await fsImpl.readdir(fileHistoryStorageDir);
|
|
472998
473197
|
} catch {
|
|
472999
473198
|
return result;
|
|
473000
473199
|
}
|
|
473001
|
-
const fileHistorySessionsDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
473200
|
+
const fileHistorySessionsDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join173(fileHistoryStorageDir, dirent.name));
|
|
473002
473201
|
await Promise.all(fileHistorySessionsDirs.map(async (fileHistorySessionDir) => {
|
|
473003
473202
|
try {
|
|
473004
473203
|
const stats2 = await fsImpl.stat(fileHistorySessionDir);
|
|
@@ -473025,14 +473224,14 @@ async function cleanupOldSessionEnvDirs() {
|
|
|
473025
473224
|
const fsImpl = getFsImplementation();
|
|
473026
473225
|
try {
|
|
473027
473226
|
const configDir = getTheusConfigHomeDir();
|
|
473028
|
-
const sessionEnvBaseDir =
|
|
473227
|
+
const sessionEnvBaseDir = join173(configDir, "session-env");
|
|
473029
473228
|
let dirents;
|
|
473030
473229
|
try {
|
|
473031
473230
|
dirents = await fsImpl.readdir(sessionEnvBaseDir);
|
|
473032
473231
|
} catch {
|
|
473033
473232
|
return result;
|
|
473034
473233
|
}
|
|
473035
|
-
const sessionEnvDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
473234
|
+
const sessionEnvDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join173(sessionEnvBaseDir, dirent.name));
|
|
473036
473235
|
for (const sessionEnvDir of sessionEnvDirs) {
|
|
473037
473236
|
try {
|
|
473038
473237
|
const stats2 = await fsImpl.stat(sessionEnvDir);
|
|
@@ -473054,7 +473253,7 @@ async function cleanupOldDebugLogs() {
|
|
|
473054
473253
|
const cutoffDate = getCutoffDate();
|
|
473055
473254
|
const result = { messages: 0, errors: 0 };
|
|
473056
473255
|
const fsImpl = getFsImplementation();
|
|
473057
|
-
const debugDir =
|
|
473256
|
+
const debugDir = join173(getTheusConfigHomeDir(), "debug");
|
|
473058
473257
|
let dirents;
|
|
473059
473258
|
try {
|
|
473060
473259
|
dirents = await fsImpl.readdir(debugDir);
|
|
@@ -473066,7 +473265,7 @@ async function cleanupOldDebugLogs() {
|
|
|
473066
473265
|
continue;
|
|
473067
473266
|
}
|
|
473068
473267
|
try {
|
|
473069
|
-
if (await unlinkIfOld(
|
|
473268
|
+
if (await unlinkIfOld(join173(debugDir, dirent.name), cutoffDate, fsImpl)) {
|
|
473070
473269
|
result.messages++;
|
|
473071
473270
|
}
|
|
473072
473271
|
} catch {
|
|
@@ -476278,7 +476477,7 @@ __export(exports_asciicast, {
|
|
|
476278
476477
|
_resetRecordingStateForTesting: () => _resetRecordingStateForTesting
|
|
476279
476478
|
});
|
|
476280
476479
|
import { appendFile as appendFile9, rename as rename12 } from "fs/promises";
|
|
476281
|
-
import { basename as basename65, dirname as dirname73, join as
|
|
476480
|
+
import { basename as basename65, dirname as dirname73, join as join175 } from "path";
|
|
476282
476481
|
function getRecordFilePath() {
|
|
476283
476482
|
if (recordingState.filePath !== null) {
|
|
476284
476483
|
return recordingState.filePath;
|
|
@@ -476289,10 +476488,10 @@ function getRecordFilePath() {
|
|
|
476289
476488
|
if (!isEnvTruthy(process.env.THEUS_CODE_TERMINAL_RECORDING)) {
|
|
476290
476489
|
return null;
|
|
476291
476490
|
}
|
|
476292
|
-
const projectsDir =
|
|
476293
|
-
const projectDir =
|
|
476491
|
+
const projectsDir = join175(getTheusConfigHomeDir(), "projects");
|
|
476492
|
+
const projectDir = join175(projectsDir, sanitizePath2(getOriginalCwd()));
|
|
476294
476493
|
recordingState.timestamp = Date.now();
|
|
476295
|
-
recordingState.filePath =
|
|
476494
|
+
recordingState.filePath = join175(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
|
|
476296
476495
|
return recordingState.filePath;
|
|
476297
476496
|
}
|
|
476298
476497
|
function _resetRecordingStateForTesting() {
|
|
@@ -476301,13 +476500,13 @@ function _resetRecordingStateForTesting() {
|
|
|
476301
476500
|
}
|
|
476302
476501
|
function getSessionRecordingPaths() {
|
|
476303
476502
|
const sessionId = getSessionId();
|
|
476304
|
-
const projectsDir =
|
|
476305
|
-
const projectDir =
|
|
476503
|
+
const projectsDir = join175(getTheusConfigHomeDir(), "projects");
|
|
476504
|
+
const projectDir = join175(projectsDir, sanitizePath2(getOriginalCwd()));
|
|
476306
476505
|
try {
|
|
476307
476506
|
const entries = getFsImplementation().readdirSync(projectDir);
|
|
476308
476507
|
const names = typeof entries[0] === "string" ? entries : entries.map((e) => e.name);
|
|
476309
476508
|
const files2 = names.filter((f) => f.startsWith(sessionId) && f.endsWith(".cast")).sort();
|
|
476310
|
-
return files2.map((f) =>
|
|
476509
|
+
return files2.map((f) => join175(projectDir, f));
|
|
476311
476510
|
} catch {
|
|
476312
476511
|
return [];
|
|
476313
476512
|
}
|
|
@@ -476317,9 +476516,9 @@ async function renameRecordingForSession() {
|
|
|
476317
476516
|
if (!oldPath || recordingState.timestamp === 0) {
|
|
476318
476517
|
return;
|
|
476319
476518
|
}
|
|
476320
|
-
const projectsDir =
|
|
476321
|
-
const projectDir =
|
|
476322
|
-
const newPath =
|
|
476519
|
+
const projectsDir = join175(getTheusConfigHomeDir(), "projects");
|
|
476520
|
+
const projectDir = join175(projectsDir, sanitizePath2(getOriginalCwd()));
|
|
476521
|
+
const newPath = join175(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
|
|
476323
476522
|
if (oldPath === newPath) {
|
|
476324
476523
|
return;
|
|
476325
476524
|
}
|
|
@@ -479082,7 +479281,7 @@ var init_useAwaySummary = __esm(() => {
|
|
|
479082
479281
|
|
|
479083
479282
|
// utils/theusInChrome/setupPortable.ts
|
|
479084
479283
|
import { readdir as readdir37 } from "fs/promises";
|
|
479085
|
-
import { join as
|
|
479284
|
+
import { join as join176 } from "path";
|
|
479086
479285
|
function getExtensionIds() {
|
|
479087
479286
|
return [THEUS_BROWSER_EXTENSION_ID];
|
|
479088
479287
|
}
|
|
@@ -479109,7 +479308,7 @@ async function detectExtensionInstallationPortable(browserPaths, log2) {
|
|
|
479109
479308
|
}
|
|
479110
479309
|
for (const profile of profileDirs) {
|
|
479111
479310
|
for (const extensionId of extensionIds) {
|
|
479112
|
-
const extensionPath =
|
|
479311
|
+
const extensionPath = join176(browserBasePath, profile, "Extensions", extensionId);
|
|
479113
479312
|
try {
|
|
479114
479313
|
await readdir37(extensionPath);
|
|
479115
479314
|
log2?.(`[Theus in Chrome] Extension ${extensionId} found in ${browser} ${profile}`);
|
|
@@ -479133,7 +479332,7 @@ var init_setupPortable = __esm(() => {
|
|
|
479133
479332
|
// utils/theusInChrome/setup.ts
|
|
479134
479333
|
import { chmod as chmod15, mkdir as mkdir56, readFile as readFile67, writeFile as writeFile54 } from "fs/promises";
|
|
479135
479334
|
import { homedir as homedir50 } from "os";
|
|
479136
|
-
import { join as
|
|
479335
|
+
import { join as join177 } from "path";
|
|
479137
479336
|
import { fileURLToPath as fileURLToPath8 } from "url";
|
|
479138
479337
|
function isTheusInChromeEngineAvailable() {
|
|
479139
479338
|
return Array.isArray(BROWSER_TOOLS);
|
|
@@ -479197,8 +479396,8 @@ function setupTheusInChrome() {
|
|
|
479197
479396
|
};
|
|
479198
479397
|
} else {
|
|
479199
479398
|
const __filename3 = fileURLToPath8(import.meta.url);
|
|
479200
|
-
const __dirname3 =
|
|
479201
|
-
const cliPath =
|
|
479399
|
+
const __dirname3 = join177(__filename3, "..");
|
|
479400
|
+
const cliPath = join177(__dirname3, "cli.js");
|
|
479202
479401
|
createWrapperScript(`"${process.execPath}" "${cliPath}" --chrome-native-host`).then((manifestBinaryPath) => installChromeNativeHostManifest(manifestBinaryPath)).catch((e) => logForDebugging(`[Theus in Chrome] Failed to install native host: ${e}`, { level: "error" }));
|
|
479203
479402
|
const mcpConfig = {
|
|
479204
479403
|
[THEUS_IN_CHROME_MCP_SERVER_NAME]: {
|
|
@@ -479220,8 +479419,8 @@ function getNativeMessagingHostsDirs() {
|
|
|
479220
479419
|
const platform7 = getPlatform();
|
|
479221
479420
|
if (platform7 === "windows") {
|
|
479222
479421
|
const home = homedir50();
|
|
479223
|
-
const appData = process.env.APPDATA ||
|
|
479224
|
-
return [
|
|
479422
|
+
const appData = process.env.APPDATA || join177(home, "AppData", "Local");
|
|
479423
|
+
return [join177(appData, "Theus", "ChromeNativeHost")];
|
|
479225
479424
|
}
|
|
479226
479425
|
return getAllNativeMessagingHostsDirs().map(({ path: path21 }) => path21);
|
|
479227
479426
|
}
|
|
@@ -479240,7 +479439,7 @@ async function installChromeNativeHostManifest(manifestBinaryPath) {
|
|
|
479240
479439
|
const manifestContent = jsonStringify(manifest, null, 2);
|
|
479241
479440
|
let anyManifestUpdated = false;
|
|
479242
479441
|
for (const manifestDir of manifestDirs) {
|
|
479243
|
-
const manifestPath =
|
|
479442
|
+
const manifestPath = join177(manifestDir, NATIVE_HOST_MANIFEST_NAME);
|
|
479244
479443
|
const existingContent = await readFile67(manifestPath, "utf-8").catch(() => null);
|
|
479245
479444
|
if (existingContent === manifestContent) {
|
|
479246
479445
|
continue;
|
|
@@ -479255,7 +479454,7 @@ async function installChromeNativeHostManifest(manifestBinaryPath) {
|
|
|
479255
479454
|
}
|
|
479256
479455
|
}
|
|
479257
479456
|
if (getPlatform() === "windows") {
|
|
479258
|
-
const manifestPath =
|
|
479457
|
+
const manifestPath = join177(manifestDirs[0], NATIVE_HOST_MANIFEST_NAME);
|
|
479259
479458
|
registerWindowsNativeHosts(manifestPath);
|
|
479260
479459
|
}
|
|
479261
479460
|
if (anyManifestUpdated) {
|
|
@@ -479293,8 +479492,8 @@ function registerWindowsNativeHosts(manifestPath) {
|
|
|
479293
479492
|
}
|
|
479294
479493
|
async function createWrapperScript(command9) {
|
|
479295
479494
|
const platform7 = getPlatform();
|
|
479296
|
-
const chromeDir =
|
|
479297
|
-
const wrapperPath = platform7 === "windows" ?
|
|
479495
|
+
const chromeDir = join177(getTheusConfigHomeDir(), "chrome");
|
|
479496
|
+
const wrapperPath = platform7 === "windows" ? join177(chromeDir, "chrome-native-host.bat") : join177(chromeDir, "chrome-native-host");
|
|
479298
479497
|
const scriptContent = platform7 === "windows" ? `@echo off
|
|
479299
479498
|
REM Chrome native host wrapper script
|
|
479300
479499
|
REM Generated by Theus - do not edit manually
|
|
@@ -479423,7 +479622,7 @@ var init_useChromeExtensionNotification = __esm(() => {
|
|
|
479423
479622
|
});
|
|
479424
479623
|
|
|
479425
479624
|
// utils/plugins/officialMarketplaceStartupCheck.ts
|
|
479426
|
-
import { join as
|
|
479625
|
+
import { join as join178 } from "path";
|
|
479427
479626
|
function isOfficialMarketplaceAutoInstallDisabled() {
|
|
479428
479627
|
if (isEnvTruthy(process.env.THEUS_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL)) {
|
|
479429
479628
|
return true;
|
|
@@ -479501,7 +479700,7 @@ async function checkAndInstallOfficialMarketplace() {
|
|
|
479501
479700
|
return { installed: false, skipped: true, reason: "policy_blocked" };
|
|
479502
479701
|
}
|
|
479503
479702
|
const cacheDir = getMarketplacesCacheDir();
|
|
479504
|
-
const installLocation =
|
|
479703
|
+
const installLocation = join178(cacheDir, OFFICIAL_MARKETPLACE_NAME);
|
|
479505
479704
|
const gcsSha = await fetchOfficialMarketplaceFromGcs(installLocation, cacheDir);
|
|
479506
479705
|
if (gcsSha !== null) {
|
|
479507
479706
|
const known = await loadKnownMarketplacesConfig();
|
|
@@ -482285,7 +482484,7 @@ var init_usePluginRecommendationBase = __esm(() => {
|
|
|
482285
482484
|
});
|
|
482286
482485
|
|
|
482287
482486
|
// hooks/useLspPluginRecommendation.tsx
|
|
482288
|
-
import { extname as extname20, join as
|
|
482487
|
+
import { extname as extname20, join as join179 } from "path";
|
|
482289
482488
|
function useLspPluginRecommendation() {
|
|
482290
482489
|
const $2 = c3(12);
|
|
482291
482490
|
const trackedFiles = useAppState(_temp202);
|
|
@@ -482370,7 +482569,7 @@ function useLspPluginRecommendation() {
|
|
|
482370
482569
|
case "yes": {
|
|
482371
482570
|
installPluginAndNotify(pluginId, pluginName, "lsp-plugin", addNotification, async (pluginData) => {
|
|
482372
482571
|
logForDebugging(`[useLspPluginRecommendation] Installing plugin: ${pluginId}`);
|
|
482373
|
-
const localSourcePath = typeof pluginData.entry.source === "string" ?
|
|
482572
|
+
const localSourcePath = typeof pluginData.entry.source === "string" ? join179(pluginData.marketplaceInstallLocation, pluginData.entry.source) : undefined;
|
|
482374
482573
|
await cacheAndRegisterPlugin(pluginId, pluginData.entry, "user", undefined, localSourcePath);
|
|
482375
482574
|
const settings = getSettingsForSource("userSettings");
|
|
482376
482575
|
updateSettingsForSource("userSettings", {
|
|
@@ -485574,7 +485773,7 @@ var exports_REPL = {};
|
|
|
485574
485773
|
__export(exports_REPL, {
|
|
485575
485774
|
REPL: () => REPL
|
|
485576
485775
|
});
|
|
485577
|
-
import { dirname as dirname75, join as
|
|
485776
|
+
import { dirname as dirname75, join as join180 } from "path";
|
|
485578
485777
|
import { tmpdir as tmpdir16 } from "os";
|
|
485579
485778
|
import { writeFile as writeFile55 } from "fs/promises";
|
|
485580
485779
|
import { randomUUID as randomUUID61 } from "crypto";
|
|
@@ -488208,7 +488407,7 @@ Note: ctrl + z now suspends Theus, ctrl + _ undoes input.
|
|
|
488208
488407
|
const w = Math.max(80, (process.stdout.columns ?? 80) - 6);
|
|
488209
488408
|
const raw = await renderMessagesToPlainText(deferredMessages, tools, w);
|
|
488210
488409
|
const text2 = raw.replace(/[ \t]+$/gm, "");
|
|
488211
|
-
const path21 =
|
|
488410
|
+
const path21 = join180(tmpdir16(), `cc-transcript-${Date.now()}.txt`);
|
|
488212
488411
|
await writeFile55(path21, text2);
|
|
488213
488412
|
const opened = openFileInExternalEditor(path21);
|
|
488214
488413
|
setStatus(opened ? `opening ${path21}` : `wrote ${path21} \xB7 no $VISUAL/$EDITOR set`);
|
|
@@ -490550,6 +490749,7 @@ function TrustDialog(t0) {
|
|
|
490550
490749
|
if ($2[25] !== onChange) {
|
|
490551
490750
|
t21 = /* @__PURE__ */ jsx_runtime485.jsx(Select, {
|
|
490552
490751
|
options: t20,
|
|
490752
|
+
defaultFocusValue: "exit",
|
|
490553
490753
|
onChange: (value_0) => onChange(value_0),
|
|
490554
490754
|
onCancel: () => onChange("exit")
|
|
490555
490755
|
});
|
|
@@ -490972,7 +491172,7 @@ function completeOnboarding() {
|
|
|
490972
491172
|
saveGlobalConfig((current) => ({
|
|
490973
491173
|
...current,
|
|
490974
491174
|
hasCompletedOnboarding: true,
|
|
490975
|
-
lastOnboardingVersion: { VERSION: "0.2.
|
|
491175
|
+
lastOnboardingVersion: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
490976
491176
|
}));
|
|
490977
491177
|
}
|
|
490978
491178
|
function showDialog(root2, renderer) {
|
|
@@ -491203,15 +491403,15 @@ var init_interactiveHelpers = __esm(() => {
|
|
|
491203
491403
|
|
|
491204
491404
|
// components/Theus/arsenalStats.ts
|
|
491205
491405
|
import { existsSync as existsSync30, readdirSync as readdirSync6 } from "fs";
|
|
491206
|
-
import { dirname as dirname76, join as
|
|
491406
|
+
import { dirname as dirname76, join as join181 } from "path";
|
|
491207
491407
|
import { fileURLToPath as fileURLToPath9 } from "url";
|
|
491208
491408
|
function countBundledArsenalSkills() {
|
|
491209
491409
|
try {
|
|
491210
491410
|
const here = dirname76(fileURLToPath9(import.meta.url));
|
|
491211
491411
|
for (const dir of [
|
|
491212
|
-
|
|
491213
|
-
|
|
491214
|
-
|
|
491412
|
+
join181(here, "..", "..", "vendor", "theus-arsenal", "skills"),
|
|
491413
|
+
join181(here, "vendor", "theus-arsenal", "skills"),
|
|
491414
|
+
join181(here, "..", "vendor", "theus-arsenal", "skills")
|
|
491215
491415
|
]) {
|
|
491216
491416
|
if (!existsSync30(dir))
|
|
491217
491417
|
continue;
|
|
@@ -491295,7 +491495,7 @@ var init_arsenalStats = __esm(() => {
|
|
|
491295
491495
|
// services/import/detect/global.ts
|
|
491296
491496
|
import { existsSync as existsSync31 } from "fs";
|
|
491297
491497
|
import { open as open25, readdir as readdir38, stat as stat57 } from "fs/promises";
|
|
491298
|
-
import { join as
|
|
491498
|
+
import { join as join182 } from "path";
|
|
491299
491499
|
async function rutaDelTranscript(fichero) {
|
|
491300
491500
|
let crudo;
|
|
491301
491501
|
try {
|
|
@@ -491326,7 +491526,7 @@ async function rutaDelTranscript(fichero) {
|
|
|
491326
491526
|
return null;
|
|
491327
491527
|
}
|
|
491328
491528
|
async function explorarTodoElTrabajo(entorno) {
|
|
491329
|
-
const raiz =
|
|
491529
|
+
const raiz = join182(directorioConfig(entorno), "projects");
|
|
491330
491530
|
let directorios;
|
|
491331
491531
|
try {
|
|
491332
491532
|
directorios = await readdir38(raiz);
|
|
@@ -491335,7 +491535,7 @@ async function explorarTodoElTrabajo(entorno) {
|
|
|
491335
491535
|
}
|
|
491336
491536
|
const salida = [];
|
|
491337
491537
|
for (const dir of directorios) {
|
|
491338
|
-
const ruta =
|
|
491538
|
+
const ruta = join182(raiz, dir);
|
|
491339
491539
|
let sesiones;
|
|
491340
491540
|
try {
|
|
491341
491541
|
sesiones = (await readdir38(ruta)).filter((n3) => n3.endsWith(".jsonl"));
|
|
@@ -491349,7 +491549,7 @@ async function explorarTodoElTrabajo(entorno) {
|
|
|
491349
491549
|
let ficheroMasReciente = sesiones[0];
|
|
491350
491550
|
for (const nombre of sesiones) {
|
|
491351
491551
|
try {
|
|
491352
|
-
const info = await stat57(
|
|
491552
|
+
const info = await stat57(join182(ruta, nombre));
|
|
491353
491553
|
bytes += info.size;
|
|
491354
491554
|
if (info.mtimeMs > masReciente) {
|
|
491355
491555
|
masReciente = info.mtimeMs;
|
|
@@ -491357,7 +491557,7 @@ async function explorarTodoElTrabajo(entorno) {
|
|
|
491357
491557
|
}
|
|
491358
491558
|
} catch {}
|
|
491359
491559
|
}
|
|
491360
|
-
const proyecto = await rutaDelTranscript(
|
|
491560
|
+
const proyecto = await rutaDelTranscript(join182(ruta, ficheroMasReciente));
|
|
491361
491561
|
if (!proyecto)
|
|
491362
491562
|
continue;
|
|
491363
491563
|
salida.push({
|
|
@@ -491461,7 +491661,7 @@ __export(exports_OnboardingWizard, {
|
|
|
491461
491661
|
OnboardingWizard: () => OnboardingWizard
|
|
491462
491662
|
});
|
|
491463
491663
|
import { existsSync as existsSync32, mkdirSync as mkdirSync15, writeFileSync as writeFileSync14 } from "fs";
|
|
491464
|
-
import { join as
|
|
491664
|
+
import { join as join183 } from "path";
|
|
491465
491665
|
function hasSeenOnboardingWizard() {
|
|
491466
491666
|
if (isEnvTruthy(process.env.THEUS_FORCE_ONBOARDING_WIZARD))
|
|
491467
491667
|
return false;
|
|
@@ -491469,7 +491669,7 @@ function hasSeenOnboardingWizard() {
|
|
|
491469
491669
|
return true;
|
|
491470
491670
|
}
|
|
491471
491671
|
try {
|
|
491472
|
-
return existsSync32(
|
|
491672
|
+
return existsSync32(join183(getTheusConfigHome(), WIZARD_MARKER));
|
|
491473
491673
|
} catch {
|
|
491474
491674
|
return true;
|
|
491475
491675
|
}
|
|
@@ -491478,7 +491678,7 @@ function markOnboardingWizardSeen() {
|
|
|
491478
491678
|
try {
|
|
491479
491679
|
const home = getTheusConfigHome();
|
|
491480
491680
|
mkdirSync15(home, { recursive: true });
|
|
491481
|
-
writeFileSync14(
|
|
491681
|
+
writeFileSync14(join183(home, WIZARD_MARKER), `${JSON.stringify({
|
|
491482
491682
|
seenAt: new Date().toISOString(),
|
|
491483
491683
|
version: globalThis.MACRO?.VERSION ?? null
|
|
491484
491684
|
})}
|
|
@@ -497566,9 +497766,9 @@ var init_createDirectConnectSession = __esm(() => {
|
|
|
497566
497766
|
|
|
497567
497767
|
// utils/releaseNotes.ts
|
|
497568
497768
|
import { mkdir as mkdir57, readFile as readFile69, writeFile as writeFile56 } from "fs/promises";
|
|
497569
|
-
import { dirname as dirname78, join as
|
|
497769
|
+
import { dirname as dirname78, join as join184 } from "path";
|
|
497570
497770
|
function getChangelogCachePath() {
|
|
497571
|
-
return
|
|
497771
|
+
return join184(getTheusConfigHomeDir(), "cache", "changelog.md");
|
|
497572
497772
|
}
|
|
497573
497773
|
async function migrateChangelogFromConfig() {
|
|
497574
497774
|
const config3 = getGlobalConfig();
|
|
@@ -497668,7 +497868,7 @@ function getRecentReleaseNotes(currentVersion, previousVersion, changelogContent
|
|
|
497668
497868
|
}
|
|
497669
497869
|
return [];
|
|
497670
497870
|
}
|
|
497671
|
-
async function checkForReleaseNotes(lastSeenVersion, currentVersion = { VERSION: "0.2.
|
|
497871
|
+
async function checkForReleaseNotes(lastSeenVersion, currentVersion = { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION) {
|
|
497672
497872
|
if (false) {}
|
|
497673
497873
|
const cachedChangelog = await getStoredChangelog();
|
|
497674
497874
|
if (lastSeenVersion !== currentVersion || !cachedChangelog) {
|
|
@@ -497766,7 +497966,7 @@ __export(exports_setup2, {
|
|
|
497766
497966
|
setupComputerUse: () => setupComputerUse,
|
|
497767
497967
|
COMPUTER_USE_SYSTEM_HINT: () => COMPUTER_USE_SYSTEM_HINT
|
|
497768
497968
|
});
|
|
497769
|
-
import { dirname as dirname79, join as
|
|
497969
|
+
import { dirname as dirname79, join as join185 } from "path";
|
|
497770
497970
|
import { fileURLToPath as fileURLToPath10 } from "url";
|
|
497771
497971
|
function setupComputerUse() {
|
|
497772
497972
|
const allowedTools = COMPUTER_USE_TOOL_NAMES.map((name) => buildMcpToolName(COMPUTER_USE_SERVER_NAME, name));
|
|
@@ -497793,11 +497993,11 @@ function resolveComputerUseLauncher() {
|
|
|
497793
497993
|
return { command: process.execPath, args: [entry, COMPUTER_USE_FLAG] };
|
|
497794
497994
|
}
|
|
497795
497995
|
if (entry) {
|
|
497796
|
-
const launcher =
|
|
497996
|
+
const launcher = join185(dirname79(entry), "..", "bin", "theus");
|
|
497797
497997
|
return { command: launcher, args: [COMPUTER_USE_FLAG] };
|
|
497798
497998
|
}
|
|
497799
497999
|
return {
|
|
497800
|
-
command:
|
|
498000
|
+
command: join185(fileURLToPath10(import.meta.url), "..", "..", "..", "bin", "theus"),
|
|
497801
498001
|
args: [COMPUTER_USE_FLAG]
|
|
497802
498002
|
};
|
|
497803
498003
|
}
|
|
@@ -497815,7 +498015,7 @@ __export(exports_arsenalBundled, {
|
|
|
497815
498015
|
ensureBundledArsenalInstalled: () => ensureBundledArsenalInstalled
|
|
497816
498016
|
});
|
|
497817
498017
|
import { existsSync as existsSync33, readFileSync as readFileSync33 } from "fs";
|
|
497818
|
-
import { dirname as dirname80, join as
|
|
498018
|
+
import { dirname as dirname80, join as join186 } from "path";
|
|
497819
498019
|
import { fileURLToPath as fileURLToPath11 } from "url";
|
|
497820
498020
|
function isArsenalAutoInstallEnabled() {
|
|
497821
498021
|
return process.env.THEUS_NO_ARSENAL !== "1";
|
|
@@ -497823,10 +498023,10 @@ function isArsenalAutoInstallEnabled() {
|
|
|
497823
498023
|
function findBundledArsenalDir() {
|
|
497824
498024
|
const here = dirname80(fileURLToPath11(import.meta.url));
|
|
497825
498025
|
for (const candidate of [
|
|
497826
|
-
|
|
497827
|
-
|
|
498026
|
+
join186(here, "vendor", "theus-arsenal"),
|
|
498027
|
+
join186(here, "..", "vendor", "theus-arsenal")
|
|
497828
498028
|
]) {
|
|
497829
|
-
if (existsSync33(
|
|
498029
|
+
if (existsSync33(join186(candidate, ".theus-plugin", "plugin.json"))) {
|
|
497830
498030
|
return candidate;
|
|
497831
498031
|
}
|
|
497832
498032
|
}
|
|
@@ -497834,7 +498034,7 @@ function findBundledArsenalDir() {
|
|
|
497834
498034
|
}
|
|
497835
498035
|
function readBundledVersion(bundledDir) {
|
|
497836
498036
|
try {
|
|
497837
|
-
const manifest = JSON.parse(readFileSync33(
|
|
498037
|
+
const manifest = JSON.parse(readFileSync33(join186(bundledDir, ".theus-plugin", "plugin.json"), "utf8"));
|
|
497838
498038
|
return typeof manifest.version === "string" ? manifest.version : null;
|
|
497839
498039
|
} catch {
|
|
497840
498040
|
return null;
|
|
@@ -498074,7 +498274,7 @@ var init_sessionMemory = __esm(() => {
|
|
|
498074
498274
|
// utils/iTermBackup.ts
|
|
498075
498275
|
import { copyFile as copyFile10, stat as stat59 } from "fs/promises";
|
|
498076
498276
|
import { homedir as homedir52 } from "os";
|
|
498077
|
-
import { join as
|
|
498277
|
+
import { join as join187 } from "path";
|
|
498078
498278
|
function markITerm2SetupComplete() {
|
|
498079
498279
|
saveGlobalConfig((current) => ({
|
|
498080
498280
|
...current,
|
|
@@ -498089,7 +498289,7 @@ function getIterm2RecoveryInfo() {
|
|
|
498089
498289
|
};
|
|
498090
498290
|
}
|
|
498091
498291
|
function getITerm2PlistPath() {
|
|
498092
|
-
return
|
|
498292
|
+
return join187(homedir52(), "Library", "Preferences", "com.googlecode.iterm2.plist");
|
|
498093
498293
|
}
|
|
498094
498294
|
async function checkAndRestoreITerm2Backup() {
|
|
498095
498295
|
const { inProgress, backupPath } = getIterm2RecoveryInfo();
|
|
@@ -499597,7 +499797,7 @@ var init_sessionUrl = __esm(() => {
|
|
|
499597
499797
|
|
|
499598
499798
|
// utils/plugins/zipCacheAdapters.ts
|
|
499599
499799
|
import { readFile as readFile70 } from "fs/promises";
|
|
499600
|
-
import { join as
|
|
499800
|
+
import { join as join188 } from "path";
|
|
499601
499801
|
async function readZipCacheKnownMarketplaces() {
|
|
499602
499802
|
try {
|
|
499603
499803
|
const content = await readFile70(getZipCacheKnownMarketplacesPath(), "utf-8");
|
|
@@ -499622,13 +499822,13 @@ async function saveMarketplaceJsonToZipCache(marketplaceName, installLocation) {
|
|
|
499622
499822
|
const content = await readMarketplaceJsonContent(installLocation);
|
|
499623
499823
|
if (content !== null) {
|
|
499624
499824
|
const relPath = getMarketplaceJsonRelativePath(marketplaceName);
|
|
499625
|
-
await atomicWriteToZipCache(
|
|
499825
|
+
await atomicWriteToZipCache(join188(zipCachePath, relPath), content);
|
|
499626
499826
|
}
|
|
499627
499827
|
}
|
|
499628
499828
|
async function readMarketplaceJsonContent(dir) {
|
|
499629
499829
|
const candidates = [
|
|
499630
|
-
|
|
499631
|
-
|
|
499830
|
+
join188(dir, ".theus-plugin", "marketplace.json"),
|
|
499831
|
+
join188(dir, "marketplace.json"),
|
|
499632
499832
|
dir
|
|
499633
499833
|
];
|
|
499634
499834
|
for (const candidate of candidates) {
|
|
@@ -503201,7 +503401,7 @@ async function startMCPServer(cwd3, debug3, verbose) {
|
|
|
503201
503401
|
setCwd(cwd3);
|
|
503202
503402
|
const server2 = new Server({
|
|
503203
503403
|
name: "theus/tengu",
|
|
503204
|
-
version: { VERSION: "0.2.
|
|
503404
|
+
version: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
503205
503405
|
}, {
|
|
503206
503406
|
capabilities: {
|
|
503207
503407
|
tools: {}
|
|
@@ -503333,14 +503533,14 @@ __export(exports_theusDesktop, {
|
|
|
503333
503533
|
});
|
|
503334
503534
|
import { readdir as readdir39, readFile as readFile72, stat as stat61 } from "fs/promises";
|
|
503335
503535
|
import { homedir as homedir53 } from "os";
|
|
503336
|
-
import { join as
|
|
503536
|
+
import { join as join189 } from "path";
|
|
503337
503537
|
async function getTheusDesktopConfigPath() {
|
|
503338
503538
|
const platform7 = getPlatform();
|
|
503339
503539
|
if (!SUPPORTED_PLATFORMS.includes(platform7)) {
|
|
503340
503540
|
throw new Error(`Unsupported platform: ${platform7} - Theus Desktop integration only works on macOS and WSL.`);
|
|
503341
503541
|
}
|
|
503342
503542
|
if (platform7 === "macos") {
|
|
503343
|
-
return
|
|
503543
|
+
return join189(homedir53(), "Library", "Application Support", "Theus", "theus_desktop_config.json");
|
|
503344
503544
|
}
|
|
503345
503545
|
const windowsHome = process.env.USERPROFILE ? process.env.USERPROFILE.replace(/\\/g, "/") : null;
|
|
503346
503546
|
if (windowsHome) {
|
|
@@ -503359,7 +503559,7 @@ async function getTheusDesktopConfigPath() {
|
|
|
503359
503559
|
if (user.name === "Public" || user.name === "Default" || user.name === "Default User" || user.name === "All Users") {
|
|
503360
503560
|
continue;
|
|
503361
503561
|
}
|
|
503362
|
-
const potentialConfigPath =
|
|
503562
|
+
const potentialConfigPath = join189(usersDir, user.name, "AppData", "Roaming", "Theus", "theus_desktop_config.json");
|
|
503363
503563
|
try {
|
|
503364
503564
|
await stat61(potentialConfigPath);
|
|
503365
503565
|
return potentialConfigPath;
|
|
@@ -504268,12 +504468,12 @@ __export(exports_install, {
|
|
|
504268
504468
|
install: () => install
|
|
504269
504469
|
});
|
|
504270
504470
|
import { homedir as homedir54 } from "os";
|
|
504271
|
-
import { join as
|
|
504471
|
+
import { join as join190 } from "path";
|
|
504272
504472
|
function getInstallationPath2() {
|
|
504273
504473
|
const isWindows2 = env3.platform === "win32";
|
|
504274
504474
|
const homeDir = homedir54();
|
|
504275
504475
|
if (isWindows2) {
|
|
504276
|
-
const windowsPath =
|
|
504476
|
+
const windowsPath = join190(homeDir, ".local", "bin", "theus.exe");
|
|
504277
504477
|
return windowsPath.replace(/\//g, "\\");
|
|
504278
504478
|
}
|
|
504279
504479
|
return "~/.local/bin/theus";
|
|
@@ -504643,7 +504843,7 @@ async function setupTokenHandler(root2) {
|
|
|
504643
504843
|
gap: 1,
|
|
504644
504844
|
children: [
|
|
504645
504845
|
/* @__PURE__ */ jsx_runtime503.jsx(TheusBanner, {
|
|
504646
|
-
version: { VERSION: "0.2.
|
|
504846
|
+
version: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
504647
504847
|
}),
|
|
504648
504848
|
showAuthWarning && /* @__PURE__ */ jsx_runtime503.jsxs(ThemedBox_default, {
|
|
504649
504849
|
flexDirection: "column",
|
|
@@ -505246,7 +505446,8 @@ async function run7() {
|
|
|
505246
505446
|
sortSubcommands: true,
|
|
505247
505447
|
sortOptions: true
|
|
505248
505448
|
}, {
|
|
505249
|
-
compareOptions: (a2, b) => getOptionSortKey(a2).localeCompare(getOptionSortKey(b))
|
|
505449
|
+
compareOptions: (a2, b) => getOptionSortKey(a2).localeCompare(getOptionSortKey(b)),
|
|
505450
|
+
helpWidth: Math.max(95, Math.min(100, process.stdout.columns || 95))
|
|
505250
505451
|
});
|
|
505251
505452
|
}
|
|
505252
505453
|
const program2 = new Command().configureHelp(createSortedHelpConfig()).enablePositionalOptions();
|
|
@@ -505280,7 +505481,7 @@ async function run7() {
|
|
|
505280
505481
|
});
|
|
505281
505482
|
program2.name("theus").description(`Theus - inicia una sesi\xF3n interactiva por defecto; usa -p/--print para salida no interactiva`).argument("[prompt]", "Tu prompt", String).helpOption("-h, --help", "Muestra la ayuda del comando").option("-d, --debug [filter]", 'Activa el modo de depuraci\xF3n con filtrado opcional por categor\xEDas (p. ej., "api,hooks" o "!1p,!file")', (_value) => {
|
|
505282
505483
|
return true;
|
|
505283
|
-
}).addOption(new Option("--debug-to-stderr", "Enable debug mode (to stderr)").argParser(Boolean).hideHelp()).option("--debug-file <path>", "Escribe los registros de depuraci\xF3n en una ruta de archivo espec\xEDfica (activa impl\xEDcitamente el modo de depuraci\xF3n)", () => true).option("--verbose", "Anula el ajuste de modo detallado de la configuraci\xF3n", () => true).option("-p, --print", "Imprime la respuesta y sale (\xFAtil para pipes). Nota: el di\xE1logo de confianza del espacio de trabajo se omite cuando Theus se ejecuta en modo -p. Usa esta opci\xF3n solo en directorios de confianza.", () => true).option("--bare", "Modo
|
|
505484
|
+
}).addOption(new Option("--debug-to-stderr", "Enable debug mode (to stderr)").argParser(Boolean).hideHelp()).option("--debug-file <path>", "Escribe los registros de depuraci\xF3n en una ruta de archivo espec\xEDfica (activa impl\xEDcitamente el modo de depuraci\xF3n)", () => true).option("--verbose", "Anula el ajuste de modo detallado de la configuraci\xF3n", () => true).option("-p, --print", "Imprime la respuesta y sale (\xFAtil para pipes). Nota: el di\xE1logo de confianza del espacio de trabajo se omite cuando Theus se ejecuta en modo -p. Usa esta opci\xF3n solo en directorios de confianza.", () => true).option("--bare", "Modo minimo para automatizacion: omite hooks, LSP, plugins, memoria y lecturas del llavero. Autentica solo con clave de API o apiKeyHelper. Detalle en docs.theus.pe/docs/cli-reference", () => true).addOption(new Option("--init", "Run Setup hooks with init trigger, then continue").hideHelp()).addOption(new Option("--init-only", "Run Setup and SessionStart:startup hooks, then exit").hideHelp()).addOption(new Option("--maintenance", "Run Setup hooks with maintenance trigger, then continue").hideHelp()).addOption(new Option("--output-format <format>", 'Formato de salida (solo funciona con --print): "text" (por defecto), "json" (resultado \xFAnico) o "stream-json" (transmisi\xF3n en tiempo real)').choices(["text", "json", "stream-json"])).addOption(new Option("--json-schema <schema>", 'Esquema JSON para validar la salida estructurada. Ejemplo: {"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}').argParser(String)).option("--include-hook-events", "Incluye todos los eventos del ciclo de vida de los hooks en el flujo de salida (solo funciona con --output-format=stream-json)", () => true).option("--include-partial-messages", "Incluye fragmentos parciales de mensajes a medida que llegan (solo funciona con --print y --output-format=stream-json)", () => true).addOption(new Option("--input-format <format>", 'Formato de entrada (solo funciona con --print): "text" (por defecto) o "stream-json" (entrada en streaming en tiempo real)').choices(["text", "stream-json"])).option("--mcp-debug", "[OBSOLETO. Usa --debug en su lugar] Activa el modo de depuraci\xF3n de MCP (muestra errores de los servidores MCP)", () => true).option("--dangerously-skip-permissions", "Omite todas las verificaciones de permisos. Recomendado solo para sandboxes sin acceso a internet.", () => true).option("--allow-dangerously-skip-permissions", "Permite omitir todas las verificaciones de permisos como opci\xF3n, sin activarla por defecto. Recomendado solo para sandboxes sin acceso a internet.", () => true).addOption(new Option("--thinking <mode>", "Thinking mode: enabled (equivalent to adaptive), disabled").choices(["enabled", "adaptive", "disabled"]).hideHelp()).addOption(new Option("--max-thinking-tokens <tokens>", "[DEPRECATED. Use --thinking instead for newer models] Maximum number of thinking tokens (only works with --print)").argParser(Number).hideHelp()).addOption(new Option("--max-turns <turns>", "Maximum number of agentic turns in non-interactive mode. This will early exit the conversation after the specified number of turns. (only works with --print)").argParser(Number).hideHelp()).addOption(new Option("--max-budget-usd <amount>", "Monto m\xE1ximo en d\xF3lares a gastar en llamadas a la API (solo funciona con --print)").argParser((value) => {
|
|
505284
505485
|
const amount = Number(value);
|
|
505285
505486
|
if (isNaN(amount) || amount <= 0) {
|
|
505286
505487
|
throw new Error("--max-budget-usd must be a positive number greater than 0");
|
|
@@ -506228,7 +506429,7 @@ ${assistantAddendum}` : assistantAddendum;
|
|
|
506228
506429
|
}
|
|
506229
506430
|
}
|
|
506230
506431
|
logForDiagnosticsNoPII("info", "started", {
|
|
506231
|
-
version: { VERSION: "0.2.
|
|
506432
|
+
version: { VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
506232
506433
|
is_native_binary: isInBundledMode()
|
|
506233
506434
|
});
|
|
506234
506435
|
registerCleanup(async () => {
|
|
@@ -507096,7 +507297,7 @@ Usage: theus --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
507096
507297
|
pendingHookMessages
|
|
507097
507298
|
}, renderAndRun);
|
|
507098
507299
|
}
|
|
507099
|
-
}).version(`${{ VERSION: "0.2.
|
|
507300
|
+
}).version(`${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} (Theus)`, "-v, --version", "Muestra el n\xFAmero de versi\xF3n");
|
|
507100
507301
|
program2.option("-w, --worktree [name]", "Crea un nuevo worktree de git para esta sesi\xF3n (opcionalmente indica un nombre)");
|
|
507101
507302
|
program2.option("--tmux", "Crea una sesi\xF3n de tmux para el worktree (requiere --worktree). Usa paneles nativos de iTerm2 cuando est\xE1n disponibles; usa --tmux=classic para tmux tradicional.");
|
|
507102
507303
|
if (canUserConfigureAdvisor()) {
|
|
@@ -507697,7 +507898,7 @@ if (false) {}
|
|
|
507697
507898
|
async function main2() {
|
|
507698
507899
|
const args = process.argv.slice(2);
|
|
507699
507900
|
if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
|
|
507700
|
-
console.log(`${{ VERSION: "0.2.
|
|
507901
|
+
console.log(`${{ VERSION: "0.2.82", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} (Theus)`);
|
|
507701
507902
|
return;
|
|
507702
507903
|
}
|
|
507703
507904
|
if (args[0] === "login" || args[0] === "signin" || args[0] === "entrar" || args[0] === "iniciar-sesion") {
|