ur-agent 1.49.0 → 1.50.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
|
@@ -75079,7 +75079,7 @@ var init_auth = __esm(() => {
|
|
|
75079
75079
|
|
|
75080
75080
|
// src/utils/userAgent.ts
|
|
75081
75081
|
function getURCodeUserAgent() {
|
|
75082
|
-
return `ur/${"1.
|
|
75082
|
+
return `ur/${"1.50.0"}`;
|
|
75083
75083
|
}
|
|
75084
75084
|
|
|
75085
75085
|
// src/utils/workloadContext.ts
|
|
@@ -75101,7 +75101,7 @@ function getUserAgent() {
|
|
|
75101
75101
|
const clientApp = process.env.UR_AGENT_SDK_CLIENT_APP ? `, client-app/${process.env.UR_AGENT_SDK_CLIENT_APP}` : "";
|
|
75102
75102
|
const workload = getWorkload();
|
|
75103
75103
|
const workloadSuffix = workload ? `, workload/${workload}` : "";
|
|
75104
|
-
return `ur-cli/${"1.
|
|
75104
|
+
return `ur-cli/${"1.50.0"} (${process.env.USER_TYPE}, ${process.env.UR_CODE_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
|
|
75105
75105
|
}
|
|
75106
75106
|
function getMCPUserAgent() {
|
|
75107
75107
|
const parts = [];
|
|
@@ -75115,7 +75115,7 @@ function getMCPUserAgent() {
|
|
|
75115
75115
|
parts.push(`client-app/${process.env.UR_AGENT_SDK_CLIENT_APP}`);
|
|
75116
75116
|
}
|
|
75117
75117
|
const suffix = parts.length > 0 ? ` (${parts.join(", ")})` : "";
|
|
75118
|
-
return `ur/${"1.
|
|
75118
|
+
return `ur/${"1.50.0"}${suffix}`;
|
|
75119
75119
|
}
|
|
75120
75120
|
function getWebFetchUserAgent() {
|
|
75121
75121
|
return `UR-User (${getURCodeUserAgent()})`;
|
|
@@ -75253,7 +75253,7 @@ var init_user = __esm(() => {
|
|
|
75253
75253
|
deviceId,
|
|
75254
75254
|
sessionId: getSessionId(),
|
|
75255
75255
|
email: getEmail(),
|
|
75256
|
-
appVersion: "1.
|
|
75256
|
+
appVersion: "1.50.0",
|
|
75257
75257
|
platform: getHostPlatformForAnalytics(),
|
|
75258
75258
|
organizationUuid,
|
|
75259
75259
|
accountUuid,
|
|
@@ -83453,7 +83453,7 @@ var init_metadata = __esm(() => {
|
|
|
83453
83453
|
COMPOUND_OPERATOR_REGEX = /\s*(?:&&|\|\||[;|])\s*/;
|
|
83454
83454
|
WHITESPACE_REGEX = /\s+/;
|
|
83455
83455
|
getVersionBase = memoize_default(() => {
|
|
83456
|
-
const match = "1.
|
|
83456
|
+
const match = "1.50.0".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
|
|
83457
83457
|
return match ? match[0] : undefined;
|
|
83458
83458
|
});
|
|
83459
83459
|
buildEnvContext = memoize_default(async () => {
|
|
@@ -83493,7 +83493,7 @@ var init_metadata = __esm(() => {
|
|
|
83493
83493
|
isGithubAction: isEnvTruthy(process.env.GITHUB_ACTIONS),
|
|
83494
83494
|
isURCodeAction: isEnvTruthy(process.env.UR_CODE_ACTION),
|
|
83495
83495
|
isURAiAuth: isURAISubscriber(),
|
|
83496
|
-
version: "1.
|
|
83496
|
+
version: "1.50.0",
|
|
83497
83497
|
versionBase: getVersionBase(),
|
|
83498
83498
|
buildTime: "",
|
|
83499
83499
|
deploymentEnvironment: env2.detectDeploymentEnvironment(),
|
|
@@ -84163,7 +84163,7 @@ function initialize1PEventLogging() {
|
|
|
84163
84163
|
const platform2 = getPlatform();
|
|
84164
84164
|
const attributes = {
|
|
84165
84165
|
[import_semantic_conventions4.ATTR_SERVICE_NAME]: "ur",
|
|
84166
|
-
[import_semantic_conventions4.ATTR_SERVICE_VERSION]: "1.
|
|
84166
|
+
[import_semantic_conventions4.ATTR_SERVICE_VERSION]: "1.50.0"
|
|
84167
84167
|
};
|
|
84168
84168
|
if (platform2 === "wsl") {
|
|
84169
84169
|
const wslVersion = getWslVersion();
|
|
@@ -84191,7 +84191,7 @@ function initialize1PEventLogging() {
|
|
|
84191
84191
|
})
|
|
84192
84192
|
]
|
|
84193
84193
|
});
|
|
84194
|
-
firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.urhq.ur.events", "1.
|
|
84194
|
+
firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.urhq.ur.events", "1.50.0");
|
|
84195
84195
|
}
|
|
84196
84196
|
async function reinitialize1PEventLoggingIfConfigChanged() {
|
|
84197
84197
|
if (!is1PEventLoggingEnabled() || !firstPartyEventLoggerProvider) {
|
|
@@ -94007,7 +94007,7 @@ function formatAgentTrendReport(report = buildAgentTrendReport()) {
|
|
|
94007
94007
|
function formatA2AAgentCard(options = {}, pretty = true) {
|
|
94008
94008
|
return JSON.stringify(buildA2AAgentCard(options), null, pretty ? 2 : 0);
|
|
94009
94009
|
}
|
|
94010
|
-
var urVersion = "1.
|
|
94010
|
+
var urVersion = "1.50.0", researchSnapshotDate = "2026-07-15", coverage, priorityRoadmap;
|
|
94011
94011
|
var init_trends = __esm(() => {
|
|
94012
94012
|
init_a2aCardSignature();
|
|
94013
94013
|
coverage = [
|
|
@@ -96808,7 +96808,7 @@ function getAttributionHeader(fingerprint) {
|
|
|
96808
96808
|
if (!isAttributionHeaderEnabled()) {
|
|
96809
96809
|
return "";
|
|
96810
96810
|
}
|
|
96811
|
-
const version2 = `${"1.
|
|
96811
|
+
const version2 = `${"1.50.0"}.${fingerprint}`;
|
|
96812
96812
|
const entrypoint = process.env.UR_CODE_ENTRYPOINT ?? "unknown";
|
|
96813
96813
|
const cch = "";
|
|
96814
96814
|
const workload = getWorkload();
|
|
@@ -154493,7 +154493,7 @@ var init_projectSafety = __esm(() => {
|
|
|
154493
154493
|
function getInstruments() {
|
|
154494
154494
|
if (instruments)
|
|
154495
154495
|
return instruments;
|
|
154496
|
-
const meter = import_api10.metrics.getMeter("ur-agent.gen_ai", "1.
|
|
154496
|
+
const meter = import_api10.metrics.getMeter("ur-agent.gen_ai", "1.50.0");
|
|
154497
154497
|
instruments = {
|
|
154498
154498
|
operationDuration: meter.createHistogram("gen_ai.client.operation.duration", {
|
|
154499
154499
|
description: "GenAI operation duration.",
|
|
@@ -154591,7 +154591,7 @@ function genAiAgentAttributes() {
|
|
|
154591
154591
|
"gen_ai.operation.name": GEN_AI_OPERATION_INVOKE_AGENT,
|
|
154592
154592
|
"gen_ai.provider.name": "ur",
|
|
154593
154593
|
"gen_ai.agent.name": "UR-Nexus",
|
|
154594
|
-
"gen_ai.agent.version": "1.
|
|
154594
|
+
"gen_ai.agent.version": "1.50.0"
|
|
154595
154595
|
};
|
|
154596
154596
|
}
|
|
154597
154597
|
function genAiWorkflowAttributes(workflowName) {
|
|
@@ -154607,7 +154607,7 @@ function genAiWorkflowAttributes(workflowName) {
|
|
|
154607
154607
|
function startGenAiWorkflowSpan(workflowName) {
|
|
154608
154608
|
const attributes = genAiWorkflowAttributes(workflowName);
|
|
154609
154609
|
const name = typeof attributes["gen_ai.workflow.name"] === "string" ? `invoke_workflow ${attributes["gen_ai.workflow.name"]}` : GEN_AI_OPERATION_INVOKE_WORKFLOW;
|
|
154610
|
-
return import_api10.trace.getTracer("ur-agent.gen_ai", "1.
|
|
154610
|
+
return import_api10.trace.getTracer("ur-agent.gen_ai", "1.50.0").startSpan(name, { kind: import_api10.SpanKind.INTERNAL, attributes });
|
|
154611
154611
|
}
|
|
154612
154612
|
function endGenAiWorkflowSpan(span, options2 = {}) {
|
|
154613
154613
|
try {
|
|
@@ -154645,7 +154645,7 @@ function startGenAiMemorySpan(operation, options2 = {}) {
|
|
|
154645
154645
|
if (options2.recordCount !== undefined && Number.isInteger(options2.recordCount) && options2.recordCount >= 0) {
|
|
154646
154646
|
attributes["gen_ai.memory.record.count"] = options2.recordCount;
|
|
154647
154647
|
}
|
|
154648
|
-
return import_api10.trace.getTracer("ur-agent.gen_ai", "1.
|
|
154648
|
+
return import_api10.trace.getTracer("ur-agent.gen_ai", "1.50.0").startSpan(operation, { kind: import_api10.SpanKind.INTERNAL, attributes });
|
|
154649
154649
|
}
|
|
154650
154650
|
function endGenAiMemorySpan(span, options2 = {}) {
|
|
154651
154651
|
try {
|
|
@@ -206164,7 +206164,7 @@ function getTelemetryAttributes() {
|
|
|
206164
206164
|
attributes["session.id"] = sessionId;
|
|
206165
206165
|
}
|
|
206166
206166
|
if (shouldIncludeAttribute("OTEL_METRICS_INCLUDE_VERSION")) {
|
|
206167
|
-
attributes["app.version"] = "1.
|
|
206167
|
+
attributes["app.version"] = "1.50.0";
|
|
206168
206168
|
}
|
|
206169
206169
|
const oauthAccount = getOauthAccountInfo();
|
|
206170
206170
|
if (oauthAccount) {
|
|
@@ -252415,7 +252415,7 @@ function getInstallationEnv() {
|
|
|
252415
252415
|
return;
|
|
252416
252416
|
}
|
|
252417
252417
|
function getURCodeVersion() {
|
|
252418
|
-
return "1.
|
|
252418
|
+
return "1.50.0";
|
|
252419
252419
|
}
|
|
252420
252420
|
async function getInstalledVSCodeExtensionVersion(command) {
|
|
252421
252421
|
const { stdout } = await execFileNoThrow(command, ["--list-extensions", "--show-versions"], {
|
|
@@ -259746,7 +259746,7 @@ async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) {
|
|
|
259746
259746
|
const client2 = new Client({
|
|
259747
259747
|
name: "ur",
|
|
259748
259748
|
title: "UR",
|
|
259749
|
-
version: "1.
|
|
259749
|
+
version: "1.50.0",
|
|
259750
259750
|
description: "UR-Nexus autonomous engineering workflow engine",
|
|
259751
259751
|
websiteUrl: PRODUCT_URL
|
|
259752
259752
|
}, {
|
|
@@ -260106,7 +260106,7 @@ var init_client5 = __esm(() => {
|
|
|
260106
260106
|
const client2 = new Client({
|
|
260107
260107
|
name: "ur",
|
|
260108
260108
|
title: "UR",
|
|
260109
|
-
version: "1.
|
|
260109
|
+
version: "1.50.0",
|
|
260110
260110
|
description: "UR-Nexus autonomous engineering workflow engine",
|
|
260111
260111
|
websiteUrl: PRODUCT_URL
|
|
260112
260112
|
}, {
|
|
@@ -272707,7 +272707,7 @@ async function createRuntime() {
|
|
|
272707
272707
|
bootstrapTelemetry();
|
|
272708
272708
|
const resource = defaultResource().merge(detectResources({ detectors: [envDetector] })).merge(resourceFromAttributes({
|
|
272709
272709
|
[import_semantic_conventions7.ATTR_SERVICE_NAME]: "ur-agent",
|
|
272710
|
-
[import_semantic_conventions7.ATTR_SERVICE_VERSION]: "1.
|
|
272710
|
+
[import_semantic_conventions7.ATTR_SERVICE_VERSION]: "1.50.0"
|
|
272711
272711
|
}));
|
|
272712
272712
|
const tracerProvider = exporters.traces.length > 0 ? new BasicTracerProvider({
|
|
272713
272713
|
resource,
|
|
@@ -272740,11 +272740,11 @@ async function createRuntime() {
|
|
|
272740
272740
|
setMeterProvider(meterProvider);
|
|
272741
272741
|
setLoggerProvider(loggerProvider);
|
|
272742
272742
|
if (meterProvider) {
|
|
272743
|
-
const meter = meterProvider.getMeter("ur-agent", "1.
|
|
272743
|
+
const meter = meterProvider.getMeter("ur-agent", "1.50.0");
|
|
272744
272744
|
setMeter(meter, (name, options2) => meter.createCounter(name, options2));
|
|
272745
272745
|
}
|
|
272746
272746
|
if (loggerProvider) {
|
|
272747
|
-
setEventLogger(loggerProvider.getLogger("ur-agent.events", "1.
|
|
272747
|
+
setEventLogger(loggerProvider.getLogger("ur-agent.events", "1.50.0"));
|
|
272748
272748
|
}
|
|
272749
272749
|
if (!cleanupRegistered2) {
|
|
272750
272750
|
cleanupRegistered2 = true;
|
|
@@ -273406,9 +273406,9 @@ async function assertMinVersion() {
|
|
|
273406
273406
|
if (false) {}
|
|
273407
273407
|
try {
|
|
273408
273408
|
const versionConfig = await getDynamicConfig_BLOCKS_ON_INIT("tengu_version_config", { minVersion: "0.0.0" });
|
|
273409
|
-
if (versionConfig.minVersion && lt("1.
|
|
273409
|
+
if (versionConfig.minVersion && lt("1.50.0", versionConfig.minVersion)) {
|
|
273410
273410
|
console.error(`
|
|
273411
|
-
It looks like your version of UR (${"1.
|
|
273411
|
+
It looks like your version of UR (${"1.50.0"}) needs an update.
|
|
273412
273412
|
A newer version (${versionConfig.minVersion} or higher) is required to continue.
|
|
273413
273413
|
|
|
273414
273414
|
To update, please run:
|
|
@@ -273624,7 +273624,7 @@ async function installGlobalPackage(specificVersion) {
|
|
|
273624
273624
|
logError2(new AutoUpdaterError("Another process is currently installing an update"));
|
|
273625
273625
|
logEvent("tengu_auto_updater_lock_contention", {
|
|
273626
273626
|
pid: process.pid,
|
|
273627
|
-
currentVersion: "1.
|
|
273627
|
+
currentVersion: "1.50.0"
|
|
273628
273628
|
});
|
|
273629
273629
|
return "in_progress";
|
|
273630
273630
|
}
|
|
@@ -273633,7 +273633,7 @@ async function installGlobalPackage(specificVersion) {
|
|
|
273633
273633
|
if (!env2.isRunningWithBun() && env2.isNpmFromWindowsPath()) {
|
|
273634
273634
|
logError2(new Error("Windows NPM detected in WSL environment"));
|
|
273635
273635
|
logEvent("tengu_auto_updater_windows_npm_in_wsl", {
|
|
273636
|
-
currentVersion: "1.
|
|
273636
|
+
currentVersion: "1.50.0"
|
|
273637
273637
|
});
|
|
273638
273638
|
console.error(`
|
|
273639
273639
|
Error: Windows NPM detected in WSL
|
|
@@ -274168,7 +274168,7 @@ function detectLinuxGlobPatternWarnings() {
|
|
|
274168
274168
|
}
|
|
274169
274169
|
async function getDoctorDiagnostic() {
|
|
274170
274170
|
const installationType = await getCurrentInstallationType();
|
|
274171
|
-
const version2 = typeof MACRO !== "undefined" ? "1.
|
|
274171
|
+
const version2 = typeof MACRO !== "undefined" ? "1.50.0" : "unknown";
|
|
274172
274172
|
const installationPath = await getInstallationPath();
|
|
274173
274173
|
const invokedBinary = getInvokedBinary();
|
|
274174
274174
|
const multipleInstallations = await detectMultipleInstallations();
|
|
@@ -275103,8 +275103,8 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
|
|
|
275103
275103
|
const maxVersion = await getMaxVersion();
|
|
275104
275104
|
if (maxVersion && gt(version2, maxVersion)) {
|
|
275105
275105
|
logForDebugging(`Native installer: maxVersion ${maxVersion} is set, capping update from ${version2} to ${maxVersion}`);
|
|
275106
|
-
if (gte("1.
|
|
275107
|
-
logForDebugging(`Native installer: current version ${"1.
|
|
275106
|
+
if (gte("1.50.0", maxVersion)) {
|
|
275107
|
+
logForDebugging(`Native installer: current version ${"1.50.0"} is already at or above maxVersion ${maxVersion}, skipping update`);
|
|
275108
275108
|
logEvent("tengu_native_update_skipped_max_version", {
|
|
275109
275109
|
latency_ms: Date.now() - startTime,
|
|
275110
275110
|
max_version: maxVersion,
|
|
@@ -275115,7 +275115,7 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
|
|
|
275115
275115
|
version2 = maxVersion;
|
|
275116
275116
|
}
|
|
275117
275117
|
}
|
|
275118
|
-
if (!forceReinstall && version2 === "1.
|
|
275118
|
+
if (!forceReinstall && version2 === "1.50.0" && await versionIsAvailable(version2) && await isPossibleURBinary(executablePath)) {
|
|
275119
275119
|
logForDebugging(`Found ${version2} at ${executablePath}, skipping install`);
|
|
275120
275120
|
logEvent("tengu_native_update_complete", {
|
|
275121
275121
|
latency_ms: Date.now() - startTime,
|
|
@@ -344908,7 +344908,7 @@ function isAnyTracingEnabled() {
|
|
|
344908
344908
|
return isTelemetryEnabled() || isEnhancedTelemetryEnabled() || isBetaTracingEnabled();
|
|
344909
344909
|
}
|
|
344910
344910
|
function getTracer() {
|
|
344911
|
-
return import_api39.trace.getTracer("ur-agent.gen_ai", "1.
|
|
344911
|
+
return import_api39.trace.getTracer("ur-agent.gen_ai", "1.50.0");
|
|
344912
344912
|
}
|
|
344913
344913
|
function createSpanAttributes(spanType, customAttributes = {}) {
|
|
344914
344914
|
const baseAttributes = getTelemetryAttributes();
|
|
@@ -374002,7 +374002,7 @@ function Feedback({
|
|
|
374002
374002
|
platform: env2.platform,
|
|
374003
374003
|
gitRepo: envInfo.isGit,
|
|
374004
374004
|
terminal: env2.terminal,
|
|
374005
|
-
version: "1.
|
|
374005
|
+
version: "1.50.0",
|
|
374006
374006
|
transcript: normalizeMessagesForAPI(messages),
|
|
374007
374007
|
errors: sanitizedErrors,
|
|
374008
374008
|
lastApiRequest: getLastAPIRequest(),
|
|
@@ -374194,7 +374194,7 @@ function Feedback({
|
|
|
374194
374194
|
", ",
|
|
374195
374195
|
env2.terminal,
|
|
374196
374196
|
", v",
|
|
374197
|
-
"1.
|
|
374197
|
+
"1.50.0"
|
|
374198
374198
|
]
|
|
374199
374199
|
}, undefined, true, undefined, this)
|
|
374200
374200
|
]
|
|
@@ -374300,7 +374300,7 @@ ${sanitizedDescription}
|
|
|
374300
374300
|
` + `**Environment Info**
|
|
374301
374301
|
` + `- Platform: ${env2.platform}
|
|
374302
374302
|
` + `- Terminal: ${env2.terminal}
|
|
374303
|
-
` + `- Version: ${"1.
|
|
374303
|
+
` + `- Version: ${"1.50.0"}
|
|
374304
374304
|
` + `- Feedback ID: ${feedbackId}
|
|
374305
374305
|
` + `
|
|
374306
374306
|
**Errors**
|
|
@@ -377411,7 +377411,7 @@ function buildPrimarySection() {
|
|
|
377411
377411
|
}, undefined, false, undefined, this);
|
|
377412
377412
|
return [{
|
|
377413
377413
|
label: "Version",
|
|
377414
|
-
value: "1.
|
|
377414
|
+
value: "1.50.0"
|
|
377415
377415
|
}, {
|
|
377416
377416
|
label: "Session name",
|
|
377417
377417
|
value: nameValue
|
|
@@ -380741,7 +380741,7 @@ function Config({
|
|
|
380741
380741
|
}
|
|
380742
380742
|
}, undefined, false, undefined, this)
|
|
380743
380743
|
}, undefined, false, undefined, this) : showSubmenu === "ChannelDowngrade" ? /* @__PURE__ */ jsx_dev_runtime178.jsxDEV(ChannelDowngradeDialog, {
|
|
380744
|
-
currentVersion: "1.
|
|
380744
|
+
currentVersion: "1.50.0",
|
|
380745
380745
|
onChoice: (choice) => {
|
|
380746
380746
|
setShowSubmenu(null);
|
|
380747
380747
|
setTabsHidden(false);
|
|
@@ -380753,7 +380753,7 @@ function Config({
|
|
|
380753
380753
|
autoUpdatesChannel: "stable"
|
|
380754
380754
|
};
|
|
380755
380755
|
if (choice === "stay") {
|
|
380756
|
-
newSettings.minimumVersion = "1.
|
|
380756
|
+
newSettings.minimumVersion = "1.50.0";
|
|
380757
380757
|
}
|
|
380758
380758
|
updateSettingsForSource("userSettings", newSettings);
|
|
380759
380759
|
setSettingsData((prev_27) => ({
|
|
@@ -388823,7 +388823,7 @@ function HelpV2(t0) {
|
|
|
388823
388823
|
let t6;
|
|
388824
388824
|
if ($2[31] !== tabs) {
|
|
388825
388825
|
t6 = /* @__PURE__ */ jsx_dev_runtime205.jsxDEV(Tabs, {
|
|
388826
|
-
title: `UR v${"1.
|
|
388826
|
+
title: `UR v${"1.50.0"}`,
|
|
388827
388827
|
color: "professionalBlue",
|
|
388828
388828
|
defaultTab: "general",
|
|
388829
388829
|
children: tabs
|
|
@@ -389740,7 +389740,7 @@ function buildToolUseContext(tools, readFileStateCache, toolPermissionContext, a
|
|
|
389740
389740
|
async function handleInitialize(options2) {
|
|
389741
389741
|
return {
|
|
389742
389742
|
name: "UR",
|
|
389743
|
-
version: "1.
|
|
389743
|
+
version: "1.50.0",
|
|
389744
389744
|
protocolVersion: "0.1.0",
|
|
389745
389745
|
workspaceRoot: options2.cwd,
|
|
389746
389746
|
capabilities: {
|
|
@@ -392463,6 +392463,49 @@ function stringArray2(value) {
|
|
|
392463
392463
|
function isAssociation(value) {
|
|
392464
392464
|
return TRUSTED_GITHUB_ASSOCIATIONS.includes(value);
|
|
392465
392465
|
}
|
|
392466
|
+
function isTriggerEvent(value) {
|
|
392467
|
+
return AGENTIC_CI_TRIGGER_EVENTS.includes(value);
|
|
392468
|
+
}
|
|
392469
|
+
function triggerKeywords(spec) {
|
|
392470
|
+
const config3 = spec.trigger?.issueComment;
|
|
392471
|
+
const keyword = config3?.keyword?.trim() || AGENTIC_CI_DEFAULT_KEYWORD;
|
|
392472
|
+
const aliases = config3?.aliases ?? [...AGENTIC_CI_DEFAULT_ALIASES];
|
|
392473
|
+
const unique = [];
|
|
392474
|
+
for (const candidate of [keyword, ...aliases]) {
|
|
392475
|
+
const trimmed = candidate?.trim();
|
|
392476
|
+
if (!trimmed)
|
|
392477
|
+
continue;
|
|
392478
|
+
if (!unique.some((item) => item.toLowerCase() === trimmed.toLowerCase())) {
|
|
392479
|
+
unique.push(trimmed);
|
|
392480
|
+
}
|
|
392481
|
+
}
|
|
392482
|
+
return unique.sort((a2, b) => b.length - a2.length);
|
|
392483
|
+
}
|
|
392484
|
+
function triggerEvents(spec) {
|
|
392485
|
+
const configured = spec.trigger?.issueComment?.events;
|
|
392486
|
+
return configured?.length ? configured.filter(isTriggerEvent) : [...AGENTIC_CI_TRIGGER_EVENTS];
|
|
392487
|
+
}
|
|
392488
|
+
function findTriggerMention(body, keywords) {
|
|
392489
|
+
const scannable = stripQuotedAndFenced(body);
|
|
392490
|
+
for (const keyword of keywords) {
|
|
392491
|
+
const pattern = new RegExp(`(^|[^\\w@/#-])${escapeRegExp3(keyword)}(?![\\w@/-])`, "i");
|
|
392492
|
+
const match = pattern.exec(scannable);
|
|
392493
|
+
if (!match)
|
|
392494
|
+
continue;
|
|
392495
|
+
const start = match.index + (match[1]?.length ?? 0) + keyword.length;
|
|
392496
|
+
return { keyword, prompt: scannable.slice(start).trim() };
|
|
392497
|
+
}
|
|
392498
|
+
return;
|
|
392499
|
+
}
|
|
392500
|
+
function escapeRegExp3(value) {
|
|
392501
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
392502
|
+
}
|
|
392503
|
+
function stripQuotedAndFenced(body) {
|
|
392504
|
+
const withoutFences = body.replace(/```[\s\S]*?```/g, " ").replace(/~~~[\s\S]*?~~~/g, " ").replace(/`[^`\n]*`/g, " ");
|
|
392505
|
+
return withoutFences.split(`
|
|
392506
|
+
`).filter((line) => !/^\s*>/.test(line)).join(`
|
|
392507
|
+
`);
|
|
392508
|
+
}
|
|
392466
392509
|
function validateAgenticCiSpec(spec) {
|
|
392467
392510
|
const errors4 = [];
|
|
392468
392511
|
const warnings = [];
|
|
@@ -392484,11 +392527,26 @@ function validateAgenticCiSpec(spec) {
|
|
|
392484
392527
|
errors4.push("runner.timeoutMinutes must be an integer between 1 and 120");
|
|
392485
392528
|
}
|
|
392486
392529
|
const issue2 = spec.trigger?.issueComment;
|
|
392487
|
-
if (issue2?.keyword !== undefined) {
|
|
392488
|
-
|
|
392489
|
-
|
|
392530
|
+
if (issue2?.keyword !== undefined && !KEYWORD_RE.test(issue2.keyword)) {
|
|
392531
|
+
errors4.push("trigger.issueComment.keyword is invalid");
|
|
392532
|
+
}
|
|
392533
|
+
for (const alias of issue2?.aliases ?? []) {
|
|
392534
|
+
if (!KEYWORD_RE.test(alias)) {
|
|
392535
|
+
errors4.push(`trigger.issueComment.aliases contains "${alias}"`);
|
|
392490
392536
|
}
|
|
392491
392537
|
}
|
|
392538
|
+
for (const event of issue2?.events ?? []) {
|
|
392539
|
+
if (!isTriggerEvent(event)) {
|
|
392540
|
+
errors4.push(`trigger.issueComment.events contains "${event}"`);
|
|
392541
|
+
}
|
|
392542
|
+
}
|
|
392543
|
+
const publishMode = spec.publish?.mode;
|
|
392544
|
+
if (publishMode !== undefined && !AGENTIC_CI_PUBLISH_MODES.includes(publishMode)) {
|
|
392545
|
+
errors4.push(`publish.mode must be one of ${AGENTIC_CI_PUBLISH_MODES.join(", ")}`);
|
|
392546
|
+
}
|
|
392547
|
+
if (publishMode === "pull-request") {
|
|
392548
|
+
warnings.push('publish.mode "pull-request" grants the publisher job contents:write');
|
|
392549
|
+
}
|
|
392492
392550
|
for (const association of issue2?.allowedAssociations ?? []) {
|
|
392493
392551
|
if (!isAssociation(association)) {
|
|
392494
392552
|
errors4.push(`trigger.issueComment.allowedAssociations contains "${association}"`);
|
|
@@ -392549,6 +392607,7 @@ function parseAgenticCiSpec(text) {
|
|
|
392549
392607
|
const workspace = value.workspace ?? {};
|
|
392550
392608
|
const verification = value.verification ?? {};
|
|
392551
392609
|
const outputs = value.outputs ?? {};
|
|
392610
|
+
const publish = value.publish ?? {};
|
|
392552
392611
|
const commands = Array.isArray(verification.commands) ? verification.commands.map((item) => {
|
|
392553
392612
|
const command5 = item && typeof item === "object" ? item : {};
|
|
392554
392613
|
return {
|
|
@@ -392566,7 +392625,9 @@ function parseAgenticCiSpec(text) {
|
|
|
392566
392625
|
manual: trigger.manual === true,
|
|
392567
392626
|
issueComment: issue2 ? {
|
|
392568
392627
|
keyword: typeof issue2.keyword === "string" ? issue2.keyword : undefined,
|
|
392569
|
-
|
|
392628
|
+
aliases: Array.isArray(issue2.aliases) ? stringArray2(issue2.aliases) : undefined,
|
|
392629
|
+
allowedAssociations: stringArray2(issue2.allowedAssociations),
|
|
392630
|
+
events: Array.isArray(issue2.events) ? stringArray2(issue2.events) : undefined
|
|
392570
392631
|
} : undefined
|
|
392571
392632
|
},
|
|
392572
392633
|
runner: {
|
|
@@ -392587,7 +392648,9 @@ function parseAgenticCiSpec(text) {
|
|
|
392587
392648
|
maxSummaryChars: typeof outputs.maxSummaryChars === "number" ? outputs.maxSummaryChars : undefined,
|
|
392588
392649
|
maxPatchBytes: typeof outputs.maxPatchBytes === "number" ? outputs.maxPatchBytes : undefined
|
|
392589
392650
|
},
|
|
392590
|
-
publish: {
|
|
392651
|
+
publish: {
|
|
392652
|
+
mode: typeof publish.mode === "string" ? publish.mode : "comment"
|
|
392653
|
+
}
|
|
392591
392654
|
};
|
|
392592
392655
|
const validation = validateAgenticCiSpec(spec);
|
|
392593
392656
|
if (!validation.valid) {
|
|
@@ -392618,89 +392681,179 @@ function decideAgenticCiEvent(spec, payload, explicitEventName) {
|
|
|
392618
392681
|
reason: "manual trigger is disabled"
|
|
392619
392682
|
};
|
|
392620
392683
|
}
|
|
392621
|
-
const
|
|
392684
|
+
const prompt2 = boundedPrompt(asRecord(root2.inputs).prompt) ?? boundedPrompt(asRecord(root2.workflow_dispatch).prompt);
|
|
392622
392685
|
return {
|
|
392623
392686
|
accepted: true,
|
|
392624
392687
|
source: "manual",
|
|
392625
392688
|
reason: "trusted manual dispatch",
|
|
392626
|
-
prompt
|
|
392689
|
+
prompt: prompt2
|
|
392627
392690
|
};
|
|
392628
392691
|
}
|
|
392629
|
-
|
|
392630
|
-
|
|
392631
|
-
if (!config3) {
|
|
392632
|
-
return {
|
|
392633
|
-
accepted: false,
|
|
392634
|
-
source: "issue_comment",
|
|
392635
|
-
reason: "issue-comment trigger is disabled"
|
|
392636
|
-
};
|
|
392637
|
-
}
|
|
392638
|
-
if (typeof root2.action === "string" && root2.action !== "created") {
|
|
392639
|
-
return {
|
|
392640
|
-
accepted: false,
|
|
392641
|
-
source: "issue_comment",
|
|
392642
|
-
reason: `unsupported issue_comment action "${root2.action}"`
|
|
392643
|
-
};
|
|
392644
|
-
}
|
|
392645
|
-
const comment = asRecord(root2.comment);
|
|
392646
|
-
const actor = typeof asRecord(comment.user).login === "string" ? String(asRecord(comment.user).login) : undefined;
|
|
392647
|
-
const association = typeof comment.author_association === "string" ? comment.author_association.toUpperCase() : "";
|
|
392648
|
-
const allowed = config3.allowedAssociations?.length ? config3.allowedAssociations : [...TRUSTED_GITHUB_ASSOCIATIONS];
|
|
392649
|
-
if (!allowed.includes(association)) {
|
|
392650
|
-
return {
|
|
392651
|
-
accepted: false,
|
|
392652
|
-
source: "issue_comment",
|
|
392653
|
-
reason: `actor association "${association || "NONE"}" is not allowed`,
|
|
392654
|
-
actor,
|
|
392655
|
-
association
|
|
392656
|
-
};
|
|
392657
|
-
}
|
|
392658
|
-
const body = boundedPrompt(comment.body);
|
|
392659
|
-
const keyword = config3.keyword?.trim() || "/ur";
|
|
392660
|
-
if (!body) {
|
|
392661
|
-
return {
|
|
392662
|
-
accepted: false,
|
|
392663
|
-
source: "issue_comment",
|
|
392664
|
-
reason: "comment body is empty or too large",
|
|
392665
|
-
actor,
|
|
392666
|
-
association
|
|
392667
|
-
};
|
|
392668
|
-
}
|
|
392669
|
-
const index2 = body.toLowerCase().indexOf(keyword.toLowerCase());
|
|
392670
|
-
if (index2 < 0) {
|
|
392671
|
-
return {
|
|
392672
|
-
accepted: false,
|
|
392673
|
-
source: "issue_comment",
|
|
392674
|
-
reason: `comment does not contain "${keyword}"`,
|
|
392675
|
-
actor,
|
|
392676
|
-
association
|
|
392677
|
-
};
|
|
392678
|
-
}
|
|
392679
|
-
const prompt = boundedPrompt(body.slice(index2 + keyword.length));
|
|
392680
|
-
if (!prompt) {
|
|
392681
|
-
return {
|
|
392682
|
-
accepted: false,
|
|
392683
|
-
source: "issue_comment",
|
|
392684
|
-
reason: "trigger contains no bounded task text",
|
|
392685
|
-
actor,
|
|
392686
|
-
association
|
|
392687
|
-
};
|
|
392688
|
-
}
|
|
392692
|
+
const mention = normalizeMentionEvent(root2, eventName);
|
|
392693
|
+
if (!mention) {
|
|
392689
392694
|
return {
|
|
392690
|
-
accepted:
|
|
392691
|
-
source: "
|
|
392692
|
-
reason: "
|
|
392695
|
+
accepted: false,
|
|
392696
|
+
source: "none",
|
|
392697
|
+
reason: "event type is not enabled"
|
|
392698
|
+
};
|
|
392699
|
+
}
|
|
392700
|
+
const { source } = mention;
|
|
392701
|
+
const config3 = spec.trigger?.issueComment;
|
|
392702
|
+
if (!config3) {
|
|
392703
|
+
return { accepted: false, source, reason: "mention trigger is disabled" };
|
|
392704
|
+
}
|
|
392705
|
+
if (!triggerEvents(spec).includes(source)) {
|
|
392706
|
+
return {
|
|
392707
|
+
accepted: false,
|
|
392708
|
+
source,
|
|
392709
|
+
reason: `event "${source}" is not enabled for this spec`
|
|
392710
|
+
};
|
|
392711
|
+
}
|
|
392712
|
+
if (mention.action && !mention.acceptedActions.includes(mention.action)) {
|
|
392713
|
+
return {
|
|
392714
|
+
accepted: false,
|
|
392715
|
+
source,
|
|
392716
|
+
reason: `unsupported ${source} action "${mention.action}"`
|
|
392717
|
+
};
|
|
392718
|
+
}
|
|
392719
|
+
const { actor, association, issueNumber, commentId, isPullRequest } = mention;
|
|
392720
|
+
const allowed = config3.allowedAssociations?.length ? config3.allowedAssociations : [...TRUSTED_GITHUB_ASSOCIATIONS];
|
|
392721
|
+
if (!allowed.includes(association)) {
|
|
392722
|
+
return {
|
|
392723
|
+
accepted: false,
|
|
392724
|
+
source,
|
|
392725
|
+
reason: `actor association "${association || "NONE"}" is not allowed`,
|
|
392693
392726
|
actor,
|
|
392694
392727
|
association,
|
|
392695
|
-
|
|
392728
|
+
issueNumber,
|
|
392729
|
+
commentId,
|
|
392730
|
+
isPullRequest
|
|
392731
|
+
};
|
|
392732
|
+
}
|
|
392733
|
+
const body = boundedPrompt(mention.body);
|
|
392734
|
+
if (!body) {
|
|
392735
|
+
return {
|
|
392736
|
+
accepted: false,
|
|
392737
|
+
source,
|
|
392738
|
+
reason: "comment body is empty or too large",
|
|
392739
|
+
actor,
|
|
392740
|
+
association,
|
|
392741
|
+
issueNumber,
|
|
392742
|
+
commentId,
|
|
392743
|
+
isPullRequest
|
|
392744
|
+
};
|
|
392745
|
+
}
|
|
392746
|
+
const keywords = triggerKeywords(spec);
|
|
392747
|
+
const match = findTriggerMention(body, keywords);
|
|
392748
|
+
if (!match) {
|
|
392749
|
+
return {
|
|
392750
|
+
accepted: false,
|
|
392751
|
+
source,
|
|
392752
|
+
reason: `comment does not mention ${keywords.map((k2) => `"${k2}"`).join(" or ")}`,
|
|
392753
|
+
actor,
|
|
392754
|
+
association,
|
|
392755
|
+
issueNumber,
|
|
392756
|
+
commentId,
|
|
392757
|
+
isPullRequest
|
|
392758
|
+
};
|
|
392759
|
+
}
|
|
392760
|
+
const prompt = boundedPrompt(match.prompt);
|
|
392761
|
+
if (!prompt) {
|
|
392762
|
+
return {
|
|
392763
|
+
accepted: false,
|
|
392764
|
+
source,
|
|
392765
|
+
reason: "trigger contains no bounded task text",
|
|
392766
|
+
actor,
|
|
392767
|
+
association,
|
|
392768
|
+
issueNumber,
|
|
392769
|
+
commentId,
|
|
392770
|
+
isPullRequest
|
|
392696
392771
|
};
|
|
392697
392772
|
}
|
|
392698
392773
|
return {
|
|
392699
|
-
accepted:
|
|
392700
|
-
source
|
|
392701
|
-
reason:
|
|
392774
|
+
accepted: true,
|
|
392775
|
+
source,
|
|
392776
|
+
reason: `trusted actor mentioned "${match.keyword}"`,
|
|
392777
|
+
actor,
|
|
392778
|
+
association,
|
|
392779
|
+
prompt,
|
|
392780
|
+
issueNumber,
|
|
392781
|
+
commentId,
|
|
392782
|
+
isPullRequest
|
|
392702
392783
|
};
|
|
392703
392784
|
}
|
|
392785
|
+
function login(value) {
|
|
392786
|
+
const candidate = asRecord(value).login;
|
|
392787
|
+
return typeof candidate === "string" ? candidate : undefined;
|
|
392788
|
+
}
|
|
392789
|
+
function association(value) {
|
|
392790
|
+
const candidate = asRecord(value).author_association;
|
|
392791
|
+
return typeof candidate === "string" ? candidate.toUpperCase() : "";
|
|
392792
|
+
}
|
|
392793
|
+
function numeric(value) {
|
|
392794
|
+
return typeof value === "number" && Number.isFinite(value) ? value : undefined;
|
|
392795
|
+
}
|
|
392796
|
+
function normalizeMentionEvent(root2, eventName) {
|
|
392797
|
+
const action3 = typeof root2.action === "string" ? root2.action : undefined;
|
|
392798
|
+
const issue2 = asRecord(root2.issue);
|
|
392799
|
+
const pull = asRecord(root2.pull_request);
|
|
392800
|
+
const comment = asRecord(root2.comment);
|
|
392801
|
+
const review = asRecord(root2.review);
|
|
392802
|
+
if (eventName === "pull_request_review_comment") {
|
|
392803
|
+
return {
|
|
392804
|
+
source: "pull_request_review_comment",
|
|
392805
|
+
acceptedActions: ["created"],
|
|
392806
|
+
action: action3,
|
|
392807
|
+
body: comment.body,
|
|
392808
|
+
actor: login(comment.user),
|
|
392809
|
+
association: association(comment),
|
|
392810
|
+
issueNumber: numeric(pull.number),
|
|
392811
|
+
commentId: numeric(comment.id),
|
|
392812
|
+
isPullRequest: true
|
|
392813
|
+
};
|
|
392814
|
+
}
|
|
392815
|
+
if (eventName === "pull_request_review") {
|
|
392816
|
+
return {
|
|
392817
|
+
source: "pull_request_review",
|
|
392818
|
+
acceptedActions: ["submitted", "edited"],
|
|
392819
|
+
action: action3,
|
|
392820
|
+
body: review.body,
|
|
392821
|
+
actor: login(review.user),
|
|
392822
|
+
association: association(review),
|
|
392823
|
+
issueNumber: numeric(pull.number),
|
|
392824
|
+
commentId: numeric(review.id),
|
|
392825
|
+
isPullRequest: true
|
|
392826
|
+
};
|
|
392827
|
+
}
|
|
392828
|
+
if (eventName === "issues") {
|
|
392829
|
+
return {
|
|
392830
|
+
source: "issues",
|
|
392831
|
+
acceptedActions: ["opened", "edited", "assigned", "labeled"],
|
|
392832
|
+
action: action3,
|
|
392833
|
+
body: [issue2.title, issue2.body].filter((part) => typeof part === "string").join(`
|
|
392834
|
+
|
|
392835
|
+
`),
|
|
392836
|
+
actor: login(issue2.user),
|
|
392837
|
+
association: association(issue2),
|
|
392838
|
+
issueNumber: numeric(issue2.number),
|
|
392839
|
+
isPullRequest: false
|
|
392840
|
+
};
|
|
392841
|
+
}
|
|
392842
|
+
if (eventName === "issue_comment" || root2.comment !== undefined) {
|
|
392843
|
+
return {
|
|
392844
|
+
source: "issue_comment",
|
|
392845
|
+
acceptedActions: ["created"],
|
|
392846
|
+
action: action3,
|
|
392847
|
+
body: comment.body,
|
|
392848
|
+
actor: login(comment.user),
|
|
392849
|
+
association: association(comment),
|
|
392850
|
+
issueNumber: numeric(issue2.number),
|
|
392851
|
+
commentId: numeric(comment.id),
|
|
392852
|
+
isPullRequest: issue2.pull_request !== undefined
|
|
392853
|
+
};
|
|
392854
|
+
}
|
|
392855
|
+
return;
|
|
392856
|
+
}
|
|
392704
392857
|
function loadAgenticCiEventFile(path17) {
|
|
392705
392858
|
const bytes = readFileSync33(path17);
|
|
392706
392859
|
if (bytes.byteLength > AGENTIC_CI_MAX_EVENT_BYTES) {
|
|
@@ -392945,6 +393098,7 @@ async function runAgenticCi(options2) {
|
|
|
392945
393098
|
const runId = `${Date.now().toString(36)}-${randomUUID44().slice(0, 8)}`;
|
|
392946
393099
|
const manifestPath5 = manifestPathFor(outputRoot, runId);
|
|
392947
393100
|
const eventDecision = options2.event !== undefined ? decideAgenticCiEvent(options2.spec, options2.event, options2.eventName) : undefined;
|
|
393101
|
+
const publishContract = buildPublishContract(options2.spec, eventDecision);
|
|
392948
393102
|
if (eventDecision && !eventDecision.accepted) {
|
|
392949
393103
|
const blocked = {
|
|
392950
393104
|
version: 1,
|
|
@@ -392954,7 +393108,8 @@ async function runAgenticCi(options2) {
|
|
|
392954
393108
|
summary: eventDecision.reason,
|
|
392955
393109
|
checks: [],
|
|
392956
393110
|
violations: [eventDecision.reason],
|
|
392957
|
-
manifestPath: manifestPath5
|
|
393111
|
+
manifestPath: manifestPath5,
|
|
393112
|
+
publish: publishContract
|
|
392958
393113
|
};
|
|
392959
393114
|
writeAgenticCiResult(blocked);
|
|
392960
393115
|
return blocked;
|
|
@@ -392976,7 +393131,8 @@ async function runAgenticCi(options2) {
|
|
|
392976
393131
|
summary: "Dry run: validated spec and event; no worktree or model was started.",
|
|
392977
393132
|
checks: [],
|
|
392978
393133
|
violations: [],
|
|
392979
|
-
manifestPath: manifestPath5
|
|
393134
|
+
manifestPath: manifestPath5,
|
|
393135
|
+
publish: publishContract
|
|
392980
393136
|
};
|
|
392981
393137
|
writeAgenticCiResult(dry);
|
|
392982
393138
|
rmSync9(verificationHome, { recursive: true, force: true });
|
|
@@ -393144,11 +393300,25 @@ async function runAgenticCi(options2) {
|
|
|
393144
393300
|
patch,
|
|
393145
393301
|
checks: checks4,
|
|
393146
393302
|
violations,
|
|
393147
|
-
manifestPath: manifestPath5
|
|
393303
|
+
manifestPath: manifestPath5,
|
|
393304
|
+
publish: publishContract
|
|
393148
393305
|
};
|
|
393149
393306
|
writeAgenticCiResult(result);
|
|
393150
393307
|
return result;
|
|
393151
393308
|
}
|
|
393309
|
+
function buildPublishContract(spec, decision) {
|
|
393310
|
+
const mode = spec.publish?.mode ?? "comment";
|
|
393311
|
+
if (mode === "artifact")
|
|
393312
|
+
return;
|
|
393313
|
+
return {
|
|
393314
|
+
mode,
|
|
393315
|
+
source: decision?.source ?? "manual",
|
|
393316
|
+
actor: decision?.actor,
|
|
393317
|
+
issueNumber: decision?.issueNumber,
|
|
393318
|
+
commentId: decision?.commentId,
|
|
393319
|
+
isPullRequest: decision?.isPullRequest ?? false
|
|
393320
|
+
};
|
|
393321
|
+
}
|
|
393152
393322
|
function defaultAgenticCiSpec(name = "default") {
|
|
393153
393323
|
return {
|
|
393154
393324
|
version: 1,
|
|
@@ -393157,8 +393327,10 @@ function defaultAgenticCiSpec(name = "default") {
|
|
|
393157
393327
|
trigger: {
|
|
393158
393328
|
manual: true,
|
|
393159
393329
|
issueComment: {
|
|
393160
|
-
keyword:
|
|
393161
|
-
|
|
393330
|
+
keyword: AGENTIC_CI_DEFAULT_KEYWORD,
|
|
393331
|
+
aliases: [...AGENTIC_CI_DEFAULT_ALIASES],
|
|
393332
|
+
allowedAssociations: [...TRUSTED_GITHUB_ASSOCIATIONS],
|
|
393333
|
+
events: [...AGENTIC_CI_TRIGGER_EVENTS]
|
|
393162
393334
|
}
|
|
393163
393335
|
},
|
|
393164
393336
|
runner: { maxTurns: 20, timeoutMinutes: 30 },
|
|
@@ -393182,7 +393354,7 @@ function defaultAgenticCiSpec(name = "default") {
|
|
|
393182
393354
|
maxSummaryChars: AGENTIC_CI_MAX_SUMMARY_CHARS,
|
|
393183
393355
|
maxPatchBytes: AGENTIC_CI_MAX_PATCH_BYTES
|
|
393184
393356
|
},
|
|
393185
|
-
publish: { mode: "
|
|
393357
|
+
publish: { mode: "comment" }
|
|
393186
393358
|
};
|
|
393187
393359
|
}
|
|
393188
393360
|
function agenticCiDir(cwd2) {
|
|
@@ -393220,56 +393392,127 @@ function compileAgenticCiWorkflow(specName = "default", options2 = {}) {
|
|
|
393220
393392
|
if (spec.name !== specName) {
|
|
393221
393393
|
throw new Error("Agentic CI workflow spec name does not match");
|
|
393222
393394
|
}
|
|
393223
|
-
const packageVersion = options2.packageVersion ?? (typeof MACRO !== "undefined" ? "1.
|
|
393395
|
+
const packageVersion = options2.packageVersion ?? (typeof MACRO !== "undefined" ? "1.50.0" : "1.50.0");
|
|
393224
393396
|
if (!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(packageVersion)) {
|
|
393225
393397
|
throw new Error("invalid ur-agent package version");
|
|
393226
393398
|
}
|
|
393399
|
+
const issue2 = spec.trigger?.issueComment;
|
|
393400
|
+
const keywords = triggerKeywords(spec);
|
|
393401
|
+
const events2 = triggerEvents(spec);
|
|
393402
|
+
const publishMode = spec.publish?.mode ?? "comment";
|
|
393403
|
+
const publishes = publishMode !== "artifact";
|
|
393404
|
+
const associations = issue2?.allowedAssociations?.length ? issue2.allowedAssociations : [...TRUSTED_GITHUB_ASSOCIATIONS];
|
|
393405
|
+
const trustedActors = `contains(fromJSON('${JSON.stringify(associations)}'), `;
|
|
393406
|
+
const quoted = (value) => `'${value.replaceAll("'", "''")}'`;
|
|
393407
|
+
const mentions = (expression) => keywords.map((word) => `contains(${expression}, ${quoted(word)})`).join(" || ");
|
|
393408
|
+
const gate = (eventName, bodyExpressions, associationExpression) => [
|
|
393409
|
+
"(",
|
|
393410
|
+
` github.event_name == '${eventName}' &&`,
|
|
393411
|
+
` (${bodyExpressions.map(mentions).join(" || ")}) &&`,
|
|
393412
|
+
` ${trustedActors}${associationExpression})`,
|
|
393413
|
+
")"
|
|
393414
|
+
].join(`
|
|
393415
|
+
`);
|
|
393416
|
+
const foldExpression = (text, indent = " ") => text.split(`
|
|
393417
|
+
`).map((line, index2) => index2 === 0 ? line : `${indent}${line}`).join(`
|
|
393418
|
+
`);
|
|
393227
393419
|
const conditions = [];
|
|
393420
|
+
const onBlocks = [];
|
|
393228
393421
|
if (spec.trigger?.manual) {
|
|
393229
393422
|
conditions.push("github.event_name == 'workflow_dispatch'");
|
|
393230
|
-
|
|
393231
|
-
|
|
393232
|
-
|
|
393233
|
-
|
|
393234
|
-
|
|
393235
|
-
|
|
393236
|
-
"
|
|
393237
|
-
" github.event_name == 'issue_comment' &&",
|
|
393238
|
-
` contains(github.event.comment.body, '${keyword}') &&`,
|
|
393239
|
-
` contains(fromJSON('${JSON.stringify(associations)}'), github.event.comment.author_association)`,
|
|
393240
|
-
")"
|
|
393423
|
+
onBlocks.push([
|
|
393424
|
+
" workflow_dispatch:",
|
|
393425
|
+
" inputs:",
|
|
393426
|
+
" prompt:",
|
|
393427
|
+
" description: Bounded task for the isolated agent",
|
|
393428
|
+
" required: false",
|
|
393429
|
+
" type: string"
|
|
393241
393430
|
].join(`
|
|
393242
393431
|
`));
|
|
393243
393432
|
}
|
|
393244
|
-
|
|
393245
|
-
|
|
393246
|
-
|
|
393247
|
-
|
|
393248
|
-
|
|
393249
|
-
|
|
393250
|
-
|
|
393251
|
-
|
|
393252
|
-
|
|
393253
|
-
|
|
393254
|
-
|
|
393255
|
-
|
|
393256
|
-
|
|
393257
|
-
|
|
393258
|
-
|
|
393259
|
-
|
|
393260
|
-
|
|
393261
|
-
|
|
393262
|
-
|
|
393263
|
-
|
|
393264
|
-
|
|
393265
|
-
|
|
393266
|
-
|
|
393267
|
-
|
|
393268
|
-
|
|
393433
|
+
if (issue2) {
|
|
393434
|
+
if (events2.includes("issue_comment")) {
|
|
393435
|
+
onBlocks.push(` issue_comment:
|
|
393436
|
+
types: [created]`);
|
|
393437
|
+
conditions.push(gate("issue_comment", ["github.event.comment.body"], "github.event.comment.author_association"));
|
|
393438
|
+
}
|
|
393439
|
+
if (events2.includes("pull_request_review_comment")) {
|
|
393440
|
+
onBlocks.push(` pull_request_review_comment:
|
|
393441
|
+
types: [created]`);
|
|
393442
|
+
conditions.push(gate("pull_request_review_comment", ["github.event.comment.body"], "github.event.comment.author_association"));
|
|
393443
|
+
}
|
|
393444
|
+
if (events2.includes("pull_request_review")) {
|
|
393445
|
+
onBlocks.push(` pull_request_review:
|
|
393446
|
+
types: [submitted]`);
|
|
393447
|
+
conditions.push(gate("pull_request_review", ["github.event.review.body"], "github.event.review.author_association"));
|
|
393448
|
+
}
|
|
393449
|
+
if (events2.includes("issues")) {
|
|
393450
|
+
onBlocks.push(` issues:
|
|
393451
|
+
types: [opened, assigned]`);
|
|
393452
|
+
conditions.push(gate("issues", ["github.event.issue.body", "github.event.issue.title"], "github.event.issue.author_association"));
|
|
393453
|
+
}
|
|
393454
|
+
}
|
|
393455
|
+
const jobCondition = conditions.length > 0 ? foldExpression(conditions.join(` ||
|
|
393456
|
+
`)) : "false";
|
|
393457
|
+
const artifactName = "ur-agentic-ci-${{ github.run_id }}-${{ github.run_attempt }}";
|
|
393458
|
+
const runUrl = "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}";
|
|
393459
|
+
const acknowledgeJob = ` acknowledge:
|
|
393269
393460
|
if: >-
|
|
393270
393461
|
${jobCondition}
|
|
393271
393462
|
runs-on: ubuntu-latest
|
|
393272
|
-
timeout-minutes:
|
|
393463
|
+
timeout-minutes: 5
|
|
393464
|
+
permissions:
|
|
393465
|
+
issues: write
|
|
393466
|
+
pull-requests: write
|
|
393467
|
+
outputs:
|
|
393468
|
+
issue-number: \${{ steps.track.outputs.issue-number }}
|
|
393469
|
+
comment-id: \${{ steps.track.outputs.comment-id }}
|
|
393470
|
+
steps:
|
|
393471
|
+
- name: React and open a tracking comment
|
|
393472
|
+
id: track
|
|
393473
|
+
env:
|
|
393474
|
+
GH_TOKEN: \${{ github.token }}
|
|
393475
|
+
GH_REPO: \${{ github.repository }}
|
|
393476
|
+
RUN_URL: ${runUrl}
|
|
393477
|
+
run: |
|
|
393478
|
+
set -euo pipefail
|
|
393479
|
+
number="$(jq -r '.issue.number // .pull_request.number // empty' "$GITHUB_EVENT_PATH")"
|
|
393480
|
+
comment="$(jq -r '.comment.id // empty' "$GITHUB_EVENT_PATH")"
|
|
393481
|
+
printf 'issue-number=%s\\n' "$number" >> "$GITHUB_OUTPUT"
|
|
393482
|
+
if [ -z "$number" ]; then
|
|
393483
|
+
printf 'comment-id=\\n' >> "$GITHUB_OUTPUT"
|
|
393484
|
+
exit 0
|
|
393485
|
+
fi
|
|
393486
|
+
case "$GITHUB_EVENT_NAME" in
|
|
393487
|
+
issue_comment)
|
|
393488
|
+
[ -z "$comment" ] || gh api --silent --method POST \\
|
|
393489
|
+
"repos/$GH_REPO/issues/comments/$comment/reactions" \\
|
|
393490
|
+
-f content=eyes || true ;;
|
|
393491
|
+
pull_request_review_comment)
|
|
393492
|
+
[ -z "$comment" ] || gh api --silent --method POST \\
|
|
393493
|
+
"repos/$GH_REPO/pulls/comments/$comment/reactions" \\
|
|
393494
|
+
-f content=eyes || true ;;
|
|
393495
|
+
issues)
|
|
393496
|
+
gh api --silent --method POST \\
|
|
393497
|
+
"repos/$GH_REPO/issues/$number/reactions" \\
|
|
393498
|
+
-f content=eyes || true ;;
|
|
393499
|
+
esac
|
|
393500
|
+
body="UR is working on this. [Follow the run]($RUN_URL)."
|
|
393501
|
+
id="$(jq -n --arg body "$body" '{body: $body}' \\
|
|
393502
|
+
| gh api "repos/$GH_REPO/issues/$number/comments" --input - --jq '.id')"
|
|
393503
|
+
printf 'comment-id=%s\\n' "$id" >> "$GITHUB_OUTPUT"
|
|
393504
|
+
|
|
393505
|
+
`;
|
|
393506
|
+
const agentJob = ` agent:
|
|
393507
|
+
${publishes ? ` needs: acknowledge
|
|
393508
|
+
` : ""} if: >-
|
|
393509
|
+
${jobCondition}
|
|
393510
|
+
runs-on: ubuntu-latest
|
|
393511
|
+
timeout-minutes: ${spec.runner?.timeoutMinutes ?? 30}
|
|
393512
|
+
permissions:
|
|
393513
|
+
contents: read
|
|
393514
|
+
issues: read
|
|
393515
|
+
pull-requests: read
|
|
393273
393516
|
steps:
|
|
393274
393517
|
- name: Checkout trusted base
|
|
393275
393518
|
uses: actions/checkout@${CHECKOUT_SHA} # v7.0.0
|
|
@@ -393299,13 +393542,139 @@ jobs:
|
|
|
393299
393542
|
if: always()
|
|
393300
393543
|
uses: actions/upload-artifact@${UPLOAD_ARTIFACT_SHA} # v4.6.2
|
|
393301
393544
|
with:
|
|
393302
|
-
name:
|
|
393545
|
+
name: ${artifactName}
|
|
393303
393546
|
path: \${{ runner.temp }}/ur-agentic-ci
|
|
393304
393547
|
if-no-files-found: error
|
|
393305
393548
|
retention-days: 7
|
|
393306
393549
|
`;
|
|
393550
|
+
const pullRequestSteps = ` - name: Checkout for patch application
|
|
393551
|
+
uses: actions/checkout@${CHECKOUT_SHA} # v7.0.0
|
|
393552
|
+
with:
|
|
393553
|
+
fetch-depth: 0
|
|
393554
|
+
- name: Open a pull request from the verified patch
|
|
393555
|
+
id: pr
|
|
393556
|
+
env:
|
|
393557
|
+
GH_TOKEN: \${{ github.token }}
|
|
393558
|
+
BASE_BRANCH: \${{ github.event.repository.default_branch }}
|
|
393559
|
+
RUN_URL: ${runUrl}
|
|
393560
|
+
run: |
|
|
393561
|
+
set -euo pipefail
|
|
393562
|
+
manifest="$(find "$RUNNER_TEMP/ur-agentic-ci-out" -name manifest.json -print -quit 2>/dev/null || true)"
|
|
393563
|
+
if [ -z "$manifest" ]; then exit 0; fi
|
|
393564
|
+
if [ "$(jq -r '.status' "$manifest")" != "passed" ]; then exit 0; fi
|
|
393565
|
+
relative="$(jq -r '.patch.path // empty' "$manifest")"
|
|
393566
|
+
if [ -z "$relative" ]; then exit 0; fi
|
|
393567
|
+
patch="$(dirname "$manifest")/$relative"
|
|
393568
|
+
run_id="$(jq -r '.runId' "$manifest")"
|
|
393569
|
+
branch="ur/agentic-ci-$run_id"
|
|
393570
|
+
git config user.name 'ur-agent[bot]'
|
|
393571
|
+
git config user.email 'ur-agent[bot]@users.noreply.github.com'
|
|
393572
|
+
git checkout -b "$branch" "$(jq -r '.baseSha' "$manifest")"
|
|
393573
|
+
git apply --index --whitespace=nowarn "$patch"
|
|
393574
|
+
git commit -m "UR: apply verified Agentic CI patch ($run_id)"
|
|
393575
|
+
git push origin "HEAD:$branch"
|
|
393576
|
+
jq -r '.summary' "$manifest" > "$RUNNER_TEMP/ur-pr-body.md"
|
|
393577
|
+
printf '\\nPatch sha256: \`%s\`\\n\\n[Run](%s)\\n' \\
|
|
393578
|
+
"$(jq -r '.patch.sha256' "$manifest")" "$RUN_URL" \\
|
|
393579
|
+
>> "$RUNNER_TEMP/ur-pr-body.md"
|
|
393580
|
+
url="$(gh pr create --base "$BASE_BRANCH" --head "$branch" \\
|
|
393581
|
+
--title "UR: verified patch from run $run_id" \\
|
|
393582
|
+
--body-file "$RUNNER_TEMP/ur-pr-body.md")"
|
|
393583
|
+
printf 'url=%s\\n' "$url" >> "$GITHUB_OUTPUT"
|
|
393584
|
+
`;
|
|
393585
|
+
const publishJob = ` publish:
|
|
393586
|
+
needs: [acknowledge, agent]
|
|
393587
|
+
if: always() && needs.acknowledge.outputs.comment-id != ''
|
|
393588
|
+
runs-on: ubuntu-latest
|
|
393589
|
+
timeout-minutes: 10
|
|
393590
|
+
permissions:
|
|
393591
|
+
contents: ${publishMode === "pull-request" ? "write" : "read"}
|
|
393592
|
+
issues: write
|
|
393593
|
+
pull-requests: write
|
|
393594
|
+
steps:
|
|
393595
|
+
- name: Download agent outputs
|
|
393596
|
+
env:
|
|
393597
|
+
GH_TOKEN: \${{ github.token }}
|
|
393598
|
+
run: |
|
|
393599
|
+
set -euo pipefail
|
|
393600
|
+
mkdir -p "$RUNNER_TEMP/ur-agentic-ci-out"
|
|
393601
|
+
gh run download "$GITHUB_RUN_ID" \\
|
|
393602
|
+
--name "${artifactName}" \\
|
|
393603
|
+
--dir "$RUNNER_TEMP/ur-agentic-ci-out" || true
|
|
393604
|
+
${publishMode === "pull-request" ? pullRequestSteps : ""} - name: Report the result in the thread
|
|
393605
|
+
if: always()
|
|
393606
|
+
env:
|
|
393607
|
+
GH_TOKEN: \${{ github.token }}
|
|
393608
|
+
GH_REPO: \${{ github.repository }}
|
|
393609
|
+
COMMENT_ID: \${{ needs.acknowledge.outputs.comment-id }}
|
|
393610
|
+
AGENT_RESULT: \${{ needs.agent.result }}
|
|
393611
|
+
PR_URL: ${publishMode === "pull-request" ? "${{ steps.pr.outputs.url }}" : ""}
|
|
393612
|
+
RUN_URL: ${runUrl}
|
|
393613
|
+
run: |
|
|
393614
|
+
set -euo pipefail
|
|
393615
|
+
manifest="$(find "$RUNNER_TEMP/ur-agentic-ci-out" -name manifest.json -print -quit 2>/dev/null || true)"
|
|
393616
|
+
out="$RUNNER_TEMP/ur-comment.md"
|
|
393617
|
+
if [ -z "$manifest" ]; then
|
|
393618
|
+
{
|
|
393619
|
+
printf '### UR\\n\\n'
|
|
393620
|
+
printf 'The agent job finished as \`%s\` without producing a manifest.\\n\\n' "$AGENT_RESULT"
|
|
393621
|
+
printf '[Inspect the run](%s)\\n' "$RUN_URL"
|
|
393622
|
+
} > "$out"
|
|
393623
|
+
else
|
|
393624
|
+
status="$(jq -r '.status' "$manifest")"
|
|
393625
|
+
case "$status" in
|
|
393626
|
+
passed) icon='PASSED' ;;
|
|
393627
|
+
failed) icon='FAILED' ;;
|
|
393628
|
+
blocked) icon='BLOCKED' ;;
|
|
393629
|
+
*) icon="$status" ;;
|
|
393630
|
+
esac
|
|
393631
|
+
{
|
|
393632
|
+
printf '### UR \u2014 %s\\n\\n' "$icon"
|
|
393633
|
+
jq -r '.summary' "$manifest"
|
|
393634
|
+
printf '\\n'
|
|
393635
|
+
if [ "$(jq -r '.checks | length' "$manifest")" -gt 0 ]; then
|
|
393636
|
+
printf '\\n| Check | Exit | Duration |\\n| --- | --- | --- |\\n'
|
|
393637
|
+
jq -r '.checks[] | "| \\(.name) | \`\\(.exitCode)\` | \\(.durationMs)ms |"' "$manifest"
|
|
393638
|
+
fi
|
|
393639
|
+
if [ "$(jq -r '.violations // [] | length' "$manifest")" -gt 0 ]; then
|
|
393640
|
+
printf '\\n**Policy violations**\\n\\n'
|
|
393641
|
+
jq -r '.violations[] | "- \\(.)"' "$manifest"
|
|
393642
|
+
fi
|
|
393643
|
+
relative="$(jq -r '.patch.path // empty' "$manifest")"
|
|
393644
|
+
if [ -n "$relative" ]; then
|
|
393645
|
+
printf '\\n<details><summary>Proposed patch (%s bytes, sha256 %s)</summary>\\n\\n' \\
|
|
393646
|
+
"$(jq -r '.patch.bytes' "$manifest")" "$(jq -r '.patch.sha256' "$manifest")"
|
|
393647
|
+
printf '\\n\`\`\`diff\\n'
|
|
393648
|
+
head -c 30000 "$(dirname "$manifest")/$relative" | sed 's/^\`\`\`/ \`\`\`/'
|
|
393649
|
+
printf '\\n\`\`\`\\n\\n</details>\\n'
|
|
393650
|
+
fi
|
|
393651
|
+
if [ -n "\${PR_URL:-}" ]; then
|
|
393652
|
+
printf '\\nOpened %s\\n' "$PR_URL"
|
|
393653
|
+
fi
|
|
393654
|
+
printf '\\n[Full run and artifacts](%s)\\n' "$RUN_URL"
|
|
393655
|
+
} > "$out"
|
|
393656
|
+
fi
|
|
393657
|
+
jq -n --rawfile body "$out" '{body: $body}' \\
|
|
393658
|
+
| gh api --silent --method PATCH \\
|
|
393659
|
+
"repos/$GH_REPO/issues/comments/$COMMENT_ID" --input -
|
|
393660
|
+
`;
|
|
393661
|
+
return `name: UR Agentic CI
|
|
393662
|
+
|
|
393663
|
+
on:
|
|
393664
|
+
${onBlocks.join(`
|
|
393665
|
+
`)}
|
|
393666
|
+
|
|
393667
|
+
permissions: {}
|
|
393668
|
+
|
|
393669
|
+
concurrency:
|
|
393670
|
+
group: ur-agentic-ci-\${{ github.repository }}-\${{ github.event.issue.number || github.event.pull_request.number || github.run_id }}
|
|
393671
|
+
cancel-in-progress: false
|
|
393672
|
+
|
|
393673
|
+
jobs:
|
|
393674
|
+
${publishes ? acknowledgeJob : ""}${agentJob}${publishes ? `
|
|
393675
|
+
${publishJob}` : ""}`;
|
|
393307
393676
|
}
|
|
393308
|
-
var import_yaml2, AGENTIC_CI_MAX_EVENT_BYTES, AGENTIC_CI_MAX_PROMPT_CHARS, AGENTIC_CI_MAX_SUMMARY_CHARS, AGENTIC_CI_MAX_PATCH_BYTES, AGENTIC_CI_MAX_LOG_CHARS, TRUSTED_GITHUB_ASSOCIATIONS, NAME_RE, SAFE_PATH_RE, SECRET_NAME_RE, CHILD_FORBIDDEN_ENV_RE, HEADLESS_PROVIDER_SECRET_RE, defaultExec2 = async (file2, args, cwd2, timeoutMs, env4) => {
|
|
393677
|
+
var import_yaml2, AGENTIC_CI_MAX_EVENT_BYTES, AGENTIC_CI_MAX_PROMPT_CHARS, AGENTIC_CI_MAX_SUMMARY_CHARS, AGENTIC_CI_MAX_PATCH_BYTES, AGENTIC_CI_MAX_LOG_CHARS, TRUSTED_GITHUB_ASSOCIATIONS, AGENTIC_CI_DEFAULT_KEYWORD = "@ur", AGENTIC_CI_DEFAULT_ALIASES, AGENTIC_CI_TRIGGER_EVENTS, AGENTIC_CI_PUBLISH_MODES, NAME_RE, SAFE_PATH_RE, KEYWORD_RE, SECRET_NAME_RE, CHILD_FORBIDDEN_ENV_RE, HEADLESS_PROVIDER_SECRET_RE, defaultExec2 = async (file2, args, cwd2, timeoutMs, env4) => {
|
|
393309
393678
|
const result = await execFileNoThrowWithCwd(file2, args, {
|
|
393310
393679
|
cwd: cwd2,
|
|
393311
393680
|
timeout: timeoutMs ?? 10 * 60000,
|
|
@@ -393340,15 +393709,28 @@ var init_agenticCi = __esm(() => {
|
|
|
393340
393709
|
"MEMBER",
|
|
393341
393710
|
"COLLABORATOR"
|
|
393342
393711
|
];
|
|
393712
|
+
AGENTIC_CI_DEFAULT_ALIASES = ["/ur"];
|
|
393713
|
+
AGENTIC_CI_TRIGGER_EVENTS = [
|
|
393714
|
+
"issue_comment",
|
|
393715
|
+
"pull_request_review_comment",
|
|
393716
|
+
"pull_request_review",
|
|
393717
|
+
"issues"
|
|
393718
|
+
];
|
|
393719
|
+
AGENTIC_CI_PUBLISH_MODES = [
|
|
393720
|
+
"artifact",
|
|
393721
|
+
"comment",
|
|
393722
|
+
"pull-request"
|
|
393723
|
+
];
|
|
393343
393724
|
NAME_RE = /^[a-z0-9][a-z0-9-_]{0,63}$/i;
|
|
393344
393725
|
SAFE_PATH_RE = /^[^\0\r\n]{1,512}$/;
|
|
393726
|
+
KEYWORD_RE = /^[A-Za-z0-9@/_+#:.-]{1,64}$/;
|
|
393345
393727
|
SECRET_NAME_RE = /(?:TOKEN|SECRET|PASSWORD|PASSWD|API_KEY|PRIVATE_KEY|CREDENTIAL|AUTH)/i;
|
|
393346
393728
|
CHILD_FORBIDDEN_ENV_RE = /^(?:GITHUB_TOKEN|GH_TOKEN|ACTIONS_ID_TOKEN_REQUEST_TOKEN|ACTIONS_ID_TOKEN_REQUEST_URL|ACTIONS_RUNTIME_TOKEN|ACTIONS_RUNTIME_URL|SSH_AUTH_SOCK)$/;
|
|
393347
393729
|
HEADLESS_PROVIDER_SECRET_RE = /^(?:URHQ_API_KEY|UR_CODE_OAUTH_TOKEN|URHQ_AUTH_TOKEN|URHQ_FOUNDRY_API_KEY|OPENAI_API_KEY|ANTHROPIC_API_KEY|GEMINI_API_KEY|OPENROUTER_API_KEY|OPENAI_COMPATIBLE_API_KEY|AWS_ACCESS_KEY_ID|AWS_SECRET_ACCESS_KEY|AWS_SESSION_TOKEN|AWS_BEARER_TOKEN_BEDROCK|AZURE_CLIENT_SECRET|AZURE_CLIENT_CERTIFICATE_PATH|GOOGLE_APPLICATION_CREDENTIALS)$/;
|
|
393348
393730
|
});
|
|
393349
393731
|
|
|
393350
393732
|
// src/constants/github-app.ts
|
|
393351
|
-
var PR_TITLE = "Add UR GitHub Workflow", GITHUB_ACTION_SETUP_DOCS_URL = "https://github.com/Maitham16/UR", urVersion2, WORKFLOW_CONTENT, PR_BODY = `## Installing UR GitHub App
|
|
393733
|
+
var import_yaml3, PR_TITLE = "Add UR GitHub Workflow", GITHUB_ACTION_SETUP_DOCS_URL = "https://github.com/Maitham16/UR", urVersion2, WORKFLOW_CONTENT, AGENTIC_CI_SPEC_PATH = ".ur/agentic-ci/default.yaml", AGENTIC_CI_SPEC_CONTENT, PR_BODY = `## Installing UR GitHub App
|
|
393352
393734
|
|
|
393353
393735
|
This PR adds a GitHub Actions workflow that enables UR integration in our repository.
|
|
393354
393736
|
|
|
@@ -393364,26 +393746,45 @@ This PR adds a GitHub Actions workflow that enables UR integration in our reposi
|
|
|
393364
393746
|
|
|
393365
393747
|
### How it works
|
|
393366
393748
|
|
|
393367
|
-
Once this PR is merged, trusted collaborators can
|
|
393368
|
-
|
|
393749
|
+
Once this PR is merged, trusted collaborators can summon UR by writing \`@ur\` followed by a task:
|
|
393750
|
+
|
|
393751
|
+
- an issue comment or pull-request comment
|
|
393752
|
+
- an inline review comment on a diff
|
|
393753
|
+
- a submitted pull-request review
|
|
393754
|
+
- the body or title of a new issue
|
|
393755
|
+
|
|
393756
|
+
UR reacts with \uD83D\uDC40, posts a tracking comment, works in an isolated checkout, and
|
|
393757
|
+
then edits that comment with the summary, verification results, and the proposed
|
|
393758
|
+
patch. The legacy \`/ur\` form still works.
|
|
393759
|
+
|
|
393760
|
+
### Files in this PR
|
|
393761
|
+
|
|
393762
|
+
- \`.github/workflows/ur.yml\` \u2014 the workflow
|
|
393763
|
+
- \`.ur/agentic-ci/default.yaml\` \u2014 the policy spec that governs the run
|
|
393764
|
+
|
|
393765
|
+
Edit the spec to change the keyword, the trusted associations, which events are
|
|
393766
|
+
allowed, the verification commands, or the writable path allowlist.
|
|
393369
393767
|
|
|
393370
393768
|
### Important Notes
|
|
393371
393769
|
|
|
393372
393770
|
- **This workflow won't take effect until this PR is merged**
|
|
393373
|
-
- The workflow runs for manual dispatches and trusted issue comments containing \`/ur\`
|
|
393374
393771
|
- Event text is passed as data, never interpolated into shell source
|
|
393772
|
+
- \`@urgent\` and mentions inside code fences or quoted replies do not trigger a run
|
|
393375
393773
|
|
|
393376
393774
|
### Security
|
|
393377
393775
|
|
|
393378
393776
|
- The API key is securely stored as a GitHub Actions secret
|
|
393379
|
-
- Only owners, members, and collaborators can trigger
|
|
393777
|
+
- Only owners, members, and collaborators can trigger runs
|
|
393380
393778
|
- All UR runs are stored in the GitHub Actions run history
|
|
393381
|
-
- The
|
|
393382
|
-
and emits a bounded hash-addressed patch artifact
|
|
393779
|
+
- The job that reads untrusted comment text holds **no write token**. It runs in
|
|
393780
|
+
a detached worktree and emits a bounded, hash-addressed patch artifact
|
|
393781
|
+
- A separate publisher job holds the write scopes and only ever consumes that
|
|
393782
|
+
artifact, so untrusted input and write access never share a job
|
|
393783
|
+
- Opening pull requests is opt-in: set \`publish.mode: pull-request\` in the spec
|
|
393383
393784
|
|
|
393384
393785
|
There's more information in the [UR repository](https://github.com/Maitham16/UR).
|
|
393385
393786
|
|
|
393386
|
-
After merging this PR, try
|
|
393787
|
+
After merging this PR, try \`@ur investigate this\` in a comment to get started.`, CODE_REVIEW_PLUGIN_WORKFLOW_CONTENT = `name: UR Review
|
|
393387
393788
|
|
|
393388
393789
|
on:
|
|
393389
393790
|
pull_request:
|
|
@@ -393416,10 +393817,12 @@ jobs:
|
|
|
393416
393817
|
`;
|
|
393417
393818
|
var init_github_app = __esm(() => {
|
|
393418
393819
|
init_agenticCi();
|
|
393419
|
-
|
|
393820
|
+
import_yaml3 = __toESM(require_dist4(), 1);
|
|
393821
|
+
urVersion2 = typeof MACRO !== "undefined" ? "1.50.0" : "1.50.0";
|
|
393420
393822
|
WORKFLOW_CONTENT = compileAgenticCiWorkflow("default", {
|
|
393421
393823
|
packageVersion: urVersion2
|
|
393422
393824
|
});
|
|
393825
|
+
AGENTIC_CI_SPEC_CONTENT = import_yaml3.stringify(defaultAgenticCiSpec("default"));
|
|
393423
393826
|
});
|
|
393424
393827
|
|
|
393425
393828
|
// src/commands/install-github-app/ApiKeyStep.tsx
|
|
@@ -395422,11 +395825,13 @@ async function createWorkflowFile(repoName, branchName, workflowPath, workflowCo
|
|
|
395422
395825
|
if (checkFileResult.code === 0) {
|
|
395423
395826
|
fileSha = checkFileResult.stdout.trim();
|
|
395424
395827
|
}
|
|
395828
|
+
const ACTION_INPUT = /ur_api_key: \$\{\{ secrets\.UR_API_KEY \}\}/g;
|
|
395829
|
+
const ENV_VAR = /URHQ_API_KEY: \$\{\{ secrets\.UR_API_KEY \}\}/g;
|
|
395425
395830
|
let content = workflowContent;
|
|
395426
395831
|
if (secretName === "UR_CODE_OAUTH_TOKEN") {
|
|
395427
|
-
content =
|
|
395832
|
+
content = content.replace(ACTION_INPUT, `ur_oauth_token: \${{ secrets.UR_CODE_OAUTH_TOKEN }}`).replace(ENV_VAR, `UR_CODE_OAUTH_TOKEN: \${{ secrets.UR_CODE_OAUTH_TOKEN }}`);
|
|
395428
395833
|
} else if (secretName !== "UR_API_KEY") {
|
|
395429
|
-
content =
|
|
395834
|
+
content = content.replace(ACTION_INPUT, `ur_api_key: \${{ secrets.${secretName} }}`).replace(ENV_VAR, `URHQ_API_KEY: \${{ secrets.${secretName} }}`);
|
|
395430
395835
|
}
|
|
395431
395836
|
const base64Content = Buffer.from(content).toString("base64");
|
|
395432
395837
|
const apiParams = [
|
|
@@ -395552,6 +395957,11 @@ async function setupGitHubActions(repoName, apiKeyOrOAuthToken, secretName, upda
|
|
|
395552
395957
|
content: WORKFLOW_CONTENT,
|
|
395553
395958
|
message: "UR PR Assistant workflow"
|
|
395554
395959
|
});
|
|
395960
|
+
workflows.push({
|
|
395961
|
+
path: AGENTIC_CI_SPEC_PATH,
|
|
395962
|
+
content: AGENTIC_CI_SPEC_CONTENT,
|
|
395963
|
+
message: "UR Agentic CI policy spec"
|
|
395964
|
+
});
|
|
395555
395965
|
}
|
|
395556
395966
|
if (selectedWorkflows.includes("ur-review")) {
|
|
395557
395967
|
workflows.push({
|
|
@@ -411407,7 +411817,7 @@ function getAllReleaseNotes(changelogContent = getStoredChangelogFromMemory()) {
|
|
|
411407
411817
|
return [];
|
|
411408
411818
|
}
|
|
411409
411819
|
}
|
|
411410
|
-
async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.
|
|
411820
|
+
async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.50.0") {
|
|
411411
411821
|
if (process.env.USER_TYPE === "ant") {
|
|
411412
411822
|
const changelog = "";
|
|
411413
411823
|
if (changelog) {
|
|
@@ -411434,7 +411844,7 @@ async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.49.0")
|
|
|
411434
411844
|
releaseNotes
|
|
411435
411845
|
};
|
|
411436
411846
|
}
|
|
411437
|
-
function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "1.
|
|
411847
|
+
function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "1.50.0") {
|
|
411438
411848
|
if (process.env.USER_TYPE === "ant") {
|
|
411439
411849
|
const changelog = "";
|
|
411440
411850
|
if (changelog) {
|
|
@@ -414291,7 +414701,7 @@ function getRecentActivitySync() {
|
|
|
414291
414701
|
return cachedActivity;
|
|
414292
414702
|
}
|
|
414293
414703
|
function getLogoDisplayData() {
|
|
414294
|
-
const version2 = process.env.DEMO_VERSION ?? "1.
|
|
414704
|
+
const version2 = process.env.DEMO_VERSION ?? "1.50.0";
|
|
414295
414705
|
const serverUrl = getDirectConnectServerUrl();
|
|
414296
414706
|
const displayPath = process.env.DEMO_VERSION ? "/code/ur" : getDisplayPath(getCwd());
|
|
414297
414707
|
const cwd2 = serverUrl ? `${displayPath} in ${serverUrl.replace(/^https?:\/\//, "")}` : displayPath;
|
|
@@ -415175,7 +415585,7 @@ function LogoV2() {
|
|
|
415175
415585
|
if ($2[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
415176
415586
|
t2 = () => {
|
|
415177
415587
|
const currentConfig2 = getGlobalConfig();
|
|
415178
|
-
if (currentConfig2.lastReleaseNotesSeen === "1.
|
|
415588
|
+
if (currentConfig2.lastReleaseNotesSeen === "1.50.0") {
|
|
415179
415589
|
return;
|
|
415180
415590
|
}
|
|
415181
415591
|
saveGlobalConfig(_temp327);
|
|
@@ -415860,12 +416270,12 @@ function LogoV2() {
|
|
|
415860
416270
|
return t41;
|
|
415861
416271
|
}
|
|
415862
416272
|
function _temp327(current) {
|
|
415863
|
-
if (current.lastReleaseNotesSeen === "1.
|
|
416273
|
+
if (current.lastReleaseNotesSeen === "1.50.0") {
|
|
415864
416274
|
return current;
|
|
415865
416275
|
}
|
|
415866
416276
|
return {
|
|
415867
416277
|
...current,
|
|
415868
|
-
lastReleaseNotesSeen: "1.
|
|
416278
|
+
lastReleaseNotesSeen: "1.50.0"
|
|
415869
416279
|
};
|
|
415870
416280
|
}
|
|
415871
416281
|
function _temp243(s_0) {
|
|
@@ -431361,7 +431771,7 @@ runner; \`ur trigger\` is the inbound parser that decides what to run.
|
|
|
431361
431771
|
path: ".github/workflows/ur.yml",
|
|
431362
431772
|
root: "project",
|
|
431363
431773
|
content: compileAgenticCiWorkflow("default", {
|
|
431364
|
-
packageVersion: typeof MACRO !== "undefined" ? "1.
|
|
431774
|
+
packageVersion: typeof MACRO !== "undefined" ? "1.50.0" : "1.50.0"
|
|
431365
431775
|
})
|
|
431366
431776
|
},
|
|
431367
431777
|
{
|
|
@@ -431424,7 +431834,7 @@ function value(tokens, flag) {
|
|
|
431424
431834
|
return index2 >= 0 ? tokens[index2 + 1] : undefined;
|
|
431425
431835
|
}
|
|
431426
431836
|
function cliVersion() {
|
|
431427
|
-
return typeof MACRO !== "undefined" ? "1.
|
|
431837
|
+
return typeof MACRO !== "undefined" ? "1.50.0" : "1.50.0";
|
|
431428
431838
|
}
|
|
431429
431839
|
function workflowPath(cwd2) {
|
|
431430
431840
|
return join155(cwd2, ".github", "workflows", "ur-agentic-ci.yml");
|
|
@@ -437280,7 +437690,7 @@ function createAcpStdioApp(deps) {
|
|
|
437280
437690
|
}
|
|
437281
437691
|
},
|
|
437282
437692
|
authMethods: [],
|
|
437283
|
-
agentInfo: { name: "UR-Nexus", version: "1.
|
|
437693
|
+
agentInfo: { name: "UR-Nexus", version: "1.50.0" }
|
|
437284
437694
|
})).onRequest("authenticate", () => ({})).onRequest("session/new", async (context6) => {
|
|
437285
437695
|
const result = runtime2.newSession(context6.params.cwd, context6.params.mcpServers, context6.params.additionalDirectories);
|
|
437286
437696
|
await runtime2.announce({
|
|
@@ -437377,7 +437787,7 @@ function createAcpStdioAgent(deps) {
|
|
|
437377
437787
|
}
|
|
437378
437788
|
},
|
|
437379
437789
|
authMethods: [],
|
|
437380
|
-
agentInfo: { name: "UR-Nexus", version: "1.
|
|
437790
|
+
agentInfo: { name: "UR-Nexus", version: "1.50.0" }
|
|
437381
437791
|
});
|
|
437382
437792
|
return;
|
|
437383
437793
|
case "authenticate":
|
|
@@ -440510,7 +440920,7 @@ function statePath(cwd2, name) {
|
|
|
440510
440920
|
}
|
|
440511
440921
|
function parseWorkflowText(text) {
|
|
440512
440922
|
const trimmed = text.trim();
|
|
440513
|
-
const parsed = trimmed.startsWith("{") ? safeParseJSON(trimmed, false) :
|
|
440923
|
+
const parsed = trimmed.startsWith("{") ? safeParseJSON(trimmed, false) : import_yaml5.parse(trimmed);
|
|
440514
440924
|
if (!parsed || typeof parsed !== "object") {
|
|
440515
440925
|
throw new Error("Workflow is not an object");
|
|
440516
440926
|
}
|
|
@@ -440692,7 +441102,7 @@ function saveWorkflow(cwd2, spec, options2 = {}) {
|
|
|
440692
441102
|
if (existsSync44(path22) && options2.force !== true) {
|
|
440693
441103
|
return { path: path22, created: false };
|
|
440694
441104
|
}
|
|
440695
|
-
writeFileSync34(path22, `${
|
|
441105
|
+
writeFileSync34(path22, `${import_yaml5.stringify(spec)}`);
|
|
440696
441106
|
return { path: path22, created: true };
|
|
440697
441107
|
}
|
|
440698
441108
|
function loadRunState(cwd2, name) {
|
|
@@ -440818,10 +441228,10 @@ function formatRunPlan(plan) {
|
|
|
440818
441228
|
return lines.join(`
|
|
440819
441229
|
`);
|
|
440820
441230
|
}
|
|
440821
|
-
var
|
|
441231
|
+
var import_yaml5, KNOWN_AGENTS, NAME_RE2, GATE_LABEL;
|
|
440822
441232
|
var init_workflows = __esm(() => {
|
|
440823
441233
|
init_json();
|
|
440824
|
-
|
|
441234
|
+
import_yaml5 = __toESM(require_dist4(), 1);
|
|
440825
441235
|
KNOWN_AGENTS = [
|
|
440826
441236
|
"general-purpose",
|
|
440827
441237
|
"worker",
|
|
@@ -442318,7 +442728,7 @@ function normalizeSkillStep(raw, index2) {
|
|
|
442318
442728
|
}
|
|
442319
442729
|
function parseSkillYaml(text) {
|
|
442320
442730
|
const trimmed = text.trim();
|
|
442321
|
-
const parsed = trimmed.startsWith("{") ? safeParseJSON(trimmed, false) :
|
|
442731
|
+
const parsed = trimmed.startsWith("{") ? safeParseJSON(trimmed, false) : import_yaml6.parse(trimmed);
|
|
442322
442732
|
if (!parsed || typeof parsed !== "object") {
|
|
442323
442733
|
throw new Error("Skill spec is not an object");
|
|
442324
442734
|
}
|
|
@@ -442575,12 +442985,12 @@ Executable skill for ${name}.
|
|
|
442575
442985
|
};
|
|
442576
442986
|
}
|
|
442577
442987
|
function stringifySkillYaml(spec) {
|
|
442578
|
-
return
|
|
442988
|
+
return import_yaml6.stringify(spec);
|
|
442579
442989
|
}
|
|
442580
|
-
var
|
|
442990
|
+
var import_yaml6, SKILL_YAML_FILE = "skill.yaml", SKILL_INSTRUCTIONS_FILE = "instructions.md", NAME_RE3;
|
|
442581
442991
|
var init_skillSpec = __esm(() => {
|
|
442582
442992
|
init_json();
|
|
442583
|
-
|
|
442993
|
+
import_yaml6 = __toESM(require_dist4(), 1);
|
|
442584
442994
|
NAME_RE3 = /^[a-z0-9][a-z0-9-_]{0,63}$/i;
|
|
442585
442995
|
});
|
|
442586
442996
|
|
|
@@ -444494,8 +444904,8 @@ function ensureCloudDirectory(cwd2) {
|
|
|
444494
444904
|
assertSafeStateNode(directory, "directory");
|
|
444495
444905
|
}
|
|
444496
444906
|
function boundedInteger(value2, fallback, minimum, maximum) {
|
|
444497
|
-
const
|
|
444498
|
-
return Number.isSafeInteger(
|
|
444907
|
+
const numeric2 = typeof value2 === "number" ? value2 : typeof value2 === "string" && /^\d+$/u.test(value2.trim()) ? Number(value2) : Number.NaN;
|
|
444908
|
+
return Number.isSafeInteger(numeric2) && numeric2 >= minimum ? Math.min(numeric2, maximum) : fallback;
|
|
444499
444909
|
}
|
|
444500
444910
|
function secretValues() {
|
|
444501
444911
|
return Object.entries(process.env).filter(([name, value2]) => isSecretLikeSubprocessEnvName(name) && (value2?.length ?? 0) >= 6).map(([, value2]) => value2).sort((left, right) => right.length - left.length);
|
|
@@ -459136,7 +459546,7 @@ var init_code_index2 = __esm(() => {
|
|
|
459136
459546
|
|
|
459137
459547
|
// node_modules/typescript/lib/typescript.js
|
|
459138
459548
|
var require_typescript2 = __commonJS((exports, module) => {
|
|
459139
|
-
var __dirname = "/sessions/
|
|
459549
|
+
var __dirname = "/sessions/great-laughing-cerf/mnt/UR-1.49.0/node_modules/typescript/lib", __filename = "/sessions/great-laughing-cerf/mnt/UR-1.49.0/node_modules/typescript/lib/typescript.js";
|
|
459140
459550
|
/*! *****************************************************************************
|
|
459141
459551
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
459142
459552
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
@@ -590276,7 +590686,7 @@ ${newComment.split(`
|
|
|
590276
590686
|
}
|
|
590277
590687
|
}
|
|
590278
590688
|
return result;
|
|
590279
|
-
function
|
|
590689
|
+
function escapeRegExp4(str2) {
|
|
590280
590690
|
return str2.replace(/[-[\]/{}()*+?.\\^$|]/g, "\\$&");
|
|
590281
590691
|
}
|
|
590282
590692
|
function getTodoCommentsRegExp() {
|
|
@@ -590284,7 +590694,7 @@ ${newComment.split(`
|
|
|
590284
590694
|
const multiLineCommentStart = /(?:\/\*+\s*)/.source;
|
|
590285
590695
|
const anyNumberOfSpacesAndAsterisksAtStartOfLine = /(?:^(?:\s|\*)*)/.source;
|
|
590286
590696
|
const preamble = "(" + anyNumberOfSpacesAndAsterisksAtStartOfLine + "|" + singleLineCommentStart + "|" + multiLineCommentStart + ")";
|
|
590287
|
-
const literals = "(?:" + map3(descriptors2, (d3) => "(" +
|
|
590697
|
+
const literals = "(?:" + map3(descriptors2, (d3) => "(" + escapeRegExp4(d3.text) + ")").join("|") + ")";
|
|
590288
590698
|
const endOfLineOrEndOfComment = /(?:$|\*\/)/.source;
|
|
590289
590699
|
const messageRemainder = /(?:.*?)/.source;
|
|
590290
590700
|
const messagePortion = "(" + literals + messageRemainder + ")";
|
|
@@ -609544,14 +609954,14 @@ ${content}
|
|
|
609544
609954
|
function getOrganizeImportsUnicodeStringComparer(ignoreCase, preferences) {
|
|
609545
609955
|
const resolvedLocale = getOrganizeImportsLocale(preferences);
|
|
609546
609956
|
const caseFirst = preferences.organizeImportsCaseFirst ?? false;
|
|
609547
|
-
const
|
|
609957
|
+
const numeric2 = preferences.organizeImportsNumericCollation ?? false;
|
|
609548
609958
|
const accents = preferences.organizeImportsAccentCollation ?? true;
|
|
609549
609959
|
const sensitivity = ignoreCase ? accents ? "accent" : "base" : accents ? "variant" : "case";
|
|
609550
609960
|
const collator = new Intl.Collator(resolvedLocale, {
|
|
609551
609961
|
usage: "sort",
|
|
609552
609962
|
caseFirst: caseFirst || "false",
|
|
609553
609963
|
sensitivity,
|
|
609554
|
-
numeric
|
|
609964
|
+
numeric: numeric2
|
|
609555
609965
|
});
|
|
609556
609966
|
return collator.compare;
|
|
609557
609967
|
}
|
|
@@ -644856,7 +645266,7 @@ async function captureMemoryDiagnostics(trigger2, dumpNumber = 0) {
|
|
|
644856
645266
|
smapsRollup,
|
|
644857
645267
|
platform: process.platform,
|
|
644858
645268
|
nodeVersion: process.version,
|
|
644859
|
-
ccVersion: "1.
|
|
645269
|
+
ccVersion: "1.50.0"
|
|
644860
645270
|
};
|
|
644861
645271
|
}
|
|
644862
645272
|
async function performHeapDump(trigger2 = "manual", dumpNumber = 0) {
|
|
@@ -645442,7 +645852,7 @@ var init_bridge_kick = __esm(() => {
|
|
|
645442
645852
|
var call145 = async () => {
|
|
645443
645853
|
return {
|
|
645444
645854
|
type: "text",
|
|
645445
|
-
value: "1.
|
|
645855
|
+
value: "1.50.0"
|
|
645446
645856
|
};
|
|
645447
645857
|
}, version2, version_default;
|
|
645448
645858
|
var init_version = __esm(() => {
|
|
@@ -656560,7 +656970,7 @@ function generateHtmlReport(data, insights) {
|
|
|
656560
656970
|
</html>`;
|
|
656561
656971
|
}
|
|
656562
656972
|
function buildExportData(data, insights, facets, remoteStats) {
|
|
656563
|
-
const version3 = typeof MACRO !== "undefined" ? "1.
|
|
656973
|
+
const version3 = typeof MACRO !== "undefined" ? "1.50.0" : "unknown";
|
|
656564
656974
|
const remote_hosts_collected = remoteStats?.hosts.filter((h2) => h2.sessionCount > 0).map((h2) => h2.name);
|
|
656565
656975
|
const facets_summary = {
|
|
656566
656976
|
total: facets.size,
|
|
@@ -660893,7 +661303,7 @@ var init_sessionStorage = __esm(() => {
|
|
|
660893
661303
|
init_settings2();
|
|
660894
661304
|
init_slowOperations();
|
|
660895
661305
|
init_uuid();
|
|
660896
|
-
VERSION7 = typeof MACRO !== "undefined" ? "1.
|
|
661306
|
+
VERSION7 = typeof MACRO !== "undefined" ? "1.50.0" : "unknown";
|
|
660897
661307
|
MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
|
|
660898
661308
|
SKIP_FIRST_PROMPT_PATTERN = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
|
|
660899
661309
|
EPHEMERAL_PROGRESS_TYPES = new Set([
|
|
@@ -662108,7 +662518,7 @@ var init_filesystem = __esm(() => {
|
|
|
662108
662518
|
});
|
|
662109
662519
|
getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
|
|
662110
662520
|
const nonce = randomBytes19(16).toString("hex");
|
|
662111
|
-
return join224(getURTempDir(), "bundled-skills", "1.
|
|
662521
|
+
return join224(getURTempDir(), "bundled-skills", "1.50.0", nonce);
|
|
662112
662522
|
});
|
|
662113
662523
|
getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
|
|
662114
662524
|
});
|
|
@@ -668403,7 +668813,7 @@ function computeFingerprint(messageText2, version3) {
|
|
|
668403
668813
|
}
|
|
668404
668814
|
function computeFingerprintFromMessages(messages) {
|
|
668405
668815
|
const firstMessageText = extractFirstMessageText(messages);
|
|
668406
|
-
return computeFingerprint(firstMessageText, "1.
|
|
668816
|
+
return computeFingerprint(firstMessageText, "1.50.0");
|
|
668407
668817
|
}
|
|
668408
668818
|
var FINGERPRINT_SALT = "59cf53e54c78";
|
|
668409
668819
|
var init_fingerprint = () => {};
|
|
@@ -670299,7 +670709,7 @@ async function sideQuery(opts) {
|
|
|
670299
670709
|
betas.push(STRUCTURED_OUTPUTS_BETA_HEADER);
|
|
670300
670710
|
}
|
|
670301
670711
|
const messageText2 = extractFirstUserMessageText(messages);
|
|
670302
|
-
const fingerprint2 = computeFingerprint(messageText2, "1.
|
|
670712
|
+
const fingerprint2 = computeFingerprint(messageText2, "1.50.0");
|
|
670303
670713
|
const attributionHeader = getAttributionHeader(fingerprint2);
|
|
670304
670714
|
const systemBlocks = [
|
|
670305
670715
|
attributionHeader ? { type: "text", text: attributionHeader } : null,
|
|
@@ -675070,7 +675480,7 @@ function buildSystemInitMessage(inputs) {
|
|
|
675070
675480
|
slash_commands: inputs.commands.filter((c4) => c4.userInvocable !== false).map((c4) => c4.name),
|
|
675071
675481
|
apiKeySource: getURHQApiKeyWithSource().source,
|
|
675072
675482
|
betas: getSdkBetas(),
|
|
675073
|
-
ur_version: "1.
|
|
675483
|
+
ur_version: "1.50.0",
|
|
675074
675484
|
output_style: outputStyle2,
|
|
675075
675485
|
agents: inputs.agents.map((agent2) => agent2.agentType),
|
|
675076
675486
|
skills: inputs.skills.filter((s) => s.userInvocable !== false).map((skill2) => skill2.name),
|
|
@@ -688930,7 +689340,7 @@ var init_useVoiceEnabled = __esm(() => {
|
|
|
688930
689340
|
function getSemverPart(version3) {
|
|
688931
689341
|
return `${import_semver13.major(version3, { loose: true })}.${import_semver13.minor(version3, { loose: true })}.${import_semver13.patch(version3, { loose: true })}`;
|
|
688932
689342
|
}
|
|
688933
|
-
function useUpdateNotification(updatedVersion, initialVersion = "1.
|
|
689343
|
+
function useUpdateNotification(updatedVersion, initialVersion = "1.50.0") {
|
|
688934
689344
|
const [lastNotifiedSemver, setLastNotifiedSemver] = import_react228.useState(() => getSemverPart(initialVersion));
|
|
688935
689345
|
if (!updatedVersion) {
|
|
688936
689346
|
return null;
|
|
@@ -688979,7 +689389,7 @@ function AutoUpdater({
|
|
|
688979
689389
|
return;
|
|
688980
689390
|
}
|
|
688981
689391
|
if (false) {}
|
|
688982
|
-
const currentVersion = "1.
|
|
689392
|
+
const currentVersion = "1.50.0";
|
|
688983
689393
|
const channel = getInitialSettings()?.autoUpdatesChannel ?? "latest";
|
|
688984
689394
|
let latestVersion = await getLatestVersion(channel);
|
|
688985
689395
|
const isDisabled = isAutoUpdaterDisabled();
|
|
@@ -689208,12 +689618,12 @@ function NativeAutoUpdater({
|
|
|
689208
689618
|
logEvent("tengu_native_auto_updater_start", {});
|
|
689209
689619
|
try {
|
|
689210
689620
|
const maxVersion = await getMaxVersion();
|
|
689211
|
-
if (maxVersion && gt("1.
|
|
689621
|
+
if (maxVersion && gt("1.50.0", maxVersion)) {
|
|
689212
689622
|
const msg = await getMaxVersionMessage();
|
|
689213
689623
|
setMaxVersionIssue(msg ?? "affects your version");
|
|
689214
689624
|
}
|
|
689215
689625
|
const result = await installLatest(channel);
|
|
689216
|
-
const currentVersion = "1.
|
|
689626
|
+
const currentVersion = "1.50.0";
|
|
689217
689627
|
const latencyMs = Date.now() - startTime;
|
|
689218
689628
|
if (result.lockFailed) {
|
|
689219
689629
|
logEvent("tengu_native_auto_updater_lock_contention", {
|
|
@@ -689350,17 +689760,17 @@ function PackageManagerAutoUpdater(t0) {
|
|
|
689350
689760
|
const maxVersion = await getMaxVersion();
|
|
689351
689761
|
if (maxVersion && latest && gt(latest, maxVersion)) {
|
|
689352
689762
|
logForDebugging(`PackageManagerAutoUpdater: maxVersion ${maxVersion} is set, capping update from ${latest} to ${maxVersion}`);
|
|
689353
|
-
if (gte("1.
|
|
689354
|
-
logForDebugging(`PackageManagerAutoUpdater: current version ${"1.
|
|
689763
|
+
if (gte("1.50.0", maxVersion)) {
|
|
689764
|
+
logForDebugging(`PackageManagerAutoUpdater: current version ${"1.50.0"} is already at or above maxVersion ${maxVersion}, skipping update`);
|
|
689355
689765
|
setUpdateAvailable(false);
|
|
689356
689766
|
return;
|
|
689357
689767
|
}
|
|
689358
689768
|
latest = maxVersion;
|
|
689359
689769
|
}
|
|
689360
|
-
const hasUpdate = latest && !gte("1.
|
|
689770
|
+
const hasUpdate = latest && !gte("1.50.0", latest) && !shouldSkipVersion(latest);
|
|
689361
689771
|
setUpdateAvailable(!!hasUpdate);
|
|
689362
689772
|
if (hasUpdate) {
|
|
689363
|
-
logForDebugging(`PackageManagerAutoUpdater: Update available ${"1.
|
|
689773
|
+
logForDebugging(`PackageManagerAutoUpdater: Update available ${"1.50.0"} -> ${latest}`);
|
|
689364
689774
|
}
|
|
689365
689775
|
};
|
|
689366
689776
|
$2[0] = t1;
|
|
@@ -689394,7 +689804,7 @@ function PackageManagerAutoUpdater(t0) {
|
|
|
689394
689804
|
wrap: "truncate",
|
|
689395
689805
|
children: [
|
|
689396
689806
|
"currentVersion: ",
|
|
689397
|
-
"1.
|
|
689807
|
+
"1.50.0"
|
|
689398
689808
|
]
|
|
689399
689809
|
}, undefined, true, undefined, this);
|
|
689400
689810
|
$2[3] = verbose;
|
|
@@ -693733,7 +694143,7 @@ var require_version_check = __commonJS((exports) => {
|
|
|
693733
694143
|
|
|
693734
694144
|
// node_modules/qrcode/lib/core/regex.js
|
|
693735
694145
|
var require_regex = __commonJS((exports) => {
|
|
693736
|
-
var
|
|
694146
|
+
var numeric2 = "[0-9]+";
|
|
693737
694147
|
var alphanumeric = "[A-Z $%*+\\-./:]+";
|
|
693738
694148
|
var kanji = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|" + "[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|" + "[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|" + "[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";
|
|
693739
694149
|
kanji = kanji.replace(/u/g, "\\u");
|
|
@@ -693742,10 +694152,10 @@ var require_regex = __commonJS((exports) => {
|
|
|
693742
694152
|
exports.KANJI = new RegExp(kanji, "g");
|
|
693743
694153
|
exports.BYTE_KANJI = new RegExp("[^A-Z0-9 $%*+\\-./:]+", "g");
|
|
693744
694154
|
exports.BYTE = new RegExp(byte, "g");
|
|
693745
|
-
exports.NUMERIC = new RegExp(
|
|
694155
|
+
exports.NUMERIC = new RegExp(numeric2, "g");
|
|
693746
694156
|
exports.ALPHANUMERIC = new RegExp(alphanumeric, "g");
|
|
693747
694157
|
var TEST_KANJI = new RegExp("^" + kanji + "$");
|
|
693748
|
-
var TEST_NUMERIC = new RegExp("^" +
|
|
694158
|
+
var TEST_NUMERIC = new RegExp("^" + numeric2 + "$");
|
|
693749
694159
|
var TEST_ALPHANUMERIC = new RegExp("^[A-Z0-9 $%*+\\-./:]+$");
|
|
693750
694160
|
exports.testKanji = function testKanji(str2) {
|
|
693751
694161
|
return TEST_KANJI.test(str2);
|
|
@@ -700091,7 +700501,7 @@ function buildStatusLineCommandInput(permissionMode, exceeds200kTokens, settings
|
|
|
700091
700501
|
project_dir: getOriginalCwd(),
|
|
700092
700502
|
added_dirs: addedDirs
|
|
700093
700503
|
},
|
|
700094
|
-
version: "1.
|
|
700504
|
+
version: "1.50.0",
|
|
700095
700505
|
output_style: {
|
|
700096
700506
|
name: outputStyleName
|
|
700097
700507
|
},
|
|
@@ -700174,7 +700584,7 @@ function StatusLineInner({
|
|
|
700174
700584
|
const taskValues = Object.values(tasks2);
|
|
700175
700585
|
const taskRunningCount = taskValues.filter((task2) => task2.status === "running" || task2.status === "pending").length;
|
|
700176
700586
|
const defaultStatusLineText = buildDefaultStatusBar({
|
|
700177
|
-
version: "1.
|
|
700587
|
+
version: "1.50.0",
|
|
700178
700588
|
providerLabel: providerRuntime.providerLabel,
|
|
700179
700589
|
authMode: providerRuntime.authLabel,
|
|
700180
700590
|
model: providerRuntime.model ?? renderModelName(mainLoopModel),
|
|
@@ -712317,7 +712727,7 @@ async function submitTranscriptShare(messages, trigger2, appearanceId) {
|
|
|
712317
712727
|
} catch {}
|
|
712318
712728
|
const data = {
|
|
712319
712729
|
trigger: trigger2,
|
|
712320
|
-
version: "1.
|
|
712730
|
+
version: "1.50.0",
|
|
712321
712731
|
platform: process.platform,
|
|
712322
712732
|
transcript,
|
|
712323
712733
|
subagentTranscripts: Object.keys(subagentTranscripts).length > 0 ? subagentTranscripts : undefined,
|
|
@@ -724603,7 +725013,7 @@ function WelcomeV2() {
|
|
|
724603
725013
|
dimColor: true,
|
|
724604
725014
|
children: [
|
|
724605
725015
|
"v",
|
|
724606
|
-
"1.
|
|
725016
|
+
"1.50.0"
|
|
724607
725017
|
]
|
|
724608
725018
|
}, undefined, true, undefined, this)
|
|
724609
725019
|
]
|
|
@@ -725863,7 +726273,7 @@ function completeOnboarding() {
|
|
|
725863
726273
|
saveGlobalConfig((current) => ({
|
|
725864
726274
|
...current,
|
|
725865
726275
|
hasCompletedOnboarding: true,
|
|
725866
|
-
lastOnboardingVersion: "1.
|
|
726276
|
+
lastOnboardingVersion: "1.50.0"
|
|
725867
726277
|
}));
|
|
725868
726278
|
}
|
|
725869
726279
|
function showDialog(root2, renderer) {
|
|
@@ -730907,7 +731317,7 @@ function appendToLog(path24, message) {
|
|
|
730907
731317
|
cwd: getFsImplementation().cwd(),
|
|
730908
731318
|
userType: process.env.USER_TYPE,
|
|
730909
731319
|
sessionId: getSessionId(),
|
|
730910
|
-
version: "1.
|
|
731320
|
+
version: "1.50.0"
|
|
730911
731321
|
};
|
|
730912
731322
|
getLogWriter(path24).write(messageWithTimestamp);
|
|
730913
731323
|
}
|
|
@@ -735066,8 +735476,8 @@ async function getEnvLessBridgeConfig() {
|
|
|
735066
735476
|
}
|
|
735067
735477
|
async function checkEnvLessBridgeMinVersion() {
|
|
735068
735478
|
const cfg = await getEnvLessBridgeConfig();
|
|
735069
|
-
if (cfg.min_version && lt("1.
|
|
735070
|
-
return `Your version of UR (${"1.
|
|
735479
|
+
if (cfg.min_version && lt("1.50.0", cfg.min_version)) {
|
|
735480
|
+
return `Your version of UR (${"1.50.0"}) is too old for Remote Control.
|
|
735071
735481
|
Version ${cfg.min_version} or higher is required. Run \`ur update\` to update.`;
|
|
735072
735482
|
}
|
|
735073
735483
|
return null;
|
|
@@ -735541,7 +735951,7 @@ async function initBridgeCore(params) {
|
|
|
735541
735951
|
const rawApi = createBridgeApiClient({
|
|
735542
735952
|
baseUrl,
|
|
735543
735953
|
getAccessToken,
|
|
735544
|
-
runnerVersion: "1.
|
|
735954
|
+
runnerVersion: "1.50.0",
|
|
735545
735955
|
onDebug: logForDebugging,
|
|
735546
735956
|
onAuth401,
|
|
735547
735957
|
getTrustedDeviceToken
|
|
@@ -745010,7 +745420,7 @@ function getAgUiCapabilities() {
|
|
|
745010
745420
|
name: "UR-Nexus",
|
|
745011
745421
|
type: "ur-nexus",
|
|
745012
745422
|
description: "Provider-flexible, local-first autonomous engineering workflow agent.",
|
|
745013
|
-
version: "1.
|
|
745423
|
+
version: "1.50.0",
|
|
745014
745424
|
provider: "UR",
|
|
745015
745425
|
documentationUrl: "https://github.com/Maitham16/UR/blob/master/docs/AG_UI.md"
|
|
745016
745426
|
},
|
|
@@ -746150,7 +746560,7 @@ function createMCPServer(cwd4, debug2, verbose) {
|
|
|
746150
746560
|
};
|
|
746151
746561
|
const server2 = new Server({
|
|
746152
746562
|
name: "ur-nexus",
|
|
746153
|
-
version: "1.
|
|
746563
|
+
version: "1.50.0"
|
|
746154
746564
|
}, {
|
|
746155
746565
|
capabilities: {
|
|
746156
746566
|
tools: {}
|
|
@@ -747308,7 +747718,7 @@ function thrownResponse(error40) {
|
|
|
747308
747718
|
}
|
|
747309
747719
|
async function createUrMcp2026Runtime(options4) {
|
|
747310
747720
|
const server2 = createMCPServer(options4.cwd, options4.debug === true, options4.verbose === true);
|
|
747311
|
-
const client2 = new Client({ name: "ur-mcp-2026-adapter", version: "1.
|
|
747721
|
+
const client2 = new Client({ name: "ur-mcp-2026-adapter", version: "1.50.0" }, { capabilities: {} });
|
|
747312
747722
|
const [clientTransport, serverTransport] = createLinkedTransportPair();
|
|
747313
747723
|
try {
|
|
747314
747724
|
await server2.connect(serverTransport);
|
|
@@ -747319,7 +747729,7 @@ async function createUrMcp2026Runtime(options4) {
|
|
|
747319
747729
|
}
|
|
747320
747730
|
const runtime2 = new Mcp2026Runtime({
|
|
747321
747731
|
cwd: options4.cwd,
|
|
747322
|
-
version: "1.
|
|
747732
|
+
version: "1.50.0",
|
|
747323
747733
|
backend: {
|
|
747324
747734
|
listTools: async () => {
|
|
747325
747735
|
const listed = await client2.listTools();
|
|
@@ -749452,7 +749862,7 @@ async function update() {
|
|
|
749452
749862
|
logEvent("tengu_update_check", {});
|
|
749453
749863
|
const diagnostic2 = await getDoctorDiagnostic();
|
|
749454
749864
|
const result = await checkUpgradeStatus({
|
|
749455
|
-
currentVersion: "1.
|
|
749865
|
+
currentVersion: "1.50.0",
|
|
749456
749866
|
packageName: UR_AGENT_PACKAGE_NAME,
|
|
749457
749867
|
installationType: diagnostic2.installationType,
|
|
749458
749868
|
latestVersion: () => getLatestNpmPackageVersion(UR_AGENT_PACKAGE_NAME)
|
|
@@ -750768,7 +751178,7 @@ ${customInstructions}` : customInstructions;
|
|
|
750768
751178
|
}
|
|
750769
751179
|
}
|
|
750770
751180
|
logForDiagnosticsNoPII("info", "started", {
|
|
750771
|
-
version: "1.
|
|
751181
|
+
version: "1.50.0",
|
|
750772
751182
|
is_native_binary: isInBundledMode()
|
|
750773
751183
|
});
|
|
750774
751184
|
registerCleanup(async () => {
|
|
@@ -751554,7 +751964,7 @@ Usage: ur --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
751554
751964
|
pendingHookMessages
|
|
751555
751965
|
}, renderAndRun);
|
|
751556
751966
|
}
|
|
751557
|
-
}).version("1.
|
|
751967
|
+
}).version("1.50.0 (UR-Nexus)", "-v, --version", "Output the version number");
|
|
751558
751968
|
program2.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
|
|
751559
751969
|
program2.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
|
|
751560
751970
|
if (canUserConfigureAdvisor()) {
|
|
@@ -752570,7 +752980,7 @@ if (false) {}
|
|
|
752570
752980
|
async function main2() {
|
|
752571
752981
|
const args = process.argv.slice(2);
|
|
752572
752982
|
if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
|
|
752573
|
-
console.log(`${"1.
|
|
752983
|
+
console.log(`${"1.50.0"} (UR-Nexus)`);
|
|
752574
752984
|
return;
|
|
752575
752985
|
}
|
|
752576
752986
|
if (args[0] === "a2a" && args[1] === "serve" && !args.includes("--help") && !args.includes("-h")) {
|