theus-cli 0.2.11 → 0.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli.js +1401 -353
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -58285,7 +58285,7 @@ async function _executeApiKeyHelper(isNonInteractiveSession) {
|
|
|
58285
58285
|
if (isApiKeyHelperFromProjectOrLocalSettings()) {
|
|
58286
58286
|
const hasTrust = checkHasTrustDialogAccepted();
|
|
58287
58287
|
if (!hasTrust && !isNonInteractiveSession) {
|
|
58288
|
-
const error40 = new Error(`Security: apiKeyHelper executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.
|
|
58288
|
+
const error40 = new Error(`Security: apiKeyHelper executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.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}.`);
|
|
58289
58289
|
logAntError("apiKeyHelper invoked before trust check", error40);
|
|
58290
58290
|
logEvent("tengu_apiKeyHelper_missing_trust11", {});
|
|
58291
58291
|
return null;
|
|
@@ -58329,7 +58329,7 @@ async function runAwsAuthRefresh() {
|
|
|
58329
58329
|
if (isAwsAuthRefreshFromProjectSettings()) {
|
|
58330
58330
|
const hasTrust = checkHasTrustDialogAccepted();
|
|
58331
58331
|
if (!hasTrust && !getIsNonInteractiveSession()) {
|
|
58332
|
-
const error40 = new Error(`Security: awsAuthRefresh executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.
|
|
58332
|
+
const error40 = new Error(`Security: awsAuthRefresh executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.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}.`);
|
|
58333
58333
|
logAntError("awsAuthRefresh invoked before trust check", error40);
|
|
58334
58334
|
logEvent("tengu_awsAuthRefresh_missing_trust", {});
|
|
58335
58335
|
return false;
|
|
@@ -58389,7 +58389,7 @@ async function getAwsCredsFromCredentialExport() {
|
|
|
58389
58389
|
if (isAwsCredentialExportFromProjectSettings()) {
|
|
58390
58390
|
const hasTrust = checkHasTrustDialogAccepted();
|
|
58391
58391
|
if (!hasTrust && !getIsNonInteractiveSession()) {
|
|
58392
|
-
const error40 = new Error(`Security: awsCredentialExport executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.
|
|
58392
|
+
const error40 = new Error(`Security: awsCredentialExport executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.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}.`);
|
|
58393
58393
|
logAntError("awsCredentialExport invoked before trust check", error40);
|
|
58394
58394
|
logEvent("tengu_awsCredentialExport_missing_trust", {});
|
|
58395
58395
|
return null;
|
|
@@ -58474,7 +58474,7 @@ async function runGcpAuthRefresh() {
|
|
|
58474
58474
|
if (isGcpAuthRefreshFromProjectSettings()) {
|
|
58475
58475
|
const hasTrust = checkHasTrustDialogAccepted();
|
|
58476
58476
|
if (!hasTrust && !getIsNonInteractiveSession()) {
|
|
58477
|
-
const error40 = new Error(`Security: gcpAuthRefresh executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.
|
|
58477
|
+
const error40 = new Error(`Security: gcpAuthRefresh executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.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}.`);
|
|
58478
58478
|
logAntError("gcpAuthRefresh invoked before trust check", error40);
|
|
58479
58479
|
logEvent("tengu_gcpAuthRefresh_missing_trust", {});
|
|
58480
58480
|
return false;
|
|
@@ -59169,7 +59169,7 @@ var init_auth = __esm(() => {
|
|
|
59169
59169
|
|
|
59170
59170
|
// utils/userAgent.ts
|
|
59171
59171
|
function getTheusCodeUserAgent() {
|
|
59172
|
-
return `theus-code/${{ VERSION: "0.2.
|
|
59172
|
+
return `theus-code/${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}`;
|
|
59173
59173
|
}
|
|
59174
59174
|
|
|
59175
59175
|
// utils/workloadContext.ts
|
|
@@ -59191,7 +59191,7 @@ function getUserAgent() {
|
|
|
59191
59191
|
const clientApp = process.env.THEUS_AGENT_SDK_CLIENT_APP ? `, client-app/${process.env.THEUS_AGENT_SDK_CLIENT_APP}` : "";
|
|
59192
59192
|
const workload = getWorkload();
|
|
59193
59193
|
const workloadSuffix = workload ? `, workload/${workload}` : "";
|
|
59194
|
-
return `theus-cli/${{ VERSION: "0.2.
|
|
59194
|
+
return `theus-cli/${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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})`;
|
|
59195
59195
|
}
|
|
59196
59196
|
function getMCPUserAgent() {
|
|
59197
59197
|
const parts = [];
|
|
@@ -59205,7 +59205,7 @@ function getMCPUserAgent() {
|
|
|
59205
59205
|
parts.push(`client-app/${process.env.THEUS_AGENT_SDK_CLIENT_APP}`);
|
|
59206
59206
|
}
|
|
59207
59207
|
const suffix = parts.length > 0 ? ` (${parts.join(", ")})` : "";
|
|
59208
|
-
return `theus-code/${{ VERSION: "0.2.
|
|
59208
|
+
return `theus-code/${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}`;
|
|
59209
59209
|
}
|
|
59210
59210
|
function getWebFetchUserAgent() {
|
|
59211
59211
|
return `Theus-User (${getTheusCodeUserAgent()}; +https://support.theus.pe/)`;
|
|
@@ -59343,7 +59343,7 @@ var init_user = __esm(() => {
|
|
|
59343
59343
|
deviceId,
|
|
59344
59344
|
sessionId: getSessionId(),
|
|
59345
59345
|
email: getEmail(),
|
|
59346
|
-
appVersion: { VERSION: "0.2.
|
|
59346
|
+
appVersion: { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
59347
59347
|
platform: getHostPlatformForAnalytics(),
|
|
59348
59348
|
organizationUuid,
|
|
59349
59349
|
accountUuid,
|
|
@@ -61058,7 +61058,7 @@ var init_metadata = __esm(() => {
|
|
|
61058
61058
|
COMPOUND_OPERATOR_REGEX = /\s*(?:&&|\|\||[;|])\s*/;
|
|
61059
61059
|
WHITESPACE_REGEX = /\s+/;
|
|
61060
61060
|
getVersionBase = memoize_default(() => {
|
|
61061
|
-
const match = { VERSION: "0.2.
|
|
61061
|
+
const match = { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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]+)?/);
|
|
61062
61062
|
return match ? match[0] : undefined;
|
|
61063
61063
|
});
|
|
61064
61064
|
buildEnvContext = memoize_default(async () => {
|
|
@@ -61098,9 +61098,9 @@ var init_metadata = __esm(() => {
|
|
|
61098
61098
|
isGithubAction: isEnvTruthy(process.env.GITHUB_ACTIONS),
|
|
61099
61099
|
isTheusCodeAction: isEnvTruthy(process.env.THEUS_CODE_ACTION),
|
|
61100
61100
|
isTheusAiAuth: isTheusAISubscriber(),
|
|
61101
|
-
version: { VERSION: "0.2.
|
|
61101
|
+
version: { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
61102
61102
|
versionBase: getVersionBase(),
|
|
61103
|
-
buildTime: { VERSION: "0.2.
|
|
61103
|
+
buildTime: { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.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,
|
|
61104
61104
|
deploymentEnvironment: env3.detectDeploymentEnvironment(),
|
|
61105
61105
|
...isEnvTruthy(process.env.GITHUB_ACTIONS) && {
|
|
61106
61106
|
githubEventName: process.env.GITHUB_EVENT_NAME,
|
|
@@ -61766,7 +61766,7 @@ function initialize1PEventLogging() {
|
|
|
61766
61766
|
const platform2 = getPlatform();
|
|
61767
61767
|
const attributes = {
|
|
61768
61768
|
[ATTR_SERVICE_NAME]: "theus-code",
|
|
61769
|
-
[ATTR_SERVICE_VERSION]: { VERSION: "0.2.
|
|
61769
|
+
[ATTR_SERVICE_VERSION]: { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
61770
61770
|
};
|
|
61771
61771
|
if (platform2 === "wsl") {
|
|
61772
61772
|
const wslVersion = getWslVersion();
|
|
@@ -61793,7 +61793,7 @@ function initialize1PEventLogging() {
|
|
|
61793
61793
|
})
|
|
61794
61794
|
]
|
|
61795
61795
|
});
|
|
61796
|
-
firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.theus.theus_code.events", { VERSION: "0.2.
|
|
61796
|
+
firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.theus.theus_code.events", { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
|
|
61797
61797
|
}
|
|
61798
61798
|
async function reinitialize1PEventLoggingIfConfigChanged() {
|
|
61799
61799
|
if (!is1PEventLoggingEnabled() || !firstPartyEventLoggerProvider) {
|
|
@@ -63664,7 +63664,7 @@ function getAttributionHeader(fingerprint) {
|
|
|
63664
63664
|
if (!isAttributionHeaderEnabled()) {
|
|
63665
63665
|
return "";
|
|
63666
63666
|
}
|
|
63667
|
-
const version2 = `${{ VERSION: "0.2.
|
|
63667
|
+
const version2 = `${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}`;
|
|
63668
63668
|
const entrypoint = process.env.THEUS_CODE_ENTRYPOINT ?? "unknown";
|
|
63669
63669
|
const cch = "";
|
|
63670
63670
|
const workload = getWorkload();
|
|
@@ -107720,7 +107720,7 @@ Complete the user's request by providing accurate, documentation-based guidance.
|
|
|
107720
107720
|
}
|
|
107721
107721
|
function getFeedbackGuideline() {
|
|
107722
107722
|
if (isUsing3PServices()) {
|
|
107723
|
-
return `- When you cannot find an answer or the feature doesn't exist, direct the user to ${{ VERSION: "0.2.
|
|
107723
|
+
return `- When you cannot find an answer or the feature doesn't exist, direct the user to ${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.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}`;
|
|
107724
107724
|
}
|
|
107725
107725
|
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";
|
|
107726
107726
|
}
|
|
@@ -109279,6 +109279,9 @@ function canonicalize(obj, stack, replacementStack, replacer, key) {
|
|
|
109279
109279
|
}
|
|
109280
109280
|
return canonicalizedObj;
|
|
109281
109281
|
}
|
|
109282
|
+
function diffArrays(oldArr, newArr, callback) {
|
|
109283
|
+
return arrayDiff.diff(oldArr, newArr, callback);
|
|
109284
|
+
}
|
|
109282
109285
|
function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
|
|
109283
109286
|
if (!options) {
|
|
109284
109287
|
options = {};
|
|
@@ -166422,7 +166425,7 @@ function getTelemetryAttributes() {
|
|
|
166422
166425
|
attributes["session.id"] = sessionId;
|
|
166423
166426
|
}
|
|
166424
166427
|
if (shouldIncludeAttribute("OTEL_METRICS_INCLUDE_VERSION")) {
|
|
166425
|
-
attributes["app.version"] = { VERSION: "0.2.
|
|
166428
|
+
attributes["app.version"] = { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
|
|
166426
166429
|
}
|
|
166427
166430
|
const oauthAccount = getOauthAccountInfo();
|
|
166428
166431
|
if (oauthAccount) {
|
|
@@ -191896,9 +191899,20 @@ function getRemoteSessionUrl(sessionId, ingressUrl) {
|
|
|
191896
191899
|
}
|
|
191897
191900
|
var PRODUCT_URL = "https://theus.com/theus-code", THEUS_AI_BASE_URL = "https://theus.pe", THEUS_AI_STAGING_BASE_URL = "https://theus-ai.staging.ant.dev", THEUS_AI_LOCAL_BASE_URL = "http://localhost:4000";
|
|
191898
191901
|
|
|
191902
|
+
// utils/terminalPanelEnabled.ts
|
|
191903
|
+
function isTerminalPanelEnabled() {
|
|
191904
|
+
return TERMINAL_PANEL_FORCED;
|
|
191905
|
+
}
|
|
191906
|
+
var TERMINAL_PANEL_FORCED;
|
|
191907
|
+
var init_terminalPanelEnabled = __esm(() => {
|
|
191908
|
+
init_envUtils();
|
|
191909
|
+
TERMINAL_PANEL_FORCED = isEnvTruthy(process.env.THEUS_TERMINAL_PANEL);
|
|
191910
|
+
});
|
|
191911
|
+
|
|
191899
191912
|
// keybindings/defaultBindings.ts
|
|
191900
191913
|
var IMAGE_PASTE_KEY, SUPPORTS_TERMINAL_VT_MODE, MODE_CYCLE_KEY, DEFAULT_BINDINGS;
|
|
191901
191914
|
var init_defaultBindings = __esm(() => {
|
|
191915
|
+
init_terminalPanelEnabled();
|
|
191902
191916
|
init_platform2();
|
|
191903
191917
|
IMAGE_PASTE_KEY = getPlatform() === "windows" ? "alt+v" : "ctrl+v";
|
|
191904
191918
|
SUPPORTS_TERMINAL_VT_MODE = getPlatform() !== "windows" || (isRunningWithBun() ? satisfies(process.versions.bun, ">=1.2.23") : satisfies(process.versions.node, ">=22.17.0 <23.0.0 || >=24.2.0"));
|
|
@@ -191916,7 +191930,7 @@ var init_defaultBindings = __esm(() => {
|
|
|
191916
191930
|
"ctrl+shift+o": "app:toggleTeammatePreview",
|
|
191917
191931
|
"ctrl+r": "history:search",
|
|
191918
191932
|
...{},
|
|
191919
|
-
...{}
|
|
191933
|
+
...isTerminalPanelEnabled() ? { "meta+j": "app:toggleTerminal" } : {}
|
|
191920
191934
|
}
|
|
191921
191935
|
},
|
|
191922
191936
|
{
|
|
@@ -202469,7 +202483,7 @@ function getInstallationEnv() {
|
|
|
202469
202483
|
return;
|
|
202470
202484
|
}
|
|
202471
202485
|
function getTheusCodeVersion() {
|
|
202472
|
-
return { VERSION: "0.2.
|
|
202486
|
+
return { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
|
|
202473
202487
|
}
|
|
202474
202488
|
async function getInstalledVSCodeExtensionVersion(command) {
|
|
202475
202489
|
const { stdout } = await execFileNoThrow(command, ["--list-extensions", "--show-versions"], {
|
|
@@ -203987,7 +204001,7 @@ async function getMcpHeadersFromHelper(serverName, config2) {
|
|
|
203987
204001
|
if ("scope" in config2 && isMcpServerFromProjectOrLocalSettings(config2) && !getIsNonInteractiveSession()) {
|
|
203988
204002
|
const hasTrust = checkHasTrustDialogAccepted();
|
|
203989
204003
|
if (!hasTrust) {
|
|
203990
|
-
const error40 = new Error(`Security: headersHelper for MCP server '${serverName}' executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.
|
|
204004
|
+
const error40 = new Error(`Security: headersHelper for MCP server '${serverName}' executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.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}.`);
|
|
203991
204005
|
logAntError("MCP headersHelper invoked before trust check", error40);
|
|
203992
204006
|
logEvent("tengu_mcp_headersHelper_missing_trust", {});
|
|
203993
204007
|
return null;
|
|
@@ -205197,7 +205211,7 @@ async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) {
|
|
|
205197
205211
|
const client2 = new Client({
|
|
205198
205212
|
name: "theus-code",
|
|
205199
205213
|
title: "Theus",
|
|
205200
|
-
version: { VERSION: "0.2.
|
|
205214
|
+
version: { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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",
|
|
205201
205215
|
description: "Theus's agentic coding tool",
|
|
205202
205216
|
websiteUrl: PRODUCT_URL
|
|
205203
205217
|
}, {
|
|
@@ -205551,7 +205565,7 @@ var init_client5 = __esm(() => {
|
|
|
205551
205565
|
const client2 = new Client({
|
|
205552
205566
|
name: "theus-code",
|
|
205553
205567
|
title: "Theus",
|
|
205554
|
-
version: { VERSION: "0.2.
|
|
205568
|
+
version: { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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",
|
|
205555
205569
|
description: "Theus's agentic coding tool",
|
|
205556
205570
|
websiteUrl: PRODUCT_URL
|
|
205557
205571
|
}, {
|
|
@@ -216110,7 +216124,7 @@ async function initializeBetaTracing(resource) {
|
|
|
216110
216124
|
});
|
|
216111
216125
|
logs.setGlobalLoggerProvider(loggerProvider);
|
|
216112
216126
|
setLoggerProvider(loggerProvider);
|
|
216113
|
-
const eventLogger = logs.getLogger("com.theus.theus_code.events", { VERSION: "0.2.
|
|
216127
|
+
const eventLogger = logs.getLogger("com.theus.theus_code.events", { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
|
|
216114
216128
|
setEventLogger(eventLogger);
|
|
216115
216129
|
process.on("beforeExit", async () => {
|
|
216116
216130
|
await loggerProvider?.forceFlush();
|
|
@@ -216150,7 +216164,7 @@ async function initializeTelemetry() {
|
|
|
216150
216164
|
const platform4 = getPlatform();
|
|
216151
216165
|
const baseAttributes = {
|
|
216152
216166
|
[ATTR_SERVICE_NAME]: "theus-code",
|
|
216153
|
-
[ATTR_SERVICE_VERSION]: { VERSION: "0.2.
|
|
216167
|
+
[ATTR_SERVICE_VERSION]: { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
216154
216168
|
};
|
|
216155
216169
|
if (platform4 === "wsl") {
|
|
216156
216170
|
const wslVersion = getWslVersion();
|
|
@@ -216195,7 +216209,7 @@ async function initializeTelemetry() {
|
|
|
216195
216209
|
} catch {}
|
|
216196
216210
|
};
|
|
216197
216211
|
registerCleanup(shutdownTelemetry2);
|
|
216198
|
-
return meterProvider2.getMeter("com.theus.theus_code", { VERSION: "0.2.
|
|
216212
|
+
return meterProvider2.getMeter("com.theus.theus_code", { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
|
|
216199
216213
|
}
|
|
216200
216214
|
const meterProvider = new MeterProvider({
|
|
216201
216215
|
resource,
|
|
@@ -216215,7 +216229,7 @@ async function initializeTelemetry() {
|
|
|
216215
216229
|
});
|
|
216216
216230
|
logs.setGlobalLoggerProvider(loggerProvider);
|
|
216217
216231
|
setLoggerProvider(loggerProvider);
|
|
216218
|
-
const eventLogger = logs.getLogger("com.theus.theus_code.events", { VERSION: "0.2.
|
|
216232
|
+
const eventLogger = logs.getLogger("com.theus.theus_code.events", { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
|
|
216219
216233
|
setEventLogger(eventLogger);
|
|
216220
216234
|
logForDebugging("[3P telemetry] Event logger set successfully");
|
|
216221
216235
|
process.on("beforeExit", async () => {
|
|
@@ -216277,7 +216291,7 @@ Current timeout: ${timeoutMs}ms
|
|
|
216277
216291
|
}
|
|
216278
216292
|
};
|
|
216279
216293
|
registerCleanup(shutdownTelemetry);
|
|
216280
|
-
return meterProvider.getMeter("com.theus.theus_code", { VERSION: "0.2.
|
|
216294
|
+
return meterProvider.getMeter("com.theus.theus_code", { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
|
|
216281
216295
|
}
|
|
216282
216296
|
async function flushTelemetry() {
|
|
216283
216297
|
const meterProvider = getMeterProvider();
|
|
@@ -216817,7 +216831,7 @@ async function installOrUpdateTheusPackage(channel2, specificVersion) {
|
|
|
216817
216831
|
return "install_failed";
|
|
216818
216832
|
}
|
|
216819
216833
|
const versionSpec = specificVersion ? specificVersion : channel2 === "stable" ? "stable" : "latest";
|
|
216820
|
-
const result = await execFileNoThrowWithCwd("npm", ["install", `${{ VERSION: "0.2.
|
|
216834
|
+
const result = await execFileNoThrowWithCwd("npm", ["install", `${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.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 });
|
|
216821
216835
|
if (result.code !== 0) {
|
|
216822
216836
|
const error40 = new Error(`Failed to install Theus CLI package: ${result.stderr}`);
|
|
216823
216837
|
logError2(error40);
|
|
@@ -216963,9 +216977,9 @@ async function assertMinVersion() {
|
|
|
216963
216977
|
if (false) {}
|
|
216964
216978
|
try {
|
|
216965
216979
|
const versionConfig = await getDynamicConfig_BLOCKS_ON_INIT("tengu_version_config", { minVersion: "0.0.0" });
|
|
216966
|
-
if (versionConfig.minVersion && lt({ VERSION: "0.2.
|
|
216980
|
+
if (versionConfig.minVersion && lt({ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
|
|
216967
216981
|
console.error(`
|
|
216968
|
-
It looks like your version of Theus (${{ VERSION: "0.2.
|
|
216982
|
+
It looks like your version of Theus (${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.
|
|
216969
216983
|
A newer version (${versionConfig.minVersion} or higher) is required to continue.
|
|
216970
216984
|
|
|
216971
216985
|
To update, please run:
|
|
@@ -217106,7 +217120,7 @@ async function getInstallationPrefix() {
|
|
|
217106
217120
|
return prefixResult.stdout.trim();
|
|
217107
217121
|
}
|
|
217108
217122
|
function getGlobalInstallPackageManager() {
|
|
217109
|
-
if ({ VERSION: "0.2.
|
|
217123
|
+
if ({ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.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") {
|
|
217110
217124
|
return "npm";
|
|
217111
217125
|
}
|
|
217112
217126
|
return env3.isRunningWithBun() ? "bun" : "npm";
|
|
@@ -217131,7 +217145,7 @@ async function checkGlobalInstallPermissions() {
|
|
|
217131
217145
|
}
|
|
217132
217146
|
async function getLatestVersion(channel2) {
|
|
217133
217147
|
const npmTag = channel2 === "stable" ? "stable" : "latest";
|
|
217134
|
-
const result = await execFileNoThrowWithCwd("npm", ["view", `${{ VERSION: "0.2.
|
|
217148
|
+
const result = await execFileNoThrowWithCwd("npm", ["view", `${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.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() });
|
|
217135
217149
|
if (result.code !== 0) {
|
|
217136
217150
|
logForDebugging(`npm view failed with code ${result.code}`);
|
|
217137
217151
|
if (result.stderr) {
|
|
@@ -217147,7 +217161,7 @@ async function getLatestVersion(channel2) {
|
|
|
217147
217161
|
return result.stdout.trim();
|
|
217148
217162
|
}
|
|
217149
217163
|
async function getNpmDistTags() {
|
|
217150
|
-
const result = await execFileNoThrowWithCwd("npm", ["view", { VERSION: "0.2.
|
|
217164
|
+
const result = await execFileNoThrowWithCwd("npm", ["view", { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.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() });
|
|
217151
217165
|
if (result.code !== 0) {
|
|
217152
217166
|
logForDebugging(`npm view dist-tags failed with code ${result.code}`);
|
|
217153
217167
|
return { latest: null, stable: null };
|
|
@@ -217187,7 +217201,7 @@ async function installGlobalPackage(specificVersion) {
|
|
|
217187
217201
|
logError2(new AutoUpdaterError("Another process is currently installing an update"));
|
|
217188
217202
|
logEvent("tengu_auto_updater_lock_contention", {
|
|
217189
217203
|
pid: process.pid,
|
|
217190
|
-
currentVersion: { VERSION: "0.2.
|
|
217204
|
+
currentVersion: { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
217191
217205
|
});
|
|
217192
217206
|
return "in_progress";
|
|
217193
217207
|
}
|
|
@@ -217196,7 +217210,7 @@ async function installGlobalPackage(specificVersion) {
|
|
|
217196
217210
|
if (!env3.isRunningWithBun() && env3.isNpmFromWindowsPath()) {
|
|
217197
217211
|
logError2(new Error("Windows NPM detected in WSL environment"));
|
|
217198
217212
|
logEvent("tengu_auto_updater_windows_npm_in_wsl", {
|
|
217199
|
-
currentVersion: { VERSION: "0.2.
|
|
217213
|
+
currentVersion: { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
217200
217214
|
});
|
|
217201
217215
|
console.error(`
|
|
217202
217216
|
Error: Windows NPM detected in WSL
|
|
@@ -217215,7 +217229,7 @@ To fix this issue:
|
|
|
217215
217229
|
if (!hasPermissions) {
|
|
217216
217230
|
return "no_permissions";
|
|
217217
217231
|
}
|
|
217218
|
-
const packageSpec = specificVersion ? `${{ VERSION: "0.2.
|
|
217232
|
+
const packageSpec = specificVersion ? `${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}@${specificVersion}` : { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.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;
|
|
217219
217233
|
const packageManager = getGlobalInstallPackageManager();
|
|
217220
217234
|
const installResult = await execFileNoThrowWithCwd(packageManager, ["install", "-g", packageSpec], { cwd: homedir18() });
|
|
217221
217235
|
if (installResult.code !== 0) {
|
|
@@ -217543,8 +217557,8 @@ async function detectMultipleInstallations() {
|
|
|
217543
217557
|
installations.push({ type: "npm-local", path: localPath });
|
|
217544
217558
|
}
|
|
217545
217559
|
const packagesToCheck = ["@theus-ai/theus-code"];
|
|
217546
|
-
if ({ VERSION: "0.2.
|
|
217547
|
-
packagesToCheck.push({ VERSION: "0.2.
|
|
217560
|
+
if ({ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL && { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.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") {
|
|
217561
|
+
packagesToCheck.push({ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.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);
|
|
217548
217562
|
}
|
|
217549
217563
|
const npmResult = await execFileNoThrow("npm", [
|
|
217550
217564
|
"-g",
|
|
@@ -217727,7 +217741,7 @@ function detectLinuxGlobPatternWarnings() {
|
|
|
217727
217741
|
}
|
|
217728
217742
|
async function getDoctorDiagnostic() {
|
|
217729
217743
|
const installationType = await getCurrentInstallationType();
|
|
217730
|
-
const version2 = { VERSION: "0.2.
|
|
217744
|
+
const version2 = { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION ? { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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";
|
|
217731
217745
|
const installationPath = await getInstallationPath();
|
|
217732
217746
|
const invokedBinary = getInvokedBinary();
|
|
217733
217747
|
const multipleInstallations = await detectMultipleInstallations();
|
|
@@ -217739,8 +217753,8 @@ async function getDoctorDiagnostic() {
|
|
|
217739
217753
|
for (const install of npmInstalls) {
|
|
217740
217754
|
if (install.type === "npm-global") {
|
|
217741
217755
|
let uninstallCmd = "npm -g uninstall @theus-ai/theus-code";
|
|
217742
|
-
if ({ VERSION: "0.2.
|
|
217743
|
-
uninstallCmd += ` && npm -g uninstall ${{ VERSION: "0.2.
|
|
217756
|
+
if ({ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL && { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.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") {
|
|
217757
|
+
uninstallCmd += ` && npm -g uninstall ${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.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}`;
|
|
217744
217758
|
}
|
|
217745
217759
|
warnings.push({
|
|
217746
217760
|
issue: `Leftover npm global installation at ${install.path}`,
|
|
@@ -217852,7 +217866,7 @@ async function getLatestVersionFromArtifactory(tag2 = "latest") {
|
|
|
217852
217866
|
const startTime2 = Date.now();
|
|
217853
217867
|
const { stdout, code, stderr } = await execFileNoThrowWithCwd("npm", [
|
|
217854
217868
|
"view",
|
|
217855
|
-
`${{ VERSION: "0.2.
|
|
217869
|
+
`${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.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}`,
|
|
217856
217870
|
"version",
|
|
217857
217871
|
"--prefer-online",
|
|
217858
217872
|
"--registry",
|
|
@@ -217876,7 +217890,7 @@ async function getLatestVersionFromArtifactory(tag2 = "latest") {
|
|
|
217876
217890
|
latency_ms: latencyMs,
|
|
217877
217891
|
source_npm: true
|
|
217878
217892
|
});
|
|
217879
|
-
logForDebugging(`npm view ${{ VERSION: "0.2.
|
|
217893
|
+
logForDebugging(`npm view ${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.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}`);
|
|
217880
217894
|
const latestVersion = stdout.trim();
|
|
217881
217895
|
return latestVersion;
|
|
217882
217896
|
}
|
|
@@ -217932,7 +217946,7 @@ async function downloadVersionFromArtifactory(version2, stagingPath) {
|
|
|
217932
217946
|
const fs3 = getFsImplementation();
|
|
217933
217947
|
await fs3.rm(stagingPath, { recursive: true, force: true });
|
|
217934
217948
|
const platform4 = getPlatform2();
|
|
217935
|
-
const platformPackageName = `${{ VERSION: "0.2.
|
|
217949
|
+
const platformPackageName = `${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.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}`;
|
|
217936
217950
|
logForDebugging(`Fetching integrity hash for ${platformPackageName}@${version2}`);
|
|
217937
217951
|
const {
|
|
217938
217952
|
stdout: integrityOutput,
|
|
@@ -217961,7 +217975,7 @@ async function downloadVersionFromArtifactory(version2, stagingPath) {
|
|
|
217961
217975
|
name: "theus-native-installer",
|
|
217962
217976
|
version: "0.0.1",
|
|
217963
217977
|
dependencies: {
|
|
217964
|
-
[{ VERSION: "0.2.
|
|
217978
|
+
[{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.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
|
|
217965
217979
|
}
|
|
217966
217980
|
};
|
|
217967
217981
|
const packageLock = {
|
|
@@ -217974,10 +217988,10 @@ async function downloadVersionFromArtifactory(version2, stagingPath) {
|
|
|
217974
217988
|
name: "theus-native-installer",
|
|
217975
217989
|
version: "0.0.1",
|
|
217976
217990
|
dependencies: {
|
|
217977
|
-
[{ VERSION: "0.2.
|
|
217991
|
+
[{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.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
|
|
217978
217992
|
}
|
|
217979
217993
|
},
|
|
217980
|
-
[`node_modules/${{ VERSION: "0.2.
|
|
217994
|
+
[`node_modules/${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.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}`]: {
|
|
217981
217995
|
version: version2,
|
|
217982
217996
|
optionalDependencies: {
|
|
217983
217997
|
[platformPackageName]: version2
|
|
@@ -217999,7 +218013,7 @@ async function downloadVersionFromArtifactory(version2, stagingPath) {
|
|
|
217999
218013
|
if (result.code !== 0) {
|
|
218000
218014
|
throw new Error(`npm ci failed with code ${result.code}: ${result.stderr}`);
|
|
218001
218015
|
}
|
|
218002
|
-
logForDebugging(`Successfully downloaded and verified ${{ VERSION: "0.2.
|
|
218016
|
+
logForDebugging(`Successfully downloaded and verified ${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.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}`);
|
|
218003
218017
|
}
|
|
218004
218018
|
function getStallTimeoutMs() {
|
|
218005
218019
|
return Number(process.env.THEUS_CODE_STALL_TIMEOUT_MS_FOR_TESTING) || DEFAULT_STALL_TIMEOUT_MS;
|
|
@@ -218662,8 +218676,8 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
|
|
|
218662
218676
|
const maxVersion = await getMaxVersion();
|
|
218663
218677
|
if (maxVersion && gt(version2, maxVersion)) {
|
|
218664
218678
|
logForDebugging(`Native installer: maxVersion ${maxVersion} is set, capping update from ${version2} to ${maxVersion}`);
|
|
218665
|
-
if (gte({ VERSION: "0.2.
|
|
218666
|
-
logForDebugging(`Native installer: current version ${{ VERSION: "0.2.
|
|
218679
|
+
if (gte({ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
|
|
218680
|
+
logForDebugging(`Native installer: current version ${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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`);
|
|
218667
218681
|
logEvent("tengu_native_update_skipped_max_version", {
|
|
218668
218682
|
latency_ms: Date.now() - startTime2,
|
|
218669
218683
|
max_version: maxVersion,
|
|
@@ -218674,7 +218688,7 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
|
|
|
218674
218688
|
version2 = maxVersion;
|
|
218675
218689
|
}
|
|
218676
218690
|
}
|
|
218677
|
-
if (!forceReinstall && version2 === { VERSION: "0.2.
|
|
218691
|
+
if (!forceReinstall && version2 === { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
|
|
218678
218692
|
logForDebugging(`Found ${version2} at ${executablePath}, skipping install`);
|
|
218679
218693
|
logEvent("tengu_native_update_complete", {
|
|
218680
218694
|
latency_ms: Date.now() - startTime2,
|
|
@@ -219424,8 +219438,8 @@ async function cleanupNpmInstallations() {
|
|
|
219424
219438
|
} else if (codePackageResult.error) {
|
|
219425
219439
|
errors4.push(codePackageResult.error);
|
|
219426
219440
|
}
|
|
219427
|
-
if ({ VERSION: "0.2.
|
|
219428
|
-
const macroPackageResult = await attemptNpmUninstall({ VERSION: "0.2.
|
|
219441
|
+
if ({ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL && { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.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") {
|
|
219442
|
+
const macroPackageResult = await attemptNpmUninstall({ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.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);
|
|
219429
219443
|
if (macroPackageResult.success) {
|
|
219430
219444
|
removed++;
|
|
219431
219445
|
if (macroPackageResult.warning) {
|
|
@@ -268480,19 +268494,724 @@ var init_Fallback = __esm(() => {
|
|
|
268480
268494
|
hlCache = new Map;
|
|
268481
268495
|
});
|
|
268482
268496
|
|
|
268483
|
-
//
|
|
268484
|
-
|
|
268485
|
-
|
|
268486
|
-
|
|
268487
|
-
|
|
268488
|
-
|
|
268489
|
-
|
|
268490
|
-
|
|
268491
|
-
|
|
268492
|
-
|
|
268493
|
-
|
|
268494
|
-
|
|
268495
|
-
|
|
268497
|
+
// native-ts/color-diff/index.ts
|
|
268498
|
+
import { basename as basename24, extname as extname12 } from "path";
|
|
268499
|
+
function hljs() {
|
|
268500
|
+
if (cachedHljs)
|
|
268501
|
+
return cachedHljs;
|
|
268502
|
+
const mod = require_lib();
|
|
268503
|
+
cachedHljs = "default" in mod && mod.default ? mod.default : mod;
|
|
268504
|
+
return cachedHljs;
|
|
268505
|
+
}
|
|
268506
|
+
function rgb2(r, g, b) {
|
|
268507
|
+
return { r, g, b, a: 255 };
|
|
268508
|
+
}
|
|
268509
|
+
function ansiIdx(index) {
|
|
268510
|
+
return { r: index, g: 0, b: 0, a: 0 };
|
|
268511
|
+
}
|
|
268512
|
+
function detectColorMode(theme) {
|
|
268513
|
+
if (theme.includes("ansi"))
|
|
268514
|
+
return "ansi";
|
|
268515
|
+
const ct = process.env.COLORTERM ?? "";
|
|
268516
|
+
return ct === "truecolor" || ct === "24bit" ? "truecolor" : "color256";
|
|
268517
|
+
}
|
|
268518
|
+
function ansi256FromRgb(r, g, b) {
|
|
268519
|
+
const q = (c5) => c5 < 48 ? 0 : c5 < 115 ? 1 : c5 < 155 ? 2 : c5 < 195 ? 3 : c5 < 235 ? 4 : 5;
|
|
268520
|
+
const qr = q(r);
|
|
268521
|
+
const qg = q(g);
|
|
268522
|
+
const qb = q(b);
|
|
268523
|
+
const cubeIdx = 16 + 36 * qr + 6 * qg + qb;
|
|
268524
|
+
const grey = Math.round((r + g + b) / 3);
|
|
268525
|
+
if (grey < 5)
|
|
268526
|
+
return 16;
|
|
268527
|
+
if (grey > 244 && qr === qg && qg === qb)
|
|
268528
|
+
return cubeIdx;
|
|
268529
|
+
const greyLevel = Math.max(0, Math.min(23, Math.round((grey - 8) / 10)));
|
|
268530
|
+
const greyIdx = 232 + greyLevel;
|
|
268531
|
+
const greyRgb = 8 + greyLevel * 10;
|
|
268532
|
+
const cr = CUBE_LEVELS[qr];
|
|
268533
|
+
const cg = CUBE_LEVELS[qg];
|
|
268534
|
+
const cb = CUBE_LEVELS[qb];
|
|
268535
|
+
const dCube = (r - cr) ** 2 + (g - cg) ** 2 + (b - cb) ** 2;
|
|
268536
|
+
const dGrey = (r - greyRgb) ** 2 + (g - greyRgb) ** 2 + (b - greyRgb) ** 2;
|
|
268537
|
+
return dGrey < dCube ? greyIdx : cubeIdx;
|
|
268538
|
+
}
|
|
268539
|
+
function colorToEscape(c5, fg, mode) {
|
|
268540
|
+
if (c5.a === 0) {
|
|
268541
|
+
const idx = c5.r;
|
|
268542
|
+
if (idx < 8)
|
|
268543
|
+
return `\x1B[${(fg ? 30 : 40) + idx}m`;
|
|
268544
|
+
if (idx < 16)
|
|
268545
|
+
return `\x1B[${(fg ? 90 : 100) + (idx - 8)}m`;
|
|
268546
|
+
return `\x1B[${fg ? 38 : 48};5;${idx}m`;
|
|
268547
|
+
}
|
|
268548
|
+
if (c5.a === 1)
|
|
268549
|
+
return fg ? "\x1B[39m" : "\x1B[49m";
|
|
268550
|
+
const codeType = fg ? 38 : 48;
|
|
268551
|
+
if (mode === "truecolor") {
|
|
268552
|
+
return `\x1B[${codeType};2;${c5.r};${c5.g};${c5.b}m`;
|
|
268553
|
+
}
|
|
268554
|
+
return `\x1B[${codeType};5;${ansi256FromRgb(c5.r, c5.g, c5.b)}m`;
|
|
268555
|
+
}
|
|
268556
|
+
function asTerminalEscaped(blocks, mode, skipBackground, dim2) {
|
|
268557
|
+
let out = dim2 ? RESET + DIM : RESET;
|
|
268558
|
+
for (const [style, text] of blocks) {
|
|
268559
|
+
out += colorToEscape(style.foreground, true, mode);
|
|
268560
|
+
if (!skipBackground) {
|
|
268561
|
+
out += colorToEscape(style.background, false, mode);
|
|
268562
|
+
}
|
|
268563
|
+
out += text;
|
|
268564
|
+
}
|
|
268565
|
+
return out + RESET;
|
|
268566
|
+
}
|
|
268567
|
+
function defaultSyntaxThemeName(themeName) {
|
|
268568
|
+
if (themeName.includes("ansi"))
|
|
268569
|
+
return "ansi";
|
|
268570
|
+
if (themeName.includes("dark"))
|
|
268571
|
+
return "Monokai Extended";
|
|
268572
|
+
return "GitHub";
|
|
268573
|
+
}
|
|
268574
|
+
function buildTheme(themeName, mode) {
|
|
268575
|
+
const isDark = themeName.includes("dark");
|
|
268576
|
+
const isAnsi = themeName.includes("ansi");
|
|
268577
|
+
const isDaltonized = themeName.includes("daltonized");
|
|
268578
|
+
const tc = mode === "truecolor";
|
|
268579
|
+
if (isAnsi) {
|
|
268580
|
+
return {
|
|
268581
|
+
addLine: DEFAULT_BG,
|
|
268582
|
+
addWord: DEFAULT_BG,
|
|
268583
|
+
addDecoration: ansiIdx(10),
|
|
268584
|
+
deleteLine: DEFAULT_BG,
|
|
268585
|
+
deleteWord: DEFAULT_BG,
|
|
268586
|
+
deleteDecoration: ansiIdx(9),
|
|
268587
|
+
foreground: ansiIdx(7),
|
|
268588
|
+
background: DEFAULT_BG,
|
|
268589
|
+
scopes: ANSI_SCOPES
|
|
268590
|
+
};
|
|
268591
|
+
}
|
|
268592
|
+
if (isDark) {
|
|
268593
|
+
const fg2 = rgb2(248, 248, 242);
|
|
268594
|
+
const deleteLine2 = rgb2(61, 1, 0);
|
|
268595
|
+
const deleteWord2 = rgb2(92, 2, 0);
|
|
268596
|
+
const deleteDecoration2 = rgb2(220, 90, 90);
|
|
268597
|
+
if (isDaltonized) {
|
|
268598
|
+
return {
|
|
268599
|
+
addLine: tc ? rgb2(0, 27, 41) : ansiIdx(17),
|
|
268600
|
+
addWord: tc ? rgb2(0, 48, 71) : ansiIdx(24),
|
|
268601
|
+
addDecoration: rgb2(81, 160, 200),
|
|
268602
|
+
deleteLine: deleteLine2,
|
|
268603
|
+
deleteWord: deleteWord2,
|
|
268604
|
+
deleteDecoration: deleteDecoration2,
|
|
268605
|
+
foreground: fg2,
|
|
268606
|
+
background: DEFAULT_BG,
|
|
268607
|
+
scopes: MONOKAI_SCOPES
|
|
268608
|
+
};
|
|
268609
|
+
}
|
|
268610
|
+
return {
|
|
268611
|
+
addLine: tc ? rgb2(2, 40, 0) : ansiIdx(22),
|
|
268612
|
+
addWord: tc ? rgb2(4, 71, 0) : ansiIdx(28),
|
|
268613
|
+
addDecoration: rgb2(80, 200, 80),
|
|
268614
|
+
deleteLine: deleteLine2,
|
|
268615
|
+
deleteWord: deleteWord2,
|
|
268616
|
+
deleteDecoration: deleteDecoration2,
|
|
268617
|
+
foreground: fg2,
|
|
268618
|
+
background: DEFAULT_BG,
|
|
268619
|
+
scopes: MONOKAI_SCOPES
|
|
268620
|
+
};
|
|
268621
|
+
}
|
|
268622
|
+
const fg = rgb2(51, 51, 51);
|
|
268623
|
+
const deleteLine = rgb2(255, 220, 220);
|
|
268624
|
+
const deleteWord = rgb2(255, 199, 199);
|
|
268625
|
+
const deleteDecoration = rgb2(207, 34, 46);
|
|
268626
|
+
if (isDaltonized) {
|
|
268627
|
+
return {
|
|
268628
|
+
addLine: rgb2(219, 237, 255),
|
|
268629
|
+
addWord: rgb2(179, 217, 255),
|
|
268630
|
+
addDecoration: rgb2(36, 87, 138),
|
|
268631
|
+
deleteLine,
|
|
268632
|
+
deleteWord,
|
|
268633
|
+
deleteDecoration,
|
|
268634
|
+
foreground: fg,
|
|
268635
|
+
background: DEFAULT_BG,
|
|
268636
|
+
scopes: GITHUB_SCOPES
|
|
268637
|
+
};
|
|
268638
|
+
}
|
|
268639
|
+
return {
|
|
268640
|
+
addLine: rgb2(220, 255, 220),
|
|
268641
|
+
addWord: rgb2(178, 255, 178),
|
|
268642
|
+
addDecoration: rgb2(36, 138, 61),
|
|
268643
|
+
deleteLine,
|
|
268644
|
+
deleteWord,
|
|
268645
|
+
deleteDecoration,
|
|
268646
|
+
foreground: fg,
|
|
268647
|
+
background: DEFAULT_BG,
|
|
268648
|
+
scopes: GITHUB_SCOPES
|
|
268649
|
+
};
|
|
268650
|
+
}
|
|
268651
|
+
function defaultStyle3(theme) {
|
|
268652
|
+
return { foreground: theme.foreground, background: theme.background };
|
|
268653
|
+
}
|
|
268654
|
+
function lineBackground(marker, theme) {
|
|
268655
|
+
switch (marker) {
|
|
268656
|
+
case "+":
|
|
268657
|
+
return theme.addLine;
|
|
268658
|
+
case "-":
|
|
268659
|
+
return theme.deleteLine;
|
|
268660
|
+
case " ":
|
|
268661
|
+
return theme.background;
|
|
268662
|
+
}
|
|
268663
|
+
}
|
|
268664
|
+
function wordBackground(marker, theme) {
|
|
268665
|
+
switch (marker) {
|
|
268666
|
+
case "+":
|
|
268667
|
+
return theme.addWord;
|
|
268668
|
+
case "-":
|
|
268669
|
+
return theme.deleteWord;
|
|
268670
|
+
case " ":
|
|
268671
|
+
return theme.background;
|
|
268672
|
+
}
|
|
268673
|
+
}
|
|
268674
|
+
function decorationColor(marker, theme) {
|
|
268675
|
+
switch (marker) {
|
|
268676
|
+
case "+":
|
|
268677
|
+
return theme.addDecoration;
|
|
268678
|
+
case "-":
|
|
268679
|
+
return theme.deleteDecoration;
|
|
268680
|
+
case " ":
|
|
268681
|
+
return theme.foreground;
|
|
268682
|
+
}
|
|
268683
|
+
}
|
|
268684
|
+
function detectLanguage(filePath, firstLine) {
|
|
268685
|
+
const base2 = basename24(filePath);
|
|
268686
|
+
const ext = extname12(filePath).slice(1);
|
|
268687
|
+
const stem = base2.split(".")[0] ?? "";
|
|
268688
|
+
const byName = FILENAME_LANGS[base2] ?? FILENAME_LANGS[stem];
|
|
268689
|
+
if (byName && hljs().getLanguage(byName))
|
|
268690
|
+
return byName;
|
|
268691
|
+
if (ext) {
|
|
268692
|
+
const lang = hljs().getLanguage(ext);
|
|
268693
|
+
if (lang)
|
|
268694
|
+
return ext;
|
|
268695
|
+
}
|
|
268696
|
+
if (firstLine) {
|
|
268697
|
+
const line = firstLine.startsWith("\uFEFF") ? firstLine.slice(1) : firstLine;
|
|
268698
|
+
if (line.startsWith("#!")) {
|
|
268699
|
+
if (line.includes("bash") || line.includes("/sh"))
|
|
268700
|
+
return "bash";
|
|
268701
|
+
if (line.includes("python"))
|
|
268702
|
+
return "python";
|
|
268703
|
+
if (line.includes("node"))
|
|
268704
|
+
return "javascript";
|
|
268705
|
+
if (line.includes("ruby"))
|
|
268706
|
+
return "ruby";
|
|
268707
|
+
if (line.includes("perl"))
|
|
268708
|
+
return "perl";
|
|
268709
|
+
}
|
|
268710
|
+
if (line.startsWith("<?php"))
|
|
268711
|
+
return "php";
|
|
268712
|
+
if (line.startsWith("<?xml"))
|
|
268713
|
+
return "xml";
|
|
268714
|
+
}
|
|
268715
|
+
return null;
|
|
268716
|
+
}
|
|
268717
|
+
function scopeColor(scope, text, theme) {
|
|
268718
|
+
if (!scope)
|
|
268719
|
+
return theme.foreground;
|
|
268720
|
+
if (scope === "keyword" && STORAGE_KEYWORDS.has(text.trim())) {
|
|
268721
|
+
return theme.scopes["_storage"] ?? theme.foreground;
|
|
268722
|
+
}
|
|
268723
|
+
return theme.scopes[scope] ?? theme.scopes[scope.split(".")[0]] ?? theme.foreground;
|
|
268724
|
+
}
|
|
268725
|
+
function flattenHljs(node, theme, parentScope, out) {
|
|
268726
|
+
if (typeof node === "string") {
|
|
268727
|
+
const fg = scopeColor(parentScope, node, theme);
|
|
268728
|
+
out.push([{ foreground: fg, background: theme.background }, node]);
|
|
268729
|
+
return;
|
|
268730
|
+
}
|
|
268731
|
+
const scope = node.scope ?? node.kind ?? parentScope;
|
|
268732
|
+
for (const child of node.children) {
|
|
268733
|
+
flattenHljs(child, theme, scope, out);
|
|
268734
|
+
}
|
|
268735
|
+
}
|
|
268736
|
+
function extractEmitter(result) {
|
|
268737
|
+
if (typeof result !== "object" || result === null)
|
|
268738
|
+
return;
|
|
268739
|
+
const r = result;
|
|
268740
|
+
return r._emitter ?? r.emitter;
|
|
268741
|
+
}
|
|
268742
|
+
function hasRootNode(emitter) {
|
|
268743
|
+
return typeof emitter === "object" && emitter !== null && "rootNode" in emitter && typeof emitter.rootNode === "object" && emitter.rootNode !== null && "children" in emitter.rootNode;
|
|
268744
|
+
}
|
|
268745
|
+
function highlightLine(state, line, theme) {
|
|
268746
|
+
const code = line + `
|
|
268747
|
+
`;
|
|
268748
|
+
if (!state.lang) {
|
|
268749
|
+
return [[defaultStyle3(theme), code]];
|
|
268750
|
+
}
|
|
268751
|
+
let result;
|
|
268752
|
+
try {
|
|
268753
|
+
result = hljs().highlight(code, {
|
|
268754
|
+
language: state.lang,
|
|
268755
|
+
ignoreIllegals: true
|
|
268756
|
+
});
|
|
268757
|
+
} catch {
|
|
268758
|
+
return [[defaultStyle3(theme), code]];
|
|
268759
|
+
}
|
|
268760
|
+
const emitter = extractEmitter(result);
|
|
268761
|
+
if (!hasRootNode(emitter)) {
|
|
268762
|
+
if (!loggedEmitterShapeError) {
|
|
268763
|
+
loggedEmitterShapeError = true;
|
|
268764
|
+
const shape = emitter !== null && typeof emitter === "object" ? Object.keys(emitter).join(",") : String(emitter);
|
|
268765
|
+
logError2(new Error(`color-diff: hljs emitter shape mismatch (got: ${shape}). Syntax highlighting disabled.`));
|
|
268766
|
+
}
|
|
268767
|
+
return [[defaultStyle3(theme), code]];
|
|
268768
|
+
}
|
|
268769
|
+
const blocks = [];
|
|
268770
|
+
flattenHljs(emitter.rootNode, theme, undefined, blocks);
|
|
268771
|
+
return blocks;
|
|
268772
|
+
}
|
|
268773
|
+
function tokenize6(text) {
|
|
268774
|
+
const tokens = [];
|
|
268775
|
+
let i3 = 0;
|
|
268776
|
+
while (i3 < text.length) {
|
|
268777
|
+
const ch2 = text[i3];
|
|
268778
|
+
if (/[\p{L}\p{N}_]/u.test(ch2)) {
|
|
268779
|
+
let j2 = i3 + 1;
|
|
268780
|
+
while (j2 < text.length && /[\p{L}\p{N}_]/u.test(text[j2]))
|
|
268781
|
+
j2++;
|
|
268782
|
+
tokens.push(text.slice(i3, j2));
|
|
268783
|
+
i3 = j2;
|
|
268784
|
+
} else if (/\s/.test(ch2)) {
|
|
268785
|
+
let j2 = i3 + 1;
|
|
268786
|
+
while (j2 < text.length && /\s/.test(text[j2]))
|
|
268787
|
+
j2++;
|
|
268788
|
+
tokens.push(text.slice(i3, j2));
|
|
268789
|
+
i3 = j2;
|
|
268790
|
+
} else {
|
|
268791
|
+
const cp = text.codePointAt(i3);
|
|
268792
|
+
const len = cp > 65535 ? 2 : 1;
|
|
268793
|
+
tokens.push(text.slice(i3, i3 + len));
|
|
268794
|
+
i3 += len;
|
|
268795
|
+
}
|
|
268796
|
+
}
|
|
268797
|
+
return tokens;
|
|
268798
|
+
}
|
|
268799
|
+
function findAdjacentPairs(markers) {
|
|
268800
|
+
const pairs = [];
|
|
268801
|
+
let i3 = 0;
|
|
268802
|
+
while (i3 < markers.length) {
|
|
268803
|
+
if (markers[i3] === "-") {
|
|
268804
|
+
const delStart = i3;
|
|
268805
|
+
let delEnd = i3;
|
|
268806
|
+
while (delEnd < markers.length && markers[delEnd] === "-")
|
|
268807
|
+
delEnd++;
|
|
268808
|
+
let addEnd = delEnd;
|
|
268809
|
+
while (addEnd < markers.length && markers[addEnd] === "+")
|
|
268810
|
+
addEnd++;
|
|
268811
|
+
const delCount = delEnd - delStart;
|
|
268812
|
+
const addCount = addEnd - delEnd;
|
|
268813
|
+
if (delCount > 0 && addCount > 0) {
|
|
268814
|
+
const n2 = Math.min(delCount, addCount);
|
|
268815
|
+
for (let k2 = 0;k2 < n2; k2++) {
|
|
268816
|
+
pairs.push([delStart + k2, delEnd + k2]);
|
|
268817
|
+
}
|
|
268818
|
+
i3 = addEnd;
|
|
268819
|
+
} else {
|
|
268820
|
+
i3 = delEnd;
|
|
268821
|
+
}
|
|
268822
|
+
} else {
|
|
268823
|
+
i3++;
|
|
268824
|
+
}
|
|
268825
|
+
}
|
|
268826
|
+
return pairs;
|
|
268827
|
+
}
|
|
268828
|
+
function wordDiffStrings(oldStr, newStr) {
|
|
268829
|
+
const oldTokens = tokenize6(oldStr);
|
|
268830
|
+
const newTokens = tokenize6(newStr);
|
|
268831
|
+
const ops = diffArrays(oldTokens, newTokens);
|
|
268832
|
+
const totalLen = oldStr.length + newStr.length;
|
|
268833
|
+
let changedLen = 0;
|
|
268834
|
+
const oldRanges = [];
|
|
268835
|
+
const newRanges = [];
|
|
268836
|
+
let oldOff = 0;
|
|
268837
|
+
let newOff = 0;
|
|
268838
|
+
for (const op of ops) {
|
|
268839
|
+
const len = op.value.reduce((s, t) => s + t.length, 0);
|
|
268840
|
+
if (op.removed) {
|
|
268841
|
+
changedLen += len;
|
|
268842
|
+
oldRanges.push({ start: oldOff, end: oldOff + len });
|
|
268843
|
+
oldOff += len;
|
|
268844
|
+
} else if (op.added) {
|
|
268845
|
+
changedLen += len;
|
|
268846
|
+
newRanges.push({ start: newOff, end: newOff + len });
|
|
268847
|
+
newOff += len;
|
|
268848
|
+
} else {
|
|
268849
|
+
oldOff += len;
|
|
268850
|
+
newOff += len;
|
|
268851
|
+
}
|
|
268852
|
+
}
|
|
268853
|
+
if (totalLen > 0 && changedLen / totalLen > CHANGE_THRESHOLD) {
|
|
268854
|
+
return [[], []];
|
|
268855
|
+
}
|
|
268856
|
+
return [oldRanges, newRanges];
|
|
268857
|
+
}
|
|
268858
|
+
function removeNewlines(h2) {
|
|
268859
|
+
h2.lines = h2.lines.map((line) => line.flatMap(([style, text]) => text.split(`
|
|
268860
|
+
`).filter((p) => p.length > 0).map((p) => [style, p])));
|
|
268861
|
+
}
|
|
268862
|
+
function charWidth(ch2) {
|
|
268863
|
+
return stringWidth(ch2);
|
|
268864
|
+
}
|
|
268865
|
+
function wrapText5(h2, width, theme) {
|
|
268866
|
+
const newLines = [];
|
|
268867
|
+
for (const line of h2.lines) {
|
|
268868
|
+
const queue2 = line.slice();
|
|
268869
|
+
let cur = [];
|
|
268870
|
+
let curW = 0;
|
|
268871
|
+
while (queue2.length > 0) {
|
|
268872
|
+
const [style, text] = queue2.shift();
|
|
268873
|
+
const tw = stringWidth(text);
|
|
268874
|
+
if (curW + tw <= width) {
|
|
268875
|
+
cur.push([style, text]);
|
|
268876
|
+
curW += tw;
|
|
268877
|
+
} else {
|
|
268878
|
+
const remaining = width - curW;
|
|
268879
|
+
let bytePos = 0;
|
|
268880
|
+
let accW = 0;
|
|
268881
|
+
for (const ch2 of text) {
|
|
268882
|
+
const cw = charWidth(ch2);
|
|
268883
|
+
if (accW + cw > remaining)
|
|
268884
|
+
break;
|
|
268885
|
+
accW += cw;
|
|
268886
|
+
bytePos += ch2.length;
|
|
268887
|
+
}
|
|
268888
|
+
if (bytePos === 0) {
|
|
268889
|
+
if (curW === 0) {
|
|
268890
|
+
const firstCp = text.codePointAt(0);
|
|
268891
|
+
bytePos = firstCp > 65535 ? 2 : 1;
|
|
268892
|
+
} else {
|
|
268893
|
+
newLines.push(cur);
|
|
268894
|
+
queue2.unshift([style, text]);
|
|
268895
|
+
cur = [];
|
|
268896
|
+
curW = 0;
|
|
268897
|
+
continue;
|
|
268898
|
+
}
|
|
268899
|
+
}
|
|
268900
|
+
cur.push([style, text.slice(0, bytePos)]);
|
|
268901
|
+
newLines.push(cur);
|
|
268902
|
+
queue2.unshift([style, text.slice(bytePos)]);
|
|
268903
|
+
cur = [];
|
|
268904
|
+
curW = 0;
|
|
268905
|
+
}
|
|
268906
|
+
}
|
|
268907
|
+
newLines.push(cur);
|
|
268908
|
+
}
|
|
268909
|
+
h2.lines = newLines;
|
|
268910
|
+
if (h2.marker && h2.marker !== " ") {
|
|
268911
|
+
const bg = lineBackground(h2.marker, theme);
|
|
268912
|
+
const padStyle = { foreground: theme.foreground, background: bg };
|
|
268913
|
+
for (const line of h2.lines) {
|
|
268914
|
+
const curW = line.reduce((s, [, t]) => s + stringWidth(t), 0);
|
|
268915
|
+
if (curW < width) {
|
|
268916
|
+
line.push([padStyle, " ".repeat(width - curW)]);
|
|
268917
|
+
}
|
|
268918
|
+
}
|
|
268919
|
+
}
|
|
268920
|
+
}
|
|
268921
|
+
function addLineNumber(h2, theme, maxDigits, fullDim) {
|
|
268922
|
+
const style = {
|
|
268923
|
+
foreground: h2.marker ? decorationColor(h2.marker, theme) : theme.foreground,
|
|
268924
|
+
background: h2.marker ? lineBackground(h2.marker, theme) : theme.background
|
|
268925
|
+
};
|
|
268926
|
+
const shouldDim = h2.marker === null || h2.marker === " ";
|
|
268927
|
+
for (let i3 = 0;i3 < h2.lines.length; i3++) {
|
|
268928
|
+
const prefix = i3 === 0 ? ` ${String(h2.lineNumber).padStart(maxDigits)} ` : " ".repeat(maxDigits + 2);
|
|
268929
|
+
const wrapped = shouldDim && !fullDim ? `${DIM}${prefix}${UNDIM}` : prefix;
|
|
268930
|
+
h2.lines[i3].unshift([style, wrapped]);
|
|
268931
|
+
}
|
|
268932
|
+
}
|
|
268933
|
+
function addMarker(h2, theme) {
|
|
268934
|
+
if (!h2.marker)
|
|
268935
|
+
return;
|
|
268936
|
+
const style = {
|
|
268937
|
+
foreground: decorationColor(h2.marker, theme),
|
|
268938
|
+
background: lineBackground(h2.marker, theme)
|
|
268939
|
+
};
|
|
268940
|
+
for (const line of h2.lines) {
|
|
268941
|
+
line.unshift([style, h2.marker]);
|
|
268942
|
+
}
|
|
268943
|
+
}
|
|
268944
|
+
function dimContent(h2) {
|
|
268945
|
+
for (const line of h2.lines) {
|
|
268946
|
+
if (line.length > 0) {
|
|
268947
|
+
line[0][1] = DIM + line[0][1];
|
|
268948
|
+
const last2 = line.length - 1;
|
|
268949
|
+
line[last2][1] = line[last2][1] + UNDIM;
|
|
268950
|
+
}
|
|
268951
|
+
}
|
|
268952
|
+
}
|
|
268953
|
+
function applyBackground(h2, theme, ranges) {
|
|
268954
|
+
if (!h2.marker)
|
|
268955
|
+
return;
|
|
268956
|
+
const lineBg = lineBackground(h2.marker, theme);
|
|
268957
|
+
const wordBg = wordBackground(h2.marker, theme);
|
|
268958
|
+
let rangeIdx = 0;
|
|
268959
|
+
let byteOff = 0;
|
|
268960
|
+
for (let li = 0;li < h2.lines.length; li++) {
|
|
268961
|
+
const newLine = [];
|
|
268962
|
+
for (const [style, text] of h2.lines[li]) {
|
|
268963
|
+
const textStart = byteOff;
|
|
268964
|
+
const textEnd = byteOff + text.length;
|
|
268965
|
+
while (rangeIdx < ranges.length && ranges[rangeIdx].end <= textStart) {
|
|
268966
|
+
rangeIdx++;
|
|
268967
|
+
}
|
|
268968
|
+
if (rangeIdx >= ranges.length) {
|
|
268969
|
+
newLine.push([{ ...style, background: lineBg }, text]);
|
|
268970
|
+
byteOff = textEnd;
|
|
268971
|
+
continue;
|
|
268972
|
+
}
|
|
268973
|
+
let remaining = text;
|
|
268974
|
+
let pos = textStart;
|
|
268975
|
+
while (remaining.length > 0 && rangeIdx < ranges.length) {
|
|
268976
|
+
const r = ranges[rangeIdx];
|
|
268977
|
+
const inRange = pos >= r.start && pos < r.end;
|
|
268978
|
+
let next;
|
|
268979
|
+
if (inRange) {
|
|
268980
|
+
next = Math.min(r.end, textEnd);
|
|
268981
|
+
} else if (r.start > pos && r.start < textEnd) {
|
|
268982
|
+
next = r.start;
|
|
268983
|
+
} else {
|
|
268984
|
+
next = textEnd;
|
|
268985
|
+
}
|
|
268986
|
+
const segLen = next - pos;
|
|
268987
|
+
const seg = remaining.slice(0, segLen);
|
|
268988
|
+
newLine.push([{ ...style, background: inRange ? wordBg : lineBg }, seg]);
|
|
268989
|
+
remaining = remaining.slice(segLen);
|
|
268990
|
+
pos = next;
|
|
268991
|
+
if (pos >= r.end)
|
|
268992
|
+
rangeIdx++;
|
|
268993
|
+
}
|
|
268994
|
+
if (remaining.length > 0) {
|
|
268995
|
+
newLine.push([{ ...style, background: lineBg }, remaining]);
|
|
268996
|
+
}
|
|
268997
|
+
byteOff = textEnd;
|
|
268998
|
+
}
|
|
268999
|
+
h2.lines[li] = newLine;
|
|
269000
|
+
}
|
|
269001
|
+
}
|
|
269002
|
+
function intoLines(h2, dim2, skipBg, mode) {
|
|
269003
|
+
return h2.lines.map((line) => asTerminalEscaped(line, mode, skipBg, dim2));
|
|
269004
|
+
}
|
|
269005
|
+
function maxLineNumber(hunk) {
|
|
269006
|
+
const oldEnd = Math.max(0, hunk.oldStart + hunk.oldLines - 1);
|
|
269007
|
+
const newEnd = Math.max(0, hunk.newStart + hunk.newLines - 1);
|
|
269008
|
+
return Math.max(oldEnd, newEnd);
|
|
269009
|
+
}
|
|
269010
|
+
function parseMarker(s) {
|
|
269011
|
+
return s === "+" || s === "-" ? s : " ";
|
|
269012
|
+
}
|
|
269013
|
+
|
|
269014
|
+
class ColorDiff {
|
|
269015
|
+
hunk;
|
|
269016
|
+
filePath;
|
|
269017
|
+
firstLine;
|
|
269018
|
+
prefixContent;
|
|
269019
|
+
constructor(hunk, firstLine, filePath, prefixContent) {
|
|
269020
|
+
this.hunk = hunk;
|
|
269021
|
+
this.filePath = filePath;
|
|
269022
|
+
this.firstLine = firstLine;
|
|
269023
|
+
this.prefixContent = prefixContent ?? null;
|
|
269024
|
+
}
|
|
269025
|
+
render(themeName, width, dim2) {
|
|
269026
|
+
const mode = detectColorMode(themeName);
|
|
269027
|
+
const theme = buildTheme(themeName, mode);
|
|
269028
|
+
const lang = detectLanguage(this.filePath, this.firstLine);
|
|
269029
|
+
const hlState = { lang, stack: null };
|
|
269030
|
+
this.prefixContent;
|
|
269031
|
+
const maxDigits = String(maxLineNumber(this.hunk)).length;
|
|
269032
|
+
let oldLine = this.hunk.oldStart;
|
|
269033
|
+
let newLine = this.hunk.newStart;
|
|
269034
|
+
const effectiveWidth = Math.max(1, width - maxDigits - 2 - 1);
|
|
269035
|
+
const entries = this.hunk.lines.map((rawLine) => {
|
|
269036
|
+
const marker = parseMarker(rawLine.slice(0, 1));
|
|
269037
|
+
const code = rawLine.slice(1);
|
|
269038
|
+
let lineNumber;
|
|
269039
|
+
switch (marker) {
|
|
269040
|
+
case "+":
|
|
269041
|
+
lineNumber = newLine++;
|
|
269042
|
+
break;
|
|
269043
|
+
case "-":
|
|
269044
|
+
lineNumber = oldLine++;
|
|
269045
|
+
break;
|
|
269046
|
+
case " ":
|
|
269047
|
+
lineNumber = newLine;
|
|
269048
|
+
oldLine++;
|
|
269049
|
+
newLine++;
|
|
269050
|
+
break;
|
|
269051
|
+
}
|
|
269052
|
+
return { lineNumber, marker, code };
|
|
269053
|
+
});
|
|
269054
|
+
const ranges = entries.map(() => []);
|
|
269055
|
+
if (!dim2) {
|
|
269056
|
+
const markers = entries.map((e) => e.marker);
|
|
269057
|
+
for (const [delIdx, addIdx] of findAdjacentPairs(markers)) {
|
|
269058
|
+
const [delR, addR] = wordDiffStrings(entries[delIdx].code, entries[addIdx].code);
|
|
269059
|
+
ranges[delIdx] = delR;
|
|
269060
|
+
ranges[addIdx] = addR;
|
|
269061
|
+
}
|
|
269062
|
+
}
|
|
269063
|
+
const out = [];
|
|
269064
|
+
for (let i3 = 0;i3 < entries.length; i3++) {
|
|
269065
|
+
const { lineNumber, marker, code } = entries[i3];
|
|
269066
|
+
const tokens = marker === "-" ? [[defaultStyle3(theme), code]] : highlightLine(hlState, code, theme);
|
|
269067
|
+
const h2 = { marker, lineNumber, lines: [tokens] };
|
|
269068
|
+
removeNewlines(h2);
|
|
269069
|
+
applyBackground(h2, theme, ranges[i3]);
|
|
269070
|
+
wrapText5(h2, effectiveWidth, theme);
|
|
269071
|
+
if (mode === "ansi" && marker === "-") {
|
|
269072
|
+
dimContent(h2);
|
|
269073
|
+
}
|
|
269074
|
+
addMarker(h2, theme);
|
|
269075
|
+
addLineNumber(h2, theme, maxDigits, dim2);
|
|
269076
|
+
out.push(...intoLines(h2, dim2, false, mode));
|
|
269077
|
+
}
|
|
269078
|
+
return out;
|
|
269079
|
+
}
|
|
269080
|
+
}
|
|
269081
|
+
|
|
269082
|
+
class ColorFile {
|
|
269083
|
+
code;
|
|
269084
|
+
filePath;
|
|
269085
|
+
constructor(code, filePath) {
|
|
269086
|
+
this.code = code;
|
|
269087
|
+
this.filePath = filePath;
|
|
269088
|
+
}
|
|
269089
|
+
render(themeName, width, dim2) {
|
|
269090
|
+
const mode = detectColorMode(themeName);
|
|
269091
|
+
const theme = buildTheme(themeName, mode);
|
|
269092
|
+
const lines = this.code.split(`
|
|
269093
|
+
`);
|
|
269094
|
+
if (lines.length > 0 && lines[lines.length - 1] === "")
|
|
269095
|
+
lines.pop();
|
|
269096
|
+
const firstLine = lines[0] ?? null;
|
|
269097
|
+
const lang = detectLanguage(this.filePath, firstLine);
|
|
269098
|
+
const hlState = { lang, stack: null };
|
|
269099
|
+
const maxDigits = String(lines.length).length;
|
|
269100
|
+
const effectiveWidth = Math.max(1, width - maxDigits - 2);
|
|
269101
|
+
const out = [];
|
|
269102
|
+
for (let i3 = 0;i3 < lines.length; i3++) {
|
|
269103
|
+
const tokens = highlightLine(hlState, lines[i3], theme);
|
|
269104
|
+
const h2 = { marker: null, lineNumber: i3 + 1, lines: [tokens] };
|
|
269105
|
+
removeNewlines(h2);
|
|
269106
|
+
wrapText5(h2, effectiveWidth, theme);
|
|
269107
|
+
addLineNumber(h2, theme, maxDigits, dim2);
|
|
269108
|
+
out.push(...intoLines(h2, dim2, true, mode));
|
|
269109
|
+
}
|
|
269110
|
+
return out;
|
|
269111
|
+
}
|
|
269112
|
+
}
|
|
269113
|
+
function getSyntaxTheme(themeName) {
|
|
269114
|
+
const envTheme = process.env.THEUS_CODE_SYNTAX_HIGHLIGHT ?? process.env.BAT_THEME;
|
|
269115
|
+
return { theme: defaultSyntaxThemeName(themeName), source: null };
|
|
269116
|
+
}
|
|
269117
|
+
var cachedHljs = null, RESET = "\x1B[0m", DIM = "\x1B[2m", UNDIM = "\x1B[22m", DEFAULT_BG, CUBE_LEVELS, MONOKAI_SCOPES, GITHUB_SCOPES, STORAGE_KEYWORDS, ANSI_SCOPES, FILENAME_LANGS, loggedEmitterShapeError = false, CHANGE_THRESHOLD = 0.4;
|
|
269118
|
+
var init_color_diff = __esm(() => {
|
|
269119
|
+
init_lib();
|
|
269120
|
+
init_stringWidth();
|
|
269121
|
+
init_log2();
|
|
269122
|
+
DEFAULT_BG = { r: 0, g: 0, b: 0, a: 1 };
|
|
269123
|
+
CUBE_LEVELS = [0, 95, 135, 175, 215, 255];
|
|
269124
|
+
MONOKAI_SCOPES = {
|
|
269125
|
+
keyword: rgb2(249, 38, 114),
|
|
269126
|
+
_storage: rgb2(102, 217, 239),
|
|
269127
|
+
built_in: rgb2(166, 226, 46),
|
|
269128
|
+
type: rgb2(166, 226, 46),
|
|
269129
|
+
literal: rgb2(190, 132, 255),
|
|
269130
|
+
number: rgb2(190, 132, 255),
|
|
269131
|
+
string: rgb2(230, 219, 116),
|
|
269132
|
+
title: rgb2(166, 226, 46),
|
|
269133
|
+
"title.function": rgb2(166, 226, 46),
|
|
269134
|
+
"title.class": rgb2(166, 226, 46),
|
|
269135
|
+
"title.class.inherited": rgb2(166, 226, 46),
|
|
269136
|
+
params: rgb2(253, 151, 31),
|
|
269137
|
+
comment: rgb2(117, 113, 94),
|
|
269138
|
+
meta: rgb2(117, 113, 94),
|
|
269139
|
+
attr: rgb2(166, 226, 46),
|
|
269140
|
+
attribute: rgb2(166, 226, 46),
|
|
269141
|
+
variable: rgb2(255, 255, 255),
|
|
269142
|
+
"variable.language": rgb2(255, 255, 255),
|
|
269143
|
+
property: rgb2(255, 255, 255),
|
|
269144
|
+
operator: rgb2(249, 38, 114),
|
|
269145
|
+
punctuation: rgb2(248, 248, 242),
|
|
269146
|
+
symbol: rgb2(190, 132, 255),
|
|
269147
|
+
regexp: rgb2(230, 219, 116),
|
|
269148
|
+
subst: rgb2(248, 248, 242)
|
|
269149
|
+
};
|
|
269150
|
+
GITHUB_SCOPES = {
|
|
269151
|
+
keyword: rgb2(167, 29, 93),
|
|
269152
|
+
_storage: rgb2(167, 29, 93),
|
|
269153
|
+
built_in: rgb2(0, 134, 179),
|
|
269154
|
+
type: rgb2(0, 134, 179),
|
|
269155
|
+
literal: rgb2(0, 134, 179),
|
|
269156
|
+
number: rgb2(0, 134, 179),
|
|
269157
|
+
string: rgb2(24, 54, 145),
|
|
269158
|
+
title: rgb2(121, 93, 163),
|
|
269159
|
+
"title.function": rgb2(121, 93, 163),
|
|
269160
|
+
"title.class": rgb2(0, 0, 0),
|
|
269161
|
+
"title.class.inherited": rgb2(0, 0, 0),
|
|
269162
|
+
params: rgb2(0, 134, 179),
|
|
269163
|
+
comment: rgb2(150, 152, 150),
|
|
269164
|
+
meta: rgb2(150, 152, 150),
|
|
269165
|
+
attr: rgb2(0, 134, 179),
|
|
269166
|
+
attribute: rgb2(0, 134, 179),
|
|
269167
|
+
variable: rgb2(0, 134, 179),
|
|
269168
|
+
"variable.language": rgb2(0, 134, 179),
|
|
269169
|
+
property: rgb2(0, 134, 179),
|
|
269170
|
+
operator: rgb2(167, 29, 93),
|
|
269171
|
+
punctuation: rgb2(51, 51, 51),
|
|
269172
|
+
symbol: rgb2(0, 134, 179),
|
|
269173
|
+
regexp: rgb2(24, 54, 145),
|
|
269174
|
+
subst: rgb2(51, 51, 51)
|
|
269175
|
+
};
|
|
269176
|
+
STORAGE_KEYWORDS = new Set([
|
|
269177
|
+
"const",
|
|
269178
|
+
"let",
|
|
269179
|
+
"var",
|
|
269180
|
+
"function",
|
|
269181
|
+
"class",
|
|
269182
|
+
"type",
|
|
269183
|
+
"interface",
|
|
269184
|
+
"enum",
|
|
269185
|
+
"namespace",
|
|
269186
|
+
"module",
|
|
269187
|
+
"def",
|
|
269188
|
+
"fn",
|
|
269189
|
+
"func",
|
|
269190
|
+
"struct",
|
|
269191
|
+
"trait",
|
|
269192
|
+
"impl"
|
|
269193
|
+
]);
|
|
269194
|
+
ANSI_SCOPES = {
|
|
269195
|
+
keyword: ansiIdx(13),
|
|
269196
|
+
_storage: ansiIdx(14),
|
|
269197
|
+
built_in: ansiIdx(14),
|
|
269198
|
+
type: ansiIdx(14),
|
|
269199
|
+
literal: ansiIdx(12),
|
|
269200
|
+
number: ansiIdx(12),
|
|
269201
|
+
string: ansiIdx(10),
|
|
269202
|
+
title: ansiIdx(11),
|
|
269203
|
+
"title.function": ansiIdx(11),
|
|
269204
|
+
"title.class": ansiIdx(11),
|
|
269205
|
+
comment: ansiIdx(8),
|
|
269206
|
+
meta: ansiIdx(8)
|
|
269207
|
+
};
|
|
269208
|
+
FILENAME_LANGS = {
|
|
269209
|
+
Dockerfile: "dockerfile",
|
|
269210
|
+
Makefile: "makefile",
|
|
269211
|
+
Rakefile: "ruby",
|
|
269212
|
+
Gemfile: "ruby",
|
|
269213
|
+
CMakeLists: "cmake"
|
|
269214
|
+
};
|
|
268496
269215
|
});
|
|
268497
269216
|
|
|
268498
269217
|
// components/StructuredDiff/colorDiff.ts
|
|
@@ -268512,7 +269231,7 @@ function getSyntaxTheme2(themeName) {
|
|
|
268512
269231
|
return getColorModuleUnavailableReason() === null ? getSyntaxTheme(themeName) : null;
|
|
268513
269232
|
}
|
|
268514
269233
|
var init_colorDiff = __esm(() => {
|
|
268515
|
-
|
|
269234
|
+
init_color_diff();
|
|
268516
269235
|
init_envUtils();
|
|
268517
269236
|
});
|
|
268518
269237
|
|
|
@@ -268890,7 +269609,7 @@ function generateWordDiffElements(item, width, maxWidth, dim2, overrideTheme) {
|
|
|
268890
269609
|
const totalLength = removedLineText.length + addedLineText.length;
|
|
268891
269610
|
const changedLength = wordDiffs.filter((part) => part.added || part.removed).reduce((sum, part) => sum + part.value.length, 0);
|
|
268892
269611
|
const changeRatio = changedLength / totalLength;
|
|
268893
|
-
if (changeRatio >
|
|
269612
|
+
if (changeRatio > CHANGE_THRESHOLD2 || dim2) {
|
|
268894
269613
|
return null;
|
|
268895
269614
|
}
|
|
268896
269615
|
const diffPrefix = type === "add" ? "+" : "-";
|
|
@@ -268991,10 +269710,10 @@ function formatDiff(lines, startingLineNumber, width, dim2, overrideTheme) {
|
|
|
268991
269710
|
const lineObjects = transformLinesToObjects(lines);
|
|
268992
269711
|
const processedLines = processAdjacentLines(lineObjects);
|
|
268993
269712
|
const ls = numberDiffLines(processedLines, startingLineNumber);
|
|
268994
|
-
const
|
|
269713
|
+
const maxLineNumber2 = Math.max(...ls.map(({
|
|
268995
269714
|
i: i3
|
|
268996
269715
|
}) => i3), 0);
|
|
268997
|
-
const maxWidth = Math.max(
|
|
269716
|
+
const maxWidth = Math.max(maxLineNumber2.toString().length + 1, 0);
|
|
268998
269717
|
return ls.flatMap((item) => {
|
|
268999
269718
|
const {
|
|
269000
269719
|
type,
|
|
@@ -269112,7 +269831,7 @@ function numberDiffLines(diff3, startLine) {
|
|
|
269112
269831
|
}
|
|
269113
269832
|
return result;
|
|
269114
269833
|
}
|
|
269115
|
-
var jsx_runtime128,
|
|
269834
|
+
var jsx_runtime128, CHANGE_THRESHOLD2 = 0.4;
|
|
269116
269835
|
var init_Fallback2 = __esm(() => {
|
|
269117
269836
|
init_compiler_runtime();
|
|
269118
269837
|
init_lib();
|
|
@@ -269123,8 +269842,8 @@ var init_Fallback2 = __esm(() => {
|
|
|
269123
269842
|
|
|
269124
269843
|
// components/StructuredDiff.tsx
|
|
269125
269844
|
function computeGutterWidth(patch) {
|
|
269126
|
-
const
|
|
269127
|
-
return
|
|
269845
|
+
const maxLineNumber2 = Math.max(patch.oldStart + patch.oldLines - 1, patch.newStart + patch.newLines - 1, 1);
|
|
269846
|
+
return maxLineNumber2.toString().length + 3;
|
|
269128
269847
|
}
|
|
269129
269848
|
function renderColorDiff(patch, firstLine, filePath, fileContent, theme, width, dim2, splitGutter) {
|
|
269130
269849
|
const ColorDiff2 = expectColorDiff();
|
|
@@ -271715,13 +272434,13 @@ var init_orphanedPluginFilter = __esm(() => {
|
|
|
271715
272434
|
});
|
|
271716
272435
|
|
|
271717
272436
|
// utils/glob.ts
|
|
271718
|
-
import { basename as
|
|
272437
|
+
import { basename as basename25, dirname as dirname36, isAbsolute as isAbsolute22, join as join87, sep as sep21 } from "path";
|
|
271719
272438
|
function extractGlobBaseDirectory(pattern) {
|
|
271720
272439
|
const globChars = /[*?[{]/;
|
|
271721
272440
|
const match = pattern.match(globChars);
|
|
271722
272441
|
if (!match || match.index === undefined) {
|
|
271723
272442
|
const dir = dirname36(pattern);
|
|
271724
|
-
const file2 =
|
|
272443
|
+
const file2 = basename25(pattern);
|
|
271725
272444
|
return { baseDir: dir, relativePattern: file2 };
|
|
271726
272445
|
}
|
|
271727
272446
|
const staticPrefix = pattern.slice(0, match.index);
|
|
@@ -273057,7 +273776,7 @@ var init_UI12 = __esm(() => {
|
|
|
273057
273776
|
});
|
|
273058
273777
|
|
|
273059
273778
|
// tools/NotebookEditTool/NotebookEditTool.ts
|
|
273060
|
-
import { extname as
|
|
273779
|
+
import { extname as extname13, isAbsolute as isAbsolute23, resolve as resolve32 } from "path";
|
|
273061
273780
|
var inputSchema16, outputSchema13, NotebookEditTool;
|
|
273062
273781
|
var init_NotebookEditTool = __esm(() => {
|
|
273063
273782
|
init_fileHistory();
|
|
@@ -273171,7 +273890,7 @@ var init_NotebookEditTool = __esm(() => {
|
|
|
273171
273890
|
if (fullPath.startsWith("\\\\") || fullPath.startsWith("//")) {
|
|
273172
273891
|
return { result: true };
|
|
273173
273892
|
}
|
|
273174
|
-
if (
|
|
273893
|
+
if (extname13(fullPath) !== ".ipynb") {
|
|
273175
273894
|
return {
|
|
273176
273895
|
result: false,
|
|
273177
273896
|
message: "File must be a Jupyter notebook (.ipynb file). For editing other file types, use the FileEdit tool.",
|
|
@@ -274171,7 +274890,7 @@ To complete your request, I need to fetch content from the redirected URL. Pleas
|
|
|
274171
274890
|
|
|
274172
274891
|
// utils/listSessionsImpl.ts
|
|
274173
274892
|
import { readdir as readdir14, stat as stat27 } from "fs/promises";
|
|
274174
|
-
import { basename as
|
|
274893
|
+
import { basename as basename26, join as join88 } from "path";
|
|
274175
274894
|
async function listCandidates(projectDir, doStat, projectPath) {
|
|
274176
274895
|
let names;
|
|
274177
274896
|
try {
|
|
@@ -278502,10 +279221,10 @@ function __stub8(ref) {
|
|
|
278502
279221
|
}
|
|
278503
279222
|
});
|
|
278504
279223
|
}
|
|
278505
|
-
var __module8 = "tools/TungstenTool/TungstenTool.js",
|
|
279224
|
+
var __module8 = "tools/TungstenTool/TungstenTool.js", _s19, TungstenTool_default, TungstenTool;
|
|
278506
279225
|
var init_TungstenTool = __esm(() => {
|
|
278507
|
-
|
|
278508
|
-
TungstenTool_default =
|
|
279226
|
+
_s19 = __stub8(__module8);
|
|
279227
|
+
TungstenTool_default = _s19;
|
|
278509
279228
|
TungstenTool = __stub8(__module8 + "#TungstenTool");
|
|
278510
279229
|
});
|
|
278511
279230
|
|
|
@@ -282830,10 +283549,10 @@ function __stub9(ref) {
|
|
|
282830
283549
|
}
|
|
282831
283550
|
});
|
|
282832
283551
|
}
|
|
282833
|
-
var __module9 = "tools/REPLTool/REPLTool.js",
|
|
283552
|
+
var __module9 = "tools/REPLTool/REPLTool.js", _s20, REPLTool_default;
|
|
282834
283553
|
var init_REPLTool = __esm(() => {
|
|
282835
|
-
|
|
282836
|
-
REPLTool_default =
|
|
283554
|
+
_s20 = __stub9(__module9);
|
|
283555
|
+
REPLTool_default = _s20;
|
|
282837
283556
|
});
|
|
282838
283557
|
|
|
282839
283558
|
// tools/SuggestBackgroundPRTool/SuggestBackgroundPRTool.js
|
|
@@ -282882,10 +283601,10 @@ function __stub10(ref) {
|
|
|
282882
283601
|
}
|
|
282883
283602
|
});
|
|
282884
283603
|
}
|
|
282885
|
-
var __module10 = "tools/SuggestBackgroundPRTool/SuggestBackgroundPRTool.js",
|
|
283604
|
+
var __module10 = "tools/SuggestBackgroundPRTool/SuggestBackgroundPRTool.js", _s21, SuggestBackgroundPRTool_default;
|
|
282886
283605
|
var init_SuggestBackgroundPRTool = __esm(() => {
|
|
282887
|
-
|
|
282888
|
-
SuggestBackgroundPRTool_default =
|
|
283606
|
+
_s21 = __stub10(__module10);
|
|
283607
|
+
SuggestBackgroundPRTool_default = _s21;
|
|
282889
283608
|
});
|
|
282890
283609
|
|
|
282891
283610
|
// tools/SleepTool/UI.tsx
|
|
@@ -285655,10 +286374,330 @@ function __stub11(ref) {
|
|
|
285655
286374
|
}
|
|
285656
286375
|
});
|
|
285657
286376
|
}
|
|
285658
|
-
var __module11 = "tools/VerifyPlanExecutionTool/VerifyPlanExecutionTool.js",
|
|
286377
|
+
var __module11 = "tools/VerifyPlanExecutionTool/VerifyPlanExecutionTool.js", _s22, VerifyPlanExecutionTool_default;
|
|
285659
286378
|
var init_VerifyPlanExecutionTool = __esm(() => {
|
|
285660
|
-
|
|
285661
|
-
VerifyPlanExecutionTool_default =
|
|
286379
|
+
_s22 = __stub11(__module11);
|
|
286380
|
+
VerifyPlanExecutionTool_default = _s22;
|
|
286381
|
+
});
|
|
286382
|
+
|
|
286383
|
+
// utils/terminalPanel.ts
|
|
286384
|
+
import { spawn as spawn7, spawnSync as spawnSync5 } from "child_process";
|
|
286385
|
+
function getTerminalPanelSocket() {
|
|
286386
|
+
const sessionId = getSessionId();
|
|
286387
|
+
return `theus-panel-${sessionId.slice(0, 8)}`;
|
|
286388
|
+
}
|
|
286389
|
+
function getTerminalPanel() {
|
|
286390
|
+
if (!instance) {
|
|
286391
|
+
instance = new TerminalPanel;
|
|
286392
|
+
}
|
|
286393
|
+
return instance;
|
|
286394
|
+
}
|
|
286395
|
+
|
|
286396
|
+
class TerminalPanel {
|
|
286397
|
+
hasTmux;
|
|
286398
|
+
cleanupRegistered = false;
|
|
286399
|
+
toggle() {
|
|
286400
|
+
this.showShell();
|
|
286401
|
+
}
|
|
286402
|
+
checkTmux() {
|
|
286403
|
+
if (this.hasTmux !== undefined)
|
|
286404
|
+
return this.hasTmux;
|
|
286405
|
+
const result = spawnSync5("tmux", ["-V"], { encoding: "utf-8" });
|
|
286406
|
+
this.hasTmux = result.status === 0;
|
|
286407
|
+
if (!this.hasTmux) {
|
|
286408
|
+
logForDebugging("Terminal panel: tmux not found, falling back to non-persistent shell");
|
|
286409
|
+
}
|
|
286410
|
+
return this.hasTmux;
|
|
286411
|
+
}
|
|
286412
|
+
hasSession() {
|
|
286413
|
+
const result = spawnSync5("tmux", ["-L", getTerminalPanelSocket(), "has-session", "-t", TMUX_SESSION], { encoding: "utf-8" });
|
|
286414
|
+
return result.status === 0;
|
|
286415
|
+
}
|
|
286416
|
+
createSession() {
|
|
286417
|
+
const shell = process.env.SHELL || "/bin/bash";
|
|
286418
|
+
const cwd2 = pwd();
|
|
286419
|
+
const socket = getTerminalPanelSocket();
|
|
286420
|
+
const result = spawnSync5("tmux", [
|
|
286421
|
+
"-L",
|
|
286422
|
+
socket,
|
|
286423
|
+
"new-session",
|
|
286424
|
+
"-d",
|
|
286425
|
+
"-s",
|
|
286426
|
+
TMUX_SESSION,
|
|
286427
|
+
"-c",
|
|
286428
|
+
cwd2,
|
|
286429
|
+
shell,
|
|
286430
|
+
"-l"
|
|
286431
|
+
], { encoding: "utf-8" });
|
|
286432
|
+
if (result.status !== 0) {
|
|
286433
|
+
logForDebugging(`Terminal panel: failed to create tmux session: ${result.stderr}`);
|
|
286434
|
+
return false;
|
|
286435
|
+
}
|
|
286436
|
+
spawnSync5("tmux", [
|
|
286437
|
+
"-L",
|
|
286438
|
+
socket,
|
|
286439
|
+
"bind-key",
|
|
286440
|
+
"-n",
|
|
286441
|
+
"M-j",
|
|
286442
|
+
"detach-client",
|
|
286443
|
+
";",
|
|
286444
|
+
"set-option",
|
|
286445
|
+
"-g",
|
|
286446
|
+
"status-style",
|
|
286447
|
+
"bg=default",
|
|
286448
|
+
";",
|
|
286449
|
+
"set-option",
|
|
286450
|
+
"-g",
|
|
286451
|
+
"status-left",
|
|
286452
|
+
"",
|
|
286453
|
+
";",
|
|
286454
|
+
"set-option",
|
|
286455
|
+
"-g",
|
|
286456
|
+
"status-right",
|
|
286457
|
+
" Alt+J to return to Theus ",
|
|
286458
|
+
";",
|
|
286459
|
+
"set-option",
|
|
286460
|
+
"-g",
|
|
286461
|
+
"status-right-style",
|
|
286462
|
+
"fg=brightblack"
|
|
286463
|
+
]);
|
|
286464
|
+
if (!this.cleanupRegistered) {
|
|
286465
|
+
this.cleanupRegistered = true;
|
|
286466
|
+
registerCleanup(async () => {
|
|
286467
|
+
spawn7("tmux", ["-L", socket, "kill-server"], {
|
|
286468
|
+
detached: true,
|
|
286469
|
+
stdio: "ignore"
|
|
286470
|
+
}).on("error", () => {}).unref();
|
|
286471
|
+
});
|
|
286472
|
+
}
|
|
286473
|
+
return true;
|
|
286474
|
+
}
|
|
286475
|
+
attachSession() {
|
|
286476
|
+
spawnSync5("tmux", ["-L", getTerminalPanelSocket(), "attach-session", "-t", TMUX_SESSION], { stdio: "inherit" });
|
|
286477
|
+
}
|
|
286478
|
+
showShell() {
|
|
286479
|
+
const inkInstance = instances_default.get(process.stdout);
|
|
286480
|
+
if (!inkInstance) {
|
|
286481
|
+
logForDebugging("Terminal panel: no Ink instance found, aborting");
|
|
286482
|
+
return;
|
|
286483
|
+
}
|
|
286484
|
+
inkInstance.enterAlternateScreen();
|
|
286485
|
+
try {
|
|
286486
|
+
if (this.checkTmux() && this.ensureSession()) {
|
|
286487
|
+
this.attachSession();
|
|
286488
|
+
} else {
|
|
286489
|
+
this.runShellDirect();
|
|
286490
|
+
}
|
|
286491
|
+
} finally {
|
|
286492
|
+
inkInstance.exitAlternateScreen();
|
|
286493
|
+
}
|
|
286494
|
+
}
|
|
286495
|
+
ensureSession() {
|
|
286496
|
+
if (this.hasSession())
|
|
286497
|
+
return true;
|
|
286498
|
+
return this.createSession();
|
|
286499
|
+
}
|
|
286500
|
+
runShellDirect() {
|
|
286501
|
+
const shell = process.env.SHELL || "/bin/bash";
|
|
286502
|
+
const cwd2 = pwd();
|
|
286503
|
+
spawnSync5(shell, ["-i", "-l"], {
|
|
286504
|
+
stdio: "inherit",
|
|
286505
|
+
cwd: cwd2,
|
|
286506
|
+
env: process.env
|
|
286507
|
+
});
|
|
286508
|
+
}
|
|
286509
|
+
}
|
|
286510
|
+
var TMUX_SESSION = "panel", instance;
|
|
286511
|
+
var init_terminalPanel = __esm(() => {
|
|
286512
|
+
init_state();
|
|
286513
|
+
init_instances();
|
|
286514
|
+
init_cleanupRegistry();
|
|
286515
|
+
init_cwd2();
|
|
286516
|
+
init_debug();
|
|
286517
|
+
});
|
|
286518
|
+
|
|
286519
|
+
// tools/TerminalCaptureTool/prompt.ts
|
|
286520
|
+
var TERMINAL_CAPTURE_TOOL_NAME = "TerminalCapture", DESCRIPTION24 = "Lee el contenido actual del panel de terminal integrado (Alt+J).", PROMPT9 = `Lee el contenido visible y reciente del panel de terminal integrado de Theus (el panel que se abre y cierra con Alt+J / Meta+J).
|
|
286521
|
+
|
|
286522
|
+
\xDAsala cuando necesites ver la salida de lo que el usuario ejecut\xF3 en ese panel: el estado de un servidor de desarrollo, el resultado de un comando largo, errores de compilaci\xF3n, logs, prompts interactivos, etc. Es de solo lectura: no ejecuta ni escribe nada en la terminal, \xFAnicamente captura lo que ya est\xE1 en pantalla.
|
|
286523
|
+
|
|
286524
|
+
Par\xE1metros:
|
|
286525
|
+
- lines (opcional): n\xFAmero de l\xEDneas finales a capturar. Por defecto 200. La salida se recorta a un tama\xF1o razonable si es muy grande, conservando siempre lo m\xE1s reciente.
|
|
286526
|
+
|
|
286527
|
+
Notas:
|
|
286528
|
+
- Si no hay un panel de terminal activo (nadie lo ha abierto todav\xEDa en esta sesi\xF3n), la herramienta lo indica claramente en lugar de fallar. En ese caso, pide al usuario que abra el panel con Alt+J y ejecute ah\xED lo que quiera que veas.
|
|
286529
|
+
- El contenido se devuelve como texto plano (sin c\xF3digos de color) para que sea f\xE1cil de leer.
|
|
286530
|
+
- Para ejecutar comandos usa la herramienta de shell habitual; esta herramienta solo observa el panel interactivo del usuario.`;
|
|
286531
|
+
|
|
286532
|
+
// tools/TerminalCaptureTool/TerminalCaptureTool.ts
|
|
286533
|
+
var exports_TerminalCaptureTool = {};
|
|
286534
|
+
__export(exports_TerminalCaptureTool, {
|
|
286535
|
+
TerminalCaptureTool: () => TerminalCaptureTool
|
|
286536
|
+
});
|
|
286537
|
+
import { spawnSync as spawnSync6 } from "child_process";
|
|
286538
|
+
function hasTmux() {
|
|
286539
|
+
const result = spawnSync6("tmux", ["-V"], { encoding: "utf-8" });
|
|
286540
|
+
return result.status === 0;
|
|
286541
|
+
}
|
|
286542
|
+
function hasPanelSession(socket) {
|
|
286543
|
+
const result = spawnSync6("tmux", ["-L", socket, "has-session", "-t", TMUX_SESSION2], { encoding: "utf-8" });
|
|
286544
|
+
return result.status === 0;
|
|
286545
|
+
}
|
|
286546
|
+
function capturePane(socket, lines) {
|
|
286547
|
+
const result = spawnSync6("tmux", [
|
|
286548
|
+
"-L",
|
|
286549
|
+
socket,
|
|
286550
|
+
"capture-pane",
|
|
286551
|
+
"-p",
|
|
286552
|
+
"-J",
|
|
286553
|
+
"-t",
|
|
286554
|
+
TMUX_SESSION2,
|
|
286555
|
+
"-S",
|
|
286556
|
+
`-${lines}`
|
|
286557
|
+
], { encoding: "utf-8", maxBuffer: 8 * 1024 * 1024 });
|
|
286558
|
+
if (result.status !== 0) {
|
|
286559
|
+
const stderr = (result.stderr || "").toString().trim();
|
|
286560
|
+
throw new Error(stderr || "No se pudo capturar el contenido del panel de terminal.");
|
|
286561
|
+
}
|
|
286562
|
+
return (result.stdout || "").toString();
|
|
286563
|
+
}
|
|
286564
|
+
function normalize11(raw, lines) {
|
|
286565
|
+
let allLines = raw.replace(/\r\n/g, `
|
|
286566
|
+
`).split(`
|
|
286567
|
+
`).map((l) => l.replace(/\s+$/, ""));
|
|
286568
|
+
while (allLines.length > 0 && allLines[allLines.length - 1] === "") {
|
|
286569
|
+
allLines.pop();
|
|
286570
|
+
}
|
|
286571
|
+
if (allLines.length > lines) {
|
|
286572
|
+
allLines = allLines.slice(-lines);
|
|
286573
|
+
}
|
|
286574
|
+
let content = allLines.join(`
|
|
286575
|
+
`);
|
|
286576
|
+
let truncated = false;
|
|
286577
|
+
if (Buffer.byteLength(content, "utf-8") > MAX_BYTES) {
|
|
286578
|
+
truncated = true;
|
|
286579
|
+
const buf = Buffer.from(content, "utf-8");
|
|
286580
|
+
let sliced = buf.subarray(buf.length - MAX_BYTES).toString("utf-8");
|
|
286581
|
+
const nl = sliced.indexOf(`
|
|
286582
|
+
`);
|
|
286583
|
+
if (nl !== -1)
|
|
286584
|
+
sliced = sliced.slice(nl + 1);
|
|
286585
|
+
content = `[...salida anterior truncada...]
|
|
286586
|
+
${sliced}`;
|
|
286587
|
+
}
|
|
286588
|
+
return {
|
|
286589
|
+
content,
|
|
286590
|
+
lineCount: content === "" ? 0 : content.split(`
|
|
286591
|
+
`).length,
|
|
286592
|
+
truncated
|
|
286593
|
+
};
|
|
286594
|
+
}
|
|
286595
|
+
var TMUX_SESSION2 = "panel", DEFAULT_LINES = 200, MAX_LINES = 1000, MAX_BYTES = 30000, inputSchema45, outputSchema36, TerminalCaptureTool;
|
|
286596
|
+
var init_TerminalCaptureTool = __esm(() => {
|
|
286597
|
+
init_v4();
|
|
286598
|
+
init_Tool();
|
|
286599
|
+
init_terminalPanel();
|
|
286600
|
+
inputSchema45 = lazySchema(() => exports_external.strictObject({
|
|
286601
|
+
lines: exports_external.number().int().positive().max(MAX_LINES).optional().describe(`N\xFAmero de l\xEDneas finales del panel a capturar (por defecto ${DEFAULT_LINES}, m\xE1ximo ${MAX_LINES}).`)
|
|
286602
|
+
}));
|
|
286603
|
+
outputSchema36 = lazySchema(() => exports_external.object({
|
|
286604
|
+
active: exports_external.boolean(),
|
|
286605
|
+
content: exports_external.string(),
|
|
286606
|
+
lineCount: exports_external.number(),
|
|
286607
|
+
truncated: exports_external.boolean()
|
|
286608
|
+
}));
|
|
286609
|
+
TerminalCaptureTool = buildTool({
|
|
286610
|
+
name: TERMINAL_CAPTURE_TOOL_NAME,
|
|
286611
|
+
searchHint: "leer el contenido del panel de terminal integrado",
|
|
286612
|
+
maxResultSizeChars: 1e5,
|
|
286613
|
+
async description() {
|
|
286614
|
+
return DESCRIPTION24;
|
|
286615
|
+
},
|
|
286616
|
+
async prompt() {
|
|
286617
|
+
return PROMPT9;
|
|
286618
|
+
},
|
|
286619
|
+
get inputSchema() {
|
|
286620
|
+
return inputSchema45();
|
|
286621
|
+
},
|
|
286622
|
+
get outputSchema() {
|
|
286623
|
+
return outputSchema36();
|
|
286624
|
+
},
|
|
286625
|
+
userFacingName() {
|
|
286626
|
+
return "CapturaTerminal";
|
|
286627
|
+
},
|
|
286628
|
+
isEnabled() {
|
|
286629
|
+
return true;
|
|
286630
|
+
},
|
|
286631
|
+
isConcurrencySafe() {
|
|
286632
|
+
return true;
|
|
286633
|
+
},
|
|
286634
|
+
isReadOnly() {
|
|
286635
|
+
return true;
|
|
286636
|
+
},
|
|
286637
|
+
isDestructive() {
|
|
286638
|
+
return false;
|
|
286639
|
+
},
|
|
286640
|
+
renderToolUseMessage() {
|
|
286641
|
+
return null;
|
|
286642
|
+
},
|
|
286643
|
+
async call({ lines }) {
|
|
286644
|
+
const requested = Math.min(lines ?? DEFAULT_LINES, MAX_LINES);
|
|
286645
|
+
if (!hasTmux()) {
|
|
286646
|
+
return {
|
|
286647
|
+
data: {
|
|
286648
|
+
active: false,
|
|
286649
|
+
content: "El panel de terminal integrado no est\xE1 disponible en este sistema (no se encontr\xF3 tmux). No hay contenido que capturar.",
|
|
286650
|
+
lineCount: 0,
|
|
286651
|
+
truncated: false
|
|
286652
|
+
}
|
|
286653
|
+
};
|
|
286654
|
+
}
|
|
286655
|
+
const socket = getTerminalPanelSocket();
|
|
286656
|
+
if (!hasPanelSession(socket)) {
|
|
286657
|
+
return {
|
|
286658
|
+
data: {
|
|
286659
|
+
active: false,
|
|
286660
|
+
content: "No hay un panel de terminal activo en esta sesi\xF3n. P\xEDdele al usuario que lo abra con Alt+J (Meta+J) y ejecute ah\xED lo que quiera que veas; luego vuelve a intentarlo.",
|
|
286661
|
+
lineCount: 0,
|
|
286662
|
+
truncated: false
|
|
286663
|
+
}
|
|
286664
|
+
};
|
|
286665
|
+
}
|
|
286666
|
+
const raw = capturePane(socket, requested);
|
|
286667
|
+
const { content, lineCount, truncated } = normalize11(raw, requested);
|
|
286668
|
+
if (lineCount === 0) {
|
|
286669
|
+
return {
|
|
286670
|
+
data: {
|
|
286671
|
+
active: true,
|
|
286672
|
+
content: "El panel de terminal est\xE1 activo pero no tiene salida visible todav\xEDa.",
|
|
286673
|
+
lineCount: 0,
|
|
286674
|
+
truncated: false
|
|
286675
|
+
}
|
|
286676
|
+
};
|
|
286677
|
+
}
|
|
286678
|
+
return {
|
|
286679
|
+
data: { active: true, content, lineCount, truncated }
|
|
286680
|
+
};
|
|
286681
|
+
},
|
|
286682
|
+
mapToolResultToToolResultBlockParam(content, toolUseID) {
|
|
286683
|
+
const out = content;
|
|
286684
|
+
if (!out.active) {
|
|
286685
|
+
return {
|
|
286686
|
+
tool_use_id: toolUseID,
|
|
286687
|
+
type: "tool_result",
|
|
286688
|
+
content: out.content
|
|
286689
|
+
};
|
|
286690
|
+
}
|
|
286691
|
+
const header = out.truncated ? `Panel de terminal (\xFAltimas ${out.lineCount} l\xEDneas, salida recortada por tama\xF1o):` : `Panel de terminal (${out.lineCount} ${out.lineCount === 1 ? "l\xEDnea" : "l\xEDneas"}):`;
|
|
286692
|
+
return {
|
|
286693
|
+
tool_use_id: toolUseID,
|
|
286694
|
+
type: "tool_result",
|
|
286695
|
+
content: `${header}
|
|
286696
|
+
|
|
286697
|
+
${out.content}`
|
|
286698
|
+
};
|
|
286699
|
+
}
|
|
286700
|
+
});
|
|
285662
286701
|
});
|
|
285663
286702
|
|
|
285664
286703
|
// tools.ts
|
|
@@ -285700,7 +286739,7 @@ function getAllBaseTools() {
|
|
|
285700
286739
|
...isTodoV2Enabled() ? [TaskCreateTool, TaskGetTool, TaskUpdateTool, TaskListTool] : [],
|
|
285701
286740
|
...OverflowTestTool ? [OverflowTestTool] : [],
|
|
285702
286741
|
...CtxInspectTool ? [CtxInspectTool] : [],
|
|
285703
|
-
...
|
|
286742
|
+
...TerminalCaptureTool2 ? [TerminalCaptureTool2] : [],
|
|
285704
286743
|
...isEnvTruthy(process.env.ENABLE_LSP_TOOL) ? [LSPTool] : [],
|
|
285705
286744
|
...isWorktreeModeEnabled() ? [EnterWorktreeTool, ExitWorktreeTool] : [],
|
|
285706
286745
|
getSendMessageTool(),
|
|
@@ -285736,7 +286775,7 @@ function assembleToolPool(permissionContext, mcpTools) {
|
|
|
285736
286775
|
const byName = (a2, b) => a2.name.localeCompare(b.name);
|
|
285737
286776
|
return uniqBy_default([...builtInTools].sort(byName).concat(allowedMcpTools.sort(byName)), "name");
|
|
285738
286777
|
}
|
|
285739
|
-
var REPLTool, SuggestBackgroundPRTool, SleepTool2, cronTools, RemoteTriggerTool = null, MonitorTool2, SendUserFileTool = null, PushNotificationTool = null, SubscribePRTool = null, getTeamCreateTool = () => (init_TeamCreateTool(), __toCommonJS(exports_TeamCreateTool)).TeamCreateTool, getTeamDeleteTool = () => (init_TeamDeleteTool(), __toCommonJS(exports_TeamDeleteTool)).TeamDeleteTool, getSendMessageTool = () => (init_SendMessageTool(), __toCommonJS(exports_SendMessageTool)).SendMessageTool, VerifyPlanExecutionTool, OverflowTestTool = null, CtxInspectTool = null,
|
|
286778
|
+
var REPLTool, SuggestBackgroundPRTool, SleepTool2, cronTools, RemoteTriggerTool = null, MonitorTool2, SendUserFileTool = null, PushNotificationTool = null, SubscribePRTool = null, getTeamCreateTool = () => (init_TeamCreateTool(), __toCommonJS(exports_TeamCreateTool)).TeamCreateTool, getTeamDeleteTool = () => (init_TeamDeleteTool(), __toCommonJS(exports_TeamDeleteTool)).TeamDeleteTool, getSendMessageTool = () => (init_SendMessageTool(), __toCommonJS(exports_SendMessageTool)).SendMessageTool, VerifyPlanExecutionTool, OverflowTestTool = null, CtxInspectTool = null, TerminalCaptureTool2, WebBrowserTool = null, SnipTool = null, ListPeersTool = null, WorkflowTool = null, getPowerShellTool2 = () => {
|
|
285740
286779
|
if (!isPowerShellToolEnabled())
|
|
285741
286780
|
return null;
|
|
285742
286781
|
return (init_PowerShellTool(), __toCommonJS(exports_PowerShellTool)).PowerShellTool;
|
|
@@ -285814,6 +286853,7 @@ var init_tools2 = __esm(() => {
|
|
|
285814
286853
|
init_shellToolUtils();
|
|
285815
286854
|
init_agentSwarmsEnabled();
|
|
285816
286855
|
init_agentTriggersEnabled();
|
|
286856
|
+
init_terminalPanelEnabled();
|
|
285817
286857
|
init_constants4();
|
|
285818
286858
|
REPLTool = process.env.USER_TYPE === "ant" ? (init_REPLTool(), __toCommonJS(exports_REPLTool)).REPLTool : null;
|
|
285819
286859
|
SuggestBackgroundPRTool = process.env.USER_TYPE === "ant" ? (init_SuggestBackgroundPRTool(), __toCommonJS(exports_SuggestBackgroundPRTool)).SuggestBackgroundPRTool : null;
|
|
@@ -285825,6 +286865,7 @@ var init_tools2 = __esm(() => {
|
|
|
285825
286865
|
] : [];
|
|
285826
286866
|
MonitorTool2 = process.env.THEUS_MONITOR !== "0" ? (init_MonitorTool(), __toCommonJS(exports_MonitorTool)).MonitorTool : null;
|
|
285827
286867
|
VerifyPlanExecutionTool = process.env.THEUS_CODE_VERIFY_PLAN === "true" ? (init_VerifyPlanExecutionTool(), __toCommonJS(exports_VerifyPlanExecutionTool)).VerifyPlanExecutionTool : null;
|
|
286868
|
+
TerminalCaptureTool2 = isTerminalPanelEnabled() ? (init_TerminalCaptureTool(), __toCommonJS(exports_TerminalCaptureTool)).TerminalCaptureTool : null;
|
|
285828
286869
|
TOOL_PRESETS = ["default"];
|
|
285829
286870
|
});
|
|
285830
286871
|
|
|
@@ -287193,7 +288234,7 @@ function resolveTeamName(input, appState) {
|
|
|
287193
288234
|
return;
|
|
287194
288235
|
return input.team_name || appState.teamContext?.teamName;
|
|
287195
288236
|
}
|
|
287196
|
-
var jsx_runtime160, proactiveModule2 = null, PROGRESS_THRESHOLD_MS2 = 2000, isBackgroundTasksDisabled2, baseInputSchema, fullInputSchema2, inputSchema8,
|
|
288237
|
+
var jsx_runtime160, proactiveModule2 = null, PROGRESS_THRESHOLD_MS2 = 2000, isBackgroundTasksDisabled2, baseInputSchema, fullInputSchema2, inputSchema8, outputSchema37, AgentTool;
|
|
287197
288238
|
var init_AgentTool = __esm(() => {
|
|
287198
288239
|
init_Tool();
|
|
287199
288240
|
init_promptCategory();
|
|
@@ -287269,7 +288310,7 @@ var init_AgentTool = __esm(() => {
|
|
|
287269
288310
|
run_in_background: true
|
|
287270
288311
|
}) : schema;
|
|
287271
288312
|
});
|
|
287272
|
-
|
|
288313
|
+
outputSchema37 = lazySchema(() => {
|
|
287273
288314
|
const syncOutputSchema = agentToolResultSchema().extend({
|
|
287274
288315
|
status: exports_external.literal("completed"),
|
|
287275
288316
|
prompt: exports_external.string()
|
|
@@ -287318,7 +288359,7 @@ var init_AgentTool = __esm(() => {
|
|
|
287318
288359
|
return inputSchema8();
|
|
287319
288360
|
},
|
|
287320
288361
|
get outputSchema() {
|
|
287321
|
-
return
|
|
288362
|
+
return outputSchema37();
|
|
287322
288363
|
},
|
|
287323
288364
|
async call({
|
|
287324
288365
|
prompt,
|
|
@@ -288125,7 +289166,7 @@ var init_primitiveTools = __esm(() => {
|
|
|
288125
289166
|
});
|
|
288126
289167
|
|
|
288127
289168
|
// utils/memoryFileDetection.ts
|
|
288128
|
-
import { normalize as
|
|
289169
|
+
import { normalize as normalize12, posix as posix6, win32 as win322 } from "path";
|
|
288129
289170
|
function toPosix(p) {
|
|
288130
289171
|
return p.split(win322.sep).join(posix6.sep);
|
|
288131
289172
|
}
|
|
@@ -288184,7 +289225,7 @@ function isAutoManagedMemoryFile(filePath) {
|
|
|
288184
289225
|
return false;
|
|
288185
289226
|
}
|
|
288186
289227
|
function isMemoryDirectory(dirPath) {
|
|
288187
|
-
const normalizedPath =
|
|
289228
|
+
const normalizedPath = normalize12(dirPath);
|
|
288188
289229
|
const normalizedCmp = toComparable(normalizedPath);
|
|
288189
289230
|
if (isAutoMemoryEnabled() && (normalizedCmp.includes("/agent-memory/") || normalizedCmp.includes("/agent-memory-local/"))) {
|
|
288190
289231
|
return true;
|
|
@@ -290866,7 +291907,7 @@ async function* runShellCommand({
|
|
|
290866
291907
|
}
|
|
290867
291908
|
}
|
|
290868
291909
|
var jsx_runtime161, EOL4 = `
|
|
290869
|
-
`, PROGRESS_THRESHOLD_MS3 = 2000, ASSISTANT_BLOCKING_BUDGET_MS2 = 15000, BASH_SEARCH_COMMANDS, BASH_READ_COMMANDS, BASH_LIST_COMMANDS, BASH_SEMANTIC_NEUTRAL_COMMANDS, BASH_SILENT_COMMANDS, DISALLOWED_AUTO_BACKGROUND_COMMANDS2, isBackgroundTasksDisabled3, fullInputSchema3,
|
|
291910
|
+
`, PROGRESS_THRESHOLD_MS3 = 2000, ASSISTANT_BLOCKING_BUDGET_MS2 = 15000, BASH_SEARCH_COMMANDS, BASH_READ_COMMANDS, BASH_LIST_COMMANDS, BASH_SEMANTIC_NEUTRAL_COMMANDS, BASH_SILENT_COMMANDS, DISALLOWED_AUTO_BACKGROUND_COMMANDS2, isBackgroundTasksDisabled3, fullInputSchema3, inputSchema46, COMMON_BACKGROUND_COMMANDS2, outputSchema38, BashTool;
|
|
290870
291911
|
var init_BashTool = __esm(() => {
|
|
290871
291912
|
init_v4();
|
|
290872
291913
|
init_state();
|
|
@@ -290959,14 +292000,14 @@ For commands that are harder to parse at a glance (piped commands, obscure flags
|
|
|
290959
292000
|
newContent: exports_external.string()
|
|
290960
292001
|
}).optional().describe("Internal: pre-computed sed edit result from preview")
|
|
290961
292002
|
}));
|
|
290962
|
-
|
|
292003
|
+
inputSchema46 = lazySchema(() => isBackgroundTasksDisabled3 ? fullInputSchema3().omit({
|
|
290963
292004
|
run_in_background: true,
|
|
290964
292005
|
_simulatedSedEdit: true
|
|
290965
292006
|
}) : fullInputSchema3().omit({
|
|
290966
292007
|
_simulatedSedEdit: true
|
|
290967
292008
|
}));
|
|
290968
292009
|
COMMON_BACKGROUND_COMMANDS2 = ["npm", "yarn", "pnpm", "node", "python", "python3", "go", "cargo", "make", "docker", "terraform", "webpack", "vite", "jest", "pytest", "curl", "wget", "build", "test", "serve", "watch", "dev"];
|
|
290969
|
-
|
|
292010
|
+
outputSchema38 = lazySchema(() => exports_external.object({
|
|
290970
292011
|
stdout: exports_external.string().describe("The standard output of the command"),
|
|
290971
292012
|
stderr: exports_external.string().describe("The standard error output of the command"),
|
|
290972
292013
|
rawOutputPath: exports_external.string().optional().describe("Path to raw output file for large MCP tool outputs"),
|
|
@@ -291025,7 +292066,7 @@ For commands that are harder to parse at a glance (piped commands, obscure flags
|
|
|
291025
292066
|
};
|
|
291026
292067
|
},
|
|
291027
292068
|
isSearchOrReadCommand(input) {
|
|
291028
|
-
const parsed =
|
|
292069
|
+
const parsed = inputSchema46().safeParse(input);
|
|
291029
292070
|
if (!parsed.success)
|
|
291030
292071
|
return {
|
|
291031
292072
|
isSearch: false,
|
|
@@ -291035,10 +292076,10 @@ For commands that are harder to parse at a glance (piped commands, obscure flags
|
|
|
291035
292076
|
return isSearchOrReadBashCommand(parsed.data.command);
|
|
291036
292077
|
},
|
|
291037
292078
|
get inputSchema() {
|
|
291038
|
-
return
|
|
292079
|
+
return inputSchema46();
|
|
291039
292080
|
},
|
|
291040
292081
|
get outputSchema() {
|
|
291041
|
-
return
|
|
292082
|
+
return outputSchema38();
|
|
291042
292083
|
},
|
|
291043
292084
|
userFacingName(input) {
|
|
291044
292085
|
if (!input) {
|
|
@@ -295355,11 +296396,11 @@ var init_memoryTypes = __esm(() => {
|
|
|
295355
296396
|
|
|
295356
296397
|
// memdir/memoryScan.ts
|
|
295357
296398
|
import { readdir as readdir16 } from "fs/promises";
|
|
295358
|
-
import { basename as
|
|
296399
|
+
import { basename as basename27, join as join96 } from "path";
|
|
295359
296400
|
async function scanMemoryFiles(memoryDir, signal) {
|
|
295360
296401
|
try {
|
|
295361
296402
|
const entries = await readdir16(memoryDir, { recursive: true });
|
|
295362
|
-
const mdFiles = entries.filter((f) => f.endsWith(".md") &&
|
|
296403
|
+
const mdFiles = entries.filter((f) => f.endsWith(".md") && basename27(f) !== "MEMORY.md");
|
|
295363
296404
|
const headerResults = await Promise.allSettled(mdFiles.map(async (relativePath) => {
|
|
295364
296405
|
const filePath = join96(memoryDir, relativePath);
|
|
295365
296406
|
const { content, mtimeMs } = await readFileInRange(filePath, 0, FRONTMATTER_MAX_LINES, undefined, signal);
|
|
@@ -295466,7 +296507,7 @@ __export(exports_extractMemories, {
|
|
|
295466
296507
|
drainPendingExtraction: () => drainPendingExtraction,
|
|
295467
296508
|
createAutoMemCanUseTool: () => createAutoMemCanUseTool
|
|
295468
296509
|
});
|
|
295469
|
-
import { basename as
|
|
296510
|
+
import { basename as basename28 } from "path";
|
|
295470
296511
|
function isModelVisibleMessage(message) {
|
|
295471
296512
|
return message.type === "user" || message.type === "assistant";
|
|
295472
296513
|
}
|
|
@@ -295648,7 +296689,7 @@ function initExtractMemories() {
|
|
|
295648
296689
|
} else {
|
|
295649
296690
|
logForDebugging("[extractMemories] no memories saved this run");
|
|
295650
296691
|
}
|
|
295651
|
-
const memoryPaths = writtenPaths.filter((p) =>
|
|
296692
|
+
const memoryPaths = writtenPaths.filter((p) => basename28(p) !== ENTRYPOINT_NAME);
|
|
295652
296693
|
const teamCount = 0;
|
|
295653
296694
|
logEvent("tengu_extract_memories_extraction", {
|
|
295654
296695
|
input_tokens: result.totalUsage.input_tokens,
|
|
@@ -297555,7 +298596,7 @@ function makeDefaultWaitForStep(pollIntervalMs, maxWaitMs) {
|
|
|
297555
298596
|
};
|
|
297556
298597
|
}
|
|
297557
298598
|
async function run(plan, context2, deps = {}) {
|
|
297558
|
-
const
|
|
298599
|
+
const spawn8 = deps.spawn ?? spawnTeammate;
|
|
297559
298600
|
const waitForStep = deps.waitForStep ?? makeDefaultWaitForStep(deps.pollIntervalMs ?? 500, deps.maxWaitMs ?? 300000);
|
|
297560
298601
|
const teamName = deps.teamName ?? "router-plan";
|
|
297561
298602
|
const signal = deps.signal;
|
|
@@ -297580,7 +298621,7 @@ async function run(plan, context2, deps = {}) {
|
|
|
297580
298621
|
model: step.model
|
|
297581
298622
|
}
|
|
297582
298623
|
};
|
|
297583
|
-
const spawned = await
|
|
298624
|
+
const spawned = await spawn8(config2, context2);
|
|
297584
298625
|
const teammateId = spawned.data.teammate_id;
|
|
297585
298626
|
return waitForStep(teammateId, step, context2, signal);
|
|
297586
298627
|
}));
|
|
@@ -298558,9 +299599,9 @@ function getTheusEnvMetadata() {
|
|
|
298558
299599
|
};
|
|
298559
299600
|
}
|
|
298560
299601
|
function getBuildAgeMinutes() {
|
|
298561
|
-
if (!{ VERSION: "0.2.
|
|
299602
|
+
if (!{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.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)
|
|
298562
299603
|
return;
|
|
298563
|
-
const buildTime = new Date({ VERSION: "0.2.
|
|
299604
|
+
const buildTime = new Date({ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.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();
|
|
298564
299605
|
if (isNaN(buildTime))
|
|
298565
299606
|
return;
|
|
298566
299607
|
return Math.floor((Date.now() - buildTime) / 60000);
|
|
@@ -302098,8 +303139,8 @@ async function calculateDeferredToolDescriptionChars(tools, getToolPermissionCon
|
|
|
302098
303139
|
tools,
|
|
302099
303140
|
agents
|
|
302100
303141
|
});
|
|
302101
|
-
const
|
|
302102
|
-
return tool.name.length + description.length +
|
|
303142
|
+
const inputSchema47 = tool.inputJSONSchema ? jsonStringify(tool.inputJSONSchema) : tool.inputSchema ? jsonStringify(zodToJsonSchema3(tool.inputSchema)) : "";
|
|
303143
|
+
return tool.name.length + description.length + inputSchema47.length;
|
|
302103
303144
|
}));
|
|
302104
303145
|
return sizes.reduce((total, size) => total + size, 0);
|
|
302105
303146
|
}
|
|
@@ -303599,7 +304640,7 @@ async function readImageWithTokenBudget(filePath, maxTokens = getDefaultFileRead
|
|
|
303599
304640
|
}
|
|
303600
304641
|
return result;
|
|
303601
304642
|
}
|
|
303602
|
-
var BLOCKED_DEVICE_PATHS, THIN_SPACE, fileReadListeners, MaxFileReadTokenExceededError, IMAGE_EXTENSIONS,
|
|
304643
|
+
var BLOCKED_DEVICE_PATHS, THIN_SPACE, fileReadListeners, MaxFileReadTokenExceededError, IMAGE_EXTENSIONS, inputSchema47, outputSchema39, FileReadTool, CYBER_RISK_MITIGATION_REMINDER = `
|
|
303603
304644
|
|
|
303604
304645
|
<system-reminder>
|
|
303605
304646
|
Whenever you read a file, you should consider whether it would be considered malware. You CAN and SHOULD provide analysis of malware, what it is doing. But you MUST refuse to improve or augment the code. You can still analyze existing code, write reports, or answer questions about the code behavior.
|
|
@@ -303666,13 +304707,13 @@ var init_FileReadTool = __esm(() => {
|
|
|
303666
304707
|
}
|
|
303667
304708
|
};
|
|
303668
304709
|
IMAGE_EXTENSIONS = new Set(["png", "jpg", "jpeg", "gif", "webp"]);
|
|
303669
|
-
|
|
304710
|
+
inputSchema47 = lazySchema(() => exports_external.strictObject({
|
|
303670
304711
|
file_path: exports_external.string().describe("The absolute path to the file to read"),
|
|
303671
304712
|
offset: semanticNumber(exports_external.number().int().nonnegative().optional()).describe("The line number to start reading from. Only provide if the file is too large to read at once"),
|
|
303672
304713
|
limit: semanticNumber(exports_external.number().int().positive().optional()).describe("The number of lines to read. Only provide if the file is too large to read at once."),
|
|
303673
304714
|
pages: exports_external.string().optional().describe(`Page range for PDF files (e.g., "1-5", "3", "10-20"). Only applicable to PDF files. Maximum ${PDF_MAX_PAGES_PER_READ} pages per request.`)
|
|
303674
304715
|
}));
|
|
303675
|
-
|
|
304716
|
+
outputSchema39 = lazySchema(() => {
|
|
303676
304717
|
const imageMediaTypes = exports_external.enum([
|
|
303677
304718
|
"image/jpeg",
|
|
303678
304719
|
"image/png",
|
|
@@ -303751,10 +304792,10 @@ var init_FileReadTool = __esm(() => {
|
|
|
303751
304792
|
return renderPromptTemplate(pickLineFormatInstruction(), maxSizeInstruction, offsetInstruction);
|
|
303752
304793
|
},
|
|
303753
304794
|
get inputSchema() {
|
|
303754
|
-
return
|
|
304795
|
+
return inputSchema47();
|
|
303755
304796
|
},
|
|
303756
304797
|
get outputSchema() {
|
|
303757
|
-
return
|
|
304798
|
+
return outputSchema39();
|
|
303758
304799
|
},
|
|
303759
304800
|
userFacingName: userFacingName9,
|
|
303760
304801
|
getToolUseSummary: getToolUseSummary8,
|
|
@@ -306119,22 +307160,22 @@ var init_attachments2 = __esm(() => {
|
|
|
306119
307160
|
});
|
|
306120
307161
|
|
|
306121
307162
|
// utils/plugins/loadPluginCommands.ts
|
|
306122
|
-
import { basename as
|
|
307163
|
+
import { basename as basename30, dirname as dirname40, join as join103 } from "path";
|
|
306123
307164
|
function isSkillFile2(filePath) {
|
|
306124
|
-
return /^skill\.md$/i.test(
|
|
307165
|
+
return /^skill\.md$/i.test(basename30(filePath));
|
|
306125
307166
|
}
|
|
306126
307167
|
function getCommandNameFromFile(filePath, baseDir, pluginName) {
|
|
306127
307168
|
const isSkill = isSkillFile2(filePath);
|
|
306128
307169
|
if (isSkill) {
|
|
306129
307170
|
const skillDirectory = dirname40(filePath);
|
|
306130
307171
|
const parentOfSkillDir = dirname40(skillDirectory);
|
|
306131
|
-
const commandBaseName =
|
|
307172
|
+
const commandBaseName = basename30(skillDirectory);
|
|
306132
307173
|
const relativePath = parentOfSkillDir.startsWith(baseDir) ? parentOfSkillDir.slice(baseDir.length).replace(/^\//, "") : "";
|
|
306133
307174
|
const namespace = relativePath ? relativePath.split("/").join(":") : "";
|
|
306134
307175
|
return namespace ? `${pluginName}:${namespace}:${commandBaseName}` : `${pluginName}:${commandBaseName}`;
|
|
306135
307176
|
} else {
|
|
306136
307177
|
const fileDirectory = dirname40(filePath);
|
|
306137
|
-
const commandBaseName =
|
|
307178
|
+
const commandBaseName = basename30(filePath).replace(/\.md$/, "");
|
|
306138
307179
|
const relativePath = fileDirectory.startsWith(baseDir) ? fileDirectory.slice(baseDir.length).replace(/^\//, "") : "";
|
|
306139
307180
|
const namespace = relativePath ? relativePath.split("/").join(":") : "";
|
|
306140
307181
|
return namespace ? `${pluginName}:${namespace}:${commandBaseName}` : `${pluginName}:${commandBaseName}`;
|
|
@@ -306171,7 +307212,7 @@ function transformPluginSkillFiles(files) {
|
|
|
306171
307212
|
if (skillFiles.length > 0) {
|
|
306172
307213
|
const skillFile = skillFiles[0];
|
|
306173
307214
|
if (skillFiles.length > 1) {
|
|
306174
|
-
logForDebugging(`Multiple skill files found in ${dir}, using ${
|
|
307215
|
+
logForDebugging(`Multiple skill files found in ${dir}, using ${basename30(skillFile.filePath)}`);
|
|
306175
307216
|
}
|
|
306176
307217
|
result.push(skillFile);
|
|
306177
307218
|
} else {
|
|
@@ -306318,7 +307359,7 @@ async function loadSkillsFromDirectory(skillsPath, pluginName, sourceName, plugi
|
|
|
306318
307359
|
}
|
|
306319
307360
|
try {
|
|
306320
307361
|
const { frontmatter, content: markdownContent } = parseFrontmatter(directSkillContent, directSkillPath);
|
|
306321
|
-
const skillName = `${pluginName}:${
|
|
307362
|
+
const skillName = `${pluginName}:${basename30(skillsPath)}`;
|
|
306322
307363
|
const file2 = {
|
|
306323
307364
|
filePath: directSkillPath,
|
|
306324
307365
|
baseDir: dirname40(directSkillPath),
|
|
@@ -306464,7 +307505,7 @@ var init_loadPluginCommands = __esm(() => {
|
|
|
306464
307505
|
}
|
|
306465
307506
|
}
|
|
306466
307507
|
if (!commandName) {
|
|
306467
|
-
commandName = `${plugin.name}:${
|
|
307508
|
+
commandName = `${plugin.name}:${basename30(commandPath).replace(/\.md$/, "")}`;
|
|
306468
307509
|
}
|
|
306469
307510
|
const finalFrontmatter = metadataOverride ? {
|
|
306470
307511
|
...frontmatter,
|
|
@@ -306608,7 +307649,7 @@ import {
|
|
|
306608
307649
|
writeFile as writeFile31
|
|
306609
307650
|
} from "fs/promises";
|
|
306610
307651
|
import { tmpdir as tmpdir7 } from "os";
|
|
306611
|
-
import { basename as
|
|
307652
|
+
import { basename as basename31, dirname as dirname41, join as join104 } from "path";
|
|
306612
307653
|
function isPluginZipCacheEnabled() {
|
|
306613
307654
|
return isEnvTruthy(process.env.THEUS_CODE_PLUGIN_USE_ZIP_CACHE);
|
|
306614
307655
|
}
|
|
@@ -306673,7 +307714,7 @@ async function cleanupSessionPluginCache() {
|
|
|
306673
307714
|
async function atomicWriteToZipCache(targetPath, data) {
|
|
306674
307715
|
const dir = dirname41(targetPath);
|
|
306675
307716
|
await getFsImplementation().mkdir(dir);
|
|
306676
|
-
const tmpName = `.${
|
|
307717
|
+
const tmpName = `.${basename31(targetPath)}.tmp.${randomBytes13(4).toString("hex")}`;
|
|
306677
307718
|
const tmpPath = join104(dir, tmpName);
|
|
306678
307719
|
try {
|
|
306679
307720
|
if (typeof data === "string") {
|
|
@@ -307379,7 +308420,7 @@ var init_officialMarketplaceGcs = __esm(() => {
|
|
|
307379
308420
|
|
|
307380
308421
|
// utils/plugins/marketplaceManager.ts
|
|
307381
308422
|
import { writeFile as writeFile34 } from "fs/promises";
|
|
307382
|
-
import { basename as
|
|
308423
|
+
import { basename as basename32, dirname as dirname43, isAbsolute as isAbsolute24, join as join107, resolve as resolve36, sep as sep23 } from "path";
|
|
307383
308424
|
function getKnownMarketplacesFile() {
|
|
307384
308425
|
return join107(getPluginsDirectory(), "known_marketplaces.json");
|
|
307385
308426
|
}
|
|
@@ -307960,7 +309001,7 @@ Technical details: ${error40.message}`);
|
|
|
307960
309001
|
});
|
|
307961
309002
|
}
|
|
307962
309003
|
function getCachePathForSource(source) {
|
|
307963
|
-
const tempName = source.source === "github" ? source.repo.replace("/", "-") : source.source === "npm" ? source.package.replace("@", "").replace("/", "-") : source.source === "file" ?
|
|
309004
|
+
const tempName = source.source === "github" ? source.repo.replace("/", "-") : source.source === "npm" ? source.package.replace("@", "").replace("/", "-") : source.source === "file" ? basename32(source.path).replace(".json", "") : source.source === "directory" ? basename32(source.path) : "temp_" + Date.now();
|
|
307964
309005
|
return tempName;
|
|
307965
309006
|
}
|
|
307966
309007
|
async function parseFileWithSchema(filePath, schema) {
|
|
@@ -309395,7 +310436,7 @@ import {
|
|
|
309395
310436
|
stat as stat36,
|
|
309396
310437
|
symlink as symlink3
|
|
309397
310438
|
} from "fs/promises";
|
|
309398
|
-
import { basename as
|
|
310439
|
+
import { basename as basename33, dirname as dirname46, join as join110, relative as relative23, resolve as resolve38, sep as sep25 } from "path";
|
|
309399
310440
|
function getPluginCachePath() {
|
|
309400
310441
|
return join110(getPluginsDirectory(), "cache");
|
|
309401
310442
|
}
|
|
@@ -310760,7 +311801,7 @@ async function loadSessionOnlyPlugins(sessionPluginPaths) {
|
|
|
310760
311801
|
});
|
|
310761
311802
|
continue;
|
|
310762
311803
|
}
|
|
310763
|
-
const dirName =
|
|
311804
|
+
const dirName = basename33(resolvedPath);
|
|
310764
311805
|
const { plugin, errors: pluginErrors } = await createPluginFromPath(resolvedPath, `${dirName}@inline`, true, dirName);
|
|
310765
311806
|
plugin.source = `${plugin.name}@inline`;
|
|
310766
311807
|
plugin.repository = `${plugin.name}@inline`;
|
|
@@ -310932,7 +311973,7 @@ var init_pluginLoader = __esm(() => {
|
|
|
310932
311973
|
});
|
|
310933
311974
|
|
|
310934
311975
|
// utils/plugins/loadPluginOutputStyles.ts
|
|
310935
|
-
import { basename as
|
|
311976
|
+
import { basename as basename34 } from "path";
|
|
310936
311977
|
async function loadOutputStylesFromDirectory(outputStylesPath, pluginName, loadedPaths) {
|
|
310937
311978
|
const styles5 = [];
|
|
310938
311979
|
await walkPluginMarkdown(outputStylesPath, async (fullPath) => {
|
|
@@ -310950,7 +311991,7 @@ async function loadOutputStyleFromFile(filePath, pluginName, loadedPaths) {
|
|
|
310950
311991
|
try {
|
|
310951
311992
|
const content = await fs4.readFile(filePath, { encoding: "utf-8" });
|
|
310952
311993
|
const { frontmatter, content: markdownContent } = parseFrontmatter(content, filePath);
|
|
310953
|
-
const fileName =
|
|
311994
|
+
const fileName = basename34(filePath, ".md");
|
|
310954
311995
|
const baseStyleName = frontmatter.name || fileName;
|
|
310955
311996
|
const name = `${pluginName}:${baseStyleName}`;
|
|
310956
311997
|
const description = coerceDescriptionToString(frontmatter.description, name) ?? extractDescriptionFromMarkdown(markdownContent, `Output style from ${pluginName} plugin`);
|
|
@@ -311031,7 +312072,7 @@ var init_loadPluginOutputStyles = __esm(() => {
|
|
|
311031
312072
|
});
|
|
311032
312073
|
|
|
311033
312074
|
// outputStyles/loadOutputStylesDir.ts
|
|
311034
|
-
import { basename as
|
|
312075
|
+
import { basename as basename35 } from "path";
|
|
311035
312076
|
var getOutputStyleDirStyles;
|
|
311036
312077
|
var init_loadOutputStylesDir = __esm(() => {
|
|
311037
312078
|
init_memoize();
|
|
@@ -311045,7 +312086,7 @@ var init_loadOutputStylesDir = __esm(() => {
|
|
|
311045
312086
|
const markdownFiles = await loadMarkdownFilesForSubdir("output-styles", cwd2);
|
|
311046
312087
|
const styles5 = markdownFiles.map(({ filePath, frontmatter, content, source }) => {
|
|
311047
312088
|
try {
|
|
311048
|
-
const fileName =
|
|
312089
|
+
const fileName = basename35(filePath);
|
|
311049
312090
|
const styleName = fileName.replace(/\.md$/, "");
|
|
311050
312091
|
const name = frontmatter["name"] || styleName;
|
|
311051
312092
|
const description = coerceDescriptionToString(frontmatter["description"], styleName) ?? extractDescriptionFromMarkdown(content, `Custom ${styleName} output style`);
|
|
@@ -314790,7 +315831,7 @@ function getAssistantMessageFromError(error40, model, options2) {
|
|
|
314790
315831
|
if (process.env.USER_TYPE === "ant") {
|
|
314791
315832
|
const baseMessage = `API Error: 400 ${error40.message}
|
|
314792
315833
|
|
|
314793
|
-
Run /share and post the JSON file to ${{ VERSION: "0.2.
|
|
315834
|
+
Run /share and post the JSON file to ${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.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}.`;
|
|
314794
315835
|
const rewindInstruction = getIsNonInteractiveSession() ? "" : " Then, use /rewind to recover the conversation.";
|
|
314795
315836
|
return createAssistantAPIErrorMessage({
|
|
314796
315837
|
content: baseMessage + rewindInstruction,
|
|
@@ -314826,7 +315867,7 @@ Run /share and post the JSON file to ${{ VERSION: "0.2.11", BUILD_TIME: "1970-01
|
|
|
314826
315867
|
if (process.env.USER_TYPE === "ant" && !process.env.THEUS_MODEL && error40 instanceof Error && error40.message.toLowerCase().includes("invalid model name")) {
|
|
314827
315868
|
const orgId = getOauthAccountInfo()?.organizationUuid;
|
|
314828
315869
|
const baseMsg = `[THEUS-INTERNAL] Your org isn't gated into the \`${model}\` model. Either run \`theus\` with \`THEUS_MODEL=${getDefaultMainLoopModelSetting()}\``;
|
|
314829
|
-
const msg = orgId ? `${baseMsg} or share your orgId (${orgId}) in ${{ VERSION: "0.2.
|
|
315870
|
+
const msg = orgId ? `${baseMsg} or share your orgId (${orgId}) in ${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.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.2.12", BUILD_TIME: "1970-01-01T00:00:00.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.`;
|
|
314830
315871
|
return createAssistantAPIErrorMessage({
|
|
314831
315872
|
content: msg,
|
|
314832
315873
|
error: "invalid_request"
|
|
@@ -319993,7 +321034,7 @@ var init_renderPlaceholder = __esm(() => {
|
|
|
319993
321034
|
});
|
|
319994
321035
|
|
|
319995
321036
|
// hooks/usePasteHandler.ts
|
|
319996
|
-
import { basename as
|
|
321037
|
+
import { basename as basename36 } from "path";
|
|
319997
321038
|
function usePasteHandler({
|
|
319998
321039
|
onPaste,
|
|
319999
321040
|
onInput,
|
|
@@ -320044,7 +321085,7 @@ function usePasteHandler({
|
|
|
320044
321085
|
const validImages = results.filter((r) => r !== null);
|
|
320045
321086
|
if (validImages.length > 0) {
|
|
320046
321087
|
for (const imageData of validImages) {
|
|
320047
|
-
const filename =
|
|
321088
|
+
const filename = basename36(imageData.path);
|
|
320048
321089
|
onImagePaste2(imageData.base64, imageData.mediaType, filename, imageData.dimensions, imageData.path);
|
|
320049
321090
|
}
|
|
320050
321091
|
const nonImageLines = lines.filter((line) => !isImageFilePath(line));
|
|
@@ -320649,7 +321690,7 @@ var init_TextInput = __esm(() => {
|
|
|
320649
321690
|
});
|
|
320650
321691
|
|
|
320651
321692
|
// utils/suggestions/directoryCompletion.ts
|
|
320652
|
-
import { basename as
|
|
321693
|
+
import { basename as basename37, dirname as dirname49, join as join117, sep as sep26 } from "path";
|
|
320653
321694
|
function parsePartialPath(partialPath, basePath) {
|
|
320654
321695
|
if (!partialPath) {
|
|
320655
321696
|
const directory2 = basePath || getCwd();
|
|
@@ -320660,7 +321701,7 @@ function parsePartialPath(partialPath, basePath) {
|
|
|
320660
321701
|
return { directory: resolved, prefix: "" };
|
|
320661
321702
|
}
|
|
320662
321703
|
const directory = dirname49(resolved);
|
|
320663
|
-
const prefix =
|
|
321704
|
+
const prefix = basename37(partialPath);
|
|
320664
321705
|
return { directory, prefix };
|
|
320665
321706
|
}
|
|
320666
321707
|
async function scanDirectory(dirPath) {
|
|
@@ -323393,11 +324434,11 @@ function truncateLine(text, maxLen) {
|
|
|
323393
324434
|
let width = 0;
|
|
323394
324435
|
const targetWidth = maxLen - 1;
|
|
323395
324436
|
for (const char of firstLine) {
|
|
323396
|
-
const
|
|
323397
|
-
if (width +
|
|
324437
|
+
const charWidth2 = stringWidth(char);
|
|
324438
|
+
if (width + charWidth2 > targetWidth)
|
|
323398
324439
|
break;
|
|
323399
324440
|
result += char;
|
|
323400
|
-
width +=
|
|
324441
|
+
width += charWidth2;
|
|
323401
324442
|
}
|
|
323402
324443
|
return result + "\u2026";
|
|
323403
324444
|
}
|
|
@@ -324926,7 +325967,7 @@ function buildPrimarySection() {
|
|
|
324926
325967
|
});
|
|
324927
325968
|
return [{
|
|
324928
325969
|
label: "Version",
|
|
324929
|
-
value: { VERSION: "0.2.
|
|
325970
|
+
value: { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
324930
325971
|
}, {
|
|
324931
325972
|
label: "Session name",
|
|
324932
325973
|
value: nameValue
|
|
@@ -328677,7 +329718,7 @@ function Config({
|
|
|
328677
329718
|
}
|
|
328678
329719
|
})
|
|
328679
329720
|
}) : showSubmenu === "ChannelDowngrade" ? /* @__PURE__ */ jsx_runtime185.jsx(ChannelDowngradeDialog, {
|
|
328680
|
-
currentVersion: { VERSION: "0.2.
|
|
329721
|
+
currentVersion: { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
328681
329722
|
onChoice: (choice) => {
|
|
328682
329723
|
setShowSubmenu(null);
|
|
328683
329724
|
setTabsHidden(false);
|
|
@@ -328689,7 +329730,7 @@ function Config({
|
|
|
328689
329730
|
autoUpdatesChannel: "stable"
|
|
328690
329731
|
};
|
|
328691
329732
|
if (choice === "stay") {
|
|
328692
|
-
newSettings.minimumVersion = { VERSION: "0.2.
|
|
329733
|
+
newSettings.minimumVersion = { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
|
|
328693
329734
|
}
|
|
328694
329735
|
updateSettingsForSource("userSettings", newSettings);
|
|
328695
329736
|
setSettingsData((prev_27) => ({
|
|
@@ -330978,13 +332019,13 @@ function renderToAnsiString(node, columns) {
|
|
|
330978
332019
|
stream4.on("data", (chunk) => {
|
|
330979
332020
|
output += chunk.toString();
|
|
330980
332021
|
});
|
|
330981
|
-
const
|
|
332022
|
+
const instance2 = await render(/* @__PURE__ */ jsx_runtime193.jsx(RenderOnceAndExit, {
|
|
330982
332023
|
children: node
|
|
330983
332024
|
}), {
|
|
330984
332025
|
stdout: stream4,
|
|
330985
332026
|
patchConsole: false
|
|
330986
332027
|
});
|
|
330987
|
-
await
|
|
332028
|
+
await instance2.waitUntilExit();
|
|
330988
332029
|
await resolve40(extractFirstFrame(output));
|
|
330989
332030
|
});
|
|
330990
332031
|
}
|
|
@@ -335555,15 +336596,15 @@ var init_MemoryUpdateNotification = __esm(() => {
|
|
|
335555
336596
|
|
|
335556
336597
|
// utils/editor.ts
|
|
335557
336598
|
import {
|
|
335558
|
-
spawn as
|
|
335559
|
-
spawnSync as
|
|
336599
|
+
spawn as spawn8,
|
|
336600
|
+
spawnSync as spawnSync7
|
|
335560
336601
|
} from "child_process";
|
|
335561
|
-
import { basename as
|
|
336602
|
+
import { basename as basename38 } from "path";
|
|
335562
336603
|
function isCommandAvailable3(command3) {
|
|
335563
336604
|
return !!whichSync(command3);
|
|
335564
336605
|
}
|
|
335565
336606
|
function classifyGuiEditor(editor) {
|
|
335566
|
-
const base2 =
|
|
336607
|
+
const base2 = basename38(editor.split(" ")[0] ?? "");
|
|
335567
336608
|
return GUI_EDITORS.find((g) => base2.includes(g));
|
|
335568
336609
|
}
|
|
335569
336610
|
function guiGotoArgv(guiFamily, filePath, line) {
|
|
@@ -335589,9 +336630,9 @@ function openFileInExternalEditor(filePath, line) {
|
|
|
335589
336630
|
let child;
|
|
335590
336631
|
if (process.platform === "win32") {
|
|
335591
336632
|
const gotoStr = gotoArgv.map((a2) => `"${a2}"`).join(" ");
|
|
335592
|
-
child =
|
|
336633
|
+
child = spawn8(`${editor} ${gotoStr}`, { ...detachedOpts, shell: true });
|
|
335593
336634
|
} else {
|
|
335594
|
-
child =
|
|
336635
|
+
child = spawn8(base2, [...editorArgs, ...gotoArgv], detachedOpts);
|
|
335595
336636
|
}
|
|
335596
336637
|
child.on("error", (e) => logForDebugging(`editor spawn failed: ${e}`, { level: "error" }));
|
|
335597
336638
|
child.unref();
|
|
@@ -335600,14 +336641,14 @@ function openFileInExternalEditor(filePath, line) {
|
|
|
335600
336641
|
const inkInstance = instances_default.get(process.stdout);
|
|
335601
336642
|
if (!inkInstance)
|
|
335602
336643
|
return false;
|
|
335603
|
-
const useGotoLine = line && PLUS_N_EDITORS.test(
|
|
336644
|
+
const useGotoLine = line && PLUS_N_EDITORS.test(basename38(base2));
|
|
335604
336645
|
inkInstance.enterAlternateScreen();
|
|
335605
336646
|
try {
|
|
335606
336647
|
const syncOpts = { stdio: "inherit" };
|
|
335607
336648
|
let result;
|
|
335608
336649
|
if (process.platform === "win32") {
|
|
335609
336650
|
const lineArg = useGotoLine ? `+${line} ` : "";
|
|
335610
|
-
result =
|
|
336651
|
+
result = spawnSync7(`${editor} ${lineArg}"${filePath}"`, {
|
|
335611
336652
|
...syncOpts,
|
|
335612
336653
|
shell: true
|
|
335613
336654
|
});
|
|
@@ -335616,7 +336657,7 @@ function openFileInExternalEditor(filePath, line) {
|
|
|
335616
336657
|
...editorArgs,
|
|
335617
336658
|
...useGotoLine ? [`+${line}`, filePath] : [filePath]
|
|
335618
336659
|
];
|
|
335619
|
-
result =
|
|
336660
|
+
result = spawnSync7(base2, args, syncOpts);
|
|
335620
336661
|
}
|
|
335621
336662
|
if (result.error) {
|
|
335622
336663
|
logForDebugging(`editor spawn failed: ${result.error}`, {
|
|
@@ -336723,7 +337764,7 @@ function HelpV2(t0) {
|
|
|
336723
337764
|
let t6;
|
|
336724
337765
|
if ($2[31] !== tabs) {
|
|
336725
337766
|
t6 = /* @__PURE__ */ jsx_runtime212.jsx(Tabs, {
|
|
336726
|
-
title: `Theus v${{ VERSION: "0.2.
|
|
337767
|
+
title: `Theus v${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}`,
|
|
336727
337768
|
color: "professionalBlue",
|
|
336728
337769
|
defaultTab: "general",
|
|
336729
337770
|
children: tabs
|
|
@@ -340106,7 +341147,7 @@ var init_channelPermissions = __esm(() => {
|
|
|
340106
341147
|
});
|
|
340107
341148
|
|
|
340108
341149
|
// services/mcp/useManageMCPConnections.ts
|
|
340109
|
-
import { basename as
|
|
341150
|
+
import { basename as basename39 } from "path";
|
|
340110
341151
|
function getErrorKey(error40) {
|
|
340111
341152
|
const plugin = "plugin" in error40 ? error40.plugin : "no-plugin";
|
|
340112
341153
|
return `${error40.type}:${error40.source}:${plugin}`;
|
|
@@ -340483,7 +341524,7 @@ function useManageMCPConnections(dynamicMcpConfig, isStrictMcpConfig = false) {
|
|
|
340483
341524
|
else if (serverConfig.scope === "theusai")
|
|
340484
341525
|
counts.theusai++;
|
|
340485
341526
|
if (process.env.USER_TYPE === "ant" && !isMcpServerDisabled(name) && (serverConfig.type === undefined || serverConfig.type === "stdio") && "command" in serverConfig) {
|
|
340486
|
-
stdioCommands.push(
|
|
341527
|
+
stdioCommands.push(basename39(serverConfig.command));
|
|
340487
341528
|
}
|
|
340488
341529
|
}
|
|
340489
341530
|
logEvent("tengu_mcp_servers", {
|
|
@@ -353447,6 +354488,16 @@ var init_mcp3 = __esm(() => {
|
|
|
353447
354488
|
var NOVEDADES;
|
|
353448
354489
|
var init_data = __esm(() => {
|
|
353449
354490
|
NOVEDADES = [
|
|
354491
|
+
{
|
|
354492
|
+
version: "v0.2.12",
|
|
354493
|
+
fecha: "2026-07-11",
|
|
354494
|
+
titulo: "Panel de terminal integrado, diffs a color y sandbox",
|
|
354495
|
+
puntos: [
|
|
354496
|
+
"Panel de terminal integrado (Alt+J): abre una terminal real junto a tu sesi\xF3n, persistente v\xEDa tmux, y Theus puede leer su contenido para ayudarte. Act\xEDvalo con THEUS_TERMINAL_PANEL=1.",
|
|
354497
|
+
"Resaltado de diffs con color perceptual real (word-diff coloreado, cuantizaci\xF3n a 256 colores), ahora en TypeScript puro sin depender de binarios nativos.",
|
|
354498
|
+
"El sandbox de ejecuci\xF3n est\xE1 disponible: settings.sandbox.enabled a\xEDsla los comandos de shell (bloquea escrituras fuera del proyecto y la red) para una ejecuci\xF3n m\xE1s segura."
|
|
354499
|
+
]
|
|
354500
|
+
},
|
|
353450
354501
|
{
|
|
353451
354502
|
version: "v0.2.11",
|
|
353452
354503
|
fecha: "2026-07-11",
|
|
@@ -354394,9 +355445,9 @@ function getAllReleaseNotes(changelogContent = getStoredChangelogFromMemory()) {
|
|
|
354394
355445
|
return [];
|
|
354395
355446
|
}
|
|
354396
355447
|
}
|
|
354397
|
-
async function checkForReleaseNotes(lastSeenVersion, currentVersion = { VERSION: "0.2.
|
|
355448
|
+
async function checkForReleaseNotes(lastSeenVersion, currentVersion = { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION) {
|
|
354398
355449
|
if (process.env.USER_TYPE === "ant") {
|
|
354399
|
-
const changelog = { VERSION: "0.2.
|
|
355450
|
+
const changelog = { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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;
|
|
354400
355451
|
if (changelog) {
|
|
354401
355452
|
const commits = changelog.trim().split(`
|
|
354402
355453
|
`).filter(Boolean);
|
|
@@ -355583,7 +356634,7 @@ var init_TheusSessionGrid = __esm(() => {
|
|
|
355583
356634
|
});
|
|
355584
356635
|
|
|
355585
356636
|
// components/Theus/TheusSessionHeader.tsx
|
|
355586
|
-
import { basename as
|
|
356637
|
+
import { basename as basename42 } from "path";
|
|
355587
356638
|
function compactModelName(model, maxLength) {
|
|
355588
356639
|
if (model.length <= maxLength)
|
|
355589
356640
|
return model;
|
|
@@ -355599,7 +356650,7 @@ function TheusSessionHeader({ version: version2 }) {
|
|
|
355599
356650
|
const [themeName] = useTheme();
|
|
355600
356651
|
const theme = getTheme(themeName);
|
|
355601
356652
|
const { columns } = useTerminalSize();
|
|
355602
|
-
const project =
|
|
356653
|
+
const project = basename42(getCwd()) || "proyecto";
|
|
355603
356654
|
const model = compactModelName(String(getMainLoopModel()), columns < 72 ? 22 : 36);
|
|
355604
356655
|
const ruleLength = Math.max(8, Math.min(columns - 2, 72));
|
|
355605
356656
|
const showArt = process.env.THEUS_CODE_NO_SESSION_ART !== "1";
|
|
@@ -358784,7 +359835,7 @@ var init_Messages = __esm(() => {
|
|
|
358784
359835
|
let t1;
|
|
358785
359836
|
if ($2[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
358786
359837
|
t1 = /* @__PURE__ */ jsx_runtime251.jsx(TheusSessionHeader, {
|
|
358787
|
-
version: { VERSION: "0.2.
|
|
359838
|
+
version: { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
358788
359839
|
});
|
|
358789
359840
|
$2[0] = t1;
|
|
358790
359841
|
} else {
|
|
@@ -386324,7 +387375,7 @@ async function captureMemoryDiagnostics(trigger, dumpNumber = 0) {
|
|
|
386324
387375
|
smapsRollup,
|
|
386325
387376
|
platform: process.platform,
|
|
386326
387377
|
nodeVersion: process.version,
|
|
386327
|
-
ccVersion: { VERSION: "0.2.
|
|
387378
|
+
ccVersion: { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
386328
387379
|
};
|
|
386329
387380
|
}
|
|
386330
387381
|
async function performHeapDump(trigger = "manual", dumpNumber = 0) {
|
|
@@ -386910,7 +387961,7 @@ var init_bridge_kick = __esm(() => {
|
|
|
386910
387961
|
var call55 = async () => {
|
|
386911
387962
|
return {
|
|
386912
387963
|
type: "text",
|
|
386913
|
-
value: { VERSION: "0.2.
|
|
387964
|
+
value: { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.BUILD_TIME ? `${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} (built ${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.BUILD_TIME})` : { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
386914
387965
|
};
|
|
386915
387966
|
}, version2, version_default;
|
|
386916
387967
|
var init_version = __esm(() => {
|
|
@@ -388276,7 +389327,7 @@ var init_advisor2 = __esm(() => {
|
|
|
388276
389327
|
// skills/bundledSkills.ts
|
|
388277
389328
|
import { constants as fsConstants5 } from "fs";
|
|
388278
389329
|
import { mkdir as mkdir41, open as open13 } from "fs/promises";
|
|
388279
|
-
import { dirname as dirname56, isAbsolute as isAbsolute25, join as join137, normalize as
|
|
389330
|
+
import { dirname as dirname56, isAbsolute as isAbsolute25, join as join137, normalize as normalize13, sep as pathSep2 } from "path";
|
|
388280
389331
|
function registerBundledSkill(definition) {
|
|
388281
389332
|
const { files: files2 } = definition;
|
|
388282
389333
|
let skillRoot;
|
|
@@ -388362,7 +389413,7 @@ async function safeWriteFile(p, content) {
|
|
|
388362
389413
|
}
|
|
388363
389414
|
}
|
|
388364
389415
|
function resolveSkillFilePath(baseDir, relPath) {
|
|
388365
|
-
const normalized =
|
|
389416
|
+
const normalized = normalize13(relPath);
|
|
388366
389417
|
if (isAbsolute25(normalized) || normalized.split(pathSep2).includes("..") || normalized.split("/").includes("..")) {
|
|
388367
389418
|
throw new Error(`bundled skill file path escapes skill dir: ${relPath}`);
|
|
388368
389419
|
}
|
|
@@ -388464,7 +389515,7 @@ function WorktreeExitDialog({
|
|
|
388464
389515
|
async function handleSelect(value) {
|
|
388465
389516
|
if (!worktreeSession)
|
|
388466
389517
|
return;
|
|
388467
|
-
const
|
|
389518
|
+
const hasTmux2 = Boolean(worktreeSession.tmuxSessionName);
|
|
388468
389519
|
if (value === "keep" || value === "keep-with-tmux") {
|
|
388469
389520
|
setStatus("keeping");
|
|
388470
389521
|
logEvent("tengu_worktree_kept", {
|
|
@@ -388476,7 +389527,7 @@ function WorktreeExitDialog({
|
|
|
388476
389527
|
setCwd(worktreeSession.originalCwd);
|
|
388477
389528
|
recordWorktreeExit();
|
|
388478
389529
|
getPlansDirectory.cache.clear?.();
|
|
388479
|
-
if (
|
|
389530
|
+
if (hasTmux2) {
|
|
388480
389531
|
setResultMessage(`Worktree kept. Your work is saved at ${worktreeSession.worktreePath} on branch ${worktreeSession.worktreeBranch}. Reattach to tmux session with: tmux attach -t ${worktreeSession.tmuxSessionName}`);
|
|
388481
389532
|
} else {
|
|
388482
389533
|
setResultMessage(`Worktree kept. Your work is saved at ${worktreeSession.worktreePath} on branch ${worktreeSession.worktreeBranch}`);
|
|
@@ -388521,7 +389572,7 @@ function WorktreeExitDialog({
|
|
|
388521
389572
|
setStatus("done");
|
|
388522
389573
|
return;
|
|
388523
389574
|
}
|
|
388524
|
-
const tmuxNote =
|
|
389575
|
+
const tmuxNote = hasTmux2 ? " Tmux session terminated." : "";
|
|
388525
389576
|
if (commitCount > 0 && changes.length > 0) {
|
|
388526
389577
|
setResultMessage(`Worktree removed. ${commitCount} ${commitCount === 1 ? "commit" : "commits"} and uncommitted changes were discarded.${tmuxNote}`);
|
|
388527
389578
|
} else if (commitCount > 0) {
|
|
@@ -390643,7 +391694,7 @@ var exports_update = {};
|
|
|
390643
391694
|
__export(exports_update, {
|
|
390644
391695
|
update: () => update
|
|
390645
391696
|
});
|
|
390646
|
-
import { spawn as
|
|
391697
|
+
import { spawn as spawn9, spawnSync as spawnSync8 } from "child_process";
|
|
390647
391698
|
import { createHash as createHash27 } from "crypto";
|
|
390648
391699
|
import {
|
|
390649
391700
|
cpSync,
|
|
@@ -390676,7 +391727,7 @@ async function updateNaupa() {
|
|
|
390676
391727
|
settled = true;
|
|
390677
391728
|
resolve43();
|
|
390678
391729
|
};
|
|
390679
|
-
const child =
|
|
391730
|
+
const child = spawn9(bin, ["update", "-y", "--ui"], {
|
|
390680
391731
|
stdio: ["ignore", "inherit", "inherit"],
|
|
390681
391732
|
env: process.env
|
|
390682
391733
|
});
|
|
@@ -390755,13 +391806,13 @@ async function updateReleaseBundle() {
|
|
|
390755
391806
|
await gracefulShutdown(1);
|
|
390756
391807
|
return;
|
|
390757
391808
|
}
|
|
390758
|
-
if (gte({ VERSION: "0.2.
|
|
390759
|
-
writeToStdout(source_default.green(`Theus is up to date (${{ VERSION: "0.2.
|
|
391809
|
+
if (gte({ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
|
|
391810
|
+
writeToStdout(source_default.green(`Theus is up to date (${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})`) + `
|
|
390760
391811
|
`);
|
|
390761
391812
|
await gracefulShutdown(0);
|
|
390762
391813
|
return;
|
|
390763
391814
|
}
|
|
390764
|
-
writeToStdout(`New version available: ${latest} (current: ${{ VERSION: "0.2.
|
|
391815
|
+
writeToStdout(`New version available: ${latest} (current: ${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})
|
|
390765
391816
|
`);
|
|
390766
391817
|
writeToStdout(`Installing update from theus.pe/dl...
|
|
390767
391818
|
`);
|
|
@@ -390784,7 +391835,7 @@ async function updateReleaseBundle() {
|
|
|
390784
391835
|
await gracefulShutdown(1);
|
|
390785
391836
|
return;
|
|
390786
391837
|
}
|
|
390787
|
-
const ex =
|
|
391838
|
+
const ex = spawnSync8("tar", ["-xzf", tarPath, "-C", tmp], {
|
|
390788
391839
|
stdio: "ignore"
|
|
390789
391840
|
});
|
|
390790
391841
|
const staged = join140(tmp, "theus-cli");
|
|
@@ -390795,7 +391846,7 @@ async function updateReleaseBundle() {
|
|
|
390795
391846
|
return;
|
|
390796
391847
|
}
|
|
390797
391848
|
cpSync(staged, bundleDir, { recursive: true, force: true });
|
|
390798
|
-
writeToStdout(source_default.green(`Successfully updated from ${{ VERSION: "0.2.
|
|
391849
|
+
writeToStdout(source_default.green(`Successfully updated from ${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION} to version ${latest}`) + `
|
|
390799
391850
|
`);
|
|
390800
391851
|
await regenerateCompletionCache();
|
|
390801
391852
|
} finally {
|
|
@@ -390808,7 +391859,7 @@ async function updateReleaseBundle() {
|
|
|
390808
391859
|
async function update() {
|
|
390809
391860
|
logEvent("tengu_update_check", {});
|
|
390810
391861
|
await updateNaupa();
|
|
390811
|
-
writeToStdout(`Current version: ${{ VERSION: "0.2.
|
|
391862
|
+
writeToStdout(`Current version: ${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}
|
|
390812
391863
|
`);
|
|
390813
391864
|
const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
|
|
390814
391865
|
writeToStdout(`Checking for updates to ${channel2} version...
|
|
@@ -390887,8 +391938,8 @@ async function update() {
|
|
|
390887
391938
|
writeToStdout(`Theus is managed by Homebrew.
|
|
390888
391939
|
`);
|
|
390889
391940
|
const latest = await getLatestVersion(channel2);
|
|
390890
|
-
if (latest && !gte({ VERSION: "0.2.
|
|
390891
|
-
writeToStdout(`Update available: ${{ VERSION: "0.2.
|
|
391941
|
+
if (latest && !gte({ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
|
|
391942
|
+
writeToStdout(`Update available: ${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}
|
|
390892
391943
|
`);
|
|
390893
391944
|
writeToStdout(`
|
|
390894
391945
|
`);
|
|
@@ -390904,8 +391955,8 @@ async function update() {
|
|
|
390904
391955
|
writeToStdout(`Theus is managed by winget.
|
|
390905
391956
|
`);
|
|
390906
391957
|
const latest = await getLatestVersion(channel2);
|
|
390907
|
-
if (latest && !gte({ VERSION: "0.2.
|
|
390908
|
-
writeToStdout(`Update available: ${{ VERSION: "0.2.
|
|
391958
|
+
if (latest && !gte({ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
|
|
391959
|
+
writeToStdout(`Update available: ${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}
|
|
390909
391960
|
`);
|
|
390910
391961
|
writeToStdout(`
|
|
390911
391962
|
`);
|
|
@@ -390921,8 +391972,8 @@ async function update() {
|
|
|
390921
391972
|
writeToStdout(`Theus is managed by apk.
|
|
390922
391973
|
`);
|
|
390923
391974
|
const latest = await getLatestVersion(channel2);
|
|
390924
|
-
if (latest && !gte({ VERSION: "0.2.
|
|
390925
|
-
writeToStdout(`Update available: ${{ VERSION: "0.2.
|
|
391975
|
+
if (latest && !gte({ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
|
|
391976
|
+
writeToStdout(`Update available: ${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}
|
|
390926
391977
|
`);
|
|
390927
391978
|
writeToStdout(`
|
|
390928
391979
|
`);
|
|
@@ -390987,11 +392038,11 @@ async function update() {
|
|
|
390987
392038
|
`);
|
|
390988
392039
|
await gracefulShutdown(1);
|
|
390989
392040
|
}
|
|
390990
|
-
if (result.latestVersion === { VERSION: "0.2.
|
|
390991
|
-
writeToStdout(source_default.green(`Theus is up to date (${{ VERSION: "0.2.
|
|
392041
|
+
if (result.latestVersion === { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION) {
|
|
392042
|
+
writeToStdout(source_default.green(`Theus is up to date (${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})`) + `
|
|
390992
392043
|
`);
|
|
390993
392044
|
} else {
|
|
390994
|
-
writeToStdout(source_default.green(`Successfully updated from ${{ VERSION: "0.2.
|
|
392045
|
+
writeToStdout(source_default.green(`Successfully updated from ${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}`) + `
|
|
390995
392046
|
`);
|
|
390996
392047
|
await regenerateCompletionCache();
|
|
390997
392048
|
}
|
|
@@ -391010,9 +392061,9 @@ async function update() {
|
|
|
391010
392061
|
await removeInstalledSymlink();
|
|
391011
392062
|
}
|
|
391012
392063
|
logForDebugging("update: Checking npm registry for latest version");
|
|
391013
|
-
logForDebugging(`update: Package URL: ${{ VERSION: "0.2.
|
|
392064
|
+
logForDebugging(`update: Package URL: ${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.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}`);
|
|
391014
392065
|
const npmTag = channel2 === "stable" ? "stable" : "latest";
|
|
391015
|
-
const npmCommand = `npm view ${{ VERSION: "0.2.
|
|
392066
|
+
const npmCommand = `npm view ${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.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`;
|
|
391016
392067
|
logForDebugging(`update: Running: ${npmCommand}`);
|
|
391017
392068
|
const latestVersion = await getLatestVersion(channel2);
|
|
391018
392069
|
logForDebugging(`update: Latest version from npm: ${latestVersion || "FAILED"}`);
|
|
@@ -391032,7 +392083,7 @@ async function update() {
|
|
|
391032
392083
|
`);
|
|
391033
392084
|
process.stderr.write(` \u2022 Corporate proxy/firewall blocking npm
|
|
391034
392085
|
`);
|
|
391035
|
-
if ({ VERSION: "0.2.
|
|
392086
|
+
if ({ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL && !{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.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")) {
|
|
391036
392087
|
process.stderr.write(` \u2022 Internal/development build not published to npm
|
|
391037
392088
|
`);
|
|
391038
392089
|
}
|
|
@@ -391044,19 +392095,19 @@ async function update() {
|
|
|
391044
392095
|
`);
|
|
391045
392096
|
process.stderr.write(` \u2022 Run with --debug flag for more details
|
|
391046
392097
|
`);
|
|
391047
|
-
const packageName = { VERSION: "0.2.
|
|
392098
|
+
const packageName = { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.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");
|
|
391048
392099
|
process.stderr.write(` \u2022 Manually check: npm view ${packageName} version
|
|
391049
392100
|
`);
|
|
391050
392101
|
process.stderr.write(` \u2022 Check if you need to login: npm whoami
|
|
391051
392102
|
`);
|
|
391052
392103
|
await gracefulShutdown(1);
|
|
391053
392104
|
}
|
|
391054
|
-
if (gte({ VERSION: "0.2.
|
|
391055
|
-
writeToStdout(source_default.green(`Theus is up to date (${{ VERSION: "0.2.
|
|
392105
|
+
if (gte({ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
|
|
392106
|
+
writeToStdout(source_default.green(`Theus is up to date (${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})`) + `
|
|
391056
392107
|
`);
|
|
391057
392108
|
await gracefulShutdown(0);
|
|
391058
392109
|
}
|
|
391059
|
-
writeToStdout(`New version available: ${latestVersion} (current: ${{ VERSION: "0.2.
|
|
392110
|
+
writeToStdout(`New version available: ${latestVersion} (current: ${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})
|
|
391060
392111
|
`);
|
|
391061
392112
|
writeToStdout(`Installing update...
|
|
391062
392113
|
`);
|
|
@@ -391101,7 +392152,7 @@ async function update() {
|
|
|
391101
392152
|
logForDebugging(`update: Installation status: ${status2}`);
|
|
391102
392153
|
switch (status2) {
|
|
391103
392154
|
case "success":
|
|
391104
|
-
writeToStdout(source_default.green(`Successfully updated from ${{ VERSION: "0.2.
|
|
392155
|
+
writeToStdout(source_default.green(`Successfully updated from ${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}`) + `
|
|
391105
392156
|
`);
|
|
391106
392157
|
await regenerateCompletionCache();
|
|
391107
392158
|
break;
|
|
@@ -391111,7 +392162,7 @@ async function update() {
|
|
|
391111
392162
|
if (useLocalUpdate) {
|
|
391112
392163
|
process.stderr.write(`Try manually updating with:
|
|
391113
392164
|
`);
|
|
391114
|
-
process.stderr.write(` cd ~/.theus/local && npm update ${{ VERSION: "0.2.
|
|
392165
|
+
process.stderr.write(` cd ~/.theus/local && npm update ${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.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}
|
|
391115
392166
|
`);
|
|
391116
392167
|
} else {
|
|
391117
392168
|
process.stderr.write(`Try running with sudo or fix npm permissions
|
|
@@ -391127,7 +392178,7 @@ async function update() {
|
|
|
391127
392178
|
if (useLocalUpdate) {
|
|
391128
392179
|
process.stderr.write(`Try manually updating with:
|
|
391129
392180
|
`);
|
|
391130
|
-
process.stderr.write(` cd ~/.theus/local && npm update ${{ VERSION: "0.2.
|
|
392181
|
+
process.stderr.write(` cd ~/.theus/local && npm update ${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.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}
|
|
391131
392182
|
`);
|
|
391132
392183
|
} else {
|
|
391133
392184
|
process.stderr.write(`Or consider using native installation with: theus install
|
|
@@ -392275,7 +393326,7 @@ function get256Color(index) {
|
|
|
392275
393326
|
const gray2 = (index - 232) * 10 + 8;
|
|
392276
393327
|
return { r: gray2, g: gray2, b: gray2 };
|
|
392277
393328
|
}
|
|
392278
|
-
var ANSI_COLORS, DEFAULT_FG,
|
|
393329
|
+
var ANSI_COLORS, DEFAULT_FG, DEFAULT_BG2;
|
|
392279
393330
|
var init_ansiToSvg = __esm(() => {
|
|
392280
393331
|
ANSI_COLORS = {
|
|
392281
393332
|
30: { r: 0, g: 0, b: 0 },
|
|
@@ -392296,7 +393347,7 @@ var init_ansiToSvg = __esm(() => {
|
|
|
392296
393347
|
97: { r: 255, g: 255, b: 255 }
|
|
392297
393348
|
};
|
|
392298
393349
|
DEFAULT_FG = { r: 229, g: 229, b: 229 };
|
|
392299
|
-
|
|
393350
|
+
DEFAULT_BG2 = { r: 30, g: 30, b: 30 };
|
|
392300
393351
|
});
|
|
392301
393352
|
|
|
392302
393353
|
// utils/ansiToPng.ts
|
|
@@ -392331,7 +393382,7 @@ function ansiToPng(ansiText, options2 = {}) {
|
|
|
392331
393382
|
paddingX = 48,
|
|
392332
393383
|
paddingY = 48,
|
|
392333
393384
|
borderRadius = 16,
|
|
392334
|
-
background =
|
|
393385
|
+
background = DEFAULT_BG2
|
|
392335
393386
|
} = options2;
|
|
392336
393387
|
const lines = parseAnsi(ansiText);
|
|
392337
393388
|
while (lines.length > 0 && lines[lines.length - 1].every((span) => span.text.trim() === "")) {
|
|
@@ -392588,7 +393639,7 @@ var init_screenshotClipboard = __esm(() => {
|
|
|
392588
393639
|
|
|
392589
393640
|
// utils/stats.ts
|
|
392590
393641
|
import { open as open15 } from "fs/promises";
|
|
392591
|
-
import { basename as
|
|
393642
|
+
import { basename as basename43, join as join143, sep as sep31 } from "path";
|
|
392592
393643
|
async function processSessionFiles(sessionFiles, options2 = {}) {
|
|
392593
393644
|
const { fromDate, toDate } = options2;
|
|
392594
393645
|
const fs5 = getFsImplementation();
|
|
@@ -392646,7 +393697,7 @@ async function processSessionFiles(sessionFiles, options2 = {}) {
|
|
|
392646
393697
|
logForDebugging(`Failed to read session file ${sessionFile}: ${errorMessage(error40)}`);
|
|
392647
393698
|
continue;
|
|
392648
393699
|
}
|
|
392649
|
-
const sessionId =
|
|
393700
|
+
const sessionId = basename43(sessionFile, ".jsonl");
|
|
392650
393701
|
const messages = [];
|
|
392651
393702
|
for (const entry of entries) {
|
|
392652
393703
|
if (isTranscriptMessage(entry)) {
|
|
@@ -394673,10 +395724,10 @@ function __stub12(ref) {
|
|
|
394673
395724
|
}
|
|
394674
395725
|
});
|
|
394675
395726
|
}
|
|
394676
|
-
var __module12 = "commands/agents-platform/index.js",
|
|
395727
|
+
var __module12 = "commands/agents-platform/index.js", _s23, agents_platform_default;
|
|
394677
395728
|
var init_agents_platform = __esm(() => {
|
|
394678
|
-
|
|
394679
|
-
agents_platform_default =
|
|
395729
|
+
_s23 = __stub12(__module12);
|
|
395730
|
+
agents_platform_default = _s23;
|
|
394680
395731
|
});
|
|
394681
395732
|
|
|
394682
395733
|
// commands.ts
|
|
@@ -395204,7 +396255,7 @@ import {
|
|
|
395204
396255
|
unlink as unlink20,
|
|
395205
396256
|
writeFile as writeFile48
|
|
395206
396257
|
} from "fs/promises";
|
|
395207
|
-
import { basename as
|
|
396258
|
+
import { basename as basename44, dirname as dirname59, join as join144 } from "path";
|
|
395208
396259
|
function isTranscriptMessage(entry) {
|
|
395209
396260
|
return entry.type === "user" || entry.type === "assistant" || entry.type === "attachment" || entry.type === "system";
|
|
395210
396261
|
}
|
|
@@ -397638,7 +398689,7 @@ async function getSessionFilesWithMtime(projectDir) {
|
|
|
397638
398689
|
for (const dirent of dirents) {
|
|
397639
398690
|
if (!dirent.isFile() || !dirent.name.endsWith(".jsonl"))
|
|
397640
398691
|
continue;
|
|
397641
|
-
const sessionId = validateUuid2(
|
|
398692
|
+
const sessionId = validateUuid2(basename44(dirent.name, ".jsonl"));
|
|
397642
398693
|
if (!sessionId)
|
|
397643
398694
|
continue;
|
|
397644
398695
|
candidates.push({ sessionId, filePath: join144(projectDir, dirent.name) });
|
|
@@ -398027,7 +399078,7 @@ var init_sessionStorage = __esm(() => {
|
|
|
398027
399078
|
init_settings2();
|
|
398028
399079
|
init_slowOperations();
|
|
398029
399080
|
init_uuid();
|
|
398030
|
-
VERSION4 = { VERSION: "0.2.
|
|
399081
|
+
VERSION4 = { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
|
|
398031
399082
|
MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
|
|
398032
399083
|
SKIP_FIRST_PROMPT_PATTERN = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
|
|
398033
399084
|
EPHEMERAL_PROGRESS_TYPES = new Set([
|
|
@@ -398277,7 +399328,7 @@ var init_memdir = __esm(() => {
|
|
|
398277
399328
|
});
|
|
398278
399329
|
|
|
398279
399330
|
// tools/AgentTool/agentMemory.ts
|
|
398280
|
-
import { join as join145, normalize as
|
|
399331
|
+
import { join as join145, normalize as normalize14, sep as sep32 } from "path";
|
|
398281
399332
|
function sanitizeAgentTypeForPath(agentType) {
|
|
398282
399333
|
return agentType.replace(/:/g, "-");
|
|
398283
399334
|
}
|
|
@@ -398299,7 +399350,7 @@ function getAgentMemoryDir(agentType, scope) {
|
|
|
398299
399350
|
}
|
|
398300
399351
|
}
|
|
398301
399352
|
function isAgentMemoryPath(absolutePath) {
|
|
398302
|
-
const normalizedPath =
|
|
399353
|
+
const normalizedPath = normalize14(absolutePath);
|
|
398303
399354
|
const memoryBase = getMemoryBaseDir();
|
|
398304
399355
|
if (normalizedPath.startsWith(join145(memoryBase, "agent-memory") + sep32)) {
|
|
398305
399356
|
return true;
|
|
@@ -398362,7 +399413,7 @@ var init_agentMemory = __esm(() => {
|
|
|
398362
399413
|
// utils/permissions/filesystem.ts
|
|
398363
399414
|
import { randomBytes as randomBytes21 } from "crypto";
|
|
398364
399415
|
import { homedir as homedir36, tmpdir as tmpdir11 } from "os";
|
|
398365
|
-
import { join as join146, normalize as
|
|
399416
|
+
import { join as join146, normalize as normalize15, posix as posix8, sep as sep33 } from "path";
|
|
398366
399417
|
function normalizeCaseForComparison(path19) {
|
|
398367
399418
|
return path19.toLowerCase();
|
|
398368
399419
|
}
|
|
@@ -398437,7 +399488,7 @@ function isTheusConfigFilePath(filePath) {
|
|
|
398437
399488
|
}
|
|
398438
399489
|
function isSessionPlanFile(absolutePath) {
|
|
398439
399490
|
const expectedPrefix = join146(getPlansDirectory(), getPlanSlug());
|
|
398440
|
-
const normalizedPath =
|
|
399491
|
+
const normalizedPath = normalize15(absolutePath);
|
|
398441
399492
|
return normalizedPath.startsWith(expectedPrefix) && normalizedPath.endsWith(".md");
|
|
398442
399493
|
}
|
|
398443
399494
|
function getSessionMemoryDir() {
|
|
@@ -398447,12 +399498,12 @@ function getSessionMemoryPath() {
|
|
|
398447
399498
|
return join146(getSessionMemoryDir(), "summary.md");
|
|
398448
399499
|
}
|
|
398449
399500
|
function isSessionMemoryPath(absolutePath) {
|
|
398450
|
-
const normalizedPath =
|
|
399501
|
+
const normalizedPath = normalize15(absolutePath);
|
|
398451
399502
|
return normalizedPath.startsWith(getSessionMemoryDir());
|
|
398452
399503
|
}
|
|
398453
399504
|
function isProjectDirPath(absolutePath) {
|
|
398454
399505
|
const projectDir = getProjectDir2(getCwd());
|
|
398455
|
-
const normalizedPath =
|
|
399506
|
+
const normalizedPath = normalize15(absolutePath);
|
|
398456
399507
|
return normalizedPath === projectDir || normalizedPath.startsWith(projectDir + sep33);
|
|
398457
399508
|
}
|
|
398458
399509
|
function isScratchpadEnabled() {
|
|
@@ -398485,7 +399536,7 @@ function isScratchpadPath(absolutePath) {
|
|
|
398485
399536
|
return false;
|
|
398486
399537
|
}
|
|
398487
399538
|
const scratchpadDir = getScratchpadDir();
|
|
398488
|
-
const normalizedPath =
|
|
399539
|
+
const normalizedPath = normalize15(absolutePath);
|
|
398489
399540
|
return normalizedPath === scratchpadDir || normalizedPath.startsWith(scratchpadDir + sep33);
|
|
398490
399541
|
}
|
|
398491
399542
|
function isDangerousFilePathToAutoEdit(path19) {
|
|
@@ -399005,7 +400056,7 @@ function generateSuggestions(filePath, operationType, toolPermissionContext, pre
|
|
|
399005
400056
|
return shouldSuggestAcceptEdits ? [{ type: "setMode", mode: "acceptEdits", destination: "session" }] : [];
|
|
399006
400057
|
}
|
|
399007
400058
|
function checkEditableInternalPath(absolutePath, input) {
|
|
399008
|
-
const normalizedPath =
|
|
400059
|
+
const normalizedPath = normalize15(absolutePath);
|
|
399009
400060
|
if (isSessionPlanFile(normalizedPath)) {
|
|
399010
400061
|
return {
|
|
399011
400062
|
behavior: "allow",
|
|
@@ -399060,7 +400111,7 @@ function checkEditableInternalPath(absolutePath, input) {
|
|
|
399060
400111
|
return { behavior: "passthrough", message: "" };
|
|
399061
400112
|
}
|
|
399062
400113
|
function checkReadableInternalPath(absolutePath, input) {
|
|
399063
|
-
const normalizedPath =
|
|
400114
|
+
const normalizedPath = normalize15(absolutePath);
|
|
399064
400115
|
if (isSessionMemoryPath(normalizedPath)) {
|
|
399065
400116
|
return {
|
|
399066
400117
|
behavior: "allow",
|
|
@@ -399232,7 +400283,7 @@ var init_filesystem = __esm(() => {
|
|
|
399232
400283
|
});
|
|
399233
400284
|
getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
|
|
399234
400285
|
const nonce = randomBytes21(16).toString("hex");
|
|
399235
|
-
return join146(getTheusTempDir(), "bundled-skills", { VERSION: "0.2.
|
|
400286
|
+
return join146(getTheusTempDir(), "bundled-skills", { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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);
|
|
399236
400287
|
});
|
|
399237
400288
|
getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
|
|
399238
400289
|
});
|
|
@@ -400663,8 +401714,8 @@ __export(exports_hooks2, {
|
|
|
400663
401714
|
executeConfigChangeHooks: () => executeConfigChangeHooks,
|
|
400664
401715
|
createBaseHookInput: () => createBaseHookInput
|
|
400665
401716
|
});
|
|
400666
|
-
import { basename as
|
|
400667
|
-
import { spawn as
|
|
401717
|
+
import { basename as basename45 } from "path";
|
|
401718
|
+
import { spawn as spawn10 } from "child_process";
|
|
400668
401719
|
import { randomUUID as randomUUID31 } from "crypto";
|
|
400669
401720
|
function getSessionEndHookTimeoutMs() {
|
|
400670
401721
|
const raw = process.env.THEUS_CODE_SESSIONEND_HOOKS_TIMEOUT_MS;
|
|
@@ -401077,14 +402128,14 @@ async function execCommandHook(hook, hookEvent, hookName, jsonInput, signal, hoo
|
|
|
401077
402128
|
if (!pwshPath) {
|
|
401078
402129
|
throw new Error(`Hook "${hook.command}" has shell: 'powershell' but no PowerShell ` + `executable (pwsh or powershell) was found on PATH. Install ` + `PowerShell, or remove "shell": "powershell" to use bash.`);
|
|
401079
402130
|
}
|
|
401080
|
-
child =
|
|
402131
|
+
child = spawn10(pwshPath, buildPowerShellArgs(finalCommand), {
|
|
401081
402132
|
env: envVars,
|
|
401082
402133
|
cwd: safeCwd,
|
|
401083
402134
|
windowsHide: true
|
|
401084
402135
|
});
|
|
401085
402136
|
} else {
|
|
401086
402137
|
const shell = isWindows2 ? findGitBashPath() : true;
|
|
401087
|
-
child =
|
|
402138
|
+
child = spawn10(finalCommand, [], {
|
|
401088
402139
|
env: envVars,
|
|
401089
402140
|
cwd: safeCwd,
|
|
401090
402141
|
shell,
|
|
@@ -401494,7 +402545,7 @@ async function getMatchingHooks(appState, sessionId, hookEvent, hookInput, tools
|
|
|
401494
402545
|
matchQuery = hookInput.load_reason;
|
|
401495
402546
|
break;
|
|
401496
402547
|
case "FileChanged":
|
|
401497
|
-
matchQuery =
|
|
402548
|
+
matchQuery = basename45(hookInput.file_path);
|
|
401498
402549
|
break;
|
|
401499
402550
|
default:
|
|
401500
402551
|
break;
|
|
@@ -403515,7 +404566,7 @@ __export(exports_worktree, {
|
|
|
403515
404566
|
cleanupWorktree: () => cleanupWorktree,
|
|
403516
404567
|
cleanupStaleAgentWorktrees: () => cleanupStaleAgentWorktrees
|
|
403517
404568
|
});
|
|
403518
|
-
import { spawnSync as
|
|
404569
|
+
import { spawnSync as spawnSync9 } from "child_process";
|
|
403519
404570
|
import {
|
|
403520
404571
|
copyFile as copyFile9,
|
|
403521
404572
|
mkdir as mkdir45,
|
|
@@ -403525,7 +404576,7 @@ import {
|
|
|
403525
404576
|
symlink as symlink5,
|
|
403526
404577
|
utimes as utimes2
|
|
403527
404578
|
} from "fs/promises";
|
|
403528
|
-
import { basename as
|
|
404579
|
+
import { basename as basename46, dirname as dirname60, join as join148 } from "path";
|
|
403529
404580
|
function validateWorktreeSlug(slug) {
|
|
403530
404581
|
if (slug.length > MAX_WORKTREE_SLUG_LENGTH) {
|
|
403531
404582
|
throw new Error(`Invalid worktree name: must be ${MAX_WORKTREE_SLUG_LENGTH} characters or fewer (got ${slug.length})`);
|
|
@@ -403568,7 +404619,7 @@ function restoreWorktreeSession(session2) {
|
|
|
403568
404619
|
currentWorktreeSession = session2;
|
|
403569
404620
|
}
|
|
403570
404621
|
function generateTmuxSessionName(repoPath, branch2) {
|
|
403571
|
-
const repoName =
|
|
404622
|
+
const repoName = basename46(repoPath);
|
|
403572
404623
|
const combined = `${repoName}_${branch2}`;
|
|
403573
404624
|
return combined.replace(/[/.]/g, "_");
|
|
403574
404625
|
}
|
|
@@ -404084,7 +405135,7 @@ async function execIntoTmuxWorktree(args) {
|
|
|
404084
405135
|
error: "Error: --tmux is not supported on Windows"
|
|
404085
405136
|
};
|
|
404086
405137
|
}
|
|
404087
|
-
const tmuxCheck =
|
|
405138
|
+
const tmuxCheck = spawnSync9("tmux", ["-V"], { encoding: "utf-8" });
|
|
404088
405139
|
if (tmuxCheck.status !== 0) {
|
|
404089
405140
|
const installHint = process.platform === "darwin" ? "Install tmux with: brew install tmux" : "Install tmux with: sudo apt install tmux";
|
|
404090
405141
|
return {
|
|
@@ -404144,7 +405195,7 @@ async function execIntoTmuxWorktree(args) {
|
|
|
404144
405195
|
error: `Error: ${errorMessage(error40)}`
|
|
404145
405196
|
};
|
|
404146
405197
|
}
|
|
404147
|
-
repoName =
|
|
405198
|
+
repoName = basename46(findCanonicalGitRoot(getCwd()) ?? getCwd());
|
|
404148
405199
|
console.log(`Using worktree via hook: ${worktreeDir}`);
|
|
404149
405200
|
} else {
|
|
404150
405201
|
const repoRoot = findCanonicalGitRoot(getCwd());
|
|
@@ -404154,7 +405205,7 @@ async function execIntoTmuxWorktree(args) {
|
|
|
404154
405205
|
error: "Error: --worktree requires a git repository"
|
|
404155
405206
|
};
|
|
404156
405207
|
}
|
|
404157
|
-
repoName =
|
|
405208
|
+
repoName = basename46(repoRoot);
|
|
404158
405209
|
worktreeDir = worktreePathFor(repoRoot, worktreeName);
|
|
404159
405210
|
try {
|
|
404160
405211
|
const result = await getOrCreateWorktree(repoRoot, worktreeName, prNumber !== null ? { prNumber } : undefined);
|
|
@@ -404189,7 +405240,7 @@ async function execIntoTmuxWorktree(args) {
|
|
|
404189
405240
|
newArgs.push(arg);
|
|
404190
405241
|
}
|
|
404191
405242
|
let tmuxPrefix = "C-b";
|
|
404192
|
-
const prefixResult =
|
|
405243
|
+
const prefixResult = spawnSync9("tmux", ["show-options", "-g", "prefix"], {
|
|
404193
405244
|
encoding: "utf-8"
|
|
404194
405245
|
});
|
|
404195
405246
|
if (prefixResult.status === 0 && prefixResult.stdout) {
|
|
@@ -404216,7 +405267,7 @@ async function execIntoTmuxWorktree(args) {
|
|
|
404216
405267
|
THEUS_CODE_TMUX_PREFIX: tmuxPrefix,
|
|
404217
405268
|
THEUS_CODE_TMUX_PREFIX_CONFLICTS: prefixConflicts ? "1" : ""
|
|
404218
405269
|
};
|
|
404219
|
-
const hasSessionResult =
|
|
405270
|
+
const hasSessionResult = spawnSync9("tmux", ["has-session", "-t", tmuxSessionName], { encoding: "utf-8" });
|
|
404220
405271
|
const sessionExists = hasSessionResult.status === 0;
|
|
404221
405272
|
const isAlreadyInTmux = Boolean(process.env.TMUX);
|
|
404222
405273
|
const useControlMode = isInITerm2() && !forceClassicTmux && !isAlreadyInTmux;
|
|
@@ -404234,7 +405285,7 @@ ${y("\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2
|
|
|
404234
405285
|
const isTheusCliInternal = repoName === "theus-cli-internal";
|
|
404235
405286
|
const shouldSetupDevPanes = isAnt && isTheusCliInternal && !sessionExists;
|
|
404236
405287
|
if (shouldSetupDevPanes) {
|
|
404237
|
-
|
|
405288
|
+
spawnSync9("tmux", [
|
|
404238
405289
|
"new-session",
|
|
404239
405290
|
"-d",
|
|
404240
405291
|
"-s",
|
|
@@ -404245,21 +405296,21 @@ ${y("\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2
|
|
|
404245
405296
|
process.execPath,
|
|
404246
405297
|
...newArgs
|
|
404247
405298
|
], { cwd: worktreeDir, env: tmuxEnv });
|
|
404248
|
-
|
|
404249
|
-
|
|
404250
|
-
|
|
404251
|
-
|
|
405299
|
+
spawnSync9("tmux", ["split-window", "-h", "-t", tmuxSessionName, "-c", worktreeDir], { cwd: worktreeDir });
|
|
405300
|
+
spawnSync9("tmux", ["send-keys", "-t", tmuxSessionName, "bun run watch", "Enter"], { cwd: worktreeDir });
|
|
405301
|
+
spawnSync9("tmux", ["split-window", "-v", "-t", tmuxSessionName, "-c", worktreeDir], { cwd: worktreeDir });
|
|
405302
|
+
spawnSync9("tmux", ["send-keys", "-t", tmuxSessionName, "bun run start"], {
|
|
404252
405303
|
cwd: worktreeDir
|
|
404253
405304
|
});
|
|
404254
|
-
|
|
405305
|
+
spawnSync9("tmux", ["select-pane", "-t", `${tmuxSessionName}:0.0`], {
|
|
404255
405306
|
cwd: worktreeDir
|
|
404256
405307
|
});
|
|
404257
405308
|
if (isAlreadyInTmux) {
|
|
404258
|
-
|
|
405309
|
+
spawnSync9("tmux", ["switch-client", "-t", tmuxSessionName], {
|
|
404259
405310
|
stdio: "inherit"
|
|
404260
405311
|
});
|
|
404261
405312
|
} else {
|
|
404262
|
-
|
|
405313
|
+
spawnSync9("tmux", [...tmuxGlobalArgs, "attach-session", "-t", tmuxSessionName], {
|
|
404263
405314
|
stdio: "inherit",
|
|
404264
405315
|
cwd: worktreeDir
|
|
404265
405316
|
});
|
|
@@ -404267,11 +405318,11 @@ ${y("\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2
|
|
|
404267
405318
|
} else {
|
|
404268
405319
|
if (isAlreadyInTmux) {
|
|
404269
405320
|
if (sessionExists) {
|
|
404270
|
-
|
|
405321
|
+
spawnSync9("tmux", ["switch-client", "-t", tmuxSessionName], {
|
|
404271
405322
|
stdio: "inherit"
|
|
404272
405323
|
});
|
|
404273
405324
|
} else {
|
|
404274
|
-
|
|
405325
|
+
spawnSync9("tmux", [
|
|
404275
405326
|
"new-session",
|
|
404276
405327
|
"-d",
|
|
404277
405328
|
"-s",
|
|
@@ -404282,7 +405333,7 @@ ${y("\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2
|
|
|
404282
405333
|
process.execPath,
|
|
404283
405334
|
...newArgs
|
|
404284
405335
|
], { cwd: worktreeDir, env: tmuxEnv });
|
|
404285
|
-
|
|
405336
|
+
spawnSync9("tmux", ["switch-client", "-t", tmuxSessionName], {
|
|
404286
405337
|
stdio: "inherit"
|
|
404287
405338
|
});
|
|
404288
405339
|
}
|
|
@@ -404299,7 +405350,7 @@ ${y("\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2
|
|
|
404299
405350
|
process.execPath,
|
|
404300
405351
|
...newArgs
|
|
404301
405352
|
];
|
|
404302
|
-
|
|
405353
|
+
spawnSync9("tmux", tmuxArgs, {
|
|
404303
405354
|
stdio: "inherit",
|
|
404304
405355
|
cwd: worktreeDir,
|
|
404305
405356
|
env: tmuxEnv
|
|
@@ -404407,7 +405458,7 @@ function getSimpleDoingTasksSection() {
|
|
|
404407
405458
|
];
|
|
404408
405459
|
const userHelpSubitems = [
|
|
404409
405460
|
`/help: Get help with using Theus`,
|
|
404410
|
-
`To give feedback, users should ${{ VERSION: "0.2.
|
|
405461
|
+
`To give feedback, users should ${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.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}`
|
|
404411
405462
|
];
|
|
404412
405463
|
const items = [
|
|
404413
405464
|
`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.`,
|
|
@@ -405230,7 +406281,7 @@ function computeFingerprint(messageText, version3) {
|
|
|
405230
406281
|
}
|
|
405231
406282
|
function computeFingerprintFromMessages(messages) {
|
|
405232
406283
|
const firstMessageText = extractFirstMessageText(messages);
|
|
405233
|
-
return computeFingerprint(firstMessageText, { VERSION: "0.2.
|
|
406284
|
+
return computeFingerprint(firstMessageText, { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
|
|
405234
406285
|
}
|
|
405235
406286
|
var FINGERPRINT_SALT = "59cf53e54c78";
|
|
405236
406287
|
var init_fingerprint = () => {};
|
|
@@ -407754,7 +408805,7 @@ async function sideQuery(opts) {
|
|
|
407754
408805
|
betas.push(STRUCTURED_OUTPUTS_BETA_HEADER);
|
|
407755
408806
|
}
|
|
407756
408807
|
const messageText = extractFirstUserMessageText(messages);
|
|
407757
|
-
const fingerprint = computeFingerprint(messageText, { VERSION: "0.2.
|
|
408808
|
+
const fingerprint = computeFingerprint(messageText, { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
|
|
407758
408809
|
const attributionHeader = getAttributionHeader(fingerprint);
|
|
407759
408810
|
const systemBlocks = [
|
|
407760
408811
|
attributionHeader ? { type: "text", text: attributionHeader } : null,
|
|
@@ -409057,7 +410108,7 @@ async function handleMemories(state) {
|
|
|
409057
410108
|
async function runProjectContextMcpServer() {
|
|
409058
410109
|
const projectRoot = process.env.THEUS_PROJECT_ROOT || process.cwd();
|
|
409059
410110
|
const state = new ProjectContextState(projectRoot);
|
|
409060
|
-
const server = new Server({ name: SERVER_NAME, version: { VERSION: "0.2.
|
|
410111
|
+
const server = new Server({ name: SERVER_NAME, version: { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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: {} } });
|
|
409061
410112
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
409062
410113
|
tools: TOOL_DEFINITIONS.map((t) => ({
|
|
409063
410114
|
name: t.name,
|
|
@@ -410270,7 +411321,7 @@ __export(exports_workerRegistry, {
|
|
|
410270
411321
|
runDaemonWorker: () => runDaemonWorker,
|
|
410271
411322
|
makeOnFireTask: () => makeOnFireTask
|
|
410272
411323
|
});
|
|
410273
|
-
import { spawn as
|
|
411324
|
+
import { spawn as spawn11 } from "child_process";
|
|
410274
411325
|
import { randomUUID as randomUUID34 } from "crypto";
|
|
410275
411326
|
import {
|
|
410276
411327
|
appendFileSync as appendFileSync5,
|
|
@@ -410415,7 +411466,7 @@ function makeOnFireTask(projectDir, projectOptions) {
|
|
|
410415
411466
|
logDaemonLine(`[daemon:cron] fire task=${task.id} cron="${task.cron}" cwd=${cwd2} bin=${bin} permisos=${perm.label}`);
|
|
410416
411467
|
let child;
|
|
410417
411468
|
try {
|
|
410418
|
-
child =
|
|
411469
|
+
child = spawn11(bin, ["-p", task.prompt, ...perm.args], {
|
|
410419
411470
|
cwd: cwd2,
|
|
410420
411471
|
env: {
|
|
410421
411472
|
...process.env,
|
|
@@ -414308,7 +415359,7 @@ var init_IdleReturnDialog = __esm(() => {
|
|
|
414308
415359
|
});
|
|
414309
415360
|
|
|
414310
415361
|
// services/preventSleep.ts
|
|
414311
|
-
import { spawn as
|
|
415362
|
+
import { spawn as spawn12 } from "child_process";
|
|
414312
415363
|
function startPreventSleep() {
|
|
414313
415364
|
refCount++;
|
|
414314
415365
|
if (refCount === 1) {
|
|
@@ -414366,7 +415417,7 @@ function spawnCaffeinate() {
|
|
|
414366
415417
|
});
|
|
414367
415418
|
}
|
|
414368
415419
|
try {
|
|
414369
|
-
caffeinateProcess =
|
|
415420
|
+
caffeinateProcess = spawn12("caffeinate", ["-i", "-t", String(CAFFEINATE_TIMEOUT_SECONDS)], {
|
|
414370
415421
|
stdio: "ignore"
|
|
414371
415422
|
});
|
|
414372
415423
|
caffeinateProcess.unref();
|
|
@@ -414799,7 +415850,7 @@ function buildSystemInitMessage(inputs) {
|
|
|
414799
415850
|
slash_commands: inputs.commands.filter((c5) => c5.userInvocable !== false).map((c5) => c5.name),
|
|
414800
415851
|
apiKeySource: getTheusApiKeyWithSource().source,
|
|
414801
415852
|
betas: getSdkBetas(),
|
|
414802
|
-
theus_code_version: { VERSION: "0.2.
|
|
415853
|
+
theus_code_version: { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
414803
415854
|
output_style: outputStyle2,
|
|
414804
415855
|
agents: inputs.agents.map((agent) => agent.agentType),
|
|
414805
415856
|
skills: inputs.skills.filter((s) => s.userInvocable !== false).map((skill) => skill.name),
|
|
@@ -420774,7 +421825,7 @@ var init_FileEditToolDiff = __esm(() => {
|
|
|
420774
421825
|
|
|
420775
421826
|
// hooks/useDiffInIDE.ts
|
|
420776
421827
|
import { randomUUID as randomUUID37 } from "crypto";
|
|
420777
|
-
import { basename as
|
|
421828
|
+
import { basename as basename48 } from "path";
|
|
420778
421829
|
function useDiffInIDE({
|
|
420779
421830
|
onChange,
|
|
420780
421831
|
toolUseContext,
|
|
@@ -420785,7 +421836,7 @@ function useDiffInIDE({
|
|
|
420785
421836
|
const isUnmounted = import_react200.useRef(false);
|
|
420786
421837
|
const [hasError, setHasError] = import_react200.useState(false);
|
|
420787
421838
|
const sha = import_react200.useMemo(() => randomUUID37().slice(0, 6), []);
|
|
420788
|
-
const tabName = import_react200.useMemo(() => `\u273B [Theus] ${
|
|
421839
|
+
const tabName = import_react200.useMemo(() => `\u273B [Theus] ${basename48(filePath)} (${sha}) \u29C9`, [filePath, sha]);
|
|
420789
421840
|
const shouldShowDiffInIDE = hasAccessToIDEExtensionDiffFeature(toolUseContext.options.mcpClients) && getGlobalConfig().diffTool === "auto" && !filePath.endsWith(".ipynb");
|
|
420790
421841
|
const ideName = getConnectedIdeName(toolUseContext.options.mcpClients) ?? "IDE";
|
|
420791
421842
|
async function showDiff() {
|
|
@@ -420967,7 +422018,7 @@ var init_useDiffInIDE = __esm(() => {
|
|
|
420967
422018
|
});
|
|
420968
422019
|
|
|
420969
422020
|
// components/ShowInIDEPrompt.tsx
|
|
420970
|
-
import { basename as
|
|
422021
|
+
import { basename as basename49, relative as relative30 } from "path";
|
|
420971
422022
|
function ShowInIDEPrompt(t0) {
|
|
420972
422023
|
const $2 = c3(36);
|
|
420973
422024
|
const {
|
|
@@ -421024,7 +422075,7 @@ function ShowInIDEPrompt(t0) {
|
|
|
421024
422075
|
}
|
|
421025
422076
|
let t4;
|
|
421026
422077
|
if ($2[5] !== filePath) {
|
|
421027
|
-
t4 =
|
|
422078
|
+
t4 = basename49(filePath);
|
|
421028
422079
|
$2[5] = filePath;
|
|
421029
422080
|
$2[6] = t4;
|
|
421030
422081
|
} else {
|
|
@@ -421185,7 +422236,7 @@ var init_ShowInIDEPrompt = __esm(() => {
|
|
|
421185
422236
|
|
|
421186
422237
|
// components/permissions/FilePermissionDialog/permissionOptions.tsx
|
|
421187
422238
|
import { homedir as homedir43 } from "os";
|
|
421188
|
-
import { basename as
|
|
422239
|
+
import { basename as basename50, join as join156, sep as sep34 } from "path";
|
|
421189
422240
|
function isInTheusFolder(filePath) {
|
|
421190
422241
|
const absolutePath = expandPath(filePath);
|
|
421191
422242
|
const theusFolderPath = expandPath(`${getOriginalCwd()}/.theus`);
|
|
@@ -421267,7 +422318,7 @@ function getFilePermissionOptions({
|
|
|
421267
422318
|
}
|
|
421268
422319
|
} else {
|
|
421269
422320
|
const dirPath = getDirectoryForPath(filePath);
|
|
421270
|
-
const dirName =
|
|
422321
|
+
const dirName = basename50(dirPath) || "este directorio";
|
|
421271
422322
|
if (operationType === "read") {
|
|
421272
422323
|
sessionLabel = /* @__PURE__ */ jsx_runtime366.jsxs(ThemedText, {
|
|
421273
422324
|
children: [
|
|
@@ -421766,7 +422817,7 @@ var init_FilePermissionDialog = __esm(() => {
|
|
|
421766
422817
|
});
|
|
421767
422818
|
|
|
421768
422819
|
// components/permissions/SedEditPermissionRequest/SedEditPermissionRequest.tsx
|
|
421769
|
-
import { basename as
|
|
422820
|
+
import { basename as basename51, relative as relative32 } from "path";
|
|
421770
422821
|
function SedEditPermissionRequest(t0) {
|
|
421771
422822
|
const $2 = c3(9);
|
|
421772
422823
|
let props;
|
|
@@ -421942,7 +422993,7 @@ function SedEditPermissionRequestInner(t0) {
|
|
|
421942
422993
|
}
|
|
421943
422994
|
let t10;
|
|
421944
422995
|
if ($2[16] !== filePath) {
|
|
421945
|
-
t10 =
|
|
422996
|
+
t10 = basename51(filePath);
|
|
421946
422997
|
$2[16] = filePath;
|
|
421947
422998
|
$2[17] = t10;
|
|
421948
422999
|
} else {
|
|
@@ -422154,7 +423205,7 @@ var init_useShellPermissionFeedback = __esm(() => {
|
|
|
422154
423205
|
});
|
|
422155
423206
|
|
|
422156
423207
|
// components/permissions/shellPermissionHelpers.tsx
|
|
422157
|
-
import { basename as
|
|
423208
|
+
import { basename as basename52, sep as sep35 } from "path";
|
|
422158
423209
|
function commandListDisplay(commands) {
|
|
422159
423210
|
switch (commands.length) {
|
|
422160
423211
|
case 0:
|
|
@@ -422205,7 +423256,7 @@ function commandListDisplayTruncated(commands) {
|
|
|
422205
423256
|
function formatPathList(paths2) {
|
|
422206
423257
|
if (paths2.length === 0)
|
|
422207
423258
|
return "";
|
|
422208
|
-
const names = paths2.map((p) =>
|
|
423259
|
+
const names = paths2.map((p) => basename52(p) || p);
|
|
422209
423260
|
if (names.length === 1) {
|
|
422210
423261
|
return /* @__PURE__ */ jsx_runtime369.jsxs(ThemedText, {
|
|
422211
423262
|
children: [
|
|
@@ -422271,7 +423322,7 @@ function generateShellSuggestionsLabel(suggestions, shellToolName, commandTransf
|
|
|
422271
423322
|
if (hasReadPaths && !hasDirectories && !hasCommands) {
|
|
422272
423323
|
if (readPaths.length === 1) {
|
|
422273
423324
|
const firstPath = readPaths[0];
|
|
422274
|
-
const dirName =
|
|
423325
|
+
const dirName = basename52(firstPath) || firstPath;
|
|
422275
423326
|
return /* @__PURE__ */ jsx_runtime369.jsxs(ThemedText, {
|
|
422276
423327
|
children: [
|
|
422277
423328
|
"S\xED, permitir leer de ",
|
|
@@ -422295,7 +423346,7 @@ function generateShellSuggestionsLabel(suggestions, shellToolName, commandTransf
|
|
|
422295
423346
|
if (hasDirectories && !hasReadPaths && !hasCommands) {
|
|
422296
423347
|
if (directories.length === 1) {
|
|
422297
423348
|
const firstDir = directories[0];
|
|
422298
|
-
const dirName =
|
|
423349
|
+
const dirName = basename52(firstDir) || firstDir;
|
|
422299
423350
|
return /* @__PURE__ */ jsx_runtime369.jsxs(ThemedText, {
|
|
422300
423351
|
children: [
|
|
422301
423352
|
"S\xED, y permitir siempre el acceso a ",
|
|
@@ -424535,7 +425586,7 @@ function createSingleEditDiffConfig(filePath, oldString, newString, replaceAll)
|
|
|
424535
425586
|
}
|
|
424536
425587
|
|
|
424537
425588
|
// components/permissions/FileEditPermissionRequest/FileEditPermissionRequest.tsx
|
|
424538
|
-
import { basename as
|
|
425589
|
+
import { basename as basename53, relative as relative33 } from "path";
|
|
424539
425590
|
function FileEditPermissionRequest(props) {
|
|
424540
425591
|
const $2 = c3(51);
|
|
424541
425592
|
const parseInput = _temp166;
|
|
@@ -424578,7 +425629,7 @@ function FileEditPermissionRequest(props) {
|
|
|
424578
425629
|
t3 = " ";
|
|
424579
425630
|
T0 = ThemedText;
|
|
424580
425631
|
t0 = true;
|
|
424581
|
-
t1 =
|
|
425632
|
+
t1 = basename53(file_path);
|
|
424582
425633
|
$2[0] = props.onDone;
|
|
424583
425634
|
$2[1] = props.onReject;
|
|
424584
425635
|
$2[2] = props.toolUseConfirm;
|
|
@@ -425005,7 +426056,7 @@ var init_FileWriteToolDiff = __esm(() => {
|
|
|
425005
426056
|
});
|
|
425006
426057
|
|
|
425007
426058
|
// components/permissions/FileWritePermissionRequest/FileWritePermissionRequest.tsx
|
|
425008
|
-
import { basename as
|
|
426059
|
+
import { basename as basename54, relative as relative34 } from "path";
|
|
425009
426060
|
function FileWritePermissionRequest(props) {
|
|
425010
426061
|
const $2 = c3(30);
|
|
425011
426062
|
const parseInput = _temp169;
|
|
@@ -425072,7 +426123,7 @@ function FileWritePermissionRequest(props) {
|
|
|
425072
426123
|
}
|
|
425073
426124
|
let t9;
|
|
425074
426125
|
if ($2[7] !== file_path) {
|
|
425075
|
-
t9 =
|
|
426126
|
+
t9 = basename54(file_path);
|
|
425076
426127
|
$2[7] = file_path;
|
|
425077
426128
|
$2[8] = t9;
|
|
425078
426129
|
} else {
|
|
@@ -425477,7 +426528,7 @@ var init_NotebookEditToolDiff = __esm(() => {
|
|
|
425477
426528
|
});
|
|
425478
426529
|
|
|
425479
426530
|
// components/permissions/NotebookEditPermissionRequest/NotebookEditPermissionRequest.tsx
|
|
425480
|
-
import { basename as
|
|
426531
|
+
import { basename as basename55 } from "path";
|
|
425481
426532
|
function NotebookEditPermissionRequest(props) {
|
|
425482
426533
|
const $2 = c3(52);
|
|
425483
426534
|
const parseInput = _temp171;
|
|
@@ -425521,7 +426572,7 @@ function NotebookEditPermissionRequest(props) {
|
|
|
425521
426572
|
t4 = " ";
|
|
425522
426573
|
T0 = ThemedText;
|
|
425523
426574
|
t0 = true;
|
|
425524
|
-
t1 =
|
|
426575
|
+
t1 = basename55(notebook_path);
|
|
425525
426576
|
$2[0] = props.onDone;
|
|
425526
426577
|
$2[1] = props.onReject;
|
|
425527
426578
|
$2[2] = props.toolUseConfirm;
|
|
@@ -429433,7 +430484,7 @@ var init_useVoiceEnabled = __esm(() => {
|
|
|
429433
430484
|
function getSemverPart(version3) {
|
|
429434
430485
|
return `${import_semver13.major(version3, { loose: true })}.${import_semver13.minor(version3, { loose: true })}.${import_semver13.patch(version3, { loose: true })}`;
|
|
429435
430486
|
}
|
|
429436
|
-
function useUpdateNotification(updatedVersion, initialVersion = { VERSION: "0.2.
|
|
430487
|
+
function useUpdateNotification(updatedVersion, initialVersion = { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION) {
|
|
429437
430488
|
const [lastNotifiedSemver, setLastNotifiedSemver] = import_react217.useState(() => getSemverPart(initialVersion));
|
|
429438
430489
|
if (!updatedVersion) {
|
|
429439
430490
|
return null;
|
|
@@ -429473,7 +430524,7 @@ function AutoUpdater({
|
|
|
429473
430524
|
return;
|
|
429474
430525
|
}
|
|
429475
430526
|
if (false) {}
|
|
429476
|
-
const currentVersion = { VERSION: "0.2.
|
|
430527
|
+
const currentVersion = { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
|
|
429477
430528
|
const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
|
|
429478
430529
|
let latestVersion = await getLatestVersion(channel2);
|
|
429479
430530
|
const isDisabled2 = isAutoUpdaterDisabled();
|
|
@@ -429609,7 +430660,7 @@ function AutoUpdater({
|
|
|
429609
430660
|
" ",
|
|
429610
430661
|
/* @__PURE__ */ jsx_runtime389.jsx(ThemedText, {
|
|
429611
430662
|
bold: true,
|
|
429612
|
-
children: hasLocalInstall ? `cd ~/.theus/local && npm update ${{ VERSION: "0.2.
|
|
430663
|
+
children: hasLocalInstall ? `cd ~/.theus/local && npm update ${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.PACKAGE_URL}` : `npm i -g ${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.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}`
|
|
429613
430664
|
})
|
|
429614
430665
|
]
|
|
429615
430666
|
})
|
|
@@ -429686,12 +430737,12 @@ function NativeAutoUpdater({
|
|
|
429686
430737
|
logEvent("tengu_native_auto_updater_start", {});
|
|
429687
430738
|
try {
|
|
429688
430739
|
const maxVersion = await getMaxVersion();
|
|
429689
|
-
if (maxVersion && gt({ VERSION: "0.2.
|
|
430740
|
+
if (maxVersion && gt({ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
|
|
429690
430741
|
const msg = await getMaxVersionMessage();
|
|
429691
430742
|
setMaxVersionIssue(msg ?? "affects your version");
|
|
429692
430743
|
}
|
|
429693
430744
|
const result = await installLatest(channel2);
|
|
429694
|
-
const currentVersion = { VERSION: "0.2.
|
|
430745
|
+
const currentVersion = { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
|
|
429695
430746
|
const latencyMs = Date.now() - startTime2;
|
|
429696
430747
|
if (result.lockFailed) {
|
|
429697
430748
|
logEvent("tengu_native_auto_updater_lock_contention", {
|
|
@@ -429828,17 +430879,17 @@ function PackageManagerAutoUpdater(t0) {
|
|
|
429828
430879
|
const maxVersion = await getMaxVersion();
|
|
429829
430880
|
if (maxVersion && latest && gt(latest, maxVersion)) {
|
|
429830
430881
|
logForDebugging(`PackageManagerAutoUpdater: maxVersion ${maxVersion} is set, capping update from ${latest} to ${maxVersion}`);
|
|
429831
|
-
if (gte({ VERSION: "0.2.
|
|
429832
|
-
logForDebugging(`PackageManagerAutoUpdater: current version ${{ VERSION: "0.2.
|
|
430882
|
+
if (gte({ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
|
|
430883
|
+
logForDebugging(`PackageManagerAutoUpdater: current version ${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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`);
|
|
429833
430884
|
setUpdateAvailable(false);
|
|
429834
430885
|
return;
|
|
429835
430886
|
}
|
|
429836
430887
|
latest = maxVersion;
|
|
429837
430888
|
}
|
|
429838
|
-
const hasUpdate = latest && !gte({ VERSION: "0.2.
|
|
430889
|
+
const hasUpdate = latest && !gte({ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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);
|
|
429839
430890
|
setUpdateAvailable(!!hasUpdate);
|
|
429840
430891
|
if (hasUpdate) {
|
|
429841
|
-
logForDebugging(`PackageManagerAutoUpdater: Update available ${{ VERSION: "0.2.
|
|
430892
|
+
logForDebugging(`PackageManagerAutoUpdater: Update available ${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}`);
|
|
429842
430893
|
}
|
|
429843
430894
|
};
|
|
429844
430895
|
$2[0] = t1;
|
|
@@ -429872,7 +430923,7 @@ function PackageManagerAutoUpdater(t0) {
|
|
|
429872
430923
|
wrap: "truncate",
|
|
429873
430924
|
children: [
|
|
429874
430925
|
"currentVersion: ",
|
|
429875
|
-
{ VERSION: "0.2.
|
|
430926
|
+
{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
429876
430927
|
]
|
|
429877
430928
|
});
|
|
429878
430929
|
$2[3] = verbose;
|
|
@@ -430027,7 +431078,7 @@ var init_AutoUpdaterWrapper = __esm(() => {
|
|
|
430027
431078
|
});
|
|
430028
431079
|
|
|
430029
431080
|
// components/IdeStatusIndicator.tsx
|
|
430030
|
-
import { basename as
|
|
431081
|
+
import { basename as basename56 } from "path";
|
|
430031
431082
|
function IdeStatusIndicator(t0) {
|
|
430032
431083
|
const $2 = c3(7);
|
|
430033
431084
|
const {
|
|
@@ -430067,7 +431118,7 @@ function IdeStatusIndicator(t0) {
|
|
|
430067
431118
|
if (ideSelection.filePath) {
|
|
430068
431119
|
let t1;
|
|
430069
431120
|
if ($2[3] !== ideSelection.filePath) {
|
|
430070
|
-
t1 =
|
|
431121
|
+
t1 = basename56(ideSelection.filePath);
|
|
430071
431122
|
$2[3] = ideSelection.filePath;
|
|
430072
431123
|
$2[4] = t1;
|
|
430073
431124
|
} else {
|
|
@@ -431715,7 +432766,7 @@ function mergeIndices(indices) {
|
|
|
431715
432766
|
function isInverse(type) {
|
|
431716
432767
|
return type.startsWith("inverse");
|
|
431717
432768
|
}
|
|
431718
|
-
function
|
|
432769
|
+
function tokenize7(pattern) {
|
|
431719
432770
|
const tokens = [];
|
|
431720
432771
|
const len = pattern.length;
|
|
431721
432772
|
let i3 = 0;
|
|
@@ -431760,7 +432811,7 @@ function getMatch(pattern, exp) {
|
|
|
431760
432811
|
}
|
|
431761
432812
|
function parseQuery(pattern, options2 = {}) {
|
|
431762
432813
|
return pattern.replace(/\\\|/g, ESCAPED_PIPE).split(OR_TOKEN).map((item) => {
|
|
431763
|
-
const query2 =
|
|
432814
|
+
const query2 = tokenize7(item.replace(/\u0000/g, "|").trim()).filter((item2) => item2 && !!item2.trim());
|
|
431764
432815
|
const results = [];
|
|
431765
432816
|
for (let i3 = 0, len = query2.length;i3 < len; i3 += 1) {
|
|
431766
432817
|
const queryItem = query2[i3];
|
|
@@ -431895,11 +432946,11 @@ function warnNonGlobal(regex2) {
|
|
|
431895
432946
|
console.warn(`[Fuse] tokenize regex ${regex2} lacks the global flag; only the first match per text will be returned. Add the 'g' flag.`);
|
|
431896
432947
|
}
|
|
431897
432948
|
}
|
|
431898
|
-
function resolveTokenize(
|
|
431899
|
-
if (typeof
|
|
432949
|
+
function resolveTokenize(tokenize8) {
|
|
432950
|
+
if (typeof tokenize8 === "function") {
|
|
431900
432951
|
let validated = false;
|
|
431901
432952
|
return (text2) => {
|
|
431902
|
-
const result =
|
|
432953
|
+
const result = tokenize8(text2);
|
|
431903
432954
|
if (!validated) {
|
|
431904
432955
|
validated = true;
|
|
431905
432956
|
if (!Array.isArray(result) || result.some((t) => typeof t !== "string"))
|
|
@@ -431908,15 +432959,15 @@ function resolveTokenize(tokenize7) {
|
|
|
431908
432959
|
return result;
|
|
431909
432960
|
};
|
|
431910
432961
|
}
|
|
431911
|
-
if (
|
|
431912
|
-
if (!
|
|
431913
|
-
warnNonGlobal(
|
|
431914
|
-
return (text2) => text2.match(
|
|
432962
|
+
if (tokenize8 instanceof RegExp) {
|
|
432963
|
+
if (!tokenize8.global)
|
|
432964
|
+
warnNonGlobal(tokenize8);
|
|
432965
|
+
return (text2) => text2.match(tokenize8) || [];
|
|
431915
432966
|
}
|
|
431916
432967
|
return (text2) => text2.match(DEFAULT_TOKEN) || [];
|
|
431917
432968
|
}
|
|
431918
|
-
function createAnalyzer({ isCaseSensitive = false, ignoreDiacritics = false, tokenize:
|
|
431919
|
-
const tokenizeFn = resolveTokenize(
|
|
432969
|
+
function createAnalyzer({ isCaseSensitive = false, ignoreDiacritics = false, tokenize: tokenize8 } = {}) {
|
|
432970
|
+
const tokenizeFn = resolveTokenize(tokenize8);
|
|
431920
432971
|
return { tokenize(text2) {
|
|
431921
432972
|
if (!isCaseSensitive)
|
|
431922
432973
|
text2 = text2.toLowerCase();
|
|
@@ -433584,7 +434635,7 @@ var init_slackChannelSuggestions = __esm(() => {
|
|
|
433584
434635
|
});
|
|
433585
434636
|
|
|
433586
434637
|
// hooks/unifiedSuggestions.ts
|
|
433587
|
-
import { basename as
|
|
434638
|
+
import { basename as basename57 } from "path";
|
|
433588
434639
|
function createSuggestionFromSource(source) {
|
|
433589
434640
|
switch (source.type) {
|
|
433590
434641
|
case "file":
|
|
@@ -433646,7 +434697,7 @@ async function generateUnifiedSuggestions(query2, mcpResources, agents2, showOnE
|
|
|
433646
434697
|
displayText: suggestion.displayText,
|
|
433647
434698
|
description: suggestion.description,
|
|
433648
434699
|
path: suggestion.displayText,
|
|
433649
|
-
filename:
|
|
434700
|
+
filename: basename57(suggestion.displayText),
|
|
433650
434701
|
score: suggestion.metadata?.score
|
|
433651
434702
|
}));
|
|
433652
434703
|
const mcpSources = Object.values(mcpResources).flat().map((resource) => ({
|
|
@@ -434869,7 +435920,7 @@ var init_AutoModeOptInDialog = __esm(() => {
|
|
|
434869
435920
|
});
|
|
434870
435921
|
|
|
434871
435922
|
// components/BridgeDialog.tsx
|
|
434872
|
-
import { basename as
|
|
435923
|
+
import { basename as basename58 } from "path";
|
|
434873
435924
|
function BridgeDialog(t0) {
|
|
434874
435925
|
const $2 = c3(87);
|
|
434875
435926
|
const {
|
|
@@ -434892,7 +435943,7 @@ function BridgeDialog(t0) {
|
|
|
434892
435943
|
const [branchName, setBranchName] = import_react232.useState("");
|
|
434893
435944
|
let t1;
|
|
434894
435945
|
if ($2[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
434895
|
-
t1 =
|
|
435946
|
+
t1 = basename58(getOriginalCwd());
|
|
434896
435947
|
$2[0] = t1;
|
|
434897
435948
|
} else {
|
|
434898
435949
|
t1 = $2[0];
|
|
@@ -437745,7 +438796,7 @@ function buildStatusLineCommandInput(permissionMode, exceeds200kTokens, settings
|
|
|
437745
438796
|
project_dir: getOriginalCwd(),
|
|
437746
438797
|
added_dirs: addedDirs
|
|
437747
438798
|
},
|
|
437748
|
-
version: { VERSION: "0.2.
|
|
438799
|
+
version: { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
437749
438800
|
output_style: {
|
|
437750
438801
|
name: outputStyleName
|
|
437751
438802
|
},
|
|
@@ -444697,15 +445748,6 @@ var init_useApiKeyVerification = __esm(() => {
|
|
|
444697
445748
|
import_react262 = __toESM(require_react(), 1);
|
|
444698
445749
|
});
|
|
444699
445750
|
|
|
444700
|
-
// utils/terminalPanel.ts
|
|
444701
|
-
var init_terminalPanel = __esm(() => {
|
|
444702
|
-
init_state();
|
|
444703
|
-
init_instances();
|
|
444704
|
-
init_cleanupRegistry();
|
|
444705
|
-
init_cwd2();
|
|
444706
|
-
init_debug();
|
|
444707
|
-
});
|
|
444708
|
-
|
|
444709
445751
|
// hooks/useGlobalKeybindings.tsx
|
|
444710
445752
|
function GlobalKeybindingHandlers({
|
|
444711
445753
|
screen,
|
|
@@ -444809,7 +445851,12 @@ function GlobalKeybindingHandlers({
|
|
|
444809
445851
|
context: "Global"
|
|
444810
445852
|
});
|
|
444811
445853
|
const handleToggleTerminal = import_react263.useCallback(() => {
|
|
444812
|
-
if (
|
|
445854
|
+
if (isTerminalPanelEnabled()) {
|
|
445855
|
+
if (!isTerminalPanelEnabled() && !getFeatureValue_CACHED_MAY_BE_STALE("tengu_terminal_panel", false)) {
|
|
445856
|
+
return;
|
|
445857
|
+
}
|
|
445858
|
+
getTerminalPanel().toggle();
|
|
445859
|
+
}
|
|
444813
445860
|
}, []);
|
|
444814
445861
|
useKeybinding("app:toggleTerminal", handleToggleTerminal, {
|
|
444815
445862
|
context: "Global"
|
|
@@ -444836,6 +445883,7 @@ var init_useGlobalKeybindings = __esm(() => {
|
|
|
444836
445883
|
init_instances();
|
|
444837
445884
|
init_useKeybinding();
|
|
444838
445885
|
init_growthbook2();
|
|
445886
|
+
init_terminalPanelEnabled();
|
|
444839
445887
|
init_analytics();
|
|
444840
445888
|
init_AppState();
|
|
444841
445889
|
init_terminalPanel();
|
|
@@ -447674,7 +448722,7 @@ __export(exports_asciicast, {
|
|
|
447674
448722
|
_resetRecordingStateForTesting: () => _resetRecordingStateForTesting
|
|
447675
448723
|
});
|
|
447676
448724
|
import { appendFile as appendFile7, rename as rename10 } from "fs/promises";
|
|
447677
|
-
import { basename as
|
|
448725
|
+
import { basename as basename59, dirname as dirname64, join as join159 } from "path";
|
|
447678
448726
|
function getRecordFilePath() {
|
|
447679
448727
|
if (recordingState.filePath !== null) {
|
|
447680
448728
|
return recordingState.filePath;
|
|
@@ -447720,8 +448768,8 @@ async function renameRecordingForSession() {
|
|
|
447720
448768
|
return;
|
|
447721
448769
|
}
|
|
447722
448770
|
await recorder?.flush();
|
|
447723
|
-
const oldName =
|
|
447724
|
-
const newName =
|
|
448771
|
+
const oldName = basename59(oldPath);
|
|
448772
|
+
const newName = basename59(newPath);
|
|
447725
448773
|
try {
|
|
447726
448774
|
await rename10(oldPath, newPath);
|
|
447727
448775
|
recordingState.filePath = newPath;
|
|
@@ -449365,7 +450413,7 @@ async function submitTranscriptShare(messages, trigger, appearanceId) {
|
|
|
449365
450413
|
} catch {}
|
|
449366
450414
|
const data = {
|
|
449367
450415
|
trigger,
|
|
449368
|
-
version: { VERSION: "0.2.
|
|
450416
|
+
version: { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
449369
450417
|
platform: process.platform,
|
|
449370
450418
|
transcript,
|
|
449371
450419
|
subagentTranscripts: Object.keys(subagentTranscripts).length > 0 ? subagentTranscripts : undefined,
|
|
@@ -452430,13 +453478,13 @@ function permissionPromptToolResultToPermissionDecision(result, tool, input, too
|
|
|
452430
453478
|
decisionReason
|
|
452431
453479
|
};
|
|
452432
453480
|
}
|
|
452433
|
-
var
|
|
453481
|
+
var inputSchema48, decisionClassificationField, PermissionAllowResultSchema, PermissionDenyResultSchema, outputSchema40;
|
|
452434
453482
|
var init_PermissionPromptToolResultSchema = __esm(() => {
|
|
452435
453483
|
init_v4();
|
|
452436
453484
|
init_debug();
|
|
452437
453485
|
init_PermissionUpdate();
|
|
452438
453486
|
init_PermissionUpdateSchema();
|
|
452439
|
-
|
|
453487
|
+
inputSchema48 = lazySchema(() => v4_default.object({
|
|
452440
453488
|
tool_name: v4_default.string().describe("The name of the tool requesting permission"),
|
|
452441
453489
|
input: v4_default.record(v4_default.string(), v4_default.unknown()).describe("The input for the tool"),
|
|
452442
453490
|
tool_use_id: v4_default.string().optional().describe("The unique tool use request ID")
|
|
@@ -452459,7 +453507,7 @@ var init_PermissionPromptToolResultSchema = __esm(() => {
|
|
|
452459
453507
|
toolUseID: v4_default.string().optional(),
|
|
452460
453508
|
decisionClassification: decisionClassificationField()
|
|
452461
453509
|
}));
|
|
452462
|
-
|
|
453510
|
+
outputSchema40 = lazySchema(() => v4_default.union([PermissionAllowResultSchema(), PermissionDenyResultSchema()]));
|
|
452463
453511
|
});
|
|
452464
453512
|
|
|
452465
453513
|
// cli/ndjsonSafeStringify.ts
|
|
@@ -452801,7 +453849,7 @@ class StructuredIO {
|
|
|
452801
453849
|
decision_reason: serializeDecisionReason(mainPermissionResult.decisionReason),
|
|
452802
453850
|
tool_use_id: toolUseID,
|
|
452803
453851
|
agent_id: toolUseContext.agentId
|
|
452804
|
-
},
|
|
453852
|
+
}, outputSchema40(), hookAbortController.signal, requestId).then((result) => ({ source: "sdk", result }));
|
|
452805
453853
|
const winner = await Promise.race([hookPromise, sdkPromise]);
|
|
452806
453854
|
if (winner.source === "hook") {
|
|
452807
453855
|
if (winner.decision) {
|
|
@@ -452872,7 +453920,7 @@ class StructuredIO {
|
|
|
452872
453920
|
input: { host: hostPattern.host },
|
|
452873
453921
|
tool_use_id: randomUUID49(),
|
|
452874
453922
|
description: `Allow network connection to ${hostPattern.host}?`
|
|
452875
|
-
},
|
|
453923
|
+
}, outputSchema40());
|
|
452876
453924
|
return result.behavior === "allow";
|
|
452877
453925
|
} catch {
|
|
452878
453926
|
return false;
|
|
@@ -453703,7 +454751,7 @@ var init_binaryCheck = __esm(() => {
|
|
|
453703
454751
|
});
|
|
453704
454752
|
|
|
453705
454753
|
// utils/plugins/lspRecommendation.ts
|
|
453706
|
-
import { extname as
|
|
454754
|
+
import { extname as extname16 } from "path";
|
|
453707
454755
|
function isOfficialMarketplace(name) {
|
|
453708
454756
|
return ALLOWED_OFFICIAL_MARKETPLACE_NAMES.has(name.toLowerCase());
|
|
453709
454757
|
}
|
|
@@ -453793,7 +454841,7 @@ async function getMatchingLspPlugins(filePath) {
|
|
|
453793
454841
|
logForDebugging("[lspRecommendation] Recommendations are disabled");
|
|
453794
454842
|
return [];
|
|
453795
454843
|
}
|
|
453796
|
-
const ext =
|
|
454844
|
+
const ext = extname16(filePath).toLowerCase();
|
|
453797
454845
|
if (!ext) {
|
|
453798
454846
|
logForDebugging("[lspRecommendation] No file extension found");
|
|
453799
454847
|
return [];
|
|
@@ -453986,7 +455034,7 @@ var init_usePluginRecommendationBase = __esm(() => {
|
|
|
453986
455034
|
});
|
|
453987
455035
|
|
|
453988
455036
|
// hooks/useLspPluginRecommendation.tsx
|
|
453989
|
-
import { extname as
|
|
455037
|
+
import { extname as extname17, join as join163 } from "path";
|
|
453990
455038
|
function useLspPluginRecommendation() {
|
|
453991
455039
|
const $2 = c3(12);
|
|
453992
455040
|
const trackedFiles = useAppState(_temp200);
|
|
@@ -454032,7 +455080,7 @@ function useLspPluginRecommendation() {
|
|
|
454032
455080
|
pluginId: match.pluginId,
|
|
454033
455081
|
pluginName: match.pluginName,
|
|
454034
455082
|
pluginDescription: match.description,
|
|
454035
|
-
fileExtension:
|
|
455083
|
+
fileExtension: extname17(filePath),
|
|
454036
455084
|
shownAt: Date.now()
|
|
454037
455085
|
};
|
|
454038
455086
|
}
|
|
@@ -456143,9 +457191,9 @@ function __stub13(ref) {
|
|
|
456143
457191
|
}
|
|
456144
457192
|
});
|
|
456145
457193
|
}
|
|
456146
|
-
var __module13 = "tools/TungstenTool/TungstenLiveMonitor.js",
|
|
457194
|
+
var __module13 = "tools/TungstenTool/TungstenLiveMonitor.js", _s24, TungstenLiveMonitor;
|
|
456147
457195
|
var init_TungstenLiveMonitor = __esm(() => {
|
|
456148
|
-
|
|
457196
|
+
_s24 = __stub13(__module13);
|
|
456149
457197
|
TungstenLiveMonitor = __stub13(__module13 + "#TungstenLiveMonitor");
|
|
456150
457198
|
});
|
|
456151
457199
|
|
|
@@ -460677,7 +461725,7 @@ __export(exports_StartupMenu, {
|
|
|
460677
461725
|
default: () => StartupMenu_default,
|
|
460678
461726
|
StartupMenu: () => StartupMenu
|
|
460679
461727
|
});
|
|
460680
|
-
import { basename as
|
|
461728
|
+
import { basename as basename60 } from "path";
|
|
460681
461729
|
function compactText(value, maxLength) {
|
|
460682
461730
|
if (value.length <= maxLength)
|
|
460683
461731
|
return value;
|
|
@@ -460732,7 +461780,7 @@ function StartupMenu({
|
|
|
460732
461780
|
status: projectIntelligence,
|
|
460733
461781
|
promise: projectIntelligencePromise
|
|
460734
461782
|
});
|
|
460735
|
-
const project2 =
|
|
461783
|
+
const project2 = basename60(getCwd()) || "proyecto";
|
|
460736
461784
|
const model = compactText(String(getMainLoopModel()), columns < 80 ? 24 : 38);
|
|
460737
461785
|
const showSidePanel = columns >= 104 && rows >= 22;
|
|
460738
461786
|
const compactMenu = columns < 72 || rows < 22;
|
|
@@ -462316,7 +463364,7 @@ function Onboarding({
|
|
|
462316
463364
|
flexDirection: "column",
|
|
462317
463365
|
children: [
|
|
462318
463366
|
/* @__PURE__ */ jsx_runtime464.jsx(TheusBanner, {
|
|
462319
|
-
version: { VERSION: "0.2.
|
|
463367
|
+
version: { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
462320
463368
|
}),
|
|
462321
463369
|
/* @__PURE__ */ jsx_runtime464.jsxs(ThemedBox_default, {
|
|
462322
463370
|
flexDirection: "column",
|
|
@@ -463187,7 +464235,7 @@ function completeOnboarding() {
|
|
|
463187
464235
|
saveGlobalConfig((current) => ({
|
|
463188
464236
|
...current,
|
|
463189
464237
|
hasCompletedOnboarding: true,
|
|
463190
|
-
lastOnboardingVersion: { VERSION: "0.2.
|
|
464238
|
+
lastOnboardingVersion: { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
463191
464239
|
}));
|
|
463192
464240
|
}
|
|
463193
464241
|
function showDialog(root2, renderer) {
|
|
@@ -463699,7 +464747,7 @@ __export(exports_TheusSplash, {
|
|
|
463699
464747
|
default: () => TheusSplash_default,
|
|
463700
464748
|
TheusSplash: () => TheusSplash
|
|
463701
464749
|
});
|
|
463702
|
-
import { basename as
|
|
464750
|
+
import { basename as basename61 } from "path";
|
|
463703
464751
|
function compactText2(value, maxLength) {
|
|
463704
464752
|
if (value.length <= maxLength)
|
|
463705
464753
|
return value;
|
|
@@ -463729,7 +464777,7 @@ function TheusSplash({
|
|
|
463729
464777
|
const intelligence = useProjectIntelligenceState({
|
|
463730
464778
|
promise: projectIntelligencePromise
|
|
463731
464779
|
});
|
|
463732
|
-
const project2 = compactText2(
|
|
464780
|
+
const project2 = compactText2(basename61(getCwd()) || "proyecto", 32);
|
|
463733
464781
|
const modelName = import_react323.useMemo(() => {
|
|
463734
464782
|
try {
|
|
463735
464783
|
return String(getMainLoopModel() ?? "");
|
|
@@ -467647,7 +468695,7 @@ function registerVerifySkill() {
|
|
|
467647
468695
|
}
|
|
467648
468696
|
registerBundledSkill({
|
|
467649
468697
|
name: "verify",
|
|
467650
|
-
description:
|
|
468698
|
+
description: DESCRIPTION25,
|
|
467651
468699
|
userInvocable: true,
|
|
467652
468700
|
files: SKILL_FILES,
|
|
467653
468701
|
async getPromptForCommand(args) {
|
|
@@ -467663,13 +468711,13 @@ ${args}`);
|
|
|
467663
468711
|
}
|
|
467664
468712
|
});
|
|
467665
468713
|
}
|
|
467666
|
-
var frontmatter, SKILL_BODY,
|
|
468714
|
+
var frontmatter, SKILL_BODY, DESCRIPTION25;
|
|
467667
468715
|
var init_verify = __esm(() => {
|
|
467668
468716
|
init_frontmatterParser();
|
|
467669
468717
|
init_bundledSkills();
|
|
467670
468718
|
init_verifyContent();
|
|
467671
468719
|
({ frontmatter, content: SKILL_BODY } = parseFrontmatter(SKILL_MD));
|
|
467672
|
-
|
|
468720
|
+
DESCRIPTION25 = typeof frontmatter.description === "string" ? frontmatter.description : "Verify a code change does what it should by running the app.";
|
|
467673
468721
|
});
|
|
467674
468722
|
|
|
467675
468723
|
// skills/bundled/loop.ts
|
|
@@ -468554,7 +469602,7 @@ function appendToLog(path21, message) {
|
|
|
468554
469602
|
cwd: getFsImplementation().cwd(),
|
|
468555
469603
|
userType: process.env.USER_TYPE,
|
|
468556
469604
|
sessionId: getSessionId(),
|
|
468557
|
-
version: { VERSION: "0.2.
|
|
469605
|
+
version: { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
468558
469606
|
};
|
|
468559
469607
|
getLogWriter(path21).write(messageWithTimestamp);
|
|
468560
469608
|
}
|
|
@@ -472321,9 +473369,9 @@ function __stub14(ref) {
|
|
|
472321
473369
|
}
|
|
472322
473370
|
});
|
|
472323
473371
|
}
|
|
472324
|
-
var __module14 = "utils/filePersistence/types.js",
|
|
473372
|
+
var __module14 = "utils/filePersistence/types.js", _s25, DEFAULT_UPLOAD_CONCURRENCY, FILE_COUNT_LIMIT, OUTPUTS_SUBDIR, TurnStartTime;
|
|
472325
473373
|
var init_types17 = __esm(() => {
|
|
472326
|
-
|
|
473374
|
+
_s25 = __stub14(__module14);
|
|
472327
473375
|
DEFAULT_UPLOAD_CONCURRENCY = __stub14(__module14 + "#DEFAULT_UPLOAD_CONCURRENCY");
|
|
472328
473376
|
FILE_COUNT_LIMIT = __stub14(__module14 + "#FILE_COUNT_LIMIT");
|
|
472329
473377
|
OUTPUTS_SUBDIR = __stub14(__module14 + "#OUTPUTS_SUBDIR");
|
|
@@ -472382,7 +473430,7 @@ var init_idleTimeout = __esm(() => {
|
|
|
472382
473430
|
// bridge/inboundAttachments.ts
|
|
472383
473431
|
import { randomUUID as randomUUID53 } from "crypto";
|
|
472384
473432
|
import { mkdir as mkdir50, writeFile as writeFile55 } from "fs/promises";
|
|
472385
|
-
import { basename as
|
|
473433
|
+
import { basename as basename62, join as join168 } from "path";
|
|
472386
473434
|
function debug(msg) {
|
|
472387
473435
|
logForDebugging(`[bridge:inbound-attach] ${msg}`);
|
|
472388
473436
|
}
|
|
@@ -472394,7 +473442,7 @@ function extractInboundAttachments(msg) {
|
|
|
472394
473442
|
return parsed.success ? parsed.data : [];
|
|
472395
473443
|
}
|
|
472396
473444
|
function sanitizeFileName(name) {
|
|
472397
|
-
const base2 =
|
|
473445
|
+
const base2 = basename62(name).replace(/[^a-zA-Z0-9._-]/g, "_");
|
|
472398
473446
|
return base2 || "attachment";
|
|
472399
473447
|
}
|
|
472400
473448
|
function uploadsDir() {
|
|
@@ -472688,8 +473736,8 @@ async function getEnvLessBridgeConfig() {
|
|
|
472688
473736
|
}
|
|
472689
473737
|
async function checkEnvLessBridgeMinVersion() {
|
|
472690
473738
|
const cfg = await getEnvLessBridgeConfig();
|
|
472691
|
-
if (cfg.min_version && lt({ VERSION: "0.2.
|
|
472692
|
-
return `Your version of Theus (${{ VERSION: "0.2.
|
|
473739
|
+
if (cfg.min_version && lt({ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
|
|
473740
|
+
return `Your version of Theus (${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.
|
|
472693
473741
|
Version ${cfg.min_version} or higher is required. Run \`theus update\` to update.`;
|
|
472694
473742
|
}
|
|
472695
473743
|
return null;
|
|
@@ -473163,7 +474211,7 @@ async function initBridgeCore(params) {
|
|
|
473163
474211
|
const rawApi = createBridgeApiClient({
|
|
473164
474212
|
baseUrl,
|
|
473165
474213
|
getAccessToken,
|
|
473166
|
-
runnerVersion: { VERSION: "0.2.
|
|
474214
|
+
runnerVersion: { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
473167
474215
|
onDebug: logForDebugging,
|
|
473168
474216
|
onAuth401,
|
|
473169
474217
|
getTrustedDeviceToken
|
|
@@ -477119,7 +478167,7 @@ function createCanUseToolWithPermissionPrompt(permissionPromptTool) {
|
|
|
477119
478167
|
if (!permissionToolResultBlockParam.content || !Array.isArray(permissionToolResultBlockParam.content) || !permissionToolResultBlockParam.content[0] || permissionToolResultBlockParam.content[0].type !== "text" || typeof permissionToolResultBlockParam.content[0].text !== "string") {
|
|
477120
478168
|
throw new Error('Permission prompt tool returned an invalid result. Expected a single text block param with type="text" and a string text value.');
|
|
477121
478169
|
}
|
|
477122
|
-
return permissionPromptToolResultToPermissionDecision(
|
|
478170
|
+
return permissionPromptToolResultToPermissionDecision(outputSchema40().parse(safeParseJSON(permissionToolResultBlockParam.content[0].text)), permissionPromptTool, input, toolUseContext);
|
|
477123
478171
|
};
|
|
477124
478172
|
return canUseTool;
|
|
477125
478173
|
}
|
|
@@ -478429,7 +479477,7 @@ async function startMCPServer(cwd3, debug2, verbose) {
|
|
|
478429
479477
|
setCwd(cwd3);
|
|
478430
479478
|
const server = new Server({
|
|
478431
479479
|
name: "theus/tengu",
|
|
478432
|
-
version: { VERSION: "0.2.
|
|
479480
|
+
version: { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
478433
479481
|
}, {
|
|
478434
479482
|
capabilities: {
|
|
478435
479483
|
tools: {}
|
|
@@ -478440,11 +479488,11 @@ async function startMCPServer(cwd3, debug2, verbose) {
|
|
|
478440
479488
|
const tools = getTools(toolPermissionContext);
|
|
478441
479489
|
return {
|
|
478442
479490
|
tools: await Promise.all(tools.map(async (tool) => {
|
|
478443
|
-
let
|
|
479491
|
+
let outputSchema41;
|
|
478444
479492
|
if (tool.outputSchema) {
|
|
478445
479493
|
const convertedSchema = zodToJsonSchema3(tool.outputSchema);
|
|
478446
479494
|
if (typeof convertedSchema === "object" && convertedSchema !== null && "type" in convertedSchema && convertedSchema.type === "object") {
|
|
478447
|
-
|
|
479495
|
+
outputSchema41 = convertedSchema;
|
|
478448
479496
|
}
|
|
478449
479497
|
}
|
|
478450
479498
|
return {
|
|
@@ -478455,7 +479503,7 @@ async function startMCPServer(cwd3, debug2, verbose) {
|
|
|
478455
479503
|
agents: []
|
|
478456
479504
|
}),
|
|
478457
479505
|
inputSchema: zodToJsonSchema3(tool.inputSchema),
|
|
478458
|
-
outputSchema:
|
|
479506
|
+
outputSchema: outputSchema41
|
|
478459
479507
|
};
|
|
478460
479508
|
}))
|
|
478461
479509
|
};
|
|
@@ -478983,7 +480031,7 @@ __export(exports_plugins, {
|
|
|
478983
480031
|
VALID_UPDATE_SCOPES: () => VALID_UPDATE_SCOPES,
|
|
478984
480032
|
VALID_INSTALLABLE_SCOPES: () => VALID_INSTALLABLE_SCOPES
|
|
478985
480033
|
});
|
|
478986
|
-
import { basename as
|
|
480034
|
+
import { basename as basename63, dirname as dirname72 } from "path";
|
|
478987
480035
|
function handleMarketplaceError(error40, action2) {
|
|
478988
480036
|
logError2(error40);
|
|
478989
480037
|
cliError(`${figures_default.cross} Failed to ${action2}: ${errorMessage(error40)}`);
|
|
@@ -479017,7 +480065,7 @@ async function pluginValidateHandler(manifestPath, options2) {
|
|
|
479017
480065
|
let contentResults = [];
|
|
479018
480066
|
if (result.fileType === "plugin") {
|
|
479019
480067
|
const manifestDir = dirname72(result.filePath);
|
|
479020
|
-
if (
|
|
480068
|
+
if (basename63(manifestDir) === ".theus-plugin") {
|
|
479021
480069
|
contentResults = await validatePluginContents(dirname72(manifestDir));
|
|
479022
480070
|
for (const r of contentResults) {
|
|
479023
480071
|
console.log(`Validating ${r.fileType}: ${r.filePath}
|
|
@@ -479871,7 +480919,7 @@ async function setupTokenHandler(root2) {
|
|
|
479871
480919
|
gap: 1,
|
|
479872
480920
|
children: [
|
|
479873
480921
|
/* @__PURE__ */ jsx_runtime481.jsx(TheusBanner, {
|
|
479874
|
-
version: { VERSION: "0.2.
|
|
480922
|
+
version: { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
479875
480923
|
}),
|
|
479876
480924
|
showAuthWarning && /* @__PURE__ */ jsx_runtime481.jsxs(ThemedBox_default, {
|
|
479877
480925
|
flexDirection: "column",
|
|
@@ -481283,7 +482331,7 @@ ${customInstructions}` : customInstructions;
|
|
|
481283
482331
|
}
|
|
481284
482332
|
}
|
|
481285
482333
|
logForDiagnosticsNoPII("info", "started", {
|
|
481286
|
-
version: { VERSION: "0.2.
|
|
482334
|
+
version: { VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
481287
482335
|
is_native_binary: isInBundledMode()
|
|
481288
482336
|
});
|
|
481289
482337
|
registerCleanup(async () => {
|
|
@@ -482067,7 +483115,7 @@ Usage: theus --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
482067
483115
|
pendingHookMessages
|
|
482068
483116
|
}, renderAndRun);
|
|
482069
483117
|
}
|
|
482070
|
-
}).version(`${{ VERSION: "0.2.
|
|
483118
|
+
}).version(`${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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");
|
|
482071
483119
|
program2.option("-w, --worktree [name]", "Crea un nuevo worktree de git para esta sesi\xF3n (opcionalmente indica un nombre)");
|
|
482072
483120
|
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.");
|
|
482073
483121
|
if (canUserConfigureAdvisor()) {
|
|
@@ -482581,7 +483629,7 @@ if (false) {}
|
|
|
482581
483629
|
async function main2() {
|
|
482582
483630
|
const args = process.argv.slice(2);
|
|
482583
483631
|
if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
|
|
482584
|
-
console.log(`${{ VERSION: "0.2.
|
|
483632
|
+
console.log(`${{ VERSION: "0.2.12", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)`);
|
|
482585
483633
|
return;
|
|
482586
483634
|
}
|
|
482587
483635
|
const {
|