ur-agent 1.57.4 → 1.58.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js
CHANGED
|
@@ -63228,6 +63228,15 @@ function calculateUSDCost(resolvedModel, usage) {
|
|
|
63228
63228
|
const modelCosts = getModelCosts(resolvedModel, usage);
|
|
63229
63229
|
return tokensToUSDCost(modelCosts, usage);
|
|
63230
63230
|
}
|
|
63231
|
+
function calculateCostFromTokens(model, tokens) {
|
|
63232
|
+
const usage = {
|
|
63233
|
+
input_tokens: tokens.inputTokens,
|
|
63234
|
+
output_tokens: tokens.outputTokens,
|
|
63235
|
+
cache_read_input_tokens: tokens.cacheReadInputTokens,
|
|
63236
|
+
cache_creation_input_tokens: tokens.cacheCreationInputTokens
|
|
63237
|
+
};
|
|
63238
|
+
return calculateUSDCost(model, usage);
|
|
63239
|
+
}
|
|
63231
63240
|
function formatPrice(price) {
|
|
63232
63241
|
if (Number.isInteger(price)) {
|
|
63233
63242
|
return `$${price}`;
|
|
@@ -75151,7 +75160,7 @@ var init_auth = __esm(() => {
|
|
|
75151
75160
|
|
|
75152
75161
|
// src/utils/userAgent.ts
|
|
75153
75162
|
function getURCodeUserAgent() {
|
|
75154
|
-
return `ur/${"1.
|
|
75163
|
+
return `ur/${"1.58.0"}`;
|
|
75155
75164
|
}
|
|
75156
75165
|
|
|
75157
75166
|
// src/utils/workloadContext.ts
|
|
@@ -75173,7 +75182,7 @@ function getUserAgent() {
|
|
|
75173
75182
|
const clientApp = process.env.UR_AGENT_SDK_CLIENT_APP ? `, client-app/${process.env.UR_AGENT_SDK_CLIENT_APP}` : "";
|
|
75174
75183
|
const workload = getWorkload();
|
|
75175
75184
|
const workloadSuffix = workload ? `, workload/${workload}` : "";
|
|
75176
|
-
return `ur-cli/${"1.
|
|
75185
|
+
return `ur-cli/${"1.58.0"} (${process.env.USER_TYPE}, ${process.env.UR_CODE_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
|
|
75177
75186
|
}
|
|
75178
75187
|
function getMCPUserAgent() {
|
|
75179
75188
|
const parts = [];
|
|
@@ -75187,7 +75196,7 @@ function getMCPUserAgent() {
|
|
|
75187
75196
|
parts.push(`client-app/${process.env.UR_AGENT_SDK_CLIENT_APP}`);
|
|
75188
75197
|
}
|
|
75189
75198
|
const suffix = parts.length > 0 ? ` (${parts.join(", ")})` : "";
|
|
75190
|
-
return `ur/${"1.
|
|
75199
|
+
return `ur/${"1.58.0"}${suffix}`;
|
|
75191
75200
|
}
|
|
75192
75201
|
function getWebFetchUserAgent() {
|
|
75193
75202
|
return `UR-User (${getURCodeUserAgent()})`;
|
|
@@ -75325,7 +75334,7 @@ var init_user = __esm(() => {
|
|
|
75325
75334
|
deviceId,
|
|
75326
75335
|
sessionId: getSessionId(),
|
|
75327
75336
|
email: getEmail(),
|
|
75328
|
-
appVersion: "1.
|
|
75337
|
+
appVersion: "1.58.0",
|
|
75329
75338
|
platform: getHostPlatformForAnalytics(),
|
|
75330
75339
|
organizationUuid,
|
|
75331
75340
|
accountUuid,
|
|
@@ -83525,7 +83534,7 @@ var init_metadata = __esm(() => {
|
|
|
83525
83534
|
COMPOUND_OPERATOR_REGEX = /\s*(?:&&|\|\||[;|])\s*/;
|
|
83526
83535
|
WHITESPACE_REGEX = /\s+/;
|
|
83527
83536
|
getVersionBase = memoize_default(() => {
|
|
83528
|
-
const match = "1.
|
|
83537
|
+
const match = "1.58.0".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
|
|
83529
83538
|
return match ? match[0] : undefined;
|
|
83530
83539
|
});
|
|
83531
83540
|
buildEnvContext = memoize_default(async () => {
|
|
@@ -83565,7 +83574,7 @@ var init_metadata = __esm(() => {
|
|
|
83565
83574
|
isGithubAction: isEnvTruthy(process.env.GITHUB_ACTIONS),
|
|
83566
83575
|
isURCodeAction: isEnvTruthy(process.env.UR_CODE_ACTION),
|
|
83567
83576
|
isURAiAuth: isURAISubscriber(),
|
|
83568
|
-
version: "1.
|
|
83577
|
+
version: "1.58.0",
|
|
83569
83578
|
versionBase: getVersionBase(),
|
|
83570
83579
|
buildTime: "",
|
|
83571
83580
|
deploymentEnvironment: env2.detectDeploymentEnvironment(),
|
|
@@ -84235,7 +84244,7 @@ function initialize1PEventLogging() {
|
|
|
84235
84244
|
const platform2 = getPlatform();
|
|
84236
84245
|
const attributes = {
|
|
84237
84246
|
[import_semantic_conventions4.ATTR_SERVICE_NAME]: "ur",
|
|
84238
|
-
[import_semantic_conventions4.ATTR_SERVICE_VERSION]: "1.
|
|
84247
|
+
[import_semantic_conventions4.ATTR_SERVICE_VERSION]: "1.58.0"
|
|
84239
84248
|
};
|
|
84240
84249
|
if (platform2 === "wsl") {
|
|
84241
84250
|
const wslVersion = getWslVersion();
|
|
@@ -84263,7 +84272,7 @@ function initialize1PEventLogging() {
|
|
|
84263
84272
|
})
|
|
84264
84273
|
]
|
|
84265
84274
|
});
|
|
84266
|
-
firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.urhq.ur.events", "1.
|
|
84275
|
+
firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.urhq.ur.events", "1.58.0");
|
|
84267
84276
|
}
|
|
84268
84277
|
async function reinitialize1PEventLoggingIfConfigChanged() {
|
|
84269
84278
|
if (!is1PEventLoggingEnabled() || !firstPartyEventLoggerProvider) {
|
|
@@ -94102,7 +94111,7 @@ function formatAgentTrendReport(report = buildAgentTrendReport()) {
|
|
|
94102
94111
|
function formatA2AAgentCard(options = {}, pretty = true) {
|
|
94103
94112
|
return JSON.stringify(buildA2AAgentCard(options), null, pretty ? 2 : 0);
|
|
94104
94113
|
}
|
|
94105
|
-
var urVersion = "1.
|
|
94114
|
+
var urVersion = "1.58.0", researchSnapshotDate = "2026-07-15", coverage, priorityRoadmap;
|
|
94106
94115
|
var init_trends = __esm(() => {
|
|
94107
94116
|
init_a2aCardSignature();
|
|
94108
94117
|
coverage = [
|
|
@@ -96903,7 +96912,7 @@ function getAttributionHeader(fingerprint) {
|
|
|
96903
96912
|
if (!isAttributionHeaderEnabled()) {
|
|
96904
96913
|
return "";
|
|
96905
96914
|
}
|
|
96906
|
-
const version2 = `${"1.
|
|
96915
|
+
const version2 = `${"1.58.0"}.${fingerprint}`;
|
|
96907
96916
|
const entrypoint = process.env.UR_CODE_ENTRYPOINT ?? "unknown";
|
|
96908
96917
|
const cch = "";
|
|
96909
96918
|
const workload = getWorkload();
|
|
@@ -154492,7 +154501,7 @@ var init_projectSafety = __esm(() => {
|
|
|
154492
154501
|
function getInstruments() {
|
|
154493
154502
|
if (instruments)
|
|
154494
154503
|
return instruments;
|
|
154495
|
-
const meter = import_api10.metrics.getMeter("ur-agent.gen_ai", "1.
|
|
154504
|
+
const meter = import_api10.metrics.getMeter("ur-agent.gen_ai", "1.58.0");
|
|
154496
154505
|
instruments = {
|
|
154497
154506
|
operationDuration: meter.createHistogram("gen_ai.client.operation.duration", {
|
|
154498
154507
|
description: "GenAI operation duration.",
|
|
@@ -154590,7 +154599,7 @@ function genAiAgentAttributes() {
|
|
|
154590
154599
|
"gen_ai.operation.name": GEN_AI_OPERATION_INVOKE_AGENT,
|
|
154591
154600
|
"gen_ai.provider.name": "ur",
|
|
154592
154601
|
"gen_ai.agent.name": "UR-Nexus",
|
|
154593
|
-
"gen_ai.agent.version": "1.
|
|
154602
|
+
"gen_ai.agent.version": "1.58.0"
|
|
154594
154603
|
};
|
|
154595
154604
|
}
|
|
154596
154605
|
function genAiWorkflowAttributes(workflowName) {
|
|
@@ -154606,7 +154615,7 @@ function genAiWorkflowAttributes(workflowName) {
|
|
|
154606
154615
|
function startGenAiWorkflowSpan(workflowName) {
|
|
154607
154616
|
const attributes = genAiWorkflowAttributes(workflowName);
|
|
154608
154617
|
const name = typeof attributes["gen_ai.workflow.name"] === "string" ? `invoke_workflow ${attributes["gen_ai.workflow.name"]}` : GEN_AI_OPERATION_INVOKE_WORKFLOW;
|
|
154609
|
-
return import_api10.trace.getTracer("ur-agent.gen_ai", "1.
|
|
154618
|
+
return import_api10.trace.getTracer("ur-agent.gen_ai", "1.58.0").startSpan(name, { kind: import_api10.SpanKind.INTERNAL, attributes });
|
|
154610
154619
|
}
|
|
154611
154620
|
function endGenAiWorkflowSpan(span, options2 = {}) {
|
|
154612
154621
|
try {
|
|
@@ -154644,7 +154653,7 @@ function startGenAiMemorySpan(operation, options2 = {}) {
|
|
|
154644
154653
|
if (options2.recordCount !== undefined && Number.isInteger(options2.recordCount) && options2.recordCount >= 0) {
|
|
154645
154654
|
attributes["gen_ai.memory.record.count"] = options2.recordCount;
|
|
154646
154655
|
}
|
|
154647
|
-
return import_api10.trace.getTracer("ur-agent.gen_ai", "1.
|
|
154656
|
+
return import_api10.trace.getTracer("ur-agent.gen_ai", "1.58.0").startSpan(operation, { kind: import_api10.SpanKind.INTERNAL, attributes });
|
|
154648
154657
|
}
|
|
154649
154658
|
function endGenAiMemorySpan(span, options2 = {}) {
|
|
154650
154659
|
try {
|
|
@@ -206163,7 +206172,7 @@ function getTelemetryAttributes() {
|
|
|
206163
206172
|
attributes["session.id"] = sessionId;
|
|
206164
206173
|
}
|
|
206165
206174
|
if (shouldIncludeAttribute("OTEL_METRICS_INCLUDE_VERSION")) {
|
|
206166
|
-
attributes["app.version"] = "1.
|
|
206175
|
+
attributes["app.version"] = "1.58.0";
|
|
206167
206176
|
}
|
|
206168
206177
|
const oauthAccount = getOauthAccountInfo();
|
|
206169
206178
|
if (oauthAccount) {
|
|
@@ -241837,7 +241846,7 @@ function getInstallationEnv() {
|
|
|
241837
241846
|
return;
|
|
241838
241847
|
}
|
|
241839
241848
|
function getURCodeVersion() {
|
|
241840
|
-
return "1.
|
|
241849
|
+
return "1.58.0";
|
|
241841
241850
|
}
|
|
241842
241851
|
async function getInstalledVSCodeExtensionVersion(command) {
|
|
241843
241852
|
const { stdout } = await execFileNoThrow(command, ["--list-extensions", "--show-versions"], {
|
|
@@ -249168,7 +249177,7 @@ async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) {
|
|
|
249168
249177
|
const client2 = new Client({
|
|
249169
249178
|
name: "ur",
|
|
249170
249179
|
title: "UR",
|
|
249171
|
-
version: "1.
|
|
249180
|
+
version: "1.58.0",
|
|
249172
249181
|
description: "UR-Nexus autonomous engineering workflow engine",
|
|
249173
249182
|
websiteUrl: PRODUCT_URL
|
|
249174
249183
|
}, {
|
|
@@ -249528,7 +249537,7 @@ var init_client5 = __esm(() => {
|
|
|
249528
249537
|
const client2 = new Client({
|
|
249529
249538
|
name: "ur",
|
|
249530
249539
|
title: "UR",
|
|
249531
|
-
version: "1.
|
|
249540
|
+
version: "1.58.0",
|
|
249532
249541
|
description: "UR-Nexus autonomous engineering workflow engine",
|
|
249533
249542
|
websiteUrl: PRODUCT_URL
|
|
249534
249543
|
}, {
|
|
@@ -262129,7 +262138,7 @@ async function createRuntime() {
|
|
|
262129
262138
|
bootstrapTelemetry();
|
|
262130
262139
|
const resource = defaultResource().merge(detectResources({ detectors: [envDetector] })).merge(resourceFromAttributes({
|
|
262131
262140
|
[import_semantic_conventions7.ATTR_SERVICE_NAME]: "ur-agent",
|
|
262132
|
-
[import_semantic_conventions7.ATTR_SERVICE_VERSION]: "1.
|
|
262141
|
+
[import_semantic_conventions7.ATTR_SERVICE_VERSION]: "1.58.0"
|
|
262133
262142
|
}));
|
|
262134
262143
|
const tracerProvider = exporters.traces.length > 0 ? new BasicTracerProvider({
|
|
262135
262144
|
resource,
|
|
@@ -262162,11 +262171,11 @@ async function createRuntime() {
|
|
|
262162
262171
|
setMeterProvider(meterProvider);
|
|
262163
262172
|
setLoggerProvider(loggerProvider);
|
|
262164
262173
|
if (meterProvider) {
|
|
262165
|
-
const meter = meterProvider.getMeter("ur-agent", "1.
|
|
262174
|
+
const meter = meterProvider.getMeter("ur-agent", "1.58.0");
|
|
262166
262175
|
setMeter(meter, (name, options2) => meter.createCounter(name, options2));
|
|
262167
262176
|
}
|
|
262168
262177
|
if (loggerProvider) {
|
|
262169
|
-
setEventLogger(loggerProvider.getLogger("ur-agent.events", "1.
|
|
262178
|
+
setEventLogger(loggerProvider.getLogger("ur-agent.events", "1.58.0"));
|
|
262170
262179
|
}
|
|
262171
262180
|
if (!cleanupRegistered2) {
|
|
262172
262181
|
cleanupRegistered2 = true;
|
|
@@ -262828,9 +262837,9 @@ async function assertMinVersion() {
|
|
|
262828
262837
|
if (false) {}
|
|
262829
262838
|
try {
|
|
262830
262839
|
const versionConfig = await getDynamicConfig_BLOCKS_ON_INIT("tengu_version_config", { minVersion: "0.0.0" });
|
|
262831
|
-
if (versionConfig.minVersion && lt("1.
|
|
262840
|
+
if (versionConfig.minVersion && lt("1.58.0", versionConfig.minVersion)) {
|
|
262832
262841
|
console.error(`
|
|
262833
|
-
It looks like your version of UR (${"1.
|
|
262842
|
+
It looks like your version of UR (${"1.58.0"}) needs an update.
|
|
262834
262843
|
A newer version (${versionConfig.minVersion} or higher) is required to continue.
|
|
262835
262844
|
|
|
262836
262845
|
To update, please run:
|
|
@@ -263046,7 +263055,7 @@ async function installGlobalPackage(specificVersion) {
|
|
|
263046
263055
|
logError2(new AutoUpdaterError("Another process is currently installing an update"));
|
|
263047
263056
|
logEvent("tengu_auto_updater_lock_contention", {
|
|
263048
263057
|
pid: process.pid,
|
|
263049
|
-
currentVersion: "1.
|
|
263058
|
+
currentVersion: "1.58.0"
|
|
263050
263059
|
});
|
|
263051
263060
|
return "in_progress";
|
|
263052
263061
|
}
|
|
@@ -263055,7 +263064,7 @@ async function installGlobalPackage(specificVersion) {
|
|
|
263055
263064
|
if (!env2.isRunningWithBun() && env2.isNpmFromWindowsPath()) {
|
|
263056
263065
|
logError2(new Error("Windows NPM detected in WSL environment"));
|
|
263057
263066
|
logEvent("tengu_auto_updater_windows_npm_in_wsl", {
|
|
263058
|
-
currentVersion: "1.
|
|
263067
|
+
currentVersion: "1.58.0"
|
|
263059
263068
|
});
|
|
263060
263069
|
console.error(`
|
|
263061
263070
|
Error: Windows NPM detected in WSL
|
|
@@ -263590,7 +263599,7 @@ function detectLinuxGlobPatternWarnings() {
|
|
|
263590
263599
|
}
|
|
263591
263600
|
async function getDoctorDiagnostic() {
|
|
263592
263601
|
const installationType = await getCurrentInstallationType();
|
|
263593
|
-
const version2 = typeof MACRO !== "undefined" ? "1.
|
|
263602
|
+
const version2 = typeof MACRO !== "undefined" ? "1.58.0" : "unknown";
|
|
263594
263603
|
const installationPath = await getInstallationPath();
|
|
263595
263604
|
const invokedBinary = getInvokedBinary();
|
|
263596
263605
|
const multipleInstallations = await detectMultipleInstallations();
|
|
@@ -264525,8 +264534,8 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
|
|
|
264525
264534
|
const maxVersion = await getMaxVersion();
|
|
264526
264535
|
if (maxVersion && gt(version2, maxVersion)) {
|
|
264527
264536
|
logForDebugging(`Native installer: maxVersion ${maxVersion} is set, capping update from ${version2} to ${maxVersion}`);
|
|
264528
|
-
if (gte("1.
|
|
264529
|
-
logForDebugging(`Native installer: current version ${"1.
|
|
264537
|
+
if (gte("1.58.0", maxVersion)) {
|
|
264538
|
+
logForDebugging(`Native installer: current version ${"1.58.0"} is already at or above maxVersion ${maxVersion}, skipping update`);
|
|
264530
264539
|
logEvent("tengu_native_update_skipped_max_version", {
|
|
264531
264540
|
latency_ms: Date.now() - startTime,
|
|
264532
264541
|
max_version: maxVersion,
|
|
@@ -264537,7 +264546,7 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
|
|
|
264537
264546
|
version2 = maxVersion;
|
|
264538
264547
|
}
|
|
264539
264548
|
}
|
|
264540
|
-
if (!forceReinstall && version2 === "1.
|
|
264549
|
+
if (!forceReinstall && version2 === "1.58.0" && await versionIsAvailable(version2) && await isPossibleURBinary(executablePath)) {
|
|
264541
264550
|
logForDebugging(`Found ${version2} at ${executablePath}, skipping install`);
|
|
264542
264551
|
logEvent("tengu_native_update_complete", {
|
|
264543
264552
|
latency_ms: Date.now() - startTime,
|
|
@@ -334732,7 +334741,7 @@ function isAnyTracingEnabled() {
|
|
|
334732
334741
|
return isTelemetryEnabled() || isEnhancedTelemetryEnabled() || isBetaTracingEnabled();
|
|
334733
334742
|
}
|
|
334734
334743
|
function getTracer() {
|
|
334735
|
-
return import_api39.trace.getTracer("ur-agent.gen_ai", "1.
|
|
334744
|
+
return import_api39.trace.getTracer("ur-agent.gen_ai", "1.58.0");
|
|
334736
334745
|
}
|
|
334737
334746
|
function createSpanAttributes(spanType, customAttributes = {}) {
|
|
334738
334747
|
const baseAttributes = getTelemetryAttributes();
|
|
@@ -364235,7 +364244,7 @@ function Feedback({
|
|
|
364235
364244
|
platform: env2.platform,
|
|
364236
364245
|
gitRepo: envInfo.isGit,
|
|
364237
364246
|
terminal: env2.terminal,
|
|
364238
|
-
version: "1.
|
|
364247
|
+
version: "1.58.0",
|
|
364239
364248
|
transcript: normalizeMessagesForAPI(messages),
|
|
364240
364249
|
errors: sanitizedErrors,
|
|
364241
364250
|
lastApiRequest: getLastAPIRequest(),
|
|
@@ -364427,7 +364436,7 @@ function Feedback({
|
|
|
364427
364436
|
", ",
|
|
364428
364437
|
env2.terminal,
|
|
364429
364438
|
", v",
|
|
364430
|
-
"1.
|
|
364439
|
+
"1.58.0"
|
|
364431
364440
|
]
|
|
364432
364441
|
}, undefined, true, undefined, this)
|
|
364433
364442
|
]
|
|
@@ -364533,7 +364542,7 @@ ${sanitizedDescription}
|
|
|
364533
364542
|
` + `**Environment Info**
|
|
364534
364543
|
` + `- Platform: ${env2.platform}
|
|
364535
364544
|
` + `- Terminal: ${env2.terminal}
|
|
364536
|
-
` + `- Version: ${"1.
|
|
364545
|
+
` + `- Version: ${"1.58.0"}
|
|
364537
364546
|
` + `- Feedback ID: ${feedbackId}
|
|
364538
364547
|
` + `
|
|
364539
364548
|
**Errors**
|
|
@@ -367643,7 +367652,7 @@ function buildPrimarySection() {
|
|
|
367643
367652
|
}, undefined, false, undefined, this);
|
|
367644
367653
|
return [{
|
|
367645
367654
|
label: "Version",
|
|
367646
|
-
value: "1.
|
|
367655
|
+
value: "1.58.0"
|
|
367647
367656
|
}, {
|
|
367648
367657
|
label: "Session name",
|
|
367649
367658
|
value: nameValue
|
|
@@ -370973,7 +370982,7 @@ function Config({
|
|
|
370973
370982
|
}
|
|
370974
370983
|
}, undefined, false, undefined, this)
|
|
370975
370984
|
}, undefined, false, undefined, this) : showSubmenu === "ChannelDowngrade" ? /* @__PURE__ */ jsx_dev_runtime179.jsxDEV(ChannelDowngradeDialog, {
|
|
370976
|
-
currentVersion: "1.
|
|
370985
|
+
currentVersion: "1.58.0",
|
|
370977
370986
|
onChoice: (choice) => {
|
|
370978
370987
|
setShowSubmenu(null);
|
|
370979
370988
|
setTabsHidden(false);
|
|
@@ -370985,7 +370994,7 @@ function Config({
|
|
|
370985
370994
|
autoUpdatesChannel: "stable"
|
|
370986
370995
|
};
|
|
370987
370996
|
if (choice === "stay") {
|
|
370988
|
-
newSettings.minimumVersion = "1.
|
|
370997
|
+
newSettings.minimumVersion = "1.58.0";
|
|
370989
370998
|
}
|
|
370990
370999
|
updateSettingsForSource("userSettings", newSettings);
|
|
370991
371000
|
setSettingsData((prev_27) => ({
|
|
@@ -379049,7 +379058,7 @@ function HelpV2(t0) {
|
|
|
379049
379058
|
let t6;
|
|
379050
379059
|
if ($2[31] !== tabs) {
|
|
379051
379060
|
t6 = /* @__PURE__ */ jsx_dev_runtime206.jsxDEV(Tabs, {
|
|
379052
|
-
title: `UR v${"1.
|
|
379061
|
+
title: `UR v${"1.58.0"}`,
|
|
379053
379062
|
color: "professionalBlue",
|
|
379054
379063
|
defaultTab: "general",
|
|
379055
379064
|
children: tabs
|
|
@@ -379966,7 +379975,7 @@ function buildToolUseContext(tools, readFileStateCache, toolPermissionContext, a
|
|
|
379966
379975
|
async function handleInitialize(options2) {
|
|
379967
379976
|
return {
|
|
379968
379977
|
name: "UR",
|
|
379969
|
-
version: "1.
|
|
379978
|
+
version: "1.58.0",
|
|
379970
379979
|
protocolVersion: "0.1.0",
|
|
379971
379980
|
workspaceRoot: options2.cwd,
|
|
379972
379981
|
capabilities: {
|
|
@@ -397074,7 +397083,7 @@ function getAllReleaseNotes(changelogContent = getStoredChangelogFromMemory()) {
|
|
|
397074
397083
|
return [];
|
|
397075
397084
|
}
|
|
397076
397085
|
}
|
|
397077
|
-
async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.
|
|
397086
|
+
async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.58.0") {
|
|
397078
397087
|
if (process.env.USER_TYPE === "ant") {
|
|
397079
397088
|
const changelog = "";
|
|
397080
397089
|
if (changelog) {
|
|
@@ -397101,7 +397110,7 @@ async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.57.4")
|
|
|
397101
397110
|
releaseNotes
|
|
397102
397111
|
};
|
|
397103
397112
|
}
|
|
397104
|
-
function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "1.
|
|
397113
|
+
function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "1.58.0") {
|
|
397105
397114
|
if (process.env.USER_TYPE === "ant") {
|
|
397106
397115
|
const changelog = "";
|
|
397107
397116
|
if (changelog) {
|
|
@@ -399958,7 +399967,7 @@ function getRecentActivitySync() {
|
|
|
399958
399967
|
return cachedActivity;
|
|
399959
399968
|
}
|
|
399960
399969
|
function getLogoDisplayData() {
|
|
399961
|
-
const version2 = process.env.DEMO_VERSION ?? "1.
|
|
399970
|
+
const version2 = process.env.DEMO_VERSION ?? "1.58.0";
|
|
399962
399971
|
const serverUrl = getDirectConnectServerUrl();
|
|
399963
399972
|
const displayPath = process.env.DEMO_VERSION ? "/code/ur" : getDisplayPath(getCwd());
|
|
399964
399973
|
const cwd2 = serverUrl ? `${displayPath} in ${serverUrl.replace(/^https?:\/\//, "")}` : displayPath;
|
|
@@ -400842,7 +400851,7 @@ function LogoV2() {
|
|
|
400842
400851
|
if ($2[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
400843
400852
|
t2 = () => {
|
|
400844
400853
|
const currentConfig2 = getGlobalConfig();
|
|
400845
|
-
if (currentConfig2.lastReleaseNotesSeen === "1.
|
|
400854
|
+
if (currentConfig2.lastReleaseNotesSeen === "1.58.0") {
|
|
400846
400855
|
return;
|
|
400847
400856
|
}
|
|
400848
400857
|
saveGlobalConfig(_temp327);
|
|
@@ -401527,12 +401536,12 @@ function LogoV2() {
|
|
|
401527
401536
|
return t41;
|
|
401528
401537
|
}
|
|
401529
401538
|
function _temp327(current) {
|
|
401530
|
-
if (current.lastReleaseNotesSeen === "1.
|
|
401539
|
+
if (current.lastReleaseNotesSeen === "1.58.0") {
|
|
401531
401540
|
return current;
|
|
401532
401541
|
}
|
|
401533
401542
|
return {
|
|
401534
401543
|
...current,
|
|
401535
|
-
lastReleaseNotesSeen: "1.
|
|
401544
|
+
lastReleaseNotesSeen: "1.58.0"
|
|
401536
401545
|
};
|
|
401537
401546
|
}
|
|
401538
401547
|
function _temp241(s_0) {
|
|
@@ -418330,7 +418339,7 @@ function compileAgenticCiWorkflow(specName = "default", options2 = {}) {
|
|
|
418330
418339
|
if (spec.name !== specName) {
|
|
418331
418340
|
throw new Error("Agentic CI workflow spec name does not match");
|
|
418332
418341
|
}
|
|
418333
|
-
const packageVersion = options2.packageVersion ?? (typeof MACRO !== "undefined" ? "1.
|
|
418342
|
+
const packageVersion = options2.packageVersion ?? (typeof MACRO !== "undefined" ? "1.58.0" : "1.58.0");
|
|
418334
418343
|
if (!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(packageVersion)) {
|
|
418335
418344
|
throw new Error("invalid ur-agent package version");
|
|
418336
418345
|
}
|
|
@@ -419323,7 +419332,7 @@ runner; \`ur trigger\` is the inbound parser that decides what to run.
|
|
|
419323
419332
|
path: ".github/workflows/ur.yml",
|
|
419324
419333
|
root: "project",
|
|
419325
419334
|
content: compileAgenticCiWorkflow("default", {
|
|
419326
|
-
packageVersion: typeof MACRO !== "undefined" ? "1.
|
|
419335
|
+
packageVersion: typeof MACRO !== "undefined" ? "1.58.0" : "1.58.0"
|
|
419327
419336
|
})
|
|
419328
419337
|
},
|
|
419329
419338
|
{
|
|
@@ -419386,7 +419395,7 @@ function value(tokens, flag) {
|
|
|
419386
419395
|
return index2 >= 0 ? tokens[index2 + 1] : undefined;
|
|
419387
419396
|
}
|
|
419388
419397
|
function cliVersion() {
|
|
419389
|
-
return typeof MACRO !== "undefined" ? "1.
|
|
419398
|
+
return typeof MACRO !== "undefined" ? "1.58.0" : "1.58.0";
|
|
419390
419399
|
}
|
|
419391
419400
|
function workflowPath(cwd2) {
|
|
419392
419401
|
return join159(cwd2, ".github", "workflows", "ur-agentic-ci.yml");
|
|
@@ -425242,7 +425251,7 @@ function createAcpStdioApp(deps) {
|
|
|
425242
425251
|
}
|
|
425243
425252
|
},
|
|
425244
425253
|
authMethods: [],
|
|
425245
|
-
agentInfo: { name: "UR-Nexus", version: "1.
|
|
425254
|
+
agentInfo: { name: "UR-Nexus", version: "1.58.0" }
|
|
425246
425255
|
})).onRequest("authenticate", () => ({})).onRequest("session/new", async (context6) => {
|
|
425247
425256
|
const result = runtime2.newSession(context6.params.cwd, context6.params.mcpServers, context6.params.additionalDirectories);
|
|
425248
425257
|
await runtime2.announce({
|
|
@@ -425339,7 +425348,7 @@ function createAcpStdioAgent(deps) {
|
|
|
425339
425348
|
}
|
|
425340
425349
|
},
|
|
425341
425350
|
authMethods: [],
|
|
425342
|
-
agentInfo: { name: "UR-Nexus", version: "1.
|
|
425351
|
+
agentInfo: { name: "UR-Nexus", version: "1.58.0" }
|
|
425343
425352
|
});
|
|
425344
425353
|
return;
|
|
425345
425354
|
case "authenticate":
|
|
@@ -434461,7 +434470,18 @@ var init_thread2 = __esm(() => {
|
|
|
434461
434470
|
});
|
|
434462
434471
|
|
|
434463
434472
|
// src/services/agents/inspector.ts
|
|
434464
|
-
import { existsSync as existsSync64, readFileSync as readFileSync61 } from "fs";
|
|
434473
|
+
import { existsSync as existsSync64, readdirSync as readdirSync22, readFileSync as readFileSync61 } from "fs";
|
|
434474
|
+
import { join as join182 } from "path";
|
|
434475
|
+
function emptyUsage2() {
|
|
434476
|
+
return {
|
|
434477
|
+
inputTokens: 0,
|
|
434478
|
+
outputTokens: 0,
|
|
434479
|
+
cacheReadInputTokens: 0,
|
|
434480
|
+
cacheCreationInputTokens: 0,
|
|
434481
|
+
costUSD: 0,
|
|
434482
|
+
model: null
|
|
434483
|
+
};
|
|
434484
|
+
}
|
|
434465
434485
|
function preview3(value2, max2 = PREVIEW_CHARS) {
|
|
434466
434486
|
const text = value2.replace(/\s+/g, " ").trim();
|
|
434467
434487
|
if (text.length <= max2)
|
|
@@ -434489,10 +434509,13 @@ function inspectMessages(messages) {
|
|
|
434489
434509
|
errors: 0,
|
|
434490
434510
|
verdicts: { pass: 0, fail: 0, partial: 0 },
|
|
434491
434511
|
tokens: { input: 0, output: 0 },
|
|
434492
|
-
toolUsage: {}
|
|
434512
|
+
toolUsage: {},
|
|
434513
|
+
costUSD: 0,
|
|
434514
|
+
mainThreadCostUSD: 0
|
|
434493
434515
|
};
|
|
434494
434516
|
const agents = [];
|
|
434495
434517
|
const pendingById = new Map;
|
|
434518
|
+
const byAgentId = new Map;
|
|
434496
434519
|
for (const message of messages) {
|
|
434497
434520
|
const role = message.message?.role ?? message.type;
|
|
434498
434521
|
if (role === "assistant")
|
|
@@ -434501,6 +434524,26 @@ function inspectMessages(messages) {
|
|
|
434501
434524
|
if (usage11) {
|
|
434502
434525
|
summary2.tokens.input += usage11.input_tokens ?? 0;
|
|
434503
434526
|
summary2.tokens.output += usage11.output_tokens ?? 0;
|
|
434527
|
+
const tokens = {
|
|
434528
|
+
inputTokens: usage11.input_tokens ?? 0,
|
|
434529
|
+
outputTokens: usage11.output_tokens ?? 0,
|
|
434530
|
+
cacheReadInputTokens: usage11.cache_read_input_tokens ?? 0,
|
|
434531
|
+
cacheCreationInputTokens: usage11.cache_creation_input_tokens ?? 0
|
|
434532
|
+
};
|
|
434533
|
+
const model = message.message?.model ?? null;
|
|
434534
|
+
const cost2 = model ? calculateCostFromTokens(model, tokens) : 0;
|
|
434535
|
+
summary2.costUSD += cost2;
|
|
434536
|
+
const owner = message.agentId ? byAgentId.get(message.agentId) : undefined;
|
|
434537
|
+
if (owner) {
|
|
434538
|
+
owner.usage.inputTokens += tokens.inputTokens;
|
|
434539
|
+
owner.usage.outputTokens += tokens.outputTokens;
|
|
434540
|
+
owner.usage.cacheReadInputTokens += tokens.cacheReadInputTokens;
|
|
434541
|
+
owner.usage.cacheCreationInputTokens += tokens.cacheCreationInputTokens;
|
|
434542
|
+
owner.usage.costUSD += cost2;
|
|
434543
|
+
owner.usage.model ??= model;
|
|
434544
|
+
} else {
|
|
434545
|
+
summary2.mainThreadCostUSD += cost2;
|
|
434546
|
+
}
|
|
434504
434547
|
}
|
|
434505
434548
|
const content = message.message?.content;
|
|
434506
434549
|
if (!Array.isArray(content)) {
|
|
@@ -434530,7 +434573,8 @@ function inspectMessages(messages) {
|
|
|
434530
434573
|
promptPreview: preview3(String(input.prompt ?? "")),
|
|
434531
434574
|
resultPreview: "",
|
|
434532
434575
|
status: "pending",
|
|
434533
|
-
verdict: null
|
|
434576
|
+
verdict: null,
|
|
434577
|
+
usage: emptyUsage2()
|
|
434534
434578
|
};
|
|
434535
434579
|
agents.push(run3);
|
|
434536
434580
|
if (raw.id)
|
|
@@ -434619,9 +434663,87 @@ function formatInspection(report, json2) {
|
|
|
434619
434663
|
return lines.join(`
|
|
434620
434664
|
`);
|
|
434621
434665
|
}
|
|
434666
|
+
function summarizeSubagentCosts(subagentsDir) {
|
|
434667
|
+
let entries;
|
|
434668
|
+
try {
|
|
434669
|
+
entries = readdirSync22(subagentsDir);
|
|
434670
|
+
} catch {
|
|
434671
|
+
return [];
|
|
434672
|
+
}
|
|
434673
|
+
const rows = [];
|
|
434674
|
+
for (const entry of entries.sort()) {
|
|
434675
|
+
const matched = /^agent-(.+)\.jsonl$/.exec(entry);
|
|
434676
|
+
if (!matched)
|
|
434677
|
+
continue;
|
|
434678
|
+
let messages;
|
|
434679
|
+
try {
|
|
434680
|
+
messages = loadTranscript(join182(subagentsDir, entry));
|
|
434681
|
+
} catch {
|
|
434682
|
+
continue;
|
|
434683
|
+
}
|
|
434684
|
+
const row = {
|
|
434685
|
+
agentId: matched[1],
|
|
434686
|
+
model: null,
|
|
434687
|
+
messages: messages.length,
|
|
434688
|
+
inputTokens: 0,
|
|
434689
|
+
outputTokens: 0,
|
|
434690
|
+
cacheReadInputTokens: 0,
|
|
434691
|
+
cacheCreationInputTokens: 0,
|
|
434692
|
+
costUSD: 0
|
|
434693
|
+
};
|
|
434694
|
+
for (const message of messages) {
|
|
434695
|
+
const usage11 = message.message?.usage;
|
|
434696
|
+
if (!usage11)
|
|
434697
|
+
continue;
|
|
434698
|
+
const tokens = {
|
|
434699
|
+
inputTokens: usage11.input_tokens ?? 0,
|
|
434700
|
+
outputTokens: usage11.output_tokens ?? 0,
|
|
434701
|
+
cacheReadInputTokens: usage11.cache_read_input_tokens ?? 0,
|
|
434702
|
+
cacheCreationInputTokens: usage11.cache_creation_input_tokens ?? 0
|
|
434703
|
+
};
|
|
434704
|
+
row.inputTokens += tokens.inputTokens;
|
|
434705
|
+
row.outputTokens += tokens.outputTokens;
|
|
434706
|
+
row.cacheReadInputTokens += tokens.cacheReadInputTokens;
|
|
434707
|
+
row.cacheCreationInputTokens += tokens.cacheCreationInputTokens;
|
|
434708
|
+
const model = message.message?.model ?? null;
|
|
434709
|
+
row.model ??= model;
|
|
434710
|
+
if (model)
|
|
434711
|
+
row.costUSD += calculateCostFromTokens(model, tokens);
|
|
434712
|
+
}
|
|
434713
|
+
rows.push(row);
|
|
434714
|
+
}
|
|
434715
|
+
return rows.sort((a2, b) => b.costUSD - a2.costUSD);
|
|
434716
|
+
}
|
|
434717
|
+
function formatSubagentCosts(rows, json2) {
|
|
434718
|
+
if (json2)
|
|
434719
|
+
return JSON.stringify({ subagents: rows }, null, 2);
|
|
434720
|
+
if (rows.length === 0) {
|
|
434721
|
+
return "No subagent transcripts found for this session.";
|
|
434722
|
+
}
|
|
434723
|
+
const billed = rows.some((row) => row.costUSD > 0);
|
|
434724
|
+
const width = Math.max(...rows.map((row) => row.agentId.length), 5);
|
|
434725
|
+
const lines = ["Per-agent usage", ""];
|
|
434726
|
+
for (const row of rows) {
|
|
434727
|
+
const cost2 = billed ? ` ${formatUSD(row.costUSD).padStart(9)}` : "";
|
|
434728
|
+
lines.push(` ${row.agentId.padEnd(width)} ${String(row.inputTokens).padStart(9)} in ` + `${String(row.outputTokens).padStart(8)} out${cost2} ${row.model ?? "unknown model"}`);
|
|
434729
|
+
}
|
|
434730
|
+
const totalIn = rows.reduce((sum, row) => sum + row.inputTokens, 0);
|
|
434731
|
+
const totalOut = rows.reduce((sum, row) => sum + row.outputTokens, 0);
|
|
434732
|
+
const total = rows.reduce((sum, row) => sum + row.costUSD, 0);
|
|
434733
|
+
lines.push(` ${"-".repeat(width)} ${"-".repeat(12)} ${"-".repeat(12)}`, ` ${"total".padEnd(width)} ${String(totalIn).padStart(9)} in ` + `${String(totalOut).padStart(8)} out${billed ? ` ${formatUSD(total).padStart(9)}` : ""}`);
|
|
434734
|
+
if (!billed) {
|
|
434735
|
+
lines.push("", "Cost omitted: the active runtime is local and unbilled.");
|
|
434736
|
+
}
|
|
434737
|
+
return lines.join(`
|
|
434738
|
+
`);
|
|
434739
|
+
}
|
|
434740
|
+
function formatUSD(value2) {
|
|
434741
|
+
return value2 > 0 && value2 < 0.01 ? "<$0.01" : `$${value2.toFixed(2)}`;
|
|
434742
|
+
}
|
|
434622
434743
|
var AGENT_TOOL_NAMES, PREVIEW_CHARS = 160, VERDICT_RE2;
|
|
434623
434744
|
var init_inspector = __esm(() => {
|
|
434624
434745
|
init_json();
|
|
434746
|
+
init_modelCost();
|
|
434625
434747
|
AGENT_TOOL_NAMES = new Set(["Agent", "Task"]);
|
|
434626
434748
|
VERDICT_RE2 = /\bVERDICT:\s*(PASS|FAIL|PARTIAL)\b/i;
|
|
434627
434749
|
});
|
|
@@ -434631,11 +434753,33 @@ var exports_agent_inspect = {};
|
|
|
434631
434753
|
__export(exports_agent_inspect, {
|
|
434632
434754
|
call: () => call78
|
|
434633
434755
|
});
|
|
434756
|
+
import { dirname as dirname72 } from "path";
|
|
434757
|
+
function resolveSessionSubagentsDir() {
|
|
434758
|
+
try {
|
|
434759
|
+
return dirname72(getAgentTranscriptPath("probe"));
|
|
434760
|
+
} catch {
|
|
434761
|
+
return null;
|
|
434762
|
+
}
|
|
434763
|
+
}
|
|
434634
434764
|
var call78 = async (args, context6) => {
|
|
434635
434765
|
const tokens = parseArguments2(args);
|
|
434636
434766
|
const json2 = tokens.includes("--json");
|
|
434637
434767
|
const fileIndex2 = tokens.indexOf("--file");
|
|
434638
434768
|
const filePath = fileIndex2 >= 0 ? tokens[fileIndex2 + 1] : undefined;
|
|
434769
|
+
const costsIndex = tokens.indexOf("--costs");
|
|
434770
|
+
if (costsIndex >= 0) {
|
|
434771
|
+
const dir = tokens[costsIndex + 1] ?? resolveSessionSubagentsDir();
|
|
434772
|
+
if (!dir) {
|
|
434773
|
+
return {
|
|
434774
|
+
type: "text",
|
|
434775
|
+
value: "Could not locate a session directory. Pass one: ur agent-inspect --costs <sessionDir>/subagents"
|
|
434776
|
+
};
|
|
434777
|
+
}
|
|
434778
|
+
return {
|
|
434779
|
+
type: "text",
|
|
434780
|
+
value: formatSubagentCosts(summarizeSubagentCosts(dir), json2)
|
|
434781
|
+
};
|
|
434782
|
+
}
|
|
434639
434783
|
let messages;
|
|
434640
434784
|
if (filePath) {
|
|
434641
434785
|
try {
|
|
@@ -434661,6 +434805,7 @@ var call78 = async (args, context6) => {
|
|
|
434661
434805
|
};
|
|
434662
434806
|
var init_agent_inspect = __esm(() => {
|
|
434663
434807
|
init_inspector();
|
|
434808
|
+
init_sessionStorage();
|
|
434664
434809
|
init_argumentSubstitution();
|
|
434665
434810
|
});
|
|
434666
434811
|
|
|
@@ -434672,7 +434817,7 @@ var init_agent_inspect2 = __esm(() => {
|
|
|
434672
434817
|
name: "agent-inspect",
|
|
434673
434818
|
aliases: ["inspect-agents"],
|
|
434674
434819
|
description: "Reconstruct a per-subagent timeline (spawns, prompts, results, verdicts, tools, tokens) from this session or a transcript file",
|
|
434675
|
-
argumentHint: "[--file <path>] [--json]",
|
|
434820
|
+
argumentHint: "[--file <path>] [--costs [subagentsDir]] [--json]",
|
|
434676
434821
|
supportsNonInteractive: true,
|
|
434677
434822
|
load: () => Promise.resolve().then(() => (init_agent_inspect(), exports_agent_inspect))
|
|
434678
434823
|
};
|
|
@@ -434844,19 +434989,19 @@ import {
|
|
|
434844
434989
|
existsSync as existsSync65,
|
|
434845
434990
|
mkdirSync as mkdirSync46,
|
|
434846
434991
|
readFileSync as readFileSync62,
|
|
434847
|
-
readdirSync as
|
|
434992
|
+
readdirSync as readdirSync23,
|
|
434848
434993
|
statSync as statSync23,
|
|
434849
434994
|
writeFileSync as writeFileSync46
|
|
434850
434995
|
} from "fs";
|
|
434851
|
-
import { basename as basename46, join as
|
|
434996
|
+
import { basename as basename46, join as join183, relative as relative42, resolve as resolve59 } from "path";
|
|
434852
434997
|
function knowledgeDir(cwd2) {
|
|
434853
|
-
return
|
|
434998
|
+
return join183(cwd2, ".ur", "knowledge");
|
|
434854
434999
|
}
|
|
434855
435000
|
function sourcesPath(cwd2) {
|
|
434856
|
-
return
|
|
435001
|
+
return join183(knowledgeDir(cwd2), "sources.json");
|
|
434857
435002
|
}
|
|
434858
435003
|
function indexPath2(cwd2) {
|
|
434859
|
-
return
|
|
435004
|
+
return join183(knowledgeDir(cwd2), "index", "index.json");
|
|
434860
435005
|
}
|
|
434861
435006
|
function tokenize7(value2) {
|
|
434862
435007
|
return [...new Set(value2.toLowerCase().match(/[a-z0-9_]{3,}/g) ?? [])];
|
|
@@ -434926,14 +435071,14 @@ function collectFiles(cwd2, source) {
|
|
|
434926
435071
|
return;
|
|
434927
435072
|
let entries;
|
|
434928
435073
|
try {
|
|
434929
|
-
entries =
|
|
435074
|
+
entries = readdirSync23(dir);
|
|
434930
435075
|
} catch {
|
|
434931
435076
|
return;
|
|
434932
435077
|
}
|
|
434933
435078
|
for (const entry of entries) {
|
|
434934
435079
|
if (entry.startsWith(".") || entry === "node_modules")
|
|
434935
435080
|
continue;
|
|
434936
|
-
const full =
|
|
435081
|
+
const full = join183(dir, entry);
|
|
434937
435082
|
const stat42 = statSync23(full);
|
|
434938
435083
|
if (stat42.isDirectory())
|
|
434939
435084
|
walk2(full);
|
|
@@ -435043,7 +435188,7 @@ async function buildIndex(cwd2, options2 = {}) {
|
|
|
435043
435188
|
embedModel,
|
|
435044
435189
|
chunks
|
|
435045
435190
|
};
|
|
435046
|
-
mkdirSync46(
|
|
435191
|
+
mkdirSync46(join183(knowledgeDir(cwd2), "index"), { recursive: true });
|
|
435047
435192
|
writeFileSync46(indexPath2(cwd2), `${JSON.stringify(index2, null, 2)}
|
|
435048
435193
|
`);
|
|
435049
435194
|
return index2;
|
|
@@ -435092,7 +435237,7 @@ function pruneKnowledge(cwd2, options2) {
|
|
|
435092
435237
|
index2.chunks = index2.chunks.filter((chunk) => keptIds.has(chunk.sourceId));
|
|
435093
435238
|
removedChunks = before - index2.chunks.length;
|
|
435094
435239
|
index2.builtAt = new Date().toISOString();
|
|
435095
|
-
mkdirSync46(
|
|
435240
|
+
mkdirSync46(join183(knowledgeDir(cwd2), "index"), { recursive: true });
|
|
435096
435241
|
writeFileSync46(indexPath2(cwd2), `${JSON.stringify(index2, null, 2)}
|
|
435097
435242
|
`);
|
|
435098
435243
|
}
|
|
@@ -435281,16 +435426,16 @@ var init_knowledge3 = __esm(() => {
|
|
|
435281
435426
|
});
|
|
435282
435427
|
|
|
435283
435428
|
// src/services/agents/crew.ts
|
|
435284
|
-
import { existsSync as existsSync66, mkdirSync as mkdirSync47, readdirSync as
|
|
435285
|
-
import { join as
|
|
435429
|
+
import { existsSync as existsSync66, mkdirSync as mkdirSync47, readdirSync as readdirSync24, readFileSync as readFileSync63, unlinkSync as unlinkSync12, writeFileSync as writeFileSync47 } from "fs";
|
|
435430
|
+
import { join as join184 } from "path";
|
|
435286
435431
|
function crewDir(cwd2) {
|
|
435287
|
-
return
|
|
435432
|
+
return join184(cwd2, ".ur", "crew");
|
|
435288
435433
|
}
|
|
435289
435434
|
function sanitizeCrewName(name) {
|
|
435290
435435
|
return name.trim().replace(/[^a-zA-Z0-9_-]/g, "-");
|
|
435291
435436
|
}
|
|
435292
435437
|
function crewPath(cwd2, name) {
|
|
435293
|
-
return
|
|
435438
|
+
return join184(crewDir(cwd2), `${sanitizeCrewName(name)}.json`);
|
|
435294
435439
|
}
|
|
435295
435440
|
function isCrewSpec(value2) {
|
|
435296
435441
|
return !!value2 && typeof value2 === "object" && Array.isArray(value2.tasks) && typeof value2.goal === "string";
|
|
@@ -435299,7 +435444,7 @@ function listCrews(cwd2) {
|
|
|
435299
435444
|
const dir = crewDir(cwd2);
|
|
435300
435445
|
if (!existsSync66(dir))
|
|
435301
435446
|
return [];
|
|
435302
|
-
return
|
|
435447
|
+
return readdirSync24(dir).filter((file2) => file2.endsWith(".json")).map((file2) => safeParseJSON(readFileSync63(join184(dir, file2), "utf-8"), false)).filter(isCrewSpec);
|
|
435303
435448
|
}
|
|
435304
435449
|
function loadCrew(cwd2, name) {
|
|
435305
435450
|
const path22 = crewPath(cwd2, name);
|
|
@@ -435476,11 +435621,11 @@ function taskToStep(task, lead) {
|
|
|
435476
435621
|
return { id: task.id, name: task.title, agent: lead, prompt: task.prompt };
|
|
435477
435622
|
}
|
|
435478
435623
|
async function ensureWorktree(cwd2, crew, worker) {
|
|
435479
|
-
const path22 =
|
|
435624
|
+
const path22 = join184(crewDir(cwd2), ".worktrees", `${crew}-${worker}`);
|
|
435480
435625
|
const branch = `ur/crew/${crew}/${worker}`;
|
|
435481
435626
|
if (existsSync66(path22))
|
|
435482
435627
|
return path22;
|
|
435483
|
-
mkdirSync47(
|
|
435628
|
+
mkdirSync47(join184(crewDir(cwd2), ".worktrees"), { recursive: true });
|
|
435484
435629
|
const result = await execFileNoThrowWithCwd("git", ["worktree", "add", "-b", branch, path22], { cwd: cwd2, timeout: 60000, preserveOutputOnError: true });
|
|
435485
435630
|
return result.code === 0 ? path22 : null;
|
|
435486
435631
|
}
|
|
@@ -435914,22 +436059,22 @@ var init_crew3 = __esm(() => {
|
|
|
435914
436059
|
});
|
|
435915
436060
|
|
|
435916
436061
|
// src/services/agents/goals.ts
|
|
435917
|
-
import { existsSync as existsSync67, mkdirSync as mkdirSync48, readdirSync as
|
|
435918
|
-
import { join as
|
|
436062
|
+
import { existsSync as existsSync67, mkdirSync as mkdirSync48, readdirSync as readdirSync25, readFileSync as readFileSync64, unlinkSync as unlinkSync13, writeFileSync as writeFileSync48 } from "fs";
|
|
436063
|
+
import { join as join185 } from "path";
|
|
435919
436064
|
function goalsDir(cwd2) {
|
|
435920
|
-
return
|
|
436065
|
+
return join185(cwd2, ".ur", "goals");
|
|
435921
436066
|
}
|
|
435922
436067
|
function sanitizeGoalName(name) {
|
|
435923
436068
|
return name.trim().replace(/[^a-zA-Z0-9_-]/g, "-");
|
|
435924
436069
|
}
|
|
435925
436070
|
function goalPath(cwd2, name) {
|
|
435926
|
-
return
|
|
436071
|
+
return join185(goalsDir(cwd2), `${sanitizeGoalName(name)}.json`);
|
|
435927
436072
|
}
|
|
435928
436073
|
function listGoals(cwd2) {
|
|
435929
436074
|
const dir = goalsDir(cwd2);
|
|
435930
436075
|
if (!existsSync67(dir))
|
|
435931
436076
|
return [];
|
|
435932
|
-
return
|
|
436077
|
+
return readdirSync25(dir).filter((file2) => file2.endsWith(".json")).map((file2) => safeParseJSON(readFileSync64(join185(dir, file2), "utf-8"), false)).filter((spec) => isGoalSpec(spec)).sort((a2, b) => a2.updatedAt < b.updatedAt ? 1 : -1);
|
|
435933
436078
|
}
|
|
435934
436079
|
function isGoalSpec(value2) {
|
|
435935
436080
|
return !!value2 && typeof value2 === "object" && typeof value2.name === "string" && typeof value2.objective === "string";
|
|
@@ -436258,7 +436403,7 @@ var init_verificationProofs = __esm(() => {
|
|
|
436258
436403
|
|
|
436259
436404
|
// src/services/agents/kernel.ts
|
|
436260
436405
|
import { existsSync as existsSync68, readFileSync as readFileSync65 } from "fs";
|
|
436261
|
-
import { join as
|
|
436406
|
+
import { join as join186 } from "path";
|
|
436262
436407
|
function defaultGuard(skipPermissions) {
|
|
436263
436408
|
return {
|
|
436264
436409
|
canUseTool: (_toolName, _input) => ({
|
|
@@ -436276,8 +436421,8 @@ function defaultRouter() {
|
|
|
436276
436421
|
function defaultMemory(cwd2) {
|
|
436277
436422
|
return {
|
|
436278
436423
|
loadMemorySnippet: (scope, agentType) => {
|
|
436279
|
-
const base2 = scope === "project" ?
|
|
436280
|
-
const path22 =
|
|
436424
|
+
const base2 = scope === "project" ? join186(cwd2, ".ur", "memory") : join186(cwd2, ".ur", "memory");
|
|
436425
|
+
const path22 = join186(base2, `${agentType}.md`);
|
|
436281
436426
|
const legacy = existsSync68(path22) ? readFileSync65(path22, "utf-8") : "";
|
|
436282
436427
|
if (scope !== "project")
|
|
436283
436428
|
return legacy || null;
|
|
@@ -436683,23 +436828,23 @@ __export(exports_spec, {
|
|
|
436683
436828
|
import {
|
|
436684
436829
|
existsSync as existsSync69,
|
|
436685
436830
|
mkdirSync as mkdirSync49,
|
|
436686
|
-
readdirSync as
|
|
436831
|
+
readdirSync as readdirSync26,
|
|
436687
436832
|
readFileSync as readFileSync66,
|
|
436688
436833
|
rmSync as rmSync14,
|
|
436689
436834
|
writeFileSync as writeFileSync49
|
|
436690
436835
|
} from "fs";
|
|
436691
|
-
import { join as
|
|
436836
|
+
import { join as join187 } from "path";
|
|
436692
436837
|
function specsDir(cwd2) {
|
|
436693
|
-
return
|
|
436838
|
+
return join187(cwd2, ".ur", "specs");
|
|
436694
436839
|
}
|
|
436695
436840
|
function slugifySpecName(name) {
|
|
436696
436841
|
return name.trim().toLowerCase().replace(/[^a-z0-9_-]+/g, "-").replace(/^-+|-+$/g, "") || "spec";
|
|
436697
436842
|
}
|
|
436698
436843
|
function specDir(cwd2, name) {
|
|
436699
|
-
return
|
|
436844
|
+
return join187(specsDir(cwd2), slugifySpecName(name));
|
|
436700
436845
|
}
|
|
436701
436846
|
function metaPath(cwd2, name) {
|
|
436702
|
-
return
|
|
436847
|
+
return join187(specDir(cwd2, name), "spec.json");
|
|
436703
436848
|
}
|
|
436704
436849
|
function phaseFile(phase) {
|
|
436705
436850
|
return `${phase}.md`;
|
|
@@ -436708,7 +436853,7 @@ function listSpecs2(cwd2) {
|
|
|
436708
436853
|
const dir = specsDir(cwd2);
|
|
436709
436854
|
if (!existsSync69(dir))
|
|
436710
436855
|
return [];
|
|
436711
|
-
return
|
|
436856
|
+
return readdirSync26(dir).filter((entry) => existsSync69(join187(dir, entry, "spec.json"))).map((entry) => safeParseJSON(readFileSync66(join187(dir, entry, "spec.json"), "utf-8"), false)).filter((m) => !!m && typeof m === "object" && ("goal" in m));
|
|
436712
436857
|
}
|
|
436713
436858
|
function loadSpec(cwd2, name) {
|
|
436714
436859
|
const path22 = metaPath(cwd2, name);
|
|
@@ -436723,12 +436868,12 @@ function saveMeta(cwd2, meta) {
|
|
|
436723
436868
|
`);
|
|
436724
436869
|
}
|
|
436725
436870
|
function readPhase(cwd2, name, phase) {
|
|
436726
|
-
const path22 =
|
|
436871
|
+
const path22 = join187(specDir(cwd2, name), phaseFile(phase));
|
|
436727
436872
|
return existsSync69(path22) ? readFileSync66(path22, "utf-8") : null;
|
|
436728
436873
|
}
|
|
436729
436874
|
function writePhase(cwd2, name, phase, body) {
|
|
436730
436875
|
mkdirSync49(specDir(cwd2, name), { recursive: true });
|
|
436731
|
-
writeFileSync49(
|
|
436876
|
+
writeFileSync49(join187(specDir(cwd2, name), phaseFile(phase)), body.endsWith(`
|
|
436732
436877
|
`) ? body : `${body}
|
|
436733
436878
|
`);
|
|
436734
436879
|
}
|
|
@@ -436986,12 +437131,12 @@ var init_spec = __esm(() => {
|
|
|
436986
437131
|
|
|
436987
437132
|
// src/services/agents/specVerifier.ts
|
|
436988
437133
|
import { existsSync as existsSync70, mkdirSync as mkdirSync50, readFileSync as readFileSync67, writeFileSync as writeFileSync50 } from "fs";
|
|
436989
|
-
import { join as
|
|
437134
|
+
import { join as join188 } from "path";
|
|
436990
437135
|
function recordPath(cwd2, name) {
|
|
436991
|
-
return
|
|
437136
|
+
return join188(cwd2, ".ur", "specs", name, RECORD_FILE);
|
|
436992
437137
|
}
|
|
436993
437138
|
function reportPath(cwd2, name) {
|
|
436994
|
-
return
|
|
437139
|
+
return join188(cwd2, ".ur", "specs", name, REPORT_FILE);
|
|
436995
437140
|
}
|
|
436996
437141
|
function loadVerificationRecord(cwd2, name) {
|
|
436997
437142
|
const path22 = recordPath(cwd2, name);
|
|
@@ -437011,7 +437156,7 @@ function listVerificationRecords(cwd2, name) {
|
|
|
437011
437156
|
}
|
|
437012
437157
|
function saveVerificationRecord(cwd2, name, record3) {
|
|
437013
437158
|
const path22 = recordPath(cwd2, name);
|
|
437014
|
-
mkdirSync50(
|
|
437159
|
+
mkdirSync50(join188(cwd2, ".ur", "specs", name), { recursive: true });
|
|
437015
437160
|
writeFileSync50(path22, `${JSON.stringify(record3, null, 2)}
|
|
437016
437161
|
`);
|
|
437017
437162
|
}
|
|
@@ -437465,7 +437610,7 @@ var init_spec3 = __esm(() => {
|
|
|
437465
437610
|
|
|
437466
437611
|
// src/services/agents/escalation.ts
|
|
437467
437612
|
import { existsSync as existsSync71, mkdirSync as mkdirSync51, readFileSync as readFileSync68, writeFileSync as writeFileSync51 } from "fs";
|
|
437468
|
-
import { join as
|
|
437613
|
+
import { join as join189 } from "path";
|
|
437469
437614
|
function scoreOracle(model) {
|
|
437470
437615
|
let score = (model.contextLength ?? 0) / 1000;
|
|
437471
437616
|
if (model.likelyCode)
|
|
@@ -437647,7 +437792,7 @@ ${question}`,
|
|
|
437647
437792
|
return { model: tiers.oracle, output: out.output, verdict: out.verdict ?? null };
|
|
437648
437793
|
}
|
|
437649
437794
|
function policyPath(cwd2) {
|
|
437650
|
-
return
|
|
437795
|
+
return join189(cwd2, ".ur", "escalation.json");
|
|
437651
437796
|
}
|
|
437652
437797
|
function loadPolicy(cwd2) {
|
|
437653
437798
|
const path22 = policyPath(cwd2);
|
|
@@ -437657,7 +437802,7 @@ function loadPolicy(cwd2) {
|
|
|
437657
437802
|
return parsed && typeof parsed === "object" ? parsed : {};
|
|
437658
437803
|
}
|
|
437659
437804
|
function savePolicy(cwd2, policy) {
|
|
437660
|
-
mkdirSync51(
|
|
437805
|
+
mkdirSync51(join189(cwd2, ".ur"), { recursive: true });
|
|
437661
437806
|
writeFileSync51(policyPath(cwd2), `${JSON.stringify(policy, null, 2)}
|
|
437662
437807
|
`);
|
|
437663
437808
|
}
|
|
@@ -437838,12 +437983,12 @@ import {
|
|
|
437838
437983
|
lstatSync as lstatSync15,
|
|
437839
437984
|
renameSync as renameSync13
|
|
437840
437985
|
} from "fs";
|
|
437841
|
-
import { join as
|
|
437986
|
+
import { join as join190 } from "path";
|
|
437842
437987
|
function learningDir2(cwd2) {
|
|
437843
|
-
return
|
|
437988
|
+
return join190(cwd2, ".ur", "learning");
|
|
437844
437989
|
}
|
|
437845
437990
|
function storePath(cwd2) {
|
|
437846
|
-
return
|
|
437991
|
+
return join190(learningDir2(cwd2), "playbooks.json");
|
|
437847
437992
|
}
|
|
437848
437993
|
function digest3(value2) {
|
|
437849
437994
|
return `sha256:${createHash41("sha256").update(JSON.stringify(value2)).digest("hex")}`;
|
|
@@ -437887,10 +438032,10 @@ function getLearnedPlaybook(cwd2, idOrName) {
|
|
|
437887
438032
|
return item ? structuredClone(item) : null;
|
|
437888
438033
|
}
|
|
437889
438034
|
function planTask(cwd2, runId) {
|
|
437890
|
-
const path22 =
|
|
438035
|
+
const path22 = join190(cwd2, ".ur", "runs", runId, "plan.json");
|
|
437891
438036
|
if (!existsSync72(path22))
|
|
437892
438037
|
return runId;
|
|
437893
|
-
const raw = readPrivateText(
|
|
438038
|
+
const raw = readPrivateText(join190(cwd2, ".ur", "runs", runId), path22, 1024 * 1024);
|
|
437894
438039
|
if (!raw)
|
|
437895
438040
|
return runId;
|
|
437896
438041
|
const parsed = safeParseJSON(raw, false);
|
|
@@ -438199,8 +438344,8 @@ function disableLearnedPlaybook(cwd2, id, options2 = {}) {
|
|
|
438199
438344
|
if (!stat42.isFile() || stat42.isSymbolicLink() || !workflow2 || JSON.stringify(workflow2) !== JSON.stringify(candidate.workflow)) {
|
|
438200
438345
|
throw new Error("Learned workflow changed after promotion; refusing to move it");
|
|
438201
438346
|
}
|
|
438202
|
-
const archiveDir =
|
|
438203
|
-
const archivePath =
|
|
438347
|
+
const archiveDir = join190(learningDir2(cwd2), "disabled");
|
|
438348
|
+
const archivePath = join190(archiveDir, `${candidate.id}-${digest3(candidate.workflow).slice(7, 23)}.yaml.disabled`);
|
|
438204
438349
|
if (existsSync72(archivePath)) {
|
|
438205
438350
|
throw new Error("Disabled workflow archive already exists");
|
|
438206
438351
|
}
|
|
@@ -438614,7 +438759,7 @@ var init_guardrails3 = __esm(() => {
|
|
|
438614
438759
|
|
|
438615
438760
|
// src/services/agents/execTarget.ts
|
|
438616
438761
|
import { existsSync as existsSync74, mkdirSync as mkdirSync52, readFileSync as readFileSync70, writeFileSync as writeFileSync52 } from "fs";
|
|
438617
|
-
import { join as
|
|
438762
|
+
import { join as join191 } from "path";
|
|
438618
438763
|
function isContainerized(config3) {
|
|
438619
438764
|
return config3.kind !== "local";
|
|
438620
438765
|
}
|
|
@@ -438638,10 +438783,10 @@ function wrapCommand(config3, command5, cwd2) {
|
|
|
438638
438783
|
return { file: "docker", args: buildDockerArgs(config3, command5, cwd2) };
|
|
438639
438784
|
}
|
|
438640
438785
|
function configPath(cwd2) {
|
|
438641
|
-
return
|
|
438786
|
+
return join191(cwd2, ".ur", "devcontainer.json");
|
|
438642
438787
|
}
|
|
438643
438788
|
function readDevcontainerImage(cwd2) {
|
|
438644
|
-
const path22 =
|
|
438789
|
+
const path22 = join191(cwd2, ".devcontainer", "devcontainer.json");
|
|
438645
438790
|
if (!existsSync74(path22))
|
|
438646
438791
|
return;
|
|
438647
438792
|
const parsed = safeParseJSON(readFileSync70(path22, "utf-8"), false);
|
|
@@ -438681,7 +438826,7 @@ function defaultExecTargetConfig(image = "node:22-bookworm") {
|
|
|
438681
438826
|
}
|
|
438682
438827
|
function scaffoldExecTarget(cwd2, options2 = {}) {
|
|
438683
438828
|
const path22 = configPath(cwd2);
|
|
438684
|
-
mkdirSync52(
|
|
438829
|
+
mkdirSync52(join191(cwd2, ".ur"), { recursive: true });
|
|
438685
438830
|
if (existsSync74(path22) && options2.force !== true)
|
|
438686
438831
|
return { path: path22, created: false };
|
|
438687
438832
|
writeFileSync52(path22, `${JSON.stringify(defaultExecTargetConfig(options2.image), null, 2)}
|
|
@@ -439111,7 +439256,7 @@ var init_desktopQaSchema = __esm(() => {
|
|
|
439111
439256
|
|
|
439112
439257
|
// src/services/qa/electronDesktopQaDriver.ts
|
|
439113
439258
|
import { mkdirSync as mkdirSync53 } from "fs";
|
|
439114
|
-
import { isAbsolute as isAbsolute40, join as
|
|
439259
|
+
import { isAbsolute as isAbsolute40, join as join192, resolve as resolve60 } from "path";
|
|
439115
439260
|
function buildDesktopQaEnvironment(source = process.env, explicit = {}) {
|
|
439116
439261
|
const safe = {};
|
|
439117
439262
|
for (const [name, value2] of Object.entries(source)) {
|
|
@@ -439267,7 +439412,7 @@ var init_electronDesktopQaDriver = __esm(() => {
|
|
|
439267
439412
|
if (privacyError)
|
|
439268
439413
|
throw new Error(privacyError);
|
|
439269
439414
|
const { _electron } = await import("playwright-core");
|
|
439270
|
-
const videoDir =
|
|
439415
|
+
const videoDir = join192(options2.runDir, "video");
|
|
439271
439416
|
mkdirSync53(options2.runDir, { recursive: true, mode: 448 });
|
|
439272
439417
|
if (fixture.recording.video) {
|
|
439273
439418
|
mkdirSync53(videoDir, { recursive: true, mode: 448 });
|
|
@@ -439289,7 +439434,7 @@ var init_electronDesktopQaDriver = __esm(() => {
|
|
|
439289
439434
|
});
|
|
439290
439435
|
page3.setDefaultTimeout(Math.min(fixture.timeoutMs, 120000));
|
|
439291
439436
|
const context6 = page3.context();
|
|
439292
|
-
const tracePath = fixture.recording.trace ?
|
|
439437
|
+
const tracePath = fixture.recording.trace ? join192(options2.runDir, "trace.zip") : null;
|
|
439293
439438
|
if (tracePath) {
|
|
439294
439439
|
await context6.tracing.start({
|
|
439295
439440
|
screenshots: true,
|
|
@@ -439315,7 +439460,7 @@ import {
|
|
|
439315
439460
|
lstatSync as lstatSync16,
|
|
439316
439461
|
readFileSync as readFileSync71,
|
|
439317
439462
|
realpathSync as realpathSync13,
|
|
439318
|
-
readdirSync as
|
|
439463
|
+
readdirSync as readdirSync27,
|
|
439319
439464
|
rmSync as rmSync15,
|
|
439320
439465
|
statSync as statSync24,
|
|
439321
439466
|
unlinkSync as unlinkSync14,
|
|
@@ -439326,7 +439471,7 @@ import {
|
|
|
439326
439471
|
basename as basename47,
|
|
439327
439472
|
extname as extname17,
|
|
439328
439473
|
isAbsolute as isAbsolute41,
|
|
439329
|
-
join as
|
|
439474
|
+
join as join193,
|
|
439330
439475
|
relative as relative43,
|
|
439331
439476
|
resolve as resolve61,
|
|
439332
439477
|
sep as sep40
|
|
@@ -439454,7 +439599,7 @@ async function executeStep(session2, step, options2) {
|
|
|
439454
439599
|
return;
|
|
439455
439600
|
case "screenshot": {
|
|
439456
439601
|
const name = safeEvidenceName(step.name ?? `step-${options2.index + 1}`);
|
|
439457
|
-
const path22 =
|
|
439602
|
+
const path22 = join193(options2.runDir, `${String(options2.index + 1).padStart(3, "0")}-${name}.png`);
|
|
439458
439603
|
await session2.screenshot(path22, {
|
|
439459
439604
|
fullPage: step.fullPage,
|
|
439460
439605
|
timeoutMs: timeout,
|
|
@@ -439469,8 +439614,8 @@ function walkFiles2(root2) {
|
|
|
439469
439614
|
return [];
|
|
439470
439615
|
const files = [];
|
|
439471
439616
|
const visit2 = (directory) => {
|
|
439472
|
-
for (const entry of
|
|
439473
|
-
const path22 =
|
|
439617
|
+
for (const entry of readdirSync27(directory, { withFileTypes: true })) {
|
|
439618
|
+
const path22 = join193(directory, entry.name);
|
|
439474
439619
|
if (entry.isDirectory())
|
|
439475
439620
|
visit2(path22);
|
|
439476
439621
|
else if (entry.isFile() && !entry.isSymbolicLink())
|
|
@@ -439528,11 +439673,11 @@ async function runDesktopQaFixture(cwd2, input, options2 = {}) {
|
|
|
439528
439673
|
}
|
|
439529
439674
|
validateDesktopQaLaunchPolicy(cwd2, fixture, options2.allowOutsideWorkspace ?? false);
|
|
439530
439675
|
const id = safeRunId(options2.runId ?? randomUUID52());
|
|
439531
|
-
const runDir =
|
|
439676
|
+
const runDir = join193(cwd2, ".ur", "desktop-qa", "runs", id);
|
|
439532
439677
|
if (existsSync75(runDir)) {
|
|
439533
439678
|
throw new Error(`Desktop QA run directory already exists: ${runDir}`);
|
|
439534
439679
|
}
|
|
439535
|
-
ensurePrivateDirectory(
|
|
439680
|
+
ensurePrivateDirectory(join193(cwd2, ".ur"), runDir);
|
|
439536
439681
|
try {
|
|
439537
439682
|
const started = Date.now();
|
|
439538
439683
|
const startedAt = new Date(started).toISOString();
|
|
@@ -439576,7 +439721,7 @@ async function runDesktopQaFixture(cwd2, input, options2 = {}) {
|
|
|
439576
439721
|
}
|
|
439577
439722
|
}
|
|
439578
439723
|
if (fixture.recording.screenshots) {
|
|
439579
|
-
await session2.screenshot(
|
|
439724
|
+
await session2.screenshot(join193(runDir, "final.png"), {
|
|
439580
439725
|
fullPage: false,
|
|
439581
439726
|
timeoutMs: remainingTimeout(deadline, 15000),
|
|
439582
439727
|
redactSelectors: fixture.recording.redactSelectors
|
|
@@ -439586,7 +439731,7 @@ async function runDesktopQaFixture(cwd2, input, options2 = {}) {
|
|
|
439586
439731
|
failed = error40;
|
|
439587
439732
|
if (session2 && fixture.recording.screenshotOnFailure) {
|
|
439588
439733
|
try {
|
|
439589
|
-
await session2.screenshot(
|
|
439734
|
+
await session2.screenshot(join193(runDir, "failure.png"), {
|
|
439590
439735
|
fullPage: false,
|
|
439591
439736
|
timeoutMs: Math.max(1, Math.min(1e4, deadline - Date.now())),
|
|
439592
439737
|
redactSelectors: fixture.recording.redactSelectors
|
|
@@ -439640,7 +439785,7 @@ async function runDesktopQaFixture(cwd2, input, options2 = {}) {
|
|
|
439640
439785
|
warnings,
|
|
439641
439786
|
...failed ? { error: errorText2(failed, redact2) } : {}
|
|
439642
439787
|
};
|
|
439643
|
-
const reportPath2 =
|
|
439788
|
+
const reportPath2 = join193(runDir, "report.json");
|
|
439644
439789
|
writeFileSync53(reportPath2, `${JSON.stringify(report, null, 2)}
|
|
439645
439790
|
`, {
|
|
439646
439791
|
mode: 384
|
|
@@ -439690,13 +439835,13 @@ import {
|
|
|
439690
439835
|
lstatSync as lstatSync17,
|
|
439691
439836
|
mkdirSync as mkdirSync54,
|
|
439692
439837
|
realpathSync as realpathSync14,
|
|
439693
|
-
readdirSync as
|
|
439838
|
+
readdirSync as readdirSync28,
|
|
439694
439839
|
writeFileSync as writeFileSync54
|
|
439695
439840
|
} from "fs";
|
|
439696
439841
|
import {
|
|
439697
|
-
dirname as
|
|
439842
|
+
dirname as dirname73,
|
|
439698
439843
|
isAbsolute as isAbsolute42,
|
|
439699
|
-
join as
|
|
439844
|
+
join as join194,
|
|
439700
439845
|
relative as relative44,
|
|
439701
439846
|
resolve as resolve62,
|
|
439702
439847
|
sep as sep41
|
|
@@ -439739,7 +439884,7 @@ function existingAncestor(path22) {
|
|
|
439739
439884
|
for (;; ) {
|
|
439740
439885
|
if (existsSync76(current))
|
|
439741
439886
|
return realpathSync14(current);
|
|
439742
|
-
const parent2 =
|
|
439887
|
+
const parent2 = dirname73(current);
|
|
439743
439888
|
if (parent2 === current)
|
|
439744
439889
|
return current;
|
|
439745
439890
|
current = parent2;
|
|
@@ -439749,7 +439894,7 @@ function initTargetAllowed(cwd2, path22, allowExternal) {
|
|
|
439749
439894
|
if (allowExternal)
|
|
439750
439895
|
return true;
|
|
439751
439896
|
const workspace = realpathSync14(cwd2);
|
|
439752
|
-
return pathIsWithin4(workspace, resolve62(path22)) && pathIsWithin4(workspace, existingAncestor(
|
|
439897
|
+
return pathIsWithin4(workspace, resolve62(path22)) && pathIsWithin4(workspace, existingAncestor(dirname73(path22)));
|
|
439753
439898
|
}
|
|
439754
439899
|
async function runDesktopQaCommand(args, cwd2, dependencies = {}) {
|
|
439755
439900
|
const runFixture = dependencies.runFixture ?? runDesktopQaFixture;
|
|
@@ -439839,7 +439984,7 @@ async function runDesktopQaCommand(args, cwd2, dependencies = {}) {
|
|
|
439839
439984
|
value: `Fixture already exists: ${path22} (use --force to replace it).`
|
|
439840
439985
|
};
|
|
439841
439986
|
}
|
|
439842
|
-
mkdirSync54(
|
|
439987
|
+
mkdirSync54(dirname73(path22), { recursive: true, mode: 448 });
|
|
439843
439988
|
writeFileSync54(path22, `${JSON.stringify(EXAMPLE_FIXTURE, null, 2)}
|
|
439844
439989
|
`, {
|
|
439845
439990
|
mode: 384
|
|
@@ -439847,10 +439992,10 @@ async function runDesktopQaCommand(args, cwd2, dependencies = {}) {
|
|
|
439847
439992
|
return { type: "text", value: `Created desktop QA fixture: ${path22}` };
|
|
439848
439993
|
}
|
|
439849
439994
|
if (action3 === "list" || action3 === "ls") {
|
|
439850
|
-
const directory =
|
|
439851
|
-
const fixtures2 = existsSync76(directory) ?
|
|
439995
|
+
const directory = join194(cwd2, ".ur", "desktop-qa", "fixtures");
|
|
439996
|
+
const fixtures2 = existsSync76(directory) ? readdirSync28(directory).filter((name) => name.endsWith(".json")).sort().map((name) => {
|
|
439852
439997
|
try {
|
|
439853
|
-
const fixture = loadFixture(
|
|
439998
|
+
const fixture = loadFixture(join194(directory, name));
|
|
439854
439999
|
return {
|
|
439855
440000
|
file: name,
|
|
439856
440001
|
valid: true,
|
|
@@ -440641,9 +440786,9 @@ import {
|
|
|
440641
440786
|
readFileSync as readFileSync73,
|
|
440642
440787
|
writeFileSync as writeFileSync55
|
|
440643
440788
|
} from "fs";
|
|
440644
|
-
import { dirname as
|
|
440789
|
+
import { dirname as dirname74, join as join195, relative as relative45 } from "path";
|
|
440645
440790
|
function defaultTraceDir(cwd2) {
|
|
440646
|
-
return
|
|
440791
|
+
return join195(cwd2, ".ur", "test-first", "traces");
|
|
440647
440792
|
}
|
|
440648
440793
|
function slug4(value2) {
|
|
440649
440794
|
return value2.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "").slice(0, 72) || "command";
|
|
@@ -440651,7 +440796,7 @@ function slug4(value2) {
|
|
|
440651
440796
|
function writeFailureTrace(cwd2, traceDir, run3, result, now8) {
|
|
440652
440797
|
mkdirSync55(traceDir, { recursive: true });
|
|
440653
440798
|
const stamp = now8.toISOString().replace(/[:.]/g, "-");
|
|
440654
|
-
const file2 =
|
|
440799
|
+
const file2 = join195(traceDir, `${stamp}-attempt-${run3.attempt}-${run3.phase}-${slug4(run3.command)}.log`);
|
|
440655
440800
|
const body = [
|
|
440656
440801
|
"# UR test-first failure trace",
|
|
440657
440802
|
"",
|
|
@@ -440693,8 +440838,8 @@ function mergeStringArray(existing2, additions) {
|
|
|
440693
440838
|
return [...out];
|
|
440694
440839
|
}
|
|
440695
440840
|
function installTestFirstGates(cwd2, stack = detectTestFirstStack(cwd2)) {
|
|
440696
|
-
const path22 =
|
|
440697
|
-
mkdirSync55(
|
|
440841
|
+
const path22 = join195(cwd2, ".ur", "verify.json");
|
|
440842
|
+
mkdirSync55(dirname74(path22), { recursive: true });
|
|
440698
440843
|
const commands = stack.commands.map((command5) => command5.command);
|
|
440699
440844
|
const existing2 = readExistingVerifyConfig(path22);
|
|
440700
440845
|
const next = {
|
|
@@ -441890,7 +442035,7 @@ __export(exports_sdk, {
|
|
|
441890
442035
|
call: () => call97
|
|
441891
442036
|
});
|
|
441892
442037
|
import { existsSync as existsSync79, mkdirSync as mkdirSync56, writeFileSync as writeFileSync56 } from "fs";
|
|
441893
|
-
import { join as
|
|
442038
|
+
import { join as join196 } from "path";
|
|
441894
442039
|
function infoText() {
|
|
441895
442040
|
return [
|
|
441896
442041
|
"UR SDK \u2014 drive UR programmatically (headless).",
|
|
@@ -441970,7 +442115,7 @@ A2A server: \`ur a2a serve\`.
|
|
|
441970
442115
|
const force = tokens.includes("--force");
|
|
441971
442116
|
const action3 = tokens.find((token) => !token.startsWith("--")) ?? "info";
|
|
441972
442117
|
if (action3 === "init") {
|
|
441973
|
-
const root2 =
|
|
442118
|
+
const root2 = join196(getCwd(), ".ur", "sdk");
|
|
441974
442119
|
mkdirSync56(root2, { recursive: true });
|
|
441975
442120
|
const files = [
|
|
441976
442121
|
["example.ts", TS_EXAMPLE],
|
|
@@ -441980,7 +442125,7 @@ A2A server: \`ur a2a serve\`.
|
|
|
441980
442125
|
const created = [];
|
|
441981
442126
|
const skipped = [];
|
|
441982
442127
|
for (const [name, content] of files) {
|
|
441983
|
-
const path22 =
|
|
442128
|
+
const path22 = join196(root2, name);
|
|
441984
442129
|
if (!force && existsSync79(path22)) {
|
|
441985
442130
|
skipped.push(name);
|
|
441986
442131
|
continue;
|
|
@@ -442323,12 +442468,12 @@ import {
|
|
|
442323
442468
|
existsSync as existsSync80,
|
|
442324
442469
|
mkdirSync as mkdirSync57,
|
|
442325
442470
|
readFileSync as readFileSync75,
|
|
442326
|
-
readdirSync as
|
|
442471
|
+
readdirSync as readdirSync29,
|
|
442327
442472
|
rmSync as rmSync16,
|
|
442328
442473
|
writeFileSync as writeFileSync57
|
|
442329
442474
|
} from "fs";
|
|
442330
442475
|
import { randomUUID as randomUUID53 } from "crypto";
|
|
442331
|
-
import { join as
|
|
442476
|
+
import { join as join197 } from "path";
|
|
442332
442477
|
function evaluateEvalGate(report, thresholds, baseline) {
|
|
442333
442478
|
const checks4 = [];
|
|
442334
442479
|
const minimum = (name, actual, expected) => {
|
|
@@ -442798,7 +442943,7 @@ async function runSuiteReliability(suite, runner2, options3) {
|
|
|
442798
442943
|
};
|
|
442799
442944
|
}
|
|
442800
442945
|
function metricsFile() {
|
|
442801
|
-
return
|
|
442946
|
+
return join197(process.env.UR_EVAL_METRICS_DIR ?? process.cwd(), `.ur-eval-metrics-${process.pid}.json`);
|
|
442802
442947
|
}
|
|
442803
442948
|
function readChildMetricsFile(path22) {
|
|
442804
442949
|
if (!existsSync80(path22))
|
|
@@ -442931,9 +443076,9 @@ async function createEvalWorktree(cwd2, caseId) {
|
|
|
442931
443076
|
throw new Error("isolated eval cases require a git repository with a valid HEAD");
|
|
442932
443077
|
}
|
|
442933
443078
|
const safeId2 = caseId.replace(/[^a-z0-9_-]/gi, "-").slice(0, 40);
|
|
442934
|
-
const root2 =
|
|
442935
|
-
const path22 =
|
|
442936
|
-
ensurePrivateDirectory(
|
|
443079
|
+
const root2 = join197(cwd2, ".ur", "evals", ".worktrees");
|
|
443080
|
+
const path22 = join197(root2, `${safeId2}-${randomUUID53().slice(0, 8)}`);
|
|
443081
|
+
ensurePrivateDirectory(join197(cwd2, ".ur"), root2);
|
|
442937
443082
|
const created = await execFileNoThrowWithCwd("git", [
|
|
442938
443083
|
...SAFE_EVAL_GIT_ARGS,
|
|
442939
443084
|
"worktree",
|
|
@@ -443195,10 +443340,10 @@ function loadAllReports(cwd2) {
|
|
|
443195
443340
|
if (!existsSync80(dir))
|
|
443196
443341
|
return [];
|
|
443197
443342
|
const reports = [];
|
|
443198
|
-
for (const file2 of
|
|
443343
|
+
for (const file2 of readdirSync29(dir)) {
|
|
443199
443344
|
if (!file2.endsWith(".json") || file2.startsWith("reliability-"))
|
|
443200
443345
|
continue;
|
|
443201
|
-
const parsed = safeParseJSON(readFileSync75(
|
|
443346
|
+
const parsed = safeParseJSON(readFileSync75(join197(dir, file2), "utf-8"), false);
|
|
443202
443347
|
if (parsed && typeof parsed === "object")
|
|
443203
443348
|
reports.push(parsed);
|
|
443204
443349
|
}
|
|
@@ -443209,10 +443354,10 @@ function loadAllReliability(cwd2) {
|
|
|
443209
443354
|
if (!existsSync80(dir))
|
|
443210
443355
|
return [];
|
|
443211
443356
|
const reports = [];
|
|
443212
|
-
for (const file2 of
|
|
443357
|
+
for (const file2 of readdirSync29(dir)) {
|
|
443213
443358
|
if (!file2.startsWith("reliability-") || !file2.endsWith(".json"))
|
|
443214
443359
|
continue;
|
|
443215
|
-
const parsed = safeParseJSON(readFileSync75(
|
|
443360
|
+
const parsed = safeParseJSON(readFileSync75(join197(dir, file2), "utf-8"), false);
|
|
443216
443361
|
if (parsed && typeof parsed === "object")
|
|
443217
443362
|
reports.push(parsed);
|
|
443218
443363
|
}
|
|
@@ -443220,7 +443365,7 @@ function loadAllReliability(cwd2) {
|
|
|
443220
443365
|
}
|
|
443221
443366
|
function saveReliabilityReport(cwd2, report) {
|
|
443222
443367
|
mkdirSync57(resultsDir(cwd2), { recursive: true });
|
|
443223
|
-
const path22 =
|
|
443368
|
+
const path22 = join197(resultsDir(cwd2), `reliability-${suiteSlug(report.name)}.json`);
|
|
443224
443369
|
writeFileSync57(path22, `${JSON.stringify(report, null, 2)}
|
|
443225
443370
|
`);
|
|
443226
443371
|
return path22;
|
|
@@ -443228,7 +443373,7 @@ function saveReliabilityReport(cwd2, report) {
|
|
|
443228
443373
|
function writeDashboard(cwd2) {
|
|
443229
443374
|
const html3 = buildDashboardHtml(loadAllReports(cwd2), loadAllReliability(cwd2));
|
|
443230
443375
|
mkdirSync57(evalsDir(cwd2), { recursive: true });
|
|
443231
|
-
const path22 =
|
|
443376
|
+
const path22 = join197(evalsDir(cwd2), "dashboard.html");
|
|
443232
443377
|
writeFileSync57(path22, html3);
|
|
443233
443378
|
return path22;
|
|
443234
443379
|
}
|
|
@@ -443239,7 +443384,7 @@ function buildLeaderboard(cwd2, reports, options3 = {}) {
|
|
|
443239
443384
|
if (format6 === "json") {
|
|
443240
443385
|
const dir2 = resultsDir(cwd2);
|
|
443241
443386
|
mkdirSync57(dir2, { recursive: true });
|
|
443242
|
-
const path23 =
|
|
443387
|
+
const path23 = join197(dir2, "leaderboard.json");
|
|
443243
443388
|
writeFileSync57(path23, JSON.stringify({ title, generatedAt: new Date().toISOString(), reports }, null, 2) + `
|
|
443244
443389
|
`);
|
|
443245
443390
|
if (runId) {
|
|
@@ -443250,7 +443395,7 @@ function buildLeaderboard(cwd2, reports, options3 = {}) {
|
|
|
443250
443395
|
if (format6 === "md") {
|
|
443251
443396
|
const dir2 = resultsDir(cwd2);
|
|
443252
443397
|
mkdirSync57(dir2, { recursive: true });
|
|
443253
|
-
const path23 =
|
|
443398
|
+
const path23 = join197(dir2, "leaderboard.md");
|
|
443254
443399
|
writeFileSync57(path23, formatLeaderboardMarkdown(title, reports));
|
|
443255
443400
|
if (runId) {
|
|
443256
443401
|
addRunArtifact(cwd2, runId, { kind: "leaderboard", path: path23, title });
|
|
@@ -443259,7 +443404,7 @@ function buildLeaderboard(cwd2, reports, options3 = {}) {
|
|
|
443259
443404
|
}
|
|
443260
443405
|
const dir = evalsDir(cwd2);
|
|
443261
443406
|
mkdirSync57(dir, { recursive: true });
|
|
443262
|
-
const path22 =
|
|
443407
|
+
const path22 = join197(dir, "leaderboard.html");
|
|
443263
443408
|
const html3 = buildDashboardHtml(reports, []);
|
|
443264
443409
|
writeFileSync57(path22, html3.replace("<title>UR Eval Dashboard</title>", `<title>${escapeHtml(title)}</title>`).replace("<h1>UR Eval Dashboard</h1>", `<h1>${escapeHtml(title)}</h1>`));
|
|
443265
443410
|
if (runId) {
|
|
@@ -443283,18 +443428,18 @@ function formatLeaderboardMarkdown(title, reports) {
|
|
|
443283
443428
|
`;
|
|
443284
443429
|
}
|
|
443285
443430
|
function runsDir(cwd2, suiteName) {
|
|
443286
|
-
return
|
|
443431
|
+
return join197(evalsDir(cwd2), ".runs", suiteSlug(suiteName));
|
|
443287
443432
|
}
|
|
443288
443433
|
function writeRunMetrics(cwd2, suiteName, caseId, metrics3) {
|
|
443289
443434
|
const dir = runsDir(cwd2, suiteName);
|
|
443290
443435
|
mkdirSync57(dir, { recursive: true });
|
|
443291
|
-
const path22 =
|
|
443436
|
+
const path22 = join197(dir, `${caseId}.json`);
|
|
443292
443437
|
writeFileSync57(path22, `${JSON.stringify(metrics3, null, 2)}
|
|
443293
443438
|
`);
|
|
443294
443439
|
return path22;
|
|
443295
443440
|
}
|
|
443296
443441
|
function loadRunMetrics(cwd2, suiteName, caseId) {
|
|
443297
|
-
const path22 =
|
|
443442
|
+
const path22 = join197(runsDir(cwd2, suiteName), `${caseId}.json`);
|
|
443298
443443
|
if (!existsSync80(path22))
|
|
443299
443444
|
return null;
|
|
443300
443445
|
const parsed = safeParseJSON(readFileSync75(path22, "utf-8"), false);
|
|
@@ -443319,10 +443464,10 @@ function formatReliabilityReport(report, json2) {
|
|
|
443319
443464
|
`);
|
|
443320
443465
|
}
|
|
443321
443466
|
function evalsDir(cwd2) {
|
|
443322
|
-
return
|
|
443467
|
+
return join197(cwd2, ".ur", "evals");
|
|
443323
443468
|
}
|
|
443324
443469
|
function resultsDir(cwd2) {
|
|
443325
|
-
return
|
|
443470
|
+
return join197(evalsDir(cwd2), ".results");
|
|
443326
443471
|
}
|
|
443327
443472
|
function suiteSlug(name) {
|
|
443328
443473
|
return name.trim().toLowerCase().replace(/[^a-z0-9-_]+/g, "-").slice(0, 64);
|
|
@@ -443355,10 +443500,10 @@ function listSuites(cwd2) {
|
|
|
443355
443500
|
const dir = evalsDir(cwd2);
|
|
443356
443501
|
if (!existsSync80(dir))
|
|
443357
443502
|
return [];
|
|
443358
|
-
return
|
|
443503
|
+
return readdirSync29(dir).filter((file2) => file2.endsWith(".json")).map((file2) => file2.replace(/\.json$/, "")).sort();
|
|
443359
443504
|
}
|
|
443360
443505
|
function loadSuite(cwd2, name) {
|
|
443361
|
-
const path22 =
|
|
443506
|
+
const path22 = join197(evalsDir(cwd2), `${suiteSlug(name)}.json`);
|
|
443362
443507
|
if (!existsSync80(path22))
|
|
443363
443508
|
return null;
|
|
443364
443509
|
try {
|
|
@@ -443368,7 +443513,7 @@ function loadSuite(cwd2, name) {
|
|
|
443368
443513
|
}
|
|
443369
443514
|
}
|
|
443370
443515
|
function saveSuite(cwd2, suite, options3 = {}) {
|
|
443371
|
-
const path22 =
|
|
443516
|
+
const path22 = join197(evalsDir(cwd2), `${suiteSlug(suite.name)}.json`);
|
|
443372
443517
|
mkdirSync57(evalsDir(cwd2), { recursive: true });
|
|
443373
443518
|
if (existsSync80(path22) && options3.force !== true) {
|
|
443374
443519
|
return { path: path22, created: false };
|
|
@@ -443530,7 +443675,7 @@ function importBenchmarkSuite(cwd2, adapter2, file2, options3 = {}) {
|
|
|
443530
443675
|
}
|
|
443531
443676
|
function saveReport(cwd2, report, options3 = {}) {
|
|
443532
443677
|
mkdirSync57(resultsDir(cwd2), { recursive: true });
|
|
443533
|
-
const path22 =
|
|
443678
|
+
const path22 = join197(resultsDir(cwd2), `${suiteSlug(report.name)}.json`);
|
|
443534
443679
|
writeFileSync57(path22, `${JSON.stringify(report, null, 2)}
|
|
443535
443680
|
`);
|
|
443536
443681
|
if (options3.runId) {
|
|
@@ -443543,7 +443688,7 @@ function saveReport(cwd2, report, options3 = {}) {
|
|
|
443543
443688
|
return path22;
|
|
443544
443689
|
}
|
|
443545
443690
|
function loadReport(cwd2, name) {
|
|
443546
|
-
const path22 =
|
|
443691
|
+
const path22 = join197(resultsDir(cwd2), `${suiteSlug(name)}.json`);
|
|
443547
443692
|
if (!existsSync80(path22))
|
|
443548
443693
|
return null;
|
|
443549
443694
|
const parsed = safeParseJSON(readFileSync75(path22, "utf-8"), false);
|
|
@@ -443598,7 +443743,7 @@ function scaffoldEvals(cwd2, options3 = {}) {
|
|
|
443598
443743
|
const root2 = evalsDir(cwd2);
|
|
443599
443744
|
const result = { root: root2, created: [], skipped: [] };
|
|
443600
443745
|
mkdirSync57(root2, { recursive: true });
|
|
443601
|
-
const readmePath =
|
|
443746
|
+
const readmePath = join197(root2, "README.md");
|
|
443602
443747
|
if (existsSync80(readmePath) && options3.force !== true) {
|
|
443603
443748
|
result.skipped.push("evals/README.md");
|
|
443604
443749
|
} else {
|
|
@@ -443746,7 +443891,7 @@ var init_evals = __esm(() => {
|
|
|
443746
443891
|
});
|
|
443747
443892
|
|
|
443748
443893
|
// src/services/agents/benchmarkSuites.ts
|
|
443749
|
-
import { join as
|
|
443894
|
+
import { join as join198 } from "path";
|
|
443750
443895
|
function listBuiltinSuiteIds() {
|
|
443751
443896
|
return [...BUILTIN_SUITE_IDS];
|
|
443752
443897
|
}
|
|
@@ -443756,7 +443901,7 @@ function getBuiltinSuite(id) {
|
|
|
443756
443901
|
function installBuiltinSuite(cwd2, id, options3 = {}) {
|
|
443757
443902
|
const suite = getBuiltinSuite(id);
|
|
443758
443903
|
if (!suite) {
|
|
443759
|
-
return { path:
|
|
443904
|
+
return { path: join198(evalsDir(cwd2), `${id}.json`), created: false };
|
|
443760
443905
|
}
|
|
443761
443906
|
const saved = saveSuite(cwd2, suite, { force: options3.force });
|
|
443762
443907
|
return { path: saved.path, created: saved.created, suite };
|
|
@@ -443986,7 +444131,7 @@ __export(exports_eval, {
|
|
|
443986
444131
|
call: () => call98
|
|
443987
444132
|
});
|
|
443988
444133
|
import { mkdirSync as mkdirSync58, writeFileSync as writeFileSync58 } from "fs";
|
|
443989
|
-
import { join as
|
|
444134
|
+
import { join as join199 } from "path";
|
|
443990
444135
|
function optionValue7(tokens, flag) {
|
|
443991
444136
|
const index2 = tokens.indexOf(flag);
|
|
443992
444137
|
return index2 >= 0 ? tokens[index2 + 1] : undefined;
|
|
@@ -444198,9 +444343,9 @@ Run: ur eval run ${suite2.name}`
|
|
|
444198
444343
|
if (tokens.includes("--dashboard")) {
|
|
444199
444344
|
const { buildDashboardHtml: buildDashboardHtml2 } = await Promise.resolve().then(() => (init_evals(), exports_evals));
|
|
444200
444345
|
const html3 = buildDashboardHtml2([report], []);
|
|
444201
|
-
const dir =
|
|
444346
|
+
const dir = join199(evalsDir(cwd2), ".dashboards");
|
|
444202
444347
|
mkdirSync58(dir, { recursive: true });
|
|
444203
|
-
const path22 =
|
|
444348
|
+
const path22 = join199(dir, `${suiteSlug(report.name)}.html`);
|
|
444204
444349
|
writeFileSync58(path22, html3);
|
|
444205
444350
|
return { type: "text", value: `Wrote single-suite dashboard to ${path22}` };
|
|
444206
444351
|
}
|
|
@@ -444975,17 +445120,17 @@ var init_os2 = __esm(() => {
|
|
|
444975
445120
|
import { createHash as createHash43, randomUUID as randomUUID54 } from "crypto";
|
|
444976
445121
|
import { existsSync as existsSync82, lstatSync as lstatSync18, realpathSync as realpathSync15, rmSync as rmSync17 } from "fs";
|
|
444977
445122
|
import { tmpdir as tmpdir15 } from "os";
|
|
444978
|
-
import { dirname as
|
|
445123
|
+
import { dirname as dirname75, isAbsolute as isAbsolute43, join as join200, relative as relative46, resolve as resolve64 } from "path";
|
|
444979
445124
|
function workspaceDir(cwd2) {
|
|
444980
|
-
return
|
|
445125
|
+
return join200(cwd2, ".ur", "workspaces");
|
|
444981
445126
|
}
|
|
444982
445127
|
function workspaceSpecPath(cwd2, name) {
|
|
444983
445128
|
assertId(name, "workspace name");
|
|
444984
|
-
return
|
|
445129
|
+
return join200(workspaceDir(cwd2), `${name}.json`);
|
|
444985
445130
|
}
|
|
444986
445131
|
function workspaceStatePath(cwd2, name) {
|
|
444987
445132
|
assertId(name, "workspace name");
|
|
444988
|
-
return
|
|
445133
|
+
return join200(workspaceDir(cwd2), ".state", `${name}.json`);
|
|
444989
445134
|
}
|
|
444990
445135
|
function assertId(value2, label) {
|
|
444991
445136
|
if (!ID_RE5.test(value2))
|
|
@@ -445374,7 +445519,7 @@ async function prepareRepositoryState(cwd2, spec2, validation, runId, options3)
|
|
|
445374
445519
|
throw new Error(`Cannot resolve ${repo.id} base ref ${repo.baseRef}`);
|
|
445375
445520
|
}
|
|
445376
445521
|
const branch = branchName(spec2.name, runId, repo.id);
|
|
445377
|
-
const worktree2 =
|
|
445522
|
+
const worktree2 = join200(workspaceDir(cwd2), ".worktrees", spec2.name, runId, repo.id);
|
|
445378
445523
|
const shouldPrepare = !options3.dryRun && options3.prepareWorktrees !== false;
|
|
445379
445524
|
if (shouldPrepare) {
|
|
445380
445525
|
const filters = await git7(details.root, ["config", "--get-regexp", "^filter\\..*\\.(clean|process)$"], options3.commandRunner);
|
|
@@ -445384,7 +445529,7 @@ async function prepareRepositoryState(cwd2, spec2, validation, runId, options3)
|
|
|
445384
445529
|
if (filters.code !== 0 && filters.code !== 1) {
|
|
445385
445530
|
throw new Error(`Could not inspect ${repo.id} Git filters`);
|
|
445386
445531
|
}
|
|
445387
|
-
ensurePrivateDirectory(workspaceDir(cwd2),
|
|
445532
|
+
ensurePrivateDirectory(workspaceDir(cwd2), dirname75(worktree2));
|
|
445388
445533
|
const created = await git7(details.root, ["worktree", "add", "-b", branch, worktree2, repo.baseRef], options3.commandRunner);
|
|
445389
445534
|
if (created.code !== 0) {
|
|
445390
445535
|
throw new Error(`Could not create ${repo.id} worktree: ${created.stderr || created.error || created.stdout}`);
|
|
@@ -445481,7 +445626,7 @@ async function runWorkspace(cwd2, name, options3 = {}) {
|
|
|
445481
445626
|
const persist = () => {
|
|
445482
445627
|
state.updatedAt = new Date().toISOString();
|
|
445483
445628
|
if (!options3.dryRun) {
|
|
445484
|
-
ensurePrivateDirectory(workspaceDir(cwd2),
|
|
445629
|
+
ensurePrivateDirectory(workspaceDir(cwd2), dirname75(workspaceStatePath(cwd2, name)));
|
|
445485
445630
|
withPrivateStateLock(workspaceDir(cwd2), `state-${name}`, () => saveState(cwd2, state));
|
|
445486
445631
|
}
|
|
445487
445632
|
};
|
|
@@ -445580,7 +445725,7 @@ async function runVerificationCommand(command5, cwd2, runner2 = defaultCommandRu
|
|
|
445580
445725
|
return process.platform === "win32" ? runner2("cmd.exe", ["/d", "/s", "/c", command5], cwd2) : runner2("/bin/sh", ["-lc", command5], cwd2);
|
|
445581
445726
|
}
|
|
445582
445727
|
async function workspaceTreeDigest(worktree2) {
|
|
445583
|
-
const temporaryIndex =
|
|
445728
|
+
const temporaryIndex = join200(tmpdir15(), `ur-workspace-index-${process.pid}-${randomUUID54()}`);
|
|
445584
445729
|
const env4 = {
|
|
445585
445730
|
...strictSubprocessEnv(),
|
|
445586
445731
|
GIT_INDEX_FILE: temporaryIndex
|
|
@@ -446119,15 +446264,15 @@ import {
|
|
|
446119
446264
|
existsSync as existsSync83,
|
|
446120
446265
|
mkdirSync as mkdirSync59,
|
|
446121
446266
|
readFileSync as readFileSync77,
|
|
446122
|
-
readdirSync as
|
|
446267
|
+
readdirSync as readdirSync30,
|
|
446123
446268
|
writeFileSync as writeFileSync59
|
|
446124
446269
|
} from "fs";
|
|
446125
|
-
import { dirname as
|
|
446270
|
+
import { dirname as dirname76, join as join201 } from "path";
|
|
446126
446271
|
function memoryDir(cwd2) {
|
|
446127
|
-
return
|
|
446272
|
+
return join201(cwd2, ".ur", "memory");
|
|
446128
446273
|
}
|
|
446129
446274
|
function policyPath2(cwd2) {
|
|
446130
|
-
return
|
|
446275
|
+
return join201(memoryDir(cwd2), "retention.json");
|
|
446131
446276
|
}
|
|
446132
446277
|
function defaultMemoryRetentionPolicy() {
|
|
446133
446278
|
return { version: 1, maxEntries: 1000, updatedAt: new Date().toISOString() };
|
|
@@ -446157,7 +446302,7 @@ function saveMemoryRetentionPolicy(cwd2, patch) {
|
|
|
446157
446302
|
decayDays: patch.decayDays === undefined ? current.decayDays : validPositive(patch.decayDays),
|
|
446158
446303
|
updatedAt: new Date().toISOString()
|
|
446159
446304
|
};
|
|
446160
|
-
mkdirSync59(
|
|
446305
|
+
mkdirSync59(dirname76(policyPath2(cwd2)), { recursive: true });
|
|
446161
446306
|
writeFileSync59(policyPath2(cwd2), `${JSON.stringify(next, null, 2)}
|
|
446162
446307
|
`);
|
|
446163
446308
|
return next;
|
|
@@ -446218,7 +446363,7 @@ function memoryJsonlFiles(cwd2) {
|
|
|
446218
446363
|
const dir = memoryDir(cwd2);
|
|
446219
446364
|
if (!existsSync83(dir))
|
|
446220
446365
|
return [];
|
|
446221
|
-
return
|
|
446366
|
+
return readdirSync30(dir).filter((name) => name.endsWith(".jsonl")).map((name) => join201(dir, name));
|
|
446222
446367
|
}
|
|
446223
446368
|
function pruneMemoryRetention(cwd2, policy = loadMemoryRetentionPolicy(cwd2), nowMs = Date.now()) {
|
|
446224
446369
|
const files = memoryJsonlFiles(cwd2).map((file2) => {
|
|
@@ -446339,10 +446484,10 @@ var exports_semantic_memory = {};
|
|
|
446339
446484
|
__export(exports_semantic_memory, {
|
|
446340
446485
|
call: () => call106
|
|
446341
446486
|
});
|
|
446342
|
-
import { existsSync as existsSync84, mkdirSync as mkdirSync60, readdirSync as
|
|
446343
|
-
import { basename as basename48, join as
|
|
446487
|
+
import { existsSync as existsSync84, mkdirSync as mkdirSync60, readdirSync as readdirSync31, readFileSync as readFileSync78, statSync as statSync26, writeFileSync as writeFileSync60 } from "fs";
|
|
446488
|
+
import { basename as basename48, join as join202 } from "path";
|
|
446344
446489
|
function indexPath3() {
|
|
446345
|
-
return
|
|
446490
|
+
return join202(getCwd(), ".ur", "semantic-memory", "index", "index.json");
|
|
446346
446491
|
}
|
|
446347
446492
|
function tokenize8(value2) {
|
|
446348
446493
|
return [...new Set(value2.toLowerCase().match(/[a-z0-9_]{3,}/g) ?? [])];
|
|
@@ -446351,15 +446496,15 @@ function sourceFiles() {
|
|
|
446351
446496
|
const cwd2 = getCwd();
|
|
446352
446497
|
const files = [];
|
|
446353
446498
|
for (const file2 of ["UR.md", "README.md"]) {
|
|
446354
|
-
const path22 =
|
|
446499
|
+
const path22 = join202(cwd2, file2);
|
|
446355
446500
|
if (existsSync84(path22))
|
|
446356
446501
|
files.push(path22);
|
|
446357
446502
|
}
|
|
446358
|
-
for (const dir of [
|
|
446503
|
+
for (const dir of [join202(cwd2, ".ur", "memory"), join202(cwd2, ".ur", "docs")]) {
|
|
446359
446504
|
if (!existsSync84(dir))
|
|
446360
446505
|
continue;
|
|
446361
|
-
for (const file2 of
|
|
446362
|
-
const path22 =
|
|
446506
|
+
for (const file2 of readdirSync31(dir)) {
|
|
446507
|
+
const path22 = join202(dir, file2);
|
|
446363
446508
|
if (statSync26(path22).isFile() && /\.(md|txt|jsonl)$/i.test(file2)) {
|
|
446364
446509
|
files.push(path22);
|
|
446365
446510
|
}
|
|
@@ -446383,7 +446528,7 @@ function buildIndex2() {
|
|
|
446383
446528
|
builtAt: new Date().toISOString(),
|
|
446384
446529
|
entries
|
|
446385
446530
|
};
|
|
446386
|
-
mkdirSync60(
|
|
446531
|
+
mkdirSync60(join202(getCwd(), ".ur", "semantic-memory", "index"), { recursive: true });
|
|
446387
446532
|
writeFileSync60(indexPath3(), `${JSON.stringify(index2, null, 2)}
|
|
446388
446533
|
`);
|
|
446389
446534
|
return index2;
|
|
@@ -615731,14 +615876,14 @@ import {
|
|
|
615731
615876
|
existsSync as existsSync85,
|
|
615732
615877
|
mkdirSync as mkdirSync61,
|
|
615733
615878
|
readFileSync as readFileSync79,
|
|
615734
|
-
readdirSync as
|
|
615879
|
+
readdirSync as readdirSync32,
|
|
615735
615880
|
statSync as statSync27,
|
|
615736
615881
|
writeFileSync as writeFileSync61
|
|
615737
615882
|
} from "fs";
|
|
615738
|
-
import { dirname as
|
|
615883
|
+
import { dirname as dirname77, extname as extname19, isAbsolute as isAbsolute44, join as join203, relative as relative48, resolve as resolve65 } from "path";
|
|
615739
615884
|
import { promisify as promisify4 } from "util";
|
|
615740
615885
|
function repoEditIndexPath(root2) {
|
|
615741
|
-
return
|
|
615886
|
+
return join203(root2, ".ur", "repo-edit", "index.json");
|
|
615742
615887
|
}
|
|
615743
615888
|
function isSkippedDir(pathFromRoot, name) {
|
|
615744
615889
|
if (SKIP_DIRS2.has(name))
|
|
@@ -615762,14 +615907,14 @@ function listRepoFiles(root2, maxFiles = 25000) {
|
|
|
615762
615907
|
return;
|
|
615763
615908
|
let entries;
|
|
615764
615909
|
try {
|
|
615765
|
-
entries =
|
|
615910
|
+
entries = readdirSync32(dir, { withFileTypes: true });
|
|
615766
615911
|
} catch {
|
|
615767
615912
|
return;
|
|
615768
615913
|
}
|
|
615769
615914
|
for (const entry of entries) {
|
|
615770
615915
|
if (files.length >= maxFiles)
|
|
615771
615916
|
return;
|
|
615772
|
-
const full =
|
|
615917
|
+
const full = join203(dir, entry.name);
|
|
615773
615918
|
const rel = normalizeRelPath(relative48(root2, full));
|
|
615774
615919
|
if (entry.isDirectory()) {
|
|
615775
615920
|
if (entry.name.startsWith(".") && entry.name !== ".ur")
|
|
@@ -615845,7 +615990,7 @@ function collectSymbols(file2, content) {
|
|
|
615845
615990
|
}
|
|
615846
615991
|
function buildRepoEditIndex(root2) {
|
|
615847
615992
|
const files = listRepoFiles(root2).map((path22) => {
|
|
615848
|
-
const abs =
|
|
615993
|
+
const abs = join203(root2, path22);
|
|
615849
615994
|
const stat42 = statSync27(abs);
|
|
615850
615995
|
const ext = extname19(path22).toLowerCase();
|
|
615851
615996
|
const text = isTextPath(path22);
|
|
@@ -615875,7 +616020,7 @@ ${content}`),
|
|
|
615875
616020
|
builtAt: new Date().toISOString(),
|
|
615876
616021
|
files
|
|
615877
616022
|
};
|
|
615878
|
-
mkdirSync61(
|
|
616023
|
+
mkdirSync61(dirname77(repoEditIndexPath(root2)), { recursive: true });
|
|
615879
616024
|
writeFileSync61(repoEditIndexPath(root2), `${JSON.stringify(index2, null, 2)}
|
|
615880
616025
|
`);
|
|
615881
616026
|
return index2;
|
|
@@ -615910,7 +616055,7 @@ function searchRepoEditIndex(root2, query2, index2 = loadRepoEditIndex(root2) ??
|
|
|
615910
616055
|
const lines = [];
|
|
615911
616056
|
if (file2.text && score > 0) {
|
|
615912
616057
|
try {
|
|
615913
|
-
const content = readFileSync79(
|
|
616058
|
+
const content = readFileSync79(join203(root2, file2.path), "utf-8");
|
|
615914
616059
|
const split = content.split(`
|
|
615915
616060
|
`);
|
|
615916
616061
|
for (let i3 = 0;i3 < split.length && lines.length < 4; i3++) {
|
|
@@ -615964,7 +616109,7 @@ function planRename(root2, from, to) {
|
|
|
615964
616109
|
if (from === to)
|
|
615965
616110
|
throw new Error("from and to must be different identifiers");
|
|
615966
616111
|
const files = listRepoFiles(root2).filter(isCodePath).flatMap((file2) => {
|
|
615967
|
-
const abs =
|
|
616112
|
+
const abs = join203(root2, file2);
|
|
615968
616113
|
let oldContent;
|
|
615969
616114
|
try {
|
|
615970
616115
|
oldContent = readFileSync79(abs, "utf-8");
|
|
@@ -616024,7 +616169,7 @@ async function runCheck(command5, cwd2) {
|
|
|
616024
616169
|
}
|
|
616025
616170
|
function rollback(root2, snapshots) {
|
|
616026
616171
|
for (const [file2, content] of snapshots) {
|
|
616027
|
-
writeFileSync61(
|
|
616172
|
+
writeFileSync61(join203(root2, file2), content);
|
|
616028
616173
|
}
|
|
616029
616174
|
}
|
|
616030
616175
|
async function applyRename(root2, from, to, options4 = {}) {
|
|
@@ -616037,7 +616182,7 @@ async function applyRename(root2, from, to, options4 = {}) {
|
|
|
616037
616182
|
try {
|
|
616038
616183
|
for (const file2 of plan.files) {
|
|
616039
616184
|
snapshots.set(file2.file, file2.oldContent);
|
|
616040
|
-
writeFileSync61(
|
|
616185
|
+
writeFileSync61(join203(root2, file2.file), file2.newContent);
|
|
616041
616186
|
writtenFiles.push(file2.file);
|
|
616042
616187
|
}
|
|
616043
616188
|
const syntax = plan.files.flatMap((file2) => syntaxErrors(file2.file, file2.newContent));
|
|
@@ -616271,7 +616416,7 @@ var init_engineRouter = __esm(() => {
|
|
|
616271
616416
|
|
|
616272
616417
|
// src/services/repoEditing/ast/diagnostics.ts
|
|
616273
616418
|
import { exec as exec9 } from "child_process";
|
|
616274
|
-
import { join as
|
|
616419
|
+
import { join as join204 } from "path";
|
|
616275
616420
|
import { promisify as promisify5 } from "util";
|
|
616276
616421
|
function emptySnapshot(source = "none") {
|
|
616277
616422
|
return { files: {}, collectedAt: new Date().toISOString(), source };
|
|
@@ -616356,7 +616501,7 @@ function createSyntheticProgram(root2, files) {
|
|
|
616356
616501
|
strict: false
|
|
616357
616502
|
};
|
|
616358
616503
|
const host = import_typescript2.default.createCompilerHost(compilerOptions);
|
|
616359
|
-
const fileNames = files.map((f) =>
|
|
616504
|
+
const fileNames = files.map((f) => join204(root2, f));
|
|
616360
616505
|
return import_typescript2.default.createProgram(fileNames, compilerOptions, host);
|
|
616361
616506
|
}
|
|
616362
616507
|
function collectTsDiagnostics(root2, files) {
|
|
@@ -616552,7 +616697,7 @@ var init_diagnostics = __esm(() => {
|
|
|
616552
616697
|
});
|
|
616553
616698
|
|
|
616554
616699
|
// src/services/repoEditing/ast/workspaceEdit.ts
|
|
616555
|
-
import { dirname as
|
|
616700
|
+
import { dirname as dirname78, isAbsolute as isAbsolute45, relative as relative49, resolve as resolve66, sep as sep43 } from "path";
|
|
616556
616701
|
import {
|
|
616557
616702
|
chmodSync as chmodSync11,
|
|
616558
616703
|
existsSync as existsSync86,
|
|
@@ -616603,7 +616748,7 @@ function realpathForMissing(path22) {
|
|
|
616603
616748
|
const suffix = [];
|
|
616604
616749
|
let cursor = path22;
|
|
616605
616750
|
while (!existsSync86(cursor)) {
|
|
616606
|
-
const parent2 =
|
|
616751
|
+
const parent2 = dirname78(cursor);
|
|
616607
616752
|
if (parent2 === cursor)
|
|
616608
616753
|
return path22;
|
|
616609
616754
|
suffix.unshift(cursor.slice(parent2.length + (parent2.endsWith(sep43) ? 0 : 1)));
|
|
@@ -616633,8 +616778,8 @@ function workspaceRelativePath(root2, file2) {
|
|
|
616633
616778
|
return relative49(realpathSync16(root2), resolveWorkspaceFile(root2, file2)).split(sep43).join("/");
|
|
616634
616779
|
}
|
|
616635
616780
|
function atomicWrite(path22, content, mode) {
|
|
616636
|
-
mkdirSync62(
|
|
616637
|
-
const temp = resolve66(
|
|
616781
|
+
mkdirSync62(dirname78(path22), { recursive: true });
|
|
616782
|
+
const temp = resolve66(dirname78(path22), `.${randomUUID55()}.ur-repo-edit.tmp`);
|
|
616638
616783
|
try {
|
|
616639
616784
|
writeFileSync62(temp, content, { flag: "wx", ...mode !== undefined ? { mode } : {} });
|
|
616640
616785
|
renameSync14(temp, path22);
|
|
@@ -616683,14 +616828,14 @@ function rollbackWorkspaceEdit(root2, snapshots) {
|
|
|
616683
616828
|
continue;
|
|
616684
616829
|
}
|
|
616685
616830
|
rmSync18(abs, { force: true, recursive: true });
|
|
616686
|
-
let parent2 =
|
|
616831
|
+
let parent2 = dirname78(abs);
|
|
616687
616832
|
while (parent2 !== realRoot && isWithin(realRoot, parent2)) {
|
|
616688
616833
|
try {
|
|
616689
616834
|
rmdirSync2(parent2);
|
|
616690
616835
|
} catch {
|
|
616691
616836
|
break;
|
|
616692
616837
|
}
|
|
616693
|
-
parent2 =
|
|
616838
|
+
parent2 = dirname78(parent2);
|
|
616694
616839
|
}
|
|
616695
616840
|
}
|
|
616696
616841
|
}
|
|
@@ -616838,7 +616983,7 @@ var init_lspEditEngine = __esm(() => {
|
|
|
616838
616983
|
});
|
|
616839
616984
|
|
|
616840
616985
|
// src/services/repoEditing/ast/typescriptEngine.ts
|
|
616841
|
-
import { dirname as
|
|
616986
|
+
import { dirname as dirname79, join as join205, relative as relative50 } from "path";
|
|
616842
616987
|
import { existsSync as existsSync87, readFileSync as readFileSync82 } from "fs";
|
|
616843
616988
|
function loadProgram(root2, files) {
|
|
616844
616989
|
const configPath2 = import_typescript3.default.findConfigFile(root2, import_typescript3.default.sys.fileExists, "tsconfig.json");
|
|
@@ -616862,7 +617007,7 @@ function loadProgram(root2, files) {
|
|
|
616862
617007
|
jsx: import_typescript3.default.JsxEmit.React
|
|
616863
617008
|
};
|
|
616864
617009
|
const host = import_typescript3.default.createCompilerHost(compilerOptions);
|
|
616865
|
-
const fileNames = files?.length ? files.map((f) =>
|
|
617010
|
+
const fileNames = files?.length ? files.map((f) => join205(root2, f)) : [];
|
|
616866
617011
|
program = import_typescript3.default.createProgram(fileNames, compilerOptions, host);
|
|
616867
617012
|
}
|
|
616868
617013
|
return { program, checker: program.getTypeChecker() };
|
|
@@ -616887,7 +617032,7 @@ function findNodeAtPosition(sourceFile, pos) {
|
|
|
616887
617032
|
return visit2(sourceFile);
|
|
616888
617033
|
}
|
|
616889
617034
|
function symbolAtPosition(ctx, file2, line, column) {
|
|
616890
|
-
const abs =
|
|
617035
|
+
const abs = join205(ctx.program.getCurrentDirectory(), file2);
|
|
616891
617036
|
const sourceFile = ctx.program.getSourceFile(abs);
|
|
616892
617037
|
if (!sourceFile)
|
|
616893
617038
|
return;
|
|
@@ -616950,7 +617095,7 @@ function addOldText(root2, edits) {
|
|
|
616950
617095
|
}
|
|
616951
617096
|
function tsRenameSymbol(ctx, options4) {
|
|
616952
617097
|
const { root: root2, from, to, file: maybeFile, line, column } = options4;
|
|
616953
|
-
const targetFile = maybeFile ?
|
|
617098
|
+
const targetFile = maybeFile ? join205(root2, maybeFile) : undefined;
|
|
616954
617099
|
let targetSymbols;
|
|
616955
617100
|
if (maybeFile && line !== undefined && column !== undefined) {
|
|
616956
617101
|
const symbol2 = symbolAtPosition(ctx, maybeFile, line, column);
|
|
@@ -616997,8 +617142,8 @@ function tsMoveFunction(ctx, options4) {
|
|
|
616997
617142
|
if (!sourceFileRel) {
|
|
616998
617143
|
throw new Error("TS move requires --file to identify the source file");
|
|
616999
617144
|
}
|
|
617000
|
-
const sourceAbs =
|
|
617001
|
-
const targetAbs =
|
|
617145
|
+
const sourceAbs = join205(root2, sourceFileRel);
|
|
617146
|
+
const targetAbs = join205(root2, targetFileRel);
|
|
617002
617147
|
const sourceSf = ctx.program.getSourceFile(sourceAbs);
|
|
617003
617148
|
const targetSf = ctx.program.getSourceFile(targetAbs) ?? ctx.program.getSourceFile(targetFileRel);
|
|
617004
617149
|
if (!sourceSf)
|
|
@@ -617099,11 +617244,11 @@ function normalizePath4(value2) {
|
|
|
617099
617244
|
function resolveRelativeImport(importingFileRel, specifier) {
|
|
617100
617245
|
if (!specifier.startsWith("."))
|
|
617101
617246
|
return;
|
|
617102
|
-
const base2 = normalizePath4(
|
|
617247
|
+
const base2 = normalizePath4(join205(dirname79(importingFileRel), specifier));
|
|
617103
617248
|
return stripKnownExtension(base2);
|
|
617104
617249
|
}
|
|
617105
617250
|
function moduleSpecifierBetween(importingFileRel, targetFileRel) {
|
|
617106
|
-
let specifier = normalizePath4(relative50(
|
|
617251
|
+
let specifier = normalizePath4(relative50(dirname79(importingFileRel), stripKnownExtension(targetFileRel)));
|
|
617107
617252
|
if (!specifier.startsWith("."))
|
|
617108
617253
|
specifier = `./${specifier}`;
|
|
617109
617254
|
return specifier;
|
|
@@ -618118,8 +618263,8 @@ var init_cite2 = __esm(() => {
|
|
|
618118
618263
|
});
|
|
618119
618264
|
|
|
618120
618265
|
// src/ur/fileops.ts
|
|
618121
|
-
import { existsSync as existsSync89, mkdirSync as mkdirSync63, readdirSync as
|
|
618122
|
-
import { extname as extname21, isAbsolute as isAbsolute46, join as
|
|
618266
|
+
import { existsSync as existsSync89, mkdirSync as mkdirSync63, readdirSync as readdirSync33, readFileSync as readFileSync84, statSync as statSync29, writeFileSync as writeFileSync63 } from "fs";
|
|
618267
|
+
import { extname as extname21, isAbsolute as isAbsolute46, join as join206, relative as relative51, resolve as resolve67 } from "path";
|
|
618123
618268
|
function readFileSafe2(cwd2, target, maxBytes = 64000) {
|
|
618124
618269
|
const abs = isAbsolute46(target) ? target : resolve67(cwd2, target);
|
|
618125
618270
|
if (!existsSync89(abs))
|
|
@@ -618144,7 +618289,7 @@ function* walk2(dir, root2, budget = { n: 0 }, max2 = 8000) {
|
|
|
618144
618289
|
return;
|
|
618145
618290
|
let entries;
|
|
618146
618291
|
try {
|
|
618147
|
-
entries =
|
|
618292
|
+
entries = readdirSync33(dir, { withFileTypes: true });
|
|
618148
618293
|
} catch {
|
|
618149
618294
|
return;
|
|
618150
618295
|
}
|
|
@@ -618153,7 +618298,7 @@ function* walk2(dir, root2, budget = { n: 0 }, max2 = 8000) {
|
|
|
618153
618298
|
return;
|
|
618154
618299
|
if (e.name.startsWith(".") && e.name !== ".ur")
|
|
618155
618300
|
continue;
|
|
618156
|
-
const full =
|
|
618301
|
+
const full = join206(dir, e.name);
|
|
618157
618302
|
if (e.isDirectory()) {
|
|
618158
618303
|
if (SKIP_DIRS3.has(e.name))
|
|
618159
618304
|
continue;
|
|
@@ -618172,7 +618317,7 @@ function searchFiles(cwd2, query2, maxResults = 60) {
|
|
|
618172
618317
|
continue;
|
|
618173
618318
|
let lines;
|
|
618174
618319
|
try {
|
|
618175
|
-
lines = readFileSync84(
|
|
618320
|
+
lines = readFileSync84(join206(cwd2, rel), "utf8").split(`
|
|
618176
618321
|
`);
|
|
618177
618322
|
} catch {
|
|
618178
618323
|
continue;
|
|
@@ -618190,8 +618335,8 @@ function searchFiles(cwd2, query2, maxResults = 60) {
|
|
|
618190
618335
|
function indexWorkspace(cwd2) {
|
|
618191
618336
|
const files = [...walk2(cwd2, cwd2)];
|
|
618192
618337
|
try {
|
|
618193
|
-
mkdirSync63(
|
|
618194
|
-
writeFileSync63(
|
|
618338
|
+
mkdirSync63(join206(cwd2, ".ur", "index"), { recursive: true });
|
|
618339
|
+
writeFileSync63(join206(cwd2, ".ur", "index", "files.txt"), files.join(`
|
|
618195
618340
|
`) + `
|
|
618196
618341
|
`);
|
|
618197
618342
|
} catch {}
|
|
@@ -618617,8 +618762,8 @@ __export(exports_mode, {
|
|
|
618617
618762
|
call: () => call122
|
|
618618
618763
|
});
|
|
618619
618764
|
import { existsSync as existsSync92, mkdirSync as mkdirSync64, readFileSync as readFileSync85, writeFileSync as writeFileSync64 } from "fs";
|
|
618620
|
-
import { join as
|
|
618621
|
-
var MODES2, SECURITY_MODES2, file2 = (cwd2) =>
|
|
618765
|
+
import { join as join207 } from "path";
|
|
618766
|
+
var MODES2, SECURITY_MODES2, file2 = (cwd2) => join207(cwd2, ".ur", "mode"), call122 = async (args) => {
|
|
618622
618767
|
const want = (args ?? "").trim().toLowerCase();
|
|
618623
618768
|
const f = file2(getCwd());
|
|
618624
618769
|
if (!want) {
|
|
@@ -618636,7 +618781,7 @@ available: ${MODES2.join(", ")}
|
|
|
618636
618781
|
security: ${SECURITY_MODES2.join(", ")}` };
|
|
618637
618782
|
}
|
|
618638
618783
|
try {
|
|
618639
|
-
mkdirSync64(
|
|
618784
|
+
mkdirSync64(join207(getCwd(), ".ur"), { recursive: true });
|
|
618640
618785
|
writeFileSync64(f, want + `
|
|
618641
618786
|
`);
|
|
618642
618787
|
} catch {}
|
|
@@ -618760,7 +618905,7 @@ __export(exports_role_mode, {
|
|
|
618760
618905
|
call: () => call123
|
|
618761
618906
|
});
|
|
618762
618907
|
import { existsSync as existsSync93, mkdirSync as mkdirSync65, writeFileSync as writeFileSync65 } from "fs";
|
|
618763
|
-
import { join as
|
|
618908
|
+
import { join as join208 } from "path";
|
|
618764
618909
|
function formatList2() {
|
|
618765
618910
|
const lines = ["Built-in role modes:", ""];
|
|
618766
618911
|
for (const mode2 of ROLE_MODES) {
|
|
@@ -618814,12 +618959,12 @@ var call123 = async (args) => {
|
|
|
618814
618959
|
value: `Unknown role mode "${target}". Available: ${listModeNames().join(", ")}, or "all".`
|
|
618815
618960
|
};
|
|
618816
618961
|
}
|
|
618817
|
-
const agentsDir =
|
|
618962
|
+
const agentsDir = join208(getCwd(), ".ur", "agents");
|
|
618818
618963
|
mkdirSync65(agentsDir, { recursive: true });
|
|
618819
618964
|
const created = [];
|
|
618820
618965
|
const skipped = [];
|
|
618821
618966
|
for (const mode2 of modes) {
|
|
618822
|
-
const path22 =
|
|
618967
|
+
const path22 = join208(agentsDir, `${mode2.name}.md`);
|
|
618823
618968
|
if (existsSync93(path22) && !force) {
|
|
618824
618969
|
skipped.push(`${mode2.name} (exists; use --force to overwrite)`);
|
|
618825
618970
|
continue;
|
|
@@ -618871,14 +619016,14 @@ var init_role_mode2 = __esm(() => {
|
|
|
618871
619016
|
|
|
618872
619017
|
// src/ur/researchGraph.ts
|
|
618873
619018
|
import { appendFileSync as appendFileSync8, existsSync as existsSync94, mkdirSync as mkdirSync66, readFileSync as readFileSync86 } from "fs";
|
|
618874
|
-
import { dirname as
|
|
619019
|
+
import { dirname as dirname80, join as join209 } from "path";
|
|
618875
619020
|
function isEntity(s) {
|
|
618876
619021
|
return ENTITIES.includes(s);
|
|
618877
619022
|
}
|
|
618878
619023
|
function addEntity(cwd2, entity, text) {
|
|
618879
619024
|
try {
|
|
618880
619025
|
const f = file3(cwd2, entity);
|
|
618881
|
-
mkdirSync66(
|
|
619026
|
+
mkdirSync66(dirname80(f), { recursive: true });
|
|
618882
619027
|
appendFileSync8(f, JSON.stringify({ ts: new Date().toISOString(), text }) + `
|
|
618883
619028
|
`);
|
|
618884
619029
|
} catch {}
|
|
@@ -618902,7 +619047,7 @@ function graphSummary(cwd2) {
|
|
|
618902
619047
|
out[e] = listEntity(cwd2, e).length;
|
|
618903
619048
|
return out;
|
|
618904
619049
|
}
|
|
618905
|
-
var ENTITIES, file3 = (cwd2, entity) =>
|
|
619050
|
+
var ENTITIES, file3 = (cwd2, entity) => join209(cwd2, ".ur", "graph", `${entity}.jsonl`);
|
|
618906
619051
|
var init_researchGraph = __esm(() => {
|
|
618907
619052
|
ENTITIES = [
|
|
618908
619053
|
"sources",
|
|
@@ -618971,15 +619116,15 @@ var exports_toolsmith = {};
|
|
|
618971
619116
|
__export(exports_toolsmith, {
|
|
618972
619117
|
call: () => call125
|
|
618973
619118
|
});
|
|
618974
|
-
import { existsSync as existsSync95, mkdirSync as mkdirSync67, readdirSync as
|
|
618975
|
-
import { join as
|
|
619119
|
+
import { existsSync as existsSync95, mkdirSync as mkdirSync67, readdirSync as readdirSync34, writeFileSync as writeFileSync66 } from "fs";
|
|
619120
|
+
import { join as join210 } from "path";
|
|
618976
619121
|
var TEMPLATES, call125 = async (args) => {
|
|
618977
619122
|
const [name, langArg] = (args ?? "").trim().split(/\s+/).filter(Boolean);
|
|
618978
619123
|
const auto = [["python3", "python"], ["node", "node"], ["bash", "bash"], ["go", "go"], ["cargo", "rust"]].find(([bin]) => commandExists(bin))?.[1] ?? "python";
|
|
618979
619124
|
const lang = langArg ?? auto;
|
|
618980
|
-
const dir =
|
|
619125
|
+
const dir = join210(getCwd(), ".ur", "tools");
|
|
618981
619126
|
if (!name) {
|
|
618982
|
-
const files = existsSync95(dir) ?
|
|
619127
|
+
const files = existsSync95(dir) ? readdirSync34(dir) : [];
|
|
618983
619128
|
return { type: "text", value: files.length ? `tools:
|
|
618984
619129
|
` + files.map((f) => " " + f).join(`
|
|
618985
619130
|
`) : "no tools yet. usage: /toolsmith <name> <python|bash|node|go|rust>" };
|
|
@@ -618988,7 +619133,7 @@ var TEMPLATES, call125 = async (args) => {
|
|
|
618988
619133
|
if (!tpl)
|
|
618989
619134
|
return { type: "text", value: `unknown lang "${lang}". choose: ${Object.keys(TEMPLATES).join(", ")}` };
|
|
618990
619135
|
mkdirSync67(dir, { recursive: true });
|
|
618991
|
-
const file4 =
|
|
619136
|
+
const file4 = join210(dir, `${name}.${tpl.ext}`);
|
|
618992
619137
|
if (existsSync95(file4))
|
|
618993
619138
|
return { type: "text", value: `already exists: .ur/tools/${name}.${tpl.ext}` };
|
|
618994
619139
|
writeFileSync66(file4, tpl.body);
|
|
@@ -619052,12 +619197,12 @@ __export(exports_browser, {
|
|
|
619052
619197
|
call: () => call126
|
|
619053
619198
|
});
|
|
619054
619199
|
import { existsSync as existsSync96 } from "fs";
|
|
619055
|
-
import { join as
|
|
619200
|
+
import { join as join211 } from "path";
|
|
619056
619201
|
var call126 = async (args) => {
|
|
619057
619202
|
const task2 = (args ?? "").trim();
|
|
619058
619203
|
if (!task2)
|
|
619059
619204
|
return { type: "text", value: "usage: /browser <url|task>" };
|
|
619060
|
-
const hasPlaywright = existsSync96(
|
|
619205
|
+
const hasPlaywright = existsSync96(join211(getCwd(), "node_modules", "playwright")) || existsSync96(join211(getCwd(), "node_modules", "playwright-core"));
|
|
619061
619206
|
if (hasPlaywright) {
|
|
619062
619207
|
return { type: "text", value: `Playwright detected \u2014 ask UR to drive the browser for: ${task2}
|
|
619063
619208
|
Risky actions (form submit, downloads, login) require your approval.` };
|
|
@@ -619115,16 +619260,16 @@ var init_ur_doctor2 = __esm(() => {
|
|
|
619115
619260
|
|
|
619116
619261
|
// src/utils/urAssets.ts
|
|
619117
619262
|
import { existsSync as existsSync97, mkdirSync as mkdirSync68, writeFileSync as writeFileSync67 } from "fs";
|
|
619118
|
-
import { join as
|
|
619263
|
+
import { join as join212 } from "path";
|
|
619119
619264
|
function scaffoldUrAssets(cwd2) {
|
|
619120
|
-
const root2 =
|
|
619265
|
+
const root2 = join212(cwd2, ".ur");
|
|
619121
619266
|
const created = [];
|
|
619122
619267
|
const skipped = [];
|
|
619123
619268
|
mkdirSync68(root2, { recursive: true });
|
|
619124
619269
|
for (const d3 of DIRS)
|
|
619125
|
-
mkdirSync68(
|
|
619270
|
+
mkdirSync68(join212(root2, d3), { recursive: true });
|
|
619126
619271
|
for (const file4 of SEED_FILES) {
|
|
619127
|
-
const full =
|
|
619272
|
+
const full = join212(root2, file4.path);
|
|
619128
619273
|
if (existsSync97(full)) {
|
|
619129
619274
|
skipped.push(file4.path);
|
|
619130
619275
|
continue;
|
|
@@ -619415,7 +619560,7 @@ __export(exports_thinkback, {
|
|
|
619415
619560
|
call: () => call132
|
|
619416
619561
|
});
|
|
619417
619562
|
import { readFile as readFile47 } from "fs/promises";
|
|
619418
|
-
import { join as
|
|
619563
|
+
import { join as join213 } from "path";
|
|
619419
619564
|
function getMarketplaceName() {
|
|
619420
619565
|
return OFFICIAL_MARKETPLACE_NAME;
|
|
619421
619566
|
}
|
|
@@ -619433,15 +619578,15 @@ async function getThinkbackSkillDir() {
|
|
|
619433
619578
|
if (!thinkbackPlugin) {
|
|
619434
619579
|
return null;
|
|
619435
619580
|
}
|
|
619436
|
-
const skillDir =
|
|
619581
|
+
const skillDir = join213(thinkbackPlugin.path, "skills", SKILL_NAME);
|
|
619437
619582
|
if (await pathExists(skillDir)) {
|
|
619438
619583
|
return skillDir;
|
|
619439
619584
|
}
|
|
619440
619585
|
return null;
|
|
619441
619586
|
}
|
|
619442
619587
|
async function playAnimation(skillDir) {
|
|
619443
|
-
const dataPath =
|
|
619444
|
-
const playerPath =
|
|
619588
|
+
const dataPath = join213(skillDir, "year_in_review.js");
|
|
619589
|
+
const playerPath = join213(skillDir, "player.js");
|
|
619445
619590
|
try {
|
|
619446
619591
|
await readFile47(dataPath);
|
|
619447
619592
|
} catch (e) {
|
|
@@ -619489,7 +619634,7 @@ async function playAnimation(skillDir) {
|
|
|
619489
619634
|
} catch {} finally {
|
|
619490
619635
|
inkInstance.exitAlternateScreen();
|
|
619491
619636
|
}
|
|
619492
|
-
const htmlPath =
|
|
619637
|
+
const htmlPath = join213(skillDir, "year_in_review.html");
|
|
619493
619638
|
if (await pathExists(htmlPath)) {
|
|
619494
619639
|
const platform6 = getPlatform();
|
|
619495
619640
|
const openCmd = platform6 === "macos" ? "open" : platform6 === "windows" ? "start" : "xdg-open";
|
|
@@ -619825,7 +619970,7 @@ function ThinkbackFlow(t0) {
|
|
|
619825
619970
|
if (!skillDir) {
|
|
619826
619971
|
return;
|
|
619827
619972
|
}
|
|
619828
|
-
const dataPath =
|
|
619973
|
+
const dataPath = join213(skillDir, "year_in_review.js");
|
|
619829
619974
|
pathExists(dataPath).then((exists) => {
|
|
619830
619975
|
logForDebugging(`Checking for ${dataPath}: ${exists ? "found" : "not found"}`);
|
|
619831
619976
|
setHasGenerated(exists);
|
|
@@ -619999,7 +620144,7 @@ var exports_thinkback_play = {};
|
|
|
619999
620144
|
__export(exports_thinkback_play, {
|
|
620000
620145
|
call: () => call133
|
|
620001
620146
|
});
|
|
620002
|
-
import { join as
|
|
620147
|
+
import { join as join214 } from "path";
|
|
620003
620148
|
function getPluginId2() {
|
|
620004
620149
|
const marketplaceName = process.env.USER_TYPE === "ant" ? INTERNAL_MARKETPLACE_NAME : OFFICIAL_MARKETPLACE_NAME;
|
|
620005
620150
|
return `thinkback@${marketplaceName}`;
|
|
@@ -620021,7 +620166,7 @@ async function call133() {
|
|
|
620021
620166
|
value: "Thinkback plugin installation path not found."
|
|
620022
620167
|
};
|
|
620023
620168
|
}
|
|
620024
|
-
const skillDir =
|
|
620169
|
+
const skillDir = join214(firstInstall.installPath, "skills", SKILL_NAME2);
|
|
620025
620170
|
const result = await playAnimation(skillDir);
|
|
620026
620171
|
return { type: "text", value: result.message };
|
|
620027
620172
|
}
|
|
@@ -626490,7 +626635,7 @@ var init_types15 = __esm(() => {
|
|
|
626490
626635
|
|
|
626491
626636
|
// src/components/agents/agentFileUtils.ts
|
|
626492
626637
|
import { mkdir as mkdir36, open as open13, unlink as unlink20 } from "fs/promises";
|
|
626493
|
-
import { join as
|
|
626638
|
+
import { join as join215 } from "path";
|
|
626494
626639
|
function formatAgentAsMarkdown(agentType, whenToUse, tools, systemPrompt, color3, model, memory2, effort) {
|
|
626495
626640
|
const escapedWhenToUse = whenToUse.replace(/\\/g, "\\\\").replace(/"/g, "\\\"").replace(/\n/g, "\\\\n");
|
|
626496
626641
|
const isAllTools = tools === undefined || tools.length === 1 && tools[0] === "*";
|
|
@@ -626517,26 +626662,26 @@ function getAgentDirectoryPath(location2) {
|
|
|
626517
626662
|
case "flagSettings":
|
|
626518
626663
|
throw new Error(`Cannot get directory path for ${location2} agents`);
|
|
626519
626664
|
case "userSettings":
|
|
626520
|
-
return
|
|
626665
|
+
return join215(getURConfigHomeDir(), AGENT_PATHS.AGENTS_DIR);
|
|
626521
626666
|
case "projectSettings":
|
|
626522
|
-
return
|
|
626667
|
+
return join215(getCwd(), AGENT_PATHS.FOLDER_NAME, AGENT_PATHS.AGENTS_DIR);
|
|
626523
626668
|
case "policySettings":
|
|
626524
|
-
return
|
|
626669
|
+
return join215(getManagedFilePath(), AGENT_PATHS.FOLDER_NAME, AGENT_PATHS.AGENTS_DIR);
|
|
626525
626670
|
case "localSettings":
|
|
626526
|
-
return
|
|
626671
|
+
return join215(getCwd(), AGENT_PATHS.FOLDER_NAME, AGENT_PATHS.AGENTS_DIR);
|
|
626527
626672
|
}
|
|
626528
626673
|
}
|
|
626529
626674
|
function getRelativeAgentDirectoryPath(location2) {
|
|
626530
626675
|
switch (location2) {
|
|
626531
626676
|
case "projectSettings":
|
|
626532
|
-
return
|
|
626677
|
+
return join215(".", AGENT_PATHS.FOLDER_NAME, AGENT_PATHS.AGENTS_DIR);
|
|
626533
626678
|
default:
|
|
626534
626679
|
return getAgentDirectoryPath(location2);
|
|
626535
626680
|
}
|
|
626536
626681
|
}
|
|
626537
626682
|
function getNewAgentFilePath(agent2) {
|
|
626538
626683
|
const dirPath = getAgentDirectoryPath(agent2.source);
|
|
626539
|
-
return
|
|
626684
|
+
return join215(dirPath, `${agent2.agentType}.md`);
|
|
626540
626685
|
}
|
|
626541
626686
|
function getActualAgentFilePath(agent2) {
|
|
626542
626687
|
if (agent2.source === "built-in") {
|
|
@@ -626547,14 +626692,14 @@ function getActualAgentFilePath(agent2) {
|
|
|
626547
626692
|
}
|
|
626548
626693
|
const dirPath = getAgentDirectoryPath(agent2.source);
|
|
626549
626694
|
const filename = agent2.filename || agent2.agentType;
|
|
626550
|
-
return
|
|
626695
|
+
return join215(dirPath, `${filename}.md`);
|
|
626551
626696
|
}
|
|
626552
626697
|
function getNewRelativeAgentFilePath(agent2) {
|
|
626553
626698
|
if (agent2.source === "built-in") {
|
|
626554
626699
|
return "Built-in";
|
|
626555
626700
|
}
|
|
626556
626701
|
const dirPath = getRelativeAgentDirectoryPath(agent2.source);
|
|
626557
|
-
return
|
|
626702
|
+
return join215(dirPath, `${agent2.agentType}.md`);
|
|
626558
626703
|
}
|
|
626559
626704
|
function getActualRelativeAgentFilePath(agent2) {
|
|
626560
626705
|
if (isBuiltInAgent(agent2)) {
|
|
@@ -626568,7 +626713,7 @@ function getActualRelativeAgentFilePath(agent2) {
|
|
|
626568
626713
|
}
|
|
626569
626714
|
const dirPath = getRelativeAgentDirectoryPath(agent2.source);
|
|
626570
626715
|
const filename = agent2.filename || agent2.agentType;
|
|
626571
|
-
return
|
|
626716
|
+
return join215(dirPath, `${filename}.md`);
|
|
626572
626717
|
}
|
|
626573
626718
|
async function ensureAgentDirectoryExists(source) {
|
|
626574
626719
|
const dirPath = getAgentDirectoryPath(source);
|
|
@@ -632616,7 +632761,7 @@ var init_undo3 = __esm(() => {
|
|
|
632616
632761
|
// src/utils/heapDumpService.ts
|
|
632617
632762
|
import { createWriteStream as createWriteStream3, writeFileSync as writeFileSync68 } from "fs";
|
|
632618
632763
|
import { readdir as readdir27, readFile as readFile49, writeFile as writeFile40 } from "fs/promises";
|
|
632619
|
-
import { join as
|
|
632764
|
+
import { join as join216 } from "path";
|
|
632620
632765
|
import { pipeline as pipeline2 } from "stream/promises";
|
|
632621
632766
|
import {
|
|
632622
632767
|
getHeapSnapshot,
|
|
@@ -632706,7 +632851,7 @@ async function captureMemoryDiagnostics(trigger2, dumpNumber = 0) {
|
|
|
632706
632851
|
smapsRollup,
|
|
632707
632852
|
platform: process.platform,
|
|
632708
632853
|
nodeVersion: process.version,
|
|
632709
|
-
ccVersion: "1.
|
|
632854
|
+
ccVersion: "1.58.0"
|
|
632710
632855
|
};
|
|
632711
632856
|
}
|
|
632712
632857
|
async function performHeapDump(trigger2 = "manual", dumpNumber = 0) {
|
|
@@ -632724,8 +632869,8 @@ async function performHeapDump(trigger2 = "manual", dumpNumber = 0) {
|
|
|
632724
632869
|
const suffix = dumpNumber > 0 ? `-dump${dumpNumber}` : "";
|
|
632725
632870
|
const heapFilename = `${sessionId}${suffix}.heapsnapshot`;
|
|
632726
632871
|
const diagFilename = `${sessionId}${suffix}-diagnostics.json`;
|
|
632727
|
-
const heapPath =
|
|
632728
|
-
const diagPath =
|
|
632872
|
+
const heapPath = join216(dumpDir, heapFilename);
|
|
632873
|
+
const diagPath = join216(dumpDir, diagFilename);
|
|
632729
632874
|
await writeFile40(diagPath, jsonStringify(diagnostics, null, 2), {
|
|
632730
632875
|
mode: 384
|
|
632731
632876
|
});
|
|
@@ -633286,7 +633431,7 @@ var init_bridge_kick = __esm(() => {
|
|
|
633286
633431
|
var call149 = async () => {
|
|
633287
633432
|
return {
|
|
633288
633433
|
type: "text",
|
|
633289
|
-
value: "1.
|
|
633434
|
+
value: "1.58.0"
|
|
633290
633435
|
};
|
|
633291
633436
|
}, version2, version_default;
|
|
633292
633437
|
var init_version = __esm(() => {
|
|
@@ -634670,7 +634815,7 @@ var init_sandbox_toggle2 = __esm(() => {
|
|
|
634670
634815
|
|
|
634671
634816
|
// src/utils/urInChrome/setupPortable.ts
|
|
634672
634817
|
import { readdir as readdir28 } from "fs/promises";
|
|
634673
|
-
import { join as
|
|
634818
|
+
import { join as join217 } from "path";
|
|
634674
634819
|
function getExtensionIds() {
|
|
634675
634820
|
return process.env.USER_TYPE === "ant" ? [PROD_EXTENSION_ID, DEV_EXTENSION_ID, ANT_EXTENSION_ID] : [PROD_EXTENSION_ID];
|
|
634676
634821
|
}
|
|
@@ -634697,7 +634842,7 @@ async function detectExtensionInstallationPortable(browserPaths, log) {
|
|
|
634697
634842
|
}
|
|
634698
634843
|
for (const profile of profileDirs) {
|
|
634699
634844
|
for (const extensionId of extensionIds) {
|
|
634700
|
-
const extensionPath =
|
|
634845
|
+
const extensionPath = join217(browserBasePath, profile, "Extensions", extensionId);
|
|
634701
634846
|
try {
|
|
634702
634847
|
await readdir28(extensionPath);
|
|
634703
634848
|
log?.(`[UR in Chrome] Extension ${extensionId} found in ${browser2} ${profile}`);
|
|
@@ -634721,7 +634866,7 @@ var init_setupPortable = __esm(() => {
|
|
|
634721
634866
|
// src/utils/urInChrome/setup.ts
|
|
634722
634867
|
import { chmod as chmod10, mkdir as mkdir37, readFile as readFile50, writeFile as writeFile41 } from "fs/promises";
|
|
634723
634868
|
import { homedir as homedir34 } from "os";
|
|
634724
|
-
import { join as
|
|
634869
|
+
import { join as join218 } from "path";
|
|
634725
634870
|
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
634726
634871
|
function shouldEnableURInChrome(chromeFlag) {
|
|
634727
634872
|
if (getIsNonInteractiveSession() && chromeFlag !== true) {
|
|
@@ -634778,8 +634923,8 @@ function setupURInChrome() {
|
|
|
634778
634923
|
};
|
|
634779
634924
|
} else {
|
|
634780
634925
|
const __filename3 = fileURLToPath6(import.meta.url);
|
|
634781
|
-
const __dirname3 =
|
|
634782
|
-
const cliPath =
|
|
634926
|
+
const __dirname3 = join218(__filename3, "..");
|
|
634927
|
+
const cliPath = join218(__dirname3, "cli.js");
|
|
634783
634928
|
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" }));
|
|
634784
634929
|
const mcpConfig = {
|
|
634785
634930
|
[UR_IN_CHROME_MCP_SERVER_NAME]: {
|
|
@@ -634801,8 +634946,8 @@ function getNativeMessagingHostsDirs() {
|
|
|
634801
634946
|
const platform6 = getPlatform();
|
|
634802
634947
|
if (platform6 === "windows") {
|
|
634803
634948
|
const home = homedir34();
|
|
634804
|
-
const appData = process.env.APPDATA ||
|
|
634805
|
-
return [
|
|
634949
|
+
const appData = process.env.APPDATA || join218(home, "AppData", "Local");
|
|
634950
|
+
return [join218(appData, "UR", "ChromeNativeHost")];
|
|
634806
634951
|
}
|
|
634807
634952
|
return getAllNativeMessagingHostsDirs().map(({ path: path22 }) => path22);
|
|
634808
634953
|
}
|
|
@@ -634827,7 +634972,7 @@ async function installChromeNativeHostManifest(manifestBinaryPath) {
|
|
|
634827
634972
|
const manifestContent = jsonStringify(manifest, null, 2);
|
|
634828
634973
|
let anyManifestUpdated = false;
|
|
634829
634974
|
for (const manifestDir of manifestDirs) {
|
|
634830
|
-
const manifestPath6 =
|
|
634975
|
+
const manifestPath6 = join218(manifestDir, NATIVE_HOST_MANIFEST_NAME);
|
|
634831
634976
|
const existingContent = await readFile50(manifestPath6, "utf-8").catch(() => null);
|
|
634832
634977
|
if (existingContent === manifestContent) {
|
|
634833
634978
|
continue;
|
|
@@ -634842,7 +634987,7 @@ async function installChromeNativeHostManifest(manifestBinaryPath) {
|
|
|
634842
634987
|
}
|
|
634843
634988
|
}
|
|
634844
634989
|
if (getPlatform() === "windows") {
|
|
634845
|
-
const manifestPath6 =
|
|
634990
|
+
const manifestPath6 = join218(manifestDirs[0], NATIVE_HOST_MANIFEST_NAME);
|
|
634846
634991
|
registerWindowsNativeHosts(manifestPath6);
|
|
634847
634992
|
}
|
|
634848
634993
|
if (anyManifestUpdated) {
|
|
@@ -634880,8 +635025,8 @@ function registerWindowsNativeHosts(manifestPath6) {
|
|
|
634880
635025
|
}
|
|
634881
635026
|
async function createWrapperScript(command7) {
|
|
634882
635027
|
const platform6 = getPlatform();
|
|
634883
|
-
const chromeDir =
|
|
634884
|
-
const wrapperPath = platform6 === "windows" ?
|
|
635028
|
+
const chromeDir = join218(getURConfigHomeDir(), "chrome");
|
|
635029
|
+
const wrapperPath = platform6 === "windows" ? join218(chromeDir, "chrome-native-host.bat") : join218(chromeDir, "chrome-native-host");
|
|
634885
635030
|
const scriptContent = platform6 === "windows" ? `@echo off
|
|
634886
635031
|
REM Chrome native host wrapper script
|
|
634887
635032
|
REM Generated by UR - do not edit manually
|
|
@@ -635453,7 +635598,7 @@ var init_advisor2 = __esm(() => {
|
|
|
635453
635598
|
// src/skills/bundledSkills.ts
|
|
635454
635599
|
import { constants as fsConstants6 } from "fs";
|
|
635455
635600
|
import { mkdir as mkdir38, open as open14 } from "fs/promises";
|
|
635456
|
-
import { dirname as
|
|
635601
|
+
import { dirname as dirname81, isAbsolute as isAbsolute49, join as join219, normalize as normalize14, sep as pathSep4 } from "path";
|
|
635457
635602
|
function registerBundledSkill(definition) {
|
|
635458
635603
|
const { files: files2 } = definition;
|
|
635459
635604
|
let skillRoot;
|
|
@@ -635501,7 +635646,7 @@ function getBundledSkills() {
|
|
|
635501
635646
|
return [...bundledSkills];
|
|
635502
635647
|
}
|
|
635503
635648
|
function getBundledSkillExtractDir(skillName) {
|
|
635504
|
-
return
|
|
635649
|
+
return join219(getBundledSkillsRoot(), skillName);
|
|
635505
635650
|
}
|
|
635506
635651
|
async function extractBundledSkillFiles(skillName, files2) {
|
|
635507
635652
|
const dir = getBundledSkillExtractDir(skillName);
|
|
@@ -635517,7 +635662,7 @@ async function writeSkillFiles(dir, files2) {
|
|
|
635517
635662
|
const byParent = new Map;
|
|
635518
635663
|
for (const [relPath, content] of Object.entries(files2)) {
|
|
635519
635664
|
const target = resolveSkillFilePath(dir, relPath);
|
|
635520
|
-
const parent2 =
|
|
635665
|
+
const parent2 = dirname81(target);
|
|
635521
635666
|
const entry = [target, content];
|
|
635522
635667
|
const group = byParent.get(parent2);
|
|
635523
635668
|
if (group)
|
|
@@ -635543,7 +635688,7 @@ function resolveSkillFilePath(baseDir, relPath) {
|
|
|
635543
635688
|
if (isAbsolute49(normalized) || normalized.split(pathSep4).includes("..") || normalized.split("/").includes("..")) {
|
|
635544
635689
|
throw new Error(`bundled skill file path escapes skill dir: ${relPath}`);
|
|
635545
635690
|
}
|
|
635546
|
-
return
|
|
635691
|
+
return join219(baseDir, normalized);
|
|
635547
635692
|
}
|
|
635548
635693
|
function prependBaseDir(blocks, baseDir) {
|
|
635549
635694
|
const prefix = `Base directory for this skill: ${baseDir}
|
|
@@ -635898,7 +636043,7 @@ var init_exit2 = __esm(() => {
|
|
|
635898
636043
|
});
|
|
635899
636044
|
|
|
635900
636045
|
// src/components/ExportDialog.tsx
|
|
635901
|
-
import { join as
|
|
636046
|
+
import { join as join220 } from "path";
|
|
635902
636047
|
function ExportDialog({
|
|
635903
636048
|
content,
|
|
635904
636049
|
defaultFilename,
|
|
@@ -635931,7 +636076,7 @@ function ExportDialog({
|
|
|
635931
636076
|
};
|
|
635932
636077
|
const handleFilenameSubmit = () => {
|
|
635933
636078
|
const finalFilename = filename.endsWith(".txt") ? filename : filename.replace(/\.[^.]+$/, "") + ".txt";
|
|
635934
|
-
const filepath =
|
|
636079
|
+
const filepath = join220(getCwd(), finalFilename);
|
|
635935
636080
|
try {
|
|
635936
636081
|
writeFileSync_DEPRECATED(filepath, content, {
|
|
635937
636082
|
encoding: "utf-8",
|
|
@@ -636154,7 +636299,7 @@ __export(exports_export, {
|
|
|
636154
636299
|
extractFirstPrompt: () => extractFirstPrompt,
|
|
636155
636300
|
call: () => call155
|
|
636156
636301
|
});
|
|
636157
|
-
import { join as
|
|
636302
|
+
import { join as join221 } from "path";
|
|
636158
636303
|
function formatTimestamp(date6) {
|
|
636159
636304
|
const year = date6.getFullYear();
|
|
636160
636305
|
const month = String(date6.getMonth() + 1).padStart(2, "0");
|
|
@@ -636198,7 +636343,7 @@ async function call155(onDone, context6, args) {
|
|
|
636198
636343
|
const filename = args.trim();
|
|
636199
636344
|
if (filename) {
|
|
636200
636345
|
const finalFilename = filename.endsWith(".txt") ? filename : filename.replace(/\.[^.]+$/, "") + ".txt";
|
|
636201
|
-
const filepath =
|
|
636346
|
+
const filepath = join221(getCwd(), finalFilename);
|
|
636202
636347
|
try {
|
|
636203
636348
|
writeFileSync_DEPRECATED(filepath, content, {
|
|
636204
636349
|
encoding: "utf-8",
|
|
@@ -639090,7 +639235,7 @@ var require_asciichart = __commonJS((exports) => {
|
|
|
639090
639235
|
// src/utils/statsCache.ts
|
|
639091
639236
|
import { randomBytes as randomBytes19 } from "crypto";
|
|
639092
639237
|
import { open as open15 } from "fs/promises";
|
|
639093
|
-
import { join as
|
|
639238
|
+
import { join as join222 } from "path";
|
|
639094
639239
|
async function withStatsCacheLock(fn) {
|
|
639095
639240
|
while (statsCacheLockPromise) {
|
|
639096
639241
|
await statsCacheLockPromise;
|
|
@@ -639107,7 +639252,7 @@ async function withStatsCacheLock(fn) {
|
|
|
639107
639252
|
}
|
|
639108
639253
|
}
|
|
639109
639254
|
function getStatsCachePath() {
|
|
639110
|
-
return
|
|
639255
|
+
return join222(getURConfigHomeDir(), STATS_CACHE_FILENAME);
|
|
639111
639256
|
}
|
|
639112
639257
|
function getEmptyCache() {
|
|
639113
639258
|
return {
|
|
@@ -639775,12 +639920,12 @@ var init_ansiToPng = __esm(() => {
|
|
|
639775
639920
|
// src/utils/screenshotClipboard.ts
|
|
639776
639921
|
import { mkdir as mkdir39, unlink as unlink21, writeFile as writeFile42 } from "fs/promises";
|
|
639777
639922
|
import { tmpdir as tmpdir16 } from "os";
|
|
639778
|
-
import { join as
|
|
639923
|
+
import { join as join223 } from "path";
|
|
639779
639924
|
async function copyAnsiToClipboard(ansiText, options4) {
|
|
639780
639925
|
try {
|
|
639781
|
-
const tempDir =
|
|
639926
|
+
const tempDir = join223(tmpdir16(), "ur-screenshots");
|
|
639782
639927
|
await mkdir39(tempDir, { recursive: true });
|
|
639783
|
-
const pngPath =
|
|
639928
|
+
const pngPath = join223(tempDir, `screenshot-${Date.now()}.png`);
|
|
639784
639929
|
const pngBuffer = ansiToPng(ansiText, options4);
|
|
639785
639930
|
await writeFile42(pngPath, pngBuffer);
|
|
639786
639931
|
const result = await copyPngToClipboard(pngPath);
|
|
@@ -639851,7 +639996,7 @@ var init_screenshotClipboard = __esm(() => {
|
|
|
639851
639996
|
|
|
639852
639997
|
// src/utils/stats.ts
|
|
639853
639998
|
import { open as open16 } from "fs/promises";
|
|
639854
|
-
import { basename as basename49, join as
|
|
639999
|
+
import { basename as basename49, join as join224, sep as sep44 } from "path";
|
|
639855
640000
|
async function processSessionFiles(sessionFiles, options4 = {}) {
|
|
639856
640001
|
const { fromDate, toDate } = options4;
|
|
639857
640002
|
const fs12 = getFsImplementation();
|
|
@@ -640029,17 +640174,17 @@ async function getAllSessionFiles() {
|
|
|
640029
640174
|
return [];
|
|
640030
640175
|
throw e;
|
|
640031
640176
|
}
|
|
640032
|
-
const projectDirs = allEntries.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
640177
|
+
const projectDirs = allEntries.filter((dirent) => dirent.isDirectory()).map((dirent) => join224(projectsDir, dirent.name));
|
|
640033
640178
|
const projectResults = await Promise.all(projectDirs.map(async (projectDir) => {
|
|
640034
640179
|
try {
|
|
640035
640180
|
const entries = await fs12.readdir(projectDir);
|
|
640036
|
-
const mainFiles = entries.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".jsonl")).map((dirent) =>
|
|
640181
|
+
const mainFiles = entries.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".jsonl")).map((dirent) => join224(projectDir, dirent.name));
|
|
640037
640182
|
const sessionDirs = entries.filter((dirent) => dirent.isDirectory());
|
|
640038
640183
|
const subagentResults = await Promise.all(sessionDirs.map(async (sessionDir) => {
|
|
640039
|
-
const subagentsDir =
|
|
640184
|
+
const subagentsDir = join224(projectDir, sessionDir.name, "subagents");
|
|
640040
640185
|
try {
|
|
640041
640186
|
const subagentEntries = await fs12.readdir(subagentsDir);
|
|
640042
|
-
return subagentEntries.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".jsonl") && dirent.name.startsWith("agent-")).map((dirent) =>
|
|
640187
|
+
return subagentEntries.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".jsonl") && dirent.name.startsWith("agent-")).map((dirent) => join224(subagentsDir, dirent.name));
|
|
640043
640188
|
} catch {
|
|
640044
640189
|
return [];
|
|
640045
640190
|
}
|
|
@@ -642903,7 +643048,7 @@ import {
|
|
|
642903
643048
|
writeFile as writeFile43
|
|
642904
643049
|
} from "fs/promises";
|
|
642905
643050
|
import { tmpdir as tmpdir17 } from "os";
|
|
642906
|
-
import { extname as extname23, join as
|
|
643051
|
+
import { extname as extname23, join as join225 } from "path";
|
|
642907
643052
|
function getAnalysisModel() {
|
|
642908
643053
|
return getDefaultmodelOModel();
|
|
642909
643054
|
}
|
|
@@ -642911,13 +643056,13 @@ function getInsightsModel() {
|
|
|
642911
643056
|
return getDefaultmodelOModel();
|
|
642912
643057
|
}
|
|
642913
643058
|
function getDataDir() {
|
|
642914
|
-
return
|
|
643059
|
+
return join225(getURConfigHomeDir(), "usage-data");
|
|
642915
643060
|
}
|
|
642916
643061
|
function getFacetsDir() {
|
|
642917
|
-
return
|
|
643062
|
+
return join225(getDataDir(), "facets");
|
|
642918
643063
|
}
|
|
642919
643064
|
function getSessionMetaDir() {
|
|
642920
|
-
return
|
|
643065
|
+
return join225(getDataDir(), "session-meta");
|
|
642921
643066
|
}
|
|
642922
643067
|
function getLanguageFromPath(filePath) {
|
|
642923
643068
|
const ext = extname23(filePath).toLowerCase();
|
|
@@ -643262,7 +643407,7 @@ async function formatTranscriptWithSummarization(log) {
|
|
|
643262
643407
|
`);
|
|
643263
643408
|
}
|
|
643264
643409
|
async function loadCachedFacets(sessionId) {
|
|
643265
|
-
const facetPath =
|
|
643410
|
+
const facetPath = join225(getFacetsDir(), `${sessionId}.json`);
|
|
643266
643411
|
try {
|
|
643267
643412
|
const content = await readFile51(facetPath, { encoding: "utf-8" });
|
|
643268
643413
|
const parsed = jsonParse(content);
|
|
@@ -643281,14 +643426,14 @@ async function saveFacets(facets) {
|
|
|
643281
643426
|
try {
|
|
643282
643427
|
await mkdir40(getFacetsDir(), { recursive: true });
|
|
643283
643428
|
} catch {}
|
|
643284
|
-
const facetPath =
|
|
643429
|
+
const facetPath = join225(getFacetsDir(), `${facets.session_id}.json`);
|
|
643285
643430
|
await writeFile43(facetPath, jsonStringify(facets, null, 2), {
|
|
643286
643431
|
encoding: "utf-8",
|
|
643287
643432
|
mode: 384
|
|
643288
643433
|
});
|
|
643289
643434
|
}
|
|
643290
643435
|
async function loadCachedSessionMeta(sessionId) {
|
|
643291
|
-
const metaPath2 =
|
|
643436
|
+
const metaPath2 = join225(getSessionMetaDir(), `${sessionId}.json`);
|
|
643292
643437
|
try {
|
|
643293
643438
|
const content = await readFile51(metaPath2, { encoding: "utf-8" });
|
|
643294
643439
|
return jsonParse(content);
|
|
@@ -643300,7 +643445,7 @@ async function saveSessionMeta(meta) {
|
|
|
643300
643445
|
try {
|
|
643301
643446
|
await mkdir40(getSessionMetaDir(), { recursive: true });
|
|
643302
643447
|
} catch {}
|
|
643303
|
-
const metaPath2 =
|
|
643448
|
+
const metaPath2 = join225(getSessionMetaDir(), `${meta.session_id}.json`);
|
|
643304
643449
|
await writeFile43(metaPath2, jsonStringify(meta, null, 2), {
|
|
643305
643450
|
encoding: "utf-8",
|
|
643306
643451
|
mode: 384
|
|
@@ -644357,7 +644502,7 @@ function generateHtmlReport(data, insights) {
|
|
|
644357
644502
|
</html>`;
|
|
644358
644503
|
}
|
|
644359
644504
|
function buildExportData(data, insights, facets, remoteStats) {
|
|
644360
|
-
const version3 = typeof MACRO !== "undefined" ? "1.
|
|
644505
|
+
const version3 = typeof MACRO !== "undefined" ? "1.58.0" : "unknown";
|
|
644361
644506
|
const remote_hosts_collected = remoteStats?.hosts.filter((h2) => h2.sessionCount > 0).map((h2) => h2.name);
|
|
644362
644507
|
const facets_summary = {
|
|
644363
644508
|
total: facets.size,
|
|
@@ -644408,7 +644553,7 @@ async function scanAllSessions() {
|
|
|
644408
644553
|
} catch {
|
|
644409
644554
|
return [];
|
|
644410
644555
|
}
|
|
644411
|
-
const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
644556
|
+
const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join225(projectsDir, dirent.name));
|
|
644412
644557
|
const allSessions = [];
|
|
644413
644558
|
for (let i3 = 0;i3 < projectDirs.length; i3++) {
|
|
644414
644559
|
const sessionFiles = await getSessionFilesWithMtime(projectDirs[i3]);
|
|
@@ -644430,7 +644575,7 @@ async function scanAllSessions() {
|
|
|
644430
644575
|
async function generateUsageReport(options4) {
|
|
644431
644576
|
let remoteStats;
|
|
644432
644577
|
if (process.env.USER_TYPE === "ant" && options4?.collectRemote) {
|
|
644433
|
-
const destDir =
|
|
644578
|
+
const destDir = join225(getURConfigHomeDir(), "projects");
|
|
644434
644579
|
const { hosts, totalCopied } = await collectAllRemoteHostData(destDir);
|
|
644435
644580
|
remoteStats = { hosts, totalCopied };
|
|
644436
644581
|
}
|
|
@@ -644569,7 +644714,7 @@ async function generateUsageReport(options4) {
|
|
|
644569
644714
|
try {
|
|
644570
644715
|
await mkdir40(getDataDir(), { recursive: true });
|
|
644571
644716
|
} catch {}
|
|
644572
|
-
const htmlPath =
|
|
644717
|
+
const htmlPath = join225(getDataDir(), "report.html");
|
|
644573
644718
|
await writeFile43(htmlPath, htmlReport, {
|
|
644574
644719
|
encoding: "utf-8",
|
|
644575
644720
|
mode: 384
|
|
@@ -644665,13 +644810,13 @@ var init_insights = __esm(() => {
|
|
|
644665
644810
|
} : async () => 0;
|
|
644666
644811
|
collectFromRemoteHost = process.env.USER_TYPE === "ant" ? async (homespace, destDir) => {
|
|
644667
644812
|
const result = { copied: 0, skipped: 0 };
|
|
644668
|
-
const tempDir = await mkdtemp(
|
|
644813
|
+
const tempDir = await mkdtemp(join225(tmpdir17(), "ur-hs-"));
|
|
644669
644814
|
try {
|
|
644670
644815
|
const scpResult = await execFileNoThrow("scp", ["-rq", `${homespace}.coder:/root/.ur/projects/`, tempDir], { timeout: 300000 });
|
|
644671
644816
|
if (scpResult.code !== 0) {
|
|
644672
644817
|
return result;
|
|
644673
644818
|
}
|
|
644674
|
-
const projectsDir =
|
|
644819
|
+
const projectsDir = join225(tempDir, "projects");
|
|
644675
644820
|
let projectDirents;
|
|
644676
644821
|
try {
|
|
644677
644822
|
projectDirents = await readdir29(projectsDir, { withFileTypes: true });
|
|
@@ -644680,11 +644825,11 @@ var init_insights = __esm(() => {
|
|
|
644680
644825
|
}
|
|
644681
644826
|
await Promise.all(projectDirents.map(async (dirent) => {
|
|
644682
644827
|
const projectName = dirent.name;
|
|
644683
|
-
const projectPath =
|
|
644828
|
+
const projectPath = join225(projectsDir, projectName);
|
|
644684
644829
|
if (!dirent.isDirectory())
|
|
644685
644830
|
return;
|
|
644686
644831
|
const destProjectName = `${projectName}__${homespace}`;
|
|
644687
|
-
const destProjectPath =
|
|
644832
|
+
const destProjectPath = join225(destDir, destProjectName);
|
|
644688
644833
|
try {
|
|
644689
644834
|
await mkdir40(destProjectPath, { recursive: true });
|
|
644690
644835
|
} catch {}
|
|
@@ -644698,8 +644843,8 @@ var init_insights = __esm(() => {
|
|
|
644698
644843
|
const fileName = fileDirent.name;
|
|
644699
644844
|
if (!fileName.endsWith(".jsonl"))
|
|
644700
644845
|
return;
|
|
644701
|
-
const srcFile =
|
|
644702
|
-
const destFile =
|
|
644846
|
+
const srcFile = join225(projectPath, fileName);
|
|
644847
|
+
const destFile = join225(destProjectPath, fileName);
|
|
644703
644848
|
try {
|
|
644704
644849
|
await copyFile9(srcFile, destFile, fsConstants7.COPYFILE_EXCL);
|
|
644705
644850
|
result.copied++;
|
|
@@ -645811,7 +645956,7 @@ import {
|
|
|
645811
645956
|
unlink as unlink23,
|
|
645812
645957
|
writeFile as writeFile44
|
|
645813
645958
|
} from "fs/promises";
|
|
645814
|
-
import { basename as basename51, dirname as
|
|
645959
|
+
import { basename as basename51, dirname as dirname83, join as join226 } from "path";
|
|
645815
645960
|
function isTranscriptMessage(entry) {
|
|
645816
645961
|
const t = entry.type;
|
|
645817
645962
|
return t === "user" || t === "assistant" || t === "attachment" || t === "system";
|
|
@@ -645826,11 +645971,11 @@ function isEphemeralToolProgress(dataType) {
|
|
|
645826
645971
|
return typeof dataType === "string" && EPHEMERAL_PROGRESS_TYPES.has(dataType);
|
|
645827
645972
|
}
|
|
645828
645973
|
function getProjectsDir2() {
|
|
645829
|
-
return
|
|
645974
|
+
return join226(getURConfigHomeDir(), "projects");
|
|
645830
645975
|
}
|
|
645831
645976
|
function getTranscriptPath() {
|
|
645832
645977
|
const projectDir = getSessionProjectDir() ?? getProjectDir2(getOriginalCwd());
|
|
645833
|
-
return
|
|
645978
|
+
return join226(projectDir, `${getSessionId()}.jsonl`);
|
|
645834
645979
|
}
|
|
645835
645980
|
function getTranscriptPathForSession(sessionId) {
|
|
645836
645981
|
if (!/^[a-zA-Z0-9-]{1,128}$/u.test(sessionId)) {
|
|
@@ -645840,7 +645985,7 @@ function getTranscriptPathForSession(sessionId) {
|
|
|
645840
645985
|
return getTranscriptPath();
|
|
645841
645986
|
}
|
|
645842
645987
|
const projectDir = getProjectDir2(getOriginalCwd());
|
|
645843
|
-
return
|
|
645988
|
+
return join226(projectDir, `${sessionId}.jsonl`);
|
|
645844
645989
|
}
|
|
645845
645990
|
function setAgentTranscriptSubdir(agentId, subdir) {
|
|
645846
645991
|
agentTranscriptSubdirs.set(agentId, subdir);
|
|
@@ -645852,15 +645997,15 @@ function getAgentTranscriptPath(agentId) {
|
|
|
645852
645997
|
const projectDir = getSessionProjectDir() ?? getProjectDir2(getOriginalCwd());
|
|
645853
645998
|
const sessionId = getSessionId();
|
|
645854
645999
|
const subdir = agentTranscriptSubdirs.get(agentId);
|
|
645855
|
-
const base2 = subdir ?
|
|
645856
|
-
return
|
|
646000
|
+
const base2 = subdir ? join226(projectDir, sessionId, "subagents", subdir) : join226(projectDir, sessionId, "subagents");
|
|
646001
|
+
return join226(base2, `agent-${agentId}.jsonl`);
|
|
645857
646002
|
}
|
|
645858
646003
|
function getAgentMetadataPath(agentId) {
|
|
645859
646004
|
return getAgentTranscriptPath(agentId).replace(/\.jsonl$/, ".meta.json");
|
|
645860
646005
|
}
|
|
645861
646006
|
async function writeAgentMetadata(agentId, metadata) {
|
|
645862
646007
|
const path22 = getAgentMetadataPath(agentId);
|
|
645863
|
-
await mkdir41(
|
|
646008
|
+
await mkdir41(dirname83(path22), { recursive: true });
|
|
645864
646009
|
await writeFile44(path22, JSON.stringify(metadata));
|
|
645865
646010
|
}
|
|
645866
646011
|
async function readAgentMetadata(agentId) {
|
|
@@ -645876,14 +646021,14 @@ async function readAgentMetadata(agentId) {
|
|
|
645876
646021
|
}
|
|
645877
646022
|
function getRemoteAgentsDir() {
|
|
645878
646023
|
const projectDir = getSessionProjectDir() ?? getProjectDir2(getOriginalCwd());
|
|
645879
|
-
return
|
|
646024
|
+
return join226(projectDir, getSessionId(), "remote-agents");
|
|
645880
646025
|
}
|
|
645881
646026
|
function getRemoteAgentMetadataPath(taskId) {
|
|
645882
|
-
return
|
|
646027
|
+
return join226(getRemoteAgentsDir(), `remote-agent-${taskId}.meta.json`);
|
|
645883
646028
|
}
|
|
645884
646029
|
async function writeRemoteAgentMetadata(taskId, metadata) {
|
|
645885
646030
|
const path22 = getRemoteAgentMetadataPath(taskId);
|
|
645886
|
-
await mkdir41(
|
|
646031
|
+
await mkdir41(dirname83(path22), { recursive: true });
|
|
645887
646032
|
await writeFile44(path22, JSON.stringify(metadata));
|
|
645888
646033
|
}
|
|
645889
646034
|
async function readRemoteAgentMetadata(taskId) {
|
|
@@ -645922,7 +646067,7 @@ async function listRemoteAgentMetadata() {
|
|
|
645922
646067
|
if (!entry.isFile() || !entry.name.endsWith(".meta.json"))
|
|
645923
646068
|
continue;
|
|
645924
646069
|
try {
|
|
645925
|
-
const raw = await readFile52(
|
|
646070
|
+
const raw = await readFile52(join226(dir, entry.name), "utf-8");
|
|
645926
646071
|
results.push(JSON.parse(raw));
|
|
645927
646072
|
} catch (e) {
|
|
645928
646073
|
logForDebugging(`listRemoteAgentMetadata: skipping ${entry.name}: ${String(e)}`);
|
|
@@ -645932,7 +646077,7 @@ async function listRemoteAgentMetadata() {
|
|
|
645932
646077
|
}
|
|
645933
646078
|
function sessionIdExists(sessionId) {
|
|
645934
646079
|
const projectDir = getProjectDir2(getOriginalCwd());
|
|
645935
|
-
const sessionFile =
|
|
646080
|
+
const sessionFile = join226(projectDir, `${sessionId}.jsonl`);
|
|
645936
646081
|
const fs12 = getFsImplementation();
|
|
645937
646082
|
try {
|
|
645938
646083
|
fs12.statSync(sessionFile);
|
|
@@ -646086,7 +646231,7 @@ class Project {
|
|
|
646086
646231
|
try {
|
|
646087
646232
|
await fsAppendFile(filePath, data, { mode: 384 });
|
|
646088
646233
|
} catch {
|
|
646089
|
-
await mkdir41(
|
|
646234
|
+
await mkdir41(dirname83(filePath), { recursive: true, mode: 448 });
|
|
646090
646235
|
await fsAppendFile(filePath, data, { mode: 384 });
|
|
646091
646236
|
}
|
|
646092
646237
|
}
|
|
@@ -646689,7 +646834,7 @@ async function hydrateFromCCRv2InternalEvents(sessionId) {
|
|
|
646689
646834
|
}
|
|
646690
646835
|
for (const [agentId, entries] of byAgent) {
|
|
646691
646836
|
const agentFile = getAgentTranscriptPath(asAgentId(agentId));
|
|
646692
|
-
await mkdir41(
|
|
646837
|
+
await mkdir41(dirname83(agentFile), { recursive: true, mode: 448 });
|
|
646693
646838
|
const agentContent = entries.map((p2) => jsonStringify(p2) + `
|
|
646694
646839
|
`).join("");
|
|
646695
646840
|
await writeFile44(agentFile, agentContent, {
|
|
@@ -647226,7 +647371,7 @@ function appendEntryToFile(fullPath, entry) {
|
|
|
647226
647371
|
try {
|
|
647227
647372
|
fs12.appendFileSync(fullPath, line, { mode: 384 });
|
|
647228
647373
|
} catch {
|
|
647229
|
-
fs12.mkdirSync(
|
|
647374
|
+
fs12.mkdirSync(dirname83(fullPath), { mode: 448 });
|
|
647230
647375
|
fs12.appendFileSync(fullPath, line, { mode: 384 });
|
|
647231
647376
|
}
|
|
647232
647377
|
}
|
|
@@ -647923,7 +648068,7 @@ async function loadTranscriptFile(filePath, opts) {
|
|
|
647923
648068
|
};
|
|
647924
648069
|
}
|
|
647925
648070
|
async function loadSessionFile(sessionId) {
|
|
647926
|
-
const sessionFile =
|
|
648071
|
+
const sessionFile = join226(getSessionProjectDir() ?? getProjectDir2(getOriginalCwd()), `${sessionId}.jsonl`);
|
|
647927
648072
|
return loadTranscriptFile(sessionFile);
|
|
647928
648073
|
}
|
|
647929
648074
|
function clearSessionMessagesCache() {
|
|
@@ -647991,7 +648136,7 @@ async function loadAllProjectsMessageLogsFull(limit) {
|
|
|
647991
648136
|
} catch {
|
|
647992
648137
|
return [];
|
|
647993
648138
|
}
|
|
647994
|
-
const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
648139
|
+
const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join226(projectsDir, dirent.name));
|
|
647995
648140
|
const logsPerProject = await Promise.all(projectDirs.map((projectDir) => getLogsWithoutIndex(projectDir, limit)));
|
|
647996
648141
|
const allLogs = logsPerProject.flat();
|
|
647997
648142
|
const deduped = new Map;
|
|
@@ -648016,7 +648161,7 @@ async function loadAllProjectsMessageLogsProgressive(limit, initialEnrichCount =
|
|
|
648016
648161
|
} catch {
|
|
648017
648162
|
return { logs: [], allStatLogs: [], nextIndex: 0 };
|
|
648018
648163
|
}
|
|
648019
|
-
const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
648164
|
+
const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join226(projectsDir, dirent.name));
|
|
648020
648165
|
const rawLogs = [];
|
|
648021
648166
|
for (const projectDir of projectDirs) {
|
|
648022
648167
|
rawLogs.push(...await getSessionFilesLite(projectDir, limit));
|
|
@@ -648077,7 +648222,7 @@ async function getStatOnlyLogsForWorktrees(worktreePaths, limit) {
|
|
|
648077
648222
|
for (const { path: wtPath, prefix } of indexed) {
|
|
648078
648223
|
if (dirName === prefix || dirName.startsWith(prefix + "-")) {
|
|
648079
648224
|
seenDirs.add(dirName);
|
|
648080
|
-
allLogs.push(...await getSessionFilesLite(
|
|
648225
|
+
allLogs.push(...await getSessionFilesLite(join226(projectsDir, dirent.name), undefined, wtPath));
|
|
648081
648226
|
break;
|
|
648082
648227
|
}
|
|
648083
648228
|
}
|
|
@@ -648146,7 +648291,7 @@ async function loadSubagentTranscripts(agentIds) {
|
|
|
648146
648291
|
return transcripts;
|
|
648147
648292
|
}
|
|
648148
648293
|
async function loadAllSubagentTranscriptsFromDisk() {
|
|
648149
|
-
const subagentsDir =
|
|
648294
|
+
const subagentsDir = join226(getSessionProjectDir() ?? getProjectDir2(getOriginalCwd()), getSessionId(), "subagents");
|
|
648150
648295
|
let entries;
|
|
648151
648296
|
try {
|
|
648152
648297
|
entries = await readdir30(subagentsDir, { withFileTypes: true });
|
|
@@ -648274,7 +648419,7 @@ async function getSessionFilesWithMtime(projectDir) {
|
|
|
648274
648419
|
const sessionId = validateUuid2(basename51(dirent.name, ".jsonl"));
|
|
648275
648420
|
if (!sessionId)
|
|
648276
648421
|
continue;
|
|
648277
|
-
candidates2.push({ sessionId, filePath:
|
|
648422
|
+
candidates2.push({ sessionId, filePath: join226(projectDir, dirent.name) });
|
|
648278
648423
|
}
|
|
648279
648424
|
await Promise.all(candidates2.map(async ({ sessionId, filePath }) => {
|
|
648280
648425
|
try {
|
|
@@ -648660,7 +648805,7 @@ var init_sessionStorage = __esm(() => {
|
|
|
648660
648805
|
init_settings2();
|
|
648661
648806
|
init_slowOperations();
|
|
648662
648807
|
init_uuid();
|
|
648663
|
-
VERSION7 = typeof MACRO !== "undefined" ? "1.
|
|
648808
|
+
VERSION7 = typeof MACRO !== "undefined" ? "1.58.0" : "unknown";
|
|
648664
648809
|
MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
|
|
648665
648810
|
SKIP_FIRST_PROMPT_PATTERN = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
|
|
648666
648811
|
EPHEMERAL_PROGRESS_TYPES = new Set([
|
|
@@ -648672,7 +648817,7 @@ var init_sessionStorage = __esm(() => {
|
|
|
648672
648817
|
MAX_TRANSCRIPT_READ_BYTES = 50 * 1024 * 1024;
|
|
648673
648818
|
agentTranscriptSubdirs = new Map;
|
|
648674
648819
|
getProjectDir2 = memoize_default((projectDir) => {
|
|
648675
|
-
return
|
|
648820
|
+
return join226(getProjectsDir2(), sanitizePath2(projectDir));
|
|
648676
648821
|
});
|
|
648677
648822
|
METADATA_TYPE_MARKERS = [
|
|
648678
648823
|
'"type":"summary"',
|
|
@@ -648910,41 +649055,41 @@ var init_memdir = __esm(() => {
|
|
|
648910
649055
|
});
|
|
648911
649056
|
|
|
648912
649057
|
// src/tools/AgentTool/agentMemory.ts
|
|
648913
|
-
import { join as
|
|
649058
|
+
import { join as join227, normalize as normalize15, sep as sep45 } from "path";
|
|
648914
649059
|
function sanitizeAgentTypeForPath(agentType) {
|
|
648915
649060
|
return agentType.replace(/:/g, "-");
|
|
648916
649061
|
}
|
|
648917
649062
|
function getLocalAgentMemoryDir(dirName) {
|
|
648918
649063
|
if (process.env.UR_CODE_REMOTE_MEMORY_DIR) {
|
|
648919
|
-
return
|
|
649064
|
+
return join227(process.env.UR_CODE_REMOTE_MEMORY_DIR, "projects", sanitizePath2(findCanonicalGitRoot(getProjectRoot()) ?? getProjectRoot()), "agent-memory-local", dirName) + sep45;
|
|
648920
649065
|
}
|
|
648921
|
-
return
|
|
649066
|
+
return join227(getCwd(), ".ur", "agent-memory-local", dirName) + sep45;
|
|
648922
649067
|
}
|
|
648923
649068
|
function getAgentMemoryDir(agentType, scope) {
|
|
648924
649069
|
const dirName = sanitizeAgentTypeForPath(agentType);
|
|
648925
649070
|
switch (scope) {
|
|
648926
649071
|
case "project":
|
|
648927
|
-
return
|
|
649072
|
+
return join227(getCwd(), ".ur", "agent-memory", dirName) + sep45;
|
|
648928
649073
|
case "local":
|
|
648929
649074
|
return getLocalAgentMemoryDir(dirName);
|
|
648930
649075
|
case "user":
|
|
648931
|
-
return
|
|
649076
|
+
return join227(getMemoryBaseDir(), "agent-memory", dirName) + sep45;
|
|
648932
649077
|
}
|
|
648933
649078
|
}
|
|
648934
649079
|
function isAgentMemoryPath(absolutePath) {
|
|
648935
649080
|
const normalizedPath2 = normalize15(absolutePath);
|
|
648936
649081
|
const memoryBase = getMemoryBaseDir();
|
|
648937
|
-
if (normalizedPath2.startsWith(
|
|
649082
|
+
if (normalizedPath2.startsWith(join227(memoryBase, "agent-memory") + sep45)) {
|
|
648938
649083
|
return true;
|
|
648939
649084
|
}
|
|
648940
|
-
if (normalizedPath2.startsWith(
|
|
649085
|
+
if (normalizedPath2.startsWith(join227(getCwd(), ".ur", "agent-memory") + sep45)) {
|
|
648941
649086
|
return true;
|
|
648942
649087
|
}
|
|
648943
649088
|
if (process.env.UR_CODE_REMOTE_MEMORY_DIR) {
|
|
648944
|
-
if (normalizedPath2.includes(sep45 + "agent-memory-local" + sep45) && normalizedPath2.startsWith(
|
|
649089
|
+
if (normalizedPath2.includes(sep45 + "agent-memory-local" + sep45) && normalizedPath2.startsWith(join227(process.env.UR_CODE_REMOTE_MEMORY_DIR, "projects") + sep45)) {
|
|
648945
649090
|
return true;
|
|
648946
649091
|
}
|
|
648947
|
-
} else if (normalizedPath2.startsWith(
|
|
649092
|
+
} else if (normalizedPath2.startsWith(join227(getCwd(), ".ur", "agent-memory-local") + sep45)) {
|
|
648948
649093
|
return true;
|
|
648949
649094
|
}
|
|
648950
649095
|
return false;
|
|
@@ -648952,7 +649097,7 @@ function isAgentMemoryPath(absolutePath) {
|
|
|
648952
649097
|
function getMemoryScopeDisplay(memory2) {
|
|
648953
649098
|
switch (memory2) {
|
|
648954
649099
|
case "user":
|
|
648955
|
-
return `User (${
|
|
649100
|
+
return `User (${join227(getMemoryBaseDir(), "agent-memory")}/)`;
|
|
648956
649101
|
case "project":
|
|
648957
649102
|
return "Project (.ur/agent-memory/)";
|
|
648958
649103
|
case "local":
|
|
@@ -648995,7 +649140,7 @@ var init_agentMemory = __esm(() => {
|
|
|
648995
649140
|
// src/utils/permissions/filesystem.ts
|
|
648996
649141
|
import { randomBytes as randomBytes20 } from "crypto";
|
|
648997
649142
|
import { homedir as homedir35, tmpdir as tmpdir18 } from "os";
|
|
648998
|
-
import { join as
|
|
649143
|
+
import { join as join228, normalize as normalize16, posix as posix10, sep as sep46 } from "path";
|
|
648999
649144
|
function normalizeCaseForComparison(path22) {
|
|
649000
649145
|
return path22.toLowerCase();
|
|
649001
649146
|
}
|
|
@@ -649004,19 +649149,19 @@ function getURSkillScope(filePath) {
|
|
|
649004
649149
|
const absolutePathLower = normalizeCaseForComparison(absolutePath);
|
|
649005
649150
|
const bases = [
|
|
649006
649151
|
{
|
|
649007
|
-
dir: expandPath(
|
|
649152
|
+
dir: expandPath(join228(getOriginalCwd(), ".ur", "skills")),
|
|
649008
649153
|
prefix: "/.ur/skills/"
|
|
649009
649154
|
},
|
|
649010
649155
|
{
|
|
649011
|
-
dir: expandPath(
|
|
649156
|
+
dir: expandPath(join228(homedir35(), ".ur", "skills")),
|
|
649012
649157
|
prefix: "~/.ur/skills/"
|
|
649013
649158
|
},
|
|
649014
649159
|
{
|
|
649015
|
-
dir: expandPath(
|
|
649160
|
+
dir: expandPath(join228(getOriginalCwd(), ".agents", "skills")),
|
|
649016
649161
|
prefix: "/.agents/skills/"
|
|
649017
649162
|
},
|
|
649018
649163
|
{
|
|
649019
|
-
dir: expandPath(
|
|
649164
|
+
dir: expandPath(join228(homedir35(), ".agents", "skills")),
|
|
649020
649165
|
prefix: "~/.agents/skills/"
|
|
649021
649166
|
}
|
|
649022
649167
|
];
|
|
@@ -649071,22 +649216,22 @@ function isURConfigFilePath(filePath) {
|
|
|
649071
649216
|
if (isURSettingsPath(filePath)) {
|
|
649072
649217
|
return true;
|
|
649073
649218
|
}
|
|
649074
|
-
const commandsDir =
|
|
649075
|
-
const agentsDir =
|
|
649076
|
-
const skillsDir =
|
|
649077
|
-
const crossClientSkillsDir =
|
|
649219
|
+
const commandsDir = join228(getOriginalCwd(), ".ur", "commands");
|
|
649220
|
+
const agentsDir = join228(getOriginalCwd(), ".ur", "agents");
|
|
649221
|
+
const skillsDir = join228(getOriginalCwd(), ".ur", "skills");
|
|
649222
|
+
const crossClientSkillsDir = join228(getOriginalCwd(), ".agents", "skills");
|
|
649078
649223
|
return pathInWorkingPath(filePath, commandsDir) || pathInWorkingPath(filePath, agentsDir) || pathInWorkingPath(filePath, skillsDir) || pathInWorkingPath(filePath, crossClientSkillsDir);
|
|
649079
649224
|
}
|
|
649080
649225
|
function isSessionPlanFile(absolutePath) {
|
|
649081
|
-
const expectedPrefix =
|
|
649226
|
+
const expectedPrefix = join228(getPlansDirectory(), getPlanSlug());
|
|
649082
649227
|
const normalizedPath2 = normalize16(absolutePath);
|
|
649083
649228
|
return normalizedPath2.startsWith(expectedPrefix) && normalizedPath2.endsWith(".md");
|
|
649084
649229
|
}
|
|
649085
649230
|
function getSessionMemoryDir() {
|
|
649086
|
-
return
|
|
649231
|
+
return join228(getProjectDir2(getCwd()), getSessionId(), "session-memory") + sep46;
|
|
649087
649232
|
}
|
|
649088
649233
|
function getSessionMemoryPath() {
|
|
649089
|
-
return
|
|
649234
|
+
return join228(getSessionMemoryDir(), "summary.md");
|
|
649090
649235
|
}
|
|
649091
649236
|
function isSessionMemoryPath(absolutePath) {
|
|
649092
649237
|
const normalizedPath2 = normalize16(absolutePath);
|
|
@@ -649108,10 +649253,10 @@ function getURTempDirName() {
|
|
|
649108
649253
|
return `ur-${uid}`;
|
|
649109
649254
|
}
|
|
649110
649255
|
function getProjectTempDir() {
|
|
649111
|
-
return
|
|
649256
|
+
return join228(getURTempDir(), sanitizePath2(getOriginalCwd())) + sep46;
|
|
649112
649257
|
}
|
|
649113
649258
|
function getScratchpadDir() {
|
|
649114
|
-
return
|
|
649259
|
+
return join228(getProjectTempDir(), getSessionId(), "scratchpad");
|
|
649115
649260
|
}
|
|
649116
649261
|
async function ensureScratchpadDir() {
|
|
649117
649262
|
if (!isScratchpadEnabled()) {
|
|
@@ -649689,7 +649834,7 @@ function checkEditableInternalPath(absolutePath, input) {
|
|
|
649689
649834
|
}
|
|
649690
649835
|
};
|
|
649691
649836
|
}
|
|
649692
|
-
if (normalizeCaseForComparison(normalizedPath2) === normalizeCaseForComparison(
|
|
649837
|
+
if (normalizeCaseForComparison(normalizedPath2) === normalizeCaseForComparison(join228(getOriginalCwd(), ".ur", "launch.json"))) {
|
|
649693
649838
|
return {
|
|
649694
649839
|
behavior: "allow",
|
|
649695
649840
|
updatedInput: input,
|
|
@@ -649786,7 +649931,7 @@ function checkReadableInternalPath(absolutePath, input) {
|
|
|
649786
649931
|
}
|
|
649787
649932
|
};
|
|
649788
649933
|
}
|
|
649789
|
-
const tasksDir =
|
|
649934
|
+
const tasksDir = join228(getURConfigHomeDir(), "tasks") + sep46;
|
|
649790
649935
|
if (normalizedPath2 === tasksDir.slice(0, -1) || normalizedPath2.startsWith(tasksDir)) {
|
|
649791
649936
|
return {
|
|
649792
649937
|
behavior: "allow",
|
|
@@ -649797,7 +649942,7 @@ function checkReadableInternalPath(absolutePath, input) {
|
|
|
649797
649942
|
}
|
|
649798
649943
|
};
|
|
649799
649944
|
}
|
|
649800
|
-
const teamsReadDir =
|
|
649945
|
+
const teamsReadDir = join228(getURConfigHomeDir(), "teams") + sep46;
|
|
649801
649946
|
if (normalizedPath2 === teamsReadDir.slice(0, -1) || normalizedPath2.startsWith(teamsReadDir)) {
|
|
649802
649947
|
return {
|
|
649803
649948
|
behavior: "allow",
|
|
@@ -649871,11 +650016,11 @@ var init_filesystem = __esm(() => {
|
|
|
649871
650016
|
try {
|
|
649872
650017
|
resolvedBaseTmpDir = fs12.realpathSync(baseTmpDir);
|
|
649873
650018
|
} catch {}
|
|
649874
|
-
return
|
|
650019
|
+
return join228(resolvedBaseTmpDir, getURTempDirName()) + sep46;
|
|
649875
650020
|
});
|
|
649876
650021
|
getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
|
|
649877
650022
|
const nonce = randomBytes20(16).toString("hex");
|
|
649878
|
-
return
|
|
650023
|
+
return join228(getURTempDir(), "bundled-skills", "1.58.0", nonce);
|
|
649879
650024
|
});
|
|
649880
650025
|
getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
|
|
649881
650026
|
});
|
|
@@ -649889,10 +650034,10 @@ import {
|
|
|
649889
650034
|
symlink as symlink4,
|
|
649890
650035
|
unlink as unlink24
|
|
649891
650036
|
} from "fs/promises";
|
|
649892
|
-
import { join as
|
|
650037
|
+
import { join as join229 } from "path";
|
|
649893
650038
|
function getTaskOutputDir() {
|
|
649894
650039
|
if (_taskOutputDir === undefined) {
|
|
649895
|
-
_taskOutputDir =
|
|
650040
|
+
_taskOutputDir = join229(getProjectTempDir(), getSessionId(), "tasks");
|
|
649896
650041
|
}
|
|
649897
650042
|
return _taskOutputDir;
|
|
649898
650043
|
}
|
|
@@ -649900,7 +650045,7 @@ async function ensureOutputDir() {
|
|
|
649900
650045
|
await mkdir42(getTaskOutputDir(), { recursive: true });
|
|
649901
650046
|
}
|
|
649902
650047
|
function getTaskOutputPath(taskId) {
|
|
649903
|
-
return
|
|
650048
|
+
return join229(getTaskOutputDir(), `${taskId}.output`);
|
|
649904
650049
|
}
|
|
649905
650050
|
function track(p2) {
|
|
649906
650051
|
_pendingOps.add(p2);
|
|
@@ -654426,7 +654571,7 @@ import {
|
|
|
654426
654571
|
symlink as symlink5,
|
|
654427
654572
|
utimes as utimes2
|
|
654428
654573
|
} from "fs/promises";
|
|
654429
|
-
import { basename as basename53, dirname as
|
|
654574
|
+
import { basename as basename53, dirname as dirname84, join as join230 } from "path";
|
|
654430
654575
|
function validateWorktreeSlug(slug5) {
|
|
654431
654576
|
if (slug5.length > MAX_WORKTREE_SLUG_LENGTH) {
|
|
654432
654577
|
throw new Error(`Invalid worktree name: must be ${MAX_WORKTREE_SLUG_LENGTH} characters or fewer (got ${slug5.length})`);
|
|
@@ -654449,8 +654594,8 @@ async function symlinkDirectories(repoRootPath, worktreePath, dirsToSymlink) {
|
|
|
654449
654594
|
logForDebugging(`Skipping symlink for "${dir}": path traversal detected`, { level: "warn" });
|
|
654450
654595
|
continue;
|
|
654451
654596
|
}
|
|
654452
|
-
const sourcePath =
|
|
654453
|
-
const destPath =
|
|
654597
|
+
const sourcePath = join230(repoRootPath, dir);
|
|
654598
|
+
const destPath = join230(worktreePath, dir);
|
|
654454
654599
|
try {
|
|
654455
654600
|
await symlink5(sourcePath, destPath, "dir");
|
|
654456
654601
|
logForDebugging(`Symlinked ${dir} from main repository to worktree to avoid disk bloat`);
|
|
@@ -654474,7 +654619,7 @@ function generateTmuxSessionName(repoPath, branch2) {
|
|
|
654474
654619
|
return combined.replace(/[/.]/g, "_");
|
|
654475
654620
|
}
|
|
654476
654621
|
function worktreesDir2(repoRoot) {
|
|
654477
|
-
return
|
|
654622
|
+
return join230(repoRoot, ".ur", "worktrees");
|
|
654478
654623
|
}
|
|
654479
654624
|
function flattenSlug(slug5) {
|
|
654480
654625
|
return slug5.replaceAll("/", "+");
|
|
@@ -654483,7 +654628,7 @@ function worktreeBranchName(slug5) {
|
|
|
654483
654628
|
return `worktree-${flattenSlug(slug5)}`;
|
|
654484
654629
|
}
|
|
654485
654630
|
function worktreePathFor(repoRoot, slug5) {
|
|
654486
|
-
return
|
|
654631
|
+
return join230(worktreesDir2(repoRoot), flattenSlug(slug5));
|
|
654487
654632
|
}
|
|
654488
654633
|
async function getOrCreateWorktree(repoRoot, slug5, options4) {
|
|
654489
654634
|
const worktreePath = worktreePathFor(repoRoot, slug5);
|
|
@@ -654564,7 +654709,7 @@ async function getOrCreateWorktree(repoRoot, slug5, options4) {
|
|
|
654564
654709
|
async function copyWorktreeIncludeFiles(repoRoot, worktreePath) {
|
|
654565
654710
|
let includeContent;
|
|
654566
654711
|
try {
|
|
654567
|
-
includeContent = await readFile53(
|
|
654712
|
+
includeContent = await readFile53(join230(repoRoot, ".worktreeinclude"), "utf-8");
|
|
654568
654713
|
} catch {
|
|
654569
654714
|
return [];
|
|
654570
654715
|
}
|
|
@@ -654619,10 +654764,10 @@ async function copyWorktreeIncludeFiles(repoRoot, worktreePath) {
|
|
|
654619
654764
|
}
|
|
654620
654765
|
const copied = [];
|
|
654621
654766
|
for (const relativePath3 of files2) {
|
|
654622
|
-
const srcPath =
|
|
654623
|
-
const destPath =
|
|
654767
|
+
const srcPath = join230(repoRoot, relativePath3);
|
|
654768
|
+
const destPath = join230(worktreePath, relativePath3);
|
|
654624
654769
|
try {
|
|
654625
|
-
await mkdir43(
|
|
654770
|
+
await mkdir43(dirname84(destPath), { recursive: true });
|
|
654626
654771
|
await copyFile10(srcPath, destPath);
|
|
654627
654772
|
copied.push(relativePath3);
|
|
654628
654773
|
} catch (e) {
|
|
@@ -654636,10 +654781,10 @@ async function copyWorktreeIncludeFiles(repoRoot, worktreePath) {
|
|
|
654636
654781
|
}
|
|
654637
654782
|
async function performPostCreationSetup(repoRoot, worktreePath) {
|
|
654638
654783
|
const localSettingsRelativePath = getRelativeSettingsFilePathForSource("localSettings");
|
|
654639
|
-
const sourceSettingsLocal =
|
|
654784
|
+
const sourceSettingsLocal = join230(repoRoot, localSettingsRelativePath);
|
|
654640
654785
|
try {
|
|
654641
|
-
const destSettingsLocal =
|
|
654642
|
-
await mkdirRecursive(
|
|
654786
|
+
const destSettingsLocal = join230(worktreePath, localSettingsRelativePath);
|
|
654787
|
+
await mkdirRecursive(dirname84(destSettingsLocal));
|
|
654643
654788
|
await copyFile10(sourceSettingsLocal, destSettingsLocal);
|
|
654644
654789
|
logForDebugging(`Copied settings.local.json to worktree: ${destSettingsLocal}`);
|
|
654645
654790
|
} catch (e) {
|
|
@@ -654648,8 +654793,8 @@ async function performPostCreationSetup(repoRoot, worktreePath) {
|
|
|
654648
654793
|
logForDebugging(`Failed to copy settings.local.json: ${e.message}`, { level: "warn" });
|
|
654649
654794
|
}
|
|
654650
654795
|
}
|
|
654651
|
-
const huskyPath =
|
|
654652
|
-
const gitHooksPath =
|
|
654796
|
+
const huskyPath = join230(repoRoot, ".husky");
|
|
654797
|
+
const gitHooksPath = join230(repoRoot, ".git", "hooks");
|
|
654653
654798
|
let hooksPath = null;
|
|
654654
654799
|
for (const candidatePath of [huskyPath, gitHooksPath]) {
|
|
654655
654800
|
try {
|
|
@@ -654924,7 +655069,7 @@ async function cleanupStaleAgentWorktrees(cutoffDate) {
|
|
|
654924
655069
|
if (!EPHEMERAL_WORKTREE_PATTERNS.some((p2) => p2.test(slug5))) {
|
|
654925
655070
|
continue;
|
|
654926
655071
|
}
|
|
654927
|
-
const worktreePath =
|
|
655072
|
+
const worktreePath = join230(dir, slug5);
|
|
654928
655073
|
if (currentPath === worktreePath) {
|
|
654929
655074
|
continue;
|
|
654930
655075
|
}
|
|
@@ -656170,7 +656315,7 @@ function computeFingerprint(messageText2, version3) {
|
|
|
656170
656315
|
}
|
|
656171
656316
|
function computeFingerprintFromMessages(messages) {
|
|
656172
656317
|
const firstMessageText = extractFirstMessageText(messages);
|
|
656173
|
-
return computeFingerprint(firstMessageText, "1.
|
|
656318
|
+
return computeFingerprint(firstMessageText, "1.58.0");
|
|
656174
656319
|
}
|
|
656175
656320
|
var FINGERPRINT_SALT = "59cf53e54c78";
|
|
656176
656321
|
var init_fingerprint = () => {};
|
|
@@ -658066,7 +658211,7 @@ async function sideQuery(opts) {
|
|
|
658066
658211
|
betas.push(STRUCTURED_OUTPUTS_BETA_HEADER);
|
|
658067
658212
|
}
|
|
658068
658213
|
const messageText2 = extractFirstUserMessageText(messages);
|
|
658069
|
-
const fingerprint2 = computeFingerprint(messageText2, "1.
|
|
658214
|
+
const fingerprint2 = computeFingerprint(messageText2, "1.58.0");
|
|
658070
658215
|
const attributionHeader = getAttributionHeader(fingerprint2);
|
|
658071
658216
|
const systemBlocks = [
|
|
658072
658217
|
attributionHeader ? { type: "text", text: attributionHeader } : null,
|
|
@@ -658346,7 +658491,7 @@ import {
|
|
|
658346
658491
|
} from "fs/promises";
|
|
658347
658492
|
import { createServer as createServer6 } from "net";
|
|
658348
658493
|
import { homedir as homedir36, platform as platform6 } from "os";
|
|
658349
|
-
import { join as
|
|
658494
|
+
import { join as join231 } from "path";
|
|
658350
658495
|
function log(message, ...args) {
|
|
658351
658496
|
if (LOG_FILE) {
|
|
658352
658497
|
const timestamp2 = new Date().toISOString();
|
|
@@ -658413,7 +658558,7 @@ class ChromeNativeHost {
|
|
|
658413
658558
|
try {
|
|
658414
658559
|
process.kill(pid, 0);
|
|
658415
658560
|
} catch {
|
|
658416
|
-
await unlink25(
|
|
658561
|
+
await unlink25(join231(socketDir, file4)).catch(() => {});
|
|
658417
658562
|
log(`Removed stale socket for PID ${pid}`);
|
|
658418
658563
|
}
|
|
658419
658564
|
}
|
|
@@ -658684,7 +658829,7 @@ var init_chromeNativeHost = __esm(() => {
|
|
|
658684
658829
|
init_slowOperations();
|
|
658685
658830
|
init_common3();
|
|
658686
658831
|
MAX_MESSAGE_SIZE = 1024 * 1024;
|
|
658687
|
-
LOG_FILE = process.env.USER_TYPE === "ant" ?
|
|
658832
|
+
LOG_FILE = process.env.USER_TYPE === "ant" ? join231(homedir36(), ".ur", "debug", "chrome-native-host.txt") : undefined;
|
|
658688
658833
|
messageSchema = lazySchema(() => exports_external2.object({
|
|
658689
658834
|
type: exports_external2.string()
|
|
658690
658835
|
}).passthrough());
|
|
@@ -661234,7 +661379,7 @@ __export(exports_upstreamproxy, {
|
|
|
661234
661379
|
});
|
|
661235
661380
|
import { mkdir as mkdir45, readFile as readFile54, unlink as unlink26, writeFile as writeFile45 } from "fs/promises";
|
|
661236
661381
|
import { homedir as homedir37 } from "os";
|
|
661237
|
-
import { join as
|
|
661382
|
+
import { join as join232 } from "path";
|
|
661238
661383
|
async function initUpstreamProxy(opts) {
|
|
661239
661384
|
if (!isEnvTruthy(process.env.UR_CODE_REMOTE)) {
|
|
661240
661385
|
return state;
|
|
@@ -661255,7 +661400,7 @@ async function initUpstreamProxy(opts) {
|
|
|
661255
661400
|
}
|
|
661256
661401
|
setNonDumpable();
|
|
661257
661402
|
const baseUrl = opts?.ccrBaseUrl ?? "";
|
|
661258
|
-
const caBundlePath = opts?.caBundlePath ??
|
|
661403
|
+
const caBundlePath = opts?.caBundlePath ?? join232(homedir37(), ".ccr", "ca-bundle.crt");
|
|
661259
661404
|
const caOk = await downloadCaBundle(baseUrl, opts?.systemCaPath ?? SYSTEM_CA_BUNDLE, caBundlePath);
|
|
661260
661405
|
if (!caOk)
|
|
661261
661406
|
return state;
|
|
@@ -661355,7 +661500,7 @@ async function downloadCaBundle(baseUrl, systemCaPath, outPath) {
|
|
|
661355
661500
|
}
|
|
661356
661501
|
const ccrCa = await resp.text();
|
|
661357
661502
|
const systemCa = await readFile54(systemCaPath, "utf8").catch(() => "");
|
|
661358
|
-
await mkdir45(
|
|
661503
|
+
await mkdir45(join232(outPath, ".."), { recursive: true });
|
|
661359
661504
|
await writeFile45(outPath, systemCa + `
|
|
661360
661505
|
` + ccrCa, "utf8");
|
|
661361
661506
|
return true;
|
|
@@ -662837,7 +662982,7 @@ function buildSystemInitMessage(inputs) {
|
|
|
662837
662982
|
slash_commands: inputs.commands.filter((c4) => c4.userInvocable !== false).map((c4) => c4.name),
|
|
662838
662983
|
apiKeySource: getURHQApiKeyWithSource().source,
|
|
662839
662984
|
betas: getSdkBetas(),
|
|
662840
|
-
ur_version: "1.
|
|
662985
|
+
ur_version: "1.58.0",
|
|
662841
662986
|
output_style: outputStyle2,
|
|
662842
662987
|
agents: inputs.agents.map((agent2) => agent2.agentType),
|
|
662843
662988
|
skills: inputs.skills.filter((s) => s.userInvocable !== false).map((skill2) => skill2.name),
|
|
@@ -668443,7 +668588,7 @@ var init_ShowInIDEPrompt = __esm(() => {
|
|
|
668443
668588
|
|
|
668444
668589
|
// src/components/permissions/FilePermissionDialog/permissionOptions.tsx
|
|
668445
668590
|
import { homedir as homedir38 } from "os";
|
|
668446
|
-
import { basename as basename57, join as
|
|
668591
|
+
import { basename as basename57, join as join233, sep as sep47 } from "path";
|
|
668447
668592
|
function isInURFolder(filePath) {
|
|
668448
668593
|
const absolutePath = expandPath(filePath);
|
|
668449
668594
|
const urFolderPath = expandPath(`${getOriginalCwd()}/.ur`);
|
|
@@ -668453,7 +668598,7 @@ function isInURFolder(filePath) {
|
|
|
668453
668598
|
}
|
|
668454
668599
|
function isInGlobalURFolder(filePath) {
|
|
668455
668600
|
const absolutePath = expandPath(filePath);
|
|
668456
|
-
const globalURFolderPath =
|
|
668601
|
+
const globalURFolderPath = join233(homedir38(), ".ur");
|
|
668457
668602
|
const normalizedAbsolutePath = normalizeCaseForComparison(absolutePath);
|
|
668458
668603
|
const normalizedGlobalURFolderPath = normalizeCaseForComparison(globalURFolderPath);
|
|
668459
668604
|
return normalizedAbsolutePath.startsWith(normalizedGlobalURFolderPath + sep47.toLowerCase()) || normalizedAbsolutePath.startsWith(normalizedGlobalURFolderPath + "/");
|
|
@@ -676697,7 +676842,7 @@ var init_useVoiceEnabled = __esm(() => {
|
|
|
676697
676842
|
function getSemverPart(version3) {
|
|
676698
676843
|
return `${import_semver13.major(version3, { loose: true })}.${import_semver13.minor(version3, { loose: true })}.${import_semver13.patch(version3, { loose: true })}`;
|
|
676699
676844
|
}
|
|
676700
|
-
function useUpdateNotification(updatedVersion, initialVersion = "1.
|
|
676845
|
+
function useUpdateNotification(updatedVersion, initialVersion = "1.58.0") {
|
|
676701
676846
|
const [lastNotifiedSemver, setLastNotifiedSemver] = import_react222.useState(() => getSemverPart(initialVersion));
|
|
676702
676847
|
if (!updatedVersion) {
|
|
676703
676848
|
return null;
|
|
@@ -676746,7 +676891,7 @@ function AutoUpdater({
|
|
|
676746
676891
|
return;
|
|
676747
676892
|
}
|
|
676748
676893
|
if (false) {}
|
|
676749
|
-
const currentVersion = "1.
|
|
676894
|
+
const currentVersion = "1.58.0";
|
|
676750
676895
|
const channel = getInitialSettings()?.autoUpdatesChannel ?? "latest";
|
|
676751
676896
|
let latestVersion = await getLatestVersion(channel);
|
|
676752
676897
|
const isDisabled = isAutoUpdaterDisabled();
|
|
@@ -676975,12 +677120,12 @@ function NativeAutoUpdater({
|
|
|
676975
677120
|
logEvent("tengu_native_auto_updater_start", {});
|
|
676976
677121
|
try {
|
|
676977
677122
|
const maxVersion = await getMaxVersion();
|
|
676978
|
-
if (maxVersion && gt("1.
|
|
677123
|
+
if (maxVersion && gt("1.58.0", maxVersion)) {
|
|
676979
677124
|
const msg = await getMaxVersionMessage();
|
|
676980
677125
|
setMaxVersionIssue(msg ?? "affects your version");
|
|
676981
677126
|
}
|
|
676982
677127
|
const result = await installLatest(channel);
|
|
676983
|
-
const currentVersion = "1.
|
|
677128
|
+
const currentVersion = "1.58.0";
|
|
676984
677129
|
const latencyMs = Date.now() - startTime;
|
|
676985
677130
|
if (result.lockFailed) {
|
|
676986
677131
|
logEvent("tengu_native_auto_updater_lock_contention", {
|
|
@@ -677117,17 +677262,17 @@ function PackageManagerAutoUpdater(t0) {
|
|
|
677117
677262
|
const maxVersion = await getMaxVersion();
|
|
677118
677263
|
if (maxVersion && latest && gt(latest, maxVersion)) {
|
|
677119
677264
|
logForDebugging(`PackageManagerAutoUpdater: maxVersion ${maxVersion} is set, capping update from ${latest} to ${maxVersion}`);
|
|
677120
|
-
if (gte("1.
|
|
677121
|
-
logForDebugging(`PackageManagerAutoUpdater: current version ${"1.
|
|
677265
|
+
if (gte("1.58.0", maxVersion)) {
|
|
677266
|
+
logForDebugging(`PackageManagerAutoUpdater: current version ${"1.58.0"} is already at or above maxVersion ${maxVersion}, skipping update`);
|
|
677122
677267
|
setUpdateAvailable(false);
|
|
677123
677268
|
return;
|
|
677124
677269
|
}
|
|
677125
677270
|
latest = maxVersion;
|
|
677126
677271
|
}
|
|
677127
|
-
const hasUpdate = latest && !gte("1.
|
|
677272
|
+
const hasUpdate = latest && !gte("1.58.0", latest) && !shouldSkipVersion(latest);
|
|
677128
677273
|
setUpdateAvailable(!!hasUpdate);
|
|
677129
677274
|
if (hasUpdate) {
|
|
677130
|
-
logForDebugging(`PackageManagerAutoUpdater: Update available ${"1.
|
|
677275
|
+
logForDebugging(`PackageManagerAutoUpdater: Update available ${"1.58.0"} -> ${latest}`);
|
|
677131
677276
|
}
|
|
677132
677277
|
};
|
|
677133
677278
|
$2[0] = t1;
|
|
@@ -677161,7 +677306,7 @@ function PackageManagerAutoUpdater(t0) {
|
|
|
677161
677306
|
wrap: "truncate",
|
|
677162
677307
|
children: [
|
|
677163
677308
|
"currentVersion: ",
|
|
677164
|
-
"1.
|
|
677309
|
+
"1.58.0"
|
|
677165
677310
|
]
|
|
677166
677311
|
}, undefined, true, undefined, this);
|
|
677167
677312
|
$2[3] = verbose;
|
|
@@ -687858,7 +688003,7 @@ function buildStatusLineCommandInput(permissionMode, exceeds200kTokens, settings
|
|
|
687858
688003
|
project_dir: getOriginalCwd(),
|
|
687859
688004
|
added_dirs: addedDirs
|
|
687860
688005
|
},
|
|
687861
|
-
version: "1.
|
|
688006
|
+
version: "1.58.0",
|
|
687862
688007
|
output_style: {
|
|
687863
688008
|
name: outputStyleName
|
|
687864
688009
|
},
|
|
@@ -687941,7 +688086,7 @@ function StatusLineInner({
|
|
|
687941
688086
|
const taskValues = Object.values(tasks2);
|
|
687942
688087
|
const taskRunningCount = taskValues.filter((task2) => task2.status === "running" || task2.status === "pending").length;
|
|
687943
688088
|
const defaultStatusLineText = buildDefaultStatusBar({
|
|
687944
|
-
version: "1.
|
|
688089
|
+
version: "1.58.0",
|
|
687945
688090
|
providerLabel: providerRuntime.providerLabel,
|
|
687946
688091
|
authMode: providerRuntime.authLabel,
|
|
687947
688092
|
model: providerRuntime.model ?? renderModelName(mainLoopModel),
|
|
@@ -694226,9 +694371,9 @@ function initSkillImprovement() {
|
|
|
694226
694371
|
async function applySkillImprovement(skillName, updates) {
|
|
694227
694372
|
if (!skillName)
|
|
694228
694373
|
return;
|
|
694229
|
-
const { join:
|
|
694374
|
+
const { join: join234 } = await import("path");
|
|
694230
694375
|
const fs12 = await import("fs/promises");
|
|
694231
|
-
const filePath =
|
|
694376
|
+
const filePath = join234(getCwd(), ".ur", "skills", skillName, "SKILL.md");
|
|
694232
694377
|
let currentContent;
|
|
694233
694378
|
try {
|
|
694234
694379
|
currentContent = await fs12.readFile(filePath, "utf-8");
|
|
@@ -694382,7 +694527,7 @@ function useMoreRight(_args) {
|
|
|
694382
694527
|
// src/utils/cleanup.ts
|
|
694383
694528
|
import * as fs12 from "fs/promises";
|
|
694384
694529
|
import { homedir as homedir39 } from "os";
|
|
694385
|
-
import { join as
|
|
694530
|
+
import { join as join234 } from "path";
|
|
694386
694531
|
function getCutoffDate() {
|
|
694387
694532
|
const settings = getSettings_DEPRECATED() || {};
|
|
694388
694533
|
const cleanupPeriodDays = settings.cleanupPeriodDays ?? DEFAULT_CLEANUP_PERIOD_DAYS;
|
|
@@ -694407,7 +694552,7 @@ async function cleanupOldFilesInDirectory(dirPath, cutoffDate, isMessagePath) {
|
|
|
694407
694552
|
try {
|
|
694408
694553
|
const timestamp2 = convertFileNameToDate(file4.name);
|
|
694409
694554
|
if (timestamp2 < cutoffDate) {
|
|
694410
|
-
await getFsImplementation().unlink(
|
|
694555
|
+
await getFsImplementation().unlink(join234(dirPath, file4.name));
|
|
694411
694556
|
if (isMessagePath) {
|
|
694412
694557
|
result.messages++;
|
|
694413
694558
|
} else {
|
|
@@ -694438,7 +694583,7 @@ async function cleanupOldMessageFiles() {
|
|
|
694438
694583
|
} catch {
|
|
694439
694584
|
return result;
|
|
694440
694585
|
}
|
|
694441
|
-
const mcpLogDirs = dirents.filter((dirent) => dirent.isDirectory() && dirent.name.startsWith("mcp-logs-")).map((dirent) =>
|
|
694586
|
+
const mcpLogDirs = dirents.filter((dirent) => dirent.isDirectory() && dirent.name.startsWith("mcp-logs-")).map((dirent) => join234(baseCachePath, dirent.name));
|
|
694442
694587
|
for (const mcpLogDir of mcpLogDirs) {
|
|
694443
694588
|
result = addCleanupResults(result, await cleanupOldFilesInDirectory(mcpLogDir, cutoffDate, true));
|
|
694444
694589
|
await tryRmdir(mcpLogDir, fsImpl);
|
|
@@ -694477,7 +694622,7 @@ async function cleanupOldSessionFiles() {
|
|
|
694477
694622
|
for (const projectDirent of projectDirents) {
|
|
694478
694623
|
if (!projectDirent.isDirectory())
|
|
694479
694624
|
continue;
|
|
694480
|
-
const projectDir =
|
|
694625
|
+
const projectDir = join234(projectsDir, projectDirent.name);
|
|
694481
694626
|
let entries;
|
|
694482
694627
|
try {
|
|
694483
694628
|
entries = await fsImpl.readdir(projectDir);
|
|
@@ -694491,15 +694636,15 @@ async function cleanupOldSessionFiles() {
|
|
|
694491
694636
|
continue;
|
|
694492
694637
|
}
|
|
694493
694638
|
try {
|
|
694494
|
-
if (await unlinkIfOld(
|
|
694639
|
+
if (await unlinkIfOld(join234(projectDir, entry.name), cutoffDate, fsImpl)) {
|
|
694495
694640
|
result.messages++;
|
|
694496
694641
|
}
|
|
694497
694642
|
} catch {
|
|
694498
694643
|
result.errors++;
|
|
694499
694644
|
}
|
|
694500
694645
|
} else if (entry.isDirectory()) {
|
|
694501
|
-
const sessionDir =
|
|
694502
|
-
const toolResultsDir =
|
|
694646
|
+
const sessionDir = join234(projectDir, entry.name);
|
|
694647
|
+
const toolResultsDir = join234(sessionDir, TOOL_RESULTS_SUBDIR);
|
|
694503
694648
|
let toolDirs;
|
|
694504
694649
|
try {
|
|
694505
694650
|
toolDirs = await fsImpl.readdir(toolResultsDir);
|
|
@@ -694510,14 +694655,14 @@ async function cleanupOldSessionFiles() {
|
|
|
694510
694655
|
for (const toolEntry of toolDirs) {
|
|
694511
694656
|
if (toolEntry.isFile()) {
|
|
694512
694657
|
try {
|
|
694513
|
-
if (await unlinkIfOld(
|
|
694658
|
+
if (await unlinkIfOld(join234(toolResultsDir, toolEntry.name), cutoffDate, fsImpl)) {
|
|
694514
694659
|
result.messages++;
|
|
694515
694660
|
}
|
|
694516
694661
|
} catch {
|
|
694517
694662
|
result.errors++;
|
|
694518
694663
|
}
|
|
694519
694664
|
} else if (toolEntry.isDirectory()) {
|
|
694520
|
-
const toolDirPath =
|
|
694665
|
+
const toolDirPath = join234(toolResultsDir, toolEntry.name);
|
|
694521
694666
|
let toolFiles;
|
|
694522
694667
|
try {
|
|
694523
694668
|
toolFiles = await fsImpl.readdir(toolDirPath);
|
|
@@ -694528,7 +694673,7 @@ async function cleanupOldSessionFiles() {
|
|
|
694528
694673
|
if (!tf.isFile())
|
|
694529
694674
|
continue;
|
|
694530
694675
|
try {
|
|
694531
|
-
if (await unlinkIfOld(
|
|
694676
|
+
if (await unlinkIfOld(join234(toolDirPath, tf.name), cutoffDate, fsImpl)) {
|
|
694532
694677
|
result.messages++;
|
|
694533
694678
|
}
|
|
694534
694679
|
} catch {
|
|
@@ -694560,7 +694705,7 @@ async function cleanupSingleDirectory(dirPath, extension, removeEmptyDir = true)
|
|
|
694560
694705
|
if (!dirent.isFile() || !dirent.name.endsWith(extension))
|
|
694561
694706
|
continue;
|
|
694562
694707
|
try {
|
|
694563
|
-
if (await unlinkIfOld(
|
|
694708
|
+
if (await unlinkIfOld(join234(dirPath, dirent.name), cutoffDate, fsImpl)) {
|
|
694564
694709
|
result.messages++;
|
|
694565
694710
|
}
|
|
694566
694711
|
} catch {
|
|
@@ -694573,7 +694718,7 @@ async function cleanupSingleDirectory(dirPath, extension, removeEmptyDir = true)
|
|
|
694573
694718
|
return result;
|
|
694574
694719
|
}
|
|
694575
694720
|
function cleanupOldPlanFiles() {
|
|
694576
|
-
const plansDir =
|
|
694721
|
+
const plansDir = join234(getURConfigHomeDir(), "plans");
|
|
694577
694722
|
return cleanupSingleDirectory(plansDir, ".md");
|
|
694578
694723
|
}
|
|
694579
694724
|
async function cleanupOldFileHistoryBackups() {
|
|
@@ -694582,14 +694727,14 @@ async function cleanupOldFileHistoryBackups() {
|
|
|
694582
694727
|
const fsImpl = getFsImplementation();
|
|
694583
694728
|
try {
|
|
694584
694729
|
const configDir = getURConfigHomeDir();
|
|
694585
|
-
const fileHistoryStorageDir =
|
|
694730
|
+
const fileHistoryStorageDir = join234(configDir, "file-history");
|
|
694586
694731
|
let dirents;
|
|
694587
694732
|
try {
|
|
694588
694733
|
dirents = await fsImpl.readdir(fileHistoryStorageDir);
|
|
694589
694734
|
} catch {
|
|
694590
694735
|
return result;
|
|
694591
694736
|
}
|
|
694592
|
-
const fileHistorySessionsDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
694737
|
+
const fileHistorySessionsDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join234(fileHistoryStorageDir, dirent.name));
|
|
694593
694738
|
await Promise.all(fileHistorySessionsDirs.map(async (fileHistorySessionDir) => {
|
|
694594
694739
|
try {
|
|
694595
694740
|
const stats2 = await fsImpl.stat(fileHistorySessionDir);
|
|
@@ -694616,14 +694761,14 @@ async function cleanupOldSessionEnvDirs() {
|
|
|
694616
694761
|
const fsImpl = getFsImplementation();
|
|
694617
694762
|
try {
|
|
694618
694763
|
const configDir = getURConfigHomeDir();
|
|
694619
|
-
const sessionEnvBaseDir =
|
|
694764
|
+
const sessionEnvBaseDir = join234(configDir, "session-env");
|
|
694620
694765
|
let dirents;
|
|
694621
694766
|
try {
|
|
694622
694767
|
dirents = await fsImpl.readdir(sessionEnvBaseDir);
|
|
694623
694768
|
} catch {
|
|
694624
694769
|
return result;
|
|
694625
694770
|
}
|
|
694626
|
-
const sessionEnvDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
694771
|
+
const sessionEnvDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join234(sessionEnvBaseDir, dirent.name));
|
|
694627
694772
|
for (const sessionEnvDir of sessionEnvDirs) {
|
|
694628
694773
|
try {
|
|
694629
694774
|
const stats2 = await fsImpl.stat(sessionEnvDir);
|
|
@@ -694645,7 +694790,7 @@ async function cleanupOldDebugLogs() {
|
|
|
694645
694790
|
const cutoffDate = getCutoffDate();
|
|
694646
694791
|
const result = { messages: 0, errors: 0 };
|
|
694647
694792
|
const fsImpl = getFsImplementation();
|
|
694648
|
-
const debugDir =
|
|
694793
|
+
const debugDir = join234(getURConfigHomeDir(), "debug");
|
|
694649
694794
|
let dirents;
|
|
694650
694795
|
try {
|
|
694651
694796
|
dirents = await fsImpl.readdir(debugDir);
|
|
@@ -694657,7 +694802,7 @@ async function cleanupOldDebugLogs() {
|
|
|
694657
694802
|
continue;
|
|
694658
694803
|
}
|
|
694659
694804
|
try {
|
|
694660
|
-
if (await unlinkIfOld(
|
|
694805
|
+
if (await unlinkIfOld(join234(debugDir, dirent.name), cutoffDate, fsImpl)) {
|
|
694661
694806
|
result.messages++;
|
|
694662
694807
|
}
|
|
694663
694808
|
} catch {
|
|
@@ -694667,7 +694812,7 @@ async function cleanupOldDebugLogs() {
|
|
|
694667
694812
|
return result;
|
|
694668
694813
|
}
|
|
694669
694814
|
async function cleanupNpmCacheForURHQPackages() {
|
|
694670
|
-
const markerPath =
|
|
694815
|
+
const markerPath = join234(getURConfigHomeDir(), ".npm-cache-cleanup");
|
|
694671
694816
|
try {
|
|
694672
694817
|
const stat48 = await fs12.stat(markerPath);
|
|
694673
694818
|
if (Date.now() - stat48.mtimeMs < ONE_DAY_MS) {
|
|
@@ -694682,7 +694827,7 @@ async function cleanupNpmCacheForURHQPackages() {
|
|
|
694682
694827
|
return;
|
|
694683
694828
|
}
|
|
694684
694829
|
logForDebugging("npm cache cleanup: starting");
|
|
694685
|
-
const npmCachePath =
|
|
694830
|
+
const npmCachePath = join234(homedir39(), ".npm", "_cacache");
|
|
694686
694831
|
const NPM_CACHE_RETENTION_COUNT = 5;
|
|
694687
694832
|
const startTime = Date.now();
|
|
694688
694833
|
try {
|
|
@@ -694737,7 +694882,7 @@ async function cleanupNpmCacheForURHQPackages() {
|
|
|
694737
694882
|
}
|
|
694738
694883
|
}
|
|
694739
694884
|
async function cleanupOldVersionsThrottled() {
|
|
694740
|
-
const markerPath =
|
|
694885
|
+
const markerPath = join234(getURConfigHomeDir(), ".version-cleanup");
|
|
694741
694886
|
try {
|
|
694742
694887
|
const stat48 = await fs12.stat(markerPath);
|
|
694743
694888
|
if (Date.now() - stat48.mtimeMs < ONE_DAY_MS) {
|
|
@@ -698438,7 +698583,7 @@ __export(exports_asciicast, {
|
|
|
698438
698583
|
_resetRecordingStateForTesting: () => _resetRecordingStateForTesting
|
|
698439
698584
|
});
|
|
698440
698585
|
import { appendFile as appendFile7, rename as rename10 } from "fs/promises";
|
|
698441
|
-
import { basename as basename66, dirname as
|
|
698586
|
+
import { basename as basename66, dirname as dirname85, join as join236 } from "path";
|
|
698442
698587
|
function getRecordFilePath() {
|
|
698443
698588
|
if (recordingState.filePath !== null) {
|
|
698444
698589
|
return recordingState.filePath;
|
|
@@ -698449,10 +698594,10 @@ function getRecordFilePath() {
|
|
|
698449
698594
|
if (!isEnvTruthy(process.env.UR_CODE_TERMINAL_RECORDING)) {
|
|
698450
698595
|
return null;
|
|
698451
698596
|
}
|
|
698452
|
-
const projectsDir =
|
|
698453
|
-
const projectDir =
|
|
698597
|
+
const projectsDir = join236(getURConfigHomeDir(), "projects");
|
|
698598
|
+
const projectDir = join236(projectsDir, sanitizePath2(getOriginalCwd()));
|
|
698454
698599
|
recordingState.timestamp = Date.now();
|
|
698455
|
-
recordingState.filePath =
|
|
698600
|
+
recordingState.filePath = join236(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
|
|
698456
698601
|
return recordingState.filePath;
|
|
698457
698602
|
}
|
|
698458
698603
|
function _resetRecordingStateForTesting() {
|
|
@@ -698461,13 +698606,13 @@ function _resetRecordingStateForTesting() {
|
|
|
698461
698606
|
}
|
|
698462
698607
|
function getSessionRecordingPaths() {
|
|
698463
698608
|
const sessionId = getSessionId();
|
|
698464
|
-
const projectsDir =
|
|
698465
|
-
const projectDir =
|
|
698609
|
+
const projectsDir = join236(getURConfigHomeDir(), "projects");
|
|
698610
|
+
const projectDir = join236(projectsDir, sanitizePath2(getOriginalCwd()));
|
|
698466
698611
|
try {
|
|
698467
698612
|
const entries = getFsImplementation().readdirSync(projectDir);
|
|
698468
698613
|
const names = typeof entries[0] === "string" ? entries : entries.map((e) => e.name);
|
|
698469
698614
|
const files2 = names.filter((f) => f.startsWith(sessionId) && f.endsWith(".cast")).sort();
|
|
698470
|
-
return files2.map((f) =>
|
|
698615
|
+
return files2.map((f) => join236(projectDir, f));
|
|
698471
698616
|
} catch {
|
|
698472
698617
|
return [];
|
|
698473
698618
|
}
|
|
@@ -698477,9 +698622,9 @@ async function renameRecordingForSession() {
|
|
|
698477
698622
|
if (!oldPath || recordingState.timestamp === 0) {
|
|
698478
698623
|
return;
|
|
698479
698624
|
}
|
|
698480
|
-
const projectsDir =
|
|
698481
|
-
const projectDir =
|
|
698482
|
-
const newPath =
|
|
698625
|
+
const projectsDir = join236(getURConfigHomeDir(), "projects");
|
|
698626
|
+
const projectDir = join236(projectsDir, sanitizePath2(getOriginalCwd()));
|
|
698627
|
+
const newPath = join236(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
|
|
698483
698628
|
if (oldPath === newPath) {
|
|
698484
698629
|
return;
|
|
698485
698630
|
}
|
|
@@ -698520,7 +698665,7 @@ function installAsciicastRecorder() {
|
|
|
698520
698665
|
}
|
|
698521
698666
|
});
|
|
698522
698667
|
try {
|
|
698523
|
-
getFsImplementation().mkdirSync(
|
|
698668
|
+
getFsImplementation().mkdirSync(dirname85(filePath));
|
|
698524
698669
|
} catch {}
|
|
698525
698670
|
getFsImplementation().appendFileSync(filePath, header + `
|
|
698526
698671
|
`, { mode: 384 });
|
|
@@ -698589,7 +698734,7 @@ var init_asciicast = __esm(() => {
|
|
|
698589
698734
|
});
|
|
698590
698735
|
|
|
698591
698736
|
// src/utils/sessionRestore.ts
|
|
698592
|
-
import { dirname as
|
|
698737
|
+
import { dirname as dirname86 } from "path";
|
|
698593
698738
|
function extractTodosFromTranscript(messages) {
|
|
698594
698739
|
for (let i3 = messages.length - 1;i3 >= 0; i3--) {
|
|
698595
698740
|
const msg = messages[i3];
|
|
@@ -698714,7 +698859,7 @@ async function processResumedConversation(result, opts, context6) {
|
|
|
698714
698859
|
if (!opts.forkSession) {
|
|
698715
698860
|
const sid = opts.sessionIdOverride ?? result.sessionId;
|
|
698716
698861
|
if (sid) {
|
|
698717
|
-
switchSession(asSessionId(sid), opts.transcriptPath ?
|
|
698862
|
+
switchSession(asSessionId(sid), opts.transcriptPath ? dirname86(opts.transcriptPath) : null);
|
|
698718
698863
|
await renameRecordingForSession();
|
|
698719
698864
|
await resetSessionFilePointer();
|
|
698720
698865
|
restoreCostStateForSession(sid);
|
|
@@ -700084,7 +700229,7 @@ async function submitTranscriptShare(messages, trigger2, appearanceId) {
|
|
|
700084
700229
|
} catch {}
|
|
700085
700230
|
const data = {
|
|
700086
700231
|
trigger: trigger2,
|
|
700087
|
-
version: "1.
|
|
700232
|
+
version: "1.58.0",
|
|
700088
700233
|
platform: process.platform,
|
|
700089
700234
|
transcript,
|
|
700090
700235
|
subagentTranscripts: Object.keys(subagentTranscripts).length > 0 ? subagentTranscripts : undefined,
|
|
@@ -701356,7 +701501,7 @@ var init_useChromeExtensionNotification = __esm(() => {
|
|
|
701356
701501
|
});
|
|
701357
701502
|
|
|
701358
701503
|
// src/utils/plugins/officialMarketplaceStartupCheck.ts
|
|
701359
|
-
import { join as
|
|
701504
|
+
import { join as join237 } from "path";
|
|
701360
701505
|
function isOfficialMarketplaceAutoInstallDisabled() {
|
|
701361
701506
|
return isEnvTruthy(process.env.UR_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL);
|
|
701362
701507
|
}
|
|
@@ -701440,7 +701585,7 @@ async function checkAndInstallOfficialMarketplace() {
|
|
|
701440
701585
|
return { installed: false, skipped: true, reason: "policy_blocked" };
|
|
701441
701586
|
}
|
|
701442
701587
|
const cacheDir = getMarketplacesCacheDir();
|
|
701443
|
-
const installLocation =
|
|
701588
|
+
const installLocation = join237(cacheDir, OFFICIAL_MARKETPLACE_NAME);
|
|
701444
701589
|
const gcsSha = await fetchOfficialMarketplaceFromGcs(installLocation, cacheDir);
|
|
701445
701590
|
if (gcsSha !== null) {
|
|
701446
701591
|
const known = await loadKnownMarketplacesConfig();
|
|
@@ -704423,7 +704568,7 @@ var init_usePluginRecommendationBase = __esm(() => {
|
|
|
704423
704568
|
});
|
|
704424
704569
|
|
|
704425
704570
|
// src/hooks/useLspPluginRecommendation.tsx
|
|
704426
|
-
import { extname as extname25, join as
|
|
704571
|
+
import { extname as extname25, join as join238 } from "path";
|
|
704427
704572
|
function useLspPluginRecommendation() {
|
|
704428
704573
|
const $2 = import_compiler_runtime332.c(12);
|
|
704429
704574
|
const trackedFiles = useAppState(_temp203);
|
|
@@ -704508,7 +704653,7 @@ function useLspPluginRecommendation() {
|
|
|
704508
704653
|
case "yes": {
|
|
704509
704654
|
installPluginAndNotify(pluginId, pluginName, "lsp-plugin", addNotification, async (pluginData) => {
|
|
704510
704655
|
logForDebugging(`[useLspPluginRecommendation] Installing plugin: ${pluginId}`);
|
|
704511
|
-
const localSourcePath = typeof pluginData.entry.source === "string" ?
|
|
704656
|
+
const localSourcePath = typeof pluginData.entry.source === "string" ? join238(pluginData.marketplaceInstallLocation, pluginData.entry.source) : undefined;
|
|
704512
704657
|
await cacheAndRegisterPlugin(pluginId, pluginData.entry, "user", undefined, localSourcePath);
|
|
704513
704658
|
const settings = getSettingsForSource("userSettings");
|
|
704514
704659
|
updateSettingsForSource("userSettings", {
|
|
@@ -707729,7 +707874,7 @@ var exports_REPL = {};
|
|
|
707729
707874
|
__export(exports_REPL, {
|
|
707730
707875
|
REPL: () => REPL
|
|
707731
707876
|
});
|
|
707732
|
-
import { dirname as
|
|
707877
|
+
import { dirname as dirname87, join as join239 } from "path";
|
|
707733
707878
|
import { tmpdir as tmpdir19 } from "os";
|
|
707734
707879
|
import { writeFile as writeFile47 } from "fs/promises";
|
|
707735
707880
|
import { randomUUID as randomUUID76 } from "crypto";
|
|
@@ -708669,7 +708814,7 @@ function REPL({
|
|
|
708669
708814
|
const targetSessionCosts = getStoredSessionCosts(sessionId);
|
|
708670
708815
|
saveCurrentSessionCosts();
|
|
708671
708816
|
resetCostState();
|
|
708672
|
-
switchSession(asSessionId(sessionId), log2.fullPath ?
|
|
708817
|
+
switchSession(asSessionId(sessionId), log2.fullPath ? dirname87(log2.fullPath) : null);
|
|
708673
708818
|
const {
|
|
708674
708819
|
renameRecordingForSession: renameRecordingForSession2
|
|
708675
708820
|
} = await Promise.resolve().then(() => (init_asciicast(), exports_asciicast));
|
|
@@ -710300,7 +710445,7 @@ Note: ctrl + z now suspends UR, ctrl + _ undoes input.
|
|
|
710300
710445
|
const w = Math.max(80, (process.stdout.columns ?? 80) - 6);
|
|
710301
710446
|
const raw = await renderMessagesToPlainText(deferredMessages, tools, w);
|
|
710302
710447
|
const text = raw.replace(/[ \t]+$/gm, "");
|
|
710303
|
-
const path24 =
|
|
710448
|
+
const path24 = join239(tmpdir19(), `cc-transcript-${Date.now()}.txt`);
|
|
710304
710449
|
await writeFile47(path24, text);
|
|
710305
710450
|
const opened = openFileInExternalEditor(path24);
|
|
710306
710451
|
setStatus2(opened ? `opening ${path24}` : `wrote ${path24} \xB7 no $VISUAL/$EDITOR set`);
|
|
@@ -712364,7 +712509,7 @@ function WelcomeV2() {
|
|
|
712364
712509
|
dimColor: true,
|
|
712365
712510
|
children: [
|
|
712366
712511
|
"v",
|
|
712367
|
-
"1.
|
|
712512
|
+
"1.58.0"
|
|
712368
712513
|
]
|
|
712369
712514
|
}, undefined, true, undefined, this)
|
|
712370
712515
|
]
|
|
@@ -713624,7 +713769,7 @@ function completeOnboarding() {
|
|
|
713624
713769
|
saveGlobalConfig((current) => ({
|
|
713625
713770
|
...current,
|
|
713626
713771
|
hasCompletedOnboarding: true,
|
|
713627
|
-
lastOnboardingVersion: "1.
|
|
713772
|
+
lastOnboardingVersion: "1.58.0"
|
|
713628
713773
|
}));
|
|
713629
713774
|
}
|
|
713630
713775
|
function showDialog(root2, renderer) {
|
|
@@ -714768,7 +714913,7 @@ var exports_ResumeConversation = {};
|
|
|
714768
714913
|
__export(exports_ResumeConversation, {
|
|
714769
714914
|
ResumeConversation: () => ResumeConversation
|
|
714770
714915
|
});
|
|
714771
|
-
import { dirname as
|
|
714916
|
+
import { dirname as dirname88 } from "path";
|
|
714772
714917
|
function parsePrIdentifier(value2) {
|
|
714773
714918
|
const directNumber = parseInt(value2, 10);
|
|
714774
714919
|
if (!isNaN(directNumber) && directNumber > 0) {
|
|
@@ -714900,7 +715045,7 @@ function ResumeConversation({
|
|
|
714900
715045
|
}
|
|
714901
715046
|
if (false) {}
|
|
714902
715047
|
if (result_3.sessionId && !forkSession) {
|
|
714903
|
-
switchSession(asSessionId(result_3.sessionId), log_0.fullPath ?
|
|
715048
|
+
switchSession(asSessionId(result_3.sessionId), log_0.fullPath ? dirname88(log_0.fullPath) : null);
|
|
714904
715049
|
await renameRecordingForSession();
|
|
714905
715050
|
await resetSessionFilePointer();
|
|
714906
715051
|
restoreCostStateForSession(result_3.sessionId);
|
|
@@ -718619,12 +718764,12 @@ var init_createDirectConnectSession = __esm(() => {
|
|
|
718619
718764
|
});
|
|
718620
718765
|
|
|
718621
718766
|
// src/utils/errorLogSink.ts
|
|
718622
|
-
import { dirname as
|
|
718767
|
+
import { dirname as dirname89, join as join240 } from "path";
|
|
718623
718768
|
function getErrorsPath() {
|
|
718624
|
-
return
|
|
718769
|
+
return join240(CACHE_PATHS.errors(), DATE + ".jsonl");
|
|
718625
718770
|
}
|
|
718626
718771
|
function getMCPLogsPath(serverName) {
|
|
718627
|
-
return
|
|
718772
|
+
return join240(CACHE_PATHS.mcpLogs(serverName), DATE + ".jsonl");
|
|
718628
718773
|
}
|
|
718629
718774
|
function createJsonlWriter(options4) {
|
|
718630
718775
|
const writer = createBufferedWriter(options4);
|
|
@@ -718640,7 +718785,7 @@ function createJsonlWriter(options4) {
|
|
|
718640
718785
|
function getLogWriter(path24) {
|
|
718641
718786
|
let writer = logWriters.get(path24);
|
|
718642
718787
|
if (!writer) {
|
|
718643
|
-
const dir =
|
|
718788
|
+
const dir = dirname89(path24);
|
|
718644
718789
|
writer = createJsonlWriter({
|
|
718645
718790
|
writeFn: (content) => {
|
|
718646
718791
|
try {
|
|
@@ -718668,7 +718813,7 @@ function appendToLog(path24, message) {
|
|
|
718668
718813
|
cwd: getFsImplementation().cwd(),
|
|
718669
718814
|
userType: process.env.USER_TYPE,
|
|
718670
718815
|
sessionId: getSessionId(),
|
|
718671
|
-
version: "1.
|
|
718816
|
+
version: "1.58.0"
|
|
718672
718817
|
};
|
|
718673
718818
|
getLogWriter(path24).write(messageWithTimestamp);
|
|
718674
718819
|
}
|
|
@@ -718772,12 +718917,12 @@ var exports_setup = {};
|
|
|
718772
718917
|
__export(exports_setup, {
|
|
718773
718918
|
setupComputerUseMCP: () => setupComputerUseMCP
|
|
718774
718919
|
});
|
|
718775
|
-
import { join as
|
|
718920
|
+
import { join as join241 } from "path";
|
|
718776
718921
|
import { fileURLToPath as fileURLToPath7 } from "url";
|
|
718777
718922
|
function setupComputerUseMCP() {
|
|
718778
718923
|
const allowedTools = buildComputerUseTools(CLI_CU_CAPABILITIES, getChicagoCoordinateMode()).map((t) => buildMcpToolName(COMPUTER_USE_MCP_SERVER_NAME, t.name));
|
|
718779
718924
|
const args = isInBundledMode() ? ["--computer-use-mcp"] : [
|
|
718780
|
-
|
|
718925
|
+
join241(fileURLToPath7(import.meta.url), "..", "cli.js"),
|
|
718781
718926
|
"--computer-use-mcp"
|
|
718782
718927
|
];
|
|
718783
718928
|
return {
|
|
@@ -718999,7 +719144,7 @@ var init_sessionMemory = __esm(() => {
|
|
|
718999
719144
|
// src/utils/iTermBackup.ts
|
|
719000
719145
|
import { copyFile as copyFile11, stat as stat50 } from "fs/promises";
|
|
719001
719146
|
import { homedir as homedir42 } from "os";
|
|
719002
|
-
import { join as
|
|
719147
|
+
import { join as join242 } from "path";
|
|
719003
719148
|
function markITerm2SetupComplete() {
|
|
719004
719149
|
saveGlobalConfig((current) => ({
|
|
719005
719150
|
...current,
|
|
@@ -719014,7 +719159,7 @@ function getIterm2RecoveryInfo() {
|
|
|
719014
719159
|
};
|
|
719015
719160
|
}
|
|
719016
719161
|
function getITerm2PlistPath() {
|
|
719017
|
-
return
|
|
719162
|
+
return join242(homedir42(), "Library", "Preferences", "com.googlecode.iterm2.plist");
|
|
719018
719163
|
}
|
|
719019
719164
|
async function checkAndRestoreITerm2Backup() {
|
|
719020
719165
|
const { inProgress, backupPath } = getIterm2RecoveryInfo();
|
|
@@ -722521,7 +722666,7 @@ var init_idleTimeout = __esm(() => {
|
|
|
722521
722666
|
// src/bridge/inboundAttachments.ts
|
|
722522
722667
|
import { randomUUID as randomUUID79 } from "crypto";
|
|
722523
722668
|
import { mkdir as mkdir46, writeFile as writeFile49 } from "fs/promises";
|
|
722524
|
-
import { basename as basename67, join as
|
|
722669
|
+
import { basename as basename67, join as join243 } from "path";
|
|
722525
722670
|
function debug(msg) {
|
|
722526
722671
|
logForDebugging(`[bridge:inbound-attach] ${msg}`);
|
|
722527
722672
|
}
|
|
@@ -722537,7 +722682,7 @@ function sanitizeFileName(name) {
|
|
|
722537
722682
|
return base2 || "attachment";
|
|
722538
722683
|
}
|
|
722539
722684
|
function uploadsDir() {
|
|
722540
|
-
return
|
|
722685
|
+
return join243(getURConfigHomeDir(), "uploads", getSessionId());
|
|
722541
722686
|
}
|
|
722542
722687
|
async function resolveOne(att) {
|
|
722543
722688
|
const token = getBridgeAccessToken();
|
|
@@ -722566,7 +722711,7 @@ async function resolveOne(att) {
|
|
|
722566
722711
|
const safeName = sanitizeFileName(att.file_name);
|
|
722567
722712
|
const prefix = (att.file_uuid.slice(0, 8) || randomUUID79().slice(0, 8)).replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
722568
722713
|
const dir = uploadsDir();
|
|
722569
|
-
const outPath =
|
|
722714
|
+
const outPath = join243(dir, `${prefix}-${safeName}`);
|
|
722570
722715
|
try {
|
|
722571
722716
|
await mkdir46(dir, { recursive: true });
|
|
722572
722717
|
await writeFile49(outPath, data);
|
|
@@ -722666,7 +722811,7 @@ var init_sessionUrl = __esm(() => {
|
|
|
722666
722811
|
|
|
722667
722812
|
// src/utils/plugins/zipCacheAdapters.ts
|
|
722668
722813
|
import { readFile as readFile56 } from "fs/promises";
|
|
722669
|
-
import { join as
|
|
722814
|
+
import { join as join244 } from "path";
|
|
722670
722815
|
async function readZipCacheKnownMarketplaces() {
|
|
722671
722816
|
try {
|
|
722672
722817
|
const content = await readFile56(getZipCacheKnownMarketplacesPath(), "utf-8");
|
|
@@ -722691,13 +722836,13 @@ async function saveMarketplaceJsonToZipCache(marketplaceName, installLocation) {
|
|
|
722691
722836
|
const content = await readMarketplaceJsonContent(installLocation);
|
|
722692
722837
|
if (content !== null) {
|
|
722693
722838
|
const relPath = getMarketplaceJsonRelativePath(marketplaceName);
|
|
722694
|
-
await atomicWriteToZipCache(
|
|
722839
|
+
await atomicWriteToZipCache(join244(zipCachePath, relPath), content);
|
|
722695
722840
|
}
|
|
722696
722841
|
}
|
|
722697
722842
|
async function readMarketplaceJsonContent(dir) {
|
|
722698
722843
|
const candidates2 = [
|
|
722699
|
-
|
|
722700
|
-
|
|
722844
|
+
join244(dir, ".ur-plugin", "marketplace.json"),
|
|
722845
|
+
join244(dir, "marketplace.json"),
|
|
722701
722846
|
dir
|
|
722702
722847
|
];
|
|
722703
722848
|
for (const candidate of candidates2) {
|
|
@@ -722827,8 +722972,8 @@ async function getEnvLessBridgeConfig() {
|
|
|
722827
722972
|
}
|
|
722828
722973
|
async function checkEnvLessBridgeMinVersion() {
|
|
722829
722974
|
const cfg = await getEnvLessBridgeConfig();
|
|
722830
|
-
if (cfg.min_version && lt("1.
|
|
722831
|
-
return `Your version of UR (${"1.
|
|
722975
|
+
if (cfg.min_version && lt("1.58.0", cfg.min_version)) {
|
|
722976
|
+
return `Your version of UR (${"1.58.0"}) is too old for Remote Control.
|
|
722832
722977
|
Version ${cfg.min_version} or higher is required. Run \`ur update\` to update.`;
|
|
722833
722978
|
}
|
|
722834
722979
|
return null;
|
|
@@ -723156,14 +723301,14 @@ __export(exports_bridgePointer, {
|
|
|
723156
723301
|
BRIDGE_POINTER_TTL_MS: () => BRIDGE_POINTER_TTL_MS
|
|
723157
723302
|
});
|
|
723158
723303
|
import { mkdir as mkdir47, readFile as readFile57, stat as stat51, unlink as unlink27, writeFile as writeFile50 } from "fs/promises";
|
|
723159
|
-
import { dirname as
|
|
723304
|
+
import { dirname as dirname90, join as join245 } from "path";
|
|
723160
723305
|
function getBridgePointerPath(dir) {
|
|
723161
|
-
return
|
|
723306
|
+
return join245(getProjectsDir(), sanitizePath2(dir), "bridge-pointer.json");
|
|
723162
723307
|
}
|
|
723163
723308
|
async function writeBridgePointer(dir, pointer) {
|
|
723164
723309
|
const path24 = getBridgePointerPath(dir);
|
|
723165
723310
|
try {
|
|
723166
|
-
await mkdir47(
|
|
723311
|
+
await mkdir47(dirname90(path24), { recursive: true });
|
|
723167
723312
|
await writeFile50(path24, jsonStringify(pointer), "utf8");
|
|
723168
723313
|
logForDebugging(`[bridge:pointer] wrote ${path24}`);
|
|
723169
723314
|
} catch (err2) {
|
|
@@ -723302,7 +723447,7 @@ async function initBridgeCore(params) {
|
|
|
723302
723447
|
const rawApi = createBridgeApiClient({
|
|
723303
723448
|
baseUrl,
|
|
723304
723449
|
getAccessToken,
|
|
723305
|
-
runnerVersion: "1.
|
|
723450
|
+
runnerVersion: "1.58.0",
|
|
723306
723451
|
onDebug: logForDebugging,
|
|
723307
723452
|
onAuth401,
|
|
723308
723453
|
getTrustedDeviceToken
|
|
@@ -725167,7 +725312,7 @@ __export(exports_print, {
|
|
|
725167
725312
|
canBatchWith: () => canBatchWith
|
|
725168
725313
|
});
|
|
725169
725314
|
import { readFile as readFile58, stat as stat52, writeFile as writeFile51 } from "fs/promises";
|
|
725170
|
-
import { dirname as
|
|
725315
|
+
import { dirname as dirname91 } from "path";
|
|
725171
725316
|
import { cwd as cwd2 } from "process";
|
|
725172
725317
|
import { randomUUID as randomUUID82 } from "crypto";
|
|
725173
725318
|
function trackReceivedMessageUuid(uuid3) {
|
|
@@ -727624,7 +727769,7 @@ async function loadInitialMessages(setAppState, options4) {
|
|
|
727624
727769
|
if (false) {}
|
|
727625
727770
|
if (!options4.forkSession) {
|
|
727626
727771
|
if (result.sessionId) {
|
|
727627
|
-
switchSession(asSessionId(result.sessionId), result.fullPath ?
|
|
727772
|
+
switchSession(asSessionId(result.sessionId), result.fullPath ? dirname91(result.fullPath) : null);
|
|
727628
727773
|
if (persistSession) {
|
|
727629
727774
|
await resetSessionFilePointer();
|
|
727630
727775
|
}
|
|
@@ -727722,7 +727867,7 @@ async function loadInitialMessages(setAppState, options4) {
|
|
|
727722
727867
|
}
|
|
727723
727868
|
if (false) {}
|
|
727724
727869
|
if (!options4.forkSession && result.sessionId) {
|
|
727725
|
-
switchSession(asSessionId(result.sessionId), result.fullPath ?
|
|
727870
|
+
switchSession(asSessionId(result.sessionId), result.fullPath ? dirname91(result.fullPath) : null);
|
|
727726
727871
|
if (persistSession) {
|
|
727727
727872
|
await resetSessionFilePointer();
|
|
727728
727873
|
}
|
|
@@ -732778,7 +732923,7 @@ function getAgUiCapabilities() {
|
|
|
732778
732923
|
name: "UR-Nexus",
|
|
732779
732924
|
type: "ur-nexus",
|
|
732780
732925
|
description: "Provider-flexible, local-first autonomous engineering workflow agent.",
|
|
732781
|
-
version: "1.
|
|
732926
|
+
version: "1.58.0",
|
|
732782
732927
|
provider: "UR",
|
|
732783
732928
|
documentationUrl: "https://github.com/Maitham16/UR/blob/master/docs/AG_UI.md"
|
|
732784
732929
|
},
|
|
@@ -733918,7 +734063,7 @@ function createMCPServer(cwd4, debug2, verbose) {
|
|
|
733918
734063
|
};
|
|
733919
734064
|
const server2 = new Server({
|
|
733920
734065
|
name: "ur-nexus",
|
|
733921
|
-
version: "1.
|
|
734066
|
+
version: "1.58.0"
|
|
733922
734067
|
}, {
|
|
733923
734068
|
capabilities: {
|
|
733924
734069
|
tools: {}
|
|
@@ -734078,7 +734223,7 @@ import {
|
|
|
734078
734223
|
unlinkSync as unlinkSync15,
|
|
734079
734224
|
writeFileSync as writeFileSync69
|
|
734080
734225
|
} from "fs";
|
|
734081
|
-
import { join as
|
|
734226
|
+
import { join as join246 } from "path";
|
|
734082
734227
|
function isRecord6(value2) {
|
|
734083
734228
|
return Boolean(value2) && typeof value2 === "object" && !Array.isArray(value2);
|
|
734084
734229
|
}
|
|
@@ -734111,7 +734256,7 @@ function isTask2(value2) {
|
|
|
734111
734256
|
return typeof value2.taskId === "string" && ["working", "input_required", "completed", "failed", "cancelled"].includes(String(value2.status)) && typeof value2.createdAt === "string" && typeof value2.lastUpdatedAt === "string" && Number.isFinite(createdAt) && Number.isFinite(lastUpdatedAt) && (value2.ttlMs === null || typeof value2.ttlMs === "number" && Number.isSafeInteger(value2.ttlMs) && value2.ttlMs >= 0);
|
|
734112
734257
|
}
|
|
734113
734258
|
function taskManifestPath(cwd4) {
|
|
734114
|
-
return
|
|
734259
|
+
return join246(cwd4, ".ur", "mcp-2026", "tasks.json");
|
|
734115
734260
|
}
|
|
734116
734261
|
function quarantineTaskManifest(path24) {
|
|
734117
734262
|
const destination = `${path24}.corrupt.${new Date().toISOString().replaceAll(/[:.]/g, "-")}.${randomUUID85()}`;
|
|
@@ -734125,8 +734270,8 @@ function assertNotSymlink(path24) {
|
|
|
734125
734270
|
}
|
|
734126
734271
|
}
|
|
734127
734272
|
function prepareTaskDirectory(cwd4) {
|
|
734128
|
-
const urDir =
|
|
734129
|
-
const mcpDir =
|
|
734273
|
+
const urDir = join246(cwd4, ".ur");
|
|
734274
|
+
const mcpDir = join246(urDir, "mcp-2026");
|
|
734130
734275
|
assertNotSymlink(urDir);
|
|
734131
734276
|
mkdirSync69(urDir, { recursive: true, mode: 448 });
|
|
734132
734277
|
assertNotSymlink(urDir);
|
|
@@ -735076,7 +735221,7 @@ function thrownResponse(error40) {
|
|
|
735076
735221
|
}
|
|
735077
735222
|
async function createUrMcp2026Runtime(options4) {
|
|
735078
735223
|
const server2 = createMCPServer(options4.cwd, options4.debug === true, options4.verbose === true);
|
|
735079
|
-
const client2 = new Client({ name: "ur-mcp-2026-adapter", version: "1.
|
|
735224
|
+
const client2 = new Client({ name: "ur-mcp-2026-adapter", version: "1.58.0" }, { capabilities: {} });
|
|
735080
735225
|
const [clientTransport, serverTransport] = createLinkedTransportPair();
|
|
735081
735226
|
try {
|
|
735082
735227
|
await server2.connect(serverTransport);
|
|
@@ -735087,7 +735232,7 @@ async function createUrMcp2026Runtime(options4) {
|
|
|
735087
735232
|
}
|
|
735088
735233
|
const runtime2 = new Mcp2026Runtime({
|
|
735089
735234
|
cwd: options4.cwd,
|
|
735090
|
-
version: "1.
|
|
735235
|
+
version: "1.58.0",
|
|
735091
735236
|
backend: {
|
|
735092
735237
|
listTools: async () => {
|
|
735093
735238
|
const listed = await client2.listTools();
|
|
@@ -735270,14 +735415,14 @@ __export(exports_urDesktop, {
|
|
|
735270
735415
|
});
|
|
735271
735416
|
import { readdir as readdir33, readFile as readFile59, stat as stat54 } from "fs/promises";
|
|
735272
735417
|
import { homedir as homedir43 } from "os";
|
|
735273
|
-
import { join as
|
|
735418
|
+
import { join as join247 } from "path";
|
|
735274
735419
|
async function getURDesktopConfigPath() {
|
|
735275
735420
|
const platform7 = getPlatform();
|
|
735276
735421
|
if (!SUPPORTED_PLATFORMS.includes(platform7)) {
|
|
735277
735422
|
throw new Error(`Unsupported platform: ${platform7} - UR Desktop integration only works on macOS and WSL.`);
|
|
735278
735423
|
}
|
|
735279
735424
|
if (platform7 === "macos") {
|
|
735280
|
-
return
|
|
735425
|
+
return join247(homedir43(), "Library", "Application Support", "UR", "ur_desktop_config.json");
|
|
735281
735426
|
}
|
|
735282
735427
|
const windowsHome = process.env.USERPROFILE ? process.env.USERPROFILE.replace(/\\/g, "/") : null;
|
|
735283
735428
|
if (windowsHome) {
|
|
@@ -735296,7 +735441,7 @@ async function getURDesktopConfigPath() {
|
|
|
735296
735441
|
if (user.name === "Public" || user.name === "Default" || user.name === "Default User" || user.name === "All Users") {
|
|
735297
735442
|
continue;
|
|
735298
735443
|
}
|
|
735299
|
-
const potentialConfigPath =
|
|
735444
|
+
const potentialConfigPath = join247(usersDir, user.name, "AppData", "Roaming", "UR", "ur_desktop_config.json");
|
|
735300
735445
|
try {
|
|
735301
735446
|
await stat54(potentialConfigPath);
|
|
735302
735447
|
return potentialConfigPath;
|
|
@@ -735890,10 +736035,10 @@ var init_providers2 = __esm(() => {
|
|
|
735890
736035
|
});
|
|
735891
736036
|
|
|
735892
736037
|
// src/utils/plugins/pluginDoctor.ts
|
|
735893
|
-
import { existsSync as existsSync99, readdirSync as
|
|
735894
|
-
import { basename as basename68, join as
|
|
736038
|
+
import { existsSync as existsSync99, readdirSync as readdirSync35, readFileSync as readFileSync88, statSync as statSync32 } from "fs";
|
|
736039
|
+
import { basename as basename68, join as join248 } from "path";
|
|
735895
736040
|
function manifestPathFor2(dir) {
|
|
735896
|
-
const p2 =
|
|
736041
|
+
const p2 = join248(dir, ".ur-plugin", "plugin.json");
|
|
735897
736042
|
return existsSync99(p2) ? p2 : null;
|
|
735898
736043
|
}
|
|
735899
736044
|
function discoverPluginDirs(roots) {
|
|
@@ -735914,12 +736059,12 @@ function discoverPluginDirs(roots) {
|
|
|
735914
736059
|
}
|
|
735915
736060
|
let entries = [];
|
|
735916
736061
|
try {
|
|
735917
|
-
entries =
|
|
736062
|
+
entries = readdirSync35(root2);
|
|
735918
736063
|
} catch {
|
|
735919
736064
|
continue;
|
|
735920
736065
|
}
|
|
735921
736066
|
for (const entry of entries) {
|
|
735922
|
-
const full =
|
|
736067
|
+
const full = join248(root2, entry);
|
|
735923
736068
|
try {
|
|
735924
736069
|
if (statSync32(full).isDirectory() && manifestPathFor2(full))
|
|
735925
736070
|
add(full);
|
|
@@ -736050,7 +736195,7 @@ __export(exports_plugins, {
|
|
|
736050
736195
|
VALID_UPDATE_SCOPES: () => VALID_UPDATE_SCOPES,
|
|
736051
736196
|
VALID_INSTALLABLE_SCOPES: () => VALID_INSTALLABLE_SCOPES
|
|
736052
736197
|
});
|
|
736053
|
-
import { basename as basename69, dirname as
|
|
736198
|
+
import { basename as basename69, dirname as dirname93, join as join249, resolve as resolve72 } from "path";
|
|
736054
736199
|
function handleMarketplaceError(error40, action3) {
|
|
736055
736200
|
logError2(error40);
|
|
736056
736201
|
cliError(`${figures_default.cross} Failed to ${action3}: ${errorMessage2(error40)}`);
|
|
@@ -736077,7 +736222,7 @@ async function pluginDoctorHandler(options4) {
|
|
|
736077
736222
|
const roots = [];
|
|
736078
736223
|
if (options4.path)
|
|
736079
736224
|
roots.push(resolve72(options4.path));
|
|
736080
|
-
roots.push(
|
|
736225
|
+
roots.push(join249(process.cwd(), ".ur", "plugins"));
|
|
736081
736226
|
try {
|
|
736082
736227
|
const data = loadInstalledPluginsV2();
|
|
736083
736228
|
for (const installations of Object.values(data.plugins ?? {})) {
|
|
@@ -736103,9 +736248,9 @@ async function pluginValidateHandler(manifestPath6, options4) {
|
|
|
736103
736248
|
printValidationResult(result);
|
|
736104
736249
|
let contentResults = [];
|
|
736105
736250
|
if (result.fileType === "plugin") {
|
|
736106
|
-
const manifestDir =
|
|
736251
|
+
const manifestDir = dirname93(result.filePath);
|
|
736107
736252
|
if (basename69(manifestDir) === ".ur-plugin") {
|
|
736108
|
-
contentResults = await validatePluginContents(
|
|
736253
|
+
contentResults = await validatePluginContents(dirname93(manifestDir));
|
|
736109
736254
|
for (const r of contentResults) {
|
|
736110
736255
|
console.log(`Validating ${r.fileType}: ${r.filePath}
|
|
736111
736256
|
`);
|
|
@@ -736584,12 +736729,12 @@ __export(exports_install, {
|
|
|
736584
736729
|
install: () => install
|
|
736585
736730
|
});
|
|
736586
736731
|
import { homedir as homedir44 } from "os";
|
|
736587
|
-
import { join as
|
|
736732
|
+
import { join as join250 } from "path";
|
|
736588
736733
|
function getInstallationPath2() {
|
|
736589
736734
|
const isWindows2 = env2.platform === "win32";
|
|
736590
736735
|
const homeDir = homedir44();
|
|
736591
736736
|
if (isWindows2) {
|
|
736592
|
-
const windowsPath =
|
|
736737
|
+
const windowsPath = join250(homeDir, ".local", "bin", "ur.exe");
|
|
736593
736738
|
return windowsPath.replace(/\//g, "\\");
|
|
736594
736739
|
}
|
|
736595
736740
|
return "~/.local/bin/ur";
|
|
@@ -737220,7 +737365,7 @@ async function update() {
|
|
|
737220
737365
|
logEvent("tengu_update_check", {});
|
|
737221
737366
|
const diagnostic2 = await getDoctorDiagnostic();
|
|
737222
737367
|
const result = await checkUpgradeStatus({
|
|
737223
|
-
currentVersion: "1.
|
|
737368
|
+
currentVersion: "1.58.0",
|
|
737224
737369
|
packageName: UR_AGENT_PACKAGE_NAME,
|
|
737225
737370
|
installationType: diagnostic2.installationType,
|
|
737226
737371
|
latestVersion: () => getLatestNpmPackageVersion(UR_AGENT_PACKAGE_NAME)
|
|
@@ -738536,7 +738681,7 @@ ${customInstructions}` : customInstructions;
|
|
|
738536
738681
|
}
|
|
738537
738682
|
}
|
|
738538
738683
|
logForDiagnosticsNoPII("info", "started", {
|
|
738539
|
-
version: "1.
|
|
738684
|
+
version: "1.58.0",
|
|
738540
738685
|
is_native_binary: isInBundledMode()
|
|
738541
738686
|
});
|
|
738542
738687
|
registerCleanup(async () => {
|
|
@@ -739322,7 +739467,7 @@ Usage: ur --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
739322
739467
|
pendingHookMessages
|
|
739323
739468
|
}, renderAndRun);
|
|
739324
739469
|
}
|
|
739325
|
-
}).version("1.
|
|
739470
|
+
}).version("1.58.0 (UR-Nexus)", "-v, --version", "Output the version number");
|
|
739326
739471
|
program2.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
|
|
739327
739472
|
program2.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
|
|
739328
739473
|
if (canUserConfigureAdvisor()) {
|
|
@@ -739758,8 +739903,9 @@ Usage: ur --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
739758
739903
|
const cmdArgs = [action3 ? quoteLocalCommandArg(action3) : undefined, name ? quoteLocalCommandArg(name) : undefined, ...args.map(quoteLocalCommandArg), opts.dryRun ? "--dry-run" : undefined, opts.maxTurns ? `--max-turns ${quoteLocalCommandArg(opts.maxTurns)}` : undefined, opts.skipPermissions ? "--skip-permissions" : undefined, opts.json ? "--json" : undefined].filter(Boolean).join(" ");
|
|
739759
739904
|
await runLocalTextCommand(() => Promise.resolve().then(() => (init_skill(), exports_skill)), cmdArgs);
|
|
739760
739905
|
});
|
|
739761
|
-
program2.command("agent-inspect").alias("inspect-agents").description("Reconstruct a per-subagent timeline from a session transcript").option("--file <path>", "Transcript JSONL or JSON file").option("--json", "Output as JSON").action(async (opts) => {
|
|
739762
|
-
const
|
|
739906
|
+
program2.command("agent-inspect").alias("inspect-agents").description("Reconstruct a per-subagent timeline from a session transcript").option("--file <path>", "Transcript JSONL or JSON file").option("--costs [dir]", "Per-agent token/cost breakdown from the session subagents directory").option("--json", "Output as JSON").action(async (opts) => {
|
|
739907
|
+
const costs = opts.costs === true ? "--costs" : typeof opts.costs === "string" ? `--costs ${quoteLocalCommandArg(opts.costs)}` : undefined;
|
|
739908
|
+
const args = [opts.file ? `--file ${quoteLocalCommandArg(opts.file)}` : undefined, costs, opts.json ? "--json" : undefined].filter(Boolean).join(" ");
|
|
739763
739909
|
await runLocalTextCommand(() => Promise.resolve().then(() => (init_agent_inspect(), exports_agent_inspect)), args);
|
|
739764
739910
|
});
|
|
739765
739911
|
program2.command("route [task...]").alias("intent").description("Classify a task and recommend the best subagent and collaboration pattern").option("--json", "Output as JSON").action(async (task2 = [], opts) => {
|
|
@@ -740357,7 +740503,7 @@ if (false) {}
|
|
|
740357
740503
|
async function main2() {
|
|
740358
740504
|
const args = process.argv.slice(2);
|
|
740359
740505
|
if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
|
|
740360
|
-
console.log(`${"1.
|
|
740506
|
+
console.log(`${"1.58.0"} (UR-Nexus)`);
|
|
740361
740507
|
return;
|
|
740362
740508
|
}
|
|
740363
740509
|
if (args[0] === "a2a" && args[1] === "serve" && !args.includes("--help") && !args.includes("-h")) {
|