theus-cli 0.2.24 → 0.2.25
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 +898 -312
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -49423,6 +49423,16 @@ var init_managedPath = __esm(() => {
|
|
|
49423
49423
|
});
|
|
49424
49424
|
});
|
|
49425
49425
|
|
|
49426
|
+
// proactive/proactiveEnabled.ts
|
|
49427
|
+
function isProactiveForced() {
|
|
49428
|
+
return PROACTIVE_FORCED;
|
|
49429
|
+
}
|
|
49430
|
+
var PROACTIVE_FORCED;
|
|
49431
|
+
var init_proactiveEnabled = __esm(() => {
|
|
49432
|
+
init_envUtils();
|
|
49433
|
+
PROACTIVE_FORCED = isEnvTruthy(process.env.THEUS_PROACTIVE);
|
|
49434
|
+
});
|
|
49435
|
+
|
|
49426
49436
|
// utils/lazySchema.ts
|
|
49427
49437
|
function lazySchema(factory2) {
|
|
49428
49438
|
let cached2;
|
|
@@ -51178,6 +51188,7 @@ function isMcpServerUrlEntry(entry) {
|
|
|
51178
51188
|
}
|
|
51179
51189
|
var EnvironmentVariablesSchema, PermissionsSchema, ExtraKnownMarketplaceSchema, AllowedMcpServerEntrySchema, DeniedMcpServerEntrySchema, CUSTOMIZATION_SURFACES, SettingsSchema;
|
|
51180
51190
|
var init_types3 = __esm(() => {
|
|
51191
|
+
init_proactiveEnabled();
|
|
51181
51192
|
init_v4();
|
|
51182
51193
|
init_sandboxTypes();
|
|
51183
51194
|
init_envUtils();
|
|
@@ -51356,7 +51367,10 @@ var init_types3 = __esm(() => {
|
|
|
51356
51367
|
...process.env.USER_TYPE === "ant" ? {
|
|
51357
51368
|
classifierPermissionsEnabled: exports_external.boolean().optional().describe("Enable AI-based classification for Bash(prompt:...) permission rules")
|
|
51358
51369
|
} : {},
|
|
51359
|
-
...{
|
|
51370
|
+
...isProactiveForced() ? {
|
|
51371
|
+
minSleepDurationMs: exports_external.number().nonnegative().int().optional().describe("Minimum duration in milliseconds that the Sleep tool must sleep for. " + "Useful for throttling proactive tick frequency."),
|
|
51372
|
+
maxSleepDurationMs: exports_external.number().int().min(-1).optional().describe("Maximum duration in milliseconds that the Sleep tool can sleep for. " + "Set to -1 for indefinite sleep (waits for user input). " + "Useful for limiting idle time in remote/managed environments.")
|
|
51373
|
+
} : {},
|
|
51360
51374
|
...{},
|
|
51361
51375
|
...{},
|
|
51362
51376
|
channelsEnabled: exports_external.boolean().optional().describe("Teams/Enterprise opt-in for channel notifications (MCP servers with the " + "theus/channel capability pushing inbound messages). Default off. " + "Set true to allow; users then select servers via --channels."),
|
|
@@ -58304,7 +58318,7 @@ async function _executeApiKeyHelper(isNonInteractiveSession) {
|
|
|
58304
58318
|
if (isApiKeyHelperFromProjectOrLocalSettings()) {
|
|
58305
58319
|
const hasTrust = checkHasTrustDialogAccepted();
|
|
58306
58320
|
if (!hasTrust && !isNonInteractiveSession) {
|
|
58307
|
-
const error40 = new Error(`Security: apiKeyHelper executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.
|
|
58321
|
+
const error40 = new Error(`Security: apiKeyHelper executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.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}.`);
|
|
58308
58322
|
logAntError("apiKeyHelper invoked before trust check", error40);
|
|
58309
58323
|
logEvent("tengu_apiKeyHelper_missing_trust11", {});
|
|
58310
58324
|
return null;
|
|
@@ -58348,7 +58362,7 @@ async function runAwsAuthRefresh() {
|
|
|
58348
58362
|
if (isAwsAuthRefreshFromProjectSettings()) {
|
|
58349
58363
|
const hasTrust = checkHasTrustDialogAccepted();
|
|
58350
58364
|
if (!hasTrust && !getIsNonInteractiveSession()) {
|
|
58351
|
-
const error40 = new Error(`Security: awsAuthRefresh executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.
|
|
58365
|
+
const error40 = new Error(`Security: awsAuthRefresh executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.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}.`);
|
|
58352
58366
|
logAntError("awsAuthRefresh invoked before trust check", error40);
|
|
58353
58367
|
logEvent("tengu_awsAuthRefresh_missing_trust", {});
|
|
58354
58368
|
return false;
|
|
@@ -58408,7 +58422,7 @@ async function getAwsCredsFromCredentialExport() {
|
|
|
58408
58422
|
if (isAwsCredentialExportFromProjectSettings()) {
|
|
58409
58423
|
const hasTrust = checkHasTrustDialogAccepted();
|
|
58410
58424
|
if (!hasTrust && !getIsNonInteractiveSession()) {
|
|
58411
|
-
const error40 = new Error(`Security: awsCredentialExport executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.
|
|
58425
|
+
const error40 = new Error(`Security: awsCredentialExport executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.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}.`);
|
|
58412
58426
|
logAntError("awsCredentialExport invoked before trust check", error40);
|
|
58413
58427
|
logEvent("tengu_awsCredentialExport_missing_trust", {});
|
|
58414
58428
|
return null;
|
|
@@ -58493,7 +58507,7 @@ async function runGcpAuthRefresh() {
|
|
|
58493
58507
|
if (isGcpAuthRefreshFromProjectSettings()) {
|
|
58494
58508
|
const hasTrust = checkHasTrustDialogAccepted();
|
|
58495
58509
|
if (!hasTrust && !getIsNonInteractiveSession()) {
|
|
58496
|
-
const error40 = new Error(`Security: gcpAuthRefresh executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.
|
|
58510
|
+
const error40 = new Error(`Security: gcpAuthRefresh executed before workspace trust is confirmed. If you see this message, post in ${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.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}.`);
|
|
58497
58511
|
logAntError("gcpAuthRefresh invoked before trust check", error40);
|
|
58498
58512
|
logEvent("tengu_gcpAuthRefresh_missing_trust", {});
|
|
58499
58513
|
return false;
|
|
@@ -59188,7 +59202,7 @@ var init_auth = __esm(() => {
|
|
|
59188
59202
|
|
|
59189
59203
|
// utils/userAgent.ts
|
|
59190
59204
|
function getTheusCodeUserAgent() {
|
|
59191
|
-
return `theus-code/${{ VERSION: "0.2.
|
|
59205
|
+
return `theus-code/${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}`;
|
|
59192
59206
|
}
|
|
59193
59207
|
|
|
59194
59208
|
// utils/workloadContext.ts
|
|
@@ -59210,7 +59224,7 @@ function getUserAgent() {
|
|
|
59210
59224
|
const clientApp = process.env.THEUS_AGENT_SDK_CLIENT_APP ? `, client-app/${process.env.THEUS_AGENT_SDK_CLIENT_APP}` : "";
|
|
59211
59225
|
const workload = getWorkload();
|
|
59212
59226
|
const workloadSuffix = workload ? `, workload/${workload}` : "";
|
|
59213
|
-
return `theus-cli/${{ VERSION: "0.2.
|
|
59227
|
+
return `theus-cli/${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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})`;
|
|
59214
59228
|
}
|
|
59215
59229
|
function getMCPUserAgent() {
|
|
59216
59230
|
const parts = [];
|
|
@@ -59224,7 +59238,7 @@ function getMCPUserAgent() {
|
|
|
59224
59238
|
parts.push(`client-app/${process.env.THEUS_AGENT_SDK_CLIENT_APP}`);
|
|
59225
59239
|
}
|
|
59226
59240
|
const suffix = parts.length > 0 ? ` (${parts.join(", ")})` : "";
|
|
59227
|
-
return `theus-code/${{ VERSION: "0.2.
|
|
59241
|
+
return `theus-code/${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}`;
|
|
59228
59242
|
}
|
|
59229
59243
|
function getWebFetchUserAgent() {
|
|
59230
59244
|
return `Theus-User (${getTheusCodeUserAgent()}; +https://support.theus.pe/)`;
|
|
@@ -59362,7 +59376,7 @@ var init_user = __esm(() => {
|
|
|
59362
59376
|
deviceId,
|
|
59363
59377
|
sessionId: getSessionId(),
|
|
59364
59378
|
email: getEmail(),
|
|
59365
|
-
appVersion: { VERSION: "0.2.
|
|
59379
|
+
appVersion: { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
59366
59380
|
platform: getHostPlatformForAnalytics(),
|
|
59367
59381
|
organizationUuid,
|
|
59368
59382
|
accountUuid,
|
|
@@ -61077,7 +61091,7 @@ var init_metadata = __esm(() => {
|
|
|
61077
61091
|
COMPOUND_OPERATOR_REGEX = /\s*(?:&&|\|\||[;|])\s*/;
|
|
61078
61092
|
WHITESPACE_REGEX = /\s+/;
|
|
61079
61093
|
getVersionBase = memoize_default(() => {
|
|
61080
|
-
const match = { VERSION: "0.2.
|
|
61094
|
+
const match = { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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]+)?/);
|
|
61081
61095
|
return match ? match[0] : undefined;
|
|
61082
61096
|
});
|
|
61083
61097
|
buildEnvContext = memoize_default(async () => {
|
|
@@ -61117,9 +61131,9 @@ var init_metadata = __esm(() => {
|
|
|
61117
61131
|
isGithubAction: isEnvTruthy(process.env.GITHUB_ACTIONS),
|
|
61118
61132
|
isTheusCodeAction: isEnvTruthy(process.env.THEUS_CODE_ACTION),
|
|
61119
61133
|
isTheusAiAuth: isTheusAISubscriber(),
|
|
61120
|
-
version: { VERSION: "0.2.
|
|
61134
|
+
version: { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
61121
61135
|
versionBase: getVersionBase(),
|
|
61122
|
-
buildTime: { VERSION: "0.2.
|
|
61136
|
+
buildTime: { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.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,
|
|
61123
61137
|
deploymentEnvironment: env3.detectDeploymentEnvironment(),
|
|
61124
61138
|
...isEnvTruthy(process.env.GITHUB_ACTIONS) && {
|
|
61125
61139
|
githubEventName: process.env.GITHUB_EVENT_NAME,
|
|
@@ -61785,7 +61799,7 @@ function initialize1PEventLogging() {
|
|
|
61785
61799
|
const platform2 = getPlatform();
|
|
61786
61800
|
const attributes = {
|
|
61787
61801
|
[ATTR_SERVICE_NAME]: "theus-code",
|
|
61788
|
-
[ATTR_SERVICE_VERSION]: { VERSION: "0.2.
|
|
61802
|
+
[ATTR_SERVICE_VERSION]: { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
61789
61803
|
};
|
|
61790
61804
|
if (platform2 === "wsl") {
|
|
61791
61805
|
const wslVersion = getWslVersion();
|
|
@@ -61812,7 +61826,7 @@ function initialize1PEventLogging() {
|
|
|
61812
61826
|
})
|
|
61813
61827
|
]
|
|
61814
61828
|
});
|
|
61815
|
-
firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.theus.theus_code.events", { VERSION: "0.2.
|
|
61829
|
+
firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.theus.theus_code.events", { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
|
|
61816
61830
|
}
|
|
61817
61831
|
async function reinitialize1PEventLoggingIfConfigChanged() {
|
|
61818
61832
|
if (!is1PEventLoggingEnabled() || !firstPartyEventLoggerProvider) {
|
|
@@ -63683,7 +63697,7 @@ function getAttributionHeader(fingerprint) {
|
|
|
63683
63697
|
if (!isAttributionHeaderEnabled()) {
|
|
63684
63698
|
return "";
|
|
63685
63699
|
}
|
|
63686
|
-
const version2 = `${{ VERSION: "0.2.
|
|
63700
|
+
const version2 = `${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}`;
|
|
63687
63701
|
const entrypoint = process.env.THEUS_CODE_ENTRYPOINT ?? "unknown";
|
|
63688
63702
|
const cch = "";
|
|
63689
63703
|
const workload = getWorkload();
|
|
@@ -107783,7 +107797,7 @@ Complete the user's request by providing accurate, documentation-based guidance.
|
|
|
107783
107797
|
}
|
|
107784
107798
|
function getFeedbackGuideline() {
|
|
107785
107799
|
if (isUsing3PServices()) {
|
|
107786
|
-
return `- When you cannot find an answer or the feature doesn't exist, direct the user to ${{ VERSION: "0.2.
|
|
107800
|
+
return `- When you cannot find an answer or the feature doesn't exist, direct the user to ${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.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}`;
|
|
107787
107801
|
}
|
|
107788
107802
|
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";
|
|
107789
107803
|
}
|
|
@@ -166488,7 +166502,7 @@ function getTelemetryAttributes() {
|
|
|
166488
166502
|
attributes["session.id"] = sessionId;
|
|
166489
166503
|
}
|
|
166490
166504
|
if (shouldIncludeAttribute("OTEL_METRICS_INCLUDE_VERSION")) {
|
|
166491
|
-
attributes["app.version"] = { VERSION: "0.2.
|
|
166505
|
+
attributes["app.version"] = { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
|
|
166492
166506
|
}
|
|
166493
166507
|
const oauthAccount = getOauthAccountInfo();
|
|
166494
166508
|
if (oauthAccount) {
|
|
@@ -202546,7 +202560,7 @@ function getInstallationEnv() {
|
|
|
202546
202560
|
return;
|
|
202547
202561
|
}
|
|
202548
202562
|
function getTheusCodeVersion() {
|
|
202549
|
-
return { VERSION: "0.2.
|
|
202563
|
+
return { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
|
|
202550
202564
|
}
|
|
202551
202565
|
async function getInstalledVSCodeExtensionVersion(command) {
|
|
202552
202566
|
const { stdout } = await execFileNoThrow(command, ["--list-extensions", "--show-versions"], {
|
|
@@ -204064,7 +204078,7 @@ async function getMcpHeadersFromHelper(serverName, config2) {
|
|
|
204064
204078
|
if ("scope" in config2 && isMcpServerFromProjectOrLocalSettings(config2) && !getIsNonInteractiveSession()) {
|
|
204065
204079
|
const hasTrust = checkHasTrustDialogAccepted();
|
|
204066
204080
|
if (!hasTrust) {
|
|
204067
|
-
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.
|
|
204081
|
+
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.25", BUILD_TIME: "1970-01-01T00:00:00.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}.`);
|
|
204068
204082
|
logAntError("MCP headersHelper invoked before trust check", error40);
|
|
204069
204083
|
logEvent("tengu_mcp_headersHelper_missing_trust", {});
|
|
204070
204084
|
return null;
|
|
@@ -205274,7 +205288,7 @@ async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) {
|
|
|
205274
205288
|
const client2 = new Client({
|
|
205275
205289
|
name: "theus-code",
|
|
205276
205290
|
title: "Theus",
|
|
205277
|
-
version: { VERSION: "0.2.
|
|
205291
|
+
version: { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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",
|
|
205278
205292
|
description: "Theus's agentic coding tool",
|
|
205279
205293
|
websiteUrl: PRODUCT_URL
|
|
205280
205294
|
}, {
|
|
@@ -205628,7 +205642,7 @@ var init_client5 = __esm(() => {
|
|
|
205628
205642
|
const client2 = new Client({
|
|
205629
205643
|
name: "theus-code",
|
|
205630
205644
|
title: "Theus",
|
|
205631
|
-
version: { VERSION: "0.2.
|
|
205645
|
+
version: { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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",
|
|
205632
205646
|
description: "Theus's agentic coding tool",
|
|
205633
205647
|
websiteUrl: PRODUCT_URL
|
|
205634
205648
|
}, {
|
|
@@ -216206,7 +216220,7 @@ async function initializeBetaTracing(resource) {
|
|
|
216206
216220
|
});
|
|
216207
216221
|
logs.setGlobalLoggerProvider(loggerProvider);
|
|
216208
216222
|
setLoggerProvider(loggerProvider);
|
|
216209
|
-
const eventLogger = logs.getLogger("com.theus.theus_code.events", { VERSION: "0.2.
|
|
216223
|
+
const eventLogger = logs.getLogger("com.theus.theus_code.events", { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
|
|
216210
216224
|
setEventLogger(eventLogger);
|
|
216211
216225
|
process.on("beforeExit", async () => {
|
|
216212
216226
|
await loggerProvider?.forceFlush();
|
|
@@ -216246,7 +216260,7 @@ async function initializeTelemetry() {
|
|
|
216246
216260
|
const platform4 = getPlatform();
|
|
216247
216261
|
const baseAttributes = {
|
|
216248
216262
|
[ATTR_SERVICE_NAME]: "theus-code",
|
|
216249
|
-
[ATTR_SERVICE_VERSION]: { VERSION: "0.2.
|
|
216263
|
+
[ATTR_SERVICE_VERSION]: { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
216250
216264
|
};
|
|
216251
216265
|
if (platform4 === "wsl") {
|
|
216252
216266
|
const wslVersion = getWslVersion();
|
|
@@ -216291,7 +216305,7 @@ async function initializeTelemetry() {
|
|
|
216291
216305
|
} catch {}
|
|
216292
216306
|
};
|
|
216293
216307
|
registerCleanup(shutdownTelemetry2);
|
|
216294
|
-
return meterProvider2.getMeter("com.theus.theus_code", { VERSION: "0.2.
|
|
216308
|
+
return meterProvider2.getMeter("com.theus.theus_code", { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
|
|
216295
216309
|
}
|
|
216296
216310
|
const meterProvider = new MeterProvider({
|
|
216297
216311
|
resource,
|
|
@@ -216311,7 +216325,7 @@ async function initializeTelemetry() {
|
|
|
216311
216325
|
});
|
|
216312
216326
|
logs.setGlobalLoggerProvider(loggerProvider);
|
|
216313
216327
|
setLoggerProvider(loggerProvider);
|
|
216314
|
-
const eventLogger = logs.getLogger("com.theus.theus_code.events", { VERSION: "0.2.
|
|
216328
|
+
const eventLogger = logs.getLogger("com.theus.theus_code.events", { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
|
|
216315
216329
|
setEventLogger(eventLogger);
|
|
216316
216330
|
logForDebugging("[3P telemetry] Event logger set successfully");
|
|
216317
216331
|
process.on("beforeExit", async () => {
|
|
@@ -216373,7 +216387,7 @@ Current timeout: ${timeoutMs}ms
|
|
|
216373
216387
|
}
|
|
216374
216388
|
};
|
|
216375
216389
|
registerCleanup(shutdownTelemetry);
|
|
216376
|
-
return meterProvider.getMeter("com.theus.theus_code", { VERSION: "0.2.
|
|
216390
|
+
return meterProvider.getMeter("com.theus.theus_code", { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
|
|
216377
216391
|
}
|
|
216378
216392
|
async function flushTelemetry() {
|
|
216379
216393
|
const meterProvider = getMeterProvider();
|
|
@@ -216913,7 +216927,7 @@ async function installOrUpdateTheusPackage(channel2, specificVersion) {
|
|
|
216913
216927
|
return "install_failed";
|
|
216914
216928
|
}
|
|
216915
216929
|
const versionSpec = specificVersion ? specificVersion : channel2 === "stable" ? "stable" : "latest";
|
|
216916
|
-
const result = await execFileNoThrowWithCwd("npm", ["install", `${{ VERSION: "0.2.
|
|
216930
|
+
const result = await execFileNoThrowWithCwd("npm", ["install", `${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.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 });
|
|
216917
216931
|
if (result.code !== 0) {
|
|
216918
216932
|
const error40 = new Error(`Failed to install Theus CLI package: ${result.stderr}`);
|
|
216919
216933
|
logError2(error40);
|
|
@@ -217059,9 +217073,9 @@ async function assertMinVersion() {
|
|
|
217059
217073
|
if (false) {}
|
|
217060
217074
|
try {
|
|
217061
217075
|
const versionConfig = await getDynamicConfig_BLOCKS_ON_INIT("tengu_version_config", { minVersion: "0.0.0" });
|
|
217062
|
-
if (versionConfig.minVersion && lt({ VERSION: "0.2.
|
|
217076
|
+
if (versionConfig.minVersion && lt({ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
|
|
217063
217077
|
console.error(`
|
|
217064
|
-
It looks like your version of Theus (${{ VERSION: "0.2.
|
|
217078
|
+
It looks like your version of Theus (${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.
|
|
217065
217079
|
A newer version (${versionConfig.minVersion} or higher) is required to continue.
|
|
217066
217080
|
|
|
217067
217081
|
To update, please run:
|
|
@@ -217202,7 +217216,7 @@ async function getInstallationPrefix() {
|
|
|
217202
217216
|
return prefixResult.stdout.trim();
|
|
217203
217217
|
}
|
|
217204
217218
|
function getGlobalInstallPackageManager() {
|
|
217205
|
-
if ({ VERSION: "0.2.
|
|
217219
|
+
if ({ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.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") {
|
|
217206
217220
|
return "npm";
|
|
217207
217221
|
}
|
|
217208
217222
|
return env3.isRunningWithBun() ? "bun" : "npm";
|
|
@@ -217227,7 +217241,7 @@ async function checkGlobalInstallPermissions() {
|
|
|
217227
217241
|
}
|
|
217228
217242
|
async function getLatestVersion(channel2) {
|
|
217229
217243
|
const npmTag = channel2 === "stable" ? "stable" : "latest";
|
|
217230
|
-
const result = await execFileNoThrowWithCwd("npm", ["view", `${{ VERSION: "0.2.
|
|
217244
|
+
const result = await execFileNoThrowWithCwd("npm", ["view", `${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.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() });
|
|
217231
217245
|
if (result.code !== 0) {
|
|
217232
217246
|
logForDebugging(`npm view failed with code ${result.code}`);
|
|
217233
217247
|
if (result.stderr) {
|
|
@@ -217243,7 +217257,7 @@ async function getLatestVersion(channel2) {
|
|
|
217243
217257
|
return result.stdout.trim();
|
|
217244
217258
|
}
|
|
217245
217259
|
async function getNpmDistTags() {
|
|
217246
|
-
const result = await execFileNoThrowWithCwd("npm", ["view", { VERSION: "0.2.
|
|
217260
|
+
const result = await execFileNoThrowWithCwd("npm", ["view", { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.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() });
|
|
217247
217261
|
if (result.code !== 0) {
|
|
217248
217262
|
logForDebugging(`npm view dist-tags failed with code ${result.code}`);
|
|
217249
217263
|
return { latest: null, stable: null };
|
|
@@ -217283,7 +217297,7 @@ async function installGlobalPackage(specificVersion) {
|
|
|
217283
217297
|
logError2(new AutoUpdaterError("Another process is currently installing an update"));
|
|
217284
217298
|
logEvent("tengu_auto_updater_lock_contention", {
|
|
217285
217299
|
pid: process.pid,
|
|
217286
|
-
currentVersion: { VERSION: "0.2.
|
|
217300
|
+
currentVersion: { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
217287
217301
|
});
|
|
217288
217302
|
return "in_progress";
|
|
217289
217303
|
}
|
|
@@ -217292,7 +217306,7 @@ async function installGlobalPackage(specificVersion) {
|
|
|
217292
217306
|
if (!env3.isRunningWithBun() && env3.isNpmFromWindowsPath()) {
|
|
217293
217307
|
logError2(new Error("Windows NPM detected in WSL environment"));
|
|
217294
217308
|
logEvent("tengu_auto_updater_windows_npm_in_wsl", {
|
|
217295
|
-
currentVersion: { VERSION: "0.2.
|
|
217309
|
+
currentVersion: { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
217296
217310
|
});
|
|
217297
217311
|
console.error(`
|
|
217298
217312
|
Error: Windows NPM detected in WSL
|
|
@@ -217311,7 +217325,7 @@ To fix this issue:
|
|
|
217311
217325
|
if (!hasPermissions) {
|
|
217312
217326
|
return "no_permissions";
|
|
217313
217327
|
}
|
|
217314
|
-
const packageSpec = specificVersion ? `${{ VERSION: "0.2.
|
|
217328
|
+
const packageSpec = specificVersion ? `${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.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.25", BUILD_TIME: "1970-01-01T00:00:00.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;
|
|
217315
217329
|
const packageManager = getGlobalInstallPackageManager();
|
|
217316
217330
|
const installResult = await execFileNoThrowWithCwd(packageManager, ["install", "-g", packageSpec], { cwd: homedir18() });
|
|
217317
217331
|
if (installResult.code !== 0) {
|
|
@@ -217639,8 +217653,8 @@ async function detectMultipleInstallations() {
|
|
|
217639
217653
|
installations.push({ type: "npm-local", path: localPath });
|
|
217640
217654
|
}
|
|
217641
217655
|
const packagesToCheck = ["@theus-ai/theus-code"];
|
|
217642
|
-
if ({ VERSION: "0.2.
|
|
217643
|
-
packagesToCheck.push({ VERSION: "0.2.
|
|
217656
|
+
if ({ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.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.25", BUILD_TIME: "1970-01-01T00:00:00.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") {
|
|
217657
|
+
packagesToCheck.push({ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.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);
|
|
217644
217658
|
}
|
|
217645
217659
|
const npmResult = await execFileNoThrow("npm", [
|
|
217646
217660
|
"-g",
|
|
@@ -217823,7 +217837,7 @@ function detectLinuxGlobPatternWarnings() {
|
|
|
217823
217837
|
}
|
|
217824
217838
|
async function getDoctorDiagnostic() {
|
|
217825
217839
|
const installationType = await getCurrentInstallationType();
|
|
217826
|
-
const version2 = { VERSION: "0.2.
|
|
217840
|
+
const version2 = { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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";
|
|
217827
217841
|
const installationPath = await getInstallationPath();
|
|
217828
217842
|
const invokedBinary = getInvokedBinary();
|
|
217829
217843
|
const multipleInstallations = await detectMultipleInstallations();
|
|
@@ -217835,8 +217849,8 @@ async function getDoctorDiagnostic() {
|
|
|
217835
217849
|
for (const install of npmInstalls) {
|
|
217836
217850
|
if (install.type === "npm-global") {
|
|
217837
217851
|
let uninstallCmd = "npm -g uninstall @theus-ai/theus-code";
|
|
217838
|
-
if ({ VERSION: "0.2.
|
|
217839
|
-
uninstallCmd += ` && npm -g uninstall ${{ VERSION: "0.2.
|
|
217852
|
+
if ({ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.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.25", BUILD_TIME: "1970-01-01T00:00:00.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") {
|
|
217853
|
+
uninstallCmd += ` && npm -g uninstall ${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.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}`;
|
|
217840
217854
|
}
|
|
217841
217855
|
warnings.push({
|
|
217842
217856
|
issue: `Leftover npm global installation at ${install.path}`,
|
|
@@ -217948,7 +217962,7 @@ async function getLatestVersionFromArtifactory(tag2 = "latest") {
|
|
|
217948
217962
|
const startTime2 = Date.now();
|
|
217949
217963
|
const { stdout, code, stderr } = await execFileNoThrowWithCwd("npm", [
|
|
217950
217964
|
"view",
|
|
217951
|
-
`${{ VERSION: "0.2.
|
|
217965
|
+
`${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.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}`,
|
|
217952
217966
|
"version",
|
|
217953
217967
|
"--prefer-online",
|
|
217954
217968
|
"--registry",
|
|
@@ -217972,7 +217986,7 @@ async function getLatestVersionFromArtifactory(tag2 = "latest") {
|
|
|
217972
217986
|
latency_ms: latencyMs,
|
|
217973
217987
|
source_npm: true
|
|
217974
217988
|
});
|
|
217975
|
-
logForDebugging(`npm view ${{ VERSION: "0.2.
|
|
217989
|
+
logForDebugging(`npm view ${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.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}`);
|
|
217976
217990
|
const latestVersion = stdout.trim();
|
|
217977
217991
|
return latestVersion;
|
|
217978
217992
|
}
|
|
@@ -218028,7 +218042,7 @@ async function downloadVersionFromArtifactory(version2, stagingPath) {
|
|
|
218028
218042
|
const fs3 = getFsImplementation();
|
|
218029
218043
|
await fs3.rm(stagingPath, { recursive: true, force: true });
|
|
218030
218044
|
const platform4 = getPlatform2();
|
|
218031
|
-
const platformPackageName = `${{ VERSION: "0.2.
|
|
218045
|
+
const platformPackageName = `${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.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}`;
|
|
218032
218046
|
logForDebugging(`Fetching integrity hash for ${platformPackageName}@${version2}`);
|
|
218033
218047
|
const {
|
|
218034
218048
|
stdout: integrityOutput,
|
|
@@ -218057,7 +218071,7 @@ async function downloadVersionFromArtifactory(version2, stagingPath) {
|
|
|
218057
218071
|
name: "theus-native-installer",
|
|
218058
218072
|
version: "0.0.1",
|
|
218059
218073
|
dependencies: {
|
|
218060
|
-
[{ VERSION: "0.2.
|
|
218074
|
+
[{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.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
|
|
218061
218075
|
}
|
|
218062
218076
|
};
|
|
218063
218077
|
const packageLock = {
|
|
@@ -218070,10 +218084,10 @@ async function downloadVersionFromArtifactory(version2, stagingPath) {
|
|
|
218070
218084
|
name: "theus-native-installer",
|
|
218071
218085
|
version: "0.0.1",
|
|
218072
218086
|
dependencies: {
|
|
218073
|
-
[{ VERSION: "0.2.
|
|
218087
|
+
[{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.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
|
|
218074
218088
|
}
|
|
218075
218089
|
},
|
|
218076
|
-
[`node_modules/${{ VERSION: "0.2.
|
|
218090
|
+
[`node_modules/${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.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}`]: {
|
|
218077
218091
|
version: version2,
|
|
218078
218092
|
optionalDependencies: {
|
|
218079
218093
|
[platformPackageName]: version2
|
|
@@ -218095,7 +218109,7 @@ async function downloadVersionFromArtifactory(version2, stagingPath) {
|
|
|
218095
218109
|
if (result.code !== 0) {
|
|
218096
218110
|
throw new Error(`npm ci failed with code ${result.code}: ${result.stderr}`);
|
|
218097
218111
|
}
|
|
218098
|
-
logForDebugging(`Successfully downloaded and verified ${{ VERSION: "0.2.
|
|
218112
|
+
logForDebugging(`Successfully downloaded and verified ${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.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}`);
|
|
218099
218113
|
}
|
|
218100
218114
|
function getStallTimeoutMs() {
|
|
218101
218115
|
return Number(process.env.THEUS_CODE_STALL_TIMEOUT_MS_FOR_TESTING) || DEFAULT_STALL_TIMEOUT_MS;
|
|
@@ -218758,8 +218772,8 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
|
|
|
218758
218772
|
const maxVersion = await getMaxVersion();
|
|
218759
218773
|
if (maxVersion && gt(version2, maxVersion)) {
|
|
218760
218774
|
logForDebugging(`Native installer: maxVersion ${maxVersion} is set, capping update from ${version2} to ${maxVersion}`);
|
|
218761
|
-
if (gte({ VERSION: "0.2.
|
|
218762
|
-
logForDebugging(`Native installer: current version ${{ VERSION: "0.2.
|
|
218775
|
+
if (gte({ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
|
|
218776
|
+
logForDebugging(`Native installer: current version ${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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`);
|
|
218763
218777
|
logEvent("tengu_native_update_skipped_max_version", {
|
|
218764
218778
|
latency_ms: Date.now() - startTime2,
|
|
218765
218779
|
max_version: maxVersion,
|
|
@@ -218770,7 +218784,7 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
|
|
|
218770
218784
|
version2 = maxVersion;
|
|
218771
218785
|
}
|
|
218772
218786
|
}
|
|
218773
|
-
if (!forceReinstall && version2 === { VERSION: "0.2.
|
|
218787
|
+
if (!forceReinstall && version2 === { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
|
|
218774
218788
|
logForDebugging(`Found ${version2} at ${executablePath}, skipping install`);
|
|
218775
218789
|
logEvent("tengu_native_update_complete", {
|
|
218776
218790
|
latency_ms: Date.now() - startTime2,
|
|
@@ -219520,8 +219534,8 @@ async function cleanupNpmInstallations() {
|
|
|
219520
219534
|
} else if (codePackageResult.error) {
|
|
219521
219535
|
errors4.push(codePackageResult.error);
|
|
219522
219536
|
}
|
|
219523
|
-
if ({ VERSION: "0.2.
|
|
219524
|
-
const macroPackageResult = await attemptNpmUninstall({ VERSION: "0.2.
|
|
219537
|
+
if ({ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.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.25", BUILD_TIME: "1970-01-01T00:00:00.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") {
|
|
219538
|
+
const macroPackageResult = await attemptNpmUninstall({ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.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);
|
|
219525
219539
|
if (macroPackageResult.success) {
|
|
219526
219540
|
removed++;
|
|
219527
219541
|
if (macroPackageResult.warning) {
|
|
@@ -283808,6 +283822,129 @@ var init_UI25 = __esm(() => {
|
|
|
283808
283822
|
jsx_runtime155 = __toESM(require_jsx_runtime(), 1);
|
|
283809
283823
|
});
|
|
283810
283824
|
|
|
283825
|
+
// proactive/index.js
|
|
283826
|
+
var exports_proactive = {};
|
|
283827
|
+
__export(exports_proactive, {
|
|
283828
|
+
subscribeToProactiveChanges: () => subscribeToProactiveChanges,
|
|
283829
|
+
setNextTickAt: () => setNextTickAt,
|
|
283830
|
+
setContextBlocked: () => setContextBlocked,
|
|
283831
|
+
resumeProactive: () => resumeProactive,
|
|
283832
|
+
pauseProactive: () => pauseProactive,
|
|
283833
|
+
isProactivePaused: () => isProactivePaused,
|
|
283834
|
+
isProactiveForced: () => isProactiveForced,
|
|
283835
|
+
isProactiveActive: () => isProactiveActive,
|
|
283836
|
+
isContextBlocked: () => isContextBlocked,
|
|
283837
|
+
getProactiveSource: () => getProactiveSource,
|
|
283838
|
+
getNextTickAt: () => getNextTickAt,
|
|
283839
|
+
deactivateProactive: () => deactivateProactive,
|
|
283840
|
+
activateProactive: () => activateProactive,
|
|
283841
|
+
__resetProactiveState: () => __resetProactiveState
|
|
283842
|
+
});
|
|
283843
|
+
function debug(msg) {
|
|
283844
|
+
if (process.env.THEUS_PROACTIVE_DEBUG === "1") {
|
|
283845
|
+
try {
|
|
283846
|
+
process.stderr.write(`[proactive] ${msg}
|
|
283847
|
+
`);
|
|
283848
|
+
} catch {}
|
|
283849
|
+
}
|
|
283850
|
+
}
|
|
283851
|
+
function notify2() {
|
|
283852
|
+
for (const cb of Array.from(listeners)) {
|
|
283853
|
+
try {
|
|
283854
|
+
cb();
|
|
283855
|
+
} catch {}
|
|
283856
|
+
}
|
|
283857
|
+
}
|
|
283858
|
+
function isProactiveActive() {
|
|
283859
|
+
return active;
|
|
283860
|
+
}
|
|
283861
|
+
function isProactivePaused() {
|
|
283862
|
+
return paused;
|
|
283863
|
+
}
|
|
283864
|
+
function isContextBlocked() {
|
|
283865
|
+
return contextBlocked;
|
|
283866
|
+
}
|
|
283867
|
+
function getNextTickAt() {
|
|
283868
|
+
return nextTickAt;
|
|
283869
|
+
}
|
|
283870
|
+
function getProactiveSource() {
|
|
283871
|
+
return proactiveSource;
|
|
283872
|
+
}
|
|
283873
|
+
function subscribeToProactiveChanges(cb) {
|
|
283874
|
+
if (typeof cb !== "function")
|
|
283875
|
+
return () => {};
|
|
283876
|
+
listeners.add(cb);
|
|
283877
|
+
return () => {
|
|
283878
|
+
listeners.delete(cb);
|
|
283879
|
+
};
|
|
283880
|
+
}
|
|
283881
|
+
function activateProactive(src) {
|
|
283882
|
+
if (active && !paused) {
|
|
283883
|
+
if (src)
|
|
283884
|
+
proactiveSource = src;
|
|
283885
|
+
return;
|
|
283886
|
+
}
|
|
283887
|
+
active = true;
|
|
283888
|
+
paused = false;
|
|
283889
|
+
proactiveSource = src ?? proactiveSource ?? "command";
|
|
283890
|
+
debug(`activate (source=${proactiveSource})`);
|
|
283891
|
+
notify2();
|
|
283892
|
+
}
|
|
283893
|
+
function deactivateProactive() {
|
|
283894
|
+
if (!active && !paused && nextTickAt === null)
|
|
283895
|
+
return;
|
|
283896
|
+
active = false;
|
|
283897
|
+
paused = false;
|
|
283898
|
+
nextTickAt = null;
|
|
283899
|
+
debug("deactivate");
|
|
283900
|
+
notify2();
|
|
283901
|
+
}
|
|
283902
|
+
function pauseProactive() {
|
|
283903
|
+
if (!active || paused)
|
|
283904
|
+
return;
|
|
283905
|
+
paused = true;
|
|
283906
|
+
nextTickAt = null;
|
|
283907
|
+
debug("pause");
|
|
283908
|
+
notify2();
|
|
283909
|
+
}
|
|
283910
|
+
function resumeProactive() {
|
|
283911
|
+
if (!paused)
|
|
283912
|
+
return;
|
|
283913
|
+
paused = false;
|
|
283914
|
+
debug("resume");
|
|
283915
|
+
notify2();
|
|
283916
|
+
}
|
|
283917
|
+
function setContextBlocked(blocked) {
|
|
283918
|
+
const next = !!blocked;
|
|
283919
|
+
if (contextBlocked === next)
|
|
283920
|
+
return;
|
|
283921
|
+
contextBlocked = next;
|
|
283922
|
+
if (next)
|
|
283923
|
+
nextTickAt = null;
|
|
283924
|
+
debug(`contextBlocked=${next}`);
|
|
283925
|
+
notify2();
|
|
283926
|
+
}
|
|
283927
|
+
function setNextTickAt(ts) {
|
|
283928
|
+
const next = typeof ts === "number" && Number.isFinite(ts) ? ts : null;
|
|
283929
|
+
if (nextTickAt === next)
|
|
283930
|
+
return;
|
|
283931
|
+
nextTickAt = next;
|
|
283932
|
+
notify2();
|
|
283933
|
+
}
|
|
283934
|
+
function __resetProactiveState() {
|
|
283935
|
+
active = false;
|
|
283936
|
+
paused = false;
|
|
283937
|
+
contextBlocked = false;
|
|
283938
|
+
proactiveSource = null;
|
|
283939
|
+
nextTickAt = null;
|
|
283940
|
+
listeners.clear();
|
|
283941
|
+
}
|
|
283942
|
+
var active = false, paused = false, contextBlocked = false, proactiveSource = null, nextTickAt = null, listeners;
|
|
283943
|
+
var init_proactive = __esm(() => {
|
|
283944
|
+
init_proactiveEnabled();
|
|
283945
|
+
listeners = new Set;
|
|
283946
|
+
});
|
|
283947
|
+
|
|
283811
283948
|
// tools/SleepTool/SleepTool.ts
|
|
283812
283949
|
var exports_SleepTool = {};
|
|
283813
283950
|
__export(exports_SleepTool, {
|
|
@@ -283847,13 +283984,15 @@ function resolveDurationMs({ seconds, until }) {
|
|
|
283847
283984
|
}
|
|
283848
283985
|
return Math.min(Math.max(0, ms), MAX_SLEEP_SECONDS * 1000);
|
|
283849
283986
|
}
|
|
283850
|
-
var proactiveModule
|
|
283987
|
+
var proactiveModule, DEFAULT_SLEEP_SECONDS = 30, MAX_SLEEP_SECONDS = 86400, POLL_INTERVAL_MS2 = 1000, inputSchema37, outputSchema31, SleepTool;
|
|
283851
283988
|
var init_SleepTool = __esm(() => {
|
|
283989
|
+
init_proactiveEnabled();
|
|
283852
283990
|
init_v4();
|
|
283853
283991
|
init_Tool();
|
|
283854
283992
|
init_messageQueueManager();
|
|
283855
283993
|
init_prompt8();
|
|
283856
283994
|
init_UI25();
|
|
283995
|
+
proactiveModule = isProactiveForced() ? (init_proactive(), __toCommonJS(exports_proactive)) : null;
|
|
283857
283996
|
inputSchema37 = lazySchema(() => exports_external.strictObject({
|
|
283858
283997
|
seconds: exports_external.number().min(0).max(MAX_SLEEP_SECONDS).optional().describe(`Cu\xE1ntos segundos dormir (0\u2013${MAX_SLEEP_SECONDS}). Por defecto ${DEFAULT_SLEEP_SECONDS}.`),
|
|
283859
283998
|
until: exports_external.string().optional().describe('Marca de tiempo ISO 8601 hasta la que dormir. Si se indica, tiene prioridad sobre "seconds".')
|
|
@@ -285592,6 +285731,9 @@ function parseAddress(to) {
|
|
|
285592
285731
|
}
|
|
285593
285732
|
|
|
285594
285733
|
// utils/systemPrompt.ts
|
|
285734
|
+
function isProactiveActive_SAFE_TO_CALL_ANYWHERE() {
|
|
285735
|
+
return proactiveModule2?.isProactiveActive() ?? false;
|
|
285736
|
+
}
|
|
285595
285737
|
function buildEffectiveSystemPrompt({
|
|
285596
285738
|
mainThreadAgentDefinition,
|
|
285597
285739
|
toolUseContext,
|
|
@@ -285616,16 +285758,27 @@ function buildEffectiveSystemPrompt({
|
|
|
285616
285758
|
source: "main-thread"
|
|
285617
285759
|
});
|
|
285618
285760
|
}
|
|
285619
|
-
if (agentSystemPrompt &&
|
|
285761
|
+
if (agentSystemPrompt && isProactiveForced() && isProactiveActive_SAFE_TO_CALL_ANYWHERE()) {
|
|
285762
|
+
return asSystemPrompt([
|
|
285763
|
+
...defaultSystemPrompt,
|
|
285764
|
+
`
|
|
285765
|
+
# Custom Agent Instructions
|
|
285766
|
+
${agentSystemPrompt}`,
|
|
285767
|
+
...appendSystemPrompt ? [appendSystemPrompt] : []
|
|
285768
|
+
]);
|
|
285769
|
+
}
|
|
285620
285770
|
return asSystemPrompt([
|
|
285621
285771
|
...agentSystemPrompt ? [agentSystemPrompt] : customSystemPrompt ? [customSystemPrompt] : defaultSystemPrompt,
|
|
285622
285772
|
...appendSystemPrompt ? [appendSystemPrompt] : []
|
|
285623
285773
|
]);
|
|
285624
285774
|
}
|
|
285775
|
+
var proactiveModule2;
|
|
285625
285776
|
var init_systemPrompt = __esm(() => {
|
|
285777
|
+
init_proactiveEnabled();
|
|
285626
285778
|
init_analytics();
|
|
285627
285779
|
init_loadAgentsDir();
|
|
285628
285780
|
init_envUtils();
|
|
285781
|
+
proactiveModule2 = isProactiveForced() ? (init_proactive(), __toCommonJS(exports_proactive)) : null;
|
|
285629
285782
|
});
|
|
285630
285783
|
|
|
285631
285784
|
// tools/AgentTool/forkSubagent.ts
|
|
@@ -289158,8 +289311,9 @@ function resolveTeamName(input, appState) {
|
|
|
289158
289311
|
return;
|
|
289159
289312
|
return input.team_name || appState.teamContext?.teamName;
|
|
289160
289313
|
}
|
|
289161
|
-
var jsx_runtime160,
|
|
289314
|
+
var jsx_runtime160, proactiveModule3, PROGRESS_THRESHOLD_MS2 = 2000, isBackgroundTasksDisabled2, baseInputSchema, fullInputSchema2, inputSchema8, outputSchema37, AgentTool;
|
|
289162
289315
|
var init_AgentTool = __esm(() => {
|
|
289316
|
+
init_proactiveEnabled();
|
|
289163
289317
|
init_Tool();
|
|
289164
289318
|
init_promptCategory();
|
|
289165
289319
|
init_v4();
|
|
@@ -289207,6 +289361,7 @@ var init_AgentTool = __esm(() => {
|
|
|
289207
289361
|
init_runAgent();
|
|
289208
289362
|
init_UI4();
|
|
289209
289363
|
jsx_runtime160 = __toESM(require_jsx_runtime(), 1);
|
|
289364
|
+
proactiveModule3 = isProactiveForced() ? (init_proactive(), __toCommonJS(exports_proactive)) : null;
|
|
289210
289365
|
isBackgroundTasksDisabled2 = isEnvTruthy(process.env.THEUS_CODE_DISABLE_BACKGROUND_TASKS);
|
|
289211
289366
|
baseInputSchema = lazySchema(() => exports_external.object({
|
|
289212
289367
|
description: exports_external.string().describe("A short (3-5 word) description of the task"),
|
|
@@ -289468,7 +289623,7 @@ var init_AgentTool = __esm(() => {
|
|
|
289468
289623
|
const isCoordinator = false;
|
|
289469
289624
|
const forceAsync = isForkSubagentEnabled();
|
|
289470
289625
|
const assistantForceAsync = false;
|
|
289471
|
-
const shouldRunAsync = (run_in_background === true || selectedAgent.background === true || isCoordinator || forceAsync || assistantForceAsync || (
|
|
289626
|
+
const shouldRunAsync = (run_in_background === true || selectedAgent.background === true || isCoordinator || forceAsync || assistantForceAsync || (proactiveModule3?.isProactiveActive() ?? false)) && !isBackgroundTasksDisabled2;
|
|
289472
289627
|
const workerPermissionContext = {
|
|
289473
289628
|
...appState.toolPermissionContext,
|
|
289474
289629
|
mode: selectedAgent.permissionMode ?? "acceptEdits"
|
|
@@ -300533,9 +300688,9 @@ function getTheusEnvMetadata() {
|
|
|
300533
300688
|
};
|
|
300534
300689
|
}
|
|
300535
300690
|
function getBuildAgeMinutes() {
|
|
300536
|
-
if (!{ VERSION: "0.2.
|
|
300691
|
+
if (!{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.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)
|
|
300537
300692
|
return;
|
|
300538
|
-
const buildTime = new Date({ VERSION: "0.2.
|
|
300693
|
+
const buildTime = new Date({ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.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();
|
|
300539
300694
|
if (isNaN(buildTime))
|
|
300540
300695
|
return;
|
|
300541
300696
|
return Math.floor((Date.now() - buildTime) / 60000);
|
|
@@ -301358,12 +301513,16 @@ Recent messages are preserved verbatim.`;
|
|
|
301358
301513
|
if (suppressFollowUpQuestions) {
|
|
301359
301514
|
let continuation = `${baseSummary}
|
|
301360
301515
|
Continue the conversation from where it left off without asking the user any further questions. Resume directly \u2014 do not acknowledge the summary, do not recap what was happening, do not preface with "I'll continue" or similar. Pick up the last task as if the break never happened.`;
|
|
301361
|
-
if (
|
|
301516
|
+
if (isProactiveForced() && proactiveModule4?.isProactiveActive()) {
|
|
301517
|
+
continuation += `
|
|
301518
|
+
|
|
301519
|
+
You are running in autonomous/proactive mode. This is NOT a first wake-up \u2014 you were already working autonomously before compaction. Continue your work loop: pick up where you left off based on the summary above. Do not greet the user or ask what to work on.`;
|
|
301520
|
+
}
|
|
301362
301521
|
return continuation;
|
|
301363
301522
|
}
|
|
301364
301523
|
return baseSummary;
|
|
301365
301524
|
}
|
|
301366
|
-
var NO_TOOLS_PREAMBLE = `CRITICAL: Respond with TEXT ONLY. Do NOT call any tools.
|
|
301525
|
+
var proactiveModule4, NO_TOOLS_PREAMBLE = `CRITICAL: Respond with TEXT ONLY. Do NOT call any tools.
|
|
301367
301526
|
|
|
301368
301527
|
- Do NOT use Read, Bash, Grep, Glob, Edit, Write, or ANY other tool.
|
|
301369
301528
|
- You already have all the context you need in the conversation above.
|
|
@@ -301398,6 +301557,8 @@ var NO_TOOLS_PREAMBLE = `CRITICAL: Respond with TEXT ONLY. Do NOT call any tools
|
|
|
301398
301557
|
- Pay special attention to specific user feedback that you received, especially if the user told you to do something differently.
|
|
301399
301558
|
2. Double-check for technical accuracy and completeness, addressing each required element thoroughly.`, BASE_COMPACT_PROMPT, PARTIAL_COMPACT_PROMPT, PARTIAL_COMPACT_UP_TO_PROMPT, NO_TOOLS_TRAILER;
|
|
301400
301559
|
var init_prompt22 = __esm(() => {
|
|
301560
|
+
init_proactiveEnabled();
|
|
301561
|
+
proactiveModule4 = isProactiveForced() ? (init_proactive(), __toCommonJS(exports_proactive)) : null;
|
|
301401
301562
|
BASE_COMPACT_PROMPT = `Your task is to create a detailed summary of the conversation so far, paying close attention to the user's explicit requests and your previous actions.
|
|
301402
301563
|
This summary should be thorough in capturing technical details, code patterns, and architectural decisions that would be essential for continuing development work without losing context.
|
|
301403
301564
|
|
|
@@ -316777,7 +316938,7 @@ function getAssistantMessageFromError(error40, model, options2) {
|
|
|
316777
316938
|
if (process.env.USER_TYPE === "ant") {
|
|
316778
316939
|
const baseMessage = `API Error: 400 ${error40.message}
|
|
316779
316940
|
|
|
316780
|
-
Run /share and post the JSON file to ${{ VERSION: "0.2.
|
|
316941
|
+
Run /share and post the JSON file to ${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.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}.`;
|
|
316781
316942
|
const rewindInstruction = getIsNonInteractiveSession() ? "" : " Then, use /rewind to recover the conversation.";
|
|
316782
316943
|
return createAssistantAPIErrorMessage({
|
|
316783
316944
|
content: baseMessage + rewindInstruction,
|
|
@@ -316813,7 +316974,7 @@ Run /share and post the JSON file to ${{ VERSION: "0.2.24", BUILD_TIME: "1970-01
|
|
|
316813
316974
|
if (process.env.USER_TYPE === "ant" && !process.env.THEUS_MODEL && error40 instanceof Error && error40.message.toLowerCase().includes("invalid model name")) {
|
|
316814
316975
|
const orgId = getOauthAccountInfo()?.organizationUuid;
|
|
316815
316976
|
const baseMsg = `[THEUS-INTERNAL] Your org isn't gated into the \`${model}\` model. Either run \`theus\` with \`THEUS_MODEL=${getDefaultMainLoopModelSetting()}\``;
|
|
316816
|
-
const msg = orgId ? `${baseMsg} or share your orgId (${orgId}) in ${{ VERSION: "0.2.
|
|
316977
|
+
const msg = orgId ? `${baseMsg} or share your orgId (${orgId}) in ${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.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.25", BUILD_TIME: "1970-01-01T00:00:00.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.`;
|
|
316817
316978
|
return createAssistantAPIErrorMessage({
|
|
316818
316979
|
content: msg,
|
|
316819
316980
|
error: "invalid_request"
|
|
@@ -323694,7 +323855,7 @@ function ScrollBox({
|
|
|
323694
323855
|
const [, forceRender] = import_react97.useState(0);
|
|
323695
323856
|
const listenersRef = import_react97.useRef(new Set);
|
|
323696
323857
|
const renderQueuedRef = import_react97.useRef(false);
|
|
323697
|
-
const
|
|
323858
|
+
const notify3 = () => {
|
|
323698
323859
|
for (const l of listenersRef.current)
|
|
323699
323860
|
l();
|
|
323700
323861
|
};
|
|
@@ -323702,7 +323863,7 @@ function ScrollBox({
|
|
|
323702
323863
|
markScrollActivity();
|
|
323703
323864
|
markDirty(el);
|
|
323704
323865
|
markCommitStart();
|
|
323705
|
-
|
|
323866
|
+
notify3();
|
|
323706
323867
|
if (renderQueuedRef.current)
|
|
323707
323868
|
return;
|
|
323708
323869
|
renderQueuedRef.current = true;
|
|
@@ -323750,7 +323911,7 @@ function ScrollBox({
|
|
|
323750
323911
|
el.pendingScrollDelta = undefined;
|
|
323751
323912
|
el.stickyScroll = true;
|
|
323752
323913
|
markDirty(el);
|
|
323753
|
-
|
|
323914
|
+
notify3();
|
|
323754
323915
|
forceRender((n2) => n2 + 1);
|
|
323755
323916
|
},
|
|
323756
323917
|
getScrollTop() {
|
|
@@ -325010,7 +325171,10 @@ async function clearConversation({
|
|
|
325010
325171
|
}
|
|
325011
325172
|
}
|
|
325012
325173
|
setMessages(() => []);
|
|
325013
|
-
if (
|
|
325174
|
+
if (isProactiveForced()) {
|
|
325175
|
+
const { setContextBlocked: setContextBlocked2 } = (init_proactive(), __toCommonJS(exports_proactive));
|
|
325176
|
+
setContextBlocked2(false);
|
|
325177
|
+
}
|
|
325014
325178
|
if (setConversationId) {
|
|
325015
325179
|
setConversationId(randomUUID26());
|
|
325016
325180
|
}
|
|
@@ -325091,6 +325255,7 @@ async function clearConversation({
|
|
|
325091
325255
|
}
|
|
325092
325256
|
}
|
|
325093
325257
|
var init_conversation = __esm(() => {
|
|
325258
|
+
init_proactiveEnabled();
|
|
325094
325259
|
init_state();
|
|
325095
325260
|
init_analytics();
|
|
325096
325261
|
init_LocalAgentTask();
|
|
@@ -326913,7 +327078,7 @@ function buildPrimarySection() {
|
|
|
326913
327078
|
});
|
|
326914
327079
|
return [{
|
|
326915
327080
|
label: "Version",
|
|
326916
|
-
value: { VERSION: "0.2.
|
|
327081
|
+
value: { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
326917
327082
|
}, {
|
|
326918
327083
|
label: "Session name",
|
|
326919
327084
|
value: nameValue
|
|
@@ -330729,7 +330894,7 @@ function Config({
|
|
|
330729
330894
|
}
|
|
330730
330895
|
})
|
|
330731
330896
|
}) : showSubmenu === "ChannelDowngrade" ? /* @__PURE__ */ jsx_runtime185.jsx(ChannelDowngradeDialog, {
|
|
330732
|
-
currentVersion: { VERSION: "0.2.
|
|
330897
|
+
currentVersion: { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
330733
330898
|
onChoice: (choice) => {
|
|
330734
330899
|
setShowSubmenu(null);
|
|
330735
330900
|
setTabsHidden(false);
|
|
@@ -330741,7 +330906,7 @@ function Config({
|
|
|
330741
330906
|
autoUpdatesChannel: "stable"
|
|
330742
330907
|
};
|
|
330743
330908
|
if (choice === "stay") {
|
|
330744
|
-
newSettings.minimumVersion = { VERSION: "0.2.
|
|
330909
|
+
newSettings.minimumVersion = { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
|
|
330745
330910
|
}
|
|
330746
330911
|
updateSettingsForSource("userSettings", newSettings);
|
|
330747
330912
|
setSettingsData((prev_27) => ({
|
|
@@ -338775,7 +338940,7 @@ function HelpV2(t0) {
|
|
|
338775
338940
|
let t6;
|
|
338776
338941
|
if ($2[31] !== tabs) {
|
|
338777
338942
|
t6 = /* @__PURE__ */ jsx_runtime212.jsx(Tabs, {
|
|
338778
|
-
title: `Theus v${{ VERSION: "0.2.
|
|
338943
|
+
title: `Theus v${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}`,
|
|
338779
338944
|
color: "professionalBlue",
|
|
338780
338945
|
defaultTab: "general",
|
|
338781
338946
|
children: tabs
|
|
@@ -347447,9 +347612,9 @@ function DiscoverPlugins({
|
|
|
347447
347612
|
const [loading, setLoading] = import_react133.useState(true);
|
|
347448
347613
|
const [installCounts, setInstallCounts] = import_react133.useState(null);
|
|
347449
347614
|
const [isSearchMode, setIsSearchModeRaw] = import_react133.useState(false);
|
|
347450
|
-
const setIsSearchMode = import_react133.useCallback((
|
|
347451
|
-
setIsSearchModeRaw(
|
|
347452
|
-
onSearchModeChange?.(
|
|
347615
|
+
const setIsSearchMode = import_react133.useCallback((active2) => {
|
|
347616
|
+
setIsSearchModeRaw(active2);
|
|
347617
|
+
onSearchModeChange?.(active2);
|
|
347453
347618
|
}, [onSearchModeChange]);
|
|
347454
347619
|
const {
|
|
347455
347620
|
query: searchQuery,
|
|
@@ -351340,9 +351505,9 @@ function ManagePlugins({
|
|
|
351340
351505
|
const pluginErrors = useAppState((s_1) => s_1.plugins.errors);
|
|
351341
351506
|
const flaggedPlugins = getFlaggedPlugins();
|
|
351342
351507
|
const [isSearchMode, setIsSearchModeRaw] = import_react135.useState(false);
|
|
351343
|
-
const setIsSearchMode = import_react135.useCallback((
|
|
351344
|
-
setIsSearchModeRaw(
|
|
351345
|
-
onSearchModeChange?.(
|
|
351508
|
+
const setIsSearchMode = import_react135.useCallback((active2) => {
|
|
351509
|
+
setIsSearchModeRaw(active2);
|
|
351510
|
+
onSearchModeChange?.(active2);
|
|
351346
351511
|
}, [onSearchModeChange]);
|
|
351347
351512
|
const isTerminalFocused = useTerminalFocus();
|
|
351348
351513
|
const {
|
|
@@ -355496,6 +355661,15 @@ var init_mcp3 = __esm(() => {
|
|
|
355496
355661
|
var NOVEDADES;
|
|
355497
355662
|
var init_data = __esm(() => {
|
|
355498
355663
|
NOVEDADES = [
|
|
355664
|
+
{
|
|
355665
|
+
version: "v0.2.25",
|
|
355666
|
+
fecha: "2026-07-12",
|
|
355667
|
+
titulo: "Modo proactivo (beta)",
|
|
355668
|
+
puntos: [
|
|
355669
|
+
"Modo proactivo reconstruido (beta, opt-in): el agente trabaja solo entre turnos \u2014 duerme y despierta cuando hay trabajo o mensajes. Act\xEDvalo con THEUS_PROACTIVE=1 y luego /proactive on (apagado por defecto mientras se estabiliza).",
|
|
355670
|
+
"Nuevo comando /proactive (on/off/pause/resume/status) y arranque con --proactive. La herramienta de espera se activa sola con el modo."
|
|
355671
|
+
]
|
|
355672
|
+
},
|
|
355499
355673
|
{
|
|
355500
355674
|
version: "v0.2.24",
|
|
355501
355675
|
fecha: "2026-07-12",
|
|
@@ -357139,7 +357313,7 @@ function Onboarding({
|
|
|
357139
357313
|
flexDirection: "column",
|
|
357140
357314
|
children: [
|
|
357141
357315
|
/* @__PURE__ */ jsx_runtime245.jsx(TheusBanner, {
|
|
357142
|
-
version: { VERSION: "0.2.
|
|
357316
|
+
version: { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
357143
357317
|
}),
|
|
357144
357318
|
/* @__PURE__ */ jsx_runtime245.jsxs(ThemedBox_default, {
|
|
357145
357319
|
flexDirection: "column",
|
|
@@ -357484,9 +357658,9 @@ function getAllReleaseNotes(changelogContent = getStoredChangelogFromMemory()) {
|
|
|
357484
357658
|
return [];
|
|
357485
357659
|
}
|
|
357486
357660
|
}
|
|
357487
|
-
async function checkForReleaseNotes(lastSeenVersion, currentVersion = { VERSION: "0.2.
|
|
357661
|
+
async function checkForReleaseNotes(lastSeenVersion, currentVersion = { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION) {
|
|
357488
357662
|
if (process.env.USER_TYPE === "ant") {
|
|
357489
|
-
const changelog = { VERSION: "0.2.
|
|
357663
|
+
const changelog = { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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;
|
|
357490
357664
|
if (changelog) {
|
|
357491
357665
|
const commits = changelog.trim().split(`
|
|
357492
357666
|
`).filter(Boolean);
|
|
@@ -361516,7 +361690,7 @@ function shouldRenderStatically(message, streamingToolUseIDs, inProgressToolUseI
|
|
|
361516
361690
|
}
|
|
361517
361691
|
}
|
|
361518
361692
|
}
|
|
361519
|
-
var React86, import_react152, jsx_runtime258, LogoHeader,
|
|
361693
|
+
var React86, import_react152, jsx_runtime258, LogoHeader, proactiveModule5, BRIEF_TOOL_NAME4 = null, SEND_USER_FILE_TOOL_NAME2 = null, MAX_MESSAGES_TO_SHOW_IN_TRANSCRIPT_MODE = 30, MAX_MESSAGES_WITHOUT_VIRTUALIZATION = 200, MESSAGE_CAP_STEP = 50, MessagesImpl = ({
|
|
361520
361694
|
messages,
|
|
361521
361695
|
tools,
|
|
361522
361696
|
commands,
|
|
@@ -361701,7 +361875,7 @@ var React86, import_react152, jsx_runtime258, LogoHeader, proactiveModule3 = nul
|
|
|
361701
361875
|
progress
|
|
361702
361876
|
} = useTerminalNotification();
|
|
361703
361877
|
const prevProgressState = import_react152.useRef(null);
|
|
361704
|
-
const progressEnabled = getGlobalConfig().terminalProgressBarEnabled && !getIsRemoteMode() && !(
|
|
361878
|
+
const progressEnabled = getGlobalConfig().terminalProgressBarEnabled && !getIsRemoteMode() && !(proactiveModule5?.isProactiveActive() ?? false);
|
|
361705
361879
|
import_react152.useEffect(() => {
|
|
361706
361880
|
const state = progressEnabled ? hasToolsInProgress ? "indeterminate" : "completed" : null;
|
|
361707
361881
|
if (prevProgressState.current === state)
|
|
@@ -361848,6 +362022,7 @@ var React86, import_react152, jsx_runtime258, LogoHeader, proactiveModule3 = nul
|
|
|
361848
362022
|
});
|
|
361849
362023
|
}, Messages;
|
|
361850
362024
|
var init_Messages = __esm(() => {
|
|
362025
|
+
init_proactiveEnabled();
|
|
361851
362026
|
init_compiler_runtime();
|
|
361852
362027
|
init_source();
|
|
361853
362028
|
init_state();
|
|
@@ -361888,7 +362063,7 @@ var init_Messages = __esm(() => {
|
|
|
361888
362063
|
let t1;
|
|
361889
362064
|
if ($2[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
361890
362065
|
t1 = /* @__PURE__ */ jsx_runtime258.jsx(TheusSessionHeader, {
|
|
361891
|
-
version: { VERSION: "0.2.
|
|
362066
|
+
version: { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
361892
362067
|
});
|
|
361893
362068
|
$2[0] = t1;
|
|
361894
362069
|
} else {
|
|
@@ -361918,6 +362093,7 @@ var init_Messages = __esm(() => {
|
|
|
361918
362093
|
}
|
|
361919
362094
|
return t2;
|
|
361920
362095
|
});
|
|
362096
|
+
proactiveModule5 = isProactiveForced() ? (init_proactive(), __toCommonJS(exports_proactive)) : null;
|
|
361921
362097
|
Messages = React86.memo(MessagesImpl, (prev, next) => {
|
|
361922
362098
|
const keys2 = Object.keys(prev);
|
|
361923
362099
|
for (const key of keys2) {
|
|
@@ -370757,14 +370933,14 @@ async function launchUltraplan2(opts) {
|
|
|
370757
370933
|
onSessionReady
|
|
370758
370934
|
} = opts;
|
|
370759
370935
|
const {
|
|
370760
|
-
ultraplanSessionUrl:
|
|
370936
|
+
ultraplanSessionUrl: active2,
|
|
370761
370937
|
ultraplanLaunching
|
|
370762
370938
|
} = getAppState();
|
|
370763
|
-
if (
|
|
370939
|
+
if (active2 || ultraplanLaunching) {
|
|
370764
370940
|
logEvent("tengu_ultraplan_create_failed", {
|
|
370765
|
-
reason:
|
|
370941
|
+
reason: active2 ? "already_polling" : "already_launching"
|
|
370766
370942
|
});
|
|
370767
|
-
return buildAlreadyActiveMessage(
|
|
370943
|
+
return buildAlreadyActiveMessage(active2);
|
|
370768
370944
|
}
|
|
370769
370945
|
if (!blurb && !seedPlan) {
|
|
370770
370946
|
return [
|
|
@@ -370913,14 +371089,14 @@ var ULTRAPLAN_TIMEOUT_MS, CCR_TERMS_URL2 = "https://docs.theus.pe/docs/en/theus-
|
|
|
370913
371089
|
return null;
|
|
370914
371090
|
}
|
|
370915
371091
|
const {
|
|
370916
|
-
ultraplanSessionUrl:
|
|
371092
|
+
ultraplanSessionUrl: active2,
|
|
370917
371093
|
ultraplanLaunching
|
|
370918
371094
|
} = context3.getAppState();
|
|
370919
|
-
if (
|
|
371095
|
+
if (active2 || ultraplanLaunching) {
|
|
370920
371096
|
logEvent("tengu_ultraplan_create_failed", {
|
|
370921
|
-
reason:
|
|
371097
|
+
reason: active2 ? "already_polling" : "already_launching"
|
|
370922
371098
|
});
|
|
370923
|
-
onDone(buildAlreadyActiveMessage(
|
|
371099
|
+
onDone(buildAlreadyActiveMessage(active2), {
|
|
370924
371100
|
display: "system"
|
|
370925
371101
|
});
|
|
370926
371102
|
return null;
|
|
@@ -383418,8 +383594,8 @@ function resolveAgentOverrides(allAgents, activeAgents) {
|
|
|
383418
383594
|
if (seen.has(key))
|
|
383419
383595
|
continue;
|
|
383420
383596
|
seen.add(key);
|
|
383421
|
-
const
|
|
383422
|
-
const overriddenBy =
|
|
383597
|
+
const active2 = activeMap.get(agent.agentType);
|
|
383598
|
+
const overriddenBy = active2 && active2.source !== agent.source ? active2.source : undefined;
|
|
383423
383599
|
resolved.push({ ...agent, overriddenBy });
|
|
383424
383600
|
}
|
|
383425
383601
|
return resolved;
|
|
@@ -389645,7 +389821,7 @@ async function captureMemoryDiagnostics(trigger, dumpNumber = 0) {
|
|
|
389645
389821
|
smapsRollup,
|
|
389646
389822
|
platform: process.platform,
|
|
389647
389823
|
nodeVersion: process.version,
|
|
389648
|
-
ccVersion: { VERSION: "0.2.
|
|
389824
|
+
ccVersion: { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
389649
389825
|
};
|
|
389650
389826
|
}
|
|
389651
389827
|
async function performHeapDump(trigger = "manual", dumpNumber = 0) {
|
|
@@ -389764,7 +389940,7 @@ function validateBridgeId(id, label) {
|
|
|
389764
389940
|
return id;
|
|
389765
389941
|
}
|
|
389766
389942
|
function createBridgeApiClient(deps) {
|
|
389767
|
-
function
|
|
389943
|
+
function debug2(msg) {
|
|
389768
389944
|
deps.onDebug?.(msg);
|
|
389769
389945
|
}
|
|
389770
389946
|
let consecutiveEmptyPolls = 0;
|
|
@@ -389797,27 +389973,27 @@ function createBridgeApiClient(deps) {
|
|
|
389797
389973
|
return response;
|
|
389798
389974
|
}
|
|
389799
389975
|
if (!deps.onAuth401) {
|
|
389800
|
-
|
|
389976
|
+
debug2(`[bridge:api] ${context3}: 401 received, no refresh handler`);
|
|
389801
389977
|
return response;
|
|
389802
389978
|
}
|
|
389803
|
-
|
|
389979
|
+
debug2(`[bridge:api] ${context3}: 401 received, attempting token refresh`);
|
|
389804
389980
|
const refreshed2 = await deps.onAuth401(accessToken);
|
|
389805
389981
|
if (refreshed2) {
|
|
389806
|
-
|
|
389982
|
+
debug2(`[bridge:api] ${context3}: Token refreshed, retrying request`);
|
|
389807
389983
|
const newToken = resolveAuth();
|
|
389808
389984
|
const retryResponse = await fn(newToken);
|
|
389809
389985
|
if (retryResponse.status !== 401) {
|
|
389810
389986
|
return retryResponse;
|
|
389811
389987
|
}
|
|
389812
|
-
|
|
389988
|
+
debug2(`[bridge:api] ${context3}: Retry after refresh also got 401`);
|
|
389813
389989
|
} else {
|
|
389814
|
-
|
|
389990
|
+
debug2(`[bridge:api] ${context3}: Token refresh failed`);
|
|
389815
389991
|
}
|
|
389816
389992
|
return response;
|
|
389817
389993
|
}
|
|
389818
389994
|
return {
|
|
389819
389995
|
async registerBridgeEnvironment(config3) {
|
|
389820
|
-
|
|
389996
|
+
debug2(`[bridge:api] POST /v1/environments/bridge bridgeId=${config3.bridgeId}`);
|
|
389821
389997
|
const response = await withOAuthRetry((token) => axios_default.post(`${deps.baseUrl}/v1/environments/bridge`, {
|
|
389822
389998
|
machine_name: config3.machineName,
|
|
389823
389999
|
directory: config3.dir,
|
|
@@ -389834,9 +390010,9 @@ function createBridgeApiClient(deps) {
|
|
|
389834
390010
|
validateStatus: (status2) => status2 < 500
|
|
389835
390011
|
}), "Registration");
|
|
389836
390012
|
handleErrorStatus(response.status, response.data, "Registration");
|
|
389837
|
-
|
|
389838
|
-
|
|
389839
|
-
|
|
390013
|
+
debug2(`[bridge:api] POST /v1/environments/bridge -> ${response.status} environment_id=${response.data.environment_id}`);
|
|
390014
|
+
debug2(`[bridge:api] >>> ${debugBody({ machine_name: config3.machineName, directory: config3.dir, branch: config3.branch, git_repo_url: config3.gitRepoUrl, max_sessions: config3.maxSessions, metadata: { worker_type: config3.workerType } })}`);
|
|
390015
|
+
debug2(`[bridge:api] <<< ${debugBody(response.data)}`);
|
|
389840
390016
|
return response.data;
|
|
389841
390017
|
},
|
|
389842
390018
|
async pollForWork(environmentId, environmentSecret, signal, reclaimOlderThanMs) {
|
|
@@ -389854,101 +390030,101 @@ function createBridgeApiClient(deps) {
|
|
|
389854
390030
|
if (!response.data) {
|
|
389855
390031
|
consecutiveEmptyPolls = prevEmptyPolls + 1;
|
|
389856
390032
|
if (consecutiveEmptyPolls === 1 || consecutiveEmptyPolls % EMPTY_POLL_LOG_INTERVAL === 0) {
|
|
389857
|
-
|
|
390033
|
+
debug2(`[bridge:api] GET .../work/poll -> ${response.status} (no work, ${consecutiveEmptyPolls} consecutive empty polls)`);
|
|
389858
390034
|
}
|
|
389859
390035
|
return null;
|
|
389860
390036
|
}
|
|
389861
|
-
|
|
389862
|
-
|
|
390037
|
+
debug2(`[bridge:api] GET .../work/poll -> ${response.status} workId=${response.data.id} type=${response.data.data?.type}${response.data.data?.id ? ` sessionId=${response.data.data.id}` : ""}`);
|
|
390038
|
+
debug2(`[bridge:api] <<< ${debugBody(response.data)}`);
|
|
389863
390039
|
return response.data;
|
|
389864
390040
|
},
|
|
389865
390041
|
async acknowledgeWork(environmentId, workId, sessionToken2) {
|
|
389866
390042
|
validateBridgeId(environmentId, "environmentId");
|
|
389867
390043
|
validateBridgeId(workId, "workId");
|
|
389868
|
-
|
|
390044
|
+
debug2(`[bridge:api] POST .../work/${workId}/ack`);
|
|
389869
390045
|
const response = await axios_default.post(`${deps.baseUrl}/v1/environments/${environmentId}/work/${workId}/ack`, {}, {
|
|
389870
390046
|
headers: getHeaders(sessionToken2),
|
|
389871
390047
|
timeout: 1e4,
|
|
389872
390048
|
validateStatus: (s) => s < 500
|
|
389873
390049
|
});
|
|
389874
390050
|
handleErrorStatus(response.status, response.data, "Acknowledge");
|
|
389875
|
-
|
|
390051
|
+
debug2(`[bridge:api] POST .../work/${workId}/ack -> ${response.status}`);
|
|
389876
390052
|
},
|
|
389877
390053
|
async stopWork(environmentId, workId, force) {
|
|
389878
390054
|
validateBridgeId(environmentId, "environmentId");
|
|
389879
390055
|
validateBridgeId(workId, "workId");
|
|
389880
|
-
|
|
390056
|
+
debug2(`[bridge:api] POST .../work/${workId}/stop force=${force}`);
|
|
389881
390057
|
const response = await withOAuthRetry((token) => axios_default.post(`${deps.baseUrl}/v1/environments/${environmentId}/work/${workId}/stop`, { force }, {
|
|
389882
390058
|
headers: getHeaders(token),
|
|
389883
390059
|
timeout: 1e4,
|
|
389884
390060
|
validateStatus: (s) => s < 500
|
|
389885
390061
|
}), "StopWork");
|
|
389886
390062
|
handleErrorStatus(response.status, response.data, "StopWork");
|
|
389887
|
-
|
|
390063
|
+
debug2(`[bridge:api] POST .../work/${workId}/stop -> ${response.status}`);
|
|
389888
390064
|
},
|
|
389889
390065
|
async deregisterEnvironment(environmentId) {
|
|
389890
390066
|
validateBridgeId(environmentId, "environmentId");
|
|
389891
|
-
|
|
390067
|
+
debug2(`[bridge:api] DELETE /v1/environments/bridge/${environmentId}`);
|
|
389892
390068
|
const response = await withOAuthRetry((token) => axios_default.delete(`${deps.baseUrl}/v1/environments/bridge/${environmentId}`, {
|
|
389893
390069
|
headers: getHeaders(token),
|
|
389894
390070
|
timeout: 1e4,
|
|
389895
390071
|
validateStatus: (s) => s < 500
|
|
389896
390072
|
}), "Deregister");
|
|
389897
390073
|
handleErrorStatus(response.status, response.data, "Deregister");
|
|
389898
|
-
|
|
390074
|
+
debug2(`[bridge:api] DELETE /v1/environments/bridge/${environmentId} -> ${response.status}`);
|
|
389899
390075
|
},
|
|
389900
390076
|
async archiveSession(sessionId) {
|
|
389901
390077
|
validateBridgeId(sessionId, "sessionId");
|
|
389902
|
-
|
|
390078
|
+
debug2(`[bridge:api] POST /v1/sessions/${sessionId}/archive`);
|
|
389903
390079
|
const response = await withOAuthRetry((token) => axios_default.post(`${deps.baseUrl}/v1/sessions/${sessionId}/archive`, {}, {
|
|
389904
390080
|
headers: getHeaders(token),
|
|
389905
390081
|
timeout: 1e4,
|
|
389906
390082
|
validateStatus: (s) => s < 500
|
|
389907
390083
|
}), "ArchiveSession");
|
|
389908
390084
|
if (response.status === 409) {
|
|
389909
|
-
|
|
390085
|
+
debug2(`[bridge:api] POST /v1/sessions/${sessionId}/archive -> 409 (already archived)`);
|
|
389910
390086
|
return;
|
|
389911
390087
|
}
|
|
389912
390088
|
handleErrorStatus(response.status, response.data, "ArchiveSession");
|
|
389913
|
-
|
|
390089
|
+
debug2(`[bridge:api] POST /v1/sessions/${sessionId}/archive -> ${response.status}`);
|
|
389914
390090
|
},
|
|
389915
390091
|
async reconnectSession(environmentId, sessionId) {
|
|
389916
390092
|
validateBridgeId(environmentId, "environmentId");
|
|
389917
390093
|
validateBridgeId(sessionId, "sessionId");
|
|
389918
|
-
|
|
390094
|
+
debug2(`[bridge:api] POST /v1/environments/${environmentId}/bridge/reconnect session_id=${sessionId}`);
|
|
389919
390095
|
const response = await withOAuthRetry((token) => axios_default.post(`${deps.baseUrl}/v1/environments/${environmentId}/bridge/reconnect`, { session_id: sessionId }, {
|
|
389920
390096
|
headers: getHeaders(token),
|
|
389921
390097
|
timeout: 1e4,
|
|
389922
390098
|
validateStatus: (s) => s < 500
|
|
389923
390099
|
}), "ReconnectSession");
|
|
389924
390100
|
handleErrorStatus(response.status, response.data, "ReconnectSession");
|
|
389925
|
-
|
|
390101
|
+
debug2(`[bridge:api] POST .../bridge/reconnect -> ${response.status}`);
|
|
389926
390102
|
},
|
|
389927
390103
|
async heartbeatWork(environmentId, workId, sessionToken2) {
|
|
389928
390104
|
validateBridgeId(environmentId, "environmentId");
|
|
389929
390105
|
validateBridgeId(workId, "workId");
|
|
389930
|
-
|
|
390106
|
+
debug2(`[bridge:api] POST .../work/${workId}/heartbeat`);
|
|
389931
390107
|
const response = await axios_default.post(`${deps.baseUrl}/v1/environments/${environmentId}/work/${workId}/heartbeat`, {}, {
|
|
389932
390108
|
headers: getHeaders(sessionToken2),
|
|
389933
390109
|
timeout: 1e4,
|
|
389934
390110
|
validateStatus: (s) => s < 500
|
|
389935
390111
|
});
|
|
389936
390112
|
handleErrorStatus(response.status, response.data, "Heartbeat");
|
|
389937
|
-
|
|
390113
|
+
debug2(`[bridge:api] POST .../work/${workId}/heartbeat -> ${response.status} lease_extended=${response.data.lease_extended} state=${response.data.state}`);
|
|
389938
390114
|
return response.data;
|
|
389939
390115
|
},
|
|
389940
390116
|
async sendPermissionResponseEvent(sessionId, event, sessionToken2) {
|
|
389941
390117
|
validateBridgeId(sessionId, "sessionId");
|
|
389942
|
-
|
|
390118
|
+
debug2(`[bridge:api] POST /v1/sessions/${sessionId}/events type=${event.type}`);
|
|
389943
390119
|
const response = await axios_default.post(`${deps.baseUrl}/v1/sessions/${sessionId}/events`, { events: [event] }, {
|
|
389944
390120
|
headers: getHeaders(sessionToken2),
|
|
389945
390121
|
timeout: 1e4,
|
|
389946
390122
|
validateStatus: (s) => s < 500
|
|
389947
390123
|
});
|
|
389948
390124
|
handleErrorStatus(response.status, response.data, "SendPermissionResponseEvent");
|
|
389949
|
-
|
|
389950
|
-
|
|
389951
|
-
|
|
390125
|
+
debug2(`[bridge:api] POST /v1/sessions/${sessionId}/events -> ${response.status}`);
|
|
390126
|
+
debug2(`[bridge:api] >>> ${debugBody({ events: [event] })}`);
|
|
390127
|
+
debug2(`[bridge:api] <<< ${debugBody(response.data)}`);
|
|
389952
390128
|
}
|
|
389953
390129
|
};
|
|
389954
390130
|
}
|
|
@@ -390231,7 +390407,7 @@ var init_bridge_kick = __esm(() => {
|
|
|
390231
390407
|
var call57 = async () => {
|
|
390232
390408
|
return {
|
|
390233
390409
|
type: "text",
|
|
390234
|
-
value: { VERSION: "0.2.
|
|
390410
|
+
value: { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.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.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.25", BUILD_TIME: "1970-01-01T00:00:00.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.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
390235
390411
|
};
|
|
390236
390412
|
}, version2, version_default;
|
|
390237
390413
|
var init_version = __esm(() => {
|
|
@@ -390728,13 +390904,13 @@ function IntelligenceBar({ onDone }) {
|
|
|
390728
390904
|
}
|
|
390729
390905
|
}
|
|
390730
390906
|
const labelCells = LEVELS.map((l, i3) => {
|
|
390731
|
-
const
|
|
390907
|
+
const active2 = i3 === index;
|
|
390732
390908
|
return /* @__PURE__ */ jsx_runtime331.jsxs(ThemedText, {
|
|
390733
|
-
bold:
|
|
390734
|
-
color:
|
|
390735
|
-
dimColor: !
|
|
390909
|
+
bold: active2,
|
|
390910
|
+
color: active2 ? isMax ? baseColor : NEON : undefined,
|
|
390911
|
+
dimColor: !active2,
|
|
390736
390912
|
children: [
|
|
390737
|
-
|
|
390913
|
+
active2 ? `\u25B8 ${l.label}` : ` ${l.label}`,
|
|
390738
390914
|
" "
|
|
390739
390915
|
]
|
|
390740
390916
|
}, l.key);
|
|
@@ -393289,10 +393465,10 @@ function CatalogModelPicker({
|
|
|
393289
393465
|
}
|
|
393290
393466
|
return out;
|
|
393291
393467
|
}, [catalog, aliasOptions]);
|
|
393292
|
-
const
|
|
393468
|
+
const active2 = getActiveSessionSelection();
|
|
393293
393469
|
const defaultValue = import_react188.useMemo(() => {
|
|
393294
|
-
if (
|
|
393295
|
-
const value = catalogValue(
|
|
393470
|
+
if (active2) {
|
|
393471
|
+
const value = catalogValue(active2);
|
|
393296
393472
|
if (selectOptions.some((o2) => o2.value === value))
|
|
393297
393473
|
return value;
|
|
393298
393474
|
}
|
|
@@ -393305,8 +393481,8 @@ function CatalogModelPicker({
|
|
|
393305
393481
|
return alias;
|
|
393306
393482
|
}
|
|
393307
393483
|
return selectOptions[0]?.value;
|
|
393308
|
-
}, [
|
|
393309
|
-
const currentLabel =
|
|
393484
|
+
}, [active2, mainLoopModel, catalog, selectOptions]);
|
|
393485
|
+
const currentLabel = active2 ? `${active2.label} \xB7 ${active2.providerId}` : mainLoopModel ?? "predeterminado";
|
|
393310
393486
|
const handleCancel = React111.useCallback(() => {
|
|
393311
393487
|
logEvent("tengu_model_command_menu", {
|
|
393312
393488
|
action: "cancel"
|
|
@@ -394673,13 +394849,13 @@ async function updateReleaseBundle() {
|
|
|
394673
394849
|
await gracefulShutdown(1);
|
|
394674
394850
|
return;
|
|
394675
394851
|
}
|
|
394676
|
-
if (gte({ VERSION: "0.2.
|
|
394677
|
-
writeToStdout(source_default.green(`Theus is up to date (${{ VERSION: "0.2.
|
|
394852
|
+
if (gte({ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
|
|
394853
|
+
writeToStdout(source_default.green(`Theus is up to date (${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})`) + `
|
|
394678
394854
|
`);
|
|
394679
394855
|
await gracefulShutdown(0);
|
|
394680
394856
|
return;
|
|
394681
394857
|
}
|
|
394682
|
-
writeToStdout(`New version available: ${latest} (current: ${{ VERSION: "0.2.
|
|
394858
|
+
writeToStdout(`New version available: ${latest} (current: ${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})
|
|
394683
394859
|
`);
|
|
394684
394860
|
writeToStdout(`Installing update from theus.pe/dl...
|
|
394685
394861
|
`);
|
|
@@ -394713,7 +394889,7 @@ async function updateReleaseBundle() {
|
|
|
394713
394889
|
return;
|
|
394714
394890
|
}
|
|
394715
394891
|
cpSync(staged, bundleDir, { recursive: true, force: true });
|
|
394716
|
-
writeToStdout(source_default.green(`Successfully updated from ${{ VERSION: "0.2.
|
|
394892
|
+
writeToStdout(source_default.green(`Successfully updated from ${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}`) + `
|
|
394717
394893
|
`);
|
|
394718
394894
|
await regenerateCompletionCache();
|
|
394719
394895
|
} finally {
|
|
@@ -394726,7 +394902,7 @@ async function updateReleaseBundle() {
|
|
|
394726
394902
|
async function update() {
|
|
394727
394903
|
logEvent("tengu_update_check", {});
|
|
394728
394904
|
await updateNaupa();
|
|
394729
|
-
writeToStdout(`Current version: ${{ VERSION: "0.2.
|
|
394905
|
+
writeToStdout(`Current version: ${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}
|
|
394730
394906
|
`);
|
|
394731
394907
|
const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
|
|
394732
394908
|
writeToStdout(`Checking for updates to ${channel2} version...
|
|
@@ -394805,8 +394981,8 @@ async function update() {
|
|
|
394805
394981
|
writeToStdout(`Theus is managed by Homebrew.
|
|
394806
394982
|
`);
|
|
394807
394983
|
const latest = await getLatestVersion(channel2);
|
|
394808
|
-
if (latest && !gte({ VERSION: "0.2.
|
|
394809
|
-
writeToStdout(`Update available: ${{ VERSION: "0.2.
|
|
394984
|
+
if (latest && !gte({ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
|
|
394985
|
+
writeToStdout(`Update available: ${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}
|
|
394810
394986
|
`);
|
|
394811
394987
|
writeToStdout(`
|
|
394812
394988
|
`);
|
|
@@ -394822,8 +394998,8 @@ async function update() {
|
|
|
394822
394998
|
writeToStdout(`Theus is managed by winget.
|
|
394823
394999
|
`);
|
|
394824
395000
|
const latest = await getLatestVersion(channel2);
|
|
394825
|
-
if (latest && !gte({ VERSION: "0.2.
|
|
394826
|
-
writeToStdout(`Update available: ${{ VERSION: "0.2.
|
|
395001
|
+
if (latest && !gte({ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
|
|
395002
|
+
writeToStdout(`Update available: ${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}
|
|
394827
395003
|
`);
|
|
394828
395004
|
writeToStdout(`
|
|
394829
395005
|
`);
|
|
@@ -394839,8 +395015,8 @@ async function update() {
|
|
|
394839
395015
|
writeToStdout(`Theus is managed by apk.
|
|
394840
395016
|
`);
|
|
394841
395017
|
const latest = await getLatestVersion(channel2);
|
|
394842
|
-
if (latest && !gte({ VERSION: "0.2.
|
|
394843
|
-
writeToStdout(`Update available: ${{ VERSION: "0.2.
|
|
395018
|
+
if (latest && !gte({ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
|
|
395019
|
+
writeToStdout(`Update available: ${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}
|
|
394844
395020
|
`);
|
|
394845
395021
|
writeToStdout(`
|
|
394846
395022
|
`);
|
|
@@ -394905,11 +395081,11 @@ async function update() {
|
|
|
394905
395081
|
`);
|
|
394906
395082
|
await gracefulShutdown(1);
|
|
394907
395083
|
}
|
|
394908
|
-
if (result.latestVersion === { VERSION: "0.2.
|
|
394909
|
-
writeToStdout(source_default.green(`Theus is up to date (${{ VERSION: "0.2.
|
|
395084
|
+
if (result.latestVersion === { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION) {
|
|
395085
|
+
writeToStdout(source_default.green(`Theus is up to date (${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})`) + `
|
|
394910
395086
|
`);
|
|
394911
395087
|
} else {
|
|
394912
|
-
writeToStdout(source_default.green(`Successfully updated from ${{ VERSION: "0.2.
|
|
395088
|
+
writeToStdout(source_default.green(`Successfully updated from ${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}`) + `
|
|
394913
395089
|
`);
|
|
394914
395090
|
await regenerateCompletionCache();
|
|
394915
395091
|
}
|
|
@@ -394928,9 +395104,9 @@ async function update() {
|
|
|
394928
395104
|
await removeInstalledSymlink();
|
|
394929
395105
|
}
|
|
394930
395106
|
logForDebugging("update: Checking npm registry for latest version");
|
|
394931
|
-
logForDebugging(`update: Package URL: ${{ VERSION: "0.2.
|
|
395107
|
+
logForDebugging(`update: Package URL: ${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.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}`);
|
|
394932
395108
|
const npmTag = channel2 === "stable" ? "stable" : "latest";
|
|
394933
|
-
const npmCommand = `npm view ${{ VERSION: "0.2.
|
|
395109
|
+
const npmCommand = `npm view ${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.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`;
|
|
394934
395110
|
logForDebugging(`update: Running: ${npmCommand}`);
|
|
394935
395111
|
const latestVersion = await getLatestVersion(channel2);
|
|
394936
395112
|
logForDebugging(`update: Latest version from npm: ${latestVersion || "FAILED"}`);
|
|
@@ -394950,7 +395126,7 @@ async function update() {
|
|
|
394950
395126
|
`);
|
|
394951
395127
|
process.stderr.write(` \u2022 Corporate proxy/firewall blocking npm
|
|
394952
395128
|
`);
|
|
394953
|
-
if ({ VERSION: "0.2.
|
|
395129
|
+
if ({ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.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.25", BUILD_TIME: "1970-01-01T00:00:00.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")) {
|
|
394954
395130
|
process.stderr.write(` \u2022 Internal/development build not published to npm
|
|
394955
395131
|
`);
|
|
394956
395132
|
}
|
|
@@ -394962,19 +395138,19 @@ async function update() {
|
|
|
394962
395138
|
`);
|
|
394963
395139
|
process.stderr.write(` \u2022 Run with --debug flag for more details
|
|
394964
395140
|
`);
|
|
394965
|
-
const packageName = { VERSION: "0.2.
|
|
395141
|
+
const packageName = { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.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");
|
|
394966
395142
|
process.stderr.write(` \u2022 Manually check: npm view ${packageName} version
|
|
394967
395143
|
`);
|
|
394968
395144
|
process.stderr.write(` \u2022 Check if you need to login: npm whoami
|
|
394969
395145
|
`);
|
|
394970
395146
|
await gracefulShutdown(1);
|
|
394971
395147
|
}
|
|
394972
|
-
if (gte({ VERSION: "0.2.
|
|
394973
|
-
writeToStdout(source_default.green(`Theus is up to date (${{ VERSION: "0.2.
|
|
395148
|
+
if (gte({ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
|
|
395149
|
+
writeToStdout(source_default.green(`Theus is up to date (${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})`) + `
|
|
394974
395150
|
`);
|
|
394975
395151
|
await gracefulShutdown(0);
|
|
394976
395152
|
}
|
|
394977
|
-
writeToStdout(`New version available: ${latestVersion} (current: ${{ VERSION: "0.2.
|
|
395153
|
+
writeToStdout(`New version available: ${latestVersion} (current: ${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION})
|
|
394978
395154
|
`);
|
|
394979
395155
|
writeToStdout(`Installing update...
|
|
394980
395156
|
`);
|
|
@@ -395019,7 +395195,7 @@ async function update() {
|
|
|
395019
395195
|
logForDebugging(`update: Installation status: ${status2}`);
|
|
395020
395196
|
switch (status2) {
|
|
395021
395197
|
case "success":
|
|
395022
|
-
writeToStdout(source_default.green(`Successfully updated from ${{ VERSION: "0.2.
|
|
395198
|
+
writeToStdout(source_default.green(`Successfully updated from ${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}`) + `
|
|
395023
395199
|
`);
|
|
395024
395200
|
await regenerateCompletionCache();
|
|
395025
395201
|
break;
|
|
@@ -395029,7 +395205,7 @@ async function update() {
|
|
|
395029
395205
|
if (useLocalUpdate) {
|
|
395030
395206
|
process.stderr.write(`Try manually updating with:
|
|
395031
395207
|
`);
|
|
395032
|
-
process.stderr.write(` cd ~/.theus/local && npm update ${{ VERSION: "0.2.
|
|
395208
|
+
process.stderr.write(` cd ~/.theus/local && npm update ${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.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}
|
|
395033
395209
|
`);
|
|
395034
395210
|
} else {
|
|
395035
395211
|
process.stderr.write(`Try running with sudo or fix npm permissions
|
|
@@ -395045,7 +395221,7 @@ async function update() {
|
|
|
395045
395221
|
if (useLocalUpdate) {
|
|
395046
395222
|
process.stderr.write(`Try manually updating with:
|
|
395047
395223
|
`);
|
|
395048
|
-
process.stderr.write(` cd ~/.theus/local && npm update ${{ VERSION: "0.2.
|
|
395224
|
+
process.stderr.write(` cd ~/.theus/local && npm update ${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.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}
|
|
395049
395225
|
`);
|
|
395050
395226
|
} else {
|
|
395051
395227
|
process.stderr.write(`Or consider using native installation with: theus install
|
|
@@ -398597,6 +398773,107 @@ var init_agents_platform = __esm(() => {
|
|
|
398597
398773
|
agents_platform_default = _s24;
|
|
398598
398774
|
});
|
|
398599
398775
|
|
|
398776
|
+
// commands/proactive.js
|
|
398777
|
+
var exports_proactive2 = {};
|
|
398778
|
+
__export(exports_proactive2, {
|
|
398779
|
+
default: () => proactive_default
|
|
398780
|
+
});
|
|
398781
|
+
function statusLine() {
|
|
398782
|
+
if (!isProactiveActive())
|
|
398783
|
+
return "Modo proactivo: DESACTIVADO.";
|
|
398784
|
+
if (isProactivePaused())
|
|
398785
|
+
return "Modo proactivo: ACTIVO (en pausa).";
|
|
398786
|
+
return "Modo proactivo: ACTIVO.";
|
|
398787
|
+
}
|
|
398788
|
+
var ON_MESSAGE, call74 = async (args) => {
|
|
398789
|
+
const arg = (args ?? "").trim().toLowerCase();
|
|
398790
|
+
let value;
|
|
398791
|
+
switch (arg) {
|
|
398792
|
+
case "on":
|
|
398793
|
+
case "activar":
|
|
398794
|
+
case "start":
|
|
398795
|
+
if (isProactiveActive() && !isProactivePaused()) {
|
|
398796
|
+
value = "El modo proactivo ya estaba activo.";
|
|
398797
|
+
} else {
|
|
398798
|
+
activateProactive("command");
|
|
398799
|
+
value = ON_MESSAGE;
|
|
398800
|
+
}
|
|
398801
|
+
break;
|
|
398802
|
+
case "off":
|
|
398803
|
+
case "desactivar":
|
|
398804
|
+
case "stop":
|
|
398805
|
+
if (!isProactiveActive()) {
|
|
398806
|
+
value = "El modo proactivo ya estaba desactivado.";
|
|
398807
|
+
} else {
|
|
398808
|
+
deactivateProactive();
|
|
398809
|
+
value = "Modo proactivo DESACTIVADO. Vuelves al modo interactivo normal.";
|
|
398810
|
+
}
|
|
398811
|
+
break;
|
|
398812
|
+
case "pause":
|
|
398813
|
+
case "pausa":
|
|
398814
|
+
case "pausar":
|
|
398815
|
+
if (!isProactiveActive()) {
|
|
398816
|
+
value = "El modo proactivo no est\xE1 activo.";
|
|
398817
|
+
} else {
|
|
398818
|
+
pauseProactive();
|
|
398819
|
+
value = "Modo proactivo EN PAUSA. Usa /proactive resume para reanudar.";
|
|
398820
|
+
}
|
|
398821
|
+
break;
|
|
398822
|
+
case "resume":
|
|
398823
|
+
case "reanudar":
|
|
398824
|
+
if (!isProactiveActive()) {
|
|
398825
|
+
value = "El modo proactivo no est\xE1 activo.";
|
|
398826
|
+
} else {
|
|
398827
|
+
resumeProactive();
|
|
398828
|
+
value = "Modo proactivo REANUDADO.";
|
|
398829
|
+
}
|
|
398830
|
+
break;
|
|
398831
|
+
case "status":
|
|
398832
|
+
case "estado":
|
|
398833
|
+
value = statusLine();
|
|
398834
|
+
break;
|
|
398835
|
+
case "":
|
|
398836
|
+
case "toggle":
|
|
398837
|
+
if (isProactiveActive()) {
|
|
398838
|
+
deactivateProactive();
|
|
398839
|
+
value = "Modo proactivo DESACTIVADO. Vuelves al modo interactivo normal.";
|
|
398840
|
+
} else {
|
|
398841
|
+
activateProactive("command");
|
|
398842
|
+
value = ON_MESSAGE;
|
|
398843
|
+
}
|
|
398844
|
+
break;
|
|
398845
|
+
default:
|
|
398846
|
+
value = `Uso: /proactive [on|off|pause|resume|status]. ${statusLine()}`;
|
|
398847
|
+
break;
|
|
398848
|
+
}
|
|
398849
|
+
return { type: "text", value };
|
|
398850
|
+
}, proactive, proactive_default;
|
|
398851
|
+
var init_proactive2 = __esm(() => {
|
|
398852
|
+
init_proactive();
|
|
398853
|
+
init_proactiveEnabled();
|
|
398854
|
+
ON_MESSAGE = "Modo proactivo ACTIVADO. El agente trabajar\xE1 solo entre turnos: duerme y " + "despierta cuando haya trabajo o mensajes. La herramienta de espera queda " + "disponible. Escribe tu objetivo, o usa /proactive off para detenerlo.";
|
|
398855
|
+
proactive = {
|
|
398856
|
+
type: "local",
|
|
398857
|
+
name: "proactive",
|
|
398858
|
+
aliases: ["proactivo"],
|
|
398859
|
+
description: "Activa/desactiva el modo proactivo: el agente trabaja solo entre turnos (duerme y despierta cuando hay trabajo)",
|
|
398860
|
+
argumentHint: "[on|off|pause|resume|status]",
|
|
398861
|
+
isEnabled: () => {
|
|
398862
|
+
try {
|
|
398863
|
+
return isProactiveForced();
|
|
398864
|
+
} catch {
|
|
398865
|
+
return false;
|
|
398866
|
+
}
|
|
398867
|
+
},
|
|
398868
|
+
isHidden: false,
|
|
398869
|
+
userInvocable: true,
|
|
398870
|
+
disableModelInvocation: true,
|
|
398871
|
+
supportsNonInteractive: true,
|
|
398872
|
+
load: () => Promise.resolve({ call: call74 })
|
|
398873
|
+
};
|
|
398874
|
+
proactive_default = proactive;
|
|
398875
|
+
});
|
|
398876
|
+
|
|
398600
398877
|
// commands/brief.ts
|
|
398601
398878
|
var exports_brief = {};
|
|
398602
398879
|
__export(exports_brief, {
|
|
@@ -398781,7 +399058,7 @@ var exports_assistant = {};
|
|
|
398781
399058
|
__export(exports_assistant, {
|
|
398782
399059
|
installAssistant: () => installAssistant,
|
|
398783
399060
|
computeDefaultInstallDir: () => computeDefaultInstallDir,
|
|
398784
|
-
call: () =>
|
|
399061
|
+
call: () => call75,
|
|
398785
399062
|
NewInstallWizard: () => NewInstallWizard
|
|
398786
399063
|
});
|
|
398787
399064
|
import { existsSync as existsSync18, mkdirSync as mkdirSync10, readFileSync as readFileSync24, writeFileSync as writeFileSync8 } from "fs";
|
|
@@ -398938,7 +399215,7 @@ function AssistantCommandFlow({
|
|
|
398938
399215
|
onCancel: () => onDone()
|
|
398939
399216
|
});
|
|
398940
399217
|
}
|
|
398941
|
-
async function
|
|
399218
|
+
async function call75(onDone, _context, _args) {
|
|
398942
399219
|
return /* @__PURE__ */ jsx_runtime354.jsx(AssistantCommandFlow, {
|
|
398943
399220
|
onDone
|
|
398944
399221
|
});
|
|
@@ -399210,7 +399487,7 @@ function PeersPanel({ onDone }) {
|
|
|
399210
399487
|
]
|
|
399211
399488
|
});
|
|
399212
399489
|
}
|
|
399213
|
-
var import_react193, jsx_runtime355, KIND_LABELS,
|
|
399490
|
+
var import_react193, jsx_runtime355, KIND_LABELS, call76 = async (onDone) => {
|
|
399214
399491
|
return /* @__PURE__ */ jsx_runtime355.jsx(PeersPanel, {
|
|
399215
399492
|
onDone
|
|
399216
399493
|
});
|
|
@@ -399232,7 +399509,7 @@ var init_peers = __esm(() => {
|
|
|
399232
399509
|
name: "peers",
|
|
399233
399510
|
description: "Lista otras sesiones de Theus vivas en esta m\xE1quina",
|
|
399234
399511
|
isEnabled: () => isUdsInboxEnabled(),
|
|
399235
|
-
load: () => Promise.resolve({ call:
|
|
399512
|
+
load: () => Promise.resolve({ call: call76 })
|
|
399236
399513
|
};
|
|
399237
399514
|
peers_default = peers;
|
|
399238
399515
|
});
|
|
@@ -399911,7 +400188,7 @@ var init_sprites = __esm(() => {
|
|
|
399911
400188
|
// commands/buddy/buddy.tsx
|
|
399912
400189
|
var exports_buddy = {};
|
|
399913
400190
|
__export(exports_buddy, {
|
|
399914
|
-
call: () =>
|
|
400191
|
+
call: () => call77
|
|
399915
400192
|
});
|
|
399916
400193
|
async function generateSoul(bones, inspirationSeed) {
|
|
399917
400194
|
const especie = SPECIES_ES[bones.species];
|
|
@@ -400188,7 +400465,7 @@ function BuddyPanel({
|
|
|
400188
400465
|
]
|
|
400189
400466
|
});
|
|
400190
400467
|
}
|
|
400191
|
-
var import_react195, jsx_runtime357, HATCH_TIMEOUT_MS = 15000, TICK_MS2 = 400,
|
|
400468
|
+
var import_react195, jsx_runtime357, HATCH_TIMEOUT_MS = 15000, TICK_MS2 = 400, call77 = async (onDone, _context, args) => {
|
|
400192
400469
|
const arg = (args ?? "").trim().toLowerCase();
|
|
400193
400470
|
if (arg === "silencio" || arg === "silenciar" || arg === "mute") {
|
|
400194
400471
|
const config3 = getGlobalConfig();
|
|
@@ -400383,8 +400660,9 @@ function formatDescriptionWithSource(cmd) {
|
|
|
400383
400660
|
}
|
|
400384
400661
|
return `${cmd.description} (${getSettingSourceName(cmd.source)})`;
|
|
400385
400662
|
}
|
|
400386
|
-
var agentsPlatform,
|
|
400663
|
+
var agentsPlatform, proactive2, briefCommand, assistantCommand, bridge = null, remoteControlServerCommand = null, voiceCommand = null, forceSnip = null, workflowsCmd = null, webCmd = null, clearSkillIndexCache2 = null, subscribePr = null, ultraplan = null, peersCmd, forkCmd, buddy2, INTERNAL_ONLY_COMMANDS2, COMMANDS, builtInCommandNames, getWorkflowCommands = null, loadAllCommands, getSkillToolCommands, getSlashCommandToolSkills, REMOTE_SAFE_COMMANDS, BRIDGE_SAFE_COMMANDS;
|
|
400387
400664
|
var init_commands2 = __esm(() => {
|
|
400665
|
+
init_proactiveEnabled();
|
|
400388
400666
|
init_add_dir2();
|
|
400389
400667
|
init_autofix_pr();
|
|
400390
400668
|
init_backfill_sessions();
|
|
@@ -400490,6 +400768,7 @@ var init_commands2 = __esm(() => {
|
|
|
400490
400768
|
init_debug_tool_call();
|
|
400491
400769
|
init_constants();
|
|
400492
400770
|
agentsPlatform = process.env.USER_TYPE === "ant" ? (init_agents_platform(), __toCommonJS(exports_agents_platform)).default : null;
|
|
400771
|
+
proactive2 = isProactiveForced() ? (init_proactive2(), __toCommonJS(exports_proactive2)).default : null;
|
|
400493
400772
|
briefCommand = isKairosForced() || false || (init_briefEnabled(), __toCommonJS(exports_briefEnabled)).isBriefForced() ? (init_brief(), __toCommonJS(exports_brief)).default : null;
|
|
400494
400773
|
assistantCommand = isKairosForced() ? (init_assistant2(), __toCommonJS(exports_assistant2)).default : null;
|
|
400495
400774
|
peersCmd = (init_udsInboxEnabled(), __toCommonJS(exports_udsInboxEnabled)).isUdsInboxEnabled() ? (init_peers(), __toCommonJS(exports_peers)).default : null;
|
|
@@ -400589,7 +400868,7 @@ var init_commands2 = __esm(() => {
|
|
|
400589
400868
|
...webCmd ? [webCmd] : [],
|
|
400590
400869
|
...forkCmd ? [forkCmd] : [],
|
|
400591
400870
|
...buddy2 ? [buddy2] : [],
|
|
400592
|
-
...
|
|
400871
|
+
...proactive2 ? [proactive2] : [],
|
|
400593
400872
|
...briefCommand ? [briefCommand] : [],
|
|
400594
400873
|
...assistantCommand ? [assistantCommand] : [],
|
|
400595
400874
|
...bridge ? [bridge] : [],
|
|
@@ -403428,8 +403707,8 @@ function extractFirstPromptFromChunk(chunk2) {
|
|
|
403428
403707
|
if (bashInput)
|
|
403429
403708
|
return `! ${bashInput}`;
|
|
403430
403709
|
if (SKIP_FIRST_PROMPT_PATTERN.test(result)) {
|
|
403431
|
-
if (
|
|
403432
|
-
;
|
|
403710
|
+
if (isProactiveForced() && result.startsWith(`<${TICK_TAG}>`))
|
|
403711
|
+
hasTickMessages = true;
|
|
403433
403712
|
continue;
|
|
403434
403713
|
}
|
|
403435
403714
|
if (result.length > 200) {
|
|
@@ -403443,8 +403722,8 @@ function extractFirstPromptFromChunk(chunk2) {
|
|
|
403443
403722
|
}
|
|
403444
403723
|
if (firstCommandFallback)
|
|
403445
403724
|
return firstCommandFallback;
|
|
403446
|
-
if (
|
|
403447
|
-
;
|
|
403725
|
+
if (isProactiveForced() && hasTickMessages)
|
|
403726
|
+
return "Proactive session";
|
|
403448
403727
|
return "";
|
|
403449
403728
|
}
|
|
403450
403729
|
function extractJsonStringFieldPrefix(text, key, maxLen) {
|
|
@@ -403571,6 +403850,7 @@ async function enrichLogs(allLogs, startIndex, count4) {
|
|
|
403571
403850
|
}
|
|
403572
403851
|
var VERSION4, MAX_TOMBSTONE_REWRITE_BYTES, SKIP_FIRST_PROMPT_PATTERN, EPHEMERAL_PROGRESS_TYPES, MAX_TRANSCRIPT_READ_BYTES, agentTranscriptSubdirs, getProjectDir2, project = null, cleanupRegistered4 = false, REMOTE_FLUSH_INTERVAL_MS = 10, METADATA_TYPE_MARKERS, METADATA_MARKER_BUFS, METADATA_PREFIX_BOUND = 25, getSessionMessages, INITIAL_ENRICH_COUNT = 50;
|
|
403573
403852
|
var init_sessionStorage = __esm(() => {
|
|
403853
|
+
init_proactiveEnabled();
|
|
403574
403854
|
init_memoize();
|
|
403575
403855
|
init_analytics();
|
|
403576
403856
|
init_state();
|
|
@@ -403600,14 +403880,14 @@ var init_sessionStorage = __esm(() => {
|
|
|
403600
403880
|
init_settings2();
|
|
403601
403881
|
init_slowOperations();
|
|
403602
403882
|
init_uuid();
|
|
403603
|
-
VERSION4 = { VERSION: "0.2.
|
|
403883
|
+
VERSION4 = { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
|
|
403604
403884
|
MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
|
|
403605
403885
|
SKIP_FIRST_PROMPT_PATTERN = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
|
|
403606
403886
|
EPHEMERAL_PROGRESS_TYPES = new Set([
|
|
403607
403887
|
"bash_progress",
|
|
403608
403888
|
"powershell_progress",
|
|
403609
403889
|
"mcp_progress",
|
|
403610
|
-
...[]
|
|
403890
|
+
...isProactiveForced() ? ["sleep_progress"] : []
|
|
403611
403891
|
]);
|
|
403612
403892
|
MAX_TRANSCRIPT_READ_BYTES = 50 * 1024 * 1024;
|
|
403613
403893
|
agentTranscriptSubdirs = new Map;
|
|
@@ -404805,7 +405085,7 @@ var init_filesystem = __esm(() => {
|
|
|
404805
405085
|
});
|
|
404806
405086
|
getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
|
|
404807
405087
|
const nonce = randomBytes21(16).toString("hex");
|
|
404808
|
-
return join148(getTheusTempDir(), "bundled-skills", { VERSION: "0.2.
|
|
405088
|
+
return join148(getTheusTempDir(), "bundled-skills", { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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);
|
|
404809
405089
|
});
|
|
404810
405090
|
getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
|
|
404811
405091
|
});
|
|
@@ -408768,19 +409048,19 @@ async function executeStatusLineCommand(statusLineInput, signal, timeoutMs = 500
|
|
|
408768
409048
|
logForDebugging(`Skipping StatusLine command execution - workspace trust not accepted`);
|
|
408769
409049
|
return;
|
|
408770
409050
|
}
|
|
408771
|
-
let
|
|
409051
|
+
let statusLine2;
|
|
408772
409052
|
if (shouldAllowManagedHooksOnly()) {
|
|
408773
|
-
|
|
409053
|
+
statusLine2 = getSettingsForSource("policySettings")?.statusLine;
|
|
408774
409054
|
} else {
|
|
408775
|
-
|
|
409055
|
+
statusLine2 = getSettings_DEPRECATED()?.statusLine;
|
|
408776
409056
|
}
|
|
408777
|
-
if (!
|
|
409057
|
+
if (!statusLine2 || statusLine2.type !== "command") {
|
|
408778
409058
|
return;
|
|
408779
409059
|
}
|
|
408780
409060
|
const abortSignal = signal || AbortSignal.timeout(timeoutMs);
|
|
408781
409061
|
try {
|
|
408782
409062
|
const jsonInput = jsonStringify(statusLineInput);
|
|
408783
|
-
const result = await execCommandHook(
|
|
409063
|
+
const result = await execCommandHook(statusLine2, "StatusLine", "statusLine", jsonInput, abortSignal, randomUUID31());
|
|
408784
409064
|
if (result.aborted) {
|
|
408785
409065
|
return;
|
|
408786
409066
|
}
|
|
@@ -408790,12 +409070,12 @@ async function executeStatusLineCommand(statusLineInput, signal, timeoutMs = 500
|
|
|
408790
409070
|
`);
|
|
408791
409071
|
if (output) {
|
|
408792
409072
|
if (logResult2) {
|
|
408793
|
-
logForDebugging(`StatusLine [${
|
|
409073
|
+
logForDebugging(`StatusLine [${statusLine2.command}] completed with status ${result.status}`);
|
|
408794
409074
|
}
|
|
408795
409075
|
return output;
|
|
408796
409076
|
}
|
|
408797
409077
|
} else if (logResult2) {
|
|
408798
|
-
logForDebugging(`StatusLine [${
|
|
409078
|
+
logForDebugging(`StatusLine [${statusLine2.command}] completed with status ${result.status}`, { level: "warn" });
|
|
408799
409079
|
}
|
|
408800
409080
|
return;
|
|
408801
409081
|
} catch (error40) {
|
|
@@ -409920,6 +410200,10 @@ import { type as osType2, version as osVersion, release as osRelease2 } from "os
|
|
|
409920
410200
|
function getHooksSection() {
|
|
409921
410201
|
return `Users may configure 'hooks', shell commands that execute in response to events like tool calls, in settings. Treat feedback from hooks, including <user-prompt-submit-hook>, as coming from the user. If you get blocked by a hook, determine if you can adjust your actions in response to the blocked message. If not, ask the user to check their hooks configuration.`;
|
|
409922
410202
|
}
|
|
410203
|
+
function getSystemRemindersSection() {
|
|
410204
|
+
return `- Tool results and user messages may include <system-reminder> tags. <system-reminder> tags contain useful information and reminders. They are automatically added by the system, and bear no direct relation to the specific tool results or user messages in which they appear.
|
|
410205
|
+
- The conversation has unlimited context through automatic summarization.`;
|
|
410206
|
+
}
|
|
409923
410207
|
function getInternalModelOverrideSection() {
|
|
409924
410208
|
if (process.env.USER_TYPE !== "ant")
|
|
409925
410209
|
return null;
|
|
@@ -409980,7 +410264,7 @@ function getSimpleDoingTasksSection() {
|
|
|
409980
410264
|
];
|
|
409981
410265
|
const userHelpSubitems = [
|
|
409982
410266
|
`/help: Get help with using Theus`,
|
|
409983
|
-
`To give feedback, users should ${{ VERSION: "0.2.
|
|
410267
|
+
`To give feedback, users should ${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.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}`
|
|
409984
410268
|
];
|
|
409985
410269
|
const items = [
|
|
409986
410270
|
`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.`,
|
|
@@ -410135,7 +410419,24 @@ Date: ${getSessionStartDate()}`
|
|
|
410135
410419
|
]);
|
|
410136
410420
|
const settings = getInitialSettings();
|
|
410137
410421
|
const enabledTools = new Set(tools.map((_) => _.name));
|
|
410138
|
-
if (
|
|
410422
|
+
if (isProactiveForced() && proactiveModule6?.isProactiveActive()) {
|
|
410423
|
+
logForDebugging(`[SystemPrompt] path=simple-proactive`);
|
|
410424
|
+
return [
|
|
410425
|
+
`
|
|
410426
|
+
You are an autonomous agent. Use the available tools to do useful work.
|
|
410427
|
+
|
|
410428
|
+
${CYBER_RISK_INSTRUCTION}`,
|
|
410429
|
+
getSystemRemindersSection(),
|
|
410430
|
+
await loadMemoryPrompt(),
|
|
410431
|
+
envInfo,
|
|
410432
|
+
getLanguageSection(settings.language),
|
|
410433
|
+
isMcpInstructionsDeltaEnabled() ? null : getMcpInstructionsSection(mcpClients),
|
|
410434
|
+
getScratchpadInstructions(),
|
|
410435
|
+
getFunctionResultClearingSection(model),
|
|
410436
|
+
SUMMARIZE_TOOL_RESULTS_SECTION,
|
|
410437
|
+
getProactiveSection()
|
|
410438
|
+
].filter((s) => s !== null);
|
|
410439
|
+
}
|
|
410139
410440
|
const dynamicSections = [
|
|
410140
410441
|
systemPromptSection("session_guidance", () => getSessionSpecificGuidanceSection(enabledTools, skillToolCommands)),
|
|
410141
410442
|
systemPromptSection("memory", () => loadMemoryPrompt()),
|
|
@@ -410318,8 +410619,67 @@ function getFunctionResultClearingSection(model) {
|
|
|
410318
410619
|
|
|
410319
410620
|
Old tool results will be automatically cleared from context to free up space. The ${config3.keepRecent} most recent results are always kept.`;
|
|
410320
410621
|
}
|
|
410321
|
-
|
|
410622
|
+
function getProactiveSection() {
|
|
410623
|
+
if (!isProactiveForced())
|
|
410624
|
+
return null;
|
|
410625
|
+
if (!proactiveModule6?.isProactiveActive())
|
|
410626
|
+
return null;
|
|
410627
|
+
return `# Autonomous work
|
|
410628
|
+
|
|
410629
|
+
You are running autonomously. You will receive \`<${TICK_TAG}>\` prompts that keep you alive between turns \u2014 just treat them as "you're awake, what now?" The time in each \`<${TICK_TAG}>\` is the user's current local time. Use it to judge the time of day \u2014 timestamps from external tools (Slack, GitHub, etc.) may be in a different timezone.
|
|
410630
|
+
|
|
410631
|
+
Multiple ticks may be batched into a single message. This is normal \u2014 just process the latest one. Never echo or repeat tick content in your response.
|
|
410632
|
+
|
|
410633
|
+
## Pacing
|
|
410634
|
+
|
|
410635
|
+
Use the ${SLEEP_TOOL_NAME} tool to control how long you wait between actions. Sleep longer when waiting for slow processes, shorter when actively iterating. Each wake-up costs an API call, but the prompt cache expires after 5 minutes of inactivity \u2014 balance accordingly.
|
|
410636
|
+
|
|
410637
|
+
**If you have nothing useful to do on a tick, you MUST call ${SLEEP_TOOL_NAME}.** Never respond with only a status message like "still waiting" or "nothing to do" \u2014 that wastes a turn and burns tokens for no reason.
|
|
410638
|
+
|
|
410639
|
+
## First wake-up
|
|
410640
|
+
|
|
410641
|
+
On your very first tick in a new session, greet the user briefly and ask what they'd like to work on. Do not start exploring the codebase or making changes unprompted \u2014 wait for direction.
|
|
410642
|
+
|
|
410643
|
+
## What to do on subsequent wake-ups
|
|
410644
|
+
|
|
410645
|
+
Look for useful work. A good colleague faced with ambiguity doesn't just stop \u2014 they investigate, reduce risk, and build understanding. Ask yourself: what don't I know yet? What could go wrong? What would I want to verify before calling this done?
|
|
410646
|
+
|
|
410647
|
+
Do not spam the user. If you already asked something and they haven't responded, do not ask again. Do not narrate what you're about to do \u2014 just do it.
|
|
410648
|
+
|
|
410649
|
+
If a tick arrives and you have no useful action to take (no files to read, no commands to run, no decisions to make), call ${SLEEP_TOOL_NAME} immediately. Do not output text narrating that you're idle \u2014 the user doesn't need "still waiting" messages.
|
|
410650
|
+
|
|
410651
|
+
## Staying responsive
|
|
410652
|
+
|
|
410653
|
+
When the user is actively engaging with you, check for and respond to their messages frequently. Treat real-time conversations like pairing \u2014 keep the feedback loop tight. If you sense the user is waiting on you (e.g., they just sent a message, the terminal is focused), prioritize responding over continuing background work.
|
|
410654
|
+
|
|
410655
|
+
## Bias toward action
|
|
410656
|
+
|
|
410657
|
+
Act on your best judgment rather than asking for confirmation.
|
|
410658
|
+
|
|
410659
|
+
- Read files, search code, explore the project, run tests, check types, run linters \u2014 all without asking.
|
|
410660
|
+
- Make code changes. Commit when you reach a good stopping point.
|
|
410661
|
+
- If you're unsure between two reasonable approaches, pick one and go. You can always course-correct.
|
|
410662
|
+
|
|
410663
|
+
## Be concise
|
|
410664
|
+
|
|
410665
|
+
Keep your text output brief and high-level. The user does not need a play-by-play of your thought process or implementation details \u2014 they can see your tool calls. Focus text output on:
|
|
410666
|
+
- Decisions that need the user's input
|
|
410667
|
+
- High-level status updates at natural milestones (e.g., "PR created", "tests passing")
|
|
410668
|
+
- Errors or blockers that change the plan
|
|
410669
|
+
|
|
410670
|
+
Do not narrate each step, list every file you read, or explain routine actions. If you can say it in one sentence, don't use three.
|
|
410671
|
+
|
|
410672
|
+
## Terminal focus
|
|
410673
|
+
|
|
410674
|
+
The user context may include a \`terminalFocus\` field indicating whether the user's terminal is focused or unfocused. Use this to calibrate how autonomous you are:
|
|
410675
|
+
- **Unfocused**: The user is away. Lean heavily into autonomous action \u2014 make decisions, explore, commit, push. Only pause for genuinely irreversible or high-risk actions.
|
|
410676
|
+
- **Focused**: The user is watching. Be more collaborative \u2014 surface choices, ask before committing to large changes, and keep your output concise so it's easy to follow in real time.${BRIEF_PROACTIVE_SECTION2 && briefToolModule?.isBriefEnabled() ? `
|
|
410677
|
+
|
|
410678
|
+
${BRIEF_PROACTIVE_SECTION2}` : ""}`;
|
|
410679
|
+
}
|
|
410680
|
+
var getCachedMCConfigForFRC = null, proactiveModule6, BRIEF_PROACTIVE_SECTION2 = null, briefToolModule = null, DISCOVER_SKILLS_TOOL_NAME = null, SYSTEM_PROMPT_DYNAMIC_BOUNDARY = "__SYSTEM_PROMPT_DYNAMIC_BOUNDARY__", FRONTIER_MODEL_NAME = "Theus Opus 4.6", THEUS_4_5_OR_4_6_MODEL_IDS, DEFAULT_AGENT_PROMPT = `You are an agent for Theus, Theus's official CLI for Theus. Given the user's message, you should use the tools available to complete the task. Complete the task fully\u2014don't gold-plate, but don't leave it half-done. When you complete the task, respond with a concise report covering what was done and any key findings \u2014 the caller will relay this to the user, so it only needs the essentials.`, SUMMARIZE_TOOL_RESULTS_SECTION = `When working with tool results, write down any important information you might need later in your response, as the original tool result may be cleared later.`;
|
|
410322
410681
|
var init_prompts4 = __esm(() => {
|
|
410682
|
+
init_proactiveEnabled();
|
|
410323
410683
|
init_env();
|
|
410324
410684
|
init_git();
|
|
410325
410685
|
init_cwd2();
|
|
@@ -410352,6 +410712,7 @@ var init_prompts4 = __esm(() => {
|
|
|
410352
410712
|
init_undercover();
|
|
410353
410713
|
init_mcpInstructionsDelta();
|
|
410354
410714
|
init_internalModels();
|
|
410715
|
+
proactiveModule6 = isProactiveForced() ? (init_proactive(), __toCommonJS(exports_proactive)) : null;
|
|
410355
410716
|
THEUS_4_5_OR_4_6_MODEL_IDS = {
|
|
410356
410717
|
opus: "theus-opus-4-6",
|
|
410357
410718
|
sonnet: "theus-sonnet-4-6",
|
|
@@ -410803,7 +411164,7 @@ function computeFingerprint(messageText, version3) {
|
|
|
410803
411164
|
}
|
|
410804
411165
|
function computeFingerprintFromMessages(messages) {
|
|
410805
411166
|
const firstMessageText = extractFirstMessageText(messages);
|
|
410806
|
-
return computeFingerprint(firstMessageText, { VERSION: "0.2.
|
|
411167
|
+
return computeFingerprint(firstMessageText, { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
|
|
410807
411168
|
}
|
|
410808
411169
|
var FINGERPRINT_SALT = "59cf53e54c78";
|
|
410809
411170
|
var init_fingerprint = () => {};
|
|
@@ -412900,10 +413261,10 @@ function blocksFromOpenAIMessage(message) {
|
|
|
412900
413261
|
}
|
|
412901
413262
|
}
|
|
412902
413263
|
if (Array.isArray(message.tool_calls)) {
|
|
412903
|
-
for (const
|
|
412904
|
-
if (!
|
|
413264
|
+
for (const call78 of message.tool_calls) {
|
|
413265
|
+
if (!call78 || typeof call78 !== "object")
|
|
412905
413266
|
continue;
|
|
412906
|
-
const typed =
|
|
413267
|
+
const typed = call78;
|
|
412907
413268
|
const name = typed.function?.name;
|
|
412908
413269
|
if (!name)
|
|
412909
413270
|
continue;
|
|
@@ -413351,7 +413712,7 @@ async function sideQuery(opts) {
|
|
|
413351
413712
|
betas.push(STRUCTURED_OUTPUTS_BETA_HEADER);
|
|
413352
413713
|
}
|
|
413353
413714
|
const messageText = extractFirstUserMessageText(messages);
|
|
413354
|
-
const fingerprint = computeFingerprint(messageText, { VERSION: "0.2.
|
|
413715
|
+
const fingerprint = computeFingerprint(messageText, { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION);
|
|
413355
413716
|
const attributionHeader = getAttributionHeader(fingerprint);
|
|
413356
413717
|
const systemBlocks = [
|
|
413357
413718
|
attributionHeader ? { type: "text", text: attributionHeader } : null,
|
|
@@ -414654,7 +415015,7 @@ async function handleMemories(state) {
|
|
|
414654
415015
|
async function runProjectContextMcpServer() {
|
|
414655
415016
|
const projectRoot = process.env.THEUS_PROJECT_ROOT || process.cwd();
|
|
414656
415017
|
const state = new ProjectContextState(projectRoot);
|
|
414657
|
-
const server2 = new Server({ name: SERVER_NAME, version: { VERSION: "0.2.
|
|
415018
|
+
const server2 = new Server({ name: SERVER_NAME, version: { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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: {} } });
|
|
414658
415019
|
server2.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
414659
415020
|
tools: TOOL_DEFINITIONS.map((t) => ({
|
|
414660
415021
|
name: t.name,
|
|
@@ -416634,7 +416995,7 @@ function createBridgeLogger(options2) {
|
|
|
416634
416995
|
connectUrl = buildBridgeConnectUrl(environmentId, cachedIngressUrl);
|
|
416635
416996
|
regenerateQr(connectUrl);
|
|
416636
416997
|
if (verbose) {
|
|
416637
|
-
write(source_default.dim(`Remote Control`) + ` v${{ VERSION: "0.2.
|
|
416998
|
+
write(source_default.dim(`Remote Control`) + ` v${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION}
|
|
416638
416999
|
`);
|
|
416639
417000
|
}
|
|
416640
417001
|
if (verbose) {
|
|
@@ -416767,10 +417128,10 @@ function createBridgeLogger(options2) {
|
|
|
416767
417128
|
qrVisible = !qrVisible;
|
|
416768
417129
|
renderStatusLine();
|
|
416769
417130
|
},
|
|
416770
|
-
updateSessionCount(
|
|
416771
|
-
if (sessionActive ===
|
|
417131
|
+
updateSessionCount(active2, max2, mode) {
|
|
417132
|
+
if (sessionActive === active2 && sessionMax === max2 && spawnMode === mode)
|
|
416772
417133
|
return;
|
|
416773
|
-
sessionActive =
|
|
417134
|
+
sessionActive = active2;
|
|
416774
417135
|
sessionMax = max2;
|
|
416775
417136
|
spawnMode = mode;
|
|
416776
417137
|
},
|
|
@@ -417607,7 +417968,7 @@ function appendToLog(path19, message) {
|
|
|
417607
417968
|
cwd: getFsImplementation().cwd(),
|
|
417608
417969
|
userType: process.env.USER_TYPE,
|
|
417609
417970
|
sessionId: getSessionId(),
|
|
417610
|
-
version: { VERSION: "0.2.
|
|
417971
|
+
version: { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
417611
417972
|
};
|
|
417612
417973
|
getLogWriter(path19).write(messageWithTimestamp);
|
|
417613
417974
|
}
|
|
@@ -418877,7 +419238,7 @@ Spawn mode for this project:
|
|
|
418877
419238
|
const api2 = createBridgeApiClient({
|
|
418878
419239
|
baseUrl,
|
|
418879
419240
|
getAccessToken: getBridgeAccessToken2,
|
|
418880
|
-
runnerVersion: { VERSION: "0.2.
|
|
419241
|
+
runnerVersion: { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
418881
419242
|
onDebug: logForDebugging,
|
|
418882
419243
|
onAuth401: handleOAuth401Error2,
|
|
418883
419244
|
getTrustedDeviceToken
|
|
@@ -419115,7 +419476,7 @@ async function runBridgeHeadless(opts, signal) {
|
|
|
419115
419476
|
const api2 = createBridgeApiClient({
|
|
419116
419477
|
baseUrl,
|
|
419117
419478
|
getAccessToken: opts.getAccessToken,
|
|
419118
|
-
runnerVersion: { VERSION: "0.2.
|
|
419479
|
+
runnerVersion: { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
419119
419480
|
onDebug: log2,
|
|
419120
419481
|
onAuth401: opts.onAuth401,
|
|
419121
419482
|
getTrustedDeviceToken
|
|
@@ -423179,7 +423540,7 @@ function buildSystemInitMessage(inputs) {
|
|
|
423179
423540
|
slash_commands: inputs.commands.filter((c5) => c5.userInvocable !== false).map((c5) => c5.name),
|
|
423180
423541
|
apiKeySource: getTheusApiKeyWithSource().source,
|
|
423181
423542
|
betas: getSdkBetas(),
|
|
423182
|
-
theus_code_version: { VERSION: "0.2.
|
|
423543
|
+
theus_code_version: { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
423183
423544
|
output_style: outputStyle2,
|
|
423184
423545
|
agents: inputs.agents.map((agent) => agent.agentType),
|
|
423185
423546
|
skills: inputs.skills.filter((s) => s.userInvocable !== false).map((skill) => skill.name),
|
|
@@ -423219,8 +423580,8 @@ async function getEnvLessBridgeConfig() {
|
|
|
423219
423580
|
}
|
|
423220
423581
|
async function checkEnvLessBridgeMinVersion() {
|
|
423221
423582
|
const cfg = await getEnvLessBridgeConfig();
|
|
423222
|
-
if (cfg.min_version && lt({ VERSION: "0.2.
|
|
423223
|
-
return `Your version of Theus (${{ VERSION: "0.2.
|
|
423583
|
+
if (cfg.min_version && lt({ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
|
|
423584
|
+
return `Your version of Theus (${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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.
|
|
423224
423585
|
Version ${cfg.min_version} or higher is required. Run \`theus update\` to update.`;
|
|
423225
423586
|
}
|
|
423226
423587
|
return null;
|
|
@@ -425543,7 +425904,7 @@ async function initBridgeCore(params) {
|
|
|
425543
425904
|
const rawApi = createBridgeApiClient({
|
|
425544
425905
|
baseUrl,
|
|
425545
425906
|
getAccessToken,
|
|
425546
|
-
runnerVersion: { VERSION: "0.2.
|
|
425907
|
+
runnerVersion: { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
425547
425908
|
onDebug: logForDebugging,
|
|
425548
425909
|
onAuth401,
|
|
425549
425910
|
getTrustedDeviceToken
|
|
@@ -427405,7 +427766,7 @@ __export(exports_inboundAttachments, {
|
|
|
427405
427766
|
import { randomUUID as randomUUID40 } from "crypto";
|
|
427406
427767
|
import { mkdir as mkdir51, writeFile as writeFile52 } from "fs/promises";
|
|
427407
427768
|
import { basename as basename48, join as join162 } from "path";
|
|
427408
|
-
function
|
|
427769
|
+
function debug2(msg) {
|
|
427409
427770
|
logForDebugging(`[bridge:inbound-attach] ${msg}`);
|
|
427410
427771
|
}
|
|
427411
427772
|
function extractInboundAttachments(msg) {
|
|
@@ -427425,7 +427786,7 @@ function uploadsDir() {
|
|
|
427425
427786
|
async function resolveOne(att) {
|
|
427426
427787
|
const token = getBridgeAccessToken();
|
|
427427
427788
|
if (!token) {
|
|
427428
|
-
|
|
427789
|
+
debug2("skip: no oauth token");
|
|
427429
427790
|
return;
|
|
427430
427791
|
}
|
|
427431
427792
|
let data;
|
|
@@ -427438,12 +427799,12 @@ async function resolveOne(att) {
|
|
|
427438
427799
|
validateStatus: () => true
|
|
427439
427800
|
});
|
|
427440
427801
|
if (response.status !== 200) {
|
|
427441
|
-
|
|
427802
|
+
debug2(`fetch ${att.file_uuid} failed: status=${response.status}`);
|
|
427442
427803
|
return;
|
|
427443
427804
|
}
|
|
427444
427805
|
data = Buffer.from(response.data);
|
|
427445
427806
|
} catch (e) {
|
|
427446
|
-
|
|
427807
|
+
debug2(`fetch ${att.file_uuid} threw: ${e}`);
|
|
427447
427808
|
return;
|
|
427448
427809
|
}
|
|
427449
427810
|
const safeName = sanitizeFileName(att.file_name);
|
|
@@ -427454,16 +427815,16 @@ async function resolveOne(att) {
|
|
|
427454
427815
|
await mkdir51(dir, { recursive: true });
|
|
427455
427816
|
await writeFile52(outPath, data);
|
|
427456
427817
|
} catch (e) {
|
|
427457
|
-
|
|
427818
|
+
debug2(`write ${outPath} failed: ${e}`);
|
|
427458
427819
|
return;
|
|
427459
427820
|
}
|
|
427460
|
-
|
|
427821
|
+
debug2(`resolved ${att.file_uuid} \u2192 ${outPath} (${data.length} bytes)`);
|
|
427461
427822
|
return outPath;
|
|
427462
427823
|
}
|
|
427463
427824
|
async function resolveInboundAttachments(attachments) {
|
|
427464
427825
|
if (attachments.length === 0)
|
|
427465
427826
|
return "";
|
|
427466
|
-
|
|
427827
|
+
debug2(`resolving ${attachments.length} attachment(s)`);
|
|
427467
427828
|
const paths2 = await Promise.all(attachments.map(resolveOne));
|
|
427468
427829
|
const ok = paths2.filter((p) => p !== undefined);
|
|
427469
427830
|
if (ok.length === 0)
|
|
@@ -442118,7 +442479,7 @@ var init_useVoiceEnabled = __esm(() => {
|
|
|
442118
442479
|
function getSemverPart(version3) {
|
|
442119
442480
|
return `${import_semver14.major(version3, { loose: true })}.${import_semver14.minor(version3, { loose: true })}.${import_semver14.patch(version3, { loose: true })}`;
|
|
442120
442481
|
}
|
|
442121
|
-
function useUpdateNotification(updatedVersion, initialVersion = { VERSION: "0.2.
|
|
442482
|
+
function useUpdateNotification(updatedVersion, initialVersion = { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION) {
|
|
442122
442483
|
const [lastNotifiedSemver, setLastNotifiedSemver] = import_react228.useState(() => getSemverPart(initialVersion));
|
|
442123
442484
|
if (!updatedVersion) {
|
|
442124
442485
|
return null;
|
|
@@ -442158,7 +442519,7 @@ function AutoUpdater({
|
|
|
442158
442519
|
return;
|
|
442159
442520
|
}
|
|
442160
442521
|
if (false) {}
|
|
442161
|
-
const currentVersion = { VERSION: "0.2.
|
|
442522
|
+
const currentVersion = { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
|
|
442162
442523
|
const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
|
|
442163
442524
|
let latestVersion = await getLatestVersion(channel2);
|
|
442164
442525
|
const isDisabled2 = isAutoUpdaterDisabled();
|
|
@@ -442294,7 +442655,7 @@ function AutoUpdater({
|
|
|
442294
442655
|
" ",
|
|
442295
442656
|
/* @__PURE__ */ jsx_runtime401.jsx(ThemedText, {
|
|
442296
442657
|
bold: true,
|
|
442297
|
-
children: hasLocalInstall ? `cd ~/.theus/local && npm update ${{ VERSION: "0.2.
|
|
442658
|
+
children: hasLocalInstall ? `cd ~/.theus/local && npm update ${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.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.25", BUILD_TIME: "1970-01-01T00:00:00.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}`
|
|
442298
442659
|
})
|
|
442299
442660
|
]
|
|
442300
442661
|
})
|
|
@@ -442371,12 +442732,12 @@ function NativeAutoUpdater({
|
|
|
442371
442732
|
logEvent("tengu_native_auto_updater_start", {});
|
|
442372
442733
|
try {
|
|
442373
442734
|
const maxVersion = await getMaxVersion();
|
|
442374
|
-
if (maxVersion && gt({ VERSION: "0.2.
|
|
442735
|
+
if (maxVersion && gt({ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
|
|
442375
442736
|
const msg = await getMaxVersionMessage();
|
|
442376
442737
|
setMaxVersionIssue(msg ?? "affects your version");
|
|
442377
442738
|
}
|
|
442378
442739
|
const result = await installLatest(channel2);
|
|
442379
|
-
const currentVersion = { VERSION: "0.2.
|
|
442740
|
+
const currentVersion = { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION;
|
|
442380
442741
|
const latencyMs = Date.now() - startTime2;
|
|
442381
442742
|
if (result.lockFailed) {
|
|
442382
442743
|
logEvent("tengu_native_auto_updater_lock_contention", {
|
|
@@ -442513,17 +442874,17 @@ function PackageManagerAutoUpdater(t0) {
|
|
|
442513
442874
|
const maxVersion = await getMaxVersion();
|
|
442514
442875
|
if (maxVersion && latest && gt(latest, maxVersion)) {
|
|
442515
442876
|
logForDebugging(`PackageManagerAutoUpdater: maxVersion ${maxVersion} is set, capping update from ${latest} to ${maxVersion}`);
|
|
442516
|
-
if (gte({ VERSION: "0.2.
|
|
442517
|
-
logForDebugging(`PackageManagerAutoUpdater: current version ${{ VERSION: "0.2.
|
|
442877
|
+
if (gte({ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)) {
|
|
442878
|
+
logForDebugging(`PackageManagerAutoUpdater: current version ${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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`);
|
|
442518
442879
|
setUpdateAvailable(false);
|
|
442519
442880
|
return;
|
|
442520
442881
|
}
|
|
442521
442882
|
latest = maxVersion;
|
|
442522
442883
|
}
|
|
442523
|
-
const hasUpdate = latest && !gte({ VERSION: "0.2.
|
|
442884
|
+
const hasUpdate = latest && !gte({ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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);
|
|
442524
442885
|
setUpdateAvailable(!!hasUpdate);
|
|
442525
442886
|
if (hasUpdate) {
|
|
442526
|
-
logForDebugging(`PackageManagerAutoUpdater: Update available ${{ VERSION: "0.2.
|
|
442887
|
+
logForDebugging(`PackageManagerAutoUpdater: Update available ${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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}`);
|
|
442527
442888
|
}
|
|
442528
442889
|
};
|
|
442529
442890
|
$2[0] = t1;
|
|
@@ -442557,7 +442918,7 @@ function PackageManagerAutoUpdater(t0) {
|
|
|
442557
442918
|
wrap: "truncate",
|
|
442558
442919
|
children: [
|
|
442559
442920
|
"currentVersion: ",
|
|
442560
|
-
{ VERSION: "0.2.
|
|
442921
|
+
{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
442561
442922
|
]
|
|
442562
442923
|
});
|
|
442563
442924
|
$2[3] = verbose;
|
|
@@ -443041,7 +443402,7 @@ function Notifications(t0) {
|
|
|
443041
443402
|
const {
|
|
443042
443403
|
apiKeyStatus,
|
|
443043
443404
|
autoUpdaterResult,
|
|
443044
|
-
debug:
|
|
443405
|
+
debug: debug3,
|
|
443045
443406
|
isAutoUpdating,
|
|
443046
443407
|
verbose,
|
|
443047
443408
|
messages,
|
|
@@ -443167,7 +443528,7 @@ function Notifications(t0) {
|
|
|
443167
443528
|
const t11 = isNarrow ? "flex-start" : "flex-end";
|
|
443168
443529
|
const t12 = isInOverageMode ?? false;
|
|
443169
443530
|
let t13;
|
|
443170
|
-
if ($2[15] !== apiKeyStatus || $2[16] !== autoUpdaterResult || $2[17] !==
|
|
443531
|
+
if ($2[15] !== apiKeyStatus || $2[16] !== autoUpdaterResult || $2[17] !== debug3 || $2[18] !== ideSelection || $2[19] !== isAutoUpdating || $2[20] !== isShowingCompactMessage || $2[21] !== mainLoopModel || $2[22] !== mcpClients || $2[23] !== notifications || $2[24] !== onAutoUpdaterResult || $2[25] !== onChangeIsUpdating || $2[26] !== shouldShowAutoUpdater || $2[27] !== t12 || $2[28] !== tokenUsage || $2[29] !== verbose) {
|
|
443171
443532
|
t13 = /* @__PURE__ */ jsx_runtime409.jsx(NotificationContent, {
|
|
443172
443533
|
ideSelection,
|
|
443173
443534
|
mcpClients,
|
|
@@ -443175,7 +443536,7 @@ function Notifications(t0) {
|
|
|
443175
443536
|
isInOverageMode: t12,
|
|
443176
443537
|
isTeamOrEnterprise,
|
|
443177
443538
|
apiKeyStatus,
|
|
443178
|
-
debug:
|
|
443539
|
+
debug: debug3,
|
|
443179
443540
|
verbose,
|
|
443180
443541
|
tokenUsage,
|
|
443181
443542
|
mainLoopModel,
|
|
@@ -443188,7 +443549,7 @@ function Notifications(t0) {
|
|
|
443188
443549
|
});
|
|
443189
443550
|
$2[15] = apiKeyStatus;
|
|
443190
443551
|
$2[16] = autoUpdaterResult;
|
|
443191
|
-
$2[17] =
|
|
443552
|
+
$2[17] = debug3;
|
|
443192
443553
|
$2[18] = ideSelection;
|
|
443193
443554
|
$2[19] = isAutoUpdating;
|
|
443194
443555
|
$2[20] = isShowingCompactMessage;
|
|
@@ -443237,7 +443598,7 @@ function NotificationContent({
|
|
|
443237
443598
|
isInOverageMode,
|
|
443238
443599
|
isTeamOrEnterprise,
|
|
443239
443600
|
apiKeyStatus,
|
|
443240
|
-
debug:
|
|
443601
|
+
debug: debug3,
|
|
443241
443602
|
verbose,
|
|
443242
443603
|
tokenUsage,
|
|
443243
443604
|
mainLoopModel,
|
|
@@ -443314,7 +443675,7 @@ function NotificationContent({
|
|
|
443314
443675
|
children: isEnvTruthy(process.env.THEUS_CODE_REMOTE) ? "Authentication error \xB7 Try again" : "Not logged in \xB7 Run /login"
|
|
443315
443676
|
})
|
|
443316
443677
|
}),
|
|
443317
|
-
|
|
443678
|
+
debug3 && /* @__PURE__ */ jsx_runtime409.jsx(ThemedBox_default, {
|
|
443318
443679
|
children: /* @__PURE__ */ jsx_runtime409.jsx(ThemedText, {
|
|
443319
443680
|
color: "warning",
|
|
443320
443681
|
wrap: "truncate",
|
|
@@ -450430,7 +450791,7 @@ function buildStatusLineCommandInput(permissionMode, exceeds200kTokens, settings
|
|
|
450430
450791
|
project_dir: getOriginalCwd(),
|
|
450431
450792
|
added_dirs: addedDirs
|
|
450432
450793
|
},
|
|
450433
|
-
version: { VERSION: "0.2.
|
|
450794
|
+
version: { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
450434
450795
|
output_style: {
|
|
450435
450796
|
name: outputStyleName
|
|
450436
450797
|
},
|
|
@@ -450573,11 +450934,11 @@ function StatusLineInner({
|
|
|
450573
450934
|
doUpdate();
|
|
450574
450935
|
}, [statusLineCommand, doUpdate]);
|
|
450575
450936
|
import_react252.useEffect(() => {
|
|
450576
|
-
const
|
|
450577
|
-
if (
|
|
450937
|
+
const statusLine2 = settings?.statusLine;
|
|
450938
|
+
if (statusLine2) {
|
|
450578
450939
|
logEvent("tengu_status_line_mount", {
|
|
450579
|
-
command_length:
|
|
450580
|
-
padding:
|
|
450940
|
+
command_length: statusLine2.command.length,
|
|
450941
|
+
padding: statusLine2.padding
|
|
450581
450942
|
});
|
|
450582
450943
|
if (settings.disableAllHooks === true) {
|
|
450583
450944
|
logForDebugging("Status line is configured but disableAllHooks is true", {
|
|
@@ -451565,6 +451926,66 @@ var init_VoiceIndicator = __esm(() => {
|
|
|
451565
451926
|
});
|
|
451566
451927
|
|
|
451567
451928
|
// components/PromptInput/PromptInputFooterLeftSide.tsx
|
|
451929
|
+
function ProactiveCountdown() {
|
|
451930
|
+
const $2 = c3(7);
|
|
451931
|
+
const nextTickAt2 = import_react255.useSyncExternalStore(proactiveModule7?.subscribeToProactiveChanges ?? NO_OP_SUBSCRIBE, proactiveModule7?.getNextTickAt ?? NULL, NULL);
|
|
451932
|
+
const [remainingSeconds, setRemainingSeconds] = import_react255.useState(null);
|
|
451933
|
+
let t0;
|
|
451934
|
+
let t1;
|
|
451935
|
+
if ($2[0] !== nextTickAt2) {
|
|
451936
|
+
t0 = () => {
|
|
451937
|
+
if (nextTickAt2 === null) {
|
|
451938
|
+
setRemainingSeconds(null);
|
|
451939
|
+
return;
|
|
451940
|
+
}
|
|
451941
|
+
const update3 = function update() {
|
|
451942
|
+
const remaining = Math.max(0, Math.ceil((nextTickAt2 - Date.now()) / 1000));
|
|
451943
|
+
setRemainingSeconds(remaining);
|
|
451944
|
+
};
|
|
451945
|
+
update3();
|
|
451946
|
+
const interval = setInterval(update3, 1000);
|
|
451947
|
+
return () => clearInterval(interval);
|
|
451948
|
+
};
|
|
451949
|
+
t1 = [nextTickAt2];
|
|
451950
|
+
$2[0] = nextTickAt2;
|
|
451951
|
+
$2[1] = t0;
|
|
451952
|
+
$2[2] = t1;
|
|
451953
|
+
} else {
|
|
451954
|
+
t0 = $2[1];
|
|
451955
|
+
t1 = $2[2];
|
|
451956
|
+
}
|
|
451957
|
+
import_react255.useEffect(t0, t1);
|
|
451958
|
+
if (remainingSeconds === null) {
|
|
451959
|
+
return null;
|
|
451960
|
+
}
|
|
451961
|
+
const t2 = remainingSeconds * 1000;
|
|
451962
|
+
let t3;
|
|
451963
|
+
if ($2[3] !== t2) {
|
|
451964
|
+
t3 = formatDuration(t2, {
|
|
451965
|
+
mostSignificantOnly: true
|
|
451966
|
+
});
|
|
451967
|
+
$2[3] = t2;
|
|
451968
|
+
$2[4] = t3;
|
|
451969
|
+
} else {
|
|
451970
|
+
t3 = $2[4];
|
|
451971
|
+
}
|
|
451972
|
+
let t4;
|
|
451973
|
+
if ($2[5] !== t3) {
|
|
451974
|
+
t4 = /* @__PURE__ */ jsx_runtime428.jsxs(ThemedText, {
|
|
451975
|
+
dimColor: true,
|
|
451976
|
+
children: [
|
|
451977
|
+
"waiting",
|
|
451978
|
+
" ",
|
|
451979
|
+
t3
|
|
451980
|
+
]
|
|
451981
|
+
});
|
|
451982
|
+
$2[5] = t3;
|
|
451983
|
+
$2[6] = t4;
|
|
451984
|
+
} else {
|
|
451985
|
+
t4 = $2[6];
|
|
451986
|
+
}
|
|
451987
|
+
return t4;
|
|
451988
|
+
}
|
|
451568
451989
|
function PromptInputFooterLeftSide(t0) {
|
|
451569
451990
|
const $2 = c3(27);
|
|
451570
451991
|
const {
|
|
@@ -451724,13 +452145,13 @@ function ModeIndicator({
|
|
|
451724
452145
|
const showSpinnerTree = expandedView === "teammates";
|
|
451725
452146
|
const prStatus = usePrStatus(isLoading, isPrStatusEnabled());
|
|
451726
452147
|
const hasTmuxSession = useAppState((s_4) => false);
|
|
451727
|
-
const
|
|
452148
|
+
const nextTickAt2 = import_react255.useSyncExternalStore(proactiveModule7?.subscribeToProactiveChanges ?? NO_OP_SUBSCRIBE, proactiveModule7?.getNextTickAt ?? NULL, NULL);
|
|
451728
452149
|
const voiceEnabled = false;
|
|
451729
452150
|
const voiceState = "idle";
|
|
451730
452151
|
const voiceWarmingUp = false;
|
|
451731
452152
|
const hasSelection2 = useHasSelection();
|
|
451732
452153
|
const selGetState = useSelection().getState;
|
|
451733
|
-
const hasNextTick =
|
|
452154
|
+
const hasNextTick = nextTickAt2 !== null;
|
|
451734
452155
|
const isCoordinator = false;
|
|
451735
452156
|
const runningTaskCount = import_react255.useMemo(() => count2(Object.values(tasks2), (t) => isBackgroundTask(t) && true), [tasks2]);
|
|
451736
452157
|
const tasksV2 = useTasksV2();
|
|
@@ -451816,7 +452237,9 @@ function ModeIndicator({
|
|
|
451816
452237
|
action: "return to team lead"
|
|
451817
452238
|
})
|
|
451818
452239
|
}, "esc-return"));
|
|
451819
|
-
} else if (
|
|
452240
|
+
} else if (isProactiveForced() && hasNextTick) {
|
|
452241
|
+
parts.push(/* @__PURE__ */ jsx_runtime428.jsx(ProactiveCountdown, {}, "proactive"));
|
|
452242
|
+
} else if (!hasTeammatePills && showHint) {
|
|
451820
452243
|
parts.push(...hintParts);
|
|
451821
452244
|
}
|
|
451822
452245
|
if (hasTeammatePills) {
|
|
@@ -451969,8 +452392,9 @@ function getSpinnerHintParts(isLoading, escShortcut, todosShortcut, killAgentsSh
|
|
|
451969
452392
|
function isPrStatusEnabled() {
|
|
451970
452393
|
return getGlobalConfig().prStatusFooterEnabled ?? true;
|
|
451971
452394
|
}
|
|
451972
|
-
var import_react255, jsx_runtime428,
|
|
452395
|
+
var import_react255, jsx_runtime428, proactiveModule7, NO_OP_SUBSCRIBE = (_cb) => () => {}, NULL = () => null;
|
|
451973
452396
|
var init_PromptInputFooterLeftSide = __esm(() => {
|
|
452397
|
+
init_proactiveEnabled();
|
|
451974
452398
|
init_compiler_runtime();
|
|
451975
452399
|
init_ink2();
|
|
451976
452400
|
init_figures();
|
|
@@ -452004,12 +452428,13 @@ var init_PromptInputFooterLeftSide = __esm(() => {
|
|
|
452004
452428
|
init_PrBadge();
|
|
452005
452429
|
import_react255 = __toESM(require_react(), 1);
|
|
452006
452430
|
jsx_runtime428 = __toESM(require_jsx_runtime(), 1);
|
|
452431
|
+
proactiveModule7 = isProactiveForced() ? (init_proactive(), __toCommonJS(exports_proactive)) : null;
|
|
452007
452432
|
});
|
|
452008
452433
|
|
|
452009
452434
|
// components/PromptInput/PromptInputFooter.tsx
|
|
452010
452435
|
function PromptInputFooter({
|
|
452011
452436
|
apiKeyStatus,
|
|
452012
|
-
debug:
|
|
452437
|
+
debug: debug3,
|
|
452013
452438
|
exitMessage,
|
|
452014
452439
|
vimMode,
|
|
452015
452440
|
mode,
|
|
@@ -452124,7 +452549,7 @@ function PromptInputFooter({
|
|
|
452124
452549
|
isFullscreen ? null : /* @__PURE__ */ jsx_runtime429.jsx(Notifications, {
|
|
452125
452550
|
apiKeyStatus,
|
|
452126
452551
|
autoUpdaterResult,
|
|
452127
|
-
debug:
|
|
452552
|
+
debug: debug3,
|
|
452128
452553
|
isAutoUpdating,
|
|
452129
452554
|
verbose,
|
|
452130
452555
|
messages,
|
|
@@ -452669,7 +453094,7 @@ function usePromptInputPlaceholder({
|
|
|
452669
453094
|
if (queuedCommands.some(isQueuedCommandEditable) && (getGlobalConfig().queuedCommandUpHintCount || 0) < NUM_TIMES_QUEUE_HINT_SHOWN) {
|
|
452670
453095
|
return "Press up to edit queued messages";
|
|
452671
453096
|
}
|
|
452672
|
-
if (submitCount < 1 && promptSuggestionEnabled && !
|
|
453097
|
+
if (submitCount < 1 && promptSuggestionEnabled && !proactiveModule8?.isProactiveActive()) {
|
|
452673
453098
|
return getExampleCommandFromCache();
|
|
452674
453099
|
}
|
|
452675
453100
|
}, [
|
|
@@ -452681,14 +453106,16 @@ function usePromptInputPlaceholder({
|
|
|
452681
453106
|
]);
|
|
452682
453107
|
return placeholder;
|
|
452683
453108
|
}
|
|
452684
|
-
var import_react259,
|
|
453109
|
+
var import_react259, proactiveModule8, NUM_TIMES_QUEUE_HINT_SHOWN = 3, MAX_TEAMMATE_NAME_LENGTH = 20;
|
|
452685
453110
|
var init_usePromptInputPlaceholder = __esm(() => {
|
|
453111
|
+
init_proactiveEnabled();
|
|
452686
453112
|
init_useCommandQueue();
|
|
452687
453113
|
init_AppState();
|
|
452688
453114
|
init_config2();
|
|
452689
453115
|
init_exampleCommands();
|
|
452690
453116
|
init_messageQueueManager();
|
|
452691
453117
|
import_react259 = __toESM(require_react(), 1);
|
|
453118
|
+
proactiveModule8 = isProactiveForced() ? (init_proactive(), __toCommonJS(exports_proactive)) : null;
|
|
452692
453119
|
});
|
|
452693
453120
|
|
|
452694
453121
|
// components/PromptInput/useShowFastIconHint.ts
|
|
@@ -452764,9 +453191,9 @@ function useSwarmBanner() {
|
|
|
452764
453191
|
};
|
|
452765
453192
|
}
|
|
452766
453193
|
}
|
|
452767
|
-
const
|
|
452768
|
-
if (
|
|
452769
|
-
const task =
|
|
453194
|
+
const active2 = getActiveAgentForInput(state2);
|
|
453195
|
+
if (active2.type === "named_agent") {
|
|
453196
|
+
const task = active2.task;
|
|
452770
453197
|
let name;
|
|
452771
453198
|
for (const [n3, id] of state2.agentNameRegistry) {
|
|
452772
453199
|
if (id === task.id) {
|
|
@@ -452821,9 +453248,9 @@ function sideColor(sideIndex, crest) {
|
|
|
452821
453248
|
return WAVE_MID;
|
|
452822
453249
|
return WAVE_TROUGH;
|
|
452823
453250
|
}
|
|
452824
|
-
function useNeonBorderWave(
|
|
453251
|
+
function useNeonBorderWave(active2) {
|
|
452825
453252
|
const reduced = isEnvTruthy(process.env.THEUS_CODE_REDUCE_MOTION);
|
|
452826
|
-
const shouldAnimate =
|
|
453253
|
+
const shouldAnimate = active2 && !reduced && !!process.stdout.isTTY;
|
|
452827
453254
|
const [crest, setCrest] = import_react261.useState(0);
|
|
452828
453255
|
import_react261.useEffect(() => {
|
|
452829
453256
|
if (!shouldAnimate)
|
|
@@ -452855,7 +453282,7 @@ var init_useNeonBorder = __esm(() => {
|
|
|
452855
453282
|
// components/PromptInput/PromptInput.tsx
|
|
452856
453283
|
import * as path20 from "path";
|
|
452857
453284
|
function PromptInput({
|
|
452858
|
-
debug:
|
|
453285
|
+
debug: debug3,
|
|
452859
453286
|
ideSelection,
|
|
452860
453287
|
toolPermissionContext,
|
|
452861
453288
|
setToolPermissionContext,
|
|
@@ -454529,7 +454956,7 @@ function PromptInput({
|
|
|
454529
454956
|
}),
|
|
454530
454957
|
/* @__PURE__ */ jsx_runtime433.jsx(PromptInputFooter_default, {
|
|
454531
454958
|
apiKeyStatus,
|
|
454532
|
-
debug:
|
|
454959
|
+
debug: debug3,
|
|
454533
454960
|
exitMessage,
|
|
454534
454961
|
vimMode: isVimModeEnabled() ? vimMode : undefined,
|
|
454535
454962
|
mode,
|
|
@@ -454575,7 +455002,7 @@ function PromptInput({
|
|
|
454575
455002
|
children: /* @__PURE__ */ jsx_runtime433.jsx(Notifications, {
|
|
454576
455003
|
apiKeyStatus,
|
|
454577
455004
|
autoUpdaterResult,
|
|
454578
|
-
debug:
|
|
455005
|
+
debug: debug3,
|
|
454579
455006
|
isAutoUpdating,
|
|
454580
455007
|
verbose,
|
|
454581
455008
|
messages,
|
|
@@ -461776,7 +462203,7 @@ async function submitTranscriptShare(messages, trigger, appearanceId) {
|
|
|
461776
462203
|
} catch {}
|
|
461777
462204
|
const data = {
|
|
461778
462205
|
trigger,
|
|
461779
|
-
version: { VERSION: "0.2.
|
|
462206
|
+
version: { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
461780
462207
|
platform: process.platform,
|
|
461781
462208
|
transcript,
|
|
461782
462209
|
subagentTranscripts: Object.keys(subagentTranscripts).length > 0 ? subagentTranscripts : undefined,
|
|
@@ -469370,6 +469797,72 @@ var init_ScrollKeybindingHandler = __esm(() => {
|
|
|
469370
469797
|
import_react320 = __toESM(require_react(), 1);
|
|
469371
469798
|
});
|
|
469372
469799
|
|
|
469800
|
+
// proactive/useProactive.js
|
|
469801
|
+
var exports_useProactive = {};
|
|
469802
|
+
__export(exports_useProactive, {
|
|
469803
|
+
useProactive: () => useProactive,
|
|
469804
|
+
default: () => useProactive_default
|
|
469805
|
+
});
|
|
469806
|
+
function resolveTickMs() {
|
|
469807
|
+
const raw = process.env.THEUS_PROACTIVE_TICK_MS;
|
|
469808
|
+
const n3 = raw ? Number(raw) : Number.NaN;
|
|
469809
|
+
return Number.isFinite(n3) && n3 >= MIN_TICK_MS ? n3 : DEFAULT_TICK_MS;
|
|
469810
|
+
}
|
|
469811
|
+
function buildTickPrompt() {
|
|
469812
|
+
return `<${TICK_TAG}>${new Date().toLocaleTimeString()}</${TICK_TAG}>`;
|
|
469813
|
+
}
|
|
469814
|
+
function useProactive(opts) {
|
|
469815
|
+
const {
|
|
469816
|
+
isLoading = false,
|
|
469817
|
+
queuedCommandsLength = 0,
|
|
469818
|
+
hasActiveLocalJsxUI = false,
|
|
469819
|
+
isInPlanMode = false,
|
|
469820
|
+
onSubmitTick,
|
|
469821
|
+
onQueueTick
|
|
469822
|
+
} = opts ?? {};
|
|
469823
|
+
const active2 = React164.useSyncExternalStore(subscribeToProactiveChanges, isProactiveActive);
|
|
469824
|
+
const paused2 = React164.useSyncExternalStore(subscribeToProactiveChanges, isProactivePaused);
|
|
469825
|
+
const blocked = React164.useSyncExternalStore(subscribeToProactiveChanges, isContextBlocked);
|
|
469826
|
+
const submitRef = React164.useRef(onSubmitTick);
|
|
469827
|
+
const queueRef = React164.useRef(onQueueTick);
|
|
469828
|
+
submitRef.current = onSubmitTick;
|
|
469829
|
+
queueRef.current = onQueueTick;
|
|
469830
|
+
const idle = active2 && !paused2 && !blocked && !isLoading && queuedCommandsLength === 0 && !hasActiveLocalJsxUI && !isInPlanMode;
|
|
469831
|
+
React164.useEffect(() => {
|
|
469832
|
+
if (!idle) {
|
|
469833
|
+
setNextTickAt(null);
|
|
469834
|
+
return;
|
|
469835
|
+
}
|
|
469836
|
+
const tickMs = resolveTickMs();
|
|
469837
|
+
setNextTickAt(Date.now() + tickMs);
|
|
469838
|
+
const timer = setTimeout(() => {
|
|
469839
|
+
setNextTickAt(null);
|
|
469840
|
+
if (!isProactiveActive() || isProactivePaused() || isContextBlocked()) {
|
|
469841
|
+
return;
|
|
469842
|
+
}
|
|
469843
|
+
const prompt = buildTickPrompt();
|
|
469844
|
+
const submit = submitRef.current;
|
|
469845
|
+
const queue2 = queueRef.current;
|
|
469846
|
+
if (typeof submit === "function")
|
|
469847
|
+
submit(prompt);
|
|
469848
|
+
else if (typeof queue2 === "function")
|
|
469849
|
+
queue2(prompt);
|
|
469850
|
+
}, tickMs);
|
|
469851
|
+
return () => {
|
|
469852
|
+
clearTimeout(timer);
|
|
469853
|
+
setNextTickAt(null);
|
|
469854
|
+
};
|
|
469855
|
+
}, [idle]);
|
|
469856
|
+
return null;
|
|
469857
|
+
}
|
|
469858
|
+
var React164, DEFAULT_TICK_MS = 5000, MIN_TICK_MS = 500, useProactive_default;
|
|
469859
|
+
var init_useProactive = __esm(() => {
|
|
469860
|
+
init_xml();
|
|
469861
|
+
init_proactive();
|
|
469862
|
+
React164 = __toESM(require_react(), 1);
|
|
469863
|
+
useProactive_default = useProactive;
|
|
469864
|
+
});
|
|
469865
|
+
|
|
469373
469866
|
// utils/cronJitterConfig.ts
|
|
469374
469867
|
var exports_cronJitterConfig = {};
|
|
469375
469868
|
__export(exports_cronJitterConfig, {
|
|
@@ -469592,8 +470085,8 @@ function TranscriptSearchBar({
|
|
|
469592
470085
|
onExit: () => onClose(query2),
|
|
469593
470086
|
onCancel
|
|
469594
470087
|
});
|
|
469595
|
-
const [indexStatus, setIndexStatus] =
|
|
469596
|
-
|
|
470088
|
+
const [indexStatus, setIndexStatus] = React165.useState("building");
|
|
470089
|
+
React165.useEffect(() => {
|
|
469597
470090
|
let alive = true;
|
|
469598
470091
|
const warm = jumpRef.current?.warmSearchIndex;
|
|
469599
470092
|
if (!warm) {
|
|
@@ -469722,7 +470215,7 @@ function _temp224(f) {
|
|
|
469722
470215
|
}
|
|
469723
470216
|
function REPL({
|
|
469724
470217
|
commands: initialCommands,
|
|
469725
|
-
debug:
|
|
470218
|
+
debug: debug3,
|
|
469726
470219
|
initialTools,
|
|
469727
470220
|
initialMessages,
|
|
469728
470221
|
pendingHookMessages,
|
|
@@ -469810,7 +470303,7 @@ function REPL({
|
|
|
469810
470303
|
const mainLoopModel = useMainLoopModel();
|
|
469811
470304
|
const [localCommands, setLocalCommands] = import_react322.useState(initialCommands);
|
|
469812
470305
|
useSkillsChange(isRemoteSession ? undefined : getProjectRoot(), setLocalCommands);
|
|
469813
|
-
const proactiveActive =
|
|
470306
|
+
const proactiveActive = React165.useSyncExternalStore(proactiveModule9?.subscribeToProactiveChanges ?? PROACTIVE_NO_OP_SUBSCRIBE, proactiveModule9?.isProactiveActive ?? PROACTIVE_FALSE);
|
|
469814
470307
|
const isBriefOnly = useAppState((s) => s.isBriefOnly);
|
|
469815
470308
|
const localTools = import_react322.useMemo(() => getTools(toolPermissionContext), [toolPermissionContext, proactiveActive, isBriefOnly]);
|
|
469816
470309
|
useKickOffCheckAndDisableBypassPermissionsIfNeeded();
|
|
@@ -469938,36 +470431,36 @@ function REPL({
|
|
|
469938
470431
|
const scrollRef = import_react322.useRef(null);
|
|
469939
470432
|
const modalScrollRef = import_react322.useRef(null);
|
|
469940
470433
|
const lastUserScrollTsRef = import_react322.useRef(0);
|
|
469941
|
-
const queryGuard =
|
|
469942
|
-
const isQueryActive =
|
|
469943
|
-
const [isExternalLoading, setIsExternalLoadingRaw] =
|
|
470434
|
+
const queryGuard = React165.useRef(new QueryGuard).current;
|
|
470435
|
+
const isQueryActive = React165.useSyncExternalStore(queryGuard.subscribe, queryGuard.getSnapshot);
|
|
470436
|
+
const [isExternalLoading, setIsExternalLoadingRaw] = React165.useState(remoteSessionConfig?.hasInitialPrompt ?? false);
|
|
469944
470437
|
const isLoading = isQueryActive || isExternalLoading;
|
|
469945
|
-
const [userInputOnProcessing, setUserInputOnProcessingRaw] =
|
|
469946
|
-
const userInputBaselineRef =
|
|
469947
|
-
const userMessagePendingRef =
|
|
469948
|
-
const loadingStartTimeRef =
|
|
469949
|
-
const totalPausedMsRef =
|
|
469950
|
-
const pauseStartTimeRef =
|
|
469951
|
-
const resetTimingRefs =
|
|
470438
|
+
const [userInputOnProcessing, setUserInputOnProcessingRaw] = React165.useState(undefined);
|
|
470439
|
+
const userInputBaselineRef = React165.useRef(0);
|
|
470440
|
+
const userMessagePendingRef = React165.useRef(false);
|
|
470441
|
+
const loadingStartTimeRef = React165.useRef(0);
|
|
470442
|
+
const totalPausedMsRef = React165.useRef(0);
|
|
470443
|
+
const pauseStartTimeRef = React165.useRef(null);
|
|
470444
|
+
const resetTimingRefs = React165.useCallback(() => {
|
|
469952
470445
|
loadingStartTimeRef.current = Date.now();
|
|
469953
470446
|
totalPausedMsRef.current = 0;
|
|
469954
470447
|
pauseStartTimeRef.current = null;
|
|
469955
470448
|
}, []);
|
|
469956
|
-
const wasQueryActiveRef =
|
|
470449
|
+
const wasQueryActiveRef = React165.useRef(false);
|
|
469957
470450
|
if (isQueryActive && !wasQueryActiveRef.current) {
|
|
469958
470451
|
resetTimingRefs();
|
|
469959
470452
|
}
|
|
469960
470453
|
wasQueryActiveRef.current = isQueryActive;
|
|
469961
|
-
const setIsExternalLoading =
|
|
470454
|
+
const setIsExternalLoading = React165.useCallback((value) => {
|
|
469962
470455
|
setIsExternalLoadingRaw(value);
|
|
469963
470456
|
if (value)
|
|
469964
470457
|
resetTimingRefs();
|
|
469965
470458
|
}, [resetTimingRefs]);
|
|
469966
|
-
const swarmStartTimeRef =
|
|
469967
|
-
const swarmBudgetInfoRef =
|
|
469968
|
-
const focusedInputDialogRef =
|
|
470459
|
+
const swarmStartTimeRef = React165.useRef(null);
|
|
470460
|
+
const swarmBudgetInfoRef = React165.useRef(undefined);
|
|
470461
|
+
const focusedInputDialogRef = React165.useRef(undefined);
|
|
469969
470462
|
const PROMPT_SUPPRESSION_MS = 1500;
|
|
469970
|
-
const [isPromptInputActive, setIsPromptInputActive] =
|
|
470463
|
+
const [isPromptInputActive, setIsPromptInputActive] = React165.useState(false);
|
|
469971
470464
|
const [autoUpdaterResult, setAutoUpdaterResult] = import_react322.useState(null);
|
|
469972
470465
|
import_react322.useEffect(() => {
|
|
469973
470466
|
if (autoUpdaterResult?.notifications) {
|
|
@@ -470241,7 +470734,7 @@ function REPL({
|
|
|
470241
470734
|
const terminalFocusRef = import_react322.useRef(isTerminalFocused);
|
|
470242
470735
|
terminalFocusRef.current = isTerminalFocused;
|
|
470243
470736
|
const [theme2] = useTheme();
|
|
470244
|
-
const tipPickedThisTurnRef =
|
|
470737
|
+
const tipPickedThisTurnRef = React165.useRef(false);
|
|
470245
470738
|
const pickNewSpinnerTip = import_react322.useCallback(() => {
|
|
470246
470739
|
if (tipPickedThisTurnRef.current)
|
|
470247
470740
|
return;
|
|
@@ -470568,7 +471061,9 @@ function REPL({
|
|
|
470568
471061
|
return;
|
|
470569
471062
|
}
|
|
470570
471063
|
logForDebugging(`[onCancel] focusedInputDialog=${focusedInputDialog} streamMode=${streamMode}`);
|
|
470571
|
-
if (
|
|
471064
|
+
if (isProactiveForced()) {
|
|
471065
|
+
proactiveModule9?.pauseProactive();
|
|
471066
|
+
}
|
|
470572
471067
|
queryGuard.forceEnd();
|
|
470573
471068
|
skipIdleCheckRef.current = false;
|
|
470574
471069
|
if (streamingText?.trim()) {
|
|
@@ -470767,7 +471262,7 @@ Error: sandbox required but unavailable: ${reason}
|
|
|
470767
471262
|
options: {
|
|
470768
471263
|
commands,
|
|
470769
471264
|
tools: computeTools(),
|
|
470770
|
-
debug:
|
|
471265
|
+
debug: debug3,
|
|
470771
471266
|
verbose: s.verbose,
|
|
470772
471267
|
mainLoopModel: mainLoopModel2,
|
|
470773
471268
|
thinkingConfig: s.thinkingEnabled !== false ? thinkingConfig : {
|
|
@@ -470861,7 +471356,7 @@ Error: sandbox required but unavailable: ${reason}
|
|
|
470861
471356
|
requestPrompt: undefined,
|
|
470862
471357
|
contentReplacementState: contentReplacementStateRef.current
|
|
470863
471358
|
};
|
|
470864
|
-
}, [commands, combinedInitialTools, mainThreadAgentDefinition,
|
|
471359
|
+
}, [commands, combinedInitialTools, mainThreadAgentDefinition, debug3, initialMcpClients, ideInstallationStatus, dynamicMcpConfig, theme2, allowedAgentTypes, store, setAppState, reverify, addNotification, setMessages, onChangeDynamicMcpConfig, resume2, requestPrompt, disabled, customSystemPrompt, appendSystemPrompt, setConversationId]);
|
|
470865
471360
|
const handleBackgroundQuery = import_react322.useCallback(() => {
|
|
470866
471361
|
abortController?.abort("background");
|
|
470867
471362
|
const removedNotifications = removeByFilter((cmd) => cmd.mode === "task-notification");
|
|
@@ -470921,7 +471416,9 @@ Error: sandbox required but unavailable: ${reason}
|
|
|
470921
471416
|
setMessages(() => [newMessage]);
|
|
470922
471417
|
}
|
|
470923
471418
|
setConversationId(randomUUID54());
|
|
470924
|
-
if (
|
|
471419
|
+
if (isProactiveForced()) {
|
|
471420
|
+
proactiveModule9?.setContextBlocked(false);
|
|
471421
|
+
}
|
|
470925
471422
|
} else if (newMessage.type === "progress" && isEphemeralToolProgress(newMessage.data.type)) {
|
|
470926
471423
|
setMessages((oldMessages) => {
|
|
470927
471424
|
const last2 = oldMessages.at(-1);
|
|
@@ -470935,7 +471432,13 @@ Error: sandbox required but unavailable: ${reason}
|
|
|
470935
471432
|
} else {
|
|
470936
471433
|
setMessages((oldMessages) => [...oldMessages, newMessage]);
|
|
470937
471434
|
}
|
|
470938
|
-
if (
|
|
471435
|
+
if (isProactiveForced()) {
|
|
471436
|
+
if (newMessage.type === "assistant" && "isApiErrorMessage" in newMessage && newMessage.isApiErrorMessage) {
|
|
471437
|
+
proactiveModule9?.setContextBlocked(true);
|
|
471438
|
+
} else if (newMessage.type === "assistant") {
|
|
471439
|
+
proactiveModule9?.setContextBlocked(false);
|
|
471440
|
+
}
|
|
471441
|
+
}
|
|
470939
471442
|
}, (newContent) => {
|
|
470940
471443
|
setResponseLength((length) => length + newContent.length);
|
|
470941
471444
|
}, setStreamMode, setStreamingToolUses, (tombstonedMessage) => {
|
|
@@ -470997,7 +471500,9 @@ Error: sandbox required but unavailable: ${reason}
|
|
|
470997
471500
|
if (!shouldQuery) {
|
|
470998
471501
|
if (newMessages.some(isCompactBoundaryMessage)) {
|
|
470999
471502
|
setConversationId(randomUUID54());
|
|
471000
|
-
if (
|
|
471503
|
+
if (isProactiveForced()) {
|
|
471504
|
+
proactiveModule9?.setContextBlocked(false);
|
|
471505
|
+
}
|
|
471001
471506
|
}
|
|
471002
471507
|
resetLoadingState();
|
|
471003
471508
|
setAbortController(null);
|
|
@@ -471026,7 +471531,9 @@ Error: sandbox required but unavailable: ${reason}
|
|
|
471026
471531
|
const userContext = {
|
|
471027
471532
|
...baseUserContext,
|
|
471028
471533
|
...getCoordinatorUserContext(freshMcpClients, isScratchpadEnabled() ? getScratchpadDir() : undefined),
|
|
471029
|
-
...{
|
|
471534
|
+
...isProactiveForced() && proactiveModule9?.isProactiveActive() && !terminalFocusRef.current ? {
|
|
471535
|
+
terminalFocus: "The terminal is unfocused \u2014 the user is not actively watching."
|
|
471536
|
+
} : {}
|
|
471030
471537
|
};
|
|
471031
471538
|
queryCheckpoint("query_context_loading_end");
|
|
471032
471539
|
const systemPrompt = buildEffectiveSystemPrompt({
|
|
@@ -471214,7 +471721,9 @@ Error: sandbox required but unavailable: ${reason}
|
|
|
471214
471721
|
}, [initialMessage, isLoading, setMessages, setAppState, onQuery, mainLoopModel, tools]);
|
|
471215
471722
|
const onSubmit = import_react322.useCallback(async (input, helpers, speculationAccept, options2) => {
|
|
471216
471723
|
repinScroll();
|
|
471217
|
-
if (
|
|
471724
|
+
if (isProactiveForced()) {
|
|
471725
|
+
proactiveModule9?.resumeProactive();
|
|
471726
|
+
}
|
|
471218
471727
|
if (!speculationAccept && input.trim().startsWith("/")) {
|
|
471219
471728
|
const trimmedInput = expandPastedTextRefs(input, pastedContents).trim();
|
|
471220
471729
|
const spaceIndex = trimmedInput.indexOf(" ");
|
|
@@ -471907,6 +472416,22 @@ ${fileList}`);
|
|
|
471907
472416
|
});
|
|
471908
472417
|
}
|
|
471909
472418
|
if (false) {}
|
|
472419
|
+
if (isProactiveForced()) {
|
|
472420
|
+
useProactive2?.({
|
|
472421
|
+
isLoading: isLoading || initialMessage !== null,
|
|
472422
|
+
queuedCommandsLength: queuedCommands.length,
|
|
472423
|
+
hasActiveLocalJsxUI: isShowingLocalJSXCommand,
|
|
472424
|
+
isInPlanMode: toolPermissionContext.mode === "plan",
|
|
472425
|
+
onSubmitTick: (prompt) => handleIncomingPrompt(prompt, {
|
|
472426
|
+
isMeta: true
|
|
472427
|
+
}),
|
|
472428
|
+
onQueueTick: (prompt) => enqueue({
|
|
472429
|
+
mode: "prompt",
|
|
472430
|
+
value: prompt,
|
|
472431
|
+
isMeta: true
|
|
472432
|
+
})
|
|
472433
|
+
});
|
|
472434
|
+
}
|
|
471910
472435
|
import_react322.useEffect(() => {
|
|
471911
472436
|
if (queuedCommands.some((cmd) => cmd.priority === "now")) {
|
|
471912
472437
|
abortControllerRef.current?.abort("interrupt");
|
|
@@ -472012,8 +472537,8 @@ Note: ctrl + z now suspends Theus, ctrl + _ undoes input.
|
|
|
472012
472537
|
setPositions
|
|
472013
472538
|
} = useSearchHighlight();
|
|
472014
472539
|
const transcriptCols = useTerminalSize().columns;
|
|
472015
|
-
const prevColsRef =
|
|
472016
|
-
|
|
472540
|
+
const prevColsRef = React165.useRef(transcriptCols);
|
|
472541
|
+
React165.useEffect(() => {
|
|
472017
472542
|
if (prevColsRef.current !== transcriptCols) {
|
|
472018
472543
|
prevColsRef.current = transcriptCols;
|
|
472019
472544
|
if (searchQuery || searchOpen) {
|
|
@@ -472682,7 +473207,7 @@ Note: ctrl + z now suspends Theus, ctrl + _ undoes input.
|
|
|
472682
473207
|
false,
|
|
472683
473208
|
showIssueFlagBanner && /* @__PURE__ */ jsx_runtime465.jsx(IssueFlagBanner, {}),
|
|
472684
473209
|
/* @__PURE__ */ jsx_runtime465.jsx(PromptInput_default, {
|
|
472685
|
-
debug:
|
|
473210
|
+
debug: debug3,
|
|
472686
473211
|
ideSelection,
|
|
472687
473212
|
hasSuppressedDialogs: !!hasSuppressedDialogs,
|
|
472688
473213
|
isLocalJSXCommandActive: isShowingLocalJSXCommand,
|
|
@@ -472781,7 +473306,9 @@ Note: ctrl + z now suspends Theus, ctrl + _ undoes input.
|
|
|
472781
473306
|
} else {
|
|
472782
473307
|
setMessages(postCompact);
|
|
472783
473308
|
}
|
|
472784
|
-
if (
|
|
473309
|
+
if (isProactiveForced()) {
|
|
473310
|
+
proactiveModule9?.setContextBlocked(false);
|
|
473311
|
+
}
|
|
472785
473312
|
setConversationId(randomUUID54());
|
|
472786
473313
|
runPostCompactCleanup(context3.options.querySource);
|
|
472787
473314
|
if (direction === "from") {
|
|
@@ -472823,11 +473350,12 @@ Note: ctrl + z now suspends Theus, ctrl + _ undoes input.
|
|
|
472823
473350
|
}
|
|
472824
473351
|
return mainReturn;
|
|
472825
473352
|
}
|
|
472826
|
-
var
|
|
473353
|
+
var React165, import_react322, jsx_runtime465, useFrustrationDetection = () => ({
|
|
472827
473354
|
state: "closed",
|
|
472828
473355
|
handleTranscriptSelect: () => {}
|
|
472829
|
-
}), useAntOrgWarningNotification = () => {}, getCoordinatorUserContext = () => ({}),
|
|
473356
|
+
}), useAntOrgWarningNotification = () => {}, getCoordinatorUserContext = () => ({}), proactiveModule9, PROACTIVE_NO_OP_SUBSCRIBE = (_cb) => () => {}, PROACTIVE_FALSE = () => false, SUGGEST_BG_PR_NOOP = (_p, _n) => false, useProactive2, useScheduledTasks2, EMPTY_MCP_CLIENTS2, HISTORY_STUB, RECENT_SCROLL_REPIN_WINDOW_MS = 3000, TITLE_ANIMATION_FRAMES, TITLE_STATIC_PREFIX = "\u2733", TITLE_ANIMATION_INTERVAL_MS = 960;
|
|
472830
473357
|
var init_REPL = __esm(() => {
|
|
473358
|
+
init_proactiveEnabled();
|
|
472831
473359
|
init_compiler_runtime();
|
|
472832
473360
|
init_state();
|
|
472833
473361
|
init_tokenBudget();
|
|
@@ -473031,9 +473559,11 @@ var init_REPL = __esm(() => {
|
|
|
473031
473559
|
init_messageActions();
|
|
473032
473560
|
init_osc();
|
|
473033
473561
|
init_attachments2();
|
|
473034
|
-
|
|
473562
|
+
React165 = __toESM(require_react(), 1);
|
|
473035
473563
|
import_react322 = __toESM(require_react(), 1);
|
|
473036
473564
|
jsx_runtime465 = __toESM(require_jsx_runtime(), 1);
|
|
473565
|
+
proactiveModule9 = isProactiveForced() ? (init_proactive(), __toCommonJS(exports_proactive)) : null;
|
|
473566
|
+
useProactive2 = isProactiveForced() ? (init_useProactive(), __toCommonJS(exports_useProactive)).useProactive : null;
|
|
473037
473567
|
useScheduledTasks2 = isAgentTriggersForced() ? (init_useScheduledTasks(), __toCommonJS(exports_useScheduledTasks)).useScheduledTasks : null;
|
|
473038
473568
|
EMPTY_MCP_CLIENTS2 = [];
|
|
473039
473569
|
HISTORY_STUB = {
|
|
@@ -474697,7 +475227,7 @@ function completeOnboarding() {
|
|
|
474697
475227
|
saveGlobalConfig((current) => ({
|
|
474698
475228
|
...current,
|
|
474699
475229
|
hasCompletedOnboarding: true,
|
|
474700
|
-
lastOnboardingVersion: { VERSION: "0.2.
|
|
475230
|
+
lastOnboardingVersion: { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
474701
475231
|
}));
|
|
474702
475232
|
}
|
|
474703
475233
|
function showDialog(root2, renderer) {
|
|
@@ -475025,12 +475555,12 @@ function movingTrack(width, timeMs, offsetMs = 0) {
|
|
|
475025
475555
|
}
|
|
475026
475556
|
return result;
|
|
475027
475557
|
}
|
|
475028
|
-
function pulseRule(width, timeMs, label,
|
|
475558
|
+
function pulseRule(width, timeMs, label, active2 = true) {
|
|
475029
475559
|
const safeWidth = Math.max(20, width);
|
|
475030
475560
|
const labelText = ` ${label} `;
|
|
475031
475561
|
const leftWidth = Math.max(2, Math.floor((safeWidth - labelText.length) * 0.32));
|
|
475032
475562
|
const rightWidth = Math.max(2, safeWidth - labelText.length - leftWidth);
|
|
475033
|
-
if (!
|
|
475563
|
+
if (!active2) {
|
|
475034
475564
|
return fitForgeLine([seg("-".repeat(leftWidth), "dim"), seg(labelText, "brand", true), seg("-".repeat(rightWidth), "dim")], safeWidth);
|
|
475035
475565
|
}
|
|
475036
475566
|
const track2 = movingTrack(safeWidth, timeMs);
|
|
@@ -476665,7 +477195,7 @@ function ResumeConversation({
|
|
|
476665
477195
|
initialTools,
|
|
476666
477196
|
mcpClients,
|
|
476667
477197
|
dynamicMcpConfig,
|
|
476668
|
-
debug:
|
|
477198
|
+
debug: debug3,
|
|
476669
477199
|
mainThreadAgentDefinition,
|
|
476670
477200
|
autoConnectIdeFlag,
|
|
476671
477201
|
strictMcpConfig = false,
|
|
@@ -476843,7 +477373,7 @@ function ResumeConversation({
|
|
|
476843
477373
|
}
|
|
476844
477374
|
if (resumeData) {
|
|
476845
477375
|
return /* @__PURE__ */ jsx_runtime481.jsx(REPL, {
|
|
476846
|
-
debug:
|
|
477376
|
+
debug: debug3,
|
|
476847
477377
|
commands,
|
|
476848
477378
|
initialTools,
|
|
476849
477379
|
initialMessages: resumeData.messages,
|
|
@@ -482170,7 +482700,9 @@ Startup time: ${Math.round(process.uptime() * 1000)}ms
|
|
|
482170
482700
|
});
|
|
482171
482701
|
}
|
|
482172
482702
|
});
|
|
482173
|
-
if (
|
|
482703
|
+
if (isProactiveForced() && proactiveModule10 && !proactiveModule10.isProactiveActive() && isEnvTruthy(process.env.THEUS_CODE_PROACTIVE)) {
|
|
482704
|
+
proactiveModule10.activateProactive("command");
|
|
482705
|
+
}
|
|
482174
482706
|
if (typeof Bun !== "undefined") {
|
|
482175
482707
|
const gcTimer = setInterval(Bun.gc, 1000);
|
|
482176
482708
|
gcTimer.unref();
|
|
@@ -482836,7 +483368,22 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial
|
|
|
482836
483368
|
currentCommands = newCommands;
|
|
482837
483369
|
});
|
|
482838
483370
|
});
|
|
482839
|
-
const scheduleProactiveTick =
|
|
483371
|
+
const scheduleProactiveTick = isProactiveForced() ? () => {
|
|
483372
|
+
setTimeout(() => {
|
|
483373
|
+
if (!proactiveModule10?.isProactiveActive() || proactiveModule10.isProactivePaused() || inputClosed) {
|
|
483374
|
+
return;
|
|
483375
|
+
}
|
|
483376
|
+
const tickContent = `<${TICK_TAG}>${new Date().toLocaleTimeString()}</${TICK_TAG}>`;
|
|
483377
|
+
enqueue({
|
|
483378
|
+
mode: "prompt",
|
|
483379
|
+
value: tickContent,
|
|
483380
|
+
uuid: randomUUID57(),
|
|
483381
|
+
priority: "later",
|
|
483382
|
+
isMeta: true
|
|
483383
|
+
});
|
|
483384
|
+
run3();
|
|
483385
|
+
}, 0);
|
|
483386
|
+
} : undefined;
|
|
482840
483387
|
subscribeToCommandQueue(() => {
|
|
482841
483388
|
if (abortController && getCommandsByMaxPriority("now").length > 0) {
|
|
482842
483389
|
abortController.abort("interrupt");
|
|
@@ -483188,7 +483735,12 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial
|
|
|
483188
483735
|
running2 = false;
|
|
483189
483736
|
idleTimeout.start();
|
|
483190
483737
|
}
|
|
483191
|
-
if (
|
|
483738
|
+
if (isProactiveForced() && proactiveModule10?.isProactiveActive() && !proactiveModule10.isProactivePaused()) {
|
|
483739
|
+
if (peek2(isMainThread) === undefined && !inputClosed) {
|
|
483740
|
+
scheduleProactiveTick();
|
|
483741
|
+
return;
|
|
483742
|
+
}
|
|
483743
|
+
}
|
|
483192
483744
|
if (peek2(isMainThread) !== undefined) {
|
|
483193
483745
|
run3();
|
|
483194
483746
|
return;
|
|
@@ -483994,7 +484546,18 @@ ${m.text}
|
|
|
483994
484546
|
sendControlResponseError(message, errorMessage(e));
|
|
483995
484547
|
}
|
|
483996
484548
|
})();
|
|
483997
|
-
} else if (
|
|
484549
|
+
} else if (isProactiveForced() && message.request.subtype === "set_proactive") {
|
|
484550
|
+
const req = message.request;
|
|
484551
|
+
if (req.enabled) {
|
|
484552
|
+
if (!proactiveModule10.isProactiveActive()) {
|
|
484553
|
+
proactiveModule10.activateProactive("command");
|
|
484554
|
+
scheduleProactiveTick();
|
|
484555
|
+
}
|
|
484556
|
+
} else {
|
|
484557
|
+
proactiveModule10.deactivateProactive();
|
|
484558
|
+
}
|
|
484559
|
+
sendControlResponseSuccess(message);
|
|
484560
|
+
} else if (message.request.subtype === "remote_control") {
|
|
483998
484561
|
if (message.request.enabled) {
|
|
483999
484562
|
if (bridgeHandle) {
|
|
484000
484563
|
sendControlResponseSuccess(message, {
|
|
@@ -484930,7 +485493,7 @@ async function reconcileMcpServers(desiredConfigs, currentState2, setAppState) {
|
|
|
484930
485493
|
newState
|
|
484931
485494
|
};
|
|
484932
485495
|
}
|
|
484933
|
-
var cronSchedulerModule, cronJitterConfigModule, cronGate, SHUTDOWN_TEAM_PROMPT = `<system-reminder>
|
|
485496
|
+
var proactiveModule10, cronSchedulerModule, cronJitterConfigModule, cronGate, SHUTDOWN_TEAM_PROMPT = `<system-reminder>
|
|
484934
485497
|
You are running in non-interactive mode and cannot return a response to the user until your team is shut down.
|
|
484935
485498
|
|
|
484936
485499
|
You MUST shut down your team before preparing your final response:
|
|
@@ -484944,6 +485507,7 @@ The user cannot receive your response until the team is completely shut down.
|
|
|
484944
485507
|
|
|
484945
485508
|
Shut down your team and prepare your final response for the user.`, MAX_RECEIVED_UUIDS = 1e4, receivedMessageUuids, receivedMessageUuidsOrder;
|
|
484946
485509
|
var init_print = __esm(() => {
|
|
485510
|
+
init_proactiveEnabled();
|
|
484947
485511
|
init_settingsSync();
|
|
484948
485512
|
init_remoteManagedSettings();
|
|
484949
485513
|
init_structuredIO();
|
|
@@ -485064,6 +485628,7 @@ var init_print = __esm(() => {
|
|
|
485064
485628
|
init_growthbook2();
|
|
485065
485629
|
init_errors();
|
|
485066
485630
|
init_paths();
|
|
485631
|
+
proactiveModule10 = isProactiveForced() ? (init_proactive(), __toCommonJS(exports_proactive)) : null;
|
|
485067
485632
|
cronSchedulerModule = isAgentTriggersForced() ? (init_cronScheduler(), __toCommonJS(exports_cronScheduler)) : null;
|
|
485068
485633
|
cronJitterConfigModule = isAgentTriggersForced() ? (init_cronJitterConfig(), __toCommonJS(exports_cronJitterConfig)) : null;
|
|
485069
485634
|
cronGate = isAgentTriggersForced() ? (init_prompt10(), __toCommonJS(exports_prompt3)) : null;
|
|
@@ -485515,13 +486080,13 @@ var exports_mcp2 = {};
|
|
|
485515
486080
|
__export(exports_mcp2, {
|
|
485516
486081
|
startMCPServer: () => startMCPServer
|
|
485517
486082
|
});
|
|
485518
|
-
async function startMCPServer(cwd3,
|
|
486083
|
+
async function startMCPServer(cwd3, debug3, verbose) {
|
|
485519
486084
|
const READ_FILE_STATE_CACHE_SIZE2 = 100;
|
|
485520
486085
|
const readFileStateCache = createFileStateCacheWithSizeLimit(READ_FILE_STATE_CACHE_SIZE2);
|
|
485521
486086
|
setCwd(cwd3);
|
|
485522
486087
|
const server2 = new Server({
|
|
485523
486088
|
name: "theus/tengu",
|
|
485524
|
-
version: { VERSION: "0.2.
|
|
486089
|
+
version: { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
485525
486090
|
}, {
|
|
485526
486091
|
capabilities: {
|
|
485527
486092
|
tools: {}
|
|
@@ -485569,7 +486134,7 @@ async function startMCPServer(cwd3, debug2, verbose) {
|
|
|
485569
486134
|
mcpClients: [],
|
|
485570
486135
|
mcpResources: {},
|
|
485571
486136
|
isNonInteractiveSession: true,
|
|
485572
|
-
debug:
|
|
486137
|
+
debug: debug3,
|
|
485573
486138
|
verbose,
|
|
485574
486139
|
agentDefinitions: { activeAgents: [], allAgents: [] }
|
|
485575
486140
|
},
|
|
@@ -485767,7 +486332,7 @@ async function checkMcpServerHealth(name, server2) {
|
|
|
485767
486332
|
}
|
|
485768
486333
|
}
|
|
485769
486334
|
async function mcpServeHandler({
|
|
485770
|
-
debug:
|
|
486335
|
+
debug: debug3,
|
|
485771
486336
|
verbose
|
|
485772
486337
|
}) {
|
|
485773
486338
|
const providedCwd = cwd3();
|
|
@@ -485788,7 +486353,7 @@ async function mcpServeHandler({
|
|
|
485788
486353
|
const {
|
|
485789
486354
|
startMCPServer: startMCPServer2
|
|
485790
486355
|
} = await Promise.resolve().then(() => (init_mcp4(), exports_mcp2));
|
|
485791
|
-
await startMCPServer2(providedCwd,
|
|
486356
|
+
await startMCPServer2(providedCwd, debug3 ?? false, verbose ?? false);
|
|
485792
486357
|
} catch (error40) {
|
|
485793
486358
|
cliError(`Error: Failed to start MCP server: ${error40}`);
|
|
485794
486359
|
}
|
|
@@ -486963,7 +487528,7 @@ async function setupTokenHandler(root2) {
|
|
|
486963
487528
|
gap: 1,
|
|
486964
487529
|
children: [
|
|
486965
487530
|
/* @__PURE__ */ jsx_runtime487.jsx(TheusBanner, {
|
|
486966
|
-
version: { VERSION: "0.2.
|
|
487531
|
+
version: { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION
|
|
486967
487532
|
}),
|
|
486968
487533
|
showAuthWarning && /* @__PURE__ */ jsx_runtime487.jsxs(ThemedBox_default, {
|
|
486969
487534
|
flexDirection: "column",
|
|
@@ -487553,7 +488118,7 @@ async function run3() {
|
|
|
487553
488118
|
}
|
|
487554
488119
|
}
|
|
487555
488120
|
const {
|
|
487556
|
-
debug:
|
|
488121
|
+
debug: debug3 = false,
|
|
487557
488122
|
debugToStderr = false,
|
|
487558
488123
|
dangerouslySkipPermissions,
|
|
487559
488124
|
allowDangerouslySkipPermissions = false,
|
|
@@ -488236,7 +488801,20 @@ ${customInstructions}` : customInstructions;
|
|
|
488236
488801
|
}
|
|
488237
488802
|
maybeActivateBrief(options2);
|
|
488238
488803
|
if (false) {}
|
|
488239
|
-
if (
|
|
488804
|
+
if (isProactiveForced() && (options2.proactive || isEnvTruthy(process.env.THEUS_CODE_PROACTIVE)) && !coordinatorModeModule?.isCoordinatorMode()) {
|
|
488805
|
+
const briefVisibility = "The user will see any text you output.";
|
|
488806
|
+
const proactivePrompt = `
|
|
488807
|
+
# Proactive Mode
|
|
488808
|
+
|
|
488809
|
+
You are in proactive mode. Take initiative \u2014 explore, act, and make progress without waiting for instructions.
|
|
488810
|
+
|
|
488811
|
+
Start by briefly greeting the user.
|
|
488812
|
+
|
|
488813
|
+
You will receive periodic <tick> prompts. These are check-ins. Do whatever seems most useful, or call Sleep if there's nothing to do. ${briefVisibility}`;
|
|
488814
|
+
appendSystemPrompt = appendSystemPrompt ? `${appendSystemPrompt}
|
|
488815
|
+
|
|
488816
|
+
${proactivePrompt}` : proactivePrompt;
|
|
488817
|
+
}
|
|
488240
488818
|
if (isKairosForced() && kairosEnabled && assistantModule) {
|
|
488241
488819
|
const assistantAddendum = assistantModule.getAssistantSystemPromptAddendum();
|
|
488242
488820
|
appendSystemPrompt = appendSystemPrompt ? `${appendSystemPrompt}
|
|
@@ -488419,7 +488997,7 @@ ${assistantAddendum}` : assistantAddendum;
|
|
|
488419
488997
|
}
|
|
488420
488998
|
}
|
|
488421
488999
|
logForDiagnosticsNoPII("info", "started", {
|
|
488422
|
-
version: { VERSION: "0.2.
|
|
489000
|
+
version: { VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", PACKAGE_URL: "theus-cli", NATIVE_PACKAGE_URL: "theus-cli-native", FEEDBACK_CHANNEL: "theus", VERSION_CHANGELOG: "", ISSUES_EXPLAINER: "report issues to the Theus maintainers" }.VERSION,
|
|
488423
489001
|
is_native_binary: isInBundledMode()
|
|
488424
489002
|
});
|
|
488425
489003
|
registerCleanup(async () => {
|
|
@@ -488429,7 +489007,7 @@ ${assistantAddendum}` : assistantAddendum;
|
|
|
488429
489007
|
hasInitialPrompt: Boolean(prompt),
|
|
488430
489008
|
hasStdin: Boolean(inputPrompt),
|
|
488431
489009
|
verbose,
|
|
488432
|
-
debug:
|
|
489010
|
+
debug: debug3,
|
|
488433
489011
|
debugToStderr,
|
|
488434
489012
|
print: print ?? false,
|
|
488435
489013
|
outputFormat: outputFormat ?? "text",
|
|
@@ -488844,7 +489422,7 @@ ${assistantAddendum}` : assistantAddendum;
|
|
|
488844
489422
|
const sessionUploaderPromise = null;
|
|
488845
489423
|
const uploaderReady = sessionUploaderPromise ? sessionUploaderPromise.then((mod) => mod.createSessionTurnUploader()).catch(() => null) : null;
|
|
488846
489424
|
const sessionConfig = {
|
|
488847
|
-
debug:
|
|
489425
|
+
debug: debug3 || debugToStderr,
|
|
488848
489426
|
commands: [...commands, ...mcpCommands],
|
|
488849
489427
|
initialTools,
|
|
488850
489428
|
mcpClients,
|
|
@@ -488993,7 +489571,7 @@ ${assistantAddendum}` : assistantAddendum;
|
|
|
488993
489571
|
stats: stats2,
|
|
488994
489572
|
initialState: assistantInitialState
|
|
488995
489573
|
}, {
|
|
488996
|
-
debug:
|
|
489574
|
+
debug: debug3 || debugToStderr,
|
|
488997
489575
|
commands: remoteCommands,
|
|
488998
489576
|
initialTools: [],
|
|
488999
489577
|
initialMessages: [infoMessage],
|
|
@@ -489103,7 +489681,7 @@ Usage: theus --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
489103
489681
|
stats: stats2,
|
|
489104
489682
|
initialState: remoteInitialState
|
|
489105
489683
|
}, {
|
|
489106
|
-
debug:
|
|
489684
|
+
debug: debug3 || debugToStderr,
|
|
489107
489685
|
commands: remoteCommands,
|
|
489108
489686
|
initialTools: [],
|
|
489109
489687
|
initialMessages: initialUserMessage ? [remoteInfoMessage, initialUserMessage] : [remoteInfoMessage],
|
|
@@ -489287,7 +489865,7 @@ Usage: theus --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
489287
489865
|
pendingHookMessages
|
|
489288
489866
|
}, renderAndRun);
|
|
489289
489867
|
}
|
|
489290
|
-
}).version(`${{ VERSION: "0.2.
|
|
489868
|
+
}).version(`${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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");
|
|
489291
489869
|
program2.option("-w, --worktree [name]", "Crea un nuevo worktree de git para esta sesi\xF3n (opcionalmente indica un nombre)");
|
|
489292
489870
|
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.");
|
|
489293
489871
|
if (canUserConfigureAdvisor()) {
|
|
@@ -489295,7 +489873,9 @@ Usage: theus --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
489295
489873
|
}
|
|
489296
489874
|
if (false) {}
|
|
489297
489875
|
if (false) {}
|
|
489298
|
-
if (
|
|
489876
|
+
if (isProactiveForced()) {
|
|
489877
|
+
program2.addOption(new Option("--proactive", "Inicia en modo proactivo aut\xF3nomo"));
|
|
489878
|
+
}
|
|
489299
489879
|
if (false) {}
|
|
489300
489880
|
if (false) {}
|
|
489301
489881
|
if (isKairosForced()) {
|
|
@@ -489329,14 +489909,14 @@ Usage: theus --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
489329
489909
|
}
|
|
489330
489910
|
const mcp2 = program2.command("mcp").description("Configura y gestiona servidores MCP").configureHelp(createSortedHelpConfig()).enablePositionalOptions();
|
|
489331
489911
|
mcp2.command("serve").description(`Start the Theus MCP server`).option("-d, --debug", "Enable debug mode", () => true).option("--verbose", "Anula el ajuste de modo detallado de la configuraci\xF3n", () => true).action(async ({
|
|
489332
|
-
debug:
|
|
489912
|
+
debug: debug3,
|
|
489333
489913
|
verbose
|
|
489334
489914
|
}) => {
|
|
489335
489915
|
const {
|
|
489336
489916
|
mcpServeHandler: mcpServeHandler2
|
|
489337
489917
|
} = await Promise.resolve().then(() => (init_mcp5(), exports_mcp3));
|
|
489338
489918
|
await mcpServeHandler2({
|
|
489339
|
-
debug:
|
|
489919
|
+
debug: debug3,
|
|
489340
489920
|
verbose
|
|
489341
489921
|
});
|
|
489342
489922
|
});
|
|
@@ -489554,7 +490134,7 @@ async function logTenguInit({
|
|
|
489554
490134
|
hasInitialPrompt,
|
|
489555
490135
|
hasStdin,
|
|
489556
490136
|
verbose,
|
|
489557
|
-
debug:
|
|
490137
|
+
debug: debug3,
|
|
489558
490138
|
debugToStderr,
|
|
489559
490139
|
print,
|
|
489560
490140
|
outputFormat,
|
|
@@ -489580,7 +490160,7 @@ async function logTenguInit({
|
|
|
489580
490160
|
hasInitialPrompt,
|
|
489581
490161
|
hasStdin,
|
|
489582
490162
|
verbose,
|
|
489583
|
-
debug:
|
|
490163
|
+
debug: debug3,
|
|
489584
490164
|
debugToStderr,
|
|
489585
490165
|
print,
|
|
489586
490166
|
outputFormat,
|
|
@@ -489618,7 +490198,12 @@ async function logTenguInit({
|
|
|
489618
490198
|
}
|
|
489619
490199
|
}
|
|
489620
490200
|
function maybeActivateProactive(options2) {
|
|
489621
|
-
if (
|
|
490201
|
+
if (isProactiveForced() && (options2.proactive || isEnvTruthy(process.env.THEUS_CODE_PROACTIVE))) {
|
|
490202
|
+
const proactiveModule11 = (init_proactive(), __toCommonJS(exports_proactive));
|
|
490203
|
+
if (!proactiveModule11.isProactiveActive()) {
|
|
490204
|
+
proactiveModule11.activateProactive("command");
|
|
490205
|
+
}
|
|
490206
|
+
}
|
|
489622
490207
|
}
|
|
489623
490208
|
function maybeActivateBrief(options2) {
|
|
489624
490209
|
if (true)
|
|
@@ -489663,6 +490248,7 @@ function extractTeammateOptions(options2) {
|
|
|
489663
490248
|
}
|
|
489664
490249
|
var getTeammateUtils = () => (init_teammate(), __toCommonJS(exports_teammate)), getTeammatePromptAddendum = () => __toCommonJS(exports_teammatePromptAddendum), getTeammateModeSnapshot = () => (init_teammateModeSnapshot(), __toCommonJS(exports_teammateModeSnapshot)), coordinatorModeModule = null, assistantModule, kairosGate, CURRENT_MIGRATION_VERSION = 11, _pendingAssistantChat;
|
|
489665
490250
|
var init_main4 = __esm(() => {
|
|
490251
|
+
init_proactiveEnabled();
|
|
489666
490252
|
init_startupProfiler();
|
|
489667
490253
|
init_rawRead();
|
|
489668
490254
|
init_keychainPrefetch();
|
|
@@ -489831,7 +490417,7 @@ if (false) {}
|
|
|
489831
490417
|
async function main2() {
|
|
489832
490418
|
const args = process.argv.slice(2);
|
|
489833
490419
|
if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
|
|
489834
|
-
console.log(`${{ VERSION: "0.2.
|
|
490420
|
+
console.log(`${{ VERSION: "0.2.25", BUILD_TIME: "1970-01-01T00:00:00.000Z", 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)`);
|
|
489835
490421
|
return;
|
|
489836
490422
|
}
|
|
489837
490423
|
const {
|