theus-cli 0.1.11 → 0.1.13
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/README.md +27 -0
- package/cli.js +1420 -487
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -58283,7 +58283,7 @@ async function _executeApiKeyHelper(isNonInteractiveSession) {
|
|
|
58283
58283
|
if (isApiKeyHelperFromProjectOrLocalSettings()) {
|
|
58284
58284
|
const hasTrust = checkHasTrustDialogAccepted();
|
|
58285
58285
|
if (!hasTrust && !isNonInteractiveSession) {
|
|
58286
|
-
const error40 = new Error(`Security: apiKeyHelper executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.1.
|
|
58286
|
+
const error40 = new Error(`Security: apiKeyHelper executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.FEEDBACK_CHANNEL}.`);
|
|
58287
58287
|
logAntError("apiKeyHelper invoked before trust check", error40);
|
|
58288
58288
|
logEvent("tengu_apiKeyHelper_missing_trust11", {});
|
|
58289
58289
|
return null;
|
|
@@ -58327,7 +58327,7 @@ async function runAwsAuthRefresh() {
|
|
|
58327
58327
|
if (isAwsAuthRefreshFromProjectSettings()) {
|
|
58328
58328
|
const hasTrust = checkHasTrustDialogAccepted();
|
|
58329
58329
|
if (!hasTrust && !getIsNonInteractiveSession()) {
|
|
58330
|
-
const error40 = new Error(`Security: awsAuthRefresh executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.1.
|
|
58330
|
+
const error40 = new Error(`Security: awsAuthRefresh executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.FEEDBACK_CHANNEL}.`);
|
|
58331
58331
|
logAntError("awsAuthRefresh invoked before trust check", error40);
|
|
58332
58332
|
logEvent("tengu_awsAuthRefresh_missing_trust", {});
|
|
58333
58333
|
return false;
|
|
@@ -58387,7 +58387,7 @@ async function getAwsCredsFromCredentialExport() {
|
|
|
58387
58387
|
if (isAwsCredentialExportFromProjectSettings()) {
|
|
58388
58388
|
const hasTrust = checkHasTrustDialogAccepted();
|
|
58389
58389
|
if (!hasTrust && !getIsNonInteractiveSession()) {
|
|
58390
|
-
const error40 = new Error(`Security: awsCredentialExport executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.1.
|
|
58390
|
+
const error40 = new Error(`Security: awsCredentialExport executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.FEEDBACK_CHANNEL}.`);
|
|
58391
58391
|
logAntError("awsCredentialExport invoked before trust check", error40);
|
|
58392
58392
|
logEvent("tengu_awsCredentialExport_missing_trust", {});
|
|
58393
58393
|
return null;
|
|
@@ -58472,7 +58472,7 @@ async function runGcpAuthRefresh() {
|
|
|
58472
58472
|
if (isGcpAuthRefreshFromProjectSettings()) {
|
|
58473
58473
|
const hasTrust = checkHasTrustDialogAccepted();
|
|
58474
58474
|
if (!hasTrust && !getIsNonInteractiveSession()) {
|
|
58475
|
-
const error40 = new Error(`Security: gcpAuthRefresh executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.1.
|
|
58475
|
+
const error40 = new Error(`Security: gcpAuthRefresh executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.FEEDBACK_CHANNEL}.`);
|
|
58476
58476
|
logAntError("gcpAuthRefresh invoked before trust check", error40);
|
|
58477
58477
|
logEvent("tengu_gcpAuthRefresh_missing_trust", {});
|
|
58478
58478
|
return false;
|
|
@@ -59167,7 +59167,7 @@ var init_auth = __esm(() => {
|
|
|
59167
59167
|
|
|
59168
59168
|
// utils/userAgent.ts
|
|
59169
59169
|
function getTheusCodeUserAgent() {
|
|
59170
|
-
return `theus-code/${{ VERSION: "0.1.
|
|
59170
|
+
return `theus-code/${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}`;
|
|
59171
59171
|
}
|
|
59172
59172
|
|
|
59173
59173
|
// utils/workloadContext.ts
|
|
@@ -59189,7 +59189,7 @@ function getUserAgent() {
|
|
|
59189
59189
|
const clientApp = process.env.THEUS_AGENT_SDK_CLIENT_APP ? `, client-app/${process.env.THEUS_AGENT_SDK_CLIENT_APP}` : "";
|
|
59190
59190
|
const workload = getWorkload();
|
|
59191
59191
|
const workloadSuffix = workload ? `, workload/${workload}` : "";
|
|
59192
|
-
return `theus-cli/${{ VERSION: "0.1.
|
|
59192
|
+
return `theus-cli/${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} (${process.env.USER_TYPE}, ${process.env.THEUS_CODE_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
|
|
59193
59193
|
}
|
|
59194
59194
|
function getMCPUserAgent() {
|
|
59195
59195
|
const parts = [];
|
|
@@ -59203,7 +59203,7 @@ function getMCPUserAgent() {
|
|
|
59203
59203
|
parts.push(`client-app/${process.env.THEUS_AGENT_SDK_CLIENT_APP}`);
|
|
59204
59204
|
}
|
|
59205
59205
|
const suffix = parts.length > 0 ? ` (${parts.join(", ")})` : "";
|
|
59206
|
-
return `theus-code/${{ VERSION: "0.1.
|
|
59206
|
+
return `theus-code/${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}${suffix}`;
|
|
59207
59207
|
}
|
|
59208
59208
|
function getWebFetchUserAgent() {
|
|
59209
59209
|
return `Theus-User (${getTheusCodeUserAgent()}; +https://support.theus.pe/)`;
|
|
@@ -59341,7 +59341,7 @@ var init_user = __esm(() => {
|
|
|
59341
59341
|
deviceId,
|
|
59342
59342
|
sessionId: getSessionId(),
|
|
59343
59343
|
email: getEmail(),
|
|
59344
|
-
appVersion: { VERSION: "0.1.
|
|
59344
|
+
appVersion: { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
59345
59345
|
platform: getHostPlatformForAnalytics(),
|
|
59346
59346
|
organizationUuid,
|
|
59347
59347
|
accountUuid,
|
|
@@ -61056,7 +61056,7 @@ var init_metadata = __esm(() => {
|
|
|
61056
61056
|
COMPOUND_OPERATOR_REGEX = /\s*(?:&&|\|\||[;|])\s*/;
|
|
61057
61057
|
WHITESPACE_REGEX = /\s+/;
|
|
61058
61058
|
getVersionBase = memoize_default(() => {
|
|
61059
|
-
const match = { VERSION: "0.1.
|
|
61059
|
+
const match = { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION.match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
|
|
61060
61060
|
return match ? match[0] : undefined;
|
|
61061
61061
|
});
|
|
61062
61062
|
buildEnvContext = memoize_default(async () => {
|
|
@@ -61096,9 +61096,9 @@ var init_metadata = __esm(() => {
|
|
|
61096
61096
|
isGithubAction: isEnvTruthy(process.env.GITHUB_ACTIONS),
|
|
61097
61097
|
isTheusCodeAction: isEnvTruthy(process.env.THEUS_CODE_ACTION),
|
|
61098
61098
|
isTheusAiAuth: isTheusAISubscriber(),
|
|
61099
|
-
version: { VERSION: "0.1.
|
|
61099
|
+
version: { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
61100
61100
|
versionBase: getVersionBase(),
|
|
61101
|
-
buildTime: { VERSION: "0.1.
|
|
61101
|
+
buildTime: { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.BUILD_TIME,
|
|
61102
61102
|
deploymentEnvironment: env3.detectDeploymentEnvironment(),
|
|
61103
61103
|
...isEnvTruthy(process.env.GITHUB_ACTIONS) && {
|
|
61104
61104
|
githubEventName: process.env.GITHUB_EVENT_NAME,
|
|
@@ -61764,7 +61764,7 @@ function initialize1PEventLogging() {
|
|
|
61764
61764
|
const platform2 = getPlatform();
|
|
61765
61765
|
const attributes = {
|
|
61766
61766
|
[ATTR_SERVICE_NAME]: "theus-code",
|
|
61767
|
-
[ATTR_SERVICE_VERSION]: { VERSION: "0.1.
|
|
61767
|
+
[ATTR_SERVICE_VERSION]: { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
61768
61768
|
};
|
|
61769
61769
|
if (platform2 === "wsl") {
|
|
61770
61770
|
const wslVersion = getWslVersion();
|
|
@@ -61791,7 +61791,7 @@ function initialize1PEventLogging() {
|
|
|
61791
61791
|
})
|
|
61792
61792
|
]
|
|
61793
61793
|
});
|
|
61794
|
-
firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.theus.theus_code.events", { VERSION: "0.1.
|
|
61794
|
+
firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.theus.theus_code.events", { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
|
|
61795
61795
|
}
|
|
61796
61796
|
async function reinitialize1PEventLoggingIfConfigChanged() {
|
|
61797
61797
|
if (!is1PEventLoggingEnabled() || !firstPartyEventLoggerProvider) {
|
|
@@ -63662,7 +63662,7 @@ function getAttributionHeader(fingerprint) {
|
|
|
63662
63662
|
if (!isAttributionHeaderEnabled()) {
|
|
63663
63663
|
return "";
|
|
63664
63664
|
}
|
|
63665
|
-
const version2 = `${{ VERSION: "0.1.
|
|
63665
|
+
const version2 = `${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}.${fingerprint}`;
|
|
63666
63666
|
const entrypoint = process.env.THEUS_CODE_ENTRYPOINT ?? "unknown";
|
|
63667
63667
|
const cch = "";
|
|
63668
63668
|
const workload = getWorkload();
|
|
@@ -107180,7 +107180,7 @@ Complete the user's request by providing accurate, documentation-based guidance.
|
|
|
107180
107180
|
}
|
|
107181
107181
|
function getFeedbackGuideline() {
|
|
107182
107182
|
if (isUsing3PServices()) {
|
|
107183
|
-
return `- When you cannot find an answer or the feature doesn't exist, direct the user to ${{ VERSION: "0.1.
|
|
107183
|
+
return `- When you cannot find an answer or the feature doesn't exist, direct the user to ${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.ISSUES_EXPLAINER}`;
|
|
107184
107184
|
}
|
|
107185
107185
|
return "- When you cannot find an answer or the feature doesn't exist, direct the user to use /feedback to report a feature request or bug";
|
|
107186
107186
|
}
|
|
@@ -165877,7 +165877,7 @@ function getTelemetryAttributes() {
|
|
|
165877
165877
|
attributes["session.id"] = sessionId;
|
|
165878
165878
|
}
|
|
165879
165879
|
if (shouldIncludeAttribute("OTEL_METRICS_INCLUDE_VERSION")) {
|
|
165880
|
-
attributes["app.version"] = { VERSION: "0.1.
|
|
165880
|
+
attributes["app.version"] = { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
|
|
165881
165881
|
}
|
|
165882
165882
|
const oauthAccount = getOauthAccountInfo();
|
|
165883
165883
|
if (oauthAccount) {
|
|
@@ -201923,7 +201923,7 @@ function getInstallationEnv() {
|
|
|
201923
201923
|
return;
|
|
201924
201924
|
}
|
|
201925
201925
|
function getTheusCodeVersion() {
|
|
201926
|
-
return { VERSION: "0.1.
|
|
201926
|
+
return { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
|
|
201927
201927
|
}
|
|
201928
201928
|
async function getInstalledVSCodeExtensionVersion(command) {
|
|
201929
201929
|
const { stdout } = await execFileNoThrow(command, ["--list-extensions", "--show-versions"], {
|
|
@@ -203441,7 +203441,7 @@ async function getMcpHeadersFromHelper(serverName, config2) {
|
|
|
203441
203441
|
if ("scope" in config2 && isMcpServerFromProjectOrLocalSettings(config2) && !getIsNonInteractiveSession()) {
|
|
203442
203442
|
const hasTrust = checkHasTrustDialogAccepted();
|
|
203443
203443
|
if (!hasTrust) {
|
|
203444
|
-
const error40 = new Error(`Security: headersHelper for MCP server '${serverName}' executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.1.
|
|
203444
|
+
const error40 = new Error(`Security: headersHelper for MCP server '${serverName}' executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.FEEDBACK_CHANNEL}.`);
|
|
203445
203445
|
logAntError("MCP headersHelper invoked before trust check", error40);
|
|
203446
203446
|
logEvent("tengu_mcp_headersHelper_missing_trust", {});
|
|
203447
203447
|
return null;
|
|
@@ -204651,7 +204651,7 @@ async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) {
|
|
|
204651
204651
|
const client2 = new Client({
|
|
204652
204652
|
name: "theus-code",
|
|
204653
204653
|
title: "Theus",
|
|
204654
|
-
version: { VERSION: "0.1.
|
|
204654
|
+
version: { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION ?? "unknown",
|
|
204655
204655
|
description: "Theus's agentic coding tool",
|
|
204656
204656
|
websiteUrl: PRODUCT_URL
|
|
204657
204657
|
}, {
|
|
@@ -205005,7 +205005,7 @@ var init_client5 = __esm(() => {
|
|
|
205005
205005
|
const client2 = new Client({
|
|
205006
205006
|
name: "theus-code",
|
|
205007
205007
|
title: "Theus",
|
|
205008
|
-
version: { VERSION: "0.1.
|
|
205008
|
+
version: { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION ?? "unknown",
|
|
205009
205009
|
description: "Theus's agentic coding tool",
|
|
205010
205010
|
websiteUrl: PRODUCT_URL
|
|
205011
205011
|
}, {
|
|
@@ -215564,7 +215564,7 @@ async function initializeBetaTracing(resource) {
|
|
|
215564
215564
|
});
|
|
215565
215565
|
logs.setGlobalLoggerProvider(loggerProvider);
|
|
215566
215566
|
setLoggerProvider(loggerProvider);
|
|
215567
|
-
const eventLogger = logs.getLogger("com.theus.theus_code.events", { VERSION: "0.1.
|
|
215567
|
+
const eventLogger = logs.getLogger("com.theus.theus_code.events", { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
|
|
215568
215568
|
setEventLogger(eventLogger);
|
|
215569
215569
|
process.on("beforeExit", async () => {
|
|
215570
215570
|
await loggerProvider?.forceFlush();
|
|
@@ -215604,7 +215604,7 @@ async function initializeTelemetry() {
|
|
|
215604
215604
|
const platform4 = getPlatform();
|
|
215605
215605
|
const baseAttributes = {
|
|
215606
215606
|
[ATTR_SERVICE_NAME]: "theus-code",
|
|
215607
|
-
[ATTR_SERVICE_VERSION]: { VERSION: "0.1.
|
|
215607
|
+
[ATTR_SERVICE_VERSION]: { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
215608
215608
|
};
|
|
215609
215609
|
if (platform4 === "wsl") {
|
|
215610
215610
|
const wslVersion = getWslVersion();
|
|
@@ -215649,7 +215649,7 @@ async function initializeTelemetry() {
|
|
|
215649
215649
|
} catch {}
|
|
215650
215650
|
};
|
|
215651
215651
|
registerCleanup(shutdownTelemetry2);
|
|
215652
|
-
return meterProvider2.getMeter("com.theus.theus_code", { VERSION: "0.1.
|
|
215652
|
+
return meterProvider2.getMeter("com.theus.theus_code", { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
|
|
215653
215653
|
}
|
|
215654
215654
|
const meterProvider = new MeterProvider({
|
|
215655
215655
|
resource,
|
|
@@ -215669,7 +215669,7 @@ async function initializeTelemetry() {
|
|
|
215669
215669
|
});
|
|
215670
215670
|
logs.setGlobalLoggerProvider(loggerProvider);
|
|
215671
215671
|
setLoggerProvider(loggerProvider);
|
|
215672
|
-
const eventLogger = logs.getLogger("com.theus.theus_code.events", { VERSION: "0.1.
|
|
215672
|
+
const eventLogger = logs.getLogger("com.theus.theus_code.events", { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
|
|
215673
215673
|
setEventLogger(eventLogger);
|
|
215674
215674
|
logForDebugging("[3P telemetry] Event logger set successfully");
|
|
215675
215675
|
process.on("beforeExit", async () => {
|
|
@@ -215731,7 +215731,7 @@ Current timeout: ${timeoutMs}ms
|
|
|
215731
215731
|
}
|
|
215732
215732
|
};
|
|
215733
215733
|
registerCleanup(shutdownTelemetry);
|
|
215734
|
-
return meterProvider.getMeter("com.theus.theus_code", { VERSION: "0.1.
|
|
215734
|
+
return meterProvider.getMeter("com.theus.theus_code", { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
|
|
215735
215735
|
}
|
|
215736
215736
|
async function flushTelemetry() {
|
|
215737
215737
|
const meterProvider = getMeterProvider();
|
|
@@ -216271,7 +216271,7 @@ async function installOrUpdateTheusPackage(channel2, specificVersion) {
|
|
|
216271
216271
|
return "install_failed";
|
|
216272
216272
|
}
|
|
216273
216273
|
const versionSpec = specificVersion ? specificVersion : channel2 === "stable" ? "stable" : "latest";
|
|
216274
|
-
const result = await execFileNoThrowWithCwd("npm", ["install", `${{ VERSION: "0.1.
|
|
216274
|
+
const result = await execFileNoThrowWithCwd("npm", ["install", `${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}@${versionSpec}`], { cwd: getLocalInstallDir(), maxBuffer: 1e6 });
|
|
216275
216275
|
if (result.code !== 0) {
|
|
216276
216276
|
const error40 = new Error(`Failed to install Theus CLI package: ${result.stderr}`);
|
|
216277
216277
|
logError2(error40);
|
|
@@ -216417,9 +216417,9 @@ async function assertMinVersion() {
|
|
|
216417
216417
|
if (false) {}
|
|
216418
216418
|
try {
|
|
216419
216419
|
const versionConfig = await getDynamicConfig_BLOCKS_ON_INIT("tengu_version_config", { minVersion: "0.0.0" });
|
|
216420
|
-
if (versionConfig.minVersion && lt({ VERSION: "0.1.
|
|
216420
|
+
if (versionConfig.minVersion && lt({ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, versionConfig.minVersion)) {
|
|
216421
216421
|
console.error(`
|
|
216422
|
-
It looks like your version of Theus (${{ VERSION: "0.1.
|
|
216422
|
+
It looks like your version of Theus (${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}) needs an update.
|
|
216423
216423
|
A newer version (${versionConfig.minVersion} or higher) is required to continue.
|
|
216424
216424
|
|
|
216425
216425
|
To update, please run:
|
|
@@ -216560,7 +216560,7 @@ async function getInstallationPrefix() {
|
|
|
216560
216560
|
return prefixResult.stdout.trim();
|
|
216561
216561
|
}
|
|
216562
216562
|
function getGlobalInstallPackageManager() {
|
|
216563
|
-
if ({ VERSION: "0.1.
|
|
216563
|
+
if ({ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL === "theus-cli") {
|
|
216564
216564
|
return "npm";
|
|
216565
216565
|
}
|
|
216566
216566
|
return env3.isRunningWithBun() ? "bun" : "npm";
|
|
@@ -216585,7 +216585,7 @@ async function checkGlobalInstallPermissions() {
|
|
|
216585
216585
|
}
|
|
216586
216586
|
async function getLatestVersion(channel2) {
|
|
216587
216587
|
const npmTag = channel2 === "stable" ? "stable" : "latest";
|
|
216588
|
-
const result = await execFileNoThrowWithCwd("npm", ["view", `${{ VERSION: "0.1.
|
|
216588
|
+
const result = await execFileNoThrowWithCwd("npm", ["view", `${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}@${npmTag}`, "version", "--prefer-online"], { abortSignal: AbortSignal.timeout(5000), cwd: homedir18() });
|
|
216589
216589
|
if (result.code !== 0) {
|
|
216590
216590
|
logForDebugging(`npm view failed with code ${result.code}`);
|
|
216591
216591
|
if (result.stderr) {
|
|
@@ -216601,7 +216601,7 @@ async function getLatestVersion(channel2) {
|
|
|
216601
216601
|
return result.stdout.trim();
|
|
216602
216602
|
}
|
|
216603
216603
|
async function getNpmDistTags() {
|
|
216604
|
-
const result = await execFileNoThrowWithCwd("npm", ["view", { VERSION: "0.1.
|
|
216604
|
+
const result = await execFileNoThrowWithCwd("npm", ["view", { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL, "dist-tags", "--json", "--prefer-online"], { abortSignal: AbortSignal.timeout(5000), cwd: homedir18() });
|
|
216605
216605
|
if (result.code !== 0) {
|
|
216606
216606
|
logForDebugging(`npm view dist-tags failed with code ${result.code}`);
|
|
216607
216607
|
return { latest: null, stable: null };
|
|
@@ -216641,7 +216641,7 @@ async function installGlobalPackage(specificVersion) {
|
|
|
216641
216641
|
logError2(new AutoUpdaterError("Another process is currently installing an update"));
|
|
216642
216642
|
logEvent("tengu_auto_updater_lock_contention", {
|
|
216643
216643
|
pid: process.pid,
|
|
216644
|
-
currentVersion: { VERSION: "0.1.
|
|
216644
|
+
currentVersion: { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
216645
216645
|
});
|
|
216646
216646
|
return "in_progress";
|
|
216647
216647
|
}
|
|
@@ -216650,7 +216650,7 @@ async function installGlobalPackage(specificVersion) {
|
|
|
216650
216650
|
if (!env3.isRunningWithBun() && env3.isNpmFromWindowsPath()) {
|
|
216651
216651
|
logError2(new Error("Windows NPM detected in WSL environment"));
|
|
216652
216652
|
logEvent("tengu_auto_updater_windows_npm_in_wsl", {
|
|
216653
|
-
currentVersion: { VERSION: "0.1.
|
|
216653
|
+
currentVersion: { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
216654
216654
|
});
|
|
216655
216655
|
console.error(`
|
|
216656
216656
|
Error: Windows NPM detected in WSL
|
|
@@ -216669,7 +216669,7 @@ To fix this issue:
|
|
|
216669
216669
|
if (!hasPermissions) {
|
|
216670
216670
|
return "no_permissions";
|
|
216671
216671
|
}
|
|
216672
|
-
const packageSpec = specificVersion ? `${{ VERSION: "0.1.
|
|
216672
|
+
const packageSpec = specificVersion ? `${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}@${specificVersion}` : { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL;
|
|
216673
216673
|
const packageManager = getGlobalInstallPackageManager();
|
|
216674
216674
|
const installResult = await execFileNoThrowWithCwd(packageManager, ["install", "-g", packageSpec], { cwd: homedir18() });
|
|
216675
216675
|
if (installResult.code !== 0) {
|
|
@@ -216997,8 +216997,8 @@ async function detectMultipleInstallations() {
|
|
|
216997
216997
|
installations.push({ type: "npm-local", path: localPath });
|
|
216998
216998
|
}
|
|
216999
216999
|
const packagesToCheck = ["@theus-ai/theus-code"];
|
|
217000
|
-
if ({ VERSION: "0.1.
|
|
217001
|
-
packagesToCheck.push({ VERSION: "0.1.
|
|
217000
|
+
if ({ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL && { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL !== "@theus-ai/theus-code") {
|
|
217001
|
+
packagesToCheck.push({ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL);
|
|
217002
217002
|
}
|
|
217003
217003
|
const npmResult = await execFileNoThrow("npm", [
|
|
217004
217004
|
"-g",
|
|
@@ -217181,7 +217181,7 @@ function detectLinuxGlobPatternWarnings() {
|
|
|
217181
217181
|
}
|
|
217182
217182
|
async function getDoctorDiagnostic() {
|
|
217183
217183
|
const installationType = await getCurrentInstallationType();
|
|
217184
|
-
const version2 = { VERSION: "0.1.
|
|
217184
|
+
const version2 = { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION ? { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION : "unknown";
|
|
217185
217185
|
const installationPath = await getInstallationPath();
|
|
217186
217186
|
const invokedBinary = getInvokedBinary();
|
|
217187
217187
|
const multipleInstallations = await detectMultipleInstallations();
|
|
@@ -217193,8 +217193,8 @@ async function getDoctorDiagnostic() {
|
|
|
217193
217193
|
for (const install of npmInstalls) {
|
|
217194
217194
|
if (install.type === "npm-global") {
|
|
217195
217195
|
let uninstallCmd = "npm -g uninstall @theus-ai/theus-code";
|
|
217196
|
-
if ({ VERSION: "0.1.
|
|
217197
|
-
uninstallCmd += ` && npm -g uninstall ${{ VERSION: "0.1.
|
|
217196
|
+
if ({ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL && { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL !== "@theus-ai/theus-code") {
|
|
217197
|
+
uninstallCmd += ` && npm -g uninstall ${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}`;
|
|
217198
217198
|
}
|
|
217199
217199
|
warnings.push({
|
|
217200
217200
|
issue: `Leftover npm global installation at ${install.path}`,
|
|
@@ -217306,7 +217306,7 @@ async function getLatestVersionFromArtifactory(tag2 = "latest") {
|
|
|
217306
217306
|
const startTime2 = Date.now();
|
|
217307
217307
|
const { stdout, code, stderr } = await execFileNoThrowWithCwd("npm", [
|
|
217308
217308
|
"view",
|
|
217309
|
-
`${{ VERSION: "0.1.
|
|
217309
|
+
`${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.NATIVE_PACKAGE_URL}@${tag2}`,
|
|
217310
217310
|
"version",
|
|
217311
217311
|
"--prefer-online",
|
|
217312
217312
|
"--registry",
|
|
@@ -217330,7 +217330,7 @@ async function getLatestVersionFromArtifactory(tag2 = "latest") {
|
|
|
217330
217330
|
latency_ms: latencyMs,
|
|
217331
217331
|
source_npm: true
|
|
217332
217332
|
});
|
|
217333
|
-
logForDebugging(`npm view ${{ VERSION: "0.1.
|
|
217333
|
+
logForDebugging(`npm view ${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.NATIVE_PACKAGE_URL}@${tag2} version: ${stdout}`);
|
|
217334
217334
|
const latestVersion = stdout.trim();
|
|
217335
217335
|
return latestVersion;
|
|
217336
217336
|
}
|
|
@@ -217386,7 +217386,7 @@ async function downloadVersionFromArtifactory(version2, stagingPath) {
|
|
|
217386
217386
|
const fs3 = getFsImplementation();
|
|
217387
217387
|
await fs3.rm(stagingPath, { recursive: true, force: true });
|
|
217388
217388
|
const platform4 = getPlatform2();
|
|
217389
|
-
const platformPackageName = `${{ VERSION: "0.1.
|
|
217389
|
+
const platformPackageName = `${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.NATIVE_PACKAGE_URL}-${platform4}`;
|
|
217390
217390
|
logForDebugging(`Fetching integrity hash for ${platformPackageName}@${version2}`);
|
|
217391
217391
|
const {
|
|
217392
217392
|
stdout: integrityOutput,
|
|
@@ -217415,7 +217415,7 @@ async function downloadVersionFromArtifactory(version2, stagingPath) {
|
|
|
217415
217415
|
name: "theus-native-installer",
|
|
217416
217416
|
version: "0.0.1",
|
|
217417
217417
|
dependencies: {
|
|
217418
|
-
[{ VERSION: "0.1.
|
|
217418
|
+
[{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.NATIVE_PACKAGE_URL]: version2
|
|
217419
217419
|
}
|
|
217420
217420
|
};
|
|
217421
217421
|
const packageLock = {
|
|
@@ -217428,10 +217428,10 @@ async function downloadVersionFromArtifactory(version2, stagingPath) {
|
|
|
217428
217428
|
name: "theus-native-installer",
|
|
217429
217429
|
version: "0.0.1",
|
|
217430
217430
|
dependencies: {
|
|
217431
|
-
[{ VERSION: "0.1.
|
|
217431
|
+
[{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.NATIVE_PACKAGE_URL]: version2
|
|
217432
217432
|
}
|
|
217433
217433
|
},
|
|
217434
|
-
[`node_modules/${{ VERSION: "0.1.
|
|
217434
|
+
[`node_modules/${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.NATIVE_PACKAGE_URL}`]: {
|
|
217435
217435
|
version: version2,
|
|
217436
217436
|
optionalDependencies: {
|
|
217437
217437
|
[platformPackageName]: version2
|
|
@@ -217453,7 +217453,7 @@ async function downloadVersionFromArtifactory(version2, stagingPath) {
|
|
|
217453
217453
|
if (result.code !== 0) {
|
|
217454
217454
|
throw new Error(`npm ci failed with code ${result.code}: ${result.stderr}`);
|
|
217455
217455
|
}
|
|
217456
|
-
logForDebugging(`Successfully downloaded and verified ${{ VERSION: "0.1.
|
|
217456
|
+
logForDebugging(`Successfully downloaded and verified ${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.NATIVE_PACKAGE_URL}@${version2}`);
|
|
217457
217457
|
}
|
|
217458
217458
|
function getStallTimeoutMs() {
|
|
217459
217459
|
return Number(process.env.THEUS_CODE_STALL_TIMEOUT_MS_FOR_TESTING) || DEFAULT_STALL_TIMEOUT_MS;
|
|
@@ -218116,8 +218116,8 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
|
|
|
218116
218116
|
const maxVersion = await getMaxVersion();
|
|
218117
218117
|
if (maxVersion && gt(version2, maxVersion)) {
|
|
218118
218118
|
logForDebugging(`Native installer: maxVersion ${maxVersion} is set, capping update from ${version2} to ${maxVersion}`);
|
|
218119
|
-
if (gte({ VERSION: "0.1.
|
|
218120
|
-
logForDebugging(`Native installer: current version ${{ VERSION: "0.1.
|
|
218119
|
+
if (gte({ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION, maxVersion)) {
|
|
218120
|
+
logForDebugging(`Native installer: current version ${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} is already at or above maxVersion ${maxVersion}, skipping update`);
|
|
218121
218121
|
logEvent("tengu_native_update_skipped_max_version", {
|
|
218122
218122
|
latency_ms: Date.now() - startTime2,
|
|
218123
218123
|
max_version: maxVersion,
|
|
@@ -218128,7 +218128,7 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
|
|
|
218128
218128
|
version2 = maxVersion;
|
|
218129
218129
|
}
|
|
218130
218130
|
}
|
|
218131
|
-
if (!forceReinstall && version2 === { VERSION: "0.1.
|
|
218131
|
+
if (!forceReinstall && version2 === { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION && await versionIsAvailable(version2) && await isPossibleTheusBinary(executablePath)) {
|
|
218132
218132
|
logForDebugging(`Found ${version2} at ${executablePath}, skipping install`);
|
|
218133
218133
|
logEvent("tengu_native_update_complete", {
|
|
218134
218134
|
latency_ms: Date.now() - startTime2,
|
|
@@ -218870,8 +218870,8 @@ async function cleanupNpmInstallations() {
|
|
|
218870
218870
|
} else if (codePackageResult.error) {
|
|
218871
218871
|
errors4.push(codePackageResult.error);
|
|
218872
218872
|
}
|
|
218873
|
-
if ({ VERSION: "0.1.
|
|
218874
|
-
const macroPackageResult = await attemptNpmUninstall({ VERSION: "0.1.
|
|
218873
|
+
if ({ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL && { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL !== "@theus-ai/theus-code") {
|
|
218874
|
+
const macroPackageResult = await attemptNpmUninstall({ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL);
|
|
218875
218875
|
if (macroPackageResult.success) {
|
|
218876
218876
|
removed++;
|
|
218877
218877
|
if (macroPackageResult.warning) {
|
|
@@ -295236,9 +295236,9 @@ function getTheusEnvMetadata() {
|
|
|
295236
295236
|
};
|
|
295237
295237
|
}
|
|
295238
295238
|
function getBuildAgeMinutes() {
|
|
295239
|
-
if (!{ VERSION: "0.1.
|
|
295239
|
+
if (!{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.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)
|
|
295240
295240
|
return;
|
|
295241
|
-
const buildTime = new Date({ VERSION: "0.1.
|
|
295241
|
+
const buildTime = new Date({ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.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();
|
|
295242
295242
|
if (isNaN(buildTime))
|
|
295243
295243
|
return;
|
|
295244
295244
|
return Math.floor((Date.now() - buildTime) / 60000);
|
|
@@ -311468,7 +311468,7 @@ function getAssistantMessageFromError(error40, model, options2) {
|
|
|
311468
311468
|
if (process.env.USER_TYPE === "ant") {
|
|
311469
311469
|
const baseMessage = `API Error: 400 ${error40.message}
|
|
311470
311470
|
|
|
311471
|
-
Run /share and post the JSON file to ${{ VERSION: "0.1.
|
|
311471
|
+
Run /share and post the JSON file to ${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.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}.`;
|
|
311472
311472
|
const rewindInstruction = getIsNonInteractiveSession() ? "" : " Then, use /rewind to recover the conversation.";
|
|
311473
311473
|
return createAssistantAPIErrorMessage({
|
|
311474
311474
|
content: baseMessage + rewindInstruction,
|
|
@@ -311504,7 +311504,7 @@ Run /share and post the JSON file to ${{ VERSION: "0.1.11", BUILD_TIME: "1970-01
|
|
|
311504
311504
|
if (process.env.USER_TYPE === "ant" && !process.env.THEUS_MODEL && error40 instanceof Error && error40.message.toLowerCase().includes("invalid model name")) {
|
|
311505
311505
|
const orgId = getOauthAccountInfo()?.organizationUuid;
|
|
311506
311506
|
const baseMsg = `[THEUS-INTERNAL] Your org isn't gated into the \`${model}\` model. Either run \`theus\` with \`THEUS_MODEL=${getDefaultMainLoopModelSetting()}\``;
|
|
311507
|
-
const msg = orgId ? `${baseMsg} or share your orgId (${orgId}) in ${{ VERSION: "0.1.
|
|
311507
|
+
const msg = orgId ? `${baseMsg} or share your orgId (${orgId}) in ${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.FEEDBACK_CHANNEL} for help getting access.` : `${baseMsg} or reach out in ${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.FEEDBACK_CHANNEL} for help getting access.`;
|
|
311508
311508
|
return createAssistantAPIErrorMessage({
|
|
311509
311509
|
content: msg,
|
|
311510
311510
|
error: "invalid_request"
|
|
@@ -321582,7 +321582,7 @@ function buildPrimarySection() {
|
|
|
321582
321582
|
});
|
|
321583
321583
|
return [{
|
|
321584
321584
|
label: "Version",
|
|
321585
|
-
value: { VERSION: "0.1.
|
|
321585
|
+
value: { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
321586
321586
|
}, {
|
|
321587
321587
|
label: "Session name",
|
|
321588
321588
|
value: nameValue
|
|
@@ -325333,7 +325333,7 @@ function Config({
|
|
|
325333
325333
|
}
|
|
325334
325334
|
})
|
|
325335
325335
|
}) : showSubmenu === "ChannelDowngrade" ? /* @__PURE__ */ jsx_runtime180.jsx(ChannelDowngradeDialog, {
|
|
325336
|
-
currentVersion: { VERSION: "0.1.
|
|
325336
|
+
currentVersion: { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
325337
325337
|
onChoice: (choice) => {
|
|
325338
325338
|
setShowSubmenu(null);
|
|
325339
325339
|
setTabsHidden(false);
|
|
@@ -325345,7 +325345,7 @@ function Config({
|
|
|
325345
325345
|
autoUpdatesChannel: "stable"
|
|
325346
325346
|
};
|
|
325347
325347
|
if (choice === "stay") {
|
|
325348
|
-
newSettings.minimumVersion = { VERSION: "0.1.
|
|
325348
|
+
newSettings.minimumVersion = { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
|
|
325349
325349
|
}
|
|
325350
325350
|
updateSettingsForSource("userSettings", newSettings);
|
|
325351
325351
|
setSettingsData((prev_27) => ({
|
|
@@ -333379,7 +333379,7 @@ function HelpV2(t0) {
|
|
|
333379
333379
|
let t6;
|
|
333380
333380
|
if ($2[31] !== tabs) {
|
|
333381
333381
|
t6 = /* @__PURE__ */ jsx_runtime207.jsx(Tabs, {
|
|
333382
|
-
title: `Theus v${{ VERSION: "0.1.
|
|
333382
|
+
title: `Theus v${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}`,
|
|
333383
333383
|
color: "professionalBlue",
|
|
333384
333384
|
defaultTab: "general",
|
|
333385
333385
|
children: tabs
|
|
@@ -350810,9 +350810,9 @@ function getAllReleaseNotes(changelogContent = getStoredChangelogFromMemory()) {
|
|
|
350810
350810
|
return [];
|
|
350811
350811
|
}
|
|
350812
350812
|
}
|
|
350813
|
-
async function checkForReleaseNotes(lastSeenVersion, currentVersion = { VERSION: "0.1.
|
|
350813
|
+
async function checkForReleaseNotes(lastSeenVersion, currentVersion = { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION) {
|
|
350814
350814
|
if (process.env.USER_TYPE === "ant") {
|
|
350815
|
-
const changelog = { VERSION: "0.1.
|
|
350815
|
+
const changelog = { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION_CHANGELOG;
|
|
350816
350816
|
if (changelog) {
|
|
350817
350817
|
const commits = changelog.trim().split(`
|
|
350818
350818
|
`).filter(Boolean);
|
|
@@ -355006,7 +355006,7 @@ var init_Messages = __esm(() => {
|
|
|
355006
355006
|
let t1;
|
|
355007
355007
|
if ($2[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
355008
355008
|
t1 = /* @__PURE__ */ jsx_runtime245.jsx(TheusBanner, {
|
|
355009
|
-
version: { VERSION: "0.1.
|
|
355009
|
+
version: { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
355010
355010
|
});
|
|
355011
355011
|
$2[0] = t1;
|
|
355012
355012
|
} else {
|
|
@@ -382546,7 +382546,7 @@ async function captureMemoryDiagnostics(trigger, dumpNumber = 0) {
|
|
|
382546
382546
|
smapsRollup,
|
|
382547
382547
|
platform: process.platform,
|
|
382548
382548
|
nodeVersion: process.version,
|
|
382549
|
-
ccVersion: { VERSION: "0.1.
|
|
382549
|
+
ccVersion: { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
382550
382550
|
};
|
|
382551
382551
|
}
|
|
382552
382552
|
async function performHeapDump(trigger = "manual", dumpNumber = 0) {
|
|
@@ -383132,7 +383132,7 @@ var init_bridge_kick = __esm(() => {
|
|
|
383132
383132
|
var call54 = async () => {
|
|
383133
383133
|
return {
|
|
383134
383134
|
type: "text",
|
|
383135
|
-
value: { VERSION: "0.1.
|
|
383135
|
+
value: { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.BUILD_TIME ? `${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} (built ${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.BUILD_TIME})` : { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
383136
383136
|
};
|
|
383137
383137
|
}, version2, version_default;
|
|
383138
383138
|
var init_version = __esm(() => {
|
|
@@ -386867,7 +386867,7 @@ __export(exports_update, {
|
|
|
386867
386867
|
});
|
|
386868
386868
|
async function update() {
|
|
386869
386869
|
logEvent("tengu_update_check", {});
|
|
386870
|
-
writeToStdout(`Current version: ${{ VERSION: "0.1.
|
|
386870
|
+
writeToStdout(`Current version: ${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}
|
|
386871
386871
|
`);
|
|
386872
386872
|
const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
|
|
386873
386873
|
writeToStdout(`Checking for updates to ${channel2} version...
|
|
@@ -386942,8 +386942,8 @@ async function update() {
|
|
|
386942
386942
|
writeToStdout(`Theus is managed by Homebrew.
|
|
386943
386943
|
`);
|
|
386944
386944
|
const latest = await getLatestVersion(channel2);
|
|
386945
|
-
if (latest && !gte({ VERSION: "0.1.
|
|
386946
|
-
writeToStdout(`Update available: ${{ VERSION: "0.1.
|
|
386945
|
+
if (latest && !gte({ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
|
|
386946
|
+
writeToStdout(`Update available: ${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}
|
|
386947
386947
|
`);
|
|
386948
386948
|
writeToStdout(`
|
|
386949
386949
|
`);
|
|
@@ -386959,8 +386959,8 @@ async function update() {
|
|
|
386959
386959
|
writeToStdout(`Theus is managed by winget.
|
|
386960
386960
|
`);
|
|
386961
386961
|
const latest = await getLatestVersion(channel2);
|
|
386962
|
-
if (latest && !gte({ VERSION: "0.1.
|
|
386963
|
-
writeToStdout(`Update available: ${{ VERSION: "0.1.
|
|
386962
|
+
if (latest && !gte({ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
|
|
386963
|
+
writeToStdout(`Update available: ${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}
|
|
386964
386964
|
`);
|
|
386965
386965
|
writeToStdout(`
|
|
386966
386966
|
`);
|
|
@@ -386976,8 +386976,8 @@ async function update() {
|
|
|
386976
386976
|
writeToStdout(`Theus is managed by apk.
|
|
386977
386977
|
`);
|
|
386978
386978
|
const latest = await getLatestVersion(channel2);
|
|
386979
|
-
if (latest && !gte({ VERSION: "0.1.
|
|
386980
|
-
writeToStdout(`Update available: ${{ VERSION: "0.1.
|
|
386979
|
+
if (latest && !gte({ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
|
|
386980
|
+
writeToStdout(`Update available: ${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}
|
|
386981
386981
|
`);
|
|
386982
386982
|
writeToStdout(`
|
|
386983
386983
|
`);
|
|
@@ -387042,11 +387042,11 @@ async function update() {
|
|
|
387042
387042
|
`);
|
|
387043
387043
|
await gracefulShutdown(1);
|
|
387044
387044
|
}
|
|
387045
|
-
if (result.latestVersion === { VERSION: "0.1.
|
|
387046
|
-
writeToStdout(source_default.green(`Theus is up to date (${{ VERSION: "0.1.
|
|
387045
|
+
if (result.latestVersion === { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION) {
|
|
387046
|
+
writeToStdout(source_default.green(`Theus is up to date (${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})`) + `
|
|
387047
387047
|
`);
|
|
387048
387048
|
} else {
|
|
387049
|
-
writeToStdout(source_default.green(`Successfully updated from ${{ VERSION: "0.1.
|
|
387049
|
+
writeToStdout(source_default.green(`Successfully updated from ${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} to version ${result.latestVersion}`) + `
|
|
387050
387050
|
`);
|
|
387051
387051
|
await regenerateCompletionCache();
|
|
387052
387052
|
}
|
|
@@ -387065,9 +387065,9 @@ async function update() {
|
|
|
387065
387065
|
await removeInstalledSymlink();
|
|
387066
387066
|
}
|
|
387067
387067
|
logForDebugging("update: Checking npm registry for latest version");
|
|
387068
|
-
logForDebugging(`update: Package URL: ${{ VERSION: "0.1.
|
|
387068
|
+
logForDebugging(`update: Package URL: ${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.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}`);
|
|
387069
387069
|
const npmTag = channel2 === "stable" ? "stable" : "latest";
|
|
387070
|
-
const npmCommand = `npm view ${{ VERSION: "0.1.
|
|
387070
|
+
const npmCommand = `npm view ${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.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`;
|
|
387071
387071
|
logForDebugging(`update: Running: ${npmCommand}`);
|
|
387072
387072
|
const latestVersion = await getLatestVersion(channel2);
|
|
387073
387073
|
logForDebugging(`update: Latest version from npm: ${latestVersion || "FAILED"}`);
|
|
@@ -387087,7 +387087,7 @@ async function update() {
|
|
|
387087
387087
|
`);
|
|
387088
387088
|
process.stderr.write(` \u2022 Corporate proxy/firewall blocking npm
|
|
387089
387089
|
`);
|
|
387090
|
-
if ({ VERSION: "0.1.
|
|
387090
|
+
if ({ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL && !{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.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")) {
|
|
387091
387091
|
process.stderr.write(` \u2022 Internal/development build not published to npm
|
|
387092
387092
|
`);
|
|
387093
387093
|
}
|
|
@@ -387099,19 +387099,19 @@ async function update() {
|
|
|
387099
387099
|
`);
|
|
387100
387100
|
process.stderr.write(` \u2022 Run with --debug flag for more details
|
|
387101
387101
|
`);
|
|
387102
|
-
const packageName = { VERSION: "0.1.
|
|
387102
|
+
const packageName = { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL || (process.env.USER_TYPE === "ant" ? "@theus-ai/theus-cli" : "@theus-ai/theus-code");
|
|
387103
387103
|
process.stderr.write(` \u2022 Manually check: npm view ${packageName} version
|
|
387104
387104
|
`);
|
|
387105
387105
|
process.stderr.write(` \u2022 Check if you need to login: npm whoami
|
|
387106
387106
|
`);
|
|
387107
387107
|
await gracefulShutdown(1);
|
|
387108
387108
|
}
|
|
387109
|
-
if (gte({ VERSION: "0.1.
|
|
387110
|
-
writeToStdout(source_default.green(`Theus is up to date (${{ VERSION: "0.1.
|
|
387109
|
+
if (gte({ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
|
|
387110
|
+
writeToStdout(source_default.green(`Theus is up to date (${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})`) + `
|
|
387111
387111
|
`);
|
|
387112
387112
|
await gracefulShutdown(0);
|
|
387113
387113
|
}
|
|
387114
|
-
writeToStdout(`New version available: ${latestVersion} (current: ${{ VERSION: "0.1.
|
|
387114
|
+
writeToStdout(`New version available: ${latestVersion} (current: ${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})
|
|
387115
387115
|
`);
|
|
387116
387116
|
writeToStdout(`Installing update...
|
|
387117
387117
|
`);
|
|
@@ -387156,7 +387156,7 @@ async function update() {
|
|
|
387156
387156
|
logForDebugging(`update: Installation status: ${status2}`);
|
|
387157
387157
|
switch (status2) {
|
|
387158
387158
|
case "success":
|
|
387159
|
-
writeToStdout(source_default.green(`Successfully updated from ${{ VERSION: "0.1.
|
|
387159
|
+
writeToStdout(source_default.green(`Successfully updated from ${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} to version ${latestVersion}`) + `
|
|
387160
387160
|
`);
|
|
387161
387161
|
await regenerateCompletionCache();
|
|
387162
387162
|
break;
|
|
@@ -387166,7 +387166,7 @@ async function update() {
|
|
|
387166
387166
|
if (useLocalUpdate) {
|
|
387167
387167
|
process.stderr.write(`Try manually updating with:
|
|
387168
387168
|
`);
|
|
387169
|
-
process.stderr.write(` cd ~/.theus/local && npm update ${{ VERSION: "0.1.
|
|
387169
|
+
process.stderr.write(` cd ~/.theus/local && npm update ${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.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}
|
|
387170
387170
|
`);
|
|
387171
387171
|
} else {
|
|
387172
387172
|
process.stderr.write(`Try running with sudo or fix npm permissions
|
|
@@ -387182,7 +387182,7 @@ async function update() {
|
|
|
387182
387182
|
if (useLocalUpdate) {
|
|
387183
387183
|
process.stderr.write(`Try manually updating with:
|
|
387184
387184
|
`);
|
|
387185
|
-
process.stderr.write(` cd ~/.theus/local && npm update ${{ VERSION: "0.1.
|
|
387185
|
+
process.stderr.write(` cd ~/.theus/local && npm update ${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.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}
|
|
387186
387186
|
`);
|
|
387187
387187
|
} else {
|
|
387188
387188
|
process.stderr.write(`Or consider using native installation with: theus install
|
|
@@ -394077,7 +394077,7 @@ var init_sessionStorage = __esm(() => {
|
|
|
394077
394077
|
init_settings2();
|
|
394078
394078
|
init_slowOperations();
|
|
394079
394079
|
init_uuid();
|
|
394080
|
-
VERSION4 = { VERSION: "0.1.
|
|
394080
|
+
VERSION4 = { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
|
|
394081
394081
|
MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
|
|
394082
394082
|
SKIP_FIRST_PROMPT_PATTERN = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
|
|
394083
394083
|
EPHEMERAL_PROGRESS_TYPES = new Set([
|
|
@@ -395282,7 +395282,7 @@ var init_filesystem = __esm(() => {
|
|
|
395282
395282
|
});
|
|
395283
395283
|
getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
|
|
395284
395284
|
const nonce = randomBytes20(16).toString("hex");
|
|
395285
|
-
return join140(getTheusTempDir(), "bundled-skills", { VERSION: "0.1.
|
|
395285
|
+
return join140(getTheusTempDir(), "bundled-skills", { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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);
|
|
395286
395286
|
});
|
|
395287
395287
|
getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
|
|
395288
395288
|
});
|
|
@@ -400457,7 +400457,7 @@ function getSimpleDoingTasksSection() {
|
|
|
400457
400457
|
];
|
|
400458
400458
|
const userHelpSubitems = [
|
|
400459
400459
|
`/help: Get help with using Theus`,
|
|
400460
|
-
`To give feedback, users should ${{ VERSION: "0.1.
|
|
400460
|
+
`To give feedback, users should ${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.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}`
|
|
400461
400461
|
];
|
|
400462
400462
|
const items = [
|
|
400463
400463
|
`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.`,
|
|
@@ -401280,7 +401280,7 @@ function computeFingerprint(messageText, version3) {
|
|
|
401280
401280
|
}
|
|
401281
401281
|
function computeFingerprintFromMessages(messages) {
|
|
401282
401282
|
const firstMessageText = extractFirstMessageText(messages);
|
|
401283
|
-
return computeFingerprint(firstMessageText, { VERSION: "0.1.
|
|
401283
|
+
return computeFingerprint(firstMessageText, { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
|
|
401284
401284
|
}
|
|
401285
401285
|
var FINGERPRINT_SALT = "59cf53e54c78";
|
|
401286
401286
|
var init_fingerprint = () => {};
|
|
@@ -403195,6 +403195,33 @@ function stringifyToolResult(content) {
|
|
|
403195
403195
|
return String(content ?? "");
|
|
403196
403196
|
}
|
|
403197
403197
|
}
|
|
403198
|
+
function imageBlockToPart(block2) {
|
|
403199
|
+
if (!block2 || typeof block2 !== "object")
|
|
403200
|
+
return null;
|
|
403201
|
+
const typed = block2;
|
|
403202
|
+
if (typed.type !== "image" || !typed.source)
|
|
403203
|
+
return null;
|
|
403204
|
+
const src = typed.source;
|
|
403205
|
+
if (src.type === "base64" && src.data) {
|
|
403206
|
+
const mime = src.media_type || "image/png";
|
|
403207
|
+
return { type: "image_url", image_url: { url: `data:${mime};base64,${src.data}` } };
|
|
403208
|
+
}
|
|
403209
|
+
if ((src.type === "url" || !src.type) && src.url) {
|
|
403210
|
+
return { type: "image_url", image_url: { url: src.url } };
|
|
403211
|
+
}
|
|
403212
|
+
return null;
|
|
403213
|
+
}
|
|
403214
|
+
function collectImageParts(content) {
|
|
403215
|
+
if (!Array.isArray(content))
|
|
403216
|
+
return [];
|
|
403217
|
+
const parts = [];
|
|
403218
|
+
for (const block2 of content) {
|
|
403219
|
+
const part = imageBlockToPart(block2);
|
|
403220
|
+
if (part)
|
|
403221
|
+
parts.push(part);
|
|
403222
|
+
}
|
|
403223
|
+
return parts;
|
|
403224
|
+
}
|
|
403198
403225
|
function parseToolInput(raw) {
|
|
403199
403226
|
if (!raw.trim())
|
|
403200
403227
|
return {};
|
|
@@ -403235,6 +403262,8 @@ function userToOpenAI(message) {
|
|
|
403235
403262
|
}
|
|
403236
403263
|
const out = [];
|
|
403237
403264
|
const textParts = [];
|
|
403265
|
+
const imageParts = [];
|
|
403266
|
+
const deferredToolImages = [];
|
|
403238
403267
|
for (const block2 of content) {
|
|
403239
403268
|
if (!block2 || typeof block2 !== "object")
|
|
403240
403269
|
continue;
|
|
@@ -403245,16 +403274,38 @@ function userToOpenAI(message) {
|
|
|
403245
403274
|
tool_call_id: typed.tool_use_id,
|
|
403246
403275
|
content: stringifyToolResult(typed.content)
|
|
403247
403276
|
});
|
|
403277
|
+
deferredToolImages.push(...collectImageParts(typed.content));
|
|
403278
|
+
continue;
|
|
403279
|
+
}
|
|
403280
|
+
const imagePart = imageBlockToPart(block2);
|
|
403281
|
+
if (imagePart) {
|
|
403282
|
+
imageParts.push(imagePart);
|
|
403248
403283
|
continue;
|
|
403249
403284
|
}
|
|
403250
403285
|
const text = contentBlockText(block2);
|
|
403251
403286
|
if (text)
|
|
403252
403287
|
textParts.push(text);
|
|
403253
403288
|
}
|
|
403254
|
-
if (
|
|
403289
|
+
if (imageParts.length > 0) {
|
|
403290
|
+
const parts = [];
|
|
403291
|
+
if (textParts.length > 0)
|
|
403292
|
+
parts.push({ type: "text", text: textParts.join(`
|
|
403293
|
+
`) });
|
|
403294
|
+
parts.push(...imageParts);
|
|
403295
|
+
out.push({ role: "user", content: parts });
|
|
403296
|
+
} else if (textParts.length > 0) {
|
|
403255
403297
|
out.push({ role: "user", content: textParts.join(`
|
|
403256
403298
|
`) });
|
|
403257
403299
|
}
|
|
403300
|
+
if (deferredToolImages.length > 0) {
|
|
403301
|
+
out.push({
|
|
403302
|
+
role: "user",
|
|
403303
|
+
content: [
|
|
403304
|
+
{ type: "text", text: "[resultado visual de la herramienta]" },
|
|
403305
|
+
...deferredToolImages
|
|
403306
|
+
]
|
|
403307
|
+
});
|
|
403308
|
+
}
|
|
403258
403309
|
return out.length > 0 ? out : [{ role: "user", content: "" }];
|
|
403259
403310
|
}
|
|
403260
403311
|
function toOpenAIMessages(messages, systemPrompt) {
|
|
@@ -403714,7 +403765,7 @@ async function sideQuery(opts) {
|
|
|
403714
403765
|
betas.push(STRUCTURED_OUTPUTS_BETA_HEADER);
|
|
403715
403766
|
}
|
|
403716
403767
|
const messageText = extractFirstUserMessageText(messages);
|
|
403717
|
-
const fingerprint = computeFingerprint(messageText, { VERSION: "0.1.
|
|
403768
|
+
const fingerprint = computeFingerprint(messageText, { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
|
|
403718
403769
|
const attributionHeader = getAttributionHeader(fingerprint);
|
|
403719
403770
|
const systemBlocks = [
|
|
403720
403771
|
attributionHeader ? { type: "text", text: attributionHeader } : null,
|
|
@@ -405017,7 +405068,7 @@ async function handleMemories(state) {
|
|
|
405017
405068
|
async function runProjectContextMcpServer() {
|
|
405018
405069
|
const projectRoot = process.env.THEUS_PROJECT_ROOT || process.cwd();
|
|
405019
405070
|
const state = new ProjectContextState(projectRoot);
|
|
405020
|
-
const server = new Server({ name: SERVER_NAME, version: { VERSION: "0.1.
|
|
405071
|
+
const server = new Server({ name: SERVER_NAME, version: { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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: {} } });
|
|
405021
405072
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
405022
405073
|
tools: TOOL_DEFINITIONS.map((t) => ({
|
|
405023
405074
|
name: t.name,
|
|
@@ -405141,11 +405192,693 @@ var init_server4 = __esm(() => {
|
|
|
405141
405192
|
];
|
|
405142
405193
|
});
|
|
405143
405194
|
|
|
405195
|
+
// services/mcpComputerUse/macos.ts
|
|
405196
|
+
import { execFile as execFile5 } from "child_process";
|
|
405197
|
+
import { existsSync as existsSync14, mkdirSync as mkdirSync9, readFileSync as readFileSync22, statSync as statSync10, unlinkSync as unlinkSync3, writeFileSync as writeFileSync7 } from "fs";
|
|
405198
|
+
import { homedir as homedir35, tmpdir as tmpdir10 } from "os";
|
|
405199
|
+
import { join as join144 } from "path";
|
|
405200
|
+
import { promisify as promisify4 } from "util";
|
|
405201
|
+
function cuDir() {
|
|
405202
|
+
const dir = join144(homedir35(), ".theus", "cu");
|
|
405203
|
+
if (!existsSync14(dir))
|
|
405204
|
+
mkdirSync9(dir, { recursive: true });
|
|
405205
|
+
return dir;
|
|
405206
|
+
}
|
|
405207
|
+
function resolveBin(name, extra = []) {
|
|
405208
|
+
const candidates = [
|
|
405209
|
+
...extra,
|
|
405210
|
+
`/opt/homebrew/bin/${name}`,
|
|
405211
|
+
`/usr/local/bin/${name}`,
|
|
405212
|
+
`/usr/bin/${name}`,
|
|
405213
|
+
`/usr/sbin/${name}`
|
|
405214
|
+
];
|
|
405215
|
+
for (const candidate of candidates) {
|
|
405216
|
+
if (existsSync14(candidate))
|
|
405217
|
+
return candidate;
|
|
405218
|
+
}
|
|
405219
|
+
return name;
|
|
405220
|
+
}
|
|
405221
|
+
async function run2(bin, args, opts = {}) {
|
|
405222
|
+
try {
|
|
405223
|
+
const { stdout, stderr } = await execFileP(bin, args, {
|
|
405224
|
+
timeout: opts.timeoutMs ?? 15000,
|
|
405225
|
+
maxBuffer: 64 * 1024 * 1024,
|
|
405226
|
+
encoding: "utf8"
|
|
405227
|
+
});
|
|
405228
|
+
return { stdout, stderr };
|
|
405229
|
+
} catch (err2) {
|
|
405230
|
+
const e = err2;
|
|
405231
|
+
return { stdout: e.stdout ?? "", stderr: e.stderr ?? e.message ?? String(err2) };
|
|
405232
|
+
}
|
|
405233
|
+
}
|
|
405234
|
+
async function getScreenGeometry(force = false) {
|
|
405235
|
+
if (cachedGeometry && !force)
|
|
405236
|
+
return cachedGeometry;
|
|
405237
|
+
const { stdout } = await run2(OSASCRIPT, [
|
|
405238
|
+
"-e",
|
|
405239
|
+
'tell application "Finder" to get bounds of window of desktop'
|
|
405240
|
+
]);
|
|
405241
|
+
const nums = stdout.trim().split(",").map((s) => Number.parseInt(s.trim(), 10));
|
|
405242
|
+
if (nums.length === 4 && nums.every((n3) => Number.isFinite(n3))) {
|
|
405243
|
+
cachedGeometry = { logicalWidth: nums[2] - nums[0], logicalHeight: nums[3] - nums[1] };
|
|
405244
|
+
return cachedGeometry;
|
|
405245
|
+
}
|
|
405246
|
+
cachedGeometry = { logicalWidth: 1920, logicalHeight: 1080 };
|
|
405247
|
+
return cachedGeometry;
|
|
405248
|
+
}
|
|
405249
|
+
async function checkPermissions() {
|
|
405250
|
+
const probe = join144(tmpdir10(), `theus-cu-probe-${process.pid}.jpg`);
|
|
405251
|
+
const cap = await run2(SCREENCAPTURE, ["-x", "-t", "jpg", probe], { timeoutMs: 8000 });
|
|
405252
|
+
const screenRecording = existsSync14(probe) && (() => {
|
|
405253
|
+
try {
|
|
405254
|
+
return statSync10(probe).size > 0;
|
|
405255
|
+
} catch {
|
|
405256
|
+
return false;
|
|
405257
|
+
}
|
|
405258
|
+
})();
|
|
405259
|
+
try {
|
|
405260
|
+
if (existsSync14(probe))
|
|
405261
|
+
unlinkSync3(probe);
|
|
405262
|
+
} catch {}
|
|
405263
|
+
const cc = await run2(CLICLICK, ["p"], { timeoutMs: 5000 });
|
|
405264
|
+
const accessibility = !/Accessibility privileges not enabled/i.test(cc.stderr + cc.stdout);
|
|
405265
|
+
const parts = [];
|
|
405266
|
+
if (!screenRecording) {
|
|
405267
|
+
parts.push("Screen Recording NO otorgado: activa el app que corre Theus (tu terminal) " + "en Ajustes del Sistema \u2192 Privacidad y seguridad \u2192 Grabaci\xF3n de pantalla.");
|
|
405268
|
+
}
|
|
405269
|
+
if (!accessibility) {
|
|
405270
|
+
parts.push("Accessibility NO otorgado: activa el app que corre Theus en Ajustes del " + "Sistema \u2192 Privacidad y seguridad \u2192 Accesibilidad.");
|
|
405271
|
+
}
|
|
405272
|
+
if (!parts.length)
|
|
405273
|
+
parts.push("Screen Recording y Accessibility otorgados.");
|
|
405274
|
+
return { screenRecording, accessibility, detail: parts.join(" ") };
|
|
405275
|
+
}
|
|
405276
|
+
async function captureScreenshot(opts = {}) {
|
|
405277
|
+
const maxSide = opts.maxSide ?? 1400;
|
|
405278
|
+
const quality = Math.min(Math.max(opts.quality ?? 72, 1), 100);
|
|
405279
|
+
const raw = join144(cuDir(), `shot-${process.pid}.png`);
|
|
405280
|
+
const out = join144(cuDir(), `shot-${process.pid}.jpg`);
|
|
405281
|
+
const capArgs = ["-x", "-t", "png", "-o"];
|
|
405282
|
+
if (opts.displayIndex && opts.displayIndex > 0)
|
|
405283
|
+
capArgs.push("-D", String(opts.displayIndex));
|
|
405284
|
+
capArgs.push(raw);
|
|
405285
|
+
const cap = await run2(SCREENCAPTURE, capArgs, { timeoutMs: 12000 });
|
|
405286
|
+
if (!existsSync14(raw) || statSync10(raw).size === 0) {
|
|
405287
|
+
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.");
|
|
405288
|
+
}
|
|
405289
|
+
await run2(SIPS, [
|
|
405290
|
+
"-Z",
|
|
405291
|
+
String(maxSide),
|
|
405292
|
+
"-s",
|
|
405293
|
+
"format",
|
|
405294
|
+
"jpeg",
|
|
405295
|
+
"-s",
|
|
405296
|
+
"formatOptions",
|
|
405297
|
+
String(quality),
|
|
405298
|
+
raw,
|
|
405299
|
+
"--out",
|
|
405300
|
+
out
|
|
405301
|
+
], { timeoutMs: 12000 });
|
|
405302
|
+
if (!existsSync14(out) || statSync10(out).size === 0) {
|
|
405303
|
+
throw new ComputerUseError("sips no pudo reescalar la captura a JPEG.");
|
|
405304
|
+
}
|
|
405305
|
+
const dims = await run2(SIPS, ["-g", "pixelWidth", "-g", "pixelHeight", out]);
|
|
405306
|
+
const width = Number.parseInt(/pixelWidth:\s*(\d+)/.exec(dims.stdout)?.[1] ?? "0", 10);
|
|
405307
|
+
const height = Number.parseInt(/pixelHeight:\s*(\d+)/.exec(dims.stdout)?.[1] ?? "0", 10);
|
|
405308
|
+
const geometry = await getScreenGeometry();
|
|
405309
|
+
const base643 = readFileSync22(out).toString("base64");
|
|
405310
|
+
return {
|
|
405311
|
+
base64: base643,
|
|
405312
|
+
mimeType: "image/jpeg",
|
|
405313
|
+
width: width || maxSide,
|
|
405314
|
+
height: height || maxSide,
|
|
405315
|
+
logicalWidth: geometry.logicalWidth,
|
|
405316
|
+
logicalHeight: geometry.logicalHeight
|
|
405317
|
+
};
|
|
405318
|
+
}
|
|
405319
|
+
function assertFinite(n3, label) {
|
|
405320
|
+
if (!Number.isFinite(n3))
|
|
405321
|
+
throw new ComputerUseError(`Coordenada ${label} inv\xE1lida: ${n3}`);
|
|
405322
|
+
}
|
|
405323
|
+
function guardAccessibility(res) {
|
|
405324
|
+
if (/Accessibility privileges not enabled/i.test(res.stderr + res.stdout)) {
|
|
405325
|
+
throw new ComputerUseError("Acci\xF3n bloqueada: falta el permiso de Accesibilidad para el app que corre " + "Theus (Ajustes \u2192 Privacidad y seguridad \u2192 Accesibilidad).");
|
|
405326
|
+
}
|
|
405327
|
+
}
|
|
405328
|
+
async function moveMouse(x2, y) {
|
|
405329
|
+
assertFinite(x2, "x");
|
|
405330
|
+
assertFinite(y, "y");
|
|
405331
|
+
const res = await run2(CLICLICK, ["-w", "0", `m:${Math.round(x2)},${Math.round(y)}`]);
|
|
405332
|
+
guardAccessibility(res);
|
|
405333
|
+
}
|
|
405334
|
+
async function click(x2, y, button = "left", count4 = 1) {
|
|
405335
|
+
assertFinite(x2, "x");
|
|
405336
|
+
assertFinite(y, "y");
|
|
405337
|
+
const px = Math.round(x2), py = Math.round(y);
|
|
405338
|
+
const cmd = button === "right" ? "rc" : count4 >= 2 ? "dc" : "c";
|
|
405339
|
+
const res = await run2(CLICLICK, ["-w", "0", `${cmd}:${px},${py}`]);
|
|
405340
|
+
guardAccessibility(res);
|
|
405341
|
+
}
|
|
405342
|
+
async function drag(fromX, fromY, toX, toY) {
|
|
405343
|
+
[fromX, fromY, toX, toY].forEach((n3, i3) => assertFinite(n3, `arg${i3}`));
|
|
405344
|
+
const res = await run2(CLICLICK, [
|
|
405345
|
+
"-w",
|
|
405346
|
+
"20",
|
|
405347
|
+
`dd:${Math.round(fromX)},${Math.round(fromY)}`,
|
|
405348
|
+
`m:${Math.round(toX)},${Math.round(toY)}`,
|
|
405349
|
+
`du:${Math.round(toX)},${Math.round(toY)}`
|
|
405350
|
+
]);
|
|
405351
|
+
guardAccessibility(res);
|
|
405352
|
+
}
|
|
405353
|
+
async function typeText(text) {
|
|
405354
|
+
if (!text)
|
|
405355
|
+
return;
|
|
405356
|
+
const res = await run2(CLICLICK, ["-w", "0", `t:${text}`], { timeoutMs: 30000 });
|
|
405357
|
+
guardAccessibility(res);
|
|
405358
|
+
}
|
|
405359
|
+
async function pressKey(spec) {
|
|
405360
|
+
const parts = spec.split("+").map((s) => s.trim().toLowerCase()).filter(Boolean);
|
|
405361
|
+
if (!parts.length)
|
|
405362
|
+
return;
|
|
405363
|
+
const modMap = {
|
|
405364
|
+
cmd: "cmd",
|
|
405365
|
+
command: "cmd",
|
|
405366
|
+
meta: "cmd",
|
|
405367
|
+
super: "cmd",
|
|
405368
|
+
ctrl: "ctrl",
|
|
405369
|
+
control: "ctrl",
|
|
405370
|
+
alt: "alt",
|
|
405371
|
+
option: "alt",
|
|
405372
|
+
opt: "alt",
|
|
405373
|
+
shift: "shift",
|
|
405374
|
+
fn: "fn"
|
|
405375
|
+
};
|
|
405376
|
+
const mods = [];
|
|
405377
|
+
let mainKey = null;
|
|
405378
|
+
for (const p of parts) {
|
|
405379
|
+
if (modMap[p])
|
|
405380
|
+
mods.push(modMap[p]);
|
|
405381
|
+
else
|
|
405382
|
+
mainKey = p;
|
|
405383
|
+
}
|
|
405384
|
+
const special = new Map([
|
|
405385
|
+
["return", "return"],
|
|
405386
|
+
["enter", "return"],
|
|
405387
|
+
["tab", "tab"],
|
|
405388
|
+
["space", "space"],
|
|
405389
|
+
["esc", "esc"],
|
|
405390
|
+
["escape", "esc"],
|
|
405391
|
+
["delete", "delete"],
|
|
405392
|
+
["backspace", "delete"],
|
|
405393
|
+
["forward-delete", "fwd-delete"],
|
|
405394
|
+
["home", "home"],
|
|
405395
|
+
["end", "end"],
|
|
405396
|
+
["pageup", "page-up"],
|
|
405397
|
+
["pagedown", "page-down"],
|
|
405398
|
+
["up", "arrow-up"],
|
|
405399
|
+
["down", "arrow-down"],
|
|
405400
|
+
["left", "arrow-left"],
|
|
405401
|
+
["right", "arrow-right"],
|
|
405402
|
+
["arrow-up", "arrow-up"],
|
|
405403
|
+
["arrow-down", "arrow-down"],
|
|
405404
|
+
["arrow-left", "arrow-left"],
|
|
405405
|
+
["arrow-right", "arrow-right"]
|
|
405406
|
+
]);
|
|
405407
|
+
const args = ["-w", "0"];
|
|
405408
|
+
if (mods.length)
|
|
405409
|
+
args.push(`kd:${mods.join(",")}`);
|
|
405410
|
+
if (mainKey) {
|
|
405411
|
+
const sp = special.get(mainKey);
|
|
405412
|
+
if (sp)
|
|
405413
|
+
args.push(`kp:${sp}`);
|
|
405414
|
+
else if (mainKey.length === 1)
|
|
405415
|
+
args.push(`t:${mainKey}`);
|
|
405416
|
+
else
|
|
405417
|
+
args.push(`kp:${mainKey}`);
|
|
405418
|
+
}
|
|
405419
|
+
if (mods.length)
|
|
405420
|
+
args.push(`ku:${mods.join(",")}`);
|
|
405421
|
+
const res = await run2(CLICLICK, args);
|
|
405422
|
+
guardAccessibility(res);
|
|
405423
|
+
}
|
|
405424
|
+
async function cursorPosition2() {
|
|
405425
|
+
const { stdout } = await run2(CLICLICK, ["p"]);
|
|
405426
|
+
const m = /(-?\d+),\s*(-?\d+)/.exec(stdout.trim());
|
|
405427
|
+
if (!m)
|
|
405428
|
+
throw new ComputerUseError("No se pudo leer la posici\xF3n del cursor.");
|
|
405429
|
+
return { x: Number.parseInt(m[1], 10), y: Number.parseInt(m[2], 10) };
|
|
405430
|
+
}
|
|
405431
|
+
async function getFrontmostApp() {
|
|
405432
|
+
const { stdout } = await run2(OSASCRIPT, [
|
|
405433
|
+
"-e",
|
|
405434
|
+
'tell application "System Events" to get name of first application process whose frontmost is true'
|
|
405435
|
+
]);
|
|
405436
|
+
const name = stdout.trim();
|
|
405437
|
+
return name || null;
|
|
405438
|
+
}
|
|
405439
|
+
async function ensureScrollHelper() {
|
|
405440
|
+
if (scrollBinPromise)
|
|
405441
|
+
return scrollBinPromise;
|
|
405442
|
+
scrollBinPromise = (async () => {
|
|
405443
|
+
if (!existsSync14(SWIFTC) && SWIFTC === "swiftc") {}
|
|
405444
|
+
const src = join144(cuDir(), "scroll.swift");
|
|
405445
|
+
const bin = join144(cuDir(), "theus-cu-scroll");
|
|
405446
|
+
if (existsSync14(bin))
|
|
405447
|
+
return bin;
|
|
405448
|
+
try {
|
|
405449
|
+
writeFileSync7(src, SCROLL_SWIFT, "utf8");
|
|
405450
|
+
const res = await run2(SWIFTC, ["-O", "-o", bin, src], { timeoutMs: 60000 });
|
|
405451
|
+
if (existsSync14(bin))
|
|
405452
|
+
return bin;
|
|
405453
|
+
process.stderr.write(`[computer-use] no se pudo compilar el helper de scroll: ${res.stderr}
|
|
405454
|
+
`);
|
|
405455
|
+
return null;
|
|
405456
|
+
} catch {
|
|
405457
|
+
return null;
|
|
405458
|
+
}
|
|
405459
|
+
})();
|
|
405460
|
+
return scrollBinPromise;
|
|
405461
|
+
}
|
|
405462
|
+
async function scroll(direction, amount = 3) {
|
|
405463
|
+
const bin = await ensureScrollHelper();
|
|
405464
|
+
if (!bin) {
|
|
405465
|
+
throw new ComputerUseError("Scroll no disponible (no se pudo compilar el helper Swift). El resto de " + "acciones de computer-use funcionan; usa teclas Re P\xE1g/Av P\xE1g como alternativa.");
|
|
405466
|
+
}
|
|
405467
|
+
const step = 40 * Math.max(1, amount);
|
|
405468
|
+
const dy = direction === "up" ? step : direction === "down" ? -step : 0;
|
|
405469
|
+
const dx = direction === "left" ? step : direction === "right" ? -step : 0;
|
|
405470
|
+
await run2(bin, [String(dy), String(dx)]);
|
|
405471
|
+
}
|
|
405472
|
+
function toolingReport() {
|
|
405473
|
+
return { cliclick: CLICLICK, screencapture: SCREENCAPTURE, sips: SIPS, osascript: OSASCRIPT, swiftc: SWIFTC };
|
|
405474
|
+
}
|
|
405475
|
+
var execFileP, CLICLICK, SCREENCAPTURE, SIPS, OSASCRIPT, SWIFTC, ComputerUseError, cachedGeometry = null, SCROLL_SWIFT = `import CoreGraphics
|
|
405476
|
+
import Foundation
|
|
405477
|
+
let a = CommandLine.arguments
|
|
405478
|
+
let dy = a.count > 1 ? Int32(a[1]) ?? 0 : 0
|
|
405479
|
+
let dx = a.count > 2 ? Int32(a[2]) ?? 0 : 0
|
|
405480
|
+
if let e = CGEvent(scrollWheelEvent2Source: nil, units: .pixel, wheelCount: 2, wheel1: dy, wheel2: dx, wheel3: 0) {
|
|
405481
|
+
e.post(tap: .cghidEventTap)
|
|
405482
|
+
}
|
|
405483
|
+
`, scrollBinPromise = null;
|
|
405484
|
+
var init_macos = __esm(() => {
|
|
405485
|
+
execFileP = promisify4(execFile5);
|
|
405486
|
+
CLICLICK = resolveBin("cliclick");
|
|
405487
|
+
SCREENCAPTURE = resolveBin("screencapture", ["/usr/sbin/screencapture"]);
|
|
405488
|
+
SIPS = resolveBin("sips");
|
|
405489
|
+
OSASCRIPT = resolveBin("osascript");
|
|
405490
|
+
SWIFTC = resolveBin("swiftc");
|
|
405491
|
+
ComputerUseError = class ComputerUseError extends Error {
|
|
405492
|
+
};
|
|
405493
|
+
});
|
|
405494
|
+
|
|
405495
|
+
// services/mcpComputerUse/common.ts
|
|
405496
|
+
var exports_common = {};
|
|
405497
|
+
__export(exports_common, {
|
|
405498
|
+
isComputerUseEnabled: () => isComputerUseEnabled,
|
|
405499
|
+
COMPUTER_USE_TOOL_NAMES: () => COMPUTER_USE_TOOL_NAMES,
|
|
405500
|
+
COMPUTER_USE_SERVER_NAME: () => COMPUTER_USE_SERVER_NAME
|
|
405501
|
+
});
|
|
405502
|
+
function isComputerUseEnabled() {
|
|
405503
|
+
const v = (process.env.THEUS_COMPUTER_USE ?? "").trim().toLowerCase();
|
|
405504
|
+
return v === "1" || v === "true" || v === "yes" || v === "on";
|
|
405505
|
+
}
|
|
405506
|
+
var COMPUTER_USE_SERVER_NAME = "theus-computer-use", COMPUTER_USE_TOOL_NAMES;
|
|
405507
|
+
var init_common3 = __esm(() => {
|
|
405508
|
+
COMPUTER_USE_TOOL_NAMES = [
|
|
405509
|
+
"screenshot",
|
|
405510
|
+
"left_click",
|
|
405511
|
+
"double_click",
|
|
405512
|
+
"right_click",
|
|
405513
|
+
"mouse_move",
|
|
405514
|
+
"left_click_drag",
|
|
405515
|
+
"type",
|
|
405516
|
+
"key",
|
|
405517
|
+
"scroll",
|
|
405518
|
+
"cursor_position",
|
|
405519
|
+
"wait",
|
|
405520
|
+
"permissions"
|
|
405521
|
+
];
|
|
405522
|
+
});
|
|
405523
|
+
|
|
405524
|
+
// services/mcpComputerUse/server.ts
|
|
405525
|
+
var exports_server2 = {};
|
|
405526
|
+
__export(exports_server2, {
|
|
405527
|
+
runComputerUseMcpServer: () => runComputerUseMcpServer,
|
|
405528
|
+
COMPUTER_USE_SERVER_NAME: () => COMPUTER_USE_SERVER_NAME
|
|
405529
|
+
});
|
|
405530
|
+
function logToStderr2(message) {
|
|
405531
|
+
process.stderr.write(`[${COMPUTER_USE_SERVER_NAME}] ${message}
|
|
405532
|
+
`);
|
|
405533
|
+
}
|
|
405534
|
+
function text(t) {
|
|
405535
|
+
return { content: [{ type: "text", text: t }] };
|
|
405536
|
+
}
|
|
405537
|
+
function errorResult(t) {
|
|
405538
|
+
return { content: [{ type: "text", text: t }], isError: true };
|
|
405539
|
+
}
|
|
405540
|
+
function toLogical(x2, y, last2) {
|
|
405541
|
+
if (!last2 || !last2.imgWidth || !last2.imgHeight)
|
|
405542
|
+
return { x: x2, y };
|
|
405543
|
+
const lx = x2 / last2.imgWidth * last2.logicalWidth;
|
|
405544
|
+
const ly = y / last2.imgHeight * last2.logicalHeight;
|
|
405545
|
+
return {
|
|
405546
|
+
x: clamp2(lx, 0, last2.logicalWidth - 1),
|
|
405547
|
+
y: clamp2(ly, 0, last2.logicalHeight - 1)
|
|
405548
|
+
};
|
|
405549
|
+
}
|
|
405550
|
+
async function captureAndDescribe(last2) {
|
|
405551
|
+
const shot = await captureScreenshot();
|
|
405552
|
+
last2.value = {
|
|
405553
|
+
imgWidth: shot.width,
|
|
405554
|
+
imgHeight: shot.height,
|
|
405555
|
+
logicalWidth: shot.logicalWidth,
|
|
405556
|
+
logicalHeight: shot.logicalHeight
|
|
405557
|
+
};
|
|
405558
|
+
let front = null;
|
|
405559
|
+
try {
|
|
405560
|
+
front = await getFrontmostApp();
|
|
405561
|
+
} catch {}
|
|
405562
|
+
const caption = `Screenshot ${shot.width}\xD7${shot.height} px. ` + (front ? `App al frente: ${front}. ` : "") + "Da coordenadas en p\xEDxeles dentro de esta imagen.";
|
|
405563
|
+
return {
|
|
405564
|
+
content: [
|
|
405565
|
+
{ type: "text", text: caption },
|
|
405566
|
+
{ type: "image", data: shot.base64, mimeType: shot.mimeType }
|
|
405567
|
+
]
|
|
405568
|
+
};
|
|
405569
|
+
}
|
|
405570
|
+
async function runComputerUseMcpServer() {
|
|
405571
|
+
const server = new Server({ name: COMPUTER_USE_SERVER_NAME, version: "1.0.0" }, { capabilities: { tools: {} } });
|
|
405572
|
+
const last2 = { value: null };
|
|
405573
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
|
|
405574
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
405575
|
+
const name = request.params.name;
|
|
405576
|
+
const a2 = request.params.arguments ?? {};
|
|
405577
|
+
try {
|
|
405578
|
+
switch (name) {
|
|
405579
|
+
case "screenshot":
|
|
405580
|
+
return await captureAndDescribe(last2);
|
|
405581
|
+
case "left_click": {
|
|
405582
|
+
const p = toLogical(num(a2.x), num(a2.y), last2.value);
|
|
405583
|
+
await click(p.x, p.y, "left", 1);
|
|
405584
|
+
return text(`Click izquierdo en imagen (${num(a2.x)}, ${num(a2.y)}).`);
|
|
405585
|
+
}
|
|
405586
|
+
case "double_click": {
|
|
405587
|
+
const p = toLogical(num(a2.x), num(a2.y), last2.value);
|
|
405588
|
+
await click(p.x, p.y, "left", 2);
|
|
405589
|
+
return text(`Doble click en imagen (${num(a2.x)}, ${num(a2.y)}).`);
|
|
405590
|
+
}
|
|
405591
|
+
case "right_click": {
|
|
405592
|
+
const p = toLogical(num(a2.x), num(a2.y), last2.value);
|
|
405593
|
+
await click(p.x, p.y, "right", 1);
|
|
405594
|
+
return text(`Click derecho en imagen (${num(a2.x)}, ${num(a2.y)}).`);
|
|
405595
|
+
}
|
|
405596
|
+
case "mouse_move": {
|
|
405597
|
+
const p = toLogical(num(a2.x), num(a2.y), last2.value);
|
|
405598
|
+
await moveMouse(p.x, p.y);
|
|
405599
|
+
return text(`Cursor movido a imagen (${num(a2.x)}, ${num(a2.y)}).`);
|
|
405600
|
+
}
|
|
405601
|
+
case "left_click_drag": {
|
|
405602
|
+
const from = toLogical(num(a2.from_x), num(a2.from_y), last2.value);
|
|
405603
|
+
const to = toLogical(num(a2.to_x), num(a2.to_y), last2.value);
|
|
405604
|
+
await drag(from.x, from.y, to.x, to.y);
|
|
405605
|
+
return text("Arrastre completado.");
|
|
405606
|
+
}
|
|
405607
|
+
case "type": {
|
|
405608
|
+
const t = typeof a2.text === "string" ? a2.text : String(a2.text ?? "");
|
|
405609
|
+
await typeText(t);
|
|
405610
|
+
return text(`Escrito (${t.length} caracteres).`);
|
|
405611
|
+
}
|
|
405612
|
+
case "key": {
|
|
405613
|
+
const keys2 = typeof a2.keys === "string" ? a2.keys : String(a2.keys ?? "");
|
|
405614
|
+
if (!keys2)
|
|
405615
|
+
return errorResult('Falta el par\xE1metro "keys".');
|
|
405616
|
+
await pressKey(keys2);
|
|
405617
|
+
return text(`Tecla(s) "${keys2}" enviada(s).`);
|
|
405618
|
+
}
|
|
405619
|
+
case "scroll": {
|
|
405620
|
+
const dir = String(a2.direction ?? "");
|
|
405621
|
+
if (!["up", "down", "left", "right"].includes(dir)) {
|
|
405622
|
+
return errorResult("direction debe ser up|down|left|right.");
|
|
405623
|
+
}
|
|
405624
|
+
await scroll(dir, num(a2.amount, 3));
|
|
405625
|
+
return text(`Scroll ${dir}.`);
|
|
405626
|
+
}
|
|
405627
|
+
case "cursor_position": {
|
|
405628
|
+
const pos = await cursorPosition2();
|
|
405629
|
+
return text(`Cursor en (${pos.x}, ${pos.y}) puntos l\xF3gicos.`);
|
|
405630
|
+
}
|
|
405631
|
+
case "wait": {
|
|
405632
|
+
const s = clamp2(num(a2.seconds, 1), 0, 10);
|
|
405633
|
+
await new Promise((r) => setTimeout(r, s * 1000));
|
|
405634
|
+
return text(`Esperado ${s}s.`);
|
|
405635
|
+
}
|
|
405636
|
+
case "permissions": {
|
|
405637
|
+
const p = await checkPermissions();
|
|
405638
|
+
return text(`Grabaci\xF3n de pantalla: ${p.screenRecording ? "OK" : "FALTA"}
|
|
405639
|
+
` + `Accesibilidad: ${p.accessibility ? "OK" : "FALTA"}
|
|
405640
|
+
${p.detail}`);
|
|
405641
|
+
}
|
|
405642
|
+
default:
|
|
405643
|
+
return errorResult(`Tool desconocida: ${name}`);
|
|
405644
|
+
}
|
|
405645
|
+
} catch (err2) {
|
|
405646
|
+
logToStderr2(`error en tool ${name}: ${String(err2)}`);
|
|
405647
|
+
return errorResult(`Error ejecutando "${name}": ${err2 instanceof Error ? err2.message : String(err2)}`);
|
|
405648
|
+
}
|
|
405649
|
+
});
|
|
405650
|
+
const transport = new StdioServerTransport;
|
|
405651
|
+
let exiting = false;
|
|
405652
|
+
const shutdownAndExit = () => {
|
|
405653
|
+
if (exiting)
|
|
405654
|
+
return;
|
|
405655
|
+
exiting = true;
|
|
405656
|
+
process.exit(0);
|
|
405657
|
+
};
|
|
405658
|
+
process.stdin.on("end", shutdownAndExit);
|
|
405659
|
+
process.stdin.on("error", shutdownAndExit);
|
|
405660
|
+
logToStderr2("arrancando servidor MCP de computer-use (macOS)");
|
|
405661
|
+
await server.connect(transport);
|
|
405662
|
+
logToStderr2("servidor MCP de computer-use listo");
|
|
405663
|
+
}
|
|
405664
|
+
var num = (v, fallback = NaN) => {
|
|
405665
|
+
const n3 = typeof v === "number" ? v : Number.parseFloat(String(v));
|
|
405666
|
+
return Number.isFinite(n3) ? n3 : fallback;
|
|
405667
|
+
}, clamp2 = (v, lo, hi) => Math.min(Math.max(v, lo), hi), COORD, TOOLS;
|
|
405668
|
+
var init_server5 = __esm(() => {
|
|
405669
|
+
init_server3();
|
|
405670
|
+
init_stdio2();
|
|
405671
|
+
init_types();
|
|
405672
|
+
init_macos();
|
|
405673
|
+
init_common3();
|
|
405674
|
+
COORD = {
|
|
405675
|
+
x: { type: "number", description: "Coordenada X en p\xEDxeles dentro del \xFAltimo screenshot" },
|
|
405676
|
+
y: { type: "number", description: "Coordenada Y en p\xEDxeles dentro del \xFAltimo screenshot" }
|
|
405677
|
+
};
|
|
405678
|
+
TOOLS = [
|
|
405679
|
+
{
|
|
405680
|
+
name: "screenshot",
|
|
405681
|
+
description: "Captura la pantalla y la devuelve como imagen. \xDAsala ANTES de cualquier " + "acci\xF3n para ver el estado actual, y despu\xE9s para verificar el resultado. " + "Las coordenadas de las dem\xE1s tools son P\xCDXELES dentro de esta imagen.",
|
|
405682
|
+
inputSchema: { type: "object", properties: {} }
|
|
405683
|
+
},
|
|
405684
|
+
{
|
|
405685
|
+
name: "left_click",
|
|
405686
|
+
description: "Click izquierdo en (x, y), coordenadas en p\xEDxeles del \xFAltimo screenshot.",
|
|
405687
|
+
inputSchema: { type: "object", properties: { ...COORD }, required: ["x", "y"] }
|
|
405688
|
+
},
|
|
405689
|
+
{
|
|
405690
|
+
name: "double_click",
|
|
405691
|
+
description: "Doble click izquierdo en (x, y).",
|
|
405692
|
+
inputSchema: { type: "object", properties: { ...COORD }, required: ["x", "y"] }
|
|
405693
|
+
},
|
|
405694
|
+
{
|
|
405695
|
+
name: "right_click",
|
|
405696
|
+
description: "Click derecho en (x, y).",
|
|
405697
|
+
inputSchema: { type: "object", properties: { ...COORD }, required: ["x", "y"] }
|
|
405698
|
+
},
|
|
405699
|
+
{
|
|
405700
|
+
name: "mouse_move",
|
|
405701
|
+
description: "Mueve el cursor a (x, y) sin hacer click.",
|
|
405702
|
+
inputSchema: { type: "object", properties: { ...COORD }, required: ["x", "y"] }
|
|
405703
|
+
},
|
|
405704
|
+
{
|
|
405705
|
+
name: "left_click_drag",
|
|
405706
|
+
description: "Arrastra con el bot\xF3n izquierdo desde (from_x, from_y) hasta (to_x, to_y).",
|
|
405707
|
+
inputSchema: {
|
|
405708
|
+
type: "object",
|
|
405709
|
+
properties: {
|
|
405710
|
+
from_x: { type: "number" },
|
|
405711
|
+
from_y: { type: "number" },
|
|
405712
|
+
to_x: { type: "number" },
|
|
405713
|
+
to_y: { type: "number" }
|
|
405714
|
+
},
|
|
405715
|
+
required: ["from_x", "from_y", "to_x", "to_y"]
|
|
405716
|
+
}
|
|
405717
|
+
},
|
|
405718
|
+
{
|
|
405719
|
+
name: "type",
|
|
405720
|
+
description: "Escribe el texto dado en el foco actual (como si lo teclearas).",
|
|
405721
|
+
inputSchema: {
|
|
405722
|
+
type: "object",
|
|
405723
|
+
properties: { text: { type: "string", description: "Texto a escribir" } },
|
|
405724
|
+
required: ["text"]
|
|
405725
|
+
}
|
|
405726
|
+
},
|
|
405727
|
+
{
|
|
405728
|
+
name: "key",
|
|
405729
|
+
description: 'Pulsa una tecla o combinaci\xF3n. Ejemplos: "return", "tab", "escape", ' + '"cmd+a", "cmd+c", "ctrl+shift+t", "arrow-down". Modificadores: cmd, ctrl, alt, shift.',
|
|
405730
|
+
inputSchema: {
|
|
405731
|
+
type: "object",
|
|
405732
|
+
properties: { keys: { type: "string", description: 'Tecla o combinaci\xF3n, p.ej. "cmd+a"' } },
|
|
405733
|
+
required: ["keys"]
|
|
405734
|
+
}
|
|
405735
|
+
},
|
|
405736
|
+
{
|
|
405737
|
+
name: "scroll",
|
|
405738
|
+
description: "Hace scroll en la direcci\xF3n dada. amount = intensidad (por defecto 3).",
|
|
405739
|
+
inputSchema: {
|
|
405740
|
+
type: "object",
|
|
405741
|
+
properties: {
|
|
405742
|
+
direction: { type: "string", enum: ["up", "down", "left", "right"] },
|
|
405743
|
+
amount: { type: "number", description: "Intensidad del scroll (por defecto 3)" }
|
|
405744
|
+
},
|
|
405745
|
+
required: ["direction"]
|
|
405746
|
+
}
|
|
405747
|
+
},
|
|
405748
|
+
{
|
|
405749
|
+
name: "cursor_position",
|
|
405750
|
+
description: "Devuelve la posici\xF3n actual del cursor (en puntos l\xF3gicos).",
|
|
405751
|
+
inputSchema: { type: "object", properties: {} }
|
|
405752
|
+
},
|
|
405753
|
+
{
|
|
405754
|
+
name: "wait",
|
|
405755
|
+
description: "Espera N segundos (\xFAtil para que la UI reaccione). M\xE1ximo 10s.",
|
|
405756
|
+
inputSchema: {
|
|
405757
|
+
type: "object",
|
|
405758
|
+
properties: { seconds: { type: "number", description: "Segundos a esperar (0\u201310)" } },
|
|
405759
|
+
required: ["seconds"]
|
|
405760
|
+
}
|
|
405761
|
+
},
|
|
405762
|
+
{
|
|
405763
|
+
name: "permissions",
|
|
405764
|
+
description: "Verifica si los permisos macOS (Grabaci\xF3n de pantalla + Accesibilidad) " + "est\xE1n otorgados al app que corre Theus. Devuelve un diagn\xF3stico accionable.",
|
|
405765
|
+
inputSchema: { type: "object", properties: {} }
|
|
405766
|
+
}
|
|
405767
|
+
];
|
|
405768
|
+
});
|
|
405769
|
+
|
|
405770
|
+
// services/mcpComputerUse/selftest.ts
|
|
405771
|
+
var exports_selftest = {};
|
|
405772
|
+
__export(exports_selftest, {
|
|
405773
|
+
runComputerUseSelfTest: () => runComputerUseSelfTest
|
|
405774
|
+
});
|
|
405775
|
+
import { existsSync as existsSync15, writeFileSync as writeFileSync8 } from "fs";
|
|
405776
|
+
import { join as join145 } from "path";
|
|
405777
|
+
import { homedir as homedir36 } from "os";
|
|
405778
|
+
async function runComputerUseSelfTest() {
|
|
405779
|
+
let pass = 0;
|
|
405780
|
+
let fail = 0;
|
|
405781
|
+
const line = (s) => process.stdout.write(s + `
|
|
405782
|
+
`);
|
|
405783
|
+
const ok = (s) => {
|
|
405784
|
+
pass++;
|
|
405785
|
+
line(` ${GREEN}PASS${RST} ${s}`);
|
|
405786
|
+
};
|
|
405787
|
+
const bad = (s) => {
|
|
405788
|
+
fail++;
|
|
405789
|
+
line(` ${RED}FAIL${RST} ${s}`);
|
|
405790
|
+
};
|
|
405791
|
+
const warn = (s) => line(` ${YEL}\xB7\xB7\xB7\xB7${RST} ${s}`);
|
|
405792
|
+
line(`
|
|
405793
|
+
Theus computer-use \u2014 self-test (macOS)
|
|
405794
|
+
`);
|
|
405795
|
+
const tools = toolingReport();
|
|
405796
|
+
for (const [name, path19] of Object.entries(tools)) {
|
|
405797
|
+
if (existsSync15(path19))
|
|
405798
|
+
ok(`${name}: ${path19}`);
|
|
405799
|
+
else if (name === "swiftc")
|
|
405800
|
+
warn(`${name}: no encontrado (scroll quedar\xE1 deshabilitado; el resto funciona)`);
|
|
405801
|
+
else
|
|
405802
|
+
bad(`${name}: NO encontrado (${path19}) \u2014 inst\xE1lalo (brew install cliclick)`);
|
|
405803
|
+
}
|
|
405804
|
+
line(`
|
|
405805
|
+
Permisos macOS:`);
|
|
405806
|
+
const perms = await checkPermissions();
|
|
405807
|
+
if (perms.screenRecording)
|
|
405808
|
+
ok("Grabaci\xF3n de pantalla otorgada");
|
|
405809
|
+
else
|
|
405810
|
+
bad("Grabaci\xF3n de pantalla FALTA \u2014 act\xEDvala para tu terminal en Ajustes \u2192 Privacidad \u2192 Grabaci\xF3n de pantalla");
|
|
405811
|
+
if (perms.accessibility)
|
|
405812
|
+
ok("Accesibilidad otorgada");
|
|
405813
|
+
else
|
|
405814
|
+
bad("Accesibilidad FALTA \u2014 act\xEDvala para tu terminal en Ajustes \u2192 Privacidad \u2192 Accesibilidad");
|
|
405815
|
+
line(`
|
|
405816
|
+
Geometr\xEDa y captura:`);
|
|
405817
|
+
try {
|
|
405818
|
+
const geo = await getScreenGeometry(true);
|
|
405819
|
+
ok(`Geometr\xEDa l\xF3gica: ${geo.logicalWidth}\xD7${geo.logicalHeight} puntos`);
|
|
405820
|
+
} catch (e) {
|
|
405821
|
+
bad(`Geometr\xEDa fall\xF3: ${String(e)}`);
|
|
405822
|
+
}
|
|
405823
|
+
let captureOk = false;
|
|
405824
|
+
try {
|
|
405825
|
+
const shot = await captureScreenshot();
|
|
405826
|
+
const outPath = join145(homedir36(), ".theus", "cu", "selftest-shot.jpg");
|
|
405827
|
+
writeFileSync8(outPath, Buffer.from(shot.base64, "base64"));
|
|
405828
|
+
ok(`Captura ${shot.width}\xD7${shot.height} px, ${Math.round(shot.base64.length * 0.75 / 1024)} KB \u2192 ${outPath}`);
|
|
405829
|
+
captureOk = true;
|
|
405830
|
+
} catch (e) {
|
|
405831
|
+
bad(`Captura fall\xF3: ${e instanceof Error ? e.message : String(e)}`);
|
|
405832
|
+
}
|
|
405833
|
+
let startPos = null;
|
|
405834
|
+
try {
|
|
405835
|
+
startPos = await cursorPosition2();
|
|
405836
|
+
ok(`Posici\xF3n del cursor: (${startPos.x}, ${startPos.y})`);
|
|
405837
|
+
} catch (e) {
|
|
405838
|
+
bad(`Lectura de cursor fall\xF3: ${String(e)}`);
|
|
405839
|
+
}
|
|
405840
|
+
if (perms.accessibility && startPos) {
|
|
405841
|
+
line(`
|
|
405842
|
+
Control (no destructivo \u2014 mueve el cursor y lo devuelve):`);
|
|
405843
|
+
try {
|
|
405844
|
+
const geo = await getScreenGeometry();
|
|
405845
|
+
const cx = Math.round(geo.logicalWidth / 2);
|
|
405846
|
+
const cy = Math.round(geo.logicalHeight / 2);
|
|
405847
|
+
await moveMouse(cx, cy);
|
|
405848
|
+
await new Promise((r) => setTimeout(r, 200));
|
|
405849
|
+
const moved = await cursorPosition2();
|
|
405850
|
+
const near = Math.abs(moved.x - cx) <= 3 && Math.abs(moved.y - cy) <= 3;
|
|
405851
|
+
if (near)
|
|
405852
|
+
ok(`Cursor movido al centro (${moved.x}, ${moved.y}) y verificado`);
|
|
405853
|
+
else
|
|
405854
|
+
bad(`Cursor no lleg\xF3 al centro (esperaba ~${cx},${cy}, obtuve ${moved.x},${moved.y})`);
|
|
405855
|
+
await moveMouse(startPos.x, startPos.y);
|
|
405856
|
+
} catch (e) {
|
|
405857
|
+
bad(`Movimiento fall\xF3: ${e instanceof Error ? e.message : String(e)}`);
|
|
405858
|
+
}
|
|
405859
|
+
} else if (!perms.accessibility) {
|
|
405860
|
+
warn("Control de cursor omitido (falta Accesibilidad).");
|
|
405861
|
+
}
|
|
405862
|
+
line("");
|
|
405863
|
+
if (fail === 0) {
|
|
405864
|
+
line(`${GREEN}CERTIFICADO${RST}: computer-use funcional en este equipo (${pass} checks).`);
|
|
405865
|
+
if (captureOk)
|
|
405866
|
+
line("Abre ~/.theus/cu/selftest-shot.jpg para ver la captura de prueba.");
|
|
405867
|
+
} else {
|
|
405868
|
+
line(`${RED}${fail} check(s) fallaron${RST}, ${pass} pasaron. Resuelve lo anterior y vuelve a correr el self-test.`);
|
|
405869
|
+
}
|
|
405870
|
+
line("");
|
|
405871
|
+
}
|
|
405872
|
+
var GREEN = "\x1B[32m", RED = "\x1B[31m", YEL = "\x1B[33m", RST = "\x1B[0m";
|
|
405873
|
+
var init_selftest = __esm(() => {
|
|
405874
|
+
init_macos();
|
|
405875
|
+
});
|
|
405876
|
+
|
|
405144
405877
|
// utils/cronTasksLock.ts
|
|
405145
405878
|
import { mkdir as mkdir46, readFile as readFile50, unlink as unlink23, writeFile as writeFile47 } from "fs/promises";
|
|
405146
|
-
import { dirname as dirname60, join as
|
|
405879
|
+
import { dirname as dirname60, join as join146 } from "path";
|
|
405147
405880
|
function getLockPath(dir) {
|
|
405148
|
-
return
|
|
405881
|
+
return join146(dir ?? getProjectRoot(), LOCK_FILE_REL);
|
|
405149
405882
|
}
|
|
405150
405883
|
async function readLock(dir) {
|
|
405151
405884
|
let raw;
|
|
@@ -405251,7 +405984,7 @@ var init_cronTasksLock = __esm(() => {
|
|
|
405251
405984
|
init_genericProcessUtils();
|
|
405252
405985
|
init_json();
|
|
405253
405986
|
init_slowOperations();
|
|
405254
|
-
LOCK_FILE_REL =
|
|
405987
|
+
LOCK_FILE_REL = join146(".theus", "scheduled_tasks.lock");
|
|
405255
405988
|
schedulerLockSchema = lazySchema(() => exports_external.object({
|
|
405256
405989
|
sessionId: exports_external.string(),
|
|
405257
405990
|
pid: exports_external.number(),
|
|
@@ -405519,7 +406252,7 @@ function buildMissedTaskNotification(missed) {
|
|
|
405519
406252
|
NO ejecutes ${plural4 ? "estos prompts" : "este prompt"} todav\xEDa. ` + `Primero usa la herramienta AskUserQuestion para preguntar si se debe${plural4 ? "n ejecutar cada uno" : " ejecutar"} ahora. ` + `Ejec\xFAtalo solo si el usuario lo confirma.`;
|
|
405520
406253
|
const blocks = missed.map((t) => {
|
|
405521
406254
|
const meta = `[${cronToHuman(t.cron)}, creada ${new Date(t.createdAt).toLocaleString()}]`;
|
|
405522
|
-
const longestRun = (t.prompt.match(/`+/g) ?? []).reduce((max2,
|
|
406255
|
+
const longestRun = (t.prompt.match(/`+/g) ?? []).reduce((max2, run3) => Math.max(max2, run3.length), 0);
|
|
405523
406256
|
const fence = "`".repeat(Math.max(3, longestRun + 1));
|
|
405524
406257
|
return `${meta}
|
|
405525
406258
|
${fence}
|
|
@@ -405550,17 +406283,17 @@ __export(exports_workerRegistry, {
|
|
|
405550
406283
|
});
|
|
405551
406284
|
import { spawn as spawn9 } from "child_process";
|
|
405552
406285
|
import { randomUUID as randomUUID34 } from "crypto";
|
|
405553
|
-
import { appendFileSync as appendFileSync5, mkdirSync as
|
|
405554
|
-
import { homedir as
|
|
405555
|
-
import { dirname as dirname61, join as
|
|
406286
|
+
import { appendFileSync as appendFileSync5, mkdirSync as mkdirSync10, readFileSync as readFileSync23, writeFileSync as writeFileSync9 } from "fs";
|
|
406287
|
+
import { homedir as homedir37 } from "os";
|
|
406288
|
+
import { dirname as dirname61, join as join147 } from "path";
|
|
405556
406289
|
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
405557
406290
|
function projectsConfigPath() {
|
|
405558
|
-
return
|
|
406291
|
+
return join147(homedir37(), ".theus", "daemon", "projects.json");
|
|
405559
406292
|
}
|
|
405560
406293
|
function readEnabledProjects() {
|
|
405561
406294
|
let raw;
|
|
405562
406295
|
try {
|
|
405563
|
-
raw =
|
|
406296
|
+
raw = readFileSync23(projectsConfigPath(), "utf8");
|
|
405564
406297
|
} catch {
|
|
405565
406298
|
return [];
|
|
405566
406299
|
}
|
|
@@ -405574,17 +406307,17 @@ function readEnabledProjects() {
|
|
|
405574
406307
|
return list2.filter((p) => p && typeof p.dir === "string" && p.enabled !== false);
|
|
405575
406308
|
}
|
|
405576
406309
|
function daemonDir2() {
|
|
405577
|
-
return
|
|
406310
|
+
return join147(homedir37(), ".theus", "daemon");
|
|
405578
406311
|
}
|
|
405579
406312
|
function daemonLogPath() {
|
|
405580
|
-
return
|
|
406313
|
+
return join147(daemonDir2(), "daemon.log");
|
|
405581
406314
|
}
|
|
405582
406315
|
function resolveWorkerBin() {
|
|
405583
406316
|
const override = process.env.THEUS_DAEMON_WORKER_BIN;
|
|
405584
406317
|
if (typeof override === "string" && override.length > 0)
|
|
405585
406318
|
return override;
|
|
405586
406319
|
const here = dirname61(fileURLToPath6(import.meta.url));
|
|
405587
|
-
return
|
|
406320
|
+
return join147(here, "..", "bin", "theus");
|
|
405588
406321
|
}
|
|
405589
406322
|
function turnTimeoutMs() {
|
|
405590
406323
|
const raw = process.env.THEUS_DAEMON_TURN_TIMEOUT_MS;
|
|
@@ -405610,17 +406343,17 @@ function appendCapped(buf, chunk2) {
|
|
|
405610
406343
|
}
|
|
405611
406344
|
function logDaemonLine(line) {
|
|
405612
406345
|
try {
|
|
405613
|
-
|
|
406346
|
+
mkdirSync10(daemonDir2(), { recursive: true });
|
|
405614
406347
|
appendFileSync5(daemonLogPath(), `${new Date().toISOString()} ${line}
|
|
405615
406348
|
`);
|
|
405616
406349
|
} catch {}
|
|
405617
406350
|
}
|
|
405618
406351
|
function writeRunHistory(record3) {
|
|
405619
406352
|
try {
|
|
405620
|
-
const dir =
|
|
405621
|
-
|
|
406353
|
+
const dir = join147(daemonDir2(), "runs", record3.taskId);
|
|
406354
|
+
mkdirSync10(dir, { recursive: true });
|
|
405622
406355
|
const stamp = record3.startedAt.replace(/:/g, "-");
|
|
405623
|
-
|
|
406356
|
+
writeFileSync9(join147(dir, `${stamp}.json`), JSON.stringify(record3, null, 2), "utf8");
|
|
405624
406357
|
} catch (e) {
|
|
405625
406358
|
logDaemonLine(`[daemon:cron] ERROR guardando historial task=${record3.taskId}: ${e?.message}`);
|
|
405626
406359
|
}
|
|
@@ -405762,29 +406495,29 @@ __export(exports_main, {
|
|
|
405762
406495
|
daemonMain: () => daemonMain
|
|
405763
406496
|
});
|
|
405764
406497
|
import {
|
|
405765
|
-
existsSync as
|
|
405766
|
-
mkdirSync as
|
|
405767
|
-
readFileSync as
|
|
406498
|
+
existsSync as existsSync16,
|
|
406499
|
+
mkdirSync as mkdirSync11,
|
|
406500
|
+
readFileSync as readFileSync24,
|
|
405768
406501
|
rmSync as rmSync4,
|
|
405769
|
-
writeFileSync as
|
|
406502
|
+
writeFileSync as writeFileSync10
|
|
405770
406503
|
} from "fs";
|
|
405771
|
-
import { homedir as
|
|
405772
|
-
import { dirname as dirname62, join as
|
|
406504
|
+
import { homedir as homedir38 } from "os";
|
|
406505
|
+
import { dirname as dirname62, join as join148 } from "path";
|
|
405773
406506
|
function daemonDir3() {
|
|
405774
|
-
return
|
|
406507
|
+
return join148(homedir38(), ".theus", "daemon");
|
|
405775
406508
|
}
|
|
405776
406509
|
function pidFilePath() {
|
|
405777
|
-
return
|
|
406510
|
+
return join148(daemonDir3(), "theus-daemon.pid");
|
|
405778
406511
|
}
|
|
405779
406512
|
function logFilePath() {
|
|
405780
|
-
return
|
|
406513
|
+
return join148(daemonDir3(), "daemon.log");
|
|
405781
406514
|
}
|
|
405782
406515
|
function ensureDaemonDir() {
|
|
405783
|
-
|
|
406516
|
+
mkdirSync11(daemonDir3(), { recursive: true });
|
|
405784
406517
|
}
|
|
405785
406518
|
function readPid() {
|
|
405786
406519
|
try {
|
|
405787
|
-
const raw =
|
|
406520
|
+
const raw = readFileSync24(pidFilePath(), "utf8").trim();
|
|
405788
406521
|
const pid = Number.parseInt(raw, 10);
|
|
405789
406522
|
return Number.isInteger(pid) && pid > 0 ? pid : null;
|
|
405790
406523
|
} catch {
|
|
@@ -405806,7 +406539,7 @@ async function doStart() {
|
|
|
405806
406539
|
console.log(`El daemon de Theus ya est\xE1 corriendo (PID ${existing}).`);
|
|
405807
406540
|
return;
|
|
405808
406541
|
}
|
|
405809
|
-
|
|
406542
|
+
writeFileSync10(pidFilePath(), String(process.pid), "utf8");
|
|
405810
406543
|
console.log(`Daemon de Theus iniciado (PID ${process.pid}).`);
|
|
405811
406544
|
const cleanup = () => {
|
|
405812
406545
|
try {
|
|
@@ -405851,13 +406584,13 @@ function doStatus() {
|
|
|
405851
406584
|
}
|
|
405852
406585
|
function doLogs() {
|
|
405853
406586
|
const path19 = logFilePath();
|
|
405854
|
-
if (!
|
|
406587
|
+
if (!existsSync16(path19)) {
|
|
405855
406588
|
console.log(`Sin registro de daemon todav\xEDa (${path19}).`);
|
|
405856
406589
|
return;
|
|
405857
406590
|
}
|
|
405858
406591
|
let content;
|
|
405859
406592
|
try {
|
|
405860
|
-
content =
|
|
406593
|
+
content = readFileSync24(path19, "utf8");
|
|
405861
406594
|
} catch (e) {
|
|
405862
406595
|
console.error(`No se pudo leer el registro: ${e?.message}`);
|
|
405863
406596
|
return;
|
|
@@ -405875,7 +406608,7 @@ function resolveTheusBin() {
|
|
|
405875
406608
|
return "theus";
|
|
405876
406609
|
}
|
|
405877
406610
|
function macosServiceSpec() {
|
|
405878
|
-
const path19 =
|
|
406611
|
+
const path19 = join148(homedir38(), "Library", "LaunchAgents", "pe.theus.daemon.plist");
|
|
405879
406612
|
const bin = resolveTheusBin();
|
|
405880
406613
|
const logDir = daemonDir3();
|
|
405881
406614
|
const content = `<?xml version="1.0" encoding="UTF-8"?>
|
|
@@ -405902,9 +406635,9 @@ function macosServiceSpec() {
|
|
|
405902
406635
|
<key>KeepAlive</key>
|
|
405903
406636
|
<true/>
|
|
405904
406637
|
<key>StandardOutPath</key>
|
|
405905
|
-
<string>${
|
|
406638
|
+
<string>${join148(logDir, "launchd.out.log")}</string>
|
|
405906
406639
|
<key>StandardErrorPath</key>
|
|
405907
|
-
<string>${
|
|
406640
|
+
<string>${join148(logDir, "launchd.err.log")}</string>
|
|
405908
406641
|
</dict>
|
|
405909
406642
|
</plist>
|
|
405910
406643
|
`;
|
|
@@ -405919,7 +406652,7 @@ function macosServiceSpec() {
|
|
|
405919
406652
|
};
|
|
405920
406653
|
}
|
|
405921
406654
|
function linuxServiceSpec() {
|
|
405922
|
-
const path19 =
|
|
406655
|
+
const path19 = join148(homedir38(), ".config", "systemd", "user", "theus-daemon.service");
|
|
405923
406656
|
const bin = resolveTheusBin();
|
|
405924
406657
|
const content = `[Unit]
|
|
405925
406658
|
Description=Theus daemon (cron/agent supervisor)
|
|
@@ -405981,8 +406714,8 @@ Pasos posteriores:
|
|
|
405981
406714
|
return;
|
|
405982
406715
|
}
|
|
405983
406716
|
try {
|
|
405984
|
-
|
|
405985
|
-
|
|
406717
|
+
mkdirSync11(dirname62(spec.path), { recursive: true });
|
|
406718
|
+
writeFileSync10(spec.path, spec.content, "utf8");
|
|
405986
406719
|
console.log(`Archivo de servicio escrito en: ${spec.path}`);
|
|
405987
406720
|
if (spec.notes.length > 0) {
|
|
405988
406721
|
console.log(`
|
|
@@ -406003,11 +406736,11 @@ function doUninstall(args) {
|
|
|
406003
406736
|
if (!hasConfirm(args)) {
|
|
406004
406737
|
console.log(`[dry-run] Desinstalaci\xF3n del daemon de Theus (${spec.platform}).
|
|
406005
406738
|
` + `Se eliminar\xEDa: ${spec.path}
|
|
406006
|
-
` + (
|
|
406739
|
+
` + (existsSync16(spec.path) ? "El archivo existe y ser\xEDa borrado." : "El archivo no existe actualmente (nada que borrar).") + `
|
|
406007
406740
|
Vuelve a ejecutar con --confirm para eliminarlo.`);
|
|
406008
406741
|
return;
|
|
406009
406742
|
}
|
|
406010
|
-
if (!
|
|
406743
|
+
if (!existsSync16(spec.path)) {
|
|
406011
406744
|
console.log(`No hay archivo de servicio que eliminar en: ${spec.path}`);
|
|
406012
406745
|
return;
|
|
406013
406746
|
}
|
|
@@ -407836,7 +408569,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
407836
408569
|
}
|
|
407837
408570
|
this._exit(exitCode, "commander.help", "(outputHelp)");
|
|
407838
408571
|
}
|
|
407839
|
-
addHelpText(position,
|
|
408572
|
+
addHelpText(position, text2) {
|
|
407840
408573
|
const allowedValues = ["beforeAll", "before", "after", "afterAll"];
|
|
407841
408574
|
if (!allowedValues.includes(position)) {
|
|
407842
408575
|
throw new Error(`Unexpected value for position to addHelpText.
|
|
@@ -407845,10 +408578,10 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
407845
408578
|
const helpEvent = `${position}Help`;
|
|
407846
408579
|
this.on(helpEvent, (context3) => {
|
|
407847
408580
|
let helpStr;
|
|
407848
|
-
if (typeof
|
|
407849
|
-
helpStr =
|
|
408581
|
+
if (typeof text2 === "function") {
|
|
408582
|
+
helpStr = text2({ error: context3.error, command: context3.command });
|
|
407850
408583
|
} else {
|
|
407851
|
-
helpStr =
|
|
408584
|
+
helpStr = text2;
|
|
407852
408585
|
}
|
|
407853
408586
|
if (helpStr) {
|
|
407854
408587
|
context3.write(`${helpStr}
|
|
@@ -408387,8 +409120,8 @@ __export(exports_upstreamproxy, {
|
|
|
408387
409120
|
SESSION_TOKEN_PATH: () => SESSION_TOKEN_PATH
|
|
408388
409121
|
});
|
|
408389
409122
|
import { mkdir as mkdir47, readFile as readFile51, unlink as unlink24, writeFile as writeFile48 } from "fs/promises";
|
|
408390
|
-
import { homedir as
|
|
408391
|
-
import { join as
|
|
409123
|
+
import { homedir as homedir39 } from "os";
|
|
409124
|
+
import { join as join149 } from "path";
|
|
408392
409125
|
async function initUpstreamProxy(opts) {
|
|
408393
409126
|
if (!isEnvTruthy(process.env.THEUS_CODE_REMOTE)) {
|
|
408394
409127
|
return state;
|
|
@@ -408409,7 +409142,7 @@ async function initUpstreamProxy(opts) {
|
|
|
408409
409142
|
}
|
|
408410
409143
|
setNonDumpable();
|
|
408411
409144
|
const baseUrl = opts?.ccrBaseUrl ?? process.env.THEUS_BASE_URL ?? "https://api.theus.pe";
|
|
408412
|
-
const caBundlePath = opts?.caBundlePath ??
|
|
409145
|
+
const caBundlePath = opts?.caBundlePath ?? join149(homedir39(), ".ccr", "ca-bundle.crt");
|
|
408413
409146
|
const caOk = await downloadCaBundle(baseUrl, opts?.systemCaPath ?? SYSTEM_CA_BUNDLE, caBundlePath);
|
|
408414
409147
|
if (!caOk)
|
|
408415
409148
|
return state;
|
|
@@ -408509,7 +409242,7 @@ async function downloadCaBundle(baseUrl, systemCaPath, outPath) {
|
|
|
408509
409242
|
}
|
|
408510
409243
|
const ccrCa = await resp.text();
|
|
408511
409244
|
const systemCa = await readFile51(systemCaPath, "utf8").catch(() => "");
|
|
408512
|
-
await mkdir47(
|
|
409245
|
+
await mkdir47(join149(outPath, ".."), { recursive: true });
|
|
408513
409246
|
await writeFile48(outPath, systemCa + `
|
|
408514
409247
|
` + ccrCa, "utf8");
|
|
408515
409248
|
return true;
|
|
@@ -410012,7 +410745,7 @@ function buildSystemInitMessage(inputs) {
|
|
|
410012
410745
|
slash_commands: inputs.commands.filter((c5) => c5.userInvocable !== false).map((c5) => c5.name),
|
|
410013
410746
|
apiKeySource: getTheusApiKeyWithSource().source,
|
|
410014
410747
|
betas: getSdkBetas(),
|
|
410015
|
-
theus_code_version: { VERSION: "0.1.
|
|
410748
|
+
theus_code_version: { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
410016
410749
|
output_style: outputStyle2,
|
|
410017
410750
|
agents: inputs.agents.map((agent) => agent.agentType),
|
|
410018
410751
|
skills: inputs.skills.filter((s) => s.userInvocable !== false).map((skill) => skill.name),
|
|
@@ -416397,8 +417130,8 @@ var init_ShowInIDEPrompt = __esm(() => {
|
|
|
416397
417130
|
});
|
|
416398
417131
|
|
|
416399
417132
|
// components/permissions/FilePermissionDialog/permissionOptions.tsx
|
|
416400
|
-
import { homedir as
|
|
416401
|
-
import { basename as basename47, join as
|
|
417133
|
+
import { homedir as homedir40 } from "os";
|
|
417134
|
+
import { basename as basename47, join as join150, sep as sep34 } from "path";
|
|
416402
417135
|
function isInTheusFolder(filePath) {
|
|
416403
417136
|
const absolutePath = expandPath(filePath);
|
|
416404
417137
|
const theusFolderPath = expandPath(`${getOriginalCwd()}/.theus`);
|
|
@@ -416408,7 +417141,7 @@ function isInTheusFolder(filePath) {
|
|
|
416408
417141
|
}
|
|
416409
417142
|
function isInGlobalTheusFolder(filePath) {
|
|
416410
417143
|
const absolutePath = expandPath(filePath);
|
|
416411
|
-
const globalTheusFolderPath =
|
|
417144
|
+
const globalTheusFolderPath = join150(homedir40(), ".theus");
|
|
416412
417145
|
const normalizedAbsolutePath = normalizeCaseForComparison(absolutePath);
|
|
416413
417146
|
const normalizedGlobalTheusFolderPath = normalizeCaseForComparison(globalTheusFolderPath);
|
|
416414
417147
|
return normalizedAbsolutePath.startsWith(normalizedGlobalTheusFolderPath + sep34.toLowerCase()) || normalizedAbsolutePath.startsWith(normalizedGlobalTheusFolderPath + "/");
|
|
@@ -422794,9 +423527,9 @@ function ElicitationFormDialog({
|
|
|
422794
423527
|
const field = schemaFields[fieldIndex];
|
|
422795
423528
|
if (field && isTextField(field.schema) && !isEnumSchema(field.schema)) {
|
|
422796
423529
|
const val_0 = formValues[field.name];
|
|
422797
|
-
const
|
|
422798
|
-
setTextInputValue(
|
|
422799
|
-
setTextInputCursorOffset(
|
|
423530
|
+
const text2 = val_0 !== undefined ? String(val_0) : "";
|
|
423531
|
+
setTextInputValue(text2);
|
|
423532
|
+
setTextInputCursorOffset(text2.length);
|
|
422800
423533
|
}
|
|
422801
423534
|
}, [schemaFields, formValues]);
|
|
422802
423535
|
function validateMultiSelect(fieldName, schema_0) {
|
|
@@ -424528,14 +425261,14 @@ function isBuddyTeaserWindow() {
|
|
|
424528
425261
|
function RainbowText2(t0) {
|
|
424529
425262
|
const $2 = c3(2);
|
|
424530
425263
|
const {
|
|
424531
|
-
text
|
|
425264
|
+
text: text2
|
|
424532
425265
|
} = t0;
|
|
424533
425266
|
let t1;
|
|
424534
|
-
if ($2[0] !==
|
|
425267
|
+
if ($2[0] !== text2) {
|
|
424535
425268
|
t1 = /* @__PURE__ */ jsx_runtime382.jsx(jsx_runtime382.Fragment, {
|
|
424536
|
-
children: [...
|
|
425269
|
+
children: [...text2].map(_temp176)
|
|
424537
425270
|
});
|
|
424538
|
-
$2[0] =
|
|
425271
|
+
$2[0] = text2;
|
|
424539
425272
|
$2[1] = t1;
|
|
424540
425273
|
} else {
|
|
424541
425274
|
t1 = $2[1];
|
|
@@ -424586,13 +425319,13 @@ function useBuddyNotification() {
|
|
|
424586
425319
|
}
|
|
424587
425320
|
import_react212.useEffect(t0, t1);
|
|
424588
425321
|
}
|
|
424589
|
-
function findBuddyTriggerPositions(
|
|
425322
|
+
function findBuddyTriggerPositions(text2) {
|
|
424590
425323
|
if (true)
|
|
424591
425324
|
return [];
|
|
424592
425325
|
const triggers = [];
|
|
424593
425326
|
const re = /\/buddy\b/g;
|
|
424594
425327
|
let m;
|
|
424595
|
-
while ((m = re.exec(
|
|
425328
|
+
while ((m = re.exec(text2)) !== null) {
|
|
424596
425329
|
triggers.push({
|
|
424597
425330
|
start: m.index,
|
|
424598
425331
|
end: m.index + m[0].length
|
|
@@ -424646,7 +425379,7 @@ var init_useVoiceEnabled = __esm(() => {
|
|
|
424646
425379
|
function getSemverPart(version3) {
|
|
424647
425380
|
return `${import_semver13.major(version3, { loose: true })}.${import_semver13.minor(version3, { loose: true })}.${import_semver13.patch(version3, { loose: true })}`;
|
|
424648
425381
|
}
|
|
424649
|
-
function useUpdateNotification(updatedVersion, initialVersion = { VERSION: "0.1.
|
|
425382
|
+
function useUpdateNotification(updatedVersion, initialVersion = { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION) {
|
|
424650
425383
|
const [lastNotifiedSemver, setLastNotifiedSemver] = import_react215.useState(() => getSemverPart(initialVersion));
|
|
424651
425384
|
if (!updatedVersion) {
|
|
424652
425385
|
return null;
|
|
@@ -424686,7 +425419,7 @@ function AutoUpdater({
|
|
|
424686
425419
|
return;
|
|
424687
425420
|
}
|
|
424688
425421
|
if (false) {}
|
|
424689
|
-
const currentVersion = { VERSION: "0.1.
|
|
425422
|
+
const currentVersion = { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
|
|
424690
425423
|
const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
|
|
424691
425424
|
let latestVersion = await getLatestVersion(channel2);
|
|
424692
425425
|
const isDisabled2 = isAutoUpdaterDisabled();
|
|
@@ -424822,7 +425555,7 @@ function AutoUpdater({
|
|
|
424822
425555
|
" ",
|
|
424823
425556
|
/* @__PURE__ */ jsx_runtime383.jsx(ThemedText, {
|
|
424824
425557
|
bold: true,
|
|
424825
|
-
children: hasLocalInstall ? `cd ~/.theus/local && npm update ${{ VERSION: "0.1.
|
|
425558
|
+
children: hasLocalInstall ? `cd ~/.theus/local && npm update ${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}` : `npm i -g ${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.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}`
|
|
424826
425559
|
})
|
|
424827
425560
|
]
|
|
424828
425561
|
})
|
|
@@ -424899,12 +425632,12 @@ function NativeAutoUpdater({
|
|
|
424899
425632
|
logEvent("tengu_native_auto_updater_start", {});
|
|
424900
425633
|
try {
|
|
424901
425634
|
const maxVersion = await getMaxVersion();
|
|
424902
|
-
if (maxVersion && gt({ VERSION: "0.1.
|
|
425635
|
+
if (maxVersion && gt({ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
|
|
424903
425636
|
const msg = await getMaxVersionMessage();
|
|
424904
425637
|
setMaxVersionIssue(msg ?? "affects your version");
|
|
424905
425638
|
}
|
|
424906
425639
|
const result = await installLatest(channel2);
|
|
424907
|
-
const currentVersion = { VERSION: "0.1.
|
|
425640
|
+
const currentVersion = { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
|
|
424908
425641
|
const latencyMs = Date.now() - startTime2;
|
|
424909
425642
|
if (result.lockFailed) {
|
|
424910
425643
|
logEvent("tengu_native_auto_updater_lock_contention", {
|
|
@@ -425041,17 +425774,17 @@ function PackageManagerAutoUpdater(t0) {
|
|
|
425041
425774
|
const maxVersion = await getMaxVersion();
|
|
425042
425775
|
if (maxVersion && latest && gt(latest, maxVersion)) {
|
|
425043
425776
|
logForDebugging(`PackageManagerAutoUpdater: maxVersion ${maxVersion} is set, capping update from ${latest} to ${maxVersion}`);
|
|
425044
|
-
if (gte({ VERSION: "0.1.
|
|
425045
|
-
logForDebugging(`PackageManagerAutoUpdater: current version ${{ VERSION: "0.1.
|
|
425777
|
+
if (gte({ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
|
|
425778
|
+
logForDebugging(`PackageManagerAutoUpdater: current version ${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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`);
|
|
425046
425779
|
setUpdateAvailable(false);
|
|
425047
425780
|
return;
|
|
425048
425781
|
}
|
|
425049
425782
|
latest = maxVersion;
|
|
425050
425783
|
}
|
|
425051
|
-
const hasUpdate = latest && !gte({ VERSION: "0.1.
|
|
425784
|
+
const hasUpdate = latest && !gte({ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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);
|
|
425052
425785
|
setUpdateAvailable(!!hasUpdate);
|
|
425053
425786
|
if (hasUpdate) {
|
|
425054
|
-
logForDebugging(`PackageManagerAutoUpdater: Update available ${{ VERSION: "0.1.
|
|
425787
|
+
logForDebugging(`PackageManagerAutoUpdater: Update available ${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}`);
|
|
425055
425788
|
}
|
|
425056
425789
|
};
|
|
425057
425790
|
$2[0] = t1;
|
|
@@ -425085,7 +425818,7 @@ function PackageManagerAutoUpdater(t0) {
|
|
|
425085
425818
|
wrap: "truncate",
|
|
425086
425819
|
children: [
|
|
425087
425820
|
"currentVersion: ",
|
|
425088
|
-
{ VERSION: "0.1.
|
|
425821
|
+
{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
425089
425822
|
]
|
|
425090
425823
|
});
|
|
425091
425824
|
$2[3] = verbose;
|
|
@@ -425616,10 +426349,10 @@ function Notifications(t0) {
|
|
|
425616
426349
|
let t6;
|
|
425617
426350
|
if ($2[5] !== addNotification) {
|
|
425618
426351
|
t5 = () => {
|
|
425619
|
-
setEnvHookNotifier((
|
|
426352
|
+
setEnvHookNotifier((text2, isError) => {
|
|
425620
426353
|
addNotification({
|
|
425621
426354
|
key: "env-hook",
|
|
425622
|
-
text,
|
|
426355
|
+
text: text2,
|
|
425623
426356
|
color: isError ? "error" : undefined,
|
|
425624
426357
|
priority: isError ? "medium" : "low",
|
|
425625
426358
|
timeoutMs: isError ? 8000 : 5000
|
|
@@ -426315,26 +427048,26 @@ function useInputBuffer({
|
|
|
426315
427048
|
const [currentIndex, setCurrentIndex] = import_react226.useState(-1);
|
|
426316
427049
|
const lastPushTime = import_react226.useRef(0);
|
|
426317
427050
|
const pendingPush = import_react226.useRef(null);
|
|
426318
|
-
const pushToBuffer = import_react226.useCallback((
|
|
427051
|
+
const pushToBuffer = import_react226.useCallback((text2, cursorOffset, pastedContents = {}) => {
|
|
426319
427052
|
const now2 = Date.now();
|
|
426320
427053
|
if (pendingPush.current) {
|
|
426321
427054
|
clearTimeout(pendingPush.current);
|
|
426322
427055
|
pendingPush.current = null;
|
|
426323
427056
|
}
|
|
426324
427057
|
if (now2 - lastPushTime.current < debounceMs) {
|
|
426325
|
-
pendingPush.current = setTimeout(pushToBuffer, debounceMs,
|
|
427058
|
+
pendingPush.current = setTimeout(pushToBuffer, debounceMs, text2, cursorOffset, pastedContents);
|
|
426326
427059
|
return;
|
|
426327
427060
|
}
|
|
426328
427061
|
lastPushTime.current = now2;
|
|
426329
427062
|
setBuffer((prevBuffer) => {
|
|
426330
427063
|
const newBuffer = currentIndex >= 0 ? prevBuffer.slice(0, currentIndex + 1) : prevBuffer;
|
|
426331
427064
|
const lastEntry = newBuffer[newBuffer.length - 1];
|
|
426332
|
-
if (lastEntry && lastEntry.text ===
|
|
427065
|
+
if (lastEntry && lastEntry.text === text2) {
|
|
426333
427066
|
return newBuffer;
|
|
426334
427067
|
}
|
|
426335
427068
|
const updatedBuffer = [
|
|
426336
427069
|
...newBuffer,
|
|
426337
|
-
{ text, cursorOffset, pastedContents, timestamp: now2 }
|
|
427070
|
+
{ text: text2, cursorOffset, pastedContents, timestamp: now2 }
|
|
426338
427071
|
];
|
|
426339
427072
|
if (updatedBuffer.length > maxBufferSize) {
|
|
426340
427073
|
return updatedBuffer.slice(-maxBufferSize);
|
|
@@ -426595,9 +427328,9 @@ async function getCompletionsForShell(shellType, prefix, completionType, abortSi
|
|
|
426595
427328
|
});
|
|
426596
427329
|
const result = await shellCommand.result;
|
|
426597
427330
|
return result.stdout.split(`
|
|
426598
|
-
`).filter((line) => line.trim()).slice(0, MAX_SHELL_COMPLETIONS).map((
|
|
426599
|
-
id:
|
|
426600
|
-
displayText:
|
|
427331
|
+
`).filter((line) => line.trim()).slice(0, MAX_SHELL_COMPLETIONS).map((text2) => ({
|
|
427332
|
+
id: text2,
|
|
427333
|
+
displayText: text2,
|
|
426601
427334
|
description: undefined,
|
|
426602
427335
|
metadata: { completionType }
|
|
426603
427336
|
}));
|
|
@@ -426808,11 +427541,11 @@ function convertMaskToIndices(matchmask = [], minMatchCharLength = Config2.minMa
|
|
|
426808
427541
|
indices.push([start, i3 - 1]);
|
|
426809
427542
|
return indices;
|
|
426810
427543
|
}
|
|
426811
|
-
function search(
|
|
427544
|
+
function search(text2, pattern, patternAlphabet, { location = Config2.location, distance = Config2.distance, threshold = Config2.threshold, findAllMatches = Config2.findAllMatches, minMatchCharLength = Config2.minMatchCharLength, includeMatches = Config2.includeMatches, ignoreLocation = Config2.ignoreLocation } = {}) {
|
|
426812
427545
|
if (pattern.length > 32)
|
|
426813
427546
|
throw new Error(PATTERN_LENGTH_TOO_LARGE(32));
|
|
426814
427547
|
const patternLen = pattern.length;
|
|
426815
|
-
const textLen =
|
|
427548
|
+
const textLen = text2.length;
|
|
426816
427549
|
const expectedLocation = Math.max(0, Math.min(location, textLen));
|
|
426817
427550
|
let currentThreshold = threshold;
|
|
426818
427551
|
let bestLocation = expectedLocation;
|
|
@@ -426828,7 +427561,7 @@ function search(text, pattern, patternAlphabet, { location = Config2.location, d
|
|
|
426828
427561
|
const computeMatches = minMatchCharLength > 1 || includeMatches;
|
|
426829
427562
|
const matchMask = computeMatches ? Array(textLen) : [];
|
|
426830
427563
|
let index;
|
|
426831
|
-
while ((index =
|
|
427564
|
+
while ((index = text2.indexOf(pattern, bestLocation)) > -1) {
|
|
426832
427565
|
const score = calcScore(0, index);
|
|
426833
427566
|
currentThreshold = Math.min(score, currentThreshold);
|
|
426834
427567
|
bestLocation = index + patternLen;
|
|
@@ -426863,7 +427596,7 @@ function search(text, pattern, patternAlphabet, { location = Config2.location, d
|
|
|
426863
427596
|
bitArr[finish + 1] = (1 << i3) - 1;
|
|
426864
427597
|
for (let j2 = finish;j2 >= start; j2 -= 1) {
|
|
426865
427598
|
const currentLocation = j2 - 1;
|
|
426866
|
-
const charMatch = patternAlphabet[
|
|
427599
|
+
const charMatch = patternAlphabet[text2[currentLocation]];
|
|
426867
427600
|
bitArr[j2] = (bitArr[j2 + 1] << 1 | 1) & charMatch;
|
|
426868
427601
|
if (i3)
|
|
426869
427602
|
bitArr[j2] |= (lastBitArr[j2 + 1] | lastBitArr[j2]) << 1 | 1 | lastBitArr[j2 + 1];
|
|
@@ -426886,7 +427619,7 @@ function search(text, pattern, patternAlphabet, { location = Config2.location, d
|
|
|
426886
427619
|
if (computeMatches && bestLocation >= 0) {
|
|
426887
427620
|
const matchEnd = Math.min(textLen - 1, bestLocation + patternLen - 1 + bestErrors);
|
|
426888
427621
|
for (let k2 = bestLocation;k2 <= matchEnd; k2 += 1)
|
|
426889
|
-
if (patternAlphabet[
|
|
427622
|
+
if (patternAlphabet[text2[k2]])
|
|
426890
427623
|
matchMask[k2] = 1;
|
|
426891
427624
|
}
|
|
426892
427625
|
const result = {
|
|
@@ -427111,8 +427844,8 @@ function warnNonGlobal(regex2) {
|
|
|
427111
427844
|
function resolveTokenize(tokenize7) {
|
|
427112
427845
|
if (typeof tokenize7 === "function") {
|
|
427113
427846
|
let validated = false;
|
|
427114
|
-
return (
|
|
427115
|
-
const result = tokenize7(
|
|
427847
|
+
return (text2) => {
|
|
427848
|
+
const result = tokenize7(text2);
|
|
427116
427849
|
if (!validated) {
|
|
427117
427850
|
validated = true;
|
|
427118
427851
|
if (!Array.isArray(result) || result.some((t) => typeof t !== "string"))
|
|
@@ -427124,22 +427857,22 @@ function resolveTokenize(tokenize7) {
|
|
|
427124
427857
|
if (tokenize7 instanceof RegExp) {
|
|
427125
427858
|
if (!tokenize7.global)
|
|
427126
427859
|
warnNonGlobal(tokenize7);
|
|
427127
|
-
return (
|
|
427860
|
+
return (text2) => text2.match(tokenize7) || [];
|
|
427128
427861
|
}
|
|
427129
|
-
return (
|
|
427862
|
+
return (text2) => text2.match(DEFAULT_TOKEN) || [];
|
|
427130
427863
|
}
|
|
427131
427864
|
function createAnalyzer({ isCaseSensitive = false, ignoreDiacritics = false, tokenize: tokenize7 } = {}) {
|
|
427132
427865
|
const tokenizeFn = resolveTokenize(tokenize7);
|
|
427133
|
-
return { tokenize(
|
|
427866
|
+
return { tokenize(text2) {
|
|
427134
427867
|
if (!isCaseSensitive)
|
|
427135
|
-
|
|
427868
|
+
text2 = text2.toLowerCase();
|
|
427136
427869
|
if (ignoreDiacritics)
|
|
427137
|
-
|
|
427138
|
-
return tokenizeFn(
|
|
427870
|
+
text2 = stripDiacritics(text2);
|
|
427871
|
+
return tokenizeFn(text2);
|
|
427139
427872
|
} };
|
|
427140
427873
|
}
|
|
427141
|
-
function addField(index,
|
|
427142
|
-
const tokens = analyzer.tokenize(
|
|
427874
|
+
function addField(index, text2, docIdx, analyzer) {
|
|
427875
|
+
const tokens = analyzer.tokenize(text2);
|
|
427143
427876
|
if (!tokens.length)
|
|
427144
427877
|
return;
|
|
427145
427878
|
index.fieldCount++;
|
|
@@ -427388,12 +428121,12 @@ var INCORRECT_INDEX_TYPE = "Incorrect 'index' type", INVALID_DOC_INDEX = "Invali
|
|
|
427388
428121
|
subRecords.push(subRecord);
|
|
427389
428122
|
}
|
|
427390
428123
|
} else if (isDefined2(item.v)) {
|
|
427391
|
-
const
|
|
427392
|
-
if (!isBlank(
|
|
428124
|
+
const text2 = isString2(item.v) ? item.v : toString6(item.v);
|
|
428125
|
+
if (!isBlank(text2)) {
|
|
427393
428126
|
const subRecord = {
|
|
427394
|
-
v:
|
|
428127
|
+
v: text2,
|
|
427395
428128
|
i: item.i,
|
|
427396
|
-
n: this.norm.get(
|
|
428129
|
+
n: this.norm.get(text2)
|
|
427397
428130
|
};
|
|
427398
428131
|
subRecords.push(subRecord);
|
|
427399
428132
|
}
|
|
@@ -427458,17 +428191,17 @@ var INCORRECT_INDEX_TYPE = "Incorrect 'index' type", INVALID_DOC_INDEX = "Invali
|
|
|
427458
428191
|
} else
|
|
427459
428192
|
addChunk(this.pattern, 0);
|
|
427460
428193
|
}
|
|
427461
|
-
searchIn(
|
|
428194
|
+
searchIn(text2) {
|
|
427462
428195
|
const { isCaseSensitive, ignoreDiacritics, includeMatches } = this.options;
|
|
427463
|
-
|
|
427464
|
-
|
|
427465
|
-
if (this.pattern ===
|
|
428196
|
+
text2 = isCaseSensitive ? text2 : text2.toLowerCase();
|
|
428197
|
+
text2 = ignoreDiacritics ? stripDiacritics(text2) : text2;
|
|
428198
|
+
if (this.pattern === text2) {
|
|
427466
428199
|
const result2 = {
|
|
427467
428200
|
isMatch: true,
|
|
427468
428201
|
score: 0
|
|
427469
428202
|
};
|
|
427470
428203
|
if (includeMatches)
|
|
427471
|
-
result2.indices = [[0,
|
|
428204
|
+
result2.indices = [[0, text2.length - 1]];
|
|
427472
428205
|
return result2;
|
|
427473
428206
|
}
|
|
427474
428207
|
const { location, distance, threshold, findAllMatches, minMatchCharLength, ignoreLocation } = this.options;
|
|
@@ -427476,7 +428209,7 @@ var INCORRECT_INDEX_TYPE = "Incorrect 'index' type", INVALID_DOC_INDEX = "Invali
|
|
|
427476
428209
|
let totalScore = 0;
|
|
427477
428210
|
let hasMatches = false;
|
|
427478
428211
|
this.chunks.forEach(({ pattern, alphabet, startIndex }) => {
|
|
427479
|
-
const { isMatch, score, indices } = search(
|
|
428212
|
+
const { isMatch, score, indices } = search(text2, pattern, alphabet, {
|
|
427480
428213
|
location: location + startIndex,
|
|
427481
428214
|
distance,
|
|
427482
428215
|
threshold,
|
|
@@ -427521,7 +428254,7 @@ var INCORRECT_INDEX_TYPE = "Incorrect 'index' type", INVALID_DOC_INDEX = "Invali
|
|
|
427521
428254
|
static condition(_, options2) {
|
|
427522
428255
|
return options2.useExtendedSearch;
|
|
427523
428256
|
}
|
|
427524
|
-
searchIn(
|
|
428257
|
+
searchIn(text2) {
|
|
427525
428258
|
const query2 = this.query;
|
|
427526
428259
|
if (!query2)
|
|
427527
428260
|
return {
|
|
@@ -427529,8 +428262,8 @@ var INCORRECT_INDEX_TYPE = "Incorrect 'index' type", INVALID_DOC_INDEX = "Invali
|
|
|
427529
428262
|
score: 1
|
|
427530
428263
|
};
|
|
427531
428264
|
const { includeMatches, isCaseSensitive, ignoreDiacritics } = this.options;
|
|
427532
|
-
|
|
427533
|
-
|
|
428265
|
+
text2 = isCaseSensitive ? text2 : text2.toLowerCase();
|
|
428266
|
+
text2 = ignoreDiacritics ? stripDiacritics(text2) : text2;
|
|
427534
428267
|
let numMatches = 0;
|
|
427535
428268
|
const allIndices = [];
|
|
427536
428269
|
let totalScore = 0;
|
|
@@ -427542,7 +428275,7 @@ var INCORRECT_INDEX_TYPE = "Incorrect 'index' type", INVALID_DOC_INDEX = "Invali
|
|
|
427542
428275
|
hasInverse = false;
|
|
427543
428276
|
for (let j2 = 0, pLen = searchers.length;j2 < pLen; j2 += 1) {
|
|
427544
428277
|
const matcher = searchers[j2];
|
|
427545
|
-
const { isMatch, indices, score } = matcher.search(
|
|
428278
|
+
const { isMatch, indices, score } = matcher.search(text2);
|
|
427546
428279
|
if (isMatch) {
|
|
427547
428280
|
numMatches += 1;
|
|
427548
428281
|
totalScore += score;
|
|
@@ -427667,7 +428400,7 @@ var INCORRECT_INDEX_TYPE = "Incorrect 'index' type", INVALID_DOC_INDEX = "Invali
|
|
|
427667
428400
|
this.numTerms = this.termSearchers.length;
|
|
427668
428401
|
this.useMask = this.numTerms <= 31;
|
|
427669
428402
|
}
|
|
427670
|
-
searchIn(
|
|
428403
|
+
searchIn(text2) {
|
|
427671
428404
|
if (!this.termSearchers.length)
|
|
427672
428405
|
return {
|
|
427673
428406
|
isMatch: false,
|
|
@@ -427680,7 +428413,7 @@ var INCORRECT_INDEX_TYPE = "Incorrect 'index' type", INVALID_DOC_INDEX = "Invali
|
|
|
427680
428413
|
let matchedMask = 0;
|
|
427681
428414
|
const matchedTerms = this.combineAll && !this.useMask ? /* @__PURE__ */ new Set : null;
|
|
427682
428415
|
for (let i3 = 0;i3 < this.termSearchers.length; i3++) {
|
|
427683
|
-
const result = this.termSearchers[i3].searchIn(
|
|
428416
|
+
const result = this.termSearchers[i3].searchIn(text2);
|
|
427684
428417
|
const idf = this.idfWeights[i3];
|
|
427685
428418
|
maxPossibleScore += idf;
|
|
427686
428419
|
if (result.isMatch) {
|
|
@@ -427858,14 +428591,14 @@ var INCORRECT_INDEX_TYPE = "Incorrect 'index' type", INVALID_DOC_INDEX = "Invali
|
|
|
427858
428591
|
const requireAllTokens = this.options.useTokenSearch && this.options.tokenMatch === "all";
|
|
427859
428592
|
const { records } = this._myIndex;
|
|
427860
428593
|
const results = heap ? null : [];
|
|
427861
|
-
records.forEach(({ v:
|
|
427862
|
-
if (!isDefined2(
|
|
428594
|
+
records.forEach(({ v: text2, i: idx, n: norm2 }) => {
|
|
428595
|
+
if (!isDefined2(text2))
|
|
427863
428596
|
return;
|
|
427864
|
-
const searchResult = searcher.searchIn(
|
|
428597
|
+
const searchResult = searcher.searchIn(text2);
|
|
427865
428598
|
if (searchResult.isMatch) {
|
|
427866
428599
|
const match = {
|
|
427867
428600
|
score: searchResult.score,
|
|
427868
|
-
value:
|
|
428601
|
+
value: text2,
|
|
427869
428602
|
norm: norm2,
|
|
427870
428603
|
indices: searchResult.indices
|
|
427871
428604
|
};
|
|
@@ -427877,7 +428610,7 @@ var INCORRECT_INDEX_TYPE = "Incorrect 'index' type", INVALID_DOC_INDEX = "Invali
|
|
|
427877
428610
|
const matches = [match];
|
|
427878
428611
|
if (!requireAllTokens || this._coversAllTokens(matches)) {
|
|
427879
428612
|
const result = {
|
|
427880
|
-
item:
|
|
428613
|
+
item: text2,
|
|
427881
428614
|
idx,
|
|
427882
428615
|
matches
|
|
427883
428616
|
};
|
|
@@ -428003,15 +428736,15 @@ var INCORRECT_INDEX_TYPE = "Incorrect 'index' type", INVALID_DOC_INDEX = "Invali
|
|
|
428003
428736
|
return [];
|
|
428004
428737
|
const matches = [];
|
|
428005
428738
|
if (isArray3(value))
|
|
428006
|
-
value.forEach(({ v:
|
|
428007
|
-
if (!isDefined2(
|
|
428739
|
+
value.forEach(({ v: text2, i: idx, n: norm2 }) => {
|
|
428740
|
+
if (!isDefined2(text2))
|
|
428008
428741
|
return;
|
|
428009
|
-
const searchResult = searcher.searchIn(
|
|
428742
|
+
const searchResult = searcher.searchIn(text2);
|
|
428010
428743
|
if (searchResult.isMatch) {
|
|
428011
428744
|
const match = {
|
|
428012
428745
|
score: searchResult.score,
|
|
428013
428746
|
key,
|
|
428014
|
-
value:
|
|
428747
|
+
value: text2,
|
|
428015
428748
|
idx,
|
|
428016
428749
|
norm: norm2,
|
|
428017
428750
|
indices: searchResult.indices,
|
|
@@ -428026,13 +428759,13 @@ var INCORRECT_INDEX_TYPE = "Incorrect 'index' type", INVALID_DOC_INDEX = "Invali
|
|
|
428026
428759
|
}
|
|
428027
428760
|
});
|
|
428028
428761
|
else {
|
|
428029
|
-
const { v:
|
|
428030
|
-
const searchResult = searcher.searchIn(
|
|
428762
|
+
const { v: text2, n: norm2 } = value;
|
|
428763
|
+
const searchResult = searcher.searchIn(text2);
|
|
428031
428764
|
if (searchResult.isMatch) {
|
|
428032
428765
|
const match = {
|
|
428033
428766
|
score: searchResult.score,
|
|
428034
428767
|
key,
|
|
428035
|
-
value:
|
|
428768
|
+
value: text2,
|
|
428036
428769
|
norm: norm2,
|
|
428037
428770
|
indices: searchResult.indices,
|
|
428038
428771
|
hasInverse: searchResult.hasInverse
|
|
@@ -428127,8 +428860,8 @@ var init_fuse = __esm(() => {
|
|
|
428127
428860
|
singleRegex: /^=(.*)$/,
|
|
428128
428861
|
create: (pattern) => ({
|
|
428129
428862
|
type: "exact",
|
|
428130
|
-
search(
|
|
428131
|
-
const isMatch =
|
|
428863
|
+
search(text2) {
|
|
428864
|
+
const isMatch = text2 === pattern;
|
|
428132
428865
|
return {
|
|
428133
428866
|
isMatch,
|
|
428134
428867
|
score: isMatch ? 0 : 1,
|
|
@@ -428143,12 +428876,12 @@ var init_fuse = __esm(() => {
|
|
|
428143
428876
|
singleRegex: /^'(.*)$/,
|
|
428144
428877
|
create: (pattern) => ({
|
|
428145
428878
|
type: "include",
|
|
428146
|
-
search(
|
|
428879
|
+
search(text2) {
|
|
428147
428880
|
let location = 0;
|
|
428148
428881
|
let index;
|
|
428149
428882
|
const indices = [];
|
|
428150
428883
|
const patternLen = pattern.length;
|
|
428151
|
-
while ((index =
|
|
428884
|
+
while ((index = text2.indexOf(pattern, location)) > -1) {
|
|
428152
428885
|
location = index + patternLen;
|
|
428153
428886
|
indices.push([index, location - 1]);
|
|
428154
428887
|
}
|
|
@@ -428167,8 +428900,8 @@ var init_fuse = __esm(() => {
|
|
|
428167
428900
|
singleRegex: /^\^(.*)$/,
|
|
428168
428901
|
create: (pattern) => ({
|
|
428169
428902
|
type: "prefix-exact",
|
|
428170
|
-
search(
|
|
428171
|
-
const isMatch =
|
|
428903
|
+
search(text2) {
|
|
428904
|
+
const isMatch = text2.startsWith(pattern);
|
|
428172
428905
|
return {
|
|
428173
428906
|
isMatch,
|
|
428174
428907
|
score: isMatch ? 0 : 1,
|
|
@@ -428183,12 +428916,12 @@ var init_fuse = __esm(() => {
|
|
|
428183
428916
|
singleRegex: /^!\^(.*)$/,
|
|
428184
428917
|
create: (pattern) => ({
|
|
428185
428918
|
type: "inverse-prefix-exact",
|
|
428186
|
-
search(
|
|
428187
|
-
const isMatch = !
|
|
428919
|
+
search(text2) {
|
|
428920
|
+
const isMatch = !text2.startsWith(pattern);
|
|
428188
428921
|
return {
|
|
428189
428922
|
isMatch,
|
|
428190
428923
|
score: isMatch ? 0 : 1,
|
|
428191
|
-
indices: [0,
|
|
428924
|
+
indices: [0, text2.length - 1]
|
|
428192
428925
|
};
|
|
428193
428926
|
}
|
|
428194
428927
|
})
|
|
@@ -428199,12 +428932,12 @@ var init_fuse = __esm(() => {
|
|
|
428199
428932
|
singleRegex: /^!(.*)\$$/,
|
|
428200
428933
|
create: (pattern) => ({
|
|
428201
428934
|
type: "inverse-suffix-exact",
|
|
428202
|
-
search(
|
|
428203
|
-
const isMatch = !
|
|
428935
|
+
search(text2) {
|
|
428936
|
+
const isMatch = !text2.endsWith(pattern);
|
|
428204
428937
|
return {
|
|
428205
428938
|
isMatch,
|
|
428206
428939
|
score: isMatch ? 0 : 1,
|
|
428207
|
-
indices: [0,
|
|
428940
|
+
indices: [0, text2.length - 1]
|
|
428208
428941
|
};
|
|
428209
428942
|
}
|
|
428210
428943
|
})
|
|
@@ -428215,12 +428948,12 @@ var init_fuse = __esm(() => {
|
|
|
428215
428948
|
singleRegex: /^(.*)\$$/,
|
|
428216
428949
|
create: (pattern) => ({
|
|
428217
428950
|
type: "suffix-exact",
|
|
428218
|
-
search(
|
|
428219
|
-
const isMatch =
|
|
428951
|
+
search(text2) {
|
|
428952
|
+
const isMatch = text2.endsWith(pattern);
|
|
428220
428953
|
return {
|
|
428221
428954
|
isMatch,
|
|
428222
428955
|
score: isMatch ? 0 : 1,
|
|
428223
|
-
indices: [
|
|
428956
|
+
indices: [text2.length - pattern.length, text2.length - 1]
|
|
428224
428957
|
};
|
|
428225
428958
|
}
|
|
428226
428959
|
})
|
|
@@ -428231,12 +428964,12 @@ var init_fuse = __esm(() => {
|
|
|
428231
428964
|
singleRegex: /^!(.*)$/,
|
|
428232
428965
|
create: (pattern) => ({
|
|
428233
428966
|
type: "inverse-exact",
|
|
428234
|
-
search(
|
|
428235
|
-
const isMatch =
|
|
428967
|
+
search(text2) {
|
|
428968
|
+
const isMatch = text2.indexOf(pattern) === -1;
|
|
428236
428969
|
return {
|
|
428237
428970
|
isMatch,
|
|
428238
428971
|
score: isMatch ? 0 : 1,
|
|
428239
|
-
indices: [0,
|
|
428972
|
+
indices: [0, text2.length - 1]
|
|
428240
428973
|
};
|
|
428241
428974
|
}
|
|
428242
428975
|
})
|
|
@@ -428259,8 +428992,8 @@ var init_fuse = __esm(() => {
|
|
|
428259
428992
|
});
|
|
428260
428993
|
return {
|
|
428261
428994
|
type: "fuzzy",
|
|
428262
|
-
search(
|
|
428263
|
-
return bitap.searchIn(
|
|
428995
|
+
search(text2) {
|
|
428996
|
+
return bitap.searchIn(text2);
|
|
428264
428997
|
}
|
|
428265
428998
|
};
|
|
428266
428999
|
}
|
|
@@ -428282,13 +429015,13 @@ var init_fuse = __esm(() => {
|
|
|
428282
429015
|
Fuse.createIndex = createIndex;
|
|
428283
429016
|
Fuse.parseIndex = parseIndex;
|
|
428284
429017
|
Fuse.config = Config2;
|
|
428285
|
-
Fuse.match = function(pattern,
|
|
429018
|
+
Fuse.match = function(pattern, text2, options2) {
|
|
428286
429019
|
if (options2 && options2.useTokenSearch)
|
|
428287
429020
|
throw new Error(FUSE_MATCH_TOKEN_SEARCH_UNSUPPORTED);
|
|
428288
429021
|
return createSearcher(pattern, {
|
|
428289
429022
|
...Config2,
|
|
428290
429023
|
...options2
|
|
428291
|
-
}).searchIn(
|
|
429024
|
+
}).searchIn(text2);
|
|
428292
429025
|
};
|
|
428293
429026
|
Fuse.parseQuery = parse13;
|
|
428294
429027
|
register(ExtendedSearch);
|
|
@@ -428580,11 +429313,11 @@ function applyCommandSuggestion(suggestion, shouldExecute, commands, onInputChan
|
|
|
428580
429313
|
function cleanWord(word) {
|
|
428581
429314
|
return word.toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
428582
429315
|
}
|
|
428583
|
-
function findSlashCommandPositions(
|
|
429316
|
+
function findSlashCommandPositions(text2) {
|
|
428584
429317
|
const positions = [];
|
|
428585
429318
|
const regex2 = /(^|[\s])(\/[a-zA-Z][a-zA-Z0-9:\-_]*)/g;
|
|
428586
429319
|
let match = null;
|
|
428587
|
-
while ((match = regex2.exec(
|
|
429320
|
+
while ((match = regex2.exec(text2)) !== null) {
|
|
428588
429321
|
const precedingChar = match[1] ?? "";
|
|
428589
429322
|
const commandName = match[2] ?? "";
|
|
428590
429323
|
const start = match.index + precedingChar.length;
|
|
@@ -428692,21 +429425,21 @@ async function fetchChannels(clients, query2) {
|
|
|
428692
429425
|
return [];
|
|
428693
429426
|
}
|
|
428694
429427
|
}
|
|
428695
|
-
function unwrapResults(
|
|
428696
|
-
const trimmed =
|
|
429428
|
+
function unwrapResults(text2) {
|
|
429429
|
+
const trimmed = text2.trim();
|
|
428697
429430
|
if (!trimmed.startsWith("{"))
|
|
428698
|
-
return
|
|
429431
|
+
return text2;
|
|
428699
429432
|
try {
|
|
428700
429433
|
const parsed = resultsEnvelopeSchema().safeParse(jsonParse(trimmed));
|
|
428701
429434
|
if (parsed.success)
|
|
428702
429435
|
return parsed.data.results;
|
|
428703
429436
|
} catch {}
|
|
428704
|
-
return
|
|
429437
|
+
return text2;
|
|
428705
429438
|
}
|
|
428706
|
-
function parseChannels(
|
|
429439
|
+
function parseChannels(text2) {
|
|
428707
429440
|
const channels = [];
|
|
428708
429441
|
const seen = new Set;
|
|
428709
|
-
for (const line of
|
|
429442
|
+
for (const line of text2.split(`
|
|
428710
429443
|
`)) {
|
|
428711
429444
|
const m = line.match(/^Name:\s*#?([a-z0-9][a-z0-9_-]{0,79})\s*$/);
|
|
428712
429445
|
if (m && !seen.has(m[1])) {
|
|
@@ -428722,11 +429455,11 @@ function hasSlackMcpServer(clients) {
|
|
|
428722
429455
|
function getKnownChannelsVersion() {
|
|
428723
429456
|
return knownChannelsVersion;
|
|
428724
429457
|
}
|
|
428725
|
-
function findSlackChannelPositions(
|
|
429458
|
+
function findSlackChannelPositions(text2) {
|
|
428726
429459
|
const positions = [];
|
|
428727
429460
|
const re = /(^|\s)#([a-z0-9][a-z0-9_-]{0,79})(?=\s|$)/g;
|
|
428728
429461
|
let m;
|
|
428729
|
-
while ((m = re.exec(
|
|
429462
|
+
while ((m = re.exec(text2)) !== null) {
|
|
428730
429463
|
if (!knownChannels.has(m[2]))
|
|
428731
429464
|
continue;
|
|
428732
429465
|
const start = m.index + m[1].length;
|
|
@@ -429013,15 +429746,15 @@ function applyDirectorySuggestion(input, suggestionId, tokenStartPos, tokenLengt
|
|
|
429013
429746
|
cursorPos: before.length + replacement.length
|
|
429014
429747
|
};
|
|
429015
429748
|
}
|
|
429016
|
-
function extractCompletionToken(
|
|
429017
|
-
if (!
|
|
429749
|
+
function extractCompletionToken(text2, cursorPos, includeAtSymbol = false) {
|
|
429750
|
+
if (!text2)
|
|
429018
429751
|
return null;
|
|
429019
|
-
const textBeforeCursor =
|
|
429752
|
+
const textBeforeCursor = text2.substring(0, cursorPos);
|
|
429020
429753
|
if (includeAtSymbol) {
|
|
429021
429754
|
const quotedAtRegex = /@"([^"]*)"?$/;
|
|
429022
429755
|
const quotedMatch = textBeforeCursor.match(quotedAtRegex);
|
|
429023
429756
|
if (quotedMatch && quotedMatch.index !== undefined) {
|
|
429024
|
-
const textAfterCursor2 =
|
|
429757
|
+
const textAfterCursor2 = text2.substring(cursorPos);
|
|
429025
429758
|
const afterQuotedMatch = textAfterCursor2.match(/^[^"]*"?/);
|
|
429026
429759
|
const quotedSuffix = afterQuotedMatch ? afterQuotedMatch[0] : "";
|
|
429027
429760
|
return {
|
|
@@ -429037,7 +429770,7 @@ function extractCompletionToken(text, cursorPos, includeAtSymbol = false) {
|
|
|
429037
429770
|
const fromAt = textBeforeCursor.substring(atIdx);
|
|
429038
429771
|
const atHeadMatch = fromAt.match(AT_TOKEN_HEAD_RE);
|
|
429039
429772
|
if (atHeadMatch && atHeadMatch[0].length === fromAt.length) {
|
|
429040
|
-
const textAfterCursor2 =
|
|
429773
|
+
const textAfterCursor2 = text2.substring(cursorPos);
|
|
429041
429774
|
const afterMatch2 = textAfterCursor2.match(PATH_CHAR_HEAD_RE);
|
|
429042
429775
|
const tokenSuffix2 = afterMatch2 ? afterMatch2[0] : "";
|
|
429043
429776
|
return {
|
|
@@ -429053,7 +429786,7 @@ function extractCompletionToken(text, cursorPos, includeAtSymbol = false) {
|
|
|
429053
429786
|
if (!match || match.index === undefined) {
|
|
429054
429787
|
return null;
|
|
429055
429788
|
}
|
|
429056
|
-
const textAfterCursor =
|
|
429789
|
+
const textAfterCursor = text2.substring(cursorPos);
|
|
429057
429790
|
const afterMatch = textAfterCursor.match(PATH_CHAR_HEAD_RE);
|
|
429058
429791
|
const tokenSuffix = afterMatch ? afterMatch[0] : "";
|
|
429059
429792
|
return {
|
|
@@ -429785,16 +430518,16 @@ function useTypeahead({
|
|
|
429785
430518
|
context: "Autocomplete",
|
|
429786
430519
|
isActive: isAutocompleteActive && !isModalOverlayActive
|
|
429787
430520
|
});
|
|
429788
|
-
function acceptSuggestionText(
|
|
429789
|
-
const detectedMode = getModeFromInput(
|
|
430521
|
+
function acceptSuggestionText(text2) {
|
|
430522
|
+
const detectedMode = getModeFromInput(text2);
|
|
429790
430523
|
if (detectedMode !== "prompt" && onModeChange) {
|
|
429791
430524
|
onModeChange(detectedMode);
|
|
429792
|
-
const stripped = getValueFromInput(
|
|
430525
|
+
const stripped = getValueFromInput(text2);
|
|
429793
430526
|
onInputChange(stripped);
|
|
429794
430527
|
setCursorOffset(stripped.length);
|
|
429795
430528
|
} else {
|
|
429796
|
-
onInputChange(
|
|
429797
|
-
setCursorOffset(
|
|
430529
|
+
onInputChange(text2);
|
|
430530
|
+
setCursorOffset(text2.length);
|
|
429798
430531
|
}
|
|
429799
430532
|
}
|
|
429800
430533
|
const handleKeyDown = (e) => {
|
|
@@ -430002,18 +430735,18 @@ var init_getNextPermissionMode = __esm(() => {
|
|
|
430002
430735
|
});
|
|
430003
430736
|
|
|
430004
430737
|
// utils/ultraplan/keyword.ts
|
|
430005
|
-
function findKeywordTriggerPositions(
|
|
430738
|
+
function findKeywordTriggerPositions(text2, keyword) {
|
|
430006
430739
|
const re = new RegExp(keyword, "i");
|
|
430007
|
-
if (!re.test(
|
|
430740
|
+
if (!re.test(text2))
|
|
430008
430741
|
return [];
|
|
430009
|
-
if (
|
|
430742
|
+
if (text2.startsWith("/"))
|
|
430010
430743
|
return [];
|
|
430011
430744
|
const quotedRanges = [];
|
|
430012
430745
|
let openQuote = null;
|
|
430013
430746
|
let openAt = 0;
|
|
430014
430747
|
const isWord = (ch2) => !!ch2 && /[\p{L}\p{N}_]/u.test(ch2);
|
|
430015
|
-
for (let i3 = 0;i3 <
|
|
430016
|
-
const ch2 =
|
|
430748
|
+
for (let i3 = 0;i3 < text2.length; i3++) {
|
|
430749
|
+
const ch2 = text2[i3];
|
|
430017
430750
|
if (openQuote) {
|
|
430018
430751
|
if (openQuote === "[" && ch2 === "[") {
|
|
430019
430752
|
openAt = i3;
|
|
@@ -430021,18 +430754,18 @@ function findKeywordTriggerPositions(text, keyword) {
|
|
|
430021
430754
|
}
|
|
430022
430755
|
if (ch2 !== OPEN_TO_CLOSE[openQuote])
|
|
430023
430756
|
continue;
|
|
430024
|
-
if (openQuote === "'" && isWord(
|
|
430757
|
+
if (openQuote === "'" && isWord(text2[i3 + 1]))
|
|
430025
430758
|
continue;
|
|
430026
430759
|
quotedRanges.push({ start: openAt, end: i3 + 1 });
|
|
430027
430760
|
openQuote = null;
|
|
430028
|
-
} else if (ch2 === "<" && i3 + 1 <
|
|
430761
|
+
} else if (ch2 === "<" && i3 + 1 < text2.length && /[a-zA-Z/]/.test(text2[i3 + 1]) || ch2 === "'" && !isWord(text2[i3 - 1]) || ch2 !== "<" && ch2 !== "'" && ch2 in OPEN_TO_CLOSE) {
|
|
430029
430762
|
openQuote = ch2;
|
|
430030
430763
|
openAt = i3;
|
|
430031
430764
|
}
|
|
430032
430765
|
}
|
|
430033
430766
|
const positions = [];
|
|
430034
430767
|
const wordRe = new RegExp(`\\b${keyword}\\b`, "gi");
|
|
430035
|
-
const matches =
|
|
430768
|
+
const matches = text2.matchAll(wordRe);
|
|
430036
430769
|
for (const match of matches) {
|
|
430037
430770
|
if (match.index === undefined)
|
|
430038
430771
|
continue;
|
|
@@ -430040,20 +430773,20 @@ function findKeywordTriggerPositions(text, keyword) {
|
|
|
430040
430773
|
const end = start + match[0].length;
|
|
430041
430774
|
if (quotedRanges.some((r) => start >= r.start && start < r.end))
|
|
430042
430775
|
continue;
|
|
430043
|
-
const before =
|
|
430044
|
-
const after =
|
|
430776
|
+
const before = text2[start - 1];
|
|
430777
|
+
const after = text2[end];
|
|
430045
430778
|
if (before === "/" || before === "\\" || before === "-")
|
|
430046
430779
|
continue;
|
|
430047
430780
|
if (after === "/" || after === "\\" || after === "-" || after === "?")
|
|
430048
430781
|
continue;
|
|
430049
|
-
if (after === "." && isWord(
|
|
430782
|
+
if (after === "." && isWord(text2[end + 1]))
|
|
430050
430783
|
continue;
|
|
430051
430784
|
positions.push({ word: match[0], start, end });
|
|
430052
430785
|
}
|
|
430053
430786
|
return positions;
|
|
430054
430787
|
}
|
|
430055
|
-
function findUltrareviewTriggerPositions(
|
|
430056
|
-
return findKeywordTriggerPositions(
|
|
430788
|
+
function findUltrareviewTriggerPositions(text2) {
|
|
430789
|
+
return findKeywordTriggerPositions(text2, "ultrareview");
|
|
430057
430790
|
}
|
|
430058
430791
|
var OPEN_TO_CLOSE;
|
|
430059
430792
|
var init_keyword = __esm(() => {
|
|
@@ -431726,34 +432459,34 @@ function isLinewiseMotion(key) {
|
|
|
431726
432459
|
}
|
|
431727
432460
|
|
|
431728
432461
|
// vim/textObjects.ts
|
|
431729
|
-
function findTextObject(
|
|
432462
|
+
function findTextObject(text2, offset, objectType2, isInner) {
|
|
431730
432463
|
if (objectType2 === "w")
|
|
431731
|
-
return findWordObject(
|
|
432464
|
+
return findWordObject(text2, offset, isInner, isVimWordChar);
|
|
431732
432465
|
if (objectType2 === "W")
|
|
431733
|
-
return findWordObject(
|
|
432466
|
+
return findWordObject(text2, offset, isInner, (ch2) => !isVimWhitespace(ch2));
|
|
431734
432467
|
const pair = PAIRS[objectType2];
|
|
431735
432468
|
if (pair) {
|
|
431736
432469
|
const [open17, close] = pair;
|
|
431737
|
-
return open17 === close ? findQuoteObject(
|
|
432470
|
+
return open17 === close ? findQuoteObject(text2, offset, open17, isInner) : findBracketObject(text2, offset, open17, close, isInner);
|
|
431738
432471
|
}
|
|
431739
432472
|
return null;
|
|
431740
432473
|
}
|
|
431741
|
-
function findWordObject(
|
|
432474
|
+
function findWordObject(text2, offset, isInner, isWordChar) {
|
|
431742
432475
|
const graphemes = [];
|
|
431743
|
-
for (const { segment, index } of getGraphemeSegmenter().segment(
|
|
432476
|
+
for (const { segment, index } of getGraphemeSegmenter().segment(text2)) {
|
|
431744
432477
|
graphemes.push({ segment, index });
|
|
431745
432478
|
}
|
|
431746
432479
|
let graphemeIdx = graphemes.length - 1;
|
|
431747
432480
|
for (let i3 = 0;i3 < graphemes.length; i3++) {
|
|
431748
432481
|
const g = graphemes[i3];
|
|
431749
|
-
const nextStart = i3 + 1 < graphemes.length ? graphemes[i3 + 1].index :
|
|
432482
|
+
const nextStart = i3 + 1 < graphemes.length ? graphemes[i3 + 1].index : text2.length;
|
|
431750
432483
|
if (offset >= g.index && offset < nextStart) {
|
|
431751
432484
|
graphemeIdx = i3;
|
|
431752
432485
|
break;
|
|
431753
432486
|
}
|
|
431754
432487
|
}
|
|
431755
432488
|
const graphemeAt = (idx) => graphemes[idx]?.segment ?? "";
|
|
431756
|
-
const offsetAt = (idx) => idx < graphemes.length ? graphemes[idx].index :
|
|
432489
|
+
const offsetAt = (idx) => idx < graphemes.length ? graphemes[idx].index : text2.length;
|
|
431757
432490
|
const isWs = (idx) => isVimWhitespace(graphemeAt(idx));
|
|
431758
432491
|
const isWord = (idx) => isWordChar(graphemeAt(idx));
|
|
431759
432492
|
const isPunct = (idx) => isVimPunctuation(graphemeAt(idx));
|
|
@@ -431787,13 +432520,13 @@ function findWordObject(text, offset, isInner, isWordChar) {
|
|
|
431787
432520
|
}
|
|
431788
432521
|
return { start: offsetAt(startIdx), end: offsetAt(endIdx) };
|
|
431789
432522
|
}
|
|
431790
|
-
function findQuoteObject(
|
|
431791
|
-
const lineStart =
|
|
432523
|
+
function findQuoteObject(text2, offset, quote2, isInner) {
|
|
432524
|
+
const lineStart = text2.lastIndexOf(`
|
|
431792
432525
|
`, offset - 1) + 1;
|
|
431793
|
-
const lineEnd =
|
|
432526
|
+
const lineEnd = text2.indexOf(`
|
|
431794
432527
|
`, offset);
|
|
431795
|
-
const effectiveEnd = lineEnd === -1 ?
|
|
431796
|
-
const line =
|
|
432528
|
+
const effectiveEnd = lineEnd === -1 ? text2.length : lineEnd;
|
|
432529
|
+
const line = text2.slice(lineStart, effectiveEnd);
|
|
431797
432530
|
const posInLine = offset - lineStart;
|
|
431798
432531
|
const positions = [];
|
|
431799
432532
|
for (let i3 = 0;i3 < line.length; i3++) {
|
|
@@ -431809,13 +432542,13 @@ function findQuoteObject(text, offset, quote2, isInner) {
|
|
|
431809
432542
|
}
|
|
431810
432543
|
return null;
|
|
431811
432544
|
}
|
|
431812
|
-
function findBracketObject(
|
|
432545
|
+
function findBracketObject(text2, offset, open17, close, isInner) {
|
|
431813
432546
|
let depth = 0;
|
|
431814
432547
|
let start = -1;
|
|
431815
432548
|
for (let i3 = offset;i3 >= 0; i3--) {
|
|
431816
|
-
if (
|
|
432549
|
+
if (text2[i3] === close && i3 !== offset)
|
|
431817
432550
|
depth++;
|
|
431818
|
-
else if (
|
|
432551
|
+
else if (text2[i3] === open17) {
|
|
431819
432552
|
if (depth === 0) {
|
|
431820
432553
|
start = i3;
|
|
431821
432554
|
break;
|
|
@@ -431827,10 +432560,10 @@ function findBracketObject(text, offset, open17, close, isInner) {
|
|
|
431827
432560
|
return null;
|
|
431828
432561
|
depth = 0;
|
|
431829
432562
|
let end = -1;
|
|
431830
|
-
for (let i3 = start + 1;i3 <
|
|
431831
|
-
if (
|
|
432563
|
+
for (let i3 = start + 1;i3 < text2.length; i3++) {
|
|
432564
|
+
if (text2[i3] === open17)
|
|
431832
432565
|
depth++;
|
|
431833
|
-
else if (
|
|
432566
|
+
else if (text2[i3] === close) {
|
|
431834
432567
|
if (depth === 0) {
|
|
431835
432568
|
end = i3;
|
|
431836
432569
|
break;
|
|
@@ -431890,20 +432623,20 @@ function executeOperatorTextObj(op, scope, objType, count4, ctx) {
|
|
|
431890
432623
|
ctx.recordChange({ type: "operatorTextObj", op, objType, scope, count: count4 });
|
|
431891
432624
|
}
|
|
431892
432625
|
function executeLineOp(op, count4, ctx) {
|
|
431893
|
-
const
|
|
431894
|
-
const lines =
|
|
432626
|
+
const text2 = ctx.text;
|
|
432627
|
+
const lines = text2.split(`
|
|
431895
432628
|
`);
|
|
431896
|
-
const currentLine = countCharInString(
|
|
432629
|
+
const currentLine = countCharInString(text2.slice(0, ctx.cursor.offset), `
|
|
431897
432630
|
`);
|
|
431898
432631
|
const linesToAffect = Math.min(count4, lines.length - currentLine);
|
|
431899
432632
|
const lineStart = ctx.cursor.startOfLogicalLine().offset;
|
|
431900
432633
|
let lineEnd = lineStart;
|
|
431901
432634
|
for (let i3 = 0;i3 < linesToAffect; i3++) {
|
|
431902
|
-
const nextNewline =
|
|
432635
|
+
const nextNewline = text2.indexOf(`
|
|
431903
432636
|
`, lineEnd);
|
|
431904
|
-
lineEnd = nextNewline === -1 ?
|
|
432637
|
+
lineEnd = nextNewline === -1 ? text2.length : nextNewline + 1;
|
|
431905
432638
|
}
|
|
431906
|
-
let content =
|
|
432639
|
+
let content = text2.slice(lineStart, lineEnd);
|
|
431907
432640
|
if (!content.endsWith(`
|
|
431908
432641
|
`)) {
|
|
431909
432642
|
content = content + `
|
|
@@ -431915,11 +432648,11 @@ function executeLineOp(op, count4, ctx) {
|
|
|
431915
432648
|
} else if (op === "delete") {
|
|
431916
432649
|
let deleteStart = lineStart;
|
|
431917
432650
|
const deleteEnd = lineEnd;
|
|
431918
|
-
if (deleteEnd ===
|
|
432651
|
+
if (deleteEnd === text2.length && deleteStart > 0 && text2[deleteStart - 1] === `
|
|
431919
432652
|
`) {
|
|
431920
432653
|
deleteStart -= 1;
|
|
431921
432654
|
}
|
|
431922
|
-
const newText =
|
|
432655
|
+
const newText = text2.slice(0, deleteStart) + text2.slice(deleteEnd);
|
|
431923
432656
|
ctx.setText(newText || "");
|
|
431924
432657
|
const maxOff = Math.max(0, newText.length - (lastGrapheme(newText).length || 1));
|
|
431925
432658
|
ctx.setOffset(Math.min(deleteStart, maxOff));
|
|
@@ -431987,8 +432720,8 @@ function executeToggleCase(count4, ctx) {
|
|
|
431987
432720
|
ctx.recordChange({ type: "toggleCase", count: count4 });
|
|
431988
432721
|
}
|
|
431989
432722
|
function executeJoin(count4, ctx) {
|
|
431990
|
-
const
|
|
431991
|
-
const lines =
|
|
432723
|
+
const text2 = ctx.text;
|
|
432724
|
+
const lines = text2.split(`
|
|
431992
432725
|
`);
|
|
431993
432726
|
const { line: currentLine } = ctx.cursor.getPosition();
|
|
431994
432727
|
if (currentLine >= lines.length - 1)
|
|
@@ -432024,8 +432757,8 @@ function executePaste(after, count4, ctx) {
|
|
|
432024
432757
|
`);
|
|
432025
432758
|
const content = isLinewise ? register2.slice(0, -1) : register2;
|
|
432026
432759
|
if (isLinewise) {
|
|
432027
|
-
const
|
|
432028
|
-
const lines =
|
|
432760
|
+
const text2 = ctx.text;
|
|
432761
|
+
const lines = text2.split(`
|
|
432029
432762
|
`);
|
|
432030
432763
|
const { line: currentLine } = ctx.cursor.getPosition();
|
|
432031
432764
|
const insertLine = after ? currentLine + 1 : currentLine;
|
|
@@ -432055,8 +432788,8 @@ function executePaste(after, count4, ctx) {
|
|
|
432055
432788
|
}
|
|
432056
432789
|
}
|
|
432057
432790
|
function executeIndent(dir, count4, ctx) {
|
|
432058
|
-
const
|
|
432059
|
-
const lines =
|
|
432791
|
+
const text2 = ctx.text;
|
|
432792
|
+
const lines = text2.split(`
|
|
432060
432793
|
`);
|
|
432061
432794
|
const { line: currentLine } = ctx.cursor.getPosition();
|
|
432062
432795
|
const linesToAffect = Math.min(count4, lines.length - currentLine);
|
|
@@ -432089,8 +432822,8 @@ function executeIndent(dir, count4, ctx) {
|
|
|
432089
432822
|
ctx.recordChange({ type: "indent", dir, count: count4 });
|
|
432090
432823
|
}
|
|
432091
432824
|
function executeOpenLine(direction, ctx) {
|
|
432092
|
-
const
|
|
432093
|
-
const lines =
|
|
432825
|
+
const text2 = ctx.text;
|
|
432826
|
+
const lines = text2.split(`
|
|
432094
432827
|
`);
|
|
432095
432828
|
const { line: currentLine } = ctx.cursor.getPosition();
|
|
432096
432829
|
const insertLine = direction === "below" ? currentLine + 1 : currentLine;
|
|
@@ -432122,12 +432855,12 @@ function getOperatorRange(cursor, target, motion, op, count4) {
|
|
|
432122
432855
|
to = cursor.measuredText.nextOffset(wordEnd.offset);
|
|
432123
432856
|
} else if (isLinewiseMotion(motion)) {
|
|
432124
432857
|
linewise = true;
|
|
432125
|
-
const
|
|
432126
|
-
const nextNewline =
|
|
432858
|
+
const text2 = cursor.text;
|
|
432859
|
+
const nextNewline = text2.indexOf(`
|
|
432127
432860
|
`, to);
|
|
432128
432861
|
if (nextNewline === -1) {
|
|
432129
|
-
to =
|
|
432130
|
-
if (from > 0 &&
|
|
432862
|
+
to = text2.length;
|
|
432863
|
+
if (from > 0 && text2[from - 1] === `
|
|
432131
432864
|
`) {
|
|
432132
432865
|
from -= 1;
|
|
432133
432866
|
}
|
|
@@ -432894,8 +433627,8 @@ function VimTextInput(props) {
|
|
|
432894
433627
|
}
|
|
432895
433628
|
return t19;
|
|
432896
433629
|
}
|
|
432897
|
-
function _temp183(
|
|
432898
|
-
return
|
|
433630
|
+
function _temp183(text2) {
|
|
433631
|
+
return text2;
|
|
432899
433632
|
}
|
|
432900
433633
|
var import_react238, jsx_runtime404;
|
|
432901
433634
|
var init_VimTextInput = __esm(() => {
|
|
@@ -432958,7 +433691,7 @@ function buildStatusLineCommandInput(permissionMode, exceeds200kTokens, settings
|
|
|
432958
433691
|
project_dir: getOriginalCwd(),
|
|
432959
433692
|
added_dirs: addedDirs
|
|
432960
433693
|
},
|
|
432961
|
-
version: { VERSION: "0.1.
|
|
433694
|
+
version: { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
432962
433695
|
output_style: {
|
|
432963
433696
|
name: outputStyleName
|
|
432964
433697
|
},
|
|
@@ -433060,14 +433793,14 @@ function StatusLineInner({
|
|
|
433060
433793
|
previousStateRef.current.exceeds200kTokens = exceeds200kTokens;
|
|
433061
433794
|
}
|
|
433062
433795
|
const statusInput = buildStatusLineCommandInput(permissionModeRef.current, exceeds200kTokens, settingsRef.current, msgs, Array.from(addedDirsRef.current.keys()), mainLoopModelRef.current, vimModeRef.current);
|
|
433063
|
-
const
|
|
433796
|
+
const text2 = await executeStatusLineCommand(statusInput, controller.signal, undefined, logResult2);
|
|
433064
433797
|
if (!controller.signal.aborted) {
|
|
433065
433798
|
setAppState((prev) => {
|
|
433066
|
-
if (prev.statusLineText ===
|
|
433799
|
+
if (prev.statusLineText === text2)
|
|
433067
433800
|
return prev;
|
|
433068
433801
|
return {
|
|
433069
433802
|
...prev,
|
|
433070
|
-
statusLineText:
|
|
433803
|
+
statusLineText: text2
|
|
433071
433804
|
};
|
|
433072
433805
|
});
|
|
433073
433806
|
}
|
|
@@ -434959,18 +435692,18 @@ var init_PromptInputStashNotice = __esm(() => {
|
|
|
434959
435692
|
});
|
|
434960
435693
|
|
|
434961
435694
|
// components/PromptInput/inputPaste.ts
|
|
434962
|
-
function maybeTruncateMessageForInput(
|
|
434963
|
-
if (
|
|
435695
|
+
function maybeTruncateMessageForInput(text2, nextPasteId) {
|
|
435696
|
+
if (text2.length <= TRUNCATION_THRESHOLD) {
|
|
434964
435697
|
return {
|
|
434965
|
-
truncatedText:
|
|
435698
|
+
truncatedText: text2,
|
|
434966
435699
|
placeholderContent: ""
|
|
434967
435700
|
};
|
|
434968
435701
|
}
|
|
434969
435702
|
const startLength = Math.floor(PREVIEW_LENGTH / 2);
|
|
434970
435703
|
const endLength = Math.floor(PREVIEW_LENGTH / 2);
|
|
434971
|
-
const startText =
|
|
434972
|
-
const endText =
|
|
434973
|
-
const placeholderContent =
|
|
435704
|
+
const startText = text2.slice(0, startLength);
|
|
435705
|
+
const endText = text2.slice(-endLength);
|
|
435706
|
+
const placeholderContent = text2.slice(startLength, -endLength);
|
|
434974
435707
|
const truncatedLines = getPastedTextRefNumLines(placeholderContent);
|
|
434975
435708
|
const placeholderId = nextPasteId;
|
|
434976
435709
|
const placeholderRef = formatTruncatedTextRef(placeholderId, truncatedLines);
|
|
@@ -435405,9 +436138,9 @@ function PromptInput({
|
|
|
435405
436138
|
if (insertTextRef) {
|
|
435406
436139
|
insertTextRef.current = {
|
|
435407
436140
|
cursorOffset,
|
|
435408
|
-
insert: (
|
|
436141
|
+
insert: (text2) => {
|
|
435409
436142
|
const needsSpace = cursorOffset === input.length && input.length > 0 && !/\s$/.test(input);
|
|
435410
|
-
const insertText = needsSpace ? " " +
|
|
436143
|
+
const insertText = needsSpace ? " " + text2 : text2;
|
|
435411
436144
|
const newValue = input.slice(0, cursorOffset) + insertText + input.slice(cursorOffset);
|
|
435412
436145
|
lastInternalInputRef.current = newValue;
|
|
435413
436146
|
onInputChange(newValue);
|
|
@@ -436142,23 +436875,23 @@ function PromptInput({
|
|
|
436142
436875
|
}, [input, setPastedContents]);
|
|
436143
436876
|
function onTextPaste(rawText) {
|
|
436144
436877
|
pendingSpaceAfterPillRef.current = false;
|
|
436145
|
-
let
|
|
436878
|
+
let text2 = stripAnsi(rawText).replace(/\r/g, `
|
|
436146
436879
|
`).replaceAll("\t", " ");
|
|
436147
436880
|
if (input.length === 0) {
|
|
436148
|
-
const pastedMode = getModeFromInput(
|
|
436881
|
+
const pastedMode = getModeFromInput(text2);
|
|
436149
436882
|
if (pastedMode !== "prompt") {
|
|
436150
436883
|
onModeChange(pastedMode);
|
|
436151
|
-
|
|
436884
|
+
text2 = getValueFromInput(text2);
|
|
436152
436885
|
}
|
|
436153
436886
|
}
|
|
436154
|
-
const numLines = getPastedTextRefNumLines(
|
|
436887
|
+
const numLines = getPastedTextRefNumLines(text2);
|
|
436155
436888
|
const maxLines = Math.min(rows - 10, 2);
|
|
436156
|
-
if (
|
|
436889
|
+
if (text2.length > PASTE_THRESHOLD || numLines > maxLines) {
|
|
436157
436890
|
const pasteId = nextPasteIdRef.current++;
|
|
436158
436891
|
const newContent = {
|
|
436159
436892
|
id: pasteId,
|
|
436160
436893
|
type: "text",
|
|
436161
|
-
content:
|
|
436894
|
+
content: text2
|
|
436162
436895
|
};
|
|
436163
436896
|
setPastedContents((prev) => ({
|
|
436164
436897
|
...prev,
|
|
@@ -436166,7 +436899,7 @@ function PromptInput({
|
|
|
436166
436899
|
}));
|
|
436167
436900
|
insertTextAtCursor(formatPastedTextRef(pasteId, numLines));
|
|
436168
436901
|
} else {
|
|
436169
|
-
insertTextAtCursor(
|
|
436902
|
+
insertTextAtCursor(text2);
|
|
436170
436903
|
}
|
|
436171
436904
|
}
|
|
436172
436905
|
const lazySpaceInputFilter = import_react248.useCallback((input2, key) => {
|
|
@@ -436177,11 +436910,11 @@ function PromptInput({
|
|
|
436177
436910
|
return " " + input2;
|
|
436178
436911
|
return input2;
|
|
436179
436912
|
}, []);
|
|
436180
|
-
function insertTextAtCursor(
|
|
436913
|
+
function insertTextAtCursor(text2) {
|
|
436181
436914
|
pushToBuffer(input, cursorOffset, pastedContents);
|
|
436182
|
-
const newInput = input.slice(0, cursorOffset) +
|
|
436915
|
+
const newInput = input.slice(0, cursorOffset) + text2 + input.slice(cursorOffset);
|
|
436183
436916
|
trackAndSetInput(newInput);
|
|
436184
|
-
setCursorOffset(cursorOffset +
|
|
436917
|
+
setCursorOffset(cursorOffset + text2.length);
|
|
436185
436918
|
}
|
|
436186
436919
|
const doublePressEscFromEmpty = useDoublePress(() => {}, () => onShowMessageSelector());
|
|
436187
436920
|
const popAllCommandsFromQueue = import_react248.useCallback(() => {
|
|
@@ -439088,9 +439821,9 @@ function initSkillImprovement() {
|
|
|
439088
439821
|
async function applySkillImprovement(skillName, updates) {
|
|
439089
439822
|
if (!skillName)
|
|
439090
439823
|
return;
|
|
439091
|
-
const { join:
|
|
439824
|
+
const { join: join151 } = await import("path");
|
|
439092
439825
|
const fs5 = await import("fs/promises");
|
|
439093
|
-
const filePath =
|
|
439826
|
+
const filePath = join151(getCwd(), ".theus", "skills", skillName, "SKILL.md");
|
|
439094
439827
|
let currentContent;
|
|
439095
439828
|
try {
|
|
439096
439829
|
currentContent = await fs5.readFile(filePath, "utf-8");
|
|
@@ -439243,8 +439976,8 @@ function useMoreRight(_args) {
|
|
|
439243
439976
|
|
|
439244
439977
|
// utils/cleanup.ts
|
|
439245
439978
|
import * as fs5 from "fs/promises";
|
|
439246
|
-
import { homedir as
|
|
439247
|
-
import { join as
|
|
439979
|
+
import { homedir as homedir41 } from "os";
|
|
439980
|
+
import { join as join151 } from "path";
|
|
439248
439981
|
function getCutoffDate() {
|
|
439249
439982
|
const settings = getSettings_DEPRECATED() || {};
|
|
439250
439983
|
const cleanupPeriodDays = settings.cleanupPeriodDays ?? DEFAULT_CLEANUP_PERIOD_DAYS;
|
|
@@ -439269,7 +440002,7 @@ async function cleanupOldFilesInDirectory(dirPath, cutoffDate, isMessagePath) {
|
|
|
439269
440002
|
try {
|
|
439270
440003
|
const timestamp = convertFileNameToDate(file2.name);
|
|
439271
440004
|
if (timestamp < cutoffDate) {
|
|
439272
|
-
await getFsImplementation().unlink(
|
|
440005
|
+
await getFsImplementation().unlink(join151(dirPath, file2.name));
|
|
439273
440006
|
if (isMessagePath) {
|
|
439274
440007
|
result.messages++;
|
|
439275
440008
|
} else {
|
|
@@ -439300,7 +440033,7 @@ async function cleanupOldMessageFiles() {
|
|
|
439300
440033
|
} catch {
|
|
439301
440034
|
return result;
|
|
439302
440035
|
}
|
|
439303
|
-
const mcpLogDirs = dirents.filter((dirent) => dirent.isDirectory() && dirent.name.startsWith("mcp-logs-")).map((dirent) =>
|
|
440036
|
+
const mcpLogDirs = dirents.filter((dirent) => dirent.isDirectory() && dirent.name.startsWith("mcp-logs-")).map((dirent) => join151(baseCachePath, dirent.name));
|
|
439304
440037
|
for (const mcpLogDir of mcpLogDirs) {
|
|
439305
440038
|
result = addCleanupResults(result, await cleanupOldFilesInDirectory(mcpLogDir, cutoffDate, true));
|
|
439306
440039
|
await tryRmdir(mcpLogDir, fsImpl);
|
|
@@ -439339,7 +440072,7 @@ async function cleanupOldSessionFiles() {
|
|
|
439339
440072
|
for (const projectDirent of projectDirents) {
|
|
439340
440073
|
if (!projectDirent.isDirectory())
|
|
439341
440074
|
continue;
|
|
439342
|
-
const projectDir =
|
|
440075
|
+
const projectDir = join151(projectsDir, projectDirent.name);
|
|
439343
440076
|
let entries;
|
|
439344
440077
|
try {
|
|
439345
440078
|
entries = await fsImpl.readdir(projectDir);
|
|
@@ -439353,15 +440086,15 @@ async function cleanupOldSessionFiles() {
|
|
|
439353
440086
|
continue;
|
|
439354
440087
|
}
|
|
439355
440088
|
try {
|
|
439356
|
-
if (await unlinkIfOld(
|
|
440089
|
+
if (await unlinkIfOld(join151(projectDir, entry.name), cutoffDate, fsImpl)) {
|
|
439357
440090
|
result.messages++;
|
|
439358
440091
|
}
|
|
439359
440092
|
} catch {
|
|
439360
440093
|
result.errors++;
|
|
439361
440094
|
}
|
|
439362
440095
|
} else if (entry.isDirectory()) {
|
|
439363
|
-
const sessionDir =
|
|
439364
|
-
const toolResultsDir =
|
|
440096
|
+
const sessionDir = join151(projectDir, entry.name);
|
|
440097
|
+
const toolResultsDir = join151(sessionDir, TOOL_RESULTS_SUBDIR);
|
|
439365
440098
|
let toolDirs;
|
|
439366
440099
|
try {
|
|
439367
440100
|
toolDirs = await fsImpl.readdir(toolResultsDir);
|
|
@@ -439372,14 +440105,14 @@ async function cleanupOldSessionFiles() {
|
|
|
439372
440105
|
for (const toolEntry of toolDirs) {
|
|
439373
440106
|
if (toolEntry.isFile()) {
|
|
439374
440107
|
try {
|
|
439375
|
-
if (await unlinkIfOld(
|
|
440108
|
+
if (await unlinkIfOld(join151(toolResultsDir, toolEntry.name), cutoffDate, fsImpl)) {
|
|
439376
440109
|
result.messages++;
|
|
439377
440110
|
}
|
|
439378
440111
|
} catch {
|
|
439379
440112
|
result.errors++;
|
|
439380
440113
|
}
|
|
439381
440114
|
} else if (toolEntry.isDirectory()) {
|
|
439382
|
-
const toolDirPath =
|
|
440115
|
+
const toolDirPath = join151(toolResultsDir, toolEntry.name);
|
|
439383
440116
|
let toolFiles;
|
|
439384
440117
|
try {
|
|
439385
440118
|
toolFiles = await fsImpl.readdir(toolDirPath);
|
|
@@ -439390,7 +440123,7 @@ async function cleanupOldSessionFiles() {
|
|
|
439390
440123
|
if (!tf.isFile())
|
|
439391
440124
|
continue;
|
|
439392
440125
|
try {
|
|
439393
|
-
if (await unlinkIfOld(
|
|
440126
|
+
if (await unlinkIfOld(join151(toolDirPath, tf.name), cutoffDate, fsImpl)) {
|
|
439394
440127
|
result.messages++;
|
|
439395
440128
|
}
|
|
439396
440129
|
} catch {
|
|
@@ -439422,7 +440155,7 @@ async function cleanupSingleDirectory(dirPath, extension, removeEmptyDir = true)
|
|
|
439422
440155
|
if (!dirent.isFile() || !dirent.name.endsWith(extension))
|
|
439423
440156
|
continue;
|
|
439424
440157
|
try {
|
|
439425
|
-
if (await unlinkIfOld(
|
|
440158
|
+
if (await unlinkIfOld(join151(dirPath, dirent.name), cutoffDate, fsImpl)) {
|
|
439426
440159
|
result.messages++;
|
|
439427
440160
|
}
|
|
439428
440161
|
} catch {
|
|
@@ -439435,7 +440168,7 @@ async function cleanupSingleDirectory(dirPath, extension, removeEmptyDir = true)
|
|
|
439435
440168
|
return result;
|
|
439436
440169
|
}
|
|
439437
440170
|
function cleanupOldPlanFiles() {
|
|
439438
|
-
const plansDir =
|
|
440171
|
+
const plansDir = join151(getTheusConfigHomeDir(), "plans");
|
|
439439
440172
|
return cleanupSingleDirectory(plansDir, ".md");
|
|
439440
440173
|
}
|
|
439441
440174
|
async function cleanupOldFileHistoryBackups() {
|
|
@@ -439444,14 +440177,14 @@ async function cleanupOldFileHistoryBackups() {
|
|
|
439444
440177
|
const fsImpl = getFsImplementation();
|
|
439445
440178
|
try {
|
|
439446
440179
|
const configDir = getTheusConfigHomeDir();
|
|
439447
|
-
const fileHistoryStorageDir =
|
|
440180
|
+
const fileHistoryStorageDir = join151(configDir, "file-history");
|
|
439448
440181
|
let dirents;
|
|
439449
440182
|
try {
|
|
439450
440183
|
dirents = await fsImpl.readdir(fileHistoryStorageDir);
|
|
439451
440184
|
} catch {
|
|
439452
440185
|
return result;
|
|
439453
440186
|
}
|
|
439454
|
-
const fileHistorySessionsDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
440187
|
+
const fileHistorySessionsDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join151(fileHistoryStorageDir, dirent.name));
|
|
439455
440188
|
await Promise.all(fileHistorySessionsDirs.map(async (fileHistorySessionDir) => {
|
|
439456
440189
|
try {
|
|
439457
440190
|
const stats2 = await fsImpl.stat(fileHistorySessionDir);
|
|
@@ -439478,14 +440211,14 @@ async function cleanupOldSessionEnvDirs() {
|
|
|
439478
440211
|
const fsImpl = getFsImplementation();
|
|
439479
440212
|
try {
|
|
439480
440213
|
const configDir = getTheusConfigHomeDir();
|
|
439481
|
-
const sessionEnvBaseDir =
|
|
440214
|
+
const sessionEnvBaseDir = join151(configDir, "session-env");
|
|
439482
440215
|
let dirents;
|
|
439483
440216
|
try {
|
|
439484
440217
|
dirents = await fsImpl.readdir(sessionEnvBaseDir);
|
|
439485
440218
|
} catch {
|
|
439486
440219
|
return result;
|
|
439487
440220
|
}
|
|
439488
|
-
const sessionEnvDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
440221
|
+
const sessionEnvDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join151(sessionEnvBaseDir, dirent.name));
|
|
439489
440222
|
for (const sessionEnvDir of sessionEnvDirs) {
|
|
439490
440223
|
try {
|
|
439491
440224
|
const stats2 = await fsImpl.stat(sessionEnvDir);
|
|
@@ -439507,7 +440240,7 @@ async function cleanupOldDebugLogs() {
|
|
|
439507
440240
|
const cutoffDate = getCutoffDate();
|
|
439508
440241
|
const result = { messages: 0, errors: 0 };
|
|
439509
440242
|
const fsImpl = getFsImplementation();
|
|
439510
|
-
const debugDir =
|
|
440243
|
+
const debugDir = join151(getTheusConfigHomeDir(), "debug");
|
|
439511
440244
|
let dirents;
|
|
439512
440245
|
try {
|
|
439513
440246
|
dirents = await fsImpl.readdir(debugDir);
|
|
@@ -439519,7 +440252,7 @@ async function cleanupOldDebugLogs() {
|
|
|
439519
440252
|
continue;
|
|
439520
440253
|
}
|
|
439521
440254
|
try {
|
|
439522
|
-
if (await unlinkIfOld(
|
|
440255
|
+
if (await unlinkIfOld(join151(debugDir, dirent.name), cutoffDate, fsImpl)) {
|
|
439523
440256
|
result.messages++;
|
|
439524
440257
|
}
|
|
439525
440258
|
} catch {
|
|
@@ -439529,7 +440262,7 @@ async function cleanupOldDebugLogs() {
|
|
|
439529
440262
|
return result;
|
|
439530
440263
|
}
|
|
439531
440264
|
async function cleanupNpmCacheForTheusPackages() {
|
|
439532
|
-
const markerPath =
|
|
440265
|
+
const markerPath = join151(getTheusConfigHomeDir(), ".npm-cache-cleanup");
|
|
439533
440266
|
try {
|
|
439534
440267
|
const stat46 = await fs5.stat(markerPath);
|
|
439535
440268
|
if (Date.now() - stat46.mtimeMs < ONE_DAY_MS) {
|
|
@@ -439544,7 +440277,7 @@ async function cleanupNpmCacheForTheusPackages() {
|
|
|
439544
440277
|
return;
|
|
439545
440278
|
}
|
|
439546
440279
|
logForDebugging("npm cache cleanup: starting");
|
|
439547
|
-
const npmCachePath =
|
|
440280
|
+
const npmCachePath = join151(homedir41(), ".npm", "_cacache");
|
|
439548
440281
|
const NPM_CACHE_RETENTION_COUNT = 5;
|
|
439549
440282
|
const startTime2 = Date.now();
|
|
439550
440283
|
try {
|
|
@@ -439599,7 +440332,7 @@ async function cleanupNpmCacheForTheusPackages() {
|
|
|
439599
440332
|
}
|
|
439600
440333
|
}
|
|
439601
440334
|
async function cleanupOldVersionsThrottled() {
|
|
439602
|
-
const markerPath =
|
|
440335
|
+
const markerPath = join151(getTheusConfigHomeDir(), ".version-cleanup");
|
|
439603
440336
|
try {
|
|
439604
440337
|
const stat46 = await fs5.stat(markerPath);
|
|
439605
440338
|
if (Date.now() - stat46.mtimeMs < ONE_DAY_MS) {
|
|
@@ -441687,7 +442420,7 @@ async function processUserInputBase(input, mode, setToolJSX, context3, pastedCon
|
|
|
441687
442420
|
function addImageMetadataMessage(result, imageMetadataTexts) {
|
|
441688
442421
|
if (imageMetadataTexts.length > 0) {
|
|
441689
442422
|
result.messages.push(createUserMessage({
|
|
441690
|
-
content: imageMetadataTexts.map((
|
|
442423
|
+
content: imageMetadataTexts.map((text2) => ({ type: "text", text: text2 })),
|
|
441691
442424
|
isMeta: true
|
|
441692
442425
|
}));
|
|
441693
442426
|
}
|
|
@@ -442830,7 +443563,7 @@ __export(exports_asciicast, {
|
|
|
442830
443563
|
_resetRecordingStateForTesting: () => _resetRecordingStateForTesting
|
|
442831
443564
|
});
|
|
442832
443565
|
import { appendFile as appendFile7, rename as rename10 } from "fs/promises";
|
|
442833
|
-
import { basename as basename56, dirname as dirname63, join as
|
|
443566
|
+
import { basename as basename56, dirname as dirname63, join as join153 } from "path";
|
|
442834
443567
|
function getRecordFilePath() {
|
|
442835
443568
|
if (recordingState.filePath !== null) {
|
|
442836
443569
|
return recordingState.filePath;
|
|
@@ -442841,10 +443574,10 @@ function getRecordFilePath() {
|
|
|
442841
443574
|
if (!isEnvTruthy(process.env.THEUS_CODE_TERMINAL_RECORDING)) {
|
|
442842
443575
|
return null;
|
|
442843
443576
|
}
|
|
442844
|
-
const projectsDir =
|
|
442845
|
-
const projectDir =
|
|
443577
|
+
const projectsDir = join153(getTheusConfigHomeDir(), "projects");
|
|
443578
|
+
const projectDir = join153(projectsDir, sanitizePath2(getOriginalCwd()));
|
|
442846
443579
|
recordingState.timestamp = Date.now();
|
|
442847
|
-
recordingState.filePath =
|
|
443580
|
+
recordingState.filePath = join153(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
|
|
442848
443581
|
return recordingState.filePath;
|
|
442849
443582
|
}
|
|
442850
443583
|
function _resetRecordingStateForTesting() {
|
|
@@ -442853,13 +443586,13 @@ function _resetRecordingStateForTesting() {
|
|
|
442853
443586
|
}
|
|
442854
443587
|
function getSessionRecordingPaths() {
|
|
442855
443588
|
const sessionId = getSessionId();
|
|
442856
|
-
const projectsDir =
|
|
442857
|
-
const projectDir =
|
|
443589
|
+
const projectsDir = join153(getTheusConfigHomeDir(), "projects");
|
|
443590
|
+
const projectDir = join153(projectsDir, sanitizePath2(getOriginalCwd()));
|
|
442858
443591
|
try {
|
|
442859
443592
|
const entries = getFsImplementation().readdirSync(projectDir);
|
|
442860
443593
|
const names = typeof entries[0] === "string" ? entries : entries.map((e) => e.name);
|
|
442861
443594
|
const files2 = names.filter((f) => f.startsWith(sessionId) && f.endsWith(".cast")).sort();
|
|
442862
|
-
return files2.map((f) =>
|
|
443595
|
+
return files2.map((f) => join153(projectDir, f));
|
|
442863
443596
|
} catch {
|
|
442864
443597
|
return [];
|
|
442865
443598
|
}
|
|
@@ -442869,9 +443602,9 @@ async function renameRecordingForSession() {
|
|
|
442869
443602
|
if (!oldPath || recordingState.timestamp === 0) {
|
|
442870
443603
|
return;
|
|
442871
443604
|
}
|
|
442872
|
-
const projectsDir =
|
|
442873
|
-
const projectDir =
|
|
442874
|
-
const newPath =
|
|
443605
|
+
const projectsDir = join153(getTheusConfigHomeDir(), "projects");
|
|
443606
|
+
const projectDir = join153(projectsDir, sanitizePath2(getOriginalCwd()));
|
|
443607
|
+
const newPath = join153(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
|
|
442875
443608
|
if (oldPath === newPath) {
|
|
442876
443609
|
return;
|
|
442877
443610
|
}
|
|
@@ -442932,8 +443665,8 @@ function installAsciicastRecorder() {
|
|
|
442932
443665
|
const originalWrite = process.stdout.write.bind(process.stdout);
|
|
442933
443666
|
process.stdout.write = function(chunk2, encodingOrCb, cb) {
|
|
442934
443667
|
const elapsed = (performance.now() - startTime2) / 1000;
|
|
442935
|
-
const
|
|
442936
|
-
writer.write(jsonStringify([elapsed, "o",
|
|
443668
|
+
const text2 = typeof chunk2 === "string" ? chunk2 : Buffer.from(chunk2).toString("utf-8");
|
|
443669
|
+
writer.write(jsonStringify([elapsed, "o", text2]) + `
|
|
442937
443670
|
`);
|
|
442938
443671
|
if (typeof encodingOrCb === "function") {
|
|
442939
443672
|
return originalWrite(chunk2, encodingOrCb);
|
|
@@ -444285,7 +445018,7 @@ function EffortOptionLabel(t0) {
|
|
|
444285
445018
|
const $2 = c3(5);
|
|
444286
445019
|
const {
|
|
444287
445020
|
level,
|
|
444288
|
-
text
|
|
445021
|
+
text: text2
|
|
444289
445022
|
} = t0;
|
|
444290
445023
|
let t1;
|
|
444291
445024
|
if ($2[0] !== level) {
|
|
@@ -444298,16 +445031,16 @@ function EffortOptionLabel(t0) {
|
|
|
444298
445031
|
t1 = $2[1];
|
|
444299
445032
|
}
|
|
444300
445033
|
let t2;
|
|
444301
|
-
if ($2[2] !== t1 || $2[3] !==
|
|
445034
|
+
if ($2[2] !== t1 || $2[3] !== text2) {
|
|
444302
445035
|
t2 = /* @__PURE__ */ jsx_runtime423.jsxs(jsx_runtime423.Fragment, {
|
|
444303
445036
|
children: [
|
|
444304
445037
|
t1,
|
|
444305
445038
|
" ",
|
|
444306
|
-
|
|
445039
|
+
text2
|
|
444307
445040
|
]
|
|
444308
445041
|
});
|
|
444309
445042
|
$2[2] = t1;
|
|
444310
|
-
$2[3] =
|
|
445043
|
+
$2[3] = text2;
|
|
444311
445044
|
$2[4] = t2;
|
|
444312
445045
|
} else {
|
|
444313
445046
|
t2 = $2[4];
|
|
@@ -444457,8 +445190,8 @@ var init_useDynamicConfig = __esm(() => {
|
|
|
444457
445190
|
});
|
|
444458
445191
|
|
|
444459
445192
|
// components/Feedback.tsx
|
|
444460
|
-
function redactSensitiveInfo(
|
|
444461
|
-
let redacted =
|
|
445193
|
+
function redactSensitiveInfo(text2) {
|
|
445194
|
+
let redacted = text2;
|
|
444462
445195
|
redacted = redacted.replace(/"(sk-ant[^\s"']{24,})"/g, '"[REDACTED_API_KEY]"');
|
|
444463
445196
|
redacted = redacted.replace(/(?<![A-Za-z0-9"'])(sk-ant-?[A-Za-z0-9_-]{10,})(?![A-Za-z0-9"'])/g, "[REDACTED_API_KEY]");
|
|
444464
445197
|
redacted = redacted.replace(/AWS key: "(AWS[A-Z0-9]{20,})"/g, 'AWS key: "[REDACTED_AWS_KEY]"');
|
|
@@ -444521,7 +445254,7 @@ async function submitTranscriptShare(messages, trigger, appearanceId) {
|
|
|
444521
445254
|
} catch {}
|
|
444522
445255
|
const data = {
|
|
444523
445256
|
trigger,
|
|
444524
|
-
version: { VERSION: "0.1.
|
|
445257
|
+
version: { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
444525
445258
|
platform: process.platform,
|
|
444526
445259
|
transcript,
|
|
444527
445260
|
subagentTranscripts: Object.keys(subagentTranscripts).length > 0 ? subagentTranscripts : undefined,
|
|
@@ -445050,8 +445783,8 @@ function useMemorySurvey(messages, isLoading, hasActivePrompt = false, {
|
|
|
445050
445783
|
if (!lastAssistant || seenAssistantUuids.current.has(lastAssistant.uuid)) {
|
|
445051
445784
|
return;
|
|
445052
445785
|
}
|
|
445053
|
-
const
|
|
445054
|
-
if (!MEMORY_WORD_RE.test(
|
|
445786
|
+
const text2 = extractTextContent(lastAssistant.message.content, " ");
|
|
445787
|
+
if (!MEMORY_WORD_RE.test(text2)) {
|
|
445055
445788
|
return;
|
|
445056
445789
|
}
|
|
445057
445790
|
seenAssistantUuids.current.add(lastAssistant.uuid);
|
|
@@ -445748,7 +446481,7 @@ var init_useAwaySummary = __esm(() => {
|
|
|
445748
446481
|
|
|
445749
446482
|
// utils/theusInChrome/setupPortable.ts
|
|
445750
446483
|
import { readdir as readdir31 } from "fs/promises";
|
|
445751
|
-
import { join as
|
|
446484
|
+
import { join as join154 } from "path";
|
|
445752
446485
|
function getExtensionIds() {
|
|
445753
446486
|
return process.env.USER_TYPE === "ant" ? [PROD_EXTENSION_ID, DEV_EXTENSION_ID, ANT_EXTENSION_ID] : [PROD_EXTENSION_ID];
|
|
445754
446487
|
}
|
|
@@ -445775,7 +446508,7 @@ async function detectExtensionInstallationPortable(browserPaths, log2) {
|
|
|
445775
446508
|
}
|
|
445776
446509
|
for (const profile of profileDirs) {
|
|
445777
446510
|
for (const extensionId of extensionIds) {
|
|
445778
|
-
const extensionPath =
|
|
446511
|
+
const extensionPath = join154(browserBasePath, profile, "Extensions", extensionId);
|
|
445779
446512
|
try {
|
|
445780
446513
|
await readdir31(extensionPath);
|
|
445781
446514
|
log2?.(`[Theus in Chrome] Extension ${extensionId} found in ${browser} ${profile}`);
|
|
@@ -445798,8 +446531,8 @@ var init_setupPortable = __esm(() => {
|
|
|
445798
446531
|
|
|
445799
446532
|
// utils/theusInChrome/setup.ts
|
|
445800
446533
|
import { chmod as chmod11, mkdir as mkdir48, readFile as readFile53, writeFile as writeFile50 } from "fs/promises";
|
|
445801
|
-
import { homedir as
|
|
445802
|
-
import { join as
|
|
446534
|
+
import { homedir as homedir42 } from "os";
|
|
446535
|
+
import { join as join155 } from "path";
|
|
445803
446536
|
import { fileURLToPath as fileURLToPath7 } from "url";
|
|
445804
446537
|
function shouldEnableTheusInChrome(chromeFlag) {
|
|
445805
446538
|
if (getIsNonInteractiveSession() && chromeFlag !== true) {
|
|
@@ -445856,8 +446589,8 @@ function setupTheusInChrome() {
|
|
|
445856
446589
|
};
|
|
445857
446590
|
} else {
|
|
445858
446591
|
const __filename3 = fileURLToPath7(import.meta.url);
|
|
445859
|
-
const __dirname3 =
|
|
445860
|
-
const cliPath =
|
|
446592
|
+
const __dirname3 = join155(__filename3, "..");
|
|
446593
|
+
const cliPath = join155(__dirname3, "cli.js");
|
|
445861
446594
|
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" }));
|
|
445862
446595
|
const mcpConfig = {
|
|
445863
446596
|
[THEUS_IN_CHROME_MCP_SERVER_NAME]: {
|
|
@@ -445878,9 +446611,9 @@ function setupTheusInChrome() {
|
|
|
445878
446611
|
function getNativeMessagingHostsDirs() {
|
|
445879
446612
|
const platform6 = getPlatform();
|
|
445880
446613
|
if (platform6 === "windows") {
|
|
445881
|
-
const home =
|
|
445882
|
-
const appData = process.env.APPDATA ||
|
|
445883
|
-
return [
|
|
446614
|
+
const home = homedir42();
|
|
446615
|
+
const appData = process.env.APPDATA || join155(home, "AppData", "Local");
|
|
446616
|
+
return [join155(appData, "Theus", "ChromeNativeHost")];
|
|
445884
446617
|
}
|
|
445885
446618
|
return getAllNativeMessagingHostsDirs().map(({ path: path21 }) => path21);
|
|
445886
446619
|
}
|
|
@@ -445905,7 +446638,7 @@ async function installChromeNativeHostManifest(manifestBinaryPath) {
|
|
|
445905
446638
|
const manifestContent = jsonStringify(manifest, null, 2);
|
|
445906
446639
|
let anyManifestUpdated = false;
|
|
445907
446640
|
for (const manifestDir of manifestDirs) {
|
|
445908
|
-
const manifestPath =
|
|
446641
|
+
const manifestPath = join155(manifestDir, NATIVE_HOST_MANIFEST_NAME);
|
|
445909
446642
|
const existingContent = await readFile53(manifestPath, "utf-8").catch(() => null);
|
|
445910
446643
|
if (existingContent === manifestContent) {
|
|
445911
446644
|
continue;
|
|
@@ -445920,7 +446653,7 @@ async function installChromeNativeHostManifest(manifestBinaryPath) {
|
|
|
445920
446653
|
}
|
|
445921
446654
|
}
|
|
445922
446655
|
if (getPlatform() === "windows") {
|
|
445923
|
-
const manifestPath =
|
|
446656
|
+
const manifestPath = join155(manifestDirs[0], NATIVE_HOST_MANIFEST_NAME);
|
|
445924
446657
|
registerWindowsNativeHosts(manifestPath);
|
|
445925
446658
|
}
|
|
445926
446659
|
if (anyManifestUpdated) {
|
|
@@ -445958,8 +446691,8 @@ function registerWindowsNativeHosts(manifestPath) {
|
|
|
445958
446691
|
}
|
|
445959
446692
|
async function createWrapperScript(command7) {
|
|
445960
446693
|
const platform6 = getPlatform();
|
|
445961
|
-
const chromeDir =
|
|
445962
|
-
const wrapperPath = platform6 === "windows" ?
|
|
446694
|
+
const chromeDir = join155(getTheusConfigHomeDir(), "chrome");
|
|
446695
|
+
const wrapperPath = platform6 === "windows" ? join155(chromeDir, "chrome-native-host.bat") : join155(chromeDir, "chrome-native-host");
|
|
445963
446696
|
const scriptContent = platform6 === "windows" ? `@echo off
|
|
445964
446697
|
REM Chrome native host wrapper script
|
|
445965
446698
|
REM Generated by Theus - do not edit manually
|
|
@@ -446082,7 +446815,7 @@ var init_useChromeExtensionNotification = __esm(() => {
|
|
|
446082
446815
|
});
|
|
446083
446816
|
|
|
446084
446817
|
// utils/plugins/officialMarketplaceStartupCheck.ts
|
|
446085
|
-
import { join as
|
|
446818
|
+
import { join as join156 } from "path";
|
|
446086
446819
|
function isOfficialMarketplaceAutoInstallDisabled() {
|
|
446087
446820
|
if (isEnvTruthy(process.env.THEUS_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL)) {
|
|
446088
446821
|
return true;
|
|
@@ -446157,7 +446890,7 @@ async function checkAndInstallOfficialMarketplace() {
|
|
|
446157
446890
|
return { installed: false, skipped: true, reason: "policy_blocked" };
|
|
446158
446891
|
}
|
|
446159
446892
|
const cacheDir = getMarketplacesCacheDir();
|
|
446160
|
-
const installLocation =
|
|
446893
|
+
const installLocation = join156(cacheDir, OFFICIAL_MARKETPLACE_NAME);
|
|
446161
446894
|
const gcsSha = await fetchOfficialMarketplaceFromGcs(installLocation, cacheDir);
|
|
446162
446895
|
if (gcsSha !== null) {
|
|
446163
446896
|
const known = await loadKnownMarketplacesConfig();
|
|
@@ -449136,7 +449869,7 @@ var init_usePluginRecommendationBase = __esm(() => {
|
|
|
449136
449869
|
});
|
|
449137
449870
|
|
|
449138
449871
|
// hooks/useLspPluginRecommendation.tsx
|
|
449139
|
-
import { extname as extname16, join as
|
|
449872
|
+
import { extname as extname16, join as join157 } from "path";
|
|
449140
449873
|
function useLspPluginRecommendation() {
|
|
449141
449874
|
const $2 = c3(12);
|
|
449142
449875
|
const trackedFiles = useAppState(_temp200);
|
|
@@ -449221,7 +449954,7 @@ function useLspPluginRecommendation() {
|
|
|
449221
449954
|
case "yes": {
|
|
449222
449955
|
installPluginAndNotify(pluginId, pluginName, "lsp-plugin", addNotification, async (pluginData) => {
|
|
449223
449956
|
logForDebugging(`[useLspPluginRecommendation] Installing plugin: ${pluginId}`);
|
|
449224
|
-
const localSourcePath = typeof pluginData.entry.source === "string" ?
|
|
449957
|
+
const localSourcePath = typeof pluginData.entry.source === "string" ? join157(pluginData.marketplaceInstallLocation, pluginData.entry.source) : undefined;
|
|
449225
449958
|
await cacheAndRegisterPlugin(pluginId, pluginData.entry, "user", undefined, localSourcePath);
|
|
449226
449959
|
const settings = getSettingsForSource("userSettings");
|
|
449227
449960
|
updateSettingsForSource("userSettings", {
|
|
@@ -451339,11 +452072,11 @@ function hasFrictionSignal(messages) {
|
|
|
451339
452072
|
if (msg.type !== "user") {
|
|
451340
452073
|
continue;
|
|
451341
452074
|
}
|
|
451342
|
-
const
|
|
451343
|
-
if (!
|
|
452075
|
+
const text2 = getUserMessageText(msg);
|
|
452076
|
+
if (!text2) {
|
|
451344
452077
|
continue;
|
|
451345
452078
|
}
|
|
451346
|
-
return FRICTION_PATTERNS.some((p) => p.test(
|
|
452079
|
+
return FRICTION_PATTERNS.some((p) => p.test(text2));
|
|
451347
452080
|
}
|
|
451348
452081
|
return false;
|
|
451349
452082
|
}
|
|
@@ -451508,13 +452241,13 @@ function useCopyOnSelect(selection, isActive, onCopied) {
|
|
|
451508
452241
|
const enabled = getGlobalConfig().copyOnSelect ?? true;
|
|
451509
452242
|
if (!enabled)
|
|
451510
452243
|
return;
|
|
451511
|
-
const
|
|
451512
|
-
if (!
|
|
452244
|
+
const text2 = selection.copySelectionNoClear();
|
|
452245
|
+
if (!text2 || !text2.trim()) {
|
|
451513
452246
|
copiedRef.current = true;
|
|
451514
452247
|
return;
|
|
451515
452248
|
}
|
|
451516
452249
|
copiedRef.current = true;
|
|
451517
|
-
onCopiedRef.current?.(
|
|
452250
|
+
onCopiedRef.current?.(text2);
|
|
451518
452251
|
});
|
|
451519
452252
|
return unsubscribe;
|
|
451520
452253
|
}, [isActive, selection]);
|
|
@@ -451668,9 +452401,9 @@ function ScrollKeybindingHandler({
|
|
|
451668
452401
|
addNotification
|
|
451669
452402
|
} = useNotifications();
|
|
451670
452403
|
const wheelAccel = import_react306.useRef(null);
|
|
451671
|
-
function showCopiedToast(
|
|
452404
|
+
function showCopiedToast(text2) {
|
|
451672
452405
|
const path21 = getClipboardPath();
|
|
451673
|
-
const n3 =
|
|
452406
|
+
const n3 = text2.length;
|
|
451674
452407
|
let msg;
|
|
451675
452408
|
switch (path21) {
|
|
451676
452409
|
case "native":
|
|
@@ -452216,8 +452949,8 @@ var exports_REPL = {};
|
|
|
452216
452949
|
__export(exports_REPL, {
|
|
452217
452950
|
REPL: () => REPL
|
|
452218
452951
|
});
|
|
452219
|
-
import { dirname as dirname65, join as
|
|
452220
|
-
import { tmpdir as
|
|
452952
|
+
import { dirname as dirname65, join as join158 } from "path";
|
|
452953
|
+
import { tmpdir as tmpdir11 } from "os";
|
|
452221
452954
|
import { writeFile as writeFile51 } from "fs/promises";
|
|
452222
452955
|
import { randomUUID as randomUUID50 } from "crypto";
|
|
452223
452956
|
function TranscriptModeFooter(t0) {
|
|
@@ -453704,10 +454437,10 @@ Error: sandbox required but unavailable: ${reason}
|
|
|
453704
454437
|
maybeMarkProjectOnboardingComplete();
|
|
453705
454438
|
if (!titleDisabled && !sessionTitle && !agentTitle && !haikuTitleAttemptedRef.current) {
|
|
453706
454439
|
const firstUserMessage = newMessages.find((m) => m.type === "user" && !m.isMeta);
|
|
453707
|
-
const
|
|
453708
|
-
if (
|
|
454440
|
+
const text2 = firstUserMessage?.type === "user" ? getContentText(firstUserMessage.message.content) : null;
|
|
454441
|
+
if (text2 && !text2.startsWith(`<${LOCAL_COMMAND_STDOUT_TAG}>`) && !text2.startsWith(`<${COMMAND_MESSAGE_TAG}>`) && !text2.startsWith(`<${COMMAND_NAME_TAG}>`) && !text2.startsWith(`<${BASH_INPUT_TAG}>`)) {
|
|
453709
454442
|
haikuTitleAttemptedRef.current = true;
|
|
453710
|
-
generateSessionTitle(
|
|
454443
|
+
generateSessionTitle(text2, new AbortController().signal).then((title) => {
|
|
453711
454444
|
if (title)
|
|
453712
454445
|
setHaikuTitle(title);
|
|
453713
454446
|
else
|
|
@@ -454397,7 +455130,7 @@ Error: sandbox required but unavailable: ${reason}
|
|
|
454397
455130
|
return messages.findIndex((m) => m.uuid.slice(0, 24) === prefix);
|
|
454398
455131
|
};
|
|
454399
455132
|
const messageActionCaps = {
|
|
454400
|
-
copy: (
|
|
455133
|
+
copy: (text2) => void setClipboard(text2).then((raw) => {
|
|
454401
455134
|
if (raw)
|
|
454402
455135
|
process.stdout.write(raw);
|
|
454403
455136
|
addNotification({
|
|
@@ -454794,9 +455527,9 @@ Note: ctrl + z now suspends Theus, ctrl + _ undoes input.
|
|
|
454794
455527
|
try {
|
|
454795
455528
|
const w = Math.max(80, (process.stdout.columns ?? 80) - 6);
|
|
454796
455529
|
const raw = await renderMessagesToPlainText(deferredMessages, tools, w);
|
|
454797
|
-
const
|
|
454798
|
-
const path21 =
|
|
454799
|
-
await writeFile51(path21,
|
|
455530
|
+
const text2 = raw.replace(/[ \t]+$/gm, "");
|
|
455531
|
+
const path21 = join158(tmpdir11(), `cc-transcript-${Date.now()}.txt`);
|
|
455532
|
+
await writeFile51(path21, text2);
|
|
454800
455533
|
const opened = openFileInExternalEditor(path21);
|
|
454801
455534
|
setStatus(opened ? `opening ${path21}` : `wrote ${path21} \xB7 no $VISUAL/$EDITOR set`);
|
|
454802
455535
|
} catch (e) {
|
|
@@ -456623,12 +457356,12 @@ function PreflightStep(t0) {
|
|
|
456623
457356
|
let t2;
|
|
456624
457357
|
if ($2[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
456625
457358
|
t1 = () => {
|
|
456626
|
-
const
|
|
457359
|
+
const run3 = async function run() {
|
|
456627
457360
|
const checkResult = await checkEndpoints();
|
|
456628
457361
|
setResult(checkResult);
|
|
456629
457362
|
setIsChecking(false);
|
|
456630
457363
|
};
|
|
456631
|
-
|
|
457364
|
+
run3();
|
|
456632
457365
|
};
|
|
456633
457366
|
t2 = [];
|
|
456634
457367
|
$2[0] = t1;
|
|
@@ -457311,7 +458044,7 @@ function Onboarding({
|
|
|
457311
458044
|
flexDirection: "column",
|
|
457312
458045
|
children: [
|
|
457313
458046
|
/* @__PURE__ */ jsx_runtime457.jsx(TheusBanner, {
|
|
457314
|
-
version: { VERSION: "0.1.
|
|
458047
|
+
version: { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
457315
458048
|
}),
|
|
457316
458049
|
/* @__PURE__ */ jsx_runtime457.jsxs(ThemedBox_default, {
|
|
457317
458050
|
flexDirection: "column",
|
|
@@ -457527,7 +458260,7 @@ var exports_TrustDialog = {};
|
|
|
457527
458260
|
__export(exports_TrustDialog, {
|
|
457528
458261
|
TrustDialog: () => TrustDialog
|
|
457529
458262
|
});
|
|
457530
|
-
import { homedir as
|
|
458263
|
+
import { homedir as homedir43 } from "os";
|
|
457531
458264
|
function TrustDialog(t0) {
|
|
457532
458265
|
const $2 = c3(33);
|
|
457533
458266
|
const {
|
|
@@ -457638,7 +458371,7 @@ function TrustDialog(t0) {
|
|
|
457638
458371
|
let t13;
|
|
457639
458372
|
if ($2[13] !== hasAnyBashExecution) {
|
|
457640
458373
|
t12 = () => {
|
|
457641
|
-
const isHomeDir =
|
|
458374
|
+
const isHomeDir = homedir43() === getCwd();
|
|
457642
458375
|
logEvent("tengu_trust_dialog_shown", {
|
|
457643
458376
|
isHomeDir,
|
|
457644
458377
|
hasMcpServers,
|
|
@@ -457667,7 +458400,7 @@ function TrustDialog(t0) {
|
|
|
457667
458400
|
gracefulShutdownSync(1);
|
|
457668
458401
|
return;
|
|
457669
458402
|
}
|
|
457670
|
-
const isHomeDir_0 =
|
|
458403
|
+
const isHomeDir_0 = homedir43() === getCwd();
|
|
457671
458404
|
logEvent("tengu_trust_dialog_accept", {
|
|
457672
458405
|
isHomeDir: isHomeDir_0,
|
|
457673
458406
|
hasMcpServers,
|
|
@@ -458182,7 +458915,7 @@ function completeOnboarding() {
|
|
|
458182
458915
|
saveGlobalConfig((current) => ({
|
|
458183
458916
|
...current,
|
|
458184
458917
|
hasCompletedOnboarding: true,
|
|
458185
|
-
lastOnboardingVersion: { VERSION: "0.1.
|
|
458918
|
+
lastOnboardingVersion: { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
458186
458919
|
}));
|
|
458187
458920
|
}
|
|
458188
458921
|
function showDialog(root2, renderer) {
|
|
@@ -461323,7 +462056,7 @@ function extractUserMessages(messages) {
|
|
|
461323
462056
|
return content;
|
|
461324
462057
|
return content.filter((b) => b.type === "text").map((b) => b.text).join(`
|
|
461325
462058
|
`);
|
|
461326
|
-
}).filter((
|
|
462059
|
+
}).filter((text2) => text2.trim().length > 0);
|
|
461327
462060
|
}
|
|
461328
462061
|
function registerSkillifySkill() {
|
|
461329
462062
|
if (process.env.USER_TYPE !== "ant") {
|
|
@@ -462855,12 +463588,12 @@ var init_createDirectConnectSession = __esm(() => {
|
|
|
462855
463588
|
});
|
|
462856
463589
|
|
|
462857
463590
|
// utils/errorLogSink.ts
|
|
462858
|
-
import { dirname as dirname67, join as
|
|
463591
|
+
import { dirname as dirname67, join as join159 } from "path";
|
|
462859
463592
|
function getErrorsPath() {
|
|
462860
|
-
return
|
|
463593
|
+
return join159(CACHE_PATHS.errors(), DATE + ".jsonl");
|
|
462861
463594
|
}
|
|
462862
463595
|
function getMCPLogsPath(serverName) {
|
|
462863
|
-
return
|
|
463596
|
+
return join159(CACHE_PATHS.mcpLogs(serverName), DATE + ".jsonl");
|
|
462864
463597
|
}
|
|
462865
463598
|
function createJsonlWriter(options2) {
|
|
462866
463599
|
const writer = createBufferedWriter(options2);
|
|
@@ -462904,7 +463637,7 @@ function appendToLog(path21, message) {
|
|
|
462904
463637
|
cwd: getFsImplementation().cwd(),
|
|
462905
463638
|
userType: process.env.USER_TYPE,
|
|
462906
463639
|
sessionId: getSessionId(),
|
|
462907
|
-
version: { VERSION: "0.1.
|
|
463640
|
+
version: { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
462908
463641
|
};
|
|
462909
463642
|
getLogWriter(path21).write(messageWithTimestamp);
|
|
462910
463643
|
}
|
|
@@ -463003,6 +463736,137 @@ var init_sinks = __esm(() => {
|
|
|
463003
463736
|
init_errorLogSink();
|
|
463004
463737
|
});
|
|
463005
463738
|
|
|
463739
|
+
// services/mcpComputerUse/setup.ts
|
|
463740
|
+
var exports_setup = {};
|
|
463741
|
+
__export(exports_setup, {
|
|
463742
|
+
setupComputerUse: () => setupComputerUse,
|
|
463743
|
+
COMPUTER_USE_SYSTEM_HINT: () => COMPUTER_USE_SYSTEM_HINT
|
|
463744
|
+
});
|
|
463745
|
+
import { join as join160 } from "path";
|
|
463746
|
+
import { fileURLToPath as fileURLToPath8 } from "url";
|
|
463747
|
+
function setupComputerUse() {
|
|
463748
|
+
const allowedTools = COMPUTER_USE_TOOL_NAMES.map((name) => buildMcpToolName(COMPUTER_USE_SERVER_NAME, name));
|
|
463749
|
+
const bundled = isInBundledMode();
|
|
463750
|
+
const command7 = bundled ? process.execPath : join160(fileURLToPath8(import.meta.url), "..", "..", "..", "bin", "theus");
|
|
463751
|
+
const args = ["--theus-computer-use-mcp"];
|
|
463752
|
+
return {
|
|
463753
|
+
mcpConfig: {
|
|
463754
|
+
[COMPUTER_USE_SERVER_NAME]: {
|
|
463755
|
+
type: "stdio",
|
|
463756
|
+
command: command7,
|
|
463757
|
+
args,
|
|
463758
|
+
scope: "dynamic"
|
|
463759
|
+
}
|
|
463760
|
+
},
|
|
463761
|
+
allowedTools,
|
|
463762
|
+
systemPrompt: COMPUTER_USE_SYSTEM_HINT
|
|
463763
|
+
};
|
|
463764
|
+
}
|
|
463765
|
+
var COMPUTER_USE_SYSTEM_HINT;
|
|
463766
|
+
var init_setup3 = __esm(() => {
|
|
463767
|
+
init_mcpStringUtils();
|
|
463768
|
+
init_common3();
|
|
463769
|
+
COMPUTER_USE_SYSTEM_HINT = "Tienes control del escritorio (computer-use) v\xEDa las tools " + "`mcp__theus-computer-use__*`. Para operar la pantalla: toma primero un " + "`screenshot`, razona sobre lo que ves, y da las coordenadas de click/movimiento " + "en P\xCDXELES dentro de esa imagen. Tras cada acci\xF3n, vuelve a capturar para " + "verificar. Si una tool reporta falta de permisos macOS, dile al usuario que " + "otorgue Grabaci\xF3n de pantalla y Accesibilidad a su terminal.";
|
|
463770
|
+
});
|
|
463771
|
+
|
|
463772
|
+
// services/mcpNaupa/common.ts
|
|
463773
|
+
var exports_common2 = {};
|
|
463774
|
+
__export(exports_common2, {
|
|
463775
|
+
resolveNaupaBinary: () => resolveNaupaBinary,
|
|
463776
|
+
isNaupaEnabled: () => isNaupaEnabled,
|
|
463777
|
+
NAUPA_SERVER_NAME: () => NAUPA_SERVER_NAME,
|
|
463778
|
+
NAUPA_READONLY_TOOLS: () => NAUPA_READONLY_TOOLS
|
|
463779
|
+
});
|
|
463780
|
+
import { existsSync as existsSync17 } from "fs";
|
|
463781
|
+
import { homedir as homedir44 } from "os";
|
|
463782
|
+
import { join as join161 } from "path";
|
|
463783
|
+
function resolveNaupaBinary() {
|
|
463784
|
+
const fromEnv = (process.env.THEUS_NAUPA_BIN ?? "").trim();
|
|
463785
|
+
if (fromEnv) {
|
|
463786
|
+
return existsSync17(fromEnv) ? fromEnv : null;
|
|
463787
|
+
}
|
|
463788
|
+
const candidates = [
|
|
463789
|
+
join161(homedir44(), ".local", "bin", "naupa"),
|
|
463790
|
+
"/opt/homebrew/bin/naupa",
|
|
463791
|
+
"/usr/local/bin/naupa"
|
|
463792
|
+
];
|
|
463793
|
+
for (const candidate of candidates) {
|
|
463794
|
+
if (existsSync17(candidate))
|
|
463795
|
+
return candidate;
|
|
463796
|
+
}
|
|
463797
|
+
if (typeof Bun !== "undefined" && typeof Bun.which === "function") {
|
|
463798
|
+
const fromPath = Bun.which("naupa");
|
|
463799
|
+
if (fromPath)
|
|
463800
|
+
return fromPath;
|
|
463801
|
+
}
|
|
463802
|
+
return null;
|
|
463803
|
+
}
|
|
463804
|
+
function isNaupaEnabled() {
|
|
463805
|
+
if (process.env.THEUS_NO_NAUPA === "1")
|
|
463806
|
+
return false;
|
|
463807
|
+
return resolveNaupaBinary() !== null;
|
|
463808
|
+
}
|
|
463809
|
+
var NAUPA_SERVER_NAME = "theus-naupa", NAUPA_READONLY_TOOLS;
|
|
463810
|
+
var init_common4 = __esm(() => {
|
|
463811
|
+
NAUPA_READONLY_TOOLS = [
|
|
463812
|
+
"search_graph",
|
|
463813
|
+
"trace_path",
|
|
463814
|
+
"query_graph",
|
|
463815
|
+
"get_graph_schema",
|
|
463816
|
+
"get_architecture",
|
|
463817
|
+
"get_code_snippet",
|
|
463818
|
+
"search_code",
|
|
463819
|
+
"detect_changes",
|
|
463820
|
+
"index_status",
|
|
463821
|
+
"list_projects"
|
|
463822
|
+
];
|
|
463823
|
+
});
|
|
463824
|
+
|
|
463825
|
+
// services/mcpNaupa/setup.ts
|
|
463826
|
+
var exports_setup2 = {};
|
|
463827
|
+
__export(exports_setup2, {
|
|
463828
|
+
setupNaupa: () => setupNaupa,
|
|
463829
|
+
NAUPA_SYSTEM_HINT: () => NAUPA_SYSTEM_HINT
|
|
463830
|
+
});
|
|
463831
|
+
import { execFile as execFile6 } from "child_process";
|
|
463832
|
+
import { homedir as homedir45 } from "os";
|
|
463833
|
+
import { join as join162 } from "path";
|
|
463834
|
+
function ensureNaupaAutoIndex(command7, cacheDir) {
|
|
463835
|
+
try {
|
|
463836
|
+
execFile6(command7, ["config", "set", "auto_index", "true"], { timeout: 3000, env: { ...process.env, CBM_CACHE_DIR: cacheDir } }, () => {});
|
|
463837
|
+
} catch {}
|
|
463838
|
+
}
|
|
463839
|
+
function setupNaupa() {
|
|
463840
|
+
const command7 = resolveNaupaBinary();
|
|
463841
|
+
if (!command7) {
|
|
463842
|
+
return { mcpConfig: {}, allowedTools: [], systemPrompt: "" };
|
|
463843
|
+
}
|
|
463844
|
+
const cacheDir = join162(homedir45(), ".theus", "naupa");
|
|
463845
|
+
ensureNaupaAutoIndex(command7, cacheDir);
|
|
463846
|
+
const allowedTools = NAUPA_READONLY_TOOLS.map((name) => buildMcpToolName(NAUPA_SERVER_NAME, name));
|
|
463847
|
+
return {
|
|
463848
|
+
mcpConfig: {
|
|
463849
|
+
[NAUPA_SERVER_NAME]: {
|
|
463850
|
+
type: "stdio",
|
|
463851
|
+
command: command7,
|
|
463852
|
+
args: [],
|
|
463853
|
+
scope: "dynamic",
|
|
463854
|
+
env: {
|
|
463855
|
+
CBM_CACHE_DIR: cacheDir
|
|
463856
|
+
}
|
|
463857
|
+
}
|
|
463858
|
+
},
|
|
463859
|
+
allowedTools,
|
|
463860
|
+
systemPrompt: NAUPA_SYSTEM_HINT
|
|
463861
|
+
};
|
|
463862
|
+
}
|
|
463863
|
+
var NAUPA_SYSTEM_HINT;
|
|
463864
|
+
var init_setup4 = __esm(() => {
|
|
463865
|
+
init_mcpStringUtils();
|
|
463866
|
+
init_common4();
|
|
463867
|
+
NAUPA_SYSTEM_HINT = "Tienes acceso al grafo de c\xF3digo del proyecto (\xD1aupa) v\xEDa las tools " + "`mcp__theus-naupa__*`. Para preguntas ESTRUCTURALES \u2014 qui\xE9n llama a X, " + "c\xF3mo est\xE1 organizada la arquitectura, qu\xE9 impacto tiene cambiar algo \u2014 usa " + "primero `search_graph`, `trace_path` o `query_graph` ANTES de recurrir a " + "grep/read: el grafo responde en una consulta lo que costar\xEDa muchas " + "lecturas. `get_architecture` da la vista de m\xF3dulos, `get_code_snippet` " + "trae el c\xF3digo exacto de un nodo, y `detect_changes`/`index_status` dicen " + "si el \xEDndice est\xE1 al d\xEDa. El proyecto se indexa SOLO al abrir la sesi\xF3n " + "(auto-index + watcher de cambios); si `index_status` reporta que a\xFAn no " + "hay \xEDndice (repo enorme o reci\xE9n abierto), usa `index_repository {repo_path}`.";
|
|
463868
|
+
});
|
|
463869
|
+
|
|
463006
463870
|
// services/SessionMemory/sessionMemory.ts
|
|
463007
463871
|
import { writeFile as writeFile52 } from "fs/promises";
|
|
463008
463872
|
function isSessionMemoryGateEnabled() {
|
|
@@ -463202,8 +464066,8 @@ var init_sessionMemory = __esm(() => {
|
|
|
463202
464066
|
|
|
463203
464067
|
// utils/iTermBackup.ts
|
|
463204
464068
|
import { copyFile as copyFile10, stat as stat48 } from "fs/promises";
|
|
463205
|
-
import { homedir as
|
|
463206
|
-
import { join as
|
|
464069
|
+
import { homedir as homedir46 } from "os";
|
|
464070
|
+
import { join as join163 } from "path";
|
|
463207
464071
|
function markITerm2SetupComplete() {
|
|
463208
464072
|
saveGlobalConfig((current) => ({
|
|
463209
464073
|
...current,
|
|
@@ -463218,7 +464082,7 @@ function getIterm2RecoveryInfo() {
|
|
|
463218
464082
|
};
|
|
463219
464083
|
}
|
|
463220
464084
|
function getITerm2PlistPath() {
|
|
463221
|
-
return
|
|
464085
|
+
return join163(homedir46(), "Library", "Preferences", "com.googlecode.iterm2.plist");
|
|
463222
464086
|
}
|
|
463223
464087
|
async function checkAndRestoreITerm2Backup() {
|
|
463224
464088
|
const { inProgress, backupPath } = getIterm2RecoveryInfo();
|
|
@@ -463290,8 +464154,8 @@ var init_logoV2Utils = __esm(() => {
|
|
|
463290
464154
|
});
|
|
463291
464155
|
|
|
463292
464156
|
// setup.ts
|
|
463293
|
-
var
|
|
463294
|
-
__export(
|
|
464157
|
+
var exports_setup3 = {};
|
|
464158
|
+
__export(exports_setup3, {
|
|
463295
464159
|
setup: () => setup
|
|
463296
464160
|
});
|
|
463297
464161
|
async function setup(cwd2, permissionMode, allowDangerouslySkipPermissions, worktreeEnabled, worktreeName, tmuxEnabled, customSessionId, worktreePRNumber, messagingSocketPath) {
|
|
@@ -463472,7 +464336,7 @@ To attach: ${source_default.bold(`tmux attach -t ${tmuxSessionName}`)}`));
|
|
|
463472
464336
|
});
|
|
463473
464337
|
}
|
|
463474
464338
|
}
|
|
463475
|
-
var
|
|
464339
|
+
var init_setup5 = __esm(() => {
|
|
463476
464340
|
init_source();
|
|
463477
464341
|
init_analytics();
|
|
463478
464342
|
init_cwd2();
|
|
@@ -465676,8 +466540,8 @@ function installStreamJsonStdoutGuard() {
|
|
|
465676
466540
|
installed = true;
|
|
465677
466541
|
originalWrite = process.stdout.write.bind(process.stdout);
|
|
465678
466542
|
process.stdout.write = function(chunk2, encodingOrCb, cb) {
|
|
465679
|
-
const
|
|
465680
|
-
buffer +=
|
|
466543
|
+
const text2 = typeof chunk2 === "string" ? chunk2 : Buffer.from(chunk2).toString("utf-8");
|
|
466544
|
+
buffer += text2;
|
|
465681
466545
|
let newlineIdx;
|
|
465682
466546
|
let wrote = true;
|
|
465683
466547
|
while ((newlineIdx = buffer.indexOf(`
|
|
@@ -466684,7 +467548,7 @@ var init_idleTimeout = __esm(() => {
|
|
|
466684
467548
|
// bridge/inboundAttachments.ts
|
|
466685
467549
|
import { randomUUID as randomUUID53 } from "crypto";
|
|
466686
467550
|
import { mkdir as mkdir49, writeFile as writeFile53 } from "fs/promises";
|
|
466687
|
-
import { basename as basename57, join as
|
|
467551
|
+
import { basename as basename57, join as join164 } from "path";
|
|
466688
467552
|
function debug(msg) {
|
|
466689
467553
|
logForDebugging(`[bridge:inbound-attach] ${msg}`);
|
|
466690
467554
|
}
|
|
@@ -466700,7 +467564,7 @@ function sanitizeFileName(name) {
|
|
|
466700
467564
|
return base2 || "attachment";
|
|
466701
467565
|
}
|
|
466702
467566
|
function uploadsDir() {
|
|
466703
|
-
return
|
|
467567
|
+
return join164(getTheusConfigHomeDir(), "uploads", getSessionId());
|
|
466704
467568
|
}
|
|
466705
467569
|
async function resolveOne(att) {
|
|
466706
467570
|
const token = getBridgeAccessToken();
|
|
@@ -466729,7 +467593,7 @@ async function resolveOne(att) {
|
|
|
466729
467593
|
const safeName = sanitizeFileName(att.file_name);
|
|
466730
467594
|
const prefix = (att.file_uuid.slice(0, 8) || randomUUID53().slice(0, 8)).replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
466731
467595
|
const dir = uploadsDir();
|
|
466732
|
-
const outPath =
|
|
467596
|
+
const outPath = join164(dir, `${prefix}-${safeName}`);
|
|
466733
467597
|
try {
|
|
466734
467598
|
await mkdir49(dir, { recursive: true });
|
|
466735
467599
|
await writeFile53(outPath, data);
|
|
@@ -466829,7 +467693,7 @@ var init_sessionUrl = __esm(() => {
|
|
|
466829
467693
|
|
|
466830
467694
|
// utils/plugins/zipCacheAdapters.ts
|
|
466831
467695
|
import { readFile as readFile54 } from "fs/promises";
|
|
466832
|
-
import { join as
|
|
467696
|
+
import { join as join165 } from "path";
|
|
466833
467697
|
async function readZipCacheKnownMarketplaces() {
|
|
466834
467698
|
try {
|
|
466835
467699
|
const content = await readFile54(getZipCacheKnownMarketplacesPath(), "utf-8");
|
|
@@ -466854,13 +467718,13 @@ async function saveMarketplaceJsonToZipCache(marketplaceName, installLocation) {
|
|
|
466854
467718
|
const content = await readMarketplaceJsonContent(installLocation);
|
|
466855
467719
|
if (content !== null) {
|
|
466856
467720
|
const relPath = getMarketplaceJsonRelativePath(marketplaceName);
|
|
466857
|
-
await atomicWriteToZipCache(
|
|
467721
|
+
await atomicWriteToZipCache(join165(zipCachePath, relPath), content);
|
|
466858
467722
|
}
|
|
466859
467723
|
}
|
|
466860
467724
|
async function readMarketplaceJsonContent(dir) {
|
|
466861
467725
|
const candidates = [
|
|
466862
|
-
|
|
466863
|
-
|
|
467726
|
+
join165(dir, ".theus-plugin", "marketplace.json"),
|
|
467727
|
+
join165(dir, "marketplace.json"),
|
|
466864
467728
|
dir
|
|
466865
467729
|
];
|
|
466866
467730
|
for (const candidate of candidates) {
|
|
@@ -466990,8 +467854,8 @@ async function getEnvLessBridgeConfig() {
|
|
|
466990
467854
|
}
|
|
466991
467855
|
async function checkEnvLessBridgeMinVersion() {
|
|
466992
467856
|
const cfg = await getEnvLessBridgeConfig();
|
|
466993
|
-
if (cfg.min_version && lt({ VERSION: "0.1.
|
|
466994
|
-
return `Your version of Theus (${{ VERSION: "0.1.
|
|
467857
|
+
if (cfg.min_version && lt({ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
|
|
467858
|
+
return `Your version of Theus (${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.
|
|
466995
467859
|
Version ${cfg.min_version} or higher is required. Run \`theus update\` to update.`;
|
|
466996
467860
|
}
|
|
466997
467861
|
return null;
|
|
@@ -467319,9 +468183,9 @@ __export(exports_bridgePointer, {
|
|
|
467319
468183
|
BRIDGE_POINTER_TTL_MS: () => BRIDGE_POINTER_TTL_MS
|
|
467320
468184
|
});
|
|
467321
468185
|
import { mkdir as mkdir50, readFile as readFile55, stat as stat49, unlink as unlink25, writeFile as writeFile54 } from "fs/promises";
|
|
467322
|
-
import { dirname as dirname68, join as
|
|
468186
|
+
import { dirname as dirname68, join as join166 } from "path";
|
|
467323
468187
|
function getBridgePointerPath(dir) {
|
|
467324
|
-
return
|
|
468188
|
+
return join166(getProjectsDir(), sanitizePath2(dir), "bridge-pointer.json");
|
|
467325
468189
|
}
|
|
467326
468190
|
async function writeBridgePointer(dir, pointer) {
|
|
467327
468191
|
const path21 = getBridgePointerPath(dir);
|
|
@@ -467465,7 +468329,7 @@ async function initBridgeCore(params) {
|
|
|
467465
468329
|
const rawApi = createBridgeApiClient({
|
|
467466
468330
|
baseUrl,
|
|
467467
468331
|
getAccessToken,
|
|
467468
|
-
runnerVersion: { VERSION: "0.1.
|
|
468332
|
+
runnerVersion: { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
467469
468333
|
onDebug: logForDebugging,
|
|
467470
468334
|
onAuth401,
|
|
467471
468335
|
getTrustedDeviceToken
|
|
@@ -468122,8 +468986,8 @@ async function initBridgeCore(params) {
|
|
|
468122
468986
|
return;
|
|
468123
468987
|
if (!userMessageCallbackDone) {
|
|
468124
468988
|
for (const m of filtered) {
|
|
468125
|
-
const
|
|
468126
|
-
if (
|
|
468989
|
+
const text2 = extractTitleText(m);
|
|
468990
|
+
if (text2 !== undefined && onUserMessage?.(text2, currentSessionId)) {
|
|
468127
468991
|
userMessageCallbackDone = true;
|
|
468128
468992
|
break;
|
|
468129
468993
|
}
|
|
@@ -468910,8 +469774,8 @@ async function initEnvLessBridgeCore(params) {
|
|
|
468910
469774
|
return;
|
|
468911
469775
|
if (!userMessageCallbackDone) {
|
|
468912
469776
|
for (const m of filtered) {
|
|
468913
|
-
const
|
|
468914
|
-
if (
|
|
469777
|
+
const text2 = extractTitleText(m);
|
|
469778
|
+
if (text2 !== undefined && onUserMessage?.(text2, sessionId)) {
|
|
468915
469779
|
userMessageCallbackDone = true;
|
|
468916
469780
|
break;
|
|
468917
469781
|
}
|
|
@@ -469172,7 +470036,7 @@ async function initReplBridge(options2) {
|
|
|
469172
470036
|
}
|
|
469173
470037
|
});
|
|
469174
470038
|
};
|
|
469175
|
-
const onUserMessage = (
|
|
470039
|
+
const onUserMessage = (text2, bridgeSessionId) => {
|
|
469176
470040
|
if (hasExplicitTitle || getCurrentSessionTitle(getSessionId())) {
|
|
469177
470041
|
return true;
|
|
469178
470042
|
}
|
|
@@ -469182,13 +470046,13 @@ async function initReplBridge(options2) {
|
|
|
469182
470046
|
lastBridgeSessionId = bridgeSessionId;
|
|
469183
470047
|
userMessageCount++;
|
|
469184
470048
|
if (userMessageCount === 1 && !hasTitle) {
|
|
469185
|
-
const placeholder = deriveTitle(
|
|
470049
|
+
const placeholder = deriveTitle(text2);
|
|
469186
470050
|
if (placeholder)
|
|
469187
470051
|
patch2(placeholder, bridgeSessionId, userMessageCount);
|
|
469188
|
-
generateAndPatch(
|
|
470052
|
+
generateAndPatch(text2, bridgeSessionId);
|
|
469189
470053
|
} else if (userMessageCount === 3) {
|
|
469190
470054
|
const msgs = getMessages?.();
|
|
469191
|
-
const input = msgs ? extractConversationText(getMessagesAfterCompactBoundary(msgs)) :
|
|
470055
|
+
const input = msgs ? extractConversationText(getMessagesAfterCompactBoundary(msgs)) : text2;
|
|
469192
470056
|
generateAndPatch(input, bridgeSessionId);
|
|
469193
470057
|
}
|
|
469194
470058
|
return userMessageCount >= 3;
|
|
@@ -470052,7 +470916,7 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial
|
|
|
470052
470916
|
abortController.abort("interrupt");
|
|
470053
470917
|
}
|
|
470054
470918
|
});
|
|
470055
|
-
const
|
|
470919
|
+
const run3 = async () => {
|
|
470056
470920
|
if (running2) {
|
|
470057
470921
|
return;
|
|
470058
470922
|
}
|
|
@@ -470400,7 +471264,7 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial
|
|
|
470400
471264
|
}
|
|
470401
471265
|
if (false) {}
|
|
470402
471266
|
if (peek2(isMainThread) !== undefined) {
|
|
470403
|
-
|
|
471267
|
+
run3();
|
|
470404
471268
|
return;
|
|
470405
471269
|
}
|
|
470406
471270
|
{
|
|
@@ -470461,7 +471325,7 @@ ${m.text}
|
|
|
470461
471325
|
value: formatted,
|
|
470462
471326
|
uuid: randomUUID56()
|
|
470463
471327
|
});
|
|
470464
|
-
|
|
471328
|
+
run3();
|
|
470465
471329
|
return;
|
|
470466
471330
|
}
|
|
470467
471331
|
if (inputClosed && !shutdownPromptInjected) {
|
|
@@ -470472,7 +471336,7 @@ ${m.text}
|
|
|
470472
471336
|
value: SHUTDOWN_TEAM_PROMPT,
|
|
470473
471337
|
uuid: randomUUID56()
|
|
470474
471338
|
});
|
|
470475
|
-
|
|
471339
|
+
run3();
|
|
470476
471340
|
return;
|
|
470477
471341
|
}
|
|
470478
471342
|
await sleep(POLL_INTERVAL_MS4);
|
|
@@ -470496,7 +471360,7 @@ ${m.text}
|
|
|
470496
471360
|
value: SHUTDOWN_TEAM_PROMPT,
|
|
470497
471361
|
uuid: randomUUID56()
|
|
470498
471362
|
});
|
|
470499
|
-
|
|
471363
|
+
run3();
|
|
470500
471364
|
} else {
|
|
470501
471365
|
if (suggestionState.inflightPromise) {
|
|
470502
471366
|
await Promise.race([suggestionState.inflightPromise, sleep(5000)]);
|
|
@@ -470526,7 +471390,7 @@ ${m.text}
|
|
|
470526
471390
|
isMeta: true,
|
|
470527
471391
|
workload: WORKLOAD_CRON
|
|
470528
471392
|
});
|
|
470529
|
-
|
|
471393
|
+
run3();
|
|
470530
471394
|
},
|
|
470531
471395
|
isLoading: () => running2 || inputClosed,
|
|
470532
471396
|
getJitterConfig: cronJitterConfigModule?.getCronJitterConfig,
|
|
@@ -470561,7 +471425,7 @@ ${m.text}
|
|
|
470561
471425
|
setAppState,
|
|
470562
471426
|
handledToolUseIds: handledOrphanedToolUseIds,
|
|
470563
471427
|
onEnqueued: () => {
|
|
470564
|
-
|
|
471428
|
+
run3();
|
|
470565
471429
|
}
|
|
470566
471430
|
});
|
|
470567
471431
|
});
|
|
@@ -470622,7 +471486,7 @@ ${m.text}
|
|
|
470622
471486
|
}
|
|
470623
471487
|
initialized5 = true;
|
|
470624
471488
|
if (hasCommandsInQueue()) {
|
|
470625
|
-
|
|
471489
|
+
run3();
|
|
470626
471490
|
}
|
|
470627
471491
|
} else if (message.request.subtype === "set_permission_mode") {
|
|
470628
471492
|
const m = message.request;
|
|
@@ -471228,7 +472092,7 @@ ${m.text}
|
|
|
471228
472092
|
uuid: uuid3,
|
|
471229
472093
|
skipSlashCommands: true
|
|
471230
472094
|
});
|
|
471231
|
-
|
|
472095
|
+
run3();
|
|
471232
472096
|
},
|
|
471233
472097
|
onPermissionResponse(response) {
|
|
471234
472098
|
structuredIO.injectControlResponse(response);
|
|
@@ -471355,7 +472219,7 @@ ${m.text}
|
|
|
471355
472219
|
priority: message.priority
|
|
471356
472220
|
});
|
|
471357
472221
|
if (false) {}
|
|
471358
|
-
|
|
472222
|
+
run3();
|
|
471359
472223
|
}
|
|
471360
472224
|
inputClosed = true;
|
|
471361
472225
|
cronScheduler?.stop();
|
|
@@ -471746,7 +472610,7 @@ function reregisterChannelHandlerAfterReconnect(connection) {
|
|
|
471746
472610
|
}
|
|
471747
472611
|
function emitLoadError(message, outputFormat) {
|
|
471748
472612
|
if (outputFormat === "stream-json") {
|
|
471749
|
-
const
|
|
472613
|
+
const errorResult2 = {
|
|
471750
472614
|
type: "result",
|
|
471751
472615
|
subtype: "error_during_execution",
|
|
471752
472616
|
duration_ms: 0,
|
|
@@ -471762,7 +472626,7 @@ function emitLoadError(message, outputFormat) {
|
|
|
471762
472626
|
uuid: randomUUID56(),
|
|
471763
472627
|
errors: [message]
|
|
471764
472628
|
};
|
|
471765
|
-
process.stdout.write(jsonStringify(
|
|
472629
|
+
process.stdout.write(jsonStringify(errorResult2) + `
|
|
471766
472630
|
`);
|
|
471767
472631
|
} else {
|
|
471768
472632
|
process.stderr.write(message + `
|
|
@@ -472731,7 +473595,7 @@ async function startMCPServer(cwd3, debug2, verbose) {
|
|
|
472731
473595
|
setCwd(cwd3);
|
|
472732
473596
|
const server = new Server({
|
|
472733
473597
|
name: "theus/tengu",
|
|
472734
|
-
version: { VERSION: "0.1.
|
|
473598
|
+
version: { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
472735
473599
|
}, {
|
|
472736
473600
|
capabilities: {
|
|
472737
473601
|
tools: {}
|
|
@@ -472862,15 +473726,15 @@ __export(exports_theusDesktop, {
|
|
|
472862
473726
|
getTheusDesktopConfigPath: () => getTheusDesktopConfigPath
|
|
472863
473727
|
});
|
|
472864
473728
|
import { readdir as readdir32, readFile as readFile57, stat as stat51 } from "fs/promises";
|
|
472865
|
-
import { homedir as
|
|
472866
|
-
import { join as
|
|
473729
|
+
import { homedir as homedir47 } from "os";
|
|
473730
|
+
import { join as join167 } from "path";
|
|
472867
473731
|
async function getTheusDesktopConfigPath() {
|
|
472868
473732
|
const platform6 = getPlatform();
|
|
472869
473733
|
if (!SUPPORTED_PLATFORMS.includes(platform6)) {
|
|
472870
473734
|
throw new Error(`Unsupported platform: ${platform6} - Theus Desktop integration only works on macOS and WSL.`);
|
|
472871
473735
|
}
|
|
472872
473736
|
if (platform6 === "macos") {
|
|
472873
|
-
return
|
|
473737
|
+
return join167(homedir47(), "Library", "Application Support", "Theus", "theus_desktop_config.json");
|
|
472874
473738
|
}
|
|
472875
473739
|
const windowsHome = process.env.USERPROFILE ? process.env.USERPROFILE.replace(/\\/g, "/") : null;
|
|
472876
473740
|
if (windowsHome) {
|
|
@@ -472889,7 +473753,7 @@ async function getTheusDesktopConfigPath() {
|
|
|
472889
473753
|
if (user.name === "Public" || user.name === "Default" || user.name === "Default User" || user.name === "All Users") {
|
|
472890
473754
|
continue;
|
|
472891
473755
|
}
|
|
472892
|
-
const potentialConfigPath =
|
|
473756
|
+
const potentialConfigPath = join167(usersDir, user.name, "AppData", "Roaming", "Theus", "theus_desktop_config.json");
|
|
472893
473757
|
try {
|
|
472894
473758
|
await stat51(potentialConfigPath);
|
|
472895
473759
|
return potentialConfigPath;
|
|
@@ -472993,7 +473857,7 @@ async function mcpServeHandler({
|
|
|
472993
473857
|
try {
|
|
472994
473858
|
const {
|
|
472995
473859
|
setup: setup2
|
|
472996
|
-
} = await Promise.resolve().then(() => (
|
|
473860
|
+
} = await Promise.resolve().then(() => (init_setup5(), exports_setup3));
|
|
472997
473861
|
await setup2(providedCwd, "default", false, false, undefined, false);
|
|
472998
473862
|
const {
|
|
472999
473863
|
startMCPServer: startMCPServer2
|
|
@@ -473797,13 +474661,13 @@ var exports_install = {};
|
|
|
473797
474661
|
__export(exports_install, {
|
|
473798
474662
|
install: () => install
|
|
473799
474663
|
});
|
|
473800
|
-
import { homedir as
|
|
473801
|
-
import { join as
|
|
474664
|
+
import { homedir as homedir48 } from "os";
|
|
474665
|
+
import { join as join168 } from "path";
|
|
473802
474666
|
function getInstallationPath2() {
|
|
473803
474667
|
const isWindows2 = env3.platform === "win32";
|
|
473804
|
-
const homeDir =
|
|
474668
|
+
const homeDir = homedir48();
|
|
473805
474669
|
if (isWindows2) {
|
|
473806
|
-
const windowsPath =
|
|
474670
|
+
const windowsPath = join168(homeDir, ".local", "bin", "theus.exe");
|
|
473807
474671
|
return windowsPath.replace(/\//g, "\\");
|
|
473808
474672
|
}
|
|
473809
474673
|
return "~/.local/bin/theus";
|
|
@@ -473881,7 +474745,7 @@ function Install({
|
|
|
473881
474745
|
type: "checking"
|
|
473882
474746
|
});
|
|
473883
474747
|
import_react324.useEffect(() => {
|
|
473884
|
-
async function
|
|
474748
|
+
async function run3() {
|
|
473885
474749
|
try {
|
|
473886
474750
|
logForDebugging(`Install: Starting installation process (force=${force}, target=${target})`);
|
|
473887
474751
|
const channelOrVersion = target || getInitialSettings()?.autoUpdatesChannel || "latest";
|
|
@@ -473966,7 +474830,7 @@ function Install({
|
|
|
473966
474830
|
});
|
|
473967
474831
|
}
|
|
473968
474832
|
}
|
|
473969
|
-
|
|
474833
|
+
run3();
|
|
473970
474834
|
}, [force, target]);
|
|
473971
474835
|
import_react324.useEffect(() => {
|
|
473972
474836
|
if (state2.type === "success") {
|
|
@@ -474173,7 +475037,7 @@ async function setupTokenHandler(root2) {
|
|
|
474173
475037
|
gap: 1,
|
|
474174
475038
|
children: [
|
|
474175
475039
|
/* @__PURE__ */ jsx_runtime473.jsx(TheusBanner, {
|
|
474176
|
-
version: { VERSION: "0.1.
|
|
475040
|
+
version: { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
474177
475041
|
}),
|
|
474178
475042
|
showAuthWarning && /* @__PURE__ */ jsx_runtime473.jsxs(ThemedBox_default, {
|
|
474179
475043
|
flexDirection: "column",
|
|
@@ -474247,7 +475111,7 @@ async function doctorHandler(root2) {
|
|
|
474247
475111
|
async function installHandler(target, options2) {
|
|
474248
475112
|
const {
|
|
474249
475113
|
setup: setup2
|
|
474250
|
-
} = await Promise.resolve().then(() => (
|
|
475114
|
+
} = await Promise.resolve().then(() => (init_setup5(), exports_setup3));
|
|
474251
475115
|
await setup2(cwd4(), "default", false, false, undefined, false);
|
|
474252
475116
|
const {
|
|
474253
475117
|
install: install2
|
|
@@ -474343,7 +475207,7 @@ __export(exports_main2, {
|
|
|
474343
475207
|
startDeferredPrefetches: () => startDeferredPrefetches,
|
|
474344
475208
|
main: () => main
|
|
474345
475209
|
});
|
|
474346
|
-
import { readFileSync as
|
|
475210
|
+
import { readFileSync as readFileSync25 } from "fs";
|
|
474347
475211
|
import { resolve as resolve46 } from "path";
|
|
474348
475212
|
function logManagedSettings() {
|
|
474349
475213
|
try {
|
|
@@ -474499,7 +475363,7 @@ function loadSettingsFromFlag(settingsFile) {
|
|
|
474499
475363
|
resolvedPath: resolvedSettingsPath
|
|
474500
475364
|
} = safeResolvePath(getFsImplementation(), settingsFile);
|
|
474501
475365
|
try {
|
|
474502
|
-
|
|
475366
|
+
readFileSync25(resolvedSettingsPath, "utf8");
|
|
474503
475367
|
} catch (e) {
|
|
474504
475368
|
if (isENOENT(e)) {
|
|
474505
475369
|
process.stderr.write(source_default.red(`Error: Settings file not found: ${resolvedSettingsPath}
|
|
@@ -474626,7 +475490,7 @@ async function main() {
|
|
|
474626
475490
|
profileCheckpoint("main_client_type_determined");
|
|
474627
475491
|
eagerLoadSettings();
|
|
474628
475492
|
profileCheckpoint("main_before_run");
|
|
474629
|
-
await
|
|
475493
|
+
await run3();
|
|
474630
475494
|
profileCheckpoint("main_after_run");
|
|
474631
475495
|
}
|
|
474632
475496
|
async function getInputPrompt(prompt, inputFormat) {
|
|
@@ -474651,7 +475515,7 @@ async function getInputPrompt(prompt, inputFormat) {
|
|
|
474651
475515
|
}
|
|
474652
475516
|
return prompt;
|
|
474653
475517
|
}
|
|
474654
|
-
async function
|
|
475518
|
+
async function run3() {
|
|
474655
475519
|
profileCheckpoint("run_function_start");
|
|
474656
475520
|
function createSortedHelpConfig() {
|
|
474657
475521
|
const getOptionSortKey = (opt) => opt.long?.replace(/^--/, "") ?? opt.short?.replace(/^-/, "") ?? "";
|
|
@@ -474904,7 +475768,7 @@ ${getTmuxInstallInstructions2()}
|
|
|
474904
475768
|
}
|
|
474905
475769
|
try {
|
|
474906
475770
|
const filePath = resolve46(options2.systemPromptFile);
|
|
474907
|
-
systemPrompt =
|
|
475771
|
+
systemPrompt = readFileSync25(filePath, "utf8");
|
|
474908
475772
|
} catch (error40) {
|
|
474909
475773
|
const code = getErrnoCode(error40);
|
|
474910
475774
|
if (code === "ENOENT") {
|
|
@@ -474926,7 +475790,7 @@ ${getTmuxInstallInstructions2()}
|
|
|
474926
475790
|
}
|
|
474927
475791
|
try {
|
|
474928
475792
|
const filePath = resolve46(options2.appendSystemPromptFile);
|
|
474929
|
-
appendSystemPrompt =
|
|
475793
|
+
appendSystemPrompt = readFileSync25(filePath, "utf8");
|
|
474930
475794
|
} catch (error40) {
|
|
474931
475795
|
const code = getErrnoCode(error40);
|
|
474932
475796
|
if (code === "ENOENT") {
|
|
@@ -475100,6 +475964,62 @@ ${hint}` : hint;
|
|
|
475100
475964
|
}
|
|
475101
475965
|
}
|
|
475102
475966
|
if (false) {}
|
|
475967
|
+
if (getPlatform() === "macos" && !getIsNonInteractiveSession()) {
|
|
475968
|
+
try {
|
|
475969
|
+
const {
|
|
475970
|
+
isComputerUseEnabled: isComputerUseEnabled2
|
|
475971
|
+
} = await Promise.resolve().then(() => (init_common3(), exports_common));
|
|
475972
|
+
if (isComputerUseEnabled2()) {
|
|
475973
|
+
const {
|
|
475974
|
+
setupComputerUse: setupComputerUse2
|
|
475975
|
+
} = await Promise.resolve().then(() => (init_setup3(), exports_setup));
|
|
475976
|
+
const {
|
|
475977
|
+
mcpConfig: cuMcpConfig,
|
|
475978
|
+
allowedTools: cuTools,
|
|
475979
|
+
systemPrompt: cuHint
|
|
475980
|
+
} = setupComputerUse2();
|
|
475981
|
+
dynamicMcpConfig = {
|
|
475982
|
+
...dynamicMcpConfig,
|
|
475983
|
+
...cuMcpConfig
|
|
475984
|
+
};
|
|
475985
|
+
allowedTools.push(...cuTools);
|
|
475986
|
+
appendSystemPrompt = appendSystemPrompt ? `${appendSystemPrompt}
|
|
475987
|
+
|
|
475988
|
+
${cuHint}` : cuHint;
|
|
475989
|
+
}
|
|
475990
|
+
} catch (error40) {
|
|
475991
|
+
logForDebugging(`[Theus computer-use] Setup failed: ${errorMessage(error40)}`);
|
|
475992
|
+
}
|
|
475993
|
+
}
|
|
475994
|
+
if (!getIsNonInteractiveSession()) {
|
|
475995
|
+
try {
|
|
475996
|
+
const {
|
|
475997
|
+
isNaupaEnabled: isNaupaEnabled2
|
|
475998
|
+
} = await Promise.resolve().then(() => (init_common4(), exports_common2));
|
|
475999
|
+
if (isNaupaEnabled2()) {
|
|
476000
|
+
const {
|
|
476001
|
+
setupNaupa: setupNaupa2
|
|
476002
|
+
} = await Promise.resolve().then(() => (init_setup4(), exports_setup2));
|
|
476003
|
+
const {
|
|
476004
|
+
mcpConfig: naupaMcpConfig,
|
|
476005
|
+
allowedTools: naupaTools,
|
|
476006
|
+
systemPrompt: naupaHint
|
|
476007
|
+
} = setupNaupa2();
|
|
476008
|
+
dynamicMcpConfig = {
|
|
476009
|
+
...dynamicMcpConfig,
|
|
476010
|
+
...naupaMcpConfig
|
|
476011
|
+
};
|
|
476012
|
+
allowedTools.push(...naupaTools);
|
|
476013
|
+
if (naupaHint) {
|
|
476014
|
+
appendSystemPrompt = appendSystemPrompt ? `${appendSystemPrompt}
|
|
476015
|
+
|
|
476016
|
+
${naupaHint}` : naupaHint;
|
|
476017
|
+
}
|
|
476018
|
+
}
|
|
476019
|
+
} catch (error40) {
|
|
476020
|
+
logForDebugging(`[Theus \xD1aupa] Setup failed: ${errorMessage(error40)}`);
|
|
476021
|
+
}
|
|
476022
|
+
}
|
|
475103
476023
|
setAdditionalDirectoriesForTheusMd(addDir2);
|
|
475104
476024
|
let devChannels;
|
|
475105
476025
|
if (false) {}
|
|
@@ -475206,7 +476126,7 @@ ${hint}` : hint;
|
|
|
475206
476126
|
const setupStart = Date.now();
|
|
475207
476127
|
const {
|
|
475208
476128
|
setup: setup2
|
|
475209
|
-
} = await Promise.resolve().then(() => (
|
|
476129
|
+
} = await Promise.resolve().then(() => (init_setup5(), exports_setup3));
|
|
475210
476130
|
const messagingSocketPath = undefined;
|
|
475211
476131
|
const preSetupCwd = getCwd();
|
|
475212
476132
|
if (process.env.THEUS_CODE_ENTRYPOINT !== "local-agent") {
|
|
@@ -475522,7 +476442,7 @@ ${customInstructions}` : customInstructions;
|
|
|
475522
476442
|
}
|
|
475523
476443
|
}
|
|
475524
476444
|
logForDiagnosticsNoPII("info", "started", {
|
|
475525
|
-
version: { VERSION: "0.1.
|
|
476445
|
+
version: { VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
475526
476446
|
is_native_binary: isInBundledMode()
|
|
475527
476447
|
});
|
|
475528
476448
|
registerCleanup(async () => {
|
|
@@ -476306,7 +477226,7 @@ Usage: theus --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
476306
477226
|
pendingHookMessages
|
|
476307
477227
|
}, renderAndRun);
|
|
476308
477228
|
}
|
|
476309
|
-
}).version(`${{ VERSION: "0.1.
|
|
477229
|
+
}).version(`${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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");
|
|
476310
477230
|
program2.option("-w, --worktree [name]", "Crea un nuevo worktree de git para esta sesi\xF3n (opcionalmente indica un nombre)");
|
|
476311
477231
|
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.");
|
|
476312
477232
|
if (canUserConfigureAdvisor()) {
|
|
@@ -476820,7 +477740,7 @@ if (false) {}
|
|
|
476820
477740
|
async function main2() {
|
|
476821
477741
|
const args = process.argv.slice(2);
|
|
476822
477742
|
if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
|
|
476823
|
-
console.log(`${{ VERSION: "0.1.
|
|
477743
|
+
console.log(`${{ VERSION: "0.1.13", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)`);
|
|
476824
477744
|
return;
|
|
476825
477745
|
}
|
|
476826
477746
|
const {
|
|
@@ -476849,6 +477769,19 @@ async function main2() {
|
|
|
476849
477769
|
} = await Promise.resolve().then(() => (init_server4(), exports_server));
|
|
476850
477770
|
await runProjectContextMcpServer2();
|
|
476851
477771
|
return;
|
|
477772
|
+
} else if (process.argv[2] === "--theus-computer-use-mcp") {
|
|
477773
|
+
profileCheckpoint2("cli_theus_computer_use_mcp_path");
|
|
477774
|
+
const {
|
|
477775
|
+
runComputerUseMcpServer: runComputerUseMcpServer2
|
|
477776
|
+
} = await Promise.resolve().then(() => (init_server5(), exports_server2));
|
|
477777
|
+
await runComputerUseMcpServer2();
|
|
477778
|
+
return;
|
|
477779
|
+
} else if (process.argv[2] === "--theus-computer-use-selftest") {
|
|
477780
|
+
const {
|
|
477781
|
+
runComputerUseSelfTest: runComputerUseSelfTest2
|
|
477782
|
+
} = await Promise.resolve().then(() => (init_selftest(), exports_selftest));
|
|
477783
|
+
await runComputerUseSelfTest2();
|
|
477784
|
+
return;
|
|
476852
477785
|
}
|
|
476853
477786
|
if (args[0] === "--daemon-worker" || args[0] === "daemon") {
|
|
476854
477787
|
const {
|