theus-cli 0.2.69 → 0.2.70
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 +1019 -557
- 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.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.FEEDBACK_CHANNEL}.`);
|
|
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.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.FEEDBACK_CHANNEL}.`);
|
|
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.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.FEEDBACK_CHANNEL}.`);
|
|
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.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.FEEDBACK_CHANNEL}.`);
|
|
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.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}`;
|
|
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.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} (${"external"}, ${process.env.THEUS_CODE_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
|
|
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.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}${suffix}`;
|
|
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.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
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.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION.match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
|
|
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.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
60601
60601
|
versionBase: getVersionBase(),
|
|
60602
|
-
buildTime: { VERSION: "0.2.
|
|
60602
|
+
buildTime: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.BUILD_TIME,
|
|
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.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
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.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
|
|
61246
61246
|
}
|
|
61247
61247
|
async function reinitialize1PEventLoggingIfConfigChanged() {
|
|
61248
61248
|
if (!is1PEventLoggingEnabled() || !firstPartyEventLoggerProvider) {
|
|
@@ -68101,9 +68101,11 @@ var exports_earlyInput = {};
|
|
|
68101
68101
|
__export(exports_earlyInput, {
|
|
68102
68102
|
stopCapturingEarlyInput: () => stopCapturingEarlyInput,
|
|
68103
68103
|
startCapturingEarlyInput: () => startCapturingEarlyInput,
|
|
68104
|
+
seedEarlyInputAndSubmit: () => seedEarlyInputAndSubmit,
|
|
68104
68105
|
seedEarlyInput: () => seedEarlyInput,
|
|
68105
68106
|
isCapturingEarlyInput: () => isCapturingEarlyInput,
|
|
68106
68107
|
hasEarlyInput: () => hasEarlyInput,
|
|
68108
|
+
consumePendingSubmit: () => consumePendingSubmit,
|
|
68107
68109
|
consumeEarlyInput: () => consumeEarlyInput
|
|
68108
68110
|
});
|
|
68109
68111
|
function startCapturingEarlyInput() {
|
|
@@ -68197,10 +68199,19 @@ function hasEarlyInput() {
|
|
|
68197
68199
|
function seedEarlyInput(text) {
|
|
68198
68200
|
earlyInputBuffer = text;
|
|
68199
68201
|
}
|
|
68202
|
+
function seedEarlyInputAndSubmit(text) {
|
|
68203
|
+
earlyInputBuffer = text;
|
|
68204
|
+
pendienteDeEnviar = true;
|
|
68205
|
+
}
|
|
68206
|
+
function consumePendingSubmit() {
|
|
68207
|
+
const valor = pendienteDeEnviar;
|
|
68208
|
+
pendienteDeEnviar = false;
|
|
68209
|
+
return valor;
|
|
68210
|
+
}
|
|
68200
68211
|
function isCapturingEarlyInput() {
|
|
68201
68212
|
return isCapturing;
|
|
68202
68213
|
}
|
|
68203
|
-
var earlyInputBuffer = "", isCapturing = false, readableHandler = null;
|
|
68214
|
+
var earlyInputBuffer = "", isCapturing = false, readableHandler = null, pendienteDeEnviar = false;
|
|
68204
68215
|
var init_earlyInput = __esm(() => {
|
|
68205
68216
|
init_intl();
|
|
68206
68217
|
});
|
|
@@ -91070,7 +91081,7 @@ function getAttributionHeader(fingerprint) {
|
|
|
91070
91081
|
if (!isAttributionHeaderEnabled()) {
|
|
91071
91082
|
return "";
|
|
91072
91083
|
}
|
|
91073
|
-
const version2 = `${{ VERSION: "0.2.
|
|
91084
|
+
const version2 = `${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}.${fingerprint}`;
|
|
91074
91085
|
const entrypoint = process.env.THEUS_CODE_ENTRYPOINT ?? "unknown";
|
|
91075
91086
|
const cch = "";
|
|
91076
91087
|
const workload = getWorkload();
|
|
@@ -104106,7 +104117,7 @@ Complete the user's request by providing accurate, documentation-based guidance.
|
|
|
104106
104117
|
}
|
|
104107
104118
|
function getFeedbackGuideline() {
|
|
104108
104119
|
if (isUsing3PServices()) {
|
|
104109
|
-
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.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.ISSUES_EXPLAINER}`;
|
|
104110
104121
|
}
|
|
104111
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";
|
|
104112
104123
|
}
|
|
@@ -144290,7 +144301,7 @@ function getTelemetryAttributes() {
|
|
|
144290
144301
|
attributes["session.id"] = sessionId;
|
|
144291
144302
|
}
|
|
144292
144303
|
if (shouldIncludeAttribute("OTEL_METRICS_INCLUDE_VERSION")) {
|
|
144293
|
-
attributes["app.version"] = { VERSION: "0.2.
|
|
144304
|
+
attributes["app.version"] = { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
|
|
144294
144305
|
}
|
|
144295
144306
|
const oauthAccount = getOauthAccountInfo();
|
|
144296
144307
|
if (oauthAccount) {
|
|
@@ -215861,6 +215872,7 @@ var init_xaaIdpLogin = __esm(() => {
|
|
|
215861
215872
|
var exports_auth2 = {};
|
|
215862
215873
|
__export(exports_auth2, {
|
|
215863
215874
|
wrapFetchWithStepUpDetection: () => wrapFetchWithStepUpDetection,
|
|
215875
|
+
tieneCredencialesGuardadas: () => tieneCredencialesGuardadas,
|
|
215864
215876
|
saveMcpClientSecret: () => saveMcpClientSecret,
|
|
215865
215877
|
revokeServerTokens: () => revokeServerTokens,
|
|
215866
215878
|
readClientSecret: () => readClientSecret,
|
|
@@ -216134,6 +216146,17 @@ async function revokeServerTokens(serverName, serverConfig, { preserveStepUpStat
|
|
|
216134
216146
|
logMCPDebug(serverName, "Preserved step-up auth state across revocation");
|
|
216135
216147
|
}
|
|
216136
216148
|
}
|
|
216149
|
+
function tieneCredencialesGuardadas(serverName, serverConfig) {
|
|
216150
|
+
try {
|
|
216151
|
+
const data = getSecureStorage().read();
|
|
216152
|
+
if (!data?.mcpOAuth)
|
|
216153
|
+
return false;
|
|
216154
|
+
const entrada = data.mcpOAuth[getServerKey(serverName, serverConfig)];
|
|
216155
|
+
return Boolean(entrada?.accessToken);
|
|
216156
|
+
} catch {
|
|
216157
|
+
return false;
|
|
216158
|
+
}
|
|
216159
|
+
}
|
|
216137
216160
|
function clearServerTokensFromLocalStorage(serverName, serverConfig) {
|
|
216138
216161
|
const storage = getSecureStorage();
|
|
216139
216162
|
const existingData = storage.read();
|
|
@@ -220557,7 +220580,7 @@ async function getMcpHeadersFromHelper(serverName, config2) {
|
|
|
220557
220580
|
if ("scope" in config2 && isMcpServerFromProjectOrLocalSettings(config2) && !getIsNonInteractiveSession()) {
|
|
220558
220581
|
const hasTrust = checkHasTrustDialogAccepted();
|
|
220559
220582
|
if (!hasTrust) {
|
|
220560
|
-
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.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.FEEDBACK_CHANNEL}.`);
|
|
220561
220584
|
logAntError("MCP headersHelper invoked before trust check", error40);
|
|
220562
220585
|
logEvent("theus_mcp_headersHelper_missing_trust", {});
|
|
220563
220586
|
return null;
|
|
@@ -221249,7 +221272,7 @@ function computeFingerprint(messageText, version2) {
|
|
|
221249
221272
|
}
|
|
221250
221273
|
function computeFingerprintFromMessages(messages) {
|
|
221251
221274
|
const firstMessageText = extractFirstMessageText(messages);
|
|
221252
|
-
return computeFingerprint(firstMessageText, { VERSION: "0.2.
|
|
221275
|
+
return computeFingerprint(firstMessageText, { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
|
|
221253
221276
|
}
|
|
221254
221277
|
var FINGERPRINT_SALT = "59cf53e54c78";
|
|
221255
221278
|
var init_fingerprint = () => {};
|
|
@@ -221291,7 +221314,7 @@ async function sideQuery(opts) {
|
|
|
221291
221314
|
betas.push(STRUCTURED_OUTPUTS_BETA_HEADER);
|
|
221292
221315
|
}
|
|
221293
221316
|
const messageText = extractFirstUserMessageText(messages);
|
|
221294
|
-
const fingerprint = computeFingerprint(messageText, { VERSION: "0.2.
|
|
221317
|
+
const fingerprint = computeFingerprint(messageText, { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
|
|
221295
221318
|
const attributionHeader = getAttributionHeader(fingerprint);
|
|
221296
221319
|
const systemBlocks = [
|
|
221297
221320
|
attributionHeader ? { type: "text", text: attributionHeader } : null,
|
|
@@ -222415,7 +222438,7 @@ async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) {
|
|
|
222415
222438
|
const client2 = new Client({
|
|
222416
222439
|
name: "theus-code",
|
|
222417
222440
|
title: "Theus",
|
|
222418
|
-
version: { VERSION: "0.2.
|
|
222441
|
+
version: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION ?? "unknown",
|
|
222419
222442
|
description: "Theus's agentic coding tool",
|
|
222420
222443
|
websiteUrl: PRODUCT_URL
|
|
222421
222444
|
}, {
|
|
@@ -222769,7 +222792,7 @@ var init_client5 = __esm(() => {
|
|
|
222769
222792
|
const client2 = new Client({
|
|
222770
222793
|
name: "theus-code",
|
|
222771
222794
|
title: "Theus",
|
|
222772
|
-
version: { VERSION: "0.2.
|
|
222795
|
+
version: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION ?? "unknown",
|
|
222773
222796
|
description: "Theus's agentic coding tool",
|
|
222774
222797
|
websiteUrl: PRODUCT_URL
|
|
222775
222798
|
}, {
|
|
@@ -242617,7 +242640,7 @@ async function initializeBetaTracing(resource) {
|
|
|
242617
242640
|
});
|
|
242618
242641
|
logs.setGlobalLoggerProvider(loggerProvider);
|
|
242619
242642
|
setLoggerProvider(loggerProvider);
|
|
242620
|
-
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.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
|
|
242621
242644
|
setEventLogger(eventLogger);
|
|
242622
242645
|
process.on("beforeExit", async () => {
|
|
242623
242646
|
await loggerProvider?.forceFlush();
|
|
@@ -242657,7 +242680,7 @@ async function initializeTelemetry() {
|
|
|
242657
242680
|
const platform4 = getPlatform();
|
|
242658
242681
|
const baseAttributes = {
|
|
242659
242682
|
[ATTR_SERVICE_NAME]: "theus-code",
|
|
242660
|
-
[ATTR_SERVICE_VERSION]: { VERSION: "0.2.
|
|
242683
|
+
[ATTR_SERVICE_VERSION]: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
242661
242684
|
};
|
|
242662
242685
|
if (platform4 === "wsl") {
|
|
242663
242686
|
const wslVersion = getWslVersion();
|
|
@@ -242702,7 +242725,7 @@ async function initializeTelemetry() {
|
|
|
242702
242725
|
} catch {}
|
|
242703
242726
|
};
|
|
242704
242727
|
registerCleanup(shutdownTelemetry2);
|
|
242705
|
-
return meterProvider2.getMeter("com.theus.theus_code", { VERSION: "0.2.
|
|
242728
|
+
return meterProvider2.getMeter("com.theus.theus_code", { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
|
|
242706
242729
|
}
|
|
242707
242730
|
const meterProvider = new MeterProvider({
|
|
242708
242731
|
resource,
|
|
@@ -242722,7 +242745,7 @@ async function initializeTelemetry() {
|
|
|
242722
242745
|
});
|
|
242723
242746
|
logs.setGlobalLoggerProvider(loggerProvider);
|
|
242724
242747
|
setLoggerProvider(loggerProvider);
|
|
242725
|
-
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.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
|
|
242726
242749
|
setEventLogger(eventLogger);
|
|
242727
242750
|
logForDebugging("[3P telemetry] Event logger set successfully");
|
|
242728
242751
|
process.on("beforeExit", async () => {
|
|
@@ -242784,7 +242807,7 @@ Current timeout: ${timeoutMs}ms
|
|
|
242784
242807
|
}
|
|
242785
242808
|
};
|
|
242786
242809
|
registerCleanup(shutdownTelemetry);
|
|
242787
|
-
return meterProvider.getMeter("com.theus.theus_code", { VERSION: "0.2.
|
|
242810
|
+
return meterProvider.getMeter("com.theus.theus_code", { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
|
|
242788
242811
|
}
|
|
242789
242812
|
async function flushTelemetry() {
|
|
242790
242813
|
const meterProvider = getMeterProvider();
|
|
@@ -243326,7 +243349,7 @@ async function installOrUpdateTheusPackage(channel2, specificVersion) {
|
|
|
243326
243349
|
return "install_failed";
|
|
243327
243350
|
}
|
|
243328
243351
|
const versionSpec = specificVersion ? specificVersion : channel2 === "stable" ? "stable" : "latest";
|
|
243329
|
-
const result = await execFileNoThrowWithCwd("npm", ["install", `${{ VERSION: "0.2.
|
|
243352
|
+
const result = await execFileNoThrowWithCwd("npm", ["install", `${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}@${versionSpec}`], { cwd: getLocalInstallDir(), maxBuffer: 1e6 });
|
|
243330
243353
|
if (result.code !== 0) {
|
|
243331
243354
|
const error40 = new Error(`Failed to install Theus CLI package: ${result.stderr}`);
|
|
243332
243355
|
logError2(error40);
|
|
@@ -243472,9 +243495,9 @@ async function assertMinVersion() {
|
|
|
243472
243495
|
if (false) {}
|
|
243473
243496
|
try {
|
|
243474
243497
|
const versionConfig = await getDynamicConfig_BLOCKS_ON_INIT("theus_version_config", { minVersion: "0.0.0" });
|
|
243475
|
-
if (versionConfig.minVersion && lt({ VERSION: "0.2.
|
|
243498
|
+
if (versionConfig.minVersion && lt({ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, versionConfig.minVersion)) {
|
|
243476
243499
|
console.error(`
|
|
243477
|
-
It looks like your version of Theus (${{ VERSION: "0.2.
|
|
243500
|
+
It looks like your version of Theus (${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}) needs an update.
|
|
243478
243501
|
A newer version (${versionConfig.minVersion} or higher) is required to continue.
|
|
243479
243502
|
|
|
243480
243503
|
To update, please run:
|
|
@@ -243611,7 +243634,7 @@ async function getInstallationPrefix() {
|
|
|
243611
243634
|
return prefixResult.stdout.trim();
|
|
243612
243635
|
}
|
|
243613
243636
|
function getGlobalInstallPackageManager() {
|
|
243614
|
-
if ({ VERSION: "0.2.
|
|
243637
|
+
if ({ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL === "theus-cli") {
|
|
243615
243638
|
return "npm";
|
|
243616
243639
|
}
|
|
243617
243640
|
return env3.isRunningWithBun() ? "bun" : "npm";
|
|
@@ -243636,7 +243659,7 @@ async function checkGlobalInstallPermissions() {
|
|
|
243636
243659
|
}
|
|
243637
243660
|
async function getLatestVersion(channel2) {
|
|
243638
243661
|
const npmTag = channel2 === "stable" ? "stable" : "latest";
|
|
243639
|
-
const result = await execFileNoThrowWithCwd("npm", ["view", `${{ VERSION: "0.2.
|
|
243662
|
+
const result = await execFileNoThrowWithCwd("npm", ["view", `${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}@${npmTag}`, "version", "--prefer-online"], { abortSignal: AbortSignal.timeout(5000), cwd: homedir20() });
|
|
243640
243663
|
if (result.code !== 0) {
|
|
243641
243664
|
logForDebugging(`npm view failed with code ${result.code}`);
|
|
243642
243665
|
if (result.stderr) {
|
|
@@ -243652,7 +243675,7 @@ async function getLatestVersion(channel2) {
|
|
|
243652
243675
|
return result.stdout.trim();
|
|
243653
243676
|
}
|
|
243654
243677
|
async function getNpmDistTags() {
|
|
243655
|
-
const result = await execFileNoThrowWithCwd("npm", ["view", { VERSION: "0.2.
|
|
243678
|
+
const result = await execFileNoThrowWithCwd("npm", ["view", { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL, "dist-tags", "--json", "--prefer-online"], { abortSignal: AbortSignal.timeout(5000), cwd: homedir20() });
|
|
243656
243679
|
if (result.code !== 0) {
|
|
243657
243680
|
logForDebugging(`npm view dist-tags failed with code ${result.code}`);
|
|
243658
243681
|
return { latest: null, stable: null };
|
|
@@ -243692,7 +243715,7 @@ async function installGlobalPackage(specificVersion) {
|
|
|
243692
243715
|
logError2(new AutoUpdaterError("Another process is currently installing an update"));
|
|
243693
243716
|
logEvent("theus_auto_updater_lock_contention", {
|
|
243694
243717
|
pid: process.pid,
|
|
243695
|
-
currentVersion: { VERSION: "0.2.
|
|
243718
|
+
currentVersion: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
243696
243719
|
});
|
|
243697
243720
|
return "in_progress";
|
|
243698
243721
|
}
|
|
@@ -243701,7 +243724,7 @@ async function installGlobalPackage(specificVersion) {
|
|
|
243701
243724
|
if (!env3.isRunningWithBun() && env3.isNpmFromWindowsPath()) {
|
|
243702
243725
|
logError2(new Error("Windows NPM detected in WSL environment"));
|
|
243703
243726
|
logEvent("theus_auto_updater_windows_npm_in_wsl", {
|
|
243704
|
-
currentVersion: { VERSION: "0.2.
|
|
243727
|
+
currentVersion: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
243705
243728
|
});
|
|
243706
243729
|
console.error(`
|
|
243707
243730
|
Error: Windows NPM detected in WSL
|
|
@@ -243720,7 +243743,7 @@ To fix this issue:
|
|
|
243720
243743
|
if (!hasPermissions) {
|
|
243721
243744
|
return "no_permissions";
|
|
243722
243745
|
}
|
|
243723
|
-
const packageSpec = specificVersion ? `${{ VERSION: "0.2.
|
|
243746
|
+
const packageSpec = specificVersion ? `${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}@${specificVersion}` : { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL;
|
|
243724
243747
|
const packageManager = getGlobalInstallPackageManager();
|
|
243725
243748
|
const installResult = await execFileNoThrowWithCwd(packageManager, ["install", "-g", packageSpec], { cwd: homedir20() });
|
|
243726
243749
|
if (installResult.code !== 0) {
|
|
@@ -244048,8 +244071,8 @@ async function detectMultipleInstallations() {
|
|
|
244048
244071
|
installations.push({ type: "npm-local", path: localPath });
|
|
244049
244072
|
}
|
|
244050
244073
|
const packagesToCheck = ["@theus-ai/theus-code"];
|
|
244051
|
-
if ({ VERSION: "0.2.
|
|
244052
|
-
packagesToCheck.push({ VERSION: "0.2.
|
|
244074
|
+
if ({ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL && { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL !== "@theus-ai/theus-code") {
|
|
244075
|
+
packagesToCheck.push({ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL);
|
|
244053
244076
|
}
|
|
244054
244077
|
const npmResult = await execFileNoThrow("npm", [
|
|
244055
244078
|
"-g",
|
|
@@ -244232,7 +244255,7 @@ function detectLinuxGlobPatternWarnings() {
|
|
|
244232
244255
|
}
|
|
244233
244256
|
async function getDoctorDiagnostic() {
|
|
244234
244257
|
const installationType = await getCurrentInstallationType();
|
|
244235
|
-
const version2 = { VERSION: "0.2.
|
|
244258
|
+
const version2 = { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION ? { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION : "unknown";
|
|
244236
244259
|
const installationPath = await getInstallationPath();
|
|
244237
244260
|
const invokedBinary = getInvokedBinary();
|
|
244238
244261
|
const multipleInstallations = await detectMultipleInstallations();
|
|
@@ -244244,8 +244267,8 @@ async function getDoctorDiagnostic() {
|
|
|
244244
244267
|
for (const install of npmInstalls) {
|
|
244245
244268
|
if (install.type === "npm-global") {
|
|
244246
244269
|
let uninstallCmd = "npm -g uninstall @theus-ai/theus-code";
|
|
244247
|
-
if ({ VERSION: "0.2.
|
|
244248
|
-
uninstallCmd += ` && npm -g uninstall ${{ VERSION: "0.2.
|
|
244270
|
+
if ({ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL && { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL !== "@theus-ai/theus-code") {
|
|
244271
|
+
uninstallCmd += ` && npm -g uninstall ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}`;
|
|
244249
244272
|
}
|
|
244250
244273
|
warnings.push({
|
|
244251
244274
|
issue: `Leftover npm global installation at ${install.path}`,
|
|
@@ -245056,8 +245079,8 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
|
|
|
245056
245079
|
const maxVersion = await getMaxVersion();
|
|
245057
245080
|
if (maxVersion && gt(version2, maxVersion)) {
|
|
245058
245081
|
logForDebugging(`Native installer: maxVersion ${maxVersion} is set, capping update from ${version2} to ${maxVersion}`);
|
|
245059
|
-
if (gte({ VERSION: "0.2.
|
|
245060
|
-
logForDebugging(`Native installer: current version ${{ VERSION: "0.2.
|
|
245082
|
+
if (gte({ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, maxVersion)) {
|
|
245083
|
+
logForDebugging(`Native installer: current version ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} is already at or above maxVersion ${maxVersion}, skipping update`);
|
|
245061
245084
|
logEvent("theus_native_update_skipped_max_version", {
|
|
245062
245085
|
latency_ms: Date.now() - startTime2,
|
|
245063
245086
|
max_version: maxVersion,
|
|
@@ -245068,7 +245091,7 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
|
|
|
245068
245091
|
version2 = maxVersion;
|
|
245069
245092
|
}
|
|
245070
245093
|
}
|
|
245071
|
-
if (!forceReinstall && version2 === { VERSION: "0.2.
|
|
245094
|
+
if (!forceReinstall && version2 === { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION && await versionIsAvailable(version2) && await isPossibleTheusBinary(executablePath)) {
|
|
245072
245095
|
logForDebugging(`Found ${version2} at ${executablePath}, skipping install`);
|
|
245073
245096
|
logEvent("theus_native_update_complete", {
|
|
245074
245097
|
latency_ms: Date.now() - startTime2,
|
|
@@ -245818,8 +245841,8 @@ async function cleanupNpmInstallations() {
|
|
|
245818
245841
|
} else if (codePackageResult.error) {
|
|
245819
245842
|
errors4.push(codePackageResult.error);
|
|
245820
245843
|
}
|
|
245821
|
-
if ({ VERSION: "0.2.
|
|
245822
|
-
const macroPackageResult = await attemptNpmUninstall({ VERSION: "0.2.
|
|
245844
|
+
if ({ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL && { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL !== "@theus-ai/theus-code") {
|
|
245845
|
+
const macroPackageResult = await attemptNpmUninstall({ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL);
|
|
245823
245846
|
if (macroPackageResult.success) {
|
|
245824
245847
|
removed++;
|
|
245825
245848
|
if (macroPackageResult.warning) {
|
|
@@ -256236,6 +256259,18 @@ var init_ConsoleOAuthFlow = __esm(() => {
|
|
|
256236
256259
|
var NOVEDADES;
|
|
256237
256260
|
var init_data = __esm(() => {
|
|
256238
256261
|
NOVEDADES = [
|
|
256262
|
+
{
|
|
256263
|
+
version: "v0.2.70",
|
|
256264
|
+
fecha: "2026-08-13",
|
|
256265
|
+
titulo: "Theus llega conociendo tu proyecto, y los conectores dicen la verdad",
|
|
256266
|
+
puntos: [
|
|
256267
|
+
"Si ya trabajaste en esta carpeta con otro agente de c\xF3digo, Theus lo detecta solo y te ofrece traer ese contexto: en qu\xE9 andabas, qu\xE9 decidiste, qu\xE9 fall\xF3. No tienes que exportar nada ni buscar ning\xFAn archivo. Primero te ense\xF1a qu\xE9 encontr\xF3 \u2014cu\xE1ntas sesiones y de cu\xE1ndo\u2014 SIN abrir un solo mensaje, y solo lee si dices que s\xED.",
|
|
256268
|
+
"Conectores: cancelar el login dejaba el conector escrito a medias, pintado como conectado, y el siguiente intento fallaba dej\xE1ndolo atascado sin salida. Ahora la vinculaci\xF3n se guarda solo cuando termina bien, y la galer\xEDa distingue lo que est\xE1 configurado de lo que est\xE1 de verdad autenticado.",
|
|
256269
|
+
"Mercado Pago te ped\xEDa una clave que su servidor no acepta. Ya se conecta como corresponde, con el mismo inicio de sesi\xF3n que el resto.",
|
|
256270
|
+
"Al importar contexto te decimos con claridad a d\xF3nde viaja: si usas un modelo local, no sale de tu equipo; si usas tu cuenta, se env\xEDan fragmentos al modelo como en cualquier otra pregunta. Antes dec\xEDamos \xABtodo local\xBB en ambos casos, y para la mayor\xEDa no era cierto.",
|
|
256271
|
+
"Una importaci\xF3n que terminaba bien dejaba la pantalla congelada, y el men\xFA de inicio dejaba el comando escrito sin ejecutarlo. Las dos cosas ya funcionan como se espera."
|
|
256272
|
+
]
|
|
256273
|
+
},
|
|
256239
256274
|
{
|
|
256240
256275
|
version: "v0.2.69",
|
|
256241
256276
|
fecha: "2026-08-13",
|
|
@@ -300065,9 +300100,9 @@ function getTheusEnvMetadata() {
|
|
|
300065
300100
|
};
|
|
300066
300101
|
}
|
|
300067
300102
|
function getBuildAgeMinutes() {
|
|
300068
|
-
if (!{ VERSION: "0.2.
|
|
300103
|
+
if (!{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.BUILD_TIME)
|
|
300069
300104
|
return;
|
|
300070
|
-
const buildTime = new Date({ VERSION: "0.2.
|
|
300105
|
+
const buildTime = new Date({ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.BUILD_TIME).getTime();
|
|
300071
300106
|
if (isNaN(buildTime))
|
|
300072
300107
|
return;
|
|
300073
300108
|
return Math.floor((Date.now() - buildTime) / 60000);
|
|
@@ -318372,7 +318407,7 @@ function getSimpleDoingTasksSection() {
|
|
|
318372
318407
|
];
|
|
318373
318408
|
const userHelpSubitems = [
|
|
318374
318409
|
`/help: Get help with using Theus`,
|
|
318375
|
-
`To give feedback, users should ${{ VERSION: "0.2.
|
|
318410
|
+
`To give feedback, users should ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.ISSUES_EXPLAINER}`
|
|
318376
318411
|
];
|
|
318377
318412
|
const items = [
|
|
318378
318413
|
`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.`,
|
|
@@ -329508,7 +329543,7 @@ async function submitTranscriptShare(messages, trigger, appearanceId) {
|
|
|
329508
329543
|
} catch {}
|
|
329509
329544
|
const data = {
|
|
329510
329545
|
trigger,
|
|
329511
|
-
version: { VERSION: "0.2.
|
|
329546
|
+
version: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
329512
329547
|
platform: process.platform,
|
|
329513
329548
|
transcript,
|
|
329514
329549
|
subagentTranscripts: Object.keys(subagentTranscripts).length > 0 ? subagentTranscripts : undefined,
|
|
@@ -329713,10 +329748,10 @@ Si el usuario indic\xF3 una duraci\xF3n, p\xE1sala en el par\xE1metro \`duration
|
|
|
329713
329748
|
|
|
329714
329749
|
// commands/issue/index.ts
|
|
329715
329750
|
function getCliVersion() {
|
|
329716
|
-
return { VERSION: "0.2.
|
|
329751
|
+
return { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION ? { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION : "desconocida";
|
|
329717
329752
|
}
|
|
329718
329753
|
function getIssuesExplainer() {
|
|
329719
|
-
return { VERSION: "0.2.
|
|
329754
|
+
return { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.ISSUES_EXPLAINER ? { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.ISSUES_EXPLAINER : "report issues to the Theus maintainers";
|
|
329720
329755
|
}
|
|
329721
329756
|
function getActiveModelLabel() {
|
|
329722
329757
|
try {
|
|
@@ -332502,7 +332537,7 @@ function buildPrimarySection() {
|
|
|
332502
332537
|
});
|
|
332503
332538
|
return [{
|
|
332504
332539
|
label: "Version",
|
|
332505
|
-
value: { VERSION: "0.2.
|
|
332540
|
+
value: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
332506
332541
|
}, {
|
|
332507
332542
|
label: "Session name",
|
|
332508
332543
|
value: nameValue
|
|
@@ -336318,7 +336353,7 @@ function Config({
|
|
|
336318
336353
|
}
|
|
336319
336354
|
})
|
|
336320
336355
|
}) : showSubmenu === "ChannelDowngrade" ? /* @__PURE__ */ jsx_runtime189.jsx(ChannelDowngradeDialog, {
|
|
336321
|
-
currentVersion: { VERSION: "0.2.
|
|
336356
|
+
currentVersion: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
336322
336357
|
onChoice: (choice) => {
|
|
336323
336358
|
setShowSubmenu(null);
|
|
336324
336359
|
setTabsHidden(false);
|
|
@@ -336330,7 +336365,7 @@ function Config({
|
|
|
336330
336365
|
autoUpdatesChannel: "stable"
|
|
336331
336366
|
};
|
|
336332
336367
|
if (choice === "stay") {
|
|
336333
|
-
newSettings.minimumVersion = { VERSION: "0.2.
|
|
336368
|
+
newSettings.minimumVersion = { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
|
|
336334
336369
|
}
|
|
336335
336370
|
updateSettingsForSource("userSettings", newSettings);
|
|
336336
336371
|
setSettingsData((prev_27) => ({
|
|
@@ -343534,7 +343569,7 @@ function HelpV2(t0) {
|
|
|
343534
343569
|
let t6;
|
|
343535
343570
|
if ($2[31] !== tabs) {
|
|
343536
343571
|
t6 = /* @__PURE__ */ jsx_runtime215.jsx(Tabs, {
|
|
343537
|
-
title: `Theus v${{ VERSION: "0.2.
|
|
343572
|
+
title: `Theus v${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}`,
|
|
343538
343573
|
color: "professionalBlue",
|
|
343539
343574
|
defaultTab: "general",
|
|
343540
343575
|
children: tabs
|
|
@@ -360504,14 +360539,20 @@ function ConnectorsManager({
|
|
|
360504
360539
|
const spin = useSpinner(Boolean(busySlug) && motionFull, ascii);
|
|
360505
360540
|
import_react141.useEffect(() => {
|
|
360506
360541
|
let alive = true;
|
|
360507
|
-
Promise.
|
|
360542
|
+
Promise.all([
|
|
360543
|
+
Promise.resolve().then(() => (init_config3(), exports_config2)),
|
|
360544
|
+
Promise.resolve().then(() => (init_auth5(), exports_auth2))
|
|
360545
|
+
]).then(([{ getMcpConfigByName: getMcpConfigByName2 }, { tieneCredencialesGuardadas: tieneCredencialesGuardadas2 }]) => {
|
|
360508
360546
|
if (!alive)
|
|
360509
360547
|
return;
|
|
360510
360548
|
const seed = {};
|
|
360511
360549
|
for (const c5 of CONNECTORS) {
|
|
360512
360550
|
try {
|
|
360513
|
-
|
|
360514
|
-
|
|
360551
|
+
const config3 = getMcpConfigByName2(c5.slug);
|
|
360552
|
+
if (!config3)
|
|
360553
|
+
continue;
|
|
360554
|
+
const autenticado = c5.auth === "open" || tieneCredencialesGuardadas2(c5.slug, config3);
|
|
360555
|
+
seed[c5.slug] = autenticado ? { status: "connected" } : { status: "idle" };
|
|
360515
360556
|
} catch {}
|
|
360516
360557
|
}
|
|
360517
360558
|
setState((prev) => ({ ...seed, ...prev }));
|
|
@@ -360535,16 +360576,24 @@ function ConnectorsManager({
|
|
|
360535
360576
|
setState((s) => ({ ...s, [c5.slug]: { status: "connecting" } }));
|
|
360536
360577
|
const controller = new AbortController;
|
|
360537
360578
|
abortRef.current = controller;
|
|
360579
|
+
let configEscrita = false;
|
|
360538
360580
|
try {
|
|
360539
360581
|
const { addMcpConfig: addMcpConfig2 } = await Promise.resolve().then(() => (init_config3(), exports_config2));
|
|
360540
360582
|
const config3 = c5.transporte === "sse" ? { type: "sse", url: c5.url, oauth: {} } : c5.auth === "oauth" ? { type: "http", url: c5.url, oauth: {} } : { type: "http", url: c5.url };
|
|
360541
|
-
await addMcpConfig2(c5.slug, config3, "user");
|
|
360542
360583
|
if (c5.auth === "oauth") {
|
|
360543
360584
|
const { performMCPOAuthFlow: performMCPOAuthFlow2 } = await Promise.resolve().then(() => (init_auth5(), exports_auth2));
|
|
360544
360585
|
await performMCPOAuthFlow2(c5.slug, config3, (url3) => setAuthUrl(url3), controller.signal);
|
|
360545
360586
|
}
|
|
360587
|
+
await addMcpConfig2(c5.slug, config3, "user");
|
|
360588
|
+
configEscrita = true;
|
|
360546
360589
|
setState((s) => ({ ...s, [c5.slug]: { status: "connected" } }));
|
|
360547
360590
|
} catch (err2) {
|
|
360591
|
+
if (configEscrita) {
|
|
360592
|
+
try {
|
|
360593
|
+
const { removeMcpConfig: removeMcpConfig2 } = await Promise.resolve().then(() => (init_config3(), exports_config2));
|
|
360594
|
+
await removeMcpConfig2(c5.slug, "user");
|
|
360595
|
+
} catch {}
|
|
360596
|
+
}
|
|
360548
360597
|
if (controller.signal.aborted) {
|
|
360549
360598
|
setState((s) => ({ ...s, [c5.slug]: { status: "idle" } }));
|
|
360550
360599
|
} else {
|
|
@@ -360760,7 +360809,7 @@ var init_ConnectorsManager = __esm(() => {
|
|
|
360760
360809
|
{ slug: "intercom", nombre: "Intercom", descripcion: "Conversaciones y soporte a clientes", url: "https://mcp.intercom.com/sse", transporte: "sse", auth: "oauth" },
|
|
360761
360810
|
{ slug: "stripe", nombre: "Stripe", descripcion: "Pagos, clientes y facturaci\xF3n", url: "https://mcp.stripe.com", transporte: "http", auth: "oauth" },
|
|
360762
360811
|
{ slug: "paypal", nombre: "PayPal", descripcion: "Pagos y transacciones", url: "https://mcp.paypal.com/mcp", transporte: "http", auth: "oauth" },
|
|
360763
|
-
{ slug: "mercadopago", nombre: "Mercado Pago", descripcion: "Cobros y pagos en Am\xE9rica Latina", url: "https://mcp.mercadopago.com/mcp", transporte: "http", auth: "
|
|
360812
|
+
{ slug: "mercadopago", nombre: "Mercado Pago", descripcion: "Cobros y pagos en Am\xE9rica Latina", url: "https://mcp.mercadopago.com/mcp", transporte: "http", auth: "oauth" },
|
|
360764
360813
|
{ slug: "higgsfield", nombre: "Higgsfield", descripcion: "Generaci\xF3n de imagen y video con IA", url: "https://mcp.higgsfield.ai/mcp", transporte: "http", auth: "oauth" },
|
|
360765
360814
|
{ slug: "huggingface", nombre: "Hugging Face", descripcion: "Modelos, datasets y Spaces de IA", url: "https://hf.co/mcp", transporte: "http", auth: "open" },
|
|
360766
360815
|
{ slug: "canva", nombre: "Canva", descripcion: "Dise\xF1os y plantillas", url: "https://mcp.canva.com/mcp", transporte: "http", auth: "oauth" }
|
|
@@ -362124,7 +362173,7 @@ function Onboarding({
|
|
|
362124
362173
|
flexDirection: "column",
|
|
362125
362174
|
children: [
|
|
362126
362175
|
/* @__PURE__ */ jsx_runtime250.jsx(TheusBanner, {
|
|
362127
|
-
version: { VERSION: "0.2.
|
|
362176
|
+
version: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
362128
362177
|
}),
|
|
362129
362178
|
/* @__PURE__ */ jsx_runtime250.jsxs(ThemedBox_default, {
|
|
362130
362179
|
flexDirection: "column",
|
|
@@ -367511,7 +367560,7 @@ var init_Messages = __esm(() => {
|
|
|
367511
367560
|
let t1;
|
|
367512
367561
|
if ($2[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
367513
367562
|
t1 = /* @__PURE__ */ jsx_runtime263.jsx(TheusSessionHeader, {
|
|
367514
|
-
version: { VERSION: "0.2.
|
|
367563
|
+
version: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
367515
367564
|
});
|
|
367516
367565
|
$2[0] = t1;
|
|
367517
367566
|
} else {
|
|
@@ -376245,6 +376294,48 @@ var init_skills2 = __esm(() => {
|
|
|
376245
376294
|
skills_default = skills;
|
|
376246
376295
|
});
|
|
376247
376296
|
|
|
376297
|
+
// services/import/destino.ts
|
|
376298
|
+
import { existsSync as existsSync19, readFileSync as readFileSync26 } from "fs";
|
|
376299
|
+
function esHostLocal(baseURL) {
|
|
376300
|
+
let host;
|
|
376301
|
+
try {
|
|
376302
|
+
host = new URL(baseURL).hostname.toLowerCase();
|
|
376303
|
+
} catch {
|
|
376304
|
+
return false;
|
|
376305
|
+
}
|
|
376306
|
+
return host === "localhost" || host === "127.0.0.1" || host === "::1" || host === "[::1]" || host === "0.0.0.0" || host.endsWith(".local");
|
|
376307
|
+
}
|
|
376308
|
+
function leerProvidersConfig() {
|
|
376309
|
+
const path17 = defaultProvidersConfigPath();
|
|
376310
|
+
if (!existsSync19(path17))
|
|
376311
|
+
return null;
|
|
376312
|
+
try {
|
|
376313
|
+
return JSON.parse(readFileSync26(path17, "utf8"));
|
|
376314
|
+
} catch {
|
|
376315
|
+
return null;
|
|
376316
|
+
}
|
|
376317
|
+
}
|
|
376318
|
+
function resolverDestinoDestilado() {
|
|
376319
|
+
const envBase = (process.env.THEUS_BASE_URL ?? process.env.THEUS_OPENAI_BASE_URL ?? "").trim();
|
|
376320
|
+
if (envBase && !isEnvTruthy(process.env.THEUS_DISABLE_MAIN_PROVIDER)) {
|
|
376321
|
+
return esHostLocal(envBase) ? { tipo: "local", detalle: envBase } : { tipo: "remoto", detalle: envBase };
|
|
376322
|
+
}
|
|
376323
|
+
const config3 = leerProvidersConfig();
|
|
376324
|
+
const provider = config3?.providers?.find((p) => p.enabled !== false && p.adapter === "openai-compatible");
|
|
376325
|
+
const baseURL = provider && typeof provider.options?.baseURL === "string" ? provider.options.baseURL : "";
|
|
376326
|
+
if (baseURL) {
|
|
376327
|
+
return esHostLocal(baseURL) ? { tipo: "local", detalle: `${provider?.id ?? "proveedor"} \xB7 ${baseURL}` } : { tipo: "remoto", detalle: `${provider?.id ?? "proveedor"} \xB7 ${baseURL}` };
|
|
376328
|
+
}
|
|
376329
|
+
return { tipo: "remoto", detalle: "tu cuenta Theus" };
|
|
376330
|
+
}
|
|
376331
|
+
function avisoDestino(destino) {
|
|
376332
|
+
return destino.tipo === "local" ? `Todo ocurre en tu equipo: el historial se procesa con tu modelo local (${destino.detalle}) y no sale de aqu\xED.` : `Para extraer los hechos, Theus env\xEDa fragmentos del historial a tu modelo (${destino.detalle}), igual que cualquier otra pregunta del CLI. El historial completo no se guarda en ning\xFAn servidor. Si prefieres que nada salga de tu equipo, configura un modelo local con /providers.`;
|
|
376333
|
+
}
|
|
376334
|
+
var init_destino = __esm(() => {
|
|
376335
|
+
init_registry2();
|
|
376336
|
+
init_envUtils();
|
|
376337
|
+
});
|
|
376338
|
+
|
|
376248
376339
|
// services/import/aiExport.ts
|
|
376249
376340
|
function looksLikeZip(bytes) {
|
|
376250
376341
|
return bytes.length >= 4 && bytes[0] === 80 && bytes[1] === 75 && (bytes[2] === 3 || bytes[2] === 5 || bytes[2] === 7) && (bytes[3] === 4 || bytes[3] === 6 || bytes[3] === 8);
|
|
@@ -376537,6 +376628,8 @@ function sourceLabel(source) {
|
|
|
376537
376628
|
return "Claude";
|
|
376538
376629
|
case "gemini":
|
|
376539
376630
|
return "Gemini";
|
|
376631
|
+
case "agente-local":
|
|
376632
|
+
return "tu agente de c\xF3digo anterior";
|
|
376540
376633
|
}
|
|
376541
376634
|
}
|
|
376542
376635
|
var IMPORT_LIMITS, GEMINI_PREFIXES, ImportParseError;
|
|
@@ -377032,6 +377125,226 @@ var init_MemoryReview = __esm(() => {
|
|
|
377032
377125
|
jsx_runtime274 = __toESM(require_jsx_runtime(), 1);
|
|
377033
377126
|
});
|
|
377034
377127
|
|
|
377128
|
+
// services/import/detect/types.ts
|
|
377129
|
+
var LIMITES_POR_DEFECTO;
|
|
377130
|
+
var init_types12 = __esm(() => {
|
|
377131
|
+
LIMITES_POR_DEFECTO = {
|
|
377132
|
+
maxSesiones: 20,
|
|
377133
|
+
maxMensajes: 40,
|
|
377134
|
+
maxCharsPorMensaje: 2000,
|
|
377135
|
+
maxBytesPorSesion: 2000000
|
|
377136
|
+
};
|
|
377137
|
+
});
|
|
377138
|
+
|
|
377139
|
+
// services/import/detect/sources/claudeCode.ts
|
|
377140
|
+
import { createHash as createHash30 } from "crypto";
|
|
377141
|
+
import { open as open14, readdir as readdir29, stat as stat43 } from "fs/promises";
|
|
377142
|
+
import { join as join133 } from "path";
|
|
377143
|
+
function slugDeProyecto(rutaAbsoluta) {
|
|
377144
|
+
const normalizada = rutaAbsoluta.normalize("NFC");
|
|
377145
|
+
const plano = normalizada.replace(/[^a-zA-Z0-9]/g, "-");
|
|
377146
|
+
if (plano.length <= MAX_SLUG)
|
|
377147
|
+
return plano;
|
|
377148
|
+
const hash = createHash30("sha256").update(normalizada).digest("hex").slice(0, 8);
|
|
377149
|
+
return `${plano.slice(0, MAX_SLUG)}-${hash}`;
|
|
377150
|
+
}
|
|
377151
|
+
function directorioConfig(entorno) {
|
|
377152
|
+
const override = entorno.env.CLAUDE_CONFIG_DIR?.trim();
|
|
377153
|
+
return override && override.length > 0 ? override : join133(entorno.home, ".claude");
|
|
377154
|
+
}
|
|
377155
|
+
function textoDeContenido(contenido, maxChars) {
|
|
377156
|
+
if (typeof contenido === "string")
|
|
377157
|
+
return contenido.slice(0, maxChars);
|
|
377158
|
+
if (!Array.isArray(contenido))
|
|
377159
|
+
return "";
|
|
377160
|
+
const partes = [];
|
|
377161
|
+
for (const bloque of contenido) {
|
|
377162
|
+
if (!bloque || typeof bloque !== "object")
|
|
377163
|
+
continue;
|
|
377164
|
+
const b = bloque;
|
|
377165
|
+
if (b.type === "text" && typeof b.text === "string")
|
|
377166
|
+
partes.push(b.text);
|
|
377167
|
+
}
|
|
377168
|
+
return partes.join(`
|
|
377169
|
+
`).slice(0, maxChars);
|
|
377170
|
+
}
|
|
377171
|
+
var MAX_SLUG = 200, detectorClaudeCode;
|
|
377172
|
+
var init_claudeCode = __esm(() => {
|
|
377173
|
+
detectorClaudeCode = {
|
|
377174
|
+
herramienta: "claude-code",
|
|
377175
|
+
async explorar(entorno) {
|
|
377176
|
+
const ruta = join133(directorioConfig(entorno), "projects", slugDeProyecto(entorno.proyecto));
|
|
377177
|
+
let entradas;
|
|
377178
|
+
try {
|
|
377179
|
+
entradas = await readdir29(ruta);
|
|
377180
|
+
} catch {
|
|
377181
|
+
return null;
|
|
377182
|
+
}
|
|
377183
|
+
const sesiones = entradas.filter((n2) => n2.endsWith(".jsonl"));
|
|
377184
|
+
if (sesiones.length === 0)
|
|
377185
|
+
return null;
|
|
377186
|
+
let bytes = 0;
|
|
377187
|
+
let masReciente = 0;
|
|
377188
|
+
for (const nombre of sesiones) {
|
|
377189
|
+
try {
|
|
377190
|
+
const info = await stat43(join133(ruta, nombre));
|
|
377191
|
+
bytes += info.size;
|
|
377192
|
+
if (info.mtimeMs > masReciente)
|
|
377193
|
+
masReciente = info.mtimeMs;
|
|
377194
|
+
} catch {}
|
|
377195
|
+
}
|
|
377196
|
+
return {
|
|
377197
|
+
herramienta: "claude-code",
|
|
377198
|
+
etiqueta: "Tu agente de c\xF3digo anterior",
|
|
377199
|
+
ruta,
|
|
377200
|
+
sesiones: sesiones.length,
|
|
377201
|
+
masReciente,
|
|
377202
|
+
bytes
|
|
377203
|
+
};
|
|
377204
|
+
},
|
|
377205
|
+
async leer(fuente, limites) {
|
|
377206
|
+
let entradas;
|
|
377207
|
+
try {
|
|
377208
|
+
entradas = await readdir29(fuente.ruta);
|
|
377209
|
+
} catch {
|
|
377210
|
+
return [];
|
|
377211
|
+
}
|
|
377212
|
+
const ficheros = [];
|
|
377213
|
+
for (const nombre of entradas) {
|
|
377214
|
+
if (!nombre.endsWith(".jsonl"))
|
|
377215
|
+
continue;
|
|
377216
|
+
try {
|
|
377217
|
+
const info = await stat43(join133(fuente.ruta, nombre));
|
|
377218
|
+
ficheros.push({ nombre, mtime: info.mtimeMs });
|
|
377219
|
+
} catch {}
|
|
377220
|
+
}
|
|
377221
|
+
ficheros.sort((a2, b) => b.mtime - a2.mtime);
|
|
377222
|
+
const salida = [];
|
|
377223
|
+
for (const { nombre, mtime } of ficheros.slice(0, limites.maxSesiones)) {
|
|
377224
|
+
let crudo;
|
|
377225
|
+
try {
|
|
377226
|
+
const fh = await open14(join133(fuente.ruta, nombre), "r");
|
|
377227
|
+
try {
|
|
377228
|
+
const buf = Buffer.alloc(limites.maxBytesPorSesion);
|
|
377229
|
+
const { bytesRead } = await fh.read(buf, 0, buf.length, 0);
|
|
377230
|
+
crudo = buf.subarray(0, bytesRead).toString("utf8");
|
|
377231
|
+
} finally {
|
|
377232
|
+
await fh.close();
|
|
377233
|
+
}
|
|
377234
|
+
} catch {
|
|
377235
|
+
continue;
|
|
377236
|
+
}
|
|
377237
|
+
const mensajes = [];
|
|
377238
|
+
for (const linea of crudo.split(`
|
|
377239
|
+
`)) {
|
|
377240
|
+
if (!linea.trim())
|
|
377241
|
+
continue;
|
|
377242
|
+
let parsed;
|
|
377243
|
+
try {
|
|
377244
|
+
parsed = JSON.parse(linea);
|
|
377245
|
+
} catch {
|
|
377246
|
+
continue;
|
|
377247
|
+
}
|
|
377248
|
+
if (parsed.type !== "user" && parsed.type !== "assistant")
|
|
377249
|
+
continue;
|
|
377250
|
+
const role = parsed.message?.role;
|
|
377251
|
+
if (role !== "user" && role !== "assistant")
|
|
377252
|
+
continue;
|
|
377253
|
+
const text = textoDeContenido(parsed.message?.content, limites.maxCharsPorMensaje);
|
|
377254
|
+
if (!text.trim())
|
|
377255
|
+
continue;
|
|
377256
|
+
mensajes.push({ role, text });
|
|
377257
|
+
if (mensajes.length >= limites.maxMensajes)
|
|
377258
|
+
break;
|
|
377259
|
+
}
|
|
377260
|
+
if (mensajes.length > 0) {
|
|
377261
|
+
salida.push({
|
|
377262
|
+
titulo: `Sesi\xF3n ${nombre.replace(/\.jsonl$/, "").slice(0, 8)}`,
|
|
377263
|
+
creadaEn: mtime,
|
|
377264
|
+
mensajes
|
|
377265
|
+
});
|
|
377266
|
+
}
|
|
377267
|
+
}
|
|
377268
|
+
return salida;
|
|
377269
|
+
}
|
|
377270
|
+
};
|
|
377271
|
+
});
|
|
377272
|
+
|
|
377273
|
+
// services/import/detect/registry.ts
|
|
377274
|
+
import { homedir as homedir35 } from "os";
|
|
377275
|
+
import { realpathSync as realpathSync4 } from "fs";
|
|
377276
|
+
function entornoActual(cwd2) {
|
|
377277
|
+
let proyecto = cwd2;
|
|
377278
|
+
try {
|
|
377279
|
+
proyecto = realpathSync4(cwd2);
|
|
377280
|
+
} catch {}
|
|
377281
|
+
return { proyecto, home: homedir35(), env: process.env };
|
|
377282
|
+
}
|
|
377283
|
+
async function explorarFuentes(entorno) {
|
|
377284
|
+
const resultados = await Promise.all(DETECTORES.map(async (d) => {
|
|
377285
|
+
try {
|
|
377286
|
+
return await d.explorar(entorno);
|
|
377287
|
+
} catch {
|
|
377288
|
+
return null;
|
|
377289
|
+
}
|
|
377290
|
+
}));
|
|
377291
|
+
return resultados.filter((f) => f !== null).sort((a2, b) => b.masReciente - a2.masReciente);
|
|
377292
|
+
}
|
|
377293
|
+
async function leerFuentes(fuentes, limites = LIMITES_POR_DEFECTO) {
|
|
377294
|
+
const conversaciones = [];
|
|
377295
|
+
for (const fuente of fuentes) {
|
|
377296
|
+
const detector = DETECTORES.find((d) => d.herramienta === fuente.herramienta);
|
|
377297
|
+
if (!detector)
|
|
377298
|
+
continue;
|
|
377299
|
+
let leidas = [];
|
|
377300
|
+
try {
|
|
377301
|
+
leidas = await detector.leer(fuente, limites);
|
|
377302
|
+
} catch {
|
|
377303
|
+
continue;
|
|
377304
|
+
}
|
|
377305
|
+
for (const c5 of leidas) {
|
|
377306
|
+
conversaciones.push({
|
|
377307
|
+
title: c5.titulo,
|
|
377308
|
+
messages: c5.mensajes.map((m) => ({ role: m.role, text: m.text })),
|
|
377309
|
+
...c5.creadaEn !== undefined ? { createdAt: c5.creadaEn } : {}
|
|
377310
|
+
});
|
|
377311
|
+
}
|
|
377312
|
+
}
|
|
377313
|
+
return {
|
|
377314
|
+
source: "agente-local",
|
|
377315
|
+
conversations: conversaciones,
|
|
377316
|
+
totalConversations: conversaciones.length
|
|
377317
|
+
};
|
|
377318
|
+
}
|
|
377319
|
+
function describirFuente(fuente) {
|
|
377320
|
+
const sesiones = fuente.sesiones === 1 ? "1 sesi\xF3n" : `${fuente.sesiones} sesiones`;
|
|
377321
|
+
const cuando = fechaRelativa(fuente.masReciente);
|
|
377322
|
+
return `${sesiones} de este proyecto \xB7 la \xFAltima, ${cuando}`;
|
|
377323
|
+
}
|
|
377324
|
+
function fechaRelativa(epochMs, ahora = Date.now()) {
|
|
377325
|
+
if (!epochMs)
|
|
377326
|
+
return "fecha desconocida";
|
|
377327
|
+
const dias = Math.floor((ahora - epochMs) / 86400000);
|
|
377328
|
+
if (dias <= 0)
|
|
377329
|
+
return "hoy";
|
|
377330
|
+
if (dias === 1)
|
|
377331
|
+
return "ayer";
|
|
377332
|
+
if (dias < 30)
|
|
377333
|
+
return `hace ${dias} d\xEDas`;
|
|
377334
|
+
const meses = Math.floor(dias / 30);
|
|
377335
|
+
if (meses === 1)
|
|
377336
|
+
return "hace un mes";
|
|
377337
|
+
if (meses < 12)
|
|
377338
|
+
return `hace ${meses} meses`;
|
|
377339
|
+
return "hace m\xE1s de un a\xF1o";
|
|
377340
|
+
}
|
|
377341
|
+
var DETECTORES;
|
|
377342
|
+
var init_registry4 = __esm(() => {
|
|
377343
|
+
init_types12();
|
|
377344
|
+
init_claudeCode();
|
|
377345
|
+
DETECTORES = [detectorClaudeCode];
|
|
377346
|
+
});
|
|
377347
|
+
|
|
377035
377348
|
// commands/import/import.tsx
|
|
377036
377349
|
var exports_import = {};
|
|
377037
377350
|
__export(exports_import, {
|
|
@@ -377039,14 +377352,14 @@ __export(exports_import, {
|
|
|
377039
377352
|
ImportContext: () => ImportContext
|
|
377040
377353
|
});
|
|
377041
377354
|
import { readFile as readFile48 } from "fs/promises";
|
|
377042
|
-
import { homedir as
|
|
377355
|
+
import { homedir as homedir36 } from "os";
|
|
377043
377356
|
import { resolve as resolve42 } from "path";
|
|
377044
377357
|
function resolvePath3(raw) {
|
|
377045
377358
|
let p = raw.trim().replace(/^['"]|['"]$/g, "");
|
|
377046
377359
|
if (p === "~")
|
|
377047
|
-
p =
|
|
377360
|
+
p = homedir36();
|
|
377048
377361
|
else if (p.startsWith("~/"))
|
|
377049
|
-
p = resolve42(
|
|
377362
|
+
p = resolve42(homedir36(), p.slice(2));
|
|
377050
377363
|
return resolve42(p);
|
|
377051
377364
|
}
|
|
377052
377365
|
function useSpinnerFrame(active2) {
|
|
@@ -377079,8 +377392,54 @@ function ImportContext({
|
|
|
377079
377392
|
const [statusLine, setStatusLine] = React95.useState("Leyendo el export\u2026");
|
|
377080
377393
|
const [error40, setError] = React95.useState("");
|
|
377081
377394
|
const [savedCount, setSavedCount] = React95.useState(0);
|
|
377395
|
+
const [fuentes, setFuentes] = React95.useState([]);
|
|
377082
377396
|
const pathRef = React95.useRef(initialPath);
|
|
377083
377397
|
const spinner = useSpinnerFrame(step === "working" || step === "saving");
|
|
377398
|
+
React95.useEffect(() => {
|
|
377399
|
+
if (initialPath)
|
|
377400
|
+
return;
|
|
377401
|
+
let vivo = true;
|
|
377402
|
+
explorarFuentes(entornoActual(getCwd())).then((encontradas) => {
|
|
377403
|
+
if (!vivo || encontradas.length === 0)
|
|
377404
|
+
return;
|
|
377405
|
+
setFuentes(encontradas);
|
|
377406
|
+
setStep((prev) => prev === "source" ? "manifiesto" : prev);
|
|
377407
|
+
}).catch(() => {});
|
|
377408
|
+
return () => {
|
|
377409
|
+
vivo = false;
|
|
377410
|
+
};
|
|
377411
|
+
}, [initialPath]);
|
|
377412
|
+
const importarDetectado = React95.useCallback(async (aceptadas) => {
|
|
377413
|
+
const signal = context3.abortController.signal;
|
|
377414
|
+
try {
|
|
377415
|
+
setStep("working");
|
|
377416
|
+
setSource("agente-local");
|
|
377417
|
+
setStatusLine("Leyendo el contexto de este proyecto\u2026");
|
|
377418
|
+
const parsedExport = await leerFuentes(aceptadas);
|
|
377419
|
+
setParsed(parsedExport);
|
|
377420
|
+
const blocks = buildImportBlocks(parsedExport);
|
|
377421
|
+
if (blocks.length === 0) {
|
|
377422
|
+
setError("El historial encontrado no ten\xEDa conversaciones con contenido.");
|
|
377423
|
+
setStep("error");
|
|
377424
|
+
return;
|
|
377425
|
+
}
|
|
377426
|
+
setStatusLine(`Destilando hechos de ${parsedExport.totalConversations} sesiones\u2026`);
|
|
377427
|
+
const distilled = await distillFacts(blocks, {
|
|
377428
|
+
source: parsedExport.source,
|
|
377429
|
+
signal,
|
|
377430
|
+
onProgress: (p) => setProgress(p)
|
|
377431
|
+
});
|
|
377432
|
+
if (signal.aborted) {
|
|
377433
|
+
onDone("Importaci\xF3n cancelada", { display: "system" });
|
|
377434
|
+
return;
|
|
377435
|
+
}
|
|
377436
|
+
setFacts(distilled.map((f) => ({ ...f, kept: true })));
|
|
377437
|
+
setStep("review");
|
|
377438
|
+
} catch (err2) {
|
|
377439
|
+
setError(err2.message || "No pude leer el contexto detectado.");
|
|
377440
|
+
setStep("error");
|
|
377441
|
+
}
|
|
377442
|
+
}, [context3.abortController, onDone]);
|
|
377084
377443
|
const runImport = React95.useCallback(async (filePath, hintSource) => {
|
|
377085
377444
|
const signal = context3.abortController.signal;
|
|
377086
377445
|
try {
|
|
@@ -377134,6 +377493,81 @@ function ImportContext({
|
|
|
377134
377493
|
runImport(pathRef.current, source);
|
|
377135
377494
|
}
|
|
377136
377495
|
}, []);
|
|
377496
|
+
if (step === "manifiesto") {
|
|
377497
|
+
const destino = resolverDestinoDestilado();
|
|
377498
|
+
const total = fuentes.reduce((n2, f) => n2 + f.sesiones, 0);
|
|
377499
|
+
return /* @__PURE__ */ jsx_runtime275.jsxs(ThemedBox_default, {
|
|
377500
|
+
flexDirection: "column",
|
|
377501
|
+
gap: 1,
|
|
377502
|
+
children: [
|
|
377503
|
+
/* @__PURE__ */ jsx_runtime275.jsx(ThemedText, {
|
|
377504
|
+
bold: true,
|
|
377505
|
+
color: purple,
|
|
377506
|
+
children: "Encontr\xE9 contexto tuyo de este proyecto"
|
|
377507
|
+
}),
|
|
377508
|
+
/* @__PURE__ */ jsx_runtime275.jsx(ThemedBox_default, {
|
|
377509
|
+
flexDirection: "column",
|
|
377510
|
+
children: fuentes.map((f) => /* @__PURE__ */ jsx_runtime275.jsxs(ThemedText, {
|
|
377511
|
+
children: [
|
|
377512
|
+
/* @__PURE__ */ jsx_runtime275.jsx(ThemedText, {
|
|
377513
|
+
color: badge,
|
|
377514
|
+
children: "\u2022"
|
|
377515
|
+
}),
|
|
377516
|
+
" ",
|
|
377517
|
+
/* @__PURE__ */ jsx_runtime275.jsx(ThemedText, {
|
|
377518
|
+
bold: true,
|
|
377519
|
+
children: f.etiqueta
|
|
377520
|
+
}),
|
|
377521
|
+
" ",
|
|
377522
|
+
/* @__PURE__ */ jsx_runtime275.jsxs(ThemedText, {
|
|
377523
|
+
color: gray2,
|
|
377524
|
+
children: [
|
|
377525
|
+
"\u2014 ",
|
|
377526
|
+
describirFuente(f)
|
|
377527
|
+
]
|
|
377528
|
+
})
|
|
377529
|
+
]
|
|
377530
|
+
}, f.herramienta))
|
|
377531
|
+
}),
|
|
377532
|
+
/* @__PURE__ */ jsx_runtime275.jsxs(ThemedText, {
|
|
377533
|
+
color: gray2,
|
|
377534
|
+
children: [
|
|
377535
|
+
"Todav\xEDa no he abierto ning\xFAn mensaje: solo he mirado cu\xE1ntas sesiones hay y de cu\xE1ndo. Si aceptas, leo esas ",
|
|
377536
|
+
total === 1 ? "sesi\xF3n" : `${total} sesiones`,
|
|
377537
|
+
" y extraigo los hechos duraderos (en qu\xE9 trabajas, qu\xE9 decidiste, tus preferencias) para que Theus no empiece de cero."
|
|
377538
|
+
]
|
|
377539
|
+
}),
|
|
377540
|
+
/* @__PURE__ */ jsx_runtime275.jsx(ThemedText, {
|
|
377541
|
+
color: destino.tipo === "local" ? ok : badge,
|
|
377542
|
+
children: avisoDestino(destino)
|
|
377543
|
+
}),
|
|
377544
|
+
/* @__PURE__ */ jsx_runtime275.jsx(Select, {
|
|
377545
|
+
options: [
|
|
377546
|
+
{
|
|
377547
|
+
label: "S\xED, trae ese contexto",
|
|
377548
|
+
value: "si",
|
|
377549
|
+
description: "Leer las sesiones y extraer los hechos"
|
|
377550
|
+
},
|
|
377551
|
+
{
|
|
377552
|
+
label: "No, prefiero subir un export",
|
|
377553
|
+
value: "manual",
|
|
377554
|
+
description: "Elegir a mano un archivo de otra IA"
|
|
377555
|
+
},
|
|
377556
|
+
{ label: "Ahora no", value: "no" }
|
|
377557
|
+
],
|
|
377558
|
+
layout: "expanded",
|
|
377559
|
+
onChange: (value) => {
|
|
377560
|
+
if (value === "si")
|
|
377561
|
+
importarDetectado(fuentes);
|
|
377562
|
+
else if (value === "manual")
|
|
377563
|
+
setStep("source");
|
|
377564
|
+
else
|
|
377565
|
+
onDone("Importaci\xF3n omitida", { display: "system" });
|
|
377566
|
+
}
|
|
377567
|
+
})
|
|
377568
|
+
]
|
|
377569
|
+
});
|
|
377570
|
+
}
|
|
377137
377571
|
if (step === "source") {
|
|
377138
377572
|
const options2 = [
|
|
377139
377573
|
{ label: "ChatGPT", value: "chatgpt", description: SOURCE_HINT.chatgpt },
|
|
@@ -377151,7 +377585,7 @@ function ImportContext({
|
|
|
377151
377585
|
}),
|
|
377152
377586
|
/* @__PURE__ */ jsx_runtime275.jsx(ThemedText, {
|
|
377153
377587
|
color: gray2,
|
|
377154
|
-
children: "
|
|
377588
|
+
children: "Trae el contexto de otra IA y Theus arrancar\xE1 conoci\xE9ndote. El archivo se lee de forma ef\xEDmera: no se copia ni se guarda."
|
|
377155
377589
|
}),
|
|
377156
377590
|
/* @__PURE__ */ jsx_runtime275.jsx(Select, {
|
|
377157
377591
|
options: options2,
|
|
@@ -377251,7 +377685,7 @@ function ImportContext({
|
|
|
377251
377685
|
}),
|
|
377252
377686
|
/* @__PURE__ */ jsx_runtime275.jsx(ThemedText, {
|
|
377253
377687
|
color: gray2,
|
|
377254
|
-
children:
|
|
377688
|
+
children: avisoDestino(resolverDestinoDestilado())
|
|
377255
377689
|
})
|
|
377256
377690
|
]
|
|
377257
377691
|
});
|
|
@@ -377316,8 +377750,10 @@ function ImportContext({
|
|
|
377316
377750
|
}
|
|
377317
377751
|
if (step === "done") {
|
|
377318
377752
|
const label = source ? sourceLabel(source) : "otra IA";
|
|
377753
|
+
const cerrar2 = () => onDone(`${savedCount} ${savedCount === 1 ? "hecho importado" : "hechos importados"} de ${label}`, { display: "system" });
|
|
377319
377754
|
return /* @__PURE__ */ jsx_runtime275.jsxs(ThemedBox_default, {
|
|
377320
377755
|
flexDirection: "column",
|
|
377756
|
+
gap: 1,
|
|
377321
377757
|
children: [
|
|
377322
377758
|
/* @__PURE__ */ jsx_runtime275.jsxs(ThemedText, {
|
|
377323
377759
|
children: [
|
|
@@ -377342,7 +377778,12 @@ function ImportContext({
|
|
|
377342
377778
|
}),
|
|
377343
377779
|
/* @__PURE__ */ jsx_runtime275.jsx(ThemedText, {
|
|
377344
377780
|
color: gray2,
|
|
377345
|
-
children: "
|
|
377781
|
+
children: "Theus los usar\xE1 en este proyecto desde tu pr\xF3xima pregunta."
|
|
377782
|
+
}),
|
|
377783
|
+
/* @__PURE__ */ jsx_runtime275.jsx(Select, {
|
|
377784
|
+
options: [{ label: "Continuar", value: "ok" }],
|
|
377785
|
+
onChange: cerrar2,
|
|
377786
|
+
onCancel: cerrar2
|
|
377346
377787
|
})
|
|
377347
377788
|
]
|
|
377348
377789
|
});
|
|
@@ -377404,6 +377845,7 @@ async function call42(onDone, context3, args) {
|
|
|
377404
377845
|
}
|
|
377405
377846
|
var React95, jsx_runtime275, SOURCE_HINT, SPINNER3;
|
|
377406
377847
|
var init_import = __esm(() => {
|
|
377848
|
+
init_destino();
|
|
377407
377849
|
init_ink2();
|
|
377408
377850
|
init_theme();
|
|
377409
377851
|
init_select();
|
|
@@ -377411,12 +377853,15 @@ var init_import = __esm(() => {
|
|
|
377411
377853
|
init_distill();
|
|
377412
377854
|
init_persist();
|
|
377413
377855
|
init_MemoryReview();
|
|
377856
|
+
init_registry4();
|
|
377857
|
+
init_cwd2();
|
|
377414
377858
|
React95 = __toESM(require_react(), 1);
|
|
377415
377859
|
jsx_runtime275 = __toESM(require_jsx_runtime(), 1);
|
|
377416
377860
|
SOURCE_HINT = {
|
|
377417
377861
|
chatgpt: "conversations.json (.zip) \xB7 Ajustes \u2192 Exportar datos",
|
|
377418
377862
|
claude: "conversations.json (.zip) \xB7 Ajustes \u2192 Exportar datos",
|
|
377419
|
-
gemini: "Takeout \u2192 MyActivity.json (soporte parcial)"
|
|
377863
|
+
gemini: "Takeout \u2192 MyActivity.json (soporte parcial)",
|
|
377864
|
+
"agente-local": "detectado en esta carpeta, sin exportar nada"
|
|
377420
377865
|
};
|
|
377421
377866
|
SPINNER3 = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
|
|
377422
377867
|
});
|
|
@@ -377569,7 +378014,7 @@ __export(exports_types, {
|
|
|
377569
378014
|
BRIDGE_LOGIN_ERROR: () => BRIDGE_LOGIN_ERROR
|
|
377570
378015
|
});
|
|
377571
378016
|
var DEFAULT_SESSION_TIMEOUT_MS, BRIDGE_LOGIN_INSTRUCTION = "Remote Control is only available with theus.pe subscriptions. Please use `/login` to sign in with your theus.pe account.", BRIDGE_LOGIN_ERROR, REMOTE_CONTROL_DISCONNECTED_MSG = "Remote Control disconnected.";
|
|
377572
|
-
var
|
|
378017
|
+
var init_types13 = __esm(() => {
|
|
377573
378018
|
DEFAULT_SESSION_TIMEOUT_MS = 24 * 60 * 60 * 1000;
|
|
377574
378019
|
BRIDGE_LOGIN_ERROR = `Error: You must be logged in to use Remote Control.
|
|
377575
378020
|
|
|
@@ -378103,7 +378548,7 @@ var ULTRAPLAN_TIMEOUT_MS, CCR_TERMS_URL2 = "https://docs.theus.pe/docs/en/theus-
|
|
|
378103
378548
|
return null;
|
|
378104
378549
|
}, ultraplan_default;
|
|
378105
378550
|
var init_ultraplan = __esm(() => {
|
|
378106
|
-
|
|
378551
|
+
init_types13();
|
|
378107
378552
|
init_figures2();
|
|
378108
378553
|
init_growthbook2();
|
|
378109
378554
|
init_analytics();
|
|
@@ -384811,7 +385256,7 @@ __export(exports_thinkback, {
|
|
|
384811
385256
|
call: () => call51
|
|
384812
385257
|
});
|
|
384813
385258
|
import { readFile as readFile50 } from "fs/promises";
|
|
384814
|
-
import { join as
|
|
385259
|
+
import { join as join134 } from "path";
|
|
384815
385260
|
function getMarketplaceName() {
|
|
384816
385261
|
return OFFICIAL_MARKETPLACE_NAME;
|
|
384817
385262
|
}
|
|
@@ -384829,15 +385274,15 @@ async function getThinkbackSkillDir() {
|
|
|
384829
385274
|
if (!thinkbackPlugin) {
|
|
384830
385275
|
return null;
|
|
384831
385276
|
}
|
|
384832
|
-
const skillDir =
|
|
385277
|
+
const skillDir = join134(thinkbackPlugin.path, "skills", SKILL_NAME);
|
|
384833
385278
|
if (await pathExists(skillDir)) {
|
|
384834
385279
|
return skillDir;
|
|
384835
385280
|
}
|
|
384836
385281
|
return null;
|
|
384837
385282
|
}
|
|
384838
385283
|
async function playAnimation(skillDir) {
|
|
384839
|
-
const dataPath =
|
|
384840
|
-
const playerPath =
|
|
385284
|
+
const dataPath = join134(skillDir, "year_in_review.js");
|
|
385285
|
+
const playerPath = join134(skillDir, "player.js");
|
|
384841
385286
|
try {
|
|
384842
385287
|
await readFile50(dataPath);
|
|
384843
385288
|
} catch (e) {
|
|
@@ -384885,7 +385330,7 @@ async function playAnimation(skillDir) {
|
|
|
384885
385330
|
} catch {} finally {
|
|
384886
385331
|
inkInstance.exitAlternateScreen();
|
|
384887
385332
|
}
|
|
384888
|
-
const htmlPath =
|
|
385333
|
+
const htmlPath = join134(skillDir, "year_in_review.html");
|
|
384889
385334
|
if (await pathExists(htmlPath)) {
|
|
384890
385335
|
const platform6 = getPlatform();
|
|
384891
385336
|
const openCmd = platform6 === "macos" ? "open" : platform6 === "windows" ? "start" : "xdg-open";
|
|
@@ -385221,7 +385666,7 @@ function ThinkbackFlow(t0) {
|
|
|
385221
385666
|
if (!skillDir) {
|
|
385222
385667
|
return;
|
|
385223
385668
|
}
|
|
385224
|
-
const dataPath =
|
|
385669
|
+
const dataPath = join134(skillDir, "year_in_review.js");
|
|
385225
385670
|
pathExists(dataPath).then((exists) => {
|
|
385226
385671
|
logForDebugging(`Checking for ${dataPath}: ${exists ? "found" : "not found"}`);
|
|
385227
385672
|
setHasGenerated(exists);
|
|
@@ -385395,7 +385840,7 @@ var exports_thinkback_play = {};
|
|
|
385395
385840
|
__export(exports_thinkback_play, {
|
|
385396
385841
|
call: () => call52
|
|
385397
385842
|
});
|
|
385398
|
-
import { join as
|
|
385843
|
+
import { join as join135 } from "path";
|
|
385399
385844
|
function getPluginId2() {
|
|
385400
385845
|
const marketplaceName = OFFICIAL_MARKETPLACE_NAME;
|
|
385401
385846
|
return `thinkback@${marketplaceName}`;
|
|
@@ -385417,7 +385862,7 @@ async function call52() {
|
|
|
385417
385862
|
value: "Thinkback plugin installation path not found."
|
|
385418
385863
|
};
|
|
385419
385864
|
}
|
|
385420
|
-
const skillDir =
|
|
385865
|
+
const skillDir = join135(firstInstall.installPath, "skills", SKILL_NAME2);
|
|
385421
385866
|
const result = await playAnimation(skillDir);
|
|
385422
385867
|
return { type: "text", value: result.message };
|
|
385423
385868
|
}
|
|
@@ -391911,7 +392356,7 @@ var init_agentDisplay = __esm(() => {
|
|
|
391911
392356
|
|
|
391912
392357
|
// components/agents/types.ts
|
|
391913
392358
|
var AGENT_PATHS;
|
|
391914
|
-
var
|
|
392359
|
+
var init_types14 = __esm(() => {
|
|
391915
392360
|
AGENT_PATHS = {
|
|
391916
392361
|
FOLDER_NAME: ".theus",
|
|
391917
392362
|
AGENTS_DIR: "agents"
|
|
@@ -391919,8 +392364,8 @@ var init_types13 = __esm(() => {
|
|
|
391919
392364
|
});
|
|
391920
392365
|
|
|
391921
392366
|
// components/agents/agentFileUtils.ts
|
|
391922
|
-
import { mkdir as mkdir43, open as
|
|
391923
|
-
import { join as
|
|
392367
|
+
import { mkdir as mkdir43, open as open15, unlink as unlink20 } from "fs/promises";
|
|
392368
|
+
import { join as join136 } from "path";
|
|
391924
392369
|
function formatAgentAsMarkdown(agentType, whenToUse, tools, systemPrompt, color3, model, memory2, effort) {
|
|
391925
392370
|
const escapedWhenToUse = whenToUse.replace(/\\/g, "\\\\").replace(/"/g, "\\\"").replace(/\n/g, "\\\\n");
|
|
391926
392371
|
const isAllTools = tools === undefined || tools.length === 1 && tools[0] === "*";
|
|
@@ -391947,26 +392392,26 @@ function getAgentDirectoryPath(location) {
|
|
|
391947
392392
|
case "flagSettings":
|
|
391948
392393
|
throw new Error(`Cannot get directory path for ${location} agents`);
|
|
391949
392394
|
case "userSettings":
|
|
391950
|
-
return
|
|
392395
|
+
return join136(getTheusConfigHomeDir(), AGENT_PATHS.AGENTS_DIR);
|
|
391951
392396
|
case "projectSettings":
|
|
391952
|
-
return
|
|
392397
|
+
return join136(getCwd(), AGENT_PATHS.FOLDER_NAME, AGENT_PATHS.AGENTS_DIR);
|
|
391953
392398
|
case "policySettings":
|
|
391954
|
-
return
|
|
392399
|
+
return join136(getManagedFilePath(), AGENT_PATHS.FOLDER_NAME, AGENT_PATHS.AGENTS_DIR);
|
|
391955
392400
|
case "localSettings":
|
|
391956
|
-
return
|
|
392401
|
+
return join136(getCwd(), AGENT_PATHS.FOLDER_NAME, AGENT_PATHS.AGENTS_DIR);
|
|
391957
392402
|
}
|
|
391958
392403
|
}
|
|
391959
392404
|
function getRelativeAgentDirectoryPath(location) {
|
|
391960
392405
|
switch (location) {
|
|
391961
392406
|
case "projectSettings":
|
|
391962
|
-
return
|
|
392407
|
+
return join136(".", AGENT_PATHS.FOLDER_NAME, AGENT_PATHS.AGENTS_DIR);
|
|
391963
392408
|
default:
|
|
391964
392409
|
return getAgentDirectoryPath(location);
|
|
391965
392410
|
}
|
|
391966
392411
|
}
|
|
391967
392412
|
function getNewAgentFilePath(agent) {
|
|
391968
392413
|
const dirPath = getAgentDirectoryPath(agent.source);
|
|
391969
|
-
return
|
|
392414
|
+
return join136(dirPath, `${agent.agentType}.md`);
|
|
391970
392415
|
}
|
|
391971
392416
|
function getActualAgentFilePath(agent) {
|
|
391972
392417
|
if (agent.source === "built-in") {
|
|
@@ -391977,14 +392422,14 @@ function getActualAgentFilePath(agent) {
|
|
|
391977
392422
|
}
|
|
391978
392423
|
const dirPath = getAgentDirectoryPath(agent.source);
|
|
391979
392424
|
const filename = agent.filename || agent.agentType;
|
|
391980
|
-
return
|
|
392425
|
+
return join136(dirPath, `${filename}.md`);
|
|
391981
392426
|
}
|
|
391982
392427
|
function getNewRelativeAgentFilePath(agent) {
|
|
391983
392428
|
if (agent.source === "built-in") {
|
|
391984
392429
|
return "Built-in";
|
|
391985
392430
|
}
|
|
391986
392431
|
const dirPath = getRelativeAgentDirectoryPath(agent.source);
|
|
391987
|
-
return
|
|
392432
|
+
return join136(dirPath, `${agent.agentType}.md`);
|
|
391988
392433
|
}
|
|
391989
392434
|
function getActualRelativeAgentFilePath(agent) {
|
|
391990
392435
|
if (isBuiltInAgent(agent)) {
|
|
@@ -391998,7 +392443,7 @@ function getActualRelativeAgentFilePath(agent) {
|
|
|
391998
392443
|
}
|
|
391999
392444
|
const dirPath = getRelativeAgentDirectoryPath(agent.source);
|
|
392000
392445
|
const filename = agent.filename || agent.agentType;
|
|
392001
|
-
return
|
|
392446
|
+
return join136(dirPath, `${filename}.md`);
|
|
392002
392447
|
}
|
|
392003
392448
|
async function ensureAgentDirectoryExists(source) {
|
|
392004
392449
|
const dirPath = getAgentDirectoryPath(source);
|
|
@@ -392044,7 +392489,7 @@ async function deleteAgentFromFile(agent) {
|
|
|
392044
392489
|
}
|
|
392045
392490
|
}
|
|
392046
392491
|
async function writeFileAndFlush(filePath, content, flag = "w") {
|
|
392047
|
-
const handle2 = await
|
|
392492
|
+
const handle2 = await open15(filePath, flag);
|
|
392048
392493
|
try {
|
|
392049
392494
|
await handle2.writeFile(content, { encoding: "utf-8" });
|
|
392050
392495
|
await handle2.datasync();
|
|
@@ -392058,7 +392503,7 @@ var init_agentFileUtils = __esm(() => {
|
|
|
392058
392503
|
init_cwd2();
|
|
392059
392504
|
init_envUtils();
|
|
392060
392505
|
init_errors();
|
|
392061
|
-
|
|
392506
|
+
init_types14();
|
|
392062
392507
|
});
|
|
392063
392508
|
|
|
392064
392509
|
// components/agents/AgentDetail.tsx
|
|
@@ -397797,7 +398242,7 @@ var init_plugin2 = __esm(() => {
|
|
|
397797
398242
|
|
|
397798
398243
|
// services/settingsSync/types.ts
|
|
397799
398244
|
var UserSyncContentSchema, UserSyncDataSchema;
|
|
397800
|
-
var
|
|
398245
|
+
var init_types15 = __esm(() => {
|
|
397801
398246
|
init_v4();
|
|
397802
398247
|
UserSyncContentSchema = lazySchema(() => exports_external.object({
|
|
397803
398248
|
entries: exports_external.record(exports_external.string(), exports_external.string())
|
|
@@ -397829,7 +398274,7 @@ var init_settingsSync = __esm(() => {
|
|
|
397829
398274
|
init_growthbook2();
|
|
397830
398275
|
init_analytics();
|
|
397831
398276
|
init_withRetry();
|
|
397832
|
-
|
|
398277
|
+
init_types15();
|
|
397833
398278
|
MAX_FILE_SIZE_BYTES3 = 500 * 1024;
|
|
397834
398279
|
});
|
|
397835
398280
|
|
|
@@ -398010,8 +398455,8 @@ var init_rewind = __esm(() => {
|
|
|
398010
398455
|
|
|
398011
398456
|
// utils/heapDumpService.ts
|
|
398012
398457
|
import { createWriteStream as createWriteStream3, writeFileSync as writeFileSync7 } from "fs";
|
|
398013
|
-
import { readdir as
|
|
398014
|
-
import { join as
|
|
398458
|
+
import { readdir as readdir30, readFile as readFile52, writeFile as writeFile47 } from "fs/promises";
|
|
398459
|
+
import { join as join137 } from "path";
|
|
398015
398460
|
import { pipeline as pipeline2 } from "stream/promises";
|
|
398016
398461
|
import {
|
|
398017
398462
|
getHeapSnapshot,
|
|
@@ -398031,7 +398476,7 @@ async function captureMemoryDiagnostics(trigger, dumpNumber = 0) {
|
|
|
398031
398476
|
const activeRequests = process._getActiveRequests().length;
|
|
398032
398477
|
let openFileDescriptors;
|
|
398033
398478
|
try {
|
|
398034
|
-
openFileDescriptors = (await
|
|
398479
|
+
openFileDescriptors = (await readdir30("/proc/self/fd")).length;
|
|
398035
398480
|
} catch {}
|
|
398036
398481
|
let smapsRollup;
|
|
398037
398482
|
try {
|
|
@@ -398101,7 +398546,7 @@ async function captureMemoryDiagnostics(trigger, dumpNumber = 0) {
|
|
|
398101
398546
|
smapsRollup,
|
|
398102
398547
|
platform: process.platform,
|
|
398103
398548
|
nodeVersion: process.version,
|
|
398104
|
-
ccVersion: { VERSION: "0.2.
|
|
398549
|
+
ccVersion: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
398105
398550
|
};
|
|
398106
398551
|
}
|
|
398107
398552
|
async function performHeapDump(trigger = "manual", dumpNumber = 0) {
|
|
@@ -398119,8 +398564,8 @@ async function performHeapDump(trigger = "manual", dumpNumber = 0) {
|
|
|
398119
398564
|
const suffix = dumpNumber > 0 ? `-dump${dumpNumber}` : "";
|
|
398120
398565
|
const heapFilename = `${sessionId}${suffix}.heapsnapshot`;
|
|
398121
398566
|
const diagFilename = `${sessionId}${suffix}-diagnostics.json`;
|
|
398122
|
-
const heapPath =
|
|
398123
|
-
const diagPath =
|
|
398567
|
+
const heapPath = join137(dumpDir, heapFilename);
|
|
398568
|
+
const diagPath = join137(dumpDir, diagFilename);
|
|
398124
398569
|
await writeFile47(diagPath, jsonStringify(diagnostics, null, 2), {
|
|
398125
398570
|
mode: 384
|
|
398126
398571
|
});
|
|
@@ -398686,7 +399131,7 @@ var BETA_HEADER = "environments-2025-11-01", SAFE_ID_PATTERN, BridgeFatalError;
|
|
|
398686
399131
|
var init_bridgeApi = __esm(() => {
|
|
398687
399132
|
init_axios2();
|
|
398688
399133
|
init_debugUtils();
|
|
398689
|
-
|
|
399134
|
+
init_types13();
|
|
398690
399135
|
SAFE_ID_PATTERN = /^[a-zA-Z0-9_-]+$/;
|
|
398691
399136
|
BridgeFatalError = class BridgeFatalError extends Error {
|
|
398692
399137
|
status;
|
|
@@ -398862,7 +399307,7 @@ var init_bridge_kick = __esm(() => {
|
|
|
398862
399307
|
var call68 = async () => {
|
|
398863
399308
|
return {
|
|
398864
399309
|
type: "text",
|
|
398865
|
-
value: { VERSION: "0.2.
|
|
399310
|
+
value: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.BUILD_TIME ? `${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} (built ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.BUILD_TIME})` : { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
398866
399311
|
};
|
|
398867
399312
|
}, version2, version_default;
|
|
398868
399313
|
var init_version = __esm(() => {
|
|
@@ -401302,8 +401747,8 @@ var init_advisor2 = __esm(() => {
|
|
|
401302
401747
|
|
|
401303
401748
|
// skills/bundledSkills.ts
|
|
401304
401749
|
import { constants as fsConstants5 } from "fs";
|
|
401305
|
-
import { mkdir as mkdir44, open as
|
|
401306
|
-
import { dirname as dirname57, isAbsolute as isAbsolute28, join as
|
|
401750
|
+
import { mkdir as mkdir44, open as open16 } from "fs/promises";
|
|
401751
|
+
import { dirname as dirname57, isAbsolute as isAbsolute28, join as join138, normalize as normalize13, sep as pathSep2 } from "path";
|
|
401307
401752
|
function registerBundledSkill(definition) {
|
|
401308
401753
|
const { files: files2 } = definition;
|
|
401309
401754
|
let skillRoot;
|
|
@@ -401351,7 +401796,7 @@ function getBundledSkills() {
|
|
|
401351
401796
|
return [...bundledSkills];
|
|
401352
401797
|
}
|
|
401353
401798
|
function getBundledSkillExtractDir(skillName) {
|
|
401354
|
-
return
|
|
401799
|
+
return join138(getBundledSkillsRoot(), skillName);
|
|
401355
401800
|
}
|
|
401356
401801
|
async function extractBundledSkillFiles(skillName, files2) {
|
|
401357
401802
|
const dir = getBundledSkillExtractDir(skillName);
|
|
@@ -401381,7 +401826,7 @@ async function writeSkillFiles(dir, files2) {
|
|
|
401381
401826
|
}));
|
|
401382
401827
|
}
|
|
401383
401828
|
async function safeWriteFile(p, content) {
|
|
401384
|
-
const fh = await
|
|
401829
|
+
const fh = await open16(p, SAFE_WRITE_FLAGS, 384);
|
|
401385
401830
|
try {
|
|
401386
401831
|
await fh.writeFile(content, "utf8");
|
|
401387
401832
|
} finally {
|
|
@@ -401393,7 +401838,7 @@ function resolveSkillFilePath(baseDir, relPath) {
|
|
|
401393
401838
|
if (isAbsolute28(normalized) || normalized.split(pathSep2).includes("..") || normalized.split("/").includes("..")) {
|
|
401394
401839
|
throw new Error(`bundled skill file path escapes skill dir: ${relPath}`);
|
|
401395
401840
|
}
|
|
401396
|
-
return
|
|
401841
|
+
return join138(baseDir, normalized);
|
|
401397
401842
|
}
|
|
401398
401843
|
function prependBaseDir(blocks, baseDir) {
|
|
401399
401844
|
const prefix = `Base directory for this skill: ${baseDir}
|
|
@@ -401463,7 +401908,7 @@ var SECRET_NAME_PATTERN, EXTRA_ENV_ALLOWLIST, REDACTED2 = "\u2039oculto\u203A",
|
|
|
401463
401908
|
const lines = [];
|
|
401464
401909
|
lines.push("## Entorno de ejecuci\xF3n");
|
|
401465
401910
|
lines.push("");
|
|
401466
|
-
const version3 = { VERSION: "0.2.
|
|
401911
|
+
const version3 = { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION ? { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION : "desconocida";
|
|
401467
401912
|
lines.push(`- Versi\xF3n de Theus: ${version3}`);
|
|
401468
401913
|
lines.push(`- Directorio de trabajo: ${getCwd()}`);
|
|
401469
401914
|
lines.push(`- \xBFRepositorio git?: ${isGit ? "s\xED" : "no"}`);
|
|
@@ -401904,7 +402349,7 @@ var init_exit2 = __esm(() => {
|
|
|
401904
402349
|
});
|
|
401905
402350
|
|
|
401906
402351
|
// components/ExportDialog.tsx
|
|
401907
|
-
import { join as
|
|
402352
|
+
import { join as join139 } from "path";
|
|
401908
402353
|
function ExportDialog({
|
|
401909
402354
|
content,
|
|
401910
402355
|
defaultFilename,
|
|
@@ -401937,7 +402382,7 @@ function ExportDialog({
|
|
|
401937
402382
|
};
|
|
401938
402383
|
const handleFilenameSubmit = () => {
|
|
401939
402384
|
const finalFilename = filename.endsWith(".txt") ? filename : filename.replace(/\.[^.]+$/, "") + ".txt";
|
|
401940
|
-
const filepath =
|
|
402385
|
+
const filepath = join139(getCwd(), finalFilename);
|
|
401941
402386
|
try {
|
|
401942
402387
|
writeFileSync_DEPRECATED(filepath, content, {
|
|
401943
402388
|
encoding: "utf-8",
|
|
@@ -402160,7 +402605,7 @@ __export(exports_export, {
|
|
|
402160
402605
|
extractFirstPrompt: () => extractFirstPrompt,
|
|
402161
402606
|
call: () => call80
|
|
402162
402607
|
});
|
|
402163
|
-
import { join as
|
|
402608
|
+
import { join as join140 } from "path";
|
|
402164
402609
|
function formatTimestamp(date6) {
|
|
402165
402610
|
const year = date6.getFullYear();
|
|
402166
402611
|
const month = String(date6.getMonth() + 1).padStart(2, "0");
|
|
@@ -402204,7 +402649,7 @@ async function call80(onDone, context3, args) {
|
|
|
402204
402649
|
const filename = args.trim();
|
|
402205
402650
|
if (filename) {
|
|
402206
402651
|
const finalFilename = filename.endsWith(".txt") ? filename : filename.replace(/\.[^.]+$/, "") + ".txt";
|
|
402207
|
-
const filepath =
|
|
402652
|
+
const filepath = join140(getCwd(), finalFilename);
|
|
402208
402653
|
try {
|
|
402209
402654
|
writeFileSync_DEPRECATED(filepath, content, {
|
|
402210
402655
|
encoding: "utf-8",
|
|
@@ -402257,13 +402702,13 @@ var init_export2 = __esm(() => {
|
|
|
402257
402702
|
});
|
|
402258
402703
|
|
|
402259
402704
|
// services/providers/sessionCatalog.ts
|
|
402260
|
-
import { existsSync as
|
|
402705
|
+
import { existsSync as existsSync20, readFileSync as readFileSync27 } from "fs";
|
|
402261
402706
|
function loadConfig2() {
|
|
402262
402707
|
const path17 = defaultProvidersConfigPath();
|
|
402263
|
-
if (!
|
|
402708
|
+
if (!existsSync20(path17))
|
|
402264
402709
|
return null;
|
|
402265
402710
|
try {
|
|
402266
|
-
const parsed = JSON.parse(
|
|
402711
|
+
const parsed = JSON.parse(readFileSync27(path17, "utf8"));
|
|
402267
402712
|
if (!parsed || !Array.isArray(parsed.providers))
|
|
402268
402713
|
return null;
|
|
402269
402714
|
return parsed;
|
|
@@ -403823,18 +404268,18 @@ __export(exports_update, {
|
|
|
403823
404268
|
rescatarNaupaBorrado: () => rescatarNaupaBorrado
|
|
403824
404269
|
});
|
|
403825
404270
|
import { spawn as spawn8, spawnSync as spawnSync9 } from "child_process";
|
|
403826
|
-
import { createHash as
|
|
404271
|
+
import { createHash as createHash31 } from "crypto";
|
|
403827
404272
|
import {
|
|
403828
404273
|
cpSync,
|
|
403829
|
-
existsSync as
|
|
404274
|
+
existsSync as existsSync21,
|
|
403830
404275
|
mkdtempSync,
|
|
403831
|
-
readFileSync as
|
|
403832
|
-
realpathSync as
|
|
404276
|
+
readFileSync as readFileSync28,
|
|
404277
|
+
realpathSync as realpathSync5,
|
|
403833
404278
|
rmSync as rmSync4,
|
|
403834
404279
|
writeFileSync as writeFileSync8
|
|
403835
404280
|
} from "fs";
|
|
403836
404281
|
import { tmpdir as tmpdir10 } from "os";
|
|
403837
|
-
import { dirname as dirname58, join as
|
|
404282
|
+
import { dirname as dirname58, join as join141 } from "path";
|
|
403838
404283
|
function naupaVersionOf(bin) {
|
|
403839
404284
|
try {
|
|
403840
404285
|
const out = spawnSync9(bin, ["--version"], {
|
|
@@ -403849,13 +404294,13 @@ function naupaVersionOf(bin) {
|
|
|
403849
404294
|
}
|
|
403850
404295
|
function rescatarNaupaBorrado(binEnUso) {
|
|
403851
404296
|
try {
|
|
403852
|
-
if (
|
|
404297
|
+
if (existsSync21(binEnUso))
|
|
403853
404298
|
return;
|
|
403854
404299
|
const apartado = `${binEnUso}.old`;
|
|
403855
|
-
if (!
|
|
404300
|
+
if (!existsSync21(apartado))
|
|
403856
404301
|
return;
|
|
403857
404302
|
cpSync(apartado, binEnUso, { force: true });
|
|
403858
|
-
if (!
|
|
404303
|
+
if (!existsSync21(binEnUso))
|
|
403859
404304
|
return;
|
|
403860
404305
|
writeToStdout(source_default.yellow("\xD1aupa: la actualizaci\xF3n se interrumpi\xF3 y dej\xF3 el motor sin binario. " + "Restaur\xE9 la versi\xF3n anterior desde la copia de seguridad, as\xED que " + "sigue funcionando. Vuelve a intentar \xABtheus update\xBB m\xE1s tarde.") + `
|
|
403861
404306
|
`);
|
|
@@ -403870,11 +404315,11 @@ function rescatarNaupaMalUbicado(binEnUso, options2 = {}) {
|
|
|
403870
404315
|
const platform6 = options2.platform ?? process.platform;
|
|
403871
404316
|
const versionOf = options2.versionOf ?? naupaVersionOf;
|
|
403872
404317
|
const nombre = platform6 === "win32" ? "naupa.exe" : "naupa";
|
|
403873
|
-
const rutaFija =
|
|
403874
|
-
if (!
|
|
404318
|
+
const rutaFija = join141(home, ".local", "bin", nombre);
|
|
404319
|
+
if (!existsSync21(rutaFija))
|
|
403875
404320
|
return;
|
|
403876
404321
|
try {
|
|
403877
|
-
if (
|
|
404322
|
+
if (realpathSync5(rutaFija) === realpathSync5(binEnUso))
|
|
403878
404323
|
return;
|
|
403879
404324
|
} catch {}
|
|
403880
404325
|
const vUso = versionOf(binEnUso);
|
|
@@ -403955,18 +404400,18 @@ function isReleaseBundleInstall() {
|
|
|
403955
404400
|
const entry = process.argv[1];
|
|
403956
404401
|
if (!entry)
|
|
403957
404402
|
return false;
|
|
403958
|
-
const real =
|
|
404403
|
+
const real = realpathSync5(entry);
|
|
403959
404404
|
if (!real.endsWith("cli.js"))
|
|
403960
404405
|
return false;
|
|
403961
404406
|
if (real.includes("node_modules"))
|
|
403962
404407
|
return false;
|
|
403963
|
-
return
|
|
404408
|
+
return existsSync21(join141(dirname58(real), "bin", "theus"));
|
|
403964
404409
|
} catch {
|
|
403965
404410
|
return false;
|
|
403966
404411
|
}
|
|
403967
404412
|
}
|
|
403968
404413
|
function sha256File(path17) {
|
|
403969
|
-
return
|
|
404414
|
+
return createHash31("sha256").update(readFileSync28(path17)).digest("hex");
|
|
403970
404415
|
}
|
|
403971
404416
|
async function fetchReleaseChannelVersion() {
|
|
403972
404417
|
try {
|
|
@@ -403994,7 +404439,7 @@ async function downloadToFile(url3, dest) {
|
|
|
403994
404439
|
}
|
|
403995
404440
|
}
|
|
403996
404441
|
async function updateReleaseBundle() {
|
|
403997
|
-
const bundleDir = dirname58(
|
|
404442
|
+
const bundleDir = dirname58(realpathSync5(process.argv[1]));
|
|
403998
404443
|
const latest = await fetchReleaseChannelVersion();
|
|
403999
404444
|
if (!latest) {
|
|
404000
404445
|
process.stderr.write(source_default.red(`No pude comprobar la \xFAltima versi\xF3n en theus.pe/dl.
|
|
@@ -404004,27 +404449,27 @@ async function updateReleaseBundle() {
|
|
|
404004
404449
|
await gracefulShutdown(1);
|
|
404005
404450
|
return;
|
|
404006
404451
|
}
|
|
404007
|
-
if (gte({ VERSION: "0.2.
|
|
404008
|
-
writeToStdout(source_default.green(`Theus ya est\xE1 al d\xEDa (${{ VERSION: "0.2.
|
|
404452
|
+
if (gte({ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, latest)) {
|
|
404453
|
+
writeToStdout(source_default.green(`Theus ya est\xE1 al d\xEDa (${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})`) + `
|
|
404009
404454
|
`);
|
|
404010
404455
|
await gracefulShutdown(0);
|
|
404011
404456
|
return;
|
|
404012
404457
|
}
|
|
404013
|
-
writeToStdout(`Nueva versi\xF3n disponible: ${latest} (actual: ${{ VERSION: "0.2.
|
|
404458
|
+
writeToStdout(`Nueva versi\xF3n disponible: ${latest} (actual: ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})
|
|
404014
404459
|
`);
|
|
404015
404460
|
writeToStdout(`Instalando la actualizaci\xF3n desde theus.pe/dl...
|
|
404016
404461
|
`);
|
|
404017
|
-
const tmp = mkdtempSync(
|
|
404462
|
+
const tmp = mkdtempSync(join141(tmpdir10(), "theus-update-"));
|
|
404018
404463
|
try {
|
|
404019
|
-
const tarPath =
|
|
404020
|
-
const sumsPath =
|
|
404464
|
+
const tarPath = join141(tmp, "theus-cli.tar.gz");
|
|
404465
|
+
const sumsPath = join141(tmp, "SHA256SUMS");
|
|
404021
404466
|
if (!await downloadToFile(`${DL_BASE}/theus-cli.tar.gz`, tarPath) || !await downloadToFile(`${DL_BASE}/SHA256SUMS`, sumsPath)) {
|
|
404022
404467
|
process.stderr.write(source_default.red(`Fall\xF3 la descarga del release desde theus.pe/dl.
|
|
404023
404468
|
`));
|
|
404024
404469
|
await gracefulShutdown(1);
|
|
404025
404470
|
return;
|
|
404026
404471
|
}
|
|
404027
|
-
const expected =
|
|
404472
|
+
const expected = readFileSync28(sumsPath, "utf8").split(`
|
|
404028
404473
|
`).map((line) => line.trim().split(/\s+/)).find((parts) => parts[1] === "theus-cli.tar.gz" || parts[1] === "*theus-cli.tar.gz")?.[0];
|
|
404029
404474
|
const actual = sha256File(tarPath);
|
|
404030
404475
|
if (!expected || expected !== actual) {
|
|
@@ -404036,15 +404481,15 @@ async function updateReleaseBundle() {
|
|
|
404036
404481
|
const ex = spawnSync9("tar", ["-xzf", tarPath, "-C", tmp], {
|
|
404037
404482
|
stdio: "ignore"
|
|
404038
404483
|
});
|
|
404039
|
-
const staged =
|
|
404040
|
-
if (ex.status !== 0 || !
|
|
404484
|
+
const staged = join141(tmp, "theus-cli");
|
|
404485
|
+
if (ex.status !== 0 || !existsSync21(join141(staged, "cli.js"))) {
|
|
404041
404486
|
process.stderr.write(source_default.red(`No pude extraer el release descargado (o vino incompleto).
|
|
404042
404487
|
`));
|
|
404043
404488
|
await gracefulShutdown(1);
|
|
404044
404489
|
return;
|
|
404045
404490
|
}
|
|
404046
404491
|
cpSync(staged, bundleDir, { recursive: true, force: true });
|
|
404047
|
-
writeToStdout(source_default.green(`Actualizado correctamente de ${{ VERSION: "0.2.
|
|
404492
|
+
writeToStdout(source_default.green(`Actualizado correctamente de ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} a la versi\xF3n ${latest}`) + `
|
|
404048
404493
|
`);
|
|
404049
404494
|
await regenerateCompletionCache();
|
|
404050
404495
|
} finally {
|
|
@@ -404057,7 +404502,7 @@ async function updateReleaseBundle() {
|
|
|
404057
404502
|
async function update() {
|
|
404058
404503
|
logEvent("theus_update_check", {});
|
|
404059
404504
|
await updateNaupa();
|
|
404060
|
-
writeToStdout(`Versi\xF3n actual: ${{ VERSION: "0.2.
|
|
404505
|
+
writeToStdout(`Versi\xF3n actual: ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}
|
|
404061
404506
|
`);
|
|
404062
404507
|
const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
|
|
404063
404508
|
writeToStdout(`Buscando actualizaciones en el canal ${channel2}...
|
|
@@ -404136,8 +404581,8 @@ async function update() {
|
|
|
404136
404581
|
writeToStdout(`Theus est\xE1 gestionado por Homebrew.
|
|
404137
404582
|
`);
|
|
404138
404583
|
const latest = await getLatestVersion(channel2);
|
|
404139
|
-
if (latest && !gte({ VERSION: "0.2.
|
|
404140
|
-
writeToStdout(`Actualizaci\xF3n disponible: ${{ VERSION: "0.2.
|
|
404584
|
+
if (latest && !gte({ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, latest)) {
|
|
404585
|
+
writeToStdout(`Actualizaci\xF3n disponible: ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} \u2192 ${latest}
|
|
404141
404586
|
`);
|
|
404142
404587
|
writeToStdout(`
|
|
404143
404588
|
`);
|
|
@@ -404153,8 +404598,8 @@ async function update() {
|
|
|
404153
404598
|
writeToStdout(`Theus est\xE1 gestionado por winget.
|
|
404154
404599
|
`);
|
|
404155
404600
|
const latest = await getLatestVersion(channel2);
|
|
404156
|
-
if (latest && !gte({ VERSION: "0.2.
|
|
404157
|
-
writeToStdout(`Actualizaci\xF3n disponible: ${{ VERSION: "0.2.
|
|
404601
|
+
if (latest && !gte({ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, latest)) {
|
|
404602
|
+
writeToStdout(`Actualizaci\xF3n disponible: ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} \u2192 ${latest}
|
|
404158
404603
|
`);
|
|
404159
404604
|
writeToStdout(`
|
|
404160
404605
|
`);
|
|
@@ -404170,8 +404615,8 @@ async function update() {
|
|
|
404170
404615
|
writeToStdout(`Theus est\xE1 gestionado por apk.
|
|
404171
404616
|
`);
|
|
404172
404617
|
const latest = await getLatestVersion(channel2);
|
|
404173
|
-
if (latest && !gte({ VERSION: "0.2.
|
|
404174
|
-
writeToStdout(`Actualizaci\xF3n disponible: ${{ VERSION: "0.2.
|
|
404618
|
+
if (latest && !gte({ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, latest)) {
|
|
404619
|
+
writeToStdout(`Actualizaci\xF3n disponible: ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} \u2192 ${latest}
|
|
404175
404620
|
`);
|
|
404176
404621
|
writeToStdout(`
|
|
404177
404622
|
`);
|
|
@@ -404236,11 +404681,11 @@ async function update() {
|
|
|
404236
404681
|
`);
|
|
404237
404682
|
await gracefulShutdown(1);
|
|
404238
404683
|
}
|
|
404239
|
-
if (result.latestVersion === { VERSION: "0.2.
|
|
404240
|
-
writeToStdout(source_default.green(`Theus ya est\xE1 al d\xEDa (${{ VERSION: "0.2.
|
|
404684
|
+
if (result.latestVersion === { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION) {
|
|
404685
|
+
writeToStdout(source_default.green(`Theus ya est\xE1 al d\xEDa (${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})`) + `
|
|
404241
404686
|
`);
|
|
404242
404687
|
} else {
|
|
404243
|
-
writeToStdout(source_default.green(`Actualizado correctamente de ${{ VERSION: "0.2.
|
|
404688
|
+
writeToStdout(source_default.green(`Actualizado correctamente de ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} a la versi\xF3n ${result.latestVersion}`) + `
|
|
404244
404689
|
`);
|
|
404245
404690
|
await regenerateCompletionCache();
|
|
404246
404691
|
}
|
|
@@ -404259,9 +404704,9 @@ async function update() {
|
|
|
404259
404704
|
await removeInstalledSymlink();
|
|
404260
404705
|
}
|
|
404261
404706
|
logForDebugging("update: Checking npm registry for latest version");
|
|
404262
|
-
logForDebugging(`update: Package URL: ${{ VERSION: "0.2.
|
|
404707
|
+
logForDebugging(`update: Package URL: ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}`);
|
|
404263
404708
|
const npmTag = channel2 === "stable" ? "stable" : "latest";
|
|
404264
|
-
const npmCommand = `npm view ${{ VERSION: "0.2.
|
|
404709
|
+
const npmCommand = `npm view ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}@${npmTag} version`;
|
|
404265
404710
|
logForDebugging(`update: Running: ${npmCommand}`);
|
|
404266
404711
|
const latestVersion = await getLatestVersion(channel2);
|
|
404267
404712
|
logForDebugging(`update: Latest version from npm: ${latestVersion || "FAILED"}`);
|
|
@@ -404281,7 +404726,7 @@ async function update() {
|
|
|
404281
404726
|
`);
|
|
404282
404727
|
process.stderr.write(` \u2022 Un proxy o firewall corporativo bloquea npm
|
|
404283
404728
|
`);
|
|
404284
|
-
if ({ VERSION: "0.2.
|
|
404729
|
+
if ({ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL && !{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL.startsWith("@theus")) {
|
|
404285
404730
|
process.stderr.write(` \u2022 Compilaci\xF3n interna/de desarrollo no publicada en npm
|
|
404286
404731
|
`);
|
|
404287
404732
|
}
|
|
@@ -404293,19 +404738,19 @@ async function update() {
|
|
|
404293
404738
|
`);
|
|
404294
404739
|
process.stderr.write(` \u2022 Ejecuta con el flag --debug para m\xE1s detalle
|
|
404295
404740
|
`);
|
|
404296
|
-
const packageName = { VERSION: "0.2.
|
|
404741
|
+
const packageName = { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL || "@theus-ai/theus-code";
|
|
404297
404742
|
process.stderr.write(` \u2022 Comprueba a mano: npm view ${packageName} version
|
|
404298
404743
|
`);
|
|
404299
404744
|
process.stderr.write(` \u2022 Comprueba si te falta iniciar sesi\xF3n: npm whoami
|
|
404300
404745
|
`);
|
|
404301
404746
|
await gracefulShutdown(1);
|
|
404302
404747
|
}
|
|
404303
|
-
if (gte({ VERSION: "0.2.
|
|
404304
|
-
writeToStdout(source_default.green(`Theus ya est\xE1 al d\xEDa (${{ VERSION: "0.2.
|
|
404748
|
+
if (gte({ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, latestVersion)) {
|
|
404749
|
+
writeToStdout(source_default.green(`Theus ya est\xE1 al d\xEDa (${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})`) + `
|
|
404305
404750
|
`);
|
|
404306
404751
|
await gracefulShutdown(0);
|
|
404307
404752
|
}
|
|
404308
|
-
writeToStdout(`Nueva versi\xF3n disponible: ${latestVersion} (actual: ${{ VERSION: "0.2.
|
|
404753
|
+
writeToStdout(`Nueva versi\xF3n disponible: ${latestVersion} (actual: ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})
|
|
404309
404754
|
`);
|
|
404310
404755
|
writeToStdout(`Instalando la actualizaci\xF3n...
|
|
404311
404756
|
`);
|
|
@@ -404350,7 +404795,7 @@ async function update() {
|
|
|
404350
404795
|
logForDebugging(`update: Installation status: ${status2}`);
|
|
404351
404796
|
switch (status2) {
|
|
404352
404797
|
case "success":
|
|
404353
|
-
writeToStdout(source_default.green(`Actualizado correctamente de ${{ VERSION: "0.2.
|
|
404798
|
+
writeToStdout(source_default.green(`Actualizado correctamente de ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} a la versi\xF3n ${latestVersion}`) + `
|
|
404354
404799
|
`);
|
|
404355
404800
|
await regenerateCompletionCache();
|
|
404356
404801
|
break;
|
|
@@ -404360,7 +404805,7 @@ async function update() {
|
|
|
404360
404805
|
if (useLocalUpdate) {
|
|
404361
404806
|
process.stderr.write(`Prueba a actualizar a mano con:
|
|
404362
404807
|
`);
|
|
404363
|
-
process.stderr.write(` cd ~/.theus/local && npm update ${{ VERSION: "0.2.
|
|
404808
|
+
process.stderr.write(` cd ~/.theus/local && npm update ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}
|
|
404364
404809
|
`);
|
|
404365
404810
|
} else {
|
|
404366
404811
|
process.stderr.write(`Prueba con sudo o corrige los permisos de npm
|
|
@@ -404376,7 +404821,7 @@ async function update() {
|
|
|
404376
404821
|
if (useLocalUpdate) {
|
|
404377
404822
|
process.stderr.write(`Prueba a actualizar a mano con:
|
|
404378
404823
|
`);
|
|
404379
|
-
process.stderr.write(` cd ~/.theus/local && npm update ${{ VERSION: "0.2.
|
|
404824
|
+
process.stderr.write(` cd ~/.theus/local && npm update ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}
|
|
404380
404825
|
`);
|
|
404381
404826
|
} else {
|
|
404382
404827
|
process.stderr.write(`O p\xE1sate a la instalaci\xF3n nativa con: theus install
|
|
@@ -404844,8 +405289,8 @@ var init_effort3 = __esm(() => {
|
|
|
404844
405289
|
|
|
404845
405290
|
// utils/statsCache.ts
|
|
404846
405291
|
import { randomBytes as randomBytes20 } from "crypto";
|
|
404847
|
-
import { open as
|
|
404848
|
-
import { join as
|
|
405292
|
+
import { open as open17 } from "fs/promises";
|
|
405293
|
+
import { join as join142 } from "path";
|
|
404849
405294
|
async function withStatsCacheLock(fn) {
|
|
404850
405295
|
while (statsCacheLockPromise) {
|
|
404851
405296
|
await statsCacheLockPromise;
|
|
@@ -404862,7 +405307,7 @@ async function withStatsCacheLock(fn) {
|
|
|
404862
405307
|
}
|
|
404863
405308
|
}
|
|
404864
405309
|
function getStatsCachePath() {
|
|
404865
|
-
return
|
|
405310
|
+
return join142(getTheusConfigHomeDir(), STATS_CACHE_FILENAME);
|
|
404866
405311
|
}
|
|
404867
405312
|
function getEmptyCache() {
|
|
404868
405313
|
return {
|
|
@@ -404940,7 +405385,7 @@ async function saveStatsCache(cache4) {
|
|
|
404940
405385
|
await fs5.mkdir(configDir);
|
|
404941
405386
|
} catch {}
|
|
404942
405387
|
const content = jsonStringify(cache4, null, 2);
|
|
404943
|
-
const handle2 = await
|
|
405388
|
+
const handle2 = await open17(tempPath, "w", 384);
|
|
404944
405389
|
try {
|
|
404945
405390
|
await handle2.writeFile(content, { encoding: "utf-8" });
|
|
404946
405391
|
await handle2.sync();
|
|
@@ -405532,12 +405977,12 @@ var init_ansiToPng = __esm(() => {
|
|
|
405532
405977
|
// utils/screenshotClipboard.ts
|
|
405533
405978
|
import { mkdir as mkdir45, unlink as unlink21, writeFile as writeFile48 } from "fs/promises";
|
|
405534
405979
|
import { tmpdir as tmpdir11 } from "os";
|
|
405535
|
-
import { join as
|
|
405980
|
+
import { join as join143 } from "path";
|
|
405536
405981
|
async function copyAnsiToClipboard(ansiText, options2) {
|
|
405537
405982
|
try {
|
|
405538
|
-
const tempDir =
|
|
405983
|
+
const tempDir = join143(tmpdir11(), "theus-code-screenshots");
|
|
405539
405984
|
await mkdir45(tempDir, { recursive: true });
|
|
405540
|
-
const pngPath =
|
|
405985
|
+
const pngPath = join143(tempDir, `screenshot-${Date.now()}.png`);
|
|
405541
405986
|
const pngBuffer = ansiToPng(ansiText, options2);
|
|
405542
405987
|
await writeFile48(pngPath, pngBuffer);
|
|
405543
405988
|
const result = await copyPngToClipboard(pngPath);
|
|
@@ -405607,8 +406052,8 @@ var init_screenshotClipboard = __esm(() => {
|
|
|
405607
406052
|
});
|
|
405608
406053
|
|
|
405609
406054
|
// utils/stats.ts
|
|
405610
|
-
import { open as
|
|
405611
|
-
import { basename as basename45, join as
|
|
406055
|
+
import { open as open18 } from "fs/promises";
|
|
406056
|
+
import { basename as basename45, join as join144, sep as sep29 } from "path";
|
|
405612
406057
|
async function processSessionFiles(sessionFiles, options2 = {}) {
|
|
405613
406058
|
const { fromDate, toDate } = options2;
|
|
405614
406059
|
const fs5 = getFsImplementation();
|
|
@@ -405786,17 +406231,17 @@ async function getAllSessionFiles() {
|
|
|
405786
406231
|
return [];
|
|
405787
406232
|
throw e;
|
|
405788
406233
|
}
|
|
405789
|
-
const projectDirs = allEntries.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
406234
|
+
const projectDirs = allEntries.filter((dirent) => dirent.isDirectory()).map((dirent) => join144(projectsDir, dirent.name));
|
|
405790
406235
|
const projectResults = await Promise.all(projectDirs.map(async (projectDir) => {
|
|
405791
406236
|
try {
|
|
405792
406237
|
const entries = await fs5.readdir(projectDir);
|
|
405793
|
-
const mainFiles = entries.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".jsonl")).map((dirent) =>
|
|
406238
|
+
const mainFiles = entries.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".jsonl")).map((dirent) => join144(projectDir, dirent.name));
|
|
405794
406239
|
const sessionDirs = entries.filter((dirent) => dirent.isDirectory());
|
|
405795
406240
|
const subagentResults = await Promise.all(sessionDirs.map(async (sessionDir) => {
|
|
405796
|
-
const subagentsDir =
|
|
406241
|
+
const subagentsDir = join144(projectDir, sessionDir.name, "subagents");
|
|
405797
406242
|
try {
|
|
405798
406243
|
const subagentEntries = await fs5.readdir(subagentsDir);
|
|
405799
|
-
return subagentEntries.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".jsonl") && dirent.name.startsWith("agent-")).map((dirent) =>
|
|
406244
|
+
return subagentEntries.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".jsonl") && dirent.name.startsWith("agent-")).map((dirent) => join144(subagentsDir, dirent.name));
|
|
405800
406245
|
} catch {
|
|
405801
406246
|
return [];
|
|
405802
406247
|
}
|
|
@@ -406096,7 +406541,7 @@ function calculateStreaks(dailyActivity) {
|
|
|
406096
406541
|
}
|
|
406097
406542
|
async function readSessionStartDate(filePath) {
|
|
406098
406543
|
try {
|
|
406099
|
-
const fd2 = await
|
|
406544
|
+
const fd2 = await open18(filePath, "r");
|
|
406100
406545
|
try {
|
|
406101
406546
|
const buf = Buffer.allocUnsafe(4096);
|
|
406102
406547
|
const { bytesRead } = await fd2.read(buf, 0, buf.length, 0);
|
|
@@ -408550,8 +408995,8 @@ __export(exports_assistant, {
|
|
|
408550
408995
|
call: () => call93,
|
|
408551
408996
|
NewInstallWizard: () => NewInstallWizard
|
|
408552
408997
|
});
|
|
408553
|
-
import { existsSync as
|
|
408554
|
-
import { dirname as dirname60, join as
|
|
408998
|
+
import { existsSync as existsSync22, mkdirSync as mkdirSync10, readFileSync as readFileSync29, writeFileSync as writeFileSync9 } from "fs";
|
|
408999
|
+
import { dirname as dirname60, join as join145, resolve as resolve43 } from "path";
|
|
408555
409000
|
async function computeDefaultInstallDir() {
|
|
408556
409001
|
try {
|
|
408557
409002
|
return getOriginalCwd();
|
|
@@ -408561,9 +409006,9 @@ async function computeDefaultInstallDir() {
|
|
|
408561
409006
|
}
|
|
408562
409007
|
function readJsonSafe(path17) {
|
|
408563
409008
|
try {
|
|
408564
|
-
if (!
|
|
409009
|
+
if (!existsSync22(path17))
|
|
408565
409010
|
return {};
|
|
408566
|
-
const parsed = JSON.parse(
|
|
409011
|
+
const parsed = JSON.parse(readFileSync29(path17, "utf8"));
|
|
408567
409012
|
return parsed && typeof parsed === "object" ? parsed : {};
|
|
408568
409013
|
} catch {
|
|
408569
409014
|
return {};
|
|
@@ -408576,16 +409021,16 @@ function writeJson(path17, value) {
|
|
|
408576
409021
|
}
|
|
408577
409022
|
function installAssistant(dir) {
|
|
408578
409023
|
const root2 = resolve43(dir);
|
|
408579
|
-
const theusDir =
|
|
408580
|
-
const settingsPath =
|
|
409024
|
+
const theusDir = join145(root2, ".theus");
|
|
409025
|
+
const settingsPath = join145(theusDir, "settings.json");
|
|
408581
409026
|
const settings = readJsonSafe(settingsPath);
|
|
408582
409027
|
settings.assistant = true;
|
|
408583
409028
|
writeJson(settingsPath, settings);
|
|
408584
|
-
const localPath =
|
|
409029
|
+
const localPath = join145(theusDir, "settings.local.json");
|
|
408585
409030
|
const local = readJsonSafe(localPath);
|
|
408586
409031
|
local.defaultView = "chat";
|
|
408587
409032
|
writeJson(localPath, local);
|
|
408588
|
-
const agentPath =
|
|
409033
|
+
const agentPath = join145(theusDir, "agents", "assistant.md");
|
|
408589
409034
|
mkdirSync10(dirname60(agentPath), { recursive: true });
|
|
408590
409035
|
writeFileSync9(agentPath, ASSISTANT_AGENT_MD, "utf8");
|
|
408591
409036
|
return root2;
|
|
@@ -408759,8 +409204,8 @@ var exports_workflows = {};
|
|
|
408759
409204
|
__export(exports_workflows, {
|
|
408760
409205
|
default: () => workflows_default
|
|
408761
409206
|
});
|
|
408762
|
-
import { existsSync as
|
|
408763
|
-
import { homedir as
|
|
409207
|
+
import { existsSync as existsSync23, readdirSync as readdirSync3, statSync as statSync11 } from "fs";
|
|
409208
|
+
import { homedir as homedir37 } from "os";
|
|
408764
409209
|
import { basename as basename46, extname as extname16, resolve as resolve44 } from "path";
|
|
408765
409210
|
function safeCwd2() {
|
|
408766
409211
|
try {
|
|
@@ -408772,13 +409217,13 @@ function safeCwd2() {
|
|
|
408772
409217
|
function workflowDirs(cwd2) {
|
|
408773
409218
|
return [
|
|
408774
409219
|
resolve44(cwd2, ".theus", WORKFLOWS_DIR_NAME),
|
|
408775
|
-
resolve44(
|
|
409220
|
+
resolve44(homedir37(), ".theus", WORKFLOWS_DIR_NAME)
|
|
408776
409221
|
];
|
|
408777
409222
|
}
|
|
408778
409223
|
function scanDir(dir) {
|
|
408779
409224
|
const out = [];
|
|
408780
409225
|
try {
|
|
408781
|
-
if (!
|
|
409226
|
+
if (!existsSync23(dir))
|
|
408782
409227
|
return out;
|
|
408783
409228
|
for (const entry of readdirSync3(dir)) {
|
|
408784
409229
|
const ext = extname16(entry);
|
|
@@ -410248,11 +410693,11 @@ function BuddyPanel({
|
|
|
410248
410693
|
/* @__PURE__ */ jsx_runtime369.jsx(ThemedBox_default, {
|
|
410249
410694
|
flexDirection: "column",
|
|
410250
410695
|
marginTop: 1,
|
|
410251
|
-
children: STAT_NAMES.map((
|
|
410252
|
-
label: STAT_ES[
|
|
410253
|
-
value: companion.stats[
|
|
410696
|
+
children: STAT_NAMES.map((stat44) => /* @__PURE__ */ jsx_runtime369.jsx(StatRow, {
|
|
410697
|
+
label: STAT_ES[stat44],
|
|
410698
|
+
value: companion.stats[stat44],
|
|
410254
410699
|
color: color3
|
|
410255
|
-
},
|
|
410700
|
+
}, stat44))
|
|
410256
410701
|
}),
|
|
410257
410702
|
muted && /* @__PURE__ */ jsx_runtime369.jsx(ThemedBox_default, {
|
|
410258
410703
|
marginTop: 1,
|
|
@@ -410333,12 +410778,12 @@ __export(exports_createWorkflowCommand, {
|
|
|
410333
410778
|
getWorkflowCommands: () => getWorkflowCommands,
|
|
410334
410779
|
default: () => createWorkflowCommand_default
|
|
410335
410780
|
});
|
|
410336
|
-
import { existsSync as
|
|
410337
|
-
import { homedir as
|
|
410781
|
+
import { existsSync as existsSync24, readdirSync as readdirSync4, statSync as statSync12 } from "fs";
|
|
410782
|
+
import { homedir as homedir38 } from "os";
|
|
410338
410783
|
import { basename as basename47, extname as extname17, resolve as resolve45 } from "path";
|
|
410339
410784
|
function listWorkflowFiles(dir) {
|
|
410340
410785
|
try {
|
|
410341
|
-
if (!
|
|
410786
|
+
if (!existsSync24(dir))
|
|
410342
410787
|
return [];
|
|
410343
410788
|
const out = [];
|
|
410344
410789
|
for (const entry of readdirSync4(dir)) {
|
|
@@ -410400,7 +410845,7 @@ async function getWorkflowCommands(cwd2) {
|
|
|
410400
410845
|
const base2 = cwd2 || process.cwd();
|
|
410401
410846
|
const dirs = [
|
|
410402
410847
|
resolve45(base2, ".theus", WORKFLOWS_DIR_NAME),
|
|
410403
|
-
resolve45(
|
|
410848
|
+
resolve45(homedir38(), ".theus", WORKFLOWS_DIR_NAME)
|
|
410404
410849
|
];
|
|
410405
410850
|
const seen = new Set;
|
|
410406
410851
|
const commands = [];
|
|
@@ -410969,13 +411414,13 @@ import {
|
|
|
410969
411414
|
appendFile as fsAppendFile,
|
|
410970
411415
|
open as fsOpen2,
|
|
410971
411416
|
mkdir as mkdir46,
|
|
410972
|
-
readdir as
|
|
411417
|
+
readdir as readdir31,
|
|
410973
411418
|
readFile as readFile53,
|
|
410974
|
-
stat as
|
|
411419
|
+
stat as stat44,
|
|
410975
411420
|
unlink as unlink22,
|
|
410976
411421
|
writeFile as writeFile49
|
|
410977
411422
|
} from "fs/promises";
|
|
410978
|
-
import { basename as basename48, dirname as dirname61, join as
|
|
411423
|
+
import { basename as basename48, dirname as dirname61, join as join146 } from "path";
|
|
410979
411424
|
function isTranscriptMessage(entry) {
|
|
410980
411425
|
return entry.type === "user" || entry.type === "assistant" || entry.type === "attachment" || entry.type === "system";
|
|
410981
411426
|
}
|
|
@@ -410989,18 +411434,18 @@ function isEphemeralToolProgress(dataType) {
|
|
|
410989
411434
|
return typeof dataType === "string" && EPHEMERAL_PROGRESS_TYPES.has(dataType);
|
|
410990
411435
|
}
|
|
410991
411436
|
function getProjectsDir2() {
|
|
410992
|
-
return
|
|
411437
|
+
return join146(getTheusConfigHomeDir(), "projects");
|
|
410993
411438
|
}
|
|
410994
411439
|
function getTranscriptPath() {
|
|
410995
411440
|
const projectDir = getSessionProjectDir() ?? getProjectDir3(getOriginalCwd());
|
|
410996
|
-
return
|
|
411441
|
+
return join146(projectDir, `${getSessionId()}.jsonl`);
|
|
410997
411442
|
}
|
|
410998
411443
|
function getTranscriptPathForSession(sessionId) {
|
|
410999
411444
|
if (sessionId === getSessionId()) {
|
|
411000
411445
|
return getTranscriptPath();
|
|
411001
411446
|
}
|
|
411002
411447
|
const projectDir = getProjectDir3(getOriginalCwd());
|
|
411003
|
-
return
|
|
411448
|
+
return join146(projectDir, `${sessionId}.jsonl`);
|
|
411004
411449
|
}
|
|
411005
411450
|
function setAgentTranscriptSubdir(agentId, subdir) {
|
|
411006
411451
|
agentTranscriptSubdirs.set(agentId, subdir);
|
|
@@ -411012,8 +411457,8 @@ function getAgentTranscriptPath(agentId) {
|
|
|
411012
411457
|
const projectDir = getSessionProjectDir() ?? getProjectDir3(getOriginalCwd());
|
|
411013
411458
|
const sessionId = getSessionId();
|
|
411014
411459
|
const subdir = agentTranscriptSubdirs.get(agentId);
|
|
411015
|
-
const base2 = subdir ?
|
|
411016
|
-
return
|
|
411460
|
+
const base2 = subdir ? join146(projectDir, sessionId, "subagents", subdir) : join146(projectDir, sessionId, "subagents");
|
|
411461
|
+
return join146(base2, `agent-${agentId}.jsonl`);
|
|
411017
411462
|
}
|
|
411018
411463
|
function getAgentMetadataPath(agentId) {
|
|
411019
411464
|
return getAgentTranscriptPath(agentId).replace(/\.jsonl$/, ".meta.json");
|
|
@@ -411036,10 +411481,10 @@ async function readAgentMetadata(agentId) {
|
|
|
411036
411481
|
}
|
|
411037
411482
|
function getRemoteAgentsDir() {
|
|
411038
411483
|
const projectDir = getSessionProjectDir() ?? getProjectDir3(getOriginalCwd());
|
|
411039
|
-
return
|
|
411484
|
+
return join146(projectDir, getSessionId(), "remote-agents");
|
|
411040
411485
|
}
|
|
411041
411486
|
function getRemoteAgentMetadataPath(taskId) {
|
|
411042
|
-
return
|
|
411487
|
+
return join146(getRemoteAgentsDir(), `remote-agent-${taskId}.meta.json`);
|
|
411043
411488
|
}
|
|
411044
411489
|
async function writeRemoteAgentMetadata(taskId, metadata) {
|
|
411045
411490
|
const path17 = getRemoteAgentMetadataPath(taskId);
|
|
@@ -411071,7 +411516,7 @@ async function listRemoteAgentMetadata() {
|
|
|
411071
411516
|
const dir = getRemoteAgentsDir();
|
|
411072
411517
|
let entries;
|
|
411073
411518
|
try {
|
|
411074
|
-
entries = await
|
|
411519
|
+
entries = await readdir31(dir, { withFileTypes: true });
|
|
411075
411520
|
} catch (e) {
|
|
411076
411521
|
if (isFsInaccessible(e))
|
|
411077
411522
|
return [];
|
|
@@ -411082,7 +411527,7 @@ async function listRemoteAgentMetadata() {
|
|
|
411082
411527
|
if (!entry.isFile() || !entry.name.endsWith(".meta.json"))
|
|
411083
411528
|
continue;
|
|
411084
411529
|
try {
|
|
411085
|
-
const raw = await readFile53(
|
|
411530
|
+
const raw = await readFile53(join146(dir, entry.name), "utf-8");
|
|
411086
411531
|
results.push(JSON.parse(raw));
|
|
411087
411532
|
} catch (e) {
|
|
411088
411533
|
logForDebugging(`listRemoteAgentMetadata: skipping ${entry.name}: ${String(e)}`);
|
|
@@ -411092,7 +411537,7 @@ async function listRemoteAgentMetadata() {
|
|
|
411092
411537
|
}
|
|
411093
411538
|
function sessionIdExists(sessionId) {
|
|
411094
411539
|
const projectDir = getProjectDir3(getOriginalCwd());
|
|
411095
|
-
const sessionFile =
|
|
411540
|
+
const sessionFile = join146(projectDir, `${sessionId}.jsonl`);
|
|
411096
411541
|
const fs5 = getFsImplementation();
|
|
411097
411542
|
try {
|
|
411098
411543
|
fs5.statSync(sessionFile);
|
|
@@ -411634,7 +412079,7 @@ class Project {
|
|
|
411634
412079
|
return cached3;
|
|
411635
412080
|
const targetFile = getTranscriptPathForSession(sessionId);
|
|
411636
412081
|
try {
|
|
411637
|
-
await
|
|
412082
|
+
await stat44(targetFile);
|
|
411638
412083
|
this.existingSessionFiles.set(sessionId, targetFile);
|
|
411639
412084
|
return targetFile;
|
|
411640
412085
|
} catch (e) {
|
|
@@ -412886,7 +413331,7 @@ async function loadTranscriptFile(filePath, opts) {
|
|
|
412886
413331
|
let metadataLines = null;
|
|
412887
413332
|
let hasPreservedSegment = false;
|
|
412888
413333
|
if (!isEnvTruthy(process.env.THEUS_CODE_DISABLE_PRECOMPACT_SKIP)) {
|
|
412889
|
-
const { size } = await
|
|
413334
|
+
const { size } = await stat44(filePath);
|
|
412890
413335
|
if (size > SKIP_PRECOMPACT_THRESHOLD) {
|
|
412891
413336
|
const scan = await readTranscriptForLoad(filePath, size);
|
|
412892
413337
|
buf = scan.postBoundaryBuf;
|
|
@@ -413061,7 +413506,7 @@ async function loadTranscriptFile(filePath, opts) {
|
|
|
413061
413506
|
};
|
|
413062
413507
|
}
|
|
413063
413508
|
async function loadSessionFile(sessionId) {
|
|
413064
|
-
const sessionFile =
|
|
413509
|
+
const sessionFile = join146(getSessionProjectDir() ?? getProjectDir3(getOriginalCwd()), `${sessionId}.jsonl`);
|
|
413065
413510
|
return loadTranscriptFile(sessionFile);
|
|
413066
413511
|
}
|
|
413067
413512
|
function clearSessionMessagesCache() {
|
|
@@ -413125,11 +413570,11 @@ async function loadAllProjectsMessageLogsFull(limit) {
|
|
|
413125
413570
|
const projectsDir = getProjectsDir2();
|
|
413126
413571
|
let dirents;
|
|
413127
413572
|
try {
|
|
413128
|
-
dirents = await
|
|
413573
|
+
dirents = await readdir31(projectsDir, { withFileTypes: true });
|
|
413129
413574
|
} catch {
|
|
413130
413575
|
return [];
|
|
413131
413576
|
}
|
|
413132
|
-
const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
413577
|
+
const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join146(projectsDir, dirent.name));
|
|
413133
413578
|
const logsPerProject = await Promise.all(projectDirs.map((projectDir) => getLogsWithoutIndex(projectDir, limit)));
|
|
413134
413579
|
const allLogs = logsPerProject.flat();
|
|
413135
413580
|
const deduped = new Map;
|
|
@@ -413150,11 +413595,11 @@ async function loadAllProjectsMessageLogsProgressive(limit, initialEnrichCount =
|
|
|
413150
413595
|
const projectsDir = getProjectsDir2();
|
|
413151
413596
|
let dirents;
|
|
413152
413597
|
try {
|
|
413153
|
-
dirents = await
|
|
413598
|
+
dirents = await readdir31(projectsDir, { withFileTypes: true });
|
|
413154
413599
|
} catch {
|
|
413155
413600
|
return { logs: [], allStatLogs: [], nextIndex: 0 };
|
|
413156
413601
|
}
|
|
413157
|
-
const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
413602
|
+
const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join146(projectsDir, dirent.name));
|
|
413158
413603
|
const rawLogs = [];
|
|
413159
413604
|
for (const projectDir of projectDirs) {
|
|
413160
413605
|
rawLogs.push(...await getSessionFilesLite(projectDir, limit));
|
|
@@ -413200,7 +413645,7 @@ async function getStatOnlyLogsForWorktrees(worktreePaths, limit) {
|
|
|
413200
413645
|
const seenDirs = new Set;
|
|
413201
413646
|
let allDirents;
|
|
413202
413647
|
try {
|
|
413203
|
-
allDirents = await
|
|
413648
|
+
allDirents = await readdir31(projectsDir, { withFileTypes: true });
|
|
413204
413649
|
} catch (e) {
|
|
413205
413650
|
logForDebugging(`Failed to read projects dir ${projectsDir}, falling back to current project: ${e}`);
|
|
413206
413651
|
const projectDir = getProjectDir3(getOriginalCwd());
|
|
@@ -413215,7 +413660,7 @@ async function getStatOnlyLogsForWorktrees(worktreePaths, limit) {
|
|
|
413215
413660
|
for (const { path: wtPath, prefix } of indexed) {
|
|
413216
413661
|
if (dirName === prefix || dirName.startsWith(prefix + "-")) {
|
|
413217
413662
|
seenDirs.add(dirName);
|
|
413218
|
-
allLogs.push(...await getSessionFilesLite(
|
|
413663
|
+
allLogs.push(...await getSessionFilesLite(join146(projectsDir, dirent.name), undefined, wtPath));
|
|
413219
413664
|
break;
|
|
413220
413665
|
}
|
|
413221
413666
|
}
|
|
@@ -413284,10 +413729,10 @@ async function loadSubagentTranscripts(agentIds) {
|
|
|
413284
413729
|
return transcripts;
|
|
413285
413730
|
}
|
|
413286
413731
|
async function loadAllSubagentTranscriptsFromDisk() {
|
|
413287
|
-
const subagentsDir =
|
|
413732
|
+
const subagentsDir = join146(getSessionProjectDir() ?? getProjectDir3(getOriginalCwd()), getSessionId(), "subagents");
|
|
413288
413733
|
let entries;
|
|
413289
413734
|
try {
|
|
413290
|
-
entries = await
|
|
413735
|
+
entries = await readdir31(subagentsDir, { withFileTypes: true });
|
|
413291
413736
|
} catch {
|
|
413292
413737
|
return {};
|
|
413293
413738
|
}
|
|
@@ -413401,7 +413846,7 @@ async function getSessionFilesWithMtime(projectDir) {
|
|
|
413401
413846
|
const sessionFilesMap = new Map;
|
|
413402
413847
|
let dirents;
|
|
413403
413848
|
try {
|
|
413404
|
-
dirents = await
|
|
413849
|
+
dirents = await readdir31(projectDir, { withFileTypes: true });
|
|
413405
413850
|
} catch {
|
|
413406
413851
|
return sessionFilesMap;
|
|
413407
413852
|
}
|
|
@@ -413412,11 +413857,11 @@ async function getSessionFilesWithMtime(projectDir) {
|
|
|
413412
413857
|
const sessionId = validateUuid2(basename48(dirent.name, ".jsonl"));
|
|
413413
413858
|
if (!sessionId)
|
|
413414
413859
|
continue;
|
|
413415
|
-
candidates.push({ sessionId, filePath:
|
|
413860
|
+
candidates.push({ sessionId, filePath: join146(projectDir, dirent.name) });
|
|
413416
413861
|
}
|
|
413417
413862
|
await Promise.all(candidates.map(async ({ sessionId, filePath }) => {
|
|
413418
413863
|
try {
|
|
413419
|
-
const st = await
|
|
413864
|
+
const st = await stat44(filePath);
|
|
413420
413865
|
sessionFilesMap.set(sessionId, {
|
|
413421
413866
|
path: filePath,
|
|
413422
413867
|
mtime: st.mtime.getTime(),
|
|
@@ -413799,7 +414244,7 @@ var init_sessionStorage = __esm(() => {
|
|
|
413799
414244
|
init_settings2();
|
|
413800
414245
|
init_slowOperations();
|
|
413801
414246
|
init_uuid();
|
|
413802
|
-
VERSION4 = { VERSION: "0.2.
|
|
414247
|
+
VERSION4 = { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
|
|
413803
414248
|
MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
|
|
413804
414249
|
SKIP_FIRST_PROMPT_PATTERN2 = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
|
|
413805
414250
|
EPHEMERAL_PROGRESS_TYPES = new Set([
|
|
@@ -413811,7 +414256,7 @@ var init_sessionStorage = __esm(() => {
|
|
|
413811
414256
|
MAX_TRANSCRIPT_READ_BYTES = 50 * 1024 * 1024;
|
|
413812
414257
|
agentTranscriptSubdirs = new Map;
|
|
413813
414258
|
getProjectDir3 = memoize_default((projectDir) => {
|
|
413814
|
-
return
|
|
414259
|
+
return join146(getProjectsDir2(), sanitizePath2(projectDir));
|
|
413815
414260
|
});
|
|
413816
414261
|
METADATA_TYPE_MARKERS = [
|
|
413817
414262
|
'"type":"summary"',
|
|
@@ -414049,41 +414494,41 @@ var init_memdir = __esm(() => {
|
|
|
414049
414494
|
});
|
|
414050
414495
|
|
|
414051
414496
|
// tools/AgentTool/agentMemory.ts
|
|
414052
|
-
import { join as
|
|
414497
|
+
import { join as join147, normalize as normalize14, sep as sep30 } from "path";
|
|
414053
414498
|
function sanitizeAgentTypeForPath(agentType) {
|
|
414054
414499
|
return agentType.replace(/:/g, "-");
|
|
414055
414500
|
}
|
|
414056
414501
|
function getLocalAgentMemoryDir(dirName) {
|
|
414057
414502
|
if (process.env.THEUS_CODE_REMOTE_MEMORY_DIR) {
|
|
414058
|
-
return
|
|
414503
|
+
return join147(process.env.THEUS_CODE_REMOTE_MEMORY_DIR, "projects", sanitizePath2(findCanonicalGitRoot(getProjectRoot()) ?? getProjectRoot()), "agent-memory-local", dirName) + sep30;
|
|
414059
414504
|
}
|
|
414060
|
-
return
|
|
414505
|
+
return join147(getCwd(), ".theus", "agent-memory-local", dirName) + sep30;
|
|
414061
414506
|
}
|
|
414062
414507
|
function getAgentMemoryDir(agentType, scope) {
|
|
414063
414508
|
const dirName = sanitizeAgentTypeForPath(agentType);
|
|
414064
414509
|
switch (scope) {
|
|
414065
414510
|
case "project":
|
|
414066
|
-
return
|
|
414511
|
+
return join147(getCwd(), ".theus", "agent-memory", dirName) + sep30;
|
|
414067
414512
|
case "local":
|
|
414068
414513
|
return getLocalAgentMemoryDir(dirName);
|
|
414069
414514
|
case "user":
|
|
414070
|
-
return
|
|
414515
|
+
return join147(getMemoryBaseDir(), "agent-memory", dirName) + sep30;
|
|
414071
414516
|
}
|
|
414072
414517
|
}
|
|
414073
414518
|
function isAgentMemoryPath(absolutePath) {
|
|
414074
414519
|
const normalizedPath = normalize14(absolutePath);
|
|
414075
414520
|
const memoryBase = getMemoryBaseDir();
|
|
414076
|
-
if (normalizedPath.startsWith(
|
|
414521
|
+
if (normalizedPath.startsWith(join147(memoryBase, "agent-memory") + sep30)) {
|
|
414077
414522
|
return true;
|
|
414078
414523
|
}
|
|
414079
|
-
if (normalizedPath.startsWith(
|
|
414524
|
+
if (normalizedPath.startsWith(join147(getCwd(), ".theus", "agent-memory") + sep30)) {
|
|
414080
414525
|
return true;
|
|
414081
414526
|
}
|
|
414082
414527
|
if (process.env.THEUS_CODE_REMOTE_MEMORY_DIR) {
|
|
414083
|
-
if (normalizedPath.includes(sep30 + "agent-memory-local" + sep30) && normalizedPath.startsWith(
|
|
414528
|
+
if (normalizedPath.includes(sep30 + "agent-memory-local" + sep30) && normalizedPath.startsWith(join147(process.env.THEUS_CODE_REMOTE_MEMORY_DIR, "projects") + sep30)) {
|
|
414084
414529
|
return true;
|
|
414085
414530
|
}
|
|
414086
|
-
} else if (normalizedPath.startsWith(
|
|
414531
|
+
} else if (normalizedPath.startsWith(join147(getCwd(), ".theus", "agent-memory-local") + sep30)) {
|
|
414087
414532
|
return true;
|
|
414088
414533
|
}
|
|
414089
414534
|
return false;
|
|
@@ -414091,7 +414536,7 @@ function isAgentMemoryPath(absolutePath) {
|
|
|
414091
414536
|
function getMemoryScopeDisplay(memory2) {
|
|
414092
414537
|
switch (memory2) {
|
|
414093
414538
|
case "user":
|
|
414094
|
-
return `User (${
|
|
414539
|
+
return `User (${join147(getMemoryBaseDir(), "agent-memory")}/)`;
|
|
414095
414540
|
case "project":
|
|
414096
414541
|
return "Project (.theus/agent-memory/)";
|
|
414097
414542
|
case "local":
|
|
@@ -414133,8 +414578,8 @@ var init_agentMemory = __esm(() => {
|
|
|
414133
414578
|
|
|
414134
414579
|
// utils/permissions/filesystem.ts
|
|
414135
414580
|
import { randomBytes as randomBytes21 } from "crypto";
|
|
414136
|
-
import { homedir as
|
|
414137
|
-
import { join as
|
|
414581
|
+
import { homedir as homedir39, tmpdir as tmpdir12 } from "os";
|
|
414582
|
+
import { join as join148, normalize as normalize15, posix as posix7, sep as sep31 } from "path";
|
|
414138
414583
|
function normalizeCaseForComparison(path17) {
|
|
414139
414584
|
return path17.toLowerCase();
|
|
414140
414585
|
}
|
|
@@ -414143,11 +414588,11 @@ function getTheusSkillScope(filePath) {
|
|
|
414143
414588
|
const absolutePathLower = normalizeCaseForComparison(absolutePath);
|
|
414144
414589
|
const bases = [
|
|
414145
414590
|
{
|
|
414146
|
-
dir: expandPath(
|
|
414591
|
+
dir: expandPath(join148(getOriginalCwd(), ".theus", "skills")),
|
|
414147
414592
|
prefix: "/.theus/skills/"
|
|
414148
414593
|
},
|
|
414149
414594
|
{
|
|
414150
|
-
dir: expandPath(
|
|
414595
|
+
dir: expandPath(join148(homedir39(), ".theus", "skills")),
|
|
414151
414596
|
prefix: "~/.theus/skills/"
|
|
414152
414597
|
}
|
|
414153
414598
|
];
|
|
@@ -414202,21 +414647,21 @@ function isTheusConfigFilePath(filePath) {
|
|
|
414202
414647
|
if (isTheusSettingsPath(filePath)) {
|
|
414203
414648
|
return true;
|
|
414204
414649
|
}
|
|
414205
|
-
const commandsDir =
|
|
414206
|
-
const agentsDir =
|
|
414207
|
-
const skillsDir =
|
|
414650
|
+
const commandsDir = join148(getOriginalCwd(), ".theus", "commands");
|
|
414651
|
+
const agentsDir = join148(getOriginalCwd(), ".theus", "agents");
|
|
414652
|
+
const skillsDir = join148(getOriginalCwd(), ".theus", "skills");
|
|
414208
414653
|
return pathInWorkingPath(filePath, commandsDir) || pathInWorkingPath(filePath, agentsDir) || pathInWorkingPath(filePath, skillsDir);
|
|
414209
414654
|
}
|
|
414210
414655
|
function isSessionPlanFile(absolutePath) {
|
|
414211
|
-
const expectedPrefix =
|
|
414656
|
+
const expectedPrefix = join148(getPlansDirectory(), getPlanSlug());
|
|
414212
414657
|
const normalizedPath = normalize15(absolutePath);
|
|
414213
414658
|
return normalizedPath.startsWith(expectedPrefix) && normalizedPath.endsWith(".md");
|
|
414214
414659
|
}
|
|
414215
414660
|
function getSessionMemoryDir() {
|
|
414216
|
-
return
|
|
414661
|
+
return join148(getProjectDir3(getCwd()), getSessionId(), "session-memory") + sep31;
|
|
414217
414662
|
}
|
|
414218
414663
|
function getSessionMemoryPath() {
|
|
414219
|
-
return
|
|
414664
|
+
return join148(getSessionMemoryDir(), "summary.md");
|
|
414220
414665
|
}
|
|
414221
414666
|
function isSessionMemoryPath(absolutePath) {
|
|
414222
414667
|
const normalizedPath = normalize15(absolutePath);
|
|
@@ -414238,10 +414683,10 @@ function getTheusTempDirName() {
|
|
|
414238
414683
|
return `theus-${uid}`;
|
|
414239
414684
|
}
|
|
414240
414685
|
function getProjectTempDir() {
|
|
414241
|
-
return
|
|
414686
|
+
return join148(getTheusTempDir(), sanitizePath2(getOriginalCwd())) + sep31;
|
|
414242
414687
|
}
|
|
414243
414688
|
function getScratchpadDir() {
|
|
414244
|
-
return
|
|
414689
|
+
return join148(getProjectTempDir(), getSessionId(), "scratchpad");
|
|
414245
414690
|
}
|
|
414246
414691
|
async function ensureScratchpadDir() {
|
|
414247
414692
|
if (!isScratchpadEnabled()) {
|
|
@@ -414461,7 +414906,7 @@ function patternWithRoot(pattern, source) {
|
|
|
414461
414906
|
} else if (pattern.startsWith(`~${DIR_SEP}`)) {
|
|
414462
414907
|
return {
|
|
414463
414908
|
relativePattern: pattern.slice(1),
|
|
414464
|
-
root:
|
|
414909
|
+
root: homedir39().normalize("NFC")
|
|
414465
414910
|
};
|
|
414466
414911
|
} else if (pattern.startsWith(DIR_SEP)) {
|
|
414467
414912
|
return {
|
|
@@ -414819,7 +415264,7 @@ function checkEditableInternalPath(absolutePath, input) {
|
|
|
414819
415264
|
}
|
|
414820
415265
|
};
|
|
414821
415266
|
}
|
|
414822
|
-
if (normalizeCaseForComparison(normalizedPath) === normalizeCaseForComparison(
|
|
415267
|
+
if (normalizeCaseForComparison(normalizedPath) === normalizeCaseForComparison(join148(getOriginalCwd(), ".theus", "launch.json"))) {
|
|
414823
415268
|
return {
|
|
414824
415269
|
behavior: "allow",
|
|
414825
415270
|
updatedInput: input,
|
|
@@ -414916,7 +415361,7 @@ function checkReadableInternalPath(absolutePath, input) {
|
|
|
414916
415361
|
}
|
|
414917
415362
|
};
|
|
414918
415363
|
}
|
|
414919
|
-
const tasksDir =
|
|
415364
|
+
const tasksDir = join148(getTheusConfigHomeDir(), "tasks") + sep31;
|
|
414920
415365
|
if (normalizedPath === tasksDir.slice(0, -1) || normalizedPath.startsWith(tasksDir)) {
|
|
414921
415366
|
return {
|
|
414922
415367
|
behavior: "allow",
|
|
@@ -414927,7 +415372,7 @@ function checkReadableInternalPath(absolutePath, input) {
|
|
|
414927
415372
|
}
|
|
414928
415373
|
};
|
|
414929
415374
|
}
|
|
414930
|
-
const teamsReadDir =
|
|
415375
|
+
const teamsReadDir = join148(getTheusConfigHomeDir(), "teams") + sep31;
|
|
414931
415376
|
if (normalizedPath === teamsReadDir.slice(0, -1) || normalizedPath.startsWith(teamsReadDir)) {
|
|
414932
415377
|
return {
|
|
414933
415378
|
behavior: "allow",
|
|
@@ -415000,11 +415445,11 @@ var init_filesystem = __esm(() => {
|
|
|
415000
415445
|
try {
|
|
415001
415446
|
resolvedBaseTmpDir = fs5.realpathSync(baseTmpDir);
|
|
415002
415447
|
} catch {}
|
|
415003
|
-
return
|
|
415448
|
+
return join148(resolvedBaseTmpDir, getTheusTempDirName()) + sep31;
|
|
415004
415449
|
});
|
|
415005
415450
|
getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
|
|
415006
415451
|
const nonce = randomBytes21(16).toString("hex");
|
|
415007
|
-
return
|
|
415452
|
+
return join148(getTheusTempDir(), "bundled-skills", { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, nonce);
|
|
415008
415453
|
});
|
|
415009
415454
|
getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
|
|
415010
415455
|
});
|
|
@@ -415013,15 +415458,15 @@ var init_filesystem = __esm(() => {
|
|
|
415013
415458
|
import { constants as fsConstants6 } from "fs";
|
|
415014
415459
|
import {
|
|
415015
415460
|
mkdir as mkdir47,
|
|
415016
|
-
open as
|
|
415017
|
-
stat as
|
|
415461
|
+
open as open19,
|
|
415462
|
+
stat as stat45,
|
|
415018
415463
|
symlink as symlink6,
|
|
415019
415464
|
unlink as unlink23
|
|
415020
415465
|
} from "fs/promises";
|
|
415021
|
-
import { join as
|
|
415466
|
+
import { join as join149 } from "path";
|
|
415022
415467
|
function getTaskOutputDir() {
|
|
415023
415468
|
if (_taskOutputDir === undefined) {
|
|
415024
|
-
_taskOutputDir =
|
|
415469
|
+
_taskOutputDir = join149(getProjectTempDir(), getSessionId(), "tasks");
|
|
415025
415470
|
}
|
|
415026
415471
|
return _taskOutputDir;
|
|
415027
415472
|
}
|
|
@@ -415029,7 +415474,7 @@ async function ensureOutputDir() {
|
|
|
415029
415474
|
await mkdir47(getTaskOutputDir(), { recursive: true });
|
|
415030
415475
|
}
|
|
415031
415476
|
function getTaskOutputPath(taskId) {
|
|
415032
|
-
return
|
|
415477
|
+
return join149(getTaskOutputDir(), `${taskId}.output`);
|
|
415033
415478
|
}
|
|
415034
415479
|
function track(p) {
|
|
415035
415480
|
_pendingOps.add(p);
|
|
@@ -415079,7 +415524,7 @@ class DiskTaskOutput {
|
|
|
415079
415524
|
try {
|
|
415080
415525
|
if (!this.#fileHandle) {
|
|
415081
415526
|
await ensureOutputDir();
|
|
415082
|
-
this.#fileHandle = await
|
|
415527
|
+
this.#fileHandle = await open19(this.#path, process.platform === "win32" ? "a" : fsConstants6.O_WRONLY | fsConstants6.O_APPEND | fsConstants6.O_CREAT | O_NOFOLLOW2);
|
|
415083
415528
|
}
|
|
415084
415529
|
while (true) {
|
|
415085
415530
|
await this.#writeAllChunks();
|
|
@@ -415196,7 +415641,7 @@ function initTaskOutput(taskId) {
|
|
|
415196
415641
|
return track((async () => {
|
|
415197
415642
|
await ensureOutputDir();
|
|
415198
415643
|
const outputPath = getTaskOutputPath(taskId);
|
|
415199
|
-
const fh = await
|
|
415644
|
+
const fh = await open19(outputPath, process.platform === "win32" ? "wx" : fsConstants6.O_WRONLY | fsConstants6.O_CREAT | fsConstants6.O_EXCL | O_NOFOLLOW2);
|
|
415200
415645
|
await fh.close();
|
|
415201
415646
|
return outputPath;
|
|
415202
415647
|
})());
|
|
@@ -415278,7 +415723,7 @@ var init_Task = __esm(() => {
|
|
|
415278
415723
|
});
|
|
415279
415724
|
|
|
415280
415725
|
// utils/ShellCommand.ts
|
|
415281
|
-
import { stat as
|
|
415726
|
+
import { stat as stat46 } from "fs/promises";
|
|
415282
415727
|
function prependStderr(prefix, stderr) {
|
|
415283
415728
|
return stderr ? `${prefix} ${stderr}` : prefix;
|
|
415284
415729
|
}
|
|
@@ -415402,7 +415847,7 @@ class ShellCommandImpl {
|
|
|
415402
415847
|
}
|
|
415403
415848
|
#startSizeWatchdog() {
|
|
415404
415849
|
this.#sizeWatchdog = setInterval(() => {
|
|
415405
|
-
|
|
415850
|
+
stat46(this.taskOutput.path).then((s) => {
|
|
415406
415851
|
if (s.size > this.#maxOutputBytes && this.#status === "backgrounded" && this.#sizeWatchdog !== null) {
|
|
415407
415852
|
this.#killedForSize = true;
|
|
415408
415853
|
this.#clearSizeWatchdog();
|
|
@@ -419265,7 +419710,7 @@ var init_hooks5 = __esm(() => {
|
|
|
419265
419710
|
});
|
|
419266
419711
|
|
|
419267
419712
|
// utils/settings/changeDetector.ts
|
|
419268
|
-
import { stat as
|
|
419713
|
+
import { stat as stat47 } from "fs/promises";
|
|
419269
419714
|
import * as platformPath from "path";
|
|
419270
419715
|
async function initialize() {
|
|
419271
419716
|
if (getIsRemoteMode())
|
|
@@ -419345,7 +419790,7 @@ async function getWatchTargets() {
|
|
|
419345
419790
|
}
|
|
419346
419791
|
dirToSettingsFiles.get(dir).add(path17);
|
|
419347
419792
|
try {
|
|
419348
|
-
const stats2 = await
|
|
419793
|
+
const stats2 = await stat47(path17);
|
|
419349
419794
|
if (stats2.isFile()) {
|
|
419350
419795
|
dirsWithExistingFiles.add(dir);
|
|
419351
419796
|
}
|
|
@@ -419363,7 +419808,7 @@ async function getWatchTargets() {
|
|
|
419363
419808
|
let dropInDir = null;
|
|
419364
419809
|
const managedDropIn = getManagedSettingsDropInDir();
|
|
419365
419810
|
try {
|
|
419366
|
-
const stats2 = await
|
|
419811
|
+
const stats2 = await stat47(managedDropIn);
|
|
419367
419812
|
if (stats2.isDirectory()) {
|
|
419368
419813
|
dirsWithExistingFiles.add(managedDropIn);
|
|
419369
419814
|
dropInDir = managedDropIn;
|
|
@@ -419544,7 +419989,7 @@ __export(exports_sandbox_adapter, {
|
|
|
419544
419989
|
});
|
|
419545
419990
|
import { rmSync as rmSync5, statSync as statSync13 } from "fs";
|
|
419546
419991
|
import { readFile as readFile54 } from "fs/promises";
|
|
419547
|
-
import { join as
|
|
419992
|
+
import { join as join150, resolve as resolve46, sep as sep33 } from "path";
|
|
419548
419993
|
function permissionRuleValueFromString2(ruleString) {
|
|
419549
419994
|
const matches = ruleString.match(/^([^(]+)\(([^)]+)\)$/);
|
|
419550
419995
|
if (!matches) {
|
|
@@ -419726,7 +420171,7 @@ function scrubBareGitRepoFiles() {
|
|
|
419726
420171
|
}
|
|
419727
420172
|
}
|
|
419728
420173
|
async function detectWorktreeMainRepoPath(cwd2) {
|
|
419729
|
-
const gitPath =
|
|
420174
|
+
const gitPath = join150(cwd2, ".git");
|
|
419730
420175
|
try {
|
|
419731
420176
|
const gitContent = await readFile54(gitPath, { encoding: "utf8" });
|
|
419732
420177
|
const gitdirMatch = gitContent.match(/^gitdir:\s*(.+)$/m);
|
|
@@ -420029,7 +420474,7 @@ var init_sandbox_adapter = __esm(() => {
|
|
|
420029
420474
|
});
|
|
420030
420475
|
|
|
420031
420476
|
// utils/permissions/pathValidation.ts
|
|
420032
|
-
import { homedir as
|
|
420477
|
+
import { homedir as homedir40 } from "os";
|
|
420033
420478
|
import { dirname as dirname63, isAbsolute as isAbsolute29, resolve as resolve47 } from "path";
|
|
420034
420479
|
function formatDirectoryList2(directories) {
|
|
420035
420480
|
const dirCount = directories.length;
|
|
@@ -420052,7 +420497,7 @@ function getGlobBaseDirectory2(path17) {
|
|
|
420052
420497
|
}
|
|
420053
420498
|
function expandTilde2(path17) {
|
|
420054
420499
|
if (path17 === "~" || path17.startsWith("~/") || process.platform === "win32" && path17.startsWith("~\\")) {
|
|
420055
|
-
return
|
|
420500
|
+
return homedir40() + path17.slice(1);
|
|
420056
420501
|
}
|
|
420057
420502
|
return path17;
|
|
420058
420503
|
}
|
|
@@ -420169,7 +420614,7 @@ function isDangerousRemovalPath(resolvedPath) {
|
|
|
420169
420614
|
if (WINDOWS_DRIVE_ROOT_REGEX.test(normalizedPath)) {
|
|
420170
420615
|
return true;
|
|
420171
420616
|
}
|
|
420172
|
-
const normalizedHome =
|
|
420617
|
+
const normalizedHome = homedir40().replace(/[\\/]+/g, "/");
|
|
420173
420618
|
if (normalizedPath === normalizedHome) {
|
|
420174
420619
|
return true;
|
|
420175
420620
|
}
|
|
@@ -420253,8 +420698,8 @@ var init_pathValidation3 = __esm(() => {
|
|
|
420253
420698
|
|
|
420254
420699
|
// utils/plugins/pluginDirectories.ts
|
|
420255
420700
|
import { mkdirSync as mkdirSync11 } from "fs";
|
|
420256
|
-
import { readdir as
|
|
420257
|
-
import { delimiter as delimiter3, join as
|
|
420701
|
+
import { readdir as readdir32, rm as rm10, stat as stat48 } from "fs/promises";
|
|
420702
|
+
import { delimiter as delimiter3, join as join151 } from "path";
|
|
420258
420703
|
function getPluginsDirectoryName() {
|
|
420259
420704
|
if (getUseCoworkPlugins()) {
|
|
420260
420705
|
return COWORK_PLUGINS_DIR;
|
|
@@ -420269,7 +420714,7 @@ function getPluginsDirectory() {
|
|
|
420269
420714
|
if (envOverride) {
|
|
420270
420715
|
return expandTilde2(envOverride);
|
|
420271
420716
|
}
|
|
420272
|
-
return
|
|
420717
|
+
return join151(getTheusConfigHomeDir(), getPluginsDirectoryName());
|
|
420273
420718
|
}
|
|
420274
420719
|
function getPluginSeedDirs() {
|
|
420275
420720
|
const raw = process.env.THEUS_CODE_PLUGIN_SEED_DIR;
|
|
@@ -420281,7 +420726,7 @@ function sanitizePluginId(pluginId) {
|
|
|
420281
420726
|
return pluginId.replace(/[^a-zA-Z0-9\-_]/g, "-");
|
|
420282
420727
|
}
|
|
420283
420728
|
function pluginDataDirPath(pluginId) {
|
|
420284
|
-
return
|
|
420729
|
+
return join151(getPluginsDirectory(), "data", sanitizePluginId(pluginId));
|
|
420285
420730
|
}
|
|
420286
420731
|
function getPluginDataDir(pluginId) {
|
|
420287
420732
|
const dir = pluginDataDirPath(pluginId);
|
|
@@ -420292,13 +420737,13 @@ async function getPluginDataDirSize(pluginId) {
|
|
|
420292
420737
|
const dir = pluginDataDirPath(pluginId);
|
|
420293
420738
|
let bytes = 0;
|
|
420294
420739
|
const walk = async (p) => {
|
|
420295
|
-
for (const entry of await
|
|
420296
|
-
const full =
|
|
420740
|
+
for (const entry of await readdir32(p, { withFileTypes: true })) {
|
|
420741
|
+
const full = join151(p, entry.name);
|
|
420297
420742
|
if (entry.isDirectory()) {
|
|
420298
420743
|
await walk(full);
|
|
420299
420744
|
} else {
|
|
420300
420745
|
try {
|
|
420301
|
-
bytes += (await
|
|
420746
|
+
bytes += (await stat48(full)).size;
|
|
420302
420747
|
} catch {}
|
|
420303
420748
|
}
|
|
420304
420749
|
}
|
|
@@ -420334,7 +420779,7 @@ var init_pluginDirectories = __esm(() => {
|
|
|
420334
420779
|
|
|
420335
420780
|
// utils/plugins/lspPluginIntegration.ts
|
|
420336
420781
|
import { readFile as readFile55 } from "fs/promises";
|
|
420337
|
-
import { join as
|
|
420782
|
+
import { join as join152, relative as relative31, resolve as resolve48 } from "path";
|
|
420338
420783
|
function validatePathWithinPlugin(pluginPath, relativePath2) {
|
|
420339
420784
|
const resolvedPluginPath = resolve48(pluginPath);
|
|
420340
420785
|
const resolvedFilePath = resolve48(pluginPath, relativePath2);
|
|
@@ -420346,7 +420791,7 @@ function validatePathWithinPlugin(pluginPath, relativePath2) {
|
|
|
420346
420791
|
}
|
|
420347
420792
|
async function loadPluginLspServers(plugin2, errors4 = []) {
|
|
420348
420793
|
const servers = {};
|
|
420349
|
-
const lspJsonPath =
|
|
420794
|
+
const lspJsonPath = join152(plugin2.path, ".lsp.json");
|
|
420350
420795
|
try {
|
|
420351
420796
|
const content = await readFile55(lspJsonPath, "utf-8");
|
|
420352
420797
|
const parsed = jsonParse(content);
|
|
@@ -425606,8 +426051,8 @@ __export(exports_upstreamproxy, {
|
|
|
425606
426051
|
SESSION_TOKEN_PATH: () => SESSION_TOKEN_PATH
|
|
425607
426052
|
});
|
|
425608
426053
|
import { mkdir as mkdir48, readFile as readFile56, unlink as unlink24, writeFile as writeFile50 } from "fs/promises";
|
|
425609
|
-
import { homedir as
|
|
425610
|
-
import { join as
|
|
426054
|
+
import { homedir as homedir41 } from "os";
|
|
426055
|
+
import { join as join153 } from "path";
|
|
425611
426056
|
async function initUpstreamProxy(opts) {
|
|
425612
426057
|
if (!isEnvTruthy(process.env.THEUS_CODE_REMOTE)) {
|
|
425613
426058
|
return state;
|
|
@@ -425628,7 +426073,7 @@ async function initUpstreamProxy(opts) {
|
|
|
425628
426073
|
}
|
|
425629
426074
|
setNonDumpable();
|
|
425630
426075
|
const baseUrl = opts?.ccrBaseUrl ?? process.env.THEUS_BASE_URL ?? "https://api.theus.pe";
|
|
425631
|
-
const caBundlePath = opts?.caBundlePath ??
|
|
426076
|
+
const caBundlePath = opts?.caBundlePath ?? join153(homedir41(), ".ccr", "ca-bundle.crt");
|
|
425632
426077
|
const caOk = await downloadCaBundle(baseUrl, opts?.systemCaPath ?? SYSTEM_CA_BUNDLE, caBundlePath);
|
|
425633
426078
|
if (!caOk)
|
|
425634
426079
|
return state;
|
|
@@ -425729,7 +426174,7 @@ async function downloadCaBundle(baseUrl, systemCaPath, outPath) {
|
|
|
425729
426174
|
}
|
|
425730
426175
|
const ccrCa = await resp.text();
|
|
425731
426176
|
const systemCa = await readFile56(systemCaPath, "utf8").catch(() => "");
|
|
425732
|
-
await mkdir48(
|
|
426177
|
+
await mkdir48(join153(outPath, ".."), { recursive: true });
|
|
425733
426178
|
await writeFile50(outPath, systemCa + `
|
|
425734
426179
|
` + ccrCa, "utf8");
|
|
425735
426180
|
return true;
|
|
@@ -426158,14 +426603,14 @@ import {
|
|
|
426158
426603
|
appendFile as appendFile7,
|
|
426159
426604
|
chmod as chmod12,
|
|
426160
426605
|
mkdir as mkdir49,
|
|
426161
|
-
readdir as
|
|
426606
|
+
readdir as readdir33,
|
|
426162
426607
|
rmdir as rmdir3,
|
|
426163
|
-
stat as
|
|
426608
|
+
stat as stat49,
|
|
426164
426609
|
unlink as unlink25
|
|
426165
426610
|
} from "fs/promises";
|
|
426166
426611
|
import { createServer as createServer9 } from "net";
|
|
426167
426612
|
import { platform as platform6 } from "os";
|
|
426168
|
-
import { join as
|
|
426613
|
+
import { join as join154 } from "path";
|
|
426169
426614
|
function log(message, ...args) {
|
|
426170
426615
|
if (LOG_FILE) {
|
|
426171
426616
|
const timestamp2 = new Date().toISOString();
|
|
@@ -426212,7 +426657,7 @@ class ChromeNativeHost {
|
|
|
426212
426657
|
if (platform6() !== "win32") {
|
|
426213
426658
|
const socketDir = getSocketDir();
|
|
426214
426659
|
try {
|
|
426215
|
-
const dirStats = await
|
|
426660
|
+
const dirStats = await stat49(socketDir);
|
|
426216
426661
|
if (!dirStats.isDirectory()) {
|
|
426217
426662
|
await unlink25(socketDir);
|
|
426218
426663
|
}
|
|
@@ -426220,7 +426665,7 @@ class ChromeNativeHost {
|
|
|
426220
426665
|
await mkdir49(socketDir, { recursive: true, mode: 448 });
|
|
426221
426666
|
await chmod12(socketDir, 448).catch(() => {});
|
|
426222
426667
|
try {
|
|
426223
|
-
const files2 = await
|
|
426668
|
+
const files2 = await readdir33(socketDir);
|
|
426224
426669
|
for (const file2 of files2) {
|
|
426225
426670
|
if (!file2.endsWith(".sock")) {
|
|
426226
426671
|
continue;
|
|
@@ -426232,7 +426677,7 @@ class ChromeNativeHost {
|
|
|
426232
426677
|
try {
|
|
426233
426678
|
process.kill(pid, 0);
|
|
426234
426679
|
} catch {
|
|
426235
|
-
await unlink25(
|
|
426680
|
+
await unlink25(join154(socketDir, file2)).catch(() => {});
|
|
426236
426681
|
log(`Removed stale socket for PID ${pid}`);
|
|
426237
426682
|
}
|
|
426238
426683
|
}
|
|
@@ -426281,7 +426726,7 @@ class ChromeNativeHost {
|
|
|
426281
426726
|
} catch {}
|
|
426282
426727
|
try {
|
|
426283
426728
|
const socketDir = getSocketDir();
|
|
426284
|
-
const remaining = await
|
|
426729
|
+
const remaining = await readdir33(socketDir);
|
|
426285
426730
|
if (remaining.length === 0) {
|
|
426286
426731
|
await rmdir3(socketDir);
|
|
426287
426732
|
log("Removed empty socket directory");
|
|
@@ -427181,7 +427626,7 @@ async function handleMemories(state2) {
|
|
|
427181
427626
|
async function runProjectContextMcpServer() {
|
|
427182
427627
|
const projectRoot = process.env.THEUS_PROJECT_ROOT || process.cwd();
|
|
427183
427628
|
const state2 = new ProjectContextState(projectRoot);
|
|
427184
|
-
const server2 = new Server({ name: SERVER_NAME, version: { VERSION: "0.2.
|
|
427629
|
+
const server2 = new Server({ name: SERVER_NAME, version: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION }, { capabilities: { tools: {} } });
|
|
427185
427630
|
server2.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
427186
427631
|
tools: TOOL_DEFINITIONS.map((t) => ({
|
|
427187
427632
|
name: t.name,
|
|
@@ -427307,13 +427752,13 @@ var init_server3 = __esm(() => {
|
|
|
427307
427752
|
|
|
427308
427753
|
// services/mcpComputerUse/macos.ts
|
|
427309
427754
|
import { execFile as execFile8 } from "child_process";
|
|
427310
|
-
import { existsSync as
|
|
427311
|
-
import { homedir as
|
|
427312
|
-
import { join as
|
|
427755
|
+
import { existsSync as existsSync25, mkdirSync as mkdirSync12, readFileSync as readFileSync30, statSync as statSync14, unlinkSync as unlinkSync3, writeFileSync as writeFileSync10 } from "fs";
|
|
427756
|
+
import { homedir as homedir43, tmpdir as tmpdir13 } from "os";
|
|
427757
|
+
import { join as join155 } from "path";
|
|
427313
427758
|
import { promisify as promisify6 } from "util";
|
|
427314
427759
|
function cuDir() {
|
|
427315
|
-
const dir =
|
|
427316
|
-
if (!
|
|
427760
|
+
const dir = join155(homedir43(), ".theus", "cu");
|
|
427761
|
+
if (!existsSync25(dir))
|
|
427317
427762
|
mkdirSync12(dir, { recursive: true });
|
|
427318
427763
|
return dir;
|
|
427319
427764
|
}
|
|
@@ -427326,7 +427771,7 @@ function resolveBin(name, extra = []) {
|
|
|
427326
427771
|
`/usr/sbin/${name}`
|
|
427327
427772
|
];
|
|
427328
427773
|
for (const candidate of candidates) {
|
|
427329
|
-
if (
|
|
427774
|
+
if (existsSync25(candidate))
|
|
427330
427775
|
return candidate;
|
|
427331
427776
|
}
|
|
427332
427777
|
return name;
|
|
@@ -427360,9 +427805,9 @@ async function getScreenGeometry(force = false) {
|
|
|
427360
427805
|
return cachedGeometry;
|
|
427361
427806
|
}
|
|
427362
427807
|
async function checkPermissions() {
|
|
427363
|
-
const probe =
|
|
427808
|
+
const probe = join155(tmpdir13(), `theus-cu-probe-${process.pid}.jpg`);
|
|
427364
427809
|
const cap = await run6(SCREENCAPTURE, ["-x", "-t", "jpg", probe], { timeoutMs: 8000 });
|
|
427365
|
-
const screenRecording =
|
|
427810
|
+
const screenRecording = existsSync25(probe) && (() => {
|
|
427366
427811
|
try {
|
|
427367
427812
|
return statSync14(probe).size > 0;
|
|
427368
427813
|
} catch {
|
|
@@ -427370,7 +427815,7 @@ async function checkPermissions() {
|
|
|
427370
427815
|
}
|
|
427371
427816
|
})();
|
|
427372
427817
|
try {
|
|
427373
|
-
if (
|
|
427818
|
+
if (existsSync25(probe))
|
|
427374
427819
|
unlinkSync3(probe);
|
|
427375
427820
|
} catch {}
|
|
427376
427821
|
const cc = await run6(CLICLICK, ["p"], { timeoutMs: 5000 });
|
|
@@ -427389,14 +427834,14 @@ async function checkPermissions() {
|
|
|
427389
427834
|
async function captureScreenshot(opts = {}) {
|
|
427390
427835
|
const maxSide = opts.maxSide ?? 1400;
|
|
427391
427836
|
const quality = Math.min(Math.max(opts.quality ?? 72, 1), 100);
|
|
427392
|
-
const raw =
|
|
427393
|
-
const out =
|
|
427837
|
+
const raw = join155(cuDir(), `shot-${process.pid}.png`);
|
|
427838
|
+
const out = join155(cuDir(), `shot-${process.pid}.jpg`);
|
|
427394
427839
|
const capArgs = ["-x", "-t", "png", "-o"];
|
|
427395
427840
|
if (opts.displayIndex && opts.displayIndex > 0)
|
|
427396
427841
|
capArgs.push("-D", String(opts.displayIndex));
|
|
427397
427842
|
capArgs.push(raw);
|
|
427398
427843
|
const cap = await run6(SCREENCAPTURE, capArgs, { timeoutMs: 12000 });
|
|
427399
|
-
if (!
|
|
427844
|
+
if (!existsSync25(raw) || statSync14(raw).size === 0) {
|
|
427400
427845
|
throw new ComputerUseError("No se pudo capturar la pantalla (" + (cap.stderr.trim() || "screencapture no produjo imagen") + "). Falta el permiso de Grabaci\xF3n de pantalla para el app que corre Theus.");
|
|
427401
427846
|
}
|
|
427402
427847
|
await run6(SIPS, [
|
|
@@ -427412,14 +427857,14 @@ async function captureScreenshot(opts = {}) {
|
|
|
427412
427857
|
"--out",
|
|
427413
427858
|
out
|
|
427414
427859
|
], { timeoutMs: 12000 });
|
|
427415
|
-
if (!
|
|
427860
|
+
if (!existsSync25(out) || statSync14(out).size === 0) {
|
|
427416
427861
|
throw new ComputerUseError("sips no pudo reescalar la captura a JPEG.");
|
|
427417
427862
|
}
|
|
427418
427863
|
const dims = await run6(SIPS, ["-g", "pixelWidth", "-g", "pixelHeight", out]);
|
|
427419
427864
|
const width = Number.parseInt(/pixelWidth:\s*(\d+)/.exec(dims.stdout)?.[1] ?? "0", 10);
|
|
427420
427865
|
const height = Number.parseInt(/pixelHeight:\s*(\d+)/.exec(dims.stdout)?.[1] ?? "0", 10);
|
|
427421
427866
|
const geometry = await getScreenGeometry();
|
|
427422
|
-
const base643 =
|
|
427867
|
+
const base643 = readFileSync30(out).toString("base64");
|
|
427423
427868
|
return {
|
|
427424
427869
|
base64: base643,
|
|
427425
427870
|
mimeType: "image/jpeg",
|
|
@@ -427553,15 +427998,15 @@ async function ensureScrollHelper() {
|
|
|
427553
427998
|
if (scrollBinPromise)
|
|
427554
427999
|
return scrollBinPromise;
|
|
427555
428000
|
scrollBinPromise = (async () => {
|
|
427556
|
-
if (!
|
|
427557
|
-
const src =
|
|
427558
|
-
const bin =
|
|
427559
|
-
if (
|
|
428001
|
+
if (!existsSync25(SWIFTC) && SWIFTC === "swiftc") {}
|
|
428002
|
+
const src = join155(cuDir(), "scroll.swift");
|
|
428003
|
+
const bin = join155(cuDir(), "theus-cu-scroll");
|
|
428004
|
+
if (existsSync25(bin))
|
|
427560
428005
|
return bin;
|
|
427561
428006
|
try {
|
|
427562
428007
|
writeFileSync10(src, SCROLL_SWIFT, "utf8");
|
|
427563
428008
|
const res = await run6(SWIFTC, ["-O", "-o", bin, src], { timeoutMs: 60000 });
|
|
427564
|
-
if (
|
|
428009
|
+
if (existsSync25(bin))
|
|
427565
428010
|
return bin;
|
|
427566
428011
|
process.stderr.write(`[computer-use] no se pudo compilar el helper de scroll: ${res.stderr}
|
|
427567
428012
|
`);
|
|
@@ -427885,9 +428330,9 @@ var exports_selftest = {};
|
|
|
427885
428330
|
__export(exports_selftest, {
|
|
427886
428331
|
runComputerUseSelfTest: () => runComputerUseSelfTest
|
|
427887
428332
|
});
|
|
427888
|
-
import { existsSync as
|
|
427889
|
-
import { join as
|
|
427890
|
-
import { homedir as
|
|
428333
|
+
import { existsSync as existsSync26, writeFileSync as writeFileSync11 } from "fs";
|
|
428334
|
+
import { join as join156 } from "path";
|
|
428335
|
+
import { homedir as homedir44 } from "os";
|
|
427891
428336
|
async function runComputerUseSelfTest() {
|
|
427892
428337
|
let pass = 0;
|
|
427893
428338
|
let fail = 0;
|
|
@@ -427909,7 +428354,7 @@ Theus computer-use \u2014 self-test (macOS)
|
|
|
427909
428354
|
`);
|
|
427910
428355
|
const tools = toolingReport();
|
|
427911
428356
|
for (const [name, path19] of Object.entries(tools)) {
|
|
427912
|
-
if (
|
|
428357
|
+
if (existsSync26(path19))
|
|
427913
428358
|
ok2(`${name}: ${path19}`);
|
|
427914
428359
|
else if (name === "swiftc")
|
|
427915
428360
|
warn(`${name}: no encontrado (scroll quedar\xE1 deshabilitado; el resto funciona)`);
|
|
@@ -427938,7 +428383,7 @@ Geometr\xEDa y captura:`);
|
|
|
427938
428383
|
let captureOk = false;
|
|
427939
428384
|
try {
|
|
427940
428385
|
const shot = await captureScreenshot();
|
|
427941
|
-
const outPath =
|
|
428386
|
+
const outPath = join156(homedir44(), ".theus", "cu", "selftest-shot.jpg");
|
|
427942
428387
|
writeFileSync11(outPath, Buffer.from(shot.base64, "base64"));
|
|
427943
428388
|
ok2(`Captura ${shot.width}\xD7${shot.height} px, ${Math.round(shot.base64.length * 0.75 / 1024)} KB \u2192 ${outPath}`);
|
|
427944
428389
|
captureOk = true;
|
|
@@ -428409,9 +428854,9 @@ var init_client6 = __esm(() => {
|
|
|
428409
428854
|
});
|
|
428410
428855
|
|
|
428411
428856
|
// services/titanFleet/executor.ts
|
|
428412
|
-
import { createHash as
|
|
428857
|
+
import { createHash as createHash32 } from "crypto";
|
|
428413
428858
|
import { spawn as spawn11 } from "child_process";
|
|
428414
|
-
import { existsSync as
|
|
428859
|
+
import { existsSync as existsSync27 } from "fs";
|
|
428415
428860
|
import { resolve as resolve51 } from "path";
|
|
428416
428861
|
async function ensureFleetDurableEffect(effect, signal) {
|
|
428417
428862
|
if (effect.hasChanges) {
|
|
@@ -428419,10 +428864,10 @@ async function ensureFleetDurableEffect(effect, signal) {
|
|
|
428419
428864
|
}
|
|
428420
428865
|
}
|
|
428421
428866
|
async function cleanupFleetDurableEffect(effect) {
|
|
428422
|
-
if (!
|
|
428867
|
+
if (!existsSync27(effect.worktreePath))
|
|
428423
428868
|
return;
|
|
428424
428869
|
const removed = await removeAgentWorktree(effect.worktreePath, effect.worktreeBranch, effect.gitRoot, effect.hookBased);
|
|
428425
|
-
if (!removed &&
|
|
428870
|
+
if (!removed && existsSync27(effect.worktreePath)) {
|
|
428426
428871
|
throw new Error("Fleet no pudo limpiar el worktree durable; el outbox se conserva");
|
|
428427
428872
|
}
|
|
428428
428873
|
}
|
|
@@ -428577,7 +429022,7 @@ function instructionWithAcceptance(task) {
|
|
|
428577
429022
|
`);
|
|
428578
429023
|
}
|
|
428579
429024
|
function slugForLease(lease) {
|
|
428580
|
-
const digest =
|
|
429025
|
+
const digest = createHash32("sha256").update(`${lease.job.job_id}:${lease.generation}`).digest("hex").slice(0, 20);
|
|
428581
429026
|
return `fleet-${digest}`;
|
|
428582
429027
|
}
|
|
428583
429028
|
function installedCliPath() {
|
|
@@ -428585,7 +429030,7 @@ function installedCliPath() {
|
|
|
428585
429030
|
resolve51(import.meta.dir, "..", "..", "bin", "theus"),
|
|
428586
429031
|
resolve51(import.meta.dir, "bin", "theus")
|
|
428587
429032
|
];
|
|
428588
|
-
const found = candidates.find((candidate) =>
|
|
429033
|
+
const found = candidates.find((candidate) => existsSync27(candidate));
|
|
428589
429034
|
if (!found) {
|
|
428590
429035
|
throw new Error("No se encontr\xF3 el launcher bin/theus para el worker Fleet");
|
|
428591
429036
|
}
|
|
@@ -428790,26 +429235,26 @@ import {
|
|
|
428790
429235
|
chmod as chmod13,
|
|
428791
429236
|
lstat as lstat7,
|
|
428792
429237
|
mkdir as mkdir50,
|
|
428793
|
-
open as
|
|
429238
|
+
open as open20,
|
|
428794
429239
|
readFile as readFile57,
|
|
428795
429240
|
rename as rename10,
|
|
428796
429241
|
unlink as unlink26
|
|
428797
429242
|
} from "fs/promises";
|
|
428798
|
-
import { homedir as
|
|
429243
|
+
import { homedir as homedir45 } from "os";
|
|
428799
429244
|
import { dirname as dirname64, resolve as resolve52 } from "path";
|
|
428800
429245
|
function defaultFleetCredentialsPath() {
|
|
428801
|
-
return resolve52(
|
|
429246
|
+
return resolve52(homedir45(), ".theus", "titan", "fleet-worker.json");
|
|
428802
429247
|
}
|
|
428803
429248
|
async function rejectSymlink(path19) {
|
|
428804
|
-
const
|
|
429249
|
+
const stat50 = await lstat7(path19).catch((error40) => {
|
|
428805
429250
|
if (error40.code === "ENOENT")
|
|
428806
429251
|
return;
|
|
428807
429252
|
throw error40;
|
|
428808
429253
|
});
|
|
428809
|
-
if (
|
|
429254
|
+
if (stat50?.isSymbolicLink()) {
|
|
428810
429255
|
throw new Error("Se rechaz\xF3 un symlink como almac\xE9n de credenciales Fleet");
|
|
428811
429256
|
}
|
|
428812
|
-
if (
|
|
429257
|
+
if (stat50 && !stat50.isFile()) {
|
|
428813
429258
|
throw new Error("El almac\xE9n de credenciales Fleet no es un archivo regular");
|
|
428814
429259
|
}
|
|
428815
429260
|
}
|
|
@@ -428841,7 +429286,7 @@ async function saveFleetCredentials(value, path19 = defaultFleetCredentialsPath(
|
|
|
428841
429286
|
await rejectSymlink(path19);
|
|
428842
429287
|
const temp = `${path19}.tmp-${process.pid}-${randomUUID38()}`;
|
|
428843
429288
|
const flags = constants5.O_WRONLY | constants5.O_CREAT | constants5.O_EXCL | (constants5.O_NOFOLLOW ?? 0);
|
|
428844
|
-
const handle2 = await
|
|
429289
|
+
const handle2 = await open20(temp, flags, 384);
|
|
428845
429290
|
try {
|
|
428846
429291
|
await handle2.writeFile(`${JSON.stringify(parsed, null, 2)}
|
|
428847
429292
|
`, "utf8");
|
|
@@ -428873,29 +429318,29 @@ var init_tokenStore = __esm(() => {
|
|
|
428873
429318
|
|
|
428874
429319
|
// services/titanFleet/outbox.ts
|
|
428875
429320
|
import { constants as constants6 } from "fs";
|
|
428876
|
-
import { createHash as
|
|
429321
|
+
import { createHash as createHash33, randomUUID as randomUUID39 } from "crypto";
|
|
428877
429322
|
import {
|
|
428878
429323
|
chmod as chmod14,
|
|
428879
429324
|
lstat as lstat8,
|
|
428880
429325
|
mkdir as mkdir51,
|
|
428881
|
-
open as
|
|
429326
|
+
open as open21,
|
|
428882
429327
|
readFile as readFile58,
|
|
428883
429328
|
rename as rename11,
|
|
428884
|
-
stat as
|
|
429329
|
+
stat as stat50,
|
|
428885
429330
|
unlink as unlink27
|
|
428886
429331
|
} from "fs/promises";
|
|
428887
|
-
import { homedir as
|
|
429332
|
+
import { homedir as homedir46 } from "os";
|
|
428888
429333
|
import { dirname as dirname65, resolve as resolve53 } from "path";
|
|
428889
429334
|
function defaultFleetOutboxPath() {
|
|
428890
|
-
return resolve53(
|
|
429335
|
+
return resolve53(homedir46(), ".theus", "titan", "fleet-terminal-outbox.json");
|
|
428891
429336
|
}
|
|
428892
429337
|
function fingerprint(value) {
|
|
428893
|
-
return
|
|
429338
|
+
return createHash33("sha256").update(JSON.stringify(value)).digest("hex");
|
|
428894
429339
|
}
|
|
428895
429340
|
function createFleetTerminalRecord(options2) {
|
|
428896
429341
|
const now2 = new Date().toISOString();
|
|
428897
429342
|
const parsedPayload = options2.operation === "complete" ? fleetLeaseCompleteSchema.parse(options2.payload) : fleetLeaseFailSchema.parse(options2.payload);
|
|
428898
|
-
const recordId =
|
|
429343
|
+
const recordId = createHash33("sha256").update(`${options2.worker_id}\x00${options2.lease_id}\x00${options2.generation}\x00${options2.operation}\x00${options2.completion_key}`).digest("hex");
|
|
428899
429344
|
const immutable = {
|
|
428900
429345
|
gateway: options2.gateway,
|
|
428901
429346
|
operation: options2.operation,
|
|
@@ -428951,7 +429396,7 @@ async function rejectSymlink2(path19) {
|
|
|
428951
429396
|
}
|
|
428952
429397
|
async function readRecords(path19) {
|
|
428953
429398
|
await rejectSymlink2(path19);
|
|
428954
|
-
const info = await
|
|
429399
|
+
const info = await stat50(path19).catch((error40) => {
|
|
428955
429400
|
if (error40.code === "ENOENT")
|
|
428956
429401
|
return;
|
|
428957
429402
|
throw error40;
|
|
@@ -429008,7 +429453,7 @@ async function writeRecords(path19, records) {
|
|
|
429008
429453
|
await chmod14(directory, 448);
|
|
429009
429454
|
await rejectSymlink2(path19);
|
|
429010
429455
|
const temp = `${path19}.tmp-${process.pid}-${randomUUID39()}`;
|
|
429011
|
-
const handle2 = await
|
|
429456
|
+
const handle2 = await open21(temp, constants6.O_WRONLY | constants6.O_CREAT | constants6.O_EXCL | (constants6.O_NOFOLLOW ?? 0), 384);
|
|
429012
429457
|
try {
|
|
429013
429458
|
await handle2.writeFile(serialized, "utf8");
|
|
429014
429459
|
await handle2.sync();
|
|
@@ -429019,7 +429464,7 @@ async function writeRecords(path19, records) {
|
|
|
429019
429464
|
await chmod14(temp, 384);
|
|
429020
429465
|
await rename11(temp, path19);
|
|
429021
429466
|
await chmod14(path19, 384);
|
|
429022
|
-
const directoryHandle = await
|
|
429467
|
+
const directoryHandle = await open21(directory, constants6.O_RDONLY);
|
|
429023
429468
|
try {
|
|
429024
429469
|
await directoryHandle.sync();
|
|
429025
429470
|
} finally {
|
|
@@ -429155,7 +429600,7 @@ var init_outbox = __esm(() => {
|
|
|
429155
429600
|
});
|
|
429156
429601
|
|
|
429157
429602
|
// services/titanFleet/worker.ts
|
|
429158
|
-
import { createHash as
|
|
429603
|
+
import { createHash as createHash34 } from "crypto";
|
|
429159
429604
|
function wait(ms, signal) {
|
|
429160
429605
|
if (signal?.aborted)
|
|
429161
429606
|
return Promise.reject(signal.reason);
|
|
@@ -429175,7 +429620,7 @@ function wait(ms, signal) {
|
|
|
429175
429620
|
});
|
|
429176
429621
|
}
|
|
429177
429622
|
function completionKey(lease) {
|
|
429178
|
-
const digest =
|
|
429623
|
+
const digest = createHash34("sha256").update(`${TITAN_FLEET_PROTOCOL}:${lease.job.job_id}:${lease.generation}:${lease.lease_id}`).digest("hex");
|
|
429179
429624
|
return `fleet:${digest}`;
|
|
429180
429625
|
}
|
|
429181
429626
|
function asError(value) {
|
|
@@ -429858,7 +430303,7 @@ async function runTitanFleetWorker(args) {
|
|
|
429858
430303
|
max_concurrency: maxConcurrency,
|
|
429859
430304
|
runtime: {
|
|
429860
430305
|
name: "theus-cli",
|
|
429861
|
-
version: { VERSION: "0.2.
|
|
430306
|
+
version: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
429862
430307
|
}
|
|
429863
430308
|
});
|
|
429864
430309
|
const client2 = new TitanFleetClient({
|
|
@@ -430580,9 +431025,9 @@ var init_titan_fleet_run = __esm(() => {
|
|
|
430580
431025
|
|
|
430581
431026
|
// utils/cronTasksLock.ts
|
|
430582
431027
|
import { mkdir as mkdir52, readFile as readFile60, unlink as unlink28, writeFile as writeFile51 } from "fs/promises";
|
|
430583
|
-
import { dirname as dirname66, join as
|
|
431028
|
+
import { dirname as dirname66, join as join157 } from "path";
|
|
430584
431029
|
function getLockPath(dir) {
|
|
430585
|
-
return
|
|
431030
|
+
return join157(dir ?? getProjectRoot(), LOCK_FILE_REL);
|
|
430586
431031
|
}
|
|
430587
431032
|
async function readLock(dir) {
|
|
430588
431033
|
let raw;
|
|
@@ -430688,7 +431133,7 @@ var init_cronTasksLock = __esm(() => {
|
|
|
430688
431133
|
init_genericProcessUtils();
|
|
430689
431134
|
init_json();
|
|
430690
431135
|
init_slowOperations();
|
|
430691
|
-
LOCK_FILE_REL =
|
|
431136
|
+
LOCK_FILE_REL = join157(".theus", "scheduled_tasks.lock");
|
|
430692
431137
|
schedulerLockSchema = lazySchema(() => exports_external.object({
|
|
430693
431138
|
sessionId: exports_external.string(),
|
|
430694
431139
|
pid: exports_external.number(),
|
|
@@ -430991,20 +431436,20 @@ import {
|
|
|
430991
431436
|
appendFileSync as appendFileSync5,
|
|
430992
431437
|
mkdirSync as mkdirSync13,
|
|
430993
431438
|
readdirSync as readdirSync5,
|
|
430994
|
-
readFileSync as
|
|
431439
|
+
readFileSync as readFileSync31,
|
|
430995
431440
|
unlinkSync as unlinkSync4,
|
|
430996
431441
|
writeFileSync as writeFileSync12
|
|
430997
431442
|
} from "fs";
|
|
430998
|
-
import { homedir as
|
|
430999
|
-
import { dirname as dirname67, join as
|
|
431443
|
+
import { homedir as homedir47 } from "os";
|
|
431444
|
+
import { dirname as dirname67, join as join158 } from "path";
|
|
431000
431445
|
import { fileURLToPath as fileURLToPath7 } from "url";
|
|
431001
431446
|
function projectsConfigPath() {
|
|
431002
|
-
return
|
|
431447
|
+
return join158(homedir47(), ".theus", "daemon", "projects.json");
|
|
431003
431448
|
}
|
|
431004
431449
|
function readEnabledProjects() {
|
|
431005
431450
|
let raw;
|
|
431006
431451
|
try {
|
|
431007
|
-
raw =
|
|
431452
|
+
raw = readFileSync31(projectsConfigPath(), "utf8");
|
|
431008
431453
|
} catch {
|
|
431009
431454
|
return [];
|
|
431010
431455
|
}
|
|
@@ -431018,17 +431463,17 @@ function readEnabledProjects() {
|
|
|
431018
431463
|
return list3.filter((p) => p && typeof p.dir === "string" && p.enabled !== false);
|
|
431019
431464
|
}
|
|
431020
431465
|
function daemonDir2() {
|
|
431021
|
-
return
|
|
431466
|
+
return join158(homedir47(), ".theus", "daemon");
|
|
431022
431467
|
}
|
|
431023
431468
|
function daemonLogPath() {
|
|
431024
|
-
return
|
|
431469
|
+
return join158(daemonDir2(), "daemon.log");
|
|
431025
431470
|
}
|
|
431026
431471
|
function resolveWorkerBin() {
|
|
431027
431472
|
const override = process.env.THEUS_DAEMON_WORKER_BIN;
|
|
431028
431473
|
if (typeof override === "string" && override.length > 0)
|
|
431029
431474
|
return override;
|
|
431030
431475
|
const here = dirname67(fileURLToPath7(import.meta.url));
|
|
431031
|
-
return
|
|
431476
|
+
return join158(here, "..", "bin", "theus");
|
|
431032
431477
|
}
|
|
431033
431478
|
function turnTimeoutMs() {
|
|
431034
431479
|
const raw = process.env.THEUS_DAEMON_TURN_TIMEOUT_MS;
|
|
@@ -431061,10 +431506,10 @@ function logDaemonLine(line) {
|
|
|
431061
431506
|
}
|
|
431062
431507
|
function writeRunHistory(record3) {
|
|
431063
431508
|
try {
|
|
431064
|
-
const dir =
|
|
431509
|
+
const dir = join158(daemonDir2(), "runs", record3.taskId);
|
|
431065
431510
|
mkdirSync13(dir, { recursive: true });
|
|
431066
431511
|
const stamp2 = record3.startedAt.replace(/:/g, "-");
|
|
431067
|
-
writeFileSync12(
|
|
431512
|
+
writeFileSync12(join158(dir, `${stamp2}.json`), JSON.stringify(record3, null, 2), "utf8");
|
|
431068
431513
|
pruneRunHistory(record3.taskId);
|
|
431069
431514
|
} catch (e) {
|
|
431070
431515
|
logDaemonLine(`[daemon:cron] ERROR guardando historial task=${record3.taskId}: ${e?.message}`);
|
|
@@ -431075,13 +431520,13 @@ function pruneRunHistory(taskId) {
|
|
|
431075
431520
|
const raw = process.env.THEUS_DAEMON_RUNS_KEEP;
|
|
431076
431521
|
const parsed = raw ? Number.parseInt(raw, 10) : NaN;
|
|
431077
431522
|
const keep = Number.isInteger(parsed) && parsed > 0 ? parsed : 50;
|
|
431078
|
-
const dir =
|
|
431523
|
+
const dir = join158(daemonDir2(), "runs", taskId);
|
|
431079
431524
|
const files2 = readdirSync5(dir).filter((f) => f.endsWith(".json")).sort();
|
|
431080
431525
|
if (files2.length <= keep)
|
|
431081
431526
|
return;
|
|
431082
431527
|
for (const f of files2.slice(0, files2.length - keep)) {
|
|
431083
431528
|
try {
|
|
431084
|
-
unlinkSync4(
|
|
431529
|
+
unlinkSync4(join158(dir, f));
|
|
431085
431530
|
} catch {}
|
|
431086
431531
|
}
|
|
431087
431532
|
} catch {}
|
|
@@ -431264,29 +431709,29 @@ __export(exports_main, {
|
|
|
431264
431709
|
daemonMain: () => daemonMain
|
|
431265
431710
|
});
|
|
431266
431711
|
import {
|
|
431267
|
-
existsSync as
|
|
431712
|
+
existsSync as existsSync28,
|
|
431268
431713
|
mkdirSync as mkdirSync14,
|
|
431269
|
-
readFileSync as
|
|
431714
|
+
readFileSync as readFileSync32,
|
|
431270
431715
|
rmSync as rmSync6,
|
|
431271
431716
|
writeFileSync as writeFileSync13
|
|
431272
431717
|
} from "fs";
|
|
431273
|
-
import { homedir as
|
|
431274
|
-
import { dirname as dirname68, join as
|
|
431718
|
+
import { homedir as homedir48 } from "os";
|
|
431719
|
+
import { dirname as dirname68, join as join159 } from "path";
|
|
431275
431720
|
function daemonDir3() {
|
|
431276
|
-
return
|
|
431721
|
+
return join159(homedir48(), ".theus", "daemon");
|
|
431277
431722
|
}
|
|
431278
431723
|
function pidFilePath() {
|
|
431279
|
-
return
|
|
431724
|
+
return join159(daemonDir3(), "theus-daemon.pid");
|
|
431280
431725
|
}
|
|
431281
431726
|
function logFilePath() {
|
|
431282
|
-
return
|
|
431727
|
+
return join159(daemonDir3(), "daemon.log");
|
|
431283
431728
|
}
|
|
431284
431729
|
function ensureDaemonDir() {
|
|
431285
431730
|
mkdirSync14(daemonDir3(), { recursive: true });
|
|
431286
431731
|
}
|
|
431287
431732
|
function readPid() {
|
|
431288
431733
|
try {
|
|
431289
|
-
const raw =
|
|
431734
|
+
const raw = readFileSync32(pidFilePath(), "utf8").trim();
|
|
431290
431735
|
const pid = Number.parseInt(raw, 10);
|
|
431291
431736
|
return Number.isInteger(pid) && pid > 0 ? pid : null;
|
|
431292
431737
|
} catch {
|
|
@@ -431353,13 +431798,13 @@ function doStatus() {
|
|
|
431353
431798
|
}
|
|
431354
431799
|
function doLogs() {
|
|
431355
431800
|
const path19 = logFilePath();
|
|
431356
|
-
if (!
|
|
431801
|
+
if (!existsSync28(path19)) {
|
|
431357
431802
|
console.log(`Sin registro de daemon todav\xEDa (${path19}).`);
|
|
431358
431803
|
return;
|
|
431359
431804
|
}
|
|
431360
431805
|
let content;
|
|
431361
431806
|
try {
|
|
431362
|
-
content =
|
|
431807
|
+
content = readFileSync32(path19, "utf8");
|
|
431363
431808
|
} catch (e) {
|
|
431364
431809
|
console.error(`No se pudo leer el registro: ${e?.message}`);
|
|
431365
431810
|
return;
|
|
@@ -431377,7 +431822,7 @@ function resolveTheusBin() {
|
|
|
431377
431822
|
return "theus";
|
|
431378
431823
|
}
|
|
431379
431824
|
function macosServiceSpec() {
|
|
431380
|
-
const path19 =
|
|
431825
|
+
const path19 = join159(homedir48(), "Library", "LaunchAgents", "pe.theus.daemon.plist");
|
|
431381
431826
|
const bin = resolveTheusBin();
|
|
431382
431827
|
const logDir = daemonDir3();
|
|
431383
431828
|
const content = `<?xml version="1.0" encoding="UTF-8"?>
|
|
@@ -431404,9 +431849,9 @@ function macosServiceSpec() {
|
|
|
431404
431849
|
<key>KeepAlive</key>
|
|
431405
431850
|
<true/>
|
|
431406
431851
|
<key>StandardOutPath</key>
|
|
431407
|
-
<string>${
|
|
431852
|
+
<string>${join159(logDir, "launchd.out.log")}</string>
|
|
431408
431853
|
<key>StandardErrorPath</key>
|
|
431409
|
-
<string>${
|
|
431854
|
+
<string>${join159(logDir, "launchd.err.log")}</string>
|
|
431410
431855
|
</dict>
|
|
431411
431856
|
</plist>
|
|
431412
431857
|
`;
|
|
@@ -431421,7 +431866,7 @@ function macosServiceSpec() {
|
|
|
431421
431866
|
};
|
|
431422
431867
|
}
|
|
431423
431868
|
function linuxServiceSpec() {
|
|
431424
|
-
const path19 =
|
|
431869
|
+
const path19 = join159(homedir48(), ".config", "systemd", "user", "theus-daemon.service");
|
|
431425
431870
|
const bin = resolveTheusBin();
|
|
431426
431871
|
const content = `[Unit]
|
|
431427
431872
|
Description=Theus daemon (cron/agent supervisor)
|
|
@@ -431505,11 +431950,11 @@ function doUninstall(args) {
|
|
|
431505
431950
|
if (!hasConfirm(args)) {
|
|
431506
431951
|
console.log(`[dry-run] Desinstalaci\xF3n del daemon de Theus (${spec.platform}).
|
|
431507
431952
|
` + `Se eliminar\xEDa: ${spec.path}
|
|
431508
|
-
` + (
|
|
431953
|
+
` + (existsSync28(spec.path) ? "El archivo existe y ser\xEDa borrado." : "El archivo no existe actualmente (nada que borrar).") + `
|
|
431509
431954
|
Vuelve a ejecutar con --confirm para eliminarlo.`);
|
|
431510
431955
|
return;
|
|
431511
431956
|
}
|
|
431512
|
-
if (!
|
|
431957
|
+
if (!existsSync28(spec.path)) {
|
|
431513
431958
|
console.log(`No hay archivo de servicio que eliminar en: ${spec.path}`);
|
|
431514
431959
|
return;
|
|
431515
431960
|
}
|
|
@@ -431749,7 +432194,7 @@ function createBridgeLogger(options2) {
|
|
|
431749
432194
|
connectUrl = buildBridgeConnectUrl(environmentId, cachedIngressUrl);
|
|
431750
432195
|
regenerateQr(connectUrl);
|
|
431751
432196
|
if (verbose) {
|
|
431752
|
-
write(source_default.dim(`Remote Control`) + ` v${{ VERSION: "0.2.
|
|
432197
|
+
write(source_default.dim(`Remote Control`) + ` v${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}
|
|
431753
432198
|
`);
|
|
431754
432199
|
}
|
|
431755
432200
|
if (verbose) {
|
|
@@ -432157,7 +432602,7 @@ var init_pollConfig = __esm(() => {
|
|
|
432157
432602
|
import { spawn as spawn13 } from "child_process";
|
|
432158
432603
|
import { createWriteStream as createWriteStream4 } from "fs";
|
|
432159
432604
|
import { tmpdir as tmpdir14 } from "os";
|
|
432160
|
-
import { dirname as dirname69, join as
|
|
432605
|
+
import { dirname as dirname69, join as join160 } from "path";
|
|
432161
432606
|
import { createInterface } from "readline";
|
|
432162
432607
|
function safeFilenameId(id2) {
|
|
432163
432608
|
return id2.replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
@@ -432290,12 +432735,12 @@ function createSessionSpawner(deps) {
|
|
|
432290
432735
|
debugFile = `${deps.debugFile}-${safeId}`;
|
|
432291
432736
|
}
|
|
432292
432737
|
} else if (deps.verbose || false) {
|
|
432293
|
-
debugFile =
|
|
432738
|
+
debugFile = join160(tmpdir14(), "theus", `bridge-session-${safeId}.log`);
|
|
432294
432739
|
}
|
|
432295
432740
|
let transcriptStream = null;
|
|
432296
432741
|
let transcriptPath;
|
|
432297
432742
|
if (deps.debugFile) {
|
|
432298
|
-
transcriptPath =
|
|
432743
|
+
transcriptPath = join160(dirname69(deps.debugFile), `bridge-transcript-${safeId}.jsonl`);
|
|
432299
432744
|
transcriptStream = createWriteStream4(transcriptPath, { flags: "a" });
|
|
432300
432745
|
transcriptStream.on("error", (err2) => {
|
|
432301
432746
|
deps.onDebug(`[bridge:session] Transcript write error: ${err2.message}`);
|
|
@@ -432568,10 +433013,10 @@ __export(exports_bridgePointer, {
|
|
|
432568
433013
|
clearBridgePointer: () => clearBridgePointer,
|
|
432569
433014
|
BRIDGE_POINTER_TTL_MS: () => BRIDGE_POINTER_TTL_MS
|
|
432570
433015
|
});
|
|
432571
|
-
import { mkdir as mkdir53, readFile as readFile61, stat as
|
|
432572
|
-
import { dirname as dirname70, join as
|
|
433016
|
+
import { mkdir as mkdir53, readFile as readFile61, stat as stat51, unlink as unlink29, writeFile as writeFile52 } from "fs/promises";
|
|
433017
|
+
import { dirname as dirname70, join as join161 } from "path";
|
|
432573
433018
|
function getBridgePointerPath(dir) {
|
|
432574
|
-
return
|
|
433019
|
+
return join161(getProjectsDir(), sanitizePath2(dir), "bridge-pointer.json");
|
|
432575
433020
|
}
|
|
432576
433021
|
async function writeBridgePointer(dir, pointer) {
|
|
432577
433022
|
const path19 = getBridgePointerPath(dir);
|
|
@@ -432588,7 +433033,7 @@ async function readBridgePointer(dir) {
|
|
|
432588
433033
|
let raw;
|
|
432589
433034
|
let mtimeMs;
|
|
432590
433035
|
try {
|
|
432591
|
-
mtimeMs = (await
|
|
433036
|
+
mtimeMs = (await stat51(path19)).mtimeMs;
|
|
432592
433037
|
raw = await readFile61(path19, "utf8");
|
|
432593
433038
|
} catch {
|
|
432594
433039
|
return null;
|
|
@@ -432673,12 +433118,12 @@ var init_bridgePointer = __esm(() => {
|
|
|
432673
433118
|
});
|
|
432674
433119
|
|
|
432675
433120
|
// utils/errorLogSink.ts
|
|
432676
|
-
import { dirname as dirname71, join as
|
|
433121
|
+
import { dirname as dirname71, join as join162 } from "path";
|
|
432677
433122
|
function getErrorsPath() {
|
|
432678
|
-
return
|
|
433123
|
+
return join162(CACHE_PATHS.errors(), DATE + ".jsonl");
|
|
432679
433124
|
}
|
|
432680
433125
|
function getMCPLogsPath(serverName) {
|
|
432681
|
-
return
|
|
433126
|
+
return join162(CACHE_PATHS.mcpLogs(serverName), DATE + ".jsonl");
|
|
432682
433127
|
}
|
|
432683
433128
|
function createJsonlWriter(options2) {
|
|
432684
433129
|
const writer = createBufferedWriter(options2);
|
|
@@ -432722,7 +433167,7 @@ function appendToLog(path19, message) {
|
|
|
432722
433167
|
cwd: getFsImplementation().cwd(),
|
|
432723
433168
|
userType: "external",
|
|
432724
433169
|
sessionId: getSessionId(),
|
|
432725
|
-
version: { VERSION: "0.2.
|
|
433170
|
+
version: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
432726
433171
|
};
|
|
432727
433172
|
getLogWriter(path19).write(messageWithTimestamp);
|
|
432728
433173
|
}
|
|
@@ -432834,7 +433279,7 @@ __export(exports_bridgeMain, {
|
|
|
432834
433279
|
});
|
|
432835
433280
|
import { randomUUID as randomUUID42 } from "crypto";
|
|
432836
433281
|
import { hostname as hostname4, tmpdir as tmpdir15 } from "os";
|
|
432837
|
-
import { basename as basename51, join as
|
|
433282
|
+
import { basename as basename51, join as join163, resolve as resolve56 } from "path";
|
|
432838
433283
|
async function isMultiSessionSpawnEnabled() {
|
|
432839
433284
|
return checkGate_CACHED_OR_BLOCKING("theus_ccr_bridge_multi_session");
|
|
432840
433285
|
}
|
|
@@ -433347,7 +433792,7 @@ async function runBridgeLoop(config3, environmentId, environmentSecret, api2, sp
|
|
|
433347
433792
|
sessionDebugFile = `${config3.debugFile}-${safeId}`;
|
|
433348
433793
|
}
|
|
433349
433794
|
} else if (config3.verbose || false) {
|
|
433350
|
-
sessionDebugFile =
|
|
433795
|
+
sessionDebugFile = join163(tmpdir15(), "theus", `bridge-session-${safeId}.log`);
|
|
433351
433796
|
}
|
|
433352
433797
|
if (sessionDebugFile) {
|
|
433353
433798
|
logger.logVerbose(`Debug log: ${sessionDebugFile}`);
|
|
@@ -433983,7 +434428,7 @@ Spawn mode for this project:
|
|
|
433983
434428
|
const api2 = createBridgeApiClient({
|
|
433984
434429
|
baseUrl,
|
|
433985
434430
|
getAccessToken: getBridgeAccessToken2,
|
|
433986
|
-
runnerVersion: { VERSION: "0.2.
|
|
434431
|
+
runnerVersion: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
433987
434432
|
onDebug: logForDebugging,
|
|
433988
434433
|
onAuth401: handleOAuth401Error2,
|
|
433989
434434
|
getTrustedDeviceToken
|
|
@@ -434221,7 +434666,7 @@ async function runBridgeHeadless(opts, signal) {
|
|
|
434221
434666
|
const api2 = createBridgeApiClient({
|
|
434222
434667
|
baseUrl,
|
|
434223
434668
|
getAccessToken: opts.getAccessToken,
|
|
434224
|
-
runnerVersion: { VERSION: "0.2.
|
|
434669
|
+
runnerVersion: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
434225
434670
|
onDebug: log2,
|
|
434226
434671
|
onAuth401: opts.onAuth401,
|
|
434227
434672
|
getTrustedDeviceToken
|
|
@@ -434321,7 +434766,7 @@ var init_bridgeMain = __esm(() => {
|
|
|
434321
434766
|
init_pollConfig();
|
|
434322
434767
|
init_sessionRunner();
|
|
434323
434768
|
init_trustedDevice();
|
|
434324
|
-
|
|
434769
|
+
init_types13();
|
|
434325
434770
|
init_workSecret();
|
|
434326
434771
|
DEFAULT_BACKOFF = {
|
|
434327
434772
|
connInitialMs: 2000,
|
|
@@ -437318,7 +437763,7 @@ function buildSystemInitMessage(inputs) {
|
|
|
437318
437763
|
slash_commands: inputs.commands.filter((c5) => c5.userInvocable !== false).map((c5) => c5.name),
|
|
437319
437764
|
apiKeySource: getTheusApiKeyWithSource().source,
|
|
437320
437765
|
betas: getSdkBetas(),
|
|
437321
|
-
theus_code_version: { VERSION: "0.2.
|
|
437766
|
+
theus_code_version: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
437322
437767
|
output_style: outputStyle2,
|
|
437323
437768
|
agents: inputs.agents.map((agent) => agent.agentType),
|
|
437324
437769
|
skills: inputs.skills.filter((s) => s.userInvocable !== false).map((skill) => skill.name),
|
|
@@ -437358,8 +437803,8 @@ async function getEnvLessBridgeConfig() {
|
|
|
437358
437803
|
}
|
|
437359
437804
|
async function checkEnvLessBridgeMinVersion() {
|
|
437360
437805
|
const cfg = await getEnvLessBridgeConfig();
|
|
437361
|
-
if (cfg.min_version && lt({ VERSION: "0.2.
|
|
437362
|
-
return `Your version of Theus (${{ VERSION: "0.2.
|
|
437806
|
+
if (cfg.min_version && lt({ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, cfg.min_version)) {
|
|
437807
|
+
return `Your version of Theus (${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}) is too old for Remote Control.
|
|
437363
437808
|
Version ${cfg.min_version} or higher is required. Run \`theus update\` to update.`;
|
|
437364
437809
|
}
|
|
437365
437810
|
return null;
|
|
@@ -439683,7 +440128,7 @@ async function initBridgeCore(params) {
|
|
|
439683
440128
|
const rawApi = createBridgeApiClient({
|
|
439684
440129
|
baseUrl,
|
|
439685
440130
|
getAccessToken,
|
|
439686
|
-
runnerVersion: { VERSION: "0.2.
|
|
440131
|
+
runnerVersion: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
439687
440132
|
onDebug: logForDebugging,
|
|
439688
440133
|
onAuth401,
|
|
439689
440134
|
getTrustedDeviceToken
|
|
@@ -441517,7 +441962,7 @@ __export(exports_inboundAttachments, {
|
|
|
441517
441962
|
});
|
|
441518
441963
|
import { randomUUID as randomUUID47 } from "crypto";
|
|
441519
441964
|
import { mkdir as mkdir54, writeFile as writeFile53 } from "fs/promises";
|
|
441520
|
-
import { basename as basename52, join as
|
|
441965
|
+
import { basename as basename52, join as join164 } from "path";
|
|
441521
441966
|
function debug2(msg) {
|
|
441522
441967
|
logForDebugging(`[bridge:inbound-attach] ${msg}`);
|
|
441523
441968
|
}
|
|
@@ -441533,7 +441978,7 @@ function sanitizeFileName(name) {
|
|
|
441533
441978
|
return base2 || "attachment";
|
|
441534
441979
|
}
|
|
441535
441980
|
function uploadsDir() {
|
|
441536
|
-
return
|
|
441981
|
+
return join164(getTheusConfigHomeDir(), "uploads", getSessionId());
|
|
441537
441982
|
}
|
|
441538
441983
|
async function resolveOne(att) {
|
|
441539
441984
|
const token = getBridgeAccessToken();
|
|
@@ -441562,7 +442007,7 @@ async function resolveOne(att) {
|
|
|
441562
442007
|
const safeName = sanitizeFileName(att.file_name);
|
|
441563
442008
|
const prefix = (att.file_uuid.slice(0, 8) || randomUUID47().slice(0, 8)).replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
441564
442009
|
const dir = uploadsDir();
|
|
441565
|
-
const outPath =
|
|
442010
|
+
const outPath = join164(dir, `${prefix}-${safeName}`);
|
|
441566
442011
|
try {
|
|
441567
442012
|
await mkdir54(dir, { recursive: true });
|
|
441568
442013
|
await writeFile53(outPath, data);
|
|
@@ -446431,7 +446876,7 @@ async function loadFigSpec(command9) {
|
|
|
446431
446876
|
}
|
|
446432
446877
|
}
|
|
446433
446878
|
var getCommandSpec;
|
|
446434
|
-
var
|
|
446879
|
+
var init_registry5 = __esm(() => {
|
|
446435
446880
|
init_memoize2();
|
|
446436
446881
|
init_specs();
|
|
446437
446882
|
getCommandSpec = memoizeWithLRU(async (command9) => {
|
|
@@ -446555,7 +447000,7 @@ var init_prefix2 = __esm(() => {
|
|
|
446555
447000
|
init_specPrefix();
|
|
446556
447001
|
init_commands();
|
|
446557
447002
|
init_parser4();
|
|
446558
|
-
|
|
447003
|
+
init_registry5();
|
|
446559
447004
|
NUMERIC = /^\d+$/;
|
|
446560
447005
|
ENV_VAR = /^[A-Za-z_][A-Za-z0-9_]*=/;
|
|
446561
447006
|
WRAPPER_COMMANDS = new Set([
|
|
@@ -448421,8 +448866,8 @@ var init_ShowInIDEPrompt = __esm(() => {
|
|
|
448421
448866
|
});
|
|
448422
448867
|
|
|
448423
448868
|
// components/permissions/FilePermissionDialog/permissionOptions.tsx
|
|
448424
|
-
import { homedir as
|
|
448425
|
-
import { basename as basename56, join as
|
|
448869
|
+
import { homedir as homedir49 } from "os";
|
|
448870
|
+
import { basename as basename56, join as join165, sep as sep34 } from "path";
|
|
448426
448871
|
function isInTheusFolder(filePath) {
|
|
448427
448872
|
const absolutePath = expandPath(filePath);
|
|
448428
448873
|
const theusFolderPath = expandPath(`${getOriginalCwd()}/.theus`);
|
|
@@ -448432,7 +448877,7 @@ function isInTheusFolder(filePath) {
|
|
|
448432
448877
|
}
|
|
448433
448878
|
function isInGlobalTheusFolder(filePath) {
|
|
448434
448879
|
const absolutePath = expandPath(filePath);
|
|
448435
|
-
const globalTheusFolderPath =
|
|
448880
|
+
const globalTheusFolderPath = join165(homedir49(), ".theus");
|
|
448436
448881
|
const normalizedAbsolutePath = normalizeCaseForComparison(absolutePath);
|
|
448437
448882
|
const normalizedGlobalTheusFolderPath = normalizeCaseForComparison(globalTheusFolderPath);
|
|
448438
448883
|
return normalizedAbsolutePath.startsWith(normalizedGlobalTheusFolderPath + sep34.toLowerCase()) || normalizedAbsolutePath.startsWith(normalizedGlobalTheusFolderPath + "/");
|
|
@@ -453114,7 +453559,7 @@ function wordAlignedLCP(strings) {
|
|
|
453114
453559
|
return firstWords.slice(0, commonWordCount).join(" ");
|
|
453115
453560
|
}
|
|
453116
453561
|
var init_staticPrefix = __esm(() => {
|
|
453117
|
-
|
|
453562
|
+
init_registry5();
|
|
453118
453563
|
init_specPrefix();
|
|
453119
453564
|
init_stringUtils();
|
|
453120
453565
|
init_dangerousCmdlets();
|
|
@@ -456324,7 +456769,7 @@ var init_useVoiceEnabled = __esm(() => {
|
|
|
456324
456769
|
function getSemverPart(version3) {
|
|
456325
456770
|
return `${import_semver11.major(version3, { loose: true })}.${import_semver11.minor(version3, { loose: true })}.${import_semver11.patch(version3, { loose: true })}`;
|
|
456326
456771
|
}
|
|
456327
|
-
function useUpdateNotification(updatedVersion, initialVersion = { VERSION: "0.2.
|
|
456772
|
+
function useUpdateNotification(updatedVersion, initialVersion = { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION) {
|
|
456328
456773
|
const [lastNotifiedSemver, setLastNotifiedSemver] = import_react235.useState(() => getSemverPart(initialVersion));
|
|
456329
456774
|
if (!updatedVersion) {
|
|
456330
456775
|
return null;
|
|
@@ -456364,7 +456809,7 @@ function AutoUpdater({
|
|
|
456364
456809
|
return;
|
|
456365
456810
|
}
|
|
456366
456811
|
if (false) {}
|
|
456367
|
-
const currentVersion = { VERSION: "0.2.
|
|
456812
|
+
const currentVersion = { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
|
|
456368
456813
|
const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
|
|
456369
456814
|
let latestVersion = await getLatestVersion(channel2);
|
|
456370
456815
|
const isDisabled2 = isAutoUpdaterDisabled();
|
|
@@ -456499,7 +456944,7 @@ function AutoUpdater({
|
|
|
456499
456944
|
" ",
|
|
456500
456945
|
/* @__PURE__ */ jsx_runtime414.jsx(ThemedText, {
|
|
456501
456946
|
bold: true,
|
|
456502
|
-
children: hasLocalInstall ? `cd ~/.theus/local && npm update ${{ VERSION: "0.2.
|
|
456947
|
+
children: hasLocalInstall ? `cd ~/.theus/local && npm update ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}` : `npm i -g ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}`
|
|
456503
456948
|
})
|
|
456504
456949
|
]
|
|
456505
456950
|
})
|
|
@@ -456576,12 +457021,12 @@ function NativeAutoUpdater({
|
|
|
456576
457021
|
logEvent("theus_native_auto_updater_start", {});
|
|
456577
457022
|
try {
|
|
456578
457023
|
const maxVersion = await getMaxVersion();
|
|
456579
|
-
if (maxVersion && gt({ VERSION: "0.2.
|
|
457024
|
+
if (maxVersion && gt({ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, maxVersion)) {
|
|
456580
457025
|
const msg = await getMaxVersionMessage();
|
|
456581
457026
|
setMaxVersionIssue(msg ?? "affects your version");
|
|
456582
457027
|
}
|
|
456583
457028
|
const result = await installLatest(channel2);
|
|
456584
|
-
const currentVersion = { VERSION: "0.2.
|
|
457029
|
+
const currentVersion = { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
|
|
456585
457030
|
const latencyMs = Date.now() - startTime2;
|
|
456586
457031
|
if (result.lockFailed) {
|
|
456587
457032
|
logEvent("theus_native_auto_updater_lock_contention", {
|
|
@@ -456718,17 +457163,17 @@ function PackageManagerAutoUpdater(t0) {
|
|
|
456718
457163
|
const maxVersion = await getMaxVersion();
|
|
456719
457164
|
if (maxVersion && latest && gt(latest, maxVersion)) {
|
|
456720
457165
|
logForDebugging(`PackageManagerAutoUpdater: maxVersion ${maxVersion} is set, capping update from ${latest} to ${maxVersion}`);
|
|
456721
|
-
if (gte({ VERSION: "0.2.
|
|
456722
|
-
logForDebugging(`PackageManagerAutoUpdater: current version ${{ VERSION: "0.2.
|
|
457166
|
+
if (gte({ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, maxVersion)) {
|
|
457167
|
+
logForDebugging(`PackageManagerAutoUpdater: current version ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} is already at or above maxVersion ${maxVersion}, skipping update`);
|
|
456723
457168
|
setUpdateAvailable(false);
|
|
456724
457169
|
return;
|
|
456725
457170
|
}
|
|
456726
457171
|
latest = maxVersion;
|
|
456727
457172
|
}
|
|
456728
|
-
const hasUpdate = latest && !gte({ VERSION: "0.2.
|
|
457173
|
+
const hasUpdate = latest && !gte({ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, latest) && !shouldSkipVersion(latest);
|
|
456729
457174
|
setUpdateAvailable(!!hasUpdate);
|
|
456730
457175
|
if (hasUpdate) {
|
|
456731
|
-
logForDebugging(`PackageManagerAutoUpdater: Update available ${{ VERSION: "0.2.
|
|
457176
|
+
logForDebugging(`PackageManagerAutoUpdater: Update available ${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} -> ${latest}`);
|
|
456732
457177
|
}
|
|
456733
457178
|
};
|
|
456734
457179
|
$2[0] = t1;
|
|
@@ -456762,7 +457207,7 @@ function PackageManagerAutoUpdater(t0) {
|
|
|
456762
457207
|
wrap: "truncate",
|
|
456763
457208
|
children: [
|
|
456764
457209
|
"versi\xF3n actual: ",
|
|
456765
|
-
{ VERSION: "0.2.
|
|
457210
|
+
{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
456766
457211
|
]
|
|
456767
457212
|
});
|
|
456768
457213
|
$2[3] = verbose;
|
|
@@ -463400,8 +463845,8 @@ function findTextObject(text2, offset, objectType2, isInner) {
|
|
|
463400
463845
|
return findWordObject(text2, offset, isInner, (ch2) => !isVimWhitespace(ch2));
|
|
463401
463846
|
const pair = PAIRS[objectType2];
|
|
463402
463847
|
if (pair) {
|
|
463403
|
-
const [
|
|
463404
|
-
return
|
|
463848
|
+
const [open22, close] = pair;
|
|
463849
|
+
return open22 === close ? findQuoteObject(text2, offset, open22, isInner) : findBracketObject(text2, offset, open22, close, isInner);
|
|
463405
463850
|
}
|
|
463406
463851
|
return null;
|
|
463407
463852
|
}
|
|
@@ -463476,13 +463921,13 @@ function findQuoteObject(text2, offset, quote2, isInner) {
|
|
|
463476
463921
|
}
|
|
463477
463922
|
return null;
|
|
463478
463923
|
}
|
|
463479
|
-
function findBracketObject(text2, offset,
|
|
463924
|
+
function findBracketObject(text2, offset, open22, close, isInner) {
|
|
463480
463925
|
let depth = 0;
|
|
463481
463926
|
let start = -1;
|
|
463482
463927
|
for (let i3 = offset;i3 >= 0; i3--) {
|
|
463483
463928
|
if (text2[i3] === close && i3 !== offset)
|
|
463484
463929
|
depth++;
|
|
463485
|
-
else if (text2[i3] ===
|
|
463930
|
+
else if (text2[i3] === open22) {
|
|
463486
463931
|
if (depth === 0) {
|
|
463487
463932
|
start = i3;
|
|
463488
463933
|
break;
|
|
@@ -463495,7 +463940,7 @@ function findBracketObject(text2, offset, open21, close, isInner) {
|
|
|
463495
463940
|
depth = 0;
|
|
463496
463941
|
let end = -1;
|
|
463497
463942
|
for (let i3 = start + 1;i3 < text2.length; i3++) {
|
|
463498
|
-
if (text2[i3] ===
|
|
463943
|
+
if (text2[i3] === open22)
|
|
463499
463944
|
depth++;
|
|
463500
463945
|
else if (text2[i3] === close) {
|
|
463501
463946
|
if (depth === 0) {
|
|
@@ -463877,7 +464322,7 @@ function createInitialPersistentState() {
|
|
|
463877
464322
|
};
|
|
463878
464323
|
}
|
|
463879
464324
|
var OPERATORS, SIMPLE_MOTIONS, FIND_KEYS, TEXT_OBJ_SCOPES, TEXT_OBJ_TYPES, MAX_VIM_COUNT = 1e4;
|
|
463880
|
-
var
|
|
464325
|
+
var init_types16 = __esm(() => {
|
|
463881
464326
|
OPERATORS = {
|
|
463882
464327
|
d: "delete",
|
|
463883
464328
|
c: "change",
|
|
@@ -464223,7 +464668,7 @@ function executeRepeatFind(reverse, count4, ctx) {
|
|
|
464223
464668
|
}
|
|
464224
464669
|
var init_transitions = __esm(() => {
|
|
464225
464670
|
init_operators();
|
|
464226
|
-
|
|
464671
|
+
init_types16();
|
|
464227
464672
|
});
|
|
464228
464673
|
|
|
464229
464674
|
// hooks/useVimInput.ts
|
|
@@ -464423,7 +464868,7 @@ var init_useVimInput = __esm(() => {
|
|
|
464423
464868
|
init_intl();
|
|
464424
464869
|
init_operators();
|
|
464425
464870
|
init_transitions();
|
|
464426
|
-
|
|
464871
|
+
init_types16();
|
|
464427
464872
|
init_useTextInput();
|
|
464428
464873
|
import_react257 = __toESM(require_react(), 1);
|
|
464429
464874
|
});
|
|
@@ -464625,7 +465070,7 @@ function buildStatusLineCommandInput(permissionMode2, exceeds200kTokens, setting
|
|
|
464625
465070
|
project_dir: getOriginalCwd(),
|
|
464626
465071
|
added_dirs: addedDirs
|
|
464627
465072
|
},
|
|
464628
|
-
version: { VERSION: "0.2.
|
|
465073
|
+
version: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
464629
465074
|
output_style: {
|
|
464630
465075
|
name: outputStyleName
|
|
464631
465076
|
},
|
|
@@ -470613,9 +471058,9 @@ function initSkillImprovement() {
|
|
|
470613
471058
|
async function applySkillImprovement(skillName, updates) {
|
|
470614
471059
|
if (!skillName)
|
|
470615
471060
|
return;
|
|
470616
|
-
const { join:
|
|
471061
|
+
const { join: join166 } = await import("path");
|
|
470617
471062
|
const fs5 = await import("fs/promises");
|
|
470618
|
-
const filePath =
|
|
471063
|
+
const filePath = join166(getCwd(), ".theus", "skills", skillName, "SKILL.md");
|
|
470619
471064
|
let currentContent;
|
|
470620
471065
|
try {
|
|
470621
471066
|
currentContent = await fs5.readFile(filePath, "utf-8");
|
|
@@ -470767,7 +471212,7 @@ function useMoreRight(_args) {
|
|
|
470767
471212
|
}
|
|
470768
471213
|
|
|
470769
471214
|
// utils/cleanup.ts
|
|
470770
|
-
import { join as
|
|
471215
|
+
import { join as join166 } from "path";
|
|
470771
471216
|
function getCutoffDate() {
|
|
470772
471217
|
const settings = getSettings_DEPRECATED() || {};
|
|
470773
471218
|
const cleanupPeriodDays = settings.cleanupPeriodDays ?? DEFAULT_CLEANUP_PERIOD_DAYS;
|
|
@@ -470792,7 +471237,7 @@ async function cleanupOldFilesInDirectory(dirPath, cutoffDate, isMessagePath) {
|
|
|
470792
471237
|
try {
|
|
470793
471238
|
const timestamp2 = convertFileNameToDate(file2.name);
|
|
470794
471239
|
if (timestamp2 < cutoffDate) {
|
|
470795
|
-
await getFsImplementation().unlink(
|
|
471240
|
+
await getFsImplementation().unlink(join166(dirPath, file2.name));
|
|
470796
471241
|
if (isMessagePath) {
|
|
470797
471242
|
result.messages++;
|
|
470798
471243
|
} else {
|
|
@@ -470823,7 +471268,7 @@ async function cleanupOldMessageFiles() {
|
|
|
470823
471268
|
} catch {
|
|
470824
471269
|
return result;
|
|
470825
471270
|
}
|
|
470826
|
-
const mcpLogDirs = dirents.filter((dirent) => dirent.isDirectory() && dirent.name.startsWith("mcp-logs-")).map((dirent) =>
|
|
471271
|
+
const mcpLogDirs = dirents.filter((dirent) => dirent.isDirectory() && dirent.name.startsWith("mcp-logs-")).map((dirent) => join166(baseCachePath, dirent.name));
|
|
470827
471272
|
for (const mcpLogDir of mcpLogDirs) {
|
|
470828
471273
|
result = addCleanupResults(result, await cleanupOldFilesInDirectory(mcpLogDir, cutoffDate, true));
|
|
470829
471274
|
await tryRmdir(mcpLogDir, fsImpl);
|
|
@@ -470862,7 +471307,7 @@ async function cleanupOldSessionFiles() {
|
|
|
470862
471307
|
for (const projectDirent of projectDirents) {
|
|
470863
471308
|
if (!projectDirent.isDirectory())
|
|
470864
471309
|
continue;
|
|
470865
|
-
const projectDir =
|
|
471310
|
+
const projectDir = join166(projectsDir, projectDirent.name);
|
|
470866
471311
|
let entries;
|
|
470867
471312
|
try {
|
|
470868
471313
|
entries = await fsImpl.readdir(projectDir);
|
|
@@ -470876,15 +471321,15 @@ async function cleanupOldSessionFiles() {
|
|
|
470876
471321
|
continue;
|
|
470877
471322
|
}
|
|
470878
471323
|
try {
|
|
470879
|
-
if (await unlinkIfOld(
|
|
471324
|
+
if (await unlinkIfOld(join166(projectDir, entry.name), cutoffDate, fsImpl)) {
|
|
470880
471325
|
result.messages++;
|
|
470881
471326
|
}
|
|
470882
471327
|
} catch {
|
|
470883
471328
|
result.errors++;
|
|
470884
471329
|
}
|
|
470885
471330
|
} else if (entry.isDirectory()) {
|
|
470886
|
-
const sessionDir =
|
|
470887
|
-
const toolResultsDir =
|
|
471331
|
+
const sessionDir = join166(projectDir, entry.name);
|
|
471332
|
+
const toolResultsDir = join166(sessionDir, TOOL_RESULTS_SUBDIR);
|
|
470888
471333
|
let toolDirs;
|
|
470889
471334
|
try {
|
|
470890
471335
|
toolDirs = await fsImpl.readdir(toolResultsDir);
|
|
@@ -470895,14 +471340,14 @@ async function cleanupOldSessionFiles() {
|
|
|
470895
471340
|
for (const toolEntry of toolDirs) {
|
|
470896
471341
|
if (toolEntry.isFile()) {
|
|
470897
471342
|
try {
|
|
470898
|
-
if (await unlinkIfOld(
|
|
471343
|
+
if (await unlinkIfOld(join166(toolResultsDir, toolEntry.name), cutoffDate, fsImpl)) {
|
|
470899
471344
|
result.messages++;
|
|
470900
471345
|
}
|
|
470901
471346
|
} catch {
|
|
470902
471347
|
result.errors++;
|
|
470903
471348
|
}
|
|
470904
471349
|
} else if (toolEntry.isDirectory()) {
|
|
470905
|
-
const toolDirPath =
|
|
471350
|
+
const toolDirPath = join166(toolResultsDir, toolEntry.name);
|
|
470906
471351
|
let toolFiles;
|
|
470907
471352
|
try {
|
|
470908
471353
|
toolFiles = await fsImpl.readdir(toolDirPath);
|
|
@@ -470913,7 +471358,7 @@ async function cleanupOldSessionFiles() {
|
|
|
470913
471358
|
if (!tf.isFile())
|
|
470914
471359
|
continue;
|
|
470915
471360
|
try {
|
|
470916
|
-
if (await unlinkIfOld(
|
|
471361
|
+
if (await unlinkIfOld(join166(toolDirPath, tf.name), cutoffDate, fsImpl)) {
|
|
470917
471362
|
result.messages++;
|
|
470918
471363
|
}
|
|
470919
471364
|
} catch {
|
|
@@ -470945,7 +471390,7 @@ async function cleanupSingleDirectory(dirPath, extension, removeEmptyDir = true)
|
|
|
470945
471390
|
if (!dirent.isFile() || !dirent.name.endsWith(extension))
|
|
470946
471391
|
continue;
|
|
470947
471392
|
try {
|
|
470948
|
-
if (await unlinkIfOld(
|
|
471393
|
+
if (await unlinkIfOld(join166(dirPath, dirent.name), cutoffDate, fsImpl)) {
|
|
470949
471394
|
result.messages++;
|
|
470950
471395
|
}
|
|
470951
471396
|
} catch {
|
|
@@ -470958,7 +471403,7 @@ async function cleanupSingleDirectory(dirPath, extension, removeEmptyDir = true)
|
|
|
470958
471403
|
return result;
|
|
470959
471404
|
}
|
|
470960
471405
|
function cleanupOldPlanFiles() {
|
|
470961
|
-
const plansDir =
|
|
471406
|
+
const plansDir = join166(getTheusConfigHomeDir(), "plans");
|
|
470962
471407
|
return cleanupSingleDirectory(plansDir, ".md");
|
|
470963
471408
|
}
|
|
470964
471409
|
async function cleanupOldFileHistoryBackups() {
|
|
@@ -470967,14 +471412,14 @@ async function cleanupOldFileHistoryBackups() {
|
|
|
470967
471412
|
const fsImpl = getFsImplementation();
|
|
470968
471413
|
try {
|
|
470969
471414
|
const configDir = getTheusConfigHomeDir();
|
|
470970
|
-
const fileHistoryStorageDir =
|
|
471415
|
+
const fileHistoryStorageDir = join166(configDir, "file-history");
|
|
470971
471416
|
let dirents;
|
|
470972
471417
|
try {
|
|
470973
471418
|
dirents = await fsImpl.readdir(fileHistoryStorageDir);
|
|
470974
471419
|
} catch {
|
|
470975
471420
|
return result;
|
|
470976
471421
|
}
|
|
470977
|
-
const fileHistorySessionsDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
471422
|
+
const fileHistorySessionsDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join166(fileHistoryStorageDir, dirent.name));
|
|
470978
471423
|
await Promise.all(fileHistorySessionsDirs.map(async (fileHistorySessionDir) => {
|
|
470979
471424
|
try {
|
|
470980
471425
|
const stats2 = await fsImpl.stat(fileHistorySessionDir);
|
|
@@ -471001,14 +471446,14 @@ async function cleanupOldSessionEnvDirs() {
|
|
|
471001
471446
|
const fsImpl = getFsImplementation();
|
|
471002
471447
|
try {
|
|
471003
471448
|
const configDir = getTheusConfigHomeDir();
|
|
471004
|
-
const sessionEnvBaseDir =
|
|
471449
|
+
const sessionEnvBaseDir = join166(configDir, "session-env");
|
|
471005
471450
|
let dirents;
|
|
471006
471451
|
try {
|
|
471007
471452
|
dirents = await fsImpl.readdir(sessionEnvBaseDir);
|
|
471008
471453
|
} catch {
|
|
471009
471454
|
return result;
|
|
471010
471455
|
}
|
|
471011
|
-
const sessionEnvDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
471456
|
+
const sessionEnvDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join166(sessionEnvBaseDir, dirent.name));
|
|
471012
471457
|
for (const sessionEnvDir of sessionEnvDirs) {
|
|
471013
471458
|
try {
|
|
471014
471459
|
const stats2 = await fsImpl.stat(sessionEnvDir);
|
|
@@ -471030,7 +471475,7 @@ async function cleanupOldDebugLogs() {
|
|
|
471030
471475
|
const cutoffDate = getCutoffDate();
|
|
471031
471476
|
const result = { messages: 0, errors: 0 };
|
|
471032
471477
|
const fsImpl = getFsImplementation();
|
|
471033
|
-
const debugDir =
|
|
471478
|
+
const debugDir = join166(getTheusConfigHomeDir(), "debug");
|
|
471034
471479
|
let dirents;
|
|
471035
471480
|
try {
|
|
471036
471481
|
dirents = await fsImpl.readdir(debugDir);
|
|
@@ -471042,7 +471487,7 @@ async function cleanupOldDebugLogs() {
|
|
|
471042
471487
|
continue;
|
|
471043
471488
|
}
|
|
471044
471489
|
try {
|
|
471045
|
-
if (await unlinkIfOld(
|
|
471490
|
+
if (await unlinkIfOld(join166(debugDir, dirent.name), cutoffDate, fsImpl)) {
|
|
471046
471491
|
result.messages++;
|
|
471047
471492
|
}
|
|
471048
471493
|
} catch {
|
|
@@ -474254,7 +474699,7 @@ __export(exports_asciicast, {
|
|
|
474254
474699
|
_resetRecordingStateForTesting: () => _resetRecordingStateForTesting
|
|
474255
474700
|
});
|
|
474256
474701
|
import { appendFile as appendFile8, rename as rename12 } from "fs/promises";
|
|
474257
|
-
import { basename as basename65, dirname as dirname72, join as
|
|
474702
|
+
import { basename as basename65, dirname as dirname72, join as join168 } from "path";
|
|
474258
474703
|
function getRecordFilePath() {
|
|
474259
474704
|
if (recordingState.filePath !== null) {
|
|
474260
474705
|
return recordingState.filePath;
|
|
@@ -474265,10 +474710,10 @@ function getRecordFilePath() {
|
|
|
474265
474710
|
if (!isEnvTruthy(process.env.THEUS_CODE_TERMINAL_RECORDING)) {
|
|
474266
474711
|
return null;
|
|
474267
474712
|
}
|
|
474268
|
-
const projectsDir =
|
|
474269
|
-
const projectDir =
|
|
474713
|
+
const projectsDir = join168(getTheusConfigHomeDir(), "projects");
|
|
474714
|
+
const projectDir = join168(projectsDir, sanitizePath2(getOriginalCwd()));
|
|
474270
474715
|
recordingState.timestamp = Date.now();
|
|
474271
|
-
recordingState.filePath =
|
|
474716
|
+
recordingState.filePath = join168(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
|
|
474272
474717
|
return recordingState.filePath;
|
|
474273
474718
|
}
|
|
474274
474719
|
function _resetRecordingStateForTesting() {
|
|
@@ -474277,13 +474722,13 @@ function _resetRecordingStateForTesting() {
|
|
|
474277
474722
|
}
|
|
474278
474723
|
function getSessionRecordingPaths() {
|
|
474279
474724
|
const sessionId = getSessionId();
|
|
474280
|
-
const projectsDir =
|
|
474281
|
-
const projectDir =
|
|
474725
|
+
const projectsDir = join168(getTheusConfigHomeDir(), "projects");
|
|
474726
|
+
const projectDir = join168(projectsDir, sanitizePath2(getOriginalCwd()));
|
|
474282
474727
|
try {
|
|
474283
474728
|
const entries = getFsImplementation().readdirSync(projectDir);
|
|
474284
474729
|
const names = typeof entries[0] === "string" ? entries : entries.map((e) => e.name);
|
|
474285
474730
|
const files2 = names.filter((f) => f.startsWith(sessionId) && f.endsWith(".cast")).sort();
|
|
474286
|
-
return files2.map((f) =>
|
|
474731
|
+
return files2.map((f) => join168(projectDir, f));
|
|
474287
474732
|
} catch {
|
|
474288
474733
|
return [];
|
|
474289
474734
|
}
|
|
@@ -474293,9 +474738,9 @@ async function renameRecordingForSession() {
|
|
|
474293
474738
|
if (!oldPath || recordingState.timestamp === 0) {
|
|
474294
474739
|
return;
|
|
474295
474740
|
}
|
|
474296
|
-
const projectsDir =
|
|
474297
|
-
const projectDir =
|
|
474298
|
-
const newPath =
|
|
474741
|
+
const projectsDir = join168(getTheusConfigHomeDir(), "projects");
|
|
474742
|
+
const projectDir = join168(projectsDir, sanitizePath2(getOriginalCwd()));
|
|
474743
|
+
const newPath = join168(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
|
|
474299
474744
|
if (oldPath === newPath) {
|
|
474300
474745
|
return;
|
|
474301
474746
|
}
|
|
@@ -475905,7 +476350,7 @@ function useSurveyState({
|
|
|
475905
476350
|
setState("submitted");
|
|
475906
476351
|
setTimeout(setState, hideThanksAfterMs, "closed");
|
|
475907
476352
|
}, [hideThanksAfterMs]);
|
|
475908
|
-
const
|
|
476353
|
+
const open22 = import_react301.useCallback(() => {
|
|
475909
476354
|
if (state2 !== "closed") {
|
|
475910
476355
|
return;
|
|
475911
476356
|
}
|
|
@@ -475956,7 +476401,7 @@ function useSurveyState({
|
|
|
475956
476401
|
return {
|
|
475957
476402
|
state: state2,
|
|
475958
476403
|
lastResponse,
|
|
475959
|
-
open:
|
|
476404
|
+
open: open22,
|
|
475960
476405
|
handleSelect,
|
|
475961
476406
|
handleTranscriptSelect
|
|
475962
476407
|
};
|
|
@@ -476092,7 +476537,7 @@ function useFeedbackSurvey(messages, isLoading, submitCount, surveyType = "sessi
|
|
|
476092
476537
|
const {
|
|
476093
476538
|
state: state2,
|
|
476094
476539
|
lastResponse,
|
|
476095
|
-
open:
|
|
476540
|
+
open: open22,
|
|
476096
476541
|
handleSelect,
|
|
476097
476542
|
handleTranscriptSelect
|
|
476098
476543
|
} = useSurveyState({
|
|
@@ -476173,9 +476618,9 @@ function useFeedbackSurvey(messages, isLoading, submitCount, surveyType = "sessi
|
|
|
476173
476618
|
}, [state2, isLoading, hasActivePrompt, isModelAllowed2, feedbackSurvey.timeLastShown, feedbackSurvey.submitCountAtLastAppearance, submitCount, config3.minTimeBetweenFeedbackMs, config3.minTimeBetweenGlobalFeedbackMs, config3.minUserTurnsBetweenFeedback, config3.minTimeBeforeFeedbackMs, config3.minUserTurnsBeforeFeedback, config3.probability, settingsRate]);
|
|
476174
476619
|
import_react302.useEffect(() => {
|
|
476175
476620
|
if (shouldOpen) {
|
|
476176
|
-
|
|
476621
|
+
open22();
|
|
476177
476622
|
}
|
|
476178
|
-
}, [shouldOpen,
|
|
476623
|
+
}, [shouldOpen, open22]);
|
|
476179
476624
|
return {
|
|
476180
476625
|
state: state2,
|
|
476181
476626
|
lastResponse,
|
|
@@ -476319,7 +476764,7 @@ function useMemorySurvey(messages, isLoading, hasActivePrompt = false, {
|
|
|
476319
476764
|
const {
|
|
476320
476765
|
state: state2,
|
|
476321
476766
|
lastResponse,
|
|
476322
|
-
open:
|
|
476767
|
+
open: open22,
|
|
476323
476768
|
handleSelect,
|
|
476324
476769
|
handleTranscriptSelect
|
|
476325
476770
|
} = useSurveyState({
|
|
@@ -476372,9 +476817,9 @@ function useMemorySurvey(messages, isLoading, hasActivePrompt = false, {
|
|
|
476372
476817
|
return;
|
|
476373
476818
|
}
|
|
476374
476819
|
if (Math.random() < SURVEY_PROBABILITY) {
|
|
476375
|
-
|
|
476820
|
+
open22();
|
|
476376
476821
|
}
|
|
476377
|
-
}, [enabled, state2, isLoading, hasActivePrompt, lastAssistant, messages,
|
|
476822
|
+
}, [enabled, state2, isLoading, hasActivePrompt, lastAssistant, messages, open22]);
|
|
476378
476823
|
return {
|
|
476379
476824
|
state: state2,
|
|
476380
476825
|
lastResponse,
|
|
@@ -476456,7 +476901,7 @@ function usePostCompactSurvey(messages, isLoading, t0, t1) {
|
|
|
476456
476901
|
const {
|
|
476457
476902
|
state: state2,
|
|
476458
476903
|
lastResponse,
|
|
476459
|
-
open:
|
|
476904
|
+
open: open22,
|
|
476460
476905
|
handleSelect
|
|
476461
476906
|
} = useSurveyState(t5);
|
|
476462
476907
|
let t6;
|
|
@@ -476488,7 +476933,7 @@ function usePostCompactSurvey(messages, isLoading, t0, t1) {
|
|
|
476488
476933
|
const currentCompactBoundaries = t8;
|
|
476489
476934
|
let t10;
|
|
476490
476935
|
let t9;
|
|
476491
|
-
if ($2[9] !== currentCompactBoundaries || $2[10] !== enabled || $2[11] !== gateEnabled || $2[12] !== hasActivePrompt || $2[13] !== isLoading || $2[14] !== messages || $2[15] !==
|
|
476936
|
+
if ($2[9] !== currentCompactBoundaries || $2[10] !== enabled || $2[11] !== gateEnabled || $2[12] !== hasActivePrompt || $2[13] !== isLoading || $2[14] !== messages || $2[15] !== open22 || $2[16] !== state2) {
|
|
476492
476937
|
t9 = () => {
|
|
476493
476938
|
if (!enabled) {
|
|
476494
476939
|
return;
|
|
@@ -476512,7 +476957,7 @@ function usePostCompactSurvey(messages, isLoading, t0, t1) {
|
|
|
476512
476957
|
if (hasMessageAfterBoundary(messages, pendingCompactBoundaryUuid.current)) {
|
|
476513
476958
|
pendingCompactBoundaryUuid.current = null;
|
|
476514
476959
|
if (Math.random() < SURVEY_PROBABILITY2) {
|
|
476515
|
-
|
|
476960
|
+
open22();
|
|
476516
476961
|
}
|
|
476517
476962
|
return;
|
|
476518
476963
|
}
|
|
@@ -476523,14 +476968,14 @@ function usePostCompactSurvey(messages, isLoading, t0, t1) {
|
|
|
476523
476968
|
pendingCompactBoundaryUuid.current = newBoundaries[newBoundaries.length - 1];
|
|
476524
476969
|
}
|
|
476525
476970
|
};
|
|
476526
|
-
t10 = [enabled, currentCompactBoundaries, state2, isLoading, hasActivePrompt, gateEnabled, messages,
|
|
476971
|
+
t10 = [enabled, currentCompactBoundaries, state2, isLoading, hasActivePrompt, gateEnabled, messages, open22];
|
|
476527
476972
|
$2[9] = currentCompactBoundaries;
|
|
476528
476973
|
$2[10] = enabled;
|
|
476529
476974
|
$2[11] = gateEnabled;
|
|
476530
476975
|
$2[12] = hasActivePrompt;
|
|
476531
476976
|
$2[13] = isLoading;
|
|
476532
476977
|
$2[14] = messages;
|
|
476533
|
-
$2[15] =
|
|
476978
|
+
$2[15] = open22;
|
|
476534
476979
|
$2[16] = state2;
|
|
476535
476980
|
$2[17] = t10;
|
|
476536
476981
|
$2[18] = t9;
|
|
@@ -477057,8 +477502,8 @@ var init_useAwaySummary = __esm(() => {
|
|
|
477057
477502
|
});
|
|
477058
477503
|
|
|
477059
477504
|
// utils/theusInChrome/setupPortable.ts
|
|
477060
|
-
import { readdir as
|
|
477061
|
-
import { join as
|
|
477505
|
+
import { readdir as readdir34 } from "fs/promises";
|
|
477506
|
+
import { join as join169 } from "path";
|
|
477062
477507
|
function getExtensionIds() {
|
|
477063
477508
|
return [THEUS_BROWSER_EXTENSION_ID];
|
|
477064
477509
|
}
|
|
@@ -477071,7 +477516,7 @@ async function detectExtensionInstallationPortable(browserPaths, log2) {
|
|
|
477071
477516
|
for (const { browser, path: browserBasePath } of browserPaths) {
|
|
477072
477517
|
let browserProfileEntries = [];
|
|
477073
477518
|
try {
|
|
477074
|
-
browserProfileEntries = await
|
|
477519
|
+
browserProfileEntries = await readdir34(browserBasePath, {
|
|
477075
477520
|
withFileTypes: true
|
|
477076
477521
|
});
|
|
477077
477522
|
} catch (e) {
|
|
@@ -477085,9 +477530,9 @@ async function detectExtensionInstallationPortable(browserPaths, log2) {
|
|
|
477085
477530
|
}
|
|
477086
477531
|
for (const profile of profileDirs) {
|
|
477087
477532
|
for (const extensionId of extensionIds) {
|
|
477088
|
-
const extensionPath =
|
|
477533
|
+
const extensionPath = join169(browserBasePath, profile, "Extensions", extensionId);
|
|
477089
477534
|
try {
|
|
477090
|
-
await
|
|
477535
|
+
await readdir34(extensionPath);
|
|
477091
477536
|
log2?.(`[Theus in Chrome] Extension ${extensionId} found in ${browser} ${profile}`);
|
|
477092
477537
|
return { isInstalled: true, browser };
|
|
477093
477538
|
} catch {}
|
|
@@ -477108,8 +477553,8 @@ var init_setupPortable = __esm(() => {
|
|
|
477108
477553
|
|
|
477109
477554
|
// utils/theusInChrome/setup.ts
|
|
477110
477555
|
import { chmod as chmod15, mkdir as mkdir55, readFile as readFile62, writeFile as writeFile54 } from "fs/promises";
|
|
477111
|
-
import { homedir as
|
|
477112
|
-
import { join as
|
|
477556
|
+
import { homedir as homedir50 } from "os";
|
|
477557
|
+
import { join as join170 } from "path";
|
|
477113
477558
|
import { fileURLToPath as fileURLToPath8 } from "url";
|
|
477114
477559
|
function isTheusInChromeEngineAvailable() {
|
|
477115
477560
|
return Array.isArray(BROWSER_TOOLS);
|
|
@@ -477173,8 +477618,8 @@ function setupTheusInChrome() {
|
|
|
477173
477618
|
};
|
|
477174
477619
|
} else {
|
|
477175
477620
|
const __filename3 = fileURLToPath8(import.meta.url);
|
|
477176
|
-
const __dirname3 =
|
|
477177
|
-
const cliPath =
|
|
477621
|
+
const __dirname3 = join170(__filename3, "..");
|
|
477622
|
+
const cliPath = join170(__dirname3, "cli.js");
|
|
477178
477623
|
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" }));
|
|
477179
477624
|
const mcpConfig = {
|
|
477180
477625
|
[THEUS_IN_CHROME_MCP_SERVER_NAME]: {
|
|
@@ -477195,9 +477640,9 @@ function setupTheusInChrome() {
|
|
|
477195
477640
|
function getNativeMessagingHostsDirs() {
|
|
477196
477641
|
const platform7 = getPlatform();
|
|
477197
477642
|
if (platform7 === "windows") {
|
|
477198
|
-
const home =
|
|
477199
|
-
const appData = process.env.APPDATA ||
|
|
477200
|
-
return [
|
|
477643
|
+
const home = homedir50();
|
|
477644
|
+
const appData = process.env.APPDATA || join170(home, "AppData", "Local");
|
|
477645
|
+
return [join170(appData, "Theus", "ChromeNativeHost")];
|
|
477201
477646
|
}
|
|
477202
477647
|
return getAllNativeMessagingHostsDirs().map(({ path: path21 }) => path21);
|
|
477203
477648
|
}
|
|
@@ -477216,7 +477661,7 @@ async function installChromeNativeHostManifest(manifestBinaryPath) {
|
|
|
477216
477661
|
const manifestContent = jsonStringify(manifest, null, 2);
|
|
477217
477662
|
let anyManifestUpdated = false;
|
|
477218
477663
|
for (const manifestDir of manifestDirs) {
|
|
477219
|
-
const manifestPath =
|
|
477664
|
+
const manifestPath = join170(manifestDir, NATIVE_HOST_MANIFEST_NAME);
|
|
477220
477665
|
const existingContent = await readFile62(manifestPath, "utf-8").catch(() => null);
|
|
477221
477666
|
if (existingContent === manifestContent) {
|
|
477222
477667
|
continue;
|
|
@@ -477231,7 +477676,7 @@ async function installChromeNativeHostManifest(manifestBinaryPath) {
|
|
|
477231
477676
|
}
|
|
477232
477677
|
}
|
|
477233
477678
|
if (getPlatform() === "windows") {
|
|
477234
|
-
const manifestPath =
|
|
477679
|
+
const manifestPath = join170(manifestDirs[0], NATIVE_HOST_MANIFEST_NAME);
|
|
477235
477680
|
registerWindowsNativeHosts(manifestPath);
|
|
477236
477681
|
}
|
|
477237
477682
|
if (anyManifestUpdated) {
|
|
@@ -477269,8 +477714,8 @@ function registerWindowsNativeHosts(manifestPath) {
|
|
|
477269
477714
|
}
|
|
477270
477715
|
async function createWrapperScript(command9) {
|
|
477271
477716
|
const platform7 = getPlatform();
|
|
477272
|
-
const chromeDir =
|
|
477273
|
-
const wrapperPath = platform7 === "windows" ?
|
|
477717
|
+
const chromeDir = join170(getTheusConfigHomeDir(), "chrome");
|
|
477718
|
+
const wrapperPath = platform7 === "windows" ? join170(chromeDir, "chrome-native-host.bat") : join170(chromeDir, "chrome-native-host");
|
|
477274
477719
|
const scriptContent = platform7 === "windows" ? `@echo off
|
|
477275
477720
|
REM Chrome native host wrapper script
|
|
477276
477721
|
REM Generated by Theus - do not edit manually
|
|
@@ -477399,7 +477844,7 @@ var init_useChromeExtensionNotification = __esm(() => {
|
|
|
477399
477844
|
});
|
|
477400
477845
|
|
|
477401
477846
|
// utils/plugins/officialMarketplaceStartupCheck.ts
|
|
477402
|
-
import { join as
|
|
477847
|
+
import { join as join171 } from "path";
|
|
477403
477848
|
function isOfficialMarketplaceAutoInstallDisabled() {
|
|
477404
477849
|
if (isEnvTruthy(process.env.THEUS_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL)) {
|
|
477405
477850
|
return true;
|
|
@@ -477477,7 +477922,7 @@ async function checkAndInstallOfficialMarketplace() {
|
|
|
477477
477922
|
return { installed: false, skipped: true, reason: "policy_blocked" };
|
|
477478
477923
|
}
|
|
477479
477924
|
const cacheDir = getMarketplacesCacheDir();
|
|
477480
|
-
const installLocation =
|
|
477925
|
+
const installLocation = join171(cacheDir, OFFICIAL_MARKETPLACE_NAME);
|
|
477481
477926
|
const gcsSha = await fetchOfficialMarketplaceFromGcs(installLocation, cacheDir);
|
|
477482
477927
|
if (gcsSha !== null) {
|
|
477483
477928
|
const known = await loadKnownMarketplacesConfig();
|
|
@@ -480261,7 +480706,7 @@ var init_usePluginRecommendationBase = __esm(() => {
|
|
|
480261
480706
|
});
|
|
480262
480707
|
|
|
480263
480708
|
// hooks/useLspPluginRecommendation.tsx
|
|
480264
|
-
import { extname as extname20, join as
|
|
480709
|
+
import { extname as extname20, join as join172 } from "path";
|
|
480265
480710
|
function useLspPluginRecommendation() {
|
|
480266
480711
|
const $2 = c3(12);
|
|
480267
480712
|
const trackedFiles = useAppState(_temp202);
|
|
@@ -480346,7 +480791,7 @@ function useLspPluginRecommendation() {
|
|
|
480346
480791
|
case "yes": {
|
|
480347
480792
|
installPluginAndNotify(pluginId, pluginName, "lsp-plugin", addNotification, async (pluginData) => {
|
|
480348
480793
|
logForDebugging(`[useLspPluginRecommendation] Installing plugin: ${pluginId}`);
|
|
480349
|
-
const localSourcePath = typeof pluginData.entry.source === "string" ?
|
|
480794
|
+
const localSourcePath = typeof pluginData.entry.source === "string" ? join172(pluginData.marketplaceInstallLocation, pluginData.entry.source) : undefined;
|
|
480350
480795
|
await cacheAndRegisterPlugin(pluginId, pluginData.entry, "user", undefined, localSourcePath);
|
|
480351
480796
|
const settings = getSettingsForSource("userSettings");
|
|
480352
480797
|
updateSettingsForSource("userSettings", {
|
|
@@ -483550,7 +483995,7 @@ var exports_REPL = {};
|
|
|
483550
483995
|
__export(exports_REPL, {
|
|
483551
483996
|
REPL: () => REPL
|
|
483552
483997
|
});
|
|
483553
|
-
import { dirname as dirname74, join as
|
|
483998
|
+
import { dirname as dirname74, join as join173 } from "path";
|
|
483554
483999
|
import { tmpdir as tmpdir16 } from "os";
|
|
483555
484000
|
import { writeFile as writeFile55 } from "fs/promises";
|
|
483556
484001
|
import { randomUUID as randomUUID61 } from "crypto";
|
|
@@ -485656,6 +486101,23 @@ Error: sandbox required but unavailable: ${reason}
|
|
|
485656
486101
|
}, [onSubmit]);
|
|
485657
486102
|
const onSubmitRef = import_react329.useRef(onSubmit);
|
|
485658
486103
|
onSubmitRef.current = onSubmit;
|
|
486104
|
+
const envioInicialHechoRef = import_react329.useRef(false);
|
|
486105
|
+
import_react329.useEffect(() => {
|
|
486106
|
+
if (envioInicialHechoRef.current)
|
|
486107
|
+
return;
|
|
486108
|
+
envioInicialHechoRef.current = true;
|
|
486109
|
+
if (!consumePendingSubmit())
|
|
486110
|
+
return;
|
|
486111
|
+
const texto = inputValueRef.current.trim();
|
|
486112
|
+
if (!texto)
|
|
486113
|
+
return;
|
|
486114
|
+
setInputValue("");
|
|
486115
|
+
onSubmitRef.current(texto, {
|
|
486116
|
+
setCursorOffset: () => {},
|
|
486117
|
+
clearBuffer: () => {},
|
|
486118
|
+
resetHistory: () => {}
|
|
486119
|
+
});
|
|
486120
|
+
}, []);
|
|
485659
486121
|
const handleOpenRateLimitOptions = import_react329.useCallback(() => {
|
|
485660
486122
|
onSubmitRef.current("/rate-limit-options", {
|
|
485661
486123
|
setCursorOffset: () => {},
|
|
@@ -486167,7 +486629,7 @@ Note: ctrl + z now suspends Theus, ctrl + _ undoes input.
|
|
|
486167
486629
|
const w = Math.max(80, (process.stdout.columns ?? 80) - 6);
|
|
486168
486630
|
const raw = await renderMessagesToPlainText(deferredMessages, tools, w);
|
|
486169
486631
|
const text2 = raw.replace(/[ \t]+$/gm, "");
|
|
486170
|
-
const path21 =
|
|
486632
|
+
const path21 = join173(tmpdir16(), `cc-transcript-${Date.now()}.txt`);
|
|
486171
486633
|
await writeFile55(path21, text2);
|
|
486172
486634
|
const opened = openFileInExternalEditor(path21);
|
|
486173
486635
|
setStatus(opened ? `opening ${path21}` : `wrote ${path21} \xB7 no $VISUAL/$EDITOR set`);
|
|
@@ -488276,7 +488738,7 @@ var exports_TrustDialog = {};
|
|
|
488276
488738
|
__export(exports_TrustDialog, {
|
|
488277
488739
|
TrustDialog: () => TrustDialog
|
|
488278
488740
|
});
|
|
488279
|
-
import { homedir as
|
|
488741
|
+
import { homedir as homedir51 } from "os";
|
|
488280
488742
|
function TrustDialog(t0) {
|
|
488281
488743
|
const $2 = c3(33);
|
|
488282
488744
|
const {
|
|
@@ -488387,7 +488849,7 @@ function TrustDialog(t0) {
|
|
|
488387
488849
|
let t13;
|
|
488388
488850
|
if ($2[13] !== hasAnyBashExecution) {
|
|
488389
488851
|
t12 = () => {
|
|
488390
|
-
const isHomeDir =
|
|
488852
|
+
const isHomeDir = homedir51() === getCwd();
|
|
488391
488853
|
logEvent("theus_trust_dialog_shown", {
|
|
488392
488854
|
isHomeDir,
|
|
488393
488855
|
hasMcpServers,
|
|
@@ -488416,7 +488878,7 @@ function TrustDialog(t0) {
|
|
|
488416
488878
|
gracefulShutdownSync(1);
|
|
488417
488879
|
return;
|
|
488418
488880
|
}
|
|
488419
|
-
const isHomeDir_0 =
|
|
488881
|
+
const isHomeDir_0 = homedir51() === getCwd();
|
|
488420
488882
|
logEvent("theus_trust_dialog_accept", {
|
|
488421
488883
|
isHomeDir: isHomeDir_0,
|
|
488422
488884
|
hasMcpServers,
|
|
@@ -488931,7 +489393,7 @@ function completeOnboarding() {
|
|
|
488931
489393
|
saveGlobalConfig((current) => ({
|
|
488932
489394
|
...current,
|
|
488933
489395
|
hasCompletedOnboarding: true,
|
|
488934
|
-
lastOnboardingVersion: { VERSION: "0.2.
|
|
489396
|
+
lastOnboardingVersion: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
488935
489397
|
}));
|
|
488936
489398
|
}
|
|
488937
489399
|
function showDialog(root2, renderer) {
|
|
@@ -489161,18 +489623,18 @@ var init_interactiveHelpers = __esm(() => {
|
|
|
489161
489623
|
});
|
|
489162
489624
|
|
|
489163
489625
|
// components/Theus/arsenalStats.ts
|
|
489164
|
-
import { existsSync as
|
|
489165
|
-
import { dirname as dirname75, join as
|
|
489626
|
+
import { existsSync as existsSync29, readdirSync as readdirSync6 } from "fs";
|
|
489627
|
+
import { dirname as dirname75, join as join174 } from "path";
|
|
489166
489628
|
import { fileURLToPath as fileURLToPath9 } from "url";
|
|
489167
489629
|
function countBundledArsenalSkills() {
|
|
489168
489630
|
try {
|
|
489169
489631
|
const here = dirname75(fileURLToPath9(import.meta.url));
|
|
489170
489632
|
for (const dir of [
|
|
489171
|
-
|
|
489172
|
-
|
|
489173
|
-
|
|
489633
|
+
join174(here, "..", "..", "vendor", "theus-arsenal", "skills"),
|
|
489634
|
+
join174(here, "vendor", "theus-arsenal", "skills"),
|
|
489635
|
+
join174(here, "..", "vendor", "theus-arsenal", "skills")
|
|
489174
489636
|
]) {
|
|
489175
|
-
if (!
|
|
489637
|
+
if (!existsSync29(dir))
|
|
489176
489638
|
continue;
|
|
489177
489639
|
let count4 = 0;
|
|
489178
489640
|
for (const entry of readdirSync6(dir, { withFileTypes: true })) {
|
|
@@ -489259,8 +489721,8 @@ __export(exports_OnboardingWizard, {
|
|
|
489259
489721
|
default: () => OnboardingWizard_default,
|
|
489260
489722
|
OnboardingWizard: () => OnboardingWizard
|
|
489261
489723
|
});
|
|
489262
|
-
import { existsSync as
|
|
489263
|
-
import { join as
|
|
489724
|
+
import { existsSync as existsSync30, mkdirSync as mkdirSync15, writeFileSync as writeFileSync14 } from "fs";
|
|
489725
|
+
import { join as join175 } from "path";
|
|
489264
489726
|
function hasSeenOnboardingWizard() {
|
|
489265
489727
|
if (isEnvTruthy(process.env.THEUS_FORCE_ONBOARDING_WIZARD))
|
|
489266
489728
|
return false;
|
|
@@ -489268,7 +489730,7 @@ function hasSeenOnboardingWizard() {
|
|
|
489268
489730
|
return true;
|
|
489269
489731
|
}
|
|
489270
489732
|
try {
|
|
489271
|
-
return
|
|
489733
|
+
return existsSync30(join175(getTheusConfigHome(), WIZARD_MARKER));
|
|
489272
489734
|
} catch {
|
|
489273
489735
|
return true;
|
|
489274
489736
|
}
|
|
@@ -489277,7 +489739,7 @@ function markOnboardingWizardSeen() {
|
|
|
489277
489739
|
try {
|
|
489278
489740
|
const home = getTheusConfigHome();
|
|
489279
489741
|
mkdirSync15(home, { recursive: true });
|
|
489280
|
-
writeFileSync14(
|
|
489742
|
+
writeFileSync14(join175(home, WIZARD_MARKER), `${JSON.stringify({
|
|
489281
489743
|
seenAt: new Date().toISOString(),
|
|
489282
489744
|
version: globalThis.MACRO?.VERSION ?? null
|
|
489283
489745
|
})}
|
|
@@ -489701,7 +490163,7 @@ function StepImport() {
|
|
|
489701
490163
|
{
|
|
489702
490164
|
label: "Importar ahora",
|
|
489703
490165
|
value: "import",
|
|
489704
|
-
description: "ChatGPT \xB7 Claude \xB7 Gemini \u2192 tu memoria
|
|
490166
|
+
description: "ChatGPT \xB7 Claude \xB7 Gemini \u2192 tu memoria del proyecto"
|
|
489705
490167
|
},
|
|
489706
490168
|
{ label: "Omitir este paso", value: "skip" }
|
|
489707
490169
|
],
|
|
@@ -490699,7 +491161,7 @@ API local: ${project2.apiUrl}
|
|
|
490699
491161
|
};
|
|
490700
491162
|
const comando = COMANDO_POR_ACCION[action2];
|
|
490701
491163
|
if (comando)
|
|
490702
|
-
|
|
491164
|
+
seedEarlyInputAndSubmit(comando);
|
|
490703
491165
|
}
|
|
490704
491166
|
root2.render(null);
|
|
490705
491167
|
await new Promise((resolve59) => setImmediate(resolve59));
|
|
@@ -492635,7 +493097,7 @@ var init_theusInChrome = __esm(() => {
|
|
|
492635
493097
|
});
|
|
492636
493098
|
|
|
492637
493099
|
// skills/bundled/debug.ts
|
|
492638
|
-
import { open as
|
|
493100
|
+
import { open as open22, stat as stat52 } from "fs/promises";
|
|
492639
493101
|
function registerDebugSkill() {
|
|
492640
493102
|
registerBundledSkill({
|
|
492641
493103
|
name: "debug",
|
|
@@ -492649,10 +493111,10 @@ function registerDebugSkill() {
|
|
|
492649
493111
|
const debugLogPath = getDebugLogPath();
|
|
492650
493112
|
let logInfo;
|
|
492651
493113
|
try {
|
|
492652
|
-
const stats2 = await
|
|
493114
|
+
const stats2 = await stat52(debugLogPath);
|
|
492653
493115
|
const readSize = Math.min(stats2.size, TAIL_READ_BYTES);
|
|
492654
493116
|
const startOffset = stats2.size - readSize;
|
|
492655
|
-
const fd2 = await
|
|
493117
|
+
const fd2 = await open22(debugLogPath, "r");
|
|
492656
493118
|
try {
|
|
492657
493119
|
const { buffer, bytesRead } = await fd2.read({
|
|
492658
493120
|
buffer: Buffer.alloc(readSize),
|
|
@@ -495218,7 +495680,7 @@ var init_resetProToOpusDefault = __esm(() => {
|
|
|
495218
495680
|
|
|
495219
495681
|
// server/types.ts
|
|
495220
495682
|
var connectResponseSchema;
|
|
495221
|
-
var
|
|
495683
|
+
var init_types17 = __esm(() => {
|
|
495222
495684
|
init_v4();
|
|
495223
495685
|
connectResponseSchema = lazySchema(() => exports_external.object({
|
|
495224
495686
|
session_id: exports_external.string(),
|
|
@@ -495231,14 +495693,14 @@ var init_types16 = __esm(() => {
|
|
|
495231
495693
|
var init_createDirectConnectSession = __esm(() => {
|
|
495232
495694
|
init_errors();
|
|
495233
495695
|
init_slowOperations();
|
|
495234
|
-
|
|
495696
|
+
init_types17();
|
|
495235
495697
|
});
|
|
495236
495698
|
|
|
495237
495699
|
// utils/releaseNotes.ts
|
|
495238
495700
|
import { mkdir as mkdir56, readFile as readFile64, writeFile as writeFile56 } from "fs/promises";
|
|
495239
|
-
import { dirname as dirname77, join as
|
|
495701
|
+
import { dirname as dirname77, join as join176 } from "path";
|
|
495240
495702
|
function getChangelogCachePath() {
|
|
495241
|
-
return
|
|
495703
|
+
return join176(getTheusConfigHomeDir(), "cache", "changelog.md");
|
|
495242
495704
|
}
|
|
495243
495705
|
async function migrateChangelogFromConfig() {
|
|
495244
495706
|
const config3 = getGlobalConfig();
|
|
@@ -495338,7 +495800,7 @@ function getRecentReleaseNotes(currentVersion, previousVersion, changelogContent
|
|
|
495338
495800
|
}
|
|
495339
495801
|
return [];
|
|
495340
495802
|
}
|
|
495341
|
-
async function checkForReleaseNotes(lastSeenVersion, currentVersion = { VERSION: "0.2.
|
|
495803
|
+
async function checkForReleaseNotes(lastSeenVersion, currentVersion = { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION) {
|
|
495342
495804
|
if (false) {}
|
|
495343
495805
|
const cachedChangelog = await getStoredChangelog();
|
|
495344
495806
|
if (lastSeenVersion !== currentVersion || !cachedChangelog) {
|
|
@@ -495436,7 +495898,7 @@ __export(exports_setup2, {
|
|
|
495436
495898
|
setupComputerUse: () => setupComputerUse,
|
|
495437
495899
|
COMPUTER_USE_SYSTEM_HINT: () => COMPUTER_USE_SYSTEM_HINT
|
|
495438
495900
|
});
|
|
495439
|
-
import { dirname as dirname78, join as
|
|
495901
|
+
import { dirname as dirname78, join as join177 } from "path";
|
|
495440
495902
|
import { fileURLToPath as fileURLToPath10 } from "url";
|
|
495441
495903
|
function setupComputerUse() {
|
|
495442
495904
|
const allowedTools = COMPUTER_USE_TOOL_NAMES.map((name) => buildMcpToolName(COMPUTER_USE_SERVER_NAME, name));
|
|
@@ -495463,11 +495925,11 @@ function resolveComputerUseLauncher() {
|
|
|
495463
495925
|
return { command: process.execPath, args: [entry, COMPUTER_USE_FLAG] };
|
|
495464
495926
|
}
|
|
495465
495927
|
if (entry) {
|
|
495466
|
-
const launcher =
|
|
495928
|
+
const launcher = join177(dirname78(entry), "..", "bin", "theus");
|
|
495467
495929
|
return { command: launcher, args: [COMPUTER_USE_FLAG] };
|
|
495468
495930
|
}
|
|
495469
495931
|
return {
|
|
495470
|
-
command:
|
|
495932
|
+
command: join177(fileURLToPath10(import.meta.url), "..", "..", "..", "bin", "theus"),
|
|
495471
495933
|
args: [COMPUTER_USE_FLAG]
|
|
495472
495934
|
};
|
|
495473
495935
|
}
|
|
@@ -495484,8 +495946,8 @@ __export(exports_arsenalBundled, {
|
|
|
495484
495946
|
isArsenalAutoInstallEnabled: () => isArsenalAutoInstallEnabled,
|
|
495485
495947
|
ensureBundledArsenalInstalled: () => ensureBundledArsenalInstalled
|
|
495486
495948
|
});
|
|
495487
|
-
import { existsSync as
|
|
495488
|
-
import { dirname as dirname79, join as
|
|
495949
|
+
import { existsSync as existsSync31, readFileSync as readFileSync33 } from "fs";
|
|
495950
|
+
import { dirname as dirname79, join as join178 } from "path";
|
|
495489
495951
|
import { fileURLToPath as fileURLToPath11 } from "url";
|
|
495490
495952
|
function isArsenalAutoInstallEnabled() {
|
|
495491
495953
|
return process.env.THEUS_NO_ARSENAL !== "1";
|
|
@@ -495493,10 +495955,10 @@ function isArsenalAutoInstallEnabled() {
|
|
|
495493
495955
|
function findBundledArsenalDir() {
|
|
495494
495956
|
const here = dirname79(fileURLToPath11(import.meta.url));
|
|
495495
495957
|
for (const candidate of [
|
|
495496
|
-
|
|
495497
|
-
|
|
495958
|
+
join178(here, "vendor", "theus-arsenal"),
|
|
495959
|
+
join178(here, "..", "vendor", "theus-arsenal")
|
|
495498
495960
|
]) {
|
|
495499
|
-
if (
|
|
495961
|
+
if (existsSync31(join178(candidate, ".theus-plugin", "plugin.json"))) {
|
|
495500
495962
|
return candidate;
|
|
495501
495963
|
}
|
|
495502
495964
|
}
|
|
@@ -495504,7 +495966,7 @@ function findBundledArsenalDir() {
|
|
|
495504
495966
|
}
|
|
495505
495967
|
function readBundledVersion(bundledDir) {
|
|
495506
495968
|
try {
|
|
495507
|
-
const manifest = JSON.parse(
|
|
495969
|
+
const manifest = JSON.parse(readFileSync33(join178(bundledDir, ".theus-plugin", "plugin.json"), "utf8"));
|
|
495508
495970
|
return typeof manifest.version === "string" ? manifest.version : null;
|
|
495509
495971
|
} catch {
|
|
495510
495972
|
return null;
|
|
@@ -495742,9 +496204,9 @@ var init_sessionMemory = __esm(() => {
|
|
|
495742
496204
|
});
|
|
495743
496205
|
|
|
495744
496206
|
// utils/iTermBackup.ts
|
|
495745
|
-
import { copyFile as copyFile10, stat as
|
|
495746
|
-
import { homedir as
|
|
495747
|
-
import { join as
|
|
496207
|
+
import { copyFile as copyFile10, stat as stat53 } from "fs/promises";
|
|
496208
|
+
import { homedir as homedir52 } from "os";
|
|
496209
|
+
import { join as join179 } from "path";
|
|
495748
496210
|
function markITerm2SetupComplete() {
|
|
495749
496211
|
saveGlobalConfig((current) => ({
|
|
495750
496212
|
...current,
|
|
@@ -495759,7 +496221,7 @@ function getIterm2RecoveryInfo() {
|
|
|
495759
496221
|
};
|
|
495760
496222
|
}
|
|
495761
496223
|
function getITerm2PlistPath() {
|
|
495762
|
-
return
|
|
496224
|
+
return join179(homedir52(), "Library", "Preferences", "com.googlecode.iterm2.plist");
|
|
495763
496225
|
}
|
|
495764
496226
|
async function checkAndRestoreITerm2Backup() {
|
|
495765
496227
|
const { inProgress, backupPath } = getIterm2RecoveryInfo();
|
|
@@ -495771,7 +496233,7 @@ async function checkAndRestoreITerm2Backup() {
|
|
|
495771
496233
|
return { status: "no_backup" };
|
|
495772
496234
|
}
|
|
495773
496235
|
try {
|
|
495774
|
-
await
|
|
496236
|
+
await stat53(backupPath);
|
|
495775
496237
|
} catch {
|
|
495776
496238
|
markITerm2SetupComplete();
|
|
495777
496239
|
return { status: "no_backup" };
|
|
@@ -497267,7 +497729,7 @@ var init_sessionUrl = __esm(() => {
|
|
|
497267
497729
|
|
|
497268
497730
|
// utils/plugins/zipCacheAdapters.ts
|
|
497269
497731
|
import { readFile as readFile65 } from "fs/promises";
|
|
497270
|
-
import { join as
|
|
497732
|
+
import { join as join180 } from "path";
|
|
497271
497733
|
async function readZipCacheKnownMarketplaces() {
|
|
497272
497734
|
try {
|
|
497273
497735
|
const content = await readFile65(getZipCacheKnownMarketplacesPath(), "utf-8");
|
|
@@ -497292,13 +497754,13 @@ async function saveMarketplaceJsonToZipCache(marketplaceName, installLocation) {
|
|
|
497292
497754
|
const content = await readMarketplaceJsonContent(installLocation);
|
|
497293
497755
|
if (content !== null) {
|
|
497294
497756
|
const relPath = getMarketplaceJsonRelativePath(marketplaceName);
|
|
497295
|
-
await atomicWriteToZipCache(
|
|
497757
|
+
await atomicWriteToZipCache(join180(zipCachePath, relPath), content);
|
|
497296
497758
|
}
|
|
497297
497759
|
}
|
|
497298
497760
|
async function readMarketplaceJsonContent(dir) {
|
|
497299
497761
|
const candidates = [
|
|
497300
|
-
|
|
497301
|
-
|
|
497762
|
+
join180(dir, ".theus-plugin", "marketplace.json"),
|
|
497763
|
+
join180(dir, "marketplace.json"),
|
|
497302
497764
|
dir
|
|
497303
497765
|
];
|
|
497304
497766
|
for (const candidate of candidates) {
|
|
@@ -497433,7 +497895,7 @@ __export(exports_print, {
|
|
|
497433
497895
|
createCanUseToolWithPermissionPrompt: () => createCanUseToolWithPermissionPrompt,
|
|
497434
497896
|
canBatchWith: () => canBatchWith
|
|
497435
497897
|
});
|
|
497436
|
-
import { readFile as readFile66, stat as
|
|
497898
|
+
import { readFile as readFile66, stat as stat54 } from "fs/promises";
|
|
497437
497899
|
import { dirname as dirname80 } from "path";
|
|
497438
497900
|
import { cwd as cwd2 } from "process";
|
|
497439
497901
|
import { randomUUID as randomUUID64 } from "crypto";
|
|
@@ -498822,7 +499284,7 @@ ${m.text}
|
|
|
498822
499284
|
} else if (request.subtype === "seed_read_state") {
|
|
498823
499285
|
try {
|
|
498824
499286
|
const normalizedPath = expandPath(request.path);
|
|
498825
|
-
const diskMtime = Math.floor((await
|
|
499287
|
+
const diskMtime = Math.floor((await stat54(normalizedPath)).mtimeMs);
|
|
498826
499288
|
if (diskMtime <= request.mtime) {
|
|
498827
499289
|
const raw = await readFile66(normalizedPath, "utf-8");
|
|
498828
499290
|
const content = (raw.charCodeAt(0) === 65279 ? raw.slice(1) : raw).replaceAll(`\r
|
|
@@ -500871,7 +501333,7 @@ async function startMCPServer(cwd3, debug3, verbose) {
|
|
|
500871
501333
|
setCwd(cwd3);
|
|
500872
501334
|
const server2 = new Server({
|
|
500873
501335
|
name: "theus/tengu",
|
|
500874
|
-
version: { VERSION: "0.2.
|
|
501336
|
+
version: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
500875
501337
|
}, {
|
|
500876
501338
|
capabilities: {
|
|
500877
501339
|
tools: {}
|
|
@@ -501001,37 +501463,37 @@ __export(exports_theusDesktop, {
|
|
|
501001
501463
|
readTheusDesktopMcpServers: () => readTheusDesktopMcpServers,
|
|
501002
501464
|
getTheusDesktopConfigPath: () => getTheusDesktopConfigPath
|
|
501003
501465
|
});
|
|
501004
|
-
import { readdir as
|
|
501005
|
-
import { homedir as
|
|
501006
|
-
import { join as
|
|
501466
|
+
import { readdir as readdir35, readFile as readFile67, stat as stat55 } from "fs/promises";
|
|
501467
|
+
import { homedir as homedir53 } from "os";
|
|
501468
|
+
import { join as join181 } from "path";
|
|
501007
501469
|
async function getTheusDesktopConfigPath() {
|
|
501008
501470
|
const platform7 = getPlatform();
|
|
501009
501471
|
if (!SUPPORTED_PLATFORMS.includes(platform7)) {
|
|
501010
501472
|
throw new Error(`Unsupported platform: ${platform7} - Theus Desktop integration only works on macOS and WSL.`);
|
|
501011
501473
|
}
|
|
501012
501474
|
if (platform7 === "macos") {
|
|
501013
|
-
return
|
|
501475
|
+
return join181(homedir53(), "Library", "Application Support", "Theus", "theus_desktop_config.json");
|
|
501014
501476
|
}
|
|
501015
501477
|
const windowsHome = process.env.USERPROFILE ? process.env.USERPROFILE.replace(/\\/g, "/") : null;
|
|
501016
501478
|
if (windowsHome) {
|
|
501017
501479
|
const wslPath = windowsHome.replace(/^[A-Z]:/, "");
|
|
501018
501480
|
const configPath2 = `/mnt/c${wslPath}/AppData/Roaming/Theus/theus_desktop_config.json`;
|
|
501019
501481
|
try {
|
|
501020
|
-
await
|
|
501482
|
+
await stat55(configPath2);
|
|
501021
501483
|
return configPath2;
|
|
501022
501484
|
} catch {}
|
|
501023
501485
|
}
|
|
501024
501486
|
try {
|
|
501025
501487
|
const usersDir = "/mnt/c/Users";
|
|
501026
501488
|
try {
|
|
501027
|
-
const userDirs = await
|
|
501489
|
+
const userDirs = await readdir35(usersDir, { withFileTypes: true });
|
|
501028
501490
|
for (const user of userDirs) {
|
|
501029
501491
|
if (user.name === "Public" || user.name === "Default" || user.name === "Default User" || user.name === "All Users") {
|
|
501030
501492
|
continue;
|
|
501031
501493
|
}
|
|
501032
|
-
const potentialConfigPath =
|
|
501494
|
+
const potentialConfigPath = join181(usersDir, user.name, "AppData", "Roaming", "Theus", "theus_desktop_config.json");
|
|
501033
501495
|
try {
|
|
501034
|
-
await
|
|
501496
|
+
await stat55(potentialConfigPath);
|
|
501035
501497
|
return potentialConfigPath;
|
|
501036
501498
|
} catch {}
|
|
501037
501499
|
}
|
|
@@ -501100,7 +501562,7 @@ __export(exports_mcp3, {
|
|
|
501100
501562
|
mcpAddJsonHandler: () => mcpAddJsonHandler,
|
|
501101
501563
|
mcpAddFromDesktopHandler: () => mcpAddFromDesktopHandler
|
|
501102
501564
|
});
|
|
501103
|
-
import { stat as
|
|
501565
|
+
import { stat as stat56 } from "fs/promises";
|
|
501104
501566
|
import { cwd as cwd3 } from "process";
|
|
501105
501567
|
async function checkMcpServerHealth(name, server2) {
|
|
501106
501568
|
try {
|
|
@@ -501123,7 +501585,7 @@ async function mcpServeHandler({
|
|
|
501123
501585
|
const providedCwd = cwd3();
|
|
501124
501586
|
logEvent("theus_mcp_start", {});
|
|
501125
501587
|
try {
|
|
501126
|
-
await
|
|
501588
|
+
await stat56(providedCwd);
|
|
501127
501589
|
} catch (error40) {
|
|
501128
501590
|
if (isFsInaccessible(error40)) {
|
|
501129
501591
|
cliError(`Error: Directory ${providedCwd} does not exist`);
|
|
@@ -501937,13 +502399,13 @@ var exports_install = {};
|
|
|
501937
502399
|
__export(exports_install, {
|
|
501938
502400
|
install: () => install
|
|
501939
502401
|
});
|
|
501940
|
-
import { homedir as
|
|
501941
|
-
import { join as
|
|
502402
|
+
import { homedir as homedir54 } from "os";
|
|
502403
|
+
import { join as join182 } from "path";
|
|
501942
502404
|
function getInstallationPath2() {
|
|
501943
502405
|
const isWindows2 = env3.platform === "win32";
|
|
501944
|
-
const homeDir =
|
|
502406
|
+
const homeDir = homedir54();
|
|
501945
502407
|
if (isWindows2) {
|
|
501946
|
-
const windowsPath =
|
|
502408
|
+
const windowsPath = join182(homeDir, ".local", "bin", "theus.exe");
|
|
501947
502409
|
return windowsPath.replace(/\//g, "\\");
|
|
501948
502410
|
}
|
|
501949
502411
|
return "~/.local/bin/theus";
|
|
@@ -502313,7 +502775,7 @@ async function setupTokenHandler(root2) {
|
|
|
502313
502775
|
gap: 1,
|
|
502314
502776
|
children: [
|
|
502315
502777
|
/* @__PURE__ */ jsx_runtime502.jsx(TheusBanner, {
|
|
502316
|
-
version: { VERSION: "0.2.
|
|
502778
|
+
version: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
502317
502779
|
}),
|
|
502318
502780
|
showAuthWarning && /* @__PURE__ */ jsx_runtime502.jsxs(ThemedBox_default, {
|
|
502319
502781
|
flexDirection: "column",
|
|
@@ -502483,14 +502945,14 @@ __export(exports_import2, {
|
|
|
502483
502945
|
importHandler: () => importHandler
|
|
502484
502946
|
});
|
|
502485
502947
|
import { readFile as readFile68 } from "fs/promises";
|
|
502486
|
-
import { homedir as
|
|
502948
|
+
import { homedir as homedir55 } from "os";
|
|
502487
502949
|
import { resolve as resolve59 } from "path";
|
|
502488
502950
|
function resolvePath4(raw) {
|
|
502489
502951
|
let p = raw.trim().replace(/^['"]|['"]$/g, "");
|
|
502490
502952
|
if (p === "~")
|
|
502491
|
-
p =
|
|
502953
|
+
p = homedir55();
|
|
502492
502954
|
else if (p.startsWith("~/"))
|
|
502493
|
-
p = resolve59(
|
|
502955
|
+
p = resolve59(homedir55(), p.slice(2));
|
|
502494
502956
|
return resolve59(p);
|
|
502495
502957
|
}
|
|
502496
502958
|
async function importHandler(file2, options2 = {}) {
|
|
@@ -502586,7 +503048,7 @@ __export(exports_main2, {
|
|
|
502586
503048
|
startDeferredPrefetches: () => startDeferredPrefetches,
|
|
502587
503049
|
main: () => main
|
|
502588
503050
|
});
|
|
502589
|
-
import { readFileSync as
|
|
503051
|
+
import { readFileSync as readFileSync34 } from "fs";
|
|
502590
503052
|
import { resolve as resolve60 } from "path";
|
|
502591
503053
|
function logManagedSettings() {
|
|
502592
503054
|
try {
|
|
@@ -502742,7 +503204,7 @@ function loadSettingsFromFlag(settingsFile) {
|
|
|
502742
503204
|
resolvedPath: resolvedSettingsPath
|
|
502743
503205
|
} = safeResolvePath(getFsImplementation(), settingsFile);
|
|
502744
503206
|
try {
|
|
502745
|
-
|
|
503207
|
+
readFileSync34(resolvedSettingsPath, "utf8");
|
|
502746
503208
|
} catch (e) {
|
|
502747
503209
|
if (isENOENT(e)) {
|
|
502748
503210
|
process.stderr.write(source_default.red(`Error: Settings file not found: ${resolvedSettingsPath}
|
|
@@ -503175,7 +503637,7 @@ ${getTmuxInstallInstructions()}
|
|
|
503175
503637
|
}
|
|
503176
503638
|
try {
|
|
503177
503639
|
const filePath = resolve60(options2.systemPromptFile);
|
|
503178
|
-
systemPrompt =
|
|
503640
|
+
systemPrompt = readFileSync34(filePath, "utf8");
|
|
503179
503641
|
} catch (error40) {
|
|
503180
503642
|
const code = getErrnoCode(error40);
|
|
503181
503643
|
if (code === "ENOENT") {
|
|
@@ -503197,7 +503659,7 @@ ${getTmuxInstallInstructions()}
|
|
|
503197
503659
|
}
|
|
503198
503660
|
try {
|
|
503199
503661
|
const filePath = resolve60(options2.appendSystemPromptFile);
|
|
503200
|
-
appendSystemPrompt =
|
|
503662
|
+
appendSystemPrompt = readFileSync34(filePath, "utf8");
|
|
503201
503663
|
} catch (error40) {
|
|
503202
503664
|
const code = getErrnoCode(error40);
|
|
503203
503665
|
if (code === "ENOENT") {
|
|
@@ -503898,7 +504360,7 @@ ${assistantAddendum}` : assistantAddendum;
|
|
|
503898
504360
|
}
|
|
503899
504361
|
}
|
|
503900
504362
|
logForDiagnosticsNoPII("info", "started", {
|
|
503901
|
-
version: { VERSION: "0.2.
|
|
504363
|
+
version: { VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
503902
504364
|
is_native_binary: isInBundledMode()
|
|
503903
504365
|
});
|
|
503904
504366
|
registerCleanup(async () => {
|
|
@@ -504766,7 +505228,7 @@ Usage: theus --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
504766
505228
|
pendingHookMessages
|
|
504767
505229
|
}, renderAndRun);
|
|
504768
505230
|
}
|
|
504769
|
-
}).version(`${{ VERSION: "0.2.
|
|
505231
|
+
}).version(`${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} (Theus)`, "-v, --version", "Muestra el n\xFAmero de versi\xF3n");
|
|
504770
505232
|
program2.option("-w, --worktree [name]", "Crea un nuevo worktree de git para esta sesi\xF3n (opcionalmente indica un nombre)");
|
|
504771
505233
|
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.");
|
|
504772
505234
|
if (canUserConfigureAdvisor()) {
|
|
@@ -505367,7 +505829,7 @@ if (false) {}
|
|
|
505367
505829
|
async function main2() {
|
|
505368
505830
|
const args = process.argv.slice(2);
|
|
505369
505831
|
if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
|
|
505370
|
-
console.log(`${{ VERSION: "0.2.
|
|
505832
|
+
console.log(`${{ VERSION: "0.2.70", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} (Theus)`);
|
|
505371
505833
|
return;
|
|
505372
505834
|
}
|
|
505373
505835
|
if (args[0] === "login" || args[0] === "signin" || args[0] === "entrar" || args[0] === "iniciar-sesion") {
|
|
@@ -505504,7 +505966,7 @@ async function main2() {
|
|
|
505504
505966
|
} = await Promise.resolve().then(() => (init_bridgeEnabled(), exports_bridgeEnabled));
|
|
505505
505967
|
const {
|
|
505506
505968
|
BRIDGE_LOGIN_ERROR: BRIDGE_LOGIN_ERROR2
|
|
505507
|
-
} = await Promise.resolve().then(() => (
|
|
505969
|
+
} = await Promise.resolve().then(() => (init_types13(), exports_types));
|
|
505508
505970
|
const {
|
|
505509
505971
|
bridgeMain: bridgeMain2
|
|
505510
505972
|
} = await Promise.resolve().then(() => (init_bridgeMain(), exports_bridgeMain));
|