ur-agent 1.65.14 → 1.66.0
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/CHANGELOG.md +31 -0
- package/dist/cli.js +398 -253
- package/docs/VALIDATION.md +1 -1
- package/documentation/index.html +1 -1
- package/extensions/jetbrains-ur/build.gradle.kts +1 -1
- package/extensions/vscode-ur-inline-diffs/package.json +1 -1
- package/package.json +1 -1
- package/technical/04-tools.md +7 -0
- package/technical/06-configuration.md +21 -0
- package/technical/07-memory-and-context.md +29 -1
- package/technical/09-multi-agent.md +6 -0
- package/technical/README.md +1 -1
package/dist/cli.js
CHANGED
|
@@ -57136,8 +57136,19 @@ function normalizeAskUserQuestionInput(input) {
|
|
|
57136
57136
|
...objectValue2(input.metadata) ? { metadata: input.metadata } : {}
|
|
57137
57137
|
};
|
|
57138
57138
|
}
|
|
57139
|
-
function
|
|
57140
|
-
|
|
57139
|
+
function normalizeTaskId(value) {
|
|
57140
|
+
if (typeof value === "string" && value.length > 0)
|
|
57141
|
+
return value;
|
|
57142
|
+
if (typeof value === "number" && Number.isSafeInteger(value) && value > 0) {
|
|
57143
|
+
return String(value);
|
|
57144
|
+
}
|
|
57145
|
+
return null;
|
|
57146
|
+
}
|
|
57147
|
+
function normalizeTaskIdArray(value) {
|
|
57148
|
+
if (!Array.isArray(value))
|
|
57149
|
+
return null;
|
|
57150
|
+
const taskIds = value.map(normalizeTaskId);
|
|
57151
|
+
return taskIds.every((taskId) => taskId !== null) ? taskIds : null;
|
|
57141
57152
|
}
|
|
57142
57153
|
function numberish(value) {
|
|
57143
57154
|
return typeof value === "number" || typeof value === "string";
|
|
@@ -57187,6 +57198,27 @@ function normalizeGrepInput(input) {
|
|
|
57187
57198
|
}
|
|
57188
57199
|
return input;
|
|
57189
57200
|
}
|
|
57201
|
+
function normalizeTaskCreateInput(input) {
|
|
57202
|
+
const dependencyFields = [
|
|
57203
|
+
"blocks",
|
|
57204
|
+
"blockedBy",
|
|
57205
|
+
"addBlocks",
|
|
57206
|
+
"addBlockedBy"
|
|
57207
|
+
];
|
|
57208
|
+
if (!sameKeys(input, ["subject", "description"], ["activeForm", "metadata", ...dependencyFields]) || typeof input.subject !== "string" || typeof input.description !== "string" || input.activeForm !== undefined && typeof input.activeForm !== "string" || input.metadata !== undefined && !objectValue2(input.metadata)) {
|
|
57209
|
+
return null;
|
|
57210
|
+
}
|
|
57211
|
+
const normalizedDependencies = {};
|
|
57212
|
+
for (const field of dependencyFields) {
|
|
57213
|
+
if (input[field] === undefined)
|
|
57214
|
+
continue;
|
|
57215
|
+
const taskIds = normalizeTaskIdArray(input[field]);
|
|
57216
|
+
if (!taskIds)
|
|
57217
|
+
return null;
|
|
57218
|
+
normalizedDependencies[field] = taskIds;
|
|
57219
|
+
}
|
|
57220
|
+
return { ...input, ...normalizedDependencies };
|
|
57221
|
+
}
|
|
57190
57222
|
function normalizeTaskUpdateInput(input) {
|
|
57191
57223
|
const updateFields = [
|
|
57192
57224
|
"subject",
|
|
@@ -57198,11 +57230,28 @@ function normalizeTaskUpdateInput(input) {
|
|
|
57198
57230
|
"owner",
|
|
57199
57231
|
"metadata"
|
|
57200
57232
|
];
|
|
57201
|
-
const allowedStatuses = new Set([
|
|
57202
|
-
|
|
57233
|
+
const allowedStatuses = new Set([
|
|
57234
|
+
"pending",
|
|
57235
|
+
"in_progress",
|
|
57236
|
+
"completed",
|
|
57237
|
+
"failed",
|
|
57238
|
+
"skipped",
|
|
57239
|
+
"deleted"
|
|
57240
|
+
]);
|
|
57241
|
+
const taskId = normalizeTaskId(input.taskId);
|
|
57242
|
+
if (!sameKeys(input, ["taskId"], updateFields) || !taskId || !updateFields.some((field) => Object.prototype.hasOwnProperty.call(input, field)) || input.subject !== undefined && typeof input.subject !== "string" || input.description !== undefined && typeof input.description !== "string" || input.activeForm !== undefined && typeof input.activeForm !== "string" || input.status !== undefined && (typeof input.status !== "string" || !allowedStatuses.has(input.status)) || input.owner !== undefined && typeof input.owner !== "string" || input.metadata !== undefined && !objectValue2(input.metadata)) {
|
|
57203
57243
|
return null;
|
|
57204
57244
|
}
|
|
57205
|
-
|
|
57245
|
+
const addBlocks = input.addBlocks === undefined ? undefined : normalizeTaskIdArray(input.addBlocks);
|
|
57246
|
+
const addBlockedBy = input.addBlockedBy === undefined ? undefined : normalizeTaskIdArray(input.addBlockedBy);
|
|
57247
|
+
if (addBlocks === null || addBlockedBy === null)
|
|
57248
|
+
return null;
|
|
57249
|
+
return {
|
|
57250
|
+
...input,
|
|
57251
|
+
taskId,
|
|
57252
|
+
...addBlocks === undefined ? {} : { addBlocks },
|
|
57253
|
+
...addBlockedBy === undefined ? {} : { addBlockedBy }
|
|
57254
|
+
};
|
|
57206
57255
|
}
|
|
57207
57256
|
function maybeBareJsonToolCall(text, availableToolNames, index2) {
|
|
57208
57257
|
const input = parseJsonObject(text);
|
|
@@ -57223,12 +57272,15 @@ function maybeBareJsonToolCall(text, availableToolNames, index2) {
|
|
|
57223
57272
|
input: name === "AskUserQuestion" ? normalizeAskQuestionHeaders(wrappedInput) : wrappedInput
|
|
57224
57273
|
};
|
|
57225
57274
|
}
|
|
57226
|
-
if (hasTool(availableToolNames, "TaskCreate")
|
|
57227
|
-
|
|
57228
|
-
|
|
57229
|
-
|
|
57230
|
-
|
|
57231
|
-
|
|
57275
|
+
if (hasTool(availableToolNames, "TaskCreate")) {
|
|
57276
|
+
const taskCreateInput = normalizeTaskCreateInput(input);
|
|
57277
|
+
if (taskCreateInput) {
|
|
57278
|
+
return {
|
|
57279
|
+
id: parsedToolCallId("bare", index2),
|
|
57280
|
+
name: "TaskCreate",
|
|
57281
|
+
input: taskCreateInput
|
|
57282
|
+
};
|
|
57283
|
+
}
|
|
57232
57284
|
}
|
|
57233
57285
|
if (hasTool(availableToolNames, "Write") && hasRequiredKeys(input, ["file_path", "content"]) && typeof input.file_path === "string" && typeof input.content === "string") {
|
|
57234
57286
|
return {
|
|
@@ -57312,7 +57364,7 @@ function looksLikeBareJsonToolCallPrefix(text) {
|
|
|
57312
57364
|
return true;
|
|
57313
57365
|
if (!trimmed.startsWith("{"))
|
|
57314
57366
|
return false;
|
|
57315
|
-
return /^\{\s*"(?:tool|input|subject|description|file_path|content|old_string|new_string|replace_all|questions|command|taskId|status|pattern|path|glob)"\s*:/.test(trimmed);
|
|
57367
|
+
return /^\{\s*"(?:tool|input|subject|description|activeForm|metadata|blocks|blockedBy|addBlocks|addBlockedBy|owner|file_path|content|old_string|new_string|replace_all|questions|command|taskId|status|pattern|path|glob)"\s*:/.test(trimmed);
|
|
57316
57368
|
}
|
|
57317
57369
|
function parseBareJsonToolCalls(text, options) {
|
|
57318
57370
|
if (!text || !options.parseBareJsonToolCalls)
|
|
@@ -75561,7 +75613,7 @@ var init_auth = __esm(() => {
|
|
|
75561
75613
|
|
|
75562
75614
|
// src/utils/userAgent.ts
|
|
75563
75615
|
function getURCodeUserAgent() {
|
|
75564
|
-
return `ur/${"1.
|
|
75616
|
+
return `ur/${"1.66.0"}`;
|
|
75565
75617
|
}
|
|
75566
75618
|
|
|
75567
75619
|
// src/utils/workloadContext.ts
|
|
@@ -75583,7 +75635,7 @@ function getUserAgent() {
|
|
|
75583
75635
|
const clientApp = process.env.UR_AGENT_SDK_CLIENT_APP ? `, client-app/${process.env.UR_AGENT_SDK_CLIENT_APP}` : "";
|
|
75584
75636
|
const workload = getWorkload();
|
|
75585
75637
|
const workloadSuffix = workload ? `, workload/${workload}` : "";
|
|
75586
|
-
return `ur-cli/${"1.
|
|
75638
|
+
return `ur-cli/${"1.66.0"} (${process.env.USER_TYPE}, ${process.env.UR_CODE_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
|
|
75587
75639
|
}
|
|
75588
75640
|
function getMCPUserAgent() {
|
|
75589
75641
|
const parts = [];
|
|
@@ -75597,7 +75649,7 @@ function getMCPUserAgent() {
|
|
|
75597
75649
|
parts.push(`client-app/${process.env.UR_AGENT_SDK_CLIENT_APP}`);
|
|
75598
75650
|
}
|
|
75599
75651
|
const suffix = parts.length > 0 ? ` (${parts.join(", ")})` : "";
|
|
75600
|
-
return `ur/${"1.
|
|
75652
|
+
return `ur/${"1.66.0"}${suffix}`;
|
|
75601
75653
|
}
|
|
75602
75654
|
function getWebFetchUserAgent() {
|
|
75603
75655
|
return `UR-User (${getURCodeUserAgent()})`;
|
|
@@ -75735,7 +75787,7 @@ var init_user = __esm(() => {
|
|
|
75735
75787
|
deviceId,
|
|
75736
75788
|
sessionId: getSessionId(),
|
|
75737
75789
|
email: getEmail(),
|
|
75738
|
-
appVersion: "1.
|
|
75790
|
+
appVersion: "1.66.0",
|
|
75739
75791
|
platform: getHostPlatformForAnalytics(),
|
|
75740
75792
|
organizationUuid,
|
|
75741
75793
|
accountUuid,
|
|
@@ -83935,7 +83987,7 @@ var init_metadata = __esm(() => {
|
|
|
83935
83987
|
COMPOUND_OPERATOR_REGEX = /\s*(?:&&|\|\||[;|])\s*/;
|
|
83936
83988
|
WHITESPACE_REGEX = /\s+/;
|
|
83937
83989
|
getVersionBase = memoize_default(() => {
|
|
83938
|
-
const match = "1.
|
|
83990
|
+
const match = "1.66.0".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
|
|
83939
83991
|
return match ? match[0] : undefined;
|
|
83940
83992
|
});
|
|
83941
83993
|
buildEnvContext = memoize_default(async () => {
|
|
@@ -83975,7 +84027,7 @@ var init_metadata = __esm(() => {
|
|
|
83975
84027
|
isGithubAction: isEnvTruthy(process.env.GITHUB_ACTIONS),
|
|
83976
84028
|
isURCodeAction: isEnvTruthy(process.env.UR_CODE_ACTION),
|
|
83977
84029
|
isURAiAuth: isURAISubscriber(),
|
|
83978
|
-
version: "1.
|
|
84030
|
+
version: "1.66.0",
|
|
83979
84031
|
versionBase: getVersionBase(),
|
|
83980
84032
|
buildTime: "",
|
|
83981
84033
|
deploymentEnvironment: env2.detectDeploymentEnvironment(),
|
|
@@ -84645,7 +84697,7 @@ function initialize1PEventLogging() {
|
|
|
84645
84697
|
const platform2 = getPlatform();
|
|
84646
84698
|
const attributes = {
|
|
84647
84699
|
[import_semantic_conventions4.ATTR_SERVICE_NAME]: "ur",
|
|
84648
|
-
[import_semantic_conventions4.ATTR_SERVICE_VERSION]: "1.
|
|
84700
|
+
[import_semantic_conventions4.ATTR_SERVICE_VERSION]: "1.66.0"
|
|
84649
84701
|
};
|
|
84650
84702
|
if (platform2 === "wsl") {
|
|
84651
84703
|
const wslVersion = getWslVersion();
|
|
@@ -84673,7 +84725,7 @@ function initialize1PEventLogging() {
|
|
|
84673
84725
|
})
|
|
84674
84726
|
]
|
|
84675
84727
|
});
|
|
84676
|
-
firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.urhq.ur.events", "1.
|
|
84728
|
+
firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.urhq.ur.events", "1.66.0");
|
|
84677
84729
|
}
|
|
84678
84730
|
async function reinitialize1PEventLoggingIfConfigChanged() {
|
|
84679
84731
|
if (!is1PEventLoggingEnabled() || !firstPartyEventLoggerProvider) {
|
|
@@ -94561,7 +94613,7 @@ function formatAgentTrendReport(report = buildAgentTrendReport()) {
|
|
|
94561
94613
|
function formatA2AAgentCard(options = {}, pretty = true) {
|
|
94562
94614
|
return JSON.stringify(buildA2AAgentCard(options), null, pretty ? 2 : 0);
|
|
94563
94615
|
}
|
|
94564
|
-
var urVersion = "1.
|
|
94616
|
+
var urVersion = "1.66.0", researchSnapshotDate = "2026-07-15", coverage, priorityRoadmap;
|
|
94565
94617
|
var init_trends = __esm(() => {
|
|
94566
94618
|
init_a2aCardSignature();
|
|
94567
94619
|
coverage = [
|
|
@@ -97364,7 +97416,7 @@ function getAttributionHeader(fingerprint) {
|
|
|
97364
97416
|
if (!isAttributionHeaderEnabled()) {
|
|
97365
97417
|
return "";
|
|
97366
97418
|
}
|
|
97367
|
-
const version2 = `${"1.
|
|
97419
|
+
const version2 = `${"1.66.0"}.${fingerprint}`;
|
|
97368
97420
|
const entrypoint = process.env.UR_CODE_ENTRYPOINT ?? "unknown";
|
|
97369
97421
|
const cch = "";
|
|
97370
97422
|
const workload = getWorkload();
|
|
@@ -155237,7 +155289,7 @@ var init_projectSafety = __esm(() => {
|
|
|
155237
155289
|
function getInstruments() {
|
|
155238
155290
|
if (instruments)
|
|
155239
155291
|
return instruments;
|
|
155240
|
-
const meter = import_api10.metrics.getMeter("ur-agent.gen_ai", "1.
|
|
155292
|
+
const meter = import_api10.metrics.getMeter("ur-agent.gen_ai", "1.66.0");
|
|
155241
155293
|
instruments = {
|
|
155242
155294
|
operationDuration: meter.createHistogram("gen_ai.client.operation.duration", {
|
|
155243
155295
|
description: "GenAI operation duration.",
|
|
@@ -155335,7 +155387,7 @@ function genAiAgentAttributes() {
|
|
|
155335
155387
|
"gen_ai.operation.name": GEN_AI_OPERATION_INVOKE_AGENT,
|
|
155336
155388
|
"gen_ai.provider.name": "ur",
|
|
155337
155389
|
"gen_ai.agent.name": "UR-Nexus",
|
|
155338
|
-
"gen_ai.agent.version": "1.
|
|
155390
|
+
"gen_ai.agent.version": "1.66.0"
|
|
155339
155391
|
};
|
|
155340
155392
|
}
|
|
155341
155393
|
function genAiWorkflowAttributes(workflowName) {
|
|
@@ -155351,7 +155403,7 @@ function genAiWorkflowAttributes(workflowName) {
|
|
|
155351
155403
|
function startGenAiWorkflowSpan(workflowName) {
|
|
155352
155404
|
const attributes = genAiWorkflowAttributes(workflowName);
|
|
155353
155405
|
const name = typeof attributes["gen_ai.workflow.name"] === "string" ? `invoke_workflow ${attributes["gen_ai.workflow.name"]}` : GEN_AI_OPERATION_INVOKE_WORKFLOW;
|
|
155354
|
-
return import_api10.trace.getTracer("ur-agent.gen_ai", "1.
|
|
155406
|
+
return import_api10.trace.getTracer("ur-agent.gen_ai", "1.66.0").startSpan(name, { kind: import_api10.SpanKind.INTERNAL, attributes });
|
|
155355
155407
|
}
|
|
155356
155408
|
function endGenAiWorkflowSpan(span, options2 = {}) {
|
|
155357
155409
|
try {
|
|
@@ -155389,7 +155441,7 @@ function startGenAiMemorySpan(operation, options2 = {}) {
|
|
|
155389
155441
|
if (options2.recordCount !== undefined && Number.isInteger(options2.recordCount) && options2.recordCount >= 0) {
|
|
155390
155442
|
attributes["gen_ai.memory.record.count"] = options2.recordCount;
|
|
155391
155443
|
}
|
|
155392
|
-
return import_api10.trace.getTracer("ur-agent.gen_ai", "1.
|
|
155444
|
+
return import_api10.trace.getTracer("ur-agent.gen_ai", "1.66.0").startSpan(operation, { kind: import_api10.SpanKind.INTERNAL, attributes });
|
|
155393
155445
|
}
|
|
155394
155446
|
function endGenAiMemorySpan(span, options2 = {}) {
|
|
155395
155447
|
try {
|
|
@@ -248872,7 +248924,7 @@ function getTelemetryAttributes() {
|
|
|
248872
248924
|
attributes["session.id"] = sessionId;
|
|
248873
248925
|
}
|
|
248874
248926
|
if (shouldIncludeAttribute("OTEL_METRICS_INCLUDE_VERSION")) {
|
|
248875
|
-
attributes["app.version"] = "1.
|
|
248927
|
+
attributes["app.version"] = "1.66.0";
|
|
248876
248928
|
}
|
|
248877
248929
|
const oauthAccount = getOauthAccountInfo();
|
|
248878
248930
|
if (oauthAccount) {
|
|
@@ -295352,7 +295404,7 @@ function getInstallationEnv() {
|
|
|
295352
295404
|
return;
|
|
295353
295405
|
}
|
|
295354
295406
|
function getURCodeVersion() {
|
|
295355
|
-
return "1.
|
|
295407
|
+
return "1.66.0";
|
|
295356
295408
|
}
|
|
295357
295409
|
async function getInstalledVSCodeExtensionVersion(command) {
|
|
295358
295410
|
const { stdout } = await execFileNoThrow(command, ["--list-extensions", "--show-versions"], {
|
|
@@ -302683,7 +302735,7 @@ async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) {
|
|
|
302683
302735
|
const client2 = new Client({
|
|
302684
302736
|
name: "ur",
|
|
302685
302737
|
title: "UR",
|
|
302686
|
-
version: "1.
|
|
302738
|
+
version: "1.66.0",
|
|
302687
302739
|
description: "UR-Nexus autonomous engineering workflow engine",
|
|
302688
302740
|
websiteUrl: PRODUCT_URL
|
|
302689
302741
|
}, {
|
|
@@ -303043,7 +303095,7 @@ var init_client5 = __esm(() => {
|
|
|
303043
303095
|
const client2 = new Client({
|
|
303044
303096
|
name: "ur",
|
|
303045
303097
|
title: "UR",
|
|
303046
|
-
version: "1.
|
|
303098
|
+
version: "1.66.0",
|
|
303047
303099
|
description: "UR-Nexus autonomous engineering workflow engine",
|
|
303048
303100
|
websiteUrl: PRODUCT_URL
|
|
303049
303101
|
}, {
|
|
@@ -315582,7 +315634,7 @@ async function createRuntime() {
|
|
|
315582
315634
|
bootstrapTelemetry();
|
|
315583
315635
|
const resource = defaultResource().merge(detectResources({ detectors: [envDetector] })).merge(resourceFromAttributes({
|
|
315584
315636
|
[import_semantic_conventions7.ATTR_SERVICE_NAME]: "ur-agent",
|
|
315585
|
-
[import_semantic_conventions7.ATTR_SERVICE_VERSION]: "1.
|
|
315637
|
+
[import_semantic_conventions7.ATTR_SERVICE_VERSION]: "1.66.0"
|
|
315586
315638
|
}));
|
|
315587
315639
|
const tracerProvider = exporters.traces.length > 0 ? new BasicTracerProvider({
|
|
315588
315640
|
resource,
|
|
@@ -315615,11 +315667,11 @@ async function createRuntime() {
|
|
|
315615
315667
|
setMeterProvider(meterProvider);
|
|
315616
315668
|
setLoggerProvider(loggerProvider);
|
|
315617
315669
|
if (meterProvider) {
|
|
315618
|
-
const meter = meterProvider.getMeter("ur-agent", "1.
|
|
315670
|
+
const meter = meterProvider.getMeter("ur-agent", "1.66.0");
|
|
315619
315671
|
setMeter(meter, (name, options2) => meter.createCounter(name, options2));
|
|
315620
315672
|
}
|
|
315621
315673
|
if (loggerProvider) {
|
|
315622
|
-
setEventLogger(loggerProvider.getLogger("ur-agent.events", "1.
|
|
315674
|
+
setEventLogger(loggerProvider.getLogger("ur-agent.events", "1.66.0"));
|
|
315623
315675
|
}
|
|
315624
315676
|
if (!cleanupRegistered2) {
|
|
315625
315677
|
cleanupRegistered2 = true;
|
|
@@ -316281,9 +316333,9 @@ async function assertMinVersion() {
|
|
|
316281
316333
|
if (false) {}
|
|
316282
316334
|
try {
|
|
316283
316335
|
const versionConfig = await getDynamicConfig_BLOCKS_ON_INIT("tengu_version_config", { minVersion: "0.0.0" });
|
|
316284
|
-
if (versionConfig.minVersion && lt("1.
|
|
316336
|
+
if (versionConfig.minVersion && lt("1.66.0", versionConfig.minVersion)) {
|
|
316285
316337
|
console.error(`
|
|
316286
|
-
It looks like your version of UR (${"1.
|
|
316338
|
+
It looks like your version of UR (${"1.66.0"}) needs an update.
|
|
316287
316339
|
A newer version (${versionConfig.minVersion} or higher) is required to continue.
|
|
316288
316340
|
|
|
316289
316341
|
To update, please run:
|
|
@@ -316499,7 +316551,7 @@ async function installGlobalPackage(specificVersion) {
|
|
|
316499
316551
|
logError2(new AutoUpdaterError("Another process is currently installing an update"));
|
|
316500
316552
|
logEvent("tengu_auto_updater_lock_contention", {
|
|
316501
316553
|
pid: process.pid,
|
|
316502
|
-
currentVersion: "1.
|
|
316554
|
+
currentVersion: "1.66.0"
|
|
316503
316555
|
});
|
|
316504
316556
|
return "in_progress";
|
|
316505
316557
|
}
|
|
@@ -316508,7 +316560,7 @@ async function installGlobalPackage(specificVersion) {
|
|
|
316508
316560
|
if (!env2.isRunningWithBun() && env2.isNpmFromWindowsPath()) {
|
|
316509
316561
|
logError2(new Error("Windows NPM detected in WSL environment"));
|
|
316510
316562
|
logEvent("tengu_auto_updater_windows_npm_in_wsl", {
|
|
316511
|
-
currentVersion: "1.
|
|
316563
|
+
currentVersion: "1.66.0"
|
|
316512
316564
|
});
|
|
316513
316565
|
console.error(`
|
|
316514
316566
|
Error: Windows NPM detected in WSL
|
|
@@ -317043,7 +317095,7 @@ function detectLinuxGlobPatternWarnings() {
|
|
|
317043
317095
|
}
|
|
317044
317096
|
async function getDoctorDiagnostic() {
|
|
317045
317097
|
const installationType = await getCurrentInstallationType();
|
|
317046
|
-
const version2 = typeof MACRO !== "undefined" ? "1.
|
|
317098
|
+
const version2 = typeof MACRO !== "undefined" ? "1.66.0" : "unknown";
|
|
317047
317099
|
const installationPath = await getInstallationPath();
|
|
317048
317100
|
const invokedBinary = getInvokedBinary();
|
|
317049
317101
|
const multipleInstallations = await detectMultipleInstallations();
|
|
@@ -317978,8 +318030,8 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
|
|
|
317978
318030
|
const maxVersion = await getMaxVersion();
|
|
317979
318031
|
if (maxVersion && gt(version2, maxVersion)) {
|
|
317980
318032
|
logForDebugging(`Native installer: maxVersion ${maxVersion} is set, capping update from ${version2} to ${maxVersion}`);
|
|
317981
|
-
if (gte("1.
|
|
317982
|
-
logForDebugging(`Native installer: current version ${"1.
|
|
318033
|
+
if (gte("1.66.0", maxVersion)) {
|
|
318034
|
+
logForDebugging(`Native installer: current version ${"1.66.0"} is already at or above maxVersion ${maxVersion}, skipping update`);
|
|
317983
318035
|
logEvent("tengu_native_update_skipped_max_version", {
|
|
317984
318036
|
latency_ms: Date.now() - startTime,
|
|
317985
318037
|
max_version: maxVersion,
|
|
@@ -317990,7 +318042,7 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
|
|
|
317990
318042
|
version2 = maxVersion;
|
|
317991
318043
|
}
|
|
317992
318044
|
}
|
|
317993
|
-
if (!forceReinstall && version2 === "1.
|
|
318045
|
+
if (!forceReinstall && version2 === "1.66.0" && await versionIsAvailable(version2) && await isPossibleURBinary(executablePath)) {
|
|
317994
318046
|
logForDebugging(`Found ${version2} at ${executablePath}, skipping install`);
|
|
317995
318047
|
logEvent("tengu_native_update_complete", {
|
|
317996
318048
|
latency_ms: Date.now() - startTime,
|
|
@@ -322008,6 +322060,7 @@ var init_coreSchemas = __esm(() => {
|
|
|
322008
322060
|
compact_metadata: exports_external.object({
|
|
322009
322061
|
trigger: exports_external.enum(["manual", "auto"]),
|
|
322010
322062
|
pre_tokens: exports_external.number(),
|
|
322063
|
+
task_gate_free_calls_consumed: exports_external.boolean().optional(),
|
|
322011
322064
|
preserved_segment: exports_external.object({
|
|
322012
322065
|
head_uuid: UUIDPlaceholder(),
|
|
322013
322066
|
anchor_uuid: UUIDPlaceholder(),
|
|
@@ -323224,6 +323277,9 @@ The user interacts primarily with the team lead. Your work is coordinated throug
|
|
|
323224
323277
|
`;
|
|
323225
323278
|
|
|
323226
323279
|
// src/utils/swarm/inProcessRunner.ts
|
|
323280
|
+
function appendTeammateMirrorMessage(previous, message) {
|
|
323281
|
+
return appendCappedMessage(isCompactBoundaryMessage(message) ? [] : previous, message);
|
|
323282
|
+
}
|
|
323227
323283
|
function createInProcessCanUseTool(identity5, abortController, onPermissionWaitMs) {
|
|
323228
323284
|
return async (tool, input, toolUseContext, assistantMessage, toolUseID, forceDecision) => {
|
|
323229
323285
|
const result = forceDecision ?? await hasPermissionsToUseTool(tool, input, toolUseContext, assistantMessage, toolUseID);
|
|
@@ -323705,32 +323761,7 @@ ${customPrompt}`);
|
|
|
323705
323761
|
updateTaskState2(taskId, (task) => ({ ...task, currentWorkAbortController }), setAppState);
|
|
323706
323762
|
const userMessage = createUserMessage({ content: currentPrompt });
|
|
323707
323763
|
const promptMessages = [userMessage];
|
|
323708
|
-
|
|
323709
|
-
const tokenCount = tokenCountWithEstimation(allMessages);
|
|
323710
|
-
if (tokenCount > getAutoCompactThreshold(toolUseContext.options.mainLoopModel)) {
|
|
323711
|
-
logForDebugging(`[inProcessRunner] ${identity5.agentId} compacting history (${tokenCount} tokens)`);
|
|
323712
|
-
const isolatedContext = {
|
|
323713
|
-
...toolUseContext,
|
|
323714
|
-
readFileState: cloneFileStateCache(toolUseContext.readFileState),
|
|
323715
|
-
onCompactProgress: undefined,
|
|
323716
|
-
setStreamMode: undefined
|
|
323717
|
-
};
|
|
323718
|
-
const compactedSummary = await compactConversation(allMessages, isolatedContext, {
|
|
323719
|
-
systemPrompt: asSystemPrompt([]),
|
|
323720
|
-
userContext: {},
|
|
323721
|
-
systemContext: {},
|
|
323722
|
-
toolUseContext: isolatedContext,
|
|
323723
|
-
forkContextMessages: []
|
|
323724
|
-
}, true, undefined, true);
|
|
323725
|
-
contextMessages = buildPostCompactMessages(compactedSummary);
|
|
323726
|
-
resetMicrocompactState();
|
|
323727
|
-
if (teammateReplacementState) {
|
|
323728
|
-
teammateReplacementState = createContentReplacementState();
|
|
323729
|
-
}
|
|
323730
|
-
allMessages.length = 0;
|
|
323731
|
-
allMessages.push(...contextMessages);
|
|
323732
|
-
updateTaskState2(taskId, (task) => ({ ...task, messages: [...contextMessages, userMessage] }), setAppState);
|
|
323733
|
-
}
|
|
323764
|
+
const contextMessages = allMessages;
|
|
323734
323765
|
const forkContextMessages = contextMessages.length > 0 ? [...contextMessages] : undefined;
|
|
323735
323766
|
allMessages.push(userMessage);
|
|
323736
323767
|
const tracker = createProgressTracker();
|
|
@@ -323778,6 +323809,12 @@ ${customPrompt}`);
|
|
|
323778
323809
|
break;
|
|
323779
323810
|
}
|
|
323780
323811
|
iterationMessages.push(message);
|
|
323812
|
+
if (isCompactBoundaryMessage(message)) {
|
|
323813
|
+
allMessages.length = 0;
|
|
323814
|
+
if (teammateReplacementState) {
|
|
323815
|
+
teammateReplacementState = createContentReplacementState();
|
|
323816
|
+
}
|
|
323817
|
+
}
|
|
323781
323818
|
allMessages.push(message);
|
|
323782
323819
|
updateProgressFromMessage(tracker, message, resolveActivity, toolUseContext.options.tools);
|
|
323783
323820
|
const progress = getProgressUpdate(tracker);
|
|
@@ -323808,7 +323845,7 @@ ${customPrompt}`);
|
|
|
323808
323845
|
return {
|
|
323809
323846
|
...task,
|
|
323810
323847
|
progress,
|
|
323811
|
-
messages:
|
|
323848
|
+
messages: appendTeammateMirrorMessage(task.messages, message),
|
|
323812
323849
|
inProgressToolUseIDs
|
|
323813
323850
|
};
|
|
323814
323851
|
}, setAppState);
|
|
@@ -323964,9 +324001,7 @@ var init_inProcessRunner = __esm(() => {
|
|
|
323964
324001
|
init_xml();
|
|
323965
324002
|
init_useSwarmPermissionPoller();
|
|
323966
324003
|
init_analytics();
|
|
323967
|
-
init_autoCompact();
|
|
323968
324004
|
init_compact();
|
|
323969
|
-
init_microCompact();
|
|
323970
324005
|
init_InProcessTeammateTask();
|
|
323971
324006
|
init_LocalAgentTask();
|
|
323972
324007
|
init_runAgent();
|
|
@@ -323974,11 +324009,9 @@ var init_inProcessRunner = __esm(() => {
|
|
|
323974
324009
|
init_messages();
|
|
323975
324010
|
init_diskOutput();
|
|
323976
324011
|
init_framework();
|
|
323977
|
-
init_tokens();
|
|
323978
324012
|
init_abortController();
|
|
323979
324013
|
init_agentContext();
|
|
323980
324014
|
init_debug();
|
|
323981
|
-
init_fileStateCache();
|
|
323982
324015
|
init_messages();
|
|
323983
324016
|
init_PermissionUpdate();
|
|
323984
324017
|
init_permissions2();
|
|
@@ -346258,10 +346291,10 @@ var require_is = __commonJS((exports) => {
|
|
|
346258
346291
|
return Array.isArray(value);
|
|
346259
346292
|
}
|
|
346260
346293
|
exports.array = array3;
|
|
346261
|
-
function
|
|
346294
|
+
function stringArray(value) {
|
|
346262
346295
|
return array3(value) && value.every((elem) => string5(elem));
|
|
346263
346296
|
}
|
|
346264
|
-
exports.stringArray =
|
|
346297
|
+
exports.stringArray = stringArray;
|
|
346265
346298
|
});
|
|
346266
346299
|
|
|
346267
346300
|
// node_modules/vscode-jsonrpc/lib/common/messages.js
|
|
@@ -388103,7 +388136,7 @@ function isAnyTracingEnabled() {
|
|
|
388103
388136
|
return isTelemetryEnabled() || isEnhancedTelemetryEnabled() || isBetaTracingEnabled();
|
|
388104
388137
|
}
|
|
388105
388138
|
function getTracer() {
|
|
388106
|
-
return import_api39.trace.getTracer("ur-agent.gen_ai", "1.
|
|
388139
|
+
return import_api39.trace.getTracer("ur-agent.gen_ai", "1.66.0");
|
|
388107
388140
|
}
|
|
388108
388141
|
function createSpanAttributes(spanType, customAttributes = {}) {
|
|
388109
388142
|
const baseAttributes = getTelemetryAttributes();
|
|
@@ -390175,7 +390208,12 @@ function countToolCalls(messages, excludedMessageId) {
|
|
|
390175
390208
|
if (!Array.isArray(messages))
|
|
390176
390209
|
return 0;
|
|
390177
390210
|
let count3 = 0;
|
|
390211
|
+
let freeCallsConsumed = false;
|
|
390178
390212
|
for (const message of messages) {
|
|
390213
|
+
const compactBoundary = message;
|
|
390214
|
+
if (compactBoundary.type === "system" && compactBoundary.subtype === "compact_boundary" && compactBoundary.compactMetadata?.taskGateFreeCallsConsumed === true) {
|
|
390215
|
+
freeCallsConsumed = true;
|
|
390216
|
+
}
|
|
390179
390217
|
const envelope = message?.message;
|
|
390180
390218
|
if (excludedMessageId !== undefined && envelope?.id === excludedMessageId) {
|
|
390181
390219
|
continue;
|
|
@@ -390188,11 +390226,13 @@ function countToolCalls(messages, excludedMessageId) {
|
|
|
390188
390226
|
count3++;
|
|
390189
390227
|
}
|
|
390190
390228
|
}
|
|
390191
|
-
return count3;
|
|
390229
|
+
return freeCallsConsumed ? TASK_GATE_FREE_CALL_COUNT_SATURATION : count3;
|
|
390192
390230
|
}
|
|
390193
390231
|
function countToolCallsBeforeCurrent(messages, assistantMessage, toolUseID) {
|
|
390194
390232
|
const currentMessageId = assistantMessage.message?.id;
|
|
390195
390233
|
let count3 = countToolCalls(messages, typeof currentMessageId === "string" ? currentMessageId : undefined);
|
|
390234
|
+
if (count3 === TASK_GATE_FREE_CALL_COUNT_SATURATION)
|
|
390235
|
+
return count3;
|
|
390196
390236
|
const currentContent = assistantMessage.message?.content;
|
|
390197
390237
|
if (!Array.isArray(currentContent))
|
|
390198
390238
|
return count3;
|
|
@@ -391556,7 +391596,7 @@ async function checkPermissionsAndCallTool(tool, toolUseID, input, toolUseContex
|
|
|
391556
391596
|
}
|
|
391557
391597
|
}
|
|
391558
391598
|
}
|
|
391559
|
-
var HOOK_TIMING_DISPLAY_THRESHOLD_MS2 = 500, SLOW_PHASE_LOG_THRESHOLD_MS = 2000;
|
|
391599
|
+
var TASK_GATE_FREE_CALL_COUNT_SATURATION, HOOK_TIMING_DISPLAY_THRESHOLD_MS2 = 500, SLOW_PHASE_LOG_THRESHOLD_MS = 2000;
|
|
391560
391600
|
var init_toolExecution = __esm(() => {
|
|
391561
391601
|
init_analytics();
|
|
391562
391602
|
init_metadata();
|
|
@@ -391594,6 +391634,7 @@ var init_toolExecution = __esm(() => {
|
|
|
391594
391634
|
init_mcpStringUtils();
|
|
391595
391635
|
init_utils3();
|
|
391596
391636
|
init_toolHooks();
|
|
391637
|
+
TASK_GATE_FREE_CALL_COUNT_SATURATION = Number.MAX_SAFE_INTEGER;
|
|
391597
391638
|
});
|
|
391598
391639
|
|
|
391599
391640
|
// src/services/tools/StreamingToolExecutor.ts
|
|
@@ -396309,6 +396350,10 @@ async function compactConversation(messages, context5, cacheSafeParams, suppress
|
|
|
396309
396350
|
if (planAttachment) {
|
|
396310
396351
|
postCompactFileAttachments.push(planAttachment);
|
|
396311
396352
|
}
|
|
396353
|
+
const taskStateAttachment = await createTaskStateAttachmentIfNeeded(context5);
|
|
396354
|
+
if (taskStateAttachment) {
|
|
396355
|
+
postCompactFileAttachments.push(taskStateAttachment);
|
|
396356
|
+
}
|
|
396312
396357
|
const planModeAttachment = await createPlanModeAttachmentIfNeeded(context5);
|
|
396313
396358
|
if (planModeAttachment) {
|
|
396314
396359
|
postCompactFileAttachments.push(planModeAttachment);
|
|
@@ -396533,6 +396578,10 @@ User context: ${userFeedback}`;
|
|
|
396533
396578
|
if (planAttachment) {
|
|
396534
396579
|
postCompactFileAttachments.push(planAttachment);
|
|
396535
396580
|
}
|
|
396581
|
+
const taskStateAttachment = await createTaskStateAttachmentIfNeeded(context5);
|
|
396582
|
+
if (taskStateAttachment) {
|
|
396583
|
+
postCompactFileAttachments.push(taskStateAttachment);
|
|
396584
|
+
}
|
|
396536
396585
|
const planModeAttachment = await createPlanModeAttachmentIfNeeded(context5);
|
|
396537
396586
|
if (planModeAttachment) {
|
|
396538
396587
|
postCompactFileAttachments.push(planModeAttachment);
|
|
@@ -396830,6 +396879,60 @@ function createPlanAttachmentIfNeeded(agentId) {
|
|
|
396830
396879
|
planContent
|
|
396831
396880
|
});
|
|
396832
396881
|
}
|
|
396882
|
+
async function createTaskStateAttachmentIfNeeded(context5) {
|
|
396883
|
+
if (isTodoV2Enabled()) {
|
|
396884
|
+
const tasks = await listTasks(getTaskListId());
|
|
396885
|
+
if (tasks.length === 0) {
|
|
396886
|
+
return null;
|
|
396887
|
+
}
|
|
396888
|
+
const selected = selectPostCompactTasks(tasks, POST_COMPACT_MAX_TASKS_TO_RESTORE, POST_COMPACT_TASK_STATE_TOKEN_BUDGET);
|
|
396889
|
+
return createAttachmentMessage({
|
|
396890
|
+
type: "task_reminder",
|
|
396891
|
+
content: selected,
|
|
396892
|
+
itemCount: tasks.length,
|
|
396893
|
+
authoritativeAfterCompact: true
|
|
396894
|
+
});
|
|
396895
|
+
}
|
|
396896
|
+
const todoKey = context5.agentId ?? getSessionId();
|
|
396897
|
+
const todos = context5.getAppState().todos[todoKey] ?? [];
|
|
396898
|
+
if (todos.length === 0) {
|
|
396899
|
+
return null;
|
|
396900
|
+
}
|
|
396901
|
+
return createAttachmentMessage({
|
|
396902
|
+
type: "todo_reminder",
|
|
396903
|
+
content: selectPostCompactTodos(todos, POST_COMPACT_MAX_TASKS_TO_RESTORE, POST_COMPACT_TASK_STATE_TOKEN_BUDGET),
|
|
396904
|
+
itemCount: todos.length,
|
|
396905
|
+
authoritativeAfterCompact: true
|
|
396906
|
+
});
|
|
396907
|
+
}
|
|
396908
|
+
function selectPostCompactTasks(tasks, limit = POST_COMPACT_MAX_TASKS_TO_RESTORE, tokenBudget = POST_COMPACT_TASK_STATE_TOKEN_BUDGET) {
|
|
396909
|
+
if (limit <= 0 || tokenBudget <= 0) {
|
|
396910
|
+
return [];
|
|
396911
|
+
}
|
|
396912
|
+
const actionable = tasks.filter((task) => task.status === "pending" || task.status === "in_progress");
|
|
396913
|
+
const terminal = tasks.filter((task) => task.status !== "pending" && task.status !== "in_progress");
|
|
396914
|
+
return selectWithinPostCompactBudget([...actionable, ...terminal], limit, tokenBudget);
|
|
396915
|
+
}
|
|
396916
|
+
function selectPostCompactTodos(todos, limit = POST_COMPACT_MAX_TASKS_TO_RESTORE, tokenBudget = POST_COMPACT_TASK_STATE_TOKEN_BUDGET) {
|
|
396917
|
+
return selectWithinPostCompactBudget(todos, limit, tokenBudget);
|
|
396918
|
+
}
|
|
396919
|
+
function selectWithinPostCompactBudget(items, limit, tokenBudget) {
|
|
396920
|
+
if (limit <= 0 || tokenBudget <= 0) {
|
|
396921
|
+
return [];
|
|
396922
|
+
}
|
|
396923
|
+
const selected = [];
|
|
396924
|
+
let usedTokens = 0;
|
|
396925
|
+
for (const item of items) {
|
|
396926
|
+
if (selected.length >= limit)
|
|
396927
|
+
break;
|
|
396928
|
+
const itemTokens = roughTokenCountEstimation(jsonStringify(item));
|
|
396929
|
+
if (itemTokens > tokenBudget - usedTokens)
|
|
396930
|
+
continue;
|
|
396931
|
+
selected.push(item);
|
|
396932
|
+
usedTokens += itemTokens;
|
|
396933
|
+
}
|
|
396934
|
+
return selected;
|
|
396935
|
+
}
|
|
396833
396936
|
function createSkillAttachmentIfNeeded(agentId) {
|
|
396834
396937
|
const invokedSkills = getInvokedSkillsForAgent(agentId);
|
|
396835
396938
|
if (invokedSkills.size === 0) {
|
|
@@ -396944,7 +397047,7 @@ function shouldExcludeFromPostCompactRestore(filename, agentId) {
|
|
|
396944
397047
|
} catch {}
|
|
396945
397048
|
return false;
|
|
396946
397049
|
}
|
|
396947
|
-
var POST_COMPACT_MAX_FILES_TO_RESTORE = 5, POST_COMPACT_TOKEN_BUDGET = 50000, POST_COMPACT_MAX_TOKENS_PER_FILE = 5000, POST_COMPACT_MAX_TOKENS_PER_SKILL = 5000, POST_COMPACT_SKILLS_TOKEN_BUDGET = 25000, MAX_COMPACT_STREAMING_RETRIES = 2, ERROR_MESSAGE_NOT_ENOUGH_MESSAGES = "Not enough messages to compact.", MAX_PTL_RETRIES = 3, PTL_RETRY_MARKER = "[earlier conversation truncated for compaction retry]", ERROR_MESSAGE_PROMPT_TOO_LONG = "Conversation too long. Press esc twice to go up a few messages and try again.", ERROR_MESSAGE_USER_ABORT = "API Error: Request was aborted.", ERROR_MESSAGE_INCOMPLETE_RESPONSE = "Compaction interrupted \xB7 This may be due to network issues \u2014 please try again.", SKILL_TRUNCATION_MARKER = `
|
|
397050
|
+
var POST_COMPACT_MAX_FILES_TO_RESTORE = 5, POST_COMPACT_TOKEN_BUDGET = 50000, POST_COMPACT_MAX_TOKENS_PER_FILE = 5000, POST_COMPACT_MAX_TOKENS_PER_SKILL = 5000, POST_COMPACT_SKILLS_TOKEN_BUDGET = 25000, MAX_COMPACT_STREAMING_RETRIES = 2, ERROR_MESSAGE_NOT_ENOUGH_MESSAGES = "Not enough messages to compact.", MAX_PTL_RETRIES = 3, PTL_RETRY_MARKER = "[earlier conversation truncated for compaction retry]", ERROR_MESSAGE_PROMPT_TOO_LONG = "Conversation too long. Press esc twice to go up a few messages and try again.", ERROR_MESSAGE_USER_ABORT = "API Error: Request was aborted.", ERROR_MESSAGE_INCOMPLETE_RESPONSE = "Compaction interrupted \xB7 This may be due to network issues \u2014 please try again.", POST_COMPACT_MAX_TASKS_TO_RESTORE = 64, POST_COMPACT_TASK_STATE_TOKEN_BUDGET = 6000, SKILL_TRUNCATION_MARKER = `
|
|
396948
397051
|
|
|
396949
397052
|
[... skill content truncated for compaction; use Read on the skill path if you need the full text]`;
|
|
396950
397053
|
var init_compact = __esm(() => {
|
|
@@ -396973,6 +397076,7 @@ var init_compact = __esm(() => {
|
|
|
396973
397076
|
init_sessionStart();
|
|
396974
397077
|
init_sessionStorage();
|
|
396975
397078
|
init_slowOperations();
|
|
397079
|
+
init_tasks();
|
|
396976
397080
|
init_diskOutput();
|
|
396977
397081
|
init_tokens();
|
|
396978
397082
|
init_toolSearch();
|
|
@@ -397411,7 +397515,7 @@ function shouldUseSessionMemoryCompaction() {
|
|
|
397411
397515
|
}
|
|
397412
397516
|
return shouldUse;
|
|
397413
397517
|
}
|
|
397414
|
-
function createCompactionResultFromSessionMemory(messages, sessionMemory, messagesToKeep, hookResults, transcriptPath, agentId) {
|
|
397518
|
+
function createCompactionResultFromSessionMemory(messages, sessionMemory, messagesToKeep, hookResults, transcriptPath, agentId, restoredStateAttachments = []) {
|
|
397415
397519
|
const preCompactTokenCount = tokenCountFromLastAPIResponse(messages);
|
|
397416
397520
|
const boundaryMarker = createCompactBoundaryMessage("auto", preCompactTokenCount ?? 0, messages[messages.length - 1]?.uuid);
|
|
397417
397521
|
const preCompactDiscovered = extractDiscoveredToolNames(messages);
|
|
@@ -397436,7 +397540,7 @@ Some session memory sections were truncated for length. The full session memory
|
|
|
397436
397540
|
})
|
|
397437
397541
|
];
|
|
397438
397542
|
const planAttachment = createPlanAttachmentIfNeeded(agentId);
|
|
397439
|
-
const attachments = planAttachment ? [planAttachment] :
|
|
397543
|
+
const attachments = planAttachment ? [planAttachment, ...restoredStateAttachments] : restoredStateAttachments;
|
|
397440
397544
|
return {
|
|
397441
397545
|
boundaryMarker: annotateBoundaryWithPreservedSegment(boundaryMarker, summaryMessages[summaryMessages.length - 1].uuid, messagesToKeep),
|
|
397442
397546
|
summaryMessages,
|
|
@@ -397448,7 +397552,7 @@ Some session memory sections were truncated for length. The full session memory
|
|
|
397448
397552
|
truePostCompactTokenCount: estimateMessageTokens(summaryMessages)
|
|
397449
397553
|
};
|
|
397450
397554
|
}
|
|
397451
|
-
async function trySessionMemoryCompaction(messages,
|
|
397555
|
+
async function trySessionMemoryCompaction(messages, toolUseContext, autoCompactThreshold) {
|
|
397452
397556
|
if (!shouldUseSessionMemoryCompaction()) {
|
|
397453
397557
|
return null;
|
|
397454
397558
|
}
|
|
@@ -397482,7 +397586,8 @@ async function trySessionMemoryCompaction(messages, agentId, autoCompactThreshol
|
|
|
397482
397586
|
model: getMainLoopModel()
|
|
397483
397587
|
});
|
|
397484
397588
|
const transcriptPath = getTranscriptPath();
|
|
397485
|
-
const
|
|
397589
|
+
const taskStateAttachment = await createTaskStateAttachmentIfNeeded(toolUseContext);
|
|
397590
|
+
const compactionResult = createCompactionResultFromSessionMemory(messages, sessionMemory, messagesToKeep, hookResults, transcriptPath, toolUseContext.agentId, taskStateAttachment ? [taskStateAttachment] : []);
|
|
397486
397591
|
const postCompactMessages = buildPostCompactMessages(compactionResult);
|
|
397487
397592
|
const postCompactTokenCount = estimateMessageTokens(postCompactMessages);
|
|
397488
397593
|
if (autoCompactThreshold !== undefined && postCompactTokenCount >= autoCompactThreshold) {
|
|
@@ -397545,43 +397650,58 @@ function getEffectiveContextWindowSize(model) {
|
|
|
397545
397650
|
contextWindow = Math.min(contextWindow, parsed);
|
|
397546
397651
|
}
|
|
397547
397652
|
}
|
|
397548
|
-
return contextWindow - reservedTokensForSummary;
|
|
397653
|
+
return Math.max(1, contextWindow - reservedTokensForSummary);
|
|
397549
397654
|
}
|
|
397550
|
-
function
|
|
397551
|
-
|
|
397552
|
-
|
|
397553
|
-
|
|
397554
|
-
|
|
397555
|
-
|
|
397556
|
-
|
|
397557
|
-
|
|
397558
|
-
const
|
|
397559
|
-
|
|
397560
|
-
|
|
397561
|
-
|
|
397562
|
-
|
|
397563
|
-
return Math.min(percentageThreshold, autocompactThreshold);
|
|
397564
|
-
}
|
|
397655
|
+
function validThresholdPercent(value) {
|
|
397656
|
+
return typeof value === "number" && Number.isFinite(value) && value >= 50 && value <= 95;
|
|
397657
|
+
}
|
|
397658
|
+
function validEnvironmentThresholdPercent(value) {
|
|
397659
|
+
return typeof value === "number" && Number.isFinite(value) && value > 0 && value <= 100;
|
|
397660
|
+
}
|
|
397661
|
+
function resolveAutoCompactThreshold(effectiveContextWindow, userPercent, envPercent) {
|
|
397662
|
+
const safeWindow = Math.max(1, Number.isFinite(effectiveContextWindow) ? Math.floor(effectiveContextWindow) : 1);
|
|
397663
|
+
const latestSafeThreshold = Math.max(1, safeWindow - MANUAL_COMPACT_BUFFER_TOKENS);
|
|
397664
|
+
const configuredPercent = validEnvironmentThresholdPercent(envPercent) ? envPercent : validThresholdPercent(userPercent) ? userPercent : undefined;
|
|
397665
|
+
if (configuredPercent !== undefined) {
|
|
397666
|
+
const percentageThreshold = Math.floor(safeWindow * (configuredPercent / 100));
|
|
397667
|
+
return Math.max(1, Math.min(percentageThreshold, latestSafeThreshold));
|
|
397565
397668
|
}
|
|
397566
|
-
return
|
|
397669
|
+
return Math.max(1, Math.min(safeWindow - AUTOCOMPACT_BUFFER_TOKENS, latestSafeThreshold));
|
|
397567
397670
|
}
|
|
397568
|
-
function
|
|
397671
|
+
function getAutoCompactThreshold(model) {
|
|
397672
|
+
const effectiveContextWindow = getEffectiveContextWindowSize(model);
|
|
397673
|
+
const envValue = process.env.UR_AUTOCOMPACT_PCT_OVERRIDE;
|
|
397674
|
+
const parsedEnvPercent = envValue === undefined ? undefined : Number.parseFloat(envValue);
|
|
397675
|
+
return resolveAutoCompactThreshold(effectiveContextWindow, getGlobalConfig().compactionAutoThreshold, parsedEnvPercent);
|
|
397676
|
+
}
|
|
397677
|
+
function calculateAutoCompactProgress(tokenUsage, threshold) {
|
|
397678
|
+
const safeThreshold = Math.max(1, Number.isFinite(threshold) ? threshold : 1);
|
|
397679
|
+
const safeUsage = Number.isFinite(tokenUsage) ? Math.max(0, tokenUsage) : safeThreshold;
|
|
397680
|
+
const tokensUntilAutoCompact = Math.max(0, safeThreshold - safeUsage);
|
|
397681
|
+
const percentLeft = Math.min(100, Math.max(0, Math.round(tokensUntilAutoCompact / safeThreshold * 100)));
|
|
397682
|
+
return { tokensUntilAutoCompact, percentLeft };
|
|
397683
|
+
}
|
|
397684
|
+
function calculateTokenWarningState(tokenUsage, model, thresholdOverride) {
|
|
397569
397685
|
const autoCompactThreshold = getAutoCompactThreshold(model);
|
|
397570
|
-
const threshold = isAutoCompactEnabled() ? autoCompactThreshold : getEffectiveContextWindowSize(model);
|
|
397571
|
-
const percentLeft =
|
|
397572
|
-
const
|
|
397573
|
-
const
|
|
397686
|
+
const threshold = thresholdOverride ?? (isAutoCompactEnabled() ? autoCompactThreshold : getEffectiveContextWindowSize(model));
|
|
397687
|
+
const { percentLeft, tokensUntilAutoCompact } = calculateAutoCompactProgress(tokenUsage, threshold);
|
|
397688
|
+
const warningBuffer = Math.max(1, Math.min(WARNING_THRESHOLD_BUFFER_TOKENS, Math.floor(threshold * WARNING_THRESHOLD_FRACTION)));
|
|
397689
|
+
const errorBuffer = Math.max(1, Math.min(ERROR_THRESHOLD_BUFFER_TOKENS, Math.floor(threshold * ERROR_THRESHOLD_FRACTION)));
|
|
397690
|
+
const warningThreshold = Math.max(0, threshold - warningBuffer);
|
|
397691
|
+
const errorThreshold = Math.max(0, threshold - errorBuffer);
|
|
397574
397692
|
const isAboveWarningThreshold = tokenUsage >= warningThreshold;
|
|
397575
397693
|
const isAboveErrorThreshold = tokenUsage >= errorThreshold;
|
|
397576
397694
|
const isAboveAutoCompactThreshold = isAutoCompactEnabled() && tokenUsage >= autoCompactThreshold;
|
|
397577
397695
|
const actualContextWindow = getEffectiveContextWindowSize(model);
|
|
397578
|
-
const defaultBlockingLimit = actualContextWindow - MANUAL_COMPACT_BUFFER_TOKENS;
|
|
397696
|
+
const defaultBlockingLimit = Math.max(1, actualContextWindow - MANUAL_COMPACT_BUFFER_TOKENS);
|
|
397579
397697
|
const blockingLimitOverride = process.env.UR_CODE_BLOCKING_LIMIT_OVERRIDE;
|
|
397580
397698
|
const parsedOverride = blockingLimitOverride ? parseInt(blockingLimitOverride, 10) : NaN;
|
|
397581
397699
|
const blockingLimit = !isNaN(parsedOverride) && parsedOverride > 0 ? parsedOverride : defaultBlockingLimit;
|
|
397582
397700
|
const isAtBlockingLimit = tokenUsage >= blockingLimit;
|
|
397583
397701
|
return {
|
|
397584
397702
|
percentLeft,
|
|
397703
|
+
tokensUntilAutoCompact,
|
|
397704
|
+
autoCompactThreshold,
|
|
397585
397705
|
isAboveWarningThreshold,
|
|
397586
397706
|
isAboveErrorThreshold,
|
|
397587
397707
|
isAboveAutoCompactThreshold,
|
|
@@ -397598,16 +397718,22 @@ function isAutoCompactEnabled() {
|
|
|
397598
397718
|
const userConfig = getGlobalConfig();
|
|
397599
397719
|
return userConfig.autoCompactEnabled;
|
|
397600
397720
|
}
|
|
397721
|
+
function isProactiveAutoCompactEnabled() {
|
|
397722
|
+
if (!isAutoCompactEnabled()) {
|
|
397723
|
+
return false;
|
|
397724
|
+
}
|
|
397725
|
+
if (false) {}
|
|
397726
|
+
if (false) {}
|
|
397727
|
+
return true;
|
|
397728
|
+
}
|
|
397601
397729
|
async function shouldAutoCompact(messages, model, querySource, snipTokensFreed = 0) {
|
|
397602
397730
|
if (querySource === "session_memory" || querySource === "compact") {
|
|
397603
397731
|
return false;
|
|
397604
397732
|
}
|
|
397605
397733
|
if (false) {}
|
|
397606
|
-
if (!
|
|
397734
|
+
if (!isProactiveAutoCompactEnabled()) {
|
|
397607
397735
|
return false;
|
|
397608
397736
|
}
|
|
397609
|
-
if (false) {}
|
|
397610
|
-
if (false) {}
|
|
397611
397737
|
const tokenCount = tokenCountWithEstimation(messages) - snipTokensFreed;
|
|
397612
397738
|
const threshold = getAutoCompactThreshold(model);
|
|
397613
397739
|
const effectiveWindow = getEffectiveContextWindowSize(model);
|
|
@@ -397634,10 +397760,11 @@ async function autoCompactIfNeeded(messages, toolUseContext, cacheSafeParams, qu
|
|
|
397634
397760
|
autoCompactThreshold: getAutoCompactThreshold(model),
|
|
397635
397761
|
querySource
|
|
397636
397762
|
};
|
|
397637
|
-
const sessionMemoryResult = await trySessionMemoryCompaction(messages, toolUseContext
|
|
397763
|
+
const sessionMemoryResult = await trySessionMemoryCompaction(messages, toolUseContext, recompactionInfo.autoCompactThreshold);
|
|
397638
397764
|
if (sessionMemoryResult) {
|
|
397639
397765
|
setLastSummarizedMessageId(undefined);
|
|
397640
397766
|
runPostCompactCleanup(querySource);
|
|
397767
|
+
suppressCompactWarning();
|
|
397641
397768
|
if (false) {}
|
|
397642
397769
|
markPostCompaction();
|
|
397643
397770
|
return {
|
|
@@ -397649,6 +397776,7 @@ async function autoCompactIfNeeded(messages, toolUseContext, cacheSafeParams, qu
|
|
|
397649
397776
|
const compactionResult = await compactConversation(messages, toolUseContext, cacheSafeParams, true, undefined, true, recompactionInfo);
|
|
397650
397777
|
setLastSummarizedMessageId(undefined);
|
|
397651
397778
|
runPostCompactCleanup(querySource);
|
|
397779
|
+
suppressCompactWarning();
|
|
397652
397780
|
return {
|
|
397653
397781
|
wasCompacted: true,
|
|
397654
397782
|
compactionResult,
|
|
@@ -397666,7 +397794,7 @@ async function autoCompactIfNeeded(messages, toolUseContext, cacheSafeParams, qu
|
|
|
397666
397794
|
return { wasCompacted: false, consecutiveFailures: nextFailures };
|
|
397667
397795
|
}
|
|
397668
397796
|
}
|
|
397669
|
-
var MAX_OUTPUT_TOKENS_FOR_SUMMARY = 20000, AUTOCOMPACT_BUFFER_TOKENS = 13000, WARNING_THRESHOLD_BUFFER_TOKENS = 20000, ERROR_THRESHOLD_BUFFER_TOKENS =
|
|
397797
|
+
var MAX_OUTPUT_TOKENS_FOR_SUMMARY = 20000, AUTOCOMPACT_BUFFER_TOKENS = 13000, WARNING_THRESHOLD_BUFFER_TOKENS = 20000, ERROR_THRESHOLD_BUFFER_TOKENS = 5000, MANUAL_COMPACT_BUFFER_TOKENS = 3000, WARNING_THRESHOLD_FRACTION = 0.15, ERROR_THRESHOLD_FRACTION = 0.05, MAX_CONSECUTIVE_AUTOCOMPACT_FAILURES = 3;
|
|
397670
397798
|
var init_autoCompact = __esm(() => {
|
|
397671
397799
|
init_state();
|
|
397672
397800
|
init_state();
|
|
@@ -397682,6 +397810,7 @@ var init_autoCompact = __esm(() => {
|
|
|
397682
397810
|
init_promptCacheBreakDetection();
|
|
397683
397811
|
init_sessionMemoryUtils();
|
|
397684
397812
|
init_compact();
|
|
397813
|
+
init_compactWarningState();
|
|
397685
397814
|
init_postCompactCleanup();
|
|
397686
397815
|
init_sessionMemoryCompact();
|
|
397687
397816
|
});
|
|
@@ -398113,7 +398242,7 @@ async function analyzeContextUsage(messages, model, getToolPermissionContext, to
|
|
|
398113
398242
|
const skillFrontmatterTokens = skillInfo.skillFrontmatter.reduce((sum, skill) => sum + skill.tokens, 0);
|
|
398114
398243
|
const messageTokens = messageBreakdown.totalTokens;
|
|
398115
398244
|
const isAutoCompact = isAutoCompactEnabled();
|
|
398116
|
-
const autoCompactThreshold = isAutoCompact ?
|
|
398245
|
+
const autoCompactThreshold = isAutoCompact ? getAutoCompactThreshold(runtimeModel) : undefined;
|
|
398117
398246
|
const cats = [];
|
|
398118
398247
|
if (systemPromptTokens > 0) {
|
|
398119
398248
|
cats.push({
|
|
@@ -398211,6 +398340,8 @@ async function analyzeContextUsage(messages, model, getToolPermissionContext, to
|
|
|
398211
398340
|
const apiUsage = getCurrentUsage(originalMessages ?? messages);
|
|
398212
398341
|
const totalFromAPI = apiUsage ? apiUsage.input_tokens + apiUsage.cache_creation_input_tokens + apiUsage.cache_read_input_tokens : null;
|
|
398213
398342
|
const finalTotalTokens = totalFromAPI ?? totalIncludingReserved;
|
|
398343
|
+
const autoProgressTokenUsage = tokenCountWithEstimation(getMessagesAfterCompactBoundary(originalMessages ?? messages));
|
|
398344
|
+
const autoCompactPercentLeft = autoCompactThreshold === undefined || skipReservedBuffer ? undefined : calculateAutoCompactProgress(autoProgressTokenUsage, autoCompactThreshold).percentLeft;
|
|
398214
398345
|
const isNarrowScreen = terminalWidth && terminalWidth < 80;
|
|
398215
398346
|
const GRID_WIDTH = contextWindow >= 1e6 ? isNarrowScreen ? 5 : 20 : isNarrowScreen ? 5 : 10;
|
|
398216
398347
|
const GRID_HEIGHT = contextWindow >= 1e6 ? 10 : isNarrowScreen ? 5 : 10;
|
|
@@ -398328,6 +398459,7 @@ async function analyzeContextUsage(messages, model, getToolPermissionContext, to
|
|
|
398328
398459
|
skillFrontmatter: skillInfo.skillFrontmatter
|
|
398329
398460
|
} : undefined,
|
|
398330
398461
|
autoCompactThreshold,
|
|
398462
|
+
autoCompactPercentLeft,
|
|
398331
398463
|
isAutoCompactEnabled: isAutoCompact,
|
|
398332
398464
|
messageBreakdown: formattedMessageBreakdown,
|
|
398333
398465
|
apiUsage
|
|
@@ -409966,16 +410098,23 @@ ${skillsContent}`,
|
|
|
409966
410098
|
]);
|
|
409967
410099
|
}
|
|
409968
410100
|
case "todo_reminder": {
|
|
409969
|
-
const todoItems = attachment.content.map((todo, index2) =>
|
|
410101
|
+
const todoItems = attachment.content.map((todo, index2) => {
|
|
410102
|
+
const activeForm = todo.status === "in_progress" ? `
|
|
410103
|
+
Active form: ${todo.activeForm}` : "";
|
|
410104
|
+
return `${index2 + 1}. [${todo.status}] ${todo.content}${activeForm}`;
|
|
410105
|
+
}).join(`
|
|
409970
410106
|
`);
|
|
409971
|
-
let message = `The TodoWrite tool hasn't been used recently. If you're working on tasks that would benefit from tracking progress, consider using the TodoWrite tool to track progress. Also consider cleaning up the todo list if has become stale and no longer matches what you are working on. Only use it if it's relevant to the current work. This is just a gentle reminder - ignore if not applicable. Make sure that you NEVER mention this reminder to the user
|
|
410107
|
+
let message = attachment.authoritativeAfterCompact ? `Authoritative live TodoWrite state restored after compaction. Continue this list instead of recreating it, preserve the order, and change a status only when the corresponding work actually starts or its observable done check passes.` : `The TodoWrite tool hasn't been used recently. If you're working on tasks that would benefit from tracking progress, consider using the TodoWrite tool to track progress. Also consider cleaning up the todo list if has become stale and no longer matches what you are working on. Only use it if it's relevant to the current work. This is just a gentle reminder - ignore if not applicable. Make sure that you NEVER mention this reminder to the user
|
|
409972
410108
|
`;
|
|
410109
|
+
if (attachment.authoritativeAfterCompact && attachment.itemCount > attachment.content.length) {
|
|
410110
|
+
message += ` This bounded snapshot contains ${attachment.content.length} of ${attachment.itemCount} items; use TodoWrite with care because omitted items still exist.`;
|
|
410111
|
+
}
|
|
409973
410112
|
if (todoItems.length > 0) {
|
|
409974
410113
|
message += `
|
|
409975
410114
|
|
|
409976
|
-
|
|
410115
|
+
Existing todo list:
|
|
409977
410116
|
|
|
409978
|
-
|
|
410117
|
+
${todoItems}`;
|
|
409979
410118
|
}
|
|
409980
410119
|
return wrapMessagesInSystemReminder([
|
|
409981
410120
|
createUserMessage({
|
|
@@ -409988,14 +410127,27 @@ Here are the existing contents of your todo list:
|
|
|
409988
410127
|
if (!isTodoV2Enabled()) {
|
|
409989
410128
|
return [];
|
|
409990
410129
|
}
|
|
409991
|
-
const taskItems = attachment.content.map((task) =>
|
|
410130
|
+
const taskItems = attachment.content.map((task) => {
|
|
410131
|
+
const owner = task.owner ? `
|
|
410132
|
+
Owner: ${task.owner}` : "";
|
|
410133
|
+
const blockedBy = task.blockedBy.length > 0 ? `
|
|
410134
|
+
Blocked by: ${task.blockedBy.map((id) => `#${id}`).join(", ")}` : "";
|
|
410135
|
+
const blocks = task.blocks.length > 0 ? `
|
|
410136
|
+
Blocks: ${task.blocks.map((id) => `#${id}`).join(", ")}` : "";
|
|
410137
|
+
const description = task.description.length > 500 ? `${task.description.slice(0, 500)}\u2026 [truncated; use TaskGet]` : task.description;
|
|
410138
|
+
return `#${task.id} [${task.status}] ${task.subject}${owner}${blockedBy}${blocks}
|
|
410139
|
+
Done check / description: ${description}`;
|
|
410140
|
+
}).join(`
|
|
409992
410141
|
`);
|
|
409993
|
-
let message = `The task tools haven't been used recently. If you're working on tasks that would benefit from tracking progress, consider using ${TASK_CREATE_TOOL_NAME} to add new tasks and ${TASK_UPDATE_TOOL_NAME} to update task status (set to in_progress when starting, completed when done). Also consider cleaning up the task list if it has become stale. Only use these if relevant to the current work. This is just a gentle reminder - ignore if not applicable. Make sure that you NEVER mention this reminder to the user
|
|
410142
|
+
let message = attachment.authoritativeAfterCompact ? `Authoritative live task-store state restored after compaction. Continue these exact task IDs; do not recreate duplicate tasks. Preserve dependency order, keep at most one task in_progress per worker, and mark a task completed only after its observable done check passes.` : `The task tools haven't been used recently. If you're working on tasks that would benefit from tracking progress, consider using ${TASK_CREATE_TOOL_NAME} to add new tasks and ${TASK_UPDATE_TOOL_NAME} to update task status (set to in_progress when starting, completed when done). Also consider cleaning up the task list if it has become stale. Only use these if relevant to the current work. This is just a gentle reminder - ignore if not applicable. Make sure that you NEVER mention this reminder to the user
|
|
409994
410143
|
`;
|
|
410144
|
+
if (attachment.authoritativeAfterCompact && attachment.itemCount > attachment.content.length) {
|
|
410145
|
+
message += ` This bounded snapshot contains ${attachment.content.length} of ${attachment.itemCount} tasks. Call TaskList before any task mutation so omitted IDs are not duplicated or overwritten.`;
|
|
410146
|
+
}
|
|
409995
410147
|
if (taskItems.length > 0) {
|
|
409996
410148
|
message += `
|
|
409997
410149
|
|
|
409998
|
-
|
|
410150
|
+
Existing tasks:
|
|
409999
410151
|
|
|
410000
410152
|
${taskItems}`;
|
|
410001
410153
|
}
|
|
@@ -410589,6 +410741,7 @@ function createCompactBoundaryMessage(trigger, preTokens, lastPreCompactMessageU
|
|
|
410589
410741
|
compactMetadata: {
|
|
410590
410742
|
trigger,
|
|
410591
410743
|
preTokens,
|
|
410744
|
+
taskGateFreeCallsConsumed: true,
|
|
410592
410745
|
userContext,
|
|
410593
410746
|
messagesSummarized
|
|
410594
410747
|
},
|
|
@@ -419227,7 +419380,7 @@ function Feedback({
|
|
|
419227
419380
|
platform: env2.platform,
|
|
419228
419381
|
gitRepo: envInfo.isGit,
|
|
419229
419382
|
terminal: env2.terminal,
|
|
419230
|
-
version: "1.
|
|
419383
|
+
version: "1.66.0",
|
|
419231
419384
|
transcript: normalizeMessagesForAPI(messages),
|
|
419232
419385
|
errors: sanitizedErrors,
|
|
419233
419386
|
lastApiRequest: getLastAPIRequest(),
|
|
@@ -419419,7 +419572,7 @@ function Feedback({
|
|
|
419419
419572
|
", ",
|
|
419420
419573
|
env2.terminal,
|
|
419421
419574
|
", v",
|
|
419422
|
-
"1.
|
|
419575
|
+
"1.66.0"
|
|
419423
419576
|
]
|
|
419424
419577
|
}, undefined, true, undefined, this)
|
|
419425
419578
|
]
|
|
@@ -419525,7 +419678,7 @@ ${sanitizedDescription}
|
|
|
419525
419678
|
` + `**Environment Info**
|
|
419526
419679
|
` + `- Platform: ${env2.platform}
|
|
419527
419680
|
` + `- Terminal: ${env2.terminal}
|
|
419528
|
-
` + `- Version: ${"1.
|
|
419681
|
+
` + `- Version: ${"1.66.0"}
|
|
419529
419682
|
` + `- Feedback ID: ${feedbackId}
|
|
419530
419683
|
` + `
|
|
419531
419684
|
**Errors**
|
|
@@ -422208,7 +422361,7 @@ var reactiveCompact2 = null, call14 = async (args, context5) => {
|
|
|
422208
422361
|
const customInstructions = args.trim();
|
|
422209
422362
|
try {
|
|
422210
422363
|
if (!customInstructions) {
|
|
422211
|
-
const sessionMemoryResult = await trySessionMemoryCompaction(messages, context5
|
|
422364
|
+
const sessionMemoryResult = await trySessionMemoryCompaction(messages, context5);
|
|
422212
422365
|
if (sessionMemoryResult) {
|
|
422213
422366
|
getUserContext.cache.clear?.();
|
|
422214
422367
|
runPostCompactCleanup();
|
|
@@ -422635,7 +422788,7 @@ function buildPrimarySection() {
|
|
|
422635
422788
|
}, undefined, false, undefined, this);
|
|
422636
422789
|
return [{
|
|
422637
422790
|
label: "Version",
|
|
422638
|
-
value: "1.
|
|
422791
|
+
value: "1.66.0"
|
|
422639
422792
|
}, {
|
|
422640
422793
|
label: "Session name",
|
|
422641
422794
|
value: nameValue
|
|
@@ -425965,7 +426118,7 @@ function Config({
|
|
|
425965
426118
|
}
|
|
425966
426119
|
}, undefined, false, undefined, this)
|
|
425967
426120
|
}, undefined, false, undefined, this) : showSubmenu === "ChannelDowngrade" ? /* @__PURE__ */ jsx_dev_runtime179.jsxDEV(ChannelDowngradeDialog, {
|
|
425968
|
-
currentVersion: "1.
|
|
426121
|
+
currentVersion: "1.66.0",
|
|
425969
426122
|
onChoice: (choice) => {
|
|
425970
426123
|
setShowSubmenu(null);
|
|
425971
426124
|
setTabsHidden(false);
|
|
@@ -425977,7 +426130,7 @@ function Config({
|
|
|
425977
426130
|
autoUpdatesChannel: "stable"
|
|
425978
426131
|
};
|
|
425979
426132
|
if (choice === "stay") {
|
|
425980
|
-
newSettings.minimumVersion = "1.
|
|
426133
|
+
newSettings.minimumVersion = "1.66.0";
|
|
425981
426134
|
}
|
|
425982
426135
|
updateSettingsForSource("userSettings", newSettings);
|
|
425983
426136
|
setSettingsData((prev_27) => ({
|
|
@@ -427503,7 +427656,7 @@ function groupBySource(items) {
|
|
|
427503
427656
|
return orderedGroups;
|
|
427504
427657
|
}
|
|
427505
427658
|
function ContextVisualization(t0) {
|
|
427506
|
-
const $2 = import_compiler_runtime139.c(
|
|
427659
|
+
const $2 = import_compiler_runtime139.c(88);
|
|
427507
427660
|
const {
|
|
427508
427661
|
data
|
|
427509
427662
|
} = t0;
|
|
@@ -427521,7 +427674,8 @@ function ContextVisualization(t0) {
|
|
|
427521
427674
|
systemPromptSections,
|
|
427522
427675
|
agents,
|
|
427523
427676
|
skills,
|
|
427524
|
-
messageBreakdown
|
|
427677
|
+
messageBreakdown,
|
|
427678
|
+
autoCompactPercentLeft
|
|
427525
427679
|
} = data;
|
|
427526
427680
|
let T0;
|
|
427527
427681
|
let T1;
|
|
@@ -427533,7 +427687,7 @@ function ContextVisualization(t0) {
|
|
|
427533
427687
|
let t7;
|
|
427534
427688
|
let t8;
|
|
427535
427689
|
let t9;
|
|
427536
|
-
if ($2[0] !== categories || $2[1] !== gridRows || $2[2] !== mcpTools || $2[3] !== model || $2[4] !== percentage || $2[5] !== rawMaxTokens || $2[6] !== systemTools || $2[7] !== t1 || $2[8] !== totalTokens) {
|
|
427690
|
+
if ($2[0] !== categories || $2[1] !== gridRows || $2[2] !== mcpTools || $2[3] !== model || $2[4] !== percentage || $2[5] !== rawMaxTokens || $2[6] !== systemTools || $2[7] !== t1 || $2[8] !== totalTokens || $2[87] !== autoCompactPercentLeft) {
|
|
427537
427691
|
const deferredBuiltinTools = t1 === undefined ? [] : t1;
|
|
427538
427692
|
const visibleCategories = categories.filter(_temp70);
|
|
427539
427693
|
let t102;
|
|
@@ -427596,7 +427750,7 @@ function ContextVisualization(t0) {
|
|
|
427596
427750
|
t142 = $2[29];
|
|
427597
427751
|
}
|
|
427598
427752
|
let t152;
|
|
427599
|
-
if ($2[30] !== model || $2[31] !== percentage || $2[32] !== t132 || $2[33] !== t142) {
|
|
427753
|
+
if ($2[30] !== model || $2[31] !== percentage || $2[32] !== t132 || $2[33] !== t142 || $2[87] !== autoCompactPercentLeft) {
|
|
427600
427754
|
t152 = /* @__PURE__ */ jsx_dev_runtime186.jsxDEV(ThemedText, {
|
|
427601
427755
|
dimColor: true,
|
|
427602
427756
|
children: [
|
|
@@ -427608,13 +427762,15 @@ function ContextVisualization(t0) {
|
|
|
427608
427762
|
" ",
|
|
427609
427763
|
"tokens (",
|
|
427610
427764
|
percentage,
|
|
427611
|
-
"%)"
|
|
427765
|
+
"%)",
|
|
427766
|
+
autoCompactPercentLeft !== undefined ? ` \xB7 \u2248${autoCompactPercentLeft}% until auto-compact` : ""
|
|
427612
427767
|
]
|
|
427613
427768
|
}, undefined, true, undefined, this);
|
|
427614
427769
|
$2[30] = model;
|
|
427615
427770
|
$2[31] = percentage;
|
|
427616
427771
|
$2[32] = t132;
|
|
427617
427772
|
$2[33] = t142;
|
|
427773
|
+
$2[87] = autoCompactPercentLeft;
|
|
427618
427774
|
$2[34] = t152;
|
|
427619
427775
|
} else {
|
|
427620
427776
|
t152 = $2[34];
|
|
@@ -428400,7 +428556,10 @@ function formatContextAsMarkdownTable(data) {
|
|
|
428400
428556
|
skills,
|
|
428401
428557
|
messageBreakdown,
|
|
428402
428558
|
systemTools,
|
|
428403
|
-
systemPromptSections
|
|
428559
|
+
systemPromptSections,
|
|
428560
|
+
autoCompactThreshold,
|
|
428561
|
+
autoCompactPercentLeft,
|
|
428562
|
+
isAutoCompactEnabled: isAutoCompactEnabled2
|
|
428404
428563
|
} = data;
|
|
428405
428564
|
let output = `## Context Usage
|
|
428406
428565
|
|
|
@@ -428409,6 +428568,10 @@ function formatContextAsMarkdownTable(data) {
|
|
|
428409
428568
|
`;
|
|
428410
428569
|
output += `**Tokens:** ${formatTokens(totalTokens)} / ${formatTokens(rawMaxTokens)} (${percentage}%)
|
|
428411
428570
|
`;
|
|
428571
|
+
if (isAutoCompactEnabled2 && autoCompactThreshold !== undefined && autoCompactPercentLeft !== undefined) {
|
|
428572
|
+
output += `**Auto-compact:** \u2248${autoCompactPercentLeft}% remaining until trigger
|
|
428573
|
+
`;
|
|
428574
|
+
}
|
|
428412
428575
|
if (false) {}
|
|
428413
428576
|
output += `
|
|
428414
428577
|
`;
|
|
@@ -434041,7 +434204,7 @@ function HelpV2(t0) {
|
|
|
434041
434204
|
let t6;
|
|
434042
434205
|
if ($2[31] !== tabs) {
|
|
434043
434206
|
t6 = /* @__PURE__ */ jsx_dev_runtime206.jsxDEV(Tabs, {
|
|
434044
|
-
title: `UR v${"1.
|
|
434207
|
+
title: `UR v${"1.66.0"}`,
|
|
434045
434208
|
color: "professionalBlue",
|
|
434046
434209
|
defaultTab: "general",
|
|
434047
434210
|
children: tabs
|
|
@@ -434974,7 +435137,7 @@ function buildToolUseContext(tools, readFileStateCache, toolPermissionContext, a
|
|
|
434974
435137
|
async function handleInitialize(options2) {
|
|
434975
435138
|
return {
|
|
434976
435139
|
name: "UR",
|
|
434977
|
-
version: "1.
|
|
435140
|
+
version: "1.66.0",
|
|
434978
435141
|
protocolVersion: "0.1.0",
|
|
434979
435142
|
workspaceRoot: options2.cwd,
|
|
434980
435143
|
capabilities: {
|
|
@@ -452082,7 +452245,7 @@ function getAllReleaseNotes(changelogContent = getStoredChangelogFromMemory()) {
|
|
|
452082
452245
|
return [];
|
|
452083
452246
|
}
|
|
452084
452247
|
}
|
|
452085
|
-
async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.
|
|
452248
|
+
async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.66.0") {
|
|
452086
452249
|
if (process.env.USER_TYPE === "ant") {
|
|
452087
452250
|
const changelog = "";
|
|
452088
452251
|
if (changelog) {
|
|
@@ -452109,7 +452272,7 @@ async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.65.14")
|
|
|
452109
452272
|
releaseNotes
|
|
452110
452273
|
};
|
|
452111
452274
|
}
|
|
452112
|
-
function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "1.
|
|
452275
|
+
function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "1.66.0") {
|
|
452113
452276
|
if (process.env.USER_TYPE === "ant") {
|
|
452114
452277
|
const changelog = "";
|
|
452115
452278
|
if (changelog) {
|
|
@@ -454975,7 +455138,7 @@ function getRecentActivitySync() {
|
|
|
454975
455138
|
return cachedActivity;
|
|
454976
455139
|
}
|
|
454977
455140
|
function getLogoDisplayData() {
|
|
454978
|
-
const version2 = process.env.DEMO_VERSION ?? "1.
|
|
455141
|
+
const version2 = process.env.DEMO_VERSION ?? "1.66.0";
|
|
454979
455142
|
const serverUrl = getDirectConnectServerUrl();
|
|
454980
455143
|
const displayPath = process.env.DEMO_VERSION ? "/code/ur" : getDisplayPath(getCwd());
|
|
454981
455144
|
const cwd2 = serverUrl ? `${displayPath} in ${serverUrl.replace(/^https?:\/\//, "")}` : displayPath;
|
|
@@ -455842,7 +456005,7 @@ function LogoV2() {
|
|
|
455842
456005
|
if ($2[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
455843
456006
|
t2 = () => {
|
|
455844
456007
|
const currentConfig2 = getGlobalConfig();
|
|
455845
|
-
if (currentConfig2.lastReleaseNotesSeen === "1.
|
|
456008
|
+
if (currentConfig2.lastReleaseNotesSeen === "1.66.0") {
|
|
455846
456009
|
return;
|
|
455847
456010
|
}
|
|
455848
456011
|
saveGlobalConfig(_temp325);
|
|
@@ -456527,12 +456690,12 @@ function LogoV2() {
|
|
|
456527
456690
|
return t41;
|
|
456528
456691
|
}
|
|
456529
456692
|
function _temp325(current) {
|
|
456530
|
-
if (current.lastReleaseNotesSeen === "1.
|
|
456693
|
+
if (current.lastReleaseNotesSeen === "1.66.0") {
|
|
456531
456694
|
return current;
|
|
456532
456695
|
}
|
|
456533
456696
|
return {
|
|
456534
456697
|
...current,
|
|
456535
|
-
lastReleaseNotesSeen: "1.
|
|
456698
|
+
lastReleaseNotesSeen: "1.66.0"
|
|
456536
456699
|
};
|
|
456537
456700
|
}
|
|
456538
456701
|
function _temp241(s_0) {
|
|
@@ -467309,6 +467472,9 @@ function toSDKCompactMetadata(meta) {
|
|
|
467309
467472
|
return {
|
|
467310
467473
|
trigger: meta.trigger,
|
|
467311
467474
|
pre_tokens: meta.preTokens,
|
|
467475
|
+
...meta.taskGateFreeCallsConsumed === true && {
|
|
467476
|
+
task_gate_free_calls_consumed: true
|
|
467477
|
+
},
|
|
467312
467478
|
...seg && {
|
|
467313
467479
|
preserved_segment: {
|
|
467314
467480
|
head_uuid: seg.headUuid,
|
|
@@ -467323,6 +467489,9 @@ function fromSDKCompactMetadata(meta) {
|
|
|
467323
467489
|
return {
|
|
467324
467490
|
trigger: meta.trigger,
|
|
467325
467491
|
preTokens: meta.pre_tokens,
|
|
467492
|
+
...meta.task_gate_free_calls_consumed === true && {
|
|
467493
|
+
taskGateFreeCallsConsumed: true
|
|
467494
|
+
},
|
|
467326
467495
|
...seg && {
|
|
467327
467496
|
preservedSegment: {
|
|
467328
467497
|
headUuid: seg.head_uuid,
|
|
@@ -472537,7 +472706,7 @@ import { dirname as dirname67, isAbsolute as isAbsolute35, join as join157, rela
|
|
|
472537
472706
|
function positiveInteger(value, min, max2) {
|
|
472538
472707
|
return typeof value === "number" && Number.isInteger(value) && value >= min && value <= max2;
|
|
472539
472708
|
}
|
|
472540
|
-
function
|
|
472709
|
+
function stringArray(value) {
|
|
472541
472710
|
return Array.isArray(value) ? value.filter((item) => typeof item === "string") : [];
|
|
472542
472711
|
}
|
|
472543
472712
|
function isAssociation(value) {
|
|
@@ -472693,7 +472862,7 @@ function parseAgenticCiSpec(text) {
|
|
|
472693
472862
|
return {
|
|
472694
472863
|
name: typeof command5.name === "string" ? command5.name : undefined,
|
|
472695
472864
|
file: typeof command5.file === "string" ? command5.file : "",
|
|
472696
|
-
args:
|
|
472865
|
+
args: stringArray(command5.args),
|
|
472697
472866
|
timeoutMs: typeof command5.timeoutMs === "number" ? command5.timeoutMs : undefined
|
|
472698
472867
|
};
|
|
472699
472868
|
}) : [];
|
|
@@ -472705,9 +472874,9 @@ function parseAgenticCiSpec(text) {
|
|
|
472705
472874
|
manual: trigger.manual === true,
|
|
472706
472875
|
issueComment: issue2 ? {
|
|
472707
472876
|
keyword: typeof issue2.keyword === "string" ? issue2.keyword : undefined,
|
|
472708
|
-
aliases: Array.isArray(issue2.aliases) ?
|
|
472709
|
-
allowedAssociations:
|
|
472710
|
-
events: Array.isArray(issue2.events) ?
|
|
472877
|
+
aliases: Array.isArray(issue2.aliases) ? stringArray(issue2.aliases) : undefined,
|
|
472878
|
+
allowedAssociations: stringArray(issue2.allowedAssociations),
|
|
472879
|
+
events: Array.isArray(issue2.events) ? stringArray(issue2.events) : undefined
|
|
472711
472880
|
} : undefined
|
|
472712
472881
|
},
|
|
472713
472882
|
runner: {
|
|
@@ -472716,8 +472885,8 @@ function parseAgenticCiSpec(text) {
|
|
|
472716
472885
|
timeoutMinutes: typeof runner2.timeoutMinutes === "number" ? runner2.timeoutMinutes : undefined
|
|
472717
472886
|
},
|
|
472718
472887
|
workspace: {
|
|
472719
|
-
allowedPaths:
|
|
472720
|
-
deniedPaths:
|
|
472888
|
+
allowedPaths: stringArray(workspace.allowedPaths),
|
|
472889
|
+
deniedPaths: stringArray(workspace.deniedPaths)
|
|
472721
472890
|
},
|
|
472722
472891
|
verification: {
|
|
472723
472892
|
commands,
|
|
@@ -473472,7 +473641,7 @@ function compileAgenticCiWorkflow(specName = "default", options2 = {}) {
|
|
|
473472
473641
|
if (spec.name !== specName) {
|
|
473473
473642
|
throw new Error("Agentic CI workflow spec name does not match");
|
|
473474
473643
|
}
|
|
473475
|
-
const packageVersion = options2.packageVersion ?? (typeof MACRO !== "undefined" ? "1.
|
|
473644
|
+
const packageVersion = options2.packageVersion ?? (typeof MACRO !== "undefined" ? "1.66.0" : "1.66.0");
|
|
473476
473645
|
if (!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(packageVersion)) {
|
|
473477
473646
|
throw new Error("invalid ur-agent package version");
|
|
473478
473647
|
}
|
|
@@ -474465,7 +474634,7 @@ runner; \`ur trigger\` is the inbound parser that decides what to run.
|
|
|
474465
474634
|
path: ".github/workflows/ur.yml",
|
|
474466
474635
|
root: "project",
|
|
474467
474636
|
content: compileAgenticCiWorkflow("default", {
|
|
474468
|
-
packageVersion: typeof MACRO !== "undefined" ? "1.
|
|
474637
|
+
packageVersion: typeof MACRO !== "undefined" ? "1.66.0" : "1.66.0"
|
|
474469
474638
|
})
|
|
474470
474639
|
},
|
|
474471
474640
|
{
|
|
@@ -474535,7 +474704,7 @@ function value(tokens, flag) {
|
|
|
474535
474704
|
return index2 >= 0 ? tokens[index2 + 1] : undefined;
|
|
474536
474705
|
}
|
|
474537
474706
|
function cliVersion() {
|
|
474538
|
-
return typeof MACRO !== "undefined" ? "1.
|
|
474707
|
+
return typeof MACRO !== "undefined" ? "1.66.0" : "1.66.0";
|
|
474539
474708
|
}
|
|
474540
474709
|
function workflowPath(cwd2) {
|
|
474541
474710
|
return join159(cwd2, ".github", "workflows", "ur-agentic-ci.yml");
|
|
@@ -480400,7 +480569,7 @@ function createAcpStdioApp(deps) {
|
|
|
480400
480569
|
}
|
|
480401
480570
|
},
|
|
480402
480571
|
authMethods: [],
|
|
480403
|
-
agentInfo: { name: "UR-Nexus", version: "1.
|
|
480572
|
+
agentInfo: { name: "UR-Nexus", version: "1.66.0" }
|
|
480404
480573
|
})).onRequest("authenticate", () => ({})).onRequest("session/new", async (context6) => {
|
|
480405
480574
|
const result = runtime2.newSession(context6.params.cwd, context6.params.mcpServers, context6.params.additionalDirectories);
|
|
480406
480575
|
await runtime2.announce({
|
|
@@ -480497,7 +480666,7 @@ function createAcpStdioAgent(deps) {
|
|
|
480497
480666
|
}
|
|
480498
480667
|
},
|
|
480499
480668
|
authMethods: [],
|
|
480500
|
-
agentInfo: { name: "UR-Nexus", version: "1.
|
|
480669
|
+
agentInfo: { name: "UR-Nexus", version: "1.66.0" }
|
|
480501
480670
|
});
|
|
480502
480671
|
return;
|
|
480503
480672
|
case "authenticate":
|
|
@@ -691657,7 +691826,7 @@ async function captureMemoryDiagnostics(trigger2, dumpNumber = 0) {
|
|
|
691657
691826
|
smapsRollup,
|
|
691658
691827
|
platform: process.platform,
|
|
691659
691828
|
nodeVersion: process.version,
|
|
691660
|
-
ccVersion: "1.
|
|
691829
|
+
ccVersion: "1.66.0"
|
|
691661
691830
|
};
|
|
691662
691831
|
}
|
|
691663
691832
|
async function performHeapDump(trigger2 = "manual", dumpNumber = 0) {
|
|
@@ -692237,7 +692406,7 @@ var init_bridge_kick = __esm(() => {
|
|
|
692237
692406
|
var call153 = async () => {
|
|
692238
692407
|
return {
|
|
692239
692408
|
type: "text",
|
|
692240
|
-
value: "1.
|
|
692409
|
+
value: "1.66.0"
|
|
692241
692410
|
};
|
|
692242
692411
|
}, version2, version_default;
|
|
692243
692412
|
var init_version = __esm(() => {
|
|
@@ -703417,7 +703586,7 @@ function generateHtmlReport(data, insights) {
|
|
|
703417
703586
|
</html>`;
|
|
703418
703587
|
}
|
|
703419
703588
|
function buildExportData(data, insights, facets, remoteStats) {
|
|
703420
|
-
const version3 = typeof MACRO !== "undefined" ? "1.
|
|
703589
|
+
const version3 = typeof MACRO !== "undefined" ? "1.66.0" : "unknown";
|
|
703421
703590
|
const remote_hosts_collected = remoteStats?.hosts.filter((h2) => h2.sessionCount > 0).map((h2) => h2.name);
|
|
703422
703591
|
const facets_summary = {
|
|
703423
703592
|
total: facets.size,
|
|
@@ -707744,7 +707913,7 @@ var init_sessionStorage = __esm(() => {
|
|
|
707744
707913
|
init_settings2();
|
|
707745
707914
|
init_slowOperations();
|
|
707746
707915
|
init_uuid();
|
|
707747
|
-
VERSION7 = typeof MACRO !== "undefined" ? "1.
|
|
707916
|
+
VERSION7 = typeof MACRO !== "undefined" ? "1.66.0" : "unknown";
|
|
707748
707917
|
MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
|
|
707749
707918
|
SKIP_FIRST_PROMPT_PATTERN = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
|
|
707750
707919
|
EPHEMERAL_PROGRESS_TYPES = new Set([
|
|
@@ -708959,7 +709128,7 @@ var init_filesystem = __esm(() => {
|
|
|
708959
709128
|
});
|
|
708960
709129
|
getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
|
|
708961
709130
|
const nonce = randomBytes20(16).toString("hex");
|
|
708962
|
-
return join230(getURTempDir(), "bundled-skills", "1.
|
|
709131
|
+
return join230(getURTempDir(), "bundled-skills", "1.66.0", nonce);
|
|
708963
709132
|
});
|
|
708964
709133
|
getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
|
|
708965
709134
|
});
|
|
@@ -715265,7 +715434,7 @@ function computeFingerprint(messageText2, version3) {
|
|
|
715265
715434
|
}
|
|
715266
715435
|
function computeFingerprintFromMessages(messages) {
|
|
715267
715436
|
const firstMessageText = extractFirstMessageText(messages);
|
|
715268
|
-
return computeFingerprint(firstMessageText, "1.
|
|
715437
|
+
return computeFingerprint(firstMessageText, "1.66.0");
|
|
715269
715438
|
}
|
|
715270
715439
|
var FINGERPRINT_SALT = "59cf53e54c78";
|
|
715271
715440
|
var init_fingerprint = () => {};
|
|
@@ -717164,7 +717333,7 @@ async function sideQuery(opts) {
|
|
|
717164
717333
|
betas.push(STRUCTURED_OUTPUTS_BETA_HEADER);
|
|
717165
717334
|
}
|
|
717166
717335
|
const messageText2 = extractFirstUserMessageText(messages);
|
|
717167
|
-
const fingerprint2 = computeFingerprint(messageText2, "1.
|
|
717336
|
+
const fingerprint2 = computeFingerprint(messageText2, "1.66.0");
|
|
717168
717337
|
const attributionHeader = getAttributionHeader(fingerprint2);
|
|
717169
717338
|
const systemBlocks = [
|
|
717170
717339
|
attributionHeader ? { type: "text", text: attributionHeader } : null,
|
|
@@ -721951,7 +722120,7 @@ function buildSystemInitMessage(inputs) {
|
|
|
721951
722120
|
slash_commands: inputs.commands.filter((c4) => c4.userInvocable !== false).map((c4) => c4.name),
|
|
721952
722121
|
apiKeySource: getURHQApiKeyWithSource().source,
|
|
721953
722122
|
betas: getSdkBetas(),
|
|
721954
|
-
ur_version: "1.
|
|
722123
|
+
ur_version: "1.66.0",
|
|
721955
722124
|
output_style: outputStyle2,
|
|
721956
722125
|
agents: inputs.agents.map((agent2) => agent2.agentType),
|
|
721957
722126
|
skills: inputs.skills.filter((s) => s.userInvocable !== false).map((skill2) => skill2.name),
|
|
@@ -735902,7 +736071,7 @@ var init_useVoiceEnabled = __esm(() => {
|
|
|
735902
736071
|
function getSemverPart(version3) {
|
|
735903
736072
|
return `${import_semver13.major(version3, { loose: true })}.${import_semver13.minor(version3, { loose: true })}.${import_semver13.patch(version3, { loose: true })}`;
|
|
735904
736073
|
}
|
|
735905
|
-
function useUpdateNotification(updatedVersion, initialVersion = "1.
|
|
736074
|
+
function useUpdateNotification(updatedVersion, initialVersion = "1.66.0") {
|
|
735906
736075
|
const [lastNotifiedSemver, setLastNotifiedSemver] = import_react222.useState(() => getSemverPart(initialVersion));
|
|
735907
736076
|
if (!updatedVersion) {
|
|
735908
736077
|
return null;
|
|
@@ -735951,7 +736120,7 @@ function AutoUpdater({
|
|
|
735951
736120
|
return;
|
|
735952
736121
|
}
|
|
735953
736122
|
if (false) {}
|
|
735954
|
-
const currentVersion = "1.
|
|
736123
|
+
const currentVersion = "1.66.0";
|
|
735955
736124
|
const channel = getInitialSettings()?.autoUpdatesChannel ?? "latest";
|
|
735956
736125
|
let latestVersion = await getLatestVersion(channel);
|
|
735957
736126
|
const isDisabled = isAutoUpdaterDisabled();
|
|
@@ -736180,12 +736349,12 @@ function NativeAutoUpdater({
|
|
|
736180
736349
|
logEvent("tengu_native_auto_updater_start", {});
|
|
736181
736350
|
try {
|
|
736182
736351
|
const maxVersion = await getMaxVersion();
|
|
736183
|
-
if (maxVersion && gt("1.
|
|
736352
|
+
if (maxVersion && gt("1.66.0", maxVersion)) {
|
|
736184
736353
|
const msg = await getMaxVersionMessage();
|
|
736185
736354
|
setMaxVersionIssue(msg ?? "affects your version");
|
|
736186
736355
|
}
|
|
736187
736356
|
const result = await installLatest(channel);
|
|
736188
|
-
const currentVersion = "1.
|
|
736357
|
+
const currentVersion = "1.66.0";
|
|
736189
736358
|
const latencyMs = Date.now() - startTime;
|
|
736190
736359
|
if (result.lockFailed) {
|
|
736191
736360
|
logEvent("tengu_native_auto_updater_lock_contention", {
|
|
@@ -736322,17 +736491,17 @@ function PackageManagerAutoUpdater(t0) {
|
|
|
736322
736491
|
const maxVersion = await getMaxVersion();
|
|
736323
736492
|
if (maxVersion && latest && gt(latest, maxVersion)) {
|
|
736324
736493
|
logForDebugging(`PackageManagerAutoUpdater: maxVersion ${maxVersion} is set, capping update from ${latest} to ${maxVersion}`);
|
|
736325
|
-
if (gte("1.
|
|
736326
|
-
logForDebugging(`PackageManagerAutoUpdater: current version ${"1.
|
|
736494
|
+
if (gte("1.66.0", maxVersion)) {
|
|
736495
|
+
logForDebugging(`PackageManagerAutoUpdater: current version ${"1.66.0"} is already at or above maxVersion ${maxVersion}, skipping update`);
|
|
736327
736496
|
setUpdateAvailable(false);
|
|
736328
736497
|
return;
|
|
736329
736498
|
}
|
|
736330
736499
|
latest = maxVersion;
|
|
736331
736500
|
}
|
|
736332
|
-
const hasUpdate = latest && !gte("1.
|
|
736501
|
+
const hasUpdate = latest && !gte("1.66.0", latest) && !shouldSkipVersion(latest);
|
|
736333
736502
|
setUpdateAvailable(!!hasUpdate);
|
|
736334
736503
|
if (hasUpdate) {
|
|
736335
|
-
logForDebugging(`PackageManagerAutoUpdater: Update available ${"1.
|
|
736504
|
+
logForDebugging(`PackageManagerAutoUpdater: Update available ${"1.66.0"} -> ${latest}`);
|
|
736336
736505
|
}
|
|
736337
736506
|
};
|
|
736338
736507
|
$2[0] = t1;
|
|
@@ -736366,7 +736535,7 @@ function PackageManagerAutoUpdater(t0) {
|
|
|
736366
736535
|
wrap: "truncate",
|
|
736367
736536
|
children: [
|
|
736368
736537
|
"currentVersion: ",
|
|
736369
|
-
"1.
|
|
736538
|
+
"1.66.0"
|
|
736370
736539
|
]
|
|
736371
736540
|
}, undefined, true, undefined, this);
|
|
736372
736541
|
$2[3] = verbose;
|
|
@@ -736664,88 +736833,61 @@ var init_compactWarningHook = __esm(() => {
|
|
|
736664
736833
|
});
|
|
736665
736834
|
|
|
736666
736835
|
// src/components/TokenWarning.tsx
|
|
736667
|
-
function TokenWarning(
|
|
736668
|
-
|
|
736669
|
-
|
|
736670
|
-
|
|
736671
|
-
|
|
736672
|
-
|
|
736673
|
-
|
|
736674
|
-
if (
|
|
736675
|
-
|
|
736676
|
-
$2[0] = model;
|
|
736677
|
-
$2[1] = tokenUsage;
|
|
736678
|
-
$2[2] = t1;
|
|
736679
|
-
} else {
|
|
736680
|
-
t1 = $2[2];
|
|
736681
|
-
}
|
|
736836
|
+
function TokenWarning({
|
|
736837
|
+
tokenUsage,
|
|
736838
|
+
model
|
|
736839
|
+
}) {
|
|
736840
|
+
let reactiveOnlyMode = false;
|
|
736841
|
+
let collapseMode = false;
|
|
736842
|
+
if (false) {}
|
|
736843
|
+
if (false) {}
|
|
736844
|
+
const effectiveWindow = reactiveOnlyMode || collapseMode ? getEffectiveContextWindowSize(model) : undefined;
|
|
736682
736845
|
const {
|
|
736683
736846
|
percentLeft,
|
|
736684
736847
|
isAboveWarningThreshold,
|
|
736685
736848
|
isAboveErrorThreshold
|
|
736686
|
-
} =
|
|
736849
|
+
} = calculateTokenWarningState(tokenUsage, model, effectiveWindow);
|
|
736687
736850
|
const suppressWarning = useCompactWarningSuppression();
|
|
736688
|
-
if (
|
|
736851
|
+
if (suppressWarning) {
|
|
736689
736852
|
return null;
|
|
736690
736853
|
}
|
|
736691
|
-
|
|
736692
|
-
|
|
736693
|
-
|
|
736694
|
-
$2[3] = t2;
|
|
736695
|
-
} else {
|
|
736696
|
-
t2 = $2[3];
|
|
736697
|
-
}
|
|
736698
|
-
const showAutoCompactWarning = t2;
|
|
736699
|
-
let t3;
|
|
736700
|
-
if ($2[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
736701
|
-
t3 = getUpgradeMessage("warning");
|
|
736702
|
-
$2[4] = t3;
|
|
736703
|
-
} else {
|
|
736704
|
-
t3 = $2[4];
|
|
736705
|
-
}
|
|
736706
|
-
const upgradeMessage = t3;
|
|
736707
|
-
let displayPercentLeft = percentLeft;
|
|
736708
|
-
let reactiveOnlyMode = false;
|
|
736709
|
-
let collapseMode = false;
|
|
736710
|
-
if (false) {}
|
|
736711
|
-
if (false) {}
|
|
736712
|
-
if (reactiveOnlyMode || collapseMode) {
|
|
736713
|
-
const effectiveWindow = getEffectiveContextWindowSize(model);
|
|
736714
|
-
let t42;
|
|
736715
|
-
if ($2[5] !== effectiveWindow || $2[6] !== tokenUsage) {
|
|
736716
|
-
t42 = Math.round((effectiveWindow - tokenUsage) / effectiveWindow * 100);
|
|
736717
|
-
$2[5] = effectiveWindow;
|
|
736718
|
-
$2[6] = tokenUsage;
|
|
736719
|
-
$2[7] = t42;
|
|
736720
|
-
} else {
|
|
736721
|
-
t42 = $2[7];
|
|
736722
|
-
}
|
|
736723
|
-
displayPercentLeft = Math.max(0, t42);
|
|
736724
|
-
}
|
|
736854
|
+
const showAutoCompactWarning = isAutoCompactEnabled();
|
|
736855
|
+
const upgradeMessage = getUpgradeMessage("warning");
|
|
736856
|
+
const displayPercentLeft = percentLeft;
|
|
736725
736857
|
if (collapseMode && false) {}
|
|
736726
|
-
const autocompactLabel = reactiveOnlyMode ? `${100 - displayPercentLeft}% context used` :
|
|
736727
|
-
|
|
736728
|
-
|
|
736729
|
-
t4 = /* @__PURE__ */ jsx_dev_runtime397.jsxDEV(ThemedBox_default, {
|
|
736858
|
+
const autocompactLabel = reactiveOnlyMode ? `${100 - displayPercentLeft}% context used` : `\u2248${displayPercentLeft}% until auto-compact`;
|
|
736859
|
+
if (showAutoCompactWarning && !reactiveOnlyMode) {
|
|
736860
|
+
return /* @__PURE__ */ jsx_dev_runtime397.jsxDEV(ThemedBox_default, {
|
|
736730
736861
|
flexDirection: "row",
|
|
736731
|
-
children:
|
|
736732
|
-
|
|
736862
|
+
children: /* @__PURE__ */ jsx_dev_runtime397.jsxDEV(ThemedText, {
|
|
736863
|
+
color: isAboveErrorThreshold ? "error" : isAboveWarningThreshold ? "warning" : undefined,
|
|
736864
|
+
dimColor: !isAboveWarningThreshold,
|
|
736733
736865
|
wrap: "truncate",
|
|
736734
736866
|
children: upgradeMessage ? `${autocompactLabel} \xB7 ${upgradeMessage}` : autocompactLabel
|
|
736735
|
-
}, undefined, false, undefined, this)
|
|
736867
|
+
}, undefined, false, undefined, this)
|
|
736868
|
+
}, undefined, false, undefined, this);
|
|
736869
|
+
}
|
|
736870
|
+
if (!isAboveWarningThreshold) {
|
|
736871
|
+
return null;
|
|
736872
|
+
}
|
|
736873
|
+
if (reactiveOnlyMode) {
|
|
736874
|
+
return /* @__PURE__ */ jsx_dev_runtime397.jsxDEV(ThemedBox_default, {
|
|
736875
|
+
flexDirection: "row",
|
|
736876
|
+
children: /* @__PURE__ */ jsx_dev_runtime397.jsxDEV(ThemedText, {
|
|
736736
736877
|
color: isAboveErrorThreshold ? "error" : "warning",
|
|
736737
736878
|
wrap: "truncate",
|
|
736738
|
-
children: upgradeMessage ?
|
|
736879
|
+
children: upgradeMessage ? `${autocompactLabel} \xB7 ${upgradeMessage}` : autocompactLabel
|
|
736739
736880
|
}, undefined, false, undefined, this)
|
|
736740
736881
|
}, undefined, false, undefined, this);
|
|
736741
|
-
$2[9] = autocompactLabel;
|
|
736742
|
-
$2[10] = isAboveErrorThreshold;
|
|
736743
|
-
$2[11] = percentLeft;
|
|
736744
|
-
$2[12] = t4;
|
|
736745
|
-
} else {
|
|
736746
|
-
t4 = $2[12];
|
|
736747
736882
|
}
|
|
736748
|
-
return
|
|
736883
|
+
return /* @__PURE__ */ jsx_dev_runtime397.jsxDEV(ThemedBox_default, {
|
|
736884
|
+
flexDirection: "row",
|
|
736885
|
+
children: /* @__PURE__ */ jsx_dev_runtime397.jsxDEV(ThemedText, {
|
|
736886
|
+
color: isAboveErrorThreshold ? "error" : "warning",
|
|
736887
|
+
wrap: "truncate",
|
|
736888
|
+
children: upgradeMessage ? `Context low (${percentLeft}% remaining) \xB7 ${upgradeMessage}` : `Context low (${percentLeft}% remaining) \xB7 Run /compact to compact & continue`
|
|
736889
|
+
}, undefined, false, undefined, this)
|
|
736890
|
+
}, undefined, false, undefined, this);
|
|
736749
736891
|
}
|
|
736750
736892
|
var import_compiler_runtime290, import_react228, jsx_dev_runtime397;
|
|
736751
736893
|
var init_TokenWarning = __esm(() => {
|
|
@@ -737009,7 +737151,7 @@ function Notifications(t0) {
|
|
|
737009
737151
|
let t3;
|
|
737010
737152
|
if ($2[0] !== messages) {
|
|
737011
737153
|
const messagesForTokenCount = getMessagesAfterCompactBoundary(messages);
|
|
737012
|
-
t3 =
|
|
737154
|
+
t3 = tokenCountWithEstimation(messagesForTokenCount);
|
|
737013
737155
|
$2[0] = messages;
|
|
737014
737156
|
$2[1] = t3;
|
|
737015
737157
|
} else {
|
|
@@ -737026,7 +737168,7 @@ function Notifications(t0) {
|
|
|
737026
737168
|
} else {
|
|
737027
737169
|
t4 = $2[4];
|
|
737028
737170
|
}
|
|
737029
|
-
const isShowingCompactMessage = t4.isAboveWarningThreshold;
|
|
737171
|
+
const isShowingCompactMessage = isProactiveAutoCompactEnabled() || t4.isAboveWarningThreshold;
|
|
737030
737172
|
const {
|
|
737031
737173
|
status: ideStatus
|
|
737032
737174
|
} = useIdeConnectionStatus(mcpClients);
|
|
@@ -747086,7 +747228,7 @@ function buildStatusLineCommandInput(permissionMode, exceeds200kTokens, settings
|
|
|
747086
747228
|
project_dir: getOriginalCwd(),
|
|
747087
747229
|
added_dirs: addedDirs
|
|
747088
747230
|
},
|
|
747089
|
-
version: "1.
|
|
747231
|
+
version: "1.66.0",
|
|
747090
747232
|
output_style: {
|
|
747091
747233
|
name: outputStyleName
|
|
747092
747234
|
},
|
|
@@ -747164,7 +747306,7 @@ function StatusLineInner({
|
|
|
747164
747306
|
const taskValues = Object.values(tasks2);
|
|
747165
747307
|
const taskRunningCount = countActiveBackgroundTasks(taskValues);
|
|
747166
747308
|
const defaultStatusLineText = buildDefaultStatusBar({
|
|
747167
|
-
version: "1.
|
|
747309
|
+
version: "1.66.0",
|
|
747168
747310
|
providerLabel: providerRuntime.providerLabel,
|
|
747169
747311
|
authMode: providerRuntime.authLabel,
|
|
747170
747312
|
model: renderModelName(mainLoopModel) || providerRuntime.model || "",
|
|
@@ -759344,7 +759486,7 @@ async function submitTranscriptShare(messages, trigger2, appearanceId) {
|
|
|
759344
759486
|
} catch {}
|
|
759345
759487
|
const data = {
|
|
759346
759488
|
trigger: trigger2,
|
|
759347
|
-
version: "1.
|
|
759489
|
+
version: "1.66.0",
|
|
759348
759490
|
platform: process.platform,
|
|
759349
759491
|
transcript,
|
|
759350
759492
|
subagentTranscripts: Object.keys(subagentTranscripts).length > 0 ? subagentTranscripts : undefined,
|
|
@@ -762006,6 +762148,7 @@ var init_controlSchemas = __esm(() => {
|
|
|
762006
762148
|
}))
|
|
762007
762149
|
}).optional(),
|
|
762008
762150
|
autoCompactThreshold: exports_external.number().optional(),
|
|
762151
|
+
autoCompactPercentLeft: exports_external.number().min(0).max(100).optional(),
|
|
762009
762152
|
isAutoCompactEnabled: exports_external.boolean(),
|
|
762010
762153
|
messageBreakdown: exports_external.object({
|
|
762011
762154
|
toolCallTokens: exports_external.number(),
|
|
@@ -770383,6 +770526,7 @@ Note: ctrl + z now suspends UR, ctrl + _ undoes input.
|
|
|
770383
770526
|
if (false) {}
|
|
770384
770527
|
setConversationId(randomUUID83());
|
|
770385
770528
|
runPostCompactCleanup(context6.options.querySource);
|
|
770529
|
+
suppressCompactWarning();
|
|
770386
770530
|
if (direction === "from") {
|
|
770387
770531
|
const r = textForResubmit(message);
|
|
770388
770532
|
if (r) {
|
|
@@ -770547,6 +770691,7 @@ var init_REPL = __esm(() => {
|
|
|
770547
770691
|
init_queryHelpers();
|
|
770548
770692
|
init_microCompact();
|
|
770549
770693
|
init_postCompactCleanup();
|
|
770694
|
+
init_compactWarningState();
|
|
770550
770695
|
init_toolResultStorage();
|
|
770551
770696
|
init_compact();
|
|
770552
770697
|
init_fileHistory();
|
|
@@ -771709,7 +771854,7 @@ function WelcomeV2() {
|
|
|
771709
771854
|
dimColor: true,
|
|
771710
771855
|
children: [
|
|
771711
771856
|
"v",
|
|
771712
|
-
"1.
|
|
771857
|
+
"1.66.0"
|
|
771713
771858
|
]
|
|
771714
771859
|
}, undefined, true, undefined, this)
|
|
771715
771860
|
]
|
|
@@ -772969,7 +773114,7 @@ function completeOnboarding() {
|
|
|
772969
773114
|
saveGlobalConfig((current) => ({
|
|
772970
773115
|
...current,
|
|
772971
773116
|
hasCompletedOnboarding: true,
|
|
772972
|
-
lastOnboardingVersion: "1.
|
|
773117
|
+
lastOnboardingVersion: "1.66.0"
|
|
772973
773118
|
}));
|
|
772974
773119
|
}
|
|
772975
773120
|
function showDialog(root2, renderer) {
|
|
@@ -778013,7 +778158,7 @@ function appendToLog(path24, message) {
|
|
|
778013
778158
|
cwd: getFsImplementation().cwd(),
|
|
778014
778159
|
userType: process.env.USER_TYPE,
|
|
778015
778160
|
sessionId: getSessionId(),
|
|
778016
|
-
version: "1.
|
|
778161
|
+
version: "1.66.0"
|
|
778017
778162
|
};
|
|
778018
778163
|
getLogWriter(path24).write(messageWithTimestamp);
|
|
778019
778164
|
}
|
|
@@ -782177,8 +782322,8 @@ async function getEnvLessBridgeConfig() {
|
|
|
782177
782322
|
}
|
|
782178
782323
|
async function checkEnvLessBridgeMinVersion() {
|
|
782179
782324
|
const cfg = await getEnvLessBridgeConfig();
|
|
782180
|
-
if (cfg.min_version && lt("1.
|
|
782181
|
-
return `Your version of UR (${"1.
|
|
782325
|
+
if (cfg.min_version && lt("1.66.0", cfg.min_version)) {
|
|
782326
|
+
return `Your version of UR (${"1.66.0"}) is too old for Remote Control.
|
|
782182
782327
|
Version ${cfg.min_version} or higher is required. Run \`ur update\` to update.`;
|
|
782183
782328
|
}
|
|
782184
782329
|
return null;
|
|
@@ -782652,7 +782797,7 @@ async function initBridgeCore(params) {
|
|
|
782652
782797
|
const rawApi = createBridgeApiClient({
|
|
782653
782798
|
baseUrl,
|
|
782654
782799
|
getAccessToken,
|
|
782655
|
-
runnerVersion: "1.
|
|
782800
|
+
runnerVersion: "1.66.0",
|
|
782656
782801
|
onDebug: logForDebugging,
|
|
782657
782802
|
onAuth401,
|
|
782658
782803
|
getTrustedDeviceToken
|
|
@@ -792125,7 +792270,7 @@ function getAgUiCapabilities() {
|
|
|
792125
792270
|
name: "UR-Nexus",
|
|
792126
792271
|
type: "ur-nexus",
|
|
792127
792272
|
description: "Provider-flexible, local-first autonomous engineering workflow agent.",
|
|
792128
|
-
version: "1.
|
|
792273
|
+
version: "1.66.0",
|
|
792129
792274
|
provider: "UR",
|
|
792130
792275
|
documentationUrl: "https://github.com/Maitham16/UR/blob/master/docs/AG_UI.md"
|
|
792131
792276
|
},
|
|
@@ -793265,7 +793410,7 @@ function createMCPServer(cwd4, debug2, verbose) {
|
|
|
793265
793410
|
};
|
|
793266
793411
|
const server2 = new Server({
|
|
793267
793412
|
name: "ur-nexus",
|
|
793268
|
-
version: "1.
|
|
793413
|
+
version: "1.66.0"
|
|
793269
793414
|
}, {
|
|
793270
793415
|
capabilities: {
|
|
793271
793416
|
tools: {}
|
|
@@ -794423,7 +794568,7 @@ function thrownResponse(error40) {
|
|
|
794423
794568
|
}
|
|
794424
794569
|
async function createUrMcp2026Runtime(options4) {
|
|
794425
794570
|
const server2 = createMCPServer(options4.cwd, options4.debug === true, options4.verbose === true);
|
|
794426
|
-
const client2 = new Client({ name: "ur-mcp-2026-adapter", version: "1.
|
|
794571
|
+
const client2 = new Client({ name: "ur-mcp-2026-adapter", version: "1.66.0" }, { capabilities: {} });
|
|
794427
794572
|
const [clientTransport, serverTransport] = createLinkedTransportPair();
|
|
794428
794573
|
try {
|
|
794429
794574
|
await server2.connect(serverTransport);
|
|
@@ -794434,7 +794579,7 @@ async function createUrMcp2026Runtime(options4) {
|
|
|
794434
794579
|
}
|
|
794435
794580
|
const runtime2 = new Mcp2026Runtime({
|
|
794436
794581
|
cwd: options4.cwd,
|
|
794437
|
-
version: "1.
|
|
794582
|
+
version: "1.66.0",
|
|
794438
794583
|
backend: {
|
|
794439
794584
|
listTools: async () => {
|
|
794440
794585
|
const listed = await client2.listTools();
|
|
@@ -796567,7 +796712,7 @@ async function update() {
|
|
|
796567
796712
|
logEvent("tengu_update_check", {});
|
|
796568
796713
|
const diagnostic2 = await getDoctorDiagnostic();
|
|
796569
796714
|
const result = await checkUpgradeStatus({
|
|
796570
|
-
currentVersion: "1.
|
|
796715
|
+
currentVersion: "1.66.0",
|
|
796571
796716
|
packageName: UR_AGENT_PACKAGE_NAME,
|
|
796572
796717
|
installationType: diagnostic2.installationType,
|
|
796573
796718
|
latestVersion: () => getLatestNpmPackageVersion(UR_AGENT_PACKAGE_NAME)
|
|
@@ -797883,7 +798028,7 @@ ${customInstructions}` : customInstructions;
|
|
|
797883
798028
|
}
|
|
797884
798029
|
}
|
|
797885
798030
|
logForDiagnosticsNoPII("info", "started", {
|
|
797886
|
-
version: "1.
|
|
798031
|
+
version: "1.66.0",
|
|
797887
798032
|
is_native_binary: isInBundledMode()
|
|
797888
798033
|
});
|
|
797889
798034
|
registerCleanup(async () => {
|
|
@@ -798669,7 +798814,7 @@ Usage: ur --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
798669
798814
|
pendingHookMessages
|
|
798670
798815
|
}, renderAndRun);
|
|
798671
798816
|
}
|
|
798672
|
-
}).version("1.
|
|
798817
|
+
}).version("1.66.0 (UR-Nexus)", "-v, --version", "Output the version number");
|
|
798673
798818
|
program2.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
|
|
798674
798819
|
program2.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
|
|
798675
798820
|
if (canUserConfigureAdvisor()) {
|
|
@@ -799728,7 +799873,7 @@ if (false) {}
|
|
|
799728
799873
|
async function main2() {
|
|
799729
799874
|
const args = process.argv.slice(2);
|
|
799730
799875
|
if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
|
|
799731
|
-
console.log(`${"1.
|
|
799876
|
+
console.log(`${"1.66.0"} (UR-Nexus)`);
|
|
799732
799877
|
return;
|
|
799733
799878
|
}
|
|
799734
799879
|
if (args[0] === "a2a" && args[1] === "serve" && !args.includes("--help") && !args.includes("-h")) {
|