ur-agent 1.85.0 → 1.85.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +44 -0
- package/README.md +32 -2
- package/dist/cli.js +1056 -265
- package/docs/AGENT_FEATURES.md +1 -1
- package/docs/CONFIGURATION.md +22 -0
- package/docs/TROUBLESHOOTING.md +39 -0
- package/docs/USAGE.md +26 -3
- package/docs/VALIDATION.md +13 -1
- package/docs/providers.md +28 -5
- package/documentation/app.js +1 -1
- package/documentation/index.html +2 -2
- package/extensions/jetbrains-ur/build.gradle.kts +1 -1
- package/extensions/vscode-ur-inline-diffs/package.json +1 -1
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -60264,15 +60264,76 @@ function errorText(error61) {
|
|
|
60264
60264
|
return `${error61.message}
|
|
60265
60265
|
${error61.body ?? ""}`;
|
|
60266
60266
|
if (axios_default.isAxiosError(error61)) {
|
|
60267
|
-
|
|
60267
|
+
let body = "";
|
|
60268
|
+
if (typeof error61.response?.data === "string") {
|
|
60269
|
+
body = error61.response.data;
|
|
60270
|
+
} else {
|
|
60271
|
+
try {
|
|
60272
|
+
body = JSON.stringify(error61.response?.data ?? "");
|
|
60273
|
+
} catch {
|
|
60274
|
+
body = "";
|
|
60275
|
+
}
|
|
60276
|
+
}
|
|
60268
60277
|
return `${error61.message}
|
|
60269
60278
|
${body}`;
|
|
60270
60279
|
}
|
|
60271
60280
|
return error61 instanceof Error ? error61.message : String(error61);
|
|
60272
60281
|
}
|
|
60282
|
+
function providerErrorPayload(error61) {
|
|
60283
|
+
if (error61 instanceof ProviderHTTPError)
|
|
60284
|
+
return error61.body;
|
|
60285
|
+
if (axios_default.isAxiosError(error61))
|
|
60286
|
+
return error61.response?.data;
|
|
60287
|
+
if (error61 && typeof error61 === "object" && "body" in error61) {
|
|
60288
|
+
return error61.body;
|
|
60289
|
+
}
|
|
60290
|
+
return;
|
|
60291
|
+
}
|
|
60292
|
+
function collectProviderErrorCodes(value, codes, depth = 0) {
|
|
60293
|
+
if (depth > 4 || value === null || value === undefined)
|
|
60294
|
+
return;
|
|
60295
|
+
if (typeof value === "string") {
|
|
60296
|
+
const trimmed = value.trim();
|
|
60297
|
+
if (trimmed.startsWith("{") || trimmed.startsWith("[")) {
|
|
60298
|
+
try {
|
|
60299
|
+
collectProviderErrorCodes(JSON.parse(trimmed), codes, depth + 1);
|
|
60300
|
+
} catch {}
|
|
60301
|
+
}
|
|
60302
|
+
const lower = trimmed.toLowerCase();
|
|
60303
|
+
for (const code of NON_RETRYABLE_PROVIDER_CODES) {
|
|
60304
|
+
if (new RegExp(`(?:^|[^a-z0-9_])${code}(?:$|[^a-z0-9_])`, "u").test(lower)) {
|
|
60305
|
+
codes.add(code);
|
|
60306
|
+
}
|
|
60307
|
+
}
|
|
60308
|
+
return;
|
|
60309
|
+
}
|
|
60310
|
+
if (Array.isArray(value)) {
|
|
60311
|
+
for (const item of value)
|
|
60312
|
+
collectProviderErrorCodes(item, codes, depth + 1);
|
|
60313
|
+
return;
|
|
60314
|
+
}
|
|
60315
|
+
if (typeof value !== "object")
|
|
60316
|
+
return;
|
|
60317
|
+
for (const [key, nested] of Object.entries(value)) {
|
|
60318
|
+
if ((key === "code" || key === "type") && typeof nested === "string") {
|
|
60319
|
+
codes.add(nested.trim().toLowerCase());
|
|
60320
|
+
}
|
|
60321
|
+
if (key === "error" || key === "errors" || key === "detail" || key === "details") {
|
|
60322
|
+
collectProviderErrorCodes(nested, codes, depth + 1);
|
|
60323
|
+
}
|
|
60324
|
+
}
|
|
60325
|
+
}
|
|
60326
|
+
function hasNonRetryableProviderCode(error61) {
|
|
60327
|
+
const codes = new Set;
|
|
60328
|
+
collectProviderErrorCodes(providerErrorPayload(error61), codes);
|
|
60329
|
+
collectProviderErrorCodes(errorText(error61), codes);
|
|
60330
|
+
return [...codes].some((code) => NON_RETRYABLE_PROVIDER_CODES.has(code));
|
|
60331
|
+
}
|
|
60273
60332
|
function isRetryableProviderError(error61) {
|
|
60274
60333
|
if (error61 instanceof ProviderTimeoutError)
|
|
60275
60334
|
return true;
|
|
60335
|
+
if (hasNonRetryableProviderCode(error61))
|
|
60336
|
+
return false;
|
|
60276
60337
|
const status = errorStatus(error61);
|
|
60277
60338
|
if (status !== undefined) {
|
|
60278
60339
|
if (NON_RETRYABLE_STATUSES.has(status))
|
|
@@ -60404,11 +60465,108 @@ async function fetchWithProviderReliability(input2, init, options) {
|
|
|
60404
60465
|
}
|
|
60405
60466
|
async function axiosPostWithProviderReliability(url3, body, config2, options = {}) {
|
|
60406
60467
|
const timeout = options.streaming ? getProviderStreamTimeoutMs(options.timeoutMs) : getProviderRequestTimeoutMs(options.timeoutMs);
|
|
60407
|
-
return withProviderRetry(() =>
|
|
60408
|
-
|
|
60409
|
-
|
|
60410
|
-
|
|
60411
|
-
|
|
60468
|
+
return withProviderRetry(async () => {
|
|
60469
|
+
try {
|
|
60470
|
+
return await axios_default.post(url3, body, {
|
|
60471
|
+
...config2,
|
|
60472
|
+
timeout,
|
|
60473
|
+
signal: options.signal ?? config2.signal
|
|
60474
|
+
});
|
|
60475
|
+
} catch (error61) {
|
|
60476
|
+
if (axios_default.isAxiosError(error61) && error61.response) {
|
|
60477
|
+
let responseData = error61.response.data;
|
|
60478
|
+
if (options.streaming && isAsyncIterable(responseData)) {
|
|
60479
|
+
responseData = await readProviderErrorBody(responseData, options.signal);
|
|
60480
|
+
}
|
|
60481
|
+
const responseBody = serializeProviderErrorData(responseData);
|
|
60482
|
+
const detail = providerErrorMessage(responseBody);
|
|
60483
|
+
throw new ProviderHTTPError(`Provider request failed (${error61.response.status})${detail ? `: ${detail}` : ""}`, {
|
|
60484
|
+
status: error61.response.status,
|
|
60485
|
+
body: responseBody,
|
|
60486
|
+
headers: axiosResponseHeaders(error61.response.headers),
|
|
60487
|
+
cause: error61
|
|
60488
|
+
});
|
|
60489
|
+
}
|
|
60490
|
+
throw error61;
|
|
60491
|
+
}
|
|
60492
|
+
}, { maxRetries: options.maxRetries, signal: options.signal });
|
|
60493
|
+
}
|
|
60494
|
+
function serializeProviderErrorData(value) {
|
|
60495
|
+
if (typeof value === "string")
|
|
60496
|
+
return value;
|
|
60497
|
+
if (value instanceof Uint8Array)
|
|
60498
|
+
return new TextDecoder().decode(value);
|
|
60499
|
+
try {
|
|
60500
|
+
return JSON.stringify(value ?? "");
|
|
60501
|
+
} catch {
|
|
60502
|
+
return "";
|
|
60503
|
+
}
|
|
60504
|
+
}
|
|
60505
|
+
function providerErrorMessage(body) {
|
|
60506
|
+
const trimmed = body.trim();
|
|
60507
|
+
if (!trimmed)
|
|
60508
|
+
return "";
|
|
60509
|
+
try {
|
|
60510
|
+
const parsed = JSON.parse(trimmed);
|
|
60511
|
+
const message = parsed.error?.message ?? parsed.message ?? parsed.detail;
|
|
60512
|
+
if (typeof message === "string") {
|
|
60513
|
+
return message.replace(/\s+/gu, " ").trim().slice(0, 1000);
|
|
60514
|
+
}
|
|
60515
|
+
} catch {}
|
|
60516
|
+
return trimmed.replace(/\s+/gu, " ").slice(0, 1000);
|
|
60517
|
+
}
|
|
60518
|
+
function axiosResponseHeaders(value) {
|
|
60519
|
+
const headers = new Headers;
|
|
60520
|
+
if (!value || typeof value !== "object")
|
|
60521
|
+
return headers;
|
|
60522
|
+
const raw = typeof value.toJSON === "function" ? value.toJSON() : value;
|
|
60523
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw))
|
|
60524
|
+
return headers;
|
|
60525
|
+
for (const [name, header] of Object.entries(raw)) {
|
|
60526
|
+
if (header === undefined || header === null)
|
|
60527
|
+
continue;
|
|
60528
|
+
headers.set(name, Array.isArray(header) ? header.join(", ") : String(header));
|
|
60529
|
+
}
|
|
60530
|
+
return headers;
|
|
60531
|
+
}
|
|
60532
|
+
function isAsyncIterable(value) {
|
|
60533
|
+
return Boolean(value && typeof value === "object" && Symbol.asyncIterator in value && typeof value[Symbol.asyncIterator] === "function");
|
|
60534
|
+
}
|
|
60535
|
+
async function readProviderErrorBody(source, signal) {
|
|
60536
|
+
let timer;
|
|
60537
|
+
const read = async () => {
|
|
60538
|
+
const chunks = [];
|
|
60539
|
+
let bytes = 0;
|
|
60540
|
+
for await (const chunk of source) {
|
|
60541
|
+
if (signal?.aborted)
|
|
60542
|
+
throw signal.reason ?? new Error("aborted");
|
|
60543
|
+
const encoded = typeof chunk === "string" ? new TextEncoder().encode(chunk) : chunk instanceof Uint8Array ? chunk : new TextEncoder().encode(String(chunk ?? ""));
|
|
60544
|
+
const remaining = MAX_PROVIDER_ERROR_BODY_BYTES - bytes;
|
|
60545
|
+
if (remaining <= 0)
|
|
60546
|
+
break;
|
|
60547
|
+
const accepted = encoded.byteLength > remaining ? encoded.subarray(0, remaining) : encoded;
|
|
60548
|
+
chunks.push(accepted);
|
|
60549
|
+
bytes += accepted.byteLength;
|
|
60550
|
+
if (bytes >= MAX_PROVIDER_ERROR_BODY_BYTES)
|
|
60551
|
+
break;
|
|
60552
|
+
}
|
|
60553
|
+
const merged = new Uint8Array(bytes);
|
|
60554
|
+
let offset = 0;
|
|
60555
|
+
for (const chunk of chunks) {
|
|
60556
|
+
merged.set(chunk, offset);
|
|
60557
|
+
offset += chunk.byteLength;
|
|
60558
|
+
}
|
|
60559
|
+
return new TextDecoder().decode(merged);
|
|
60560
|
+
};
|
|
60561
|
+
const deadline = new Promise((_resolve, reject) => {
|
|
60562
|
+
timer = setTimeout(() => reject(new Error("Timed out reading provider error response body.")), PROVIDER_ERROR_BODY_READ_TIMEOUT_MS);
|
|
60563
|
+
});
|
|
60564
|
+
try {
|
|
60565
|
+
return await Promise.race([read(), deadline]);
|
|
60566
|
+
} finally {
|
|
60567
|
+
if (timer !== undefined)
|
|
60568
|
+
clearTimeout(timer);
|
|
60569
|
+
}
|
|
60412
60570
|
}
|
|
60413
60571
|
function trimmedUrl(value) {
|
|
60414
60572
|
const withScheme = /^https?:\/\//i.test(value.trim()) ? value.trim() : `http://${value.trim()}`;
|
|
@@ -60456,13 +60614,22 @@ function normalizeProviderEndpoint(baseUrl, defaultBaseUrl, finalSegment) {
|
|
|
60456
60614
|
}
|
|
60457
60615
|
return url3.toString().replace(/\/$/, "");
|
|
60458
60616
|
}
|
|
60459
|
-
var DEFAULT_PROVIDER_REQUEST_TIMEOUT_MS = 120000, DEFAULT_PROVIDER_STREAM_TIMEOUT_MS = 900000, DEFAULT_PROVIDER_MAX_RETRIES = 3, DEFAULT_RETRY_BASE_DELAY_MS = 250, RETRYABLE_STATUSES, NON_RETRYABLE_STATUSES, TRANSIENT_NETWORK_CODES, ProviderHTTPError, ProviderTimeoutError;
|
|
60617
|
+
var DEFAULT_PROVIDER_REQUEST_TIMEOUT_MS = 120000, DEFAULT_PROVIDER_STREAM_TIMEOUT_MS = 900000, DEFAULT_PROVIDER_MAX_RETRIES = 3, DEFAULT_RETRY_BASE_DELAY_MS = 250, MAX_PROVIDER_ERROR_BODY_BYTES, PROVIDER_ERROR_BODY_READ_TIMEOUT_MS = 1e4, RETRYABLE_STATUSES, NON_RETRYABLE_STATUSES, NON_RETRYABLE_PROVIDER_CODES, TRANSIENT_NETWORK_CODES, ProviderHTTPError, ProviderTimeoutError;
|
|
60460
60618
|
var init_providerHttp = __esm(() => {
|
|
60461
60619
|
init_axios2();
|
|
60462
60620
|
init_settings2();
|
|
60463
60621
|
init_streamIdleTimeout();
|
|
60622
|
+
MAX_PROVIDER_ERROR_BODY_BYTES = 1024 * 1024;
|
|
60464
60623
|
RETRYABLE_STATUSES = new Set([408, 429, 500, 502, 503, 504, 529]);
|
|
60465
60624
|
NON_RETRYABLE_STATUSES = new Set([400, 401, 403, 404, 422]);
|
|
60625
|
+
NON_RETRYABLE_PROVIDER_CODES = new Set([
|
|
60626
|
+
"account_deactivated",
|
|
60627
|
+
"access_terminated",
|
|
60628
|
+
"billing_hard_limit_reached",
|
|
60629
|
+
"billing_not_active",
|
|
60630
|
+
"insufficient_quota",
|
|
60631
|
+
"organization_deactivated"
|
|
60632
|
+
]);
|
|
60466
60633
|
TRANSIENT_NETWORK_CODES = new Set([
|
|
60467
60634
|
"ECONNRESET",
|
|
60468
60635
|
"ECONNREFUSED",
|
|
@@ -60508,6 +60675,45 @@ var init_providerHttp = __esm(() => {
|
|
|
60508
60675
|
};
|
|
60509
60676
|
});
|
|
60510
60677
|
|
|
60678
|
+
// src/services/providers/anthropicWorkspace.ts
|
|
60679
|
+
function isAnthropicWorkspaceId(value) {
|
|
60680
|
+
return ANTHROPIC_WORKSPACE_ID_PATTERN.test(value.trim());
|
|
60681
|
+
}
|
|
60682
|
+
function validateAnthropicWorkspaceId(value) {
|
|
60683
|
+
const trimmed = value.trim();
|
|
60684
|
+
if (!isAnthropicWorkspaceId(trimmed)) {
|
|
60685
|
+
return {
|
|
60686
|
+
ok: false,
|
|
60687
|
+
message: 'Anthropic workspace IDs start with "wrkspc_". Find the ID in Claude Console \u2192 Settings \u2192 Workspaces.'
|
|
60688
|
+
};
|
|
60689
|
+
}
|
|
60690
|
+
return { ok: true, value: trimmed };
|
|
60691
|
+
}
|
|
60692
|
+
function resolveAnthropicWorkspaceId(configured, env4 = process.env) {
|
|
60693
|
+
const raw = configured?.trim() || env4[ANTHROPIC_WORKSPACE_ENV_KEY]?.trim();
|
|
60694
|
+
if (!raw)
|
|
60695
|
+
return;
|
|
60696
|
+
const validated = validateAnthropicWorkspaceId(raw);
|
|
60697
|
+
if (validated.ok === false) {
|
|
60698
|
+
throw new Error(`${configured?.trim() ? "provider.anthropic.workspaceId" : ANTHROPIC_WORKSPACE_ENV_KEY} is invalid. ${validated.message}`);
|
|
60699
|
+
}
|
|
60700
|
+
return validated.value;
|
|
60701
|
+
}
|
|
60702
|
+
function anthropicWorkspaceHeaders(configured, env4 = process.env) {
|
|
60703
|
+
const workspaceId = resolveAnthropicWorkspaceId(configured, env4);
|
|
60704
|
+
return workspaceId ? { "anthropic-workspace-id": workspaceId } : {};
|
|
60705
|
+
}
|
|
60706
|
+
function isAnthropicWorkspaceRequiredError(message) {
|
|
60707
|
+
return /anthropic-workspace-id is required|identity-linked API key/iu.test(message);
|
|
60708
|
+
}
|
|
60709
|
+
function anthropicWorkspaceFix() {
|
|
60710
|
+
return "Set ANTHROPIC_WORKSPACE_ID, run `ur connect anthropic-api --workspace-id wrkspc_...`, or run `ur config set anthropic.workspace_id wrkspc_...`";
|
|
60711
|
+
}
|
|
60712
|
+
var ANTHROPIC_WORKSPACE_ENV_KEY = "ANTHROPIC_WORKSPACE_ID", ANTHROPIC_WORKSPACE_ID_PATTERN;
|
|
60713
|
+
var init_anthropicWorkspace = __esm(() => {
|
|
60714
|
+
ANTHROPIC_WORKSPACE_ID_PATTERN = /^wrkspc_[A-Za-z0-9]+$/u;
|
|
60715
|
+
});
|
|
60716
|
+
|
|
60511
60717
|
// src/services/providers/modelCatalog.ts
|
|
60512
60718
|
function asString(value) {
|
|
60513
60719
|
return typeof value === "string" && value.trim() ? value.trim() : undefined;
|
|
@@ -70974,6 +71180,19 @@ function setSafeProviderConfig(key, value, options = {}) {
|
|
|
70974
71180
|
}
|
|
70975
71181
|
}
|
|
70976
71182
|
};
|
|
71183
|
+
} else if (key === "anthropic.workspace_id") {
|
|
71184
|
+
if (trimmed === "auto") {
|
|
71185
|
+
settings = {
|
|
71186
|
+
provider: { anthropic: { workspaceId: undefined } }
|
|
71187
|
+
};
|
|
71188
|
+
} else {
|
|
71189
|
+
const workspace = validateAnthropicWorkspaceId(trimmed);
|
|
71190
|
+
if (workspace.ok === false)
|
|
71191
|
+
return workspace;
|
|
71192
|
+
settings = {
|
|
71193
|
+
provider: { anthropic: { workspaceId: workspace.value } }
|
|
71194
|
+
};
|
|
71195
|
+
}
|
|
70977
71196
|
} else if (key === "model") {
|
|
70978
71197
|
const currentSettings = getInitialSettings();
|
|
70979
71198
|
const currentProvider = getActiveProviderSettings(currentSettings).active ?? "ollama";
|
|
@@ -71435,7 +71654,16 @@ async function checkApiProvider(definition, settings, adapters, result) {
|
|
|
71435
71654
|
}
|
|
71436
71655
|
if (!apiKey || !baseUrl)
|
|
71437
71656
|
return;
|
|
71438
|
-
|
|
71657
|
+
let workspaceId;
|
|
71658
|
+
try {
|
|
71659
|
+
workspaceId = definition.id === "anthropic-api" ? resolveAnthropicWorkspaceId(settings.anthropic?.workspaceId, env4) : undefined;
|
|
71660
|
+
} catch (error61) {
|
|
71661
|
+
const message = error61 instanceof Error ? error61.message : String(error61);
|
|
71662
|
+
result.checks.push({ name: "workspace", status: "fail", message });
|
|
71663
|
+
addFailure(result, message, anthropicWorkspaceFix());
|
|
71664
|
+
return;
|
|
71665
|
+
}
|
|
71666
|
+
const request = apiModelsRequestForBase(definition.id, apiKey, baseUrl, workspaceId);
|
|
71439
71667
|
try {
|
|
71440
71668
|
const response = await (adapters.fetch ?? fetch)(request.url, {
|
|
71441
71669
|
method: "GET",
|
|
@@ -71443,12 +71671,14 @@ async function checkApiProvider(definition, settings, adapters, result) {
|
|
|
71443
71671
|
signal: AbortSignal.timeout(1e4)
|
|
71444
71672
|
});
|
|
71445
71673
|
if (!response.ok) {
|
|
71674
|
+
const detail = await providerHttpErrorDetail(response);
|
|
71675
|
+
const failure = detail ? `endpoint returned HTTP ${response.status}: ${detail}` : `endpoint returned HTTP ${response.status}`;
|
|
71446
71676
|
result.checks.push({
|
|
71447
71677
|
name: "endpoint",
|
|
71448
71678
|
status: "fail",
|
|
71449
|
-
message: `${request.url} returned HTTP ${response.status}
|
|
71679
|
+
message: `${request.url} returned HTTP ${response.status}${detail ? `: ${detail}` : "."}`
|
|
71450
71680
|
});
|
|
71451
|
-
addFailure(result,
|
|
71681
|
+
addFailure(result, failure, definition.id === "anthropic-api" && isAnthropicWorkspaceRequiredError(detail) ? anthropicWorkspaceFix() : `Check the API key or update base_url: ur config set base_url ${definition.id} ${baseUrl}`);
|
|
71452
71682
|
return;
|
|
71453
71683
|
}
|
|
71454
71684
|
result.checks.push({
|
|
@@ -71466,6 +71696,23 @@ async function checkApiProvider(definition, settings, adapters, result) {
|
|
|
71466
71696
|
addFailure(result, message, `Update base_url or start the configured gateway: ur config set base_url ${definition.id} ${baseUrl}`);
|
|
71467
71697
|
}
|
|
71468
71698
|
}
|
|
71699
|
+
async function providerHttpErrorDetail(response) {
|
|
71700
|
+
try {
|
|
71701
|
+
const raw = (await response.text()).trim();
|
|
71702
|
+
if (!raw)
|
|
71703
|
+
return "";
|
|
71704
|
+
let detail = raw;
|
|
71705
|
+
try {
|
|
71706
|
+
const parsed = JSON.parse(raw);
|
|
71707
|
+
const providerMessage = parsed.error?.message ?? parsed.message;
|
|
71708
|
+
if (typeof providerMessage === "string")
|
|
71709
|
+
detail = providerMessage;
|
|
71710
|
+
} catch {}
|
|
71711
|
+
return detail.replace(/\s+/gu, " ").trim().slice(0, 1000);
|
|
71712
|
+
} catch {
|
|
71713
|
+
return "";
|
|
71714
|
+
}
|
|
71715
|
+
}
|
|
71469
71716
|
function fallbackResult(settings, active, ok) {
|
|
71470
71717
|
if (ok)
|
|
71471
71718
|
return;
|
|
@@ -71949,7 +72196,11 @@ function providerModelCacheKey(provider, settings = getInitialSettings()) {
|
|
|
71949
72196
|
}
|
|
71950
72197
|
if (!endpoint)
|
|
71951
72198
|
return provider;
|
|
71952
|
-
|
|
72199
|
+
const endpointKey = providerEndpointCacheKey(provider, endpoint);
|
|
72200
|
+
if (provider !== "anthropic-api")
|
|
72201
|
+
return endpointKey;
|
|
72202
|
+
const workspaceId = resolveAnthropicWorkspaceId(getActiveProviderSettings(settings).anthropic?.workspaceId, process.env);
|
|
72203
|
+
return `${endpointKey}|workspace:${workspaceId ?? "implicit"}`;
|
|
71953
72204
|
}
|
|
71954
72205
|
function providerEndpointCacheKey(provider, endpoint) {
|
|
71955
72206
|
try {
|
|
@@ -72317,7 +72568,7 @@ async function discoverLiveModelsForProvider(provider, options = {}) {
|
|
|
72317
72568
|
}
|
|
72318
72569
|
return [];
|
|
72319
72570
|
}
|
|
72320
|
-
function apiModelsRequestForBase(provider, apiKey, configuredBase) {
|
|
72571
|
+
function apiModelsRequestForBase(provider, apiKey, configuredBase, anthropicWorkspaceId) {
|
|
72321
72572
|
const providerDefault = getProviderDefinition(provider).defaultBaseUrl;
|
|
72322
72573
|
const modelsUrl = (baseUrl, version2) => {
|
|
72323
72574
|
const url3 = new URL(normalizeBaseUrl(baseUrl));
|
|
@@ -72335,7 +72586,11 @@ function apiModelsRequestForBase(provider, apiKey, configuredBase) {
|
|
|
72335
72586
|
case "anthropic-api":
|
|
72336
72587
|
return {
|
|
72337
72588
|
url: modelsUrl(configuredBase ?? providerDefault, "v1"),
|
|
72338
|
-
headers: {
|
|
72589
|
+
headers: {
|
|
72590
|
+
"x-api-key": apiKey,
|
|
72591
|
+
"anthropic-version": "2023-06-01",
|
|
72592
|
+
...anthropicWorkspaceHeaders(anthropicWorkspaceId, {})
|
|
72593
|
+
}
|
|
72339
72594
|
};
|
|
72340
72595
|
case "gemini-api":
|
|
72341
72596
|
return {
|
|
@@ -72354,8 +72609,9 @@ function apiModelsRequestForBase(provider, apiKey, configuredBase) {
|
|
|
72354
72609
|
};
|
|
72355
72610
|
}
|
|
72356
72611
|
}
|
|
72357
|
-
function apiModelsRequest(provider, apiKey, settings) {
|
|
72358
|
-
|
|
72612
|
+
function apiModelsRequest(provider, apiKey, settings, env4 = process.env) {
|
|
72613
|
+
const providerSettings = getActiveProviderSettings(settings);
|
|
72614
|
+
return apiModelsRequestForBase(provider, apiKey, getScopedProviderBaseUrl(provider, settings), provider === "anthropic-api" ? resolveAnthropicWorkspaceId(providerSettings.anthropic?.workspaceId, env4) : undefined);
|
|
72359
72615
|
}
|
|
72360
72616
|
function apiModelEntries(provider, body) {
|
|
72361
72617
|
const root2 = body ?? {};
|
|
@@ -72411,7 +72667,7 @@ async function discoverApiProviderModels(provider, definition, options) {
|
|
|
72411
72667
|
if (!apiKey) {
|
|
72412
72668
|
throw new Error(`Not connected: run \`ur connect ${provider}\` to add an API key.`);
|
|
72413
72669
|
}
|
|
72414
|
-
const { url: url3, headers } = apiModelsRequest(provider, apiKey, options.settings ?? getInitialSettings());
|
|
72670
|
+
const { url: url3, headers } = apiModelsRequest(provider, apiKey, options.settings ?? getInitialSettings(), env4);
|
|
72415
72671
|
const fetchImpl = options.adapters?.fetch ?? fetch;
|
|
72416
72672
|
const entries = [];
|
|
72417
72673
|
const seenPageTokens = new Set;
|
|
@@ -72424,7 +72680,9 @@ async function discoverApiProviderModels(provider, definition, options) {
|
|
|
72424
72680
|
headers
|
|
72425
72681
|
});
|
|
72426
72682
|
if (!response.ok) {
|
|
72427
|
-
|
|
72683
|
+
const detail = await providerHttpErrorDetail(response);
|
|
72684
|
+
const workspaceHelp = provider === "anthropic-api" && isAnthropicWorkspaceRequiredError(detail) ? ` ${anthropicWorkspaceFix()}` : "";
|
|
72685
|
+
throw new Error(`${pageUrl} returned HTTP ${response.status}${detail ? `: ${detail}` : "."}${workspaceHelp}`);
|
|
72428
72686
|
}
|
|
72429
72687
|
let body;
|
|
72430
72688
|
try {
|
|
@@ -72718,6 +72976,7 @@ var init_providerRegistry = __esm(() => {
|
|
|
72718
72976
|
init_settings2();
|
|
72719
72977
|
init_which();
|
|
72720
72978
|
init_providerHttp();
|
|
72979
|
+
init_anthropicWorkspace();
|
|
72721
72980
|
init_modelCatalog();
|
|
72722
72981
|
init_nvidiaHostedModels();
|
|
72723
72982
|
PROVIDER_IDS = [
|
|
@@ -72895,8 +73154,8 @@ var init_providerRegistry = __esm(() => {
|
|
|
72895
73154
|
runtimeKind: "ur-native",
|
|
72896
73155
|
...UR_NATIVE_CAPABILITIES,
|
|
72897
73156
|
authMode: "api",
|
|
72898
|
-
legalPath: "ANTHROPIC_API_KEY",
|
|
72899
|
-
accessPathLabel: "API key from ANTHROPIC_API_KEY",
|
|
73157
|
+
legalPath: "ANTHROPIC_API_KEY with ANTHROPIC_WORKSPACE_ID when required",
|
|
73158
|
+
accessPathLabel: "API key from ANTHROPIC_API_KEY and optional workspace selection",
|
|
72900
73159
|
envKey: "ANTHROPIC_API_KEY",
|
|
72901
73160
|
defaultBaseUrl: "https://api.anthropic.com/v1"
|
|
72902
73161
|
},
|
|
@@ -107781,6 +108040,7 @@ __export(exports_model, {
|
|
|
107781
108040
|
getDefaultOllamaModel: () => getDefaultOllamaModel,
|
|
107782
108041
|
getDefaultMainLoopModelSetting: () => getDefaultMainLoopModelSetting,
|
|
107783
108042
|
getDefaultMainLoopModel: () => getDefaultMainLoopModel,
|
|
108043
|
+
getConfiguredModelForActiveProvider: () => getConfiguredModelForActiveProvider,
|
|
107784
108044
|
getCanonicalName: () => getCanonicalName,
|
|
107785
108045
|
getBestModel: () => getBestModel,
|
|
107786
108046
|
firstPartyNameToCanonical: () => firstPartyNameToCanonical,
|
|
@@ -107837,13 +108097,16 @@ function getUserSpecifiedModelSetting() {
|
|
|
107837
108097
|
specifiedModel = modelOverride;
|
|
107838
108098
|
} else {
|
|
107839
108099
|
const settings = getSettings_DEPRECATED() || {};
|
|
107840
|
-
specifiedModel = process.env.URHQ_MODEL || settings
|
|
108100
|
+
specifiedModel = process.env.URHQ_MODEL || getConfiguredModelForActiveProvider(settings) || undefined;
|
|
107841
108101
|
}
|
|
107842
108102
|
if (specifiedModel && !isModelAllowed(specifiedModel)) {
|
|
107843
108103
|
return;
|
|
107844
108104
|
}
|
|
107845
108105
|
return specifiedModel;
|
|
107846
108106
|
}
|
|
108107
|
+
function getConfiguredModelForActiveProvider(settings) {
|
|
108108
|
+
return getActiveProviderSettings(settings).model;
|
|
108109
|
+
}
|
|
107847
108110
|
function getMainLoopModel() {
|
|
107848
108111
|
const model = getUserSpecifiedModelSetting();
|
|
107849
108112
|
if (model !== undefined && model !== null) {
|
|
@@ -241109,7 +241372,7 @@ var init_metadata = __esm(() => {
|
|
|
241109
241372
|
COMPOUND_OPERATOR_REGEX = /\s*(?:&&|\|\||[;|])\s*/;
|
|
241110
241373
|
WHITESPACE_REGEX2 = /\s+/;
|
|
241111
241374
|
getVersionBase = memoize_default(() => {
|
|
241112
|
-
const match = "1.85.
|
|
241375
|
+
const match = "1.85.2".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
|
|
241113
241376
|
return match ? match[0] : undefined;
|
|
241114
241377
|
});
|
|
241115
241378
|
buildEnvContext = memoize_default(async () => {
|
|
@@ -241149,7 +241412,7 @@ var init_metadata = __esm(() => {
|
|
|
241149
241412
|
isGithubAction: isEnvTruthy(process.env.GITHUB_ACTIONS),
|
|
241150
241413
|
isURCodeAction: isEnvTruthy(process.env.UR_CODE_ACTION),
|
|
241151
241414
|
isURAiAuth: isURAISubscriber(),
|
|
241152
|
-
version: "1.85.
|
|
241415
|
+
version: "1.85.2",
|
|
241153
241416
|
versionBase: getVersionBase(),
|
|
241154
241417
|
buildTime: "",
|
|
241155
241418
|
deploymentEnvironment: env2.detectDeploymentEnvironment(),
|
|
@@ -248588,7 +248851,7 @@ function getAttributionHeader(fingerprint) {
|
|
|
248588
248851
|
if (!isAttributionHeaderEnabled()) {
|
|
248589
248852
|
return "";
|
|
248590
248853
|
}
|
|
248591
|
-
const version2 = `${"1.85.
|
|
248854
|
+
const version2 = `${"1.85.2"}.${fingerprint}`;
|
|
248592
248855
|
const entrypoint = process.env.UR_CODE_ENTRYPOINT ?? "unknown";
|
|
248593
248856
|
const cch = "";
|
|
248594
248857
|
const workload = getWorkload();
|
|
@@ -282071,6 +282334,7 @@ var init_types4 = __esm(() => {
|
|
|
282071
282334
|
speed: exports_external.enum(["standard", "fast"]).optional().describe("Request OpenRouter fast mode on models that explicitly support it.")
|
|
282072
282335
|
}).optional().describe("OpenRouter performance and routing controls."),
|
|
282073
282336
|
anthropic: exports_external.object({
|
|
282337
|
+
workspaceId: exports_external.string().regex(/^wrkspc_[A-Za-z0-9]+$/u).optional().describe("Claude API workspace selected for an identity-linked multi-workspace key."),
|
|
282074
282338
|
speed: exports_external.enum(["standard", "fast"]).optional().describe("Anthropic inference speed. Fast is an opt-in, premium research preview available only to enabled accounts and supported Opus models.")
|
|
282075
282339
|
}).optional().describe("Anthropic API performance controls."),
|
|
282076
282340
|
preferences: exports_external.record(exports_external.string(), NonSecretPreferenceSchema).optional().describe("Non-secret provider preferences only")
|
|
@@ -292522,7 +292786,25 @@ var require_utils3 = __commonJS((exports, module) => {
|
|
|
292522
292786
|
var isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);
|
|
292523
292787
|
var isHexPair = RegExp.prototype.test.bind(/^[\da-f]{2}$/iu);
|
|
292524
292788
|
var isUnreserved = RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu);
|
|
292525
|
-
var isPathCharacter = RegExp.prototype.test.bind(/^[
|
|
292789
|
+
var isPathCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u);
|
|
292790
|
+
var isQueryFragmentCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u);
|
|
292791
|
+
var isUserinfoCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u);
|
|
292792
|
+
var BYTE_HEX = new Array(256);
|
|
292793
|
+
{
|
|
292794
|
+
const HEX_DIGITS = "0123456789ABCDEF";
|
|
292795
|
+
for (let i3 = 0;i3 < 256; i3++) {
|
|
292796
|
+
BYTE_HEX[i3] = "%" + HEX_DIGITS[i3 >> 4] + HEX_DIGITS[i3 & 15];
|
|
292797
|
+
}
|
|
292798
|
+
}
|
|
292799
|
+
function percentEncodeNonAscii(cp) {
|
|
292800
|
+
if (cp < 2048) {
|
|
292801
|
+
return BYTE_HEX[192 | cp >> 6] + BYTE_HEX[128 | cp & 63];
|
|
292802
|
+
}
|
|
292803
|
+
if (cp < 65536) {
|
|
292804
|
+
return BYTE_HEX[224 | cp >> 12] + BYTE_HEX[128 | cp >> 6 & 63] + BYTE_HEX[128 | cp & 63];
|
|
292805
|
+
}
|
|
292806
|
+
return BYTE_HEX[240 | cp >> 18] + BYTE_HEX[128 | cp >> 12 & 63] + BYTE_HEX[128 | cp >> 6 & 63] + BYTE_HEX[128 | cp & 63];
|
|
292807
|
+
}
|
|
292526
292808
|
function stringArrayToHexStripped(input2) {
|
|
292527
292809
|
let acc = "";
|
|
292528
292810
|
let code = 0;
|
|
@@ -292547,91 +292829,122 @@ var require_utils3 = __commonJS((exports, module) => {
|
|
|
292547
292829
|
}
|
|
292548
292830
|
return acc;
|
|
292549
292831
|
}
|
|
292832
|
+
var isHextet = RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/);
|
|
292833
|
+
var isIPvFuture = RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/);
|
|
292834
|
+
var isZoneCharacter = RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/);
|
|
292550
292835
|
var nonSimpleDomain = RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);
|
|
292551
|
-
function
|
|
292552
|
-
|
|
292553
|
-
|
|
292554
|
-
|
|
292555
|
-
|
|
292556
|
-
|
|
292557
|
-
|
|
292558
|
-
|
|
292559
|
-
|
|
292560
|
-
} else {
|
|
292561
|
-
output2.error = true;
|
|
292562
|
-
return false;
|
|
292836
|
+
function isZoneIdentifier(zone) {
|
|
292837
|
+
if (zone.length === 0)
|
|
292838
|
+
return false;
|
|
292839
|
+
for (let i3 = 0;i3 < zone.length; i3++) {
|
|
292840
|
+
if (isZoneCharacter(zone[i3]))
|
|
292841
|
+
continue;
|
|
292842
|
+
if (zone[i3] === "%" && i3 + 2 < zone.length && isHexPair(zone.slice(i3 + 1, i3 + 3))) {
|
|
292843
|
+
i3 += 2;
|
|
292844
|
+
continue;
|
|
292563
292845
|
}
|
|
292564
|
-
|
|
292846
|
+
return false;
|
|
292565
292847
|
}
|
|
292566
292848
|
return true;
|
|
292567
292849
|
}
|
|
292568
|
-
function
|
|
292569
|
-
let
|
|
292570
|
-
|
|
292571
|
-
|
|
292572
|
-
|
|
292573
|
-
let
|
|
292574
|
-
|
|
292575
|
-
|
|
292576
|
-
|
|
292577
|
-
|
|
292578
|
-
|
|
292579
|
-
|
|
292580
|
-
|
|
292581
|
-
|
|
292582
|
-
|
|
292583
|
-
|
|
292584
|
-
|
|
292585
|
-
|
|
292586
|
-
|
|
292587
|
-
|
|
292588
|
-
|
|
292589
|
-
|
|
292590
|
-
|
|
292591
|
-
|
|
292592
|
-
|
|
292593
|
-
|
|
292594
|
-
|
|
292595
|
-
|
|
292596
|
-
|
|
292597
|
-
|
|
292598
|
-
|
|
292599
|
-
|
|
292600
|
-
|
|
292601
|
-
|
|
292602
|
-
|
|
292603
|
-
|
|
292850
|
+
function compressIPv6ZeroRun(hextets) {
|
|
292851
|
+
let bestStart = -1;
|
|
292852
|
+
let bestLength = 0;
|
|
292853
|
+
let runStart = -1;
|
|
292854
|
+
let runLength = 0;
|
|
292855
|
+
for (let i3 = 0;i3 < hextets.length; i3++) {
|
|
292856
|
+
if (hextets[i3] === "0") {
|
|
292857
|
+
if (runStart === -1)
|
|
292858
|
+
runStart = i3;
|
|
292859
|
+
runLength++;
|
|
292860
|
+
if (runLength > bestLength) {
|
|
292861
|
+
bestLength = runLength;
|
|
292862
|
+
bestStart = runStart;
|
|
292863
|
+
}
|
|
292864
|
+
} else {
|
|
292865
|
+
runStart = -1;
|
|
292866
|
+
runLength = 0;
|
|
292867
|
+
}
|
|
292868
|
+
}
|
|
292869
|
+
if (bestLength < 2)
|
|
292870
|
+
return hextets.join(":");
|
|
292871
|
+
const head = hextets.slice(0, bestStart).join(":");
|
|
292872
|
+
const tail = hextets.slice(bestStart + bestLength).join(":");
|
|
292873
|
+
return head + "::" + tail;
|
|
292874
|
+
}
|
|
292875
|
+
function normalizeIPv6Address(input2) {
|
|
292876
|
+
const compression = input2.indexOf("::");
|
|
292877
|
+
if (compression !== -1 && input2.indexOf("::", compression + 1) !== -1)
|
|
292878
|
+
return;
|
|
292879
|
+
const left = compression === -1 ? input2.split(":") : input2.slice(0, compression).split(":");
|
|
292880
|
+
const right = compression === -1 ? [] : input2.slice(compression + 2).split(":");
|
|
292881
|
+
if (compression !== -1) {
|
|
292882
|
+
if (left.length === 1 && left[0] === "")
|
|
292883
|
+
left.length = 0;
|
|
292884
|
+
if (right.length === 1 && right[0] === "")
|
|
292885
|
+
right.length = 0;
|
|
292886
|
+
}
|
|
292887
|
+
const parts = left.concat(right);
|
|
292888
|
+
let hextetCount = 0;
|
|
292889
|
+
for (let i3 = 0;i3 < parts.length; i3++) {
|
|
292890
|
+
const part = parts[i3];
|
|
292891
|
+
if (part === "")
|
|
292892
|
+
return;
|
|
292893
|
+
if (part.indexOf(".") !== -1) {
|
|
292894
|
+
if (i3 !== parts.length - 1 || compression !== -1 && right.length === 0 || !isIPv4(part))
|
|
292895
|
+
return;
|
|
292896
|
+
hextetCount += 2;
|
|
292604
292897
|
continue;
|
|
292605
292898
|
}
|
|
292899
|
+
if (!isHextet(part))
|
|
292900
|
+
return;
|
|
292901
|
+
parts[i3] = parseInt(part, 16).toString(16);
|
|
292902
|
+
hextetCount++;
|
|
292606
292903
|
}
|
|
292607
|
-
if (
|
|
292608
|
-
if (
|
|
292609
|
-
|
|
292610
|
-
|
|
292611
|
-
address.push(buffer.join(""));
|
|
292612
|
-
} else {
|
|
292613
|
-
address.push(stringArrayToHexStripped(buffer));
|
|
292614
|
-
}
|
|
292904
|
+
if (compression === -1) {
|
|
292905
|
+
if (hextetCount !== 8)
|
|
292906
|
+
return;
|
|
292907
|
+
return compressIPv6ZeroRun(parts);
|
|
292615
292908
|
}
|
|
292616
|
-
|
|
292617
|
-
|
|
292909
|
+
if (hextetCount >= 8)
|
|
292910
|
+
return;
|
|
292911
|
+
const expanded = parts.slice(0, left.length);
|
|
292912
|
+
for (let i3 = hextetCount;i3 < 8; i3++)
|
|
292913
|
+
expanded.push("0");
|
|
292914
|
+
for (let i3 = left.length;i3 < parts.length; i3++)
|
|
292915
|
+
expanded.push(parts[i3]);
|
|
292916
|
+
return compressIPv6ZeroRun(expanded);
|
|
292618
292917
|
}
|
|
292619
292918
|
function normalizeIPv6(host) {
|
|
292620
|
-
|
|
292621
|
-
|
|
292622
|
-
|
|
292623
|
-
|
|
292624
|
-
|
|
292625
|
-
|
|
292626
|
-
|
|
292627
|
-
|
|
292628
|
-
|
|
292629
|
-
|
|
292630
|
-
}
|
|
292631
|
-
|
|
292632
|
-
|
|
292633
|
-
|
|
292634
|
-
|
|
292919
|
+
const bracketed = host[0] === "[" && host[host.length - 1] === "]";
|
|
292920
|
+
const hasBracket = host[0] === "[" || host[host.length - 1] === "]";
|
|
292921
|
+
if (hasBracket && !bracketed)
|
|
292922
|
+
return { host, isIPV6: false, error: true };
|
|
292923
|
+
let input2 = bracketed ? host.slice(1, -1) : host;
|
|
292924
|
+
if (bracketed && isIPvFuture(input2)) {
|
|
292925
|
+
input2 = input2.toLowerCase();
|
|
292926
|
+
return { host: `[${input2}]`, escapedHost: input2, isIPV6: false, isIPVFuture: true };
|
|
292927
|
+
}
|
|
292928
|
+
if (findToken(input2, ":") < 2) {
|
|
292929
|
+
return { host, isIPV6: false, error: bracketed };
|
|
292930
|
+
}
|
|
292931
|
+
let zoneIdentifier = "";
|
|
292932
|
+
const zoneSeparator = input2.indexOf("%");
|
|
292933
|
+
if (zoneSeparator !== -1) {
|
|
292934
|
+
const separatorLength = input2.slice(zoneSeparator, zoneSeparator + 3).toLowerCase() === "%25" ? 3 : 1;
|
|
292935
|
+
zoneIdentifier = input2.slice(zoneSeparator + separatorLength);
|
|
292936
|
+
if (!isZoneIdentifier(zoneIdentifier))
|
|
292937
|
+
return { host, isIPV6: false, error: true };
|
|
292938
|
+
input2 = input2.slice(0, zoneSeparator);
|
|
292939
|
+
}
|
|
292940
|
+
const address = normalizeIPv6Address(input2);
|
|
292941
|
+
if (address === undefined)
|
|
292942
|
+
return { host, isIPV6: false, error: true };
|
|
292943
|
+
return {
|
|
292944
|
+
host: address + (zoneIdentifier ? "%" + zoneIdentifier : ""),
|
|
292945
|
+
escapedHost: address + (zoneIdentifier ? "%25" + zoneIdentifier : ""),
|
|
292946
|
+
isIPV6: true
|
|
292947
|
+
};
|
|
292635
292948
|
}
|
|
292636
292949
|
function findToken(str2, token) {
|
|
292637
292950
|
let ind = 0;
|
|
@@ -292751,7 +293064,8 @@ var require_utils3 = __commonJS((exports, module) => {
|
|
|
292751
293064
|
function normalizePathEncoding(input2) {
|
|
292752
293065
|
let output2 = "";
|
|
292753
293066
|
for (let i3 = 0;i3 < input2.length; i3++) {
|
|
292754
|
-
|
|
293067
|
+
const ch2 = input2[i3];
|
|
293068
|
+
if (ch2 === "%" && i3 + 2 < input2.length) {
|
|
292755
293069
|
const hex3 = input2.slice(i3 + 1, i3 + 3);
|
|
292756
293070
|
if (isHexPair(hex3)) {
|
|
292757
293071
|
const normalizedHex = hex3.toUpperCase();
|
|
@@ -292765,10 +293079,152 @@ var require_utils3 = __commonJS((exports, module) => {
|
|
|
292765
293079
|
continue;
|
|
292766
293080
|
}
|
|
292767
293081
|
}
|
|
292768
|
-
if (isPathCharacter(
|
|
292769
|
-
output2 +=
|
|
293082
|
+
if (isPathCharacter(ch2)) {
|
|
293083
|
+
output2 += ch2;
|
|
292770
293084
|
} else {
|
|
292771
|
-
|
|
293085
|
+
const code = input2.charCodeAt(i3);
|
|
293086
|
+
if (code < 128) {
|
|
293087
|
+
output2 += isEscapeSafe(code) ? ch2 : BYTE_HEX[code];
|
|
293088
|
+
} else if (code < 55296 || code > 57343) {
|
|
293089
|
+
output2 += percentEncodeNonAscii(code);
|
|
293090
|
+
} else if (code <= 56319 && i3 + 1 < input2.length) {
|
|
293091
|
+
const low = input2.charCodeAt(i3 + 1);
|
|
293092
|
+
if (low >= 56320 && low <= 57343) {
|
|
293093
|
+
output2 += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
|
|
293094
|
+
i3++;
|
|
293095
|
+
} else {
|
|
293096
|
+
output2 += percentEncodeNonAscii(65533);
|
|
293097
|
+
}
|
|
293098
|
+
} else {
|
|
293099
|
+
output2 += percentEncodeNonAscii(65533);
|
|
293100
|
+
}
|
|
293101
|
+
}
|
|
293102
|
+
}
|
|
293103
|
+
return output2;
|
|
293104
|
+
}
|
|
293105
|
+
function serializePathEncoding(input2, pathNoScheme = false) {
|
|
293106
|
+
let output2 = "";
|
|
293107
|
+
let firstSegment = pathNoScheme && input2[0] !== "/";
|
|
293108
|
+
for (let i3 = 0;i3 < input2.length; i3++) {
|
|
293109
|
+
const ch2 = input2[i3];
|
|
293110
|
+
if (ch2 === "%" && i3 + 2 < input2.length) {
|
|
293111
|
+
const hex3 = input2.slice(i3 + 1, i3 + 3);
|
|
293112
|
+
if (isHexPair(hex3)) {
|
|
293113
|
+
output2 += "%" + hex3.toUpperCase();
|
|
293114
|
+
i3 += 2;
|
|
293115
|
+
continue;
|
|
293116
|
+
}
|
|
293117
|
+
}
|
|
293118
|
+
if (ch2 === "/") {
|
|
293119
|
+
firstSegment = false;
|
|
293120
|
+
}
|
|
293121
|
+
if (isPathCharacter(ch2) && (ch2 !== ":" || !firstSegment)) {
|
|
293122
|
+
output2 += ch2;
|
|
293123
|
+
} else {
|
|
293124
|
+
const code = input2.charCodeAt(i3);
|
|
293125
|
+
if (code < 128) {
|
|
293126
|
+
output2 += BYTE_HEX[code];
|
|
293127
|
+
} else if (code < 55296 || code > 57343) {
|
|
293128
|
+
output2 += percentEncodeNonAscii(code);
|
|
293129
|
+
} else if (code <= 56319 && i3 + 1 < input2.length) {
|
|
293130
|
+
const low = input2.charCodeAt(i3 + 1);
|
|
293131
|
+
if (low >= 56320 && low <= 57343) {
|
|
293132
|
+
output2 += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
|
|
293133
|
+
i3++;
|
|
293134
|
+
} else {
|
|
293135
|
+
output2 += percentEncodeNonAscii(65533);
|
|
293136
|
+
}
|
|
293137
|
+
} else {
|
|
293138
|
+
output2 += percentEncodeNonAscii(65533);
|
|
293139
|
+
}
|
|
293140
|
+
}
|
|
293141
|
+
}
|
|
293142
|
+
return output2;
|
|
293143
|
+
}
|
|
293144
|
+
function encodeComponent(input2, isAllowed) {
|
|
293145
|
+
let output2 = "";
|
|
293146
|
+
for (let i3 = 0;i3 < input2.length; i3++) {
|
|
293147
|
+
const ch2 = input2[i3];
|
|
293148
|
+
if (ch2 === "%" && i3 + 2 < input2.length) {
|
|
293149
|
+
const hex3 = input2.slice(i3 + 1, i3 + 3);
|
|
293150
|
+
if (isHexPair(hex3)) {
|
|
293151
|
+
output2 += "%" + hex3.toUpperCase();
|
|
293152
|
+
i3 += 2;
|
|
293153
|
+
continue;
|
|
293154
|
+
}
|
|
293155
|
+
}
|
|
293156
|
+
if (isAllowed(ch2)) {
|
|
293157
|
+
output2 += ch2;
|
|
293158
|
+
} else {
|
|
293159
|
+
const code = input2.charCodeAt(i3);
|
|
293160
|
+
if (code < 128) {
|
|
293161
|
+
output2 += BYTE_HEX[code];
|
|
293162
|
+
} else if (code < 55296 || code > 57343) {
|
|
293163
|
+
output2 += percentEncodeNonAscii(code);
|
|
293164
|
+
} else if (code <= 56319 && i3 + 1 < input2.length) {
|
|
293165
|
+
const low = input2.charCodeAt(i3 + 1);
|
|
293166
|
+
if (low >= 56320 && low <= 57343) {
|
|
293167
|
+
output2 += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
|
|
293168
|
+
i3++;
|
|
293169
|
+
} else {
|
|
293170
|
+
output2 += percentEncodeNonAscii(65533);
|
|
293171
|
+
}
|
|
293172
|
+
} else {
|
|
293173
|
+
output2 += percentEncodeNonAscii(65533);
|
|
293174
|
+
}
|
|
293175
|
+
}
|
|
293176
|
+
}
|
|
293177
|
+
return output2;
|
|
293178
|
+
}
|
|
293179
|
+
function encodeUserinfo(input2) {
|
|
293180
|
+
return encodeComponent(input2, isUserinfoCharacter);
|
|
293181
|
+
}
|
|
293182
|
+
function encodeQuery(input2) {
|
|
293183
|
+
return encodeComponent(input2, isQueryFragmentCharacter);
|
|
293184
|
+
}
|
|
293185
|
+
function encodeFragment(input2) {
|
|
293186
|
+
return encodeComponent(input2, isQueryFragmentCharacter);
|
|
293187
|
+
}
|
|
293188
|
+
function isEscapeSafe(cp) {
|
|
293189
|
+
return cp >= 48 && cp <= 57 || cp >= 65 && cp <= 90 || cp >= 97 && cp <= 122 || cp === 42 || cp === 43 || cp === 45 || cp === 46 || cp === 47 || cp === 64 || cp === 95;
|
|
293190
|
+
}
|
|
293191
|
+
function normalizeQueryFragmentEncoding(input2) {
|
|
293192
|
+
let output2 = "";
|
|
293193
|
+
for (let i3 = 0;i3 < input2.length; i3++) {
|
|
293194
|
+
const ch2 = input2[i3];
|
|
293195
|
+
if (ch2 === "%" && i3 + 2 < input2.length) {
|
|
293196
|
+
const hex3 = input2.slice(i3 + 1, i3 + 3);
|
|
293197
|
+
if (isHexPair(hex3)) {
|
|
293198
|
+
const normalizedHex = hex3.toUpperCase();
|
|
293199
|
+
const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
|
|
293200
|
+
if (isUnreserved(decoded)) {
|
|
293201
|
+
output2 += decoded;
|
|
293202
|
+
} else {
|
|
293203
|
+
output2 += "%" + normalizedHex;
|
|
293204
|
+
}
|
|
293205
|
+
i3 += 2;
|
|
293206
|
+
continue;
|
|
293207
|
+
}
|
|
293208
|
+
}
|
|
293209
|
+
if (isQueryFragmentCharacter(ch2)) {
|
|
293210
|
+
output2 += ch2;
|
|
293211
|
+
} else {
|
|
293212
|
+
const code = input2.charCodeAt(i3);
|
|
293213
|
+
if (code < 128) {
|
|
293214
|
+
output2 += isEscapeSafe(code) ? ch2 : BYTE_HEX[code];
|
|
293215
|
+
} else if (code < 55296 || code > 57343) {
|
|
293216
|
+
output2 += percentEncodeNonAscii(code);
|
|
293217
|
+
} else if (code <= 56319 && i3 + 1 < input2.length) {
|
|
293218
|
+
const low = input2.charCodeAt(i3 + 1);
|
|
293219
|
+
if (low >= 56320 && low <= 57343) {
|
|
293220
|
+
output2 += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
|
|
293221
|
+
i3++;
|
|
293222
|
+
} else {
|
|
293223
|
+
output2 += percentEncodeNonAscii(65533);
|
|
293224
|
+
}
|
|
293225
|
+
} else {
|
|
293226
|
+
output2 += percentEncodeNonAscii(65533);
|
|
293227
|
+
}
|
|
292772
293228
|
}
|
|
292773
293229
|
}
|
|
292774
293230
|
return output2;
|
|
@@ -292791,14 +293247,18 @@ var require_utils3 = __commonJS((exports, module) => {
|
|
|
292791
293247
|
function recomposeAuthority(component) {
|
|
292792
293248
|
const uriTokens = [];
|
|
292793
293249
|
if (component.userinfo !== undefined) {
|
|
292794
|
-
uriTokens.push(component.userinfo);
|
|
293250
|
+
uriTokens.push(encodeUserinfo(component.userinfo));
|
|
292795
293251
|
uriTokens.push("@");
|
|
292796
293252
|
}
|
|
292797
293253
|
if (component.host !== undefined) {
|
|
292798
|
-
let host =
|
|
293254
|
+
let host = component.host;
|
|
292799
293255
|
if (!isIPv4(host)) {
|
|
292800
|
-
|
|
292801
|
-
if (ipV6res.isIPV6
|
|
293256
|
+
let ipV6res = normalizeIPv6(host);
|
|
293257
|
+
if (ipV6res.isIPV6 !== true && ipV6res.isIPVFuture !== true) {
|
|
293258
|
+
host = normalizePercentEncoding(host, true);
|
|
293259
|
+
ipV6res = normalizeIPv6(host);
|
|
293260
|
+
}
|
|
293261
|
+
if (ipV6res.isIPV6 === true || ipV6res.isIPVFuture === true) {
|
|
292802
293262
|
host = `[${ipV6res.escapedHost}]`;
|
|
292803
293263
|
} else {
|
|
292804
293264
|
host = reescapeHostDelimiters(host, false);
|
|
@@ -292818,6 +293278,11 @@ var require_utils3 = __commonJS((exports, module) => {
|
|
|
292818
293278
|
reescapeHostDelimiters,
|
|
292819
293279
|
normalizePercentEncoding,
|
|
292820
293280
|
normalizePathEncoding,
|
|
293281
|
+
serializePathEncoding,
|
|
293282
|
+
normalizeQueryFragmentEncoding,
|
|
293283
|
+
encodeUserinfo,
|
|
293284
|
+
encodeQuery,
|
|
293285
|
+
encodeFragment,
|
|
292821
293286
|
escapePreservingEscapes,
|
|
292822
293287
|
removeDotSegments,
|
|
292823
293288
|
isIPv4,
|
|
@@ -292830,7 +293295,7 @@ var require_utils3 = __commonJS((exports, module) => {
|
|
|
292830
293295
|
// node_modules/fast-uri/lib/schemes.js
|
|
292831
293296
|
var require_schemes2 = __commonJS((exports, module) => {
|
|
292832
293297
|
var { isUUID } = require_utils3();
|
|
292833
|
-
var URN_REG =
|
|
293298
|
+
var URN_REG = /^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu;
|
|
292834
293299
|
var supportedSchemeNames = [
|
|
292835
293300
|
"http",
|
|
292836
293301
|
"https",
|
|
@@ -292885,9 +293350,10 @@ var require_schemes2 = __commonJS((exports, module) => {
|
|
|
292885
293350
|
wsComponent.secure = undefined;
|
|
292886
293351
|
}
|
|
292887
293352
|
if (wsComponent.resourceName) {
|
|
292888
|
-
const
|
|
293353
|
+
const queryIndex = wsComponent.resourceName.indexOf("?");
|
|
293354
|
+
const path13 = queryIndex === -1 ? wsComponent.resourceName : wsComponent.resourceName.slice(0, queryIndex);
|
|
292889
293355
|
wsComponent.path = path13 && path13 !== "/" ? path13 : undefined;
|
|
292890
|
-
wsComponent.query =
|
|
293356
|
+
wsComponent.query = queryIndex === -1 ? undefined : wsComponent.resourceName.slice(queryIndex + 1);
|
|
292891
293357
|
wsComponent.resourceName = undefined;
|
|
292892
293358
|
}
|
|
292893
293359
|
wsComponent.fragment = undefined;
|
|
@@ -292899,7 +293365,7 @@ var require_schemes2 = __commonJS((exports, module) => {
|
|
|
292899
293365
|
return urnComponent;
|
|
292900
293366
|
}
|
|
292901
293367
|
const matches = urnComponent.path.match(URN_REG);
|
|
292902
|
-
if (matches) {
|
|
293368
|
+
if (matches && matches[0] === urnComponent.path) {
|
|
292903
293369
|
const scheme = options2.scheme || urnComponent.scheme || "urn";
|
|
292904
293370
|
urnComponent.nid = matches[1].toLowerCase();
|
|
292905
293371
|
urnComponent.nss = matches[2];
|
|
@@ -293003,8 +293469,17 @@ var require_schemes2 = __commonJS((exports, module) => {
|
|
|
293003
293469
|
|
|
293004
293470
|
// node_modules/fast-uri/index.js
|
|
293005
293471
|
var require_fast_uri2 = __commonJS((exports, module) => {
|
|
293006
|
-
var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding,
|
|
293472
|
+
var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, serializePathEncoding, normalizeQueryFragmentEncoding, encodeQuery, encodeFragment, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils3();
|
|
293007
293473
|
var { SCHEMES, getSchemeHandler } = require_schemes2();
|
|
293474
|
+
var VALID_SCHEME = /^[A-Za-z][A-Za-z0-9+.-]*$/u;
|
|
293475
|
+
var MALFORMED_SCHEME_ERROR = "URI scheme is malformed.";
|
|
293476
|
+
function decodeValidScheme(scheme) {
|
|
293477
|
+
const decodedScheme = unescape(String(scheme));
|
|
293478
|
+
if (!VALID_SCHEME.test(decodedScheme)) {
|
|
293479
|
+
throw new TypeError(MALFORMED_SCHEME_ERROR);
|
|
293480
|
+
}
|
|
293481
|
+
return decodedScheme;
|
|
293482
|
+
}
|
|
293008
293483
|
function normalize8(uri, options2) {
|
|
293009
293484
|
if (typeof uri === "string") {
|
|
293010
293485
|
uri = normalizeString(uri, options2);
|
|
@@ -293015,12 +293490,34 @@ var require_fast_uri2 = __commonJS((exports, module) => {
|
|
|
293015
293490
|
}
|
|
293016
293491
|
function resolve17(baseURI, relativeURI, options2) {
|
|
293017
293492
|
const schemelessOptions = options2 ? Object.assign({ scheme: "null" }, options2) : { scheme: "null" };
|
|
293018
|
-
const {
|
|
293019
|
-
|
|
293020
|
-
|
|
293493
|
+
const {
|
|
293494
|
+
parsed: baseParsed,
|
|
293495
|
+
malformedAuthorityOrPort: baseMalformed,
|
|
293496
|
+
malformedPercentEncoding: baseMalformedPercentEncoding,
|
|
293497
|
+
malformedSchemeSpecific: baseMalformedSchemeSpecific,
|
|
293498
|
+
malformedHost: baseMalformedHost,
|
|
293499
|
+
malformedScheme: baseMalformedScheme
|
|
293500
|
+
} = parseWithStatus(baseURI, schemelessOptions);
|
|
293501
|
+
const {
|
|
293502
|
+
parsed: relativeParsed,
|
|
293503
|
+
malformedAuthorityOrPort: relativeMalformed,
|
|
293504
|
+
malformedPercentEncoding: relativeMalformedPercentEncoding,
|
|
293505
|
+
malformedSchemeSpecific: relativeMalformedSchemeSpecific,
|
|
293506
|
+
malformedHost: relativeMalformedHost,
|
|
293507
|
+
malformedScheme: relativeMalformedScheme
|
|
293508
|
+
} = parseWithStatus(relativeURI, schemelessOptions);
|
|
293509
|
+
if (baseMalformed || relativeMalformed || baseMalformedPercentEncoding || relativeMalformedPercentEncoding || baseMalformedSchemeSpecific || relativeMalformedSchemeSpecific || baseMalformedHost || relativeMalformedHost || baseMalformedScheme || relativeMalformedScheme) {
|
|
293021
293510
|
throw new Error(baseParsed.error || relativeParsed.error || "URI is malformed.");
|
|
293022
293511
|
}
|
|
293023
293512
|
const resolved = resolveComponent(baseParsed, relativeParsed, schemelessOptions, true);
|
|
293513
|
+
const resolvedSchemeHandler = getSchemeHandler(options2 && options2.scheme || resolved.scheme);
|
|
293514
|
+
const resolvedHost = resolved.host;
|
|
293515
|
+
const resolvedHostIsIP = resolvedHost !== undefined && resolvedHost !== "" && (isIPv4(resolvedHost) || normalizeIPv6(resolvedHost).isIPV6);
|
|
293516
|
+
canonicalizeHost2(resolved, options2 || {}, resolvedSchemeHandler, resolvedHostIsIP);
|
|
293517
|
+
const encodedASCIIHost = resolvedHost && resolvedHost.indexOf("%") !== -1 && !/\P{ASCII}/u.test(resolvedHost);
|
|
293518
|
+
if (resolved.error && !encodedASCIIHost) {
|
|
293519
|
+
throw new Error(resolved.error);
|
|
293520
|
+
}
|
|
293024
293521
|
schemelessOptions.skipEscape = true;
|
|
293025
293522
|
return serialize2(resolved, schemelessOptions);
|
|
293026
293523
|
}
|
|
@@ -293080,7 +293577,7 @@ var require_fast_uri2 = __commonJS((exports, module) => {
|
|
|
293080
293577
|
function equal(uriA, uriB, options2) {
|
|
293081
293578
|
const normalizedA = normalizeComparableURI(uriA, options2);
|
|
293082
293579
|
const normalizedB = normalizeComparableURI(uriB, options2);
|
|
293083
|
-
return normalizedA !== undefined && normalizedB !== undefined && normalizedA
|
|
293580
|
+
return normalizedA !== undefined && normalizedB !== undefined && normalizedA === normalizedB;
|
|
293084
293581
|
}
|
|
293085
293582
|
function serialize2(cmpts, opts) {
|
|
293086
293583
|
const component = {
|
|
@@ -293101,20 +293598,23 @@ var require_fast_uri2 = __commonJS((exports, module) => {
|
|
|
293101
293598
|
};
|
|
293102
293599
|
const options2 = Object.assign({}, opts);
|
|
293103
293600
|
const uriTokens = [];
|
|
293601
|
+
if (component.scheme) {
|
|
293602
|
+
component.scheme = decodeValidScheme(component.scheme);
|
|
293603
|
+
}
|
|
293104
293604
|
const schemeHandler = getSchemeHandler(options2.scheme || component.scheme);
|
|
293105
293605
|
if (schemeHandler && schemeHandler.serialize)
|
|
293106
293606
|
schemeHandler.serialize(component, options2);
|
|
293607
|
+
const hasAuthority = component.userinfo !== undefined || component.host !== undefined || component.port !== undefined;
|
|
293608
|
+
const pathNoScheme = !options2.skipEscape && component.scheme === undefined && !hasAuthority;
|
|
293107
293609
|
if (component.path !== undefined) {
|
|
293108
293610
|
if (!options2.skipEscape) {
|
|
293109
|
-
component.path =
|
|
293110
|
-
if (component.scheme !== undefined) {
|
|
293111
|
-
component.path = component.path.split("%3A").join(":");
|
|
293112
|
-
}
|
|
293611
|
+
component.path = serializePathEncoding(component.path, pathNoScheme);
|
|
293113
293612
|
} else {
|
|
293114
293613
|
component.path = normalizePercentEncoding(component.path);
|
|
293115
293614
|
}
|
|
293116
293615
|
}
|
|
293117
293616
|
if (options2.reference !== "suffix" && component.scheme) {
|
|
293617
|
+
component.scheme = decodeValidScheme(component.scheme);
|
|
293118
293618
|
uriTokens.push(component.scheme, ":");
|
|
293119
293619
|
}
|
|
293120
293620
|
const authority = recomposeAuthority(component);
|
|
@@ -293132,16 +293632,19 @@ var require_fast_uri2 = __commonJS((exports, module) => {
|
|
|
293132
293632
|
if (!options2.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
|
|
293133
293633
|
s = removeDotSegments(s);
|
|
293134
293634
|
}
|
|
293635
|
+
if (pathNoScheme) {
|
|
293636
|
+
s = serializePathEncoding(s, true);
|
|
293637
|
+
}
|
|
293135
293638
|
if (authority === undefined && s[0] === "/" && s[1] === "/") {
|
|
293136
293639
|
s = "/%2F" + s.slice(2);
|
|
293137
293640
|
}
|
|
293138
293641
|
uriTokens.push(s);
|
|
293139
293642
|
}
|
|
293140
293643
|
if (component.query !== undefined) {
|
|
293141
|
-
uriTokens.push("?", component.query);
|
|
293644
|
+
uriTokens.push("?", encodeQuery(component.query));
|
|
293142
293645
|
}
|
|
293143
293646
|
if (component.fragment !== undefined) {
|
|
293144
|
-
uriTokens.push("#", component.fragment);
|
|
293647
|
+
uriTokens.push("#", encodeFragment(component.fragment));
|
|
293145
293648
|
}
|
|
293146
293649
|
return uriTokens.join("");
|
|
293147
293650
|
}
|
|
@@ -293157,6 +293660,33 @@ var require_fast_uri2 = __commonJS((exports, module) => {
|
|
|
293157
293660
|
}
|
|
293158
293661
|
return;
|
|
293159
293662
|
}
|
|
293663
|
+
function hasMalformedPercentEncoding(component) {
|
|
293664
|
+
if (component === undefined)
|
|
293665
|
+
return false;
|
|
293666
|
+
let percent = component.indexOf("%");
|
|
293667
|
+
while (percent !== -1) {
|
|
293668
|
+
if (percent + 2 >= component.length || !/^[\da-f]{2}$/iu.test(component.slice(percent + 1, percent + 3))) {
|
|
293669
|
+
return true;
|
|
293670
|
+
}
|
|
293671
|
+
percent = component.indexOf("%", percent + 3);
|
|
293672
|
+
}
|
|
293673
|
+
return false;
|
|
293674
|
+
}
|
|
293675
|
+
function hasMalformedComponentPercentEncoding(matches) {
|
|
293676
|
+
const host = matches[4];
|
|
293677
|
+
return hasMalformedPercentEncoding(matches[3]) || host !== undefined && !(host[0] === "[" && host[host.length - 1] === "]") && hasMalformedPercentEncoding(host) || hasMalformedPercentEncoding(matches[6]) || hasMalformedPercentEncoding(matches[7]) || hasMalformedPercentEncoding(matches[8]);
|
|
293678
|
+
}
|
|
293679
|
+
function canonicalizeHost2(parsed, options2, schemeHandler, isIP6) {
|
|
293680
|
+
if (!options2.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport) && parsed.host && parsed.host[0] !== "[" && (options2.domainHost || schemeHandler && schemeHandler.domainHost) && isIP6 === false && nonSimpleDomain(parsed.host)) {
|
|
293681
|
+
try {
|
|
293682
|
+
parsed.host = new URL("http://" + parsed.host).hostname;
|
|
293683
|
+
} catch (e) {
|
|
293684
|
+
parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
|
|
293685
|
+
return true;
|
|
293686
|
+
}
|
|
293687
|
+
}
|
|
293688
|
+
return false;
|
|
293689
|
+
}
|
|
293160
293690
|
function parseWithStatus(uri, opts) {
|
|
293161
293691
|
const options2 = Object.assign({}, opts);
|
|
293162
293692
|
const parsed = {
|
|
@@ -293169,6 +293699,11 @@ var require_fast_uri2 = __commonJS((exports, module) => {
|
|
|
293169
293699
|
fragment: undefined
|
|
293170
293700
|
};
|
|
293171
293701
|
let malformedAuthorityOrPort = false;
|
|
293702
|
+
let malformedPercentEncoding = false;
|
|
293703
|
+
let malformedSchemeSpecific = false;
|
|
293704
|
+
let malformedHost = false;
|
|
293705
|
+
let malformedIPLiteral = false;
|
|
293706
|
+
let malformedScheme = false;
|
|
293172
293707
|
let isIP6 = false;
|
|
293173
293708
|
if (options2.reference === "suffix") {
|
|
293174
293709
|
if (options2.scheme) {
|
|
@@ -293205,6 +293740,19 @@ var require_fast_uri2 = __commonJS((exports, module) => {
|
|
|
293205
293740
|
parsed.path = matches[6] || "";
|
|
293206
293741
|
parsed.query = matches[7];
|
|
293207
293742
|
parsed.fragment = matches[8];
|
|
293743
|
+
if (parsed.scheme !== undefined) {
|
|
293744
|
+
const decodedScheme = unescape(parsed.scheme);
|
|
293745
|
+
if (VALID_SCHEME.test(decodedScheme)) {
|
|
293746
|
+
parsed.scheme = decodedScheme.toLowerCase();
|
|
293747
|
+
} else {
|
|
293748
|
+
parsed.error = parsed.error || MALFORMED_SCHEME_ERROR;
|
|
293749
|
+
malformedScheme = true;
|
|
293750
|
+
}
|
|
293751
|
+
}
|
|
293752
|
+
malformedPercentEncoding = hasMalformedComponentPercentEncoding(matches);
|
|
293753
|
+
if (malformedPercentEncoding) {
|
|
293754
|
+
parsed.error = parsed.error || "URI contains malformed percent-encoding.";
|
|
293755
|
+
}
|
|
293208
293756
|
if (isNaN(parsed.port)) {
|
|
293209
293757
|
parsed.port = matches[5];
|
|
293210
293758
|
}
|
|
@@ -293216,9 +293764,15 @@ var require_fast_uri2 = __commonJS((exports, module) => {
|
|
|
293216
293764
|
if (parsed.host) {
|
|
293217
293765
|
const ipv4result = isIPv4(parsed.host);
|
|
293218
293766
|
if (ipv4result === false) {
|
|
293767
|
+
const bracketedIPLiteral = parsed.host[0] === "[" && parsed.host[parsed.host.length - 1] === "]";
|
|
293219
293768
|
const ipv6result = normalizeIPv6(parsed.host);
|
|
293220
|
-
|
|
293221
|
-
|
|
293769
|
+
isIP6 = ipv6result.isIPV6 || ipv6result.isIPVFuture === true;
|
|
293770
|
+
malformedIPLiteral = bracketedIPLiteral && ipv6result.error === true;
|
|
293771
|
+
parsed.host = isIP6 ? ipv6result.host : ipv6result.host.toLowerCase();
|
|
293772
|
+
if (malformedIPLiteral) {
|
|
293773
|
+
parsed.error = parsed.error || "URI host is malformed.";
|
|
293774
|
+
malformedAuthorityOrPort = true;
|
|
293775
|
+
}
|
|
293222
293776
|
} else {
|
|
293223
293777
|
isIP6 = true;
|
|
293224
293778
|
}
|
|
@@ -293236,42 +293790,34 @@ var require_fast_uri2 = __commonJS((exports, module) => {
|
|
|
293236
293790
|
parsed.error = parsed.error || "URI is not a " + options2.reference + " reference.";
|
|
293237
293791
|
}
|
|
293238
293792
|
const schemeHandler = getSchemeHandler(options2.scheme || parsed.scheme);
|
|
293239
|
-
|
|
293240
|
-
if (parsed.host && (options2.domainHost || schemeHandler && schemeHandler.domainHost) && isIP6 === false && nonSimpleDomain(parsed.host)) {
|
|
293241
|
-
try {
|
|
293242
|
-
parsed.host = new URL("http://" + parsed.host).hostname;
|
|
293243
|
-
} catch (e) {
|
|
293244
|
-
parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
|
|
293245
|
-
}
|
|
293246
|
-
}
|
|
293247
|
-
}
|
|
293793
|
+
malformedHost = canonicalizeHost2(parsed, options2, schemeHandler, isIP6);
|
|
293248
293794
|
if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {
|
|
293249
293795
|
if (uri.indexOf("%") !== -1) {
|
|
293250
|
-
if (parsed.
|
|
293251
|
-
parsed.
|
|
293252
|
-
|
|
293253
|
-
if (parsed.host !== undefined) {
|
|
293254
|
-
parsed.host = reescapeHostDelimiters(unescape(parsed.host), isIP6);
|
|
293796
|
+
if (parsed.host !== undefined && !malformedIPLiteral) {
|
|
293797
|
+
const host = isIP6 ? parsed.host : normalizePercentEncoding(parsed.host, true);
|
|
293798
|
+
parsed.host = reescapeHostDelimiters(host, isIP6);
|
|
293255
293799
|
}
|
|
293256
293800
|
}
|
|
293257
293801
|
if (parsed.path) {
|
|
293258
293802
|
parsed.path = normalizePathEncoding(parsed.path);
|
|
293259
293803
|
}
|
|
293804
|
+
if (parsed.query) {
|
|
293805
|
+
parsed.query = normalizeQueryFragmentEncoding(parsed.query);
|
|
293806
|
+
}
|
|
293260
293807
|
if (parsed.fragment) {
|
|
293261
|
-
|
|
293262
|
-
parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment));
|
|
293263
|
-
} catch {
|
|
293264
|
-
parsed.error = parsed.error || "URI malformed";
|
|
293265
|
-
}
|
|
293808
|
+
parsed.fragment = normalizeQueryFragmentEncoding(parsed.fragment);
|
|
293266
293809
|
}
|
|
293267
293810
|
}
|
|
293268
293811
|
if (schemeHandler && schemeHandler.parse) {
|
|
293269
293812
|
schemeHandler.parse(parsed, options2);
|
|
293813
|
+
if (schemeHandler === SCHEMES.urn && parsed.nid === undefined) {
|
|
293814
|
+
malformedSchemeSpecific = true;
|
|
293815
|
+
}
|
|
293270
293816
|
}
|
|
293271
293817
|
} else {
|
|
293272
293818
|
parsed.error = parsed.error || "URI can not be parsed.";
|
|
293273
293819
|
}
|
|
293274
|
-
return { parsed, malformedAuthorityOrPort };
|
|
293820
|
+
return { parsed, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme };
|
|
293275
293821
|
}
|
|
293276
293822
|
function parse8(uri, opts) {
|
|
293277
293823
|
return parseWithStatus(uri, opts).parsed;
|
|
@@ -293280,20 +293826,28 @@ var require_fast_uri2 = __commonJS((exports, module) => {
|
|
|
293280
293826
|
return normalizeStringWithStatus(uri, opts).normalized;
|
|
293281
293827
|
}
|
|
293282
293828
|
function normalizeStringWithStatus(uri, opts) {
|
|
293283
|
-
const { parsed, malformedAuthorityOrPort } = parseWithStatus(uri, opts);
|
|
293829
|
+
const { parsed, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme } = parseWithStatus(uri, opts);
|
|
293284
293830
|
return {
|
|
293285
|
-
normalized: malformedAuthorityOrPort ? uri : serialize2(parsed, opts),
|
|
293286
|
-
malformedAuthorityOrPort
|
|
293831
|
+
normalized: malformedAuthorityOrPort || malformedPercentEncoding || malformedSchemeSpecific || malformedHost || malformedScheme ? uri : serialize2(parsed, opts),
|
|
293832
|
+
malformedAuthorityOrPort,
|
|
293833
|
+
malformedPercentEncoding,
|
|
293834
|
+
malformedSchemeSpecific,
|
|
293835
|
+
malformedHost,
|
|
293836
|
+
malformedScheme
|
|
293287
293837
|
};
|
|
293288
293838
|
}
|
|
293289
293839
|
function normalizeComparableURI(uri, opts) {
|
|
293290
|
-
if (typeof uri
|
|
293291
|
-
|
|
293292
|
-
return malformedAuthorityOrPort ? undefined : normalized;
|
|
293840
|
+
if (typeof uri !== "string" && typeof uri !== "object") {
|
|
293841
|
+
return;
|
|
293293
293842
|
}
|
|
293294
|
-
|
|
293295
|
-
|
|
293843
|
+
let value;
|
|
293844
|
+
try {
|
|
293845
|
+
value = typeof uri === "string" ? uri : serialize2(uri, opts);
|
|
293846
|
+
} catch {
|
|
293847
|
+
return;
|
|
293296
293848
|
}
|
|
293849
|
+
const { normalized, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme } = normalizeStringWithStatus(value, opts);
|
|
293850
|
+
return malformedAuthorityOrPort || malformedPercentEncoding || malformedSchemeSpecific || malformedHost || malformedScheme ? undefined : normalized;
|
|
293297
293851
|
}
|
|
293298
293852
|
var fastUri = {
|
|
293299
293853
|
SCHEMES,
|
|
@@ -314692,7 +315246,7 @@ function getTelemetryAttributes() {
|
|
|
314692
315246
|
attributes["session.id"] = sessionId;
|
|
314693
315247
|
}
|
|
314694
315248
|
if (shouldIncludeAttribute("OTEL_METRICS_INCLUDE_VERSION")) {
|
|
314695
|
-
attributes["app.version"] = "1.85.
|
|
315249
|
+
attributes["app.version"] = "1.85.2";
|
|
314696
315250
|
}
|
|
314697
315251
|
const oauthAccount = getOauthAccountInfo();
|
|
314698
315252
|
if (oauthAccount) {
|
|
@@ -317723,7 +318277,7 @@ var require_src3 = __commonJS((exports) => {
|
|
|
317723
318277
|
function getInstruments() {
|
|
317724
318278
|
if (instruments)
|
|
317725
318279
|
return instruments;
|
|
317726
|
-
const meter = import_api2.metrics.getMeter("ur-agent.gen_ai", "1.85.
|
|
318280
|
+
const meter = import_api2.metrics.getMeter("ur-agent.gen_ai", "1.85.2");
|
|
317727
318281
|
instruments = {
|
|
317728
318282
|
operationDuration: meter.createHistogram("gen_ai.client.operation.duration", {
|
|
317729
318283
|
description: "GenAI operation duration.",
|
|
@@ -317821,7 +318375,7 @@ function genAiAgentAttributes() {
|
|
|
317821
318375
|
"gen_ai.operation.name": GEN_AI_OPERATION_INVOKE_AGENT,
|
|
317822
318376
|
"gen_ai.provider.name": "ur",
|
|
317823
318377
|
"gen_ai.agent.name": "UR-Nexus",
|
|
317824
|
-
"gen_ai.agent.version": "1.85.
|
|
318378
|
+
"gen_ai.agent.version": "1.85.2"
|
|
317825
318379
|
};
|
|
317826
318380
|
}
|
|
317827
318381
|
function genAiWorkflowAttributes(workflowName, workflowRunId) {
|
|
@@ -317842,7 +318396,7 @@ function genAiWorkflowAttributes(workflowName, workflowRunId) {
|
|
|
317842
318396
|
function startGenAiWorkflowSpan(workflowName, workflowRunId) {
|
|
317843
318397
|
const attributes = genAiWorkflowAttributes(workflowName, workflowRunId);
|
|
317844
318398
|
const name = typeof attributes["gen_ai.workflow.name"] === "string" ? `invoke_workflow ${attributes["gen_ai.workflow.name"]}` : GEN_AI_OPERATION_INVOKE_WORKFLOW;
|
|
317845
|
-
return import_api2.trace.getTracer("ur-agent.gen_ai", "1.85.
|
|
318399
|
+
return import_api2.trace.getTracer("ur-agent.gen_ai", "1.85.2").startSpan(name, { kind: import_api2.SpanKind.INTERNAL, attributes });
|
|
317846
318400
|
}
|
|
317847
318401
|
function endGenAiWorkflowSpan(span, options2 = {}) {
|
|
317848
318402
|
try {
|
|
@@ -317880,7 +318434,7 @@ function startGenAiMemorySpan(operation, options2 = {}) {
|
|
|
317880
318434
|
if (options2.recordCount !== undefined && Number.isInteger(options2.recordCount) && options2.recordCount >= 0) {
|
|
317881
318435
|
attributes["gen_ai.memory.record.count"] = options2.recordCount;
|
|
317882
318436
|
}
|
|
317883
|
-
return import_api2.trace.getTracer("ur-agent.gen_ai", "1.85.
|
|
318437
|
+
return import_api2.trace.getTracer("ur-agent.gen_ai", "1.85.2").startSpan(operation, { kind: import_api2.SpanKind.INTERNAL, attributes });
|
|
317884
318438
|
}
|
|
317885
318439
|
function endGenAiMemorySpan(span, options2 = {}) {
|
|
317886
318440
|
try {
|
|
@@ -332287,7 +332841,7 @@ async function createRuntime() {
|
|
|
332287
332841
|
bootstrapTelemetry();
|
|
332288
332842
|
const resource = defaultResource().merge(detectResources({ detectors: [envDetector] })).merge(resourceFromAttributes({
|
|
332289
332843
|
[import_semantic_conventions6.ATTR_SERVICE_NAME]: "ur-agent",
|
|
332290
|
-
[import_semantic_conventions6.ATTR_SERVICE_VERSION]: "1.85.
|
|
332844
|
+
[import_semantic_conventions6.ATTR_SERVICE_VERSION]: "1.85.2"
|
|
332291
332845
|
}));
|
|
332292
332846
|
const tracerProvider = exporters.traces.length > 0 ? new BasicTracerProvider({
|
|
332293
332847
|
resource,
|
|
@@ -332320,11 +332874,11 @@ async function createRuntime() {
|
|
|
332320
332874
|
setMeterProvider(meterProvider);
|
|
332321
332875
|
setLoggerProvider(loggerProvider);
|
|
332322
332876
|
if (meterProvider) {
|
|
332323
|
-
const meter = meterProvider.getMeter("ur-agent", "1.85.
|
|
332877
|
+
const meter = meterProvider.getMeter("ur-agent", "1.85.2");
|
|
332324
332878
|
setMeter(meter, (name, options2) => meter.createCounter(name, options2));
|
|
332325
332879
|
}
|
|
332326
332880
|
if (loggerProvider) {
|
|
332327
|
-
setEventLogger(loggerProvider.getLogger("ur-agent.events", "1.85.
|
|
332881
|
+
setEventLogger(loggerProvider.getLogger("ur-agent.events", "1.85.2"));
|
|
332328
332882
|
}
|
|
332329
332883
|
if (!cleanupRegistered4) {
|
|
332330
332884
|
cleanupRegistered4 = true;
|
|
@@ -332873,7 +333427,7 @@ function isAnyTracingEnabled() {
|
|
|
332873
333427
|
return isTelemetryEnabled() || isEnhancedTelemetryEnabled() || isBetaTracingEnabled();
|
|
332874
333428
|
}
|
|
332875
333429
|
function getTracer() {
|
|
332876
|
-
return import_api32.trace.getTracer("ur-agent.gen_ai", "1.85.
|
|
333430
|
+
return import_api32.trace.getTracer("ur-agent.gen_ai", "1.85.2");
|
|
332877
333431
|
}
|
|
332878
333432
|
function createSpanAttributes(spanType, customAttributes = {}) {
|
|
332879
333433
|
const baseAttributes = getTelemetryAttributes();
|
|
@@ -344879,7 +345433,7 @@ function computeFingerprint(messageText2, version2) {
|
|
|
344879
345433
|
}
|
|
344880
345434
|
function computeFingerprintFromMessages(messages) {
|
|
344881
345435
|
const firstMessageText = extractFirstMessageText(messages);
|
|
344882
|
-
return computeFingerprint(firstMessageText, "1.85.
|
|
345436
|
+
return computeFingerprint(firstMessageText, "1.85.2");
|
|
344883
345437
|
}
|
|
344884
345438
|
var FINGERPRINT_SALT = "59cf53e54c78";
|
|
344885
345439
|
var init_fingerprint = () => {};
|
|
@@ -344921,7 +345475,7 @@ async function sideQuery(opts) {
|
|
|
344921
345475
|
betas.push(STRUCTURED_OUTPUTS_BETA_HEADER);
|
|
344922
345476
|
}
|
|
344923
345477
|
const messageText2 = extractFirstUserMessageText(messages);
|
|
344924
|
-
const fingerprint = computeFingerprint(messageText2, "1.85.
|
|
345478
|
+
const fingerprint = computeFingerprint(messageText2, "1.85.2");
|
|
344925
345479
|
const attributionHeader = getAttributionHeader(fingerprint);
|
|
344926
345480
|
const systemBlocks = [
|
|
344927
345481
|
attributionHeader ? { type: "text", text: attributionHeader } : null,
|
|
@@ -347028,7 +347582,7 @@ var init_user = __esm(() => {
|
|
|
347028
347582
|
deviceId,
|
|
347029
347583
|
sessionId: getSessionId(),
|
|
347030
347584
|
email: getEmail(),
|
|
347031
|
-
appVersion: "1.85.
|
|
347585
|
+
appVersion: "1.85.2",
|
|
347032
347586
|
platform: getHostPlatformForAnalytics(),
|
|
347033
347587
|
organizationUuid,
|
|
347034
347588
|
accountUuid,
|
|
@@ -347788,7 +348342,7 @@ var init_growthbook_experiment_event = __esm(() => {
|
|
|
347788
348342
|
|
|
347789
348343
|
// src/utils/userAgent.ts
|
|
347790
348344
|
function getURCodeUserAgent() {
|
|
347791
|
-
return `ur/${"1.85.
|
|
348345
|
+
return `ur/${"1.85.2"}`;
|
|
347792
348346
|
}
|
|
347793
348347
|
|
|
347794
348348
|
// src/services/analytics/firstPartyEventLoggingExporter.ts
|
|
@@ -348444,7 +348998,7 @@ function initialize1PEventLogging() {
|
|
|
348444
348998
|
const platform4 = getPlatform();
|
|
348445
348999
|
const attributes = {
|
|
348446
349000
|
[import_semantic_conventions7.ATTR_SERVICE_NAME]: "ur",
|
|
348447
|
-
[import_semantic_conventions7.ATTR_SERVICE_VERSION]: "1.85.
|
|
349001
|
+
[import_semantic_conventions7.ATTR_SERVICE_VERSION]: "1.85.2"
|
|
348448
349002
|
};
|
|
348449
349003
|
if (platform4 === "wsl") {
|
|
348450
349004
|
const wslVersion = getWslVersion();
|
|
@@ -348472,7 +349026,7 @@ function initialize1PEventLogging() {
|
|
|
348472
349026
|
})
|
|
348473
349027
|
]
|
|
348474
349028
|
});
|
|
348475
|
-
firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.urhq.ur.events", "1.85.
|
|
349029
|
+
firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.urhq.ur.events", "1.85.2");
|
|
348476
349030
|
}
|
|
348477
349031
|
async function reinitialize1PEventLoggingIfConfigChanged() {
|
|
348478
349032
|
if (!is1PEventLoggingEnabled() || !firstPartyEventLoggerProvider) {
|
|
@@ -351774,9 +352328,9 @@ async function assertMinVersion() {
|
|
|
351774
352328
|
if (false) {}
|
|
351775
352329
|
try {
|
|
351776
352330
|
const versionConfig = await getDynamicConfig_BLOCKS_ON_INIT("tengu_version_config", { minVersion: "0.0.0" });
|
|
351777
|
-
if (versionConfig.minVersion && lt("1.85.
|
|
352331
|
+
if (versionConfig.minVersion && lt("1.85.2", versionConfig.minVersion)) {
|
|
351778
352332
|
console.error(`
|
|
351779
|
-
It looks like your version of UR (${"1.85.
|
|
352333
|
+
It looks like your version of UR (${"1.85.2"}) needs an update.
|
|
351780
352334
|
A newer version (${versionConfig.minVersion} or higher) is required to continue.
|
|
351781
352335
|
|
|
351782
352336
|
To update, please run:
|
|
@@ -351992,7 +352546,7 @@ async function installGlobalPackage(specificVersion) {
|
|
|
351992
352546
|
logError2(new AutoUpdaterError("Another process is currently installing an update"));
|
|
351993
352547
|
logEvent("tengu_auto_updater_lock_contention", {
|
|
351994
352548
|
pid: process.pid,
|
|
351995
|
-
currentVersion: "1.85.
|
|
352549
|
+
currentVersion: "1.85.2"
|
|
351996
352550
|
});
|
|
351997
352551
|
return "in_progress";
|
|
351998
352552
|
}
|
|
@@ -352001,7 +352555,7 @@ async function installGlobalPackage(specificVersion) {
|
|
|
352001
352555
|
if (!env2.isRunningWithBun() && env2.isNpmFromWindowsPath()) {
|
|
352002
352556
|
logError2(new Error("Windows NPM detected in WSL environment"));
|
|
352003
352557
|
logEvent("tengu_auto_updater_windows_npm_in_wsl", {
|
|
352004
|
-
currentVersion: "1.85.
|
|
352558
|
+
currentVersion: "1.85.2"
|
|
352005
352559
|
});
|
|
352006
352560
|
console.error(`
|
|
352007
352561
|
Error: Windows NPM detected in WSL
|
|
@@ -352536,7 +353090,7 @@ function detectLinuxGlobPatternWarnings() {
|
|
|
352536
353090
|
}
|
|
352537
353091
|
async function getDoctorDiagnostic() {
|
|
352538
353092
|
const installationType = await getCurrentInstallationType();
|
|
352539
|
-
const version2 = typeof MACRO !== "undefined" ? "1.85.
|
|
353093
|
+
const version2 = typeof MACRO !== "undefined" ? "1.85.2" : "unknown";
|
|
352540
353094
|
const installationPath = await getInstallationPath();
|
|
352541
353095
|
const invokedBinary = getInvokedBinary();
|
|
352542
353096
|
const multipleInstallations = await detectMultipleInstallations();
|
|
@@ -353603,7 +354157,7 @@ function getInstallationEnv() {
|
|
|
353603
354157
|
return;
|
|
353604
354158
|
}
|
|
353605
354159
|
function getURCodeVersion() {
|
|
353606
|
-
return "1.85.
|
|
354160
|
+
return "1.85.2";
|
|
353607
354161
|
}
|
|
353608
354162
|
async function getInstalledVSCodeExtensionVersion(command) {
|
|
353609
354163
|
const { stdout } = await execFileNoThrow(command, ["--list-extensions", "--show-versions"], {
|
|
@@ -355084,8 +355638,8 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
|
|
|
355084
355638
|
const maxVersion = await getMaxVersion();
|
|
355085
355639
|
if (maxVersion && gt(version2, maxVersion)) {
|
|
355086
355640
|
logForDebugging(`Native installer: maxVersion ${maxVersion} is set, capping update from ${version2} to ${maxVersion}`);
|
|
355087
|
-
if (gte("1.85.
|
|
355088
|
-
logForDebugging(`Native installer: current version ${"1.85.
|
|
355641
|
+
if (gte("1.85.2", maxVersion)) {
|
|
355642
|
+
logForDebugging(`Native installer: current version ${"1.85.2"} is already at or above maxVersion ${maxVersion}, skipping update`);
|
|
355089
355643
|
logEvent("tengu_native_update_skipped_max_version", {
|
|
355090
355644
|
latency_ms: Date.now() - startTime,
|
|
355091
355645
|
max_version: maxVersion,
|
|
@@ -355096,7 +355650,7 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
|
|
|
355096
355650
|
version2 = maxVersion;
|
|
355097
355651
|
}
|
|
355098
355652
|
}
|
|
355099
|
-
if (!forceReinstall && version2 === "1.85.
|
|
355653
|
+
if (!forceReinstall && version2 === "1.85.2" && await versionIsAvailable(version2) && await isPossibleURBinary(executablePath)) {
|
|
355100
355654
|
logForDebugging(`Found ${version2} at ${executablePath}, skipping install`);
|
|
355101
355655
|
logEvent("tengu_native_update_complete", {
|
|
355102
355656
|
latency_ms: Date.now() - startTime,
|
|
@@ -424166,7 +424720,16 @@ async function buildPayload(request, contract, options2) {
|
|
|
424166
424720
|
const missing = required2.filter((field) => payload[field] === undefined || payload[field] === null);
|
|
424167
424721
|
if (missing.length > 0) {
|
|
424168
424722
|
await deleteAssets(uploadedAssetIds, options2);
|
|
424169
|
-
|
|
424723
|
+
const convenienceFields = missing.map((field) => {
|
|
424724
|
+
if (field === "image")
|
|
424725
|
+
return "image_path";
|
|
424726
|
+
if (field === "video")
|
|
424727
|
+
return "video_path";
|
|
424728
|
+
if (field === "audio")
|
|
424729
|
+
return "audio_path";
|
|
424730
|
+
return field;
|
|
424731
|
+
});
|
|
424732
|
+
throw new Error(`NVIDIA ${contract.id} requires ${missing.join(", ")}. Submit the missing input as ${convenienceFields.join(", ")} fields on separate lines, or provide exact JSON matching the model's documented schema.`);
|
|
424170
424733
|
}
|
|
424171
424734
|
const validationErrors = schemaErrors(payload, contract.requestSchema);
|
|
424172
424735
|
if (validationErrors.length > 0) {
|
|
@@ -473319,7 +473882,7 @@ async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) {
|
|
|
473319
473882
|
const client = new Client({
|
|
473320
473883
|
name: "ur",
|
|
473321
473884
|
title: "UR",
|
|
473322
|
-
version: "1.85.
|
|
473885
|
+
version: "1.85.2",
|
|
473323
473886
|
description: "UR-Nexus autonomous engineering workflow engine",
|
|
473324
473887
|
websiteUrl: PRODUCT_URL
|
|
473325
473888
|
}, {
|
|
@@ -473676,7 +474239,7 @@ var init_client2 = __esm(() => {
|
|
|
473676
474239
|
const client = new Client({
|
|
473677
474240
|
name: "ur",
|
|
473678
474241
|
title: "UR",
|
|
473679
|
-
version: "1.85.
|
|
474242
|
+
version: "1.85.2",
|
|
473680
474243
|
description: "UR-Nexus autonomous engineering workflow engine",
|
|
473681
474244
|
websiteUrl: PRODUCT_URL
|
|
473682
474245
|
}, {
|
|
@@ -484637,7 +485200,7 @@ function Feedback({
|
|
|
484637
485200
|
platform: env2.platform,
|
|
484638
485201
|
gitRepo: envInfo.isGit,
|
|
484639
485202
|
terminal: env2.terminal,
|
|
484640
|
-
version: "1.85.
|
|
485203
|
+
version: "1.85.2",
|
|
484641
485204
|
transcript: normalizeMessagesForAPI(messages),
|
|
484642
485205
|
errors: sanitizedErrors,
|
|
484643
485206
|
lastApiRequest: getLastAPIRequest(),
|
|
@@ -484827,7 +485390,7 @@ function Feedback({
|
|
|
484827
485390
|
", ",
|
|
484828
485391
|
env2.terminal,
|
|
484829
485392
|
", v",
|
|
484830
|
-
"1.85.
|
|
485393
|
+
"1.85.2"
|
|
484831
485394
|
]
|
|
484832
485395
|
}, undefined, true, undefined, this)
|
|
484833
485396
|
]
|
|
@@ -484933,7 +485496,7 @@ ${sanitizedDescription}
|
|
|
484933
485496
|
` + `**Environment Info**
|
|
484934
485497
|
` + `- Platform: ${env2.platform}
|
|
484935
485498
|
` + `- Terminal: ${env2.terminal}
|
|
484936
|
-
` + `- Version: ${"1.85.
|
|
485499
|
+
` + `- Version: ${"1.85.2"}
|
|
484937
485500
|
` + `- Feedback ID: ${feedbackId}
|
|
484938
485501
|
` + `
|
|
484939
485502
|
**Errors**
|
|
@@ -488043,7 +488606,7 @@ function buildPrimarySection() {
|
|
|
488043
488606
|
}, undefined, false, undefined, this);
|
|
488044
488607
|
return [{
|
|
488045
488608
|
label: "Version",
|
|
488046
|
-
value: "1.85.
|
|
488609
|
+
value: "1.85.2"
|
|
488047
488610
|
}, {
|
|
488048
488611
|
label: "Session name",
|
|
488049
488612
|
value: nameValue
|
|
@@ -491557,7 +492120,7 @@ function Config({
|
|
|
491557
492120
|
}
|
|
491558
492121
|
}, undefined, false, undefined, this)
|
|
491559
492122
|
}, undefined, false, undefined, this) : showSubmenu === "ChannelDowngrade" ? /* @__PURE__ */ jsx_dev_runtime176.jsxDEV(ChannelDowngradeDialog, {
|
|
491560
|
-
currentVersion: "1.85.
|
|
492123
|
+
currentVersion: "1.85.2",
|
|
491561
492124
|
onChoice: (choice) => {
|
|
491562
492125
|
setShowSubmenu(null);
|
|
491563
492126
|
setTabsHidden(false);
|
|
@@ -491569,7 +492132,7 @@ function Config({
|
|
|
491569
492132
|
autoUpdatesChannel: "stable"
|
|
491570
492133
|
};
|
|
491571
492134
|
if (choice === "stay") {
|
|
491572
|
-
newSettings.minimumVersion = "1.85.
|
|
492135
|
+
newSettings.minimumVersion = "1.85.2";
|
|
491573
492136
|
}
|
|
491574
492137
|
updateSettingsForSource("userSettings", newSettings);
|
|
491575
492138
|
setSettingsData((prev_27) => ({
|
|
@@ -499886,7 +500449,7 @@ function HelpV2(t0) {
|
|
|
499886
500449
|
let t6;
|
|
499887
500450
|
if ($2[31] !== tabs) {
|
|
499888
500451
|
t6 = /* @__PURE__ */ jsx_dev_runtime203.jsxDEV(Tabs, {
|
|
499889
|
-
title: `UR v${"1.85.
|
|
500452
|
+
title: `UR v${"1.85.2"}`,
|
|
499890
500453
|
color: "professionalBlue",
|
|
499891
500454
|
defaultTab: "general",
|
|
499892
500455
|
children: tabs
|
|
@@ -500820,7 +501383,7 @@ function buildToolUseContext(tools, readFileStateCache, toolPermissionContext, a
|
|
|
500820
501383
|
async function handleInitialize(options2) {
|
|
500821
501384
|
return {
|
|
500822
501385
|
name: "UR",
|
|
500823
|
-
version: "1.85.
|
|
501386
|
+
version: "1.85.2",
|
|
500824
501387
|
protocolVersion: "0.1.0",
|
|
500825
501388
|
workspaceRoot: options2.cwd,
|
|
500826
501389
|
capabilities: {
|
|
@@ -517953,7 +518516,7 @@ function getAllReleaseNotes(changelogContent = getStoredChangelogFromMemory()) {
|
|
|
517953
518516
|
return [];
|
|
517954
518517
|
}
|
|
517955
518518
|
}
|
|
517956
|
-
async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.85.
|
|
518519
|
+
async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.85.2") {
|
|
517957
518520
|
if (process.env.USER_TYPE === "ant") {
|
|
517958
518521
|
const changelog = "";
|
|
517959
518522
|
if (changelog) {
|
|
@@ -517980,7 +518543,7 @@ async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.85.0")
|
|
|
517980
518543
|
releaseNotes
|
|
517981
518544
|
};
|
|
517982
518545
|
}
|
|
517983
|
-
function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "1.85.
|
|
518546
|
+
function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "1.85.2") {
|
|
517984
518547
|
if (process.env.USER_TYPE === "ant") {
|
|
517985
518548
|
const changelog = "";
|
|
517986
518549
|
if (changelog) {
|
|
@@ -520888,7 +521451,7 @@ function getRecentActivitySync() {
|
|
|
520888
521451
|
return cachedActivity;
|
|
520889
521452
|
}
|
|
520890
521453
|
function getLogoDisplayData() {
|
|
520891
|
-
const version2 = process.env.DEMO_VERSION ?? "1.85.
|
|
521454
|
+
const version2 = process.env.DEMO_VERSION ?? "1.85.2";
|
|
520892
521455
|
const serverUrl = getDirectConnectServerUrl();
|
|
520893
521456
|
const displayPath = process.env.DEMO_VERSION ? "/code/ur" : getDisplayPath(getCwd());
|
|
520894
521457
|
const cwd2 = serverUrl ? `${displayPath} in ${serverUrl.replace(/^https?:\/\//, "")}` : displayPath;
|
|
@@ -521776,7 +522339,7 @@ function LogoV2() {
|
|
|
521776
522339
|
if ($2[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
521777
522340
|
t2 = () => {
|
|
521778
522341
|
const currentConfig = getGlobalConfig();
|
|
521779
|
-
if (currentConfig.lastReleaseNotesSeen === "1.85.
|
|
522342
|
+
if (currentConfig.lastReleaseNotesSeen === "1.85.2") {
|
|
521780
522343
|
return;
|
|
521781
522344
|
}
|
|
521782
522345
|
saveGlobalConfig(_temp327);
|
|
@@ -522464,12 +523027,12 @@ function LogoV2() {
|
|
|
522464
523027
|
return t41;
|
|
522465
523028
|
}
|
|
522466
523029
|
function _temp327(current) {
|
|
522467
|
-
if (current.lastReleaseNotesSeen === "1.85.
|
|
523030
|
+
if (current.lastReleaseNotesSeen === "1.85.2") {
|
|
522468
523031
|
return current;
|
|
522469
523032
|
}
|
|
522470
523033
|
return {
|
|
522471
523034
|
...current,
|
|
522472
|
-
lastReleaseNotesSeen: "1.85.
|
|
523035
|
+
lastReleaseNotesSeen: "1.85.2"
|
|
522473
523036
|
};
|
|
522474
523037
|
}
|
|
522475
523038
|
function _temp240(s_0) {
|
|
@@ -538562,7 +539125,7 @@ function compileAgenticCiWorkflow(specName = "default", options2 = {}) {
|
|
|
538562
539125
|
if (spec.name !== specName) {
|
|
538563
539126
|
throw new Error("Agentic CI workflow spec name does not match");
|
|
538564
539127
|
}
|
|
538565
|
-
const packageVersion = options2.packageVersion ?? (typeof MACRO !== "undefined" ? "1.85.
|
|
539128
|
+
const packageVersion = options2.packageVersion ?? (typeof MACRO !== "undefined" ? "1.85.2" : "1.85.2");
|
|
538566
539129
|
if (!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(packageVersion)) {
|
|
538567
539130
|
throw new Error("invalid ur-agent package version");
|
|
538568
539131
|
}
|
|
@@ -539558,7 +540121,7 @@ runner; \`ur trigger\` is the inbound parser that decides what to run.
|
|
|
539558
540121
|
path: ".github/workflows/ur.yml",
|
|
539559
540122
|
root: "project",
|
|
539560
540123
|
content: compileAgenticCiWorkflow("default", {
|
|
539561
|
-
packageVersion: typeof MACRO !== "undefined" ? "1.85.
|
|
540124
|
+
packageVersion: typeof MACRO !== "undefined" ? "1.85.2" : "1.85.2"
|
|
539562
540125
|
})
|
|
539563
540126
|
},
|
|
539564
540127
|
{
|
|
@@ -539621,7 +540184,7 @@ function value(tokens, flag) {
|
|
|
539621
540184
|
return index2 >= 0 ? tokens[index2 + 1] : undefined;
|
|
539622
540185
|
}
|
|
539623
540186
|
function cliVersion() {
|
|
539624
|
-
return typeof MACRO !== "undefined" ? "1.85.
|
|
540187
|
+
return typeof MACRO !== "undefined" ? "1.85.2" : "1.85.2";
|
|
539625
540188
|
}
|
|
539626
540189
|
function workflowPath(cwd2) {
|
|
539627
540190
|
return join158(cwd2, ".github", "workflows", "ur-agentic-ci.yml");
|
|
@@ -540530,7 +541093,7 @@ function formatA2AV1AgentCard(options2 = {}, pretty = true) {
|
|
|
540530
541093
|
var urVersion, researchSnapshotDate = "2026-08-10", coverage2, priorityRoadmap;
|
|
540531
541094
|
var init_trends = __esm(() => {
|
|
540532
541095
|
init_a2aCardSignature();
|
|
540533
|
-
urVersion = typeof MACRO !== "undefined" ? "1.85.
|
|
541096
|
+
urVersion = typeof MACRO !== "undefined" ? "1.85.2" : "1.85.2";
|
|
540534
541097
|
coverage2 = [
|
|
540535
541098
|
{
|
|
540536
541099
|
id: "local-runtime",
|
|
@@ -546263,7 +546826,7 @@ function createAcpStdioApp(deps) {
|
|
|
546263
546826
|
}
|
|
546264
546827
|
},
|
|
546265
546828
|
authMethods: [],
|
|
546266
|
-
agentInfo: { name: "UR-Nexus", version: "1.85.
|
|
546829
|
+
agentInfo: { name: "UR-Nexus", version: "1.85.2" }
|
|
546267
546830
|
})).onRequest("authenticate", () => ({})).onRequest("session/new", async (context6) => {
|
|
546268
546831
|
const result = runtime2.newSession(context6.params.cwd, context6.params.mcpServers, context6.params.additionalDirectories);
|
|
546269
546832
|
await runtime2.announce({
|
|
@@ -546360,7 +546923,7 @@ function createAcpStdioAgent(deps) {
|
|
|
546360
546923
|
}
|
|
546361
546924
|
},
|
|
546362
546925
|
authMethods: [],
|
|
546363
|
-
agentInfo: { name: "UR-Nexus", version: "1.85.
|
|
546926
|
+
agentInfo: { name: "UR-Nexus", version: "1.85.2" }
|
|
546364
546927
|
});
|
|
546365
546928
|
return;
|
|
546366
546929
|
case "authenticate":
|
|
@@ -547015,7 +547578,7 @@ function option5(tokens, name) {
|
|
|
547015
547578
|
return index2 === -1 ? undefined : tokens[index2 + 1];
|
|
547016
547579
|
}
|
|
547017
547580
|
function positionals5(tokens) {
|
|
547018
|
-
const withValue = new Set(["--key"]);
|
|
547581
|
+
const withValue = new Set(["--key", "--workspace-id"]);
|
|
547019
547582
|
const values2 = [];
|
|
547020
547583
|
for (let i3 = 0;i3 < tokens.length; i3++) {
|
|
547021
547584
|
const token = tokens[i3];
|
|
@@ -547035,14 +547598,18 @@ function usage6() {
|
|
|
547035
547598
|
" ur connect status [--json] Show connection status for every provider",
|
|
547036
547599
|
" ur connect <provider> Connect (subscription: official login; API: prompts for a key)",
|
|
547037
547600
|
" ur connect <provider> --key <KEY> Store an API key (or pipe it: echo $KEY | ur connect <provider>)",
|
|
547601
|
+
" ur connect anthropic-api --workspace-id <wrkspc_...> Select a Claude workspace",
|
|
547038
547602
|
" ur connect logout <provider> Disconnect (clear stored key / CLI logout hint)",
|
|
547039
547603
|
"",
|
|
547040
547604
|
`Providers: ${PROVIDER_IDS.join(", ")}`
|
|
547041
547605
|
].join(`
|
|
547042
547606
|
`);
|
|
547043
547607
|
}
|
|
547044
|
-
async function connectProvider(provider, keyFlag) {
|
|
547608
|
+
async function connectProvider(provider, keyFlag, workspaceFlag) {
|
|
547045
547609
|
const def2 = getProviderDefinition(provider);
|
|
547610
|
+
if (workspaceFlag !== undefined && provider !== "anthropic-api") {
|
|
547611
|
+
return "--workspace-id is supported only by anthropic-api.";
|
|
547612
|
+
}
|
|
547046
547613
|
if (def2.accessType === "subscription") {
|
|
547047
547614
|
const alias = authAliasForProvider(provider);
|
|
547048
547615
|
if (alias === "provider") {
|
|
@@ -547053,6 +547620,11 @@ async function connectProvider(provider, keyFlag) {
|
|
|
547053
547620
|
Once logged in, ${def2.displayName} runs via its official CLI. Select it with /model.`;
|
|
547054
547621
|
}
|
|
547055
547622
|
if (def2.envKey) {
|
|
547623
|
+
if (provider === "anthropic-api" && workspaceFlag !== undefined) {
|
|
547624
|
+
const workspace = setSafeProviderConfig("anthropic.workspace_id", workspaceFlag);
|
|
547625
|
+
if (!workspace.ok)
|
|
547626
|
+
return workspace.message;
|
|
547627
|
+
}
|
|
547056
547628
|
let key = keyFlag;
|
|
547057
547629
|
if (key === undefined) {
|
|
547058
547630
|
try {
|
|
@@ -547114,7 +547686,10 @@ var call61 = async (args) => {
|
|
|
547114
547686
|
if (!provider) {
|
|
547115
547687
|
return { type: "text", value: usage6() };
|
|
547116
547688
|
}
|
|
547117
|
-
return {
|
|
547689
|
+
return {
|
|
547690
|
+
type: "text",
|
|
547691
|
+
value: await connectProvider(provider, option5(tokens, "--key"), option5(tokens, "--workspace-id"))
|
|
547692
|
+
};
|
|
547118
547693
|
};
|
|
547119
547694
|
var init_connect = __esm(() => {
|
|
547120
547695
|
init_argumentSubstitution();
|
|
@@ -760363,7 +760938,7 @@ async function captureMemoryDiagnostics(trigger2, dumpNumber = 0) {
|
|
|
760363
760938
|
smapsRollup,
|
|
760364
760939
|
platform: process.platform,
|
|
760365
760940
|
nodeVersion: process.version,
|
|
760366
|
-
ccVersion: "1.85.
|
|
760941
|
+
ccVersion: "1.85.2"
|
|
760367
760942
|
};
|
|
760368
760943
|
}
|
|
760369
760944
|
async function performHeapDump(trigger2 = "manual", dumpNumber = 0) {
|
|
@@ -760952,7 +761527,7 @@ var init_bridge_kick = __esm(() => {
|
|
|
760952
761527
|
var call153 = async () => {
|
|
760953
761528
|
return {
|
|
760954
761529
|
type: "text",
|
|
760955
|
-
value: "1.85.
|
|
761530
|
+
value: "1.85.2"
|
|
760956
761531
|
};
|
|
760957
761532
|
}, version2, version_default;
|
|
760958
761533
|
var init_version = __esm(() => {
|
|
@@ -763945,6 +764520,7 @@ function ProviderFirstModelPicker({
|
|
|
763945
764520
|
onSelect,
|
|
763946
764521
|
onCancel,
|
|
763947
764522
|
onTaskSelect,
|
|
764523
|
+
continueAfterTaskSelect = false,
|
|
763948
764524
|
isStandaloneCommand,
|
|
763949
764525
|
headerText
|
|
763950
764526
|
}) {
|
|
@@ -764264,6 +764840,13 @@ function ProviderFirstModelPicker({
|
|
|
764264
764840
|
taskKind: selectedOption.taskKind,
|
|
764265
764841
|
purpose: selectedOption.purpose
|
|
764266
764842
|
});
|
|
764843
|
+
if (continueAfterTaskSelect) {
|
|
764844
|
+
setSelectedProvider(null);
|
|
764845
|
+
setModelOptions([]);
|
|
764846
|
+
setFocusedModelValue(null);
|
|
764847
|
+
setProviderWarning("NVIDIA Special task mode is ready. Now choose the provider and model UR should use for ordinary agent conversations.");
|
|
764848
|
+
setStep("provider");
|
|
764849
|
+
}
|
|
764267
764850
|
return;
|
|
764268
764851
|
}
|
|
764269
764852
|
const selectedProviderId = selectedProvider?.value;
|
|
@@ -764350,6 +764933,9 @@ function ProviderFirstModelPicker({
|
|
|
764350
764933
|
}
|
|
764351
764934
|
setAppState((prev) => ({
|
|
764352
764935
|
...prev,
|
|
764936
|
+
mainLoopModel: value2,
|
|
764937
|
+
mainLoopModelForSession: null,
|
|
764938
|
+
nvidiaTaskModel: undefined,
|
|
764353
764939
|
provider: {
|
|
764354
764940
|
...prev.provider ?? {},
|
|
764355
764941
|
...savedProviderSettings ?? {
|
|
@@ -765187,18 +765773,6 @@ function ModelPickerWrapper(t0) {
|
|
|
765187
765773
|
from_model: mainLoopModel,
|
|
765188
765774
|
to_model: model
|
|
765189
765775
|
});
|
|
765190
|
-
setAppState((prev) => ({
|
|
765191
|
-
...prev,
|
|
765192
|
-
mainLoopModel: model,
|
|
765193
|
-
mainLoopModelForSession: null,
|
|
765194
|
-
...model && metadata2 ? {
|
|
765195
|
-
provider: {
|
|
765196
|
-
...prev.provider,
|
|
765197
|
-
active: metadata2.providerId,
|
|
765198
|
-
model
|
|
765199
|
-
}
|
|
765200
|
-
} : {}
|
|
765201
|
-
}));
|
|
765202
765776
|
let message = metadata2 ? `Selected provider: ${source_default.bold(metadata2.providerName)} (${metadata2.accessType})
|
|
765203
765777
|
Selected model: ${source_default.bold(renderModelLabel(model))}
|
|
765204
765778
|
Model source: ${metadata2.modelSource}
|
|
@@ -765239,9 +765813,12 @@ Runtime backend: ${metadata2.runtimeBackend}` : `Set model to ${source_default.b
|
|
|
765239
765813
|
let taskHandler;
|
|
765240
765814
|
if ($2[17] !== onDone) {
|
|
765241
765815
|
taskHandler = function handleTaskSelect(selection) {
|
|
765816
|
+
const contract = getNvidiaHostedTaskModelContract(selection.modelId);
|
|
765817
|
+
const required2 = Array.isArray(contract?.requestSchema.required) ? contract.requestSchema.required.filter((value2) => typeof value2 === "string") : [];
|
|
765242
765818
|
onDone(`Selected NVIDIA Special model: ${source_default.bold(selection.displayName)}
|
|
765243
765819
|
Purpose: ${selection.purpose}
|
|
765244
|
-
|
|
765820
|
+
Required input: ${required2.join(", ") || "none beyond the task description"}
|
|
765821
|
+
NVIDIA Special task mode is active; the ongoing agent model is unchanged. Your next non-command prompt runs this exact NVIDIA inference contract directly. For media inputs, use fields such as \`video_path: /path/file.mp4\` or \`image_path: /path/file.png\`.`);
|
|
765245
765822
|
};
|
|
765246
765823
|
$2[17] = onDone;
|
|
765247
765824
|
$2[18] = taskHandler;
|
|
@@ -765388,6 +765965,7 @@ function SetModelAndClose({
|
|
|
765388
765965
|
...prev,
|
|
765389
765966
|
mainLoopModel: modelValue,
|
|
765390
765967
|
mainLoopModelForSession: null,
|
|
765968
|
+
nvidiaTaskModel: undefined,
|
|
765391
765969
|
...provider ? {
|
|
765392
765970
|
provider: {
|
|
765393
765971
|
...prev.provider ?? {},
|
|
@@ -765518,6 +766096,7 @@ var init_model2 = __esm(() => {
|
|
|
765518
766096
|
init_providerRegistry();
|
|
765519
766097
|
init_settings2();
|
|
765520
766098
|
init_hooks5();
|
|
766099
|
+
init_nvidiaHostedModels();
|
|
765521
766100
|
import_compiler_runtime242 = __toESM(require_compiler_runtime(), 1);
|
|
765522
766101
|
React102 = __toESM(require_react(), 1);
|
|
765523
766102
|
jsx_dev_runtime334 = __toESM(require_jsx_dev_runtime(), 1);
|
|
@@ -772910,7 +773489,7 @@ function generateHtmlReport(data, insights) {
|
|
|
772910
773489
|
</html>`;
|
|
772911
773490
|
}
|
|
772912
773491
|
function buildExportData(data, insights, facets, remoteStats) {
|
|
772913
|
-
const version3 = typeof MACRO !== "undefined" ? "1.85.
|
|
773492
|
+
const version3 = typeof MACRO !== "undefined" ? "1.85.2" : "unknown";
|
|
772914
773493
|
const remote_hosts_collected = remoteStats?.hosts.filter((h2) => h2.sessionCount > 0).map((h2) => h2.name);
|
|
772915
773494
|
const facets_summary = {
|
|
772916
773495
|
total: facets.size,
|
|
@@ -777225,7 +777804,7 @@ var init_sessionStorage = __esm(() => {
|
|
|
777225
777804
|
init_settings2();
|
|
777226
777805
|
init_slowOperations();
|
|
777227
777806
|
init_uuid();
|
|
777228
|
-
VERSION7 = typeof MACRO !== "undefined" ? "1.85.
|
|
777807
|
+
VERSION7 = typeof MACRO !== "undefined" ? "1.85.2" : "unknown";
|
|
777229
777808
|
MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
|
|
777230
777809
|
SKIP_FIRST_PROMPT_PATTERN = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
|
|
777231
777810
|
EPHEMERAL_PROGRESS_TYPES = new Set([
|
|
@@ -778440,7 +779019,7 @@ var init_filesystem = __esm(() => {
|
|
|
778440
779019
|
});
|
|
778441
779020
|
getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
|
|
778442
779021
|
const nonce = randomBytes23(16).toString("hex");
|
|
778443
|
-
return join236(getURTempDir(), "bundled-skills", "1.85.
|
|
779022
|
+
return join236(getURTempDir(), "bundled-skills", "1.85.2", nonce);
|
|
778444
779023
|
});
|
|
778445
779024
|
getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
|
|
778446
779025
|
});
|
|
@@ -798249,7 +798828,7 @@ async function createStandardAPIClient(options5) {
|
|
|
798249
798828
|
const response = await axiosPostWithProviderReliability(endpoint, buildAPIRequest(family, wireParams, providerId), {
|
|
798250
798829
|
headers: {
|
|
798251
798830
|
"Content-Type": "application/json",
|
|
798252
|
-
...buildAuthHeaders(family, apiKey, wireParams),
|
|
798831
|
+
...buildAuthHeaders(family, apiKey, wireParams, options5.anthropic),
|
|
798253
798832
|
...clientRequestId && { "x-client-request-id": clientRequestId },
|
|
798254
798833
|
...requestOptions?.headers ?? {}
|
|
798255
798834
|
}
|
|
@@ -798272,7 +798851,7 @@ async function createStandardAPIClient(options5) {
|
|
|
798272
798851
|
const response = await axiosPostWithProviderReliability(endpoint, buildAPIRequest(family, { ...wireParams, stream: true }, providerId), {
|
|
798273
798852
|
headers: {
|
|
798274
798853
|
"Content-Type": "application/json",
|
|
798275
|
-
...buildAuthHeaders(family, apiKey, wireParams),
|
|
798854
|
+
...buildAuthHeaders(family, apiKey, wireParams, options5.anthropic),
|
|
798276
798855
|
...clientRequestId && { "x-client-request-id": clientRequestId },
|
|
798277
798856
|
...requestOptions?.headers ?? {}
|
|
798278
798857
|
},
|
|
@@ -798329,7 +798908,7 @@ async function createStandardAPIClient(options5) {
|
|
|
798329
798908
|
method: "POST",
|
|
798330
798909
|
headers: {
|
|
798331
798910
|
"Content-Type": "application/json",
|
|
798332
|
-
...buildAuthHeaders(family, apiKey, params),
|
|
798911
|
+
...buildAuthHeaders(family, apiKey, params, options5.anthropic),
|
|
798333
798912
|
...requestOptions?.headers ?? {}
|
|
798334
798913
|
},
|
|
798335
798914
|
body: JSON.stringify(body)
|
|
@@ -798433,12 +799012,13 @@ function getAPIEndpoint(family, baseUrl, model, stream5) {
|
|
|
798433
799012
|
return baseUrl ?? "";
|
|
798434
799013
|
}
|
|
798435
799014
|
}
|
|
798436
|
-
function buildAuthHeaders(family, apiKey, params) {
|
|
799015
|
+
function buildAuthHeaders(family, apiKey, params, anthropic) {
|
|
798437
799016
|
switch (family) {
|
|
798438
799017
|
case "anthropic": {
|
|
798439
799018
|
const headers = {
|
|
798440
799019
|
"x-api-key": apiKey ?? "",
|
|
798441
|
-
"anthropic-version": ANTHROPIC_VERSION
|
|
799020
|
+
"anthropic-version": ANTHROPIC_VERSION,
|
|
799021
|
+
...anthropicWorkspaceHeaders(anthropic?.workspaceId, {})
|
|
798442
799022
|
};
|
|
798443
799023
|
if (Array.isArray(params.betas) && params.betas.length > 0) {
|
|
798444
799024
|
headers["anthropic-beta"] = params.betas.join(",");
|
|
@@ -799028,6 +799608,7 @@ var init_standardAPI = __esm(() => {
|
|
|
799028
799608
|
init_debug();
|
|
799029
799609
|
init_effort();
|
|
799030
799610
|
init_providerRegistry();
|
|
799611
|
+
init_anthropicWorkspace();
|
|
799031
799612
|
init_openaiCompatible();
|
|
799032
799613
|
init_providerClient();
|
|
799033
799614
|
init_providerHttp();
|
|
@@ -799332,6 +799913,10 @@ async function createAPIClient(providerId, options5 = {}) {
|
|
|
799332
799913
|
});
|
|
799333
799914
|
}
|
|
799334
799915
|
const { createStandardAPIClient: createStandardAPIClient2 } = await Promise.resolve().then(() => (init_standardAPI(), exports_standardAPI));
|
|
799916
|
+
const anthropic = providerId === "anthropic-api" ? {
|
|
799917
|
+
...providerSettings.anthropic,
|
|
799918
|
+
workspaceId: resolveAnthropicWorkspaceId(providerSettings.anthropic?.workspaceId, process.env)
|
|
799919
|
+
} : providerSettings.anthropic;
|
|
799335
799920
|
return await createStandardAPIClient2({
|
|
799336
799921
|
providerId,
|
|
799337
799922
|
apiKey,
|
|
@@ -799339,7 +799924,7 @@ async function createAPIClient(providerId, options5 = {}) {
|
|
|
799339
799924
|
maxRetries: options5.maxRetries ?? 3,
|
|
799340
799925
|
model: options5.model,
|
|
799341
799926
|
fetch: options5.fetchOverride,
|
|
799342
|
-
anthropic
|
|
799927
|
+
anthropic
|
|
799343
799928
|
});
|
|
799344
799929
|
}
|
|
799345
799930
|
var ProviderResponseParseError, ProviderCapabilityError;
|
|
@@ -799347,6 +799932,7 @@ var init_providerClient = __esm(() => {
|
|
|
799347
799932
|
init_providerRegistry();
|
|
799348
799933
|
init_settings2();
|
|
799349
799934
|
init_providerCredentials();
|
|
799935
|
+
init_anthropicWorkspace();
|
|
799350
799936
|
init_offlineMode();
|
|
799351
799937
|
init_ollamaConfig();
|
|
799352
799938
|
ProviderResponseParseError = class ProviderResponseParseError extends Error {
|
|
@@ -810290,7 +810876,7 @@ function getUserAgent() {
|
|
|
810290
810876
|
const clientApp = process.env.UR_AGENT_SDK_CLIENT_APP ? `, client-app/${process.env.UR_AGENT_SDK_CLIENT_APP}` : "";
|
|
810291
810877
|
const workload = getWorkload();
|
|
810292
810878
|
const workloadSuffix = workload ? `, workload/${workload}` : "";
|
|
810293
|
-
return `ur-cli/${"1.85.
|
|
810879
|
+
return `ur-cli/${"1.85.2"} (${process.env.USER_TYPE}, ${process.env.UR_CODE_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
|
|
810294
810880
|
}
|
|
810295
810881
|
function getMCPUserAgent() {
|
|
810296
810882
|
const parts = [];
|
|
@@ -810304,7 +810890,7 @@ function getMCPUserAgent() {
|
|
|
810304
810890
|
parts.push(`client-app/${process.env.UR_AGENT_SDK_CLIENT_APP}`);
|
|
810305
810891
|
}
|
|
810306
810892
|
const suffix = parts.length > 0 ? ` (${parts.join(", ")})` : "";
|
|
810307
|
-
return `ur/${"1.85.
|
|
810893
|
+
return `ur/${"1.85.2"}${suffix}`;
|
|
810308
810894
|
}
|
|
810309
810895
|
function getWebFetchUserAgent() {
|
|
810310
810896
|
return `UR-User (${getURCodeUserAgent()})`;
|
|
@@ -821742,7 +822328,7 @@ function a2aSseResponse(stream5, version3, onFinally) {
|
|
|
821742
822328
|
}
|
|
821743
822329
|
});
|
|
821744
822330
|
}
|
|
821745
|
-
function
|
|
822331
|
+
function isAsyncIterable2(value2) {
|
|
821746
822332
|
return Boolean(value2) && typeof value2 === "object" && Symbol.asyncIterator in value2;
|
|
821747
822333
|
}
|
|
821748
822334
|
function agentCardResponse(card, version3, request) {
|
|
@@ -821898,7 +822484,7 @@ async function handleA2AProtocolRequest(request, options5, baseUrl) {
|
|
|
821898
822484
|
let streamingLeaseTransferred = false;
|
|
821899
822485
|
try {
|
|
821900
822486
|
const response = await protocolRuntimes(options5, baseUrl).runtime.handle(payload, protocolIdentity(auth2, inspection.method === "message/send" || inspection.method === "message/stream" ? inspection.skill : undefined));
|
|
821901
|
-
if (
|
|
822487
|
+
if (isAsyncIterable2(response)) {
|
|
821902
822488
|
streamingLeaseTransferred = true;
|
|
821903
822489
|
return a2aSseResponse(response, "0.3", releaseSubmission);
|
|
821904
822490
|
}
|
|
@@ -822067,7 +822653,7 @@ async function handleA2AV1JsonRpcRequest(request, options5, baseUrl) {
|
|
|
822067
822653
|
let streamingLeaseTransferred = false;
|
|
822068
822654
|
try {
|
|
822069
822655
|
const response = await protocolRuntimes(options5, baseUrl).v1.handleJsonRpc(payload, protocolIdentity(auth2, inspection.method === "SendMessage" || inspection.method === "SendStreamingMessage" ? inspection.skill : undefined));
|
|
822070
|
-
if (
|
|
822656
|
+
if (isAsyncIterable2(response)) {
|
|
822071
822657
|
streamingLeaseTransferred = true;
|
|
822072
822658
|
return a2aSseResponse(response, "1.0", releaseSubmission);
|
|
822073
822659
|
}
|
|
@@ -827474,7 +828060,7 @@ function buildSystemInitMessage(inputs) {
|
|
|
827474
828060
|
slash_commands: inputs.commands.filter((c4) => c4.userInvocable !== false).map((c4) => c4.name),
|
|
827475
828061
|
apiKeySource: getURHQApiKeyWithSource().source,
|
|
827476
828062
|
betas: getSdkBetas(),
|
|
827477
|
-
ur_version: "1.85.
|
|
828063
|
+
ur_version: "1.85.2",
|
|
827478
828064
|
output_style: outputStyle,
|
|
827479
828065
|
agents: inputs.agents.map((agent2) => agent2.agentType),
|
|
827480
828066
|
skills: inputs.skills.filter((s) => s.userInvocable !== false).map((skill2) => skill2.name),
|
|
@@ -831015,7 +831601,7 @@ var init_useVoiceEnabled = __esm(() => {
|
|
|
831015
831601
|
function getSemverPart(version3) {
|
|
831016
831602
|
return `${import_semver13.major(version3, { loose: true })}.${import_semver13.minor(version3, { loose: true })}.${import_semver13.patch(version3, { loose: true })}`;
|
|
831017
831603
|
}
|
|
831018
|
-
function useUpdateNotification(updatedVersion, initialVersion = "1.85.
|
|
831604
|
+
function useUpdateNotification(updatedVersion, initialVersion = "1.85.2") {
|
|
831019
831605
|
const [lastNotifiedSemver, setLastNotifiedSemver] = import_react225.useState(() => getSemverPart(initialVersion));
|
|
831020
831606
|
if (!updatedVersion) {
|
|
831021
831607
|
return null;
|
|
@@ -831064,7 +831650,7 @@ function AutoUpdater({
|
|
|
831064
831650
|
return;
|
|
831065
831651
|
}
|
|
831066
831652
|
if (false) {}
|
|
831067
|
-
const currentVersion = "1.85.
|
|
831653
|
+
const currentVersion = "1.85.2";
|
|
831068
831654
|
const channel = getInitialSettings()?.autoUpdatesChannel ?? "latest";
|
|
831069
831655
|
let latestVersion = await getLatestVersion(channel);
|
|
831070
831656
|
const isDisabled = isAutoUpdaterDisabled();
|
|
@@ -831293,12 +831879,12 @@ function NativeAutoUpdater({
|
|
|
831293
831879
|
logEvent("tengu_native_auto_updater_start", {});
|
|
831294
831880
|
try {
|
|
831295
831881
|
const maxVersion = await getMaxVersion();
|
|
831296
|
-
if (maxVersion && gt("1.85.
|
|
831882
|
+
if (maxVersion && gt("1.85.2", maxVersion)) {
|
|
831297
831883
|
const msg = await getMaxVersionMessage();
|
|
831298
831884
|
setMaxVersionIssue(msg ?? "affects your version");
|
|
831299
831885
|
}
|
|
831300
831886
|
const result = await installLatest(channel);
|
|
831301
|
-
const currentVersion = "1.85.
|
|
831887
|
+
const currentVersion = "1.85.2";
|
|
831302
831888
|
const latencyMs = Date.now() - startTime;
|
|
831303
831889
|
if (result.lockFailed) {
|
|
831304
831890
|
logEvent("tengu_native_auto_updater_lock_contention", {
|
|
@@ -831435,17 +832021,17 @@ function PackageManagerAutoUpdater(t0) {
|
|
|
831435
832021
|
const maxVersion = await getMaxVersion();
|
|
831436
832022
|
if (maxVersion && latest && gt(latest, maxVersion)) {
|
|
831437
832023
|
logForDebugging(`PackageManagerAutoUpdater: maxVersion ${maxVersion} is set, capping update from ${latest} to ${maxVersion}`);
|
|
831438
|
-
if (gte("1.85.
|
|
831439
|
-
logForDebugging(`PackageManagerAutoUpdater: current version ${"1.85.
|
|
832024
|
+
if (gte("1.85.2", maxVersion)) {
|
|
832025
|
+
logForDebugging(`PackageManagerAutoUpdater: current version ${"1.85.2"} is already at or above maxVersion ${maxVersion}, skipping update`);
|
|
831440
832026
|
setUpdateAvailable(false);
|
|
831441
832027
|
return;
|
|
831442
832028
|
}
|
|
831443
832029
|
latest = maxVersion;
|
|
831444
832030
|
}
|
|
831445
|
-
const hasUpdate = latest && !gte("1.85.
|
|
832031
|
+
const hasUpdate = latest && !gte("1.85.2", latest) && !shouldSkipVersion(latest);
|
|
831446
832032
|
setUpdateAvailable(!!hasUpdate);
|
|
831447
832033
|
if (hasUpdate) {
|
|
831448
|
-
logForDebugging(`PackageManagerAutoUpdater: Update available ${"1.85.
|
|
832034
|
+
logForDebugging(`PackageManagerAutoUpdater: Update available ${"1.85.2"} -> ${latest}`);
|
|
831449
832035
|
}
|
|
831450
832036
|
};
|
|
831451
832037
|
$2[0] = t1;
|
|
@@ -831479,7 +832065,7 @@ function PackageManagerAutoUpdater(t0) {
|
|
|
831479
832065
|
wrap: "truncate",
|
|
831480
832066
|
children: [
|
|
831481
832067
|
"currentVersion: ",
|
|
831482
|
-
"1.85.
|
|
832068
|
+
"1.85.2"
|
|
831483
832069
|
]
|
|
831484
832070
|
}, undefined, true, undefined, this);
|
|
831485
832071
|
$2[3] = verbose;
|
|
@@ -842328,7 +842914,7 @@ function buildStatusLineCommandInput(permissionMode, exceeds200kTokens, settings
|
|
|
842328
842914
|
project_dir: getOriginalCwd(),
|
|
842329
842915
|
added_dirs: addedDirs
|
|
842330
842916
|
},
|
|
842331
|
-
version: "1.85.
|
|
842917
|
+
version: "1.85.2",
|
|
842332
842918
|
output_style: {
|
|
842333
842919
|
name: outputStyleName
|
|
842334
842920
|
},
|
|
@@ -842438,6 +843024,7 @@ function StatusLineInner({
|
|
|
842438
843024
|
const setAppState = useSetAppState();
|
|
842439
843025
|
const settings = useSettings();
|
|
842440
843026
|
const providerSelection = useAppState((s) => s.provider);
|
|
843027
|
+
const nvidiaTaskModel = useAppState((s) => s.nvidiaTaskModel);
|
|
842441
843028
|
const [branch2, setBranch] = import_react249.useState(null);
|
|
842442
843029
|
const [runtimeMs, setRuntimeMs] = import_react249.useState(null);
|
|
842443
843030
|
const [customStatusReady, setCustomStatusReady] = import_react249.useState(false);
|
|
@@ -842463,10 +843050,10 @@ function StatusLineInner({
|
|
|
842463
843050
|
const attention = customStatusError ?? taskAttention;
|
|
842464
843051
|
const terminalSize = React138.useContext(TerminalSizeContext);
|
|
842465
843052
|
const defaultStatusLineText = buildDefaultStatusBar({
|
|
842466
|
-
version: "1.85.
|
|
842467
|
-
providerLabel: providerRuntime.providerLabel,
|
|
842468
|
-
authMode: providerRuntime.authLabel,
|
|
842469
|
-
model: renderModelName(mainLoopModel) || providerRuntime.model || "",
|
|
843053
|
+
version: "1.85.2",
|
|
843054
|
+
providerLabel: nvidiaTaskModel ? "NVIDIA Special" : providerRuntime.providerLabel,
|
|
843055
|
+
authMode: nvidiaTaskModel ? "API key" : providerRuntime.authLabel,
|
|
843056
|
+
model: nvidiaTaskModel ?? (renderModelName(mainLoopModel) || providerRuntime.model || ""),
|
|
842470
843057
|
mode: permissionMode,
|
|
842471
843058
|
branch: branch2,
|
|
842472
843059
|
taskRunningCount: taskSummary.running,
|
|
@@ -851579,6 +852166,144 @@ var init_processUserInput = __esm(() => {
|
|
|
851579
852166
|
init_processTextPrompt();
|
|
851580
852167
|
});
|
|
851581
852168
|
|
|
852169
|
+
// src/services/providers/nvidiaDirectTask.ts
|
|
852170
|
+
function parseJsonObject2(value2, label) {
|
|
852171
|
+
let parsed;
|
|
852172
|
+
try {
|
|
852173
|
+
parsed = JSON.parse(value2);
|
|
852174
|
+
} catch (error61) {
|
|
852175
|
+
throw new Error(`${label} must be valid JSON: ${error61 instanceof Error ? error61.message : String(error61)}`);
|
|
852176
|
+
}
|
|
852177
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
852178
|
+
throw new Error(`${label} must contain a JSON object.`);
|
|
852179
|
+
}
|
|
852180
|
+
return parsed;
|
|
852181
|
+
}
|
|
852182
|
+
function assignConvenienceValue(request, key, value2) {
|
|
852183
|
+
if (key in STRING_FIELDS && typeof value2 === "string") {
|
|
852184
|
+
request[STRING_FIELDS[key]] = value2;
|
|
852185
|
+
return true;
|
|
852186
|
+
}
|
|
852187
|
+
if (key in NUMBER_FIELDS && typeof value2 === "number" && Number.isFinite(value2)) {
|
|
852188
|
+
request[NUMBER_FIELDS[key]] = value2;
|
|
852189
|
+
return true;
|
|
852190
|
+
}
|
|
852191
|
+
if (key === "passages" && Array.isArray(value2)) {
|
|
852192
|
+
request.passages = value2.filter((item) => typeof item === "string");
|
|
852193
|
+
return true;
|
|
852194
|
+
}
|
|
852195
|
+
if (key === "payload" && value2 && typeof value2 === "object" && !Array.isArray(value2)) {
|
|
852196
|
+
request.payload = value2;
|
|
852197
|
+
return true;
|
|
852198
|
+
}
|
|
852199
|
+
return false;
|
|
852200
|
+
}
|
|
852201
|
+
function parseNvidiaDirectTaskInput(model, input2) {
|
|
852202
|
+
const trimmed = input2.trim();
|
|
852203
|
+
const request = { model };
|
|
852204
|
+
if (trimmed.startsWith("{")) {
|
|
852205
|
+
const object2 = parseJsonObject2(trimmed, "NVIDIA Special input");
|
|
852206
|
+
const recognized = [];
|
|
852207
|
+
for (const [key, value2] of Object.entries(object2)) {
|
|
852208
|
+
if (assignConvenienceValue(request, key, value2))
|
|
852209
|
+
recognized.push(key);
|
|
852210
|
+
}
|
|
852211
|
+
if (recognized.length === 0)
|
|
852212
|
+
request.payload = object2;
|
|
852213
|
+
else {
|
|
852214
|
+
const exactPayload = Object.fromEntries(Object.entries(object2).filter(([key]) => !recognized.includes(key)));
|
|
852215
|
+
if (Object.keys(exactPayload).length > 0) {
|
|
852216
|
+
request.payload = { ...request.payload, ...exactPayload };
|
|
852217
|
+
}
|
|
852218
|
+
}
|
|
852219
|
+
return request;
|
|
852220
|
+
}
|
|
852221
|
+
const lines = trimmed.split(/\r?\n/u);
|
|
852222
|
+
const freeText3 = [];
|
|
852223
|
+
let recognizedField = false;
|
|
852224
|
+
for (const line of lines) {
|
|
852225
|
+
const match = line.match(/^\s*([a-z][a-z0-9_]*)\s*[:=]\s*(.*?)\s*$/iu);
|
|
852226
|
+
if (!match) {
|
|
852227
|
+
freeText3.push(line);
|
|
852228
|
+
continue;
|
|
852229
|
+
}
|
|
852230
|
+
const key = match[1].toLowerCase();
|
|
852231
|
+
const rawValue = match[2];
|
|
852232
|
+
if (key === "payload_json") {
|
|
852233
|
+
request.payload = parseJsonObject2(rawValue, "payload_json");
|
|
852234
|
+
recognizedField = true;
|
|
852235
|
+
} else if (key === "passages") {
|
|
852236
|
+
const parsed = JSON.parse(rawValue);
|
|
852237
|
+
if (!Array.isArray(parsed) || !parsed.every((item) => typeof item === "string")) {
|
|
852238
|
+
throw new Error("passages must be a JSON array of strings.");
|
|
852239
|
+
}
|
|
852240
|
+
request.passages = parsed;
|
|
852241
|
+
recognizedField = true;
|
|
852242
|
+
} else if (key in STRING_FIELDS) {
|
|
852243
|
+
request[STRING_FIELDS[key]] = rawValue;
|
|
852244
|
+
recognizedField = true;
|
|
852245
|
+
} else if (key in NUMBER_FIELDS) {
|
|
852246
|
+
const number4 = Number(rawValue);
|
|
852247
|
+
if (!Number.isFinite(number4))
|
|
852248
|
+
throw new Error(`${key} must be a number.`);
|
|
852249
|
+
request[NUMBER_FIELDS[key]] = number4;
|
|
852250
|
+
recognizedField = true;
|
|
852251
|
+
} else {
|
|
852252
|
+
freeText3.push(line);
|
|
852253
|
+
}
|
|
852254
|
+
}
|
|
852255
|
+
if (!recognizedField)
|
|
852256
|
+
request.prompt = trimmed;
|
|
852257
|
+
else if (!request.prompt && freeText3.join(`
|
|
852258
|
+
`).trim()) {
|
|
852259
|
+
request.prompt = freeText3.join(`
|
|
852260
|
+
`).trim();
|
|
852261
|
+
}
|
|
852262
|
+
return request;
|
|
852263
|
+
}
|
|
852264
|
+
async function runNvidiaDirectTask(model, input2, options5) {
|
|
852265
|
+
return runNvidiaHostedTask(parseNvidiaDirectTaskInput(model, input2), options5);
|
|
852266
|
+
}
|
|
852267
|
+
function formatNvidiaDirectTaskResult(result) {
|
|
852268
|
+
const lines = [
|
|
852269
|
+
`NVIDIA Special completed ${result.taskKind} with ${result.model}.`
|
|
852270
|
+
];
|
|
852271
|
+
if (result.text)
|
|
852272
|
+
lines.push(result.text);
|
|
852273
|
+
if (result.artifacts?.length) {
|
|
852274
|
+
lines.push("Artifacts:", ...result.artifacts.map((artifact) => `- ${artifact.label}: ${artifact.path} (${artifact.mediaType})`));
|
|
852275
|
+
} else if (result.outputPath) {
|
|
852276
|
+
lines.push(`Artifact: ${result.outputPath}${result.mediaType ? ` (${result.mediaType})` : ""}`);
|
|
852277
|
+
}
|
|
852278
|
+
if (result.seed !== undefined)
|
|
852279
|
+
lines.push(`Seed: ${result.seed}`);
|
|
852280
|
+
return lines.join(`
|
|
852281
|
+
`);
|
|
852282
|
+
}
|
|
852283
|
+
var STRING_FIELDS, NUMBER_FIELDS;
|
|
852284
|
+
var init_nvidiaDirectTask = __esm(() => {
|
|
852285
|
+
init_nvidiaTaskRuntime();
|
|
852286
|
+
STRING_FIELDS = {
|
|
852287
|
+
prompt: "prompt",
|
|
852288
|
+
image_path: "imagePath",
|
|
852289
|
+
input_path: "inputPath",
|
|
852290
|
+
audio_path: "audioPath",
|
|
852291
|
+
video_path: "videoPath",
|
|
852292
|
+
reference_audio_path: "referenceAudioPath",
|
|
852293
|
+
diarization_path: "diarizationPath",
|
|
852294
|
+
output_path: "outputPath",
|
|
852295
|
+
query: "query"
|
|
852296
|
+
};
|
|
852297
|
+
NUMBER_FIELDS = {
|
|
852298
|
+
width: "width",
|
|
852299
|
+
height: "height",
|
|
852300
|
+
steps: "steps",
|
|
852301
|
+
seed: "seed",
|
|
852302
|
+
cfg_scale: "cfgScale",
|
|
852303
|
+
max_tokens: "maxTokens"
|
|
852304
|
+
};
|
|
852305
|
+
});
|
|
852306
|
+
|
|
851582
852307
|
// src/utils/handlePromptSubmit.ts
|
|
851583
852308
|
function exit2() {
|
|
851584
852309
|
gracefulShutdownSync(0);
|
|
@@ -851603,6 +852328,8 @@ async function handlePromptSubmit(params) {
|
|
|
851603
852328
|
onBeforeQuery,
|
|
851604
852329
|
canUseTool,
|
|
851605
852330
|
queuedCommands,
|
|
852331
|
+
addNotification,
|
|
852332
|
+
setMessages,
|
|
851606
852333
|
uuid: uuid3,
|
|
851607
852334
|
skipSlashCommands
|
|
851608
852335
|
} = params;
|
|
@@ -851626,7 +852353,9 @@ async function handlePromptSubmit(params) {
|
|
|
851626
852353
|
onBeforeQuery,
|
|
851627
852354
|
resetHistory,
|
|
851628
852355
|
canUseTool,
|
|
851629
|
-
onInputChange
|
|
852356
|
+
onInputChange,
|
|
852357
|
+
addNotification,
|
|
852358
|
+
setMessages
|
|
851630
852359
|
});
|
|
851631
852360
|
return;
|
|
851632
852361
|
}
|
|
@@ -851761,7 +852490,9 @@ async function handlePromptSubmit(params) {
|
|
|
851761
852490
|
onBeforeQuery,
|
|
851762
852491
|
resetHistory,
|
|
851763
852492
|
canUseTool,
|
|
851764
|
-
onInputChange
|
|
852493
|
+
onInputChange,
|
|
852494
|
+
addNotification,
|
|
852495
|
+
setMessages
|
|
851765
852496
|
});
|
|
851766
852497
|
}
|
|
851767
852498
|
async function executeUserInput(params) {
|
|
@@ -851780,7 +852511,9 @@ async function executeUserInput(params) {
|
|
|
851780
852511
|
onBeforeQuery,
|
|
851781
852512
|
resetHistory,
|
|
851782
852513
|
canUseTool,
|
|
851783
|
-
queuedCommands
|
|
852514
|
+
queuedCommands,
|
|
852515
|
+
addNotification,
|
|
852516
|
+
setMessages
|
|
851784
852517
|
} = params;
|
|
851785
852518
|
const abortController = createAbortController();
|
|
851786
852519
|
setAbortController(abortController);
|
|
@@ -851795,6 +852528,48 @@ async function executeUserInput(params) {
|
|
|
851795
852528
|
if (reservationToken === undefined) {
|
|
851796
852529
|
throw new Error("Prompt dispatch could not reserve the active query slot.");
|
|
851797
852530
|
}
|
|
852531
|
+
const firstCommand = queuedCommands?.[0];
|
|
852532
|
+
const firstCommandInput = typeof firstCommand?.value === "string" ? firstCommand.value : undefined;
|
|
852533
|
+
const nvidiaTaskModel = makeContext().getAppState().nvidiaTaskModel;
|
|
852534
|
+
const isDirectNvidiaTask = Boolean(nvidiaTaskModel) && firstCommand?.mode === "prompt" && firstCommandInput !== undefined && !firstCommandInput.trimStart().startsWith("/");
|
|
852535
|
+
if (isDirectNvidiaTask && firstCommand && firstCommandInput !== undefined && nvidiaTaskModel) {
|
|
852536
|
+
const input2 = firstCommandInput.trim();
|
|
852537
|
+
let responseText2;
|
|
852538
|
+
try {
|
|
852539
|
+
const result = await runNvidiaDirectTask(nvidiaTaskModel, input2, {
|
|
852540
|
+
apiKey: getProviderApiKey("nvidia-special") ?? "",
|
|
852541
|
+
cwd: getCwd(),
|
|
852542
|
+
signal: abortController.signal
|
|
852543
|
+
});
|
|
852544
|
+
responseText2 = formatNvidiaDirectTaskResult(result);
|
|
852545
|
+
} catch (error61) {
|
|
852546
|
+
responseText2 = `NVIDIA Special could not run ${nvidiaTaskModel}: ${error61 instanceof Error ? error61.message : String(error61)}`;
|
|
852547
|
+
}
|
|
852548
|
+
const userMessage = createUserMessage({
|
|
852549
|
+
content: input2,
|
|
852550
|
+
uuid: firstCommand.uuid
|
|
852551
|
+
});
|
|
852552
|
+
const assistantMessage = createAssistantMessage({ content: responseText2 });
|
|
852553
|
+
if (setMessages) {
|
|
852554
|
+
setMessages((previous) => [...previous, userMessage, assistantMessage]);
|
|
852555
|
+
} else {
|
|
852556
|
+
addNotification?.({
|
|
852557
|
+
key: `nvidia-special-${assistantMessage.uuid}`,
|
|
852558
|
+
text: responseText2,
|
|
852559
|
+
priority: "immediate"
|
|
852560
|
+
});
|
|
852561
|
+
}
|
|
852562
|
+
for (const command8 of queuedCommands?.slice(1) ?? [])
|
|
852563
|
+
enqueue(command8);
|
|
852564
|
+
resetHistory();
|
|
852565
|
+
setToolJSX({
|
|
852566
|
+
jsx: null,
|
|
852567
|
+
shouldHidePromptInput: false,
|
|
852568
|
+
clearLocalJSX: true
|
|
852569
|
+
});
|
|
852570
|
+
setAbortController(null);
|
|
852571
|
+
return;
|
|
852572
|
+
}
|
|
851798
852573
|
queryCheckpoint("query_process_user_input_start");
|
|
851799
852574
|
const newMessages = [];
|
|
851800
852575
|
let shouldQuery = false;
|
|
@@ -851919,6 +852694,10 @@ var init_handlePromptSubmit = __esm(() => {
|
|
|
851919
852694
|
init_model();
|
|
851920
852695
|
init_processUserInput();
|
|
851921
852696
|
init_queryProfiler();
|
|
852697
|
+
init_providerCredentials();
|
|
852698
|
+
init_nvidiaDirectTask();
|
|
852699
|
+
init_cwd2();
|
|
852700
|
+
init_messages();
|
|
851922
852701
|
init_workloadContext();
|
|
851923
852702
|
init_taskListRunContext();
|
|
851924
852703
|
init_tasks();
|
|
@@ -854854,7 +855633,7 @@ async function submitTranscriptShare(messages, trigger2, appearanceId) {
|
|
|
854854
855633
|
} catch {}
|
|
854855
855634
|
const data = {
|
|
854856
855635
|
trigger: trigger2,
|
|
854857
|
-
version: "1.85.
|
|
855636
|
+
version: "1.85.2",
|
|
854858
855637
|
platform: process.platform,
|
|
854859
855638
|
transcript,
|
|
854860
855639
|
subagentTranscripts: Object.keys(subagentTranscripts).length > 0 ? subagentTranscripts : undefined,
|
|
@@ -867236,7 +868015,7 @@ function WelcomeV2() {
|
|
|
867236
868015
|
dimColor: true,
|
|
867237
868016
|
children: [
|
|
867238
868017
|
"v",
|
|
867239
|
-
"1.85.
|
|
868018
|
+
"1.85.2"
|
|
867240
868019
|
]
|
|
867241
868020
|
}, undefined, true, undefined, this)
|
|
867242
868021
|
]
|
|
@@ -868482,7 +869261,7 @@ function completeOnboarding() {
|
|
|
868482
869261
|
saveGlobalConfig((current) => ({
|
|
868483
869262
|
...current,
|
|
868484
869263
|
hasCompletedOnboarding: true,
|
|
868485
|
-
lastOnboardingVersion: "1.85.
|
|
869264
|
+
lastOnboardingVersion: "1.85.2"
|
|
868486
869265
|
}));
|
|
868487
869266
|
}
|
|
868488
869267
|
function showDialog(root2, renderer) {
|
|
@@ -873479,7 +874258,7 @@ function appendToLog(path28, message) {
|
|
|
873479
874258
|
cwd: getFsImplementation().cwd(),
|
|
873480
874259
|
userType: process.env.USER_TYPE,
|
|
873481
874260
|
sessionId: getSessionId(),
|
|
873482
|
-
version: "1.85.
|
|
874261
|
+
version: "1.85.2"
|
|
873483
874262
|
};
|
|
873484
874263
|
getLogWriter(path28).write(messageWithTimestamp);
|
|
873485
874264
|
}
|
|
@@ -877642,8 +878421,8 @@ async function getEnvLessBridgeConfig() {
|
|
|
877642
878421
|
}
|
|
877643
878422
|
async function checkEnvLessBridgeMinVersion() {
|
|
877644
878423
|
const cfg = await getEnvLessBridgeConfig();
|
|
877645
|
-
if (cfg.min_version && lt("1.85.
|
|
877646
|
-
return `Your version of UR (${"1.85.
|
|
878424
|
+
if (cfg.min_version && lt("1.85.2", cfg.min_version)) {
|
|
878425
|
+
return `Your version of UR (${"1.85.2"}) is too old for Remote Control.
|
|
877647
878426
|
Version ${cfg.min_version} or higher is required. Run \`ur update\` to update.`;
|
|
877648
878427
|
}
|
|
877649
878428
|
return null;
|
|
@@ -878117,7 +878896,7 @@ async function initBridgeCore(params) {
|
|
|
878117
878896
|
const rawApi = createBridgeApiClient({
|
|
878118
878897
|
baseUrl,
|
|
878119
878898
|
getAccessToken,
|
|
878120
|
-
runnerVersion: "1.85.
|
|
878899
|
+
runnerVersion: "1.85.2",
|
|
878121
878900
|
onDebug: logForDebugging,
|
|
878122
878901
|
onAuth401,
|
|
878123
878902
|
getTrustedDeviceToken
|
|
@@ -891559,7 +892338,7 @@ function getAgUiCapabilities() {
|
|
|
891559
892338
|
name: "UR-Nexus",
|
|
891560
892339
|
type: "ur-nexus",
|
|
891561
892340
|
description: "Provider-flexible, local-first autonomous engineering workflow agent.",
|
|
891562
|
-
version: "1.85.
|
|
892341
|
+
version: "1.85.2",
|
|
891563
892342
|
provider: "UR",
|
|
891564
892343
|
documentationUrl: "https://github.com/Maitham16/UR/blob/master/docs/AG_UI.md"
|
|
891565
892344
|
},
|
|
@@ -892379,7 +893158,7 @@ function createMCPServer(cwd4, debug2, verbose) {
|
|
|
892379
893158
|
};
|
|
892380
893159
|
const server2 = new Server({
|
|
892381
893160
|
name: "ur-nexus",
|
|
892382
|
-
version: "1.85.
|
|
893161
|
+
version: "1.85.2"
|
|
892383
893162
|
}, {
|
|
892384
893163
|
capabilities: {
|
|
892385
893164
|
tools: {}
|
|
@@ -893582,7 +894361,7 @@ function thrownResponse(error61) {
|
|
|
893582
894361
|
}
|
|
893583
894362
|
async function createUrMcp2026Runtime(options5) {
|
|
893584
894363
|
const server2 = createMCPServer(options5.cwd, options5.debug === true, options5.verbose === true);
|
|
893585
|
-
const client2 = new Client({ name: "ur-mcp-2026-adapter", version: "1.85.
|
|
894364
|
+
const client2 = new Client({ name: "ur-mcp-2026-adapter", version: "1.85.2" }, { capabilities: {} });
|
|
893586
894365
|
const [clientTransport, serverTransport] = createLinkedTransportPair();
|
|
893587
894366
|
try {
|
|
893588
894367
|
await server2.connect(serverTransport);
|
|
@@ -893593,7 +894372,7 @@ async function createUrMcp2026Runtime(options5) {
|
|
|
893593
894372
|
}
|
|
893594
894373
|
const runtime2 = new Mcp2026Runtime({
|
|
893595
894374
|
cwd: options5.cwd,
|
|
893596
|
-
version: "1.85.
|
|
894375
|
+
version: "1.85.2",
|
|
893597
894376
|
backend: {
|
|
893598
894377
|
listTools: async () => {
|
|
893599
894378
|
const listed = await client2.listTools();
|
|
@@ -894524,6 +895303,7 @@ var init_providers2 = __esm(() => {
|
|
|
894524
895303
|
"openrouter.service_tier",
|
|
894525
895304
|
"openrouter.speed",
|
|
894526
895305
|
"anthropic.speed",
|
|
895306
|
+
"anthropic.workspace_id",
|
|
894527
895307
|
"model",
|
|
894528
895308
|
"base_url"
|
|
894529
895309
|
];
|
|
@@ -894624,6 +895404,11 @@ function providerConfigEntries() {
|
|
|
894624
895404
|
value: configured.anthropic?.speed ?? "standard",
|
|
894625
895405
|
category: "provider"
|
|
894626
895406
|
},
|
|
895407
|
+
{
|
|
895408
|
+
key: "anthropic.workspace_id",
|
|
895409
|
+
value: configured.anthropic?.workspaceId ?? null,
|
|
895410
|
+
category: "provider"
|
|
895411
|
+
},
|
|
894627
895412
|
{ key: "model", value: active3.model ?? null, category: "provider" },
|
|
894628
895413
|
{ key: "base_url", value: active3.baseUrl ?? null, category: "provider" }
|
|
894629
895414
|
];
|
|
@@ -896477,7 +897262,7 @@ async function update() {
|
|
|
896477
897262
|
logEvent("tengu_update_check", {});
|
|
896478
897263
|
const diagnostic2 = await getDoctorDiagnostic();
|
|
896479
897264
|
const result = await checkUpgradeStatus({
|
|
896480
|
-
currentVersion: "1.85.
|
|
897265
|
+
currentVersion: "1.85.2",
|
|
896481
897266
|
packageName: UR_AGENT_PACKAGE_NAME,
|
|
896482
897267
|
installationType: diagnostic2.installationType,
|
|
896483
897268
|
latestVersion: () => getLatestNpmPackageVersion(UR_AGENT_PACKAGE_NAME)
|
|
@@ -897513,6 +898298,7 @@ ${inputPrompt}` : mainThreadAgentDefinition.initialPrompt;
|
|
|
897513
898298
|
}
|
|
897514
898299
|
}
|
|
897515
898300
|
let effectiveModel = userSpecifiedModel;
|
|
898301
|
+
let startupNvidiaTaskModel;
|
|
897516
898302
|
if (!effectiveModel && mainThreadAgentDefinition?.model && mainThreadAgentDefinition.model !== "inherit") {
|
|
897517
898303
|
effectiveModel = parseUserSpecifiedModel(mainThreadAgentDefinition.model);
|
|
897518
898304
|
}
|
|
@@ -897661,11 +898447,15 @@ ${customInstructions}` : customInstructions;
|
|
|
897661
898447
|
if (requiresStartupModelSelection) {
|
|
897662
898448
|
const selectedModel = await showSetupDialog(root2, (done) => /* @__PURE__ */ jsx_dev_runtime483.jsxDEV(ProviderFirstModelPicker, {
|
|
897663
898449
|
initial: null,
|
|
897664
|
-
headerText: "Choose
|
|
898450
|
+
headerText: "Choose an ordinary agent provider/model for this workspace. You may also activate an NVIDIA Special one-shot task first; UR will then return here for the ordinary agent model.",
|
|
897665
898451
|
onSelect: (model) => {
|
|
897666
898452
|
if (model)
|
|
897667
898453
|
done(model);
|
|
897668
|
-
}
|
|
898454
|
+
},
|
|
898455
|
+
onTaskSelect: (selection) => {
|
|
898456
|
+
startupNvidiaTaskModel = selection.modelId;
|
|
898457
|
+
},
|
|
898458
|
+
continueAfterTaskSelect: true
|
|
897669
898459
|
}, undefined, false, undefined, this));
|
|
897670
898460
|
effectiveModel = selectedModel;
|
|
897671
898461
|
setMainLoopModelOverride(selectedModel);
|
|
@@ -897805,7 +898595,7 @@ ${customInstructions}` : customInstructions;
|
|
|
897805
898595
|
}
|
|
897806
898596
|
}
|
|
897807
898597
|
logForDiagnosticsNoPII("info", "started", {
|
|
897808
|
-
version: "1.85.
|
|
898598
|
+
version: "1.85.2",
|
|
897809
898599
|
is_native_binary: isInBundledMode()
|
|
897810
898600
|
});
|
|
897811
898601
|
registerCleanup(async () => {
|
|
@@ -898117,6 +898907,7 @@ ${customInstructions}` : customInstructions;
|
|
|
898117
898907
|
verbose: verbose ?? getGlobalConfig().verbose ?? false,
|
|
898118
898908
|
mainLoopModel: initialMainLoopModel,
|
|
898119
898909
|
mainLoopModelForSession: null,
|
|
898910
|
+
...startupNvidiaTaskModel ? { nvidiaTaskModel: startupNvidiaTaskModel } : {},
|
|
898120
898911
|
isBriefOnly: initialIsBriefOnly,
|
|
898121
898912
|
expandedView: getGlobalConfig().showSpinnerTree ? "teammates" : getGlobalConfig().showExpandedTodos ? "tasks" : "none",
|
|
898122
898913
|
showTeammateMessagePreview: isAgentSwarmsEnabled() ? false : undefined,
|
|
@@ -898592,7 +899383,7 @@ Usage: ur --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
898592
899383
|
pendingHookMessages
|
|
898593
899384
|
}, renderAndRun);
|
|
898594
899385
|
}
|
|
898595
|
-
}).version("1.85.
|
|
899386
|
+
}).version("1.85.2 (UR-Nexus)", "-v, --version", "Output the version number");
|
|
898596
899387
|
program2.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
|
|
898597
899388
|
program2.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
|
|
898598
899389
|
if (canUserConfigureAdvisor()) {
|
|
@@ -899719,7 +900510,7 @@ if (false) {}
|
|
|
899719
900510
|
async function main2() {
|
|
899720
900511
|
const args = process.argv.slice(2);
|
|
899721
900512
|
if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
|
|
899722
|
-
console.log(`${"1.85.
|
|
900513
|
+
console.log(`${"1.85.2"} (UR-Nexus)`);
|
|
899723
900514
|
return;
|
|
899724
900515
|
}
|
|
899725
900516
|
if (args[0] === "a2a" && args[1] === "serve" && !args.includes("--help") && !args.includes("-h")) {
|