ur-agent 1.22.6 → 1.22.7
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 +21 -0
- package/dist/cli.js +932 -368
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -16259,13 +16259,15 @@ function createBackgroundTask(options) {
|
|
|
16259
16259
|
saveManifest(root2, manifest);
|
|
16260
16260
|
return task;
|
|
16261
16261
|
}
|
|
16262
|
-
function
|
|
16263
|
-
const
|
|
16264
|
-
|
|
16265
|
-
|
|
16266
|
-
|
|
16267
|
-
|
|
16268
|
-
|
|
16262
|
+
function buildWorkerCommand(task, bin) {
|
|
16263
|
+
const entry = cliEntry(bin);
|
|
16264
|
+
return {
|
|
16265
|
+
entry,
|
|
16266
|
+
command: [...entry.baseArgs, "bg", "worker", task.id]
|
|
16267
|
+
};
|
|
16268
|
+
}
|
|
16269
|
+
function spawnBackgroundWorker(task, bin) {
|
|
16270
|
+
const { entry, command } = buildWorkerCommand(task, bin);
|
|
16269
16271
|
const out = openSync3(task.logFile, "a");
|
|
16270
16272
|
const err = openSync3(task.logFile, "a");
|
|
16271
16273
|
try {
|
|
@@ -16283,6 +16285,26 @@ function startBackgroundTask(options) {
|
|
|
16283
16285
|
closeSync3(out);
|
|
16284
16286
|
closeSync3(err);
|
|
16285
16287
|
}
|
|
16288
|
+
return [entry.file, ...command];
|
|
16289
|
+
}
|
|
16290
|
+
function startBackgroundTask(options) {
|
|
16291
|
+
const task = createBackgroundTask(options);
|
|
16292
|
+
const { entry, command } = buildWorkerCommand(task, options.bin);
|
|
16293
|
+
if (options.dryRun) {
|
|
16294
|
+
return { task, command: [entry.file, ...command], dryRun: true };
|
|
16295
|
+
}
|
|
16296
|
+
spawnBackgroundWorker(task, options.bin);
|
|
16297
|
+
return { task, command: [entry.file, ...command], dryRun: false };
|
|
16298
|
+
}
|
|
16299
|
+
function startExistingBackgroundTask(cwd2, id, options = {}) {
|
|
16300
|
+
const task = getBackgroundTask(cwd2, id);
|
|
16301
|
+
if (!task)
|
|
16302
|
+
return null;
|
|
16303
|
+
const { entry, command } = buildWorkerCommand(task, options.bin);
|
|
16304
|
+
if (options.dryRun) {
|
|
16305
|
+
return { task, command: [entry.file, ...command], dryRun: true };
|
|
16306
|
+
}
|
|
16307
|
+
spawnBackgroundWorker(task, options.bin);
|
|
16286
16308
|
return { task, command: [entry.file, ...command], dryRun: false };
|
|
16287
16309
|
}
|
|
16288
16310
|
function fanoutBackgroundTasks(options) {
|
|
@@ -16939,7 +16961,7 @@ function formatAgentTrendReport(report = buildAgentTrendReport()) {
|
|
|
16939
16961
|
function formatA2AAgentCard(options = {}, pretty = true) {
|
|
16940
16962
|
return JSON.stringify(buildA2AAgentCard(options), null, pretty ? 2 : 0);
|
|
16941
16963
|
}
|
|
16942
|
-
var urVersion = "1.22.
|
|
16964
|
+
var urVersion = "1.22.7", coverage, priorityRoadmap;
|
|
16943
16965
|
var init_trends = __esm(() => {
|
|
16944
16966
|
coverage = [
|
|
16945
16967
|
{
|
|
@@ -70953,7 +70975,7 @@ var init_auth = __esm(() => {
|
|
|
70953
70975
|
|
|
70954
70976
|
// src/utils/userAgent.ts
|
|
70955
70977
|
function getURCodeUserAgent() {
|
|
70956
|
-
return `ur/${"1.22.
|
|
70978
|
+
return `ur/${"1.22.7"}`;
|
|
70957
70979
|
}
|
|
70958
70980
|
|
|
70959
70981
|
// src/utils/workloadContext.ts
|
|
@@ -70975,7 +70997,7 @@ function getUserAgent() {
|
|
|
70975
70997
|
const clientApp = process.env.UR_AGENT_SDK_CLIENT_APP ? `, client-app/${process.env.UR_AGENT_SDK_CLIENT_APP}` : "";
|
|
70976
70998
|
const workload = getWorkload();
|
|
70977
70999
|
const workloadSuffix = workload ? `, workload/${workload}` : "";
|
|
70978
|
-
return `ur-cli/${"1.22.
|
|
71000
|
+
return `ur-cli/${"1.22.7"} (${process.env.USER_TYPE}, ${process.env.UR_CODE_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
|
|
70979
71001
|
}
|
|
70980
71002
|
function getMCPUserAgent() {
|
|
70981
71003
|
const parts = [];
|
|
@@ -70989,7 +71011,7 @@ function getMCPUserAgent() {
|
|
|
70989
71011
|
parts.push(`client-app/${process.env.UR_AGENT_SDK_CLIENT_APP}`);
|
|
70990
71012
|
}
|
|
70991
71013
|
const suffix = parts.length > 0 ? ` (${parts.join(", ")})` : "";
|
|
70992
|
-
return `ur/${"1.22.
|
|
71014
|
+
return `ur/${"1.22.7"}${suffix}`;
|
|
70993
71015
|
}
|
|
70994
71016
|
function getWebFetchUserAgent() {
|
|
70995
71017
|
return `UR-User (${getURCodeUserAgent()})`;
|
|
@@ -71424,7 +71446,7 @@ var init_user = __esm(() => {
|
|
|
71424
71446
|
deviceId,
|
|
71425
71447
|
sessionId: getSessionId(),
|
|
71426
71448
|
email: getEmail(),
|
|
71427
|
-
appVersion: "1.22.
|
|
71449
|
+
appVersion: "1.22.7",
|
|
71428
71450
|
platform: getHostPlatformForAnalytics(),
|
|
71429
71451
|
organizationUuid,
|
|
71430
71452
|
accountUuid,
|
|
@@ -77201,7 +77223,7 @@ var init_metadata = __esm(() => {
|
|
|
77201
77223
|
COMPOUND_OPERATOR_REGEX = /\s*(?:&&|\|\||[;|])\s*/;
|
|
77202
77224
|
WHITESPACE_REGEX = /\s+/;
|
|
77203
77225
|
getVersionBase = memoize_default(() => {
|
|
77204
|
-
const match = "1.22.
|
|
77226
|
+
const match = "1.22.7".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
|
|
77205
77227
|
return match ? match[0] : undefined;
|
|
77206
77228
|
});
|
|
77207
77229
|
buildEnvContext = memoize_default(async () => {
|
|
@@ -77241,7 +77263,7 @@ var init_metadata = __esm(() => {
|
|
|
77241
77263
|
isGithubAction: isEnvTruthy(process.env.GITHUB_ACTIONS),
|
|
77242
77264
|
isURCodeAction: isEnvTruthy(process.env.UR_CODE_ACTION),
|
|
77243
77265
|
isURAiAuth: isURAISubscriber2(),
|
|
77244
|
-
version: "1.22.
|
|
77266
|
+
version: "1.22.7",
|
|
77245
77267
|
versionBase: getVersionBase(),
|
|
77246
77268
|
buildTime: "",
|
|
77247
77269
|
deploymentEnvironment: env3.detectDeploymentEnvironment(),
|
|
@@ -77911,7 +77933,7 @@ function initialize1PEventLogging() {
|
|
|
77911
77933
|
const platform2 = getPlatform();
|
|
77912
77934
|
const attributes = {
|
|
77913
77935
|
[import_semantic_conventions4.ATTR_SERVICE_NAME]: "ur",
|
|
77914
|
-
[import_semantic_conventions4.ATTR_SERVICE_VERSION]: "1.22.
|
|
77936
|
+
[import_semantic_conventions4.ATTR_SERVICE_VERSION]: "1.22.7"
|
|
77915
77937
|
};
|
|
77916
77938
|
if (platform2 === "wsl") {
|
|
77917
77939
|
const wslVersion = getWslVersion();
|
|
@@ -77938,7 +77960,7 @@ function initialize1PEventLogging() {
|
|
|
77938
77960
|
})
|
|
77939
77961
|
]
|
|
77940
77962
|
});
|
|
77941
|
-
firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.urhq.ur.events", "1.22.
|
|
77963
|
+
firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.urhq.ur.events", "1.22.7");
|
|
77942
77964
|
}
|
|
77943
77965
|
async function reinitialize1PEventLoggingIfConfigChanged() {
|
|
77944
77966
|
if (!is1PEventLoggingEnabled() || !firstPartyEventLoggerProvider) {
|
|
@@ -79806,7 +79828,7 @@ function getAttributionHeader(fingerprint) {
|
|
|
79806
79828
|
if (!isAttributionHeaderEnabled()) {
|
|
79807
79829
|
return "";
|
|
79808
79830
|
}
|
|
79809
|
-
const version2 = `${"1.22.
|
|
79831
|
+
const version2 = `${"1.22.7"}.${fingerprint}`;
|
|
79810
79832
|
const entrypoint = process.env.UR_CODE_ENTRYPOINT ?? "unknown";
|
|
79811
79833
|
const cch = "";
|
|
79812
79834
|
const workload = getWorkload();
|
|
@@ -136820,6 +136842,31 @@ function classifyPermissions(command, policy) {
|
|
|
136820
136842
|
permissions.add("execute");
|
|
136821
136843
|
return [...permissions];
|
|
136822
136844
|
}
|
|
136845
|
+
function approvalLevelForEvaluation(permissions, matchedAsk = []) {
|
|
136846
|
+
if (matchedAsk.length > 0)
|
|
136847
|
+
return "destructive-commands";
|
|
136848
|
+
if (permissions.includes("network"))
|
|
136849
|
+
return "run-network-commands";
|
|
136850
|
+
if (permissions.includes("execute"))
|
|
136851
|
+
return "run-safe-commands";
|
|
136852
|
+
if (permissions.includes("write"))
|
|
136853
|
+
return "edit-project";
|
|
136854
|
+
return "read-only";
|
|
136855
|
+
}
|
|
136856
|
+
function formatApprovalLevel(level) {
|
|
136857
|
+
switch (level) {
|
|
136858
|
+
case "read-only":
|
|
136859
|
+
return "read-only";
|
|
136860
|
+
case "edit-project":
|
|
136861
|
+
return "edit project";
|
|
136862
|
+
case "run-safe-commands":
|
|
136863
|
+
return "run safe commands";
|
|
136864
|
+
case "run-network-commands":
|
|
136865
|
+
return "run network commands";
|
|
136866
|
+
case "destructive-commands":
|
|
136867
|
+
return "destructive commands";
|
|
136868
|
+
}
|
|
136869
|
+
}
|
|
136823
136870
|
function evaluateShellSafetyPolicy(command, cwd2, input) {
|
|
136824
136871
|
const policy = loadProjectSafetyPolicy(cwd2);
|
|
136825
136872
|
const permissions = classifyPermissions(command, policy);
|
|
@@ -136828,6 +136875,7 @@ function evaluateShellSafetyPolicy(command, cwd2, input) {
|
|
|
136828
136875
|
const sandboxRequired = permissions.some((permission) => policy.sandboxRequiredFor.includes(permission));
|
|
136829
136876
|
const sandbox = matchedAsk.length > 0 || input?.dangerouslyDisableSandbox ? "required" : sandboxRequired ? "recommended" : "not-needed";
|
|
136830
136877
|
const behavior = matchedDeny.length > 0 ? "deny" : matchedAsk.length > 0 || input?.dangerouslyDisableSandbox ? "ask" : "allow";
|
|
136878
|
+
const approvalLevel = approvalLevelForEvaluation(permissions, matchedAsk);
|
|
136831
136879
|
const reasons = [
|
|
136832
136880
|
...matchedDeny.map((rule) => rule.reason),
|
|
136833
136881
|
...matchedAsk.map((rule) => rule.reason)
|
|
@@ -136841,6 +136889,7 @@ function evaluateShellSafetyPolicy(command, cwd2, input) {
|
|
|
136841
136889
|
return {
|
|
136842
136890
|
command,
|
|
136843
136891
|
behavior,
|
|
136892
|
+
approvalLevel,
|
|
136844
136893
|
permissions,
|
|
136845
136894
|
sandbox,
|
|
136846
136895
|
reasons,
|
|
@@ -136852,6 +136901,7 @@ function formatShellSafetyEvaluation(evaluation, json2 = false) {
|
|
|
136852
136901
|
return JSON.stringify(evaluation, null, 2);
|
|
136853
136902
|
return [
|
|
136854
136903
|
`Safety decision: ${evaluation.behavior}`,
|
|
136904
|
+
`Approval level: ${formatApprovalLevel(evaluation.approvalLevel)}`,
|
|
136855
136905
|
`Permissions: ${evaluation.permissions.join(", ")}`,
|
|
136856
136906
|
`Sandbox: ${evaluation.sandbox}`,
|
|
136857
136907
|
"Reasons:",
|
|
@@ -187299,7 +187349,7 @@ function getTelemetryAttributes() {
|
|
|
187299
187349
|
attributes["session.id"] = sessionId;
|
|
187300
187350
|
}
|
|
187301
187351
|
if (shouldIncludeAttribute("OTEL_METRICS_INCLUDE_VERSION")) {
|
|
187302
|
-
attributes["app.version"] = "1.22.
|
|
187352
|
+
attributes["app.version"] = "1.22.7";
|
|
187303
187353
|
}
|
|
187304
187354
|
const oauthAccount = getOauthAccountInfo();
|
|
187305
187355
|
if (oauthAccount) {
|
|
@@ -223088,7 +223138,7 @@ function getInstallationEnv() {
|
|
|
223088
223138
|
return;
|
|
223089
223139
|
}
|
|
223090
223140
|
function getURCodeVersion() {
|
|
223091
|
-
return "1.22.
|
|
223141
|
+
return "1.22.7";
|
|
223092
223142
|
}
|
|
223093
223143
|
async function getInstalledVSCodeExtensionVersion(command) {
|
|
223094
223144
|
const { stdout } = await execFileNoThrow(command, ["--list-extensions", "--show-versions"], {
|
|
@@ -225816,7 +225866,7 @@ async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) {
|
|
|
225816
225866
|
const client2 = new Client({
|
|
225817
225867
|
name: "ur",
|
|
225818
225868
|
title: "UR",
|
|
225819
|
-
version: "1.22.
|
|
225869
|
+
version: "1.22.7",
|
|
225820
225870
|
description: "URHQ's agentic coding tool",
|
|
225821
225871
|
websiteUrl: PRODUCT_URL
|
|
225822
225872
|
}, {
|
|
@@ -226170,7 +226220,7 @@ var init_client5 = __esm(() => {
|
|
|
226170
226220
|
const client2 = new Client({
|
|
226171
226221
|
name: "ur",
|
|
226172
226222
|
title: "UR",
|
|
226173
|
-
version: "1.22.
|
|
226223
|
+
version: "1.22.7",
|
|
226174
226224
|
description: "URHQ's agentic coding tool",
|
|
226175
226225
|
websiteUrl: PRODUCT_URL
|
|
226176
226226
|
}, {
|
|
@@ -235983,9 +236033,9 @@ async function assertMinVersion() {
|
|
|
235983
236033
|
if (false) {}
|
|
235984
236034
|
try {
|
|
235985
236035
|
const versionConfig = await getDynamicConfig_BLOCKS_ON_INIT("tengu_version_config", { minVersion: "0.0.0" });
|
|
235986
|
-
if (versionConfig.minVersion && lt("1.22.
|
|
236036
|
+
if (versionConfig.minVersion && lt("1.22.7", versionConfig.minVersion)) {
|
|
235987
236037
|
console.error(`
|
|
235988
|
-
It looks like your version of UR (${"1.22.
|
|
236038
|
+
It looks like your version of UR (${"1.22.7"}) needs an update.
|
|
235989
236039
|
A newer version (${versionConfig.minVersion} or higher) is required to continue.
|
|
235990
236040
|
|
|
235991
236041
|
To update, please run:
|
|
@@ -236201,7 +236251,7 @@ async function installGlobalPackage(specificVersion) {
|
|
|
236201
236251
|
logError2(new AutoUpdaterError("Another process is currently installing an update"));
|
|
236202
236252
|
logEvent("tengu_auto_updater_lock_contention", {
|
|
236203
236253
|
pid: process.pid,
|
|
236204
|
-
currentVersion: "1.22.
|
|
236254
|
+
currentVersion: "1.22.7"
|
|
236205
236255
|
});
|
|
236206
236256
|
return "in_progress";
|
|
236207
236257
|
}
|
|
@@ -236210,7 +236260,7 @@ async function installGlobalPackage(specificVersion) {
|
|
|
236210
236260
|
if (!env3.isRunningWithBun() && env3.isNpmFromWindowsPath()) {
|
|
236211
236261
|
logError2(new Error("Windows NPM detected in WSL environment"));
|
|
236212
236262
|
logEvent("tengu_auto_updater_windows_npm_in_wsl", {
|
|
236213
|
-
currentVersion: "1.22.
|
|
236263
|
+
currentVersion: "1.22.7"
|
|
236214
236264
|
});
|
|
236215
236265
|
console.error(`
|
|
236216
236266
|
Error: Windows NPM detected in WSL
|
|
@@ -236745,7 +236795,7 @@ function detectLinuxGlobPatternWarnings() {
|
|
|
236745
236795
|
}
|
|
236746
236796
|
async function getDoctorDiagnostic() {
|
|
236747
236797
|
const installationType = await getCurrentInstallationType();
|
|
236748
|
-
const version2 = typeof MACRO !== "undefined" ? "1.22.
|
|
236798
|
+
const version2 = typeof MACRO !== "undefined" ? "1.22.7" : "unknown";
|
|
236749
236799
|
const installationPath = await getInstallationPath();
|
|
236750
236800
|
const invokedBinary = getInvokedBinary();
|
|
236751
236801
|
const multipleInstallations = await detectMultipleInstallations();
|
|
@@ -237680,8 +237730,8 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
|
|
|
237680
237730
|
const maxVersion = await getMaxVersion();
|
|
237681
237731
|
if (maxVersion && gt(version2, maxVersion)) {
|
|
237682
237732
|
logForDebugging(`Native installer: maxVersion ${maxVersion} is set, capping update from ${version2} to ${maxVersion}`);
|
|
237683
|
-
if (gte("1.22.
|
|
237684
|
-
logForDebugging(`Native installer: current version ${"1.22.
|
|
237733
|
+
if (gte("1.22.7", maxVersion)) {
|
|
237734
|
+
logForDebugging(`Native installer: current version ${"1.22.7"} is already at or above maxVersion ${maxVersion}, skipping update`);
|
|
237685
237735
|
logEvent("tengu_native_update_skipped_max_version", {
|
|
237686
237736
|
latency_ms: Date.now() - startTime,
|
|
237687
237737
|
max_version: maxVersion,
|
|
@@ -237692,7 +237742,7 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
|
|
|
237692
237742
|
version2 = maxVersion;
|
|
237693
237743
|
}
|
|
237694
237744
|
}
|
|
237695
|
-
if (!forceReinstall && version2 === "1.22.
|
|
237745
|
+
if (!forceReinstall && version2 === "1.22.7" && await versionIsAvailable(version2) && await isPossibleURBinary(executablePath)) {
|
|
237696
237746
|
logForDebugging(`Found ${version2} at ${executablePath}, skipping install`);
|
|
237697
237747
|
logEvent("tengu_native_update_complete", {
|
|
237698
237748
|
latency_ms: Date.now() - startTime,
|
|
@@ -302685,6 +302735,18 @@ function recordFailure(cwd2, record3) {
|
|
|
302685
302735
|
source: "failure-memory"
|
|
302686
302736
|
});
|
|
302687
302737
|
}
|
|
302738
|
+
function recordResolution(cwd2, failedCommand, resolution) {
|
|
302739
|
+
const text = [
|
|
302740
|
+
`Failed command: ${failedCommand}`,
|
|
302741
|
+
"Error: see previous failure memory for the original trace",
|
|
302742
|
+
`Resolution: ${resolution}`
|
|
302743
|
+
].join(`
|
|
302744
|
+
`);
|
|
302745
|
+
return appendProjectMemory(cwd2, "attempt", text, {
|
|
302746
|
+
status: "accepted",
|
|
302747
|
+
source: "failure-memory"
|
|
302748
|
+
});
|
|
302749
|
+
}
|
|
302688
302750
|
function findSimilarFailures(cwd2, command, error40) {
|
|
302689
302751
|
const attempts = readProjectMemoryByKind(cwd2, ["attempt"]);
|
|
302690
302752
|
const records = [];
|
|
@@ -334468,7 +334530,7 @@ function Feedback({
|
|
|
334468
334530
|
platform: env3.platform,
|
|
334469
334531
|
gitRepo: envInfo.isGit,
|
|
334470
334532
|
terminal: env3.terminal,
|
|
334471
|
-
version: "1.22.
|
|
334533
|
+
version: "1.22.7",
|
|
334472
334534
|
transcript: normalizeMessagesForAPI(messages),
|
|
334473
334535
|
errors: sanitizedErrors,
|
|
334474
334536
|
lastApiRequest: getLastAPIRequest(),
|
|
@@ -334660,7 +334722,7 @@ function Feedback({
|
|
|
334660
334722
|
", ",
|
|
334661
334723
|
env3.terminal,
|
|
334662
334724
|
", v",
|
|
334663
|
-
"1.22.
|
|
334725
|
+
"1.22.7"
|
|
334664
334726
|
]
|
|
334665
334727
|
}, undefined, true, undefined, this)
|
|
334666
334728
|
]
|
|
@@ -334766,7 +334828,7 @@ ${sanitizedDescription}
|
|
|
334766
334828
|
` + `**Environment Info**
|
|
334767
334829
|
` + `- Platform: ${env3.platform}
|
|
334768
334830
|
` + `- Terminal: ${env3.terminal}
|
|
334769
|
-
` + `- Version: ${"1.22.
|
|
334831
|
+
` + `- Version: ${"1.22.7"}
|
|
334770
334832
|
` + `- Feedback ID: ${feedbackId}
|
|
334771
334833
|
` + `
|
|
334772
334834
|
**Errors**
|
|
@@ -337876,7 +337938,7 @@ function buildPrimarySection() {
|
|
|
337876
337938
|
}, undefined, false, undefined, this);
|
|
337877
337939
|
return [{
|
|
337878
337940
|
label: "Version",
|
|
337879
|
-
value: "1.22.
|
|
337941
|
+
value: "1.22.7"
|
|
337880
337942
|
}, {
|
|
337881
337943
|
label: "Session name",
|
|
337882
337944
|
value: nameValue
|
|
@@ -341154,7 +341216,7 @@ function Config({
|
|
|
341154
341216
|
}
|
|
341155
341217
|
}, undefined, false, undefined, this)
|
|
341156
341218
|
}, undefined, false, undefined, this) : showSubmenu === "ChannelDowngrade" ? /* @__PURE__ */ jsx_dev_runtime177.jsxDEV(ChannelDowngradeDialog, {
|
|
341157
|
-
currentVersion: "1.22.
|
|
341219
|
+
currentVersion: "1.22.7",
|
|
341158
341220
|
onChoice: (choice) => {
|
|
341159
341221
|
setShowSubmenu(null);
|
|
341160
341222
|
setTabsHidden(false);
|
|
@@ -341166,7 +341228,7 @@ function Config({
|
|
|
341166
341228
|
autoUpdatesChannel: "stable"
|
|
341167
341229
|
};
|
|
341168
341230
|
if (choice === "stay") {
|
|
341169
|
-
newSettings.minimumVersion = "1.22.
|
|
341231
|
+
newSettings.minimumVersion = "1.22.7";
|
|
341170
341232
|
}
|
|
341171
341233
|
updateSettingsForSource("userSettings", newSettings);
|
|
341172
341234
|
setSettingsData((prev_27) => ({
|
|
@@ -349236,7 +349298,7 @@ function HelpV2(t0) {
|
|
|
349236
349298
|
let t6;
|
|
349237
349299
|
if ($3[31] !== tabs) {
|
|
349238
349300
|
t6 = /* @__PURE__ */ jsx_dev_runtime204.jsxDEV(Tabs, {
|
|
349239
|
-
title: `UR v${"1.22.
|
|
349301
|
+
title: `UR v${"1.22.7"}`,
|
|
349240
349302
|
color: "professionalBlue",
|
|
349241
349303
|
defaultTab: "general",
|
|
349242
349304
|
children: tabs
|
|
@@ -369200,7 +369262,7 @@ function getAllReleaseNotes(changelogContent = getStoredChangelogFromMemory()) {
|
|
|
369200
369262
|
return [];
|
|
369201
369263
|
}
|
|
369202
369264
|
}
|
|
369203
|
-
async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.22.
|
|
369265
|
+
async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.22.7") {
|
|
369204
369266
|
if (process.env.USER_TYPE === "ant") {
|
|
369205
369267
|
const changelog = "";
|
|
369206
369268
|
if (changelog) {
|
|
@@ -369227,7 +369289,7 @@ async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.22.6")
|
|
|
369227
369289
|
releaseNotes
|
|
369228
369290
|
};
|
|
369229
369291
|
}
|
|
369230
|
-
function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "1.22.
|
|
369292
|
+
function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "1.22.7") {
|
|
369231
369293
|
if (process.env.USER_TYPE === "ant") {
|
|
369232
369294
|
const changelog = "";
|
|
369233
369295
|
if (changelog) {
|
|
@@ -370397,7 +370459,7 @@ function getRecentActivitySync() {
|
|
|
370397
370459
|
return cachedActivity;
|
|
370398
370460
|
}
|
|
370399
370461
|
function getLogoDisplayData() {
|
|
370400
|
-
const version2 = process.env.DEMO_VERSION ?? "1.22.
|
|
370462
|
+
const version2 = process.env.DEMO_VERSION ?? "1.22.7";
|
|
370401
370463
|
const serverUrl = getDirectConnectServerUrl();
|
|
370402
370464
|
const displayPath = process.env.DEMO_VERSION ? "/code/ur" : getDisplayPath(getCwd2());
|
|
370403
370465
|
const cwd2 = serverUrl ? `${displayPath} in ${serverUrl.replace(/^https?:\/\//, "")}` : displayPath;
|
|
@@ -371186,7 +371248,7 @@ function LogoV2() {
|
|
|
371186
371248
|
if ($3[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
371187
371249
|
t2 = () => {
|
|
371188
371250
|
const currentConfig = getGlobalConfig();
|
|
371189
|
-
if (currentConfig.lastReleaseNotesSeen === "1.22.
|
|
371251
|
+
if (currentConfig.lastReleaseNotesSeen === "1.22.7") {
|
|
371190
371252
|
return;
|
|
371191
371253
|
}
|
|
371192
371254
|
saveGlobalConfig(_temp326);
|
|
@@ -371871,12 +371933,12 @@ function LogoV2() {
|
|
|
371871
371933
|
return t41;
|
|
371872
371934
|
}
|
|
371873
371935
|
function _temp326(current) {
|
|
371874
|
-
if (current.lastReleaseNotesSeen === "1.22.
|
|
371936
|
+
if (current.lastReleaseNotesSeen === "1.22.7") {
|
|
371875
371937
|
return current;
|
|
371876
371938
|
}
|
|
371877
371939
|
return {
|
|
371878
371940
|
...current,
|
|
371879
|
-
lastReleaseNotesSeen: "1.22.
|
|
371941
|
+
lastReleaseNotesSeen: "1.22.7"
|
|
371880
371942
|
};
|
|
371881
371943
|
}
|
|
371882
371944
|
function _temp243(s_0) {
|
|
@@ -388829,7 +388891,7 @@ function buildToolUseContext(tools, readFileStateCache) {
|
|
|
388829
388891
|
async function handleInitialize() {
|
|
388830
388892
|
return {
|
|
388831
388893
|
name: "ur-agent",
|
|
388832
|
-
version: "1.22.
|
|
388894
|
+
version: "1.22.7",
|
|
388833
388895
|
protocolVersion: "0.1.0"
|
|
388834
388896
|
};
|
|
388835
388897
|
}
|
|
@@ -397450,6 +397512,7 @@ async function runCiLoop(options2) {
|
|
|
397450
397512
|
const parsed = splitCommand2(command5);
|
|
397451
397513
|
const { file: file2, args } = options2.execTarget ? wrapCommand(options2.execTarget, parsed, cwd2) : parsed;
|
|
397452
397514
|
const attempts = [];
|
|
397515
|
+
let lastFailure;
|
|
397453
397516
|
if (options2.dryRun) {
|
|
397454
397517
|
return {
|
|
397455
397518
|
command: command5,
|
|
@@ -397464,17 +397527,30 @@ async function runCiLoop(options2) {
|
|
|
397464
397527
|
if (attempt === 1 && options2.seedError) {
|
|
397465
397528
|
summary = summarizeFailure(options2.seedError);
|
|
397466
397529
|
attempts.push({ attempt, code: 1, passed: false, summary });
|
|
397530
|
+
recordFailure(cwd2, {
|
|
397531
|
+
failedCommand: command5,
|
|
397532
|
+
errorTrace: summary
|
|
397533
|
+
});
|
|
397534
|
+
lastFailure = { summary };
|
|
397467
397535
|
options2.onEvent?.({ attempt, phase: "run", detail: "seeded from log" });
|
|
397468
397536
|
} else {
|
|
397469
397537
|
options2.onEvent?.({ attempt, phase: "run", detail: command5 });
|
|
397470
397538
|
const run = await exec6(file2, args, cwd2);
|
|
397471
397539
|
if (run.code === 0) {
|
|
397472
397540
|
attempts.push({ attempt, code: 0, passed: true });
|
|
397541
|
+
if (lastFailure) {
|
|
397542
|
+
recordResolution(cwd2, command5, `Command passed on attempt ${attempt} after ${attempt - 1} failed attempt(s).`);
|
|
397543
|
+
}
|
|
397473
397544
|
return { command: command5, status: "passed", attempts };
|
|
397474
397545
|
}
|
|
397475
397546
|
summary = summarizeFailure(`${run.stdout}
|
|
397476
397547
|
${run.stderr}`);
|
|
397477
397548
|
attempts.push({ attempt, code: run.code, passed: false, summary });
|
|
397549
|
+
recordFailure(cwd2, {
|
|
397550
|
+
failedCommand: command5,
|
|
397551
|
+
errorTrace: summary
|
|
397552
|
+
});
|
|
397553
|
+
lastFailure = { summary };
|
|
397478
397554
|
}
|
|
397479
397555
|
if (attempt === maxAttempts)
|
|
397480
397556
|
break;
|
|
@@ -397492,6 +397568,15 @@ End with VERDICT: PASS when you believe it is fixed.`,
|
|
|
397492
397568
|
});
|
|
397493
397569
|
const last2 = attempts[attempts.length - 1];
|
|
397494
397570
|
last2.fixVerdict = fix.verdict ?? null;
|
|
397571
|
+
lastFailure = {
|
|
397572
|
+
summary,
|
|
397573
|
+
attemptedFix: fix.output.slice(0, 2000)
|
|
397574
|
+
};
|
|
397575
|
+
recordFailure(cwd2, {
|
|
397576
|
+
failedCommand: command5,
|
|
397577
|
+
errorTrace: summary,
|
|
397578
|
+
attemptedFix: lastFailure.attemptedFix
|
|
397579
|
+
});
|
|
397495
397580
|
if (options2.commit || options2.push) {
|
|
397496
397581
|
const diff3 = await git5("git", ["diff", "HEAD"], cwd2);
|
|
397497
397582
|
if (hasBlockingFindings(reviewDiff(diff3.stdout))) {
|
|
@@ -397548,6 +397633,7 @@ var init_ciLoop = __esm(() => {
|
|
|
397548
397633
|
init_selfReview();
|
|
397549
397634
|
init_headlessAgent();
|
|
397550
397635
|
init_execTarget();
|
|
397636
|
+
init_failureMemory();
|
|
397551
397637
|
});
|
|
397552
397638
|
|
|
397553
397639
|
// src/commands/ci-loop/ci-loop.ts
|
|
@@ -397930,9 +398016,11 @@ function usage14() {
|
|
|
397930
398016
|
" ur safety init",
|
|
397931
398017
|
' ur safety check --command "<cmd>" [--json]',
|
|
397932
398018
|
"",
|
|
397933
|
-
"The default policy
|
|
397934
|
-
"
|
|
397935
|
-
"
|
|
398019
|
+
"The default policy maps commands to approval levels: read-only,",
|
|
398020
|
+
"edit project, run safe commands, run network commands, and",
|
|
398021
|
+
"destructive commands. It asks before destructive operations,",
|
|
398022
|
+
"recommends sandboxing for risky operations, and blocks common secret",
|
|
398023
|
+
"exfiltration paths."
|
|
397936
398024
|
].join(`
|
|
397937
398025
|
`);
|
|
397938
398026
|
}
|
|
@@ -398037,10 +398125,11 @@ function usage15() {
|
|
|
398037
398125
|
" ur sandbox eval <command> [--json]",
|
|
398038
398126
|
"",
|
|
398039
398127
|
"Approval levels (from project safety policy):",
|
|
398040
|
-
" read
|
|
398041
|
-
"
|
|
398042
|
-
"
|
|
398043
|
-
" network
|
|
398128
|
+
" read-only inspect files and command output",
|
|
398129
|
+
" edit project create, edit, move, or delete project files",
|
|
398130
|
+
" run safe commands run local builds, tests, scripts, and tools",
|
|
398131
|
+
" run network commands send data to another host, API, or remote service",
|
|
398132
|
+
" destructive commands remove data, rewrite history, or destroy resources",
|
|
398044
398133
|
"",
|
|
398045
398134
|
"Sandbox modes:",
|
|
398046
398135
|
" Docker, temporary worktree, and OS sandbox (macOS sandbox-exec / Linux bwrap)"
|
|
@@ -398125,10 +398214,11 @@ var call81 = async (args) => {
|
|
|
398125
398214
|
return { type: "text", value: usage15() };
|
|
398126
398215
|
const policy = loadProjectSafetyPolicy(cwd2);
|
|
398127
398216
|
const evaluation = evaluateShellSafetyPolicy(command5, cwd2);
|
|
398128
|
-
const level = evaluation.permissions.length ? evaluation.permissions.join("/") : "read-only";
|
|
398129
398217
|
const result = {
|
|
398130
398218
|
command: command5,
|
|
398131
|
-
level,
|
|
398219
|
+
level: evaluation.approvalLevel,
|
|
398220
|
+
approvalLevel: evaluation.approvalLevel,
|
|
398221
|
+
approvalLabel: formatApprovalLevel(evaluation.approvalLevel),
|
|
398132
398222
|
...evaluation,
|
|
398133
398223
|
policy
|
|
398134
398224
|
};
|
|
@@ -398138,7 +398228,7 @@ var call81 = async (args) => {
|
|
|
398138
398228
|
type: "text",
|
|
398139
398229
|
value: [
|
|
398140
398230
|
`Command: ${command5}`,
|
|
398141
|
-
`Approval level: ${
|
|
398231
|
+
`Approval level: ${formatApprovalLevel(evaluation.approvalLevel)}`,
|
|
398142
398232
|
formatShellSafetyEvaluation(evaluation)
|
|
398143
398233
|
].join(`
|
|
398144
398234
|
|
|
@@ -398838,6 +398928,7 @@ __export(exports_evals, {
|
|
|
398838
398928
|
saveReport: () => saveReport,
|
|
398839
398929
|
saveReliabilityReport: () => saveReliabilityReport,
|
|
398840
398930
|
runSuiteReliability: () => runSuiteReliability,
|
|
398931
|
+
runSuiteCompare: () => runSuiteCompare,
|
|
398841
398932
|
runSuite: () => runSuite,
|
|
398842
398933
|
parseSuiteText: () => parseSuiteText,
|
|
398843
398934
|
makeDryJudgeRunner: () => makeDryJudgeRunner,
|
|
@@ -398856,8 +398947,10 @@ __export(exports_evals, {
|
|
|
398856
398947
|
formatSuiteValidation: () => formatSuiteValidation,
|
|
398857
398948
|
formatReliabilityReport: () => formatReliabilityReport,
|
|
398858
398949
|
formatEvalReport: () => formatEvalReport,
|
|
398950
|
+
formatCompareReport: () => formatCompareReport,
|
|
398859
398951
|
evalsDir: () => evalsDir,
|
|
398860
398952
|
defaultEvalSuite: () => defaultEvalSuite,
|
|
398953
|
+
buildLeaderboard: () => buildLeaderboard,
|
|
398861
398954
|
buildDashboardHtml: () => buildDashboardHtml,
|
|
398862
398955
|
buildBenchmarkSuite: () => buildBenchmarkSuite,
|
|
398863
398956
|
BENCHMARK_ADAPTERS: () => BENCHMARK_ADAPTERS
|
|
@@ -399026,6 +399119,7 @@ function buildReport(name, cases) {
|
|
|
399026
399119
|
totalFilesChanged: sum(metrics.map((m) => m?.filesChanged)) || undefined,
|
|
399027
399120
|
totalCommandFailures: sum(metrics.map((m) => m?.commandFailures)) || undefined,
|
|
399028
399121
|
totalHumanEditsNeeded: sum(metrics.map((m) => m?.humanEditsNeeded)) || undefined,
|
|
399122
|
+
totalRollbacks: sum(metrics.map((m) => m?.rollbacks)) || undefined,
|
|
399029
399123
|
testPassRate: testRuns.length > 0 ? Number((testRuns.filter((m) => m?.testPassed).length / testRuns.length).toFixed(2)) : undefined,
|
|
399030
399124
|
cases
|
|
399031
399125
|
};
|
|
@@ -399102,6 +399196,105 @@ async function runSuite(suite, runner2, options2 = {}) {
|
|
|
399102
399196
|
}
|
|
399103
399197
|
return buildReport(suite.name, results);
|
|
399104
399198
|
}
|
|
399199
|
+
async function runSuiteCompare(suite, labels, options2 = {}) {
|
|
399200
|
+
const perLabelReports = {};
|
|
399201
|
+
for (const label of labels) {
|
|
399202
|
+
const report = await runSuite(suite, label.runnerFactory(), options2);
|
|
399203
|
+
perLabelReports[label.name] = report;
|
|
399204
|
+
}
|
|
399205
|
+
const caseMap = new Map;
|
|
399206
|
+
for (const label of labels) {
|
|
399207
|
+
const report = perLabelReports[label.name];
|
|
399208
|
+
for (const item of report.cases) {
|
|
399209
|
+
let row = caseMap.get(item.id);
|
|
399210
|
+
if (!row) {
|
|
399211
|
+
row = { caseId: item.id, category: item.category };
|
|
399212
|
+
caseMap.set(item.id, row);
|
|
399213
|
+
}
|
|
399214
|
+
row[label.name] = {
|
|
399215
|
+
passed: item.passed,
|
|
399216
|
+
durationMs: item.durationMs,
|
|
399217
|
+
costUSD: item.metrics?.costUSD,
|
|
399218
|
+
rollbacks: item.metrics?.rollbacks,
|
|
399219
|
+
commandFailures: item.metrics?.commandFailures,
|
|
399220
|
+
humanEditsNeeded: item.metrics?.humanEditsNeeded,
|
|
399221
|
+
testPassed: item.metrics?.testPassed
|
|
399222
|
+
};
|
|
399223
|
+
}
|
|
399224
|
+
}
|
|
399225
|
+
const rows = [...caseMap.values()].sort((a2, b) => a2.caseId.localeCompare(b.caseId));
|
|
399226
|
+
const byLabel = {};
|
|
399227
|
+
for (const label of labels) {
|
|
399228
|
+
const report = perLabelReports[label.name];
|
|
399229
|
+
const testRuns = report.cases.filter((c4) => c4.metrics?.testPassed !== undefined);
|
|
399230
|
+
byLabel[label.name] = {
|
|
399231
|
+
passed: report.passed,
|
|
399232
|
+
passRate: report.passRate,
|
|
399233
|
+
totalCostUSD: report.totalCostUSD,
|
|
399234
|
+
totalDurationMs: report.totalDurationMs,
|
|
399235
|
+
totalRollbacks: report.totalRollbacks ?? 0,
|
|
399236
|
+
totalCommandFailures: report.totalCommandFailures ?? 0,
|
|
399237
|
+
totalHumanEditsNeeded: report.totalHumanEditsNeeded ?? 0,
|
|
399238
|
+
testPassRate: testRuns.length > 0 ? Number((testRuns.filter((c4) => c4.metrics?.testPassed).length / testRuns.length).toFixed(2)) : undefined
|
|
399239
|
+
};
|
|
399240
|
+
}
|
|
399241
|
+
return {
|
|
399242
|
+
suiteName: suite.name,
|
|
399243
|
+
generatedAt: new Date().toISOString(),
|
|
399244
|
+
labels: labels.map((l) => l.name),
|
|
399245
|
+
totalCases: rows.length,
|
|
399246
|
+
byLabel,
|
|
399247
|
+
rows
|
|
399248
|
+
};
|
|
399249
|
+
}
|
|
399250
|
+
function formatCompareReport(report, json2) {
|
|
399251
|
+
if (json2)
|
|
399252
|
+
return JSON.stringify(report, null, 2);
|
|
399253
|
+
const lines = [
|
|
399254
|
+
`Eval comparison: ${report.suiteName}`,
|
|
399255
|
+
`Cases: ${report.totalCases} | Labels: ${report.labels.join(", ")}`,
|
|
399256
|
+
""
|
|
399257
|
+
];
|
|
399258
|
+
const totalsHeader = ["Label", "Pass rate", "Tests", "Cost", "Time", "Rollbacks", "Cmd failures", "Human edits"];
|
|
399259
|
+
const totalsRows = [totalsHeader, ...report.labels.map((name) => {
|
|
399260
|
+
const b = report.byLabel[name];
|
|
399261
|
+
return [
|
|
399262
|
+
name,
|
|
399263
|
+
`${Math.round(b.passRate * 100)}%`,
|
|
399264
|
+
b.testPassRate !== undefined ? `${Math.round(b.testPassRate * 100)}%` : "\u2014",
|
|
399265
|
+
typeof b.totalCostUSD === "number" ? `$${b.totalCostUSD.toFixed(6)}` : "\u2014",
|
|
399266
|
+
`${b.totalDurationMs}ms`,
|
|
399267
|
+
String(b.totalRollbacks),
|
|
399268
|
+
String(b.totalCommandFailures),
|
|
399269
|
+
String(b.totalHumanEditsNeeded)
|
|
399270
|
+
];
|
|
399271
|
+
})];
|
|
399272
|
+
lines.push(formatTable(totalsRows));
|
|
399273
|
+
lines.push("");
|
|
399274
|
+
const caseHeader = ["Case", "Category", ...report.labels.flatMap((name) => [
|
|
399275
|
+
`${name} pass`,
|
|
399276
|
+
`${name} time`,
|
|
399277
|
+
`${name} rollbacks`
|
|
399278
|
+
])];
|
|
399279
|
+
const caseRows = [caseHeader, ...report.rows.map((row) => {
|
|
399280
|
+
const cells = [row.caseId, row.category];
|
|
399281
|
+
for (const label of report.labels) {
|
|
399282
|
+
const cell = row[label];
|
|
399283
|
+
cells.push(cell?.passed ? "\u2713" : "\u2717");
|
|
399284
|
+
cells.push(cell ? `${cell.durationMs}ms` : "\u2014");
|
|
399285
|
+
cells.push(cell?.rollbacks !== undefined ? String(cell.rollbacks) : "\u2014");
|
|
399286
|
+
}
|
|
399287
|
+
return cells;
|
|
399288
|
+
})];
|
|
399289
|
+
lines.push(formatTable(caseRows));
|
|
399290
|
+
return lines.join(`
|
|
399291
|
+
`);
|
|
399292
|
+
}
|
|
399293
|
+
function formatTable(rows) {
|
|
399294
|
+
const widths = rows[0].map((_, i3) => Math.max(...rows.map((r) => r[i3]?.length ?? 0)));
|
|
399295
|
+
return rows.map((r) => r.map((cell, i3) => (cell ?? "").padEnd(widths[i3])).join(" ")).join(`
|
|
399296
|
+
`);
|
|
399297
|
+
}
|
|
399105
399298
|
async function runSuiteReliability(suite, runner2, options2) {
|
|
399106
399299
|
const trials = Math.max(1, Math.floor(options2.trials));
|
|
399107
399300
|
const cases = options2.category ? suite.cases.filter((item) => item.category === options2.category) : suite.cases;
|
|
@@ -399226,6 +399419,18 @@ function countHumanEdits(output) {
|
|
|
399226
399419
|
}
|
|
399227
399420
|
return count4;
|
|
399228
399421
|
}
|
|
399422
|
+
function countRollbacks(output) {
|
|
399423
|
+
const markers = ["rolled back", "rolledback", "rollback", "roll back", "reverted", "revert"];
|
|
399424
|
+
let count4 = 0;
|
|
399425
|
+
const lower = output.toLowerCase();
|
|
399426
|
+
for (const marker of markers) {
|
|
399427
|
+
const re = new RegExp(`\\b${marker.toLowerCase().replace(/\s+/g, "\\s*")}\\b`, "g");
|
|
399428
|
+
const matches = lower.match(re);
|
|
399429
|
+
if (matches)
|
|
399430
|
+
count4 += matches.length;
|
|
399431
|
+
}
|
|
399432
|
+
return count4;
|
|
399433
|
+
}
|
|
399229
399434
|
function firstModelName(modelUsage) {
|
|
399230
399435
|
const names = Object.keys(modelUsage);
|
|
399231
399436
|
return names.length > 0 ? names[0] : undefined;
|
|
@@ -399278,7 +399483,8 @@ function makeCliEvalRunner(options2) {
|
|
|
399278
399483
|
testStdout: testResult?.testStdout,
|
|
399279
399484
|
testStderr: testResult?.testStderr,
|
|
399280
399485
|
commandFailures: countCommandFailures2(output) + (result.code !== 0 ? 1 : 0) + (testResult && !testResult.testPassed ? 1 : 0),
|
|
399281
|
-
humanEditsNeeded: countHumanEdits(output)
|
|
399486
|
+
humanEditsNeeded: countHumanEdits(output),
|
|
399487
|
+
rollbacks: countRollbacks(output)
|
|
399282
399488
|
};
|
|
399283
399489
|
return { output, isError: result.code !== 0, metrics };
|
|
399284
399490
|
};
|
|
@@ -399338,6 +399544,7 @@ function buildDashboardHtml(reports, reliability = []) {
|
|
|
399338
399544
|
["Files changed", num(report.totalFilesChanged)],
|
|
399339
399545
|
["Command failures", num(report.totalCommandFailures)],
|
|
399340
399546
|
["Human edits", num(report.totalHumanEditsNeeded)],
|
|
399547
|
+
["Rollbacks", num(report.totalRollbacks)],
|
|
399341
399548
|
["Duration", `${num(report.totalDurationMs, "0")}ms`]
|
|
399342
399549
|
];
|
|
399343
399550
|
return `<div class="cards">${cards.map(([label, value]) => `<div class="card"><div class="val">${escapeHtml(value)}</div><div class="label">${escapeHtml(label)}</div></div>`).join("")}</div>`;
|
|
@@ -399346,13 +399553,13 @@ function buildDashboardHtml(reports, reliability = []) {
|
|
|
399346
399553
|
const m = c4.metrics;
|
|
399347
399554
|
const testBadge = m?.testPassed === true ? '<span class="badge ok">test pass</span>' : m?.testPassed === false ? '<span class="badge bad">test fail</span>' : "";
|
|
399348
399555
|
const commandsRun = [m?.testCommand].filter(Boolean).join(", ");
|
|
399349
|
-
return `<tr class="${c4.passed ? "ok" : "bad"}">` + `<td>${c4.passed ? "\u2713" : "\u2717"}</td>` + `<td>${escapeHtml(c4.id)}</td>` + `<td>${escapeHtml(c4.category)}</td>` + `<td>${escapeHtml(m?.model ?? "\u2014")}</td>` + `<td>${num(c4.durationMs)}ms</td>` + `<td>${fmtUsd(m?.costUSD)}</td>` + `<td>${num(m?.inputTokens)} / ${num(m?.outputTokens)}</td>` + `<td>${num(m?.filesChanged)} <span class="muted">+${num(m?.insertions)} \u2212${num(m?.deletions)}</span></td>` + `<td>${testBadge}</td>` + `<td><code>${escapeHtml(commandsRun || "\u2014")}</code></td>` + `<td>${num(m?.commandFailures)}</td>` + `<td>${m?.humanEditsNeeded ? `<span class="badge warn">${m.humanEditsNeeded}</span>` : "\u2014"}</td>` + `<td><code>${escapeHtml(c4.outputPreview.slice(0, 60))}</code></td>` + `</tr>`;
|
|
399556
|
+
return `<tr class="${c4.passed ? "ok" : "bad"}">` + `<td>${c4.passed ? "\u2713" : "\u2717"}</td>` + `<td>${escapeHtml(c4.id)}</td>` + `<td>${escapeHtml(c4.category)}</td>` + `<td>${escapeHtml(m?.model ?? "\u2014")}</td>` + `<td>${num(c4.durationMs)}ms</td>` + `<td>${fmtUsd(m?.costUSD)}</td>` + `<td>${num(m?.inputTokens)} / ${num(m?.outputTokens)}</td>` + `<td>${num(m?.filesChanged)} <span class="muted">+${num(m?.insertions)} \u2212${num(m?.deletions)}</span></td>` + `<td>${testBadge}</td>` + `<td><code>${escapeHtml(commandsRun || "\u2014")}</code></td>` + `<td>${num(m?.commandFailures)}</td>` + `<td>${m?.humanEditsNeeded ? `<span class="badge warn">${m.humanEditsNeeded}</span>` : "\u2014"}</td>` + `<td>${num(m?.rollbacks)}</td>` + `<td><code>${escapeHtml(c4.outputPreview.slice(0, 60))}</code></td>` + `</tr>`;
|
|
399350
399557
|
};
|
|
399351
399558
|
const card = (report) => {
|
|
399352
399559
|
const pct = Math.round(report.passRate * 100);
|
|
399353
399560
|
const cats = Object.entries(report.byCategory).sort((a2, b) => a2[0].localeCompare(b[0])).map(([cat2, b]) => `<tr><td>${escapeHtml(cat2)}</td><td>${b.passed}/${b.total}</td></tr>`).join("");
|
|
399354
399561
|
const rows = report.cases.map(timelineRow).join("");
|
|
399355
|
-
return `<section><h2>${escapeHtml(report.name)} \u2014 ${report.passed}/${report.total} (${pct}%)</h2>` + `<p class="muted">generated ${escapeHtml(report.generatedAt)}</p>` + `${summaryCards(report)}` + `<table class="cats"><thead><tr><th>category</th><th>pass</th></tr></thead><tbody>${cats}</tbody></table>` + `<h3>Task timeline</h3>` + `<table class="cases timeline"><thead><tr><th></th><th>case</th><th>category</th><th>model used</th><th>time</th><th>cost</th><th>tokens</th><th>diffs produced</th><th>tests passed/failed</th><th>commands run</th><th>command failures</th><th>human edits</th><th>output</th></tr></thead>` + `<tbody>${rows}</tbody></table></section>`;
|
|
399562
|
+
return `<section><h2>${escapeHtml(report.name)} \u2014 ${report.passed}/${report.total} (${pct}%)</h2>` + `<p class="muted">generated ${escapeHtml(report.generatedAt)}</p>` + `${summaryCards(report)}` + `<table class="cats"><thead><tr><th>category</th><th>pass</th></tr></thead><tbody>${cats}</tbody></table>` + `<h3>Task timeline</h3>` + `<table class="cases timeline"><thead><tr><th></th><th>case</th><th>category</th><th>model used</th><th>time</th><th>cost</th><th>tokens</th><th>diffs produced</th><th>tests passed/failed</th><th>commands run</th><th>command failures</th><th>human edits</th><th>rollbacks</th><th>output</th></tr></thead>` + `<tbody>${rows}</tbody></table></section>`;
|
|
399356
399563
|
};
|
|
399357
399564
|
const relCard = (rel) => {
|
|
399358
399565
|
const rows = rel.cases.map((c4) => `<tr class="${c4.solvedAll ? "ok" : "bad"}"><td>${c4.solvedAll ? "\u2713" : "\u2717"}</td>` + `<td>${escapeHtml(c4.id)}</td><td>${c4.passes}/${c4.trials}</td><td>${Math.round(c4.passRate * 100)}%</td></tr>`).join("");
|
|
@@ -399428,6 +399635,40 @@ function writeDashboard(cwd2) {
|
|
|
399428
399635
|
writeFileSync37(path22, html3);
|
|
399429
399636
|
return path22;
|
|
399430
399637
|
}
|
|
399638
|
+
function buildLeaderboard(cwd2, reports, options2 = {}) {
|
|
399639
|
+
const format4 = options2.format ?? "html";
|
|
399640
|
+
const title = options2.title ?? "UR Public Leaderboard";
|
|
399641
|
+
if (format4 === "json") {
|
|
399642
|
+
const path23 = join162(resultsDir(cwd2), "leaderboard.json");
|
|
399643
|
+
writeFileSync37(path23, JSON.stringify({ title, generatedAt: new Date().toISOString(), reports }, null, 2) + `
|
|
399644
|
+
`);
|
|
399645
|
+
return path23;
|
|
399646
|
+
}
|
|
399647
|
+
if (format4 === "md") {
|
|
399648
|
+
const path23 = join162(resultsDir(cwd2), "leaderboard.md");
|
|
399649
|
+
writeFileSync37(path23, formatLeaderboardMarkdown(title, reports));
|
|
399650
|
+
return path23;
|
|
399651
|
+
}
|
|
399652
|
+
const path22 = join162(evalsDir(cwd2), "leaderboard.html");
|
|
399653
|
+
const html3 = buildDashboardHtml(reports, []);
|
|
399654
|
+
writeFileSync37(path22, html3.replace("<title>UR Eval Dashboard</title>", `<title>${escapeHtml(title)}</title>`).replace("<h1>UR Eval Dashboard</h1>", `<h1>${escapeHtml(title)}</h1>`));
|
|
399655
|
+
return path22;
|
|
399656
|
+
}
|
|
399657
|
+
function formatLeaderboardMarkdown(title, reports) {
|
|
399658
|
+
const lines = [
|
|
399659
|
+
`# ${title}`,
|
|
399660
|
+
`generated ${new Date().toISOString()}`,
|
|
399661
|
+
"",
|
|
399662
|
+
"| Suite | Pass rate | Tests | Cost | Tokens | Files | Failures | Rollbacks | Human edits |",
|
|
399663
|
+
"|---|---|---|---|---|---|---|---|---|"
|
|
399664
|
+
];
|
|
399665
|
+
for (const r of reports) {
|
|
399666
|
+
lines.push(`| ${r.name} | ${Math.round(r.passRate * 100)}% | ${r.testPassRate !== undefined ? `${Math.round(r.testPassRate * 100)}%` : "\u2014"} | ${r.totalCostUSD !== undefined ? `$${r.totalCostUSD.toFixed(6)}` : "\u2014"} | ${r.totalInputTokens ?? "\u2014"} / ${r.totalOutputTokens ?? "\u2014"} | ${r.totalFilesChanged ?? "\u2014"} | ${r.totalCommandFailures ?? "\u2014"} | ${r.totalRollbacks ?? "\u2014"} | ${r.totalHumanEditsNeeded ?? "\u2014"} |`);
|
|
399667
|
+
}
|
|
399668
|
+
return lines.join(`
|
|
399669
|
+
`) + `
|
|
399670
|
+
`;
|
|
399671
|
+
}
|
|
399431
399672
|
function runsDir(cwd2, suiteName) {
|
|
399432
399673
|
return join162(evalsDir(cwd2), ".runs", suiteSlug(suiteName));
|
|
399433
399674
|
}
|
|
@@ -399782,6 +400023,7 @@ function formatEvalReport(report, json2) {
|
|
|
399782
400023
|
report.totalFilesChanged !== undefined ? `Files changed: ${report.totalFilesChanged}` : null,
|
|
399783
400024
|
report.totalCommandFailures !== undefined ? `Command failures: ${report.totalCommandFailures}` : null,
|
|
399784
400025
|
report.totalHumanEditsNeeded !== undefined ? `Human edits needed: ${report.totalHumanEditsNeeded}` : null,
|
|
400026
|
+
report.totalRollbacks !== undefined ? `Rollbacks: ${report.totalRollbacks}` : null,
|
|
399785
400027
|
report.totalDurationMs > 0 ? `Duration: ${report.totalDurationMs}ms` : null,
|
|
399786
400028
|
""
|
|
399787
400029
|
].filter((line) => line !== null);
|
|
@@ -399860,13 +400102,248 @@ var init_evals = __esm(() => {
|
|
|
399860
400102
|
VERDICT_RE3 = /\bVERDICT:\s*(PASS|FAIL|PARTIAL)\b/i;
|
|
399861
400103
|
});
|
|
399862
400104
|
|
|
400105
|
+
// src/services/agents/benchmarkSuites.ts
|
|
400106
|
+
import { join as join163 } from "path";
|
|
400107
|
+
function listBuiltinSuiteIds() {
|
|
400108
|
+
return [...BUILTIN_SUITE_IDS];
|
|
400109
|
+
}
|
|
400110
|
+
function getBuiltinSuite(id) {
|
|
400111
|
+
return BUILTIN_SUITES[id];
|
|
400112
|
+
}
|
|
400113
|
+
function installBuiltinSuite(cwd2, id, options2 = {}) {
|
|
400114
|
+
const suite = getBuiltinSuite(id);
|
|
400115
|
+
if (!suite) {
|
|
400116
|
+
return { path: join163(evalsDir(cwd2), `${id}.json`), created: false };
|
|
400117
|
+
}
|
|
400118
|
+
const saved = saveSuite(cwd2, suite, { force: options2.force });
|
|
400119
|
+
return { path: saved.path, created: saved.created, suite };
|
|
400120
|
+
}
|
|
400121
|
+
var BUILTIN_SUITE_IDS, BUILTIN_SUITES;
|
|
400122
|
+
var init_benchmarkSuites = __esm(() => {
|
|
400123
|
+
init_evals();
|
|
400124
|
+
BUILTIN_SUITE_IDS = [
|
|
400125
|
+
"bug-fix",
|
|
400126
|
+
"refactor",
|
|
400127
|
+
"test-gen",
|
|
400128
|
+
"docker-repair",
|
|
400129
|
+
"ts-migrate",
|
|
400130
|
+
"py-package-repair"
|
|
400131
|
+
];
|
|
400132
|
+
BUILTIN_SUITES = {
|
|
400133
|
+
"bug-fix": {
|
|
400134
|
+
version: 1,
|
|
400135
|
+
name: "builtin-bug-fix",
|
|
400136
|
+
description: "Small bug-fixing benchmark. Each case asks UR to fix a known defect in a fresh worktree and verify with a test command.",
|
|
400137
|
+
cases: [
|
|
400138
|
+
{
|
|
400139
|
+
id: "off-by-one",
|
|
400140
|
+
category: "bug-fix",
|
|
400141
|
+
prompt: "You are in a fresh TypeScript repo. Create src/findIndex.ts containing a function that returns the index of a target in an array. It currently returns -1 for the last element because the loop stops too early. Fix the off-by-one bug, add a test file src/findIndex.test.ts using your preferred runner, and run the tests. Finish with VERDICT: PASS if tests pass, otherwise VERDICT: FAIL.",
|
|
400142
|
+
expect: {
|
|
400143
|
+
contains: ["VERDICT:"],
|
|
400144
|
+
testCommand: "cd src && (ls findIndex.ts findIndex.test.ts && echo present)"
|
|
400145
|
+
}
|
|
400146
|
+
},
|
|
400147
|
+
{
|
|
400148
|
+
id: "null-guard",
|
|
400149
|
+
category: "bug-fix",
|
|
400150
|
+
prompt: "You are in a fresh JavaScript repo. Create src/greet.js with a greet(name) function. It currently crashes when name is null/undefined because it calls name.toUpperCase(). Add a null guard so it returns 'Hello, stranger' for missing input. Add a test file and run it. Finish with VERDICT: PASS if tests pass.",
|
|
400151
|
+
expect: {
|
|
400152
|
+
contains: ["VERDICT:"],
|
|
400153
|
+
testCommand: "cd src && (ls greet.js greet.test.js && echo present)"
|
|
400154
|
+
}
|
|
400155
|
+
},
|
|
400156
|
+
{
|
|
400157
|
+
id: "missing-await",
|
|
400158
|
+
category: "bug-fix",
|
|
400159
|
+
prompt: "You are in a fresh TypeScript repo. Create src/fetcher.ts with an async fetchData() function that forgets to await a Promise, returning the Promise object instead of the resolved value. Fix it, add a test using a mocked Promise, and run the tests. Finish with VERDICT: PASS if tests pass.",
|
|
400160
|
+
expect: {
|
|
400161
|
+
contains: ["VERDICT:"],
|
|
400162
|
+
testCommand: "cd src && (ls fetcher.ts fetcher.test.ts && echo present)"
|
|
400163
|
+
}
|
|
400164
|
+
}
|
|
400165
|
+
]
|
|
400166
|
+
},
|
|
400167
|
+
refactor: {
|
|
400168
|
+
version: 1,
|
|
400169
|
+
name: "builtin-refactor",
|
|
400170
|
+
description: "Small refactoring benchmark. Each case asks UR to clean up code in a fresh worktree and keep tests green.",
|
|
400171
|
+
cases: [
|
|
400172
|
+
{
|
|
400173
|
+
id: "extract-function",
|
|
400174
|
+
category: "refactor",
|
|
400175
|
+
prompt: "You are in a fresh TypeScript repo. Create src/checkout.ts with a long calculateTotal(price, quantity, tax, discount) function that mixes subtotal, tax, and discount math inline. Refactor it by extracting helper functions (subtotal, taxAmount, discountAmount) while preserving behavior. Add tests and run them. Finish with VERDICT: PASS if tests pass.",
|
|
400176
|
+
expect: {
|
|
400177
|
+
contains: ["VERDICT:"],
|
|
400178
|
+
testCommand: "cd src && (ls checkout.ts checkout.test.ts && echo present)"
|
|
400179
|
+
}
|
|
400180
|
+
},
|
|
400181
|
+
{
|
|
400182
|
+
id: "rename-fields",
|
|
400183
|
+
category: "refactor",
|
|
400184
|
+
prompt: "You are in a fresh TypeScript repo. Create src/user.ts with an interface using abbreviated field names (fn, ln, em). Refactor to readable names (firstName, lastName, email) and update a small usage file. Add tests and run them. Finish with VERDICT: PASS if tests pass.",
|
|
400185
|
+
expect: {
|
|
400186
|
+
contains: ["VERDICT:"],
|
|
400187
|
+
testCommand: "cd src && (ls user.ts user.test.ts && echo present)"
|
|
400188
|
+
}
|
|
400189
|
+
},
|
|
400190
|
+
{
|
|
400191
|
+
id: "remove-duplication",
|
|
400192
|
+
category: "refactor",
|
|
400193
|
+
prompt: "You are in a fresh JavaScript repo. Create src/validators.js with three form validation functions that duplicate the same empty-check logic. Refactor to share a single isEmpty helper. Add tests and run them. Finish with VERDICT: PASS if tests pass.",
|
|
400194
|
+
expect: {
|
|
400195
|
+
contains: ["VERDICT:"],
|
|
400196
|
+
testCommand: "cd src && (ls validators.js validators.test.js && echo present)"
|
|
400197
|
+
}
|
|
400198
|
+
}
|
|
400199
|
+
]
|
|
400200
|
+
},
|
|
400201
|
+
"test-gen": {
|
|
400202
|
+
version: 1,
|
|
400203
|
+
name: "builtin-test-gen",
|
|
400204
|
+
description: "Small test-generation benchmark. Each case asks UR to read existing code and add tests.",
|
|
400205
|
+
cases: [
|
|
400206
|
+
{
|
|
400207
|
+
id: "calc-tests",
|
|
400208
|
+
category: "test-gen",
|
|
400209
|
+
prompt: "You are in a fresh TypeScript repo. Create src/calc.ts with add(a,b), subtract(a,b), multiply(a,b), and divide(a,b). Ask UR to read the file and add tests in src/calc.test.ts that cover normal cases, division by zero, and at least one negative-number case. Run the tests. Finish with VERDICT: PASS if tests pass.",
|
|
400210
|
+
expect: {
|
|
400211
|
+
contains: ["VERDICT:"],
|
|
400212
|
+
testCommand: "cd src && (ls calc.ts calc.test.ts && echo present)"
|
|
400213
|
+
}
|
|
400214
|
+
},
|
|
400215
|
+
{
|
|
400216
|
+
id: "string-utils-tests",
|
|
400217
|
+
category: "test-gen",
|
|
400218
|
+
prompt: "You are in a fresh JavaScript repo. Create src/strings.js with slugify(text) and truncate(text, max). Ask UR to add tests in src/strings.test.js covering empty strings, long strings, and non-alphanumeric input. Run the tests. Finish with VERDICT: PASS if tests pass.",
|
|
400219
|
+
expect: {
|
|
400220
|
+
contains: ["VERDICT:"],
|
|
400221
|
+
testCommand: "cd src && (ls strings.js strings.test.js && echo present)"
|
|
400222
|
+
}
|
|
400223
|
+
},
|
|
400224
|
+
{
|
|
400225
|
+
id: "async-tests",
|
|
400226
|
+
category: "test-gen",
|
|
400227
|
+
prompt: "You are in a fresh TypeScript repo. Create src/cache.ts with an async getOrFetch(key, fetcher) cache. Ask UR to add tests in src/cache.test.ts using mocked fetchers and covering cache hits, misses, and errors. Run the tests. Finish with VERDICT: PASS if tests pass.",
|
|
400228
|
+
expect: {
|
|
400229
|
+
contains: ["VERDICT:"],
|
|
400230
|
+
testCommand: "cd src && (ls cache.ts cache.test.ts && echo present)"
|
|
400231
|
+
}
|
|
400232
|
+
}
|
|
400233
|
+
]
|
|
400234
|
+
},
|
|
400235
|
+
"docker-repair": {
|
|
400236
|
+
version: 1,
|
|
400237
|
+
name: "builtin-docker-repair",
|
|
400238
|
+
description: "Small Docker repair benchmark. Each case asks UR to fix a broken Dockerfile in a fresh worktree.",
|
|
400239
|
+
cases: [
|
|
400240
|
+
{
|
|
400241
|
+
id: "base-image-typo",
|
|
400242
|
+
category: "docker-repair",
|
|
400243
|
+
prompt: "You are in a fresh repo with a broken Dockerfile that uses FROM node:22-sllm (typo). Fix the base image to node:22-slim, add a small src/index.js that prints 'ok', and make the image build. Run docker build -t test-repair . if Docker is available, otherwise check syntax with 'docker --version'. Finish with VERDICT: PASS if the Dockerfile is valid and index.js exists.",
|
|
400244
|
+
expect: {
|
|
400245
|
+
contains: ["VERDICT:"],
|
|
400246
|
+
testCommand: "cat Dockerfile | grep -q 'FROM node:22-slim' && ls src/index.js"
|
|
400247
|
+
}
|
|
400248
|
+
},
|
|
400249
|
+
{
|
|
400250
|
+
id: "missing-cmd",
|
|
400251
|
+
category: "docker-repair",
|
|
400252
|
+
prompt: "You are in a fresh repo with a Dockerfile that copies files but has no CMD or ENTRYPOINT, so the container exits immediately. Add a CMD that runs node src/server.js, create src/server.js that listens on port 3000 and responds with 'hello', and verify the files exist. Finish with VERDICT: PASS.",
|
|
400253
|
+
expect: {
|
|
400254
|
+
contains: ["VERDICT:"],
|
|
400255
|
+
testCommand: 'cat Dockerfile | grep -qE "CMD|ENTRYPOINT" && ls src/server.js'
|
|
400256
|
+
}
|
|
400257
|
+
},
|
|
400258
|
+
{
|
|
400259
|
+
id: "cache-layer-order",
|
|
400260
|
+
category: "docker-repair",
|
|
400261
|
+
prompt: "You are in a fresh repo with a Dockerfile that copies package.json after copying the entire source tree, ruining Docker layer caching. Reorder the instructions so dependencies are installed before source code is copied. Create package.json with a single dependency (e.g., leftpad) and src/index.js. Finish with VERDICT: PASS if the Dockerfile copies package.json before src/.",
|
|
400262
|
+
expect: {
|
|
400263
|
+
contains: ["VERDICT:"],
|
|
400264
|
+
testCommand: "cat Dockerfile | awk '/COPY package\\.json/{a=NR}/COPY src\\//{b=NR} END{exit !(a && b && a < b)}' && ls package.json src/index.js"
|
|
400265
|
+
}
|
|
400266
|
+
}
|
|
400267
|
+
]
|
|
400268
|
+
},
|
|
400269
|
+
"ts-migrate": {
|
|
400270
|
+
version: 1,
|
|
400271
|
+
name: "builtin-ts-migrate",
|
|
400272
|
+
description: "Small TypeScript migration benchmark. Each case asks UR to convert JavaScript to typed TypeScript.",
|
|
400273
|
+
cases: [
|
|
400274
|
+
{
|
|
400275
|
+
id: "add-types",
|
|
400276
|
+
category: "ts-migrate",
|
|
400277
|
+
prompt: "You are in a fresh repo. Create src/person.js with a function createPerson(name, age) that returns an object and a usage file. Ask UR to rename it to src/person.ts, add TypeScript interface Person { name: string; age: number }, annotate the function, and run npx tsc --noEmit (or a local tsc if available). Finish with VERDICT: PASS if no type errors are reported.",
|
|
400278
|
+
expect: {
|
|
400279
|
+
contains: ["VERDICT:"],
|
|
400280
|
+
testCommand: "ls src/person.ts"
|
|
400281
|
+
}
|
|
400282
|
+
},
|
|
400283
|
+
{
|
|
400284
|
+
id: "null-types",
|
|
400285
|
+
category: "ts-migrate",
|
|
400286
|
+
prompt: "You are in a fresh repo. Create src/config.js with getConfig(key) that may return undefined. Ask UR to migrate it to src/config.ts, add strict null checks via type annotations, and create a usage file that handles undefined. Run type check. Finish with VERDICT: PASS if types are sound.",
|
|
400287
|
+
expect: {
|
|
400288
|
+
contains: ["VERDICT:"],
|
|
400289
|
+
testCommand: "ls src/config.ts"
|
|
400290
|
+
}
|
|
400291
|
+
},
|
|
400292
|
+
{
|
|
400293
|
+
id: "module-types",
|
|
400294
|
+
category: "ts-migrate",
|
|
400295
|
+
prompt: "You are in a fresh repo. Create src/math.js with CommonJS exports (module.exports = { add, subtract }). Ask UR to migrate to src/math.ts using ESM exports, add TypeScript types, create src/math.test.ts, and run tests. Finish with VERDICT: PASS if tests pass.",
|
|
400296
|
+
expect: {
|
|
400297
|
+
contains: ["VERDICT:"],
|
|
400298
|
+
testCommand: "ls src/math.ts"
|
|
400299
|
+
}
|
|
400300
|
+
}
|
|
400301
|
+
]
|
|
400302
|
+
},
|
|
400303
|
+
"py-package-repair": {
|
|
400304
|
+
version: 1,
|
|
400305
|
+
name: "builtin-py-package-repair",
|
|
400306
|
+
description: "Small Python package repair benchmark. Each case asks UR to fix packaging metadata in a fresh worktree.",
|
|
400307
|
+
cases: [
|
|
400308
|
+
{
|
|
400309
|
+
id: "missing-dep",
|
|
400310
|
+
category: "py-package-repair",
|
|
400311
|
+
prompt: "You are in a fresh Python repo with a setup.py that installs a package but forgets install_requires=['requests']. Create src/mypkg/__init__.py that imports requests. Ask UR to fix setup.py, install the package in editable mode (or write the fix), and verify the import would work. Finish with VERDICT: PASS if setup.py references requests.",
|
|
400312
|
+
expect: {
|
|
400313
|
+
contains: ["VERDICT:"],
|
|
400314
|
+
testCommand: "grep -q 'requests' setup.py"
|
|
400315
|
+
}
|
|
400316
|
+
},
|
|
400317
|
+
{
|
|
400318
|
+
id: "missing-pyproject",
|
|
400319
|
+
category: "py-package-repair",
|
|
400320
|
+
prompt: "You are in a fresh Python repo with only setup.py and no pyproject.toml. Ask UR to add a minimal pyproject.toml with build-system requires, project name, and version. Finish with VERDICT: PASS if pyproject.toml exists with [project] section.",
|
|
400321
|
+
expect: {
|
|
400322
|
+
contains: ["VERDICT:"],
|
|
400323
|
+
testCommand: "grep -q '\\[project\\]' pyproject.toml"
|
|
400324
|
+
}
|
|
400325
|
+
},
|
|
400326
|
+
{
|
|
400327
|
+
id: "entrypoint",
|
|
400328
|
+
category: "py-package-repair",
|
|
400329
|
+
prompt: "You are in a fresh Python repo with a CLI script src/mypkg/cli.py but no console_scripts entry point. Ask UR to fix setup.py or pyproject.toml so it exposes a 'mypkg' command, and create a minimal package structure. Finish with VERDICT: PASS if an entry point references mypkg.cli:main or similar.",
|
|
400330
|
+
expect: {
|
|
400331
|
+
contains: ["VERDICT:"],
|
|
400332
|
+
testCommand: "grep -qE 'console_scripts|mypkg.cli' setup.py pyproject.toml 2>/dev/null"
|
|
400333
|
+
}
|
|
400334
|
+
}
|
|
400335
|
+
]
|
|
400336
|
+
}
|
|
400337
|
+
};
|
|
400338
|
+
});
|
|
400339
|
+
|
|
399863
400340
|
// src/commands/eval/eval.ts
|
|
399864
400341
|
var exports_eval = {};
|
|
399865
400342
|
__export(exports_eval, {
|
|
399866
400343
|
call: () => call86
|
|
399867
400344
|
});
|
|
399868
400345
|
import { mkdirSync as mkdirSync40, writeFileSync as writeFileSync38 } from "fs";
|
|
399869
|
-
import { join as
|
|
400346
|
+
import { join as join164 } from "path";
|
|
399870
400347
|
function optionValue6(tokens, flag) {
|
|
399871
400348
|
const index2 = tokens.indexOf(flag);
|
|
399872
400349
|
return index2 >= 0 ? tokens[index2 + 1] : undefined;
|
|
@@ -399932,6 +400409,45 @@ ${names.map((n2) => ` - ${n2}`).join(`
|
|
|
399932
400409
|
Open it in a browser (local-first, no network).`
|
|
399933
400410
|
};
|
|
399934
400411
|
}
|
|
400412
|
+
if (command5 === "builtin" || command5 === "benchmarks") {
|
|
400413
|
+
if (!name || name === "list") {
|
|
400414
|
+
const ids = listBuiltinSuiteIds();
|
|
400415
|
+
if (json2)
|
|
400416
|
+
return { type: "text", value: JSON.stringify({ suites: ids }, null, 2) };
|
|
400417
|
+
return {
|
|
400418
|
+
type: "text",
|
|
400419
|
+
value: `Built-in benchmark suites:
|
|
400420
|
+
${ids.map((id) => ` - ${id}`).join(`
|
|
400421
|
+
`)}`
|
|
400422
|
+
};
|
|
400423
|
+
}
|
|
400424
|
+
const suite2 = getBuiltinSuite(name);
|
|
400425
|
+
if (!suite2) {
|
|
400426
|
+
return {
|
|
400427
|
+
type: "text",
|
|
400428
|
+
value: `Unknown builtin suite: ${name}
|
|
400429
|
+
Available: ${listBuiltinSuiteIds().join(", ")}`
|
|
400430
|
+
};
|
|
400431
|
+
}
|
|
400432
|
+
const { path: path22, created } = installBuiltinSuite(cwd2, name, { force });
|
|
400433
|
+
return {
|
|
400434
|
+
type: "text",
|
|
400435
|
+
value: `${created ? "Installed" : "Already exists"} builtin suite ${name} at ${path22}
|
|
400436
|
+
Run: ur eval run ${suite2.name}`
|
|
400437
|
+
};
|
|
400438
|
+
}
|
|
400439
|
+
if (command5 === "leaderboard") {
|
|
400440
|
+
const format4 = optionValue6(tokens, "--format") ?? "html";
|
|
400441
|
+
const reports = name ? [loadReport(cwd2, name)].filter((r) => r !== null) : loadAllReports(cwd2);
|
|
400442
|
+
if (reports.length === 0) {
|
|
400443
|
+
return {
|
|
400444
|
+
type: "text",
|
|
400445
|
+
value: name ? `No saved report for ${name}. Run it first: ur eval run ${name}` : "No saved reports yet. Run an eval first."
|
|
400446
|
+
};
|
|
400447
|
+
}
|
|
400448
|
+
const outPath = buildLeaderboard(cwd2, reports, { format: format4 });
|
|
400449
|
+
return { type: "text", value: `Wrote leaderboard to ${outPath}` };
|
|
400450
|
+
}
|
|
399935
400451
|
if (command5 === "report") {
|
|
399936
400452
|
const report = loadReport(cwd2, name);
|
|
399937
400453
|
if (!report) {
|
|
@@ -399943,9 +400459,9 @@ Open it in a browser (local-first, no network).`
|
|
|
399943
400459
|
if (tokens.includes("--dashboard")) {
|
|
399944
400460
|
const { buildDashboardHtml: buildDashboardHtml2 } = await Promise.resolve().then(() => (init_evals(), exports_evals));
|
|
399945
400461
|
const html3 = buildDashboardHtml2([report], []);
|
|
399946
|
-
const dir =
|
|
400462
|
+
const dir = join164(evalsDir(cwd2), ".dashboards");
|
|
399947
400463
|
mkdirSync40(dir, { recursive: true });
|
|
399948
|
-
const path22 =
|
|
400464
|
+
const path22 = join164(dir, `${suiteSlug(report.name)}.html`);
|
|
399949
400465
|
writeFileSync38(path22, html3);
|
|
399950
400466
|
return { type: "text", value: `Wrote single-suite dashboard to ${path22}` };
|
|
399951
400467
|
}
|
|
@@ -400058,10 +400574,45 @@ Run it locally: ur eval run ${result.suite.name}`
|
|
|
400058
400574
|
` : "";
|
|
400059
400575
|
return { type: "text", value: `${header}${formatEvalReport(report, false)}` };
|
|
400060
400576
|
}
|
|
400577
|
+
if (command5 === "compare") {
|
|
400578
|
+
const suiteName = positional[1];
|
|
400579
|
+
const labelNames = positional.slice(2);
|
|
400580
|
+
if (!suite || labelNames.length < 2) {
|
|
400581
|
+
return {
|
|
400582
|
+
type: "text",
|
|
400583
|
+
value: `Usage: ur eval compare <suite> <label1> <label2> [...]
|
|
400584
|
+
Labels are model/runner names (e.g., pool codex claude). Each label sets UR_MODEL for its run.`
|
|
400585
|
+
};
|
|
400586
|
+
}
|
|
400587
|
+
const dryRun = tokens.includes("--dry-run");
|
|
400588
|
+
const skipPermissions = tokens.includes("--skip-permissions") || tokens.includes("--dangerously-skip-permissions");
|
|
400589
|
+
const maxTurnsValue = Number(optionValue6(tokens, "--max-turns") ?? "20");
|
|
400590
|
+
const maxTurns = Number.isFinite(maxTurnsValue) && maxTurnsValue > 0 ? maxTurnsValue : 20;
|
|
400591
|
+
const baseJudge = dryRun ? makeDryJudgeRunner() : makeCliJudgeRunner({ cwd: cwd2, maxTurns, skipPermissions });
|
|
400592
|
+
const labels = labelNames.map((name2) => ({
|
|
400593
|
+
name: name2,
|
|
400594
|
+
model: name2,
|
|
400595
|
+
runnerFactory: () => {
|
|
400596
|
+
const base2 = dryRun ? makeDryEvalRunner() : makeCliEvalRunner({ cwd: cwd2, maxTurns, skipPermissions });
|
|
400597
|
+
return async (evalCase) => {
|
|
400598
|
+
const oldModel = process.env.UR_MODEL;
|
|
400599
|
+
process.env.UR_MODEL = name2;
|
|
400600
|
+
try {
|
|
400601
|
+
return await base2(evalCase);
|
|
400602
|
+
} finally {
|
|
400603
|
+
process.env.UR_MODEL = oldModel;
|
|
400604
|
+
}
|
|
400605
|
+
};
|
|
400606
|
+
}
|
|
400607
|
+
}));
|
|
400608
|
+
const report = await runSuiteCompare(suite, labels, { judge: baseJudge });
|
|
400609
|
+
return { type: "text", value: formatCompareReport(report, json2) };
|
|
400610
|
+
}
|
|
400061
400611
|
return { type: "text", value: `Unknown eval command: ${command5}` };
|
|
400062
400612
|
};
|
|
400063
400613
|
var init_eval = __esm(() => {
|
|
400064
400614
|
init_evals();
|
|
400615
|
+
init_benchmarkSuites();
|
|
400065
400616
|
init_argumentSubstitution();
|
|
400066
400617
|
init_cwd2();
|
|
400067
400618
|
});
|
|
@@ -400184,20 +400735,22 @@ function defaultRisks(cwd2, changedFiles2) {
|
|
|
400184
400735
|
return risks;
|
|
400185
400736
|
}
|
|
400186
400737
|
async function buildPrSummary(options2) {
|
|
400187
|
-
const { cwd: cwd2, title, description = "", base: base2, rollbackCommand, extraRisks = [], extraTodos = [] } = options2;
|
|
400738
|
+
const { cwd: cwd2, title, description = "", base: base2, rollbackCommand, testsRun = [], extraRisks = [], extraTodos = [] } = options2;
|
|
400188
400739
|
const files = await changedFiles(cwd2, base2);
|
|
400189
400740
|
const stat41 = await diffStat(cwd2, base2);
|
|
400190
|
-
const
|
|
400741
|
+
const detected = detectTests(cwd2);
|
|
400191
400742
|
const risks = [...defaultRisks(cwd2, files), ...extraRisks];
|
|
400192
400743
|
const todos = [];
|
|
400193
|
-
if (
|
|
400194
|
-
todos.push("No test command detected \u2014 verify manually.");
|
|
400744
|
+
if (testsRun.length === 0) {
|
|
400745
|
+
todos.push(detected.length ? `Run and record verification: ${detected.join(", ")}.` : "No test command detected \u2014 verify manually.");
|
|
400746
|
+
}
|
|
400195
400747
|
todos.push(...extraTodos);
|
|
400196
400748
|
return {
|
|
400197
400749
|
title,
|
|
400198
400750
|
description,
|
|
400199
400751
|
changedFiles: files,
|
|
400200
|
-
testsRun
|
|
400752
|
+
testsRun,
|
|
400753
|
+
detectedTestCommands: detected,
|
|
400201
400754
|
risks,
|
|
400202
400755
|
rollbackCommand: rollbackCommand ?? (findGitRoot(cwd2) ? "git reset --hard HEAD" : "manual file restore"),
|
|
400203
400756
|
remainingTodos: todos,
|
|
@@ -400210,13 +400763,17 @@ function formatPrSummary(summary, json2 = false) {
|
|
|
400210
400763
|
const lines = [
|
|
400211
400764
|
`# ${summary.title}`,
|
|
400212
400765
|
"",
|
|
400213
|
-
|
|
400766
|
+
"## Summary",
|
|
400767
|
+
summary.description || "No summary provided.",
|
|
400214
400768
|
"",
|
|
400215
400769
|
"## Changed files",
|
|
400216
400770
|
...summary.changedFiles.length ? summary.changedFiles.map((f) => `- ${f}`) : ["- no tracked changes detected"],
|
|
400217
400771
|
"",
|
|
400218
|
-
"## Tests
|
|
400219
|
-
...summary.testsRun.length ? summary.testsRun.map((t) => `- ${t}`) : ["-
|
|
400772
|
+
"## Tests run",
|
|
400773
|
+
...summary.testsRun.length ? summary.testsRun.map((t) => `- ${t}`) : ["- none recorded by UR for this PR handoff"],
|
|
400774
|
+
"",
|
|
400775
|
+
"## Detected verification commands",
|
|
400776
|
+
...summary.detectedTestCommands.length ? summary.detectedTestCommands.map((t) => `- ${t}`) : ["- no test commands detected"],
|
|
400220
400777
|
"",
|
|
400221
400778
|
"## Risks",
|
|
400222
400779
|
...summary.risks.length ? summary.risks.map((r) => `- ${r}`) : ["- no obvious risks flagged"],
|
|
@@ -400249,7 +400806,7 @@ function usage19() {
|
|
|
400249
400806
|
return [
|
|
400250
400807
|
"Usage:",
|
|
400251
400808
|
" ur task start <name> [--worktree] [--base <branch>] [--model <model>] [--max-turns <n>] [--json]",
|
|
400252
|
-
" ur task run <id> [--json]",
|
|
400809
|
+
" ur task run <id> [--dry-run] [--json]",
|
|
400253
400810
|
" ur task pr <id> [--create] [--draft] [--base <branch>] [--title <text>] [--body <text>] [--dry-run] [--json]",
|
|
400254
400811
|
" ur task list [--json]",
|
|
400255
400812
|
" ur task status <id> [--json]"
|
|
@@ -400347,11 +400904,18 @@ var call88 = async (args) => {
|
|
|
400347
400904
|
const id = pos[1];
|
|
400348
400905
|
if (!id)
|
|
400349
400906
|
return { type: "text", value: usage19() };
|
|
400350
|
-
const
|
|
400907
|
+
const existing2 = getBackgroundTask(cwd2, id) ?? listBackgroundTasks(cwd2).find((t) => t.id.startsWith(id));
|
|
400908
|
+
if (!existing2)
|
|
400909
|
+
return { type: "text", value: `Task ${id} not found.` };
|
|
400910
|
+
const result = startExistingBackgroundTask(cwd2, existing2.id, {
|
|
400911
|
+
dryRun: tokens.includes("--dry-run")
|
|
400912
|
+
});
|
|
400913
|
+
if (!result)
|
|
400914
|
+
return { type: "text", value: `Task ${id} not found.` };
|
|
400351
400915
|
const task = result.task;
|
|
400352
400916
|
return {
|
|
400353
400917
|
type: "text",
|
|
400354
|
-
value: json2 ? JSON.stringify({ task, command: result.command }, null, 2) :
|
|
400918
|
+
value: json2 ? JSON.stringify({ task, command: result.command }, null, 2) : `${result.dryRun ? "Would start" : "Started"} task ${task.id}
|
|
400355
400919
|
Command: ${result.command.join(" ")}
|
|
400356
400920
|
Log: ${task.logFile}`
|
|
400357
400921
|
};
|
|
@@ -400449,7 +401013,7 @@ var init_task2 = __esm(() => {
|
|
|
400449
401013
|
import { spawnSync as spawnSync4 } from "child_process";
|
|
400450
401014
|
import { existsSync as existsSync45, readdirSync as readdirSync17 } from "fs";
|
|
400451
401015
|
import { arch, homedir as homedir30, platform as platform5, release as release2 } from "os";
|
|
400452
|
-
import { join as
|
|
401016
|
+
import { join as join165 } from "path";
|
|
400453
401017
|
function commandExists(bin) {
|
|
400454
401018
|
try {
|
|
400455
401019
|
const cmd = process.platform === "win32" ? "where" : "which";
|
|
@@ -400484,7 +401048,7 @@ function workspaceInfo(cwd2) {
|
|
|
400484
401048
|
try {
|
|
400485
401049
|
fileCount = readdirSync17(cwd2).length;
|
|
400486
401050
|
} catch {}
|
|
400487
|
-
const git7 = existsSync45(
|
|
401051
|
+
const git7 = existsSync45(join165(cwd2, ".git")) ? "yes" : "no";
|
|
400488
401052
|
const dna2 = formatDna(detectProjectDna(cwd2));
|
|
400489
401053
|
return [`workspace: ${cwd2}`, `entries: ${fileCount}`, `git: ${git7}`, "", dna2].join(`
|
|
400490
401054
|
`);
|
|
@@ -400512,16 +401076,16 @@ async function urDoctor(cwd2) {
|
|
|
400512
401076
|
lines.push(` tip: no coder model found \u2014 consider: ollama pull ${pull}`);
|
|
400513
401077
|
}
|
|
400514
401078
|
}
|
|
400515
|
-
const urDir =
|
|
401079
|
+
const urDir = join165(cwd2, ".ur");
|
|
400516
401080
|
if (existsSync45(urDir)) {
|
|
400517
|
-
const have = ["actions.jsonl", "project_dna.md", "mode", "graph", "tools", "research", "memory", "index"].filter((n2) => existsSync45(
|
|
401081
|
+
const have = ["actions.jsonl", "project_dna.md", "mode", "graph", "tools", "research", "memory", "index"].filter((n2) => existsSync45(join165(urDir, n2)));
|
|
400518
401082
|
lines.push(`.ur: present \u2014 ${have.join(", ") || "(empty)"}`);
|
|
400519
401083
|
} else {
|
|
400520
401084
|
lines.push(".ur: missing (run /ur-init)");
|
|
400521
401085
|
}
|
|
400522
|
-
const mcp2 = [
|
|
401086
|
+
const mcp2 = [join165(cwd2, ".ur", "mcp", "servers.toml"), join165(homedir30(), ".ur", "mcp", "servers.toml")].filter(existsSync45);
|
|
400523
401087
|
lines.push(`mcp cfg: ${mcp2.length ? mcp2.join(", ") : "none (.ur/mcp/servers.toml)"}`);
|
|
400524
|
-
lines.push(`playwright: ${existsSync45(
|
|
401088
|
+
lines.push(`playwright: ${existsSync45(join165(cwd2, "node_modules", "playwright")) ? "installed" : "not installed"}`);
|
|
400525
401089
|
return lines.join(`
|
|
400526
401090
|
`);
|
|
400527
401091
|
}
|
|
@@ -400609,7 +401173,7 @@ var init_project2 = __esm(() => {
|
|
|
400609
401173
|
|
|
400610
401174
|
// src/ur/notes.ts
|
|
400611
401175
|
import { appendFileSync as appendFileSync5, existsSync as existsSync46, mkdirSync as mkdirSync41, readFileSync as readFileSync52, writeFileSync as writeFileSync39 } from "fs";
|
|
400612
|
-
import { dirname as dirname59, join as
|
|
401176
|
+
import { dirname as dirname59, join as join166 } from "path";
|
|
400613
401177
|
function readJsonl(file2) {
|
|
400614
401178
|
if (!existsSync46(file2))
|
|
400615
401179
|
return [];
|
|
@@ -400656,7 +401220,7 @@ function addResearch(cwd2, kind, text) {
|
|
|
400656
401220
|
function listResearch(cwd2, kind) {
|
|
400657
401221
|
return readJsonl(researchFile(cwd2, kind));
|
|
400658
401222
|
}
|
|
400659
|
-
var memFile = (cwd2) =>
|
|
401223
|
+
var memFile = (cwd2) => join166(cwd2, ".ur", "memory", "notes.jsonl"), researchFile = (cwd2, kind) => join166(cwd2, ".ur", "research", `${kind}.jsonl`);
|
|
400660
401224
|
var init_notes = () => {};
|
|
400661
401225
|
|
|
400662
401226
|
// src/commands/remember/remember.ts
|
|
@@ -400701,12 +401265,12 @@ import {
|
|
|
400701
401265
|
readdirSync as readdirSync18,
|
|
400702
401266
|
writeFileSync as writeFileSync40
|
|
400703
401267
|
} from "fs";
|
|
400704
|
-
import { dirname as dirname60, join as
|
|
401268
|
+
import { dirname as dirname60, join as join167 } from "path";
|
|
400705
401269
|
function memoryDir(cwd2) {
|
|
400706
|
-
return
|
|
401270
|
+
return join167(cwd2, ".ur", "memory");
|
|
400707
401271
|
}
|
|
400708
401272
|
function policyPath2(cwd2) {
|
|
400709
|
-
return
|
|
401273
|
+
return join167(memoryDir(cwd2), "retention.json");
|
|
400710
401274
|
}
|
|
400711
401275
|
function defaultMemoryRetentionPolicy() {
|
|
400712
401276
|
return { version: 1, maxEntries: 1000, updatedAt: new Date().toISOString() };
|
|
@@ -400797,7 +401361,7 @@ function memoryJsonlFiles(cwd2) {
|
|
|
400797
401361
|
const dir = memoryDir(cwd2);
|
|
400798
401362
|
if (!existsSync47(dir))
|
|
400799
401363
|
return [];
|
|
400800
|
-
return readdirSync18(dir).filter((name) => name.endsWith(".jsonl")).map((name) =>
|
|
401364
|
+
return readdirSync18(dir).filter((name) => name.endsWith(".jsonl")).map((name) => join167(dir, name));
|
|
400801
401365
|
}
|
|
400802
401366
|
function pruneMemoryRetention(cwd2, policy = loadMemoryRetentionPolicy(cwd2), nowMs = Date.now()) {
|
|
400803
401367
|
const files = memoryJsonlFiles(cwd2).map((file2) => {
|
|
@@ -400919,9 +401483,9 @@ __export(exports_semantic_memory, {
|
|
|
400919
401483
|
call: () => call94
|
|
400920
401484
|
});
|
|
400921
401485
|
import { existsSync as existsSync48, mkdirSync as mkdirSync43, readdirSync as readdirSync19, readFileSync as readFileSync54, statSync as statSync11, writeFileSync as writeFileSync41 } from "fs";
|
|
400922
|
-
import { basename as basename40, join as
|
|
401486
|
+
import { basename as basename40, join as join168 } from "path";
|
|
400923
401487
|
function indexPath3() {
|
|
400924
|
-
return
|
|
401488
|
+
return join168(getCwd2(), ".ur", "semantic-memory", "index", "index.json");
|
|
400925
401489
|
}
|
|
400926
401490
|
function tokenize7(value) {
|
|
400927
401491
|
return [...new Set(value.toLowerCase().match(/[a-z0-9_]{3,}/g) ?? [])];
|
|
@@ -400930,15 +401494,15 @@ function sourceFiles() {
|
|
|
400930
401494
|
const cwd2 = getCwd2();
|
|
400931
401495
|
const files = [];
|
|
400932
401496
|
for (const file2 of ["UR.md", "README.md"]) {
|
|
400933
|
-
const path22 =
|
|
401497
|
+
const path22 = join168(cwd2, file2);
|
|
400934
401498
|
if (existsSync48(path22))
|
|
400935
401499
|
files.push(path22);
|
|
400936
401500
|
}
|
|
400937
|
-
for (const dir of [
|
|
401501
|
+
for (const dir of [join168(cwd2, ".ur", "memory"), join168(cwd2, ".ur", "docs")]) {
|
|
400938
401502
|
if (!existsSync48(dir))
|
|
400939
401503
|
continue;
|
|
400940
401504
|
for (const file2 of readdirSync19(dir)) {
|
|
400941
|
-
const path22 =
|
|
401505
|
+
const path22 = join168(dir, file2);
|
|
400942
401506
|
if (statSync11(path22).isFile() && /\.(md|txt|jsonl)$/i.test(file2)) {
|
|
400943
401507
|
files.push(path22);
|
|
400944
401508
|
}
|
|
@@ -400962,7 +401526,7 @@ function buildIndex2() {
|
|
|
400962
401526
|
builtAt: new Date().toISOString(),
|
|
400963
401527
|
entries
|
|
400964
401528
|
};
|
|
400965
|
-
mkdirSync43(
|
|
401529
|
+
mkdirSync43(join168(getCwd2(), ".ur", "semantic-memory", "index"), { recursive: true });
|
|
400966
401530
|
writeFileSync41(indexPath3(), `${JSON.stringify(index2, null, 2)}
|
|
400967
401531
|
`);
|
|
400968
401532
|
return index2;
|
|
@@ -570307,10 +570871,10 @@ import {
|
|
|
570307
570871
|
statSync as statSync12,
|
|
570308
570872
|
writeFileSync as writeFileSync42
|
|
570309
570873
|
} from "fs";
|
|
570310
|
-
import { dirname as dirname61, extname as extname15, isAbsolute as isAbsolute27, join as
|
|
570874
|
+
import { dirname as dirname61, extname as extname15, isAbsolute as isAbsolute27, join as join169, relative as relative36, resolve as resolve44 } from "path";
|
|
570311
570875
|
import { promisify as promisify4 } from "util";
|
|
570312
570876
|
function repoEditIndexPath(root2) {
|
|
570313
|
-
return
|
|
570877
|
+
return join169(root2, ".ur", "repo-edit", "index.json");
|
|
570314
570878
|
}
|
|
570315
570879
|
function isSkippedDir(pathFromRoot, name) {
|
|
570316
570880
|
if (SKIP_DIRS.has(name))
|
|
@@ -570341,7 +570905,7 @@ function listRepoFiles(root2, maxFiles = 25000) {
|
|
|
570341
570905
|
for (const entry of entries) {
|
|
570342
570906
|
if (files.length >= maxFiles)
|
|
570343
570907
|
return;
|
|
570344
|
-
const full =
|
|
570908
|
+
const full = join169(dir, entry.name);
|
|
570345
570909
|
const rel = normalizeRelPath(relative36(root2, full));
|
|
570346
570910
|
if (entry.isDirectory()) {
|
|
570347
570911
|
if (entry.name.startsWith(".") && entry.name !== ".ur")
|
|
@@ -570417,7 +570981,7 @@ function collectSymbols(file2, content) {
|
|
|
570417
570981
|
}
|
|
570418
570982
|
function buildRepoEditIndex(root2) {
|
|
570419
570983
|
const files = listRepoFiles(root2).map((path22) => {
|
|
570420
|
-
const abs =
|
|
570984
|
+
const abs = join169(root2, path22);
|
|
570421
570985
|
const stat41 = statSync12(abs);
|
|
570422
570986
|
const ext = extname15(path22).toLowerCase();
|
|
570423
570987
|
const text = isTextPath(path22);
|
|
@@ -570482,7 +571046,7 @@ function searchRepoEditIndex(root2, query2, index2 = loadRepoEditIndex(root2) ??
|
|
|
570482
571046
|
const lines = [];
|
|
570483
571047
|
if (file2.text && score > 0) {
|
|
570484
571048
|
try {
|
|
570485
|
-
const content = readFileSync55(
|
|
571049
|
+
const content = readFileSync55(join169(root2, file2.path), "utf-8");
|
|
570486
571050
|
const split = content.split(`
|
|
570487
571051
|
`);
|
|
570488
571052
|
for (let i3 = 0;i3 < split.length && lines.length < 4; i3++) {
|
|
@@ -570536,7 +571100,7 @@ function planRename(root2, from, to) {
|
|
|
570536
571100
|
if (from === to)
|
|
570537
571101
|
throw new Error("from and to must be different identifiers");
|
|
570538
571102
|
const files = listRepoFiles(root2).filter(isCodePath).flatMap((file2) => {
|
|
570539
|
-
const abs =
|
|
571103
|
+
const abs = join169(root2, file2);
|
|
570540
571104
|
let oldContent;
|
|
570541
571105
|
try {
|
|
570542
571106
|
oldContent = readFileSync55(abs, "utf-8");
|
|
@@ -570596,7 +571160,7 @@ async function runCheck(command5, cwd2) {
|
|
|
570596
571160
|
}
|
|
570597
571161
|
function rollback(root2, snapshots) {
|
|
570598
571162
|
for (const [file2, content] of snapshots) {
|
|
570599
|
-
writeFileSync42(
|
|
571163
|
+
writeFileSync42(join169(root2, file2), content);
|
|
570600
571164
|
}
|
|
570601
571165
|
}
|
|
570602
571166
|
async function applyRename(root2, from, to, options2 = {}) {
|
|
@@ -570609,7 +571173,7 @@ async function applyRename(root2, from, to, options2 = {}) {
|
|
|
570609
571173
|
try {
|
|
570610
571174
|
for (const file2 of plan.files) {
|
|
570611
571175
|
snapshots.set(file2.file, file2.oldContent);
|
|
570612
|
-
writeFileSync42(
|
|
571176
|
+
writeFileSync42(join169(root2, file2.file), file2.newContent);
|
|
570613
571177
|
writtenFiles.push(file2.file);
|
|
570614
571178
|
}
|
|
570615
571179
|
const syntax = plan.files.flatMap((file2) => syntaxErrors(file2.file, file2.newContent));
|
|
@@ -570768,7 +571332,7 @@ var init_reliableRepoEdit = __esm(() => {
|
|
|
570768
571332
|
|
|
570769
571333
|
// src/services/repoEditing/ast/diagnostics.ts
|
|
570770
571334
|
import { exec as exec7 } from "child_process";
|
|
570771
|
-
import { join as
|
|
571335
|
+
import { join as join170 } from "path";
|
|
570772
571336
|
import { promisify as promisify5 } from "util";
|
|
570773
571337
|
function emptySnapshot(source = "none") {
|
|
570774
571338
|
return { files: {}, collectedAt: new Date().toISOString(), source };
|
|
@@ -570863,7 +571427,7 @@ function createSyntheticProgram(root2, files) {
|
|
|
570863
571427
|
strict: false
|
|
570864
571428
|
};
|
|
570865
571429
|
const host = import_typescript2.default.createCompilerHost(compilerOptions);
|
|
570866
|
-
const fileNames = files.map((f) =>
|
|
571430
|
+
const fileNames = files.map((f) => join170(root2, f));
|
|
570867
571431
|
return import_typescript2.default.createProgram(fileNames, compilerOptions, host);
|
|
570868
571432
|
}
|
|
570869
571433
|
function collectTsDiagnostics(root2, files) {
|
|
@@ -571090,7 +571654,7 @@ function languageFromPath2(file2) {
|
|
|
571090
571654
|
}
|
|
571091
571655
|
|
|
571092
571656
|
// src/services/repoEditing/ast/workspaceEdit.ts
|
|
571093
|
-
import { dirname as dirname62, join as
|
|
571657
|
+
import { dirname as dirname62, join as join171 } from "path";
|
|
571094
571658
|
import { existsSync as existsSync50, mkdirSync as mkdirSync45, readFileSync as readFileSync56, writeFileSync as writeFileSync43 } from "fs";
|
|
571095
571659
|
function groupByFile2(edits) {
|
|
571096
571660
|
const groups = new Map;
|
|
@@ -571125,7 +571689,7 @@ function applyWorkspaceEdit(root2, edit2) {
|
|
|
571125
571689
|
const byFile = groupByFile2(edit2.edits);
|
|
571126
571690
|
for (const [file2, rawEdits] of byFile) {
|
|
571127
571691
|
const edits = normalizeFileEdits(file2, rawEdits);
|
|
571128
|
-
const abs =
|
|
571692
|
+
const abs = join171(root2, file2);
|
|
571129
571693
|
const oldContent = existsSync50(abs) ? readFileSync56(abs, "utf-8") : "";
|
|
571130
571694
|
const newContent = applyFileEdits(oldContent, edits);
|
|
571131
571695
|
snapshots.set(file2, oldContent);
|
|
@@ -571139,14 +571703,14 @@ function applyWorkspaceEdit(root2, edit2) {
|
|
|
571139
571703
|
}
|
|
571140
571704
|
function rollbackWorkspaceEdit(root2, snapshots) {
|
|
571141
571705
|
for (const [file2, content] of snapshots) {
|
|
571142
|
-
writeFileSync43(
|
|
571706
|
+
writeFileSync43(join171(root2, file2), content);
|
|
571143
571707
|
}
|
|
571144
571708
|
}
|
|
571145
571709
|
function formatWorkspaceEditAsPatch(root2, edit2) {
|
|
571146
571710
|
const byFile = groupByFile2(edit2.edits);
|
|
571147
571711
|
const pieces = [];
|
|
571148
571712
|
for (const [file2] of byFile) {
|
|
571149
|
-
const abs =
|
|
571713
|
+
const abs = join171(root2, file2);
|
|
571150
571714
|
const oldContent = readFileSync56(abs, "utf-8");
|
|
571151
571715
|
const sorted = [...byFile.get(file2) ?? []].sort((a2, b) => b.start - a2.start);
|
|
571152
571716
|
const newContent = applyFileEdits(oldContent, sorted);
|
|
@@ -571196,7 +571760,7 @@ function uriToAbsolutePath(root2, uri) {
|
|
|
571196
571760
|
try {
|
|
571197
571761
|
path22 = decodeURIComponent(path22);
|
|
571198
571762
|
} catch {}
|
|
571199
|
-
return path22.startsWith("/") ? path22 :
|
|
571763
|
+
return path22.startsWith("/") ? path22 : join171(root2, path22);
|
|
571200
571764
|
}
|
|
571201
571765
|
function absoluteToRelative(root2, abs) {
|
|
571202
571766
|
return abs.replace(root2, "").replace(/^\//, "");
|
|
@@ -571285,7 +571849,7 @@ var init_lspEditEngine = __esm(() => {
|
|
|
571285
571849
|
});
|
|
571286
571850
|
|
|
571287
571851
|
// src/services/repoEditing/ast/typescriptEngine.ts
|
|
571288
|
-
import { dirname as dirname63, join as
|
|
571852
|
+
import { dirname as dirname63, join as join172, relative as relative37 } from "path";
|
|
571289
571853
|
function loadProgram(root2, files) {
|
|
571290
571854
|
const configPath2 = import_typescript3.default.findConfigFile(root2, import_typescript3.default.sys.fileExists, "tsconfig.json");
|
|
571291
571855
|
let program;
|
|
@@ -571308,7 +571872,7 @@ function loadProgram(root2, files) {
|
|
|
571308
571872
|
jsx: import_typescript3.default.JsxEmit.React
|
|
571309
571873
|
};
|
|
571310
571874
|
const host = import_typescript3.default.createCompilerHost(compilerOptions);
|
|
571311
|
-
const fileNames = files?.length ? files.map((f) =>
|
|
571875
|
+
const fileNames = files?.length ? files.map((f) => join172(root2, f)) : [];
|
|
571312
571876
|
program = import_typescript3.default.createProgram(fileNames, compilerOptions, host);
|
|
571313
571877
|
}
|
|
571314
571878
|
return { program, checker: program.getTypeChecker() };
|
|
@@ -571333,7 +571897,7 @@ function findNodeAtPosition(sourceFile, pos) {
|
|
|
571333
571897
|
return visit2(sourceFile);
|
|
571334
571898
|
}
|
|
571335
571899
|
function symbolAtPosition(ctx, file2, line, column) {
|
|
571336
|
-
const abs =
|
|
571900
|
+
const abs = join172(ctx.program.getCurrentDirectory(), file2);
|
|
571337
571901
|
const sourceFile = ctx.program.getSourceFile(abs);
|
|
571338
571902
|
if (!sourceFile)
|
|
571339
571903
|
return;
|
|
@@ -571384,7 +571948,7 @@ function dedupeEdits(edits) {
|
|
|
571384
571948
|
}
|
|
571385
571949
|
function tsRenameSymbol(ctx, options2) {
|
|
571386
571950
|
const { root: root2, from, to, file: maybeFile, line, column } = options2;
|
|
571387
|
-
const targetFile = maybeFile ?
|
|
571951
|
+
const targetFile = maybeFile ? join172(root2, maybeFile) : undefined;
|
|
571388
571952
|
let targetSymbols;
|
|
571389
571953
|
if (maybeFile && line !== undefined && column !== undefined) {
|
|
571390
571954
|
const symbol2 = symbolAtPosition(ctx, maybeFile, line, column);
|
|
@@ -571431,8 +571995,8 @@ function tsMoveFunction(ctx, options2) {
|
|
|
571431
571995
|
if (!sourceFileRel) {
|
|
571432
571996
|
throw new Error("TS move requires --file to identify the source file");
|
|
571433
571997
|
}
|
|
571434
|
-
const sourceAbs =
|
|
571435
|
-
const targetAbs =
|
|
571998
|
+
const sourceAbs = join172(root2, sourceFileRel);
|
|
571999
|
+
const targetAbs = join172(root2, targetFileRel);
|
|
571436
572000
|
const sourceSf = ctx.program.getSourceFile(sourceAbs);
|
|
571437
572001
|
const targetSf = ctx.program.getSourceFile(targetAbs) ?? ctx.program.getSourceFile(targetFileRel);
|
|
571438
572002
|
if (!sourceSf)
|
|
@@ -571533,7 +572097,7 @@ function normalizePath2(value) {
|
|
|
571533
572097
|
function resolveRelativeImport(importingFileRel, specifier) {
|
|
571534
572098
|
if (!specifier.startsWith("."))
|
|
571535
572099
|
return;
|
|
571536
|
-
const base2 = normalizePath2(
|
|
572100
|
+
const base2 = normalizePath2(join172(dirname63(importingFileRel), specifier));
|
|
571537
572101
|
return stripKnownExtension(base2);
|
|
571538
572102
|
}
|
|
571539
572103
|
function moduleSpecifierBetween(importingFileRel, targetFileRel) {
|
|
@@ -571567,7 +572131,7 @@ function tsOrganizeImports(_ctx, options2) {
|
|
|
571567
572131
|
const files = maybeFile ? [maybeFile] : [];
|
|
571568
572132
|
const edits = [];
|
|
571569
572133
|
for (const file2 of files) {
|
|
571570
|
-
const abs =
|
|
572134
|
+
const abs = join172(root2, file2);
|
|
571571
572135
|
const sf = _ctx.program.getSourceFile(abs);
|
|
571572
572136
|
if (!sf)
|
|
571573
572137
|
continue;
|
|
@@ -572508,7 +573072,7 @@ var init_cite2 = __esm(() => {
|
|
|
572508
573072
|
|
|
572509
573073
|
// src/ur/fileops.ts
|
|
572510
573074
|
import { existsSync as existsSync51, mkdirSync as mkdirSync46, readdirSync as readdirSync21, readFileSync as readFileSync59, statSync as statSync13, writeFileSync as writeFileSync44 } from "fs";
|
|
572511
|
-
import { extname as extname16, isAbsolute as isAbsolute28, join as
|
|
573075
|
+
import { extname as extname16, isAbsolute as isAbsolute28, join as join173, relative as relative38, resolve as resolve45 } from "path";
|
|
572512
573076
|
function readFileSafe2(cwd2, target, maxBytes = 64000) {
|
|
572513
573077
|
const abs = isAbsolute28(target) ? target : resolve45(cwd2, target);
|
|
572514
573078
|
if (!existsSync51(abs))
|
|
@@ -572542,7 +573106,7 @@ function* walk(dir, root2, budget = { n: 0 }, max2 = 8000) {
|
|
|
572542
573106
|
return;
|
|
572543
573107
|
if (e.name.startsWith(".") && e.name !== ".ur")
|
|
572544
573108
|
continue;
|
|
572545
|
-
const full =
|
|
573109
|
+
const full = join173(dir, e.name);
|
|
572546
573110
|
if (e.isDirectory()) {
|
|
572547
573111
|
if (SKIP_DIRS2.has(e.name))
|
|
572548
573112
|
continue;
|
|
@@ -572561,7 +573125,7 @@ function searchFiles(cwd2, query2, maxResults = 60) {
|
|
|
572561
573125
|
continue;
|
|
572562
573126
|
let lines;
|
|
572563
573127
|
try {
|
|
572564
|
-
lines = readFileSync59(
|
|
573128
|
+
lines = readFileSync59(join173(cwd2, rel), "utf8").split(`
|
|
572565
573129
|
`);
|
|
572566
573130
|
} catch {
|
|
572567
573131
|
continue;
|
|
@@ -572579,8 +573143,8 @@ function searchFiles(cwd2, query2, maxResults = 60) {
|
|
|
572579
573143
|
function indexWorkspace(cwd2) {
|
|
572580
573144
|
const files = [...walk(cwd2, cwd2)];
|
|
572581
573145
|
try {
|
|
572582
|
-
mkdirSync46(
|
|
572583
|
-
writeFileSync44(
|
|
573146
|
+
mkdirSync46(join173(cwd2, ".ur", "index"), { recursive: true });
|
|
573147
|
+
writeFileSync44(join173(cwd2, ".ur", "index", "files.txt"), files.join(`
|
|
572584
573148
|
`) + `
|
|
572585
573149
|
`);
|
|
572586
573150
|
} catch {}
|
|
@@ -573006,8 +573570,8 @@ __export(exports_mode, {
|
|
|
573006
573570
|
call: () => call110
|
|
573007
573571
|
});
|
|
573008
573572
|
import { existsSync as existsSync54, mkdirSync as mkdirSync47, readFileSync as readFileSync60, writeFileSync as writeFileSync45 } from "fs";
|
|
573009
|
-
import { join as
|
|
573010
|
-
var MODES, SECURITY_MODES2, file2 = (cwd2) =>
|
|
573573
|
+
import { join as join174 } from "path";
|
|
573574
|
+
var MODES, SECURITY_MODES2, file2 = (cwd2) => join174(cwd2, ".ur", "mode"), call110 = async (args) => {
|
|
573011
573575
|
const want = (args ?? "").trim().toLowerCase();
|
|
573012
573576
|
const f = file2(getCwd2());
|
|
573013
573577
|
if (!want) {
|
|
@@ -573025,7 +573589,7 @@ available: ${MODES.join(", ")}
|
|
|
573025
573589
|
security: ${SECURITY_MODES2.join(", ")}` };
|
|
573026
573590
|
}
|
|
573027
573591
|
try {
|
|
573028
|
-
mkdirSync47(
|
|
573592
|
+
mkdirSync47(join174(getCwd2(), ".ur"), { recursive: true });
|
|
573029
573593
|
writeFileSync45(f, want + `
|
|
573030
573594
|
`);
|
|
573031
573595
|
} catch {}
|
|
@@ -573149,7 +573713,7 @@ __export(exports_role_mode, {
|
|
|
573149
573713
|
call: () => call111
|
|
573150
573714
|
});
|
|
573151
573715
|
import { existsSync as existsSync55, mkdirSync as mkdirSync48, writeFileSync as writeFileSync46 } from "fs";
|
|
573152
|
-
import { join as
|
|
573716
|
+
import { join as join175 } from "path";
|
|
573153
573717
|
function formatList() {
|
|
573154
573718
|
const lines = ["Built-in role modes:", ""];
|
|
573155
573719
|
for (const mode2 of ROLE_MODES) {
|
|
@@ -573203,12 +573767,12 @@ var call111 = async (args) => {
|
|
|
573203
573767
|
value: `Unknown role mode "${target}". Available: ${listModeNames().join(", ")}, or "all".`
|
|
573204
573768
|
};
|
|
573205
573769
|
}
|
|
573206
|
-
const agentsDir =
|
|
573770
|
+
const agentsDir = join175(getCwd2(), ".ur", "agents");
|
|
573207
573771
|
mkdirSync48(agentsDir, { recursive: true });
|
|
573208
573772
|
const created = [];
|
|
573209
573773
|
const skipped = [];
|
|
573210
573774
|
for (const mode2 of modes) {
|
|
573211
|
-
const path22 =
|
|
573775
|
+
const path22 = join175(agentsDir, `${mode2.name}.md`);
|
|
573212
573776
|
if (existsSync55(path22) && !force) {
|
|
573213
573777
|
skipped.push(`${mode2.name} (exists; use --force to overwrite)`);
|
|
573214
573778
|
continue;
|
|
@@ -573260,7 +573824,7 @@ var init_role_mode2 = __esm(() => {
|
|
|
573260
573824
|
|
|
573261
573825
|
// src/ur/researchGraph.ts
|
|
573262
573826
|
import { appendFileSync as appendFileSync6, existsSync as existsSync56, mkdirSync as mkdirSync49, readFileSync as readFileSync61 } from "fs";
|
|
573263
|
-
import { dirname as dirname64, join as
|
|
573827
|
+
import { dirname as dirname64, join as join176 } from "path";
|
|
573264
573828
|
function isEntity(s) {
|
|
573265
573829
|
return ENTITIES.includes(s);
|
|
573266
573830
|
}
|
|
@@ -573291,7 +573855,7 @@ function graphSummary(cwd2) {
|
|
|
573291
573855
|
out[e] = listEntity(cwd2, e).length;
|
|
573292
573856
|
return out;
|
|
573293
573857
|
}
|
|
573294
|
-
var ENTITIES, file3 = (cwd2, entity) =>
|
|
573858
|
+
var ENTITIES, file3 = (cwd2, entity) => join176(cwd2, ".ur", "graph", `${entity}.jsonl`);
|
|
573295
573859
|
var init_researchGraph = __esm(() => {
|
|
573296
573860
|
ENTITIES = [
|
|
573297
573861
|
"sources",
|
|
@@ -573361,12 +573925,12 @@ __export(exports_toolsmith, {
|
|
|
573361
573925
|
call: () => call113
|
|
573362
573926
|
});
|
|
573363
573927
|
import { existsSync as existsSync57, mkdirSync as mkdirSync50, readdirSync as readdirSync22, writeFileSync as writeFileSync47 } from "fs";
|
|
573364
|
-
import { join as
|
|
573928
|
+
import { join as join177 } from "path";
|
|
573365
573929
|
var TEMPLATES, call113 = async (args) => {
|
|
573366
573930
|
const [name, langArg] = (args ?? "").trim().split(/\s+/).filter(Boolean);
|
|
573367
573931
|
const auto = [["python3", "python"], ["node", "node"], ["bash", "bash"], ["go", "go"], ["cargo", "rust"]].find(([bin]) => commandExists(bin))?.[1] ?? "python";
|
|
573368
573932
|
const lang = langArg ?? auto;
|
|
573369
|
-
const dir =
|
|
573933
|
+
const dir = join177(getCwd2(), ".ur", "tools");
|
|
573370
573934
|
if (!name) {
|
|
573371
573935
|
const files = existsSync57(dir) ? readdirSync22(dir) : [];
|
|
573372
573936
|
return { type: "text", value: files.length ? `tools:
|
|
@@ -573377,7 +573941,7 @@ var TEMPLATES, call113 = async (args) => {
|
|
|
573377
573941
|
if (!tpl)
|
|
573378
573942
|
return { type: "text", value: `unknown lang "${lang}". choose: ${Object.keys(TEMPLATES).join(", ")}` };
|
|
573379
573943
|
mkdirSync50(dir, { recursive: true });
|
|
573380
|
-
const file4 =
|
|
573944
|
+
const file4 = join177(dir, `${name}.${tpl.ext}`);
|
|
573381
573945
|
if (existsSync57(file4))
|
|
573382
573946
|
return { type: "text", value: `already exists: .ur/tools/${name}.${tpl.ext}` };
|
|
573383
573947
|
writeFileSync47(file4, tpl.body);
|
|
@@ -573441,12 +574005,12 @@ __export(exports_browser, {
|
|
|
573441
574005
|
call: () => call114
|
|
573442
574006
|
});
|
|
573443
574007
|
import { existsSync as existsSync58 } from "fs";
|
|
573444
|
-
import { join as
|
|
574008
|
+
import { join as join178 } from "path";
|
|
573445
574009
|
var call114 = async (args) => {
|
|
573446
574010
|
const task2 = (args ?? "").trim();
|
|
573447
574011
|
if (!task2)
|
|
573448
574012
|
return { type: "text", value: "usage: /browser <url|task>" };
|
|
573449
|
-
const hasPlaywright = existsSync58(
|
|
574013
|
+
const hasPlaywright = existsSync58(join178(getCwd2(), "node_modules", "playwright")) || existsSync58(join178(getCwd2(), "node_modules", "playwright-core"));
|
|
573450
574014
|
if (hasPlaywright) {
|
|
573451
574015
|
return { type: "text", value: `Playwright detected \u2014 ask UR to drive the browser for: ${task2}
|
|
573452
574016
|
Risky actions (form submit, downloads, login) require your approval.` };
|
|
@@ -573502,16 +574066,16 @@ var init_ur_doctor2 = __esm(() => {
|
|
|
573502
574066
|
|
|
573503
574067
|
// src/utils/urAssets.ts
|
|
573504
574068
|
import { existsSync as existsSync59, mkdirSync as mkdirSync51, writeFileSync as writeFileSync48 } from "fs";
|
|
573505
|
-
import { join as
|
|
574069
|
+
import { join as join179 } from "path";
|
|
573506
574070
|
function scaffoldUrAssets(cwd2) {
|
|
573507
|
-
const root2 =
|
|
574071
|
+
const root2 = join179(cwd2, ".ur");
|
|
573508
574072
|
const created = [];
|
|
573509
574073
|
const skipped = [];
|
|
573510
574074
|
mkdirSync51(root2, { recursive: true });
|
|
573511
574075
|
for (const d of DIRS)
|
|
573512
|
-
mkdirSync51(
|
|
574076
|
+
mkdirSync51(join179(root2, d), { recursive: true });
|
|
573513
574077
|
for (const file4 of SEED_FILES) {
|
|
573514
|
-
const full =
|
|
574078
|
+
const full = join179(root2, file4.path);
|
|
573515
574079
|
if (existsSync59(full)) {
|
|
573516
574080
|
skipped.push(file4.path);
|
|
573517
574081
|
continue;
|
|
@@ -573809,7 +574373,7 @@ __export(exports_thinkback, {
|
|
|
573809
574373
|
call: () => call120
|
|
573810
574374
|
});
|
|
573811
574375
|
import { readFile as readFile45 } from "fs/promises";
|
|
573812
|
-
import { join as
|
|
574376
|
+
import { join as join180 } from "path";
|
|
573813
574377
|
function getMarketplaceName() {
|
|
573814
574378
|
return OFFICIAL_MARKETPLACE_NAME;
|
|
573815
574379
|
}
|
|
@@ -573827,15 +574391,15 @@ async function getThinkbackSkillDir() {
|
|
|
573827
574391
|
if (!thinkbackPlugin) {
|
|
573828
574392
|
return null;
|
|
573829
574393
|
}
|
|
573830
|
-
const skillDir =
|
|
574394
|
+
const skillDir = join180(thinkbackPlugin.path, "skills", SKILL_NAME);
|
|
573831
574395
|
if (await pathExists(skillDir)) {
|
|
573832
574396
|
return skillDir;
|
|
573833
574397
|
}
|
|
573834
574398
|
return null;
|
|
573835
574399
|
}
|
|
573836
574400
|
async function playAnimation(skillDir) {
|
|
573837
|
-
const dataPath =
|
|
573838
|
-
const playerPath =
|
|
574401
|
+
const dataPath = join180(skillDir, "year_in_review.js");
|
|
574402
|
+
const playerPath = join180(skillDir, "player.js");
|
|
573839
574403
|
try {
|
|
573840
574404
|
await readFile45(dataPath);
|
|
573841
574405
|
} catch (e) {
|
|
@@ -573883,7 +574447,7 @@ async function playAnimation(skillDir) {
|
|
|
573883
574447
|
} catch {} finally {
|
|
573884
574448
|
inkInstance.exitAlternateScreen();
|
|
573885
574449
|
}
|
|
573886
|
-
const htmlPath =
|
|
574450
|
+
const htmlPath = join180(skillDir, "year_in_review.html");
|
|
573887
574451
|
if (await pathExists(htmlPath)) {
|
|
573888
574452
|
const platform6 = getPlatform();
|
|
573889
574453
|
const openCmd = platform6 === "macos" ? "open" : platform6 === "windows" ? "start" : "xdg-open";
|
|
@@ -574219,7 +574783,7 @@ function ThinkbackFlow(t0) {
|
|
|
574219
574783
|
if (!skillDir) {
|
|
574220
574784
|
return;
|
|
574221
574785
|
}
|
|
574222
|
-
const dataPath =
|
|
574786
|
+
const dataPath = join180(skillDir, "year_in_review.js");
|
|
574223
574787
|
pathExists(dataPath).then((exists) => {
|
|
574224
574788
|
logForDebugging(`Checking for ${dataPath}: ${exists ? "found" : "not found"}`);
|
|
574225
574789
|
setHasGenerated(exists);
|
|
@@ -574393,7 +574957,7 @@ var exports_thinkback_play = {};
|
|
|
574393
574957
|
__export(exports_thinkback_play, {
|
|
574394
574958
|
call: () => call121
|
|
574395
574959
|
});
|
|
574396
|
-
import { join as
|
|
574960
|
+
import { join as join181 } from "path";
|
|
574397
574961
|
function getPluginId2() {
|
|
574398
574962
|
const marketplaceName = process.env.USER_TYPE === "ant" ? INTERNAL_MARKETPLACE_NAME : OFFICIAL_MARKETPLACE_NAME;
|
|
574399
574963
|
return `thinkback@${marketplaceName}`;
|
|
@@ -574415,7 +574979,7 @@ async function call121() {
|
|
|
574415
574979
|
value: "Thinkback plugin installation path not found."
|
|
574416
574980
|
};
|
|
574417
574981
|
}
|
|
574418
|
-
const skillDir =
|
|
574982
|
+
const skillDir = join181(firstInstall.installPath, "skills", SKILL_NAME2);
|
|
574419
574983
|
const result = await playAnimation(skillDir);
|
|
574420
574984
|
return { type: "text", value: result.message };
|
|
574421
574985
|
}
|
|
@@ -580882,7 +581446,7 @@ var init_types13 = __esm(() => {
|
|
|
580882
581446
|
|
|
580883
581447
|
// src/components/agents/agentFileUtils.ts
|
|
580884
581448
|
import { mkdir as mkdir35, open as open12, unlink as unlink19 } from "fs/promises";
|
|
580885
|
-
import { join as
|
|
581449
|
+
import { join as join182 } from "path";
|
|
580886
581450
|
function formatAgentAsMarkdown(agentType, whenToUse, tools, systemPrompt, color3, model, memory2, effort) {
|
|
580887
581451
|
const escapedWhenToUse = whenToUse.replace(/\\/g, "\\\\").replace(/"/g, "\\\"").replace(/\n/g, "\\\\n");
|
|
580888
581452
|
const isAllTools = tools === undefined || tools.length === 1 && tools[0] === "*";
|
|
@@ -580909,26 +581473,26 @@ function getAgentDirectoryPath(location2) {
|
|
|
580909
581473
|
case "flagSettings":
|
|
580910
581474
|
throw new Error(`Cannot get directory path for ${location2} agents`);
|
|
580911
581475
|
case "userSettings":
|
|
580912
|
-
return
|
|
581476
|
+
return join182(getURConfigHomeDir(), AGENT_PATHS.AGENTS_DIR);
|
|
580913
581477
|
case "projectSettings":
|
|
580914
|
-
return
|
|
581478
|
+
return join182(getCwd2(), AGENT_PATHS.FOLDER_NAME, AGENT_PATHS.AGENTS_DIR);
|
|
580915
581479
|
case "policySettings":
|
|
580916
|
-
return
|
|
581480
|
+
return join182(getManagedFilePath(), AGENT_PATHS.FOLDER_NAME, AGENT_PATHS.AGENTS_DIR);
|
|
580917
581481
|
case "localSettings":
|
|
580918
|
-
return
|
|
581482
|
+
return join182(getCwd2(), AGENT_PATHS.FOLDER_NAME, AGENT_PATHS.AGENTS_DIR);
|
|
580919
581483
|
}
|
|
580920
581484
|
}
|
|
580921
581485
|
function getRelativeAgentDirectoryPath(location2) {
|
|
580922
581486
|
switch (location2) {
|
|
580923
581487
|
case "projectSettings":
|
|
580924
|
-
return
|
|
581488
|
+
return join182(".", AGENT_PATHS.FOLDER_NAME, AGENT_PATHS.AGENTS_DIR);
|
|
580925
581489
|
default:
|
|
580926
581490
|
return getAgentDirectoryPath(location2);
|
|
580927
581491
|
}
|
|
580928
581492
|
}
|
|
580929
581493
|
function getNewAgentFilePath(agent) {
|
|
580930
581494
|
const dirPath = getAgentDirectoryPath(agent.source);
|
|
580931
|
-
return
|
|
581495
|
+
return join182(dirPath, `${agent.agentType}.md`);
|
|
580932
581496
|
}
|
|
580933
581497
|
function getActualAgentFilePath(agent) {
|
|
580934
581498
|
if (agent.source === "built-in") {
|
|
@@ -580939,14 +581503,14 @@ function getActualAgentFilePath(agent) {
|
|
|
580939
581503
|
}
|
|
580940
581504
|
const dirPath = getAgentDirectoryPath(agent.source);
|
|
580941
581505
|
const filename = agent.filename || agent.agentType;
|
|
580942
|
-
return
|
|
581506
|
+
return join182(dirPath, `${filename}.md`);
|
|
580943
581507
|
}
|
|
580944
581508
|
function getNewRelativeAgentFilePath(agent) {
|
|
580945
581509
|
if (agent.source === "built-in") {
|
|
580946
581510
|
return "Built-in";
|
|
580947
581511
|
}
|
|
580948
581512
|
const dirPath = getRelativeAgentDirectoryPath(agent.source);
|
|
580949
|
-
return
|
|
581513
|
+
return join182(dirPath, `${agent.agentType}.md`);
|
|
580950
581514
|
}
|
|
580951
581515
|
function getActualRelativeAgentFilePath(agent) {
|
|
580952
581516
|
if (isBuiltInAgent(agent)) {
|
|
@@ -580960,7 +581524,7 @@ function getActualRelativeAgentFilePath(agent) {
|
|
|
580960
581524
|
}
|
|
580961
581525
|
const dirPath = getRelativeAgentDirectoryPath(agent.source);
|
|
580962
581526
|
const filename = agent.filename || agent.agentType;
|
|
580963
|
-
return
|
|
581527
|
+
return join182(dirPath, `${filename}.md`);
|
|
580964
581528
|
}
|
|
580965
581529
|
async function ensureAgentDirectoryExists(source) {
|
|
580966
581530
|
const dirPath = getAgentDirectoryPath(source);
|
|
@@ -586971,7 +587535,7 @@ var init_rewind = __esm(() => {
|
|
|
586971
587535
|
// src/utils/heapDumpService.ts
|
|
586972
587536
|
import { createWriteStream as createWriteStream3, writeFileSync as writeFileSync49 } from "fs";
|
|
586973
587537
|
import { readdir as readdir26, readFile as readFile47, writeFile as writeFile40 } from "fs/promises";
|
|
586974
|
-
import { join as
|
|
587538
|
+
import { join as join183 } from "path";
|
|
586975
587539
|
import { pipeline as pipeline2 } from "stream/promises";
|
|
586976
587540
|
import {
|
|
586977
587541
|
getHeapSnapshot,
|
|
@@ -587061,7 +587625,7 @@ async function captureMemoryDiagnostics(trigger2, dumpNumber = 0) {
|
|
|
587061
587625
|
smapsRollup,
|
|
587062
587626
|
platform: process.platform,
|
|
587063
587627
|
nodeVersion: process.version,
|
|
587064
|
-
ccVersion: "1.22.
|
|
587628
|
+
ccVersion: "1.22.7"
|
|
587065
587629
|
};
|
|
587066
587630
|
}
|
|
587067
587631
|
async function performHeapDump(trigger2 = "manual", dumpNumber = 0) {
|
|
@@ -587079,8 +587643,8 @@ async function performHeapDump(trigger2 = "manual", dumpNumber = 0) {
|
|
|
587079
587643
|
const suffix = dumpNumber > 0 ? `-dump${dumpNumber}` : "";
|
|
587080
587644
|
const heapFilename = `${sessionId}${suffix}.heapsnapshot`;
|
|
587081
587645
|
const diagFilename = `${sessionId}${suffix}-diagnostics.json`;
|
|
587082
|
-
const heapPath =
|
|
587083
|
-
const diagPath =
|
|
587646
|
+
const heapPath = join183(dumpDir, heapFilename);
|
|
587647
|
+
const diagPath = join183(dumpDir, diagFilename);
|
|
587084
587648
|
await writeFile40(diagPath, jsonStringify(diagnostics, null, 2), {
|
|
587085
587649
|
mode: 384
|
|
587086
587650
|
});
|
|
@@ -587647,7 +588211,7 @@ var init_bridge_kick = __esm(() => {
|
|
|
587647
588211
|
var call136 = async () => {
|
|
587648
588212
|
return {
|
|
587649
588213
|
type: "text",
|
|
587650
|
-
value: "1.22.
|
|
588214
|
+
value: "1.22.7"
|
|
587651
588215
|
};
|
|
587652
588216
|
}, version2, version_default;
|
|
587653
588217
|
var init_version = __esm(() => {
|
|
@@ -588919,7 +589483,7 @@ var init_sandbox_toggle2 = __esm(() => {
|
|
|
588919
589483
|
|
|
588920
589484
|
// src/utils/urInChrome/setupPortable.ts
|
|
588921
589485
|
import { readdir as readdir27 } from "fs/promises";
|
|
588922
|
-
import { join as
|
|
589486
|
+
import { join as join184 } from "path";
|
|
588923
589487
|
function getExtensionIds() {
|
|
588924
589488
|
return process.env.USER_TYPE === "ant" ? [PROD_EXTENSION_ID, DEV_EXTENSION_ID, ANT_EXTENSION_ID] : [PROD_EXTENSION_ID];
|
|
588925
589489
|
}
|
|
@@ -588946,7 +589510,7 @@ async function detectExtensionInstallationPortable(browserPaths, log) {
|
|
|
588946
589510
|
}
|
|
588947
589511
|
for (const profile of profileDirs) {
|
|
588948
589512
|
for (const extensionId of extensionIds) {
|
|
588949
|
-
const extensionPath =
|
|
589513
|
+
const extensionPath = join184(browserBasePath, profile, "Extensions", extensionId);
|
|
588950
589514
|
try {
|
|
588951
589515
|
await readdir27(extensionPath);
|
|
588952
589516
|
log?.(`[UR in Chrome] Extension ${extensionId} found in ${browser2} ${profile}`);
|
|
@@ -588970,7 +589534,7 @@ var init_setupPortable = __esm(() => {
|
|
|
588970
589534
|
// src/utils/urInChrome/setup.ts
|
|
588971
589535
|
import { chmod as chmod10, mkdir as mkdir36, readFile as readFile48, writeFile as writeFile41 } from "fs/promises";
|
|
588972
589536
|
import { homedir as homedir31 } from "os";
|
|
588973
|
-
import { join as
|
|
589537
|
+
import { join as join185 } from "path";
|
|
588974
589538
|
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
588975
589539
|
function shouldEnableURInChrome(chromeFlag) {
|
|
588976
589540
|
if (getIsNonInteractiveSession() && chromeFlag !== true) {
|
|
@@ -589027,8 +589591,8 @@ function setupURInChrome() {
|
|
|
589027
589591
|
};
|
|
589028
589592
|
} else {
|
|
589029
589593
|
const __filename3 = fileURLToPath6(import.meta.url);
|
|
589030
|
-
const __dirname3 =
|
|
589031
|
-
const cliPath =
|
|
589594
|
+
const __dirname3 = join185(__filename3, "..");
|
|
589595
|
+
const cliPath = join185(__dirname3, "cli.js");
|
|
589032
589596
|
createWrapperScript(`"${process.execPath}" "${cliPath}" --chrome-native-host`).then((manifestBinaryPath) => installChromeNativeHostManifest(manifestBinaryPath)).catch((e) => logForDebugging(`[UR in Chrome] Failed to install native host: ${e}`, { level: "error" }));
|
|
589033
589597
|
const mcpConfig = {
|
|
589034
589598
|
[UR_IN_CHROME_MCP_SERVER_NAME]: {
|
|
@@ -589050,8 +589614,8 @@ function getNativeMessagingHostsDirs() {
|
|
|
589050
589614
|
const platform6 = getPlatform();
|
|
589051
589615
|
if (platform6 === "windows") {
|
|
589052
589616
|
const home = homedir31();
|
|
589053
|
-
const appData = process.env.APPDATA ||
|
|
589054
|
-
return [
|
|
589617
|
+
const appData = process.env.APPDATA || join185(home, "AppData", "Local");
|
|
589618
|
+
return [join185(appData, "UR", "ChromeNativeHost")];
|
|
589055
589619
|
}
|
|
589056
589620
|
return getAllNativeMessagingHostsDirs().map(({ path: path22 }) => path22);
|
|
589057
589621
|
}
|
|
@@ -589076,7 +589640,7 @@ async function installChromeNativeHostManifest(manifestBinaryPath) {
|
|
|
589076
589640
|
const manifestContent = jsonStringify(manifest, null, 2);
|
|
589077
589641
|
let anyManifestUpdated = false;
|
|
589078
589642
|
for (const manifestDir of manifestDirs) {
|
|
589079
|
-
const manifestPath5 =
|
|
589643
|
+
const manifestPath5 = join185(manifestDir, NATIVE_HOST_MANIFEST_NAME);
|
|
589080
589644
|
const existingContent = await readFile48(manifestPath5, "utf-8").catch(() => null);
|
|
589081
589645
|
if (existingContent === manifestContent) {
|
|
589082
589646
|
continue;
|
|
@@ -589091,7 +589655,7 @@ async function installChromeNativeHostManifest(manifestBinaryPath) {
|
|
|
589091
589655
|
}
|
|
589092
589656
|
}
|
|
589093
589657
|
if (getPlatform() === "windows") {
|
|
589094
|
-
const manifestPath5 =
|
|
589658
|
+
const manifestPath5 = join185(manifestDirs[0], NATIVE_HOST_MANIFEST_NAME);
|
|
589095
589659
|
registerWindowsNativeHosts(manifestPath5);
|
|
589096
589660
|
}
|
|
589097
589661
|
if (anyManifestUpdated) {
|
|
@@ -589129,8 +589693,8 @@ function registerWindowsNativeHosts(manifestPath5) {
|
|
|
589129
589693
|
}
|
|
589130
589694
|
async function createWrapperScript(command7) {
|
|
589131
589695
|
const platform6 = getPlatform();
|
|
589132
|
-
const chromeDir =
|
|
589133
|
-
const wrapperPath = platform6 === "windows" ?
|
|
589696
|
+
const chromeDir = join185(getURConfigHomeDir(), "chrome");
|
|
589697
|
+
const wrapperPath = platform6 === "windows" ? join185(chromeDir, "chrome-native-host.bat") : join185(chromeDir, "chrome-native-host");
|
|
589134
589698
|
const scriptContent = platform6 === "windows" ? `@echo off
|
|
589135
589699
|
REM Chrome native host wrapper script
|
|
589136
589700
|
REM Generated by UR - do not edit manually
|
|
@@ -589702,7 +590266,7 @@ var init_advisor2 = __esm(() => {
|
|
|
589702
590266
|
// src/skills/bundledSkills.ts
|
|
589703
590267
|
import { constants as fsConstants5 } from "fs";
|
|
589704
590268
|
import { mkdir as mkdir37, open as open13 } from "fs/promises";
|
|
589705
|
-
import { dirname as dirname65, isAbsolute as isAbsolute31, join as
|
|
590269
|
+
import { dirname as dirname65, isAbsolute as isAbsolute31, join as join186, normalize as normalize13, sep as pathSep3 } from "path";
|
|
589706
590270
|
function registerBundledSkill(definition) {
|
|
589707
590271
|
const { files: files2 } = definition;
|
|
589708
590272
|
let skillRoot;
|
|
@@ -589750,7 +590314,7 @@ function getBundledSkills() {
|
|
|
589750
590314
|
return [...bundledSkills];
|
|
589751
590315
|
}
|
|
589752
590316
|
function getBundledSkillExtractDir(skillName) {
|
|
589753
|
-
return
|
|
590317
|
+
return join186(getBundledSkillsRoot(), skillName);
|
|
589754
590318
|
}
|
|
589755
590319
|
async function extractBundledSkillFiles(skillName, files2) {
|
|
589756
590320
|
const dir = getBundledSkillExtractDir(skillName);
|
|
@@ -589792,7 +590356,7 @@ function resolveSkillFilePath(baseDir, relPath) {
|
|
|
589792
590356
|
if (isAbsolute31(normalized) || normalized.split(pathSep3).includes("..") || normalized.split("/").includes("..")) {
|
|
589793
590357
|
throw new Error(`bundled skill file path escapes skill dir: ${relPath}`);
|
|
589794
590358
|
}
|
|
589795
|
-
return
|
|
590359
|
+
return join186(baseDir, normalized);
|
|
589796
590360
|
}
|
|
589797
590361
|
function prependBaseDir(blocks, baseDir) {
|
|
589798
590362
|
const prefix = `Base directory for this skill: ${baseDir}
|
|
@@ -590153,7 +590717,7 @@ var init_exit2 = __esm(() => {
|
|
|
590153
590717
|
});
|
|
590154
590718
|
|
|
590155
590719
|
// src/components/ExportDialog.tsx
|
|
590156
|
-
import { join as
|
|
590720
|
+
import { join as join187 } from "path";
|
|
590157
590721
|
function ExportDialog({
|
|
590158
590722
|
content,
|
|
590159
590723
|
defaultFilename,
|
|
@@ -590186,7 +590750,7 @@ function ExportDialog({
|
|
|
590186
590750
|
};
|
|
590187
590751
|
const handleFilenameSubmit = () => {
|
|
590188
590752
|
const finalFilename = filename.endsWith(".txt") ? filename : filename.replace(/\.[^.]+$/, "") + ".txt";
|
|
590189
|
-
const filepath =
|
|
590753
|
+
const filepath = join187(getCwd2(), finalFilename);
|
|
590190
590754
|
try {
|
|
590191
590755
|
writeFileSync_DEPRECATED(filepath, content, {
|
|
590192
590756
|
encoding: "utf-8",
|
|
@@ -590409,7 +590973,7 @@ __export(exports_export, {
|
|
|
590409
590973
|
extractFirstPrompt: () => extractFirstPrompt,
|
|
590410
590974
|
call: () => call141
|
|
590411
590975
|
});
|
|
590412
|
-
import { join as
|
|
590976
|
+
import { join as join188 } from "path";
|
|
590413
590977
|
function formatTimestamp(date6) {
|
|
590414
590978
|
const year = date6.getFullYear();
|
|
590415
590979
|
const month = String(date6.getMonth() + 1).padStart(2, "0");
|
|
@@ -590453,7 +591017,7 @@ async function call141(onDone, context4, args) {
|
|
|
590453
591017
|
const filename = args.trim();
|
|
590454
591018
|
if (filename) {
|
|
590455
591019
|
const finalFilename = filename.endsWith(".txt") ? filename : filename.replace(/\.[^.]+$/, "") + ".txt";
|
|
590456
|
-
const filepath =
|
|
591020
|
+
const filepath = join188(getCwd2(), finalFilename);
|
|
590457
591021
|
try {
|
|
590458
591022
|
writeFileSync_DEPRECATED(filepath, content, {
|
|
590459
591023
|
encoding: "utf-8",
|
|
@@ -592301,7 +592865,7 @@ var require_asciichart = __commonJS((exports) => {
|
|
|
592301
592865
|
// src/utils/statsCache.ts
|
|
592302
592866
|
import { randomBytes as randomBytes17 } from "crypto";
|
|
592303
592867
|
import { open as open14 } from "fs/promises";
|
|
592304
|
-
import { join as
|
|
592868
|
+
import { join as join189 } from "path";
|
|
592305
592869
|
async function withStatsCacheLock(fn) {
|
|
592306
592870
|
while (statsCacheLockPromise) {
|
|
592307
592871
|
await statsCacheLockPromise;
|
|
@@ -592318,7 +592882,7 @@ async function withStatsCacheLock(fn) {
|
|
|
592318
592882
|
}
|
|
592319
592883
|
}
|
|
592320
592884
|
function getStatsCachePath() {
|
|
592321
|
-
return
|
|
592885
|
+
return join189(getURConfigHomeDir(), STATS_CACHE_FILENAME);
|
|
592322
592886
|
}
|
|
592323
592887
|
function getEmptyCache() {
|
|
592324
592888
|
return {
|
|
@@ -592986,12 +593550,12 @@ var init_ansiToPng = __esm(() => {
|
|
|
592986
593550
|
// src/utils/screenshotClipboard.ts
|
|
592987
593551
|
import { mkdir as mkdir38, unlink as unlink20, writeFile as writeFile42 } from "fs/promises";
|
|
592988
593552
|
import { tmpdir as tmpdir9 } from "os";
|
|
592989
|
-
import { join as
|
|
593553
|
+
import { join as join190 } from "path";
|
|
592990
593554
|
async function copyAnsiToClipboard(ansiText, options2) {
|
|
592991
593555
|
try {
|
|
592992
|
-
const tempDir =
|
|
593556
|
+
const tempDir = join190(tmpdir9(), "ur-screenshots");
|
|
592993
593557
|
await mkdir38(tempDir, { recursive: true });
|
|
592994
|
-
const pngPath =
|
|
593558
|
+
const pngPath = join190(tempDir, `screenshot-${Date.now()}.png`);
|
|
592995
593559
|
const pngBuffer = ansiToPng(ansiText, options2);
|
|
592996
593560
|
await writeFile42(pngPath, pngBuffer);
|
|
592997
593561
|
const result = await copyPngToClipboard(pngPath);
|
|
@@ -593062,7 +593626,7 @@ var init_screenshotClipboard = __esm(() => {
|
|
|
593062
593626
|
|
|
593063
593627
|
// src/utils/stats.ts
|
|
593064
593628
|
import { open as open15 } from "fs/promises";
|
|
593065
|
-
import { basename as basename41, join as
|
|
593629
|
+
import { basename as basename41, join as join191, sep as sep33 } from "path";
|
|
593066
593630
|
async function processSessionFiles(sessionFiles, options2 = {}) {
|
|
593067
593631
|
const { fromDate, toDate } = options2;
|
|
593068
593632
|
const fs12 = getFsImplementation();
|
|
@@ -593240,17 +593804,17 @@ async function getAllSessionFiles() {
|
|
|
593240
593804
|
return [];
|
|
593241
593805
|
throw e;
|
|
593242
593806
|
}
|
|
593243
|
-
const projectDirs = allEntries.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
593807
|
+
const projectDirs = allEntries.filter((dirent) => dirent.isDirectory()).map((dirent) => join191(projectsDir, dirent.name));
|
|
593244
593808
|
const projectResults = await Promise.all(projectDirs.map(async (projectDir) => {
|
|
593245
593809
|
try {
|
|
593246
593810
|
const entries = await fs12.readdir(projectDir);
|
|
593247
|
-
const mainFiles = entries.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".jsonl")).map((dirent) =>
|
|
593811
|
+
const mainFiles = entries.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".jsonl")).map((dirent) => join191(projectDir, dirent.name));
|
|
593248
593812
|
const sessionDirs = entries.filter((dirent) => dirent.isDirectory());
|
|
593249
593813
|
const subagentResults = await Promise.all(sessionDirs.map(async (sessionDir) => {
|
|
593250
|
-
const subagentsDir =
|
|
593814
|
+
const subagentsDir = join191(projectDir, sessionDir.name, "subagents");
|
|
593251
593815
|
try {
|
|
593252
593816
|
const subagentEntries = await fs12.readdir(subagentsDir);
|
|
593253
|
-
return subagentEntries.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".jsonl") && dirent.name.startsWith("agent-")).map((dirent) =>
|
|
593817
|
+
return subagentEntries.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".jsonl") && dirent.name.startsWith("agent-")).map((dirent) => join191(subagentsDir, dirent.name));
|
|
593254
593818
|
} catch {
|
|
593255
593819
|
return [];
|
|
593256
593820
|
}
|
|
@@ -595248,7 +595812,7 @@ import {
|
|
|
595248
595812
|
writeFile as writeFile43
|
|
595249
595813
|
} from "fs/promises";
|
|
595250
595814
|
import { tmpdir as tmpdir10 } from "os";
|
|
595251
|
-
import { extname as extname18, join as
|
|
595815
|
+
import { extname as extname18, join as join192 } from "path";
|
|
595252
595816
|
function getAnalysisModel() {
|
|
595253
595817
|
return getDefaultmodelOModel();
|
|
595254
595818
|
}
|
|
@@ -595256,13 +595820,13 @@ function getInsightsModel() {
|
|
|
595256
595820
|
return getDefaultmodelOModel();
|
|
595257
595821
|
}
|
|
595258
595822
|
function getDataDir() {
|
|
595259
|
-
return
|
|
595823
|
+
return join192(getURConfigHomeDir(), "usage-data");
|
|
595260
595824
|
}
|
|
595261
595825
|
function getFacetsDir() {
|
|
595262
|
-
return
|
|
595826
|
+
return join192(getDataDir(), "facets");
|
|
595263
595827
|
}
|
|
595264
595828
|
function getSessionMetaDir() {
|
|
595265
|
-
return
|
|
595829
|
+
return join192(getDataDir(), "session-meta");
|
|
595266
595830
|
}
|
|
595267
595831
|
function getLanguageFromPath(filePath) {
|
|
595268
595832
|
const ext = extname18(filePath).toLowerCase();
|
|
@@ -595607,7 +596171,7 @@ async function formatTranscriptWithSummarization(log) {
|
|
|
595607
596171
|
`);
|
|
595608
596172
|
}
|
|
595609
596173
|
async function loadCachedFacets(sessionId) {
|
|
595610
|
-
const facetPath =
|
|
596174
|
+
const facetPath = join192(getFacetsDir(), `${sessionId}.json`);
|
|
595611
596175
|
try {
|
|
595612
596176
|
const content = await readFile49(facetPath, { encoding: "utf-8" });
|
|
595613
596177
|
const parsed = jsonParse(content);
|
|
@@ -595626,14 +596190,14 @@ async function saveFacets(facets) {
|
|
|
595626
596190
|
try {
|
|
595627
596191
|
await mkdir39(getFacetsDir(), { recursive: true });
|
|
595628
596192
|
} catch {}
|
|
595629
|
-
const facetPath =
|
|
596193
|
+
const facetPath = join192(getFacetsDir(), `${facets.session_id}.json`);
|
|
595630
596194
|
await writeFile43(facetPath, jsonStringify(facets, null, 2), {
|
|
595631
596195
|
encoding: "utf-8",
|
|
595632
596196
|
mode: 384
|
|
595633
596197
|
});
|
|
595634
596198
|
}
|
|
595635
596199
|
async function loadCachedSessionMeta(sessionId) {
|
|
595636
|
-
const metaPath2 =
|
|
596200
|
+
const metaPath2 = join192(getSessionMetaDir(), `${sessionId}.json`);
|
|
595637
596201
|
try {
|
|
595638
596202
|
const content = await readFile49(metaPath2, { encoding: "utf-8" });
|
|
595639
596203
|
return jsonParse(content);
|
|
@@ -595645,7 +596209,7 @@ async function saveSessionMeta(meta) {
|
|
|
595645
596209
|
try {
|
|
595646
596210
|
await mkdir39(getSessionMetaDir(), { recursive: true });
|
|
595647
596211
|
} catch {}
|
|
595648
|
-
const metaPath2 =
|
|
596212
|
+
const metaPath2 = join192(getSessionMetaDir(), `${meta.session_id}.json`);
|
|
595649
596213
|
await writeFile43(metaPath2, jsonStringify(meta, null, 2), {
|
|
595650
596214
|
encoding: "utf-8",
|
|
595651
596215
|
mode: 384
|
|
@@ -596702,7 +597266,7 @@ function generateHtmlReport(data, insights) {
|
|
|
596702
597266
|
</html>`;
|
|
596703
597267
|
}
|
|
596704
597268
|
function buildExportData(data, insights, facets, remoteStats) {
|
|
596705
|
-
const version3 = typeof MACRO !== "undefined" ? "1.22.
|
|
597269
|
+
const version3 = typeof MACRO !== "undefined" ? "1.22.7" : "unknown";
|
|
596706
597270
|
const remote_hosts_collected = remoteStats?.hosts.filter((h2) => h2.sessionCount > 0).map((h2) => h2.name);
|
|
596707
597271
|
const facets_summary = {
|
|
596708
597272
|
total: facets.size,
|
|
@@ -596753,7 +597317,7 @@ async function scanAllSessions() {
|
|
|
596753
597317
|
} catch {
|
|
596754
597318
|
return [];
|
|
596755
597319
|
}
|
|
596756
|
-
const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
597320
|
+
const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join192(projectsDir, dirent.name));
|
|
596757
597321
|
const allSessions = [];
|
|
596758
597322
|
for (let i3 = 0;i3 < projectDirs.length; i3++) {
|
|
596759
597323
|
const sessionFiles = await getSessionFilesWithMtime(projectDirs[i3]);
|
|
@@ -596775,7 +597339,7 @@ async function scanAllSessions() {
|
|
|
596775
597339
|
async function generateUsageReport(options2) {
|
|
596776
597340
|
let remoteStats;
|
|
596777
597341
|
if (process.env.USER_TYPE === "ant" && options2?.collectRemote) {
|
|
596778
|
-
const destDir =
|
|
597342
|
+
const destDir = join192(getURConfigHomeDir(), "projects");
|
|
596779
597343
|
const { hosts, totalCopied } = await collectAllRemoteHostData(destDir);
|
|
596780
597344
|
remoteStats = { hosts, totalCopied };
|
|
596781
597345
|
}
|
|
@@ -596914,7 +597478,7 @@ async function generateUsageReport(options2) {
|
|
|
596914
597478
|
try {
|
|
596915
597479
|
await mkdir39(getDataDir(), { recursive: true });
|
|
596916
597480
|
} catch {}
|
|
596917
|
-
const htmlPath =
|
|
597481
|
+
const htmlPath = join192(getDataDir(), "report.html");
|
|
596918
597482
|
await writeFile43(htmlPath, htmlReport, {
|
|
596919
597483
|
encoding: "utf-8",
|
|
596920
597484
|
mode: 384
|
|
@@ -597010,13 +597574,13 @@ var init_insights = __esm(() => {
|
|
|
597010
597574
|
} : async () => 0;
|
|
597011
597575
|
collectFromRemoteHost = process.env.USER_TYPE === "ant" ? async (homespace, destDir) => {
|
|
597012
597576
|
const result = { copied: 0, skipped: 0 };
|
|
597013
|
-
const tempDir = await mkdtemp(
|
|
597577
|
+
const tempDir = await mkdtemp(join192(tmpdir10(), "ur-hs-"));
|
|
597014
597578
|
try {
|
|
597015
597579
|
const scpResult = await execFileNoThrow("scp", ["-rq", `${homespace}.coder:/root/.ur/projects/`, tempDir], { timeout: 300000 });
|
|
597016
597580
|
if (scpResult.code !== 0) {
|
|
597017
597581
|
return result;
|
|
597018
597582
|
}
|
|
597019
|
-
const projectsDir =
|
|
597583
|
+
const projectsDir = join192(tempDir, "projects");
|
|
597020
597584
|
let projectDirents;
|
|
597021
597585
|
try {
|
|
597022
597586
|
projectDirents = await readdir28(projectsDir, { withFileTypes: true });
|
|
@@ -597025,11 +597589,11 @@ var init_insights = __esm(() => {
|
|
|
597025
597589
|
}
|
|
597026
597590
|
await Promise.all(projectDirents.map(async (dirent) => {
|
|
597027
597591
|
const projectName = dirent.name;
|
|
597028
|
-
const projectPath =
|
|
597592
|
+
const projectPath = join192(projectsDir, projectName);
|
|
597029
597593
|
if (!dirent.isDirectory())
|
|
597030
597594
|
return;
|
|
597031
597595
|
const destProjectName = `${projectName}__${homespace}`;
|
|
597032
|
-
const destProjectPath =
|
|
597596
|
+
const destProjectPath = join192(destDir, destProjectName);
|
|
597033
597597
|
try {
|
|
597034
597598
|
await mkdir39(destProjectPath, { recursive: true });
|
|
597035
597599
|
} catch {}
|
|
@@ -597043,8 +597607,8 @@ var init_insights = __esm(() => {
|
|
|
597043
597607
|
const fileName = fileDirent.name;
|
|
597044
597608
|
if (!fileName.endsWith(".jsonl"))
|
|
597045
597609
|
return;
|
|
597046
|
-
const srcFile =
|
|
597047
|
-
const destFile =
|
|
597610
|
+
const srcFile = join192(projectPath, fileName);
|
|
597611
|
+
const destFile = join192(destProjectPath, fileName);
|
|
597048
597612
|
try {
|
|
597049
597613
|
await copyFile9(srcFile, destFile, fsConstants6.COPYFILE_EXCL);
|
|
597050
597614
|
result.copied++;
|
|
@@ -598146,7 +598710,7 @@ import {
|
|
|
598146
598710
|
unlink as unlink22,
|
|
598147
598711
|
writeFile as writeFile44
|
|
598148
598712
|
} from "fs/promises";
|
|
598149
|
-
import { basename as basename42, dirname as dirname67, join as
|
|
598713
|
+
import { basename as basename42, dirname as dirname67, join as join193 } from "path";
|
|
598150
598714
|
function isTranscriptMessage(entry) {
|
|
598151
598715
|
const t = entry.type;
|
|
598152
598716
|
return t === "user" || t === "assistant" || t === "attachment" || t === "system";
|
|
@@ -598161,18 +598725,18 @@ function isEphemeralToolProgress(dataType) {
|
|
|
598161
598725
|
return typeof dataType === "string" && EPHEMERAL_PROGRESS_TYPES.has(dataType);
|
|
598162
598726
|
}
|
|
598163
598727
|
function getProjectsDir2() {
|
|
598164
|
-
return
|
|
598728
|
+
return join193(getURConfigHomeDir(), "projects");
|
|
598165
598729
|
}
|
|
598166
598730
|
function getTranscriptPath() {
|
|
598167
598731
|
const projectDir = getSessionProjectDir() ?? getProjectDir2(getOriginalCwd());
|
|
598168
|
-
return
|
|
598732
|
+
return join193(projectDir, `${getSessionId()}.jsonl`);
|
|
598169
598733
|
}
|
|
598170
598734
|
function getTranscriptPathForSession(sessionId) {
|
|
598171
598735
|
if (sessionId === getSessionId()) {
|
|
598172
598736
|
return getTranscriptPath();
|
|
598173
598737
|
}
|
|
598174
598738
|
const projectDir = getProjectDir2(getOriginalCwd());
|
|
598175
|
-
return
|
|
598739
|
+
return join193(projectDir, `${sessionId}.jsonl`);
|
|
598176
598740
|
}
|
|
598177
598741
|
function setAgentTranscriptSubdir(agentId, subdir) {
|
|
598178
598742
|
agentTranscriptSubdirs.set(agentId, subdir);
|
|
@@ -598184,8 +598748,8 @@ function getAgentTranscriptPath(agentId) {
|
|
|
598184
598748
|
const projectDir = getSessionProjectDir() ?? getProjectDir2(getOriginalCwd());
|
|
598185
598749
|
const sessionId = getSessionId();
|
|
598186
598750
|
const subdir = agentTranscriptSubdirs.get(agentId);
|
|
598187
|
-
const base2 = subdir ?
|
|
598188
|
-
return
|
|
598751
|
+
const base2 = subdir ? join193(projectDir, sessionId, "subagents", subdir) : join193(projectDir, sessionId, "subagents");
|
|
598752
|
+
return join193(base2, `agent-${agentId}.jsonl`);
|
|
598189
598753
|
}
|
|
598190
598754
|
function getAgentMetadataPath(agentId) {
|
|
598191
598755
|
return getAgentTranscriptPath(agentId).replace(/\.jsonl$/, ".meta.json");
|
|
@@ -598208,10 +598772,10 @@ async function readAgentMetadata(agentId) {
|
|
|
598208
598772
|
}
|
|
598209
598773
|
function getRemoteAgentsDir() {
|
|
598210
598774
|
const projectDir = getSessionProjectDir() ?? getProjectDir2(getOriginalCwd());
|
|
598211
|
-
return
|
|
598775
|
+
return join193(projectDir, getSessionId(), "remote-agents");
|
|
598212
598776
|
}
|
|
598213
598777
|
function getRemoteAgentMetadataPath(taskId) {
|
|
598214
|
-
return
|
|
598778
|
+
return join193(getRemoteAgentsDir(), `remote-agent-${taskId}.meta.json`);
|
|
598215
598779
|
}
|
|
598216
598780
|
async function writeRemoteAgentMetadata(taskId, metadata) {
|
|
598217
598781
|
const path22 = getRemoteAgentMetadataPath(taskId);
|
|
@@ -598254,7 +598818,7 @@ async function listRemoteAgentMetadata() {
|
|
|
598254
598818
|
if (!entry.isFile() || !entry.name.endsWith(".meta.json"))
|
|
598255
598819
|
continue;
|
|
598256
598820
|
try {
|
|
598257
|
-
const raw = await readFile50(
|
|
598821
|
+
const raw = await readFile50(join193(dir, entry.name), "utf-8");
|
|
598258
598822
|
results.push(JSON.parse(raw));
|
|
598259
598823
|
} catch (e) {
|
|
598260
598824
|
logForDebugging(`listRemoteAgentMetadata: skipping ${entry.name}: ${String(e)}`);
|
|
@@ -598264,7 +598828,7 @@ async function listRemoteAgentMetadata() {
|
|
|
598264
598828
|
}
|
|
598265
598829
|
function sessionIdExists(sessionId) {
|
|
598266
598830
|
const projectDir = getProjectDir2(getOriginalCwd());
|
|
598267
|
-
const sessionFile =
|
|
598831
|
+
const sessionFile = join193(projectDir, `${sessionId}.jsonl`);
|
|
598268
598832
|
const fs12 = getFsImplementation();
|
|
598269
598833
|
try {
|
|
598270
598834
|
fs12.statSync(sessionFile);
|
|
@@ -600238,7 +600802,7 @@ async function loadTranscriptFile(filePath, opts) {
|
|
|
600238
600802
|
};
|
|
600239
600803
|
}
|
|
600240
600804
|
async function loadSessionFile(sessionId) {
|
|
600241
|
-
const sessionFile =
|
|
600805
|
+
const sessionFile = join193(getSessionProjectDir() ?? getProjectDir2(getOriginalCwd()), `${sessionId}.jsonl`);
|
|
600242
600806
|
return loadTranscriptFile(sessionFile);
|
|
600243
600807
|
}
|
|
600244
600808
|
function clearSessionMessagesCache() {
|
|
@@ -600306,7 +600870,7 @@ async function loadAllProjectsMessageLogsFull(limit) {
|
|
|
600306
600870
|
} catch {
|
|
600307
600871
|
return [];
|
|
600308
600872
|
}
|
|
600309
|
-
const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
600873
|
+
const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join193(projectsDir, dirent.name));
|
|
600310
600874
|
const logsPerProject = await Promise.all(projectDirs.map((projectDir) => getLogsWithoutIndex(projectDir, limit)));
|
|
600311
600875
|
const allLogs = logsPerProject.flat();
|
|
600312
600876
|
const deduped = new Map;
|
|
@@ -600331,7 +600895,7 @@ async function loadAllProjectsMessageLogsProgressive(limit, initialEnrichCount =
|
|
|
600331
600895
|
} catch {
|
|
600332
600896
|
return { logs: [], allStatLogs: [], nextIndex: 0 };
|
|
600333
600897
|
}
|
|
600334
|
-
const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
600898
|
+
const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join193(projectsDir, dirent.name));
|
|
600335
600899
|
const rawLogs = [];
|
|
600336
600900
|
for (const projectDir of projectDirs) {
|
|
600337
600901
|
rawLogs.push(...await getSessionFilesLite(projectDir, limit));
|
|
@@ -600392,7 +600956,7 @@ async function getStatOnlyLogsForWorktrees(worktreePaths, limit) {
|
|
|
600392
600956
|
for (const { path: wtPath, prefix } of indexed) {
|
|
600393
600957
|
if (dirName === prefix || dirName.startsWith(prefix + "-")) {
|
|
600394
600958
|
seenDirs.add(dirName);
|
|
600395
|
-
allLogs.push(...await getSessionFilesLite(
|
|
600959
|
+
allLogs.push(...await getSessionFilesLite(join193(projectsDir, dirent.name), undefined, wtPath));
|
|
600396
600960
|
break;
|
|
600397
600961
|
}
|
|
600398
600962
|
}
|
|
@@ -600461,7 +601025,7 @@ async function loadSubagentTranscripts(agentIds) {
|
|
|
600461
601025
|
return transcripts;
|
|
600462
601026
|
}
|
|
600463
601027
|
async function loadAllSubagentTranscriptsFromDisk() {
|
|
600464
|
-
const subagentsDir =
|
|
601028
|
+
const subagentsDir = join193(getSessionProjectDir() ?? getProjectDir2(getOriginalCwd()), getSessionId(), "subagents");
|
|
600465
601029
|
let entries;
|
|
600466
601030
|
try {
|
|
600467
601031
|
entries = await readdir29(subagentsDir, { withFileTypes: true });
|
|
@@ -600589,7 +601153,7 @@ async function getSessionFilesWithMtime(projectDir) {
|
|
|
600589
601153
|
const sessionId = validateUuid2(basename42(dirent.name, ".jsonl"));
|
|
600590
601154
|
if (!sessionId)
|
|
600591
601155
|
continue;
|
|
600592
|
-
candidates2.push({ sessionId, filePath:
|
|
601156
|
+
candidates2.push({ sessionId, filePath: join193(projectDir, dirent.name) });
|
|
600593
601157
|
}
|
|
600594
601158
|
await Promise.all(candidates2.map(async ({ sessionId, filePath }) => {
|
|
600595
601159
|
try {
|
|
@@ -600975,7 +601539,7 @@ var init_sessionStorage = __esm(() => {
|
|
|
600975
601539
|
init_settings2();
|
|
600976
601540
|
init_slowOperations();
|
|
600977
601541
|
init_uuid();
|
|
600978
|
-
VERSION5 = typeof MACRO !== "undefined" ? "1.22.
|
|
601542
|
+
VERSION5 = typeof MACRO !== "undefined" ? "1.22.7" : "unknown";
|
|
600979
601543
|
MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
|
|
600980
601544
|
SKIP_FIRST_PROMPT_PATTERN = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
|
|
600981
601545
|
EPHEMERAL_PROGRESS_TYPES = new Set([
|
|
@@ -600987,7 +601551,7 @@ var init_sessionStorage = __esm(() => {
|
|
|
600987
601551
|
MAX_TRANSCRIPT_READ_BYTES = 50 * 1024 * 1024;
|
|
600988
601552
|
agentTranscriptSubdirs = new Map;
|
|
600989
601553
|
getProjectDir2 = memoize_default((projectDir) => {
|
|
600990
|
-
return
|
|
601554
|
+
return join193(getProjectsDir2(), sanitizePath2(projectDir));
|
|
600991
601555
|
});
|
|
600992
601556
|
METADATA_TYPE_MARKERS = [
|
|
600993
601557
|
'"type":"summary"',
|
|
@@ -601225,41 +601789,41 @@ var init_memdir = __esm(() => {
|
|
|
601225
601789
|
});
|
|
601226
601790
|
|
|
601227
601791
|
// src/tools/AgentTool/agentMemory.ts
|
|
601228
|
-
import { join as
|
|
601792
|
+
import { join as join194, normalize as normalize14, sep as sep34 } from "path";
|
|
601229
601793
|
function sanitizeAgentTypeForPath(agentType) {
|
|
601230
601794
|
return agentType.replace(/:/g, "-");
|
|
601231
601795
|
}
|
|
601232
601796
|
function getLocalAgentMemoryDir(dirName) {
|
|
601233
601797
|
if (process.env.UR_CODE_REMOTE_MEMORY_DIR) {
|
|
601234
|
-
return
|
|
601798
|
+
return join194(process.env.UR_CODE_REMOTE_MEMORY_DIR, "projects", sanitizePath2(findCanonicalGitRoot(getProjectRoot()) ?? getProjectRoot()), "agent-memory-local", dirName) + sep34;
|
|
601235
601799
|
}
|
|
601236
|
-
return
|
|
601800
|
+
return join194(getCwd2(), ".ur", "agent-memory-local", dirName) + sep34;
|
|
601237
601801
|
}
|
|
601238
601802
|
function getAgentMemoryDir(agentType, scope) {
|
|
601239
601803
|
const dirName = sanitizeAgentTypeForPath(agentType);
|
|
601240
601804
|
switch (scope) {
|
|
601241
601805
|
case "project":
|
|
601242
|
-
return
|
|
601806
|
+
return join194(getCwd2(), ".ur", "agent-memory", dirName) + sep34;
|
|
601243
601807
|
case "local":
|
|
601244
601808
|
return getLocalAgentMemoryDir(dirName);
|
|
601245
601809
|
case "user":
|
|
601246
|
-
return
|
|
601810
|
+
return join194(getMemoryBaseDir(), "agent-memory", dirName) + sep34;
|
|
601247
601811
|
}
|
|
601248
601812
|
}
|
|
601249
601813
|
function isAgentMemoryPath(absolutePath) {
|
|
601250
601814
|
const normalizedPath = normalize14(absolutePath);
|
|
601251
601815
|
const memoryBase = getMemoryBaseDir();
|
|
601252
|
-
if (normalizedPath.startsWith(
|
|
601816
|
+
if (normalizedPath.startsWith(join194(memoryBase, "agent-memory") + sep34)) {
|
|
601253
601817
|
return true;
|
|
601254
601818
|
}
|
|
601255
|
-
if (normalizedPath.startsWith(
|
|
601819
|
+
if (normalizedPath.startsWith(join194(getCwd2(), ".ur", "agent-memory") + sep34)) {
|
|
601256
601820
|
return true;
|
|
601257
601821
|
}
|
|
601258
601822
|
if (process.env.UR_CODE_REMOTE_MEMORY_DIR) {
|
|
601259
|
-
if (normalizedPath.includes(sep34 + "agent-memory-local" + sep34) && normalizedPath.startsWith(
|
|
601823
|
+
if (normalizedPath.includes(sep34 + "agent-memory-local" + sep34) && normalizedPath.startsWith(join194(process.env.UR_CODE_REMOTE_MEMORY_DIR, "projects") + sep34)) {
|
|
601260
601824
|
return true;
|
|
601261
601825
|
}
|
|
601262
|
-
} else if (normalizedPath.startsWith(
|
|
601826
|
+
} else if (normalizedPath.startsWith(join194(getCwd2(), ".ur", "agent-memory-local") + sep34)) {
|
|
601263
601827
|
return true;
|
|
601264
601828
|
}
|
|
601265
601829
|
return false;
|
|
@@ -601267,7 +601831,7 @@ function isAgentMemoryPath(absolutePath) {
|
|
|
601267
601831
|
function getMemoryScopeDisplay(memory2) {
|
|
601268
601832
|
switch (memory2) {
|
|
601269
601833
|
case "user":
|
|
601270
|
-
return `User (${
|
|
601834
|
+
return `User (${join194(getMemoryBaseDir(), "agent-memory")}/)`;
|
|
601271
601835
|
case "project":
|
|
601272
601836
|
return "Project (.ur/agent-memory/)";
|
|
601273
601837
|
case "local":
|
|
@@ -601310,7 +601874,7 @@ var init_agentMemory = __esm(() => {
|
|
|
601310
601874
|
// src/utils/permissions/filesystem.ts
|
|
601311
601875
|
import { randomBytes as randomBytes18 } from "crypto";
|
|
601312
601876
|
import { homedir as homedir32, tmpdir as tmpdir11 } from "os";
|
|
601313
|
-
import { join as
|
|
601877
|
+
import { join as join195, normalize as normalize15, posix as posix10, sep as sep35 } from "path";
|
|
601314
601878
|
function normalizeCaseForComparison(path22) {
|
|
601315
601879
|
return path22.toLowerCase();
|
|
601316
601880
|
}
|
|
@@ -601319,11 +601883,11 @@ function getURSkillScope(filePath) {
|
|
|
601319
601883
|
const absolutePathLower = normalizeCaseForComparison(absolutePath);
|
|
601320
601884
|
const bases = [
|
|
601321
601885
|
{
|
|
601322
|
-
dir: expandPath(
|
|
601886
|
+
dir: expandPath(join195(getOriginalCwd(), ".ur", "skills")),
|
|
601323
601887
|
prefix: "/.ur/skills/"
|
|
601324
601888
|
},
|
|
601325
601889
|
{
|
|
601326
|
-
dir: expandPath(
|
|
601890
|
+
dir: expandPath(join195(homedir32(), ".ur", "skills")),
|
|
601327
601891
|
prefix: "~/.ur/skills/"
|
|
601328
601892
|
}
|
|
601329
601893
|
];
|
|
@@ -601378,21 +601942,21 @@ function isURConfigFilePath(filePath) {
|
|
|
601378
601942
|
if (isURSettingsPath(filePath)) {
|
|
601379
601943
|
return true;
|
|
601380
601944
|
}
|
|
601381
|
-
const commandsDir =
|
|
601382
|
-
const agentsDir =
|
|
601383
|
-
const skillsDir =
|
|
601945
|
+
const commandsDir = join195(getOriginalCwd(), ".ur", "commands");
|
|
601946
|
+
const agentsDir = join195(getOriginalCwd(), ".ur", "agents");
|
|
601947
|
+
const skillsDir = join195(getOriginalCwd(), ".ur", "skills");
|
|
601384
601948
|
return pathInWorkingPath(filePath, commandsDir) || pathInWorkingPath(filePath, agentsDir) || pathInWorkingPath(filePath, skillsDir);
|
|
601385
601949
|
}
|
|
601386
601950
|
function isSessionPlanFile(absolutePath) {
|
|
601387
|
-
const expectedPrefix =
|
|
601951
|
+
const expectedPrefix = join195(getPlansDirectory(), getPlanSlug());
|
|
601388
601952
|
const normalizedPath = normalize15(absolutePath);
|
|
601389
601953
|
return normalizedPath.startsWith(expectedPrefix) && normalizedPath.endsWith(".md");
|
|
601390
601954
|
}
|
|
601391
601955
|
function getSessionMemoryDir() {
|
|
601392
|
-
return
|
|
601956
|
+
return join195(getProjectDir2(getCwd2()), getSessionId(), "session-memory") + sep35;
|
|
601393
601957
|
}
|
|
601394
601958
|
function getSessionMemoryPath() {
|
|
601395
|
-
return
|
|
601959
|
+
return join195(getSessionMemoryDir(), "summary.md");
|
|
601396
601960
|
}
|
|
601397
601961
|
function isSessionMemoryPath(absolutePath) {
|
|
601398
601962
|
const normalizedPath = normalize15(absolutePath);
|
|
@@ -601414,10 +601978,10 @@ function getURTempDirName() {
|
|
|
601414
601978
|
return `ur-${uid}`;
|
|
601415
601979
|
}
|
|
601416
601980
|
function getProjectTempDir() {
|
|
601417
|
-
return
|
|
601981
|
+
return join195(getURTempDir(), sanitizePath2(getOriginalCwd())) + sep35;
|
|
601418
601982
|
}
|
|
601419
601983
|
function getScratchpadDir() {
|
|
601420
|
-
return
|
|
601984
|
+
return join195(getProjectTempDir(), getSessionId(), "scratchpad");
|
|
601421
601985
|
}
|
|
601422
601986
|
async function ensureScratchpadDir() {
|
|
601423
601987
|
if (!isScratchpadEnabled()) {
|
|
@@ -601995,7 +602559,7 @@ function checkEditableInternalPath(absolutePath, input) {
|
|
|
601995
602559
|
}
|
|
601996
602560
|
};
|
|
601997
602561
|
}
|
|
601998
|
-
if (normalizeCaseForComparison(normalizedPath) === normalizeCaseForComparison(
|
|
602562
|
+
if (normalizeCaseForComparison(normalizedPath) === normalizeCaseForComparison(join195(getOriginalCwd(), ".ur", "launch.json"))) {
|
|
601999
602563
|
return {
|
|
602000
602564
|
behavior: "allow",
|
|
602001
602565
|
updatedInput: input,
|
|
@@ -602092,7 +602656,7 @@ function checkReadableInternalPath(absolutePath, input) {
|
|
|
602092
602656
|
}
|
|
602093
602657
|
};
|
|
602094
602658
|
}
|
|
602095
|
-
const tasksDir =
|
|
602659
|
+
const tasksDir = join195(getURConfigHomeDir(), "tasks") + sep35;
|
|
602096
602660
|
if (normalizedPath === tasksDir.slice(0, -1) || normalizedPath.startsWith(tasksDir)) {
|
|
602097
602661
|
return {
|
|
602098
602662
|
behavior: "allow",
|
|
@@ -602103,7 +602667,7 @@ function checkReadableInternalPath(absolutePath, input) {
|
|
|
602103
602667
|
}
|
|
602104
602668
|
};
|
|
602105
602669
|
}
|
|
602106
|
-
const teamsReadDir =
|
|
602670
|
+
const teamsReadDir = join195(getURConfigHomeDir(), "teams") + sep35;
|
|
602107
602671
|
if (normalizedPath === teamsReadDir.slice(0, -1) || normalizedPath.startsWith(teamsReadDir)) {
|
|
602108
602672
|
return {
|
|
602109
602673
|
behavior: "allow",
|
|
@@ -602176,11 +602740,11 @@ var init_filesystem = __esm(() => {
|
|
|
602176
602740
|
try {
|
|
602177
602741
|
resolvedBaseTmpDir = fs12.realpathSync(baseTmpDir);
|
|
602178
602742
|
} catch {}
|
|
602179
|
-
return
|
|
602743
|
+
return join195(resolvedBaseTmpDir, getURTempDirName()) + sep35;
|
|
602180
602744
|
});
|
|
602181
602745
|
getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
|
|
602182
602746
|
const nonce = randomBytes18(16).toString("hex");
|
|
602183
|
-
return
|
|
602747
|
+
return join195(getURTempDir(), "bundled-skills", "1.22.7", nonce);
|
|
602184
602748
|
});
|
|
602185
602749
|
getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
|
|
602186
602750
|
});
|
|
@@ -602194,10 +602758,10 @@ import {
|
|
|
602194
602758
|
symlink as symlink4,
|
|
602195
602759
|
unlink as unlink23
|
|
602196
602760
|
} from "fs/promises";
|
|
602197
|
-
import { join as
|
|
602761
|
+
import { join as join196 } from "path";
|
|
602198
602762
|
function getTaskOutputDir() {
|
|
602199
602763
|
if (_taskOutputDir === undefined) {
|
|
602200
|
-
_taskOutputDir =
|
|
602764
|
+
_taskOutputDir = join196(getProjectTempDir(), getSessionId(), "tasks");
|
|
602201
602765
|
}
|
|
602202
602766
|
return _taskOutputDir;
|
|
602203
602767
|
}
|
|
@@ -602205,7 +602769,7 @@ async function ensureOutputDir() {
|
|
|
602205
602769
|
await mkdir41(getTaskOutputDir(), { recursive: true });
|
|
602206
602770
|
}
|
|
602207
602771
|
function getTaskOutputPath(taskId) {
|
|
602208
|
-
return
|
|
602772
|
+
return join196(getTaskOutputDir(), `${taskId}.output`);
|
|
602209
602773
|
}
|
|
602210
602774
|
function track(p2) {
|
|
602211
602775
|
_pendingOps.add(p2);
|
|
@@ -606731,7 +607295,7 @@ import {
|
|
|
606731
607295
|
symlink as symlink5,
|
|
606732
607296
|
utimes as utimes2
|
|
606733
607297
|
} from "fs/promises";
|
|
606734
|
-
import { basename as basename44, dirname as dirname68, join as
|
|
607298
|
+
import { basename as basename44, dirname as dirname68, join as join197 } from "path";
|
|
606735
607299
|
function validateWorktreeSlug(slug4) {
|
|
606736
607300
|
if (slug4.length > MAX_WORKTREE_SLUG_LENGTH) {
|
|
606737
607301
|
throw new Error(`Invalid worktree name: must be ${MAX_WORKTREE_SLUG_LENGTH} characters or fewer (got ${slug4.length})`);
|
|
@@ -606754,8 +607318,8 @@ async function symlinkDirectories(repoRootPath, worktreePath, dirsToSymlink) {
|
|
|
606754
607318
|
logForDebugging(`Skipping symlink for "${dir}": path traversal detected`, { level: "warn" });
|
|
606755
607319
|
continue;
|
|
606756
607320
|
}
|
|
606757
|
-
const sourcePath =
|
|
606758
|
-
const destPath =
|
|
607321
|
+
const sourcePath = join197(repoRootPath, dir);
|
|
607322
|
+
const destPath = join197(worktreePath, dir);
|
|
606759
607323
|
try {
|
|
606760
607324
|
await symlink5(sourcePath, destPath, "dir");
|
|
606761
607325
|
logForDebugging(`Symlinked ${dir} from main repository to worktree to avoid disk bloat`);
|
|
@@ -606779,7 +607343,7 @@ function generateTmuxSessionName(repoPath, branch2) {
|
|
|
606779
607343
|
return combined.replace(/[/.]/g, "_");
|
|
606780
607344
|
}
|
|
606781
607345
|
function worktreesDir2(repoRoot) {
|
|
606782
|
-
return
|
|
607346
|
+
return join197(repoRoot, ".ur", "worktrees");
|
|
606783
607347
|
}
|
|
606784
607348
|
function flattenSlug(slug4) {
|
|
606785
607349
|
return slug4.replaceAll("/", "+");
|
|
@@ -606788,7 +607352,7 @@ function worktreeBranchName(slug4) {
|
|
|
606788
607352
|
return `worktree-${flattenSlug(slug4)}`;
|
|
606789
607353
|
}
|
|
606790
607354
|
function worktreePathFor(repoRoot, slug4) {
|
|
606791
|
-
return
|
|
607355
|
+
return join197(worktreesDir2(repoRoot), flattenSlug(slug4));
|
|
606792
607356
|
}
|
|
606793
607357
|
async function getOrCreateWorktree(repoRoot, slug4, options2) {
|
|
606794
607358
|
const worktreePath = worktreePathFor(repoRoot, slug4);
|
|
@@ -606869,7 +607433,7 @@ async function getOrCreateWorktree(repoRoot, slug4, options2) {
|
|
|
606869
607433
|
async function copyWorktreeIncludeFiles(repoRoot, worktreePath) {
|
|
606870
607434
|
let includeContent;
|
|
606871
607435
|
try {
|
|
606872
|
-
includeContent = await readFile51(
|
|
607436
|
+
includeContent = await readFile51(join197(repoRoot, ".worktreeinclude"), "utf-8");
|
|
606873
607437
|
} catch {
|
|
606874
607438
|
return [];
|
|
606875
607439
|
}
|
|
@@ -606924,8 +607488,8 @@ async function copyWorktreeIncludeFiles(repoRoot, worktreePath) {
|
|
|
606924
607488
|
}
|
|
606925
607489
|
const copied = [];
|
|
606926
607490
|
for (const relativePath3 of files2) {
|
|
606927
|
-
const srcPath =
|
|
606928
|
-
const destPath =
|
|
607491
|
+
const srcPath = join197(repoRoot, relativePath3);
|
|
607492
|
+
const destPath = join197(worktreePath, relativePath3);
|
|
606929
607493
|
try {
|
|
606930
607494
|
await mkdir42(dirname68(destPath), { recursive: true });
|
|
606931
607495
|
await copyFile10(srcPath, destPath);
|
|
@@ -606941,9 +607505,9 @@ async function copyWorktreeIncludeFiles(repoRoot, worktreePath) {
|
|
|
606941
607505
|
}
|
|
606942
607506
|
async function performPostCreationSetup(repoRoot, worktreePath) {
|
|
606943
607507
|
const localSettingsRelativePath = getRelativeSettingsFilePathForSource("localSettings");
|
|
606944
|
-
const sourceSettingsLocal =
|
|
607508
|
+
const sourceSettingsLocal = join197(repoRoot, localSettingsRelativePath);
|
|
606945
607509
|
try {
|
|
606946
|
-
const destSettingsLocal =
|
|
607510
|
+
const destSettingsLocal = join197(worktreePath, localSettingsRelativePath);
|
|
606947
607511
|
await mkdirRecursive(dirname68(destSettingsLocal));
|
|
606948
607512
|
await copyFile10(sourceSettingsLocal, destSettingsLocal);
|
|
606949
607513
|
logForDebugging(`Copied settings.local.json to worktree: ${destSettingsLocal}`);
|
|
@@ -606953,8 +607517,8 @@ async function performPostCreationSetup(repoRoot, worktreePath) {
|
|
|
606953
607517
|
logForDebugging(`Failed to copy settings.local.json: ${e.message}`, { level: "warn" });
|
|
606954
607518
|
}
|
|
606955
607519
|
}
|
|
606956
|
-
const huskyPath =
|
|
606957
|
-
const gitHooksPath =
|
|
607520
|
+
const huskyPath = join197(repoRoot, ".husky");
|
|
607521
|
+
const gitHooksPath = join197(repoRoot, ".git", "hooks");
|
|
606958
607522
|
let hooksPath = null;
|
|
606959
607523
|
for (const candidatePath of [huskyPath, gitHooksPath]) {
|
|
606960
607524
|
try {
|
|
@@ -607229,7 +607793,7 @@ async function cleanupStaleAgentWorktrees(cutoffDate) {
|
|
|
607229
607793
|
if (!EPHEMERAL_WORKTREE_PATTERNS.some((p2) => p2.test(slug4))) {
|
|
607230
607794
|
continue;
|
|
607231
607795
|
}
|
|
607232
|
-
const worktreePath =
|
|
607796
|
+
const worktreePath = join197(dir, slug4);
|
|
607233
607797
|
if (currentPath === worktreePath) {
|
|
607234
607798
|
continue;
|
|
607235
607799
|
}
|
|
@@ -608470,7 +609034,7 @@ function computeFingerprint(messageText, version3) {
|
|
|
608470
609034
|
}
|
|
608471
609035
|
function computeFingerprintFromMessages(messages) {
|
|
608472
609036
|
const firstMessageText = extractFirstMessageText(messages);
|
|
608473
|
-
return computeFingerprint(firstMessageText, "1.22.
|
|
609037
|
+
return computeFingerprint(firstMessageText, "1.22.7");
|
|
608474
609038
|
}
|
|
608475
609039
|
var FINGERPRINT_SALT = "59cf53e54c78";
|
|
608476
609040
|
var init_fingerprint = () => {};
|
|
@@ -610336,7 +610900,7 @@ async function sideQuery(opts) {
|
|
|
610336
610900
|
betas.push(STRUCTURED_OUTPUTS_BETA_HEADER);
|
|
610337
610901
|
}
|
|
610338
610902
|
const messageText = extractFirstUserMessageText(messages);
|
|
610339
|
-
const fingerprint = computeFingerprint(messageText, "1.22.
|
|
610903
|
+
const fingerprint = computeFingerprint(messageText, "1.22.7");
|
|
610340
610904
|
const attributionHeader = getAttributionHeader(fingerprint);
|
|
610341
610905
|
const systemBlocks = [
|
|
610342
610906
|
attributionHeader ? { type: "text", text: attributionHeader } : null,
|
|
@@ -610622,7 +611186,7 @@ import {
|
|
|
610622
611186
|
} from "fs/promises";
|
|
610623
611187
|
import { createServer as createServer5 } from "net";
|
|
610624
611188
|
import { homedir as homedir33, platform as platform6 } from "os";
|
|
610625
|
-
import { join as
|
|
611189
|
+
import { join as join198 } from "path";
|
|
610626
611190
|
function log(message, ...args) {
|
|
610627
611191
|
if (LOG_FILE) {
|
|
610628
611192
|
const timestamp2 = new Date().toISOString();
|
|
@@ -610689,7 +611253,7 @@ class ChromeNativeHost {
|
|
|
610689
611253
|
try {
|
|
610690
611254
|
process.kill(pid, 0);
|
|
610691
611255
|
} catch {
|
|
610692
|
-
await unlink24(
|
|
611256
|
+
await unlink24(join198(socketDir, file4)).catch(() => {});
|
|
610693
611257
|
log(`Removed stale socket for PID ${pid}`);
|
|
610694
611258
|
}
|
|
610695
611259
|
}
|
|
@@ -610960,7 +611524,7 @@ var init_chromeNativeHost = __esm(() => {
|
|
|
610960
611524
|
init_slowOperations();
|
|
610961
611525
|
init_common2();
|
|
610962
611526
|
MAX_MESSAGE_SIZE = 1024 * 1024;
|
|
610963
|
-
LOG_FILE = process.env.USER_TYPE === "ant" ?
|
|
611527
|
+
LOG_FILE = process.env.USER_TYPE === "ant" ? join198(homedir33(), ".ur", "debug", "chrome-native-host.txt") : undefined;
|
|
610964
611528
|
messageSchema = lazySchema(() => exports_external2.object({
|
|
610965
611529
|
type: exports_external2.string()
|
|
610966
611530
|
}).passthrough());
|
|
@@ -613470,7 +614034,7 @@ __export(exports_upstreamproxy, {
|
|
|
613470
614034
|
});
|
|
613471
614035
|
import { mkdir as mkdir44, readFile as readFile52, unlink as unlink25, writeFile as writeFile45 } from "fs/promises";
|
|
613472
614036
|
import { homedir as homedir34 } from "os";
|
|
613473
|
-
import { join as
|
|
614037
|
+
import { join as join199 } from "path";
|
|
613474
614038
|
async function initUpstreamProxy(opts) {
|
|
613475
614039
|
if (!isEnvTruthy(process.env.UR_CODE_REMOTE)) {
|
|
613476
614040
|
return state;
|
|
@@ -613491,7 +614055,7 @@ async function initUpstreamProxy(opts) {
|
|
|
613491
614055
|
}
|
|
613492
614056
|
setNonDumpable();
|
|
613493
614057
|
const baseUrl = opts?.ccrBaseUrl ?? "";
|
|
613494
|
-
const caBundlePath = opts?.caBundlePath ??
|
|
614058
|
+
const caBundlePath = opts?.caBundlePath ?? join199(homedir34(), ".ccr", "ca-bundle.crt");
|
|
613495
614059
|
const caOk = await downloadCaBundle(baseUrl, opts?.systemCaPath ?? SYSTEM_CA_BUNDLE, caBundlePath);
|
|
613496
614060
|
if (!caOk)
|
|
613497
614061
|
return state;
|
|
@@ -613591,7 +614155,7 @@ async function downloadCaBundle(baseUrl, systemCaPath, outPath) {
|
|
|
613591
614155
|
}
|
|
613592
614156
|
const ccrCa = await resp.text();
|
|
613593
614157
|
const systemCa = await readFile52(systemCaPath, "utf8").catch(() => "");
|
|
613594
|
-
await mkdir44(
|
|
614158
|
+
await mkdir44(join199(outPath, ".."), { recursive: true });
|
|
613595
614159
|
await writeFile45(outPath, systemCa + `
|
|
613596
614160
|
` + ccrCa, "utf8");
|
|
613597
614161
|
return true;
|
|
@@ -615073,7 +615637,7 @@ function buildSystemInitMessage(inputs) {
|
|
|
615073
615637
|
slash_commands: inputs.commands.filter((c4) => c4.userInvocable !== false).map((c4) => c4.name),
|
|
615074
615638
|
apiKeySource: getURHQApiKeyWithSource().source,
|
|
615075
615639
|
betas: getSdkBetas(),
|
|
615076
|
-
ur_version: "1.22.
|
|
615640
|
+
ur_version: "1.22.7",
|
|
615077
615641
|
output_style: outputStyle2,
|
|
615078
615642
|
agents: inputs.agents.map((agent) => agent.agentType),
|
|
615079
615643
|
skills: inputs.skills.filter((s) => s.userInvocable !== false).map((skill2) => skill2.name),
|
|
@@ -621453,7 +622017,7 @@ var init_ShowInIDEPrompt = __esm(() => {
|
|
|
621453
622017
|
|
|
621454
622018
|
// src/components/permissions/FilePermissionDialog/permissionOptions.tsx
|
|
621455
622019
|
import { homedir as homedir35 } from "os";
|
|
621456
|
-
import { basename as basename48, join as
|
|
622020
|
+
import { basename as basename48, join as join200, sep as sep36 } from "path";
|
|
621457
622021
|
function isInURFolder(filePath) {
|
|
621458
622022
|
const absolutePath = expandPath(filePath);
|
|
621459
622023
|
const urFolderPath = expandPath(`${getOriginalCwd()}/.ur`);
|
|
@@ -621463,7 +622027,7 @@ function isInURFolder(filePath) {
|
|
|
621463
622027
|
}
|
|
621464
622028
|
function isInGlobalURFolder(filePath) {
|
|
621465
622029
|
const absolutePath = expandPath(filePath);
|
|
621466
|
-
const globalURFolderPath =
|
|
622030
|
+
const globalURFolderPath = join200(homedir35(), ".ur");
|
|
621467
622031
|
const normalizedAbsolutePath = normalizeCaseForComparison(absolutePath);
|
|
621468
622032
|
const normalizedGlobalURFolderPath = normalizeCaseForComparison(globalURFolderPath);
|
|
621469
622033
|
return normalizedAbsolutePath.startsWith(normalizedGlobalURFolderPath + sep36.toLowerCase()) || normalizedAbsolutePath.startsWith(normalizedGlobalURFolderPath + "/");
|
|
@@ -629701,7 +630265,7 @@ var init_useVoiceEnabled = __esm(() => {
|
|
|
629701
630265
|
function getSemverPart(version3) {
|
|
629702
630266
|
return `${import_semver13.major(version3, { loose: true })}.${import_semver13.minor(version3, { loose: true })}.${import_semver13.patch(version3, { loose: true })}`;
|
|
629703
630267
|
}
|
|
629704
|
-
function useUpdateNotification(updatedVersion, initialVersion = "1.22.
|
|
630268
|
+
function useUpdateNotification(updatedVersion, initialVersion = "1.22.7") {
|
|
629705
630269
|
const [lastNotifiedSemver, setLastNotifiedSemver] = import_react224.useState(() => getSemverPart(initialVersion));
|
|
629706
630270
|
if (!updatedVersion) {
|
|
629707
630271
|
return null;
|
|
@@ -629750,7 +630314,7 @@ function AutoUpdater({
|
|
|
629750
630314
|
return;
|
|
629751
630315
|
}
|
|
629752
630316
|
if (false) {}
|
|
629753
|
-
const currentVersion = "1.22.
|
|
630317
|
+
const currentVersion = "1.22.7";
|
|
629754
630318
|
const channel = getInitialSettings()?.autoUpdatesChannel ?? "latest";
|
|
629755
630319
|
let latestVersion = await getLatestVersion(channel);
|
|
629756
630320
|
const isDisabled = isAutoUpdaterDisabled();
|
|
@@ -629979,12 +630543,12 @@ function NativeAutoUpdater({
|
|
|
629979
630543
|
logEvent("tengu_native_auto_updater_start", {});
|
|
629980
630544
|
try {
|
|
629981
630545
|
const maxVersion = await getMaxVersion();
|
|
629982
|
-
if (maxVersion && gt("1.22.
|
|
630546
|
+
if (maxVersion && gt("1.22.7", maxVersion)) {
|
|
629983
630547
|
const msg = await getMaxVersionMessage();
|
|
629984
630548
|
setMaxVersionIssue(msg ?? "affects your version");
|
|
629985
630549
|
}
|
|
629986
630550
|
const result = await installLatest(channel);
|
|
629987
|
-
const currentVersion = "1.22.
|
|
630551
|
+
const currentVersion = "1.22.7";
|
|
629988
630552
|
const latencyMs = Date.now() - startTime;
|
|
629989
630553
|
if (result.lockFailed) {
|
|
629990
630554
|
logEvent("tengu_native_auto_updater_lock_contention", {
|
|
@@ -630121,17 +630685,17 @@ function PackageManagerAutoUpdater(t0) {
|
|
|
630121
630685
|
const maxVersion = await getMaxVersion();
|
|
630122
630686
|
if (maxVersion && latest && gt(latest, maxVersion)) {
|
|
630123
630687
|
logForDebugging(`PackageManagerAutoUpdater: maxVersion ${maxVersion} is set, capping update from ${latest} to ${maxVersion}`);
|
|
630124
|
-
if (gte("1.22.
|
|
630125
|
-
logForDebugging(`PackageManagerAutoUpdater: current version ${"1.22.
|
|
630688
|
+
if (gte("1.22.7", maxVersion)) {
|
|
630689
|
+
logForDebugging(`PackageManagerAutoUpdater: current version ${"1.22.7"} is already at or above maxVersion ${maxVersion}, skipping update`);
|
|
630126
630690
|
setUpdateAvailable(false);
|
|
630127
630691
|
return;
|
|
630128
630692
|
}
|
|
630129
630693
|
latest = maxVersion;
|
|
630130
630694
|
}
|
|
630131
|
-
const hasUpdate = latest && !gte("1.22.
|
|
630695
|
+
const hasUpdate = latest && !gte("1.22.7", latest) && !shouldSkipVersion(latest);
|
|
630132
630696
|
setUpdateAvailable(!!hasUpdate);
|
|
630133
630697
|
if (hasUpdate) {
|
|
630134
|
-
logForDebugging(`PackageManagerAutoUpdater: Update available ${"1.22.
|
|
630698
|
+
logForDebugging(`PackageManagerAutoUpdater: Update available ${"1.22.7"} -> ${latest}`);
|
|
630135
630699
|
}
|
|
630136
630700
|
};
|
|
630137
630701
|
$3[0] = t1;
|
|
@@ -630165,7 +630729,7 @@ function PackageManagerAutoUpdater(t0) {
|
|
|
630165
630729
|
wrap: "truncate",
|
|
630166
630730
|
children: [
|
|
630167
630731
|
"currentVersion: ",
|
|
630168
|
-
"1.22.
|
|
630732
|
+
"1.22.7"
|
|
630169
630733
|
]
|
|
630170
630734
|
}, undefined, true, undefined, this);
|
|
630171
630735
|
$3[3] = verbose;
|
|
@@ -642527,7 +643091,7 @@ function buildStatusLineCommandInput(permissionMode, exceeds200kTokens, settings
|
|
|
642527
643091
|
project_dir: getOriginalCwd(),
|
|
642528
643092
|
added_dirs: addedDirs
|
|
642529
643093
|
},
|
|
642530
|
-
version: "1.22.
|
|
643094
|
+
version: "1.22.7",
|
|
642531
643095
|
output_style: {
|
|
642532
643096
|
name: outputStyleName
|
|
642533
643097
|
},
|
|
@@ -648635,9 +649199,9 @@ function initSkillImprovement() {
|
|
|
648635
649199
|
async function applySkillImprovement(skillName, updates) {
|
|
648636
649200
|
if (!skillName)
|
|
648637
649201
|
return;
|
|
648638
|
-
const { join:
|
|
649202
|
+
const { join: join201 } = await import("path");
|
|
648639
649203
|
const fs12 = await import("fs/promises");
|
|
648640
|
-
const filePath =
|
|
649204
|
+
const filePath = join201(getCwd2(), ".ur", "skills", skillName, "SKILL.md");
|
|
648641
649205
|
let currentContent;
|
|
648642
649206
|
try {
|
|
648643
649207
|
currentContent = await fs12.readFile(filePath, "utf-8");
|
|
@@ -648791,7 +649355,7 @@ function useMoreRight(_args) {
|
|
|
648791
649355
|
// src/utils/cleanup.ts
|
|
648792
649356
|
import * as fs12 from "fs/promises";
|
|
648793
649357
|
import { homedir as homedir36 } from "os";
|
|
648794
|
-
import { join as
|
|
649358
|
+
import { join as join201 } from "path";
|
|
648795
649359
|
function getCutoffDate() {
|
|
648796
649360
|
const settings = getSettings_DEPRECATED() || {};
|
|
648797
649361
|
const cleanupPeriodDays = settings.cleanupPeriodDays ?? DEFAULT_CLEANUP_PERIOD_DAYS;
|
|
@@ -648816,7 +649380,7 @@ async function cleanupOldFilesInDirectory(dirPath, cutoffDate, isMessagePath) {
|
|
|
648816
649380
|
try {
|
|
648817
649381
|
const timestamp2 = convertFileNameToDate(file4.name);
|
|
648818
649382
|
if (timestamp2 < cutoffDate) {
|
|
648819
|
-
await getFsImplementation().unlink(
|
|
649383
|
+
await getFsImplementation().unlink(join201(dirPath, file4.name));
|
|
648820
649384
|
if (isMessagePath) {
|
|
648821
649385
|
result.messages++;
|
|
648822
649386
|
} else {
|
|
@@ -648847,7 +649411,7 @@ async function cleanupOldMessageFiles() {
|
|
|
648847
649411
|
} catch {
|
|
648848
649412
|
return result;
|
|
648849
649413
|
}
|
|
648850
|
-
const mcpLogDirs = dirents.filter((dirent) => dirent.isDirectory() && dirent.name.startsWith("mcp-logs-")).map((dirent) =>
|
|
649414
|
+
const mcpLogDirs = dirents.filter((dirent) => dirent.isDirectory() && dirent.name.startsWith("mcp-logs-")).map((dirent) => join201(baseCachePath, dirent.name));
|
|
648851
649415
|
for (const mcpLogDir of mcpLogDirs) {
|
|
648852
649416
|
result = addCleanupResults(result, await cleanupOldFilesInDirectory(mcpLogDir, cutoffDate, true));
|
|
648853
649417
|
await tryRmdir(mcpLogDir, fsImpl);
|
|
@@ -648886,7 +649450,7 @@ async function cleanupOldSessionFiles() {
|
|
|
648886
649450
|
for (const projectDirent of projectDirents) {
|
|
648887
649451
|
if (!projectDirent.isDirectory())
|
|
648888
649452
|
continue;
|
|
648889
|
-
const projectDir =
|
|
649453
|
+
const projectDir = join201(projectsDir, projectDirent.name);
|
|
648890
649454
|
let entries;
|
|
648891
649455
|
try {
|
|
648892
649456
|
entries = await fsImpl.readdir(projectDir);
|
|
@@ -648900,15 +649464,15 @@ async function cleanupOldSessionFiles() {
|
|
|
648900
649464
|
continue;
|
|
648901
649465
|
}
|
|
648902
649466
|
try {
|
|
648903
|
-
if (await unlinkIfOld(
|
|
649467
|
+
if (await unlinkIfOld(join201(projectDir, entry.name), cutoffDate, fsImpl)) {
|
|
648904
649468
|
result.messages++;
|
|
648905
649469
|
}
|
|
648906
649470
|
} catch {
|
|
648907
649471
|
result.errors++;
|
|
648908
649472
|
}
|
|
648909
649473
|
} else if (entry.isDirectory()) {
|
|
648910
|
-
const sessionDir =
|
|
648911
|
-
const toolResultsDir =
|
|
649474
|
+
const sessionDir = join201(projectDir, entry.name);
|
|
649475
|
+
const toolResultsDir = join201(sessionDir, TOOL_RESULTS_SUBDIR);
|
|
648912
649476
|
let toolDirs;
|
|
648913
649477
|
try {
|
|
648914
649478
|
toolDirs = await fsImpl.readdir(toolResultsDir);
|
|
@@ -648919,14 +649483,14 @@ async function cleanupOldSessionFiles() {
|
|
|
648919
649483
|
for (const toolEntry of toolDirs) {
|
|
648920
649484
|
if (toolEntry.isFile()) {
|
|
648921
649485
|
try {
|
|
648922
|
-
if (await unlinkIfOld(
|
|
649486
|
+
if (await unlinkIfOld(join201(toolResultsDir, toolEntry.name), cutoffDate, fsImpl)) {
|
|
648923
649487
|
result.messages++;
|
|
648924
649488
|
}
|
|
648925
649489
|
} catch {
|
|
648926
649490
|
result.errors++;
|
|
648927
649491
|
}
|
|
648928
649492
|
} else if (toolEntry.isDirectory()) {
|
|
648929
|
-
const toolDirPath =
|
|
649493
|
+
const toolDirPath = join201(toolResultsDir, toolEntry.name);
|
|
648930
649494
|
let toolFiles;
|
|
648931
649495
|
try {
|
|
648932
649496
|
toolFiles = await fsImpl.readdir(toolDirPath);
|
|
@@ -648937,7 +649501,7 @@ async function cleanupOldSessionFiles() {
|
|
|
648937
649501
|
if (!tf.isFile())
|
|
648938
649502
|
continue;
|
|
648939
649503
|
try {
|
|
648940
|
-
if (await unlinkIfOld(
|
|
649504
|
+
if (await unlinkIfOld(join201(toolDirPath, tf.name), cutoffDate, fsImpl)) {
|
|
648941
649505
|
result.messages++;
|
|
648942
649506
|
}
|
|
648943
649507
|
} catch {
|
|
@@ -648969,7 +649533,7 @@ async function cleanupSingleDirectory(dirPath, extension, removeEmptyDir = true)
|
|
|
648969
649533
|
if (!dirent.isFile() || !dirent.name.endsWith(extension))
|
|
648970
649534
|
continue;
|
|
648971
649535
|
try {
|
|
648972
|
-
if (await unlinkIfOld(
|
|
649536
|
+
if (await unlinkIfOld(join201(dirPath, dirent.name), cutoffDate, fsImpl)) {
|
|
648973
649537
|
result.messages++;
|
|
648974
649538
|
}
|
|
648975
649539
|
} catch {
|
|
@@ -648982,7 +649546,7 @@ async function cleanupSingleDirectory(dirPath, extension, removeEmptyDir = true)
|
|
|
648982
649546
|
return result;
|
|
648983
649547
|
}
|
|
648984
649548
|
function cleanupOldPlanFiles() {
|
|
648985
|
-
const plansDir =
|
|
649549
|
+
const plansDir = join201(getURConfigHomeDir(), "plans");
|
|
648986
649550
|
return cleanupSingleDirectory(plansDir, ".md");
|
|
648987
649551
|
}
|
|
648988
649552
|
async function cleanupOldFileHistoryBackups() {
|
|
@@ -648991,14 +649555,14 @@ async function cleanupOldFileHistoryBackups() {
|
|
|
648991
649555
|
const fsImpl = getFsImplementation();
|
|
648992
649556
|
try {
|
|
648993
649557
|
const configDir = getURConfigHomeDir();
|
|
648994
|
-
const fileHistoryStorageDir =
|
|
649558
|
+
const fileHistoryStorageDir = join201(configDir, "file-history");
|
|
648995
649559
|
let dirents;
|
|
648996
649560
|
try {
|
|
648997
649561
|
dirents = await fsImpl.readdir(fileHistoryStorageDir);
|
|
648998
649562
|
} catch {
|
|
648999
649563
|
return result;
|
|
649000
649564
|
}
|
|
649001
|
-
const fileHistorySessionsDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
649565
|
+
const fileHistorySessionsDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join201(fileHistoryStorageDir, dirent.name));
|
|
649002
649566
|
await Promise.all(fileHistorySessionsDirs.map(async (fileHistorySessionDir) => {
|
|
649003
649567
|
try {
|
|
649004
649568
|
const stats2 = await fsImpl.stat(fileHistorySessionDir);
|
|
@@ -649025,14 +649589,14 @@ async function cleanupOldSessionEnvDirs() {
|
|
|
649025
649589
|
const fsImpl = getFsImplementation();
|
|
649026
649590
|
try {
|
|
649027
649591
|
const configDir = getURConfigHomeDir();
|
|
649028
|
-
const sessionEnvBaseDir =
|
|
649592
|
+
const sessionEnvBaseDir = join201(configDir, "session-env");
|
|
649029
649593
|
let dirents;
|
|
649030
649594
|
try {
|
|
649031
649595
|
dirents = await fsImpl.readdir(sessionEnvBaseDir);
|
|
649032
649596
|
} catch {
|
|
649033
649597
|
return result;
|
|
649034
649598
|
}
|
|
649035
|
-
const sessionEnvDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
649599
|
+
const sessionEnvDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join201(sessionEnvBaseDir, dirent.name));
|
|
649036
649600
|
for (const sessionEnvDir of sessionEnvDirs) {
|
|
649037
649601
|
try {
|
|
649038
649602
|
const stats2 = await fsImpl.stat(sessionEnvDir);
|
|
@@ -649054,7 +649618,7 @@ async function cleanupOldDebugLogs() {
|
|
|
649054
649618
|
const cutoffDate = getCutoffDate();
|
|
649055
649619
|
const result = { messages: 0, errors: 0 };
|
|
649056
649620
|
const fsImpl = getFsImplementation();
|
|
649057
|
-
const debugDir =
|
|
649621
|
+
const debugDir = join201(getURConfigHomeDir(), "debug");
|
|
649058
649622
|
let dirents;
|
|
649059
649623
|
try {
|
|
649060
649624
|
dirents = await fsImpl.readdir(debugDir);
|
|
@@ -649066,7 +649630,7 @@ async function cleanupOldDebugLogs() {
|
|
|
649066
649630
|
continue;
|
|
649067
649631
|
}
|
|
649068
649632
|
try {
|
|
649069
|
-
if (await unlinkIfOld(
|
|
649633
|
+
if (await unlinkIfOld(join201(debugDir, dirent.name), cutoffDate, fsImpl)) {
|
|
649070
649634
|
result.messages++;
|
|
649071
649635
|
}
|
|
649072
649636
|
} catch {
|
|
@@ -649076,7 +649640,7 @@ async function cleanupOldDebugLogs() {
|
|
|
649076
649640
|
return result;
|
|
649077
649641
|
}
|
|
649078
649642
|
async function cleanupNpmCacheForURHQPackages() {
|
|
649079
|
-
const markerPath =
|
|
649643
|
+
const markerPath = join201(getURConfigHomeDir(), ".npm-cache-cleanup");
|
|
649080
649644
|
try {
|
|
649081
649645
|
const stat47 = await fs12.stat(markerPath);
|
|
649082
649646
|
if (Date.now() - stat47.mtimeMs < ONE_DAY_MS) {
|
|
@@ -649091,7 +649655,7 @@ async function cleanupNpmCacheForURHQPackages() {
|
|
|
649091
649655
|
return;
|
|
649092
649656
|
}
|
|
649093
649657
|
logForDebugging("npm cache cleanup: starting");
|
|
649094
|
-
const npmCachePath =
|
|
649658
|
+
const npmCachePath = join201(homedir36(), ".npm", "_cacache");
|
|
649095
649659
|
const NPM_CACHE_RETENTION_COUNT = 5;
|
|
649096
649660
|
const startTime = Date.now();
|
|
649097
649661
|
try {
|
|
@@ -649146,7 +649710,7 @@ async function cleanupNpmCacheForURHQPackages() {
|
|
|
649146
649710
|
}
|
|
649147
649711
|
}
|
|
649148
649712
|
async function cleanupOldVersionsThrottled() {
|
|
649149
|
-
const markerPath =
|
|
649713
|
+
const markerPath = join201(getURConfigHomeDir(), ".version-cleanup");
|
|
649150
649714
|
try {
|
|
649151
649715
|
const stat47 = await fs12.stat(markerPath);
|
|
649152
649716
|
if (Date.now() - stat47.mtimeMs < ONE_DAY_MS) {
|
|
@@ -652389,7 +652953,7 @@ __export(exports_asciicast, {
|
|
|
652389
652953
|
_resetRecordingStateForTesting: () => _resetRecordingStateForTesting
|
|
652390
652954
|
});
|
|
652391
652955
|
import { appendFile as appendFile7, rename as rename10 } from "fs/promises";
|
|
652392
|
-
import { basename as basename57, dirname as dirname69, join as
|
|
652956
|
+
import { basename as basename57, dirname as dirname69, join as join203 } from "path";
|
|
652393
652957
|
function getRecordFilePath() {
|
|
652394
652958
|
if (recordingState.filePath !== null) {
|
|
652395
652959
|
return recordingState.filePath;
|
|
@@ -652400,10 +652964,10 @@ function getRecordFilePath() {
|
|
|
652400
652964
|
if (!isEnvTruthy(process.env.UR_CODE_TERMINAL_RECORDING)) {
|
|
652401
652965
|
return null;
|
|
652402
652966
|
}
|
|
652403
|
-
const projectsDir =
|
|
652404
|
-
const projectDir =
|
|
652967
|
+
const projectsDir = join203(getURConfigHomeDir(), "projects");
|
|
652968
|
+
const projectDir = join203(projectsDir, sanitizePath2(getOriginalCwd()));
|
|
652405
652969
|
recordingState.timestamp = Date.now();
|
|
652406
|
-
recordingState.filePath =
|
|
652970
|
+
recordingState.filePath = join203(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
|
|
652407
652971
|
return recordingState.filePath;
|
|
652408
652972
|
}
|
|
652409
652973
|
function _resetRecordingStateForTesting() {
|
|
@@ -652412,13 +652976,13 @@ function _resetRecordingStateForTesting() {
|
|
|
652412
652976
|
}
|
|
652413
652977
|
function getSessionRecordingPaths() {
|
|
652414
652978
|
const sessionId = getSessionId();
|
|
652415
|
-
const projectsDir =
|
|
652416
|
-
const projectDir =
|
|
652979
|
+
const projectsDir = join203(getURConfigHomeDir(), "projects");
|
|
652980
|
+
const projectDir = join203(projectsDir, sanitizePath2(getOriginalCwd()));
|
|
652417
652981
|
try {
|
|
652418
652982
|
const entries = getFsImplementation().readdirSync(projectDir);
|
|
652419
652983
|
const names = typeof entries[0] === "string" ? entries : entries.map((e) => e.name);
|
|
652420
652984
|
const files2 = names.filter((f) => f.startsWith(sessionId) && f.endsWith(".cast")).sort();
|
|
652421
|
-
return files2.map((f) =>
|
|
652985
|
+
return files2.map((f) => join203(projectDir, f));
|
|
652422
652986
|
} catch {
|
|
652423
652987
|
return [];
|
|
652424
652988
|
}
|
|
@@ -652428,9 +652992,9 @@ async function renameRecordingForSession() {
|
|
|
652428
652992
|
if (!oldPath || recordingState.timestamp === 0) {
|
|
652429
652993
|
return;
|
|
652430
652994
|
}
|
|
652431
|
-
const projectsDir =
|
|
652432
|
-
const projectDir =
|
|
652433
|
-
const newPath =
|
|
652995
|
+
const projectsDir = join203(getURConfigHomeDir(), "projects");
|
|
652996
|
+
const projectDir = join203(projectsDir, sanitizePath2(getOriginalCwd()));
|
|
652997
|
+
const newPath = join203(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
|
|
652434
652998
|
if (oldPath === newPath) {
|
|
652435
652999
|
return;
|
|
652436
653000
|
}
|
|
@@ -654035,7 +654599,7 @@ async function submitTranscriptShare(messages, trigger2, appearanceId) {
|
|
|
654035
654599
|
} catch {}
|
|
654036
654600
|
const data = {
|
|
654037
654601
|
trigger: trigger2,
|
|
654038
|
-
version: "1.22.
|
|
654602
|
+
version: "1.22.7",
|
|
654039
654603
|
platform: process.platform,
|
|
654040
654604
|
transcript,
|
|
654041
654605
|
subagentTranscripts: Object.keys(subagentTranscripts).length > 0 ? subagentTranscripts : undefined,
|
|
@@ -655307,7 +655871,7 @@ var init_useChromeExtensionNotification = __esm(() => {
|
|
|
655307
655871
|
});
|
|
655308
655872
|
|
|
655309
655873
|
// src/utils/plugins/officialMarketplaceStartupCheck.ts
|
|
655310
|
-
import { join as
|
|
655874
|
+
import { join as join204 } from "path";
|
|
655311
655875
|
function isOfficialMarketplaceAutoInstallDisabled() {
|
|
655312
655876
|
return isEnvTruthy(process.env.UR_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL);
|
|
655313
655877
|
}
|
|
@@ -655391,7 +655955,7 @@ async function checkAndInstallOfficialMarketplace() {
|
|
|
655391
655955
|
return { installed: false, skipped: true, reason: "policy_blocked" };
|
|
655392
655956
|
}
|
|
655393
655957
|
const cacheDir = getMarketplacesCacheDir();
|
|
655394
|
-
const installLocation =
|
|
655958
|
+
const installLocation = join204(cacheDir, OFFICIAL_MARKETPLACE_NAME);
|
|
655395
655959
|
const gcsSha = await fetchOfficialMarketplaceFromGcs(installLocation, cacheDir);
|
|
655396
655960
|
if (gcsSha !== null) {
|
|
655397
655961
|
const known = await loadKnownMarketplacesConfig();
|
|
@@ -658379,7 +658943,7 @@ var init_usePluginRecommendationBase = __esm(() => {
|
|
|
658379
658943
|
});
|
|
658380
658944
|
|
|
658381
658945
|
// src/hooks/useLspPluginRecommendation.tsx
|
|
658382
|
-
import { extname as extname20, join as
|
|
658946
|
+
import { extname as extname20, join as join205 } from "path";
|
|
658383
658947
|
function useLspPluginRecommendation() {
|
|
658384
658948
|
const $3 = import_compiler_runtime347.c(12);
|
|
658385
658949
|
const trackedFiles = useAppState(_temp205);
|
|
@@ -658464,7 +659028,7 @@ function useLspPluginRecommendation() {
|
|
|
658464
659028
|
case "yes": {
|
|
658465
659029
|
installPluginAndNotify(pluginId, pluginName, "lsp-plugin", addNotification, async (pluginData) => {
|
|
658466
659030
|
logForDebugging(`[useLspPluginRecommendation] Installing plugin: ${pluginId}`);
|
|
658467
|
-
const localSourcePath = typeof pluginData.entry.source === "string" ?
|
|
659031
|
+
const localSourcePath = typeof pluginData.entry.source === "string" ? join205(pluginData.marketplaceInstallLocation, pluginData.entry.source) : undefined;
|
|
658468
659032
|
await cacheAndRegisterPlugin(pluginId, pluginData.entry, "user", undefined, localSourcePath);
|
|
658469
659033
|
const settings = getSettingsForSource("userSettings");
|
|
658470
659034
|
updateSettingsForSource("userSettings", {
|
|
@@ -661294,7 +661858,7 @@ var exports_REPL = {};
|
|
|
661294
661858
|
__export(exports_REPL, {
|
|
661295
661859
|
REPL: () => REPL
|
|
661296
661860
|
});
|
|
661297
|
-
import { dirname as dirname71, join as
|
|
661861
|
+
import { dirname as dirname71, join as join206 } from "path";
|
|
661298
661862
|
import { tmpdir as tmpdir12 } from "os";
|
|
661299
661863
|
import { writeFile as writeFile47 } from "fs/promises";
|
|
661300
661864
|
import { randomUUID as randomUUID51 } from "crypto";
|
|
@@ -663866,7 +664430,7 @@ Note: ctrl + z now suspends UR, ctrl + _ undoes input.
|
|
|
663866
664430
|
const w = Math.max(80, (process.stdout.columns ?? 80) - 6);
|
|
663867
664431
|
const raw = await renderMessagesToPlainText(deferredMessages, tools, w);
|
|
663868
664432
|
const text = raw.replace(/[ \t]+$/gm, "");
|
|
663869
|
-
const path24 =
|
|
664433
|
+
const path24 = join206(tmpdir12(), `cc-transcript-${Date.now()}.txt`);
|
|
663870
664434
|
await writeFile47(path24, text);
|
|
663871
664435
|
const opened = openFileInExternalEditor(path24);
|
|
663872
664436
|
setStatus2(opened ? `opening ${path24}` : `wrote ${path24} \xB7 no $VISUAL/$EDITOR set`);
|
|
@@ -665917,7 +666481,7 @@ function WelcomeV2() {
|
|
|
665917
666481
|
dimColor: true,
|
|
665918
666482
|
children: [
|
|
665919
666483
|
"v",
|
|
665920
|
-
"1.22.
|
|
666484
|
+
"1.22.7"
|
|
665921
666485
|
]
|
|
665922
666486
|
}, undefined, true, undefined, this)
|
|
665923
666487
|
]
|
|
@@ -667177,7 +667741,7 @@ function completeOnboarding() {
|
|
|
667177
667741
|
saveGlobalConfig((current) => ({
|
|
667178
667742
|
...current,
|
|
667179
667743
|
hasCompletedOnboarding: true,
|
|
667180
|
-
lastOnboardingVersion: "1.22.
|
|
667744
|
+
lastOnboardingVersion: "1.22.7"
|
|
667181
667745
|
}));
|
|
667182
667746
|
}
|
|
667183
667747
|
function showDialog(root2, renderer) {
|
|
@@ -672229,12 +672793,12 @@ var init_createDirectConnectSession = __esm(() => {
|
|
|
672229
672793
|
});
|
|
672230
672794
|
|
|
672231
672795
|
// src/utils/errorLogSink.ts
|
|
672232
|
-
import { dirname as dirname73, join as
|
|
672796
|
+
import { dirname as dirname73, join as join207 } from "path";
|
|
672233
672797
|
function getErrorsPath() {
|
|
672234
|
-
return
|
|
672798
|
+
return join207(CACHE_PATHS.errors(), DATE + ".jsonl");
|
|
672235
672799
|
}
|
|
672236
672800
|
function getMCPLogsPath(serverName) {
|
|
672237
|
-
return
|
|
672801
|
+
return join207(CACHE_PATHS.mcpLogs(serverName), DATE + ".jsonl");
|
|
672238
672802
|
}
|
|
672239
672803
|
function createJsonlWriter(options2) {
|
|
672240
672804
|
const writer = createBufferedWriter(options2);
|
|
@@ -672278,7 +672842,7 @@ function appendToLog(path24, message) {
|
|
|
672278
672842
|
cwd: getFsImplementation().cwd(),
|
|
672279
672843
|
userType: process.env.USER_TYPE,
|
|
672280
672844
|
sessionId: getSessionId(),
|
|
672281
|
-
version: "1.22.
|
|
672845
|
+
version: "1.22.7"
|
|
672282
672846
|
};
|
|
672283
672847
|
getLogWriter(path24).write(messageWithTimestamp);
|
|
672284
672848
|
}
|
|
@@ -672577,7 +673141,7 @@ var init_sessionMemory = __esm(() => {
|
|
|
672577
673141
|
// src/utils/iTermBackup.ts
|
|
672578
673142
|
import { copyFile as copyFile11, stat as stat49 } from "fs/promises";
|
|
672579
673143
|
import { homedir as homedir38 } from "os";
|
|
672580
|
-
import { join as
|
|
673144
|
+
import { join as join208 } from "path";
|
|
672581
673145
|
function markITerm2SetupComplete() {
|
|
672582
673146
|
saveGlobalConfig((current) => ({
|
|
672583
673147
|
...current,
|
|
@@ -672592,7 +673156,7 @@ function getIterm2RecoveryInfo() {
|
|
|
672592
673156
|
};
|
|
672593
673157
|
}
|
|
672594
673158
|
function getITerm2PlistPath() {
|
|
672595
|
-
return
|
|
673159
|
+
return join208(homedir38(), "Library", "Preferences", "com.googlecode.iterm2.plist");
|
|
672596
673160
|
}
|
|
672597
673161
|
async function checkAndRestoreITerm2Backup() {
|
|
672598
673162
|
const { inProgress, backupPath } = getIterm2RecoveryInfo();
|
|
@@ -676101,7 +676665,7 @@ var init_idleTimeout = __esm(() => {
|
|
|
676101
676665
|
// src/bridge/inboundAttachments.ts
|
|
676102
676666
|
import { randomUUID as randomUUID54 } from "crypto";
|
|
676103
676667
|
import { mkdir as mkdir45, writeFile as writeFile49 } from "fs/promises";
|
|
676104
|
-
import { basename as basename58, join as
|
|
676668
|
+
import { basename as basename58, join as join209 } from "path";
|
|
676105
676669
|
function debug(msg) {
|
|
676106
676670
|
logForDebugging(`[bridge:inbound-attach] ${msg}`);
|
|
676107
676671
|
}
|
|
@@ -676117,7 +676681,7 @@ function sanitizeFileName(name) {
|
|
|
676117
676681
|
return base2 || "attachment";
|
|
676118
676682
|
}
|
|
676119
676683
|
function uploadsDir() {
|
|
676120
|
-
return
|
|
676684
|
+
return join209(getURConfigHomeDir(), "uploads", getSessionId());
|
|
676121
676685
|
}
|
|
676122
676686
|
async function resolveOne(att) {
|
|
676123
676687
|
const token = getBridgeAccessToken();
|
|
@@ -676146,7 +676710,7 @@ async function resolveOne(att) {
|
|
|
676146
676710
|
const safeName = sanitizeFileName(att.file_name);
|
|
676147
676711
|
const prefix = (att.file_uuid.slice(0, 8) || randomUUID54().slice(0, 8)).replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
676148
676712
|
const dir = uploadsDir();
|
|
676149
|
-
const outPath =
|
|
676713
|
+
const outPath = join209(dir, `${prefix}-${safeName}`);
|
|
676150
676714
|
try {
|
|
676151
676715
|
await mkdir45(dir, { recursive: true });
|
|
676152
676716
|
await writeFile49(outPath, data);
|
|
@@ -676246,7 +676810,7 @@ var init_sessionUrl = __esm(() => {
|
|
|
676246
676810
|
|
|
676247
676811
|
// src/utils/plugins/zipCacheAdapters.ts
|
|
676248
676812
|
import { readFile as readFile54 } from "fs/promises";
|
|
676249
|
-
import { join as
|
|
676813
|
+
import { join as join210 } from "path";
|
|
676250
676814
|
async function readZipCacheKnownMarketplaces() {
|
|
676251
676815
|
try {
|
|
676252
676816
|
const content = await readFile54(getZipCacheKnownMarketplacesPath(), "utf-8");
|
|
@@ -676271,13 +676835,13 @@ async function saveMarketplaceJsonToZipCache(marketplaceName, installLocation) {
|
|
|
676271
676835
|
const content = await readMarketplaceJsonContent(installLocation);
|
|
676272
676836
|
if (content !== null) {
|
|
676273
676837
|
const relPath = getMarketplaceJsonRelativePath(marketplaceName);
|
|
676274
|
-
await atomicWriteToZipCache(
|
|
676838
|
+
await atomicWriteToZipCache(join210(zipCachePath, relPath), content);
|
|
676275
676839
|
}
|
|
676276
676840
|
}
|
|
676277
676841
|
async function readMarketplaceJsonContent(dir) {
|
|
676278
676842
|
const candidates2 = [
|
|
676279
|
-
|
|
676280
|
-
|
|
676843
|
+
join210(dir, ".ur-plugin", "marketplace.json"),
|
|
676844
|
+
join210(dir, "marketplace.json"),
|
|
676281
676845
|
dir
|
|
676282
676846
|
];
|
|
676283
676847
|
for (const candidate of candidates2) {
|
|
@@ -676407,8 +676971,8 @@ async function getEnvLessBridgeConfig() {
|
|
|
676407
676971
|
}
|
|
676408
676972
|
async function checkEnvLessBridgeMinVersion() {
|
|
676409
676973
|
const cfg = await getEnvLessBridgeConfig();
|
|
676410
|
-
if (cfg.min_version && lt("1.22.
|
|
676411
|
-
return `Your version of UR (${"1.22.
|
|
676974
|
+
if (cfg.min_version && lt("1.22.7", cfg.min_version)) {
|
|
676975
|
+
return `Your version of UR (${"1.22.7"}) is too old for Remote Control.
|
|
676412
676976
|
Version ${cfg.min_version} or higher is required. Run \`ur update\` to update.`;
|
|
676413
676977
|
}
|
|
676414
676978
|
return null;
|
|
@@ -676736,9 +677300,9 @@ __export(exports_bridgePointer, {
|
|
|
676736
677300
|
BRIDGE_POINTER_TTL_MS: () => BRIDGE_POINTER_TTL_MS
|
|
676737
677301
|
});
|
|
676738
677302
|
import { mkdir as mkdir46, readFile as readFile55, stat as stat50, unlink as unlink26, writeFile as writeFile50 } from "fs/promises";
|
|
676739
|
-
import { dirname as dirname74, join as
|
|
677303
|
+
import { dirname as dirname74, join as join211 } from "path";
|
|
676740
677304
|
function getBridgePointerPath(dir) {
|
|
676741
|
-
return
|
|
677305
|
+
return join211(getProjectsDir(), sanitizePath2(dir), "bridge-pointer.json");
|
|
676742
677306
|
}
|
|
676743
677307
|
async function writeBridgePointer(dir, pointer) {
|
|
676744
677308
|
const path24 = getBridgePointerPath(dir);
|
|
@@ -676882,7 +677446,7 @@ async function initBridgeCore(params) {
|
|
|
676882
677446
|
const rawApi = createBridgeApiClient({
|
|
676883
677447
|
baseUrl,
|
|
676884
677448
|
getAccessToken,
|
|
676885
|
-
runnerVersion: "1.22.
|
|
677449
|
+
runnerVersion: "1.22.7",
|
|
676886
677450
|
onDebug: logForDebugging,
|
|
676887
677451
|
onAuth401,
|
|
676888
677452
|
getTrustedDeviceToken
|
|
@@ -682563,7 +683127,7 @@ async function startMCPServer(cwd3, debug2, verbose) {
|
|
|
682563
683127
|
setCwd(cwd3);
|
|
682564
683128
|
const server2 = new Server({
|
|
682565
683129
|
name: "ur/tengu",
|
|
682566
|
-
version: "1.22.
|
|
683130
|
+
version: "1.22.7"
|
|
682567
683131
|
}, {
|
|
682568
683132
|
capabilities: {
|
|
682569
683133
|
tools: {}
|
|
@@ -682695,14 +683259,14 @@ __export(exports_urDesktop, {
|
|
|
682695
683259
|
});
|
|
682696
683260
|
import { readdir as readdir32, readFile as readFile57, stat as stat52 } from "fs/promises";
|
|
682697
683261
|
import { homedir as homedir39 } from "os";
|
|
682698
|
-
import { join as
|
|
683262
|
+
import { join as join212 } from "path";
|
|
682699
683263
|
async function getURDesktopConfigPath() {
|
|
682700
683264
|
const platform7 = getPlatform();
|
|
682701
683265
|
if (!SUPPORTED_PLATFORMS.includes(platform7)) {
|
|
682702
683266
|
throw new Error(`Unsupported platform: ${platform7} - UR Desktop integration only works on macOS and WSL.`);
|
|
682703
683267
|
}
|
|
682704
683268
|
if (platform7 === "macos") {
|
|
682705
|
-
return
|
|
683269
|
+
return join212(homedir39(), "Library", "Application Support", "UR", "ur_desktop_config.json");
|
|
682706
683270
|
}
|
|
682707
683271
|
const windowsHome = process.env.USERPROFILE ? process.env.USERPROFILE.replace(/\\/g, "/") : null;
|
|
682708
683272
|
if (windowsHome) {
|
|
@@ -682721,7 +683285,7 @@ async function getURDesktopConfigPath() {
|
|
|
682721
683285
|
if (user.name === "Public" || user.name === "Default" || user.name === "Default User" || user.name === "All Users") {
|
|
682722
683286
|
continue;
|
|
682723
683287
|
}
|
|
682724
|
-
const potentialConfigPath =
|
|
683288
|
+
const potentialConfigPath = join212(usersDir, user.name, "AppData", "Roaming", "UR", "ur_desktop_config.json");
|
|
682725
683289
|
try {
|
|
682726
683290
|
await stat52(potentialConfigPath);
|
|
682727
683291
|
return potentialConfigPath;
|
|
@@ -683630,12 +684194,12 @@ __export(exports_install, {
|
|
|
683630
684194
|
install: () => install
|
|
683631
684195
|
});
|
|
683632
684196
|
import { homedir as homedir40 } from "os";
|
|
683633
|
-
import { join as
|
|
684197
|
+
import { join as join213 } from "path";
|
|
683634
684198
|
function getInstallationPath2() {
|
|
683635
684199
|
const isWindows2 = env3.platform === "win32";
|
|
683636
684200
|
const homeDir = homedir40();
|
|
683637
684201
|
if (isWindows2) {
|
|
683638
|
-
const windowsPath =
|
|
684202
|
+
const windowsPath = join213(homeDir, ".local", "bin", "ur.exe");
|
|
683639
684203
|
return windowsPath.replace(/\//g, "\\");
|
|
683640
684204
|
}
|
|
683641
684205
|
return "~/.local/bin/ur";
|
|
@@ -684174,7 +684738,7 @@ __export(exports_update, {
|
|
|
684174
684738
|
});
|
|
684175
684739
|
async function update() {
|
|
684176
684740
|
logEvent("tengu_update_check", {});
|
|
684177
|
-
writeToStdout(`Current version: ${"1.22.
|
|
684741
|
+
writeToStdout(`Current version: ${"1.22.7"}
|
|
684178
684742
|
`);
|
|
684179
684743
|
const channel = getInitialSettings()?.autoUpdatesChannel ?? "latest";
|
|
684180
684744
|
writeToStdout(`Checking for updates to ${channel} version...
|
|
@@ -684249,8 +684813,8 @@ async function update() {
|
|
|
684249
684813
|
writeToStdout(`UR is managed by Homebrew.
|
|
684250
684814
|
`);
|
|
684251
684815
|
const latest = await getLatestVersion(channel);
|
|
684252
|
-
if (latest && !gte("1.22.
|
|
684253
|
-
writeToStdout(`${formatUpdateAvailableMessage("1.22.
|
|
684816
|
+
if (latest && !gte("1.22.7", latest)) {
|
|
684817
|
+
writeToStdout(`${formatUpdateAvailableMessage("1.22.7", latest)}
|
|
684254
684818
|
`);
|
|
684255
684819
|
writeToStdout(`
|
|
684256
684820
|
`);
|
|
@@ -684266,8 +684830,8 @@ async function update() {
|
|
|
684266
684830
|
writeToStdout(`UR is managed by winget.
|
|
684267
684831
|
`);
|
|
684268
684832
|
const latest = await getLatestVersion(channel);
|
|
684269
|
-
if (latest && !gte("1.22.
|
|
684270
|
-
writeToStdout(`${formatUpdateAvailableMessage("1.22.
|
|
684833
|
+
if (latest && !gte("1.22.7", latest)) {
|
|
684834
|
+
writeToStdout(`${formatUpdateAvailableMessage("1.22.7", latest)}
|
|
684271
684835
|
`);
|
|
684272
684836
|
writeToStdout(`
|
|
684273
684837
|
`);
|
|
@@ -684283,8 +684847,8 @@ async function update() {
|
|
|
684283
684847
|
writeToStdout(`UR is managed by apk.
|
|
684284
684848
|
`);
|
|
684285
684849
|
const latest = await getLatestVersion(channel);
|
|
684286
|
-
if (latest && !gte("1.22.
|
|
684287
|
-
writeToStdout(`${formatUpdateAvailableMessage("1.22.
|
|
684850
|
+
if (latest && !gte("1.22.7", latest)) {
|
|
684851
|
+
writeToStdout(`${formatUpdateAvailableMessage("1.22.7", latest)}
|
|
684288
684852
|
`);
|
|
684289
684853
|
writeToStdout(`
|
|
684290
684854
|
`);
|
|
@@ -684349,11 +684913,11 @@ async function update() {
|
|
|
684349
684913
|
`);
|
|
684350
684914
|
await gracefulShutdown(1);
|
|
684351
684915
|
}
|
|
684352
|
-
if (result.latestVersion === "1.22.
|
|
684353
|
-
writeToStdout(source_default.green(`UR is up to date (${"1.22.
|
|
684916
|
+
if (result.latestVersion === "1.22.7") {
|
|
684917
|
+
writeToStdout(source_default.green(`UR is up to date (${"1.22.7"})`) + `
|
|
684354
684918
|
`);
|
|
684355
684919
|
} else {
|
|
684356
|
-
writeToStdout(source_default.green(`Successfully updated from ${"1.22.
|
|
684920
|
+
writeToStdout(source_default.green(`Successfully updated from ${"1.22.7"} to version ${result.latestVersion}`) + `
|
|
684357
684921
|
`);
|
|
684358
684922
|
await regenerateCompletionCache();
|
|
684359
684923
|
}
|
|
@@ -684413,12 +684977,12 @@ async function update() {
|
|
|
684413
684977
|
`);
|
|
684414
684978
|
await gracefulShutdown(1);
|
|
684415
684979
|
}
|
|
684416
|
-
if (latestVersion === "1.22.
|
|
684417
|
-
writeToStdout(source_default.green(`UR is up to date (${"1.22.
|
|
684980
|
+
if (latestVersion === "1.22.7") {
|
|
684981
|
+
writeToStdout(source_default.green(`UR is up to date (${"1.22.7"})`) + `
|
|
684418
684982
|
`);
|
|
684419
684983
|
await gracefulShutdown(0);
|
|
684420
684984
|
}
|
|
684421
|
-
writeToStdout(`${formatUpdateAvailableMessage("1.22.
|
|
684985
|
+
writeToStdout(`${formatUpdateAvailableMessage("1.22.7", latestVersion)}
|
|
684422
684986
|
`);
|
|
684423
684987
|
writeToStdout(`Installing update...
|
|
684424
684988
|
`);
|
|
@@ -684463,7 +685027,7 @@ async function update() {
|
|
|
684463
685027
|
logForDebugging(`update: Installation status: ${status2}`);
|
|
684464
685028
|
switch (status2) {
|
|
684465
685029
|
case "success":
|
|
684466
|
-
writeToStdout(source_default.green(`Successfully updated from ${"1.22.
|
|
685030
|
+
writeToStdout(source_default.green(`Successfully updated from ${"1.22.7"} to version ${latestVersion}`) + `
|
|
684467
685031
|
`);
|
|
684468
685032
|
await regenerateCompletionCache();
|
|
684469
685033
|
break;
|
|
@@ -685739,7 +686303,7 @@ ${customInstructions}` : customInstructions;
|
|
|
685739
686303
|
}
|
|
685740
686304
|
}
|
|
685741
686305
|
logForDiagnosticsNoPII("info", "started", {
|
|
685742
|
-
version: "1.22.
|
|
686306
|
+
version: "1.22.7",
|
|
685743
686307
|
is_native_binary: isInBundledMode()
|
|
685744
686308
|
});
|
|
685745
686309
|
registerCleanup(async () => {
|
|
@@ -686523,7 +687087,7 @@ Usage: ur --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
686523
687087
|
pendingHookMessages
|
|
686524
687088
|
}, renderAndRun);
|
|
686525
687089
|
}
|
|
686526
|
-
}).version("1.22.
|
|
687090
|
+
}).version("1.22.7 (Ur)", "-v, --version", "Output the version number");
|
|
686527
687091
|
program2.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
|
|
686528
687092
|
program2.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
|
|
686529
687093
|
if (canUserConfigureAdvisor()) {
|
|
@@ -686894,8 +687458,8 @@ Usage: ur --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
686894
687458
|
const args = [action3, ...rest, opts.note ? "--note" : undefined, opts.label ? `--label ${quoteLocalCommandArg(opts.label)}` : undefined, opts.embeddings ? "--embeddings" : undefined, opts.embedModel ? `--embed-model ${quoteLocalCommandArg(opts.embedModel)}` : undefined, opts.olderThan ? `--older-than ${opts.olderThan}` : undefined, opts.json ? "--json" : undefined].filter(Boolean).join(" ");
|
|
686895
687459
|
await runLocalTextCommand(() => Promise.resolve().then(() => (init_knowledge2(), exports_knowledge)), args);
|
|
686896
687460
|
});
|
|
686897
|
-
program2.command("eval [action] [name]").alias("evals").description("Public agent eval harness: init, list, validate, run, report, benchmark adapters").option("--file <path>", "Local benchmark JSON/JSONL file for eval bench").option("--name <suite>", "Suite name when importing a benchmark adapter").option("--limit <n>", "Limit imported benchmark records").option("--dry-run", "Run offline without calling any model").option("--category <c>", "Only run cases in this category").option("--max-turns <n>", "Max agentic turns per case when running").option("--skip-permissions", "Pass --dangerously-skip-permissions to each case (sandboxes only)").option("--force", "Overwrite existing files on init/import").option("--json", "Output as JSON").action(async (action3, name, opts) => {
|
|
686898
|
-
const args = [action3, name, opts.file ? `--file ${quoteLocalCommandArg(opts.file)}` : undefined, opts.name ? `--name ${quoteLocalCommandArg(opts.name)}` : undefined, opts.limit ? `--limit ${opts.limit}` : undefined, opts.dryRun ? "--dry-run" : undefined, opts.category ? `--category ${quoteLocalCommandArg(opts.category)}` : undefined, opts.maxTurns ? `--max-turns ${opts.maxTurns}` : undefined, opts.skipPermissions ? "--skip-permissions" : undefined, opts.force ? "--force" : undefined, opts.json ? "--json" : undefined].filter(Boolean).join(" ");
|
|
687461
|
+
program2.command("eval [action] [name] [rest...]").alias("evals").description("Public agent eval harness: init, list, validate, run, report, compare, benchmark adapters").option("--file <path>", "Local benchmark JSON/JSONL file for eval bench").option("--name <suite>", "Suite name when importing a benchmark adapter").option("--limit <n>", "Limit imported benchmark records").option("--dry-run", "Run offline without calling any model").option("--metrics", "Write per-case metrics files after running").option("--category <c>", "Only run cases in this category").option("--max-turns <n>", "Max agentic turns per case when running").option("--skip-permissions", "Pass --dangerously-skip-permissions to each case (sandboxes only)").option("--force", "Overwrite existing files on init/import").option("--json", "Output as JSON").action(async (action3, name, rest = [], opts) => {
|
|
687462
|
+
const args = [action3, name, ...rest, opts.file ? `--file ${quoteLocalCommandArg(opts.file)}` : undefined, opts.name ? `--name ${quoteLocalCommandArg(opts.name)}` : undefined, opts.limit ? `--limit ${opts.limit}` : undefined, opts.dryRun ? "--dry-run" : undefined, opts.metrics ? "--metrics" : undefined, opts.category ? `--category ${quoteLocalCommandArg(opts.category)}` : undefined, opts.maxTurns ? `--max-turns ${opts.maxTurns}` : undefined, opts.skipPermissions ? "--skip-permissions" : undefined, opts.force ? "--force" : undefined, opts.json ? "--json" : undefined].filter(Boolean).join(" ");
|
|
686899
687463
|
await runLocalTextCommand(() => Promise.resolve().then(() => (init_eval(), exports_eval)), args);
|
|
686900
687464
|
});
|
|
686901
687465
|
program2.command("code-index [action] [query...]").alias("codeindex").description("Build and query a local semantic code index (embeddings via the local Ollama app)").option("--graph", "Also build or watch the structural code graph").option("--repo", "Also build or watch the semantic repo index").option("--dry-run", "Preview watch mode without starting a watcher").option("--json", "Output as JSON").action(async (action3, query2 = [], opts) => {
|
|
@@ -687345,7 +687909,7 @@ if (false) {}
|
|
|
687345
687909
|
async function main2() {
|
|
687346
687910
|
const args = process.argv.slice(2);
|
|
687347
687911
|
if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
|
|
687348
|
-
console.log(`${"1.22.
|
|
687912
|
+
console.log(`${"1.22.7"} (Ur)`);
|
|
687349
687913
|
return;
|
|
687350
687914
|
}
|
|
687351
687915
|
if (args[0] === "a2a" && args[1] === "serve" && !args.includes("--help") && !args.includes("-h")) {
|