theus-cli 0.2.72 → 0.2.73
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 +680 -501
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -57765,7 +57765,7 @@ async function _executeApiKeyHelper(isNonInteractiveSession) {
|
|
|
57765
57765
|
if (isApiKeyHelperFromProjectOrLocalSettings()) {
|
|
57766
57766
|
const hasTrust = checkHasTrustDialogAccepted();
|
|
57767
57767
|
if (!hasTrust && !isNonInteractiveSession) {
|
|
57768
|
-
const error40 = new Error(`Security: apiKeyHelper executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.
|
|
57768
|
+
const error40 = new Error(`Security: apiKeyHelper executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.FEEDBACK_CHANNEL}.`);
|
|
57769
57769
|
logAntError("apiKeyHelper invoked before trust check", error40);
|
|
57770
57770
|
logEvent("theus_apiKeyHelper_missing_trust11", {});
|
|
57771
57771
|
return null;
|
|
@@ -57809,7 +57809,7 @@ async function runAwsAuthRefresh() {
|
|
|
57809
57809
|
if (isAwsAuthRefreshFromProjectSettings()) {
|
|
57810
57810
|
const hasTrust = checkHasTrustDialogAccepted();
|
|
57811
57811
|
if (!hasTrust && !getIsNonInteractiveSession()) {
|
|
57812
|
-
const error40 = new Error(`Security: awsAuthRefresh executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.
|
|
57812
|
+
const error40 = new Error(`Security: awsAuthRefresh executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.FEEDBACK_CHANNEL}.`);
|
|
57813
57813
|
logAntError("awsAuthRefresh invoked before trust check", error40);
|
|
57814
57814
|
logEvent("theus_awsAuthRefresh_missing_trust", {});
|
|
57815
57815
|
return false;
|
|
@@ -57869,7 +57869,7 @@ async function getAwsCredsFromCredentialExport() {
|
|
|
57869
57869
|
if (isAwsCredentialExportFromProjectSettings()) {
|
|
57870
57870
|
const hasTrust = checkHasTrustDialogAccepted();
|
|
57871
57871
|
if (!hasTrust && !getIsNonInteractiveSession()) {
|
|
57872
|
-
const error40 = new Error(`Security: awsCredentialExport executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.
|
|
57872
|
+
const error40 = new Error(`Security: awsCredentialExport executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.FEEDBACK_CHANNEL}.`);
|
|
57873
57873
|
logAntError("awsCredentialExport invoked before trust check", error40);
|
|
57874
57874
|
logEvent("theus_awsCredentialExport_missing_trust", {});
|
|
57875
57875
|
return null;
|
|
@@ -57954,7 +57954,7 @@ async function runGcpAuthRefresh() {
|
|
|
57954
57954
|
if (isGcpAuthRefreshFromProjectSettings()) {
|
|
57955
57955
|
const hasTrust = checkHasTrustDialogAccepted();
|
|
57956
57956
|
if (!hasTrust && !getIsNonInteractiveSession()) {
|
|
57957
|
-
const error40 = new Error(`Security: gcpAuthRefresh executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.
|
|
57957
|
+
const error40 = new Error(`Security: gcpAuthRefresh executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.FEEDBACK_CHANNEL}.`);
|
|
57958
57958
|
logAntError("gcpAuthRefresh invoked before trust check", error40);
|
|
57959
57959
|
logEvent("theus_gcpAuthRefresh_missing_trust", {});
|
|
57960
57960
|
return false;
|
|
@@ -58673,7 +58673,7 @@ var init_auth = __esm(() => {
|
|
|
58673
58673
|
|
|
58674
58674
|
// utils/userAgent.ts
|
|
58675
58675
|
function getTheusCodeUserAgent() {
|
|
58676
|
-
return `theus-code/${{ VERSION: "0.2.
|
|
58676
|
+
return `theus-code/${{ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}`;
|
|
58677
58677
|
}
|
|
58678
58678
|
|
|
58679
58679
|
// utils/workloadContext.ts
|
|
@@ -58695,7 +58695,7 @@ function getUserAgent() {
|
|
|
58695
58695
|
const clientApp = process.env.THEUS_AGENT_SDK_CLIENT_APP ? `, client-app/${process.env.THEUS_AGENT_SDK_CLIENT_APP}` : "";
|
|
58696
58696
|
const workload = getWorkload();
|
|
58697
58697
|
const workloadSuffix = workload ? `, workload/${workload}` : "";
|
|
58698
|
-
return `theus-cli/${{ VERSION: "0.2.
|
|
58698
|
+
return `theus-cli/${{ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} (${"external"}, ${process.env.THEUS_CODE_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
|
|
58699
58699
|
}
|
|
58700
58700
|
function getMCPUserAgent() {
|
|
58701
58701
|
const parts = [];
|
|
@@ -58709,7 +58709,7 @@ function getMCPUserAgent() {
|
|
|
58709
58709
|
parts.push(`client-app/${process.env.THEUS_AGENT_SDK_CLIENT_APP}`);
|
|
58710
58710
|
}
|
|
58711
58711
|
const suffix = parts.length > 0 ? ` (${parts.join(", ")})` : "";
|
|
58712
|
-
return `theus-code/${{ VERSION: "0.2.
|
|
58712
|
+
return `theus-code/${{ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}${suffix}`;
|
|
58713
58713
|
}
|
|
58714
58714
|
function getWebFetchUserAgent() {
|
|
58715
58715
|
return `Theus-User (${getTheusCodeUserAgent()}; +https://support.theus.pe/)`;
|
|
@@ -58847,7 +58847,7 @@ var init_user = __esm(() => {
|
|
|
58847
58847
|
deviceId,
|
|
58848
58848
|
sessionId: getSessionId(),
|
|
58849
58849
|
email: getEmail(),
|
|
58850
|
-
appVersion: { VERSION: "0.2.
|
|
58850
|
+
appVersion: { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
58851
58851
|
platform: getHostPlatformForAnalytics(),
|
|
58852
58852
|
organizationUuid,
|
|
58853
58853
|
accountUuid,
|
|
@@ -60557,7 +60557,7 @@ var init_metadata = __esm(() => {
|
|
|
60557
60557
|
COMPOUND_OPERATOR_REGEX = /\s*(?:&&|\|\||[;|])\s*/;
|
|
60558
60558
|
WHITESPACE_REGEX = /\s+/;
|
|
60559
60559
|
getVersionBase = memoize_default(() => {
|
|
60560
|
-
const match = { VERSION: "0.2.
|
|
60560
|
+
const match = { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION.match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
|
|
60561
60561
|
return match ? match[0] : undefined;
|
|
60562
60562
|
});
|
|
60563
60563
|
buildEnvContext = memoize_default(async () => {
|
|
@@ -60597,9 +60597,9 @@ var init_metadata = __esm(() => {
|
|
|
60597
60597
|
isGithubAction: isEnvTruthy(process.env.GITHUB_ACTIONS),
|
|
60598
60598
|
isTheusCodeAction: isEnvTruthy(process.env.THEUS_CODE_ACTION),
|
|
60599
60599
|
isTheusAiAuth: isTheusAISubscriber(),
|
|
60600
|
-
version: { VERSION: "0.2.
|
|
60600
|
+
version: { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
60601
60601
|
versionBase: getVersionBase(),
|
|
60602
|
-
buildTime: { VERSION: "0.2.
|
|
60602
|
+
buildTime: { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.BUILD_TIME,
|
|
60603
60603
|
deploymentEnvironment: env3.detectDeploymentEnvironment(),
|
|
60604
60604
|
...isEnvTruthy(process.env.GITHUB_ACTIONS) && {
|
|
60605
60605
|
githubEventName: process.env.GITHUB_EVENT_NAME,
|
|
@@ -61215,7 +61215,7 @@ function initialize1PEventLogging() {
|
|
|
61215
61215
|
const platform2 = getPlatform();
|
|
61216
61216
|
const attributes = {
|
|
61217
61217
|
[ATTR_SERVICE_NAME]: "theus-code",
|
|
61218
|
-
[ATTR_SERVICE_VERSION]: { VERSION: "0.2.
|
|
61218
|
+
[ATTR_SERVICE_VERSION]: { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
61219
61219
|
};
|
|
61220
61220
|
if (platform2 === "wsl") {
|
|
61221
61221
|
const wslVersion = getWslVersion();
|
|
@@ -61242,7 +61242,7 @@ function initialize1PEventLogging() {
|
|
|
61242
61242
|
})
|
|
61243
61243
|
]
|
|
61244
61244
|
});
|
|
61245
|
-
firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.theus.theus_code.events", { VERSION: "0.2.
|
|
61245
|
+
firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.theus.theus_code.events", { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
|
|
61246
61246
|
}
|
|
61247
61247
|
async function reinitialize1PEventLoggingIfConfigChanged() {
|
|
61248
61248
|
if (!is1PEventLoggingEnabled() || !firstPartyEventLoggerProvider) {
|
|
@@ -91081,7 +91081,7 @@ function getAttributionHeader(fingerprint) {
|
|
|
91081
91081
|
if (!isAttributionHeaderEnabled()) {
|
|
91082
91082
|
return "";
|
|
91083
91083
|
}
|
|
91084
|
-
const version2 = `${{ VERSION: "0.2.
|
|
91084
|
+
const version2 = `${{ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}.${fingerprint}`;
|
|
91085
91085
|
const entrypoint = process.env.THEUS_CODE_ENTRYPOINT ?? "unknown";
|
|
91086
91086
|
const cch = "";
|
|
91087
91087
|
const workload = getWorkload();
|
|
@@ -104117,7 +104117,7 @@ Complete the user's request by providing accurate, documentation-based guidance.
|
|
|
104117
104117
|
}
|
|
104118
104118
|
function getFeedbackGuideline() {
|
|
104119
104119
|
if (isUsing3PServices()) {
|
|
104120
|
-
return `- When you cannot find an answer or the feature doesn't exist, direct the user to ${{ VERSION: "0.2.
|
|
104120
|
+
return `- When you cannot find an answer or the feature doesn't exist, direct the user to ${{ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.ISSUES_EXPLAINER}`;
|
|
104121
104121
|
}
|
|
104122
104122
|
return "- When you cannot find an answer or the feature doesn't exist, direct the user to use /feedback to report a feature request or bug";
|
|
104123
104123
|
}
|
|
@@ -144301,7 +144301,7 @@ function getTelemetryAttributes() {
|
|
|
144301
144301
|
attributes["session.id"] = sessionId;
|
|
144302
144302
|
}
|
|
144303
144303
|
if (shouldIncludeAttribute("OTEL_METRICS_INCLUDE_VERSION")) {
|
|
144304
|
-
attributes["app.version"] = { VERSION: "0.2.
|
|
144304
|
+
attributes["app.version"] = { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
|
|
144305
144305
|
}
|
|
144306
144306
|
const oauthAccount = getOauthAccountInfo();
|
|
144307
144307
|
if (oauthAccount) {
|
|
@@ -220580,7 +220580,7 @@ async function getMcpHeadersFromHelper(serverName, config2) {
|
|
|
220580
220580
|
if ("scope" in config2 && isMcpServerFromProjectOrLocalSettings(config2) && !getIsNonInteractiveSession()) {
|
|
220581
220581
|
const hasTrust = checkHasTrustDialogAccepted();
|
|
220582
220582
|
if (!hasTrust) {
|
|
220583
|
-
const error40 = new Error(`Security: headersHelper for MCP server '${serverName}' executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.
|
|
220583
|
+
const error40 = new Error(`Security: headersHelper for MCP server '${serverName}' executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.FEEDBACK_CHANNEL}.`);
|
|
220584
220584
|
logAntError("MCP headersHelper invoked before trust check", error40);
|
|
220585
220585
|
logEvent("theus_mcp_headersHelper_missing_trust", {});
|
|
220586
220586
|
return null;
|
|
@@ -221272,7 +221272,7 @@ function computeFingerprint(messageText, version2) {
|
|
|
221272
221272
|
}
|
|
221273
221273
|
function computeFingerprintFromMessages(messages) {
|
|
221274
221274
|
const firstMessageText = extractFirstMessageText(messages);
|
|
221275
|
-
return computeFingerprint(firstMessageText, { VERSION: "0.2.
|
|
221275
|
+
return computeFingerprint(firstMessageText, { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
|
|
221276
221276
|
}
|
|
221277
221277
|
var FINGERPRINT_SALT = "59cf53e54c78";
|
|
221278
221278
|
var init_fingerprint = () => {};
|
|
@@ -221314,7 +221314,7 @@ async function sideQuery(opts) {
|
|
|
221314
221314
|
betas.push(STRUCTURED_OUTPUTS_BETA_HEADER);
|
|
221315
221315
|
}
|
|
221316
221316
|
const messageText = extractFirstUserMessageText(messages);
|
|
221317
|
-
const fingerprint = computeFingerprint(messageText, { VERSION: "0.2.
|
|
221317
|
+
const fingerprint = computeFingerprint(messageText, { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
|
|
221318
221318
|
const attributionHeader = getAttributionHeader(fingerprint);
|
|
221319
221319
|
const systemBlocks = [
|
|
221320
221320
|
attributionHeader ? { type: "text", text: attributionHeader } : null,
|
|
@@ -222438,7 +222438,7 @@ async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) {
|
|
|
222438
222438
|
const client2 = new Client({
|
|
222439
222439
|
name: "theus-code",
|
|
222440
222440
|
title: "Theus",
|
|
222441
|
-
version: { VERSION: "0.2.
|
|
222441
|
+
version: { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION ?? "unknown",
|
|
222442
222442
|
description: "Theus's agentic coding tool",
|
|
222443
222443
|
websiteUrl: PRODUCT_URL
|
|
222444
222444
|
}, {
|
|
@@ -222792,7 +222792,7 @@ var init_client5 = __esm(() => {
|
|
|
222792
222792
|
const client2 = new Client({
|
|
222793
222793
|
name: "theus-code",
|
|
222794
222794
|
title: "Theus",
|
|
222795
|
-
version: { VERSION: "0.2.
|
|
222795
|
+
version: { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION ?? "unknown",
|
|
222796
222796
|
description: "Theus's agentic coding tool",
|
|
222797
222797
|
websiteUrl: PRODUCT_URL
|
|
222798
222798
|
}, {
|
|
@@ -242640,7 +242640,7 @@ async function initializeBetaTracing(resource) {
|
|
|
242640
242640
|
});
|
|
242641
242641
|
logs.setGlobalLoggerProvider(loggerProvider);
|
|
242642
242642
|
setLoggerProvider(loggerProvider);
|
|
242643
|
-
const eventLogger = logs.getLogger("com.theus.theus_code.events", { VERSION: "0.2.
|
|
242643
|
+
const eventLogger = logs.getLogger("com.theus.theus_code.events", { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
|
|
242644
242644
|
setEventLogger(eventLogger);
|
|
242645
242645
|
process.on("beforeExit", async () => {
|
|
242646
242646
|
await loggerProvider?.forceFlush();
|
|
@@ -242680,7 +242680,7 @@ async function initializeTelemetry() {
|
|
|
242680
242680
|
const platform4 = getPlatform();
|
|
242681
242681
|
const baseAttributes = {
|
|
242682
242682
|
[ATTR_SERVICE_NAME]: "theus-code",
|
|
242683
|
-
[ATTR_SERVICE_VERSION]: { VERSION: "0.2.
|
|
242683
|
+
[ATTR_SERVICE_VERSION]: { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
242684
242684
|
};
|
|
242685
242685
|
if (platform4 === "wsl") {
|
|
242686
242686
|
const wslVersion = getWslVersion();
|
|
@@ -242725,7 +242725,7 @@ async function initializeTelemetry() {
|
|
|
242725
242725
|
} catch {}
|
|
242726
242726
|
};
|
|
242727
242727
|
registerCleanup(shutdownTelemetry2);
|
|
242728
|
-
return meterProvider2.getMeter("com.theus.theus_code", { VERSION: "0.2.
|
|
242728
|
+
return meterProvider2.getMeter("com.theus.theus_code", { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
|
|
242729
242729
|
}
|
|
242730
242730
|
const meterProvider = new MeterProvider({
|
|
242731
242731
|
resource,
|
|
@@ -242745,7 +242745,7 @@ async function initializeTelemetry() {
|
|
|
242745
242745
|
});
|
|
242746
242746
|
logs.setGlobalLoggerProvider(loggerProvider);
|
|
242747
242747
|
setLoggerProvider(loggerProvider);
|
|
242748
|
-
const eventLogger = logs.getLogger("com.theus.theus_code.events", { VERSION: "0.2.
|
|
242748
|
+
const eventLogger = logs.getLogger("com.theus.theus_code.events", { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
|
|
242749
242749
|
setEventLogger(eventLogger);
|
|
242750
242750
|
logForDebugging("[3P telemetry] Event logger set successfully");
|
|
242751
242751
|
process.on("beforeExit", async () => {
|
|
@@ -242807,7 +242807,7 @@ Current timeout: ${timeoutMs}ms
|
|
|
242807
242807
|
}
|
|
242808
242808
|
};
|
|
242809
242809
|
registerCleanup(shutdownTelemetry);
|
|
242810
|
-
return meterProvider.getMeter("com.theus.theus_code", { VERSION: "0.2.
|
|
242810
|
+
return meterProvider.getMeter("com.theus.theus_code", { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
|
|
242811
242811
|
}
|
|
242812
242812
|
async function flushTelemetry() {
|
|
242813
242813
|
const meterProvider = getMeterProvider();
|
|
@@ -243349,7 +243349,7 @@ async function installOrUpdateTheusPackage(channel2, specificVersion) {
|
|
|
243349
243349
|
return "install_failed";
|
|
243350
243350
|
}
|
|
243351
243351
|
const versionSpec = specificVersion ? specificVersion : channel2 === "stable" ? "stable" : "latest";
|
|
243352
|
-
const result = await execFileNoThrowWithCwd("npm", ["install", `${{ VERSION: "0.2.
|
|
243352
|
+
const result = await execFileNoThrowWithCwd("npm", ["install", `${{ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}@${versionSpec}`], { cwd: getLocalInstallDir(), maxBuffer: 1e6 });
|
|
243353
243353
|
if (result.code !== 0) {
|
|
243354
243354
|
const error40 = new Error(`Failed to install Theus CLI package: ${result.stderr}`);
|
|
243355
243355
|
logError2(error40);
|
|
@@ -243495,9 +243495,9 @@ async function assertMinVersion() {
|
|
|
243495
243495
|
if (false) {}
|
|
243496
243496
|
try {
|
|
243497
243497
|
const versionConfig = await getDynamicConfig_BLOCKS_ON_INIT("theus_version_config", { minVersion: "0.0.0" });
|
|
243498
|
-
if (versionConfig.minVersion && lt({ VERSION: "0.2.
|
|
243498
|
+
if (versionConfig.minVersion && lt({ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, versionConfig.minVersion)) {
|
|
243499
243499
|
console.error(`
|
|
243500
|
-
It looks like your version of Theus (${{ VERSION: "0.2.
|
|
243500
|
+
It looks like your version of Theus (${{ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}) needs an update.
|
|
243501
243501
|
A newer version (${versionConfig.minVersion} or higher) is required to continue.
|
|
243502
243502
|
|
|
243503
243503
|
To update, please run:
|
|
@@ -243634,7 +243634,7 @@ async function getInstallationPrefix() {
|
|
|
243634
243634
|
return prefixResult.stdout.trim();
|
|
243635
243635
|
}
|
|
243636
243636
|
function getGlobalInstallPackageManager() {
|
|
243637
|
-
if ({ VERSION: "0.2.
|
|
243637
|
+
if ({ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL === "theus-cli") {
|
|
243638
243638
|
return "npm";
|
|
243639
243639
|
}
|
|
243640
243640
|
return env3.isRunningWithBun() ? "bun" : "npm";
|
|
@@ -243659,7 +243659,7 @@ async function checkGlobalInstallPermissions() {
|
|
|
243659
243659
|
}
|
|
243660
243660
|
async function getLatestVersion(channel2) {
|
|
243661
243661
|
const npmTag = channel2 === "stable" ? "stable" : "latest";
|
|
243662
|
-
const result = await execFileNoThrowWithCwd("npm", ["view", `${{ VERSION: "0.2.
|
|
243662
|
+
const result = await execFileNoThrowWithCwd("npm", ["view", `${{ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}@${npmTag}`, "version", "--prefer-online"], { abortSignal: AbortSignal.timeout(5000), cwd: homedir20() });
|
|
243663
243663
|
if (result.code !== 0) {
|
|
243664
243664
|
logForDebugging(`npm view failed with code ${result.code}`);
|
|
243665
243665
|
if (result.stderr) {
|
|
@@ -243675,7 +243675,7 @@ async function getLatestVersion(channel2) {
|
|
|
243675
243675
|
return result.stdout.trim();
|
|
243676
243676
|
}
|
|
243677
243677
|
async function getNpmDistTags() {
|
|
243678
|
-
const result = await execFileNoThrowWithCwd("npm", ["view", { VERSION: "0.2.
|
|
243678
|
+
const result = await execFileNoThrowWithCwd("npm", ["view", { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL, "dist-tags", "--json", "--prefer-online"], { abortSignal: AbortSignal.timeout(5000), cwd: homedir20() });
|
|
243679
243679
|
if (result.code !== 0) {
|
|
243680
243680
|
logForDebugging(`npm view dist-tags failed with code ${result.code}`);
|
|
243681
243681
|
return { latest: null, stable: null };
|
|
@@ -243715,7 +243715,7 @@ async function installGlobalPackage(specificVersion) {
|
|
|
243715
243715
|
logError2(new AutoUpdaterError("Another process is currently installing an update"));
|
|
243716
243716
|
logEvent("theus_auto_updater_lock_contention", {
|
|
243717
243717
|
pid: process.pid,
|
|
243718
|
-
currentVersion: { VERSION: "0.2.
|
|
243718
|
+
currentVersion: { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
243719
243719
|
});
|
|
243720
243720
|
return "in_progress";
|
|
243721
243721
|
}
|
|
@@ -243724,7 +243724,7 @@ async function installGlobalPackage(specificVersion) {
|
|
|
243724
243724
|
if (!env3.isRunningWithBun() && env3.isNpmFromWindowsPath()) {
|
|
243725
243725
|
logError2(new Error("Windows NPM detected in WSL environment"));
|
|
243726
243726
|
logEvent("theus_auto_updater_windows_npm_in_wsl", {
|
|
243727
|
-
currentVersion: { VERSION: "0.2.
|
|
243727
|
+
currentVersion: { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
243728
243728
|
});
|
|
243729
243729
|
console.error(`
|
|
243730
243730
|
Error: Windows NPM detected in WSL
|
|
@@ -243743,7 +243743,7 @@ To fix this issue:
|
|
|
243743
243743
|
if (!hasPermissions) {
|
|
243744
243744
|
return "no_permissions";
|
|
243745
243745
|
}
|
|
243746
|
-
const packageSpec = specificVersion ? `${{ VERSION: "0.2.
|
|
243746
|
+
const packageSpec = specificVersion ? `${{ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.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.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL;
|
|
243747
243747
|
const packageManager = getGlobalInstallPackageManager();
|
|
243748
243748
|
const installResult = await execFileNoThrowWithCwd(packageManager, ["install", "-g", packageSpec], { cwd: homedir20() });
|
|
243749
243749
|
if (installResult.code !== 0) {
|
|
@@ -244071,8 +244071,8 @@ async function detectMultipleInstallations() {
|
|
|
244071
244071
|
installations.push({ type: "npm-local", path: localPath });
|
|
244072
244072
|
}
|
|
244073
244073
|
const packagesToCheck = ["@theus-ai/theus-code"];
|
|
244074
|
-
if ({ VERSION: "0.2.
|
|
244075
|
-
packagesToCheck.push({ VERSION: "0.2.
|
|
244074
|
+
if ({ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.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.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL !== "@theus-ai/theus-code") {
|
|
244075
|
+
packagesToCheck.push({ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL);
|
|
244076
244076
|
}
|
|
244077
244077
|
const npmResult = await execFileNoThrow("npm", [
|
|
244078
244078
|
"-g",
|
|
@@ -244255,7 +244255,7 @@ function detectLinuxGlobPatternWarnings() {
|
|
|
244255
244255
|
}
|
|
244256
244256
|
async function getDoctorDiagnostic() {
|
|
244257
244257
|
const installationType = await getCurrentInstallationType();
|
|
244258
|
-
const version2 = { VERSION: "0.2.
|
|
244258
|
+
const version2 = { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION : "unknown";
|
|
244259
244259
|
const installationPath = await getInstallationPath();
|
|
244260
244260
|
const invokedBinary = getInvokedBinary();
|
|
244261
244261
|
const multipleInstallations = await detectMultipleInstallations();
|
|
@@ -244267,8 +244267,8 @@ async function getDoctorDiagnostic() {
|
|
|
244267
244267
|
for (const install of npmInstalls) {
|
|
244268
244268
|
if (install.type === "npm-global") {
|
|
244269
244269
|
let uninstallCmd = "npm -g uninstall @theus-ai/theus-code";
|
|
244270
|
-
if ({ VERSION: "0.2.
|
|
244271
|
-
uninstallCmd += ` && npm -g uninstall ${{ VERSION: "0.2.
|
|
244270
|
+
if ({ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.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.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL !== "@theus-ai/theus-code") {
|
|
244271
|
+
uninstallCmd += ` && npm -g uninstall ${{ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}`;
|
|
244272
244272
|
}
|
|
244273
244273
|
warnings.push({
|
|
244274
244274
|
issue: `Leftover npm global installation at ${install.path}`,
|
|
@@ -245079,8 +245079,8 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
|
|
|
245079
245079
|
const maxVersion = await getMaxVersion();
|
|
245080
245080
|
if (maxVersion && gt(version2, maxVersion)) {
|
|
245081
245081
|
logForDebugging(`Native installer: maxVersion ${maxVersion} is set, capping update from ${version2} to ${maxVersion}`);
|
|
245082
|
-
if (gte({ VERSION: "0.2.
|
|
245083
|
-
logForDebugging(`Native installer: current version ${{ VERSION: "0.2.
|
|
245082
|
+
if (gte({ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, maxVersion)) {
|
|
245083
|
+
logForDebugging(`Native installer: current version ${{ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} is already at or above maxVersion ${maxVersion}, skipping update`);
|
|
245084
245084
|
logEvent("theus_native_update_skipped_max_version", {
|
|
245085
245085
|
latency_ms: Date.now() - startTime2,
|
|
245086
245086
|
max_version: maxVersion,
|
|
@@ -245091,7 +245091,7 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
|
|
|
245091
245091
|
version2 = maxVersion;
|
|
245092
245092
|
}
|
|
245093
245093
|
}
|
|
245094
|
-
if (!forceReinstall && version2 === { VERSION: "0.2.
|
|
245094
|
+
if (!forceReinstall && version2 === { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION && await versionIsAvailable(version2) && await isPossibleTheusBinary(executablePath)) {
|
|
245095
245095
|
logForDebugging(`Found ${version2} at ${executablePath}, skipping install`);
|
|
245096
245096
|
logEvent("theus_native_update_complete", {
|
|
245097
245097
|
latency_ms: Date.now() - startTime2,
|
|
@@ -245841,8 +245841,8 @@ async function cleanupNpmInstallations() {
|
|
|
245841
245841
|
} else if (codePackageResult.error) {
|
|
245842
245842
|
errors4.push(codePackageResult.error);
|
|
245843
245843
|
}
|
|
245844
|
-
if ({ VERSION: "0.2.
|
|
245845
|
-
const macroPackageResult = await attemptNpmUninstall({ VERSION: "0.2.
|
|
245844
|
+
if ({ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.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.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL !== "@theus-ai/theus-code") {
|
|
245845
|
+
const macroPackageResult = await attemptNpmUninstall({ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL);
|
|
245846
245846
|
if (macroPackageResult.success) {
|
|
245847
245847
|
removed++;
|
|
245848
245848
|
if (macroPackageResult.warning) {
|
|
@@ -256259,6 +256259,15 @@ var init_ConsoleOAuthFlow = __esm(() => {
|
|
|
256259
256259
|
var NOVEDADES;
|
|
256260
256260
|
var init_data = __esm(() => {
|
|
256261
256261
|
NOVEDADES = [
|
|
256262
|
+
{
|
|
256263
|
+
version: "v0.2.73",
|
|
256264
|
+
fecha: "2026-08-13",
|
|
256265
|
+
titulo: "Theus reconoce el trabajo de cuatro agentes de c\xF3digo distintos",
|
|
256266
|
+
puntos: [
|
|
256267
|
+
"Se suma la detecci\xF3n del historial de un cuarto asistente. Su documentaci\xF3n p\xFAblica dice que las carpetas se nombran con un c\xF3digo derivado de la ruta del proyecto, pero eso cambi\xF3 a principios de a\xF1o: ahora Theus consulta el \xEDndice de la propia herramienta, que guarda las rutas en claro, y va directo a lo tuyo sin enumerar tus dem\xE1s proyectos.",
|
|
256268
|
+
"Corregido un fallo en la lectura del historial que algunos asistentes dejan dentro del repositorio: los mensajes del sistema (\xABarchivo modificado\xBB, \xABcommit creado\xBB) se estaban leyendo como si los hubiera dicho el asistente."
|
|
256269
|
+
]
|
|
256270
|
+
},
|
|
256262
256271
|
{
|
|
256263
256272
|
version: "v0.2.72",
|
|
256264
256273
|
fecha: "2026-08-13",
|
|
@@ -300121,9 +300130,9 @@ function getTheusEnvMetadata() {
|
|
|
300121
300130
|
};
|
|
300122
300131
|
}
|
|
300123
300132
|
function getBuildAgeMinutes() {
|
|
300124
|
-
if (!{ VERSION: "0.2.
|
|
300133
|
+
if (!{ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.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)
|
|
300125
300134
|
return;
|
|
300126
|
-
const buildTime = new Date({ VERSION: "0.2.
|
|
300135
|
+
const buildTime = new Date({ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.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();
|
|
300127
300136
|
if (isNaN(buildTime))
|
|
300128
300137
|
return;
|
|
300129
300138
|
return Math.floor((Date.now() - buildTime) / 60000);
|
|
@@ -318428,7 +318437,7 @@ function getSimpleDoingTasksSection() {
|
|
|
318428
318437
|
];
|
|
318429
318438
|
const userHelpSubitems = [
|
|
318430
318439
|
`/help: Get help with using Theus`,
|
|
318431
|
-
`To give feedback, users should ${{ VERSION: "0.2.
|
|
318440
|
+
`To give feedback, users should ${{ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.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}`
|
|
318432
318441
|
];
|
|
318433
318442
|
const items = [
|
|
318434
318443
|
`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.`,
|
|
@@ -329564,7 +329573,7 @@ async function submitTranscriptShare(messages, trigger, appearanceId) {
|
|
|
329564
329573
|
} catch {}
|
|
329565
329574
|
const data = {
|
|
329566
329575
|
trigger,
|
|
329567
|
-
version: { VERSION: "0.2.
|
|
329576
|
+
version: { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
329568
329577
|
platform: process.platform,
|
|
329569
329578
|
transcript,
|
|
329570
329579
|
subagentTranscripts: Object.keys(subagentTranscripts).length > 0 ? subagentTranscripts : undefined,
|
|
@@ -329769,10 +329778,10 @@ Si el usuario indic\xF3 una duraci\xF3n, p\xE1sala en el par\xE1metro \`duration
|
|
|
329769
329778
|
|
|
329770
329779
|
// commands/issue/index.ts
|
|
329771
329780
|
function getCliVersion() {
|
|
329772
|
-
return { VERSION: "0.2.
|
|
329781
|
+
return { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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";
|
|
329773
329782
|
}
|
|
329774
329783
|
function getIssuesExplainer() {
|
|
329775
|
-
return { VERSION: "0.2.
|
|
329784
|
+
return { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.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.73", BUILD_TIME: "1970-01-01T00:00:00.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";
|
|
329776
329785
|
}
|
|
329777
329786
|
function getActiveModelLabel() {
|
|
329778
329787
|
try {
|
|
@@ -332558,7 +332567,7 @@ function buildPrimarySection() {
|
|
|
332558
332567
|
});
|
|
332559
332568
|
return [{
|
|
332560
332569
|
label: "Version",
|
|
332561
|
-
value: { VERSION: "0.2.
|
|
332570
|
+
value: { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
332562
332571
|
}, {
|
|
332563
332572
|
label: "Session name",
|
|
332564
332573
|
value: nameValue
|
|
@@ -336374,7 +336383,7 @@ function Config({
|
|
|
336374
336383
|
}
|
|
336375
336384
|
})
|
|
336376
336385
|
}) : showSubmenu === "ChannelDowngrade" ? /* @__PURE__ */ jsx_runtime189.jsx(ChannelDowngradeDialog, {
|
|
336377
|
-
currentVersion: { VERSION: "0.2.
|
|
336386
|
+
currentVersion: { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
336378
336387
|
onChoice: (choice) => {
|
|
336379
336388
|
setShowSubmenu(null);
|
|
336380
336389
|
setTabsHidden(false);
|
|
@@ -336386,7 +336395,7 @@ function Config({
|
|
|
336386
336395
|
autoUpdatesChannel: "stable"
|
|
336387
336396
|
};
|
|
336388
336397
|
if (choice === "stay") {
|
|
336389
|
-
newSettings.minimumVersion = { VERSION: "0.2.
|
|
336398
|
+
newSettings.minimumVersion = { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
|
|
336390
336399
|
}
|
|
336391
336400
|
updateSettingsForSource("userSettings", newSettings);
|
|
336392
336401
|
setSettingsData((prev_27) => ({
|
|
@@ -343745,7 +343754,7 @@ function HelpV2(t0) {
|
|
|
343745
343754
|
let t6;
|
|
343746
343755
|
if ($2[31] !== tabs) {
|
|
343747
343756
|
t6 = /* @__PURE__ */ jsx_runtime215.jsx(Tabs, {
|
|
343748
|
-
title: `Theus v${{ VERSION: "0.2.
|
|
343757
|
+
title: `Theus v${{ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}`,
|
|
343749
343758
|
color: "professionalBlue",
|
|
343750
343759
|
defaultTab: "general",
|
|
343751
343760
|
children: tabs
|
|
@@ -362349,7 +362358,7 @@ function Onboarding({
|
|
|
362349
362358
|
flexDirection: "column",
|
|
362350
362359
|
children: [
|
|
362351
362360
|
/* @__PURE__ */ jsx_runtime250.jsx(TheusBanner, {
|
|
362352
|
-
version: { VERSION: "0.2.
|
|
362361
|
+
version: { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
362353
362362
|
}),
|
|
362354
362363
|
/* @__PURE__ */ jsx_runtime250.jsxs(ThemedBox_default, {
|
|
362355
362364
|
flexDirection: "column",
|
|
@@ -367736,7 +367745,7 @@ var init_Messages = __esm(() => {
|
|
|
367736
367745
|
let t1;
|
|
367737
367746
|
if ($2[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
367738
367747
|
t1 = /* @__PURE__ */ jsx_runtime263.jsx(TheusSessionHeader, {
|
|
367739
|
-
version: { VERSION: "0.2.
|
|
367748
|
+
version: { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
367740
367749
|
});
|
|
367741
367750
|
$2[0] = t1;
|
|
367742
367751
|
} else {
|
|
@@ -377626,18 +377635,27 @@ function parsearHistorialAider(crudo, maxCharsPorMensaje) {
|
|
|
377626
377635
|
let rolActual = null;
|
|
377627
377636
|
let buffer = [];
|
|
377628
377637
|
const volcar = () => {
|
|
377629
|
-
if (!rolActual)
|
|
377638
|
+
if (!rolActual) {
|
|
377639
|
+
buffer = [];
|
|
377630
377640
|
return;
|
|
377641
|
+
}
|
|
377631
377642
|
const texto = buffer.join(`
|
|
377632
377643
|
`).trim();
|
|
377633
|
-
|
|
377644
|
+
const soloComando = rolActual === "user" && texto.startsWith("/") && !texto.includes(`
|
|
377645
|
+
`);
|
|
377646
|
+
if (texto && !soloComando) {
|
|
377634
377647
|
mensajes.push({ role: rolActual, text: texto.slice(0, maxCharsPorMensaje) });
|
|
377635
377648
|
}
|
|
377636
377649
|
buffer = [];
|
|
377637
377650
|
};
|
|
377638
377651
|
for (const linea of crudo.split(`
|
|
377639
377652
|
`)) {
|
|
377640
|
-
if (
|
|
377653
|
+
if (linea.startsWith("# ")) {
|
|
377654
|
+
volcar();
|
|
377655
|
+
rolActual = null;
|
|
377656
|
+
continue;
|
|
377657
|
+
}
|
|
377658
|
+
if (linea.startsWith("> ")) {
|
|
377641
377659
|
volcar();
|
|
377642
377660
|
rolActual = null;
|
|
377643
377661
|
continue;
|
|
@@ -377649,14 +377667,17 @@ function parsearHistorialAider(crudo, maxCharsPorMensaje) {
|
|
|
377649
377667
|
buffer.push(linea.slice(5));
|
|
377650
377668
|
continue;
|
|
377651
377669
|
}
|
|
377652
|
-
if (
|
|
377670
|
+
if (linea.trim() === "" && buffer.length === 0)
|
|
377671
|
+
continue;
|
|
377672
|
+
if (rolActual === "user") {
|
|
377653
377673
|
volcar();
|
|
377654
377674
|
rolActual = "assistant";
|
|
377655
|
-
}
|
|
377656
|
-
|
|
377675
|
+
} else if (rolActual === null) {
|
|
377676
|
+
if (linea.trim() === "")
|
|
377677
|
+
continue;
|
|
377657
377678
|
rolActual = "assistant";
|
|
377658
|
-
|
|
377659
|
-
|
|
377679
|
+
}
|
|
377680
|
+
buffer.push(linea);
|
|
377660
377681
|
}
|
|
377661
377682
|
volcar();
|
|
377662
377683
|
return mensajes;
|
|
@@ -377713,9 +377734,165 @@ var init_aider = __esm(() => {
|
|
|
377713
377734
|
};
|
|
377714
377735
|
});
|
|
377715
377736
|
|
|
377716
|
-
// services/import/detect/sources/
|
|
377717
|
-
import { readdir as readdir31, readFile as readFile49, stat as stat46 } from "fs/promises";
|
|
377737
|
+
// services/import/detect/sources/geminiCli.ts
|
|
377738
|
+
import { open as open17, readdir as readdir31, readFile as readFile49, stat as stat46 } from "fs/promises";
|
|
377718
377739
|
import { join as join136 } from "path";
|
|
377740
|
+
function directorioGemini(entorno) {
|
|
377741
|
+
const override = entorno.env.GEMINI_CLI_HOME?.trim();
|
|
377742
|
+
const home = override && override.length > 0 ? override : entorno.home;
|
|
377743
|
+
return join136(home, CARPETA);
|
|
377744
|
+
}
|
|
377745
|
+
async function slugDelIndice(dirGemini, proyecto) {
|
|
377746
|
+
let crudo;
|
|
377747
|
+
try {
|
|
377748
|
+
crudo = await readFile49(join136(dirGemini, "projects.json"), "utf8");
|
|
377749
|
+
} catch {
|
|
377750
|
+
return null;
|
|
377751
|
+
}
|
|
377752
|
+
try {
|
|
377753
|
+
const data = JSON.parse(crudo);
|
|
377754
|
+
const mapa = data.projects;
|
|
377755
|
+
if (!mapa || typeof mapa !== "object")
|
|
377756
|
+
return null;
|
|
377757
|
+
const slug = mapa[proyecto];
|
|
377758
|
+
return typeof slug === "string" && slug ? slug : null;
|
|
377759
|
+
} catch {
|
|
377760
|
+
return null;
|
|
377761
|
+
}
|
|
377762
|
+
}
|
|
377763
|
+
function textoDeContenido2(contenido, maxChars) {
|
|
377764
|
+
if (typeof contenido === "string")
|
|
377765
|
+
return contenido.slice(0, maxChars);
|
|
377766
|
+
if (!Array.isArray(contenido))
|
|
377767
|
+
return "";
|
|
377768
|
+
const partes = [];
|
|
377769
|
+
for (const parte of contenido) {
|
|
377770
|
+
if (typeof parte === "string") {
|
|
377771
|
+
partes.push(parte);
|
|
377772
|
+
continue;
|
|
377773
|
+
}
|
|
377774
|
+
if (!parte || typeof parte !== "object")
|
|
377775
|
+
continue;
|
|
377776
|
+
const p = parte;
|
|
377777
|
+
if (typeof p.text === "string" && p.text.trim())
|
|
377778
|
+
partes.push(p.text);
|
|
377779
|
+
}
|
|
377780
|
+
return partes.join(`
|
|
377781
|
+
`).slice(0, maxChars);
|
|
377782
|
+
}
|
|
377783
|
+
async function carpetaDeChats(entorno) {
|
|
377784
|
+
const dir = directorioGemini(entorno);
|
|
377785
|
+
const slug = await slugDelIndice(dir, entorno.proyecto);
|
|
377786
|
+
if (!slug)
|
|
377787
|
+
return null;
|
|
377788
|
+
return join136(dir, "tmp", slug, "chats");
|
|
377789
|
+
}
|
|
377790
|
+
var CARPETA = ".gemini", detectorGeminiCli;
|
|
377791
|
+
var init_geminiCli = __esm(() => {
|
|
377792
|
+
detectorGeminiCli = {
|
|
377793
|
+
herramienta: "gemini-cli",
|
|
377794
|
+
async explorar(entorno) {
|
|
377795
|
+
const ruta = await carpetaDeChats(entorno);
|
|
377796
|
+
if (!ruta)
|
|
377797
|
+
return null;
|
|
377798
|
+
let entradas;
|
|
377799
|
+
try {
|
|
377800
|
+
entradas = await readdir31(ruta);
|
|
377801
|
+
} catch {
|
|
377802
|
+
return null;
|
|
377803
|
+
}
|
|
377804
|
+
const sesiones = entradas.filter((n2) => n2.endsWith(".jsonl") || n2.endsWith(".json"));
|
|
377805
|
+
if (sesiones.length === 0)
|
|
377806
|
+
return null;
|
|
377807
|
+
let bytes = 0;
|
|
377808
|
+
let masReciente = 0;
|
|
377809
|
+
for (const nombre of sesiones) {
|
|
377810
|
+
try {
|
|
377811
|
+
const info = await stat46(join136(ruta, nombre));
|
|
377812
|
+
bytes += info.size;
|
|
377813
|
+
if (info.mtimeMs > masReciente)
|
|
377814
|
+
masReciente = info.mtimeMs;
|
|
377815
|
+
} catch {}
|
|
377816
|
+
}
|
|
377817
|
+
return {
|
|
377818
|
+
herramienta: "gemini-cli",
|
|
377819
|
+
etiqueta: "Otro asistente que usaste en esta carpeta",
|
|
377820
|
+
ruta,
|
|
377821
|
+
sesiones: sesiones.length,
|
|
377822
|
+
masReciente,
|
|
377823
|
+
bytes,
|
|
377824
|
+
proyectoConsultado: entorno.proyecto
|
|
377825
|
+
};
|
|
377826
|
+
},
|
|
377827
|
+
async leer(fuente, limites) {
|
|
377828
|
+
let entradas;
|
|
377829
|
+
try {
|
|
377830
|
+
entradas = await readdir31(fuente.ruta);
|
|
377831
|
+
} catch {
|
|
377832
|
+
return [];
|
|
377833
|
+
}
|
|
377834
|
+
const ficheros = [];
|
|
377835
|
+
for (const nombre of entradas) {
|
|
377836
|
+
if (!nombre.endsWith(".jsonl"))
|
|
377837
|
+
continue;
|
|
377838
|
+
try {
|
|
377839
|
+
const info = await stat46(join136(fuente.ruta, nombre));
|
|
377840
|
+
ficheros.push({ nombre, mtime: info.mtimeMs });
|
|
377841
|
+
} catch {}
|
|
377842
|
+
}
|
|
377843
|
+
ficheros.sort((a2, b) => b.mtime - a2.mtime);
|
|
377844
|
+
const salida = [];
|
|
377845
|
+
for (const { nombre, mtime } of ficheros.slice(0, limites.maxSesiones)) {
|
|
377846
|
+
let crudo;
|
|
377847
|
+
try {
|
|
377848
|
+
const fh = await open17(join136(fuente.ruta, nombre), "r");
|
|
377849
|
+
try {
|
|
377850
|
+
const buf = Buffer.alloc(limites.maxBytesPorSesion);
|
|
377851
|
+
const { bytesRead } = await fh.read(buf, 0, buf.length, 0);
|
|
377852
|
+
crudo = buf.subarray(0, bytesRead).toString("utf8");
|
|
377853
|
+
} finally {
|
|
377854
|
+
await fh.close();
|
|
377855
|
+
}
|
|
377856
|
+
} catch {
|
|
377857
|
+
continue;
|
|
377858
|
+
}
|
|
377859
|
+
const mensajes = [];
|
|
377860
|
+
for (const linea of crudo.split(`
|
|
377861
|
+
`)) {
|
|
377862
|
+
if (!linea.trim())
|
|
377863
|
+
continue;
|
|
377864
|
+
let obj;
|
|
377865
|
+
try {
|
|
377866
|
+
obj = JSON.parse(linea);
|
|
377867
|
+
} catch {
|
|
377868
|
+
continue;
|
|
377869
|
+
}
|
|
377870
|
+
const rol = obj.type === "user" ? "user" : obj.type === "gemini" ? "assistant" : null;
|
|
377871
|
+
if (!rol)
|
|
377872
|
+
continue;
|
|
377873
|
+
const text = textoDeContenido2(obj.content, limites.maxCharsPorMensaje);
|
|
377874
|
+
if (!text.trim())
|
|
377875
|
+
continue;
|
|
377876
|
+
mensajes.push({ role: rol, text });
|
|
377877
|
+
if (mensajes.length >= limites.maxMensajes)
|
|
377878
|
+
break;
|
|
377879
|
+
}
|
|
377880
|
+
if (mensajes.length > 0) {
|
|
377881
|
+
salida.push({
|
|
377882
|
+
titulo: `Sesi\xF3n del ${new Date(mtime).toISOString().slice(0, 10)}`,
|
|
377883
|
+
creadaEn: mtime,
|
|
377884
|
+
mensajes
|
|
377885
|
+
});
|
|
377886
|
+
}
|
|
377887
|
+
}
|
|
377888
|
+
return salida;
|
|
377889
|
+
}
|
|
377890
|
+
};
|
|
377891
|
+
});
|
|
377892
|
+
|
|
377893
|
+
// services/import/detect/sources/memoriaAgente.ts
|
|
377894
|
+
import { readdir as readdir32, readFile as readFile50, stat as stat47 } from "fs/promises";
|
|
377895
|
+
import { join as join137 } from "path";
|
|
377719
377896
|
function parsearFicheroMemoria(crudo, nombreFichero) {
|
|
377720
377897
|
const texto = crudo.trim();
|
|
377721
377898
|
if (!texto)
|
|
@@ -377743,10 +377920,10 @@ function parsearFicheroMemoria(crudo, nombreFichero) {
|
|
|
377743
377920
|
return { titulo, texto: cuerpo, ...categoria ? { categoria } : {} };
|
|
377744
377921
|
}
|
|
377745
377922
|
async function explorarMemoria(entorno) {
|
|
377746
|
-
const ruta =
|
|
377923
|
+
const ruta = join137(directorioConfig(entorno), "projects", slugDeProyecto(entorno.proyecto), "memory");
|
|
377747
377924
|
let ficheros;
|
|
377748
377925
|
try {
|
|
377749
|
-
ficheros = (await
|
|
377926
|
+
ficheros = (await readdir32(ruta)).filter((n2) => n2.toLowerCase().endsWith(".md"));
|
|
377750
377927
|
} catch {
|
|
377751
377928
|
return null;
|
|
377752
377929
|
}
|
|
@@ -377756,7 +377933,7 @@ async function explorarMemoria(entorno) {
|
|
|
377756
377933
|
let masReciente = 0;
|
|
377757
377934
|
for (const nombre of ficheros) {
|
|
377758
377935
|
try {
|
|
377759
|
-
const info = await
|
|
377936
|
+
const info = await stat47(join137(ruta, nombre));
|
|
377760
377937
|
bytes += info.size;
|
|
377761
377938
|
if (info.mtimeMs > masReciente)
|
|
377762
377939
|
masReciente = info.mtimeMs;
|
|
@@ -377775,7 +377952,7 @@ async function explorarMemoria(entorno) {
|
|
|
377775
377952
|
async function leerMemoria(fuente, maxHechos = 60) {
|
|
377776
377953
|
let ficheros;
|
|
377777
377954
|
try {
|
|
377778
|
-
ficheros = (await
|
|
377955
|
+
ficheros = (await readdir32(fuente.ruta)).filter((n2) => n2.toLowerCase().endsWith(".md"));
|
|
377779
377956
|
} catch {
|
|
377780
377957
|
return [];
|
|
377781
377958
|
}
|
|
@@ -377787,7 +377964,7 @@ async function leerMemoria(fuente, maxHechos = 60) {
|
|
|
377787
377964
|
break;
|
|
377788
377965
|
let crudo;
|
|
377789
377966
|
try {
|
|
377790
|
-
crudo = await
|
|
377967
|
+
crudo = await readFile50(join137(fuente.ruta, nombre), "utf8");
|
|
377791
377968
|
} catch {
|
|
377792
377969
|
continue;
|
|
377793
377970
|
}
|
|
@@ -377904,10 +378081,12 @@ var init_registry4 = __esm(() => {
|
|
|
377904
378081
|
init_claudeCode();
|
|
377905
378082
|
init_codex();
|
|
377906
378083
|
init_aider();
|
|
378084
|
+
init_geminiCli();
|
|
377907
378085
|
init_memoriaAgente();
|
|
377908
378086
|
DETECTORES = [
|
|
377909
378087
|
detectorClaudeCode,
|
|
377910
378088
|
detectorCodex,
|
|
378089
|
+
detectorGeminiCli,
|
|
377911
378090
|
detectorAider
|
|
377912
378091
|
];
|
|
377913
378092
|
});
|
|
@@ -377918,7 +378097,7 @@ __export(exports_import, {
|
|
|
377918
378097
|
call: () => call42,
|
|
377919
378098
|
ImportContext: () => ImportContext
|
|
377920
378099
|
});
|
|
377921
|
-
import { readFile as
|
|
378100
|
+
import { readFile as readFile51 } from "fs/promises";
|
|
377922
378101
|
import { homedir as homedir36 } from "os";
|
|
377923
378102
|
import { resolve as resolve42 } from "path";
|
|
377924
378103
|
function resolvePath3(raw) {
|
|
@@ -378029,7 +378208,7 @@ function ImportContext({
|
|
|
378029
378208
|
const abs = resolvePath3(filePath);
|
|
378030
378209
|
let bytes;
|
|
378031
378210
|
try {
|
|
378032
|
-
bytes = await
|
|
378211
|
+
bytes = await readFile51(abs);
|
|
378033
378212
|
} catch {
|
|
378034
378213
|
setError(`No pude leer el archivo: ${abs}`);
|
|
378035
378214
|
setStep("error");
|
|
@@ -385011,7 +385190,7 @@ __export(exports_TheusHome, {
|
|
|
385011
385190
|
default: () => TheusHome_default,
|
|
385012
385191
|
TheusHome: () => TheusHome
|
|
385013
385192
|
});
|
|
385014
|
-
import { readFile as
|
|
385193
|
+
import { readFile as readFile52 } from "fs/promises";
|
|
385015
385194
|
function firstName() {
|
|
385016
385195
|
const info = getOauthAccountInfo();
|
|
385017
385196
|
if (info?.displayName)
|
|
@@ -385054,7 +385233,7 @@ function relativeWhen(iso) {
|
|
|
385054
385233
|
}
|
|
385055
385234
|
async function readMemory() {
|
|
385056
385235
|
try {
|
|
385057
|
-
const raw = await
|
|
385236
|
+
const raw = await readFile52(getGraphPath(getCwd()), "utf8");
|
|
385058
385237
|
const data = JSON.parse(raw);
|
|
385059
385238
|
const nodes = Array.isArray(data.nodes) ? data.nodes : [];
|
|
385060
385239
|
let facts = 0;
|
|
@@ -385836,8 +386015,8 @@ __export(exports_thinkback, {
|
|
|
385836
386015
|
playAnimation: () => playAnimation,
|
|
385837
386016
|
call: () => call51
|
|
385838
386017
|
});
|
|
385839
|
-
import { readFile as
|
|
385840
|
-
import { join as
|
|
386018
|
+
import { readFile as readFile53 } from "fs/promises";
|
|
386019
|
+
import { join as join138 } from "path";
|
|
385841
386020
|
function getMarketplaceName() {
|
|
385842
386021
|
return OFFICIAL_MARKETPLACE_NAME;
|
|
385843
386022
|
}
|
|
@@ -385855,17 +386034,17 @@ async function getThinkbackSkillDir() {
|
|
|
385855
386034
|
if (!thinkbackPlugin) {
|
|
385856
386035
|
return null;
|
|
385857
386036
|
}
|
|
385858
|
-
const skillDir =
|
|
386037
|
+
const skillDir = join138(thinkbackPlugin.path, "skills", SKILL_NAME);
|
|
385859
386038
|
if (await pathExists(skillDir)) {
|
|
385860
386039
|
return skillDir;
|
|
385861
386040
|
}
|
|
385862
386041
|
return null;
|
|
385863
386042
|
}
|
|
385864
386043
|
async function playAnimation(skillDir) {
|
|
385865
|
-
const dataPath =
|
|
385866
|
-
const playerPath =
|
|
386044
|
+
const dataPath = join138(skillDir, "year_in_review.js");
|
|
386045
|
+
const playerPath = join138(skillDir, "player.js");
|
|
385867
386046
|
try {
|
|
385868
|
-
await
|
|
386047
|
+
await readFile53(dataPath);
|
|
385869
386048
|
} catch (e) {
|
|
385870
386049
|
if (isENOENT(e)) {
|
|
385871
386050
|
return {
|
|
@@ -385880,7 +386059,7 @@ async function playAnimation(skillDir) {
|
|
|
385880
386059
|
};
|
|
385881
386060
|
}
|
|
385882
386061
|
try {
|
|
385883
|
-
await
|
|
386062
|
+
await readFile53(playerPath);
|
|
385884
386063
|
} catch (e) {
|
|
385885
386064
|
if (isENOENT(e)) {
|
|
385886
386065
|
return {
|
|
@@ -385911,7 +386090,7 @@ async function playAnimation(skillDir) {
|
|
|
385911
386090
|
} catch {} finally {
|
|
385912
386091
|
inkInstance.exitAlternateScreen();
|
|
385913
386092
|
}
|
|
385914
|
-
const htmlPath =
|
|
386093
|
+
const htmlPath = join138(skillDir, "year_in_review.html");
|
|
385915
386094
|
if (await pathExists(htmlPath)) {
|
|
385916
386095
|
const platform6 = getPlatform();
|
|
385917
386096
|
const openCmd = platform6 === "macos" ? "open" : platform6 === "windows" ? "start" : "xdg-open";
|
|
@@ -386247,7 +386426,7 @@ function ThinkbackFlow(t0) {
|
|
|
386247
386426
|
if (!skillDir) {
|
|
386248
386427
|
return;
|
|
386249
386428
|
}
|
|
386250
|
-
const dataPath =
|
|
386429
|
+
const dataPath = join138(skillDir, "year_in_review.js");
|
|
386251
386430
|
pathExists(dataPath).then((exists) => {
|
|
386252
386431
|
logForDebugging(`Checking for ${dataPath}: ${exists ? "found" : "not found"}`);
|
|
386253
386432
|
setHasGenerated(exists);
|
|
@@ -386421,7 +386600,7 @@ var exports_thinkback_play = {};
|
|
|
386421
386600
|
__export(exports_thinkback_play, {
|
|
386422
386601
|
call: () => call52
|
|
386423
386602
|
});
|
|
386424
|
-
import { join as
|
|
386603
|
+
import { join as join139 } from "path";
|
|
386425
386604
|
function getPluginId2() {
|
|
386426
386605
|
const marketplaceName = OFFICIAL_MARKETPLACE_NAME;
|
|
386427
386606
|
return `thinkback@${marketplaceName}`;
|
|
@@ -386443,7 +386622,7 @@ async function call52() {
|
|
|
386443
386622
|
value: "Thinkback plugin installation path not found."
|
|
386444
386623
|
};
|
|
386445
386624
|
}
|
|
386446
|
-
const skillDir =
|
|
386625
|
+
const skillDir = join139(firstInstall.installPath, "skills", SKILL_NAME2);
|
|
386447
386626
|
const result = await playAnimation(skillDir);
|
|
386448
386627
|
return { type: "text", value: result.message };
|
|
386449
386628
|
}
|
|
@@ -392673,7 +392852,7 @@ __export(exports_branch, {
|
|
|
392673
392852
|
call: () => call60
|
|
392674
392853
|
});
|
|
392675
392854
|
import { randomUUID as randomUUID33 } from "crypto";
|
|
392676
|
-
import { mkdir as mkdir42, readFile as
|
|
392855
|
+
import { mkdir as mkdir42, readFile as readFile54, writeFile as writeFile46 } from "fs/promises";
|
|
392677
392856
|
function deriveFirstPrompt(firstUserMessage) {
|
|
392678
392857
|
const content = firstUserMessage?.message?.content;
|
|
392679
392858
|
if (!content)
|
|
@@ -392692,7 +392871,7 @@ async function createFork(customTitle) {
|
|
|
392692
392871
|
await mkdir42(projectDir, { recursive: true, mode: 448 });
|
|
392693
392872
|
let transcriptContent;
|
|
392694
392873
|
try {
|
|
392695
|
-
transcriptContent = await
|
|
392874
|
+
transcriptContent = await readFile54(currentTranscriptPath);
|
|
392696
392875
|
} catch {
|
|
392697
392876
|
throw new Error("No hay conversaci\xF3n que ramificar");
|
|
392698
392877
|
}
|
|
@@ -392945,8 +393124,8 @@ var init_types14 = __esm(() => {
|
|
|
392945
393124
|
});
|
|
392946
393125
|
|
|
392947
393126
|
// components/agents/agentFileUtils.ts
|
|
392948
|
-
import { mkdir as mkdir43, open as
|
|
392949
|
-
import { join as
|
|
393127
|
+
import { mkdir as mkdir43, open as open18, unlink as unlink20 } from "fs/promises";
|
|
393128
|
+
import { join as join140 } from "path";
|
|
392950
393129
|
function formatAgentAsMarkdown(agentType, whenToUse, tools, systemPrompt, color3, model, memory2, effort) {
|
|
392951
393130
|
const escapedWhenToUse = whenToUse.replace(/\\/g, "\\\\").replace(/"/g, "\\\"").replace(/\n/g, "\\\\n");
|
|
392952
393131
|
const isAllTools = tools === undefined || tools.length === 1 && tools[0] === "*";
|
|
@@ -392973,26 +393152,26 @@ function getAgentDirectoryPath(location) {
|
|
|
392973
393152
|
case "flagSettings":
|
|
392974
393153
|
throw new Error(`Cannot get directory path for ${location} agents`);
|
|
392975
393154
|
case "userSettings":
|
|
392976
|
-
return
|
|
393155
|
+
return join140(getTheusConfigHomeDir(), AGENT_PATHS.AGENTS_DIR);
|
|
392977
393156
|
case "projectSettings":
|
|
392978
|
-
return
|
|
393157
|
+
return join140(getCwd(), AGENT_PATHS.FOLDER_NAME, AGENT_PATHS.AGENTS_DIR);
|
|
392979
393158
|
case "policySettings":
|
|
392980
|
-
return
|
|
393159
|
+
return join140(getManagedFilePath(), AGENT_PATHS.FOLDER_NAME, AGENT_PATHS.AGENTS_DIR);
|
|
392981
393160
|
case "localSettings":
|
|
392982
|
-
return
|
|
393161
|
+
return join140(getCwd(), AGENT_PATHS.FOLDER_NAME, AGENT_PATHS.AGENTS_DIR);
|
|
392983
393162
|
}
|
|
392984
393163
|
}
|
|
392985
393164
|
function getRelativeAgentDirectoryPath(location) {
|
|
392986
393165
|
switch (location) {
|
|
392987
393166
|
case "projectSettings":
|
|
392988
|
-
return
|
|
393167
|
+
return join140(".", AGENT_PATHS.FOLDER_NAME, AGENT_PATHS.AGENTS_DIR);
|
|
392989
393168
|
default:
|
|
392990
393169
|
return getAgentDirectoryPath(location);
|
|
392991
393170
|
}
|
|
392992
393171
|
}
|
|
392993
393172
|
function getNewAgentFilePath(agent) {
|
|
392994
393173
|
const dirPath = getAgentDirectoryPath(agent.source);
|
|
392995
|
-
return
|
|
393174
|
+
return join140(dirPath, `${agent.agentType}.md`);
|
|
392996
393175
|
}
|
|
392997
393176
|
function getActualAgentFilePath(agent) {
|
|
392998
393177
|
if (agent.source === "built-in") {
|
|
@@ -393003,14 +393182,14 @@ function getActualAgentFilePath(agent) {
|
|
|
393003
393182
|
}
|
|
393004
393183
|
const dirPath = getAgentDirectoryPath(agent.source);
|
|
393005
393184
|
const filename = agent.filename || agent.agentType;
|
|
393006
|
-
return
|
|
393185
|
+
return join140(dirPath, `${filename}.md`);
|
|
393007
393186
|
}
|
|
393008
393187
|
function getNewRelativeAgentFilePath(agent) {
|
|
393009
393188
|
if (agent.source === "built-in") {
|
|
393010
393189
|
return "Built-in";
|
|
393011
393190
|
}
|
|
393012
393191
|
const dirPath = getRelativeAgentDirectoryPath(agent.source);
|
|
393013
|
-
return
|
|
393192
|
+
return join140(dirPath, `${agent.agentType}.md`);
|
|
393014
393193
|
}
|
|
393015
393194
|
function getActualRelativeAgentFilePath(agent) {
|
|
393016
393195
|
if (isBuiltInAgent(agent)) {
|
|
@@ -393024,7 +393203,7 @@ function getActualRelativeAgentFilePath(agent) {
|
|
|
393024
393203
|
}
|
|
393025
393204
|
const dirPath = getRelativeAgentDirectoryPath(agent.source);
|
|
393026
393205
|
const filename = agent.filename || agent.agentType;
|
|
393027
|
-
return
|
|
393206
|
+
return join140(dirPath, `${filename}.md`);
|
|
393028
393207
|
}
|
|
393029
393208
|
async function ensureAgentDirectoryExists(source) {
|
|
393030
393209
|
const dirPath = getAgentDirectoryPath(source);
|
|
@@ -393070,7 +393249,7 @@ async function deleteAgentFromFile(agent) {
|
|
|
393070
393249
|
}
|
|
393071
393250
|
}
|
|
393072
393251
|
async function writeFileAndFlush(filePath, content, flag = "w") {
|
|
393073
|
-
const handle2 = await
|
|
393252
|
+
const handle2 = await open18(filePath, flag);
|
|
393074
393253
|
try {
|
|
393075
393254
|
await handle2.writeFile(content, { encoding: "utf-8" });
|
|
393076
393255
|
await handle2.datasync();
|
|
@@ -399036,8 +399215,8 @@ var init_rewind = __esm(() => {
|
|
|
399036
399215
|
|
|
399037
399216
|
// utils/heapDumpService.ts
|
|
399038
399217
|
import { createWriteStream as createWriteStream3, writeFileSync as writeFileSync7 } from "fs";
|
|
399039
|
-
import { readdir as
|
|
399040
|
-
import { join as
|
|
399218
|
+
import { readdir as readdir33, readFile as readFile55, writeFile as writeFile47 } from "fs/promises";
|
|
399219
|
+
import { join as join141 } from "path";
|
|
399041
399220
|
import { pipeline as pipeline2 } from "stream/promises";
|
|
399042
399221
|
import {
|
|
399043
399222
|
getHeapSnapshot,
|
|
@@ -399057,11 +399236,11 @@ async function captureMemoryDiagnostics(trigger, dumpNumber = 0) {
|
|
|
399057
399236
|
const activeRequests = process._getActiveRequests().length;
|
|
399058
399237
|
let openFileDescriptors;
|
|
399059
399238
|
try {
|
|
399060
|
-
openFileDescriptors = (await
|
|
399239
|
+
openFileDescriptors = (await readdir33("/proc/self/fd")).length;
|
|
399061
399240
|
} catch {}
|
|
399062
399241
|
let smapsRollup;
|
|
399063
399242
|
try {
|
|
399064
|
-
smapsRollup = await
|
|
399243
|
+
smapsRollup = await readFile55("/proc/self/smaps_rollup", "utf8");
|
|
399065
399244
|
} catch {}
|
|
399066
399245
|
const nativeMemory = usage2.rss - usage2.heapUsed;
|
|
399067
399246
|
const bytesPerSecond = uptimeSeconds > 0 ? usage2.rss / uptimeSeconds : 0;
|
|
@@ -399127,7 +399306,7 @@ async function captureMemoryDiagnostics(trigger, dumpNumber = 0) {
|
|
|
399127
399306
|
smapsRollup,
|
|
399128
399307
|
platform: process.platform,
|
|
399129
399308
|
nodeVersion: process.version,
|
|
399130
|
-
ccVersion: { VERSION: "0.2.
|
|
399309
|
+
ccVersion: { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
399131
399310
|
};
|
|
399132
399311
|
}
|
|
399133
399312
|
async function performHeapDump(trigger = "manual", dumpNumber = 0) {
|
|
@@ -399145,8 +399324,8 @@ async function performHeapDump(trigger = "manual", dumpNumber = 0) {
|
|
|
399145
399324
|
const suffix = dumpNumber > 0 ? `-dump${dumpNumber}` : "";
|
|
399146
399325
|
const heapFilename = `${sessionId}${suffix}.heapsnapshot`;
|
|
399147
399326
|
const diagFilename = `${sessionId}${suffix}-diagnostics.json`;
|
|
399148
|
-
const heapPath =
|
|
399149
|
-
const diagPath =
|
|
399327
|
+
const heapPath = join141(dumpDir, heapFilename);
|
|
399328
|
+
const diagPath = join141(dumpDir, diagFilename);
|
|
399150
399329
|
await writeFile47(diagPath, jsonStringify(diagnostics, null, 2), {
|
|
399151
399330
|
mode: 384
|
|
399152
399331
|
});
|
|
@@ -399888,7 +400067,7 @@ var init_bridge_kick = __esm(() => {
|
|
|
399888
400067
|
var call68 = async () => {
|
|
399889
400068
|
return {
|
|
399890
400069
|
type: "text",
|
|
399891
|
-
value: { VERSION: "0.2.
|
|
400070
|
+
value: { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.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.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.73", BUILD_TIME: "1970-01-01T00:00:00.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.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
399892
400071
|
};
|
|
399893
400072
|
}, version2, version_default;
|
|
399894
400073
|
var init_version = __esm(() => {
|
|
@@ -402328,8 +402507,8 @@ var init_advisor2 = __esm(() => {
|
|
|
402328
402507
|
|
|
402329
402508
|
// skills/bundledSkills.ts
|
|
402330
402509
|
import { constants as fsConstants5 } from "fs";
|
|
402331
|
-
import { mkdir as mkdir44, open as
|
|
402332
|
-
import { dirname as dirname58, isAbsolute as isAbsolute28, join as
|
|
402510
|
+
import { mkdir as mkdir44, open as open19 } from "fs/promises";
|
|
402511
|
+
import { dirname as dirname58, isAbsolute as isAbsolute28, join as join142, normalize as normalize13, sep as pathSep2 } from "path";
|
|
402333
402512
|
function registerBundledSkill(definition) {
|
|
402334
402513
|
const { files: files2 } = definition;
|
|
402335
402514
|
let skillRoot;
|
|
@@ -402377,7 +402556,7 @@ function getBundledSkills() {
|
|
|
402377
402556
|
return [...bundledSkills];
|
|
402378
402557
|
}
|
|
402379
402558
|
function getBundledSkillExtractDir(skillName) {
|
|
402380
|
-
return
|
|
402559
|
+
return join142(getBundledSkillsRoot(), skillName);
|
|
402381
402560
|
}
|
|
402382
402561
|
async function extractBundledSkillFiles(skillName, files2) {
|
|
402383
402562
|
const dir = getBundledSkillExtractDir(skillName);
|
|
@@ -402407,7 +402586,7 @@ async function writeSkillFiles(dir, files2) {
|
|
|
402407
402586
|
}));
|
|
402408
402587
|
}
|
|
402409
402588
|
async function safeWriteFile(p, content) {
|
|
402410
|
-
const fh = await
|
|
402589
|
+
const fh = await open19(p, SAFE_WRITE_FLAGS, 384);
|
|
402411
402590
|
try {
|
|
402412
402591
|
await fh.writeFile(content, "utf8");
|
|
402413
402592
|
} finally {
|
|
@@ -402419,7 +402598,7 @@ function resolveSkillFilePath(baseDir, relPath) {
|
|
|
402419
402598
|
if (isAbsolute28(normalized) || normalized.split(pathSep2).includes("..") || normalized.split("/").includes("..")) {
|
|
402420
402599
|
throw new Error(`bundled skill file path escapes skill dir: ${relPath}`);
|
|
402421
402600
|
}
|
|
402422
|
-
return
|
|
402601
|
+
return join142(baseDir, normalized);
|
|
402423
402602
|
}
|
|
402424
402603
|
function prependBaseDir(blocks, baseDir) {
|
|
402425
402604
|
const prefix = `Base directory for this skill: ${baseDir}
|
|
@@ -402489,7 +402668,7 @@ var SECRET_NAME_PATTERN, EXTRA_ENV_ALLOWLIST, REDACTED2 = "\u2039oculto\u203A",
|
|
|
402489
402668
|
const lines = [];
|
|
402490
402669
|
lines.push("## Entorno de ejecuci\xF3n");
|
|
402491
402670
|
lines.push("");
|
|
402492
|
-
const version3 = { VERSION: "0.2.
|
|
402671
|
+
const version3 = { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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";
|
|
402493
402672
|
lines.push(`- Versi\xF3n de Theus: ${version3}`);
|
|
402494
402673
|
lines.push(`- Directorio de trabajo: ${getCwd()}`);
|
|
402495
402674
|
lines.push(`- \xBFRepositorio git?: ${isGit ? "s\xED" : "no"}`);
|
|
@@ -402930,7 +403109,7 @@ var init_exit2 = __esm(() => {
|
|
|
402930
403109
|
});
|
|
402931
403110
|
|
|
402932
403111
|
// components/ExportDialog.tsx
|
|
402933
|
-
import { join as
|
|
403112
|
+
import { join as join143 } from "path";
|
|
402934
403113
|
function ExportDialog({
|
|
402935
403114
|
content,
|
|
402936
403115
|
defaultFilename,
|
|
@@ -402963,7 +403142,7 @@ function ExportDialog({
|
|
|
402963
403142
|
};
|
|
402964
403143
|
const handleFilenameSubmit = () => {
|
|
402965
403144
|
const finalFilename = filename.endsWith(".txt") ? filename : filename.replace(/\.[^.]+$/, "") + ".txt";
|
|
402966
|
-
const filepath =
|
|
403145
|
+
const filepath = join143(getCwd(), finalFilename);
|
|
402967
403146
|
try {
|
|
402968
403147
|
writeFileSync_DEPRECATED(filepath, content, {
|
|
402969
403148
|
encoding: "utf-8",
|
|
@@ -403186,7 +403365,7 @@ __export(exports_export, {
|
|
|
403186
403365
|
extractFirstPrompt: () => extractFirstPrompt,
|
|
403187
403366
|
call: () => call80
|
|
403188
403367
|
});
|
|
403189
|
-
import { join as
|
|
403368
|
+
import { join as join144 } from "path";
|
|
403190
403369
|
function formatTimestamp(date6) {
|
|
403191
403370
|
const year = date6.getFullYear();
|
|
403192
403371
|
const month = String(date6.getMonth() + 1).padStart(2, "0");
|
|
@@ -403230,7 +403409,7 @@ async function call80(onDone, context3, args) {
|
|
|
403230
403409
|
const filename = args.trim();
|
|
403231
403410
|
if (filename) {
|
|
403232
403411
|
const finalFilename = filename.endsWith(".txt") ? filename : filename.replace(/\.[^.]+$/, "") + ".txt";
|
|
403233
|
-
const filepath =
|
|
403412
|
+
const filepath = join144(getCwd(), finalFilename);
|
|
403234
403413
|
try {
|
|
403235
403414
|
writeFileSync_DEPRECATED(filepath, content, {
|
|
403236
403415
|
encoding: "utf-8",
|
|
@@ -404860,7 +405039,7 @@ import {
|
|
|
404860
405039
|
writeFileSync as writeFileSync8
|
|
404861
405040
|
} from "fs";
|
|
404862
405041
|
import { tmpdir as tmpdir10 } from "os";
|
|
404863
|
-
import { dirname as dirname59, join as
|
|
405042
|
+
import { dirname as dirname59, join as join145 } from "path";
|
|
404864
405043
|
function naupaVersionOf(bin) {
|
|
404865
405044
|
try {
|
|
404866
405045
|
const out = spawnSync9(bin, ["--version"], {
|
|
@@ -404896,7 +405075,7 @@ function rescatarNaupaMalUbicado(binEnUso, options2 = {}) {
|
|
|
404896
405075
|
const platform6 = options2.platform ?? process.platform;
|
|
404897
405076
|
const versionOf = options2.versionOf ?? naupaVersionOf;
|
|
404898
405077
|
const nombre = platform6 === "win32" ? "naupa.exe" : "naupa";
|
|
404899
|
-
const rutaFija =
|
|
405078
|
+
const rutaFija = join145(home, ".local", "bin", nombre);
|
|
404900
405079
|
if (!existsSync22(rutaFija))
|
|
404901
405080
|
return;
|
|
404902
405081
|
try {
|
|
@@ -404986,7 +405165,7 @@ function isReleaseBundleInstall() {
|
|
|
404986
405165
|
return false;
|
|
404987
405166
|
if (real.includes("node_modules"))
|
|
404988
405167
|
return false;
|
|
404989
|
-
return existsSync22(
|
|
405168
|
+
return existsSync22(join145(dirname59(real), "bin", "theus"));
|
|
404990
405169
|
} catch {
|
|
404991
405170
|
return false;
|
|
404992
405171
|
}
|
|
@@ -405030,20 +405209,20 @@ async function updateReleaseBundle() {
|
|
|
405030
405209
|
await gracefulShutdown(1);
|
|
405031
405210
|
return;
|
|
405032
405211
|
}
|
|
405033
|
-
if (gte({ VERSION: "0.2.
|
|
405034
|
-
writeToStdout(source_default.green(`Theus ya est\xE1 al d\xEDa (${{ VERSION: "0.2.
|
|
405212
|
+
if (gte({ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
|
|
405213
|
+
writeToStdout(source_default.green(`Theus ya est\xE1 al d\xEDa (${{ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})`) + `
|
|
405035
405214
|
`);
|
|
405036
405215
|
await gracefulShutdown(0);
|
|
405037
405216
|
return;
|
|
405038
405217
|
}
|
|
405039
|
-
writeToStdout(`Nueva versi\xF3n disponible: ${latest} (actual: ${{ VERSION: "0.2.
|
|
405218
|
+
writeToStdout(`Nueva versi\xF3n disponible: ${latest} (actual: ${{ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})
|
|
405040
405219
|
`);
|
|
405041
405220
|
writeToStdout(`Instalando la actualizaci\xF3n desde theus.pe/dl...
|
|
405042
405221
|
`);
|
|
405043
|
-
const tmp = mkdtempSync(
|
|
405222
|
+
const tmp = mkdtempSync(join145(tmpdir10(), "theus-update-"));
|
|
405044
405223
|
try {
|
|
405045
|
-
const tarPath =
|
|
405046
|
-
const sumsPath =
|
|
405224
|
+
const tarPath = join145(tmp, "theus-cli.tar.gz");
|
|
405225
|
+
const sumsPath = join145(tmp, "SHA256SUMS");
|
|
405047
405226
|
if (!await downloadToFile(`${DL_BASE}/theus-cli.tar.gz`, tarPath) || !await downloadToFile(`${DL_BASE}/SHA256SUMS`, sumsPath)) {
|
|
405048
405227
|
process.stderr.write(source_default.red(`Fall\xF3 la descarga del release desde theus.pe/dl.
|
|
405049
405228
|
`));
|
|
@@ -405062,15 +405241,15 @@ async function updateReleaseBundle() {
|
|
|
405062
405241
|
const ex = spawnSync9("tar", ["-xzf", tarPath, "-C", tmp], {
|
|
405063
405242
|
stdio: "ignore"
|
|
405064
405243
|
});
|
|
405065
|
-
const staged =
|
|
405066
|
-
if (ex.status !== 0 || !existsSync22(
|
|
405244
|
+
const staged = join145(tmp, "theus-cli");
|
|
405245
|
+
if (ex.status !== 0 || !existsSync22(join145(staged, "cli.js"))) {
|
|
405067
405246
|
process.stderr.write(source_default.red(`No pude extraer el release descargado (o vino incompleto).
|
|
405068
405247
|
`));
|
|
405069
405248
|
await gracefulShutdown(1);
|
|
405070
405249
|
return;
|
|
405071
405250
|
}
|
|
405072
405251
|
cpSync(staged, bundleDir, { recursive: true, force: true });
|
|
405073
|
-
writeToStdout(source_default.green(`Actualizado correctamente de ${{ VERSION: "0.2.
|
|
405252
|
+
writeToStdout(source_default.green(`Actualizado correctamente de ${{ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}`) + `
|
|
405074
405253
|
`);
|
|
405075
405254
|
await regenerateCompletionCache();
|
|
405076
405255
|
} finally {
|
|
@@ -405083,7 +405262,7 @@ async function updateReleaseBundle() {
|
|
|
405083
405262
|
async function update() {
|
|
405084
405263
|
logEvent("theus_update_check", {});
|
|
405085
405264
|
await updateNaupa();
|
|
405086
|
-
writeToStdout(`Versi\xF3n actual: ${{ VERSION: "0.2.
|
|
405265
|
+
writeToStdout(`Versi\xF3n actual: ${{ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}
|
|
405087
405266
|
`);
|
|
405088
405267
|
const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
|
|
405089
405268
|
writeToStdout(`Buscando actualizaciones en el canal ${channel2}...
|
|
@@ -405162,8 +405341,8 @@ async function update() {
|
|
|
405162
405341
|
writeToStdout(`Theus est\xE1 gestionado por Homebrew.
|
|
405163
405342
|
`);
|
|
405164
405343
|
const latest = await getLatestVersion(channel2);
|
|
405165
|
-
if (latest && !gte({ VERSION: "0.2.
|
|
405166
|
-
writeToStdout(`Actualizaci\xF3n disponible: ${{ VERSION: "0.2.
|
|
405344
|
+
if (latest && !gte({ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
|
|
405345
|
+
writeToStdout(`Actualizaci\xF3n disponible: ${{ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}
|
|
405167
405346
|
`);
|
|
405168
405347
|
writeToStdout(`
|
|
405169
405348
|
`);
|
|
@@ -405179,8 +405358,8 @@ async function update() {
|
|
|
405179
405358
|
writeToStdout(`Theus est\xE1 gestionado por winget.
|
|
405180
405359
|
`);
|
|
405181
405360
|
const latest = await getLatestVersion(channel2);
|
|
405182
|
-
if (latest && !gte({ VERSION: "0.2.
|
|
405183
|
-
writeToStdout(`Actualizaci\xF3n disponible: ${{ VERSION: "0.2.
|
|
405361
|
+
if (latest && !gte({ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
|
|
405362
|
+
writeToStdout(`Actualizaci\xF3n disponible: ${{ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}
|
|
405184
405363
|
`);
|
|
405185
405364
|
writeToStdout(`
|
|
405186
405365
|
`);
|
|
@@ -405196,8 +405375,8 @@ async function update() {
|
|
|
405196
405375
|
writeToStdout(`Theus est\xE1 gestionado por apk.
|
|
405197
405376
|
`);
|
|
405198
405377
|
const latest = await getLatestVersion(channel2);
|
|
405199
|
-
if (latest && !gte({ VERSION: "0.2.
|
|
405200
|
-
writeToStdout(`Actualizaci\xF3n disponible: ${{ VERSION: "0.2.
|
|
405378
|
+
if (latest && !gte({ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
|
|
405379
|
+
writeToStdout(`Actualizaci\xF3n disponible: ${{ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}
|
|
405201
405380
|
`);
|
|
405202
405381
|
writeToStdout(`
|
|
405203
405382
|
`);
|
|
@@ -405262,11 +405441,11 @@ async function update() {
|
|
|
405262
405441
|
`);
|
|
405263
405442
|
await gracefulShutdown(1);
|
|
405264
405443
|
}
|
|
405265
|
-
if (result.latestVersion === { VERSION: "0.2.
|
|
405266
|
-
writeToStdout(source_default.green(`Theus ya est\xE1 al d\xEDa (${{ VERSION: "0.2.
|
|
405444
|
+
if (result.latestVersion === { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION) {
|
|
405445
|
+
writeToStdout(source_default.green(`Theus ya est\xE1 al d\xEDa (${{ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})`) + `
|
|
405267
405446
|
`);
|
|
405268
405447
|
} else {
|
|
405269
|
-
writeToStdout(source_default.green(`Actualizado correctamente de ${{ VERSION: "0.2.
|
|
405448
|
+
writeToStdout(source_default.green(`Actualizado correctamente de ${{ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}`) + `
|
|
405270
405449
|
`);
|
|
405271
405450
|
await regenerateCompletionCache();
|
|
405272
405451
|
}
|
|
@@ -405285,9 +405464,9 @@ async function update() {
|
|
|
405285
405464
|
await removeInstalledSymlink();
|
|
405286
405465
|
}
|
|
405287
405466
|
logForDebugging("update: Checking npm registry for latest version");
|
|
405288
|
-
logForDebugging(`update: Package URL: ${{ VERSION: "0.2.
|
|
405467
|
+
logForDebugging(`update: Package URL: ${{ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.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}`);
|
|
405289
405468
|
const npmTag = channel2 === "stable" ? "stable" : "latest";
|
|
405290
|
-
const npmCommand = `npm view ${{ VERSION: "0.2.
|
|
405469
|
+
const npmCommand = `npm view ${{ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.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`;
|
|
405291
405470
|
logForDebugging(`update: Running: ${npmCommand}`);
|
|
405292
405471
|
const latestVersion = await getLatestVersion(channel2);
|
|
405293
405472
|
logForDebugging(`update: Latest version from npm: ${latestVersion || "FAILED"}`);
|
|
@@ -405307,7 +405486,7 @@ async function update() {
|
|
|
405307
405486
|
`);
|
|
405308
405487
|
process.stderr.write(` \u2022 Un proxy o firewall corporativo bloquea npm
|
|
405309
405488
|
`);
|
|
405310
|
-
if ({ VERSION: "0.2.
|
|
405489
|
+
if ({ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.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.73", BUILD_TIME: "1970-01-01T00:00:00.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")) {
|
|
405311
405490
|
process.stderr.write(` \u2022 Compilaci\xF3n interna/de desarrollo no publicada en npm
|
|
405312
405491
|
`);
|
|
405313
405492
|
}
|
|
@@ -405319,19 +405498,19 @@ async function update() {
|
|
|
405319
405498
|
`);
|
|
405320
405499
|
process.stderr.write(` \u2022 Ejecuta con el flag --debug para m\xE1s detalle
|
|
405321
405500
|
`);
|
|
405322
|
-
const packageName = { VERSION: "0.2.
|
|
405501
|
+
const packageName = { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.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";
|
|
405323
405502
|
process.stderr.write(` \u2022 Comprueba a mano: npm view ${packageName} version
|
|
405324
405503
|
`);
|
|
405325
405504
|
process.stderr.write(` \u2022 Comprueba si te falta iniciar sesi\xF3n: npm whoami
|
|
405326
405505
|
`);
|
|
405327
405506
|
await gracefulShutdown(1);
|
|
405328
405507
|
}
|
|
405329
|
-
if (gte({ VERSION: "0.2.
|
|
405330
|
-
writeToStdout(source_default.green(`Theus ya est\xE1 al d\xEDa (${{ VERSION: "0.2.
|
|
405508
|
+
if (gte({ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
|
|
405509
|
+
writeToStdout(source_default.green(`Theus ya est\xE1 al d\xEDa (${{ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})`) + `
|
|
405331
405510
|
`);
|
|
405332
405511
|
await gracefulShutdown(0);
|
|
405333
405512
|
}
|
|
405334
|
-
writeToStdout(`Nueva versi\xF3n disponible: ${latestVersion} (actual: ${{ VERSION: "0.2.
|
|
405513
|
+
writeToStdout(`Nueva versi\xF3n disponible: ${latestVersion} (actual: ${{ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})
|
|
405335
405514
|
`);
|
|
405336
405515
|
writeToStdout(`Instalando la actualizaci\xF3n...
|
|
405337
405516
|
`);
|
|
@@ -405376,7 +405555,7 @@ async function update() {
|
|
|
405376
405555
|
logForDebugging(`update: Installation status: ${status2}`);
|
|
405377
405556
|
switch (status2) {
|
|
405378
405557
|
case "success":
|
|
405379
|
-
writeToStdout(source_default.green(`Actualizado correctamente de ${{ VERSION: "0.2.
|
|
405558
|
+
writeToStdout(source_default.green(`Actualizado correctamente de ${{ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}`) + `
|
|
405380
405559
|
`);
|
|
405381
405560
|
await regenerateCompletionCache();
|
|
405382
405561
|
break;
|
|
@@ -405386,7 +405565,7 @@ async function update() {
|
|
|
405386
405565
|
if (useLocalUpdate) {
|
|
405387
405566
|
process.stderr.write(`Prueba a actualizar a mano con:
|
|
405388
405567
|
`);
|
|
405389
|
-
process.stderr.write(` cd ~/.theus/local && npm update ${{ VERSION: "0.2.
|
|
405568
|
+
process.stderr.write(` cd ~/.theus/local && npm update ${{ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.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}
|
|
405390
405569
|
`);
|
|
405391
405570
|
} else {
|
|
405392
405571
|
process.stderr.write(`Prueba con sudo o corrige los permisos de npm
|
|
@@ -405402,7 +405581,7 @@ async function update() {
|
|
|
405402
405581
|
if (useLocalUpdate) {
|
|
405403
405582
|
process.stderr.write(`Prueba a actualizar a mano con:
|
|
405404
405583
|
`);
|
|
405405
|
-
process.stderr.write(` cd ~/.theus/local && npm update ${{ VERSION: "0.2.
|
|
405584
|
+
process.stderr.write(` cd ~/.theus/local && npm update ${{ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.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}
|
|
405406
405585
|
`);
|
|
405407
405586
|
} else {
|
|
405408
405587
|
process.stderr.write(`O p\xE1sate a la instalaci\xF3n nativa con: theus install
|
|
@@ -405870,8 +406049,8 @@ var init_effort3 = __esm(() => {
|
|
|
405870
406049
|
|
|
405871
406050
|
// utils/statsCache.ts
|
|
405872
406051
|
import { randomBytes as randomBytes20 } from "crypto";
|
|
405873
|
-
import { open as
|
|
405874
|
-
import { join as
|
|
406052
|
+
import { open as open20 } from "fs/promises";
|
|
406053
|
+
import { join as join146 } from "path";
|
|
405875
406054
|
async function withStatsCacheLock(fn) {
|
|
405876
406055
|
while (statsCacheLockPromise) {
|
|
405877
406056
|
await statsCacheLockPromise;
|
|
@@ -405888,7 +406067,7 @@ async function withStatsCacheLock(fn) {
|
|
|
405888
406067
|
}
|
|
405889
406068
|
}
|
|
405890
406069
|
function getStatsCachePath() {
|
|
405891
|
-
return
|
|
406070
|
+
return join146(getTheusConfigHomeDir(), STATS_CACHE_FILENAME);
|
|
405892
406071
|
}
|
|
405893
406072
|
function getEmptyCache() {
|
|
405894
406073
|
return {
|
|
@@ -405966,7 +406145,7 @@ async function saveStatsCache(cache4) {
|
|
|
405966
406145
|
await fs5.mkdir(configDir);
|
|
405967
406146
|
} catch {}
|
|
405968
406147
|
const content = jsonStringify(cache4, null, 2);
|
|
405969
|
-
const handle2 = await
|
|
406148
|
+
const handle2 = await open20(tempPath, "w", 384);
|
|
405970
406149
|
try {
|
|
405971
406150
|
await handle2.writeFile(content, { encoding: "utf-8" });
|
|
405972
406151
|
await handle2.sync();
|
|
@@ -406558,12 +406737,12 @@ var init_ansiToPng = __esm(() => {
|
|
|
406558
406737
|
// utils/screenshotClipboard.ts
|
|
406559
406738
|
import { mkdir as mkdir45, unlink as unlink21, writeFile as writeFile48 } from "fs/promises";
|
|
406560
406739
|
import { tmpdir as tmpdir11 } from "os";
|
|
406561
|
-
import { join as
|
|
406740
|
+
import { join as join147 } from "path";
|
|
406562
406741
|
async function copyAnsiToClipboard(ansiText, options2) {
|
|
406563
406742
|
try {
|
|
406564
|
-
const tempDir =
|
|
406743
|
+
const tempDir = join147(tmpdir11(), "theus-code-screenshots");
|
|
406565
406744
|
await mkdir45(tempDir, { recursive: true });
|
|
406566
|
-
const pngPath =
|
|
406745
|
+
const pngPath = join147(tempDir, `screenshot-${Date.now()}.png`);
|
|
406567
406746
|
const pngBuffer = ansiToPng(ansiText, options2);
|
|
406568
406747
|
await writeFile48(pngPath, pngBuffer);
|
|
406569
406748
|
const result = await copyPngToClipboard(pngPath);
|
|
@@ -406633,8 +406812,8 @@ var init_screenshotClipboard = __esm(() => {
|
|
|
406633
406812
|
});
|
|
406634
406813
|
|
|
406635
406814
|
// utils/stats.ts
|
|
406636
|
-
import { open as
|
|
406637
|
-
import { basename as basename45, join as
|
|
406815
|
+
import { open as open21 } from "fs/promises";
|
|
406816
|
+
import { basename as basename45, join as join148, sep as sep29 } from "path";
|
|
406638
406817
|
async function processSessionFiles(sessionFiles, options2 = {}) {
|
|
406639
406818
|
const { fromDate, toDate } = options2;
|
|
406640
406819
|
const fs5 = getFsImplementation();
|
|
@@ -406812,17 +406991,17 @@ async function getAllSessionFiles() {
|
|
|
406812
406991
|
return [];
|
|
406813
406992
|
throw e;
|
|
406814
406993
|
}
|
|
406815
|
-
const projectDirs = allEntries.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
406994
|
+
const projectDirs = allEntries.filter((dirent) => dirent.isDirectory()).map((dirent) => join148(projectsDir, dirent.name));
|
|
406816
406995
|
const projectResults = await Promise.all(projectDirs.map(async (projectDir) => {
|
|
406817
406996
|
try {
|
|
406818
406997
|
const entries = await fs5.readdir(projectDir);
|
|
406819
|
-
const mainFiles = entries.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".jsonl")).map((dirent) =>
|
|
406998
|
+
const mainFiles = entries.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".jsonl")).map((dirent) => join148(projectDir, dirent.name));
|
|
406820
406999
|
const sessionDirs = entries.filter((dirent) => dirent.isDirectory());
|
|
406821
407000
|
const subagentResults = await Promise.all(sessionDirs.map(async (sessionDir) => {
|
|
406822
|
-
const subagentsDir =
|
|
407001
|
+
const subagentsDir = join148(projectDir, sessionDir.name, "subagents");
|
|
406823
407002
|
try {
|
|
406824
407003
|
const subagentEntries = await fs5.readdir(subagentsDir);
|
|
406825
|
-
return subagentEntries.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".jsonl") && dirent.name.startsWith("agent-")).map((dirent) =>
|
|
407004
|
+
return subagentEntries.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".jsonl") && dirent.name.startsWith("agent-")).map((dirent) => join148(subagentsDir, dirent.name));
|
|
406826
407005
|
} catch {
|
|
406827
407006
|
return [];
|
|
406828
407007
|
}
|
|
@@ -407122,7 +407301,7 @@ function calculateStreaks(dailyActivity) {
|
|
|
407122
407301
|
}
|
|
407123
407302
|
async function readSessionStartDate(filePath) {
|
|
407124
407303
|
try {
|
|
407125
|
-
const fd2 = await
|
|
407304
|
+
const fd2 = await open21(filePath, "r");
|
|
407126
407305
|
try {
|
|
407127
407306
|
const buf = Buffer.allocUnsafe(4096);
|
|
407128
407307
|
const { bytesRead } = await fd2.read(buf, 0, buf.length, 0);
|
|
@@ -409577,7 +409756,7 @@ __export(exports_assistant, {
|
|
|
409577
409756
|
NewInstallWizard: () => NewInstallWizard
|
|
409578
409757
|
});
|
|
409579
409758
|
import { existsSync as existsSync23, mkdirSync as mkdirSync10, readFileSync as readFileSync29, writeFileSync as writeFileSync9 } from "fs";
|
|
409580
|
-
import { dirname as dirname61, join as
|
|
409759
|
+
import { dirname as dirname61, join as join149, resolve as resolve43 } from "path";
|
|
409581
409760
|
async function computeDefaultInstallDir() {
|
|
409582
409761
|
try {
|
|
409583
409762
|
return getOriginalCwd();
|
|
@@ -409602,16 +409781,16 @@ function writeJson(path17, value) {
|
|
|
409602
409781
|
}
|
|
409603
409782
|
function installAssistant(dir) {
|
|
409604
409783
|
const root2 = resolve43(dir);
|
|
409605
|
-
const theusDir =
|
|
409606
|
-
const settingsPath =
|
|
409784
|
+
const theusDir = join149(root2, ".theus");
|
|
409785
|
+
const settingsPath = join149(theusDir, "settings.json");
|
|
409607
409786
|
const settings = readJsonSafe(settingsPath);
|
|
409608
409787
|
settings.assistant = true;
|
|
409609
409788
|
writeJson(settingsPath, settings);
|
|
409610
|
-
const localPath =
|
|
409789
|
+
const localPath = join149(theusDir, "settings.local.json");
|
|
409611
409790
|
const local = readJsonSafe(localPath);
|
|
409612
409791
|
local.defaultView = "chat";
|
|
409613
409792
|
writeJson(localPath, local);
|
|
409614
|
-
const agentPath =
|
|
409793
|
+
const agentPath = join149(theusDir, "agents", "assistant.md");
|
|
409615
409794
|
mkdirSync10(dirname61(agentPath), { recursive: true });
|
|
409616
409795
|
writeFileSync9(agentPath, ASSISTANT_AGENT_MD, "utf8");
|
|
409617
409796
|
return root2;
|
|
@@ -411274,11 +411453,11 @@ function BuddyPanel({
|
|
|
411274
411453
|
/* @__PURE__ */ jsx_runtime369.jsx(ThemedBox_default, {
|
|
411275
411454
|
flexDirection: "column",
|
|
411276
411455
|
marginTop: 1,
|
|
411277
|
-
children: STAT_NAMES.map((
|
|
411278
|
-
label: STAT_ES[
|
|
411279
|
-
value: companion.stats[
|
|
411456
|
+
children: STAT_NAMES.map((stat48) => /* @__PURE__ */ jsx_runtime369.jsx(StatRow, {
|
|
411457
|
+
label: STAT_ES[stat48],
|
|
411458
|
+
value: companion.stats[stat48],
|
|
411280
411459
|
color: color3
|
|
411281
|
-
},
|
|
411460
|
+
}, stat48))
|
|
411282
411461
|
}),
|
|
411283
411462
|
muted && /* @__PURE__ */ jsx_runtime369.jsx(ThemedBox_default, {
|
|
411284
411463
|
marginTop: 1,
|
|
@@ -411995,13 +412174,13 @@ import {
|
|
|
411995
412174
|
appendFile as fsAppendFile,
|
|
411996
412175
|
open as fsOpen2,
|
|
411997
412176
|
mkdir as mkdir46,
|
|
411998
|
-
readdir as
|
|
411999
|
-
readFile as
|
|
412000
|
-
stat as
|
|
412177
|
+
readdir as readdir34,
|
|
412178
|
+
readFile as readFile56,
|
|
412179
|
+
stat as stat48,
|
|
412001
412180
|
unlink as unlink22,
|
|
412002
412181
|
writeFile as writeFile49
|
|
412003
412182
|
} from "fs/promises";
|
|
412004
|
-
import { basename as basename48, dirname as dirname62, join as
|
|
412183
|
+
import { basename as basename48, dirname as dirname62, join as join150 } from "path";
|
|
412005
412184
|
function isTranscriptMessage(entry) {
|
|
412006
412185
|
return entry.type === "user" || entry.type === "assistant" || entry.type === "attachment" || entry.type === "system";
|
|
412007
412186
|
}
|
|
@@ -412015,18 +412194,18 @@ function isEphemeralToolProgress(dataType) {
|
|
|
412015
412194
|
return typeof dataType === "string" && EPHEMERAL_PROGRESS_TYPES.has(dataType);
|
|
412016
412195
|
}
|
|
412017
412196
|
function getProjectsDir2() {
|
|
412018
|
-
return
|
|
412197
|
+
return join150(getTheusConfigHomeDir(), "projects");
|
|
412019
412198
|
}
|
|
412020
412199
|
function getTranscriptPath() {
|
|
412021
412200
|
const projectDir = getSessionProjectDir() ?? getProjectDir3(getOriginalCwd());
|
|
412022
|
-
return
|
|
412201
|
+
return join150(projectDir, `${getSessionId()}.jsonl`);
|
|
412023
412202
|
}
|
|
412024
412203
|
function getTranscriptPathForSession(sessionId) {
|
|
412025
412204
|
if (sessionId === getSessionId()) {
|
|
412026
412205
|
return getTranscriptPath();
|
|
412027
412206
|
}
|
|
412028
412207
|
const projectDir = getProjectDir3(getOriginalCwd());
|
|
412029
|
-
return
|
|
412208
|
+
return join150(projectDir, `${sessionId}.jsonl`);
|
|
412030
412209
|
}
|
|
412031
412210
|
function setAgentTranscriptSubdir(agentId, subdir) {
|
|
412032
412211
|
agentTranscriptSubdirs.set(agentId, subdir);
|
|
@@ -412038,8 +412217,8 @@ function getAgentTranscriptPath(agentId) {
|
|
|
412038
412217
|
const projectDir = getSessionProjectDir() ?? getProjectDir3(getOriginalCwd());
|
|
412039
412218
|
const sessionId = getSessionId();
|
|
412040
412219
|
const subdir = agentTranscriptSubdirs.get(agentId);
|
|
412041
|
-
const base2 = subdir ?
|
|
412042
|
-
return
|
|
412220
|
+
const base2 = subdir ? join150(projectDir, sessionId, "subagents", subdir) : join150(projectDir, sessionId, "subagents");
|
|
412221
|
+
return join150(base2, `agent-${agentId}.jsonl`);
|
|
412043
412222
|
}
|
|
412044
412223
|
function getAgentMetadataPath(agentId) {
|
|
412045
412224
|
return getAgentTranscriptPath(agentId).replace(/\.jsonl$/, ".meta.json");
|
|
@@ -412052,7 +412231,7 @@ async function writeAgentMetadata(agentId, metadata) {
|
|
|
412052
412231
|
async function readAgentMetadata(agentId) {
|
|
412053
412232
|
const path17 = getAgentMetadataPath(agentId);
|
|
412054
412233
|
try {
|
|
412055
|
-
const raw = await
|
|
412234
|
+
const raw = await readFile56(path17, "utf-8");
|
|
412056
412235
|
return JSON.parse(raw);
|
|
412057
412236
|
} catch (e) {
|
|
412058
412237
|
if (isFsInaccessible(e))
|
|
@@ -412062,10 +412241,10 @@ async function readAgentMetadata(agentId) {
|
|
|
412062
412241
|
}
|
|
412063
412242
|
function getRemoteAgentsDir() {
|
|
412064
412243
|
const projectDir = getSessionProjectDir() ?? getProjectDir3(getOriginalCwd());
|
|
412065
|
-
return
|
|
412244
|
+
return join150(projectDir, getSessionId(), "remote-agents");
|
|
412066
412245
|
}
|
|
412067
412246
|
function getRemoteAgentMetadataPath(taskId) {
|
|
412068
|
-
return
|
|
412247
|
+
return join150(getRemoteAgentsDir(), `remote-agent-${taskId}.meta.json`);
|
|
412069
412248
|
}
|
|
412070
412249
|
async function writeRemoteAgentMetadata(taskId, metadata) {
|
|
412071
412250
|
const path17 = getRemoteAgentMetadataPath(taskId);
|
|
@@ -412075,7 +412254,7 @@ async function writeRemoteAgentMetadata(taskId, metadata) {
|
|
|
412075
412254
|
async function readRemoteAgentMetadata(taskId) {
|
|
412076
412255
|
const path17 = getRemoteAgentMetadataPath(taskId);
|
|
412077
412256
|
try {
|
|
412078
|
-
const raw = await
|
|
412257
|
+
const raw = await readFile56(path17, "utf-8");
|
|
412079
412258
|
return JSON.parse(raw);
|
|
412080
412259
|
} catch (e) {
|
|
412081
412260
|
if (isFsInaccessible(e))
|
|
@@ -412097,7 +412276,7 @@ async function listRemoteAgentMetadata() {
|
|
|
412097
412276
|
const dir = getRemoteAgentsDir();
|
|
412098
412277
|
let entries;
|
|
412099
412278
|
try {
|
|
412100
|
-
entries = await
|
|
412279
|
+
entries = await readdir34(dir, { withFileTypes: true });
|
|
412101
412280
|
} catch (e) {
|
|
412102
412281
|
if (isFsInaccessible(e))
|
|
412103
412282
|
return [];
|
|
@@ -412108,7 +412287,7 @@ async function listRemoteAgentMetadata() {
|
|
|
412108
412287
|
if (!entry.isFile() || !entry.name.endsWith(".meta.json"))
|
|
412109
412288
|
continue;
|
|
412110
412289
|
try {
|
|
412111
|
-
const raw = await
|
|
412290
|
+
const raw = await readFile56(join150(dir, entry.name), "utf-8");
|
|
412112
412291
|
results.push(JSON.parse(raw));
|
|
412113
412292
|
} catch (e) {
|
|
412114
412293
|
logForDebugging(`listRemoteAgentMetadata: skipping ${entry.name}: ${String(e)}`);
|
|
@@ -412118,7 +412297,7 @@ async function listRemoteAgentMetadata() {
|
|
|
412118
412297
|
}
|
|
412119
412298
|
function sessionIdExists(sessionId) {
|
|
412120
412299
|
const projectDir = getProjectDir3(getOriginalCwd());
|
|
412121
|
-
const sessionFile =
|
|
412300
|
+
const sessionFile = join150(projectDir, `${sessionId}.jsonl`);
|
|
412122
412301
|
const fs5 = getFsImplementation();
|
|
412123
412302
|
try {
|
|
412124
412303
|
fs5.statSync(sessionFile);
|
|
@@ -412450,7 +412629,7 @@ class Project {
|
|
|
412450
412629
|
logForDebugging(`Skipping tombstone removal: session file too large (${formatFileSize(fileSize)})`, { level: "warn" });
|
|
412451
412630
|
return;
|
|
412452
412631
|
}
|
|
412453
|
-
const content = await
|
|
412632
|
+
const content = await readFile56(this.sessionFile, { encoding: "utf-8" });
|
|
412454
412633
|
const lines = content.split(`
|
|
412455
412634
|
`).filter((line) => {
|
|
412456
412635
|
if (!line.trim())
|
|
@@ -412660,7 +412839,7 @@ class Project {
|
|
|
412660
412839
|
return cached3;
|
|
412661
412840
|
const targetFile = getTranscriptPathForSession(sessionId);
|
|
412662
412841
|
try {
|
|
412663
|
-
await
|
|
412842
|
+
await stat48(targetFile);
|
|
412664
412843
|
this.existingSessionFiles.set(sessionId, targetFile);
|
|
412665
412844
|
return targetFile;
|
|
412666
412845
|
} catch (e) {
|
|
@@ -413260,7 +413439,7 @@ async function loadTranscriptFromFile(filePath) {
|
|
|
413260
413439
|
worktreeSession: worktreeStates.has(sessionId) ? worktreeStates.get(sessionId) : undefined
|
|
413261
413440
|
};
|
|
413262
413441
|
}
|
|
413263
|
-
const content = await
|
|
413442
|
+
const content = await readFile56(filePath, { encoding: "utf-8" });
|
|
413264
413443
|
let parsed;
|
|
413265
413444
|
try {
|
|
413266
413445
|
parsed = jsonParse(content);
|
|
@@ -413912,7 +414091,7 @@ async function loadTranscriptFile(filePath, opts) {
|
|
|
413912
414091
|
let metadataLines = null;
|
|
413913
414092
|
let hasPreservedSegment = false;
|
|
413914
414093
|
if (!isEnvTruthy(process.env.THEUS_CODE_DISABLE_PRECOMPACT_SKIP)) {
|
|
413915
|
-
const { size } = await
|
|
414094
|
+
const { size } = await stat48(filePath);
|
|
413916
414095
|
if (size > SKIP_PRECOMPACT_THRESHOLD) {
|
|
413917
414096
|
const scan = await readTranscriptForLoad(filePath, size);
|
|
413918
414097
|
buf = scan.postBoundaryBuf;
|
|
@@ -413922,7 +414101,7 @@ async function loadTranscriptFile(filePath, opts) {
|
|
|
413922
414101
|
}
|
|
413923
414102
|
}
|
|
413924
414103
|
}
|
|
413925
|
-
buf ??= await
|
|
414104
|
+
buf ??= await readFile56(filePath);
|
|
413926
414105
|
if (!opts?.keepAllLeaves && !hasPreservedSegment && !isEnvTruthy(process.env.THEUS_CODE_DISABLE_PRECOMPACT_SKIP) && buf.length > SKIP_PRECOMPACT_THRESHOLD) {
|
|
413927
414106
|
buf = walkChainBeforeParse(buf);
|
|
413928
414107
|
}
|
|
@@ -414087,7 +414266,7 @@ async function loadTranscriptFile(filePath, opts) {
|
|
|
414087
414266
|
};
|
|
414088
414267
|
}
|
|
414089
414268
|
async function loadSessionFile(sessionId) {
|
|
414090
|
-
const sessionFile =
|
|
414269
|
+
const sessionFile = join150(getSessionProjectDir() ?? getProjectDir3(getOriginalCwd()), `${sessionId}.jsonl`);
|
|
414091
414270
|
return loadTranscriptFile(sessionFile);
|
|
414092
414271
|
}
|
|
414093
414272
|
function clearSessionMessagesCache() {
|
|
@@ -414151,11 +414330,11 @@ async function loadAllProjectsMessageLogsFull(limit) {
|
|
|
414151
414330
|
const projectsDir = getProjectsDir2();
|
|
414152
414331
|
let dirents;
|
|
414153
414332
|
try {
|
|
414154
|
-
dirents = await
|
|
414333
|
+
dirents = await readdir34(projectsDir, { withFileTypes: true });
|
|
414155
414334
|
} catch {
|
|
414156
414335
|
return [];
|
|
414157
414336
|
}
|
|
414158
|
-
const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
414337
|
+
const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join150(projectsDir, dirent.name));
|
|
414159
414338
|
const logsPerProject = await Promise.all(projectDirs.map((projectDir) => getLogsWithoutIndex(projectDir, limit)));
|
|
414160
414339
|
const allLogs = logsPerProject.flat();
|
|
414161
414340
|
const deduped = new Map;
|
|
@@ -414176,11 +414355,11 @@ async function loadAllProjectsMessageLogsProgressive(limit, initialEnrichCount =
|
|
|
414176
414355
|
const projectsDir = getProjectsDir2();
|
|
414177
414356
|
let dirents;
|
|
414178
414357
|
try {
|
|
414179
|
-
dirents = await
|
|
414358
|
+
dirents = await readdir34(projectsDir, { withFileTypes: true });
|
|
414180
414359
|
} catch {
|
|
414181
414360
|
return { logs: [], allStatLogs: [], nextIndex: 0 };
|
|
414182
414361
|
}
|
|
414183
|
-
const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
414362
|
+
const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join150(projectsDir, dirent.name));
|
|
414184
414363
|
const rawLogs = [];
|
|
414185
414364
|
for (const projectDir of projectDirs) {
|
|
414186
414365
|
rawLogs.push(...await getSessionFilesLite(projectDir, limit));
|
|
@@ -414226,7 +414405,7 @@ async function getStatOnlyLogsForWorktrees(worktreePaths, limit) {
|
|
|
414226
414405
|
const seenDirs = new Set;
|
|
414227
414406
|
let allDirents;
|
|
414228
414407
|
try {
|
|
414229
|
-
allDirents = await
|
|
414408
|
+
allDirents = await readdir34(projectsDir, { withFileTypes: true });
|
|
414230
414409
|
} catch (e) {
|
|
414231
414410
|
logForDebugging(`Failed to read projects dir ${projectsDir}, falling back to current project: ${e}`);
|
|
414232
414411
|
const projectDir = getProjectDir3(getOriginalCwd());
|
|
@@ -414241,7 +414420,7 @@ async function getStatOnlyLogsForWorktrees(worktreePaths, limit) {
|
|
|
414241
414420
|
for (const { path: wtPath, prefix } of indexed) {
|
|
414242
414421
|
if (dirName === prefix || dirName.startsWith(prefix + "-")) {
|
|
414243
414422
|
seenDirs.add(dirName);
|
|
414244
|
-
allLogs.push(...await getSessionFilesLite(
|
|
414423
|
+
allLogs.push(...await getSessionFilesLite(join150(projectsDir, dirent.name), undefined, wtPath));
|
|
414245
414424
|
break;
|
|
414246
414425
|
}
|
|
414247
414426
|
}
|
|
@@ -414310,10 +414489,10 @@ async function loadSubagentTranscripts(agentIds) {
|
|
|
414310
414489
|
return transcripts;
|
|
414311
414490
|
}
|
|
414312
414491
|
async function loadAllSubagentTranscriptsFromDisk() {
|
|
414313
|
-
const subagentsDir =
|
|
414492
|
+
const subagentsDir = join150(getSessionProjectDir() ?? getProjectDir3(getOriginalCwd()), getSessionId(), "subagents");
|
|
414314
414493
|
let entries;
|
|
414315
414494
|
try {
|
|
414316
|
-
entries = await
|
|
414495
|
+
entries = await readdir34(subagentsDir, { withFileTypes: true });
|
|
414317
414496
|
} catch {
|
|
414318
414497
|
return {};
|
|
414319
414498
|
}
|
|
@@ -414427,7 +414606,7 @@ async function getSessionFilesWithMtime(projectDir) {
|
|
|
414427
414606
|
const sessionFilesMap = new Map;
|
|
414428
414607
|
let dirents;
|
|
414429
414608
|
try {
|
|
414430
|
-
dirents = await
|
|
414609
|
+
dirents = await readdir34(projectDir, { withFileTypes: true });
|
|
414431
414610
|
} catch {
|
|
414432
414611
|
return sessionFilesMap;
|
|
414433
414612
|
}
|
|
@@ -414438,11 +414617,11 @@ async function getSessionFilesWithMtime(projectDir) {
|
|
|
414438
414617
|
const sessionId = validateUuid2(basename48(dirent.name, ".jsonl"));
|
|
414439
414618
|
if (!sessionId)
|
|
414440
414619
|
continue;
|
|
414441
|
-
candidates.push({ sessionId, filePath:
|
|
414620
|
+
candidates.push({ sessionId, filePath: join150(projectDir, dirent.name) });
|
|
414442
414621
|
}
|
|
414443
414622
|
await Promise.all(candidates.map(async ({ sessionId, filePath }) => {
|
|
414444
414623
|
try {
|
|
414445
|
-
const st = await
|
|
414624
|
+
const st = await stat48(filePath);
|
|
414446
414625
|
sessionFilesMap.set(sessionId, {
|
|
414447
414626
|
path: filePath,
|
|
414448
414627
|
mtime: st.mtime.getTime(),
|
|
@@ -414825,7 +415004,7 @@ var init_sessionStorage = __esm(() => {
|
|
|
414825
415004
|
init_settings2();
|
|
414826
415005
|
init_slowOperations();
|
|
414827
415006
|
init_uuid();
|
|
414828
|
-
VERSION4 = { VERSION: "0.2.
|
|
415007
|
+
VERSION4 = { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
|
|
414829
415008
|
MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
|
|
414830
415009
|
SKIP_FIRST_PROMPT_PATTERN2 = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
|
|
414831
415010
|
EPHEMERAL_PROGRESS_TYPES = new Set([
|
|
@@ -414837,7 +415016,7 @@ var init_sessionStorage = __esm(() => {
|
|
|
414837
415016
|
MAX_TRANSCRIPT_READ_BYTES = 50 * 1024 * 1024;
|
|
414838
415017
|
agentTranscriptSubdirs = new Map;
|
|
414839
415018
|
getProjectDir3 = memoize_default((projectDir) => {
|
|
414840
|
-
return
|
|
415019
|
+
return join150(getProjectsDir2(), sanitizePath2(projectDir));
|
|
414841
415020
|
});
|
|
414842
415021
|
METADATA_TYPE_MARKERS = [
|
|
414843
415022
|
'"type":"summary"',
|
|
@@ -415075,41 +415254,41 @@ var init_memdir = __esm(() => {
|
|
|
415075
415254
|
});
|
|
415076
415255
|
|
|
415077
415256
|
// tools/AgentTool/agentMemory.ts
|
|
415078
|
-
import { join as
|
|
415257
|
+
import { join as join151, normalize as normalize14, sep as sep30 } from "path";
|
|
415079
415258
|
function sanitizeAgentTypeForPath(agentType) {
|
|
415080
415259
|
return agentType.replace(/:/g, "-");
|
|
415081
415260
|
}
|
|
415082
415261
|
function getLocalAgentMemoryDir(dirName) {
|
|
415083
415262
|
if (process.env.THEUS_CODE_REMOTE_MEMORY_DIR) {
|
|
415084
|
-
return
|
|
415263
|
+
return join151(process.env.THEUS_CODE_REMOTE_MEMORY_DIR, "projects", sanitizePath2(findCanonicalGitRoot(getProjectRoot()) ?? getProjectRoot()), "agent-memory-local", dirName) + sep30;
|
|
415085
415264
|
}
|
|
415086
|
-
return
|
|
415265
|
+
return join151(getCwd(), ".theus", "agent-memory-local", dirName) + sep30;
|
|
415087
415266
|
}
|
|
415088
415267
|
function getAgentMemoryDir(agentType, scope) {
|
|
415089
415268
|
const dirName = sanitizeAgentTypeForPath(agentType);
|
|
415090
415269
|
switch (scope) {
|
|
415091
415270
|
case "project":
|
|
415092
|
-
return
|
|
415271
|
+
return join151(getCwd(), ".theus", "agent-memory", dirName) + sep30;
|
|
415093
415272
|
case "local":
|
|
415094
415273
|
return getLocalAgentMemoryDir(dirName);
|
|
415095
415274
|
case "user":
|
|
415096
|
-
return
|
|
415275
|
+
return join151(getMemoryBaseDir(), "agent-memory", dirName) + sep30;
|
|
415097
415276
|
}
|
|
415098
415277
|
}
|
|
415099
415278
|
function isAgentMemoryPath(absolutePath) {
|
|
415100
415279
|
const normalizedPath = normalize14(absolutePath);
|
|
415101
415280
|
const memoryBase = getMemoryBaseDir();
|
|
415102
|
-
if (normalizedPath.startsWith(
|
|
415281
|
+
if (normalizedPath.startsWith(join151(memoryBase, "agent-memory") + sep30)) {
|
|
415103
415282
|
return true;
|
|
415104
415283
|
}
|
|
415105
|
-
if (normalizedPath.startsWith(
|
|
415284
|
+
if (normalizedPath.startsWith(join151(getCwd(), ".theus", "agent-memory") + sep30)) {
|
|
415106
415285
|
return true;
|
|
415107
415286
|
}
|
|
415108
415287
|
if (process.env.THEUS_CODE_REMOTE_MEMORY_DIR) {
|
|
415109
|
-
if (normalizedPath.includes(sep30 + "agent-memory-local" + sep30) && normalizedPath.startsWith(
|
|
415288
|
+
if (normalizedPath.includes(sep30 + "agent-memory-local" + sep30) && normalizedPath.startsWith(join151(process.env.THEUS_CODE_REMOTE_MEMORY_DIR, "projects") + sep30)) {
|
|
415110
415289
|
return true;
|
|
415111
415290
|
}
|
|
415112
|
-
} else if (normalizedPath.startsWith(
|
|
415291
|
+
} else if (normalizedPath.startsWith(join151(getCwd(), ".theus", "agent-memory-local") + sep30)) {
|
|
415113
415292
|
return true;
|
|
415114
415293
|
}
|
|
415115
415294
|
return false;
|
|
@@ -415117,7 +415296,7 @@ function isAgentMemoryPath(absolutePath) {
|
|
|
415117
415296
|
function getMemoryScopeDisplay(memory2) {
|
|
415118
415297
|
switch (memory2) {
|
|
415119
415298
|
case "user":
|
|
415120
|
-
return `User (${
|
|
415299
|
+
return `User (${join151(getMemoryBaseDir(), "agent-memory")}/)`;
|
|
415121
415300
|
case "project":
|
|
415122
415301
|
return "Project (.theus/agent-memory/)";
|
|
415123
415302
|
case "local":
|
|
@@ -415160,7 +415339,7 @@ var init_agentMemory = __esm(() => {
|
|
|
415160
415339
|
// utils/permissions/filesystem.ts
|
|
415161
415340
|
import { randomBytes as randomBytes21 } from "crypto";
|
|
415162
415341
|
import { homedir as homedir39, tmpdir as tmpdir12 } from "os";
|
|
415163
|
-
import { join as
|
|
415342
|
+
import { join as join152, normalize as normalize15, posix as posix7, sep as sep31 } from "path";
|
|
415164
415343
|
function normalizeCaseForComparison(path17) {
|
|
415165
415344
|
return path17.toLowerCase();
|
|
415166
415345
|
}
|
|
@@ -415169,11 +415348,11 @@ function getTheusSkillScope(filePath) {
|
|
|
415169
415348
|
const absolutePathLower = normalizeCaseForComparison(absolutePath);
|
|
415170
415349
|
const bases = [
|
|
415171
415350
|
{
|
|
415172
|
-
dir: expandPath(
|
|
415351
|
+
dir: expandPath(join152(getOriginalCwd(), ".theus", "skills")),
|
|
415173
415352
|
prefix: "/.theus/skills/"
|
|
415174
415353
|
},
|
|
415175
415354
|
{
|
|
415176
|
-
dir: expandPath(
|
|
415355
|
+
dir: expandPath(join152(homedir39(), ".theus", "skills")),
|
|
415177
415356
|
prefix: "~/.theus/skills/"
|
|
415178
415357
|
}
|
|
415179
415358
|
];
|
|
@@ -415228,21 +415407,21 @@ function isTheusConfigFilePath(filePath) {
|
|
|
415228
415407
|
if (isTheusSettingsPath(filePath)) {
|
|
415229
415408
|
return true;
|
|
415230
415409
|
}
|
|
415231
|
-
const commandsDir =
|
|
415232
|
-
const agentsDir =
|
|
415233
|
-
const skillsDir =
|
|
415410
|
+
const commandsDir = join152(getOriginalCwd(), ".theus", "commands");
|
|
415411
|
+
const agentsDir = join152(getOriginalCwd(), ".theus", "agents");
|
|
415412
|
+
const skillsDir = join152(getOriginalCwd(), ".theus", "skills");
|
|
415234
415413
|
return pathInWorkingPath(filePath, commandsDir) || pathInWorkingPath(filePath, agentsDir) || pathInWorkingPath(filePath, skillsDir);
|
|
415235
415414
|
}
|
|
415236
415415
|
function isSessionPlanFile(absolutePath) {
|
|
415237
|
-
const expectedPrefix =
|
|
415416
|
+
const expectedPrefix = join152(getPlansDirectory(), getPlanSlug());
|
|
415238
415417
|
const normalizedPath = normalize15(absolutePath);
|
|
415239
415418
|
return normalizedPath.startsWith(expectedPrefix) && normalizedPath.endsWith(".md");
|
|
415240
415419
|
}
|
|
415241
415420
|
function getSessionMemoryDir() {
|
|
415242
|
-
return
|
|
415421
|
+
return join152(getProjectDir3(getCwd()), getSessionId(), "session-memory") + sep31;
|
|
415243
415422
|
}
|
|
415244
415423
|
function getSessionMemoryPath() {
|
|
415245
|
-
return
|
|
415424
|
+
return join152(getSessionMemoryDir(), "summary.md");
|
|
415246
415425
|
}
|
|
415247
415426
|
function isSessionMemoryPath(absolutePath) {
|
|
415248
415427
|
const normalizedPath = normalize15(absolutePath);
|
|
@@ -415264,10 +415443,10 @@ function getTheusTempDirName() {
|
|
|
415264
415443
|
return `theus-${uid}`;
|
|
415265
415444
|
}
|
|
415266
415445
|
function getProjectTempDir() {
|
|
415267
|
-
return
|
|
415446
|
+
return join152(getTheusTempDir(), sanitizePath2(getOriginalCwd())) + sep31;
|
|
415268
415447
|
}
|
|
415269
415448
|
function getScratchpadDir() {
|
|
415270
|
-
return
|
|
415449
|
+
return join152(getProjectTempDir(), getSessionId(), "scratchpad");
|
|
415271
415450
|
}
|
|
415272
415451
|
async function ensureScratchpadDir() {
|
|
415273
415452
|
if (!isScratchpadEnabled()) {
|
|
@@ -415845,7 +416024,7 @@ function checkEditableInternalPath(absolutePath, input) {
|
|
|
415845
416024
|
}
|
|
415846
416025
|
};
|
|
415847
416026
|
}
|
|
415848
|
-
if (normalizeCaseForComparison(normalizedPath) === normalizeCaseForComparison(
|
|
416027
|
+
if (normalizeCaseForComparison(normalizedPath) === normalizeCaseForComparison(join152(getOriginalCwd(), ".theus", "launch.json"))) {
|
|
415849
416028
|
return {
|
|
415850
416029
|
behavior: "allow",
|
|
415851
416030
|
updatedInput: input,
|
|
@@ -415942,7 +416121,7 @@ function checkReadableInternalPath(absolutePath, input) {
|
|
|
415942
416121
|
}
|
|
415943
416122
|
};
|
|
415944
416123
|
}
|
|
415945
|
-
const tasksDir =
|
|
416124
|
+
const tasksDir = join152(getTheusConfigHomeDir(), "tasks") + sep31;
|
|
415946
416125
|
if (normalizedPath === tasksDir.slice(0, -1) || normalizedPath.startsWith(tasksDir)) {
|
|
415947
416126
|
return {
|
|
415948
416127
|
behavior: "allow",
|
|
@@ -415953,7 +416132,7 @@ function checkReadableInternalPath(absolutePath, input) {
|
|
|
415953
416132
|
}
|
|
415954
416133
|
};
|
|
415955
416134
|
}
|
|
415956
|
-
const teamsReadDir =
|
|
416135
|
+
const teamsReadDir = join152(getTheusConfigHomeDir(), "teams") + sep31;
|
|
415957
416136
|
if (normalizedPath === teamsReadDir.slice(0, -1) || normalizedPath.startsWith(teamsReadDir)) {
|
|
415958
416137
|
return {
|
|
415959
416138
|
behavior: "allow",
|
|
@@ -416026,11 +416205,11 @@ var init_filesystem = __esm(() => {
|
|
|
416026
416205
|
try {
|
|
416027
416206
|
resolvedBaseTmpDir = fs5.realpathSync(baseTmpDir);
|
|
416028
416207
|
} catch {}
|
|
416029
|
-
return
|
|
416208
|
+
return join152(resolvedBaseTmpDir, getTheusTempDirName()) + sep31;
|
|
416030
416209
|
});
|
|
416031
416210
|
getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
|
|
416032
416211
|
const nonce = randomBytes21(16).toString("hex");
|
|
416033
|
-
return
|
|
416212
|
+
return join152(getTheusTempDir(), "bundled-skills", { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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);
|
|
416034
416213
|
});
|
|
416035
416214
|
getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
|
|
416036
416215
|
});
|
|
@@ -416039,15 +416218,15 @@ var init_filesystem = __esm(() => {
|
|
|
416039
416218
|
import { constants as fsConstants6 } from "fs";
|
|
416040
416219
|
import {
|
|
416041
416220
|
mkdir as mkdir47,
|
|
416042
|
-
open as
|
|
416043
|
-
stat as
|
|
416221
|
+
open as open22,
|
|
416222
|
+
stat as stat49,
|
|
416044
416223
|
symlink as symlink6,
|
|
416045
416224
|
unlink as unlink23
|
|
416046
416225
|
} from "fs/promises";
|
|
416047
|
-
import { join as
|
|
416226
|
+
import { join as join153 } from "path";
|
|
416048
416227
|
function getTaskOutputDir() {
|
|
416049
416228
|
if (_taskOutputDir === undefined) {
|
|
416050
|
-
_taskOutputDir =
|
|
416229
|
+
_taskOutputDir = join153(getProjectTempDir(), getSessionId(), "tasks");
|
|
416051
416230
|
}
|
|
416052
416231
|
return _taskOutputDir;
|
|
416053
416232
|
}
|
|
@@ -416055,7 +416234,7 @@ async function ensureOutputDir() {
|
|
|
416055
416234
|
await mkdir47(getTaskOutputDir(), { recursive: true });
|
|
416056
416235
|
}
|
|
416057
416236
|
function getTaskOutputPath(taskId) {
|
|
416058
|
-
return
|
|
416237
|
+
return join153(getTaskOutputDir(), `${taskId}.output`);
|
|
416059
416238
|
}
|
|
416060
416239
|
function track(p) {
|
|
416061
416240
|
_pendingOps.add(p);
|
|
@@ -416105,7 +416284,7 @@ class DiskTaskOutput {
|
|
|
416105
416284
|
try {
|
|
416106
416285
|
if (!this.#fileHandle) {
|
|
416107
416286
|
await ensureOutputDir();
|
|
416108
|
-
this.#fileHandle = await
|
|
416287
|
+
this.#fileHandle = await open22(this.#path, process.platform === "win32" ? "a" : fsConstants6.O_WRONLY | fsConstants6.O_APPEND | fsConstants6.O_CREAT | O_NOFOLLOW2);
|
|
416109
416288
|
}
|
|
416110
416289
|
while (true) {
|
|
416111
416290
|
await this.#writeAllChunks();
|
|
@@ -416222,7 +416401,7 @@ function initTaskOutput(taskId) {
|
|
|
416222
416401
|
return track((async () => {
|
|
416223
416402
|
await ensureOutputDir();
|
|
416224
416403
|
const outputPath = getTaskOutputPath(taskId);
|
|
416225
|
-
const fh = await
|
|
416404
|
+
const fh = await open22(outputPath, process.platform === "win32" ? "wx" : fsConstants6.O_WRONLY | fsConstants6.O_CREAT | fsConstants6.O_EXCL | O_NOFOLLOW2);
|
|
416226
416405
|
await fh.close();
|
|
416227
416406
|
return outputPath;
|
|
416228
416407
|
})());
|
|
@@ -416304,7 +416483,7 @@ var init_Task = __esm(() => {
|
|
|
416304
416483
|
});
|
|
416305
416484
|
|
|
416306
416485
|
// utils/ShellCommand.ts
|
|
416307
|
-
import { stat as
|
|
416486
|
+
import { stat as stat50 } from "fs/promises";
|
|
416308
416487
|
function prependStderr(prefix, stderr) {
|
|
416309
416488
|
return stderr ? `${prefix} ${stderr}` : prefix;
|
|
416310
416489
|
}
|
|
@@ -416428,7 +416607,7 @@ class ShellCommandImpl {
|
|
|
416428
416607
|
}
|
|
416429
416608
|
#startSizeWatchdog() {
|
|
416430
416609
|
this.#sizeWatchdog = setInterval(() => {
|
|
416431
|
-
|
|
416610
|
+
stat50(this.taskOutput.path).then((s) => {
|
|
416432
416611
|
if (s.size > this.#maxOutputBytes && this.#status === "backgrounded" && this.#sizeWatchdog !== null) {
|
|
416433
416612
|
this.#killedForSize = true;
|
|
416434
416613
|
this.#clearSizeWatchdog();
|
|
@@ -420291,7 +420470,7 @@ var init_hooks5 = __esm(() => {
|
|
|
420291
420470
|
});
|
|
420292
420471
|
|
|
420293
420472
|
// utils/settings/changeDetector.ts
|
|
420294
|
-
import { stat as
|
|
420473
|
+
import { stat as stat51 } from "fs/promises";
|
|
420295
420474
|
import * as platformPath from "path";
|
|
420296
420475
|
async function initialize() {
|
|
420297
420476
|
if (getIsRemoteMode())
|
|
@@ -420371,7 +420550,7 @@ async function getWatchTargets() {
|
|
|
420371
420550
|
}
|
|
420372
420551
|
dirToSettingsFiles.get(dir).add(path17);
|
|
420373
420552
|
try {
|
|
420374
|
-
const stats2 = await
|
|
420553
|
+
const stats2 = await stat51(path17);
|
|
420375
420554
|
if (stats2.isFile()) {
|
|
420376
420555
|
dirsWithExistingFiles.add(dir);
|
|
420377
420556
|
}
|
|
@@ -420389,7 +420568,7 @@ async function getWatchTargets() {
|
|
|
420389
420568
|
let dropInDir = null;
|
|
420390
420569
|
const managedDropIn = getManagedSettingsDropInDir();
|
|
420391
420570
|
try {
|
|
420392
|
-
const stats2 = await
|
|
420571
|
+
const stats2 = await stat51(managedDropIn);
|
|
420393
420572
|
if (stats2.isDirectory()) {
|
|
420394
420573
|
dirsWithExistingFiles.add(managedDropIn);
|
|
420395
420574
|
dropInDir = managedDropIn;
|
|
@@ -420569,8 +420748,8 @@ __export(exports_sandbox_adapter, {
|
|
|
420569
420748
|
SandboxManager: () => SandboxManager2
|
|
420570
420749
|
});
|
|
420571
420750
|
import { rmSync as rmSync5, statSync as statSync13 } from "fs";
|
|
420572
|
-
import { readFile as
|
|
420573
|
-
import { join as
|
|
420751
|
+
import { readFile as readFile57 } from "fs/promises";
|
|
420752
|
+
import { join as join154, resolve as resolve46, sep as sep33 } from "path";
|
|
420574
420753
|
function permissionRuleValueFromString2(ruleString) {
|
|
420575
420754
|
const matches = ruleString.match(/^([^(]+)\(([^)]+)\)$/);
|
|
420576
420755
|
if (!matches) {
|
|
@@ -420752,9 +420931,9 @@ function scrubBareGitRepoFiles() {
|
|
|
420752
420931
|
}
|
|
420753
420932
|
}
|
|
420754
420933
|
async function detectWorktreeMainRepoPath(cwd2) {
|
|
420755
|
-
const gitPath =
|
|
420934
|
+
const gitPath = join154(cwd2, ".git");
|
|
420756
420935
|
try {
|
|
420757
|
-
const gitContent = await
|
|
420936
|
+
const gitContent = await readFile57(gitPath, { encoding: "utf8" });
|
|
420758
420937
|
const gitdirMatch = gitContent.match(/^gitdir:\s*(.+)$/m);
|
|
420759
420938
|
if (!gitdirMatch?.[1]) {
|
|
420760
420939
|
return null;
|
|
@@ -421279,8 +421458,8 @@ var init_pathValidation3 = __esm(() => {
|
|
|
421279
421458
|
|
|
421280
421459
|
// utils/plugins/pluginDirectories.ts
|
|
421281
421460
|
import { mkdirSync as mkdirSync11 } from "fs";
|
|
421282
|
-
import { readdir as
|
|
421283
|
-
import { delimiter as delimiter3, join as
|
|
421461
|
+
import { readdir as readdir35, rm as rm10, stat as stat52 } from "fs/promises";
|
|
421462
|
+
import { delimiter as delimiter3, join as join155 } from "path";
|
|
421284
421463
|
function getPluginsDirectoryName() {
|
|
421285
421464
|
if (getUseCoworkPlugins()) {
|
|
421286
421465
|
return COWORK_PLUGINS_DIR;
|
|
@@ -421295,7 +421474,7 @@ function getPluginsDirectory() {
|
|
|
421295
421474
|
if (envOverride) {
|
|
421296
421475
|
return expandTilde2(envOverride);
|
|
421297
421476
|
}
|
|
421298
|
-
return
|
|
421477
|
+
return join155(getTheusConfigHomeDir(), getPluginsDirectoryName());
|
|
421299
421478
|
}
|
|
421300
421479
|
function getPluginSeedDirs() {
|
|
421301
421480
|
const raw = process.env.THEUS_CODE_PLUGIN_SEED_DIR;
|
|
@@ -421307,7 +421486,7 @@ function sanitizePluginId(pluginId) {
|
|
|
421307
421486
|
return pluginId.replace(/[^a-zA-Z0-9\-_]/g, "-");
|
|
421308
421487
|
}
|
|
421309
421488
|
function pluginDataDirPath(pluginId) {
|
|
421310
|
-
return
|
|
421489
|
+
return join155(getPluginsDirectory(), "data", sanitizePluginId(pluginId));
|
|
421311
421490
|
}
|
|
421312
421491
|
function getPluginDataDir(pluginId) {
|
|
421313
421492
|
const dir = pluginDataDirPath(pluginId);
|
|
@@ -421318,13 +421497,13 @@ async function getPluginDataDirSize(pluginId) {
|
|
|
421318
421497
|
const dir = pluginDataDirPath(pluginId);
|
|
421319
421498
|
let bytes = 0;
|
|
421320
421499
|
const walk = async (p) => {
|
|
421321
|
-
for (const entry of await
|
|
421322
|
-
const full =
|
|
421500
|
+
for (const entry of await readdir35(p, { withFileTypes: true })) {
|
|
421501
|
+
const full = join155(p, entry.name);
|
|
421323
421502
|
if (entry.isDirectory()) {
|
|
421324
421503
|
await walk(full);
|
|
421325
421504
|
} else {
|
|
421326
421505
|
try {
|
|
421327
|
-
bytes += (await
|
|
421506
|
+
bytes += (await stat52(full)).size;
|
|
421328
421507
|
} catch {}
|
|
421329
421508
|
}
|
|
421330
421509
|
}
|
|
@@ -421359,8 +421538,8 @@ var init_pluginDirectories = __esm(() => {
|
|
|
421359
421538
|
});
|
|
421360
421539
|
|
|
421361
421540
|
// utils/plugins/lspPluginIntegration.ts
|
|
421362
|
-
import { readFile as
|
|
421363
|
-
import { join as
|
|
421541
|
+
import { readFile as readFile58 } from "fs/promises";
|
|
421542
|
+
import { join as join156, relative as relative31, resolve as resolve48 } from "path";
|
|
421364
421543
|
function validatePathWithinPlugin(pluginPath, relativePath2) {
|
|
421365
421544
|
const resolvedPluginPath = resolve48(pluginPath);
|
|
421366
421545
|
const resolvedFilePath = resolve48(pluginPath, relativePath2);
|
|
@@ -421372,9 +421551,9 @@ function validatePathWithinPlugin(pluginPath, relativePath2) {
|
|
|
421372
421551
|
}
|
|
421373
421552
|
async function loadPluginLspServers(plugin2, errors4 = []) {
|
|
421374
421553
|
const servers = {};
|
|
421375
|
-
const lspJsonPath =
|
|
421554
|
+
const lspJsonPath = join156(plugin2.path, ".lsp.json");
|
|
421376
421555
|
try {
|
|
421377
|
-
const content = await
|
|
421556
|
+
const content = await readFile58(lspJsonPath, "utf-8");
|
|
421378
421557
|
const parsed = jsonParse(content);
|
|
421379
421558
|
const result = exports_external.record(exports_external.string(), LspServerConfigSchema()).safeParse(parsed);
|
|
421380
421559
|
if (result.success) {
|
|
@@ -421431,7 +421610,7 @@ async function loadLspServersFromManifest(declaration, pluginPath, pluginName, e
|
|
|
421431
421610
|
continue;
|
|
421432
421611
|
}
|
|
421433
421612
|
try {
|
|
421434
|
-
const content = await
|
|
421613
|
+
const content = await readFile58(validatedPath, "utf-8");
|
|
421435
421614
|
const parsed = jsonParse(content);
|
|
421436
421615
|
const result = exports_external.record(exports_external.string(), LspServerConfigSchema()).safeParse(parsed);
|
|
421437
421616
|
if (result.success) {
|
|
@@ -426631,9 +426810,9 @@ __export(exports_upstreamproxy, {
|
|
|
426631
426810
|
getUpstreamProxyEnv: () => getUpstreamProxyEnv,
|
|
426632
426811
|
SESSION_TOKEN_PATH: () => SESSION_TOKEN_PATH
|
|
426633
426812
|
});
|
|
426634
|
-
import { mkdir as mkdir48, readFile as
|
|
426813
|
+
import { mkdir as mkdir48, readFile as readFile59, unlink as unlink24, writeFile as writeFile50 } from "fs/promises";
|
|
426635
426814
|
import { homedir as homedir41 } from "os";
|
|
426636
|
-
import { join as
|
|
426815
|
+
import { join as join157 } from "path";
|
|
426637
426816
|
async function initUpstreamProxy(opts) {
|
|
426638
426817
|
if (!isEnvTruthy(process.env.THEUS_CODE_REMOTE)) {
|
|
426639
426818
|
return state;
|
|
@@ -426654,7 +426833,7 @@ async function initUpstreamProxy(opts) {
|
|
|
426654
426833
|
}
|
|
426655
426834
|
setNonDumpable();
|
|
426656
426835
|
const baseUrl = opts?.ccrBaseUrl ?? process.env.THEUS_BASE_URL ?? "https://api.theus.pe";
|
|
426657
|
-
const caBundlePath = opts?.caBundlePath ??
|
|
426836
|
+
const caBundlePath = opts?.caBundlePath ?? join157(homedir41(), ".ccr", "ca-bundle.crt");
|
|
426658
426837
|
const caOk = await downloadCaBundle(baseUrl, opts?.systemCaPath ?? SYSTEM_CA_BUNDLE, caBundlePath);
|
|
426659
426838
|
if (!caOk)
|
|
426660
426839
|
return state;
|
|
@@ -426712,7 +426891,7 @@ function resetUpstreamProxyForTests() {
|
|
|
426712
426891
|
}
|
|
426713
426892
|
async function readToken(path19) {
|
|
426714
426893
|
try {
|
|
426715
|
-
const raw = await
|
|
426894
|
+
const raw = await readFile59(path19, "utf8");
|
|
426716
426895
|
return raw.trim() || null;
|
|
426717
426896
|
} catch (err2) {
|
|
426718
426897
|
if (isENOENT(err2))
|
|
@@ -426754,8 +426933,8 @@ async function downloadCaBundle(baseUrl, systemCaPath, outPath) {
|
|
|
426754
426933
|
return false;
|
|
426755
426934
|
}
|
|
426756
426935
|
const ccrCa = await resp.text();
|
|
426757
|
-
const systemCa = await
|
|
426758
|
-
await mkdir48(
|
|
426936
|
+
const systemCa = await readFile59(systemCaPath, "utf8").catch(() => "");
|
|
426937
|
+
await mkdir48(join157(outPath, ".."), { recursive: true });
|
|
426759
426938
|
await writeFile50(outPath, systemCa + `
|
|
426760
426939
|
` + ccrCa, "utf8");
|
|
426761
426940
|
return true;
|
|
@@ -427184,14 +427363,14 @@ import {
|
|
|
427184
427363
|
appendFile as appendFile7,
|
|
427185
427364
|
chmod as chmod12,
|
|
427186
427365
|
mkdir as mkdir49,
|
|
427187
|
-
readdir as
|
|
427366
|
+
readdir as readdir36,
|
|
427188
427367
|
rmdir as rmdir3,
|
|
427189
|
-
stat as
|
|
427368
|
+
stat as stat53,
|
|
427190
427369
|
unlink as unlink25
|
|
427191
427370
|
} from "fs/promises";
|
|
427192
427371
|
import { createServer as createServer9 } from "net";
|
|
427193
427372
|
import { platform as platform6 } from "os";
|
|
427194
|
-
import { join as
|
|
427373
|
+
import { join as join158 } from "path";
|
|
427195
427374
|
function log(message, ...args) {
|
|
427196
427375
|
if (LOG_FILE) {
|
|
427197
427376
|
const timestamp2 = new Date().toISOString();
|
|
@@ -427238,7 +427417,7 @@ class ChromeNativeHost {
|
|
|
427238
427417
|
if (platform6() !== "win32") {
|
|
427239
427418
|
const socketDir = getSocketDir();
|
|
427240
427419
|
try {
|
|
427241
|
-
const dirStats = await
|
|
427420
|
+
const dirStats = await stat53(socketDir);
|
|
427242
427421
|
if (!dirStats.isDirectory()) {
|
|
427243
427422
|
await unlink25(socketDir);
|
|
427244
427423
|
}
|
|
@@ -427246,7 +427425,7 @@ class ChromeNativeHost {
|
|
|
427246
427425
|
await mkdir49(socketDir, { recursive: true, mode: 448 });
|
|
427247
427426
|
await chmod12(socketDir, 448).catch(() => {});
|
|
427248
427427
|
try {
|
|
427249
|
-
const files2 = await
|
|
427428
|
+
const files2 = await readdir36(socketDir);
|
|
427250
427429
|
for (const file2 of files2) {
|
|
427251
427430
|
if (!file2.endsWith(".sock")) {
|
|
427252
427431
|
continue;
|
|
@@ -427258,7 +427437,7 @@ class ChromeNativeHost {
|
|
|
427258
427437
|
try {
|
|
427259
427438
|
process.kill(pid, 0);
|
|
427260
427439
|
} catch {
|
|
427261
|
-
await unlink25(
|
|
427440
|
+
await unlink25(join158(socketDir, file2)).catch(() => {});
|
|
427262
427441
|
log(`Removed stale socket for PID ${pid}`);
|
|
427263
427442
|
}
|
|
427264
427443
|
}
|
|
@@ -427307,7 +427486,7 @@ class ChromeNativeHost {
|
|
|
427307
427486
|
} catch {}
|
|
427308
427487
|
try {
|
|
427309
427488
|
const socketDir = getSocketDir();
|
|
427310
|
-
const remaining = await
|
|
427489
|
+
const remaining = await readdir36(socketDir);
|
|
427311
427490
|
if (remaining.length === 0) {
|
|
427312
427491
|
await rmdir3(socketDir);
|
|
427313
427492
|
log("Removed empty socket directory");
|
|
@@ -428207,7 +428386,7 @@ async function handleMemories(state2) {
|
|
|
428207
428386
|
async function runProjectContextMcpServer() {
|
|
428208
428387
|
const projectRoot = process.env.THEUS_PROJECT_ROOT || process.cwd();
|
|
428209
428388
|
const state2 = new ProjectContextState(projectRoot);
|
|
428210
|
-
const server2 = new Server({ name: SERVER_NAME, version: { VERSION: "0.2.
|
|
428389
|
+
const server2 = new Server({ name: SERVER_NAME, version: { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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: {} } });
|
|
428211
428390
|
server2.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
428212
428391
|
tools: TOOL_DEFINITIONS.map((t) => ({
|
|
428213
428392
|
name: t.name,
|
|
@@ -428335,10 +428514,10 @@ var init_server3 = __esm(() => {
|
|
|
428335
428514
|
import { execFile as execFile8 } from "child_process";
|
|
428336
428515
|
import { existsSync as existsSync26, mkdirSync as mkdirSync12, readFileSync as readFileSync30, statSync as statSync14, unlinkSync as unlinkSync3, writeFileSync as writeFileSync10 } from "fs";
|
|
428337
428516
|
import { homedir as homedir43, tmpdir as tmpdir13 } from "os";
|
|
428338
|
-
import { join as
|
|
428517
|
+
import { join as join159 } from "path";
|
|
428339
428518
|
import { promisify as promisify6 } from "util";
|
|
428340
428519
|
function cuDir() {
|
|
428341
|
-
const dir =
|
|
428520
|
+
const dir = join159(homedir43(), ".theus", "cu");
|
|
428342
428521
|
if (!existsSync26(dir))
|
|
428343
428522
|
mkdirSync12(dir, { recursive: true });
|
|
428344
428523
|
return dir;
|
|
@@ -428386,7 +428565,7 @@ async function getScreenGeometry(force = false) {
|
|
|
428386
428565
|
return cachedGeometry;
|
|
428387
428566
|
}
|
|
428388
428567
|
async function checkPermissions() {
|
|
428389
|
-
const probe =
|
|
428568
|
+
const probe = join159(tmpdir13(), `theus-cu-probe-${process.pid}.jpg`);
|
|
428390
428569
|
const cap = await run6(SCREENCAPTURE, ["-x", "-t", "jpg", probe], { timeoutMs: 8000 });
|
|
428391
428570
|
const screenRecording = existsSync26(probe) && (() => {
|
|
428392
428571
|
try {
|
|
@@ -428415,8 +428594,8 @@ async function checkPermissions() {
|
|
|
428415
428594
|
async function captureScreenshot(opts = {}) {
|
|
428416
428595
|
const maxSide = opts.maxSide ?? 1400;
|
|
428417
428596
|
const quality = Math.min(Math.max(opts.quality ?? 72, 1), 100);
|
|
428418
|
-
const raw =
|
|
428419
|
-
const out =
|
|
428597
|
+
const raw = join159(cuDir(), `shot-${process.pid}.png`);
|
|
428598
|
+
const out = join159(cuDir(), `shot-${process.pid}.jpg`);
|
|
428420
428599
|
const capArgs = ["-x", "-t", "png", "-o"];
|
|
428421
428600
|
if (opts.displayIndex && opts.displayIndex > 0)
|
|
428422
428601
|
capArgs.push("-D", String(opts.displayIndex));
|
|
@@ -428580,8 +428759,8 @@ async function ensureScrollHelper() {
|
|
|
428580
428759
|
return scrollBinPromise;
|
|
428581
428760
|
scrollBinPromise = (async () => {
|
|
428582
428761
|
if (!existsSync26(SWIFTC) && SWIFTC === "swiftc") {}
|
|
428583
|
-
const src =
|
|
428584
|
-
const bin =
|
|
428762
|
+
const src = join159(cuDir(), "scroll.swift");
|
|
428763
|
+
const bin = join159(cuDir(), "theus-cu-scroll");
|
|
428585
428764
|
if (existsSync26(bin))
|
|
428586
428765
|
return bin;
|
|
428587
428766
|
try {
|
|
@@ -428912,7 +429091,7 @@ __export(exports_selftest, {
|
|
|
428912
429091
|
runComputerUseSelfTest: () => runComputerUseSelfTest
|
|
428913
429092
|
});
|
|
428914
429093
|
import { existsSync as existsSync27, writeFileSync as writeFileSync11 } from "fs";
|
|
428915
|
-
import { join as
|
|
429094
|
+
import { join as join160 } from "path";
|
|
428916
429095
|
import { homedir as homedir44 } from "os";
|
|
428917
429096
|
async function runComputerUseSelfTest() {
|
|
428918
429097
|
let pass = 0;
|
|
@@ -428964,7 +429143,7 @@ Geometr\xEDa y captura:`);
|
|
|
428964
429143
|
let captureOk = false;
|
|
428965
429144
|
try {
|
|
428966
429145
|
const shot = await captureScreenshot();
|
|
428967
|
-
const outPath =
|
|
429146
|
+
const outPath = join160(homedir44(), ".theus", "cu", "selftest-shot.jpg");
|
|
428968
429147
|
writeFileSync11(outPath, Buffer.from(shot.base64, "base64"));
|
|
428969
429148
|
ok2(`Captura ${shot.width}\xD7${shot.height} px, ${Math.round(shot.base64.length * 0.75 / 1024)} KB \u2192 ${outPath}`);
|
|
428970
429149
|
captureOk = true;
|
|
@@ -429816,8 +429995,8 @@ import {
|
|
|
429816
429995
|
chmod as chmod13,
|
|
429817
429996
|
lstat as lstat7,
|
|
429818
429997
|
mkdir as mkdir50,
|
|
429819
|
-
open as
|
|
429820
|
-
readFile as
|
|
429998
|
+
open as open23,
|
|
429999
|
+
readFile as readFile60,
|
|
429821
430000
|
rename as rename10,
|
|
429822
430001
|
unlink as unlink26
|
|
429823
430002
|
} from "fs/promises";
|
|
@@ -429827,21 +430006,21 @@ function defaultFleetCredentialsPath() {
|
|
|
429827
430006
|
return resolve52(homedir45(), ".theus", "titan", "fleet-worker.json");
|
|
429828
430007
|
}
|
|
429829
430008
|
async function rejectSymlink(path19) {
|
|
429830
|
-
const
|
|
430009
|
+
const stat54 = await lstat7(path19).catch((error40) => {
|
|
429831
430010
|
if (error40.code === "ENOENT")
|
|
429832
430011
|
return;
|
|
429833
430012
|
throw error40;
|
|
429834
430013
|
});
|
|
429835
|
-
if (
|
|
430014
|
+
if (stat54?.isSymbolicLink()) {
|
|
429836
430015
|
throw new Error("Se rechaz\xF3 un symlink como almac\xE9n de credenciales Fleet");
|
|
429837
430016
|
}
|
|
429838
|
-
if (
|
|
430017
|
+
if (stat54 && !stat54.isFile()) {
|
|
429839
430018
|
throw new Error("El almac\xE9n de credenciales Fleet no es un archivo regular");
|
|
429840
430019
|
}
|
|
429841
430020
|
}
|
|
429842
430021
|
async function loadFleetCredentials(path19 = defaultFleetCredentialsPath()) {
|
|
429843
430022
|
await rejectSymlink(path19);
|
|
429844
|
-
const raw = await
|
|
430023
|
+
const raw = await readFile60(path19, "utf8").catch((error40) => {
|
|
429845
430024
|
if (error40.code === "ENOENT")
|
|
429846
430025
|
return;
|
|
429847
430026
|
throw error40;
|
|
@@ -429867,7 +430046,7 @@ async function saveFleetCredentials(value, path19 = defaultFleetCredentialsPath(
|
|
|
429867
430046
|
await rejectSymlink(path19);
|
|
429868
430047
|
const temp = `${path19}.tmp-${process.pid}-${randomUUID38()}`;
|
|
429869
430048
|
const flags = constants5.O_WRONLY | constants5.O_CREAT | constants5.O_EXCL | (constants5.O_NOFOLLOW ?? 0);
|
|
429870
|
-
const handle2 = await
|
|
430049
|
+
const handle2 = await open23(temp, flags, 384);
|
|
429871
430050
|
try {
|
|
429872
430051
|
await handle2.writeFile(`${JSON.stringify(parsed, null, 2)}
|
|
429873
430052
|
`, "utf8");
|
|
@@ -429904,10 +430083,10 @@ import {
|
|
|
429904
430083
|
chmod as chmod14,
|
|
429905
430084
|
lstat as lstat8,
|
|
429906
430085
|
mkdir as mkdir51,
|
|
429907
|
-
open as
|
|
429908
|
-
readFile as
|
|
430086
|
+
open as open24,
|
|
430087
|
+
readFile as readFile61,
|
|
429909
430088
|
rename as rename11,
|
|
429910
|
-
stat as
|
|
430089
|
+
stat as stat54,
|
|
429911
430090
|
unlink as unlink27
|
|
429912
430091
|
} from "fs/promises";
|
|
429913
430092
|
import { homedir as homedir46 } from "os";
|
|
@@ -429977,7 +430156,7 @@ async function rejectSymlink2(path19) {
|
|
|
429977
430156
|
}
|
|
429978
430157
|
async function readRecords(path19) {
|
|
429979
430158
|
await rejectSymlink2(path19);
|
|
429980
|
-
const info = await
|
|
430159
|
+
const info = await stat54(path19).catch((error40) => {
|
|
429981
430160
|
if (error40.code === "ENOENT")
|
|
429982
430161
|
return;
|
|
429983
430162
|
throw error40;
|
|
@@ -429994,7 +430173,7 @@ async function readRecords(path19) {
|
|
|
429994
430173
|
throw new FleetOutboxCorruptError("El outbox Fleet excede el l\xEDmite de bytes");
|
|
429995
430174
|
}
|
|
429996
430175
|
try {
|
|
429997
|
-
const parsed = outboxFileSchema.parse(JSON.parse(await
|
|
430176
|
+
const parsed = outboxFileSchema.parse(JSON.parse(await readFile61(path19, "utf8")));
|
|
429998
430177
|
const ids = new Set;
|
|
429999
430178
|
return parsed.records.map((record3) => {
|
|
430000
430179
|
const checked = validateRecord(record3);
|
|
@@ -430034,7 +430213,7 @@ async function writeRecords(path19, records) {
|
|
|
430034
430213
|
await chmod14(directory, 448);
|
|
430035
430214
|
await rejectSymlink2(path19);
|
|
430036
430215
|
const temp = `${path19}.tmp-${process.pid}-${randomUUID39()}`;
|
|
430037
|
-
const handle2 = await
|
|
430216
|
+
const handle2 = await open24(temp, constants6.O_WRONLY | constants6.O_CREAT | constants6.O_EXCL | (constants6.O_NOFOLLOW ?? 0), 384);
|
|
430038
430217
|
try {
|
|
430039
430218
|
await handle2.writeFile(serialized, "utf8");
|
|
430040
430219
|
await handle2.sync();
|
|
@@ -430045,7 +430224,7 @@ async function writeRecords(path19, records) {
|
|
|
430045
430224
|
await chmod14(temp, 384);
|
|
430046
430225
|
await rename11(temp, path19);
|
|
430047
430226
|
await chmod14(path19, 384);
|
|
430048
|
-
const directoryHandle = await
|
|
430227
|
+
const directoryHandle = await open24(directory, constants6.O_RDONLY);
|
|
430049
430228
|
try {
|
|
430050
430229
|
await directoryHandle.sync();
|
|
430051
430230
|
} finally {
|
|
@@ -430884,7 +431063,7 @@ async function runTitanFleetWorker(args) {
|
|
|
430884
431063
|
max_concurrency: maxConcurrency,
|
|
430885
431064
|
runtime: {
|
|
430886
431065
|
name: "theus-cli",
|
|
430887
|
-
version: { VERSION: "0.2.
|
|
431066
|
+
version: { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
430888
431067
|
}
|
|
430889
431068
|
});
|
|
430890
431069
|
const client2 = new TitanFleetClient({
|
|
@@ -431412,7 +431591,7 @@ __export(exports_titan_fleet_run, {
|
|
|
431412
431591
|
parseFleetPlanFile: () => parseFleetPlanFile,
|
|
431413
431592
|
describeFleetRunError: () => describeFleetRunError
|
|
431414
431593
|
});
|
|
431415
|
-
import { readFile as
|
|
431594
|
+
import { readFile as readFile62 } from "fs/promises";
|
|
431416
431595
|
import { resolve as resolve55 } from "path";
|
|
431417
431596
|
function valuesAfter(args, name) {
|
|
431418
431597
|
const found = [];
|
|
@@ -431523,7 +431702,7 @@ async function runTitanFleetRun(args) {
|
|
|
431523
431702
|
process.stdout.write(HELP3);
|
|
431524
431703
|
return;
|
|
431525
431704
|
}
|
|
431526
|
-
const build = options2.planPath ? parseFleetPlanFile(await
|
|
431705
|
+
const build = options2.planPath ? parseFleetPlanFile(await readFile62(resolve55(options2.planPath), "utf8")) : options2.build;
|
|
431527
431706
|
if (!build) {
|
|
431528
431707
|
throw new FleetProducerError("No hay nada que encolar");
|
|
431529
431708
|
}
|
|
@@ -431605,15 +431784,15 @@ var init_titan_fleet_run = __esm(() => {
|
|
|
431605
431784
|
});
|
|
431606
431785
|
|
|
431607
431786
|
// utils/cronTasksLock.ts
|
|
431608
|
-
import { mkdir as mkdir52, readFile as
|
|
431609
|
-
import { dirname as dirname67, join as
|
|
431787
|
+
import { mkdir as mkdir52, readFile as readFile63, unlink as unlink28, writeFile as writeFile51 } from "fs/promises";
|
|
431788
|
+
import { dirname as dirname67, join as join161 } from "path";
|
|
431610
431789
|
function getLockPath(dir) {
|
|
431611
|
-
return
|
|
431790
|
+
return join161(dir ?? getProjectRoot(), LOCK_FILE_REL);
|
|
431612
431791
|
}
|
|
431613
431792
|
async function readLock(dir) {
|
|
431614
431793
|
let raw;
|
|
431615
431794
|
try {
|
|
431616
|
-
raw = await
|
|
431795
|
+
raw = await readFile63(getLockPath(dir), "utf8");
|
|
431617
431796
|
} catch {
|
|
431618
431797
|
return;
|
|
431619
431798
|
}
|
|
@@ -431714,7 +431893,7 @@ var init_cronTasksLock = __esm(() => {
|
|
|
431714
431893
|
init_genericProcessUtils();
|
|
431715
431894
|
init_json();
|
|
431716
431895
|
init_slowOperations();
|
|
431717
|
-
LOCK_FILE_REL =
|
|
431896
|
+
LOCK_FILE_REL = join161(".theus", "scheduled_tasks.lock");
|
|
431718
431897
|
schedulerLockSchema = lazySchema(() => exports_external.object({
|
|
431719
431898
|
sessionId: exports_external.string(),
|
|
431720
431899
|
pid: exports_external.number(),
|
|
@@ -432022,10 +432201,10 @@ import {
|
|
|
432022
432201
|
writeFileSync as writeFileSync12
|
|
432023
432202
|
} from "fs";
|
|
432024
432203
|
import { homedir as homedir47 } from "os";
|
|
432025
|
-
import { dirname as dirname68, join as
|
|
432204
|
+
import { dirname as dirname68, join as join162 } from "path";
|
|
432026
432205
|
import { fileURLToPath as fileURLToPath7 } from "url";
|
|
432027
432206
|
function projectsConfigPath() {
|
|
432028
|
-
return
|
|
432207
|
+
return join162(homedir47(), ".theus", "daemon", "projects.json");
|
|
432029
432208
|
}
|
|
432030
432209
|
function readEnabledProjects() {
|
|
432031
432210
|
let raw;
|
|
@@ -432044,17 +432223,17 @@ function readEnabledProjects() {
|
|
|
432044
432223
|
return list3.filter((p) => p && typeof p.dir === "string" && p.enabled !== false);
|
|
432045
432224
|
}
|
|
432046
432225
|
function daemonDir2() {
|
|
432047
|
-
return
|
|
432226
|
+
return join162(homedir47(), ".theus", "daemon");
|
|
432048
432227
|
}
|
|
432049
432228
|
function daemonLogPath() {
|
|
432050
|
-
return
|
|
432229
|
+
return join162(daemonDir2(), "daemon.log");
|
|
432051
432230
|
}
|
|
432052
432231
|
function resolveWorkerBin() {
|
|
432053
432232
|
const override = process.env.THEUS_DAEMON_WORKER_BIN;
|
|
432054
432233
|
if (typeof override === "string" && override.length > 0)
|
|
432055
432234
|
return override;
|
|
432056
432235
|
const here = dirname68(fileURLToPath7(import.meta.url));
|
|
432057
|
-
return
|
|
432236
|
+
return join162(here, "..", "bin", "theus");
|
|
432058
432237
|
}
|
|
432059
432238
|
function turnTimeoutMs() {
|
|
432060
432239
|
const raw = process.env.THEUS_DAEMON_TURN_TIMEOUT_MS;
|
|
@@ -432087,10 +432266,10 @@ function logDaemonLine(line) {
|
|
|
432087
432266
|
}
|
|
432088
432267
|
function writeRunHistory(record3) {
|
|
432089
432268
|
try {
|
|
432090
|
-
const dir =
|
|
432269
|
+
const dir = join162(daemonDir2(), "runs", record3.taskId);
|
|
432091
432270
|
mkdirSync13(dir, { recursive: true });
|
|
432092
432271
|
const stamp2 = record3.startedAt.replace(/:/g, "-");
|
|
432093
|
-
writeFileSync12(
|
|
432272
|
+
writeFileSync12(join162(dir, `${stamp2}.json`), JSON.stringify(record3, null, 2), "utf8");
|
|
432094
432273
|
pruneRunHistory(record3.taskId);
|
|
432095
432274
|
} catch (e) {
|
|
432096
432275
|
logDaemonLine(`[daemon:cron] ERROR guardando historial task=${record3.taskId}: ${e?.message}`);
|
|
@@ -432101,13 +432280,13 @@ function pruneRunHistory(taskId) {
|
|
|
432101
432280
|
const raw = process.env.THEUS_DAEMON_RUNS_KEEP;
|
|
432102
432281
|
const parsed = raw ? Number.parseInt(raw, 10) : NaN;
|
|
432103
432282
|
const keep = Number.isInteger(parsed) && parsed > 0 ? parsed : 50;
|
|
432104
|
-
const dir =
|
|
432283
|
+
const dir = join162(daemonDir2(), "runs", taskId);
|
|
432105
432284
|
const files2 = readdirSync5(dir).filter((f) => f.endsWith(".json")).sort();
|
|
432106
432285
|
if (files2.length <= keep)
|
|
432107
432286
|
return;
|
|
432108
432287
|
for (const f of files2.slice(0, files2.length - keep)) {
|
|
432109
432288
|
try {
|
|
432110
|
-
unlinkSync4(
|
|
432289
|
+
unlinkSync4(join162(dir, f));
|
|
432111
432290
|
} catch {}
|
|
432112
432291
|
}
|
|
432113
432292
|
} catch {}
|
|
@@ -432297,15 +432476,15 @@ import {
|
|
|
432297
432476
|
writeFileSync as writeFileSync13
|
|
432298
432477
|
} from "fs";
|
|
432299
432478
|
import { homedir as homedir48 } from "os";
|
|
432300
|
-
import { dirname as dirname69, join as
|
|
432479
|
+
import { dirname as dirname69, join as join163 } from "path";
|
|
432301
432480
|
function daemonDir3() {
|
|
432302
|
-
return
|
|
432481
|
+
return join163(homedir48(), ".theus", "daemon");
|
|
432303
432482
|
}
|
|
432304
432483
|
function pidFilePath() {
|
|
432305
|
-
return
|
|
432484
|
+
return join163(daemonDir3(), "theus-daemon.pid");
|
|
432306
432485
|
}
|
|
432307
432486
|
function logFilePath() {
|
|
432308
|
-
return
|
|
432487
|
+
return join163(daemonDir3(), "daemon.log");
|
|
432309
432488
|
}
|
|
432310
432489
|
function ensureDaemonDir() {
|
|
432311
432490
|
mkdirSync14(daemonDir3(), { recursive: true });
|
|
@@ -432403,7 +432582,7 @@ function resolveTheusBin() {
|
|
|
432403
432582
|
return "theus";
|
|
432404
432583
|
}
|
|
432405
432584
|
function macosServiceSpec() {
|
|
432406
|
-
const path19 =
|
|
432585
|
+
const path19 = join163(homedir48(), "Library", "LaunchAgents", "pe.theus.daemon.plist");
|
|
432407
432586
|
const bin = resolveTheusBin();
|
|
432408
432587
|
const logDir = daemonDir3();
|
|
432409
432588
|
const content = `<?xml version="1.0" encoding="UTF-8"?>
|
|
@@ -432430,9 +432609,9 @@ function macosServiceSpec() {
|
|
|
432430
432609
|
<key>KeepAlive</key>
|
|
432431
432610
|
<true/>
|
|
432432
432611
|
<key>StandardOutPath</key>
|
|
432433
|
-
<string>${
|
|
432612
|
+
<string>${join163(logDir, "launchd.out.log")}</string>
|
|
432434
432613
|
<key>StandardErrorPath</key>
|
|
432435
|
-
<string>${
|
|
432614
|
+
<string>${join163(logDir, "launchd.err.log")}</string>
|
|
432436
432615
|
</dict>
|
|
432437
432616
|
</plist>
|
|
432438
432617
|
`;
|
|
@@ -432447,7 +432626,7 @@ function macosServiceSpec() {
|
|
|
432447
432626
|
};
|
|
432448
432627
|
}
|
|
432449
432628
|
function linuxServiceSpec() {
|
|
432450
|
-
const path19 =
|
|
432629
|
+
const path19 = join163(homedir48(), ".config", "systemd", "user", "theus-daemon.service");
|
|
432451
432630
|
const bin = resolveTheusBin();
|
|
432452
432631
|
const content = `[Unit]
|
|
432453
432632
|
Description=Theus daemon (cron/agent supervisor)
|
|
@@ -432775,7 +432954,7 @@ function createBridgeLogger(options2) {
|
|
|
432775
432954
|
connectUrl = buildBridgeConnectUrl(environmentId, cachedIngressUrl);
|
|
432776
432955
|
regenerateQr(connectUrl);
|
|
432777
432956
|
if (verbose) {
|
|
432778
|
-
write(source_default.dim(`Remote Control`) + ` v${{ VERSION: "0.2.
|
|
432957
|
+
write(source_default.dim(`Remote Control`) + ` v${{ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}
|
|
432779
432958
|
`);
|
|
432780
432959
|
}
|
|
432781
432960
|
if (verbose) {
|
|
@@ -433183,7 +433362,7 @@ var init_pollConfig = __esm(() => {
|
|
|
433183
433362
|
import { spawn as spawn13 } from "child_process";
|
|
433184
433363
|
import { createWriteStream as createWriteStream4 } from "fs";
|
|
433185
433364
|
import { tmpdir as tmpdir14 } from "os";
|
|
433186
|
-
import { dirname as dirname70, join as
|
|
433365
|
+
import { dirname as dirname70, join as join164 } from "path";
|
|
433187
433366
|
import { createInterface } from "readline";
|
|
433188
433367
|
function safeFilenameId(id2) {
|
|
433189
433368
|
return id2.replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
@@ -433316,12 +433495,12 @@ function createSessionSpawner(deps) {
|
|
|
433316
433495
|
debugFile = `${deps.debugFile}-${safeId}`;
|
|
433317
433496
|
}
|
|
433318
433497
|
} else if (deps.verbose || false) {
|
|
433319
|
-
debugFile =
|
|
433498
|
+
debugFile = join164(tmpdir14(), "theus", `bridge-session-${safeId}.log`);
|
|
433320
433499
|
}
|
|
433321
433500
|
let transcriptStream = null;
|
|
433322
433501
|
let transcriptPath;
|
|
433323
433502
|
if (deps.debugFile) {
|
|
433324
|
-
transcriptPath =
|
|
433503
|
+
transcriptPath = join164(dirname70(deps.debugFile), `bridge-transcript-${safeId}.jsonl`);
|
|
433325
433504
|
transcriptStream = createWriteStream4(transcriptPath, { flags: "a" });
|
|
433326
433505
|
transcriptStream.on("error", (err2) => {
|
|
433327
433506
|
deps.onDebug(`[bridge:session] Transcript write error: ${err2.message}`);
|
|
@@ -433594,10 +433773,10 @@ __export(exports_bridgePointer, {
|
|
|
433594
433773
|
clearBridgePointer: () => clearBridgePointer,
|
|
433595
433774
|
BRIDGE_POINTER_TTL_MS: () => BRIDGE_POINTER_TTL_MS
|
|
433596
433775
|
});
|
|
433597
|
-
import { mkdir as mkdir53, readFile as
|
|
433598
|
-
import { dirname as dirname71, join as
|
|
433776
|
+
import { mkdir as mkdir53, readFile as readFile64, stat as stat55, unlink as unlink29, writeFile as writeFile52 } from "fs/promises";
|
|
433777
|
+
import { dirname as dirname71, join as join165 } from "path";
|
|
433599
433778
|
function getBridgePointerPath(dir) {
|
|
433600
|
-
return
|
|
433779
|
+
return join165(getProjectsDir(), sanitizePath2(dir), "bridge-pointer.json");
|
|
433601
433780
|
}
|
|
433602
433781
|
async function writeBridgePointer(dir, pointer) {
|
|
433603
433782
|
const path19 = getBridgePointerPath(dir);
|
|
@@ -433614,8 +433793,8 @@ async function readBridgePointer(dir) {
|
|
|
433614
433793
|
let raw;
|
|
433615
433794
|
let mtimeMs;
|
|
433616
433795
|
try {
|
|
433617
|
-
mtimeMs = (await
|
|
433618
|
-
raw = await
|
|
433796
|
+
mtimeMs = (await stat55(path19)).mtimeMs;
|
|
433797
|
+
raw = await readFile64(path19, "utf8");
|
|
433619
433798
|
} catch {
|
|
433620
433799
|
return null;
|
|
433621
433800
|
}
|
|
@@ -433699,12 +433878,12 @@ var init_bridgePointer = __esm(() => {
|
|
|
433699
433878
|
});
|
|
433700
433879
|
|
|
433701
433880
|
// utils/errorLogSink.ts
|
|
433702
|
-
import { dirname as dirname72, join as
|
|
433881
|
+
import { dirname as dirname72, join as join166 } from "path";
|
|
433703
433882
|
function getErrorsPath() {
|
|
433704
|
-
return
|
|
433883
|
+
return join166(CACHE_PATHS.errors(), DATE + ".jsonl");
|
|
433705
433884
|
}
|
|
433706
433885
|
function getMCPLogsPath(serverName) {
|
|
433707
|
-
return
|
|
433886
|
+
return join166(CACHE_PATHS.mcpLogs(serverName), DATE + ".jsonl");
|
|
433708
433887
|
}
|
|
433709
433888
|
function createJsonlWriter(options2) {
|
|
433710
433889
|
const writer = createBufferedWriter(options2);
|
|
@@ -433748,7 +433927,7 @@ function appendToLog(path19, message) {
|
|
|
433748
433927
|
cwd: getFsImplementation().cwd(),
|
|
433749
433928
|
userType: "external",
|
|
433750
433929
|
sessionId: getSessionId(),
|
|
433751
|
-
version: { VERSION: "0.2.
|
|
433930
|
+
version: { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
433752
433931
|
};
|
|
433753
433932
|
getLogWriter(path19).write(messageWithTimestamp);
|
|
433754
433933
|
}
|
|
@@ -433860,7 +434039,7 @@ __export(exports_bridgeMain, {
|
|
|
433860
434039
|
});
|
|
433861
434040
|
import { randomUUID as randomUUID42 } from "crypto";
|
|
433862
434041
|
import { hostname as hostname4, tmpdir as tmpdir15 } from "os";
|
|
433863
|
-
import { basename as basename51, join as
|
|
434042
|
+
import { basename as basename51, join as join167, resolve as resolve56 } from "path";
|
|
433864
434043
|
async function isMultiSessionSpawnEnabled() {
|
|
433865
434044
|
return checkGate_CACHED_OR_BLOCKING("theus_ccr_bridge_multi_session");
|
|
433866
434045
|
}
|
|
@@ -434373,7 +434552,7 @@ async function runBridgeLoop(config3, environmentId, environmentSecret, api2, sp
|
|
|
434373
434552
|
sessionDebugFile = `${config3.debugFile}-${safeId}`;
|
|
434374
434553
|
}
|
|
434375
434554
|
} else if (config3.verbose || false) {
|
|
434376
|
-
sessionDebugFile =
|
|
434555
|
+
sessionDebugFile = join167(tmpdir15(), "theus", `bridge-session-${safeId}.log`);
|
|
434377
434556
|
}
|
|
434378
434557
|
if (sessionDebugFile) {
|
|
434379
434558
|
logger.logVerbose(`Debug log: ${sessionDebugFile}`);
|
|
@@ -435009,7 +435188,7 @@ Spawn mode for this project:
|
|
|
435009
435188
|
const api2 = createBridgeApiClient({
|
|
435010
435189
|
baseUrl,
|
|
435011
435190
|
getAccessToken: getBridgeAccessToken2,
|
|
435012
|
-
runnerVersion: { VERSION: "0.2.
|
|
435191
|
+
runnerVersion: { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
435013
435192
|
onDebug: logForDebugging,
|
|
435014
435193
|
onAuth401: handleOAuth401Error2,
|
|
435015
435194
|
getTrustedDeviceToken
|
|
@@ -435247,7 +435426,7 @@ async function runBridgeHeadless(opts, signal) {
|
|
|
435247
435426
|
const api2 = createBridgeApiClient({
|
|
435248
435427
|
baseUrl,
|
|
435249
435428
|
getAccessToken: opts.getAccessToken,
|
|
435250
|
-
runnerVersion: { VERSION: "0.2.
|
|
435429
|
+
runnerVersion: { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
435251
435430
|
onDebug: log2,
|
|
435252
435431
|
onAuth401: opts.onAuth401,
|
|
435253
435432
|
getTrustedDeviceToken
|
|
@@ -438344,7 +438523,7 @@ function buildSystemInitMessage(inputs) {
|
|
|
438344
438523
|
slash_commands: inputs.commands.filter((c5) => c5.userInvocable !== false).map((c5) => c5.name),
|
|
438345
438524
|
apiKeySource: getTheusApiKeyWithSource().source,
|
|
438346
438525
|
betas: getSdkBetas(),
|
|
438347
|
-
theus_code_version: { VERSION: "0.2.
|
|
438526
|
+
theus_code_version: { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
438348
438527
|
output_style: outputStyle2,
|
|
438349
438528
|
agents: inputs.agents.map((agent) => agent.agentType),
|
|
438350
438529
|
skills: inputs.skills.filter((s) => s.userInvocable !== false).map((skill) => skill.name),
|
|
@@ -438384,8 +438563,8 @@ async function getEnvLessBridgeConfig() {
|
|
|
438384
438563
|
}
|
|
438385
438564
|
async function checkEnvLessBridgeMinVersion() {
|
|
438386
438565
|
const cfg = await getEnvLessBridgeConfig();
|
|
438387
|
-
if (cfg.min_version && lt({ VERSION: "0.2.
|
|
438388
|
-
return `Your version of Theus (${{ VERSION: "0.2.
|
|
438566
|
+
if (cfg.min_version && lt({ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
|
|
438567
|
+
return `Your version of Theus (${{ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.
|
|
438389
438568
|
Version ${cfg.min_version} or higher is required. Run \`theus update\` to update.`;
|
|
438390
438569
|
}
|
|
438391
438570
|
return null;
|
|
@@ -440709,7 +440888,7 @@ async function initBridgeCore(params) {
|
|
|
440709
440888
|
const rawApi = createBridgeApiClient({
|
|
440710
440889
|
baseUrl,
|
|
440711
440890
|
getAccessToken,
|
|
440712
|
-
runnerVersion: { VERSION: "0.2.
|
|
440891
|
+
runnerVersion: { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
440713
440892
|
onDebug: logForDebugging,
|
|
440714
440893
|
onAuth401,
|
|
440715
440894
|
getTrustedDeviceToken
|
|
@@ -442543,7 +442722,7 @@ __export(exports_inboundAttachments, {
|
|
|
442543
442722
|
});
|
|
442544
442723
|
import { randomUUID as randomUUID47 } from "crypto";
|
|
442545
442724
|
import { mkdir as mkdir54, writeFile as writeFile53 } from "fs/promises";
|
|
442546
|
-
import { basename as basename52, join as
|
|
442725
|
+
import { basename as basename52, join as join168 } from "path";
|
|
442547
442726
|
function debug2(msg) {
|
|
442548
442727
|
logForDebugging(`[bridge:inbound-attach] ${msg}`);
|
|
442549
442728
|
}
|
|
@@ -442559,7 +442738,7 @@ function sanitizeFileName(name) {
|
|
|
442559
442738
|
return base2 || "attachment";
|
|
442560
442739
|
}
|
|
442561
442740
|
function uploadsDir() {
|
|
442562
|
-
return
|
|
442741
|
+
return join168(getTheusConfigHomeDir(), "uploads", getSessionId());
|
|
442563
442742
|
}
|
|
442564
442743
|
async function resolveOne(att) {
|
|
442565
442744
|
const token = getBridgeAccessToken();
|
|
@@ -442588,7 +442767,7 @@ async function resolveOne(att) {
|
|
|
442588
442767
|
const safeName = sanitizeFileName(att.file_name);
|
|
442589
442768
|
const prefix = (att.file_uuid.slice(0, 8) || randomUUID47().slice(0, 8)).replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
442590
442769
|
const dir = uploadsDir();
|
|
442591
|
-
const outPath =
|
|
442770
|
+
const outPath = join168(dir, `${prefix}-${safeName}`);
|
|
442592
442771
|
try {
|
|
442593
442772
|
await mkdir54(dir, { recursive: true });
|
|
442594
442773
|
await writeFile53(outPath, data);
|
|
@@ -449448,7 +449627,7 @@ var init_ShowInIDEPrompt = __esm(() => {
|
|
|
449448
449627
|
|
|
449449
449628
|
// components/permissions/FilePermissionDialog/permissionOptions.tsx
|
|
449450
449629
|
import { homedir as homedir49 } from "os";
|
|
449451
|
-
import { basename as basename56, join as
|
|
449630
|
+
import { basename as basename56, join as join169, sep as sep34 } from "path";
|
|
449452
449631
|
function isInTheusFolder(filePath) {
|
|
449453
449632
|
const absolutePath = expandPath(filePath);
|
|
449454
449633
|
const theusFolderPath = expandPath(`${getOriginalCwd()}/.theus`);
|
|
@@ -449458,7 +449637,7 @@ function isInTheusFolder(filePath) {
|
|
|
449458
449637
|
}
|
|
449459
449638
|
function isInGlobalTheusFolder(filePath) {
|
|
449460
449639
|
const absolutePath = expandPath(filePath);
|
|
449461
|
-
const globalTheusFolderPath =
|
|
449640
|
+
const globalTheusFolderPath = join169(homedir49(), ".theus");
|
|
449462
449641
|
const normalizedAbsolutePath = normalizeCaseForComparison(absolutePath);
|
|
449463
449642
|
const normalizedGlobalTheusFolderPath = normalizeCaseForComparison(globalTheusFolderPath);
|
|
449464
449643
|
return normalizedAbsolutePath.startsWith(normalizedGlobalTheusFolderPath + sep34.toLowerCase()) || normalizedAbsolutePath.startsWith(normalizedGlobalTheusFolderPath + "/");
|
|
@@ -457350,7 +457529,7 @@ var init_useVoiceEnabled = __esm(() => {
|
|
|
457350
457529
|
function getSemverPart(version3) {
|
|
457351
457530
|
return `${import_semver11.major(version3, { loose: true })}.${import_semver11.minor(version3, { loose: true })}.${import_semver11.patch(version3, { loose: true })}`;
|
|
457352
457531
|
}
|
|
457353
|
-
function useUpdateNotification(updatedVersion, initialVersion = { VERSION: "0.2.
|
|
457532
|
+
function useUpdateNotification(updatedVersion, initialVersion = { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION) {
|
|
457354
457533
|
const [lastNotifiedSemver, setLastNotifiedSemver] = import_react235.useState(() => getSemverPart(initialVersion));
|
|
457355
457534
|
if (!updatedVersion) {
|
|
457356
457535
|
return null;
|
|
@@ -457390,7 +457569,7 @@ function AutoUpdater({
|
|
|
457390
457569
|
return;
|
|
457391
457570
|
}
|
|
457392
457571
|
if (false) {}
|
|
457393
|
-
const currentVersion = { VERSION: "0.2.
|
|
457572
|
+
const currentVersion = { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
|
|
457394
457573
|
const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
|
|
457395
457574
|
let latestVersion = await getLatestVersion(channel2);
|
|
457396
457575
|
const isDisabled2 = isAutoUpdaterDisabled();
|
|
@@ -457525,7 +457704,7 @@ function AutoUpdater({
|
|
|
457525
457704
|
" ",
|
|
457526
457705
|
/* @__PURE__ */ jsx_runtime414.jsx(ThemedText, {
|
|
457527
457706
|
bold: true,
|
|
457528
|
-
children: hasLocalInstall ? `cd ~/.theus/local && npm update ${{ VERSION: "0.2.
|
|
457707
|
+
children: hasLocalInstall ? `cd ~/.theus/local && npm update ${{ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.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.73", BUILD_TIME: "1970-01-01T00:00:00.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}`
|
|
457529
457708
|
})
|
|
457530
457709
|
]
|
|
457531
457710
|
})
|
|
@@ -457602,12 +457781,12 @@ function NativeAutoUpdater({
|
|
|
457602
457781
|
logEvent("theus_native_auto_updater_start", {});
|
|
457603
457782
|
try {
|
|
457604
457783
|
const maxVersion = await getMaxVersion();
|
|
457605
|
-
if (maxVersion && gt({ VERSION: "0.2.
|
|
457784
|
+
if (maxVersion && gt({ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
|
|
457606
457785
|
const msg = await getMaxVersionMessage();
|
|
457607
457786
|
setMaxVersionIssue(msg ?? "affects your version");
|
|
457608
457787
|
}
|
|
457609
457788
|
const result = await installLatest(channel2);
|
|
457610
|
-
const currentVersion = { VERSION: "0.2.
|
|
457789
|
+
const currentVersion = { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
|
|
457611
457790
|
const latencyMs = Date.now() - startTime2;
|
|
457612
457791
|
if (result.lockFailed) {
|
|
457613
457792
|
logEvent("theus_native_auto_updater_lock_contention", {
|
|
@@ -457744,17 +457923,17 @@ function PackageManagerAutoUpdater(t0) {
|
|
|
457744
457923
|
const maxVersion = await getMaxVersion();
|
|
457745
457924
|
if (maxVersion && latest && gt(latest, maxVersion)) {
|
|
457746
457925
|
logForDebugging(`PackageManagerAutoUpdater: maxVersion ${maxVersion} is set, capping update from ${latest} to ${maxVersion}`);
|
|
457747
|
-
if (gte({ VERSION: "0.2.
|
|
457748
|
-
logForDebugging(`PackageManagerAutoUpdater: current version ${{ VERSION: "0.2.
|
|
457926
|
+
if (gte({ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
|
|
457927
|
+
logForDebugging(`PackageManagerAutoUpdater: current version ${{ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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`);
|
|
457749
457928
|
setUpdateAvailable(false);
|
|
457750
457929
|
return;
|
|
457751
457930
|
}
|
|
457752
457931
|
latest = maxVersion;
|
|
457753
457932
|
}
|
|
457754
|
-
const hasUpdate = latest && !gte({ VERSION: "0.2.
|
|
457933
|
+
const hasUpdate = latest && !gte({ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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);
|
|
457755
457934
|
setUpdateAvailable(!!hasUpdate);
|
|
457756
457935
|
if (hasUpdate) {
|
|
457757
|
-
logForDebugging(`PackageManagerAutoUpdater: Update available ${{ VERSION: "0.2.
|
|
457936
|
+
logForDebugging(`PackageManagerAutoUpdater: Update available ${{ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}`);
|
|
457758
457937
|
}
|
|
457759
457938
|
};
|
|
457760
457939
|
$2[0] = t1;
|
|
@@ -457788,7 +457967,7 @@ function PackageManagerAutoUpdater(t0) {
|
|
|
457788
457967
|
wrap: "truncate",
|
|
457789
457968
|
children: [
|
|
457790
457969
|
"versi\xF3n actual: ",
|
|
457791
|
-
{ VERSION: "0.2.
|
|
457970
|
+
{ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
457792
457971
|
]
|
|
457793
457972
|
});
|
|
457794
457973
|
$2[3] = verbose;
|
|
@@ -464426,8 +464605,8 @@ function findTextObject(text2, offset, objectType2, isInner) {
|
|
|
464426
464605
|
return findWordObject(text2, offset, isInner, (ch2) => !isVimWhitespace(ch2));
|
|
464427
464606
|
const pair = PAIRS[objectType2];
|
|
464428
464607
|
if (pair) {
|
|
464429
|
-
const [
|
|
464430
|
-
return
|
|
464608
|
+
const [open25, close] = pair;
|
|
464609
|
+
return open25 === close ? findQuoteObject(text2, offset, open25, isInner) : findBracketObject(text2, offset, open25, close, isInner);
|
|
464431
464610
|
}
|
|
464432
464611
|
return null;
|
|
464433
464612
|
}
|
|
@@ -464502,13 +464681,13 @@ function findQuoteObject(text2, offset, quote2, isInner) {
|
|
|
464502
464681
|
}
|
|
464503
464682
|
return null;
|
|
464504
464683
|
}
|
|
464505
|
-
function findBracketObject(text2, offset,
|
|
464684
|
+
function findBracketObject(text2, offset, open25, close, isInner) {
|
|
464506
464685
|
let depth = 0;
|
|
464507
464686
|
let start = -1;
|
|
464508
464687
|
for (let i3 = offset;i3 >= 0; i3--) {
|
|
464509
464688
|
if (text2[i3] === close && i3 !== offset)
|
|
464510
464689
|
depth++;
|
|
464511
|
-
else if (text2[i3] ===
|
|
464690
|
+
else if (text2[i3] === open25) {
|
|
464512
464691
|
if (depth === 0) {
|
|
464513
464692
|
start = i3;
|
|
464514
464693
|
break;
|
|
@@ -464521,7 +464700,7 @@ function findBracketObject(text2, offset, open24, close, isInner) {
|
|
|
464521
464700
|
depth = 0;
|
|
464522
464701
|
let end = -1;
|
|
464523
464702
|
for (let i3 = start + 1;i3 < text2.length; i3++) {
|
|
464524
|
-
if (text2[i3] ===
|
|
464703
|
+
if (text2[i3] === open25)
|
|
464525
464704
|
depth++;
|
|
464526
464705
|
else if (text2[i3] === close) {
|
|
464527
464706
|
if (depth === 0) {
|
|
@@ -465651,7 +465830,7 @@ function buildStatusLineCommandInput(permissionMode2, exceeds200kTokens, setting
|
|
|
465651
465830
|
project_dir: getOriginalCwd(),
|
|
465652
465831
|
added_dirs: addedDirs
|
|
465653
465832
|
},
|
|
465654
|
-
version: { VERSION: "0.2.
|
|
465833
|
+
version: { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
465655
465834
|
output_style: {
|
|
465656
465835
|
name: outputStyleName
|
|
465657
465836
|
},
|
|
@@ -471639,9 +471818,9 @@ function initSkillImprovement() {
|
|
|
471639
471818
|
async function applySkillImprovement(skillName, updates) {
|
|
471640
471819
|
if (!skillName)
|
|
471641
471820
|
return;
|
|
471642
|
-
const { join:
|
|
471821
|
+
const { join: join170 } = await import("path");
|
|
471643
471822
|
const fs5 = await import("fs/promises");
|
|
471644
|
-
const filePath =
|
|
471823
|
+
const filePath = join170(getCwd(), ".theus", "skills", skillName, "SKILL.md");
|
|
471645
471824
|
let currentContent;
|
|
471646
471825
|
try {
|
|
471647
471826
|
currentContent = await fs5.readFile(filePath, "utf-8");
|
|
@@ -471793,7 +471972,7 @@ function useMoreRight(_args) {
|
|
|
471793
471972
|
}
|
|
471794
471973
|
|
|
471795
471974
|
// utils/cleanup.ts
|
|
471796
|
-
import { join as
|
|
471975
|
+
import { join as join170 } from "path";
|
|
471797
471976
|
function getCutoffDate() {
|
|
471798
471977
|
const settings = getSettings_DEPRECATED() || {};
|
|
471799
471978
|
const cleanupPeriodDays = settings.cleanupPeriodDays ?? DEFAULT_CLEANUP_PERIOD_DAYS;
|
|
@@ -471818,7 +471997,7 @@ async function cleanupOldFilesInDirectory(dirPath, cutoffDate, isMessagePath) {
|
|
|
471818
471997
|
try {
|
|
471819
471998
|
const timestamp2 = convertFileNameToDate(file2.name);
|
|
471820
471999
|
if (timestamp2 < cutoffDate) {
|
|
471821
|
-
await getFsImplementation().unlink(
|
|
472000
|
+
await getFsImplementation().unlink(join170(dirPath, file2.name));
|
|
471822
472001
|
if (isMessagePath) {
|
|
471823
472002
|
result.messages++;
|
|
471824
472003
|
} else {
|
|
@@ -471849,7 +472028,7 @@ async function cleanupOldMessageFiles() {
|
|
|
471849
472028
|
} catch {
|
|
471850
472029
|
return result;
|
|
471851
472030
|
}
|
|
471852
|
-
const mcpLogDirs = dirents.filter((dirent) => dirent.isDirectory() && dirent.name.startsWith("mcp-logs-")).map((dirent) =>
|
|
472031
|
+
const mcpLogDirs = dirents.filter((dirent) => dirent.isDirectory() && dirent.name.startsWith("mcp-logs-")).map((dirent) => join170(baseCachePath, dirent.name));
|
|
471853
472032
|
for (const mcpLogDir of mcpLogDirs) {
|
|
471854
472033
|
result = addCleanupResults(result, await cleanupOldFilesInDirectory(mcpLogDir, cutoffDate, true));
|
|
471855
472034
|
await tryRmdir(mcpLogDir, fsImpl);
|
|
@@ -471888,7 +472067,7 @@ async function cleanupOldSessionFiles() {
|
|
|
471888
472067
|
for (const projectDirent of projectDirents) {
|
|
471889
472068
|
if (!projectDirent.isDirectory())
|
|
471890
472069
|
continue;
|
|
471891
|
-
const projectDir =
|
|
472070
|
+
const projectDir = join170(projectsDir, projectDirent.name);
|
|
471892
472071
|
let entries;
|
|
471893
472072
|
try {
|
|
471894
472073
|
entries = await fsImpl.readdir(projectDir);
|
|
@@ -471902,15 +472081,15 @@ async function cleanupOldSessionFiles() {
|
|
|
471902
472081
|
continue;
|
|
471903
472082
|
}
|
|
471904
472083
|
try {
|
|
471905
|
-
if (await unlinkIfOld(
|
|
472084
|
+
if (await unlinkIfOld(join170(projectDir, entry.name), cutoffDate, fsImpl)) {
|
|
471906
472085
|
result.messages++;
|
|
471907
472086
|
}
|
|
471908
472087
|
} catch {
|
|
471909
472088
|
result.errors++;
|
|
471910
472089
|
}
|
|
471911
472090
|
} else if (entry.isDirectory()) {
|
|
471912
|
-
const sessionDir =
|
|
471913
|
-
const toolResultsDir =
|
|
472091
|
+
const sessionDir = join170(projectDir, entry.name);
|
|
472092
|
+
const toolResultsDir = join170(sessionDir, TOOL_RESULTS_SUBDIR);
|
|
471914
472093
|
let toolDirs;
|
|
471915
472094
|
try {
|
|
471916
472095
|
toolDirs = await fsImpl.readdir(toolResultsDir);
|
|
@@ -471921,14 +472100,14 @@ async function cleanupOldSessionFiles() {
|
|
|
471921
472100
|
for (const toolEntry of toolDirs) {
|
|
471922
472101
|
if (toolEntry.isFile()) {
|
|
471923
472102
|
try {
|
|
471924
|
-
if (await unlinkIfOld(
|
|
472103
|
+
if (await unlinkIfOld(join170(toolResultsDir, toolEntry.name), cutoffDate, fsImpl)) {
|
|
471925
472104
|
result.messages++;
|
|
471926
472105
|
}
|
|
471927
472106
|
} catch {
|
|
471928
472107
|
result.errors++;
|
|
471929
472108
|
}
|
|
471930
472109
|
} else if (toolEntry.isDirectory()) {
|
|
471931
|
-
const toolDirPath =
|
|
472110
|
+
const toolDirPath = join170(toolResultsDir, toolEntry.name);
|
|
471932
472111
|
let toolFiles;
|
|
471933
472112
|
try {
|
|
471934
472113
|
toolFiles = await fsImpl.readdir(toolDirPath);
|
|
@@ -471939,7 +472118,7 @@ async function cleanupOldSessionFiles() {
|
|
|
471939
472118
|
if (!tf.isFile())
|
|
471940
472119
|
continue;
|
|
471941
472120
|
try {
|
|
471942
|
-
if (await unlinkIfOld(
|
|
472121
|
+
if (await unlinkIfOld(join170(toolDirPath, tf.name), cutoffDate, fsImpl)) {
|
|
471943
472122
|
result.messages++;
|
|
471944
472123
|
}
|
|
471945
472124
|
} catch {
|
|
@@ -471971,7 +472150,7 @@ async function cleanupSingleDirectory(dirPath, extension, removeEmptyDir = true)
|
|
|
471971
472150
|
if (!dirent.isFile() || !dirent.name.endsWith(extension))
|
|
471972
472151
|
continue;
|
|
471973
472152
|
try {
|
|
471974
|
-
if (await unlinkIfOld(
|
|
472153
|
+
if (await unlinkIfOld(join170(dirPath, dirent.name), cutoffDate, fsImpl)) {
|
|
471975
472154
|
result.messages++;
|
|
471976
472155
|
}
|
|
471977
472156
|
} catch {
|
|
@@ -471984,7 +472163,7 @@ async function cleanupSingleDirectory(dirPath, extension, removeEmptyDir = true)
|
|
|
471984
472163
|
return result;
|
|
471985
472164
|
}
|
|
471986
472165
|
function cleanupOldPlanFiles() {
|
|
471987
|
-
const plansDir =
|
|
472166
|
+
const plansDir = join170(getTheusConfigHomeDir(), "plans");
|
|
471988
472167
|
return cleanupSingleDirectory(plansDir, ".md");
|
|
471989
472168
|
}
|
|
471990
472169
|
async function cleanupOldFileHistoryBackups() {
|
|
@@ -471993,14 +472172,14 @@ async function cleanupOldFileHistoryBackups() {
|
|
|
471993
472172
|
const fsImpl = getFsImplementation();
|
|
471994
472173
|
try {
|
|
471995
472174
|
const configDir = getTheusConfigHomeDir();
|
|
471996
|
-
const fileHistoryStorageDir =
|
|
472175
|
+
const fileHistoryStorageDir = join170(configDir, "file-history");
|
|
471997
472176
|
let dirents;
|
|
471998
472177
|
try {
|
|
471999
472178
|
dirents = await fsImpl.readdir(fileHistoryStorageDir);
|
|
472000
472179
|
} catch {
|
|
472001
472180
|
return result;
|
|
472002
472181
|
}
|
|
472003
|
-
const fileHistorySessionsDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
472182
|
+
const fileHistorySessionsDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join170(fileHistoryStorageDir, dirent.name));
|
|
472004
472183
|
await Promise.all(fileHistorySessionsDirs.map(async (fileHistorySessionDir) => {
|
|
472005
472184
|
try {
|
|
472006
472185
|
const stats2 = await fsImpl.stat(fileHistorySessionDir);
|
|
@@ -472027,14 +472206,14 @@ async function cleanupOldSessionEnvDirs() {
|
|
|
472027
472206
|
const fsImpl = getFsImplementation();
|
|
472028
472207
|
try {
|
|
472029
472208
|
const configDir = getTheusConfigHomeDir();
|
|
472030
|
-
const sessionEnvBaseDir =
|
|
472209
|
+
const sessionEnvBaseDir = join170(configDir, "session-env");
|
|
472031
472210
|
let dirents;
|
|
472032
472211
|
try {
|
|
472033
472212
|
dirents = await fsImpl.readdir(sessionEnvBaseDir);
|
|
472034
472213
|
} catch {
|
|
472035
472214
|
return result;
|
|
472036
472215
|
}
|
|
472037
|
-
const sessionEnvDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
472216
|
+
const sessionEnvDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join170(sessionEnvBaseDir, dirent.name));
|
|
472038
472217
|
for (const sessionEnvDir of sessionEnvDirs) {
|
|
472039
472218
|
try {
|
|
472040
472219
|
const stats2 = await fsImpl.stat(sessionEnvDir);
|
|
@@ -472056,7 +472235,7 @@ async function cleanupOldDebugLogs() {
|
|
|
472056
472235
|
const cutoffDate = getCutoffDate();
|
|
472057
472236
|
const result = { messages: 0, errors: 0 };
|
|
472058
472237
|
const fsImpl = getFsImplementation();
|
|
472059
|
-
const debugDir =
|
|
472238
|
+
const debugDir = join170(getTheusConfigHomeDir(), "debug");
|
|
472060
472239
|
let dirents;
|
|
472061
472240
|
try {
|
|
472062
472241
|
dirents = await fsImpl.readdir(debugDir);
|
|
@@ -472068,7 +472247,7 @@ async function cleanupOldDebugLogs() {
|
|
|
472068
472247
|
continue;
|
|
472069
472248
|
}
|
|
472070
472249
|
try {
|
|
472071
|
-
if (await unlinkIfOld(
|
|
472250
|
+
if (await unlinkIfOld(join170(debugDir, dirent.name), cutoffDate, fsImpl)) {
|
|
472072
472251
|
result.messages++;
|
|
472073
472252
|
}
|
|
472074
472253
|
} catch {
|
|
@@ -475280,7 +475459,7 @@ __export(exports_asciicast, {
|
|
|
475280
475459
|
_resetRecordingStateForTesting: () => _resetRecordingStateForTesting
|
|
475281
475460
|
});
|
|
475282
475461
|
import { appendFile as appendFile8, rename as rename12 } from "fs/promises";
|
|
475283
|
-
import { basename as basename65, dirname as dirname73, join as
|
|
475462
|
+
import { basename as basename65, dirname as dirname73, join as join172 } from "path";
|
|
475284
475463
|
function getRecordFilePath() {
|
|
475285
475464
|
if (recordingState.filePath !== null) {
|
|
475286
475465
|
return recordingState.filePath;
|
|
@@ -475291,10 +475470,10 @@ function getRecordFilePath() {
|
|
|
475291
475470
|
if (!isEnvTruthy(process.env.THEUS_CODE_TERMINAL_RECORDING)) {
|
|
475292
475471
|
return null;
|
|
475293
475472
|
}
|
|
475294
|
-
const projectsDir =
|
|
475295
|
-
const projectDir =
|
|
475473
|
+
const projectsDir = join172(getTheusConfigHomeDir(), "projects");
|
|
475474
|
+
const projectDir = join172(projectsDir, sanitizePath2(getOriginalCwd()));
|
|
475296
475475
|
recordingState.timestamp = Date.now();
|
|
475297
|
-
recordingState.filePath =
|
|
475476
|
+
recordingState.filePath = join172(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
|
|
475298
475477
|
return recordingState.filePath;
|
|
475299
475478
|
}
|
|
475300
475479
|
function _resetRecordingStateForTesting() {
|
|
@@ -475303,13 +475482,13 @@ function _resetRecordingStateForTesting() {
|
|
|
475303
475482
|
}
|
|
475304
475483
|
function getSessionRecordingPaths() {
|
|
475305
475484
|
const sessionId = getSessionId();
|
|
475306
|
-
const projectsDir =
|
|
475307
|
-
const projectDir =
|
|
475485
|
+
const projectsDir = join172(getTheusConfigHomeDir(), "projects");
|
|
475486
|
+
const projectDir = join172(projectsDir, sanitizePath2(getOriginalCwd()));
|
|
475308
475487
|
try {
|
|
475309
475488
|
const entries = getFsImplementation().readdirSync(projectDir);
|
|
475310
475489
|
const names = typeof entries[0] === "string" ? entries : entries.map((e) => e.name);
|
|
475311
475490
|
const files2 = names.filter((f) => f.startsWith(sessionId) && f.endsWith(".cast")).sort();
|
|
475312
|
-
return files2.map((f) =>
|
|
475491
|
+
return files2.map((f) => join172(projectDir, f));
|
|
475313
475492
|
} catch {
|
|
475314
475493
|
return [];
|
|
475315
475494
|
}
|
|
@@ -475319,9 +475498,9 @@ async function renameRecordingForSession() {
|
|
|
475319
475498
|
if (!oldPath || recordingState.timestamp === 0) {
|
|
475320
475499
|
return;
|
|
475321
475500
|
}
|
|
475322
|
-
const projectsDir =
|
|
475323
|
-
const projectDir =
|
|
475324
|
-
const newPath =
|
|
475501
|
+
const projectsDir = join172(getTheusConfigHomeDir(), "projects");
|
|
475502
|
+
const projectDir = join172(projectsDir, sanitizePath2(getOriginalCwd()));
|
|
475503
|
+
const newPath = join172(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
|
|
475325
475504
|
if (oldPath === newPath) {
|
|
475326
475505
|
return;
|
|
475327
475506
|
}
|
|
@@ -476931,7 +477110,7 @@ function useSurveyState({
|
|
|
476931
477110
|
setState("submitted");
|
|
476932
477111
|
setTimeout(setState, hideThanksAfterMs, "closed");
|
|
476933
477112
|
}, [hideThanksAfterMs]);
|
|
476934
|
-
const
|
|
477113
|
+
const open25 = import_react301.useCallback(() => {
|
|
476935
477114
|
if (state2 !== "closed") {
|
|
476936
477115
|
return;
|
|
476937
477116
|
}
|
|
@@ -476982,7 +477161,7 @@ function useSurveyState({
|
|
|
476982
477161
|
return {
|
|
476983
477162
|
state: state2,
|
|
476984
477163
|
lastResponse,
|
|
476985
|
-
open:
|
|
477164
|
+
open: open25,
|
|
476986
477165
|
handleSelect,
|
|
476987
477166
|
handleTranscriptSelect
|
|
476988
477167
|
};
|
|
@@ -477118,7 +477297,7 @@ function useFeedbackSurvey(messages, isLoading, submitCount, surveyType = "sessi
|
|
|
477118
477297
|
const {
|
|
477119
477298
|
state: state2,
|
|
477120
477299
|
lastResponse,
|
|
477121
|
-
open:
|
|
477300
|
+
open: open25,
|
|
477122
477301
|
handleSelect,
|
|
477123
477302
|
handleTranscriptSelect
|
|
477124
477303
|
} = useSurveyState({
|
|
@@ -477199,9 +477378,9 @@ function useFeedbackSurvey(messages, isLoading, submitCount, surveyType = "sessi
|
|
|
477199
477378
|
}, [state2, isLoading, hasActivePrompt, isModelAllowed2, feedbackSurvey.timeLastShown, feedbackSurvey.submitCountAtLastAppearance, submitCount, config3.minTimeBetweenFeedbackMs, config3.minTimeBetweenGlobalFeedbackMs, config3.minUserTurnsBetweenFeedback, config3.minTimeBeforeFeedbackMs, config3.minUserTurnsBeforeFeedback, config3.probability, settingsRate]);
|
|
477200
477379
|
import_react302.useEffect(() => {
|
|
477201
477380
|
if (shouldOpen) {
|
|
477202
|
-
|
|
477381
|
+
open25();
|
|
477203
477382
|
}
|
|
477204
|
-
}, [shouldOpen,
|
|
477383
|
+
}, [shouldOpen, open25]);
|
|
477205
477384
|
return {
|
|
477206
477385
|
state: state2,
|
|
477207
477386
|
lastResponse,
|
|
@@ -477345,7 +477524,7 @@ function useMemorySurvey(messages, isLoading, hasActivePrompt = false, {
|
|
|
477345
477524
|
const {
|
|
477346
477525
|
state: state2,
|
|
477347
477526
|
lastResponse,
|
|
477348
|
-
open:
|
|
477527
|
+
open: open25,
|
|
477349
477528
|
handleSelect,
|
|
477350
477529
|
handleTranscriptSelect
|
|
477351
477530
|
} = useSurveyState({
|
|
@@ -477398,9 +477577,9 @@ function useMemorySurvey(messages, isLoading, hasActivePrompt = false, {
|
|
|
477398
477577
|
return;
|
|
477399
477578
|
}
|
|
477400
477579
|
if (Math.random() < SURVEY_PROBABILITY) {
|
|
477401
|
-
|
|
477580
|
+
open25();
|
|
477402
477581
|
}
|
|
477403
|
-
}, [enabled, state2, isLoading, hasActivePrompt, lastAssistant, messages,
|
|
477582
|
+
}, [enabled, state2, isLoading, hasActivePrompt, lastAssistant, messages, open25]);
|
|
477404
477583
|
return {
|
|
477405
477584
|
state: state2,
|
|
477406
477585
|
lastResponse,
|
|
@@ -477482,7 +477661,7 @@ function usePostCompactSurvey(messages, isLoading, t0, t1) {
|
|
|
477482
477661
|
const {
|
|
477483
477662
|
state: state2,
|
|
477484
477663
|
lastResponse,
|
|
477485
|
-
open:
|
|
477664
|
+
open: open25,
|
|
477486
477665
|
handleSelect
|
|
477487
477666
|
} = useSurveyState(t5);
|
|
477488
477667
|
let t6;
|
|
@@ -477514,7 +477693,7 @@ function usePostCompactSurvey(messages, isLoading, t0, t1) {
|
|
|
477514
477693
|
const currentCompactBoundaries = t8;
|
|
477515
477694
|
let t10;
|
|
477516
477695
|
let t9;
|
|
477517
|
-
if ($2[9] !== currentCompactBoundaries || $2[10] !== enabled || $2[11] !== gateEnabled || $2[12] !== hasActivePrompt || $2[13] !== isLoading || $2[14] !== messages || $2[15] !==
|
|
477696
|
+
if ($2[9] !== currentCompactBoundaries || $2[10] !== enabled || $2[11] !== gateEnabled || $2[12] !== hasActivePrompt || $2[13] !== isLoading || $2[14] !== messages || $2[15] !== open25 || $2[16] !== state2) {
|
|
477518
477697
|
t9 = () => {
|
|
477519
477698
|
if (!enabled) {
|
|
477520
477699
|
return;
|
|
@@ -477538,7 +477717,7 @@ function usePostCompactSurvey(messages, isLoading, t0, t1) {
|
|
|
477538
477717
|
if (hasMessageAfterBoundary(messages, pendingCompactBoundaryUuid.current)) {
|
|
477539
477718
|
pendingCompactBoundaryUuid.current = null;
|
|
477540
477719
|
if (Math.random() < SURVEY_PROBABILITY2) {
|
|
477541
|
-
|
|
477720
|
+
open25();
|
|
477542
477721
|
}
|
|
477543
477722
|
return;
|
|
477544
477723
|
}
|
|
@@ -477549,14 +477728,14 @@ function usePostCompactSurvey(messages, isLoading, t0, t1) {
|
|
|
477549
477728
|
pendingCompactBoundaryUuid.current = newBoundaries[newBoundaries.length - 1];
|
|
477550
477729
|
}
|
|
477551
477730
|
};
|
|
477552
|
-
t10 = [enabled, currentCompactBoundaries, state2, isLoading, hasActivePrompt, gateEnabled, messages,
|
|
477731
|
+
t10 = [enabled, currentCompactBoundaries, state2, isLoading, hasActivePrompt, gateEnabled, messages, open25];
|
|
477553
477732
|
$2[9] = currentCompactBoundaries;
|
|
477554
477733
|
$2[10] = enabled;
|
|
477555
477734
|
$2[11] = gateEnabled;
|
|
477556
477735
|
$2[12] = hasActivePrompt;
|
|
477557
477736
|
$2[13] = isLoading;
|
|
477558
477737
|
$2[14] = messages;
|
|
477559
|
-
$2[15] =
|
|
477738
|
+
$2[15] = open25;
|
|
477560
477739
|
$2[16] = state2;
|
|
477561
477740
|
$2[17] = t10;
|
|
477562
477741
|
$2[18] = t9;
|
|
@@ -478083,8 +478262,8 @@ var init_useAwaySummary = __esm(() => {
|
|
|
478083
478262
|
});
|
|
478084
478263
|
|
|
478085
478264
|
// utils/theusInChrome/setupPortable.ts
|
|
478086
|
-
import { readdir as
|
|
478087
|
-
import { join as
|
|
478265
|
+
import { readdir as readdir37 } from "fs/promises";
|
|
478266
|
+
import { join as join173 } from "path";
|
|
478088
478267
|
function getExtensionIds() {
|
|
478089
478268
|
return [THEUS_BROWSER_EXTENSION_ID];
|
|
478090
478269
|
}
|
|
@@ -478097,7 +478276,7 @@ async function detectExtensionInstallationPortable(browserPaths, log2) {
|
|
|
478097
478276
|
for (const { browser, path: browserBasePath } of browserPaths) {
|
|
478098
478277
|
let browserProfileEntries = [];
|
|
478099
478278
|
try {
|
|
478100
|
-
browserProfileEntries = await
|
|
478279
|
+
browserProfileEntries = await readdir37(browserBasePath, {
|
|
478101
478280
|
withFileTypes: true
|
|
478102
478281
|
});
|
|
478103
478282
|
} catch (e) {
|
|
@@ -478111,9 +478290,9 @@ async function detectExtensionInstallationPortable(browserPaths, log2) {
|
|
|
478111
478290
|
}
|
|
478112
478291
|
for (const profile of profileDirs) {
|
|
478113
478292
|
for (const extensionId of extensionIds) {
|
|
478114
|
-
const extensionPath =
|
|
478293
|
+
const extensionPath = join173(browserBasePath, profile, "Extensions", extensionId);
|
|
478115
478294
|
try {
|
|
478116
|
-
await
|
|
478295
|
+
await readdir37(extensionPath);
|
|
478117
478296
|
log2?.(`[Theus in Chrome] Extension ${extensionId} found in ${browser} ${profile}`);
|
|
478118
478297
|
return { isInstalled: true, browser };
|
|
478119
478298
|
} catch {}
|
|
@@ -478133,9 +478312,9 @@ var init_setupPortable = __esm(() => {
|
|
|
478133
478312
|
});
|
|
478134
478313
|
|
|
478135
478314
|
// utils/theusInChrome/setup.ts
|
|
478136
|
-
import { chmod as chmod15, mkdir as mkdir55, readFile as
|
|
478315
|
+
import { chmod as chmod15, mkdir as mkdir55, readFile as readFile65, writeFile as writeFile54 } from "fs/promises";
|
|
478137
478316
|
import { homedir as homedir50 } from "os";
|
|
478138
|
-
import { join as
|
|
478317
|
+
import { join as join174 } from "path";
|
|
478139
478318
|
import { fileURLToPath as fileURLToPath8 } from "url";
|
|
478140
478319
|
function isTheusInChromeEngineAvailable() {
|
|
478141
478320
|
return Array.isArray(BROWSER_TOOLS);
|
|
@@ -478199,8 +478378,8 @@ function setupTheusInChrome() {
|
|
|
478199
478378
|
};
|
|
478200
478379
|
} else {
|
|
478201
478380
|
const __filename3 = fileURLToPath8(import.meta.url);
|
|
478202
|
-
const __dirname3 =
|
|
478203
|
-
const cliPath =
|
|
478381
|
+
const __dirname3 = join174(__filename3, "..");
|
|
478382
|
+
const cliPath = join174(__dirname3, "cli.js");
|
|
478204
478383
|
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" }));
|
|
478205
478384
|
const mcpConfig = {
|
|
478206
478385
|
[THEUS_IN_CHROME_MCP_SERVER_NAME]: {
|
|
@@ -478222,8 +478401,8 @@ function getNativeMessagingHostsDirs() {
|
|
|
478222
478401
|
const platform7 = getPlatform();
|
|
478223
478402
|
if (platform7 === "windows") {
|
|
478224
478403
|
const home = homedir50();
|
|
478225
|
-
const appData = process.env.APPDATA ||
|
|
478226
|
-
return [
|
|
478404
|
+
const appData = process.env.APPDATA || join174(home, "AppData", "Local");
|
|
478405
|
+
return [join174(appData, "Theus", "ChromeNativeHost")];
|
|
478227
478406
|
}
|
|
478228
478407
|
return getAllNativeMessagingHostsDirs().map(({ path: path21 }) => path21);
|
|
478229
478408
|
}
|
|
@@ -478242,8 +478421,8 @@ async function installChromeNativeHostManifest(manifestBinaryPath) {
|
|
|
478242
478421
|
const manifestContent = jsonStringify(manifest, null, 2);
|
|
478243
478422
|
let anyManifestUpdated = false;
|
|
478244
478423
|
for (const manifestDir of manifestDirs) {
|
|
478245
|
-
const manifestPath =
|
|
478246
|
-
const existingContent = await
|
|
478424
|
+
const manifestPath = join174(manifestDir, NATIVE_HOST_MANIFEST_NAME);
|
|
478425
|
+
const existingContent = await readFile65(manifestPath, "utf-8").catch(() => null);
|
|
478247
478426
|
if (existingContent === manifestContent) {
|
|
478248
478427
|
continue;
|
|
478249
478428
|
}
|
|
@@ -478257,7 +478436,7 @@ async function installChromeNativeHostManifest(manifestBinaryPath) {
|
|
|
478257
478436
|
}
|
|
478258
478437
|
}
|
|
478259
478438
|
if (getPlatform() === "windows") {
|
|
478260
|
-
const manifestPath =
|
|
478439
|
+
const manifestPath = join174(manifestDirs[0], NATIVE_HOST_MANIFEST_NAME);
|
|
478261
478440
|
registerWindowsNativeHosts(manifestPath);
|
|
478262
478441
|
}
|
|
478263
478442
|
if (anyManifestUpdated) {
|
|
@@ -478295,8 +478474,8 @@ function registerWindowsNativeHosts(manifestPath) {
|
|
|
478295
478474
|
}
|
|
478296
478475
|
async function createWrapperScript(command9) {
|
|
478297
478476
|
const platform7 = getPlatform();
|
|
478298
|
-
const chromeDir =
|
|
478299
|
-
const wrapperPath = platform7 === "windows" ?
|
|
478477
|
+
const chromeDir = join174(getTheusConfigHomeDir(), "chrome");
|
|
478478
|
+
const wrapperPath = platform7 === "windows" ? join174(chromeDir, "chrome-native-host.bat") : join174(chromeDir, "chrome-native-host");
|
|
478300
478479
|
const scriptContent = platform7 === "windows" ? `@echo off
|
|
478301
478480
|
REM Chrome native host wrapper script
|
|
478302
478481
|
REM Generated by Theus - do not edit manually
|
|
@@ -478306,7 +478485,7 @@ ${command9}
|
|
|
478306
478485
|
# Generated by Theus - do not edit manually
|
|
478307
478486
|
exec ${command9}
|
|
478308
478487
|
`;
|
|
478309
|
-
const existingContent = await
|
|
478488
|
+
const existingContent = await readFile65(wrapperPath, "utf-8").catch(() => null);
|
|
478310
478489
|
if (existingContent === scriptContent) {
|
|
478311
478490
|
return wrapperPath;
|
|
478312
478491
|
}
|
|
@@ -478425,7 +478604,7 @@ var init_useChromeExtensionNotification = __esm(() => {
|
|
|
478425
478604
|
});
|
|
478426
478605
|
|
|
478427
478606
|
// utils/plugins/officialMarketplaceStartupCheck.ts
|
|
478428
|
-
import { join as
|
|
478607
|
+
import { join as join175 } from "path";
|
|
478429
478608
|
function isOfficialMarketplaceAutoInstallDisabled() {
|
|
478430
478609
|
if (isEnvTruthy(process.env.THEUS_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL)) {
|
|
478431
478610
|
return true;
|
|
@@ -478503,7 +478682,7 @@ async function checkAndInstallOfficialMarketplace() {
|
|
|
478503
478682
|
return { installed: false, skipped: true, reason: "policy_blocked" };
|
|
478504
478683
|
}
|
|
478505
478684
|
const cacheDir = getMarketplacesCacheDir();
|
|
478506
|
-
const installLocation =
|
|
478685
|
+
const installLocation = join175(cacheDir, OFFICIAL_MARKETPLACE_NAME);
|
|
478507
478686
|
const gcsSha = await fetchOfficialMarketplaceFromGcs(installLocation, cacheDir);
|
|
478508
478687
|
if (gcsSha !== null) {
|
|
478509
478688
|
const known = await loadKnownMarketplacesConfig();
|
|
@@ -481287,7 +481466,7 @@ var init_usePluginRecommendationBase = __esm(() => {
|
|
|
481287
481466
|
});
|
|
481288
481467
|
|
|
481289
481468
|
// hooks/useLspPluginRecommendation.tsx
|
|
481290
|
-
import { extname as extname20, join as
|
|
481469
|
+
import { extname as extname20, join as join176 } from "path";
|
|
481291
481470
|
function useLspPluginRecommendation() {
|
|
481292
481471
|
const $2 = c3(12);
|
|
481293
481472
|
const trackedFiles = useAppState(_temp202);
|
|
@@ -481372,7 +481551,7 @@ function useLspPluginRecommendation() {
|
|
|
481372
481551
|
case "yes": {
|
|
481373
481552
|
installPluginAndNotify(pluginId, pluginName, "lsp-plugin", addNotification, async (pluginData) => {
|
|
481374
481553
|
logForDebugging(`[useLspPluginRecommendation] Installing plugin: ${pluginId}`);
|
|
481375
|
-
const localSourcePath = typeof pluginData.entry.source === "string" ?
|
|
481554
|
+
const localSourcePath = typeof pluginData.entry.source === "string" ? join176(pluginData.marketplaceInstallLocation, pluginData.entry.source) : undefined;
|
|
481376
481555
|
await cacheAndRegisterPlugin(pluginId, pluginData.entry, "user", undefined, localSourcePath);
|
|
481377
481556
|
const settings = getSettingsForSource("userSettings");
|
|
481378
481557
|
updateSettingsForSource("userSettings", {
|
|
@@ -484576,7 +484755,7 @@ var exports_REPL = {};
|
|
|
484576
484755
|
__export(exports_REPL, {
|
|
484577
484756
|
REPL: () => REPL
|
|
484578
484757
|
});
|
|
484579
|
-
import { dirname as dirname75, join as
|
|
484758
|
+
import { dirname as dirname75, join as join177 } from "path";
|
|
484580
484759
|
import { tmpdir as tmpdir16 } from "os";
|
|
484581
484760
|
import { writeFile as writeFile55 } from "fs/promises";
|
|
484582
484761
|
import { randomUUID as randomUUID61 } from "crypto";
|
|
@@ -487210,7 +487389,7 @@ Note: ctrl + z now suspends Theus, ctrl + _ undoes input.
|
|
|
487210
487389
|
const w = Math.max(80, (process.stdout.columns ?? 80) - 6);
|
|
487211
487390
|
const raw = await renderMessagesToPlainText(deferredMessages, tools, w);
|
|
487212
487391
|
const text2 = raw.replace(/[ \t]+$/gm, "");
|
|
487213
|
-
const path21 =
|
|
487392
|
+
const path21 = join177(tmpdir16(), `cc-transcript-${Date.now()}.txt`);
|
|
487214
487393
|
await writeFile55(path21, text2);
|
|
487215
487394
|
const opened = openFileInExternalEditor(path21);
|
|
487216
487395
|
setStatus(opened ? `opening ${path21}` : `wrote ${path21} \xB7 no $VISUAL/$EDITOR set`);
|
|
@@ -489974,7 +490153,7 @@ function completeOnboarding() {
|
|
|
489974
490153
|
saveGlobalConfig((current) => ({
|
|
489975
490154
|
...current,
|
|
489976
490155
|
hasCompletedOnboarding: true,
|
|
489977
|
-
lastOnboardingVersion: { VERSION: "0.2.
|
|
490156
|
+
lastOnboardingVersion: { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
489978
490157
|
}));
|
|
489979
490158
|
}
|
|
489980
490159
|
function showDialog(root2, renderer) {
|
|
@@ -490205,15 +490384,15 @@ var init_interactiveHelpers = __esm(() => {
|
|
|
490205
490384
|
|
|
490206
490385
|
// components/Theus/arsenalStats.ts
|
|
490207
490386
|
import { existsSync as existsSync30, readdirSync as readdirSync6 } from "fs";
|
|
490208
|
-
import { dirname as dirname76, join as
|
|
490387
|
+
import { dirname as dirname76, join as join178 } from "path";
|
|
490209
490388
|
import { fileURLToPath as fileURLToPath9 } from "url";
|
|
490210
490389
|
function countBundledArsenalSkills() {
|
|
490211
490390
|
try {
|
|
490212
490391
|
const here = dirname76(fileURLToPath9(import.meta.url));
|
|
490213
490392
|
for (const dir of [
|
|
490214
|
-
|
|
490215
|
-
|
|
490216
|
-
|
|
490393
|
+
join178(here, "..", "..", "vendor", "theus-arsenal", "skills"),
|
|
490394
|
+
join178(here, "vendor", "theus-arsenal", "skills"),
|
|
490395
|
+
join178(here, "..", "vendor", "theus-arsenal", "skills")
|
|
490217
490396
|
]) {
|
|
490218
490397
|
if (!existsSync30(dir))
|
|
490219
490398
|
continue;
|
|
@@ -490296,12 +490475,12 @@ var init_arsenalStats = __esm(() => {
|
|
|
490296
490475
|
|
|
490297
490476
|
// services/import/detect/global.ts
|
|
490298
490477
|
import { existsSync as existsSync31 } from "fs";
|
|
490299
|
-
import { open as
|
|
490300
|
-
import { join as
|
|
490478
|
+
import { open as open25, readdir as readdir38, stat as stat56 } from "fs/promises";
|
|
490479
|
+
import { join as join179 } from "path";
|
|
490301
490480
|
async function rutaDelTranscript(fichero) {
|
|
490302
490481
|
let crudo;
|
|
490303
490482
|
try {
|
|
490304
|
-
const fh = await
|
|
490483
|
+
const fh = await open25(fichero, "r");
|
|
490305
490484
|
try {
|
|
490306
490485
|
const buf = Buffer.alloc(65536);
|
|
490307
490486
|
const { bytesRead } = await fh.read(buf, 0, buf.length, 0);
|
|
@@ -490328,19 +490507,19 @@ async function rutaDelTranscript(fichero) {
|
|
|
490328
490507
|
return null;
|
|
490329
490508
|
}
|
|
490330
490509
|
async function explorarTodoElTrabajo(entorno) {
|
|
490331
|
-
const raiz =
|
|
490510
|
+
const raiz = join179(directorioConfig(entorno), "projects");
|
|
490332
490511
|
let directorios;
|
|
490333
490512
|
try {
|
|
490334
|
-
directorios = await
|
|
490513
|
+
directorios = await readdir38(raiz);
|
|
490335
490514
|
} catch {
|
|
490336
490515
|
return [];
|
|
490337
490516
|
}
|
|
490338
490517
|
const salida = [];
|
|
490339
490518
|
for (const dir of directorios) {
|
|
490340
|
-
const ruta =
|
|
490519
|
+
const ruta = join179(raiz, dir);
|
|
490341
490520
|
let sesiones;
|
|
490342
490521
|
try {
|
|
490343
|
-
sesiones = (await
|
|
490522
|
+
sesiones = (await readdir38(ruta)).filter((n3) => n3.endsWith(".jsonl"));
|
|
490344
490523
|
} catch {
|
|
490345
490524
|
continue;
|
|
490346
490525
|
}
|
|
@@ -490351,7 +490530,7 @@ async function explorarTodoElTrabajo(entorno) {
|
|
|
490351
490530
|
let ficheroMasReciente = sesiones[0];
|
|
490352
490531
|
for (const nombre of sesiones) {
|
|
490353
490532
|
try {
|
|
490354
|
-
const info = await
|
|
490533
|
+
const info = await stat56(join179(ruta, nombre));
|
|
490355
490534
|
bytes += info.size;
|
|
490356
490535
|
if (info.mtimeMs > masReciente) {
|
|
490357
490536
|
masReciente = info.mtimeMs;
|
|
@@ -490359,7 +490538,7 @@ async function explorarTodoElTrabajo(entorno) {
|
|
|
490359
490538
|
}
|
|
490360
490539
|
} catch {}
|
|
490361
490540
|
}
|
|
490362
|
-
const proyecto = await rutaDelTranscript(
|
|
490541
|
+
const proyecto = await rutaDelTranscript(join179(ruta, ficheroMasReciente));
|
|
490363
490542
|
if (!proyecto)
|
|
490364
490543
|
continue;
|
|
490365
490544
|
salida.push({
|
|
@@ -490463,7 +490642,7 @@ __export(exports_OnboardingWizard, {
|
|
|
490463
490642
|
OnboardingWizard: () => OnboardingWizard
|
|
490464
490643
|
});
|
|
490465
490644
|
import { existsSync as existsSync32, mkdirSync as mkdirSync15, writeFileSync as writeFileSync14 } from "fs";
|
|
490466
|
-
import { join as
|
|
490645
|
+
import { join as join180 } from "path";
|
|
490467
490646
|
function hasSeenOnboardingWizard() {
|
|
490468
490647
|
if (isEnvTruthy(process.env.THEUS_FORCE_ONBOARDING_WIZARD))
|
|
490469
490648
|
return false;
|
|
@@ -490471,7 +490650,7 @@ function hasSeenOnboardingWizard() {
|
|
|
490471
490650
|
return true;
|
|
490472
490651
|
}
|
|
490473
490652
|
try {
|
|
490474
|
-
return existsSync32(
|
|
490653
|
+
return existsSync32(join180(getTheusConfigHome(), WIZARD_MARKER));
|
|
490475
490654
|
} catch {
|
|
490476
490655
|
return true;
|
|
490477
490656
|
}
|
|
@@ -490480,7 +490659,7 @@ function markOnboardingWizardSeen() {
|
|
|
490480
490659
|
try {
|
|
490481
490660
|
const home = getTheusConfigHome();
|
|
490482
490661
|
mkdirSync15(home, { recursive: true });
|
|
490483
|
-
writeFileSync14(
|
|
490662
|
+
writeFileSync14(join180(home, WIZARD_MARKER), `${JSON.stringify({
|
|
490484
490663
|
seenAt: new Date().toISOString(),
|
|
490485
490664
|
version: globalThis.MACRO?.VERSION ?? null
|
|
490486
490665
|
})}
|
|
@@ -491846,7 +492025,7 @@ var init_TheusMissionLaunch = __esm(() => {
|
|
|
491846
492025
|
});
|
|
491847
492026
|
|
|
491848
492027
|
// replLauncher.tsx
|
|
491849
|
-
import { readFile as
|
|
492028
|
+
import { readFile as readFile66 } from "fs/promises";
|
|
491850
492029
|
function shouldShowStartMenu(replProps) {
|
|
491851
492030
|
return !!process.stdin.isTTY && !!process.stdout.isTTY && process.env.THEUS_START_MENU !== "0" && process.env.THEUS_NO_START_MENU !== "1" && !replProps.disabled && !(replProps.initialMessages && replProps.initialMessages.length > 0) && !replProps.taskListId && !replProps.remoteSessionConfig && !replProps.directConnectConfig;
|
|
491852
492031
|
}
|
|
@@ -491878,7 +492057,7 @@ function withTimeout2(promise3, ms, fallback) {
|
|
|
491878
492057
|
async function readMemoryFacts() {
|
|
491879
492058
|
try {
|
|
491880
492059
|
const { getGraphPath: getGraphPath2 } = await Promise.resolve().then(() => (init_paths2(), exports_paths));
|
|
491881
|
-
const raw = await
|
|
492060
|
+
const raw = await readFile66(getGraphPath2(getCwd()), "utf8");
|
|
491882
492061
|
const data = JSON.parse(raw);
|
|
491883
492062
|
const nodes = Array.isArray(data.nodes) ? data.nodes : [];
|
|
491884
492063
|
let facts = 0;
|
|
@@ -493960,7 +494139,7 @@ var init_theusInChrome = __esm(() => {
|
|
|
493960
494139
|
});
|
|
493961
494140
|
|
|
493962
494141
|
// skills/bundled/debug.ts
|
|
493963
|
-
import { open as
|
|
494142
|
+
import { open as open26, stat as stat57 } from "fs/promises";
|
|
493964
494143
|
function registerDebugSkill() {
|
|
493965
494144
|
registerBundledSkill({
|
|
493966
494145
|
name: "debug",
|
|
@@ -493974,10 +494153,10 @@ function registerDebugSkill() {
|
|
|
493974
494153
|
const debugLogPath = getDebugLogPath();
|
|
493975
494154
|
let logInfo;
|
|
493976
494155
|
try {
|
|
493977
|
-
const stats2 = await
|
|
494156
|
+
const stats2 = await stat57(debugLogPath);
|
|
493978
494157
|
const readSize = Math.min(stats2.size, TAIL_READ_BYTES);
|
|
493979
494158
|
const startOffset = stats2.size - readSize;
|
|
493980
|
-
const fd2 = await
|
|
494159
|
+
const fd2 = await open26(debugLogPath, "r");
|
|
493981
494160
|
try {
|
|
493982
494161
|
const { buffer, bytesRead } = await fd2.read({
|
|
493983
494162
|
buffer: Buffer.alloc(readSize),
|
|
@@ -496560,10 +496739,10 @@ var init_createDirectConnectSession = __esm(() => {
|
|
|
496560
496739
|
});
|
|
496561
496740
|
|
|
496562
496741
|
// utils/releaseNotes.ts
|
|
496563
|
-
import { mkdir as mkdir56, readFile as
|
|
496564
|
-
import { dirname as dirname78, join as
|
|
496742
|
+
import { mkdir as mkdir56, readFile as readFile67, writeFile as writeFile56 } from "fs/promises";
|
|
496743
|
+
import { dirname as dirname78, join as join181 } from "path";
|
|
496565
496744
|
function getChangelogCachePath() {
|
|
496566
|
-
return
|
|
496745
|
+
return join181(getTheusConfigHomeDir(), "cache", "changelog.md");
|
|
496567
496746
|
}
|
|
496568
496747
|
async function migrateChangelogFromConfig() {
|
|
496569
496748
|
const config3 = getGlobalConfig();
|
|
@@ -496610,7 +496789,7 @@ async function getStoredChangelog() {
|
|
|
496610
496789
|
}
|
|
496611
496790
|
const cachePath2 = getChangelogCachePath();
|
|
496612
496791
|
try {
|
|
496613
|
-
const content = await
|
|
496792
|
+
const content = await readFile67(cachePath2, "utf-8");
|
|
496614
496793
|
changelogMemoryCache = content;
|
|
496615
496794
|
return content;
|
|
496616
496795
|
} catch {
|
|
@@ -496663,7 +496842,7 @@ function getRecentReleaseNotes(currentVersion, previousVersion, changelogContent
|
|
|
496663
496842
|
}
|
|
496664
496843
|
return [];
|
|
496665
496844
|
}
|
|
496666
|
-
async function checkForReleaseNotes(lastSeenVersion, currentVersion = { VERSION: "0.2.
|
|
496845
|
+
async function checkForReleaseNotes(lastSeenVersion, currentVersion = { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION) {
|
|
496667
496846
|
if (false) {}
|
|
496668
496847
|
const cachedChangelog = await getStoredChangelog();
|
|
496669
496848
|
if (lastSeenVersion !== currentVersion || !cachedChangelog) {
|
|
@@ -496761,7 +496940,7 @@ __export(exports_setup2, {
|
|
|
496761
496940
|
setupComputerUse: () => setupComputerUse,
|
|
496762
496941
|
COMPUTER_USE_SYSTEM_HINT: () => COMPUTER_USE_SYSTEM_HINT
|
|
496763
496942
|
});
|
|
496764
|
-
import { dirname as dirname79, join as
|
|
496943
|
+
import { dirname as dirname79, join as join182 } from "path";
|
|
496765
496944
|
import { fileURLToPath as fileURLToPath10 } from "url";
|
|
496766
496945
|
function setupComputerUse() {
|
|
496767
496946
|
const allowedTools = COMPUTER_USE_TOOL_NAMES.map((name) => buildMcpToolName(COMPUTER_USE_SERVER_NAME, name));
|
|
@@ -496788,11 +496967,11 @@ function resolveComputerUseLauncher() {
|
|
|
496788
496967
|
return { command: process.execPath, args: [entry, COMPUTER_USE_FLAG] };
|
|
496789
496968
|
}
|
|
496790
496969
|
if (entry) {
|
|
496791
|
-
const launcher =
|
|
496970
|
+
const launcher = join182(dirname79(entry), "..", "bin", "theus");
|
|
496792
496971
|
return { command: launcher, args: [COMPUTER_USE_FLAG] };
|
|
496793
496972
|
}
|
|
496794
496973
|
return {
|
|
496795
|
-
command:
|
|
496974
|
+
command: join182(fileURLToPath10(import.meta.url), "..", "..", "..", "bin", "theus"),
|
|
496796
496975
|
args: [COMPUTER_USE_FLAG]
|
|
496797
496976
|
};
|
|
496798
496977
|
}
|
|
@@ -496810,7 +496989,7 @@ __export(exports_arsenalBundled, {
|
|
|
496810
496989
|
ensureBundledArsenalInstalled: () => ensureBundledArsenalInstalled
|
|
496811
496990
|
});
|
|
496812
496991
|
import { existsSync as existsSync33, readFileSync as readFileSync33 } from "fs";
|
|
496813
|
-
import { dirname as dirname80, join as
|
|
496992
|
+
import { dirname as dirname80, join as join183 } from "path";
|
|
496814
496993
|
import { fileURLToPath as fileURLToPath11 } from "url";
|
|
496815
496994
|
function isArsenalAutoInstallEnabled() {
|
|
496816
496995
|
return process.env.THEUS_NO_ARSENAL !== "1";
|
|
@@ -496818,10 +496997,10 @@ function isArsenalAutoInstallEnabled() {
|
|
|
496818
496997
|
function findBundledArsenalDir() {
|
|
496819
496998
|
const here = dirname80(fileURLToPath11(import.meta.url));
|
|
496820
496999
|
for (const candidate of [
|
|
496821
|
-
|
|
496822
|
-
|
|
497000
|
+
join183(here, "vendor", "theus-arsenal"),
|
|
497001
|
+
join183(here, "..", "vendor", "theus-arsenal")
|
|
496823
497002
|
]) {
|
|
496824
|
-
if (existsSync33(
|
|
497003
|
+
if (existsSync33(join183(candidate, ".theus-plugin", "plugin.json"))) {
|
|
496825
497004
|
return candidate;
|
|
496826
497005
|
}
|
|
496827
497006
|
}
|
|
@@ -496829,7 +497008,7 @@ function findBundledArsenalDir() {
|
|
|
496829
497008
|
}
|
|
496830
497009
|
function readBundledVersion(bundledDir) {
|
|
496831
497010
|
try {
|
|
496832
|
-
const manifest = JSON.parse(readFileSync33(
|
|
497011
|
+
const manifest = JSON.parse(readFileSync33(join183(bundledDir, ".theus-plugin", "plugin.json"), "utf8"));
|
|
496833
497012
|
return typeof manifest.version === "string" ? manifest.version : null;
|
|
496834
497013
|
} catch {
|
|
496835
497014
|
return null;
|
|
@@ -497067,9 +497246,9 @@ var init_sessionMemory = __esm(() => {
|
|
|
497067
497246
|
});
|
|
497068
497247
|
|
|
497069
497248
|
// utils/iTermBackup.ts
|
|
497070
|
-
import { copyFile as copyFile10, stat as
|
|
497249
|
+
import { copyFile as copyFile10, stat as stat58 } from "fs/promises";
|
|
497071
497250
|
import { homedir as homedir52 } from "os";
|
|
497072
|
-
import { join as
|
|
497251
|
+
import { join as join184 } from "path";
|
|
497073
497252
|
function markITerm2SetupComplete() {
|
|
497074
497253
|
saveGlobalConfig((current) => ({
|
|
497075
497254
|
...current,
|
|
@@ -497084,7 +497263,7 @@ function getIterm2RecoveryInfo() {
|
|
|
497084
497263
|
};
|
|
497085
497264
|
}
|
|
497086
497265
|
function getITerm2PlistPath() {
|
|
497087
|
-
return
|
|
497266
|
+
return join184(homedir52(), "Library", "Preferences", "com.googlecode.iterm2.plist");
|
|
497088
497267
|
}
|
|
497089
497268
|
async function checkAndRestoreITerm2Backup() {
|
|
497090
497269
|
const { inProgress, backupPath } = getIterm2RecoveryInfo();
|
|
@@ -497096,7 +497275,7 @@ async function checkAndRestoreITerm2Backup() {
|
|
|
497096
497275
|
return { status: "no_backup" };
|
|
497097
497276
|
}
|
|
497098
497277
|
try {
|
|
497099
|
-
await
|
|
497278
|
+
await stat58(backupPath);
|
|
497100
497279
|
} catch {
|
|
497101
497280
|
markITerm2SetupComplete();
|
|
497102
497281
|
return { status: "no_backup" };
|
|
@@ -498591,11 +498770,11 @@ var init_sessionUrl = __esm(() => {
|
|
|
498591
498770
|
});
|
|
498592
498771
|
|
|
498593
498772
|
// utils/plugins/zipCacheAdapters.ts
|
|
498594
|
-
import { readFile as
|
|
498595
|
-
import { join as
|
|
498773
|
+
import { readFile as readFile68 } from "fs/promises";
|
|
498774
|
+
import { join as join185 } from "path";
|
|
498596
498775
|
async function readZipCacheKnownMarketplaces() {
|
|
498597
498776
|
try {
|
|
498598
|
-
const content = await
|
|
498777
|
+
const content = await readFile68(getZipCacheKnownMarketplacesPath(), "utf-8");
|
|
498599
498778
|
const parsed = KnownMarketplacesFileSchema().safeParse(jsonParse(content));
|
|
498600
498779
|
if (!parsed.success) {
|
|
498601
498780
|
logForDebugging(`Invalid known_marketplaces.json in zip cache: ${parsed.error.message}`, { level: "error" });
|
|
@@ -498617,18 +498796,18 @@ async function saveMarketplaceJsonToZipCache(marketplaceName, installLocation) {
|
|
|
498617
498796
|
const content = await readMarketplaceJsonContent(installLocation);
|
|
498618
498797
|
if (content !== null) {
|
|
498619
498798
|
const relPath = getMarketplaceJsonRelativePath(marketplaceName);
|
|
498620
|
-
await atomicWriteToZipCache(
|
|
498799
|
+
await atomicWriteToZipCache(join185(zipCachePath, relPath), content);
|
|
498621
498800
|
}
|
|
498622
498801
|
}
|
|
498623
498802
|
async function readMarketplaceJsonContent(dir) {
|
|
498624
498803
|
const candidates = [
|
|
498625
|
-
|
|
498626
|
-
|
|
498804
|
+
join185(dir, ".theus-plugin", "marketplace.json"),
|
|
498805
|
+
join185(dir, "marketplace.json"),
|
|
498627
498806
|
dir
|
|
498628
498807
|
];
|
|
498629
498808
|
for (const candidate of candidates) {
|
|
498630
498809
|
try {
|
|
498631
|
-
return await
|
|
498810
|
+
return await readFile68(candidate, "utf-8");
|
|
498632
498811
|
} catch {}
|
|
498633
498812
|
}
|
|
498634
498813
|
return null;
|
|
@@ -498758,7 +498937,7 @@ __export(exports_print, {
|
|
|
498758
498937
|
createCanUseToolWithPermissionPrompt: () => createCanUseToolWithPermissionPrompt,
|
|
498759
498938
|
canBatchWith: () => canBatchWith
|
|
498760
498939
|
});
|
|
498761
|
-
import { readFile as
|
|
498940
|
+
import { readFile as readFile69, stat as stat59 } from "fs/promises";
|
|
498762
498941
|
import { dirname as dirname81 } from "path";
|
|
498763
498942
|
import { cwd as cwd2 } from "process";
|
|
498764
498943
|
import { randomUUID as randomUUID64 } from "crypto";
|
|
@@ -500147,9 +500326,9 @@ ${m.text}
|
|
|
500147
500326
|
} else if (request.subtype === "seed_read_state") {
|
|
500148
500327
|
try {
|
|
500149
500328
|
const normalizedPath = expandPath(request.path);
|
|
500150
|
-
const diskMtime = Math.floor((await
|
|
500329
|
+
const diskMtime = Math.floor((await stat59(normalizedPath)).mtimeMs);
|
|
500151
500330
|
if (diskMtime <= request.mtime) {
|
|
500152
|
-
const raw = await
|
|
500331
|
+
const raw = await readFile69(normalizedPath, "utf-8");
|
|
500153
500332
|
const content = (raw.charCodeAt(0) === 65279 ? raw.slice(1) : raw).replaceAll(`\r
|
|
500154
500333
|
`, `
|
|
500155
500334
|
`);
|
|
@@ -502196,7 +502375,7 @@ async function startMCPServer(cwd3, debug3, verbose) {
|
|
|
502196
502375
|
setCwd(cwd3);
|
|
502197
502376
|
const server2 = new Server({
|
|
502198
502377
|
name: "theus/tengu",
|
|
502199
|
-
version: { VERSION: "0.2.
|
|
502378
|
+
version: { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
502200
502379
|
}, {
|
|
502201
502380
|
capabilities: {
|
|
502202
502381
|
tools: {}
|
|
@@ -502326,37 +502505,37 @@ __export(exports_theusDesktop, {
|
|
|
502326
502505
|
readTheusDesktopMcpServers: () => readTheusDesktopMcpServers,
|
|
502327
502506
|
getTheusDesktopConfigPath: () => getTheusDesktopConfigPath
|
|
502328
502507
|
});
|
|
502329
|
-
import { readdir as
|
|
502508
|
+
import { readdir as readdir39, readFile as readFile70, stat as stat60 } from "fs/promises";
|
|
502330
502509
|
import { homedir as homedir53 } from "os";
|
|
502331
|
-
import { join as
|
|
502510
|
+
import { join as join186 } from "path";
|
|
502332
502511
|
async function getTheusDesktopConfigPath() {
|
|
502333
502512
|
const platform7 = getPlatform();
|
|
502334
502513
|
if (!SUPPORTED_PLATFORMS.includes(platform7)) {
|
|
502335
502514
|
throw new Error(`Unsupported platform: ${platform7} - Theus Desktop integration only works on macOS and WSL.`);
|
|
502336
502515
|
}
|
|
502337
502516
|
if (platform7 === "macos") {
|
|
502338
|
-
return
|
|
502517
|
+
return join186(homedir53(), "Library", "Application Support", "Theus", "theus_desktop_config.json");
|
|
502339
502518
|
}
|
|
502340
502519
|
const windowsHome = process.env.USERPROFILE ? process.env.USERPROFILE.replace(/\\/g, "/") : null;
|
|
502341
502520
|
if (windowsHome) {
|
|
502342
502521
|
const wslPath = windowsHome.replace(/^[A-Z]:/, "");
|
|
502343
502522
|
const configPath2 = `/mnt/c${wslPath}/AppData/Roaming/Theus/theus_desktop_config.json`;
|
|
502344
502523
|
try {
|
|
502345
|
-
await
|
|
502524
|
+
await stat60(configPath2);
|
|
502346
502525
|
return configPath2;
|
|
502347
502526
|
} catch {}
|
|
502348
502527
|
}
|
|
502349
502528
|
try {
|
|
502350
502529
|
const usersDir = "/mnt/c/Users";
|
|
502351
502530
|
try {
|
|
502352
|
-
const userDirs = await
|
|
502531
|
+
const userDirs = await readdir39(usersDir, { withFileTypes: true });
|
|
502353
502532
|
for (const user of userDirs) {
|
|
502354
502533
|
if (user.name === "Public" || user.name === "Default" || user.name === "Default User" || user.name === "All Users") {
|
|
502355
502534
|
continue;
|
|
502356
502535
|
}
|
|
502357
|
-
const potentialConfigPath =
|
|
502536
|
+
const potentialConfigPath = join186(usersDir, user.name, "AppData", "Roaming", "Theus", "theus_desktop_config.json");
|
|
502358
502537
|
try {
|
|
502359
|
-
await
|
|
502538
|
+
await stat60(potentialConfigPath);
|
|
502360
502539
|
return potentialConfigPath;
|
|
502361
502540
|
} catch {}
|
|
502362
502541
|
}
|
|
@@ -502374,7 +502553,7 @@ async function readTheusDesktopMcpServers() {
|
|
|
502374
502553
|
const configPath2 = await getTheusDesktopConfigPath();
|
|
502375
502554
|
let configContent;
|
|
502376
502555
|
try {
|
|
502377
|
-
configContent = await
|
|
502556
|
+
configContent = await readFile70(configPath2, { encoding: "utf8" });
|
|
502378
502557
|
} catch (e) {
|
|
502379
502558
|
const code = getErrnoCode(e);
|
|
502380
502559
|
if (code === "ENOENT") {
|
|
@@ -502425,7 +502604,7 @@ __export(exports_mcp3, {
|
|
|
502425
502604
|
mcpAddJsonHandler: () => mcpAddJsonHandler,
|
|
502426
502605
|
mcpAddFromDesktopHandler: () => mcpAddFromDesktopHandler
|
|
502427
502606
|
});
|
|
502428
|
-
import { stat as
|
|
502607
|
+
import { stat as stat61 } from "fs/promises";
|
|
502429
502608
|
import { cwd as cwd3 } from "process";
|
|
502430
502609
|
async function checkMcpServerHealth(name, server2) {
|
|
502431
502610
|
try {
|
|
@@ -502448,7 +502627,7 @@ async function mcpServeHandler({
|
|
|
502448
502627
|
const providedCwd = cwd3();
|
|
502449
502628
|
logEvent("theus_mcp_start", {});
|
|
502450
502629
|
try {
|
|
502451
|
-
await
|
|
502630
|
+
await stat61(providedCwd);
|
|
502452
502631
|
} catch (error40) {
|
|
502453
502632
|
if (isFsInaccessible(error40)) {
|
|
502454
502633
|
cliError(`Error: Directory ${providedCwd} does not exist`);
|
|
@@ -503263,12 +503442,12 @@ __export(exports_install, {
|
|
|
503263
503442
|
install: () => install
|
|
503264
503443
|
});
|
|
503265
503444
|
import { homedir as homedir54 } from "os";
|
|
503266
|
-
import { join as
|
|
503445
|
+
import { join as join187 } from "path";
|
|
503267
503446
|
function getInstallationPath2() {
|
|
503268
503447
|
const isWindows2 = env3.platform === "win32";
|
|
503269
503448
|
const homeDir = homedir54();
|
|
503270
503449
|
if (isWindows2) {
|
|
503271
|
-
const windowsPath =
|
|
503450
|
+
const windowsPath = join187(homeDir, ".local", "bin", "theus.exe");
|
|
503272
503451
|
return windowsPath.replace(/\//g, "\\");
|
|
503273
503452
|
}
|
|
503274
503453
|
return "~/.local/bin/theus";
|
|
@@ -503638,7 +503817,7 @@ async function setupTokenHandler(root2) {
|
|
|
503638
503817
|
gap: 1,
|
|
503639
503818
|
children: [
|
|
503640
503819
|
/* @__PURE__ */ jsx_runtime502.jsx(TheusBanner, {
|
|
503641
|
-
version: { VERSION: "0.2.
|
|
503820
|
+
version: { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
503642
503821
|
}),
|
|
503643
503822
|
showAuthWarning && /* @__PURE__ */ jsx_runtime502.jsxs(ThemedBox_default, {
|
|
503644
503823
|
flexDirection: "column",
|
|
@@ -503807,7 +503986,7 @@ var exports_import2 = {};
|
|
|
503807
503986
|
__export(exports_import2, {
|
|
503808
503987
|
importHandler: () => importHandler
|
|
503809
503988
|
});
|
|
503810
|
-
import { readFile as
|
|
503989
|
+
import { readFile as readFile71 } from "fs/promises";
|
|
503811
503990
|
import { homedir as homedir55 } from "os";
|
|
503812
503991
|
import { resolve as resolve59 } from "path";
|
|
503813
503992
|
function resolvePath4(raw) {
|
|
@@ -503829,7 +504008,7 @@ async function importHandler(file2, options2 = {}) {
|
|
|
503829
504008
|
const abs = resolvePath4(file2);
|
|
503830
504009
|
let bytes;
|
|
503831
504010
|
try {
|
|
503832
|
-
bytes = await
|
|
504011
|
+
bytes = await readFile71(abs);
|
|
503833
504012
|
} catch {
|
|
503834
504013
|
process.stderr.write(`\u2717 No pude leer el archivo: ${abs}
|
|
503835
504014
|
`);
|
|
@@ -505223,7 +505402,7 @@ ${assistantAddendum}` : assistantAddendum;
|
|
|
505223
505402
|
}
|
|
505224
505403
|
}
|
|
505225
505404
|
logForDiagnosticsNoPII("info", "started", {
|
|
505226
|
-
version: { VERSION: "0.2.
|
|
505405
|
+
version: { VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
505227
505406
|
is_native_binary: isInBundledMode()
|
|
505228
505407
|
});
|
|
505229
505408
|
registerCleanup(async () => {
|
|
@@ -506091,7 +506270,7 @@ Usage: theus --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
506091
506270
|
pendingHookMessages
|
|
506092
506271
|
}, renderAndRun);
|
|
506093
506272
|
}
|
|
506094
|
-
}).version(`${{ VERSION: "0.2.
|
|
506273
|
+
}).version(`${{ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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");
|
|
506095
506274
|
program2.option("-w, --worktree [name]", "Crea un nuevo worktree de git para esta sesi\xF3n (opcionalmente indica un nombre)");
|
|
506096
506275
|
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.");
|
|
506097
506276
|
if (canUserConfigureAdvisor()) {
|
|
@@ -506692,7 +506871,7 @@ if (false) {}
|
|
|
506692
506871
|
async function main2() {
|
|
506693
506872
|
const args = process.argv.slice(2);
|
|
506694
506873
|
if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
|
|
506695
|
-
console.log(`${{ VERSION: "0.2.
|
|
506874
|
+
console.log(`${{ VERSION: "0.2.73", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)`);
|
|
506696
506875
|
return;
|
|
506697
506876
|
}
|
|
506698
506877
|
if (args[0] === "login" || args[0] === "signin" || args[0] === "entrar" || args[0] === "iniciar-sesion") {
|