ur-agent 1.27.5 → 1.27.6
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 +9 -0
- package/README.md +9 -4
- package/dist/cli.js +1331 -861
- package/docs/CONFIGURATION.md +15 -2
- package/docs/USAGE.md +11 -5
- package/docs/providers.md +29 -27
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -51197,7 +51197,11 @@ var init_configs = __esm(() => {
|
|
|
51197
51197
|
|
|
51198
51198
|
// src/utils/model/providers.ts
|
|
51199
51199
|
function getAPIProvider() {
|
|
51200
|
-
|
|
51200
|
+
const activeProvider = getInitialSettings().provider?.active;
|
|
51201
|
+
if (!activeProvider || activeProvider === "ollama") {
|
|
51202
|
+
return "ollama";
|
|
51203
|
+
}
|
|
51204
|
+
return "foundry";
|
|
51201
51205
|
}
|
|
51202
51206
|
function getAPIProviderForStatsig() {
|
|
51203
51207
|
return getAPIProvider();
|
|
@@ -51205,6 +51209,9 @@ function getAPIProviderForStatsig() {
|
|
|
51205
51209
|
function isFirstPartyURHQBaseUrl() {
|
|
51206
51210
|
return true;
|
|
51207
51211
|
}
|
|
51212
|
+
var init_providers = __esm(() => {
|
|
51213
|
+
init_settings2();
|
|
51214
|
+
});
|
|
51208
51215
|
|
|
51209
51216
|
// src/utils/model/modelStrings.ts
|
|
51210
51217
|
function getBuiltinModelStrings(provider) {
|
|
@@ -51301,6 +51308,7 @@ var init_modelStrings = __esm(() => {
|
|
|
51301
51308
|
init_settings2();
|
|
51302
51309
|
init_bedrock();
|
|
51303
51310
|
init_configs();
|
|
51311
|
+
init_providers();
|
|
51304
51312
|
MODEL_KEYS = Object.keys(ALL_MODEL_CONFIGS);
|
|
51305
51313
|
updateBedrockModelStrings = sequential(async () => {
|
|
51306
51314
|
if (getModelStrings() !== null) {
|
|
@@ -52422,6 +52430,7 @@ var init_fastMode = __esm(() => {
|
|
|
52422
52430
|
init_debug();
|
|
52423
52431
|
init_envUtils();
|
|
52424
52432
|
init_model();
|
|
52433
|
+
init_providers();
|
|
52425
52434
|
init_settings2();
|
|
52426
52435
|
runtimeState = { status: "active" };
|
|
52427
52436
|
cooldownTriggered = createSignal();
|
|
@@ -52488,6 +52497,7 @@ var init_modelCost = __esm(() => {
|
|
|
52488
52497
|
init_fastMode();
|
|
52489
52498
|
init_configs();
|
|
52490
52499
|
init_model();
|
|
52500
|
+
init_providers();
|
|
52491
52501
|
COST_TIER_3_15 = {
|
|
52492
52502
|
inputTokens: 3,
|
|
52493
52503
|
outputTokens: 15,
|
|
@@ -52669,6 +52679,7 @@ var init_modelAllowlist = __esm(() => {
|
|
|
52669
52679
|
init_aliases();
|
|
52670
52680
|
init_model();
|
|
52671
52681
|
init_modelStrings();
|
|
52682
|
+
init_providers();
|
|
52672
52683
|
});
|
|
52673
52684
|
|
|
52674
52685
|
// src/utils/stringUtils.ts
|
|
@@ -53013,462 +53024,6 @@ var init_ollamaModels = __esm(() => {
|
|
|
53013
53024
|
cachedOllamaModelNames = [];
|
|
53014
53025
|
});
|
|
53015
53026
|
|
|
53016
|
-
// src/utils/model/model.ts
|
|
53017
|
-
var exports_model = {};
|
|
53018
|
-
__export(exports_model, {
|
|
53019
|
-
resolveSkillModelOverride: () => resolveSkillModelOverride,
|
|
53020
|
-
renderModelSetting: () => renderModelSetting,
|
|
53021
|
-
renderModelName: () => renderModelName,
|
|
53022
|
-
renderDefaultModelSetting: () => renderDefaultModelSetting,
|
|
53023
|
-
parseUserSpecifiedModel: () => parseUserSpecifiedModel,
|
|
53024
|
-
normalizeModelStringForAPI: () => normalizeModelStringForAPI,
|
|
53025
|
-
modelDisplayString: () => modelDisplayString,
|
|
53026
|
-
ismodelO1mMergeEnabled: () => ismodelO1mMergeEnabled,
|
|
53027
|
-
isNonCustommodelOModel: () => isNonCustommodelOModel,
|
|
53028
|
-
isLegacyModelRemapEnabled: () => isLegacyModelRemapEnabled,
|
|
53029
|
-
getmodelO46PricingSuffix: () => getmodelO46PricingSuffix,
|
|
53030
|
-
getUserSpecifiedModelSetting: () => getUserSpecifiedModelSetting,
|
|
53031
|
-
getURAiUserDefaultModelDescription: () => getURAiUserDefaultModelDescription,
|
|
53032
|
-
getSmallFastModel: () => getSmallFastModel,
|
|
53033
|
-
getRuntimeMainLoopModel: () => getRuntimeMainLoopModel,
|
|
53034
|
-
getPublicModelName: () => getPublicModelName,
|
|
53035
|
-
getPublicModelDisplayName: () => getPublicModelDisplayName,
|
|
53036
|
-
getMarketingNameForModel: () => getMarketingNameForModel,
|
|
53037
|
-
getMainLoopModel: () => getMainLoopModel,
|
|
53038
|
-
getDefaultmodelSModel: () => getDefaultmodelSModel,
|
|
53039
|
-
getDefaultmodelOModel: () => getDefaultmodelOModel,
|
|
53040
|
-
getDefaultmodelHModel: () => getDefaultmodelHModel,
|
|
53041
|
-
getDefaultOllamaModel: () => getDefaultOllamaModel,
|
|
53042
|
-
getDefaultMainLoopModelSetting: () => getDefaultMainLoopModelSetting,
|
|
53043
|
-
getDefaultMainLoopModel: () => getDefaultMainLoopModel,
|
|
53044
|
-
getCanonicalName: () => getCanonicalName,
|
|
53045
|
-
getBestModel: () => getBestModel,
|
|
53046
|
-
firstPartyNameToCanonical: () => firstPartyNameToCanonical,
|
|
53047
|
-
__resetOllamaRouteMemoForTests: () => __resetOllamaRouteMemoForTests
|
|
53048
|
-
});
|
|
53049
|
-
function __resetOllamaRouteMemoForTests() {
|
|
53050
|
-
memoizedRoutedDefaultModel = undefined;
|
|
53051
|
-
memoizedRoutedFastModel = undefined;
|
|
53052
|
-
}
|
|
53053
|
-
function getDefaultOllamaModel() {
|
|
53054
|
-
if (process.env.OLLAMA_MODEL) {
|
|
53055
|
-
return process.env.OLLAMA_MODEL;
|
|
53056
|
-
}
|
|
53057
|
-
if (isOllamaAutoRouteEnabled()) {
|
|
53058
|
-
if (memoizedRoutedDefaultModel)
|
|
53059
|
-
return memoizedRoutedDefaultModel;
|
|
53060
|
-
const routed = pickBestCoderModel(getCachedOllamaModelNames());
|
|
53061
|
-
if (routed) {
|
|
53062
|
-
memoizedRoutedDefaultModel = routed;
|
|
53063
|
-
return routed;
|
|
53064
|
-
}
|
|
53065
|
-
}
|
|
53066
|
-
return DEFAULT_OLLAMA_MODEL2;
|
|
53067
|
-
}
|
|
53068
|
-
function getSmallFastModel() {
|
|
53069
|
-
if (getAPIProvider() === "ollama") {
|
|
53070
|
-
if (process.env.OLLAMA_SMALL_FAST_MODEL) {
|
|
53071
|
-
return process.env.OLLAMA_SMALL_FAST_MODEL;
|
|
53072
|
-
}
|
|
53073
|
-
if (isOllamaAutoRouteEnabled()) {
|
|
53074
|
-
if (memoizedRoutedFastModel)
|
|
53075
|
-
return memoizedRoutedFastModel;
|
|
53076
|
-
const routed = pickSmallFastModel(getCachedOllamaModelNames());
|
|
53077
|
-
if (routed) {
|
|
53078
|
-
memoizedRoutedFastModel = routed;
|
|
53079
|
-
return routed;
|
|
53080
|
-
}
|
|
53081
|
-
}
|
|
53082
|
-
return getDefaultOllamaModel();
|
|
53083
|
-
}
|
|
53084
|
-
return process.env.URHQ_SMALL_FAST_MODEL || getDefaultmodelHModel();
|
|
53085
|
-
}
|
|
53086
|
-
function isNonCustommodelOModel(model) {
|
|
53087
|
-
return model === getModelStrings2().modelO40 || model === getModelStrings2().modelO41 || model === getModelStrings2().modelO45 || model === getModelStrings2().modelO46;
|
|
53088
|
-
}
|
|
53089
|
-
function getUserSpecifiedModelSetting() {
|
|
53090
|
-
let specifiedModel;
|
|
53091
|
-
const modelOverride = getMainLoopModelOverride();
|
|
53092
|
-
if (modelOverride !== undefined) {
|
|
53093
|
-
specifiedModel = modelOverride;
|
|
53094
|
-
} else {
|
|
53095
|
-
const settings = getSettings_DEPRECATED() || {};
|
|
53096
|
-
specifiedModel = process.env.URHQ_MODEL || settings.model || undefined;
|
|
53097
|
-
}
|
|
53098
|
-
if (specifiedModel && !isModelAllowed(specifiedModel)) {
|
|
53099
|
-
return;
|
|
53100
|
-
}
|
|
53101
|
-
return specifiedModel;
|
|
53102
|
-
}
|
|
53103
|
-
function getMainLoopModel() {
|
|
53104
|
-
const model = getUserSpecifiedModelSetting();
|
|
53105
|
-
if (model !== undefined && model !== null) {
|
|
53106
|
-
return parseUserSpecifiedModel(model);
|
|
53107
|
-
}
|
|
53108
|
-
return getDefaultMainLoopModel();
|
|
53109
|
-
}
|
|
53110
|
-
function getBestModel() {
|
|
53111
|
-
return getDefaultmodelOModel();
|
|
53112
|
-
}
|
|
53113
|
-
function getDefaultmodelOModel() {
|
|
53114
|
-
if (getAPIProvider() === "ollama") {
|
|
53115
|
-
return getDefaultOllamaModel();
|
|
53116
|
-
}
|
|
53117
|
-
if (process.env.URHQ_DEFAULT_MODELO_MODEL) {
|
|
53118
|
-
return process.env.URHQ_DEFAULT_MODELO_MODEL;
|
|
53119
|
-
}
|
|
53120
|
-
if (getAPIProvider() !== "firstParty") {
|
|
53121
|
-
return getModelStrings2().modelO46;
|
|
53122
|
-
}
|
|
53123
|
-
return getModelStrings2().modelO46;
|
|
53124
|
-
}
|
|
53125
|
-
function getDefaultmodelSModel() {
|
|
53126
|
-
if (getAPIProvider() === "ollama") {
|
|
53127
|
-
return getDefaultOllamaModel();
|
|
53128
|
-
}
|
|
53129
|
-
if (process.env.URHQ_DEFAULT_MODELS_MODEL) {
|
|
53130
|
-
return process.env.URHQ_DEFAULT_MODELS_MODEL;
|
|
53131
|
-
}
|
|
53132
|
-
if (getAPIProvider() !== "firstParty") {
|
|
53133
|
-
return getModelStrings2().modelS45;
|
|
53134
|
-
}
|
|
53135
|
-
return getModelStrings2().modelS46;
|
|
53136
|
-
}
|
|
53137
|
-
function getDefaultmodelHModel() {
|
|
53138
|
-
if (getAPIProvider() === "ollama") {
|
|
53139
|
-
return process.env.OLLAMA_SMALL_FAST_MODEL || getDefaultOllamaModel();
|
|
53140
|
-
}
|
|
53141
|
-
if (process.env.URHQ_DEFAULT_MODELH_MODEL) {
|
|
53142
|
-
return process.env.URHQ_DEFAULT_MODELH_MODEL;
|
|
53143
|
-
}
|
|
53144
|
-
return getModelStrings2().modelH45;
|
|
53145
|
-
}
|
|
53146
|
-
function getRuntimeMainLoopModel(params) {
|
|
53147
|
-
const { permissionMode, mainLoopModel, exceeds200kTokens = false } = params;
|
|
53148
|
-
if (getUserSpecifiedModelSetting() === "modelOplan" && permissionMode === "plan" && !exceeds200kTokens) {
|
|
53149
|
-
return getDefaultmodelOModel();
|
|
53150
|
-
}
|
|
53151
|
-
if (getUserSpecifiedModelSetting() === "modelH" && permissionMode === "plan") {
|
|
53152
|
-
return getDefaultmodelSModel();
|
|
53153
|
-
}
|
|
53154
|
-
return mainLoopModel;
|
|
53155
|
-
}
|
|
53156
|
-
function getDefaultMainLoopModelSetting() {
|
|
53157
|
-
if (getAPIProvider() === "ollama") {
|
|
53158
|
-
return getDefaultOllamaModel();
|
|
53159
|
-
}
|
|
53160
|
-
if (process.env.USER_TYPE === "ant") {
|
|
53161
|
-
return getAntModelOverrideConfig2()?.defaultModel ?? getDefaultmodelOModel() + "[1m]";
|
|
53162
|
-
}
|
|
53163
|
-
if (isMaxSubscriber()) {
|
|
53164
|
-
return getDefaultmodelOModel() + (ismodelO1mMergeEnabled() ? "[1m]" : "");
|
|
53165
|
-
}
|
|
53166
|
-
if (isTeamPremiumSubscriber()) {
|
|
53167
|
-
return getDefaultmodelOModel() + (ismodelO1mMergeEnabled() ? "[1m]" : "");
|
|
53168
|
-
}
|
|
53169
|
-
return getDefaultmodelSModel();
|
|
53170
|
-
}
|
|
53171
|
-
function getDefaultMainLoopModel() {
|
|
53172
|
-
return parseUserSpecifiedModel(getDefaultMainLoopModelSetting());
|
|
53173
|
-
}
|
|
53174
|
-
function firstPartyNameToCanonical(name) {
|
|
53175
|
-
name = name.toLowerCase();
|
|
53176
|
-
if (name.includes("ur-modelO-4-6")) {
|
|
53177
|
-
return "ur-modelO-4-6";
|
|
53178
|
-
}
|
|
53179
|
-
if (name.includes("ur-modelO-4-5")) {
|
|
53180
|
-
return "ur-modelO-4-5";
|
|
53181
|
-
}
|
|
53182
|
-
if (name.includes("ur-modelO-4-1")) {
|
|
53183
|
-
return "ur-modelO-4-1";
|
|
53184
|
-
}
|
|
53185
|
-
if (name.includes("ur-modelO-4")) {
|
|
53186
|
-
return "ur-modelO-4";
|
|
53187
|
-
}
|
|
53188
|
-
if (name.includes("ur-modelS-4-6")) {
|
|
53189
|
-
return "ur-modelS-4-6";
|
|
53190
|
-
}
|
|
53191
|
-
if (name.includes("ur-modelS-4-5")) {
|
|
53192
|
-
return "ur-modelS-4-5";
|
|
53193
|
-
}
|
|
53194
|
-
if (name.includes("ur-modelS-4")) {
|
|
53195
|
-
return "ur-modelS-4";
|
|
53196
|
-
}
|
|
53197
|
-
if (name.includes("ur-modelH-4-5")) {
|
|
53198
|
-
return "ur-modelH-4-5";
|
|
53199
|
-
}
|
|
53200
|
-
if (name.includes("ur-3-7-modelS")) {
|
|
53201
|
-
return "ur-3-7-modelS";
|
|
53202
|
-
}
|
|
53203
|
-
if (name.includes("ur-3-5-modelS")) {
|
|
53204
|
-
return "ur-3-5-modelS";
|
|
53205
|
-
}
|
|
53206
|
-
if (name.includes("ur-3-5-modelH")) {
|
|
53207
|
-
return "ur-3-5-modelH";
|
|
53208
|
-
}
|
|
53209
|
-
if (name.includes("ur-3-modelO")) {
|
|
53210
|
-
return "ur-3-modelO";
|
|
53211
|
-
}
|
|
53212
|
-
if (name.includes("ur-3-modelS")) {
|
|
53213
|
-
return "ur-3-modelS";
|
|
53214
|
-
}
|
|
53215
|
-
if (name.includes("ur-3-modelH")) {
|
|
53216
|
-
return "ur-3-modelH";
|
|
53217
|
-
}
|
|
53218
|
-
const match = name.match(/(ur-(\d+-\d+-)?\w+)/);
|
|
53219
|
-
if (match && match[1]) {
|
|
53220
|
-
return match[1];
|
|
53221
|
-
}
|
|
53222
|
-
return name;
|
|
53223
|
-
}
|
|
53224
|
-
function getCanonicalName(fullModelName) {
|
|
53225
|
-
return firstPartyNameToCanonical(resolveOverriddenModel(fullModelName));
|
|
53226
|
-
}
|
|
53227
|
-
function getURAiUserDefaultModelDescription(fastMode = false) {
|
|
53228
|
-
if (isMaxSubscriber() || isTeamPremiumSubscriber()) {
|
|
53229
|
-
if (ismodelO1mMergeEnabled()) {
|
|
53230
|
-
return `modelO 4.6 with 1M context \xB7 Most capable for complex work${fastMode ? getmodelO46PricingSuffix(true) : ""}`;
|
|
53231
|
-
}
|
|
53232
|
-
return `modelO 4.6 \xB7 Most capable for complex work${fastMode ? getmodelO46PricingSuffix(true) : ""}`;
|
|
53233
|
-
}
|
|
53234
|
-
return "modelS 4.6 \xB7 Best for everyday tasks";
|
|
53235
|
-
}
|
|
53236
|
-
function renderDefaultModelSetting(setting) {
|
|
53237
|
-
if (setting === "modelOplan") {
|
|
53238
|
-
return "modelO 4.6 in plan mode, else modelS 4.6";
|
|
53239
|
-
}
|
|
53240
|
-
return renderModelName(parseUserSpecifiedModel(setting));
|
|
53241
|
-
}
|
|
53242
|
-
function getmodelO46PricingSuffix(fastMode) {
|
|
53243
|
-
if (getAPIProvider() !== "firstParty")
|
|
53244
|
-
return "";
|
|
53245
|
-
const pricing = formatModelPricing(getmodelO46CostTier(fastMode));
|
|
53246
|
-
const fastModeIndicator = fastMode ? ` (${LIGHTNING_BOLT})` : "";
|
|
53247
|
-
return ` \xB7${fastModeIndicator} ${pricing}`;
|
|
53248
|
-
}
|
|
53249
|
-
function ismodelO1mMergeEnabled() {
|
|
53250
|
-
if (is1mContextDisabled() || isProSubscriber() || getAPIProvider() !== "firstParty") {
|
|
53251
|
-
return false;
|
|
53252
|
-
}
|
|
53253
|
-
if (isURAISubscriber2() && getSubscriptionType() === null) {
|
|
53254
|
-
return false;
|
|
53255
|
-
}
|
|
53256
|
-
return true;
|
|
53257
|
-
}
|
|
53258
|
-
function renderModelSetting(setting) {
|
|
53259
|
-
if (setting === "modelOplan") {
|
|
53260
|
-
return "modelO Plan";
|
|
53261
|
-
}
|
|
53262
|
-
if (isModelAlias(setting)) {
|
|
53263
|
-
return capitalize(setting);
|
|
53264
|
-
}
|
|
53265
|
-
return renderModelName(setting);
|
|
53266
|
-
}
|
|
53267
|
-
function getPublicModelDisplayName(model) {
|
|
53268
|
-
if (getAPIProvider() === "ollama") {
|
|
53269
|
-
return null;
|
|
53270
|
-
}
|
|
53271
|
-
switch (model) {
|
|
53272
|
-
case getModelStrings2().modelO46:
|
|
53273
|
-
return "modelO 4.6";
|
|
53274
|
-
case getModelStrings2().modelO46 + "[1m]":
|
|
53275
|
-
return "modelO 4.6 (1M context)";
|
|
53276
|
-
case getModelStrings2().modelO45:
|
|
53277
|
-
return "modelO 4.5";
|
|
53278
|
-
case getModelStrings2().modelO41:
|
|
53279
|
-
return "modelO 4.1";
|
|
53280
|
-
case getModelStrings2().modelO40:
|
|
53281
|
-
return "modelO 4";
|
|
53282
|
-
case getModelStrings2().modelS46 + "[1m]":
|
|
53283
|
-
return "modelS 4.6 (1M context)";
|
|
53284
|
-
case getModelStrings2().modelS46:
|
|
53285
|
-
return "modelS 4.6";
|
|
53286
|
-
case getModelStrings2().modelS45 + "[1m]":
|
|
53287
|
-
return "modelS 4.5 (1M context)";
|
|
53288
|
-
case getModelStrings2().modelS45:
|
|
53289
|
-
return "modelS 4.5";
|
|
53290
|
-
case getModelStrings2().modelS40:
|
|
53291
|
-
return "modelS 4";
|
|
53292
|
-
case getModelStrings2().modelS40 + "[1m]":
|
|
53293
|
-
return "modelS 4 (1M context)";
|
|
53294
|
-
case getModelStrings2().modelS37:
|
|
53295
|
-
return "modelS 3.7";
|
|
53296
|
-
case getModelStrings2().modelS35:
|
|
53297
|
-
return "modelS 3.5";
|
|
53298
|
-
case getModelStrings2().modelH45:
|
|
53299
|
-
return "modelH 4.5";
|
|
53300
|
-
case getModelStrings2().modelH35:
|
|
53301
|
-
return "modelH 3.5";
|
|
53302
|
-
default:
|
|
53303
|
-
return null;
|
|
53304
|
-
}
|
|
53305
|
-
}
|
|
53306
|
-
function maskModelCodename(baseName) {
|
|
53307
|
-
const [codename = "", ...rest] = baseName.split("-");
|
|
53308
|
-
const masked = codename.slice(0, 3) + "*".repeat(Math.max(0, codename.length - 3));
|
|
53309
|
-
return [masked, ...rest].join("-");
|
|
53310
|
-
}
|
|
53311
|
-
function renderModelName(model) {
|
|
53312
|
-
const publicName = getPublicModelDisplayName(model);
|
|
53313
|
-
if (publicName) {
|
|
53314
|
-
return publicName;
|
|
53315
|
-
}
|
|
53316
|
-
if (process.env.USER_TYPE === "ant") {
|
|
53317
|
-
const resolved = parseUserSpecifiedModel(model);
|
|
53318
|
-
const antModel = resolveAntModel2(model);
|
|
53319
|
-
if (antModel) {
|
|
53320
|
-
const baseName = antModel.model.replace(/\[1m\]$/i, "");
|
|
53321
|
-
const masked = maskModelCodename(baseName);
|
|
53322
|
-
const suffix = has1mContext(resolved) ? "[1m]" : "";
|
|
53323
|
-
return masked + suffix;
|
|
53324
|
-
}
|
|
53325
|
-
if (resolved !== model) {
|
|
53326
|
-
return `${model} (${resolved})`;
|
|
53327
|
-
}
|
|
53328
|
-
return resolved;
|
|
53329
|
-
}
|
|
53330
|
-
return model;
|
|
53331
|
-
}
|
|
53332
|
-
function getPublicModelName(model) {
|
|
53333
|
-
if (getAPIProvider() === "ollama") {
|
|
53334
|
-
return `Ollama (${model})`;
|
|
53335
|
-
}
|
|
53336
|
-
const publicName = getPublicModelDisplayName(model);
|
|
53337
|
-
if (publicName) {
|
|
53338
|
-
return `UR ${publicName}`;
|
|
53339
|
-
}
|
|
53340
|
-
return `UR (${model})`;
|
|
53341
|
-
}
|
|
53342
|
-
function parseUserSpecifiedModel(modelInput) {
|
|
53343
|
-
const modelInputTrimmed = modelInput.trim();
|
|
53344
|
-
const normalizedModel = modelInputTrimmed.toLowerCase();
|
|
53345
|
-
const has1mTag = has1mContext(normalizedModel);
|
|
53346
|
-
const modelString = has1mTag ? normalizedModel.replace(/\[1m]$/i, "").trim() : normalizedModel;
|
|
53347
|
-
switch (modelString) {
|
|
53348
|
-
case "modeloplan":
|
|
53349
|
-
return getDefaultmodelSModel() + (has1mTag ? "[1m]" : "");
|
|
53350
|
-
case "models":
|
|
53351
|
-
return getDefaultmodelSModel() + (has1mTag ? "[1m]" : "");
|
|
53352
|
-
case "modelh":
|
|
53353
|
-
return getDefaultmodelHModel() + (has1mTag ? "[1m]" : "");
|
|
53354
|
-
case "modelo":
|
|
53355
|
-
return getDefaultmodelOModel() + (has1mTag ? "[1m]" : "");
|
|
53356
|
-
case "best":
|
|
53357
|
-
return getBestModel();
|
|
53358
|
-
default:
|
|
53359
|
-
}
|
|
53360
|
-
if (getAPIProvider() === "firstParty" && isLegacymodelOFirstParty(modelString) && isLegacyModelRemapEnabled()) {
|
|
53361
|
-
return getDefaultmodelOModel() + (has1mTag ? "[1m]" : "");
|
|
53362
|
-
}
|
|
53363
|
-
if (process.env.USER_TYPE === "ant") {
|
|
53364
|
-
const has1mAntTag = has1mContext(normalizedModel);
|
|
53365
|
-
const baseAntModel = normalizedModel.replace(/\[1m]$/i, "").trim();
|
|
53366
|
-
const antModel = resolveAntModel2(baseAntModel);
|
|
53367
|
-
if (antModel) {
|
|
53368
|
-
const suffix = has1mAntTag ? "[1m]" : "";
|
|
53369
|
-
return antModel.model + suffix;
|
|
53370
|
-
}
|
|
53371
|
-
}
|
|
53372
|
-
if (has1mTag) {
|
|
53373
|
-
return modelInputTrimmed.replace(/\[1m\]$/i, "").trim() + "[1m]";
|
|
53374
|
-
}
|
|
53375
|
-
return modelInputTrimmed;
|
|
53376
|
-
}
|
|
53377
|
-
function resolveSkillModelOverride(skillModel, currentModel) {
|
|
53378
|
-
if (has1mContext(skillModel) || !has1mContext(currentModel)) {
|
|
53379
|
-
return skillModel;
|
|
53380
|
-
}
|
|
53381
|
-
if (modelSupports1M(parseUserSpecifiedModel(skillModel))) {
|
|
53382
|
-
return skillModel + "[1m]";
|
|
53383
|
-
}
|
|
53384
|
-
return skillModel;
|
|
53385
|
-
}
|
|
53386
|
-
function isLegacymodelOFirstParty(model) {
|
|
53387
|
-
return LEGACY_MODELO_FIRSTPARTY.includes(model);
|
|
53388
|
-
}
|
|
53389
|
-
function isLegacyModelRemapEnabled() {
|
|
53390
|
-
return !isEnvTruthy(process.env.UR_CODE_DISABLE_LEGACY_MODEL_REMAP);
|
|
53391
|
-
}
|
|
53392
|
-
function modelDisplayString(model) {
|
|
53393
|
-
if (model === null) {
|
|
53394
|
-
if (process.env.USER_TYPE === "ant") {
|
|
53395
|
-
return `Default for Ants (${renderDefaultModelSetting(getDefaultMainLoopModelSetting())})`;
|
|
53396
|
-
} else if (isURAISubscriber2()) {
|
|
53397
|
-
return `Default (${getURAiUserDefaultModelDescription()})`;
|
|
53398
|
-
}
|
|
53399
|
-
return `Default (${getDefaultMainLoopModel()})`;
|
|
53400
|
-
}
|
|
53401
|
-
const resolvedModel = parseUserSpecifiedModel(model);
|
|
53402
|
-
return model === resolvedModel ? resolvedModel : `${model} (${resolvedModel})`;
|
|
53403
|
-
}
|
|
53404
|
-
function getMarketingNameForModel(modelId) {
|
|
53405
|
-
if (getAPIProvider() === "foundry" || getAPIProvider() === "ollama") {
|
|
53406
|
-
return;
|
|
53407
|
-
}
|
|
53408
|
-
const has1m = modelId.toLowerCase().includes("[1m]");
|
|
53409
|
-
const canonical = getCanonicalName(modelId);
|
|
53410
|
-
if (canonical.includes("ur-modelO-4-6")) {
|
|
53411
|
-
return has1m ? "modelO 4.6 (with 1M context)" : "modelO 4.6";
|
|
53412
|
-
}
|
|
53413
|
-
if (canonical.includes("ur-modelO-4-5")) {
|
|
53414
|
-
return "modelO 4.5";
|
|
53415
|
-
}
|
|
53416
|
-
if (canonical.includes("ur-modelO-4-1")) {
|
|
53417
|
-
return "modelO 4.1";
|
|
53418
|
-
}
|
|
53419
|
-
if (canonical.includes("ur-modelO-4")) {
|
|
53420
|
-
return "modelO 4";
|
|
53421
|
-
}
|
|
53422
|
-
if (canonical.includes("ur-modelS-4-6")) {
|
|
53423
|
-
return has1m ? "modelS 4.6 (with 1M context)" : "modelS 4.6";
|
|
53424
|
-
}
|
|
53425
|
-
if (canonical.includes("ur-modelS-4-5")) {
|
|
53426
|
-
return has1m ? "modelS 4.5 (with 1M context)" : "modelS 4.5";
|
|
53427
|
-
}
|
|
53428
|
-
if (canonical.includes("ur-modelS-4")) {
|
|
53429
|
-
return has1m ? "modelS 4 (with 1M context)" : "modelS 4";
|
|
53430
|
-
}
|
|
53431
|
-
if (canonical.includes("ur-3-7-modelS")) {
|
|
53432
|
-
return "UR 3.7 modelS";
|
|
53433
|
-
}
|
|
53434
|
-
if (canonical.includes("ur-3-5-modelS")) {
|
|
53435
|
-
return "UR 3.5 modelS";
|
|
53436
|
-
}
|
|
53437
|
-
if (canonical.includes("ur-modelH-4-5")) {
|
|
53438
|
-
return "modelH 4.5";
|
|
53439
|
-
}
|
|
53440
|
-
if (canonical.includes("ur-3-5-modelH")) {
|
|
53441
|
-
return "UR 3.5 modelH";
|
|
53442
|
-
}
|
|
53443
|
-
return;
|
|
53444
|
-
}
|
|
53445
|
-
function normalizeModelStringForAPI(model) {
|
|
53446
|
-
return model.replace(/\[(1|2)m\]/gi, "");
|
|
53447
|
-
}
|
|
53448
|
-
var DEFAULT_OLLAMA_MODEL2 = "qwen3-coder:480b-cloud", memoizedRoutedDefaultModel, memoizedRoutedFastModel, LEGACY_MODELO_FIRSTPARTY;
|
|
53449
|
-
var init_model = __esm(() => {
|
|
53450
|
-
init_state();
|
|
53451
|
-
init_auth();
|
|
53452
|
-
init_context();
|
|
53453
|
-
init_envUtils();
|
|
53454
|
-
init_modelStrings();
|
|
53455
|
-
init_modelCost();
|
|
53456
|
-
init_settings2();
|
|
53457
|
-
init_figures2();
|
|
53458
|
-
init_modelAllowlist();
|
|
53459
|
-
init_aliases();
|
|
53460
|
-
init_stringUtils();
|
|
53461
|
-
init_antModels();
|
|
53462
|
-
init_ollamaModels();
|
|
53463
|
-
init_ollamaRouter();
|
|
53464
|
-
LEGACY_MODELO_FIRSTPARTY = [
|
|
53465
|
-
"ur-modelO-4-20250514",
|
|
53466
|
-
"ur-modelO-4-1-20250805",
|
|
53467
|
-
"ur-modelO-4-0",
|
|
53468
|
-
"ur-modelO-4-1"
|
|
53469
|
-
];
|
|
53470
|
-
});
|
|
53471
|
-
|
|
53472
53027
|
// src/services/providers/providerRegistry.ts
|
|
53473
53028
|
var exports_providerRegistry = {};
|
|
53474
53029
|
__export(exports_providerRegistry, {
|
|
@@ -53488,6 +53043,7 @@ __export(exports_providerRegistry, {
|
|
|
53488
53043
|
getValidModelIdsForProvider: () => getValidModelIdsForProvider,
|
|
53489
53044
|
getProviderStatus: () => getProviderStatus,
|
|
53490
53045
|
getProviderRuntimeInfo: () => getProviderRuntimeInfo,
|
|
53046
|
+
getProviderRuntimeBackend: () => getProviderRuntimeBackend,
|
|
53491
53047
|
getProviderDefinition: () => getProviderDefinition,
|
|
53492
53048
|
getProviderAccessTypeLabel: () => getProviderAccessTypeLabel,
|
|
53493
53049
|
getDefaultModelForProvider: () => getDefaultModelForProvider,
|
|
@@ -53501,6 +53057,7 @@ __export(exports_providerRegistry, {
|
|
|
53501
53057
|
doctorProvider: () => doctorProvider,
|
|
53502
53058
|
doctorActiveProvider: () => doctorActiveProvider,
|
|
53503
53059
|
credentialTypeLabel: () => credentialTypeLabel,
|
|
53060
|
+
clearProviderModelCacheForTests: () => clearProviderModelCacheForTests,
|
|
53504
53061
|
classifyGeminiAccountSupport: () => classifyGeminiAccountSupport,
|
|
53505
53062
|
cacheProviderModelsForProvider: () => cacheProviderModelsForProvider,
|
|
53506
53063
|
buildProviderAuthCommand: () => buildProviderAuthCommand,
|
|
@@ -53536,7 +53093,7 @@ function getActiveProviderSettings(settings = getInitialSettings()) {
|
|
|
53536
53093
|
const fallback = configured.fallback === "disabled" ? "disabled" : configured.fallback ? resolveProviderId(configured.fallback) ?? undefined : undefined;
|
|
53537
53094
|
return {
|
|
53538
53095
|
active,
|
|
53539
|
-
model: configured.model ?? settings.model,
|
|
53096
|
+
model: configured.model ?? (configured.active ? undefined : settings.model),
|
|
53540
53097
|
baseUrl: configured.baseUrl,
|
|
53541
53098
|
commandPath: configured.commandPath,
|
|
53542
53099
|
fallback
|
|
@@ -53552,6 +53109,7 @@ function getProviderRuntimeInfo(settings = getInitialSettings()) {
|
|
|
53552
53109
|
accessType: definition.accessType,
|
|
53553
53110
|
accessTypeLabel: getProviderAccessTypeLabel(definition),
|
|
53554
53111
|
credentialType: definition.credentialType,
|
|
53112
|
+
runtimeBackend: getProviderRuntimeBackend(provider),
|
|
53555
53113
|
authMode: definition.authMode,
|
|
53556
53114
|
authLabel: authModeLabel(definition.authMode),
|
|
53557
53115
|
model: providerSettings.model,
|
|
@@ -53559,6 +53117,39 @@ function getProviderRuntimeInfo(settings = getInitialSettings()) {
|
|
|
53559
53117
|
fallback: providerSettings.fallback
|
|
53560
53118
|
};
|
|
53561
53119
|
}
|
|
53120
|
+
function getProviderRuntimeBackend(providerId) {
|
|
53121
|
+
const provider = resolveProviderId(providerId);
|
|
53122
|
+
switch (provider) {
|
|
53123
|
+
case "ollama":
|
|
53124
|
+
return "ollama";
|
|
53125
|
+
case "lmstudio":
|
|
53126
|
+
return "openai-compatible:lmstudio";
|
|
53127
|
+
case "llama.cpp":
|
|
53128
|
+
return "openai-compatible:llama.cpp";
|
|
53129
|
+
case "vllm":
|
|
53130
|
+
return "openai-compatible:vllm";
|
|
53131
|
+
case "openai-compatible":
|
|
53132
|
+
return "openai-compatible";
|
|
53133
|
+
case "codex-cli":
|
|
53134
|
+
return "subscription-cli:codex";
|
|
53135
|
+
case "claude-code-cli":
|
|
53136
|
+
return "subscription-cli:claude-code";
|
|
53137
|
+
case "gemini-cli":
|
|
53138
|
+
return "subscription-cli:gemini";
|
|
53139
|
+
case "antigravity-cli":
|
|
53140
|
+
return "subscription-cli:antigravity";
|
|
53141
|
+
case "openai-api":
|
|
53142
|
+
return "api:openai";
|
|
53143
|
+
case "anthropic-api":
|
|
53144
|
+
return "api:anthropic";
|
|
53145
|
+
case "gemini-api":
|
|
53146
|
+
return "api:gemini";
|
|
53147
|
+
case "openrouter":
|
|
53148
|
+
return "api:openrouter";
|
|
53149
|
+
default:
|
|
53150
|
+
return `unknown:${providerId}`;
|
|
53151
|
+
}
|
|
53152
|
+
}
|
|
53562
53153
|
function authModeLabel(mode) {
|
|
53563
53154
|
switch (mode) {
|
|
53564
53155
|
case "subscription":
|
|
@@ -54145,6 +53736,7 @@ function formatProviderList(json2 = false) {
|
|
|
54145
53736
|
accessTypeLabel: getProviderAccessTypeLabel(provider),
|
|
54146
53737
|
credentialType: provider.credentialType,
|
|
54147
53738
|
modelDiscoveryType: provider.modelDiscoveryType,
|
|
53739
|
+
runtimeBackend: getProviderRuntimeBackend(provider.id),
|
|
54148
53740
|
authMode: provider.authMode,
|
|
54149
53741
|
accessPath: provider.accessPathLabel,
|
|
54150
53742
|
legalPath: provider.legalPath
|
|
@@ -54153,9 +53745,9 @@ function formatProviderList(json2 = false) {
|
|
|
54153
53745
|
return JSON.stringify(providers, null, 2);
|
|
54154
53746
|
}
|
|
54155
53747
|
return [
|
|
54156
|
-
"Provider | ID | Aliases | Access type | Credential | Model discovery | Access path",
|
|
54157
|
-
"--- | --- | --- | --- | --- | --- | ---",
|
|
54158
|
-
...providers.map((provider) => `${provider.name} | ${provider.id} | ${provider.aliases.slice(0, 3).join(", ") || "-"} | ${provider.accessTypeLabel} | ${provider.credentialType} | ${provider.modelDiscoveryType} | ${provider.accessPath}`)
|
|
53748
|
+
"Provider | ID | Aliases | Access type | Credential | Model discovery | Runtime backend | Access path",
|
|
53749
|
+
"--- | --- | --- | --- | --- | --- | --- | ---",
|
|
53750
|
+
...providers.map((provider) => `${provider.name} | ${provider.id} | ${provider.aliases.slice(0, 3).join(", ") || "-"} | ${provider.accessTypeLabel} | ${provider.credentialType} | ${provider.modelDiscoveryType} | ${provider.runtimeBackend} | ${provider.accessPath}`)
|
|
54159
53751
|
].join(`
|
|
54160
53752
|
`);
|
|
54161
53753
|
}
|
|
@@ -54167,6 +53759,7 @@ function formatProviderDoctor(result, json2 = false) {
|
|
|
54167
53759
|
`Provider: ${result.displayName} (${result.provider})`,
|
|
54168
53760
|
`Access: ${getProviderAccessTypeLabel(getProviderDefinition(result.provider))}`,
|
|
54169
53761
|
`Credential: ${getProviderDefinition(result.provider).credentialType}`,
|
|
53762
|
+
`Runtime backend: ${getProviderRuntimeBackend(result.provider)}`,
|
|
54170
53763
|
`Auth: ${authModeLabel(result.authMode)}`,
|
|
54171
53764
|
`Status: ${result.ok ? "ready" : "not ready"}`
|
|
54172
53765
|
];
|
|
@@ -54194,12 +53787,19 @@ Failure reason: ${result.failureReason}` : "";
|
|
|
54194
53787
|
const fix = result.suggestedFix ? `
|
|
54195
53788
|
Suggested fix: ${result.suggestedFix}` : "";
|
|
54196
53789
|
const definition = getProviderDefinition(result.provider);
|
|
53790
|
+
const settings = getActiveProviderSettings(getInitialSettings());
|
|
53791
|
+
const model = settings.model ? `
|
|
53792
|
+
Active model: ${settings.model}` : "";
|
|
54197
53793
|
return `Selected provider: ${result.displayName} (${result.provider})
|
|
54198
53794
|
Access type: ${getProviderAccessTypeLabel(definition)}
|
|
54199
53795
|
Credential: ${definition.credentialType}
|
|
53796
|
+
Runtime backend: ${getProviderRuntimeBackend(result.provider)}${model}
|
|
54200
53797
|
Auth mode: ${authModeLabel(result.authMode)}
|
|
54201
53798
|
Ready: ${result.ok ? "yes" : "no"}${failure}${fix}`;
|
|
54202
53799
|
}
|
|
53800
|
+
function clearProviderModelCacheForTests() {
|
|
53801
|
+
cachedModelsByProvider.clear();
|
|
53802
|
+
}
|
|
54203
53803
|
function providerBaseUrl(provider, definition, settings) {
|
|
54204
53804
|
const providerSettings = getActiveProviderSettings(settings);
|
|
54205
53805
|
if (providerSettings.baseUrl) {
|
|
@@ -54428,11 +54028,12 @@ function validateProviderModelPair(providerId, modelId, options = {}) {
|
|
|
54428
54028
|
const suppliedModels = (options.availableModels ?? []).map((model) => typeof model === "string" ? model : model.id);
|
|
54429
54029
|
const cachedModels = getCachedProviderModels(provider).map((model) => model.id);
|
|
54430
54030
|
const staticModelIds = staticModelsForProvider(provider).map((model) => model.id);
|
|
54431
|
-
const
|
|
54031
|
+
const hasDynamicModels = models.some((model) => model.isDynamic);
|
|
54032
|
+
const validModelIds = suppliedModels.length > 0 ? suppliedModels : hasDynamicModels ? cachedModels.length > 0 ? cachedModels : staticModelIds : Array.from(new Set([...staticModelIds, ...cachedModels]));
|
|
54432
54033
|
if (validModelIds.includes(modelId)) {
|
|
54433
54034
|
return { valid: true };
|
|
54434
54035
|
}
|
|
54435
|
-
if (
|
|
54036
|
+
if (hasDynamicModels && options.allowUncachedDynamic && validModelIds.length === 0) {
|
|
54436
54037
|
return { valid: true };
|
|
54437
54038
|
}
|
|
54438
54039
|
const defaultModel = getDefaultModelForProvider(provider);
|
|
@@ -54869,6 +54470,472 @@ var init_providerRegistry = __esm(() => {
|
|
|
54869
54470
|
validateProviderModelCompatibility = validateProviderModelPair;
|
|
54870
54471
|
});
|
|
54871
54472
|
|
|
54473
|
+
// src/utils/model/model.ts
|
|
54474
|
+
var exports_model = {};
|
|
54475
|
+
__export(exports_model, {
|
|
54476
|
+
resolveSkillModelOverride: () => resolveSkillModelOverride,
|
|
54477
|
+
renderModelSetting: () => renderModelSetting,
|
|
54478
|
+
renderModelName: () => renderModelName,
|
|
54479
|
+
renderDefaultModelSetting: () => renderDefaultModelSetting,
|
|
54480
|
+
parseUserSpecifiedModel: () => parseUserSpecifiedModel,
|
|
54481
|
+
normalizeModelStringForAPI: () => normalizeModelStringForAPI,
|
|
54482
|
+
modelDisplayString: () => modelDisplayString,
|
|
54483
|
+
ismodelO1mMergeEnabled: () => ismodelO1mMergeEnabled,
|
|
54484
|
+
isNonCustommodelOModel: () => isNonCustommodelOModel,
|
|
54485
|
+
isLegacyModelRemapEnabled: () => isLegacyModelRemapEnabled,
|
|
54486
|
+
getmodelO46PricingSuffix: () => getmodelO46PricingSuffix,
|
|
54487
|
+
getUserSpecifiedModelSetting: () => getUserSpecifiedModelSetting,
|
|
54488
|
+
getURAiUserDefaultModelDescription: () => getURAiUserDefaultModelDescription,
|
|
54489
|
+
getSmallFastModel: () => getSmallFastModel,
|
|
54490
|
+
getRuntimeMainLoopModel: () => getRuntimeMainLoopModel,
|
|
54491
|
+
getPublicModelName: () => getPublicModelName,
|
|
54492
|
+
getPublicModelDisplayName: () => getPublicModelDisplayName,
|
|
54493
|
+
getMarketingNameForModel: () => getMarketingNameForModel,
|
|
54494
|
+
getMainLoopModel: () => getMainLoopModel,
|
|
54495
|
+
getDefaultmodelSModel: () => getDefaultmodelSModel,
|
|
54496
|
+
getDefaultmodelOModel: () => getDefaultmodelOModel,
|
|
54497
|
+
getDefaultmodelHModel: () => getDefaultmodelHModel,
|
|
54498
|
+
getDefaultOllamaModel: () => getDefaultOllamaModel,
|
|
54499
|
+
getDefaultMainLoopModelSetting: () => getDefaultMainLoopModelSetting,
|
|
54500
|
+
getDefaultMainLoopModel: () => getDefaultMainLoopModel,
|
|
54501
|
+
getCanonicalName: () => getCanonicalName,
|
|
54502
|
+
getBestModel: () => getBestModel,
|
|
54503
|
+
firstPartyNameToCanonical: () => firstPartyNameToCanonical,
|
|
54504
|
+
__resetOllamaRouteMemoForTests: () => __resetOllamaRouteMemoForTests
|
|
54505
|
+
});
|
|
54506
|
+
function __resetOllamaRouteMemoForTests() {
|
|
54507
|
+
memoizedRoutedDefaultModel = undefined;
|
|
54508
|
+
memoizedRoutedFastModel = undefined;
|
|
54509
|
+
}
|
|
54510
|
+
function getDefaultOllamaModel() {
|
|
54511
|
+
if (process.env.OLLAMA_MODEL) {
|
|
54512
|
+
return process.env.OLLAMA_MODEL;
|
|
54513
|
+
}
|
|
54514
|
+
if (isOllamaAutoRouteEnabled()) {
|
|
54515
|
+
if (memoizedRoutedDefaultModel)
|
|
54516
|
+
return memoizedRoutedDefaultModel;
|
|
54517
|
+
const routed = pickBestCoderModel(getCachedOllamaModelNames());
|
|
54518
|
+
if (routed) {
|
|
54519
|
+
memoizedRoutedDefaultModel = routed;
|
|
54520
|
+
return routed;
|
|
54521
|
+
}
|
|
54522
|
+
}
|
|
54523
|
+
return DEFAULT_OLLAMA_MODEL2;
|
|
54524
|
+
}
|
|
54525
|
+
function getSmallFastModel() {
|
|
54526
|
+
if (getAPIProvider() === "ollama") {
|
|
54527
|
+
if (process.env.OLLAMA_SMALL_FAST_MODEL) {
|
|
54528
|
+
return process.env.OLLAMA_SMALL_FAST_MODEL;
|
|
54529
|
+
}
|
|
54530
|
+
if (isOllamaAutoRouteEnabled()) {
|
|
54531
|
+
if (memoizedRoutedFastModel)
|
|
54532
|
+
return memoizedRoutedFastModel;
|
|
54533
|
+
const routed = pickSmallFastModel(getCachedOllamaModelNames());
|
|
54534
|
+
if (routed) {
|
|
54535
|
+
memoizedRoutedFastModel = routed;
|
|
54536
|
+
return routed;
|
|
54537
|
+
}
|
|
54538
|
+
}
|
|
54539
|
+
return getDefaultOllamaModel();
|
|
54540
|
+
}
|
|
54541
|
+
return process.env.URHQ_SMALL_FAST_MODEL || getDefaultmodelHModel();
|
|
54542
|
+
}
|
|
54543
|
+
function isNonCustommodelOModel(model) {
|
|
54544
|
+
return model === getModelStrings2().modelO40 || model === getModelStrings2().modelO41 || model === getModelStrings2().modelO45 || model === getModelStrings2().modelO46;
|
|
54545
|
+
}
|
|
54546
|
+
function getUserSpecifiedModelSetting() {
|
|
54547
|
+
let specifiedModel;
|
|
54548
|
+
const modelOverride = getMainLoopModelOverride();
|
|
54549
|
+
if (modelOverride !== undefined) {
|
|
54550
|
+
specifiedModel = modelOverride;
|
|
54551
|
+
} else {
|
|
54552
|
+
const settings = getSettings_DEPRECATED() || {};
|
|
54553
|
+
specifiedModel = process.env.URHQ_MODEL || settings.model || undefined;
|
|
54554
|
+
}
|
|
54555
|
+
if (specifiedModel && !isModelAllowed(specifiedModel)) {
|
|
54556
|
+
return;
|
|
54557
|
+
}
|
|
54558
|
+
return specifiedModel;
|
|
54559
|
+
}
|
|
54560
|
+
function getMainLoopModel() {
|
|
54561
|
+
const model = getUserSpecifiedModelSetting();
|
|
54562
|
+
if (model !== undefined && model !== null) {
|
|
54563
|
+
return parseUserSpecifiedModel(model);
|
|
54564
|
+
}
|
|
54565
|
+
return getDefaultMainLoopModel();
|
|
54566
|
+
}
|
|
54567
|
+
function getBestModel() {
|
|
54568
|
+
return getDefaultmodelOModel();
|
|
54569
|
+
}
|
|
54570
|
+
function getDefaultmodelOModel() {
|
|
54571
|
+
if (getAPIProvider() === "ollama") {
|
|
54572
|
+
return getDefaultOllamaModel();
|
|
54573
|
+
}
|
|
54574
|
+
if (process.env.URHQ_DEFAULT_MODELO_MODEL) {
|
|
54575
|
+
return process.env.URHQ_DEFAULT_MODELO_MODEL;
|
|
54576
|
+
}
|
|
54577
|
+
if (getAPIProvider() !== "firstParty") {
|
|
54578
|
+
return getModelStrings2().modelO46;
|
|
54579
|
+
}
|
|
54580
|
+
return getModelStrings2().modelO46;
|
|
54581
|
+
}
|
|
54582
|
+
function getDefaultmodelSModel() {
|
|
54583
|
+
if (getAPIProvider() === "ollama") {
|
|
54584
|
+
return getDefaultOllamaModel();
|
|
54585
|
+
}
|
|
54586
|
+
if (process.env.URHQ_DEFAULT_MODELS_MODEL) {
|
|
54587
|
+
return process.env.URHQ_DEFAULT_MODELS_MODEL;
|
|
54588
|
+
}
|
|
54589
|
+
if (getAPIProvider() !== "firstParty") {
|
|
54590
|
+
return getModelStrings2().modelS45;
|
|
54591
|
+
}
|
|
54592
|
+
return getModelStrings2().modelS46;
|
|
54593
|
+
}
|
|
54594
|
+
function getDefaultmodelHModel() {
|
|
54595
|
+
if (getAPIProvider() === "ollama") {
|
|
54596
|
+
return process.env.OLLAMA_SMALL_FAST_MODEL || getDefaultOllamaModel();
|
|
54597
|
+
}
|
|
54598
|
+
if (process.env.URHQ_DEFAULT_MODELH_MODEL) {
|
|
54599
|
+
return process.env.URHQ_DEFAULT_MODELH_MODEL;
|
|
54600
|
+
}
|
|
54601
|
+
return getModelStrings2().modelH45;
|
|
54602
|
+
}
|
|
54603
|
+
function getRuntimeMainLoopModel(params) {
|
|
54604
|
+
const { permissionMode, mainLoopModel, exceeds200kTokens = false } = params;
|
|
54605
|
+
if (getUserSpecifiedModelSetting() === "modelOplan" && permissionMode === "plan" && !exceeds200kTokens) {
|
|
54606
|
+
return getDefaultmodelOModel();
|
|
54607
|
+
}
|
|
54608
|
+
if (getUserSpecifiedModelSetting() === "modelH" && permissionMode === "plan") {
|
|
54609
|
+
return getDefaultmodelSModel();
|
|
54610
|
+
}
|
|
54611
|
+
return mainLoopModel;
|
|
54612
|
+
}
|
|
54613
|
+
function getDefaultMainLoopModelSetting() {
|
|
54614
|
+
const settings = getSettings_DEPRECATED() || {};
|
|
54615
|
+
const activeProvider = getActiveProviderSettings(settings).active ?? "ollama";
|
|
54616
|
+
if (activeProvider !== "ollama") {
|
|
54617
|
+
const providerDefault = getDefaultModelForProvider(activeProvider);
|
|
54618
|
+
if (providerDefault) {
|
|
54619
|
+
return providerDefault;
|
|
54620
|
+
}
|
|
54621
|
+
}
|
|
54622
|
+
if (getAPIProvider() === "ollama") {
|
|
54623
|
+
return getDefaultOllamaModel();
|
|
54624
|
+
}
|
|
54625
|
+
if (process.env.USER_TYPE === "ant") {
|
|
54626
|
+
return getAntModelOverrideConfig2()?.defaultModel ?? getDefaultmodelOModel() + "[1m]";
|
|
54627
|
+
}
|
|
54628
|
+
if (isMaxSubscriber()) {
|
|
54629
|
+
return getDefaultmodelOModel() + (ismodelO1mMergeEnabled() ? "[1m]" : "");
|
|
54630
|
+
}
|
|
54631
|
+
if (isTeamPremiumSubscriber()) {
|
|
54632
|
+
return getDefaultmodelOModel() + (ismodelO1mMergeEnabled() ? "[1m]" : "");
|
|
54633
|
+
}
|
|
54634
|
+
return getDefaultmodelSModel();
|
|
54635
|
+
}
|
|
54636
|
+
function getDefaultMainLoopModel() {
|
|
54637
|
+
return parseUserSpecifiedModel(getDefaultMainLoopModelSetting());
|
|
54638
|
+
}
|
|
54639
|
+
function firstPartyNameToCanonical(name) {
|
|
54640
|
+
name = name.toLowerCase();
|
|
54641
|
+
if (name.includes("ur-modelO-4-6")) {
|
|
54642
|
+
return "ur-modelO-4-6";
|
|
54643
|
+
}
|
|
54644
|
+
if (name.includes("ur-modelO-4-5")) {
|
|
54645
|
+
return "ur-modelO-4-5";
|
|
54646
|
+
}
|
|
54647
|
+
if (name.includes("ur-modelO-4-1")) {
|
|
54648
|
+
return "ur-modelO-4-1";
|
|
54649
|
+
}
|
|
54650
|
+
if (name.includes("ur-modelO-4")) {
|
|
54651
|
+
return "ur-modelO-4";
|
|
54652
|
+
}
|
|
54653
|
+
if (name.includes("ur-modelS-4-6")) {
|
|
54654
|
+
return "ur-modelS-4-6";
|
|
54655
|
+
}
|
|
54656
|
+
if (name.includes("ur-modelS-4-5")) {
|
|
54657
|
+
return "ur-modelS-4-5";
|
|
54658
|
+
}
|
|
54659
|
+
if (name.includes("ur-modelS-4")) {
|
|
54660
|
+
return "ur-modelS-4";
|
|
54661
|
+
}
|
|
54662
|
+
if (name.includes("ur-modelH-4-5")) {
|
|
54663
|
+
return "ur-modelH-4-5";
|
|
54664
|
+
}
|
|
54665
|
+
if (name.includes("ur-3-7-modelS")) {
|
|
54666
|
+
return "ur-3-7-modelS";
|
|
54667
|
+
}
|
|
54668
|
+
if (name.includes("ur-3-5-modelS")) {
|
|
54669
|
+
return "ur-3-5-modelS";
|
|
54670
|
+
}
|
|
54671
|
+
if (name.includes("ur-3-5-modelH")) {
|
|
54672
|
+
return "ur-3-5-modelH";
|
|
54673
|
+
}
|
|
54674
|
+
if (name.includes("ur-3-modelO")) {
|
|
54675
|
+
return "ur-3-modelO";
|
|
54676
|
+
}
|
|
54677
|
+
if (name.includes("ur-3-modelS")) {
|
|
54678
|
+
return "ur-3-modelS";
|
|
54679
|
+
}
|
|
54680
|
+
if (name.includes("ur-3-modelH")) {
|
|
54681
|
+
return "ur-3-modelH";
|
|
54682
|
+
}
|
|
54683
|
+
const match = name.match(/(ur-(\d+-\d+-)?\w+)/);
|
|
54684
|
+
if (match && match[1]) {
|
|
54685
|
+
return match[1];
|
|
54686
|
+
}
|
|
54687
|
+
return name;
|
|
54688
|
+
}
|
|
54689
|
+
function getCanonicalName(fullModelName) {
|
|
54690
|
+
return firstPartyNameToCanonical(resolveOverriddenModel(fullModelName));
|
|
54691
|
+
}
|
|
54692
|
+
function getURAiUserDefaultModelDescription(fastMode = false) {
|
|
54693
|
+
if (isMaxSubscriber() || isTeamPremiumSubscriber()) {
|
|
54694
|
+
if (ismodelO1mMergeEnabled()) {
|
|
54695
|
+
return `modelO 4.6 with 1M context \xB7 Most capable for complex work${fastMode ? getmodelO46PricingSuffix(true) : ""}`;
|
|
54696
|
+
}
|
|
54697
|
+
return `modelO 4.6 \xB7 Most capable for complex work${fastMode ? getmodelO46PricingSuffix(true) : ""}`;
|
|
54698
|
+
}
|
|
54699
|
+
return "modelS 4.6 \xB7 Best for everyday tasks";
|
|
54700
|
+
}
|
|
54701
|
+
function renderDefaultModelSetting(setting) {
|
|
54702
|
+
if (setting === "modelOplan") {
|
|
54703
|
+
return "modelO 4.6 in plan mode, else modelS 4.6";
|
|
54704
|
+
}
|
|
54705
|
+
return renderModelName(parseUserSpecifiedModel(setting));
|
|
54706
|
+
}
|
|
54707
|
+
function getmodelO46PricingSuffix(fastMode) {
|
|
54708
|
+
if (getAPIProvider() !== "firstParty")
|
|
54709
|
+
return "";
|
|
54710
|
+
const pricing = formatModelPricing(getmodelO46CostTier(fastMode));
|
|
54711
|
+
const fastModeIndicator = fastMode ? ` (${LIGHTNING_BOLT})` : "";
|
|
54712
|
+
return ` \xB7${fastModeIndicator} ${pricing}`;
|
|
54713
|
+
}
|
|
54714
|
+
function ismodelO1mMergeEnabled() {
|
|
54715
|
+
if (is1mContextDisabled() || isProSubscriber() || getAPIProvider() !== "firstParty") {
|
|
54716
|
+
return false;
|
|
54717
|
+
}
|
|
54718
|
+
if (isURAISubscriber2() && getSubscriptionType() === null) {
|
|
54719
|
+
return false;
|
|
54720
|
+
}
|
|
54721
|
+
return true;
|
|
54722
|
+
}
|
|
54723
|
+
function renderModelSetting(setting) {
|
|
54724
|
+
if (setting === "modelOplan") {
|
|
54725
|
+
return "modelO Plan";
|
|
54726
|
+
}
|
|
54727
|
+
if (isModelAlias(setting)) {
|
|
54728
|
+
return capitalize(setting);
|
|
54729
|
+
}
|
|
54730
|
+
return renderModelName(setting);
|
|
54731
|
+
}
|
|
54732
|
+
function getPublicModelDisplayName(model) {
|
|
54733
|
+
if (getAPIProvider() === "ollama") {
|
|
54734
|
+
return null;
|
|
54735
|
+
}
|
|
54736
|
+
switch (model) {
|
|
54737
|
+
case getModelStrings2().modelO46:
|
|
54738
|
+
return "modelO 4.6";
|
|
54739
|
+
case getModelStrings2().modelO46 + "[1m]":
|
|
54740
|
+
return "modelO 4.6 (1M context)";
|
|
54741
|
+
case getModelStrings2().modelO45:
|
|
54742
|
+
return "modelO 4.5";
|
|
54743
|
+
case getModelStrings2().modelO41:
|
|
54744
|
+
return "modelO 4.1";
|
|
54745
|
+
case getModelStrings2().modelO40:
|
|
54746
|
+
return "modelO 4";
|
|
54747
|
+
case getModelStrings2().modelS46 + "[1m]":
|
|
54748
|
+
return "modelS 4.6 (1M context)";
|
|
54749
|
+
case getModelStrings2().modelS46:
|
|
54750
|
+
return "modelS 4.6";
|
|
54751
|
+
case getModelStrings2().modelS45 + "[1m]":
|
|
54752
|
+
return "modelS 4.5 (1M context)";
|
|
54753
|
+
case getModelStrings2().modelS45:
|
|
54754
|
+
return "modelS 4.5";
|
|
54755
|
+
case getModelStrings2().modelS40:
|
|
54756
|
+
return "modelS 4";
|
|
54757
|
+
case getModelStrings2().modelS40 + "[1m]":
|
|
54758
|
+
return "modelS 4 (1M context)";
|
|
54759
|
+
case getModelStrings2().modelS37:
|
|
54760
|
+
return "modelS 3.7";
|
|
54761
|
+
case getModelStrings2().modelS35:
|
|
54762
|
+
return "modelS 3.5";
|
|
54763
|
+
case getModelStrings2().modelH45:
|
|
54764
|
+
return "modelH 4.5";
|
|
54765
|
+
case getModelStrings2().modelH35:
|
|
54766
|
+
return "modelH 3.5";
|
|
54767
|
+
default:
|
|
54768
|
+
return null;
|
|
54769
|
+
}
|
|
54770
|
+
}
|
|
54771
|
+
function maskModelCodename(baseName) {
|
|
54772
|
+
const [codename = "", ...rest] = baseName.split("-");
|
|
54773
|
+
const masked = codename.slice(0, 3) + "*".repeat(Math.max(0, codename.length - 3));
|
|
54774
|
+
return [masked, ...rest].join("-");
|
|
54775
|
+
}
|
|
54776
|
+
function renderModelName(model) {
|
|
54777
|
+
const publicName = getPublicModelDisplayName(model);
|
|
54778
|
+
if (publicName) {
|
|
54779
|
+
return publicName;
|
|
54780
|
+
}
|
|
54781
|
+
if (process.env.USER_TYPE === "ant") {
|
|
54782
|
+
const resolved = parseUserSpecifiedModel(model);
|
|
54783
|
+
const antModel = resolveAntModel2(model);
|
|
54784
|
+
if (antModel) {
|
|
54785
|
+
const baseName = antModel.model.replace(/\[1m\]$/i, "");
|
|
54786
|
+
const masked = maskModelCodename(baseName);
|
|
54787
|
+
const suffix = has1mContext(resolved) ? "[1m]" : "";
|
|
54788
|
+
return masked + suffix;
|
|
54789
|
+
}
|
|
54790
|
+
if (resolved !== model) {
|
|
54791
|
+
return `${model} (${resolved})`;
|
|
54792
|
+
}
|
|
54793
|
+
return resolved;
|
|
54794
|
+
}
|
|
54795
|
+
return model;
|
|
54796
|
+
}
|
|
54797
|
+
function getPublicModelName(model) {
|
|
54798
|
+
if (getAPIProvider() === "ollama") {
|
|
54799
|
+
return `Ollama (${model})`;
|
|
54800
|
+
}
|
|
54801
|
+
const publicName = getPublicModelDisplayName(model);
|
|
54802
|
+
if (publicName) {
|
|
54803
|
+
return `UR ${publicName}`;
|
|
54804
|
+
}
|
|
54805
|
+
return `UR (${model})`;
|
|
54806
|
+
}
|
|
54807
|
+
function parseUserSpecifiedModel(modelInput) {
|
|
54808
|
+
const modelInputTrimmed = modelInput.trim();
|
|
54809
|
+
const normalizedModel = modelInputTrimmed.toLowerCase();
|
|
54810
|
+
const has1mTag = has1mContext(normalizedModel);
|
|
54811
|
+
const modelString = has1mTag ? normalizedModel.replace(/\[1m]$/i, "").trim() : normalizedModel;
|
|
54812
|
+
switch (modelString) {
|
|
54813
|
+
case "modeloplan":
|
|
54814
|
+
return getDefaultmodelSModel() + (has1mTag ? "[1m]" : "");
|
|
54815
|
+
case "models":
|
|
54816
|
+
return getDefaultmodelSModel() + (has1mTag ? "[1m]" : "");
|
|
54817
|
+
case "modelh":
|
|
54818
|
+
return getDefaultmodelHModel() + (has1mTag ? "[1m]" : "");
|
|
54819
|
+
case "modelo":
|
|
54820
|
+
return getDefaultmodelOModel() + (has1mTag ? "[1m]" : "");
|
|
54821
|
+
case "best":
|
|
54822
|
+
return getBestModel();
|
|
54823
|
+
default:
|
|
54824
|
+
}
|
|
54825
|
+
if (getAPIProvider() === "firstParty" && isLegacymodelOFirstParty(modelString) && isLegacyModelRemapEnabled()) {
|
|
54826
|
+
return getDefaultmodelOModel() + (has1mTag ? "[1m]" : "");
|
|
54827
|
+
}
|
|
54828
|
+
if (process.env.USER_TYPE === "ant") {
|
|
54829
|
+
const has1mAntTag = has1mContext(normalizedModel);
|
|
54830
|
+
const baseAntModel = normalizedModel.replace(/\[1m]$/i, "").trim();
|
|
54831
|
+
const antModel = resolveAntModel2(baseAntModel);
|
|
54832
|
+
if (antModel) {
|
|
54833
|
+
const suffix = has1mAntTag ? "[1m]" : "";
|
|
54834
|
+
return antModel.model + suffix;
|
|
54835
|
+
}
|
|
54836
|
+
}
|
|
54837
|
+
if (has1mTag) {
|
|
54838
|
+
return modelInputTrimmed.replace(/\[1m\]$/i, "").trim() + "[1m]";
|
|
54839
|
+
}
|
|
54840
|
+
return modelInputTrimmed;
|
|
54841
|
+
}
|
|
54842
|
+
function resolveSkillModelOverride(skillModel, currentModel) {
|
|
54843
|
+
if (has1mContext(skillModel) || !has1mContext(currentModel)) {
|
|
54844
|
+
return skillModel;
|
|
54845
|
+
}
|
|
54846
|
+
if (modelSupports1M(parseUserSpecifiedModel(skillModel))) {
|
|
54847
|
+
return skillModel + "[1m]";
|
|
54848
|
+
}
|
|
54849
|
+
return skillModel;
|
|
54850
|
+
}
|
|
54851
|
+
function isLegacymodelOFirstParty(model) {
|
|
54852
|
+
return LEGACY_MODELO_FIRSTPARTY.includes(model);
|
|
54853
|
+
}
|
|
54854
|
+
function isLegacyModelRemapEnabled() {
|
|
54855
|
+
return !isEnvTruthy(process.env.UR_CODE_DISABLE_LEGACY_MODEL_REMAP);
|
|
54856
|
+
}
|
|
54857
|
+
function modelDisplayString(model) {
|
|
54858
|
+
if (model === null) {
|
|
54859
|
+
if (process.env.USER_TYPE === "ant") {
|
|
54860
|
+
return `Default for Ants (${renderDefaultModelSetting(getDefaultMainLoopModelSetting())})`;
|
|
54861
|
+
} else if (isURAISubscriber2()) {
|
|
54862
|
+
return `Default (${getURAiUserDefaultModelDescription()})`;
|
|
54863
|
+
}
|
|
54864
|
+
return `Default (${getDefaultMainLoopModel()})`;
|
|
54865
|
+
}
|
|
54866
|
+
const resolvedModel = parseUserSpecifiedModel(model);
|
|
54867
|
+
return model === resolvedModel ? resolvedModel : `${model} (${resolvedModel})`;
|
|
54868
|
+
}
|
|
54869
|
+
function getMarketingNameForModel(modelId) {
|
|
54870
|
+
if (getAPIProvider() === "foundry" || getAPIProvider() === "ollama") {
|
|
54871
|
+
return;
|
|
54872
|
+
}
|
|
54873
|
+
const has1m = modelId.toLowerCase().includes("[1m]");
|
|
54874
|
+
const canonical = getCanonicalName(modelId);
|
|
54875
|
+
if (canonical.includes("ur-modelO-4-6")) {
|
|
54876
|
+
return has1m ? "modelO 4.6 (with 1M context)" : "modelO 4.6";
|
|
54877
|
+
}
|
|
54878
|
+
if (canonical.includes("ur-modelO-4-5")) {
|
|
54879
|
+
return "modelO 4.5";
|
|
54880
|
+
}
|
|
54881
|
+
if (canonical.includes("ur-modelO-4-1")) {
|
|
54882
|
+
return "modelO 4.1";
|
|
54883
|
+
}
|
|
54884
|
+
if (canonical.includes("ur-modelO-4")) {
|
|
54885
|
+
return "modelO 4";
|
|
54886
|
+
}
|
|
54887
|
+
if (canonical.includes("ur-modelS-4-6")) {
|
|
54888
|
+
return has1m ? "modelS 4.6 (with 1M context)" : "modelS 4.6";
|
|
54889
|
+
}
|
|
54890
|
+
if (canonical.includes("ur-modelS-4-5")) {
|
|
54891
|
+
return has1m ? "modelS 4.5 (with 1M context)" : "modelS 4.5";
|
|
54892
|
+
}
|
|
54893
|
+
if (canonical.includes("ur-modelS-4")) {
|
|
54894
|
+
return has1m ? "modelS 4 (with 1M context)" : "modelS 4";
|
|
54895
|
+
}
|
|
54896
|
+
if (canonical.includes("ur-3-7-modelS")) {
|
|
54897
|
+
return "UR 3.7 modelS";
|
|
54898
|
+
}
|
|
54899
|
+
if (canonical.includes("ur-3-5-modelS")) {
|
|
54900
|
+
return "UR 3.5 modelS";
|
|
54901
|
+
}
|
|
54902
|
+
if (canonical.includes("ur-modelH-4-5")) {
|
|
54903
|
+
return "modelH 4.5";
|
|
54904
|
+
}
|
|
54905
|
+
if (canonical.includes("ur-3-5-modelH")) {
|
|
54906
|
+
return "UR 3.5 modelH";
|
|
54907
|
+
}
|
|
54908
|
+
return;
|
|
54909
|
+
}
|
|
54910
|
+
function normalizeModelStringForAPI(model) {
|
|
54911
|
+
return model.replace(/\[(1|2)m\]/gi, "");
|
|
54912
|
+
}
|
|
54913
|
+
var DEFAULT_OLLAMA_MODEL2 = "qwen3-coder:480b-cloud", memoizedRoutedDefaultModel, memoizedRoutedFastModel, LEGACY_MODELO_FIRSTPARTY;
|
|
54914
|
+
var init_model = __esm(() => {
|
|
54915
|
+
init_state();
|
|
54916
|
+
init_auth();
|
|
54917
|
+
init_context();
|
|
54918
|
+
init_envUtils();
|
|
54919
|
+
init_modelStrings();
|
|
54920
|
+
init_modelCost();
|
|
54921
|
+
init_settings2();
|
|
54922
|
+
init_providers();
|
|
54923
|
+
init_figures2();
|
|
54924
|
+
init_modelAllowlist();
|
|
54925
|
+
init_aliases();
|
|
54926
|
+
init_stringUtils();
|
|
54927
|
+
init_antModels();
|
|
54928
|
+
init_ollamaModels();
|
|
54929
|
+
init_ollamaRouter();
|
|
54930
|
+
init_providerRegistry();
|
|
54931
|
+
LEGACY_MODELO_FIRSTPARTY = [
|
|
54932
|
+
"ur-modelO-4-20250514",
|
|
54933
|
+
"ur-modelO-4-1-20250805",
|
|
54934
|
+
"ur-modelO-4-0",
|
|
54935
|
+
"ur-modelO-4-1"
|
|
54936
|
+
];
|
|
54937
|
+
});
|
|
54938
|
+
|
|
54872
54939
|
// src/utils/model/ollamaTuning.ts
|
|
54873
54940
|
function computeOllamaNumCtx(input) {
|
|
54874
54941
|
const {
|
|
@@ -56506,17 +56573,233 @@ var init_ollama = __esm(() => {
|
|
|
56506
56573
|
ollamaModelCapabilitiesCache = new Map;
|
|
56507
56574
|
});
|
|
56508
56575
|
|
|
56576
|
+
// src/services/api/streamingAdapters.ts
|
|
56577
|
+
import { randomUUID as randomUUID3 } from "crypto";
|
|
56578
|
+
function normalizeUsage(usage = {}) {
|
|
56579
|
+
return {
|
|
56580
|
+
...EMPTY_USAGE,
|
|
56581
|
+
...usage
|
|
56582
|
+
};
|
|
56583
|
+
}
|
|
56584
|
+
function messageText(message) {
|
|
56585
|
+
const content = message?.content;
|
|
56586
|
+
if (typeof content === "string") {
|
|
56587
|
+
return content;
|
|
56588
|
+
}
|
|
56589
|
+
if (!Array.isArray(content)) {
|
|
56590
|
+
return "";
|
|
56591
|
+
}
|
|
56592
|
+
return content.map((block) => {
|
|
56593
|
+
if (typeof block === "string")
|
|
56594
|
+
return block;
|
|
56595
|
+
if (block?.type === "text")
|
|
56596
|
+
return block.text ?? "";
|
|
56597
|
+
return "";
|
|
56598
|
+
}).join("");
|
|
56599
|
+
}
|
|
56600
|
+
function createOneShotMessageStream(message) {
|
|
56601
|
+
const controller = new AbortController;
|
|
56602
|
+
const usage = normalizeUsage(message?.usage);
|
|
56603
|
+
const text = messageText(message);
|
|
56604
|
+
const model = message?.model ?? "unknown";
|
|
56605
|
+
const id = message?.id ?? `provider-${randomUUID3()}`;
|
|
56606
|
+
const stopReason = message?.stop_reason ?? "end_turn";
|
|
56607
|
+
return {
|
|
56608
|
+
controller,
|
|
56609
|
+
async* [Symbol.asyncIterator]() {
|
|
56610
|
+
yield {
|
|
56611
|
+
type: "message_start",
|
|
56612
|
+
message: {
|
|
56613
|
+
id,
|
|
56614
|
+
type: "message",
|
|
56615
|
+
role: "assistant",
|
|
56616
|
+
model,
|
|
56617
|
+
content: [],
|
|
56618
|
+
stop_reason: null,
|
|
56619
|
+
stop_sequence: null,
|
|
56620
|
+
usage: { ...usage, output_tokens: 0 }
|
|
56621
|
+
}
|
|
56622
|
+
};
|
|
56623
|
+
yield {
|
|
56624
|
+
type: "content_block_start",
|
|
56625
|
+
index: 0,
|
|
56626
|
+
content_block: { type: "text", text: "" }
|
|
56627
|
+
};
|
|
56628
|
+
if (text) {
|
|
56629
|
+
yield {
|
|
56630
|
+
type: "content_block_delta",
|
|
56631
|
+
index: 0,
|
|
56632
|
+
delta: { type: "text_delta", text }
|
|
56633
|
+
};
|
|
56634
|
+
}
|
|
56635
|
+
yield { type: "content_block_stop", index: 0 };
|
|
56636
|
+
yield {
|
|
56637
|
+
type: "message_delta",
|
|
56638
|
+
delta: { stop_reason: stopReason, stop_sequence: null },
|
|
56639
|
+
usage
|
|
56640
|
+
};
|
|
56641
|
+
yield { type: "message_stop" };
|
|
56642
|
+
}
|
|
56643
|
+
};
|
|
56644
|
+
}
|
|
56645
|
+
var EMPTY_USAGE;
|
|
56646
|
+
var init_streamingAdapters = __esm(() => {
|
|
56647
|
+
EMPTY_USAGE = {
|
|
56648
|
+
input_tokens: 0,
|
|
56649
|
+
output_tokens: 0,
|
|
56650
|
+
cache_creation_input_tokens: 0,
|
|
56651
|
+
cache_read_input_tokens: 0
|
|
56652
|
+
};
|
|
56653
|
+
});
|
|
56654
|
+
|
|
56655
|
+
// src/services/api/openaiCompatible.ts
|
|
56656
|
+
var exports_openaiCompatible = {};
|
|
56657
|
+
__export(exports_openaiCompatible, {
|
|
56658
|
+
createOpenAICompatibleClient: () => createOpenAICompatibleClient
|
|
56659
|
+
});
|
|
56660
|
+
import { randomUUID as randomUUID4 } from "crypto";
|
|
56661
|
+
async function createOpenAICompatibleClient(options) {
|
|
56662
|
+
const endpoint = `${options.baseUrl.replace(/\/$/, "")}/chat/completions`;
|
|
56663
|
+
async function doRequest(params, requestOptions) {
|
|
56664
|
+
const response = await fetch(endpoint, {
|
|
56665
|
+
method: "POST",
|
|
56666
|
+
headers: {
|
|
56667
|
+
"Content-Type": "application/json",
|
|
56668
|
+
...options.apiKey ? { Authorization: `Bearer ${options.apiKey}` } : {},
|
|
56669
|
+
...requestOptions?.headers ?? {}
|
|
56670
|
+
},
|
|
56671
|
+
body: JSON.stringify(toOpenAICompatibleRequest(params)),
|
|
56672
|
+
signal: requestOptions?.signal
|
|
56673
|
+
});
|
|
56674
|
+
if (!response.ok) {
|
|
56675
|
+
const body = await response.text().catch(() => "");
|
|
56676
|
+
throw new Error(`OpenAI-compatible request failed for ${endpoint} (${response.status}): ${body || response.statusText}`);
|
|
56677
|
+
}
|
|
56678
|
+
const data = await response.json();
|
|
56679
|
+
return {
|
|
56680
|
+
response,
|
|
56681
|
+
data: parseOpenAICompatibleResponse(data, params.model)
|
|
56682
|
+
};
|
|
56683
|
+
}
|
|
56684
|
+
return {
|
|
56685
|
+
beta: {
|
|
56686
|
+
messages: {
|
|
56687
|
+
create(params, requestOptions) {
|
|
56688
|
+
if (params.stream) {
|
|
56689
|
+
const requestPromise = doRequest({ ...params, stream: false }, requestOptions);
|
|
56690
|
+
return {
|
|
56691
|
+
async withResponse() {
|
|
56692
|
+
const { response, data } = await requestPromise;
|
|
56693
|
+
return {
|
|
56694
|
+
data: createOneShotMessageStream(data),
|
|
56695
|
+
response,
|
|
56696
|
+
request_id: response.headers.get("x-request-id") ?? response.headers.get("x-request-id".toLowerCase()) ?? data.id
|
|
56697
|
+
};
|
|
56698
|
+
}
|
|
56699
|
+
};
|
|
56700
|
+
}
|
|
56701
|
+
return doRequest(params, requestOptions).then(({ data }) => data);
|
|
56702
|
+
},
|
|
56703
|
+
async countTokens(params) {
|
|
56704
|
+
return {
|
|
56705
|
+
input_tokens: Math.ceil(JSON.stringify(params.messages ?? []).length / 4)
|
|
56706
|
+
};
|
|
56707
|
+
}
|
|
56708
|
+
}
|
|
56709
|
+
}
|
|
56710
|
+
};
|
|
56711
|
+
}
|
|
56712
|
+
function toOpenAICompatibleRequest(params) {
|
|
56713
|
+
return {
|
|
56714
|
+
model: params.model,
|
|
56715
|
+
messages: toOpenAIMessages(params),
|
|
56716
|
+
max_tokens: params.max_tokens,
|
|
56717
|
+
temperature: params.temperature,
|
|
56718
|
+
stream: false,
|
|
56719
|
+
...params.tools ? { tools: params.tools } : {},
|
|
56720
|
+
...params.tool_choice ? { tool_choice: params.tool_choice } : {}
|
|
56721
|
+
};
|
|
56722
|
+
}
|
|
56723
|
+
function toOpenAIMessages(params) {
|
|
56724
|
+
const messages = [];
|
|
56725
|
+
const system = systemToText2(params.system);
|
|
56726
|
+
if (system) {
|
|
56727
|
+
messages.push({ role: "system", content: system });
|
|
56728
|
+
}
|
|
56729
|
+
for (const message of params.messages ?? []) {
|
|
56730
|
+
messages.push({
|
|
56731
|
+
role: message.role,
|
|
56732
|
+
content: contentToText(message.content)
|
|
56733
|
+
});
|
|
56734
|
+
}
|
|
56735
|
+
return messages;
|
|
56736
|
+
}
|
|
56737
|
+
function systemToText2(system) {
|
|
56738
|
+
if (!system)
|
|
56739
|
+
return "";
|
|
56740
|
+
if (typeof system === "string")
|
|
56741
|
+
return system;
|
|
56742
|
+
if (Array.isArray(system)) {
|
|
56743
|
+
return system.map((block) => block?.text ?? "").join(`
|
|
56744
|
+
|
|
56745
|
+
`);
|
|
56746
|
+
}
|
|
56747
|
+
return "";
|
|
56748
|
+
}
|
|
56749
|
+
function contentToText(content) {
|
|
56750
|
+
if (typeof content === "string")
|
|
56751
|
+
return content;
|
|
56752
|
+
if (!Array.isArray(content))
|
|
56753
|
+
return "";
|
|
56754
|
+
return content.map((block) => {
|
|
56755
|
+
if (typeof block === "string")
|
|
56756
|
+
return block;
|
|
56757
|
+
if (block?.type === "text")
|
|
56758
|
+
return block.text ?? "";
|
|
56759
|
+
if (block?.type === "tool_result")
|
|
56760
|
+
return block.content ?? "";
|
|
56761
|
+
return "";
|
|
56762
|
+
}).join(`
|
|
56763
|
+
`);
|
|
56764
|
+
}
|
|
56765
|
+
function parseOpenAICompatibleResponse(data, fallbackModel) {
|
|
56766
|
+
const choice = data.choices?.[0];
|
|
56767
|
+
return {
|
|
56768
|
+
id: data.id ?? `openai-compatible-${randomUUID4()}`,
|
|
56769
|
+
type: "message",
|
|
56770
|
+
role: "assistant",
|
|
56771
|
+
model: data.model ?? fallbackModel,
|
|
56772
|
+
content: [
|
|
56773
|
+
{
|
|
56774
|
+
type: "text",
|
|
56775
|
+
text: choice?.message?.content ?? choice?.text ?? ""
|
|
56776
|
+
}
|
|
56777
|
+
],
|
|
56778
|
+
stop_reason: choice?.finish_reason ?? "end_turn",
|
|
56779
|
+
stop_sequence: null,
|
|
56780
|
+
usage: {
|
|
56781
|
+
input_tokens: data.usage?.prompt_tokens ?? 0,
|
|
56782
|
+
output_tokens: data.usage?.completion_tokens ?? 0,
|
|
56783
|
+
cache_creation_input_tokens: 0,
|
|
56784
|
+
cache_read_input_tokens: 0
|
|
56785
|
+
}
|
|
56786
|
+
};
|
|
56787
|
+
}
|
|
56788
|
+
var init_openaiCompatible = __esm(() => {
|
|
56789
|
+
init_streamingAdapters();
|
|
56790
|
+
});
|
|
56791
|
+
|
|
56509
56792
|
// src/services/api/urhqSubscription.ts
|
|
56510
56793
|
var exports_urhqSubscription = {};
|
|
56511
56794
|
__export(exports_urhqSubscription, {
|
|
56512
56795
|
createURHQSubscriptionClient: () => createURHQSubscriptionClient
|
|
56513
56796
|
});
|
|
56514
|
-
import { randomUUID as
|
|
56797
|
+
import { randomUUID as randomUUID5 } from "crypto";
|
|
56515
56798
|
async function createURHQSubscriptionClient(providerId, options) {
|
|
56516
56799
|
async function doRequest(params, extraHeaders) {
|
|
56517
56800
|
const clientRequestId = params?.headers?.["x-client-request-id"];
|
|
56518
56801
|
const data = {
|
|
56519
|
-
id: `${providerId}-${
|
|
56802
|
+
id: `${providerId}-${randomUUID5()}`,
|
|
56520
56803
|
type: "message",
|
|
56521
56804
|
role: "assistant",
|
|
56522
56805
|
model: params.model,
|
|
@@ -56546,7 +56829,7 @@ async function createURHQSubscriptionClient(providerId, options) {
|
|
|
56546
56829
|
async withResponse() {
|
|
56547
56830
|
const { response, data } = await requestPromise;
|
|
56548
56831
|
return {
|
|
56549
|
-
data,
|
|
56832
|
+
data: createOneShotMessageStream(data),
|
|
56550
56833
|
response,
|
|
56551
56834
|
request_id: data.id
|
|
56552
56835
|
};
|
|
@@ -56578,14 +56861,16 @@ function estimateTokenCount(params) {
|
|
|
56578
56861
|
const text = JSON.stringify(params.messages ?? []);
|
|
56579
56862
|
return Math.ceil(text.length / 4);
|
|
56580
56863
|
}
|
|
56581
|
-
var init_urhqSubscription = () => {
|
|
56864
|
+
var init_urhqSubscription = __esm(() => {
|
|
56865
|
+
init_streamingAdapters();
|
|
56866
|
+
});
|
|
56582
56867
|
|
|
56583
56868
|
// src/services/api/openrouter.ts
|
|
56584
56869
|
var exports_openrouter = {};
|
|
56585
56870
|
__export(exports_openrouter, {
|
|
56586
56871
|
createOpenRouterClient: () => createOpenRouterClient
|
|
56587
56872
|
});
|
|
56588
|
-
import { randomUUID as
|
|
56873
|
+
import { randomUUID as randomUUID6 } from "crypto";
|
|
56589
56874
|
async function createOpenRouterClient(options) {
|
|
56590
56875
|
const { apiKey, maxRetries } = options;
|
|
56591
56876
|
const OPENROUTER_BASE = "https://openrouter.ai/api/v1";
|
|
@@ -56611,7 +56896,7 @@ async function createOpenRouterClient(options) {
|
|
|
56611
56896
|
return {
|
|
56612
56897
|
response,
|
|
56613
56898
|
data: {
|
|
56614
|
-
id: `openrouter-${
|
|
56899
|
+
id: `openrouter-${randomUUID6()}`,
|
|
56615
56900
|
type: "message",
|
|
56616
56901
|
role: "assistant",
|
|
56617
56902
|
model: data.model,
|
|
@@ -56635,9 +56920,9 @@ async function createOpenRouterClient(options) {
|
|
|
56635
56920
|
async withResponse() {
|
|
56636
56921
|
const { response, data } = await requestPromise;
|
|
56637
56922
|
return {
|
|
56638
|
-
data,
|
|
56923
|
+
data: createOneShotMessageStream(data),
|
|
56639
56924
|
response,
|
|
56640
|
-
request_id: response.data?.id ?? response.headers?.["x-request-id"] ??
|
|
56925
|
+
request_id: response.data?.id ?? response.headers?.["x-request-id"] ?? randomUUID6()
|
|
56641
56926
|
};
|
|
56642
56927
|
}
|
|
56643
56928
|
};
|
|
@@ -56647,7 +56932,7 @@ async function createOpenRouterClient(options) {
|
|
|
56647
56932
|
withResponse: () => ({
|
|
56648
56933
|
data,
|
|
56649
56934
|
response,
|
|
56650
|
-
request_id: response.data?.id ?? response.headers?.["x-request-id"] ??
|
|
56935
|
+
request_id: response.data?.id ?? response.headers?.["x-request-id"] ?? randomUUID6()
|
|
56651
56936
|
})
|
|
56652
56937
|
}));
|
|
56653
56938
|
},
|
|
@@ -56669,6 +56954,7 @@ function estimateTokenCount2(params) {
|
|
|
56669
56954
|
}
|
|
56670
56955
|
var init_openrouter = __esm(() => {
|
|
56671
56956
|
init_axios2();
|
|
56957
|
+
init_streamingAdapters();
|
|
56672
56958
|
});
|
|
56673
56959
|
|
|
56674
56960
|
// src/services/api/standardAPI.ts
|
|
@@ -56676,7 +56962,7 @@ var exports_standardAPI = {};
|
|
|
56676
56962
|
__export(exports_standardAPI, {
|
|
56677
56963
|
createStandardAPIClient: () => createStandardAPIClient
|
|
56678
56964
|
});
|
|
56679
|
-
import { randomUUID as
|
|
56965
|
+
import { randomUUID as randomUUID7 } from "crypto";
|
|
56680
56966
|
async function createStandardAPIClient(options) {
|
|
56681
56967
|
const { providerId, apiKey, baseUrl, maxRetries } = options;
|
|
56682
56968
|
async function doRequest(params, extraHeaders) {
|
|
@@ -56701,9 +56987,9 @@ async function createStandardAPIClient(options) {
|
|
|
56701
56987
|
async withResponse() {
|
|
56702
56988
|
const { response, data } = await requestPromise;
|
|
56703
56989
|
return {
|
|
56704
|
-
data,
|
|
56990
|
+
data: createOneShotMessageStream(data),
|
|
56705
56991
|
response,
|
|
56706
|
-
request_id: response.data?.id ?? response.headers?.["x-request-id"] ??
|
|
56992
|
+
request_id: response.data?.id ?? response.headers?.["x-request-id"] ?? randomUUID7()
|
|
56707
56993
|
};
|
|
56708
56994
|
}
|
|
56709
56995
|
};
|
|
@@ -56713,7 +56999,7 @@ async function createStandardAPIClient(options) {
|
|
|
56713
56999
|
withResponse: () => ({
|
|
56714
57000
|
data,
|
|
56715
57001
|
response,
|
|
56716
|
-
request_id: response.data?.id ?? response.headers?.["x-request-id"] ??
|
|
57002
|
+
request_id: response.data?.id ?? response.headers?.["x-request-id"] ?? randomUUID7()
|
|
56717
57003
|
})
|
|
56718
57004
|
}));
|
|
56719
57005
|
},
|
|
@@ -56746,7 +57032,7 @@ function buildAPIRequest(providerId, params) {
|
|
|
56746
57032
|
case "openai-api":
|
|
56747
57033
|
return {
|
|
56748
57034
|
model: params.model,
|
|
56749
|
-
messages: params
|
|
57035
|
+
messages: toOpenAIMessages2(params),
|
|
56750
57036
|
max_tokens: params.max_tokens,
|
|
56751
57037
|
stream: false
|
|
56752
57038
|
};
|
|
@@ -56761,11 +57047,53 @@ function buildAPIRequest(providerId, params) {
|
|
|
56761
57047
|
return params;
|
|
56762
57048
|
}
|
|
56763
57049
|
}
|
|
57050
|
+
function toOpenAIMessages2(params) {
|
|
57051
|
+
const messages = [];
|
|
57052
|
+
const system = systemToText3(params.system);
|
|
57053
|
+
if (system) {
|
|
57054
|
+
messages.push({ role: "system", content: system });
|
|
57055
|
+
}
|
|
57056
|
+
for (const message of params.messages ?? []) {
|
|
57057
|
+
messages.push({
|
|
57058
|
+
role: message.role,
|
|
57059
|
+
content: contentToText2(message.content)
|
|
57060
|
+
});
|
|
57061
|
+
}
|
|
57062
|
+
return messages;
|
|
57063
|
+
}
|
|
57064
|
+
function systemToText3(system) {
|
|
57065
|
+
if (!system)
|
|
57066
|
+
return "";
|
|
57067
|
+
if (typeof system === "string")
|
|
57068
|
+
return system;
|
|
57069
|
+
if (Array.isArray(system)) {
|
|
57070
|
+
return system.map((block) => block?.text ?? "").join(`
|
|
57071
|
+
|
|
57072
|
+
`);
|
|
57073
|
+
}
|
|
57074
|
+
return "";
|
|
57075
|
+
}
|
|
57076
|
+
function contentToText2(content) {
|
|
57077
|
+
if (typeof content === "string")
|
|
57078
|
+
return content;
|
|
57079
|
+
if (!Array.isArray(content))
|
|
57080
|
+
return "";
|
|
57081
|
+
return content.map((block) => {
|
|
57082
|
+
if (typeof block === "string")
|
|
57083
|
+
return block;
|
|
57084
|
+
if (block?.type === "text")
|
|
57085
|
+
return block.text ?? "";
|
|
57086
|
+
if (block?.type === "tool_result")
|
|
57087
|
+
return block.content ?? "";
|
|
57088
|
+
return "";
|
|
57089
|
+
}).join(`
|
|
57090
|
+
`);
|
|
57091
|
+
}
|
|
56764
57092
|
function parseAPIResponse(providerId, data) {
|
|
56765
57093
|
switch (providerId) {
|
|
56766
57094
|
case "openai-api":
|
|
56767
57095
|
return {
|
|
56768
|
-
id: `openai-${
|
|
57096
|
+
id: `openai-${randomUUID7()}`,
|
|
56769
57097
|
type: "message",
|
|
56770
57098
|
role: "assistant",
|
|
56771
57099
|
model: data.model,
|
|
@@ -56805,85 +57133,158 @@ function estimateTokenCount3(params) {
|
|
|
56805
57133
|
}
|
|
56806
57134
|
var init_standardAPI = __esm(() => {
|
|
56807
57135
|
init_axios2();
|
|
57136
|
+
init_streamingAdapters();
|
|
56808
57137
|
});
|
|
56809
57138
|
|
|
56810
|
-
// src/services/api/
|
|
56811
|
-
|
|
56812
|
-
|
|
56813
|
-
maxRetries,
|
|
56814
|
-
model,
|
|
56815
|
-
fetchOverride,
|
|
56816
|
-
source
|
|
56817
|
-
}) {
|
|
56818
|
-
const settings = getInitialSettings();
|
|
57139
|
+
// src/services/api/providerClient.ts
|
|
57140
|
+
function resolveActiveProviderModel(options = {}) {
|
|
57141
|
+
const settings = options.settings ?? getInitialSettings();
|
|
56819
57142
|
const providerSettings = getActiveProviderSettings(settings);
|
|
56820
|
-
const
|
|
56821
|
-
const provider = getProviderDefinition(
|
|
57143
|
+
const providerId = providerSettings.active ?? "ollama";
|
|
57144
|
+
const provider = getProviderDefinition(providerId);
|
|
56822
57145
|
if (!provider) {
|
|
56823
|
-
throw new Error(`Provider "${
|
|
57146
|
+
throw new Error(`Provider "${providerId}" is selected, but no runtime provider is registered. Run: ur provider list`);
|
|
56824
57147
|
}
|
|
57148
|
+
const configuredModel = providerSettings.model;
|
|
57149
|
+
const defaultModel = getDefaultModelForProvider(providerId);
|
|
57150
|
+
const model = options.model ?? configuredModel ?? defaultModel;
|
|
57151
|
+
const modelSelectionSource = options.model ? "requested" : configuredModel ? "configured" : "default";
|
|
57152
|
+
if (!model) {
|
|
57153
|
+
throw new Error(`Provider "${providerId}" is selected, but no model is selected or discoverable. Run /model and choose a model from ${providerId}.`);
|
|
57154
|
+
}
|
|
57155
|
+
const validation = validateProviderModelPair(providerId, model, {
|
|
57156
|
+
allowUncachedDynamic: providerId === "ollama" && !configuredModel
|
|
57157
|
+
});
|
|
57158
|
+
if (validation.valid === false) {
|
|
57159
|
+
throw new Error(formatRuntimeDispatchError({
|
|
57160
|
+
providerId,
|
|
57161
|
+
model,
|
|
57162
|
+
why: validation.error,
|
|
57163
|
+
validModels: validation.validModels,
|
|
57164
|
+
suggestedModel: validation.suggestedModel
|
|
57165
|
+
}));
|
|
57166
|
+
}
|
|
57167
|
+
return {
|
|
57168
|
+
providerId,
|
|
57169
|
+
providerName: provider.displayName,
|
|
57170
|
+
accessType: provider.accessType,
|
|
57171
|
+
accessTypeLabel: getProviderAccessTypeLabel(provider),
|
|
57172
|
+
credentialType: provider.credentialType,
|
|
57173
|
+
model,
|
|
57174
|
+
modelSelectionSource,
|
|
57175
|
+
runtimeBackend: getProviderRuntimeBackend(providerId)
|
|
57176
|
+
};
|
|
57177
|
+
}
|
|
57178
|
+
function formatRuntimeDispatchError({
|
|
57179
|
+
providerId,
|
|
57180
|
+
model,
|
|
57181
|
+
why,
|
|
57182
|
+
validModels,
|
|
57183
|
+
suggestedModel
|
|
57184
|
+
}) {
|
|
57185
|
+
const provider = resolveProviderId(providerId) ?? String(providerId);
|
|
57186
|
+
const valid = validModels?.length ? validModels.join(", ") : getValidModelIdsForProvider(provider).join(", ") || "(no models discovered)";
|
|
57187
|
+
const suggestion = suggestedModel ?? getDefaultModelForProvider(provider) ?? "<valid-model>";
|
|
57188
|
+
return `Provider "${provider}" is selected with model "${model}", but runtime dispatch cannot use that provider/model pair. Reason: ${why}. Valid models for ${provider}: ${valid}. Run /model and choose a model from ${provider}, or run: ur config set model ${suggestion}`;
|
|
57189
|
+
}
|
|
57190
|
+
async function createProviderClient(providerId, options = {}) {
|
|
57191
|
+
const resolved = resolveProviderId(providerId);
|
|
57192
|
+
if (!resolved) {
|
|
57193
|
+
throw new Error(`Unknown provider: ${providerId}`);
|
|
57194
|
+
}
|
|
57195
|
+
const provider = getProviderDefinition(resolved);
|
|
57196
|
+
let client;
|
|
56825
57197
|
switch (provider.accessType) {
|
|
56826
57198
|
case "local":
|
|
56827
|
-
|
|
57199
|
+
client = await createLocalProviderClient(resolved, options);
|
|
57200
|
+
break;
|
|
57201
|
+
case "server":
|
|
57202
|
+
client = await createOpenAICompatibleProviderClient(resolved, options);
|
|
57203
|
+
break;
|
|
56828
57204
|
case "subscription":
|
|
56829
|
-
|
|
57205
|
+
client = await createSubscriptionClient(resolved, options);
|
|
57206
|
+
break;
|
|
56830
57207
|
case "api":
|
|
56831
|
-
|
|
57208
|
+
if (provider.endpointKind === "openai-compatible") {
|
|
57209
|
+
client = await createOpenAICompatibleProviderClient(resolved, options);
|
|
57210
|
+
} else {
|
|
57211
|
+
client = await createAPIClient(resolved, options);
|
|
57212
|
+
}
|
|
57213
|
+
break;
|
|
56832
57214
|
default:
|
|
56833
|
-
throw new Error(`Unsupported provider access type: ${provider.accessType}
|
|
57215
|
+
throw new Error(`Unsupported provider access type: ${provider.accessType}`);
|
|
56834
57216
|
}
|
|
57217
|
+
return tagClient(client, resolved);
|
|
56835
57218
|
}
|
|
56836
|
-
|
|
56837
|
-
|
|
56838
|
-
|
|
56839
|
-
|
|
57219
|
+
function tagClient(client, providerId) {
|
|
57220
|
+
Object.defineProperties(client, {
|
|
57221
|
+
__urProviderId: { value: providerId, enumerable: false },
|
|
57222
|
+
__urRuntimeBackend: {
|
|
57223
|
+
value: getProviderRuntimeBackend(providerId),
|
|
57224
|
+
enumerable: false
|
|
57225
|
+
}
|
|
57226
|
+
});
|
|
57227
|
+
return client;
|
|
57228
|
+
}
|
|
57229
|
+
async function createLocalProviderClient(providerId, options = {}) {
|
|
57230
|
+
if (providerId !== "ollama") {
|
|
57231
|
+
throw new Error(`Provider "${providerId}" is not an Ollama runtime. Runtime backend is ${getProviderRuntimeBackend(providerId)}.`);
|
|
56840
57232
|
}
|
|
57233
|
+
const { createOllamaURHQClient: createOllamaURHQClient2 } = await Promise.resolve().then(() => (init_ollama(), exports_ollama));
|
|
57234
|
+
return createOllamaURHQClient2();
|
|
57235
|
+
}
|
|
57236
|
+
async function createOpenAICompatibleProviderClient(providerId, options = {}) {
|
|
56841
57237
|
const settings = getInitialSettings();
|
|
56842
57238
|
const providerSettings = getActiveProviderSettings(settings);
|
|
56843
57239
|
const provider = getProviderDefinition(providerId);
|
|
56844
|
-
const baseUrl = providerSettings.baseUrl ?? provider.defaultBaseUrl;
|
|
57240
|
+
const baseUrl = providerSettings.active === providerId ? providerSettings.baseUrl ?? provider.defaultBaseUrl : provider.defaultBaseUrl;
|
|
56845
57241
|
if (!baseUrl) {
|
|
56846
57242
|
throw new Error(`Provider "${providerId}" requires a base URL. Run: ur config set base_url <url>`);
|
|
56847
57243
|
}
|
|
56848
|
-
const
|
|
56849
|
-
const
|
|
56850
|
-
return
|
|
57244
|
+
const apiKey = options.apiKey ?? (provider.envKey ? process.env[provider.envKey] : undefined);
|
|
57245
|
+
const { createOpenAICompatibleClient: createOpenAICompatibleClient2 } = await Promise.resolve().then(() => (init_openaiCompatible(), exports_openaiCompatible));
|
|
57246
|
+
return createOpenAICompatibleClient2({
|
|
57247
|
+
baseUrl,
|
|
57248
|
+
apiKey,
|
|
57249
|
+
maxRetries: options.maxRetries ?? 3
|
|
57250
|
+
});
|
|
56851
57251
|
}
|
|
56852
|
-
async function createSubscriptionClient(providerId, options) {
|
|
57252
|
+
async function createSubscriptionClient(providerId, options = {}) {
|
|
56853
57253
|
const provider = getProviderDefinition(providerId);
|
|
56854
57254
|
const settings = getInitialSettings();
|
|
56855
57255
|
const providerSettings = getActiveProviderSettings(settings);
|
|
56856
57256
|
const { which: which2 } = await Promise.resolve().then(() => (init_which(), exports_which));
|
|
56857
|
-
|
|
56858
|
-
|
|
56859
|
-
if (!foundPath) {
|
|
57257
|
+
let commandPath = providerSettings.commandPath ?? null;
|
|
57258
|
+
if (!commandPath) {
|
|
56860
57259
|
for (const candidate of provider.commandCandidates ?? []) {
|
|
56861
|
-
|
|
56862
|
-
if (
|
|
57260
|
+
commandPath = await which2(candidate);
|
|
57261
|
+
if (commandPath)
|
|
56863
57262
|
break;
|
|
56864
57263
|
}
|
|
56865
57264
|
}
|
|
56866
|
-
if (!
|
|
56867
|
-
throw new Error(`Provider "${providerId}" CLI not found. Tried: ${provider.commandCandidates?.join(", ")}.
|
|
57265
|
+
if (!commandPath) {
|
|
57266
|
+
throw new Error(`Provider "${providerId}" is selected with model "${options.model ?? providerSettings.model ?? "unknown"}", but runtime backend "${getProviderRuntimeBackend(providerId)}" is unavailable. Official CLI not found. Tried: ${provider.commandCandidates?.join(", ") || providerId}. Run: ur provider doctor ${providerId}`);
|
|
56868
57267
|
}
|
|
56869
57268
|
const { createURHQSubscriptionClient: createURHQSubscriptionClient2 } = await Promise.resolve().then(() => (init_urhqSubscription(), exports_urhqSubscription));
|
|
56870
57269
|
return createURHQSubscriptionClient2(providerId, {
|
|
56871
|
-
commandPath
|
|
56872
|
-
maxRetries: options.maxRetries,
|
|
57270
|
+
commandPath,
|
|
57271
|
+
maxRetries: options.maxRetries ?? 3,
|
|
56873
57272
|
model: options.model
|
|
56874
57273
|
});
|
|
56875
57274
|
}
|
|
56876
|
-
async function createAPIClient(providerId, options) {
|
|
57275
|
+
async function createAPIClient(providerId, options = {}) {
|
|
56877
57276
|
const provider = getProviderDefinition(providerId);
|
|
57277
|
+
const settings = getInitialSettings();
|
|
57278
|
+
const providerSettings = getActiveProviderSettings(settings);
|
|
56878
57279
|
const apiKey = options.apiKey ?? process.env[provider.envKey ?? ""];
|
|
56879
57280
|
if (provider.envKey && !apiKey) {
|
|
56880
|
-
throw new Error(`Provider "${providerId}"
|
|
57281
|
+
throw new Error(`Provider "${providerId}" is selected with model "${options.model ?? providerSettings.model ?? "unknown"}", but runtime backend "${getProviderRuntimeBackend(providerId)}" is unavailable. API key ${provider.envKey} is not set. Run: ur provider doctor ${providerId}`);
|
|
56881
57282
|
}
|
|
56882
57283
|
if (providerId === "openrouter") {
|
|
56883
57284
|
const { createOpenRouterClient: createOpenRouterClient2 } = await Promise.resolve().then(() => (init_openrouter(), exports_openrouter));
|
|
56884
57285
|
return createOpenRouterClient2({
|
|
56885
57286
|
apiKey,
|
|
56886
|
-
maxRetries: options.maxRetries,
|
|
57287
|
+
maxRetries: options.maxRetries ?? 3,
|
|
56887
57288
|
model: options.model
|
|
56888
57289
|
});
|
|
56889
57290
|
}
|
|
@@ -56891,28 +57292,36 @@ async function createAPIClient(providerId, options) {
|
|
|
56891
57292
|
return createStandardAPIClient2({
|
|
56892
57293
|
providerId,
|
|
56893
57294
|
apiKey,
|
|
56894
|
-
|
|
57295
|
+
baseUrl: providerSettings.active === providerId ? providerSettings.baseUrl ?? provider.defaultBaseUrl : provider.defaultBaseUrl,
|
|
57296
|
+
maxRetries: options.maxRetries ?? 3,
|
|
56895
57297
|
model: options.model
|
|
56896
57298
|
});
|
|
56897
57299
|
}
|
|
56898
|
-
|
|
56899
|
-
|
|
56900
|
-
|
|
56901
|
-
|
|
56902
|
-
|
|
56903
|
-
|
|
56904
|
-
|
|
56905
|
-
|
|
56906
|
-
|
|
56907
|
-
|
|
56908
|
-
|
|
56909
|
-
|
|
56910
|
-
|
|
57300
|
+
var init_providerClient = __esm(() => {
|
|
57301
|
+
init_providerRegistry();
|
|
57302
|
+
init_settings2();
|
|
57303
|
+
});
|
|
57304
|
+
|
|
57305
|
+
// src/services/api/client.ts
|
|
57306
|
+
async function getURHQClient({
|
|
57307
|
+
apiKey,
|
|
57308
|
+
maxRetries,
|
|
57309
|
+
model,
|
|
57310
|
+
fetchOverride,
|
|
57311
|
+
source
|
|
57312
|
+
}) {
|
|
57313
|
+
const runtime = resolveActiveProviderModel({ model, source });
|
|
57314
|
+
return createProviderClient(runtime.providerId, {
|
|
57315
|
+
apiKey,
|
|
57316
|
+
maxRetries,
|
|
57317
|
+
model: runtime.model,
|
|
57318
|
+
fetchOverride,
|
|
57319
|
+
source
|
|
57320
|
+
});
|
|
56911
57321
|
}
|
|
56912
57322
|
var CLIENT_REQUEST_ID_HEADER = "x-client-request-id";
|
|
56913
57323
|
var init_client2 = __esm(() => {
|
|
56914
|
-
|
|
56915
|
-
init_settings2();
|
|
57324
|
+
init_providerClient();
|
|
56916
57325
|
});
|
|
56917
57326
|
|
|
56918
57327
|
// src/utils/lazySchema.ts
|
|
@@ -57000,6 +57409,7 @@ var init_modelCapabilities = __esm(() => {
|
|
|
57000
57409
|
init_envUtils();
|
|
57001
57410
|
init_json();
|
|
57002
57411
|
init_slowOperations();
|
|
57412
|
+
init_providers();
|
|
57003
57413
|
ModelCapabilitySchema = lazySchema(() => exports_external.object({
|
|
57004
57414
|
id: exports_external.string(),
|
|
57005
57415
|
max_input_tokens: exports_external.number().optional(),
|
|
@@ -57040,8 +57450,8 @@ function modelSupports1M(model) {
|
|
|
57040
57450
|
const canonical = getCanonicalName(model);
|
|
57041
57451
|
return canonical.includes("ur-modelS-4") || canonical.includes("modelO-4-6");
|
|
57042
57452
|
}
|
|
57043
|
-
function getContextWindowForModel(model, betas) {
|
|
57044
|
-
if (
|
|
57453
|
+
function getContextWindowForModel(model, betas, apiProvider = getAPIProvider()) {
|
|
57454
|
+
if (apiProvider === "ollama") {
|
|
57045
57455
|
const override = parseInt(process.env.OLLAMA_CONTEXT_TOKENS || "", 10);
|
|
57046
57456
|
if (!isNaN(override) && override > 0) {
|
|
57047
57457
|
return override;
|
|
@@ -57167,12 +57577,14 @@ var init_context = __esm(() => {
|
|
|
57167
57577
|
init_model();
|
|
57168
57578
|
init_modelCapabilities();
|
|
57169
57579
|
init_ollamaModels();
|
|
57580
|
+
init_providers();
|
|
57170
57581
|
});
|
|
57171
57582
|
|
|
57172
57583
|
// src/utils/model/modelSupportOverrides.ts
|
|
57173
57584
|
var TIERS, get3PModelCapabilityOverride;
|
|
57174
57585
|
var init_modelSupportOverrides = __esm(() => {
|
|
57175
57586
|
init_memoize();
|
|
57587
|
+
init_providers();
|
|
57176
57588
|
TIERS = [
|
|
57177
57589
|
{
|
|
57178
57590
|
modelEnvVar: "URHQ_DEFAULT_MODELO_MODEL",
|
|
@@ -57326,6 +57738,7 @@ var init_betas2 = __esm(() => {
|
|
|
57326
57738
|
init_envUtils();
|
|
57327
57739
|
init_model();
|
|
57328
57740
|
init_modelSupportOverrides();
|
|
57741
|
+
init_providers();
|
|
57329
57742
|
init_settings2();
|
|
57330
57743
|
ALLOWED_SDK_BETAS = [CONTEXT_1M_BETA_HEADER];
|
|
57331
57744
|
getAllModelBetas = memoize_default((model) => {
|
|
@@ -58720,7 +59133,7 @@ var require_gaxios = __commonJS((exports) => {
|
|
|
58720
59133
|
var retry_js_1 = require_retry2();
|
|
58721
59134
|
var stream_1 = __require("stream");
|
|
58722
59135
|
var interceptor_js_1 = require_interceptor();
|
|
58723
|
-
var
|
|
59136
|
+
var randomUUID8 = async () => globalThis.crypto?.randomUUID() || (await import("crypto")).randomUUID();
|
|
58724
59137
|
var HTTP_STATUS_NO_CONTENT = 204;
|
|
58725
59138
|
|
|
58726
59139
|
class Gaxios {
|
|
@@ -58931,7 +59344,7 @@ var require_gaxios = __commonJS((exports) => {
|
|
|
58931
59344
|
}
|
|
58932
59345
|
const shouldDirectlyPassData = typeof opts.data === "string" || opts.data instanceof ArrayBuffer || opts.data instanceof Blob || globalThis.File && opts.data instanceof File || opts.data instanceof FormData || opts.data instanceof stream_1.Readable || opts.data instanceof ReadableStream || opts.data instanceof String || opts.data instanceof URLSearchParams || ArrayBuffer.isView(opts.data) || ["Blob", "File", "FormData"].includes(opts.data?.constructor?.name || "");
|
|
58933
59346
|
if (opts.multipart?.length) {
|
|
58934
|
-
const boundary = await
|
|
59347
|
+
const boundary = await randomUUID8();
|
|
58935
59348
|
preparedHeaders.set("content-type", `multipart/related; boundary=${boundary}`);
|
|
58936
59349
|
opts.body = stream_1.Readable.from(this.getMultipartRequest(opts.multipart, boundary));
|
|
58937
59350
|
} else if (shouldDirectlyPassData) {
|
|
@@ -68542,6 +68955,7 @@ var init_auth = __esm(() => {
|
|
|
68542
68955
|
init_oauth();
|
|
68543
68956
|
init_analytics();
|
|
68544
68957
|
init_modelStrings();
|
|
68958
|
+
init_providers();
|
|
68545
68959
|
init_state();
|
|
68546
68960
|
init_mockRateLimits();
|
|
68547
68961
|
init_client();
|
|
@@ -68649,7 +69063,7 @@ var init_auth = __esm(() => {
|
|
|
68649
69063
|
|
|
68650
69064
|
// src/utils/userAgent.ts
|
|
68651
69065
|
function getURCodeUserAgent() {
|
|
68652
|
-
return `ur/${"1.27.
|
|
69066
|
+
return `ur/${"1.27.6"}`;
|
|
68653
69067
|
}
|
|
68654
69068
|
|
|
68655
69069
|
// src/utils/workloadContext.ts
|
|
@@ -68671,7 +69085,7 @@ function getUserAgent() {
|
|
|
68671
69085
|
const clientApp = process.env.UR_AGENT_SDK_CLIENT_APP ? `, client-app/${process.env.UR_AGENT_SDK_CLIENT_APP}` : "";
|
|
68672
69086
|
const workload = getWorkload();
|
|
68673
69087
|
const workloadSuffix = workload ? `, workload/${workload}` : "";
|
|
68674
|
-
return `ur-cli/${"1.27.
|
|
69088
|
+
return `ur-cli/${"1.27.6"} (${process.env.USER_TYPE}, ${process.env.UR_CODE_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
|
|
68675
69089
|
}
|
|
68676
69090
|
function getMCPUserAgent() {
|
|
68677
69091
|
const parts = [];
|
|
@@ -68685,7 +69099,7 @@ function getMCPUserAgent() {
|
|
|
68685
69099
|
parts.push(`client-app/${process.env.UR_AGENT_SDK_CLIENT_APP}`);
|
|
68686
69100
|
}
|
|
68687
69101
|
const suffix = parts.length > 0 ? ` (${parts.join(", ")})` : "";
|
|
68688
|
-
return `ur/${"1.27.
|
|
69102
|
+
return `ur/${"1.27.6"}${suffix}`;
|
|
68689
69103
|
}
|
|
68690
69104
|
function getWebFetchUserAgent() {
|
|
68691
69105
|
return `UR-User (${getURCodeUserAgent()})`;
|
|
@@ -68823,7 +69237,7 @@ var init_user = __esm(() => {
|
|
|
68823
69237
|
deviceId,
|
|
68824
69238
|
sessionId: getSessionId(),
|
|
68825
69239
|
email: getEmail(),
|
|
68826
|
-
appVersion: "1.27.
|
|
69240
|
+
appVersion: "1.27.6",
|
|
68827
69241
|
platform: getHostPlatformForAnalytics(),
|
|
68828
69242
|
organizationUuid,
|
|
68829
69243
|
accountUuid,
|
|
@@ -75340,7 +75754,7 @@ var init_metadata = __esm(() => {
|
|
|
75340
75754
|
COMPOUND_OPERATOR_REGEX = /\s*(?:&&|\|\||[;|])\s*/;
|
|
75341
75755
|
WHITESPACE_REGEX = /\s+/;
|
|
75342
75756
|
getVersionBase = memoize_default(() => {
|
|
75343
|
-
const match = "1.27.
|
|
75757
|
+
const match = "1.27.6".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
|
|
75344
75758
|
return match ? match[0] : undefined;
|
|
75345
75759
|
});
|
|
75346
75760
|
buildEnvContext = memoize_default(async () => {
|
|
@@ -75380,7 +75794,7 @@ var init_metadata = __esm(() => {
|
|
|
75380
75794
|
isGithubAction: isEnvTruthy(process.env.GITHUB_ACTIONS),
|
|
75381
75795
|
isURCodeAction: isEnvTruthy(process.env.UR_CODE_ACTION),
|
|
75382
75796
|
isURAiAuth: isURAISubscriber2(),
|
|
75383
|
-
version: "1.27.
|
|
75797
|
+
version: "1.27.6",
|
|
75384
75798
|
versionBase: getVersionBase(),
|
|
75385
75799
|
buildTime: "",
|
|
75386
75800
|
deploymentEnvironment: env2.detectDeploymentEnvironment(),
|
|
@@ -75398,7 +75812,7 @@ var init_metadata = __esm(() => {
|
|
|
75398
75812
|
});
|
|
75399
75813
|
|
|
75400
75814
|
// src/services/analytics/firstPartyEventLoggingExporter.ts
|
|
75401
|
-
import { randomUUID as
|
|
75815
|
+
import { randomUUID as randomUUID8 } from "crypto";
|
|
75402
75816
|
import { appendFile as appendFile2, mkdir as mkdir4, readdir as readdir4, unlink as unlink2, writeFile as writeFile2 } from "fs/promises";
|
|
75403
75817
|
import * as path8 from "path";
|
|
75404
75818
|
function getStorageDir() {
|
|
@@ -75889,7 +76303,7 @@ var init_firstPartyEventLoggingExporter = __esm(() => {
|
|
|
75889
76303
|
init_client();
|
|
75890
76304
|
init_analytics();
|
|
75891
76305
|
init_metadata();
|
|
75892
|
-
BATCH_UUID =
|
|
76306
|
+
BATCH_UUID = randomUUID8();
|
|
75893
76307
|
});
|
|
75894
76308
|
|
|
75895
76309
|
// src/services/analytics/sinkKillswitch.ts
|
|
@@ -75914,7 +76328,7 @@ __export(exports_firstPartyEventLogger, {
|
|
|
75914
76328
|
initialize1PEventLogging: () => initialize1PEventLogging,
|
|
75915
76329
|
getEventSamplingConfig: () => getEventSamplingConfig
|
|
75916
76330
|
});
|
|
75917
|
-
import { randomUUID as
|
|
76331
|
+
import { randomUUID as randomUUID9 } from "crypto";
|
|
75918
76332
|
function getEventSamplingConfig() {
|
|
75919
76333
|
return getDynamicConfig_CACHED_MAY_BE_STALE(EVENT_SAMPLING_CONFIG_NAME, {});
|
|
75920
76334
|
}
|
|
@@ -75961,7 +76375,7 @@ async function logEventTo1PAsync(firstPartyEventLogger2, eventName, metadata = {
|
|
|
75961
76375
|
});
|
|
75962
76376
|
const attributes = {
|
|
75963
76377
|
event_name: eventName,
|
|
75964
|
-
event_id:
|
|
76378
|
+
event_id: randomUUID9(),
|
|
75965
76379
|
core_metadata: coreMetadata,
|
|
75966
76380
|
user_metadata: getCoreUserData(true),
|
|
75967
76381
|
event_metadata: metadata
|
|
@@ -76009,7 +76423,7 @@ function logGrowthBookExperimentTo1P(data) {
|
|
|
76009
76423
|
const { accountUuid, organizationUuid } = getCoreUserData(true);
|
|
76010
76424
|
const attributes = {
|
|
76011
76425
|
event_type: "GrowthbookExperimentEvent",
|
|
76012
|
-
event_id:
|
|
76426
|
+
event_id: randomUUID9(),
|
|
76013
76427
|
experiment_id: data.experimentId,
|
|
76014
76428
|
variation_id: data.variationId,
|
|
76015
76429
|
...userId && { device_id: userId },
|
|
@@ -76050,7 +76464,7 @@ function initialize1PEventLogging() {
|
|
|
76050
76464
|
const platform2 = getPlatform();
|
|
76051
76465
|
const attributes = {
|
|
76052
76466
|
[import_semantic_conventions4.ATTR_SERVICE_NAME]: "ur",
|
|
76053
|
-
[import_semantic_conventions4.ATTR_SERVICE_VERSION]: "1.27.
|
|
76467
|
+
[import_semantic_conventions4.ATTR_SERVICE_VERSION]: "1.27.6"
|
|
76054
76468
|
};
|
|
76055
76469
|
if (platform2 === "wsl") {
|
|
76056
76470
|
const wslVersion = getWslVersion();
|
|
@@ -76077,7 +76491,7 @@ function initialize1PEventLogging() {
|
|
|
76077
76491
|
})
|
|
76078
76492
|
]
|
|
76079
76493
|
});
|
|
76080
|
-
firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.urhq.ur.events", "1.27.
|
|
76494
|
+
firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.urhq.ur.events", "1.27.6");
|
|
76081
76495
|
}
|
|
76082
76496
|
async function reinitialize1PEventLoggingIfConfigChanged() {
|
|
76083
76497
|
if (!is1PEventLoggingEnabled() || !firstPartyEventLoggerProvider) {
|
|
@@ -80404,7 +80818,7 @@ import {
|
|
|
80404
80818
|
writeFileSync as writeFileSync5
|
|
80405
80819
|
} from "fs";
|
|
80406
80820
|
import { join as join29, resolve as resolve10 } from "path";
|
|
80407
|
-
import { randomUUID as
|
|
80821
|
+
import { randomUUID as randomUUID10 } from "crypto";
|
|
80408
80822
|
function now2() {
|
|
80409
80823
|
return new Date().toISOString();
|
|
80410
80824
|
}
|
|
@@ -80458,7 +80872,7 @@ function updateTask(cwd2, id, fn) {
|
|
|
80458
80872
|
return task;
|
|
80459
80873
|
}
|
|
80460
80874
|
function makeId() {
|
|
80461
|
-
return `bg_${Date.now().toString(36)}_${
|
|
80875
|
+
return `bg_${Date.now().toString(36)}_${randomUUID10().slice(0, 8)}`;
|
|
80462
80876
|
}
|
|
80463
80877
|
function slug(input) {
|
|
80464
80878
|
return input.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 36) || "task";
|
|
@@ -80726,7 +81140,7 @@ function streamUserMessage(content, priority = "later") {
|
|
|
80726
81140
|
session_id: "",
|
|
80727
81141
|
message: { role: "user", content },
|
|
80728
81142
|
parent_tool_use_id: null,
|
|
80729
|
-
uuid:
|
|
81143
|
+
uuid: randomUUID10(),
|
|
80730
81144
|
priority
|
|
80731
81145
|
})}
|
|
80732
81146
|
`;
|
|
@@ -81101,7 +81515,7 @@ __export(exports_delegation, {
|
|
|
81101
81515
|
describeClaims: () => describeClaims,
|
|
81102
81516
|
attenuateDelegationToken: () => attenuateDelegationToken
|
|
81103
81517
|
});
|
|
81104
|
-
import { createHmac, randomUUID as
|
|
81518
|
+
import { createHmac, randomUUID as randomUUID11, timingSafeEqual } from "crypto";
|
|
81105
81519
|
function nowSeconds() {
|
|
81106
81520
|
return Math.floor(Date.now() / 1000);
|
|
81107
81521
|
}
|
|
@@ -81148,7 +81562,7 @@ function mintDelegationToken(secret, options) {
|
|
|
81148
81562
|
scope: normalizeScope(options.scope),
|
|
81149
81563
|
iat: issued,
|
|
81150
81564
|
exp: issued + Math.max(1, Math.floor(ttl)),
|
|
81151
|
-
jti: options.jti ??
|
|
81565
|
+
jti: options.jti ?? randomUUID11()
|
|
81152
81566
|
};
|
|
81153
81567
|
const payload = encodeJson(claims);
|
|
81154
81568
|
return `${payload}.${sign(secret, payload)}`;
|
|
@@ -81374,7 +81788,7 @@ function formatAgentTrendReport(report = buildAgentTrendReport()) {
|
|
|
81374
81788
|
function formatA2AAgentCard(options = {}, pretty = true) {
|
|
81375
81789
|
return JSON.stringify(buildA2AAgentCard(options), null, pretty ? 2 : 0);
|
|
81376
81790
|
}
|
|
81377
|
-
var urVersion = "1.27.
|
|
81791
|
+
var urVersion = "1.27.6", coverage, priorityRoadmap;
|
|
81378
81792
|
var init_trends = __esm(() => {
|
|
81379
81793
|
coverage = [
|
|
81380
81794
|
{
|
|
@@ -81666,7 +82080,7 @@ __export(exports_a2aServer, {
|
|
|
81666
82080
|
handleA2ARequest: () => handleA2ARequest,
|
|
81667
82081
|
authorizeRequest: () => authorizeRequest
|
|
81668
82082
|
});
|
|
81669
|
-
import { randomUUID as
|
|
82083
|
+
import { randomUUID as randomUUID12 } from "crypto";
|
|
81670
82084
|
import { existsSync as existsSync6, mkdirSync as mkdirSync6, readFileSync as readFileSync11, writeFileSync as writeFileSync6 } from "fs";
|
|
81671
82085
|
import { dirname as dirname14, join as join30 } from "path";
|
|
81672
82086
|
function jsonResponse(status, body) {
|
|
@@ -81735,7 +82149,7 @@ function saveA2AManifest(cwd2, manifest) {
|
|
|
81735
82149
|
`);
|
|
81736
82150
|
}
|
|
81737
82151
|
function createA2AId() {
|
|
81738
|
-
return `a2a_${Date.now().toString(36)}_${
|
|
82152
|
+
return `a2a_${Date.now().toString(36)}_${randomUUID12().slice(0, 8)}`;
|
|
81739
82153
|
}
|
|
81740
82154
|
function mapBackgroundStatus(status) {
|
|
81741
82155
|
switch (status) {
|
|
@@ -83206,6 +83620,7 @@ var init_datadog = __esm(() => {
|
|
|
83206
83620
|
init_config();
|
|
83207
83621
|
init_log2();
|
|
83208
83622
|
init_model();
|
|
83623
|
+
init_providers();
|
|
83209
83624
|
init_modelCost();
|
|
83210
83625
|
init_config2();
|
|
83211
83626
|
init_metadata();
|
|
@@ -83366,7 +83781,7 @@ function getAttributionHeader(fingerprint) {
|
|
|
83366
83781
|
if (!isAttributionHeaderEnabled()) {
|
|
83367
83782
|
return "";
|
|
83368
83783
|
}
|
|
83369
|
-
const version2 = `${"1.27.
|
|
83784
|
+
const version2 = `${"1.27.6"}.${fingerprint}`;
|
|
83370
83785
|
const entrypoint = process.env.UR_CODE_ENTRYPOINT ?? "unknown";
|
|
83371
83786
|
const cch = "";
|
|
83372
83787
|
const workload = getWorkload();
|
|
@@ -83380,6 +83795,7 @@ var init_system = __esm(() => {
|
|
|
83380
83795
|
init_growthbook();
|
|
83381
83796
|
init_debug();
|
|
83382
83797
|
init_envUtils();
|
|
83798
|
+
init_providers();
|
|
83383
83799
|
init_workloadContext();
|
|
83384
83800
|
CLI_SYSPROMPT_PREFIX_VALUES = [
|
|
83385
83801
|
DEFAULT_PREFIX,
|
|
@@ -126652,6 +127068,7 @@ var init_thinking = __esm(() => {
|
|
|
126652
127068
|
init_antModels();
|
|
126653
127069
|
init_model();
|
|
126654
127070
|
init_modelSupportOverrides();
|
|
127071
|
+
init_providers();
|
|
126655
127072
|
init_settings2();
|
|
126656
127073
|
RAINBOW_COLORS = [
|
|
126657
127074
|
"rainbow_red",
|
|
@@ -126850,6 +127267,7 @@ var init_effort = __esm(() => {
|
|
|
126850
127267
|
init_settings2();
|
|
126851
127268
|
init_auth();
|
|
126852
127269
|
init_growthbook();
|
|
127270
|
+
init_providers();
|
|
126853
127271
|
init_modelSupportOverrides();
|
|
126854
127272
|
init_envUtils();
|
|
126855
127273
|
EFFORT_LEVELS = [
|
|
@@ -139063,6 +139481,7 @@ var init_withRetry = __esm(() => {
|
|
|
139063
139481
|
init_debug();
|
|
139064
139482
|
init_log2();
|
|
139065
139483
|
init_messages();
|
|
139484
|
+
init_providers();
|
|
139066
139485
|
init_auth();
|
|
139067
139486
|
init_envUtils();
|
|
139068
139487
|
init_errors();
|
|
@@ -191035,7 +191454,7 @@ function getTelemetryAttributes() {
|
|
|
191035
191454
|
attributes["session.id"] = sessionId;
|
|
191036
191455
|
}
|
|
191037
191456
|
if (shouldIncludeAttribute("OTEL_METRICS_INCLUDE_VERSION")) {
|
|
191038
|
-
attributes["app.version"] = "1.27.
|
|
191457
|
+
attributes["app.version"] = "1.27.6";
|
|
191039
191458
|
}
|
|
191040
191459
|
const oauthAccount = getOauthAccountInfo();
|
|
191041
191460
|
if (oauthAccount) {
|
|
@@ -194271,7 +194690,7 @@ __export(exports_commitAttribution, {
|
|
|
194271
194690
|
buildSurfaceKey: () => buildSurfaceKey,
|
|
194272
194691
|
attributionRestoreStateFromLog: () => attributionRestoreStateFromLog
|
|
194273
194692
|
});
|
|
194274
|
-
import { createHash as createHash7, randomUUID as
|
|
194693
|
+
import { createHash as createHash7, randomUUID as randomUUID13 } from "crypto";
|
|
194275
194694
|
import { stat as stat15 } from "fs/promises";
|
|
194276
194695
|
import { isAbsolute as isAbsolute10, join as join52, relative as relative9, sep as sep10 } from "path";
|
|
194277
194696
|
function getAttributionRepoRoot() {
|
|
@@ -194705,7 +195124,7 @@ function incrementPromptCount(attribution, saveSnapshot) {
|
|
|
194705
195124
|
...attribution,
|
|
194706
195125
|
promptCount: attribution.promptCount + 1
|
|
194707
195126
|
};
|
|
194708
|
-
const snapshot2 = stateToSnapshotMessage(newAttribution,
|
|
195127
|
+
const snapshot2 = stateToSnapshotMessage(newAttribution, randomUUID13());
|
|
194709
195128
|
saveSnapshot(snapshot2);
|
|
194710
195129
|
return newAttribution;
|
|
194711
195130
|
}
|
|
@@ -199988,7 +200407,7 @@ var init_queryHelpers = __esm(() => {
|
|
|
199988
200407
|
});
|
|
199989
200408
|
|
|
199990
200409
|
// src/services/PromptSuggestion/speculation.ts
|
|
199991
|
-
import { randomUUID as
|
|
200410
|
+
import { randomUUID as randomUUID14 } from "crypto";
|
|
199992
200411
|
import { rm as rm2 } from "fs";
|
|
199993
200412
|
import { appendFile as appendFile4, copyFile, mkdir as mkdir6 } from "fs/promises";
|
|
199994
200413
|
import { dirname as dirname26, isAbsolute as isAbsolute12, join as join53, relative as relative10 } from "path";
|
|
@@ -200178,7 +200597,7 @@ async function startSpeculation(suggestionText, context3, setAppState, isPipelin
|
|
|
200178
200597
|
if (!isSpeculationEnabled())
|
|
200179
200598
|
return;
|
|
200180
200599
|
abortSpeculation(setAppState);
|
|
200181
|
-
const id =
|
|
200600
|
+
const id = randomUUID14().slice(0, 8);
|
|
200182
200601
|
const abortController = createChildAbortController(context3.toolUseContext.abortController);
|
|
200183
200602
|
if (abortController.signal.aborted)
|
|
200184
200603
|
return;
|
|
@@ -200559,7 +200978,7 @@ var init_speculation = __esm(() => {
|
|
|
200559
200978
|
});
|
|
200560
200979
|
|
|
200561
200980
|
// src/utils/sdkEventQueue.ts
|
|
200562
|
-
import { randomUUID as
|
|
200981
|
+
import { randomUUID as randomUUID15 } from "crypto";
|
|
200563
200982
|
function enqueueSdkEvent(event) {
|
|
200564
200983
|
if (!getIsNonInteractiveSession()) {
|
|
200565
200984
|
return;
|
|
@@ -200576,7 +200995,7 @@ function drainSdkEvents() {
|
|
|
200576
200995
|
const events = queue.splice(0);
|
|
200577
200996
|
return events.map((e) => ({
|
|
200578
200997
|
...e,
|
|
200579
|
-
uuid:
|
|
200998
|
+
uuid: randomUUID15(),
|
|
200580
200999
|
session_id: getSessionId()
|
|
200581
201000
|
}));
|
|
200582
201001
|
}
|
|
@@ -222550,7 +222969,7 @@ var init_xaaIdpLogin = __esm(() => {
|
|
|
222550
222969
|
});
|
|
222551
222970
|
|
|
222552
222971
|
// src/services/mcp/auth.ts
|
|
222553
|
-
import { createHash as createHash9, randomBytes as randomBytes4, randomUUID as
|
|
222972
|
+
import { createHash as createHash9, randomBytes as randomBytes4, randomUUID as randomUUID16 } from "crypto";
|
|
222554
222973
|
import { mkdir as mkdir7 } from "fs/promises";
|
|
222555
222974
|
import { createServer as createServer3 } from "http";
|
|
222556
222975
|
import { join as join60 } from "path";
|
|
@@ -222968,7 +223387,7 @@ async function performMCPOAuthFlow(serverName, serverConfig, onAuthorizationUrl,
|
|
|
222968
223387
|
scope: cachedStepUpScope,
|
|
222969
223388
|
resourceMetadataUrl
|
|
222970
223389
|
};
|
|
222971
|
-
const flowAttemptId =
|
|
223390
|
+
const flowAttemptId = randomUUID16();
|
|
222972
223391
|
logEvent("tengu_mcp_oauth_flow_start", {
|
|
222973
223392
|
flowAttemptId,
|
|
222974
223393
|
isOAuthFlow: true,
|
|
@@ -226437,7 +226856,7 @@ function getInstallationEnv() {
|
|
|
226437
226856
|
return;
|
|
226438
226857
|
}
|
|
226439
226858
|
function getURCodeVersion() {
|
|
226440
|
-
return "1.27.
|
|
226859
|
+
return "1.27.6";
|
|
226441
226860
|
}
|
|
226442
226861
|
async function getInstalledVSCodeExtensionVersion(command) {
|
|
226443
226862
|
const { stdout } = await execFileNoThrow(command, ["--list-extensions", "--show-versions"], {
|
|
@@ -229276,7 +229695,7 @@ async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) {
|
|
|
229276
229695
|
const client2 = new Client({
|
|
229277
229696
|
name: "ur",
|
|
229278
229697
|
title: "UR",
|
|
229279
|
-
version: "1.27.
|
|
229698
|
+
version: "1.27.6",
|
|
229280
229699
|
description: "UR-AGENT autonomous engineering workflow engine",
|
|
229281
229700
|
websiteUrl: PRODUCT_URL
|
|
229282
229701
|
}, {
|
|
@@ -229630,7 +230049,7 @@ var init_client5 = __esm(() => {
|
|
|
229630
230049
|
const client2 = new Client({
|
|
229631
230050
|
name: "ur",
|
|
229632
230051
|
title: "UR",
|
|
229633
|
-
version: "1.27.
|
|
230052
|
+
version: "1.27.6",
|
|
229634
230053
|
description: "UR-AGENT autonomous engineering workflow engine",
|
|
229635
230054
|
websiteUrl: PRODUCT_URL
|
|
229636
230055
|
}, {
|
|
@@ -230773,6 +231192,7 @@ var init_agent = __esm(() => {
|
|
|
230773
231192
|
init_aliases();
|
|
230774
231193
|
init_bedrock();
|
|
230775
231194
|
init_model();
|
|
231195
|
+
init_providers();
|
|
230776
231196
|
AGENT_MODEL_OPTIONS = [...MODEL_ALIASES, "inherit"];
|
|
230777
231197
|
});
|
|
230778
231198
|
|
|
@@ -234292,6 +234712,7 @@ var init_policyLimits = __esm(() => {
|
|
|
234292
234712
|
init_envUtils();
|
|
234293
234713
|
init_errors();
|
|
234294
234714
|
init_json();
|
|
234715
|
+
init_providers();
|
|
234295
234716
|
init_slowOperations();
|
|
234296
234717
|
init_withRetry();
|
|
234297
234718
|
init_types6();
|
|
@@ -238490,6 +238911,7 @@ var cached2;
|
|
|
238490
238911
|
var init_syncCache = __esm(() => {
|
|
238491
238912
|
init_oauth();
|
|
238492
238913
|
init_auth();
|
|
238914
|
+
init_providers();
|
|
238493
238915
|
init_syncCacheState();
|
|
238494
238916
|
});
|
|
238495
238917
|
|
|
@@ -239443,9 +239865,9 @@ async function assertMinVersion() {
|
|
|
239443
239865
|
if (false) {}
|
|
239444
239866
|
try {
|
|
239445
239867
|
const versionConfig = await getDynamicConfig_BLOCKS_ON_INIT("tengu_version_config", { minVersion: "0.0.0" });
|
|
239446
|
-
if (versionConfig.minVersion && lt("1.27.
|
|
239868
|
+
if (versionConfig.minVersion && lt("1.27.6", versionConfig.minVersion)) {
|
|
239447
239869
|
console.error(`
|
|
239448
|
-
It looks like your version of UR (${"1.27.
|
|
239870
|
+
It looks like your version of UR (${"1.27.6"}) needs an update.
|
|
239449
239871
|
A newer version (${versionConfig.minVersion} or higher) is required to continue.
|
|
239450
239872
|
|
|
239451
239873
|
To update, please run:
|
|
@@ -239661,7 +240083,7 @@ async function installGlobalPackage(specificVersion) {
|
|
|
239661
240083
|
logError2(new AutoUpdaterError("Another process is currently installing an update"));
|
|
239662
240084
|
logEvent("tengu_auto_updater_lock_contention", {
|
|
239663
240085
|
pid: process.pid,
|
|
239664
|
-
currentVersion: "1.27.
|
|
240086
|
+
currentVersion: "1.27.6"
|
|
239665
240087
|
});
|
|
239666
240088
|
return "in_progress";
|
|
239667
240089
|
}
|
|
@@ -239670,7 +240092,7 @@ async function installGlobalPackage(specificVersion) {
|
|
|
239670
240092
|
if (!env2.isRunningWithBun() && env2.isNpmFromWindowsPath()) {
|
|
239671
240093
|
logError2(new Error("Windows NPM detected in WSL environment"));
|
|
239672
240094
|
logEvent("tengu_auto_updater_windows_npm_in_wsl", {
|
|
239673
|
-
currentVersion: "1.27.
|
|
240095
|
+
currentVersion: "1.27.6"
|
|
239674
240096
|
});
|
|
239675
240097
|
console.error(`
|
|
239676
240098
|
Error: Windows NPM detected in WSL
|
|
@@ -240205,7 +240627,7 @@ function detectLinuxGlobPatternWarnings() {
|
|
|
240205
240627
|
}
|
|
240206
240628
|
async function getDoctorDiagnostic() {
|
|
240207
240629
|
const installationType = await getCurrentInstallationType();
|
|
240208
|
-
const version2 = typeof MACRO !== "undefined" ? "1.27.
|
|
240630
|
+
const version2 = typeof MACRO !== "undefined" ? "1.27.6" : "unknown";
|
|
240209
240631
|
const installationPath = await getInstallationPath();
|
|
240210
240632
|
const invokedBinary = getInvokedBinary();
|
|
240211
240633
|
const multipleInstallations = await detectMultipleInstallations();
|
|
@@ -241140,8 +241562,8 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
|
|
|
241140
241562
|
const maxVersion = await getMaxVersion();
|
|
241141
241563
|
if (maxVersion && gt(version2, maxVersion)) {
|
|
241142
241564
|
logForDebugging(`Native installer: maxVersion ${maxVersion} is set, capping update from ${version2} to ${maxVersion}`);
|
|
241143
|
-
if (gte("1.27.
|
|
241144
|
-
logForDebugging(`Native installer: current version ${"1.27.
|
|
241565
|
+
if (gte("1.27.6", maxVersion)) {
|
|
241566
|
+
logForDebugging(`Native installer: current version ${"1.27.6"} is already at or above maxVersion ${maxVersion}, skipping update`);
|
|
241145
241567
|
logEvent("tengu_native_update_skipped_max_version", {
|
|
241146
241568
|
latency_ms: Date.now() - startTime,
|
|
241147
241569
|
max_version: maxVersion,
|
|
@@ -241152,7 +241574,7 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
|
|
|
241152
241574
|
version2 = maxVersion;
|
|
241153
241575
|
}
|
|
241154
241576
|
}
|
|
241155
|
-
if (!forceReinstall && version2 === "1.27.
|
|
241577
|
+
if (!forceReinstall && version2 === "1.27.6" && await versionIsAvailable(version2) && await isPossibleURBinary(executablePath)) {
|
|
241156
241578
|
logForDebugging(`Found ${version2} at ${executablePath}, skipping install`);
|
|
241157
241579
|
logEvent("tengu_native_update_complete", {
|
|
241158
241580
|
latency_ms: Date.now() - startTime,
|
|
@@ -242312,6 +242734,7 @@ var init_status = __esm(() => {
|
|
|
242312
242734
|
init_format2();
|
|
242313
242735
|
init_ide();
|
|
242314
242736
|
init_model();
|
|
242737
|
+
init_providers();
|
|
242315
242738
|
init_mtls();
|
|
242316
242739
|
init_nativeInstaller();
|
|
242317
242740
|
init_proxy();
|
|
@@ -242559,6 +242982,7 @@ var init_auth6 = __esm(() => {
|
|
|
242559
242982
|
init_envUtils();
|
|
242560
242983
|
init_errors();
|
|
242561
242984
|
init_log2();
|
|
242985
|
+
init_providers();
|
|
242562
242986
|
init_settings2();
|
|
242563
242987
|
init_slowOperations();
|
|
242564
242988
|
init_status();
|
|
@@ -246499,9 +246923,9 @@ function createIdleNotification(agentId, options2) {
|
|
|
246499
246923
|
failureReason: options2?.failureReason
|
|
246500
246924
|
};
|
|
246501
246925
|
}
|
|
246502
|
-
function isIdleNotification(
|
|
246926
|
+
function isIdleNotification(messageText2) {
|
|
246503
246927
|
try {
|
|
246504
|
-
const parsed = jsonParse(
|
|
246928
|
+
const parsed = jsonParse(messageText2);
|
|
246505
246929
|
if (parsed && parsed.type === "idle_notification") {
|
|
246506
246930
|
return parsed;
|
|
246507
246931
|
}
|
|
@@ -246539,18 +246963,18 @@ function createPermissionResponseMessage(params) {
|
|
|
246539
246963
|
}
|
|
246540
246964
|
};
|
|
246541
246965
|
}
|
|
246542
|
-
function isPermissionRequest(
|
|
246966
|
+
function isPermissionRequest(messageText2) {
|
|
246543
246967
|
try {
|
|
246544
|
-
const parsed = jsonParse(
|
|
246968
|
+
const parsed = jsonParse(messageText2);
|
|
246545
246969
|
if (parsed && parsed.type === "permission_request") {
|
|
246546
246970
|
return parsed;
|
|
246547
246971
|
}
|
|
246548
246972
|
} catch {}
|
|
246549
246973
|
return null;
|
|
246550
246974
|
}
|
|
246551
|
-
function isPermissionResponse(
|
|
246975
|
+
function isPermissionResponse(messageText2) {
|
|
246552
246976
|
try {
|
|
246553
|
-
const parsed = jsonParse(
|
|
246977
|
+
const parsed = jsonParse(messageText2);
|
|
246554
246978
|
if (parsed && parsed.type === "permission_response") {
|
|
246555
246979
|
return parsed;
|
|
246556
246980
|
}
|
|
@@ -246577,18 +247001,18 @@ function createSandboxPermissionResponseMessage(params) {
|
|
|
246577
247001
|
timestamp: new Date().toISOString()
|
|
246578
247002
|
};
|
|
246579
247003
|
}
|
|
246580
|
-
function isSandboxPermissionRequest(
|
|
247004
|
+
function isSandboxPermissionRequest(messageText2) {
|
|
246581
247005
|
try {
|
|
246582
|
-
const parsed = jsonParse(
|
|
247006
|
+
const parsed = jsonParse(messageText2);
|
|
246583
247007
|
if (parsed && parsed.type === "sandbox_permission_request") {
|
|
246584
247008
|
return parsed;
|
|
246585
247009
|
}
|
|
246586
247010
|
} catch {}
|
|
246587
247011
|
return null;
|
|
246588
247012
|
}
|
|
246589
|
-
function isSandboxPermissionResponse(
|
|
247013
|
+
function isSandboxPermissionResponse(messageText2) {
|
|
246590
247014
|
try {
|
|
246591
|
-
const parsed = jsonParse(
|
|
247015
|
+
const parsed = jsonParse(messageText2);
|
|
246592
247016
|
if (parsed && parsed.type === "sandbox_permission_response") {
|
|
246593
247017
|
return parsed;
|
|
246594
247018
|
}
|
|
@@ -246640,58 +247064,58 @@ async function sendShutdownRequestToMailbox(targetName, teamName, reason) {
|
|
|
246640
247064
|
}, resolvedTeamName);
|
|
246641
247065
|
return { requestId, target: targetName };
|
|
246642
247066
|
}
|
|
246643
|
-
function isShutdownRequest(
|
|
247067
|
+
function isShutdownRequest(messageText2) {
|
|
246644
247068
|
try {
|
|
246645
|
-
const result = ShutdownRequestMessageSchema().safeParse(jsonParse(
|
|
247069
|
+
const result = ShutdownRequestMessageSchema().safeParse(jsonParse(messageText2));
|
|
246646
247070
|
if (result.success)
|
|
246647
247071
|
return result.data;
|
|
246648
247072
|
} catch {}
|
|
246649
247073
|
return null;
|
|
246650
247074
|
}
|
|
246651
|
-
function isPlanApprovalRequest(
|
|
247075
|
+
function isPlanApprovalRequest(messageText2) {
|
|
246652
247076
|
try {
|
|
246653
|
-
const result = PlanApprovalRequestMessageSchema().safeParse(jsonParse(
|
|
247077
|
+
const result = PlanApprovalRequestMessageSchema().safeParse(jsonParse(messageText2));
|
|
246654
247078
|
if (result.success)
|
|
246655
247079
|
return result.data;
|
|
246656
247080
|
} catch {}
|
|
246657
247081
|
return null;
|
|
246658
247082
|
}
|
|
246659
|
-
function isShutdownApproved(
|
|
247083
|
+
function isShutdownApproved(messageText2) {
|
|
246660
247084
|
try {
|
|
246661
|
-
const result = ShutdownApprovedMessageSchema().safeParse(jsonParse(
|
|
247085
|
+
const result = ShutdownApprovedMessageSchema().safeParse(jsonParse(messageText2));
|
|
246662
247086
|
if (result.success)
|
|
246663
247087
|
return result.data;
|
|
246664
247088
|
} catch {}
|
|
246665
247089
|
return null;
|
|
246666
247090
|
}
|
|
246667
|
-
function isShutdownRejected(
|
|
247091
|
+
function isShutdownRejected(messageText2) {
|
|
246668
247092
|
try {
|
|
246669
|
-
const result = ShutdownRejectedMessageSchema().safeParse(jsonParse(
|
|
247093
|
+
const result = ShutdownRejectedMessageSchema().safeParse(jsonParse(messageText2));
|
|
246670
247094
|
if (result.success)
|
|
246671
247095
|
return result.data;
|
|
246672
247096
|
} catch {}
|
|
246673
247097
|
return null;
|
|
246674
247098
|
}
|
|
246675
|
-
function isPlanApprovalResponse(
|
|
247099
|
+
function isPlanApprovalResponse(messageText2) {
|
|
246676
247100
|
try {
|
|
246677
|
-
const result = PlanApprovalResponseMessageSchema().safeParse(jsonParse(
|
|
247101
|
+
const result = PlanApprovalResponseMessageSchema().safeParse(jsonParse(messageText2));
|
|
246678
247102
|
if (result.success)
|
|
246679
247103
|
return result.data;
|
|
246680
247104
|
} catch {}
|
|
246681
247105
|
return null;
|
|
246682
247106
|
}
|
|
246683
|
-
function isTaskAssignment(
|
|
247107
|
+
function isTaskAssignment(messageText2) {
|
|
246684
247108
|
try {
|
|
246685
|
-
const parsed = jsonParse(
|
|
247109
|
+
const parsed = jsonParse(messageText2);
|
|
246686
247110
|
if (parsed && parsed.type === "task_assignment") {
|
|
246687
247111
|
return parsed;
|
|
246688
247112
|
}
|
|
246689
247113
|
} catch {}
|
|
246690
247114
|
return null;
|
|
246691
247115
|
}
|
|
246692
|
-
function isTeamPermissionUpdate(
|
|
247116
|
+
function isTeamPermissionUpdate(messageText2) {
|
|
246693
247117
|
try {
|
|
246694
|
-
const parsed = jsonParse(
|
|
247118
|
+
const parsed = jsonParse(messageText2);
|
|
246695
247119
|
if (parsed && parsed.type === "team_permission_update") {
|
|
246696
247120
|
return parsed;
|
|
246697
247121
|
}
|
|
@@ -246705,18 +247129,18 @@ function createModeSetRequestMessage(params) {
|
|
|
246705
247129
|
from: params.from
|
|
246706
247130
|
};
|
|
246707
247131
|
}
|
|
246708
|
-
function isModeSetRequest(
|
|
247132
|
+
function isModeSetRequest(messageText2) {
|
|
246709
247133
|
try {
|
|
246710
|
-
const parsed = ModeSetRequestMessageSchema().safeParse(jsonParse(
|
|
247134
|
+
const parsed = ModeSetRequestMessageSchema().safeParse(jsonParse(messageText2));
|
|
246711
247135
|
if (parsed.success) {
|
|
246712
247136
|
return parsed.data;
|
|
246713
247137
|
}
|
|
246714
247138
|
} catch {}
|
|
246715
247139
|
return null;
|
|
246716
247140
|
}
|
|
246717
|
-
function isStructuredProtocolMessage(
|
|
247141
|
+
function isStructuredProtocolMessage(messageText2) {
|
|
246718
247142
|
try {
|
|
246719
|
-
const parsed = jsonParse(
|
|
247143
|
+
const parsed = jsonParse(messageText2);
|
|
246720
247144
|
if (!parsed || typeof parsed !== "object" || !("type" in parsed)) {
|
|
246721
247145
|
return false;
|
|
246722
247146
|
}
|
|
@@ -252196,7 +252620,7 @@ __export(exports_api, {
|
|
|
252196
252620
|
CodeSessionSchema: () => CodeSessionSchema,
|
|
252197
252621
|
CCR_BYOC_BETA: () => CCR_BYOC_BETA
|
|
252198
252622
|
});
|
|
252199
|
-
import { randomUUID as
|
|
252623
|
+
import { randomUUID as randomUUID17 } from "crypto";
|
|
252200
252624
|
function isTransientNetworkError(error40) {
|
|
252201
252625
|
if (!axios_default.isAxiosError(error40)) {
|
|
252202
252626
|
return false;
|
|
@@ -252339,7 +252763,7 @@ async function sendEventToRemoteSession(sessionId, messageContent, opts) {
|
|
|
252339
252763
|
"x-organization-uuid": orgUUID
|
|
252340
252764
|
};
|
|
252341
252765
|
const userEvent = {
|
|
252342
|
-
uuid: opts?.uuid ??
|
|
252766
|
+
uuid: opts?.uuid ?? randomUUID17(),
|
|
252343
252767
|
session_id: sessionId,
|
|
252344
252768
|
type: "user",
|
|
252345
252769
|
parent_tool_use_id: null,
|
|
@@ -262430,7 +262854,7 @@ __export(exports_processSlashCommand, {
|
|
|
262430
262854
|
looksLikeCommand: () => looksLikeCommand,
|
|
262431
262855
|
formatSkillLoadingMetadata: () => formatSkillLoadingMetadata
|
|
262432
262856
|
});
|
|
262433
|
-
import { randomUUID as
|
|
262857
|
+
import { randomUUID as randomUUID18 } from "crypto";
|
|
262434
262858
|
async function executeForkedSlashCommand(command, args, context3, precedingInputBlocks, setToolJSX, canUseTool) {
|
|
262435
262859
|
const agentId = createAgentId();
|
|
262436
262860
|
const pluginMarketplace = command.pluginInfo ? parsePluginIdentifier(command.pluginInfo.repository).marketplace : undefined;
|
|
@@ -262474,7 +262898,7 @@ async function executeForkedSlashCommand(command, args, context3, precedingInput
|
|
|
262474
262898
|
parentToolUseID,
|
|
262475
262899
|
toolUseID: `${parentToolUseID}-${toolUseCounter}`,
|
|
262476
262900
|
timestamp: new Date().toISOString(),
|
|
262477
|
-
uuid:
|
|
262901
|
+
uuid: randomUUID18()
|
|
262478
262902
|
};
|
|
262479
262903
|
};
|
|
262480
262904
|
const updateProgress = () => {
|
|
@@ -262599,7 +263023,7 @@ async function processSlashCommand(inputString, precedingInputBlocks, imageConte
|
|
|
262599
263023
|
resultText: unknownMessage
|
|
262600
263024
|
};
|
|
262601
263025
|
}
|
|
262602
|
-
const promptId =
|
|
263026
|
+
const promptId = randomUUID18();
|
|
262603
263027
|
setPromptId(promptId);
|
|
262604
263028
|
logEvent("tengu_input_prompt", {});
|
|
262605
263029
|
logOTelEvent("user_prompt", {
|
|
@@ -263029,7 +263453,7 @@ var init_processSlashCommand = __esm(() => {
|
|
|
263029
263453
|
});
|
|
263030
263454
|
|
|
263031
263455
|
// src/tools/AgentTool/runAgent.ts
|
|
263032
|
-
import { randomUUID as
|
|
263456
|
+
import { randomUUID as randomUUID19 } from "crypto";
|
|
263033
263457
|
async function initializeAgentMcpServers(agentDefinition, parentClients) {
|
|
263034
263458
|
if (!agentDefinition.mcpServers?.length) {
|
|
263035
263459
|
return {
|
|
@@ -263215,7 +263639,7 @@ async function* runAgent({
|
|
|
263215
263639
|
type: "hook_additional_context",
|
|
263216
263640
|
content: additionalContexts,
|
|
263217
263641
|
hookName: "SubagentStart",
|
|
263218
|
-
toolUseID:
|
|
263642
|
+
toolUseID: randomUUID19(),
|
|
263219
263643
|
hookEvent: "SubagentStart"
|
|
263220
263644
|
});
|
|
263221
263645
|
initialMessages.push(contextMessage);
|
|
@@ -266103,7 +266527,7 @@ var init_words = __esm(() => {
|
|
|
266103
266527
|
});
|
|
266104
266528
|
|
|
266105
266529
|
// src/utils/plans.ts
|
|
266106
|
-
import { randomUUID as
|
|
266530
|
+
import { randomUUID as randomUUID20 } from "crypto";
|
|
266107
266531
|
import { copyFile as copyFile4, writeFile as writeFile17 } from "fs/promises";
|
|
266108
266532
|
import { join as join81, resolve as resolve22, sep as sep13 } from "path";
|
|
266109
266533
|
function getPlanSlug(sessionId) {
|
|
@@ -266286,7 +266710,7 @@ async function persistFileSnapshotIfRemote() {
|
|
|
266286
266710
|
level: "info",
|
|
266287
266711
|
isMeta: true,
|
|
266288
266712
|
timestamp: new Date().toISOString(),
|
|
266289
|
-
uuid:
|
|
266713
|
+
uuid: randomUUID20(),
|
|
266290
266714
|
snapshotFiles
|
|
266291
266715
|
};
|
|
266292
266716
|
const { recordTranscript: recordTranscript2 } = await Promise.resolve().then(() => (init_sessionStorage(), exports_sessionStorage));
|
|
@@ -267226,7 +267650,7 @@ var init_conversationRecovery = __esm(() => {
|
|
|
267226
267650
|
});
|
|
267227
267651
|
|
|
267228
267652
|
// src/services/api/filesApi.ts
|
|
267229
|
-
import { randomUUID as
|
|
267653
|
+
import { randomUUID as randomUUID21 } from "crypto";
|
|
267230
267654
|
import * as fs3 from "fs/promises";
|
|
267231
267655
|
import * as path10 from "path";
|
|
267232
267656
|
function getDefaultApiBaseUrl() {
|
|
@@ -267410,7 +267834,7 @@ async function uploadFile(filePath, relativePath, config2, opts) {
|
|
|
267410
267834
|
success: false
|
|
267411
267835
|
};
|
|
267412
267836
|
}
|
|
267413
|
-
const boundary = `----FormBoundary${
|
|
267837
|
+
const boundary = `----FormBoundary${randomUUID21()}`;
|
|
267414
267838
|
const filename = path10.basename(relativePath);
|
|
267415
267839
|
const bodyParts = [];
|
|
267416
267840
|
bodyParts.push(Buffer.from(`--${boundary}\r
|
|
@@ -267547,11 +267971,11 @@ var init_filesApi = __esm(() => {
|
|
|
267547
267971
|
});
|
|
267548
267972
|
|
|
267549
267973
|
// src/utils/tempfile.ts
|
|
267550
|
-
import { createHash as createHash16, randomUUID as
|
|
267974
|
+
import { createHash as createHash16, randomUUID as randomUUID22 } from "crypto";
|
|
267551
267975
|
import { tmpdir as tmpdir6 } from "os";
|
|
267552
267976
|
import { join as join85 } from "path";
|
|
267553
267977
|
function generateTempFilePath(prefix = "ur-prompt", extension = ".md", options2) {
|
|
267554
|
-
const id = options2?.contentHash ? createHash16("sha256").update(options2.contentHash).digest("hex").slice(0, 16) :
|
|
267978
|
+
const id = options2?.contentHash ? createHash16("sha256").update(options2.contentHash).digest("hex").slice(0, 16) : randomUUID22();
|
|
267555
267979
|
return join85(tmpdir6(), `${prefix}-${id}${extension}`);
|
|
267556
267980
|
}
|
|
267557
267981
|
var init_tempfile = () => {};
|
|
@@ -267726,7 +268150,7 @@ __export(exports_teleport, {
|
|
|
267726
268150
|
checkOutTeleportedSessionBranch: () => checkOutTeleportedSessionBranch,
|
|
267727
268151
|
archiveRemoteSession: () => archiveRemoteSession
|
|
267728
268152
|
});
|
|
267729
|
-
import { randomUUID as
|
|
268153
|
+
import { randomUUID as randomUUID23 } from "crypto";
|
|
267730
268154
|
function createTeleportResumeSystemMessage(branchError) {
|
|
267731
268155
|
if (branchError === null) {
|
|
267732
268156
|
return createSystemMessage("Session resumed", "suggestion");
|
|
@@ -268443,7 +268867,7 @@ async function teleportToRemote(options2) {
|
|
|
268443
268867
|
type: "event",
|
|
268444
268868
|
data: {
|
|
268445
268869
|
type: "control_request",
|
|
268446
|
-
request_id: `set-mode-${
|
|
268870
|
+
request_id: `set-mode-${randomUUID23()}`,
|
|
268447
268871
|
request: {
|
|
268448
268872
|
subtype: "set_permission_mode",
|
|
268449
268873
|
mode: options2.permissionMode,
|
|
@@ -268456,7 +268880,7 @@ async function teleportToRemote(options2) {
|
|
|
268456
268880
|
events2.push({
|
|
268457
268881
|
type: "event",
|
|
268458
268882
|
data: {
|
|
268459
|
-
uuid:
|
|
268883
|
+
uuid: randomUUID23(),
|
|
268460
268884
|
session_id: "",
|
|
268461
268885
|
type: "user",
|
|
268462
268886
|
parent_tool_use_id: null,
|
|
@@ -269770,12 +270194,12 @@ ${result.result}`
|
|
|
269770
270194
|
});
|
|
269771
270195
|
|
|
269772
270196
|
// src/services/lsp/LSPDiagnosticRegistry.ts
|
|
269773
|
-
import { randomUUID as
|
|
270197
|
+
import { randomUUID as randomUUID24 } from "crypto";
|
|
269774
270198
|
function registerPendingLSPDiagnostic({
|
|
269775
270199
|
serverName,
|
|
269776
270200
|
files
|
|
269777
270201
|
}) {
|
|
269778
|
-
const diagnosticId =
|
|
270202
|
+
const diagnosticId = randomUUID24();
|
|
269779
270203
|
logForDebugging(`LSP Diagnostics: Registering ${files.length} diagnostic file(s) from ${serverName} (ID: ${diagnosticId})`);
|
|
269780
270204
|
pendingDiagnostics.set(diagnosticId, {
|
|
269781
270205
|
serverName,
|
|
@@ -283369,7 +283793,7 @@ var init_PowerShellTool = __esm(() => {
|
|
|
283369
283793
|
});
|
|
283370
283794
|
|
|
283371
283795
|
// src/utils/promptShellExecution.ts
|
|
283372
|
-
import { randomUUID as
|
|
283796
|
+
import { randomUUID as randomUUID25 } from "crypto";
|
|
283373
283797
|
async function executeShellCommandsInPrompt(text, context3, slashCommandName, shell) {
|
|
283374
283798
|
let result = text;
|
|
283375
283799
|
const shellTool = shell === "powershell" && isPowerShellToolEnabled() ? getPowerShellTool() : BashTool;
|
|
@@ -283385,7 +283809,7 @@ async function executeShellCommandsInPrompt(text, context3, slashCommandName, sh
|
|
|
283385
283809
|
throw new MalformedCommandError(`Shell command permission check failed for pattern "${match[0]}": ${permissionResult.message || "Permission denied"}`);
|
|
283386
283810
|
}
|
|
283387
283811
|
const { data } = await shellTool.call({ command }, context3);
|
|
283388
|
-
const toolResultBlock = await processToolResultBlock(shellTool, data,
|
|
283812
|
+
const toolResultBlock = await processToolResultBlock(shellTool, data, randomUUID25());
|
|
283389
283813
|
const output = typeof toolResultBlock.content === "string" ? toolResultBlock.content : formatBashOutput(data.stdout, data.stderr);
|
|
283390
283814
|
result = result.replace(match[0], () => output);
|
|
283391
283815
|
} catch (e) {
|
|
@@ -293806,6 +294230,7 @@ function makeOutputFromSearchResponse(result, query2, durationSeconds) {
|
|
|
293806
294230
|
}
|
|
293807
294231
|
var inputSchema27, searchResultSchema, outputSchema23, WebSearchTool;
|
|
293808
294232
|
var init_WebSearchTool = __esm(() => {
|
|
294233
|
+
init_providers();
|
|
293809
294234
|
init_v4();
|
|
293810
294235
|
init_growthbook();
|
|
293811
294236
|
init_ur2();
|
|
@@ -298855,6 +299280,7 @@ var init_modelOptions = __esm(() => {
|
|
|
298855
299280
|
init_modelCost();
|
|
298856
299281
|
init_settings2();
|
|
298857
299282
|
init_check1mAccess();
|
|
299283
|
+
init_providers();
|
|
298858
299284
|
init_modelAllowlist();
|
|
298859
299285
|
init_model();
|
|
298860
299286
|
init_context();
|
|
@@ -298982,6 +299408,7 @@ var validModelCache;
|
|
|
298982
299408
|
var init_validateModel = __esm(() => {
|
|
298983
299409
|
init_aliases();
|
|
298984
299410
|
init_modelAllowlist();
|
|
299411
|
+
init_providers();
|
|
298985
299412
|
init_sideQuery();
|
|
298986
299413
|
init_urhq_sdk();
|
|
298987
299414
|
init_modelStrings();
|
|
@@ -301187,7 +301614,7 @@ var init_systemPrompt = __esm(() => {
|
|
|
301187
301614
|
});
|
|
301188
301615
|
|
|
301189
301616
|
// src/tools/AgentTool/forkSubagent.ts
|
|
301190
|
-
import { randomUUID as
|
|
301617
|
+
import { randomUUID as randomUUID26 } from "crypto";
|
|
301191
301618
|
function isForkSubagentEnabled() {
|
|
301192
301619
|
if (false) {}
|
|
301193
301620
|
return false;
|
|
@@ -301205,7 +301632,7 @@ function isInForkChild(messages) {
|
|
|
301205
301632
|
function buildForkedMessages(directive, assistantMessage) {
|
|
301206
301633
|
const fullAssistantMessage = {
|
|
301207
301634
|
...assistantMessage,
|
|
301208
|
-
uuid:
|
|
301635
|
+
uuid: randomUUID26(),
|
|
301209
301636
|
message: {
|
|
301210
301637
|
...assistantMessage.message,
|
|
301211
301638
|
content: [...assistantMessage.message.content]
|
|
@@ -302801,6 +303228,7 @@ function getHardcodedTeammateModelFallback() {
|
|
|
302801
303228
|
}
|
|
302802
303229
|
var init_teammateModel = __esm(() => {
|
|
302803
303230
|
init_configs();
|
|
303231
|
+
init_providers();
|
|
302804
303232
|
});
|
|
302805
303233
|
|
|
302806
303234
|
// src/tools/shared/spawnMultiAgent.ts
|
|
@@ -313332,13 +313760,13 @@ var init_config6 = __esm(() => {
|
|
|
313332
313760
|
});
|
|
313333
313761
|
|
|
313334
313762
|
// src/query/deps.ts
|
|
313335
|
-
import { randomUUID as
|
|
313763
|
+
import { randomUUID as randomUUID27 } from "crypto";
|
|
313336
313764
|
function productionDeps() {
|
|
313337
313765
|
return {
|
|
313338
313766
|
callModel: queryModelWithStreaming,
|
|
313339
313767
|
microcompact: microcompactMessages,
|
|
313340
313768
|
autocompact: autoCompactIfNeeded,
|
|
313341
|
-
uuid:
|
|
313769
|
+
uuid: randomUUID27
|
|
313342
313770
|
};
|
|
313343
313771
|
}
|
|
313344
313772
|
var init_deps = __esm(() => {
|
|
@@ -314268,9 +314696,9 @@ var init_query = __esm(() => {
|
|
|
314268
314696
|
});
|
|
314269
314697
|
|
|
314270
314698
|
// src/services/api/emptyUsage.ts
|
|
314271
|
-
var
|
|
314699
|
+
var EMPTY_USAGE2;
|
|
314272
314700
|
var init_emptyUsage = __esm(() => {
|
|
314273
|
-
|
|
314701
|
+
EMPTY_USAGE2 = {
|
|
314274
314702
|
input_tokens: 0,
|
|
314275
314703
|
cache_creation_input_tokens: 0,
|
|
314276
314704
|
cache_read_input_tokens: 0,
|
|
@@ -314715,6 +315143,7 @@ var init_logging = __esm(() => {
|
|
|
314715
315143
|
init_state();
|
|
314716
315144
|
init_debug();
|
|
314717
315145
|
init_log2();
|
|
315146
|
+
init_providers();
|
|
314718
315147
|
init_slowOperations();
|
|
314719
315148
|
init_events();
|
|
314720
315149
|
init_sessionTracing();
|
|
@@ -314763,7 +315192,7 @@ function createDenialTrackingState() {
|
|
|
314763
315192
|
var init_denialTracking = () => {};
|
|
314764
315193
|
|
|
314765
315194
|
// src/utils/forkedAgent.ts
|
|
314766
|
-
import { randomUUID as
|
|
315195
|
+
import { randomUUID as randomUUID28 } from "crypto";
|
|
314767
315196
|
function saveCacheSafeParams(params) {
|
|
314768
315197
|
lastCacheSafeParams = params;
|
|
314769
315198
|
}
|
|
@@ -314872,7 +315301,7 @@ function createSubagentContext(parentContext, overrides) {
|
|
|
314872
315301
|
agentId: overrides?.agentId ?? createAgentId(),
|
|
314873
315302
|
agentType: overrides?.agentType,
|
|
314874
315303
|
queryTracking: {
|
|
314875
|
-
chainId:
|
|
315304
|
+
chainId: randomUUID28(),
|
|
314876
315305
|
depth: (parentContext.queryTracking?.depth ?? -1) + 1
|
|
314877
315306
|
},
|
|
314878
315307
|
fileReadingLimits: parentContext.fileReadingLimits,
|
|
@@ -314896,7 +315325,7 @@ async function runForkedAgent({
|
|
|
314896
315325
|
}) {
|
|
314897
315326
|
const startTime = Date.now();
|
|
314898
315327
|
const outputMessages = [];
|
|
314899
|
-
let totalUsage = { ...
|
|
315328
|
+
let totalUsage = { ...EMPTY_USAGE2 };
|
|
314900
315329
|
const {
|
|
314901
315330
|
systemPrompt,
|
|
314902
315331
|
userContext,
|
|
@@ -314927,7 +315356,7 @@ async function runForkedAgent({
|
|
|
314927
315356
|
})) {
|
|
314928
315357
|
if (message.type === "stream_event") {
|
|
314929
315358
|
if ("event" in message && message.event?.type === "message_delta" && message.event.usage) {
|
|
314930
|
-
const turnUsage = updateUsage({ ...
|
|
315359
|
+
const turnUsage = updateUsage({ ...EMPTY_USAGE2 }, message.event.usage);
|
|
314931
315360
|
totalUsage = accumulateUsage(totalUsage, turnUsage);
|
|
314932
315361
|
}
|
|
314933
315362
|
continue;
|
|
@@ -317988,6 +318417,7 @@ var init_toolSearch = __esm(() => {
|
|
|
317988
318417
|
init_context();
|
|
317989
318418
|
init_debug();
|
|
317990
318419
|
init_envUtils();
|
|
318420
|
+
init_providers();
|
|
317991
318421
|
init_slowOperations();
|
|
317992
318422
|
init_zodToJsonSchema2();
|
|
317993
318423
|
getDeferredToolTokenCount = memoize_default(async (tools, getToolPermissionContext, agents, model) => {
|
|
@@ -318007,7 +318437,7 @@ var init_toolSearch = __esm(() => {
|
|
|
318007
318437
|
});
|
|
318008
318438
|
|
|
318009
318439
|
// src/services/vcr.ts
|
|
318010
|
-
import { createHash as createHash21, randomUUID as
|
|
318440
|
+
import { createHash as createHash21, randomUUID as randomUUID29 } from "crypto";
|
|
318011
318441
|
import { mkdir as mkdir23, readFile as readFile31, writeFile as writeFile24 } from "fs/promises";
|
|
318012
318442
|
import { dirname as dirname42, join as join103 } from "path";
|
|
318013
318443
|
function shouldUseVCR() {
|
|
@@ -318060,7 +318490,7 @@ async function withVCR(messages, f) {
|
|
|
318060
318490
|
try {
|
|
318061
318491
|
const cached3 = jsonParse(await readFile31(filename, { encoding: "utf8" }));
|
|
318062
318492
|
cached3.output.forEach(addCachedCostToTotalSessionCost);
|
|
318063
|
-
return cached3.output.map((message, index2) => mapMessage(message, hydrateValue, index2,
|
|
318493
|
+
return cached3.output.map((message, index2) => mapMessage(message, hydrateValue, index2, randomUUID29()));
|
|
318064
318494
|
} catch (e) {
|
|
318065
318495
|
const code = getErrnoCode(e);
|
|
318066
318496
|
if (code !== "ENOENT") {
|
|
@@ -318456,6 +318886,7 @@ function roughTokenCountEstimationForBlock(block2) {
|
|
|
318456
318886
|
}
|
|
318457
318887
|
var TOKEN_COUNT_THINKING_BUDGET = 1024, TOKEN_COUNT_MAX_TOKENS = 2048;
|
|
318458
318888
|
var init_tokenEstimation = __esm(() => {
|
|
318889
|
+
init_providers();
|
|
318459
318890
|
init_betas();
|
|
318460
318891
|
init_betas2();
|
|
318461
318892
|
init_envUtils();
|
|
@@ -318470,7 +318901,7 @@ var init_tokenEstimation = __esm(() => {
|
|
|
318470
318901
|
});
|
|
318471
318902
|
|
|
318472
318903
|
// src/utils/pdf.ts
|
|
318473
|
-
import { randomUUID as
|
|
318904
|
+
import { randomUUID as randomUUID30 } from "crypto";
|
|
318474
318905
|
import { mkdir as mkdir24, readdir as readdir16, readFile as readFile32 } from "fs/promises";
|
|
318475
318906
|
import { join as join104 } from "path";
|
|
318476
318907
|
async function readPDF(filePath) {
|
|
@@ -318581,7 +319012,7 @@ async function extractPDFPages(filePath, options2) {
|
|
|
318581
319012
|
}
|
|
318582
319013
|
};
|
|
318583
319014
|
}
|
|
318584
|
-
const uuid3 =
|
|
319015
|
+
const uuid3 = randomUUID30();
|
|
318585
319016
|
const outputDir = join104(getToolResultsDir(), `pdf-${uuid3}`);
|
|
318586
319017
|
await mkdir24(outputDir, { recursive: true });
|
|
318587
319018
|
const prefix = join104(outputDir, "page");
|
|
@@ -320150,7 +320581,7 @@ var init_findRelevantMemories = __esm(() => {
|
|
|
320150
320581
|
// src/utils/attachments.ts
|
|
320151
320582
|
import { readdir as readdir18, stat as stat32 } from "fs/promises";
|
|
320152
320583
|
import { dirname as dirname43, parse as parse12, relative as relative23, resolve as resolve33 } from "path";
|
|
320153
|
-
import { randomUUID as
|
|
320584
|
+
import { randomUUID as randomUUID31 } from "crypto";
|
|
320154
320585
|
async function getAttachments(input, toolUseContext, ideSelection, queuedCommands, messages, querySource, options2) {
|
|
320155
320586
|
if (isEnvTruthy(process.env.UR_CODE_DISABLE_ATTACHMENTS) || isEnvTruthy(process.env.UR_CODE_SIMPLE)) {
|
|
320156
320587
|
return getQueuedCommandAttachments(queuedCommands);
|
|
@@ -321311,7 +321742,7 @@ function createAttachmentMessage(attachment) {
|
|
|
321311
321742
|
return {
|
|
321312
321743
|
attachment,
|
|
321313
321744
|
type: "attachment",
|
|
321314
|
-
uuid:
|
|
321745
|
+
uuid: randomUUID31(),
|
|
321315
321746
|
timestamp: new Date().toISOString()
|
|
321316
321747
|
};
|
|
321317
321748
|
}
|
|
@@ -327104,7 +327535,7 @@ ${EXPLANATORY_FEATURE_PROMPT}`
|
|
|
327104
327535
|
});
|
|
327105
327536
|
|
|
327106
327537
|
// src/utils/messages.ts
|
|
327107
|
-
import { randomUUID as
|
|
327538
|
+
import { randomUUID as randomUUID32 } from "crypto";
|
|
327108
327539
|
function getTeammateMailbox() {
|
|
327109
327540
|
return init_teammateMailbox(), __toCommonJS(exports_teammateMailbox);
|
|
327110
327541
|
}
|
|
@@ -327167,10 +327598,10 @@ function baseCreateAssistantMessage({
|
|
|
327167
327598
|
}) {
|
|
327168
327599
|
return {
|
|
327169
327600
|
type: "assistant",
|
|
327170
|
-
uuid:
|
|
327601
|
+
uuid: randomUUID32(),
|
|
327171
327602
|
timestamp: new Date().toISOString(),
|
|
327172
327603
|
message: {
|
|
327173
|
-
id:
|
|
327604
|
+
id: randomUUID32(),
|
|
327174
327605
|
container: null,
|
|
327175
327606
|
model: SYNTHETIC_MODEL,
|
|
327176
327607
|
role: "assistant",
|
|
@@ -327251,7 +327682,7 @@ function createUserMessage({
|
|
|
327251
327682
|
isVirtual,
|
|
327252
327683
|
isCompactSummary,
|
|
327253
327684
|
summarizeMetadata,
|
|
327254
|
-
uuid: uuid3 ||
|
|
327685
|
+
uuid: uuid3 || randomUUID32(),
|
|
327255
327686
|
timestamp: timestamp ?? new Date().toISOString(),
|
|
327256
327687
|
toolUseResult,
|
|
327257
327688
|
mcpMeta,
|
|
@@ -327320,7 +327751,7 @@ function createProgressMessage({
|
|
|
327320
327751
|
data,
|
|
327321
327752
|
toolUseID,
|
|
327322
327753
|
parentToolUseID,
|
|
327323
|
-
uuid:
|
|
327754
|
+
uuid: randomUUID32(),
|
|
327324
327755
|
timestamp: new Date().toISOString()
|
|
327325
327756
|
};
|
|
327326
327757
|
}
|
|
@@ -327363,6 +327794,9 @@ function extractTag(html3, tagName) {
|
|
|
327363
327794
|
return null;
|
|
327364
327795
|
}
|
|
327365
327796
|
function isNotEmptyMessage(message) {
|
|
327797
|
+
if (!message || typeof message !== "object" || !("type" in message)) {
|
|
327798
|
+
return false;
|
|
327799
|
+
}
|
|
327366
327800
|
if (message.type === "progress" || message.type === "attachment" || message.type === "system") {
|
|
327367
327801
|
return true;
|
|
327368
327802
|
}
|
|
@@ -329629,7 +330063,7 @@ function createSystemMessage(content, level, toolUseID, preventContinuation) {
|
|
|
329629
330063
|
content,
|
|
329630
330064
|
isMeta: false,
|
|
329631
330065
|
timestamp: new Date().toISOString(),
|
|
329632
|
-
uuid:
|
|
330066
|
+
uuid: randomUUID32(),
|
|
329633
330067
|
toolUseID,
|
|
329634
330068
|
level,
|
|
329635
330069
|
...preventContinuation && { preventContinuation }
|
|
@@ -329644,7 +330078,7 @@ function createPermissionRetryMessage(commands) {
|
|
|
329644
330078
|
level: "info",
|
|
329645
330079
|
isMeta: false,
|
|
329646
330080
|
timestamp: new Date().toISOString(),
|
|
329647
|
-
uuid:
|
|
330081
|
+
uuid: randomUUID32()
|
|
329648
330082
|
};
|
|
329649
330083
|
}
|
|
329650
330084
|
function createStopHookSummaryMessage(hookCount, hookInfos, hookErrors, preventedContinuation, stopReason, hasOutput, level, toolUseID, hookLabel, totalDurationMs) {
|
|
@@ -329659,7 +330093,7 @@ function createStopHookSummaryMessage(hookCount, hookInfos, hookErrors, prevente
|
|
|
329659
330093
|
hasOutput,
|
|
329660
330094
|
level,
|
|
329661
330095
|
timestamp: new Date().toISOString(),
|
|
329662
|
-
uuid:
|
|
330096
|
+
uuid: randomUUID32(),
|
|
329663
330097
|
toolUseID,
|
|
329664
330098
|
hookLabel,
|
|
329665
330099
|
totalDurationMs
|
|
@@ -329675,7 +330109,7 @@ function createTurnDurationMessage(durationMs, budget, messageCount) {
|
|
|
329675
330109
|
budgetNudges: budget?.nudges,
|
|
329676
330110
|
messageCount,
|
|
329677
330111
|
timestamp: new Date().toISOString(),
|
|
329678
|
-
uuid:
|
|
330112
|
+
uuid: randomUUID32(),
|
|
329679
330113
|
isMeta: false
|
|
329680
330114
|
};
|
|
329681
330115
|
}
|
|
@@ -329685,7 +330119,7 @@ function createMemorySavedMessage(writtenPaths) {
|
|
|
329685
330119
|
subtype: "memory_saved",
|
|
329686
330120
|
writtenPaths,
|
|
329687
330121
|
timestamp: new Date().toISOString(),
|
|
329688
|
-
uuid:
|
|
330122
|
+
uuid: randomUUID32(),
|
|
329689
330123
|
isMeta: false
|
|
329690
330124
|
};
|
|
329691
330125
|
}
|
|
@@ -329694,7 +330128,7 @@ function createAgentsKilledMessage() {
|
|
|
329694
330128
|
type: "system",
|
|
329695
330129
|
subtype: "agents_killed",
|
|
329696
330130
|
timestamp: new Date().toISOString(),
|
|
329697
|
-
uuid:
|
|
330131
|
+
uuid: randomUUID32(),
|
|
329698
330132
|
isMeta: false
|
|
329699
330133
|
};
|
|
329700
330134
|
}
|
|
@@ -329705,7 +330139,7 @@ function createCommandInputMessage(content) {
|
|
|
329705
330139
|
content,
|
|
329706
330140
|
level: "info",
|
|
329707
330141
|
timestamp: new Date().toISOString(),
|
|
329708
|
-
uuid:
|
|
330142
|
+
uuid: randomUUID32(),
|
|
329709
330143
|
isMeta: false
|
|
329710
330144
|
};
|
|
329711
330145
|
}
|
|
@@ -329716,7 +330150,7 @@ function createCompactBoundaryMessage(trigger, preTokens, lastPreCompactMessageU
|
|
|
329716
330150
|
content: `Conversation compacted`,
|
|
329717
330151
|
isMeta: false,
|
|
329718
330152
|
timestamp: new Date().toISOString(),
|
|
329719
|
-
uuid:
|
|
330153
|
+
uuid: randomUUID32(),
|
|
329720
330154
|
level: "info",
|
|
329721
330155
|
compactMetadata: {
|
|
329722
330156
|
trigger,
|
|
@@ -329740,7 +330174,7 @@ function createSystemAPIErrorMessage(error40, retryInMs, retryAttempt, maxRetrie
|
|
|
329740
330174
|
retryAttempt,
|
|
329741
330175
|
maxRetries,
|
|
329742
330176
|
timestamp: new Date().toISOString(),
|
|
329743
|
-
uuid:
|
|
330177
|
+
uuid: randomUUID32()
|
|
329744
330178
|
};
|
|
329745
330179
|
}
|
|
329746
330180
|
function isCompactBoundaryMessage(message) {
|
|
@@ -330009,7 +330443,7 @@ function createToolUseSummaryMessage(summary, precedingToolUseIds) {
|
|
|
330009
330443
|
type: "tool_use_summary",
|
|
330010
330444
|
summary,
|
|
330011
330445
|
precedingToolUseIds,
|
|
330012
|
-
uuid:
|
|
330446
|
+
uuid: randomUUID32(),
|
|
330013
330447
|
timestamp: new Date().toISOString()
|
|
330014
330448
|
};
|
|
330015
330449
|
}
|
|
@@ -330909,6 +331343,7 @@ var init_errors6 = __esm(() => {
|
|
|
330909
331343
|
init_messages();
|
|
330910
331344
|
init_model();
|
|
330911
331345
|
init_modelStrings();
|
|
331346
|
+
init_providers();
|
|
330912
331347
|
init_state();
|
|
330913
331348
|
init_apiLimits();
|
|
330914
331349
|
init_envUtils();
|
|
@@ -338064,7 +338499,7 @@ function Feedback({
|
|
|
338064
338499
|
platform: env2.platform,
|
|
338065
338500
|
gitRepo: envInfo.isGit,
|
|
338066
338501
|
terminal: env2.terminal,
|
|
338067
|
-
version: "1.27.
|
|
338502
|
+
version: "1.27.6",
|
|
338068
338503
|
transcript: normalizeMessagesForAPI(messages),
|
|
338069
338504
|
errors: sanitizedErrors,
|
|
338070
338505
|
lastApiRequest: getLastAPIRequest(),
|
|
@@ -338256,7 +338691,7 @@ function Feedback({
|
|
|
338256
338691
|
", ",
|
|
338257
338692
|
env2.terminal,
|
|
338258
338693
|
", v",
|
|
338259
|
-
"1.27.
|
|
338694
|
+
"1.27.6"
|
|
338260
338695
|
]
|
|
338261
338696
|
}, undefined, true, undefined, this)
|
|
338262
338697
|
]
|
|
@@ -338362,7 +338797,7 @@ ${sanitizedDescription}
|
|
|
338362
338797
|
` + `**Environment Info**
|
|
338363
338798
|
` + `- Platform: ${env2.platform}
|
|
338364
338799
|
` + `- Terminal: ${env2.terminal}
|
|
338365
|
-
` + `- Version: ${"1.27.
|
|
338800
|
+
` + `- Version: ${"1.27.6"}
|
|
338366
338801
|
` + `- Feedback ID: ${feedbackId}
|
|
338367
338802
|
` + `
|
|
338368
338803
|
**Errors**
|
|
@@ -339561,7 +339996,7 @@ var exports_conversation = {};
|
|
|
339561
339996
|
__export(exports_conversation, {
|
|
339562
339997
|
clearConversation: () => clearConversation
|
|
339563
339998
|
});
|
|
339564
|
-
import { randomUUID as
|
|
339999
|
+
import { randomUUID as randomUUID33 } from "crypto";
|
|
339565
340000
|
async function clearConversation({
|
|
339566
340001
|
setMessages,
|
|
339567
340002
|
readFileState,
|
|
@@ -339603,7 +340038,7 @@ async function clearConversation({
|
|
|
339603
340038
|
setMessages(() => []);
|
|
339604
340039
|
if (false) {}
|
|
339605
340040
|
if (setConversationId) {
|
|
339606
|
-
setConversationId(
|
|
340041
|
+
setConversationId(randomUUID33());
|
|
339607
340042
|
}
|
|
339608
340043
|
clearSessionCaches(preservedAgentIds);
|
|
339609
340044
|
setCwd(getOriginalCwd());
|
|
@@ -341473,7 +341908,7 @@ function buildPrimarySection() {
|
|
|
341473
341908
|
}, undefined, false, undefined, this);
|
|
341474
341909
|
return [{
|
|
341475
341910
|
label: "Version",
|
|
341476
|
-
value: "1.27.
|
|
341911
|
+
value: "1.27.6"
|
|
341477
341912
|
}, {
|
|
341478
341913
|
label: "Session name",
|
|
341479
341914
|
value: nameValue
|
|
@@ -344773,7 +345208,7 @@ function Config({
|
|
|
344773
345208
|
}
|
|
344774
345209
|
}, undefined, false, undefined, this)
|
|
344775
345210
|
}, undefined, false, undefined, this) : showSubmenu === "ChannelDowngrade" ? /* @__PURE__ */ jsx_dev_runtime177.jsxDEV(ChannelDowngradeDialog, {
|
|
344776
|
-
currentVersion: "1.27.
|
|
345211
|
+
currentVersion: "1.27.6",
|
|
344777
345212
|
onChoice: (choice) => {
|
|
344778
345213
|
setShowSubmenu(null);
|
|
344779
345214
|
setTabsHidden(false);
|
|
@@ -344785,7 +345220,7 @@ function Config({
|
|
|
344785
345220
|
autoUpdatesChannel: "stable"
|
|
344786
345221
|
};
|
|
344787
345222
|
if (choice === "stay") {
|
|
344788
|
-
newSettings.minimumVersion = "1.27.
|
|
345223
|
+
newSettings.minimumVersion = "1.27.6";
|
|
344789
345224
|
}
|
|
344790
345225
|
updateSettingsForSource("userSettings", newSettings);
|
|
344791
345226
|
setSettingsData((prev_27) => ({
|
|
@@ -352855,7 +353290,7 @@ function HelpV2(t0) {
|
|
|
352855
353290
|
let t6;
|
|
352856
353291
|
if ($3[31] !== tabs) {
|
|
352857
353292
|
t6 = /* @__PURE__ */ jsx_dev_runtime204.jsxDEV(Tabs, {
|
|
352858
|
-
title: `UR v${"1.27.
|
|
353293
|
+
title: `UR v${"1.27.6"}`,
|
|
352859
353294
|
color: "professionalBlue",
|
|
352860
353295
|
defaultTab: "general",
|
|
352861
353296
|
children: tabs
|
|
@@ -372957,7 +373392,7 @@ function getAllReleaseNotes(changelogContent = getStoredChangelogFromMemory()) {
|
|
|
372957
373392
|
return [];
|
|
372958
373393
|
}
|
|
372959
373394
|
}
|
|
372960
|
-
async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.27.
|
|
373395
|
+
async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.27.6") {
|
|
372961
373396
|
if (process.env.USER_TYPE === "ant") {
|
|
372962
373397
|
const changelog = "";
|
|
372963
373398
|
if (changelog) {
|
|
@@ -372984,7 +373419,7 @@ async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.27.5")
|
|
|
372984
373419
|
releaseNotes
|
|
372985
373420
|
};
|
|
372986
373421
|
}
|
|
372987
|
-
function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "1.27.
|
|
373422
|
+
function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "1.27.6") {
|
|
372988
373423
|
if (process.env.USER_TYPE === "ant") {
|
|
372989
373424
|
const changelog = "";
|
|
372990
373425
|
if (changelog) {
|
|
@@ -374154,7 +374589,7 @@ function getRecentActivitySync() {
|
|
|
374154
374589
|
return cachedActivity;
|
|
374155
374590
|
}
|
|
374156
374591
|
function getLogoDisplayData() {
|
|
374157
|
-
const version2 = process.env.DEMO_VERSION ?? "1.27.
|
|
374592
|
+
const version2 = process.env.DEMO_VERSION ?? "1.27.6";
|
|
374158
374593
|
const serverUrl = getDirectConnectServerUrl();
|
|
374159
374594
|
const displayPath = process.env.DEMO_VERSION ? "/code/ur" : getDisplayPath(getCwd2());
|
|
374160
374595
|
const cwd2 = serverUrl ? `${displayPath} in ${serverUrl.replace(/^https?:\/\//, "")}` : displayPath;
|
|
@@ -374943,7 +375378,7 @@ function LogoV2() {
|
|
|
374943
375378
|
if ($3[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
374944
375379
|
t2 = () => {
|
|
374945
375380
|
const currentConfig = getGlobalConfig();
|
|
374946
|
-
if (currentConfig.lastReleaseNotesSeen === "1.27.
|
|
375381
|
+
if (currentConfig.lastReleaseNotesSeen === "1.27.6") {
|
|
374947
375382
|
return;
|
|
374948
375383
|
}
|
|
374949
375384
|
saveGlobalConfig(_temp326);
|
|
@@ -375628,12 +376063,12 @@ function LogoV2() {
|
|
|
375628
376063
|
return t41;
|
|
375629
376064
|
}
|
|
375630
376065
|
function _temp326(current) {
|
|
375631
|
-
if (current.lastReleaseNotesSeen === "1.27.
|
|
376066
|
+
if (current.lastReleaseNotesSeen === "1.27.6") {
|
|
375632
376067
|
return current;
|
|
375633
376068
|
}
|
|
375634
376069
|
return {
|
|
375635
376070
|
...current,
|
|
375636
|
-
lastReleaseNotesSeen: "1.27.
|
|
376071
|
+
lastReleaseNotesSeen: "1.27.6"
|
|
375637
376072
|
};
|
|
375638
376073
|
}
|
|
375639
376074
|
function _temp243(s_0) {
|
|
@@ -381238,9 +381673,9 @@ function extractSearchableText(message) {
|
|
|
381238
381673
|
}
|
|
381239
381674
|
function buildSearchableText(log) {
|
|
381240
381675
|
const searchableMessages = log.messages.length <= DEEP_SEARCH_MAX_MESSAGES ? log.messages : [...log.messages.slice(0, DEEP_SEARCH_CROP_SIZE), ...log.messages.slice(-DEEP_SEARCH_CROP_SIZE)];
|
|
381241
|
-
const
|
|
381676
|
+
const messageText2 = searchableMessages.map(extractSearchableText).filter(Boolean).join(" ");
|
|
381242
381677
|
const metadata = [log.customTitle, log.summary, log.firstPrompt, log.gitBranch, log.tag, log.prNumber ? `PR #${log.prNumber}` : undefined, log.prRepository].filter(Boolean).join(" ");
|
|
381243
|
-
const fullText = `${metadata} ${
|
|
381678
|
+
const fullText = `${metadata} ${messageText2}`.trim();
|
|
381244
381679
|
return fullText.length > DEEP_SEARCH_MAX_TEXT_LENGTH ? fullText.slice(0, DEEP_SEARCH_MAX_TEXT_LENGTH) : fullText;
|
|
381245
381680
|
}
|
|
381246
381681
|
function groupLogsBySessionId(filteredLogs) {
|
|
@@ -383104,11 +383539,11 @@ async function pollForApprovedExitPlanMode(sessionId, timeoutMs, onPhaseChange,
|
|
|
383104
383539
|
}
|
|
383105
383540
|
throw new UltraplanPollError(scanner.everSeenPending ? `no approval after ${timeoutMs / 1000}s` : `ExitPlanMode never reached after ${timeoutMs / 1000}s (the remote container failed to start, or session ID mismatch?)`, scanner.everSeenPending ? "timeout_pending" : "timeout_no_plan", scanner.rejectCount);
|
|
383106
383541
|
}
|
|
383107
|
-
function
|
|
383542
|
+
function contentToText3(content) {
|
|
383108
383543
|
return typeof content === "string" ? content : Array.isArray(content) ? content.map((b) => ("text" in b) ? b.text : "").join("") : "";
|
|
383109
383544
|
}
|
|
383110
383545
|
function extractTeleportPlan(content) {
|
|
383111
|
-
const text =
|
|
383546
|
+
const text = contentToText3(content);
|
|
383112
383547
|
const marker = `${ULTRAPLAN_TELEPORT_SENTINEL}
|
|
383113
383548
|
`;
|
|
383114
383549
|
const idx = text.indexOf(marker);
|
|
@@ -383117,7 +383552,7 @@ function extractTeleportPlan(content) {
|
|
|
383117
383552
|
return text.slice(idx + marker.length).trimEnd();
|
|
383118
383553
|
}
|
|
383119
383554
|
function extractApprovedPlan(content) {
|
|
383120
|
-
const text =
|
|
383555
|
+
const text = contentToText3(content);
|
|
383121
383556
|
const markers = [
|
|
383122
383557
|
`## Approved Plan (edited by user):
|
|
383123
383558
|
`,
|
|
@@ -385596,7 +386031,7 @@ var init_InProcessTeammateDetailDialog = __esm(() => {
|
|
|
385596
386031
|
});
|
|
385597
386032
|
|
|
385598
386033
|
// src/utils/messages/mappers.ts
|
|
385599
|
-
import { randomUUID as
|
|
386034
|
+
import { randomUUID as randomUUID34 } from "crypto";
|
|
385600
386035
|
function toInternalMessages(messages) {
|
|
385601
386036
|
return messages.flatMap((message) => {
|
|
385602
386037
|
switch (message.type) {
|
|
@@ -385615,7 +386050,7 @@ function toInternalMessages(messages) {
|
|
|
385615
386050
|
{
|
|
385616
386051
|
type: "user",
|
|
385617
386052
|
message: message.message,
|
|
385618
|
-
uuid: message.uuid ??
|
|
386053
|
+
uuid: message.uuid ?? randomUUID34(),
|
|
385619
386054
|
timestamp: message.timestamp ?? new Date().toISOString(),
|
|
385620
386055
|
isMeta: message.isSynthetic
|
|
385621
386056
|
}
|
|
@@ -392552,7 +392987,7 @@ __export(exports_acpServer, {
|
|
|
392552
392987
|
handleAcpRequest: () => handleAcpRequest,
|
|
392553
392988
|
getAcpServerPort: () => getAcpServerPort
|
|
392554
392989
|
});
|
|
392555
|
-
import { randomUUID as
|
|
392990
|
+
import { randomUUID as randomUUID35 } from "crypto";
|
|
392556
392991
|
function jsonResponse2(status2, body) {
|
|
392557
392992
|
return new Response(JSON.stringify(body, null, 2), {
|
|
392558
392993
|
status: status2,
|
|
@@ -392569,7 +393004,7 @@ function rpcError(id, code, message, data) {
|
|
|
392569
393004
|
return { jsonrpc: "2.0", id, error: { code, message, data } };
|
|
392570
393005
|
}
|
|
392571
393006
|
function createAcpId() {
|
|
392572
|
-
return `acp_${Date.now().toString(36)}_${
|
|
393007
|
+
return `acp_${Date.now().toString(36)}_${randomUUID35().slice(0, 8)}`;
|
|
392573
393008
|
}
|
|
392574
393009
|
function now6() {
|
|
392575
393010
|
return new Date().toISOString();
|
|
@@ -392622,7 +393057,7 @@ function buildToolUseContext(tools, readFileStateCache) {
|
|
|
392622
393057
|
async function handleInitialize() {
|
|
392623
393058
|
return {
|
|
392624
393059
|
name: "ur-agent",
|
|
392625
|
-
version: "1.27.
|
|
393060
|
+
version: "1.27.6",
|
|
392626
393061
|
protocolVersion: "0.1.0"
|
|
392627
393062
|
};
|
|
392628
393063
|
}
|
|
@@ -513246,14 +513681,14 @@ ${lanes.join(`
|
|
|
513246
513681
|
}
|
|
513247
513682
|
if (diagnostic.relatedInformation) {
|
|
513248
513683
|
output += host.getNewLine();
|
|
513249
|
-
for (const { file: file2, start, length: length2, messageText } of diagnostic.relatedInformation) {
|
|
513684
|
+
for (const { file: file2, start, length: length2, messageText: messageText2 } of diagnostic.relatedInformation) {
|
|
513250
513685
|
if (file2) {
|
|
513251
513686
|
output += host.getNewLine();
|
|
513252
513687
|
output += halfIndent + formatLocation2(file2, start, host);
|
|
513253
513688
|
output += formatCodeSpan(file2, start, length2, indent, "\x1B[96m", host);
|
|
513254
513689
|
}
|
|
513255
513690
|
output += host.getNewLine();
|
|
513256
|
-
output += indent + flattenDiagnosticMessageText(
|
|
513691
|
+
output += indent + flattenDiagnosticMessageText(messageText2, host.getNewLine());
|
|
513257
513692
|
}
|
|
513258
513693
|
}
|
|
513259
513694
|
output += host.getNewLine();
|
|
@@ -542025,8 +542460,8 @@ ${newComment.split(`
|
|
|
542025
542460
|
}
|
|
542026
542461
|
}
|
|
542027
542462
|
}
|
|
542028
|
-
function tryGetConstraintFromDiagnosticMessage(
|
|
542029
|
-
const [, constraint] = flattenDiagnosticMessageText(
|
|
542463
|
+
function tryGetConstraintFromDiagnosticMessage(messageText2) {
|
|
542464
|
+
const [, constraint] = flattenDiagnosticMessageText(messageText2, `
|
|
542030
542465
|
`, 0).match(/`extends (.*)`/) || [];
|
|
542031
542466
|
return constraint;
|
|
542032
542467
|
}
|
|
@@ -543680,8 +544115,8 @@ ${newComment.split(`
|
|
|
543680
544115
|
const operator = expression.operatorToken.kind;
|
|
543681
544116
|
changes.replaceNode(sourceFile, expression, operator === 38 || operator === 36 ? factory2.createPrefixUnaryExpression(54, callExpression) : callExpression);
|
|
543682
544117
|
}
|
|
543683
|
-
function getSuggestion(
|
|
543684
|
-
const [, suggestion] = flattenDiagnosticMessageText(
|
|
544118
|
+
function getSuggestion(messageText2) {
|
|
544119
|
+
const [, suggestion] = flattenDiagnosticMessageText(messageText2, `
|
|
543685
544120
|
`, 0).match(/'(.*)'/) || [];
|
|
543686
544121
|
return suggestion;
|
|
543687
544122
|
}
|
|
@@ -585108,7 +585543,7 @@ __export(exports_branch, {
|
|
|
585108
585543
|
deriveFirstPrompt: () => deriveFirstPrompt,
|
|
585109
585544
|
call: () => call129
|
|
585110
585545
|
});
|
|
585111
|
-
import { randomUUID as
|
|
585546
|
+
import { randomUUID as randomUUID36 } from "crypto";
|
|
585112
585547
|
import { mkdir as mkdir34, readFile as readFile46, writeFile as writeFile39 } from "fs/promises";
|
|
585113
585548
|
function deriveFirstPrompt(firstUserMessage) {
|
|
585114
585549
|
const content = firstUserMessage?.message?.content;
|
|
@@ -585120,7 +585555,7 @@ function deriveFirstPrompt(firstUserMessage) {
|
|
|
585120
585555
|
return raw.replace(/\s+/g, " ").trim().slice(0, 100) || "Branched conversation";
|
|
585121
585556
|
}
|
|
585122
585557
|
async function createFork(customTitle) {
|
|
585123
|
-
const forkSessionId =
|
|
585558
|
+
const forkSessionId = randomUUID36();
|
|
585124
585559
|
const originalSessionId = getSessionId();
|
|
585125
585560
|
const projectDir = getProjectDir2(getOriginalCwd());
|
|
585126
585561
|
const forkSessionPath = getTranscriptPathForSession(forkSessionId);
|
|
@@ -591338,6 +591773,7 @@ var init_settingsSync = __esm(() => {
|
|
|
591338
591773
|
init_diagLogs();
|
|
591339
591774
|
init_errors();
|
|
591340
591775
|
init_git();
|
|
591776
|
+
init_providers();
|
|
591341
591777
|
init_internalWrites();
|
|
591342
591778
|
init_settings2();
|
|
591343
591779
|
init_settingsCache();
|
|
@@ -591616,7 +592052,7 @@ async function captureMemoryDiagnostics(trigger2, dumpNumber = 0) {
|
|
|
591616
592052
|
smapsRollup,
|
|
591617
592053
|
platform: process.platform,
|
|
591618
592054
|
nodeVersion: process.version,
|
|
591619
|
-
ccVersion: "1.27.
|
|
592055
|
+
ccVersion: "1.27.6"
|
|
591620
592056
|
};
|
|
591621
592057
|
}
|
|
591622
592058
|
async function performHeapDump(trigger2 = "manual", dumpNumber = 0) {
|
|
@@ -592202,7 +592638,7 @@ var init_bridge_kick = __esm(() => {
|
|
|
592202
592638
|
var call136 = async () => {
|
|
592203
592639
|
return {
|
|
592204
592640
|
type: "text",
|
|
592205
|
-
value: "1.27.
|
|
592641
|
+
value: "1.27.6"
|
|
592206
592642
|
};
|
|
592207
592643
|
}, version2, version_default;
|
|
592208
592644
|
var init_version = __esm(() => {
|
|
@@ -595180,7 +595616,25 @@ function ProviderFirstModelPicker({
|
|
|
595180
595616
|
return;
|
|
595181
595617
|
}
|
|
595182
595618
|
}
|
|
595619
|
+
let runtimeBackend;
|
|
595183
595620
|
if (selectedProvider) {
|
|
595621
|
+
try {
|
|
595622
|
+
const runtime = resolveActiveProviderModel({
|
|
595623
|
+
settings: {
|
|
595624
|
+
provider: {
|
|
595625
|
+
active: selectedProvider.value,
|
|
595626
|
+
model: value
|
|
595627
|
+
},
|
|
595628
|
+
model: value
|
|
595629
|
+
},
|
|
595630
|
+
model: value,
|
|
595631
|
+
source: "/model"
|
|
595632
|
+
});
|
|
595633
|
+
runtimeBackend = runtime.runtimeBackend;
|
|
595634
|
+
} catch (error40) {
|
|
595635
|
+
setModelWarning(error40 instanceof Error ? error40.message : String(error40));
|
|
595636
|
+
return;
|
|
595637
|
+
}
|
|
595184
595638
|
const saveResult = setProviderModel(selectedProvider.value, value, {
|
|
595185
595639
|
availableModels: modelOptions.map((option22) => option22.value),
|
|
595186
595640
|
modelSource
|
|
@@ -595204,7 +595658,8 @@ function ProviderFirstModelPicker({
|
|
|
595204
595658
|
providerId: selectedProvider.value,
|
|
595205
595659
|
providerName: selectedProvider.label,
|
|
595206
595660
|
accessType: selectedProvider.accessType,
|
|
595207
|
-
modelSource
|
|
595661
|
+
modelSource,
|
|
595662
|
+
runtimeBackend: runtimeBackend ?? "unknown"
|
|
595208
595663
|
} : undefined);
|
|
595209
595664
|
}
|
|
595210
595665
|
function handleBack() {
|
|
@@ -595511,6 +595966,7 @@ var init_ProviderFirstModelPicker = __esm(() => {
|
|
|
595511
595966
|
init_effort();
|
|
595512
595967
|
init_model();
|
|
595513
595968
|
init_thinking();
|
|
595969
|
+
init_providerClient();
|
|
595514
595970
|
import_react188 = __toESM(require_react(), 1);
|
|
595515
595971
|
jsx_dev_runtime346 = __toESM(require_jsx_dev_runtime(), 1);
|
|
595516
595972
|
});
|
|
@@ -595562,7 +596018,8 @@ function ModelPickerWrapper(t0) {
|
|
|
595562
596018
|
}));
|
|
595563
596019
|
let message = metadata ? `Selected provider: ${source_default.bold(metadata.providerName)} (${metadata.accessType})
|
|
595564
596020
|
Selected model: ${source_default.bold(renderModelLabel(model))}
|
|
595565
|
-
Model source: ${metadata.modelSource}
|
|
596021
|
+
Model source: ${metadata.modelSource}
|
|
596022
|
+
Runtime backend: ${metadata.runtimeBackend}` : `Set model to ${source_default.bold(renderModelLabel(model))}`;
|
|
595566
596023
|
if (effort !== undefined) {
|
|
595567
596024
|
message = message + ` with ${source_default.bold(effort)} effort`;
|
|
595568
596025
|
}
|
|
@@ -596077,6 +596534,8 @@ function ShowProviderAndClose({
|
|
|
596077
596534
|
let message = `Current provider: ${source_default.bold(providerRuntime.providerLabel)} (${providerRuntime.provider})`;
|
|
596078
596535
|
message += `
|
|
596079
596536
|
Auth mode: ${providerRuntime.authLabel}`;
|
|
596537
|
+
message += `
|
|
596538
|
+
Runtime backend: ${providerRuntime.runtimeBackend}`;
|
|
596080
596539
|
if (providerRuntime.model) {
|
|
596081
596540
|
message += `
|
|
596082
596541
|
Model: ${source_default.bold(providerRuntime.model)}`;
|
|
@@ -602082,7 +602541,7 @@ function generateHtmlReport(data, insights) {
|
|
|
602082
602541
|
</html>`;
|
|
602083
602542
|
}
|
|
602084
602543
|
function buildExportData(data, insights, facets, remoteStats) {
|
|
602085
|
-
const version3 = typeof MACRO !== "undefined" ? "1.27.
|
|
602544
|
+
const version3 = typeof MACRO !== "undefined" ? "1.27.6" : "unknown";
|
|
602086
602545
|
const remote_hosts_collected = remoteStats?.hosts.filter((h2) => h2.sessionCount > 0).map((h2) => h2.name);
|
|
602087
602546
|
const facets_summary = {
|
|
602088
602547
|
total: facets.size,
|
|
@@ -603128,6 +603587,7 @@ var init_commands3 = __esm(() => {
|
|
|
603128
603587
|
init_loadPluginCommands();
|
|
603129
603588
|
init_memoize();
|
|
603130
603589
|
init_auth();
|
|
603590
|
+
init_providers();
|
|
603131
603591
|
init_env2();
|
|
603132
603592
|
init_exit2();
|
|
603133
603593
|
init_export2();
|
|
@@ -606359,7 +606819,7 @@ var init_sessionStorage = __esm(() => {
|
|
|
606359
606819
|
init_settings2();
|
|
606360
606820
|
init_slowOperations();
|
|
606361
606821
|
init_uuid();
|
|
606362
|
-
VERSION5 = typeof MACRO !== "undefined" ? "1.27.
|
|
606822
|
+
VERSION5 = typeof MACRO !== "undefined" ? "1.27.6" : "unknown";
|
|
606363
606823
|
MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
|
|
606364
606824
|
SKIP_FIRST_PROMPT_PATTERN = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
|
|
606365
606825
|
EPHEMERAL_PROGRESS_TYPES = new Set([
|
|
@@ -607564,7 +608024,7 @@ var init_filesystem = __esm(() => {
|
|
|
607564
608024
|
});
|
|
607565
608025
|
getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
|
|
607566
608026
|
const nonce = randomBytes18(16).toString("hex");
|
|
607567
|
-
return join200(getURTempDir(), "bundled-skills", "1.27.
|
|
608027
|
+
return join200(getURTempDir(), "bundled-skills", "1.27.6", nonce);
|
|
607568
608028
|
});
|
|
607569
608029
|
getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
|
|
607570
608030
|
});
|
|
@@ -608310,9 +608770,9 @@ var init_hookHelpers = __esm(() => {
|
|
|
608310
608770
|
});
|
|
608311
608771
|
|
|
608312
608772
|
// src/utils/hooks/execPromptHook.ts
|
|
608313
|
-
import { randomUUID as
|
|
608773
|
+
import { randomUUID as randomUUID37 } from "crypto";
|
|
608314
608774
|
async function execPromptHook(hook, hookName, hookEvent, jsonInput, signal, toolUseContext, messages, toolUseID) {
|
|
608315
|
-
const effectiveToolUseID = toolUseID || `hook-${
|
|
608775
|
+
const effectiveToolUseID = toolUseID || `hook-${randomUUID37()}`;
|
|
608316
608776
|
try {
|
|
608317
608777
|
const processedPrompt = addArgumentsToPrompt(hook.prompt, jsonInput);
|
|
608318
608778
|
logForDebugging(`Hooks: Processing prompt hook with prompt: ${processedPrompt}`);
|
|
@@ -608466,9 +608926,9 @@ var init_execPromptHook = __esm(() => {
|
|
|
608466
608926
|
});
|
|
608467
608927
|
|
|
608468
608928
|
// src/utils/hooks/execAgentHook.ts
|
|
608469
|
-
import { randomUUID as
|
|
608929
|
+
import { randomUUID as randomUUID38 } from "crypto";
|
|
608470
608930
|
async function execAgentHook(hook, hookName, hookEvent, jsonInput, signal, toolUseContext, toolUseID, _messages, agentName) {
|
|
608471
|
-
const effectiveToolUseID = toolUseID || `hook-${
|
|
608931
|
+
const effectiveToolUseID = toolUseID || `hook-${randomUUID38()}`;
|
|
608472
608932
|
const transcriptPath = toolUseContext.agentId ? getAgentTranscriptPath(toolUseContext.agentId) : getTranscriptPath();
|
|
608473
608933
|
const hookStartTime = Date.now();
|
|
608474
608934
|
try {
|
|
@@ -608503,7 +608963,7 @@ When done, return your result using the ${SYNTHETIC_OUTPUT_TOOL_NAME} tool with:
|
|
|
608503
608963
|
]);
|
|
608504
608964
|
const model = hook.model ?? getSmallFastModel();
|
|
608505
608965
|
const MAX_AGENT_TURNS = 50;
|
|
608506
|
-
const hookAgentId = asAgentId(`hook-agent-${
|
|
608966
|
+
const hookAgentId = asAgentId(`hook-agent-${randomUUID38()}`);
|
|
608507
608967
|
const agentToolUseContext = {
|
|
608508
608968
|
...toolUseContext,
|
|
608509
608969
|
agentId: hookAgentId,
|
|
@@ -609003,7 +609463,7 @@ __export(exports_hooks2, {
|
|
|
609003
609463
|
});
|
|
609004
609464
|
import { basename as basename45 } from "path";
|
|
609005
609465
|
import { spawn as spawn11 } from "child_process";
|
|
609006
|
-
import { randomUUID as
|
|
609466
|
+
import { randomUUID as randomUUID39 } from "crypto";
|
|
609007
609467
|
function getSessionEndHookTimeoutMs() {
|
|
609008
609468
|
const raw = process.env.UR_CODE_SESSIONEND_HOOKS_TIMEOUT_MS;
|
|
609009
609469
|
const parsed = raw ? parseInt(raw, 10) : NaN;
|
|
@@ -610041,7 +610501,7 @@ async function* executeHooks({
|
|
|
610041
610501
|
parentToolUseID: toolUseID,
|
|
610042
610502
|
toolUseID,
|
|
610043
610503
|
timestamp: new Date().toISOString(),
|
|
610044
|
-
uuid:
|
|
610504
|
+
uuid: randomUUID39()
|
|
610045
610505
|
}
|
|
610046
610506
|
};
|
|
610047
610507
|
}
|
|
@@ -610103,7 +610563,7 @@ async function* executeHooks({
|
|
|
610103
610563
|
const { signal: abortSignal, cleanup } = createCombinedAbortSignal(signal, {
|
|
610104
610564
|
timeoutMs: commandTimeoutMs
|
|
610105
610565
|
});
|
|
610106
|
-
const hookId =
|
|
610566
|
+
const hookId = randomUUID39();
|
|
610107
610567
|
const hookStartMs = Date.now();
|
|
610108
610568
|
const hookCommand = getHookDisplayText(hook);
|
|
610109
610569
|
try {
|
|
@@ -610751,7 +611211,7 @@ async function executeHooksOutsideREPL({
|
|
|
610751
611211
|
const callbackTimeoutMs = hook.timeout ? hook.timeout * 1000 : timeoutMs;
|
|
610752
611212
|
const { signal: abortSignal2, cleanup: cleanup2 } = createCombinedAbortSignal(signal, { timeoutMs: callbackTimeoutMs });
|
|
610753
611213
|
try {
|
|
610754
|
-
const toolUseID =
|
|
611214
|
+
const toolUseID = randomUUID39();
|
|
610755
611215
|
const json2 = await hook.callback(hookInput, toolUseID, abortSignal2, hookIndex);
|
|
610756
611216
|
cleanup2?.();
|
|
610757
611217
|
if (isAsyncHookJSONOutput(json2)) {
|
|
@@ -610862,7 +611322,7 @@ async function executeHooksOutsideREPL({
|
|
|
610862
611322
|
const commandTimeoutMs = hook.timeout ? hook.timeout * 1000 : timeoutMs;
|
|
610863
611323
|
const { signal: abortSignal, cleanup } = createCombinedAbortSignal(signal, { timeoutMs: commandTimeoutMs });
|
|
610864
611324
|
try {
|
|
610865
|
-
const result = await execCommandHook(hook, hookEvent, hookName, jsonInput, abortSignal,
|
|
611325
|
+
const result = await execCommandHook(hook, hookEvent, hookName, jsonInput, abortSignal, randomUUID39(), hookIndex, pluginRoot, pluginId);
|
|
610866
611326
|
cleanup?.();
|
|
610867
611327
|
if (result.aborted) {
|
|
610868
611328
|
logForDebugging(`${hookName} [${hook.command}] cancelled`);
|
|
@@ -611063,7 +611523,7 @@ async function* executeStopHooks(permissionMode, signal, timeoutMs = TOOL_HOOK_E
|
|
|
611063
611523
|
};
|
|
611064
611524
|
yield* executeHooks({
|
|
611065
611525
|
hookInput,
|
|
611066
|
-
toolUseID:
|
|
611526
|
+
toolUseID: randomUUID39(),
|
|
611067
611527
|
signal,
|
|
611068
611528
|
timeoutMs,
|
|
611069
611529
|
toolUseContext,
|
|
@@ -611080,7 +611540,7 @@ async function* executeTeammateIdleHooks(teammateName, teamName, permissionMode,
|
|
|
611080
611540
|
};
|
|
611081
611541
|
yield* executeHooks({
|
|
611082
611542
|
hookInput,
|
|
611083
|
-
toolUseID:
|
|
611543
|
+
toolUseID: randomUUID39(),
|
|
611084
611544
|
signal,
|
|
611085
611545
|
timeoutMs
|
|
611086
611546
|
});
|
|
@@ -611097,7 +611557,7 @@ async function* executeTaskCreatedHooks(taskId, taskSubject, taskDescription, te
|
|
|
611097
611557
|
};
|
|
611098
611558
|
yield* executeHooks({
|
|
611099
611559
|
hookInput,
|
|
611100
|
-
toolUseID:
|
|
611560
|
+
toolUseID: randomUUID39(),
|
|
611101
611561
|
signal,
|
|
611102
611562
|
timeoutMs,
|
|
611103
611563
|
toolUseContext
|
|
@@ -611115,7 +611575,7 @@ async function* executeTaskCompletedHooks(taskId, taskSubject, taskDescription,
|
|
|
611115
611575
|
};
|
|
611116
611576
|
yield* executeHooks({
|
|
611117
611577
|
hookInput,
|
|
611118
|
-
toolUseID:
|
|
611578
|
+
toolUseID: randomUUID39(),
|
|
611119
611579
|
signal,
|
|
611120
611580
|
timeoutMs,
|
|
611121
611581
|
toolUseContext
|
|
@@ -611134,7 +611594,7 @@ async function* executeUserPromptSubmitHooks(prompt, permissionMode, toolUseCont
|
|
|
611134
611594
|
};
|
|
611135
611595
|
yield* executeHooks({
|
|
611136
611596
|
hookInput,
|
|
611137
|
-
toolUseID:
|
|
611597
|
+
toolUseID: randomUUID39(),
|
|
611138
611598
|
signal: toolUseContext.abortController.signal,
|
|
611139
611599
|
timeoutMs: TOOL_HOOK_EXECUTION_TIMEOUT_MS,
|
|
611140
611600
|
toolUseContext,
|
|
@@ -611151,7 +611611,7 @@ async function* executeSessionStartHooks(source, sessionId, agentType, model, si
|
|
|
611151
611611
|
};
|
|
611152
611612
|
yield* executeHooks({
|
|
611153
611613
|
hookInput,
|
|
611154
|
-
toolUseID:
|
|
611614
|
+
toolUseID: randomUUID39(),
|
|
611155
611615
|
matchQuery: source,
|
|
611156
611616
|
signal,
|
|
611157
611617
|
timeoutMs,
|
|
@@ -611166,7 +611626,7 @@ async function* executeSetupHooks(trigger2, signal, timeoutMs = TOOL_HOOK_EXECUT
|
|
|
611166
611626
|
};
|
|
611167
611627
|
yield* executeHooks({
|
|
611168
611628
|
hookInput,
|
|
611169
|
-
toolUseID:
|
|
611629
|
+
toolUseID: randomUUID39(),
|
|
611170
611630
|
matchQuery: trigger2,
|
|
611171
611631
|
signal,
|
|
611172
611632
|
timeoutMs,
|
|
@@ -611182,7 +611642,7 @@ async function* executeSubagentStartHooks(agentId, agentType, signal, timeoutMs
|
|
|
611182
611642
|
};
|
|
611183
611643
|
yield* executeHooks({
|
|
611184
611644
|
hookInput,
|
|
611185
|
-
toolUseID:
|
|
611645
|
+
toolUseID: randomUUID39(),
|
|
611186
611646
|
matchQuery: agentType,
|
|
611187
611647
|
signal,
|
|
611188
611648
|
timeoutMs
|
|
@@ -611545,7 +612005,7 @@ async function executeStatusLineCommand(statusLineInput, signal, timeoutMs = 500
|
|
|
611545
612005
|
const abortSignal = signal || AbortSignal.timeout(timeoutMs);
|
|
611546
612006
|
try {
|
|
611547
612007
|
const jsonInput = jsonStringify(statusLineInput);
|
|
611548
|
-
const result = await execCommandHook(statusLine, "StatusLine", "statusLine", jsonInput, abortSignal,
|
|
612008
|
+
const result = await execCommandHook(statusLine, "StatusLine", "statusLine", jsonInput, abortSignal, randomUUID39());
|
|
611549
612009
|
if (result.aborted) {
|
|
611550
612010
|
return;
|
|
611551
612011
|
}
|
|
@@ -611589,7 +612049,7 @@ async function executeFileSuggestionCommand(fileSuggestionInput, signal, timeout
|
|
|
611589
612049
|
try {
|
|
611590
612050
|
const jsonInput = jsonStringify(fileSuggestionInput);
|
|
611591
612051
|
const hook = { type: "command", command: fileSuggestion.command };
|
|
611592
|
-
const result = await execCommandHook(hook, "FileSuggestion", "FileSuggestion", jsonInput, abortSignal,
|
|
612052
|
+
const result = await execCommandHook(hook, "FileSuggestion", "FileSuggestion", jsonInput, abortSignal, randomUUID39());
|
|
611593
612053
|
if (result.aborted || result.status !== 0) {
|
|
611594
612054
|
return [];
|
|
611595
612055
|
}
|
|
@@ -611845,7 +612305,7 @@ async function executeBeforeCommandHooks(command8, shellType, cwd2, toolUseConte
|
|
|
611845
612305
|
const results = [];
|
|
611846
612306
|
for await (const result of executeHooks({
|
|
611847
612307
|
hookInput,
|
|
611848
|
-
toolUseID: options2?.toolUseID ??
|
|
612308
|
+
toolUseID: options2?.toolUseID ?? randomUUID39(),
|
|
611849
612309
|
matchQuery: command8,
|
|
611850
612310
|
signal: options2?.signal,
|
|
611851
612311
|
timeoutMs: options2?.timeoutMs ?? TOOL_HOOK_EXECUTION_TIMEOUT_MS,
|
|
@@ -611884,7 +612344,7 @@ async function executeAfterCommandHooks(command8, shellType, cwd2, exitCode, std
|
|
|
611884
612344
|
const results = [];
|
|
611885
612345
|
for await (const result of executeHooks({
|
|
611886
612346
|
hookInput,
|
|
611887
|
-
toolUseID: options2?.toolUseID ??
|
|
612347
|
+
toolUseID: options2?.toolUseID ?? randomUUID39(),
|
|
611888
612348
|
matchQuery: command8,
|
|
611889
612349
|
signal: options2?.signal,
|
|
611890
612350
|
timeoutMs: options2?.timeoutMs ?? TOOL_HOOK_EXECUTION_TIMEOUT_MS,
|
|
@@ -611920,7 +612380,7 @@ async function executeBeforeCommitHooks(command8, toolUseContext, options2) {
|
|
|
611920
612380
|
const results = [];
|
|
611921
612381
|
for await (const result of executeHooks({
|
|
611922
612382
|
hookInput,
|
|
611923
|
-
toolUseID: options2?.toolUseID ??
|
|
612383
|
+
toolUseID: options2?.toolUseID ?? randomUUID39(),
|
|
611924
612384
|
matchQuery: command8,
|
|
611925
612385
|
signal: options2?.signal,
|
|
611926
612386
|
timeoutMs: options2?.timeoutMs ?? TOOL_HOOK_EXECUTION_TIMEOUT_MS,
|
|
@@ -611960,7 +612420,7 @@ async function executeOnFailureHooks2(error40, stage, toolUseContext, options2)
|
|
|
611960
612420
|
const results = [];
|
|
611961
612421
|
for await (const result of executeHooks({
|
|
611962
612422
|
hookInput,
|
|
611963
|
-
toolUseID: options2?.toolUseID ??
|
|
612423
|
+
toolUseID: options2?.toolUseID ?? randomUUID39(),
|
|
611964
612424
|
matchQuery: stage,
|
|
611965
612425
|
signal: options2?.signal,
|
|
611966
612426
|
timeoutMs: options2?.timeoutMs ?? TOOL_HOOK_EXECUTION_TIMEOUT_MS,
|
|
@@ -613384,6 +613844,7 @@ var init_prompts4 = __esm(() => {
|
|
|
613384
613844
|
init_prompt2();
|
|
613385
613845
|
init_model();
|
|
613386
613846
|
init_antModels();
|
|
613847
|
+
init_providers();
|
|
613387
613848
|
init_commands3();
|
|
613388
613849
|
init_outputStyles();
|
|
613389
613850
|
init_prompt();
|
|
@@ -613812,6 +614273,7 @@ var init_api3 = __esm(() => {
|
|
|
613812
614273
|
init_debug();
|
|
613813
614274
|
init_envUtils();
|
|
613814
614275
|
init_messages();
|
|
614276
|
+
init_providers();
|
|
613815
614277
|
init_filesystem();
|
|
613816
614278
|
init_plans();
|
|
613817
614279
|
init_platform();
|
|
@@ -613845,16 +614307,16 @@ function extractFirstMessageText(messages) {
|
|
|
613845
614307
|
}
|
|
613846
614308
|
return "";
|
|
613847
614309
|
}
|
|
613848
|
-
function computeFingerprint(
|
|
614310
|
+
function computeFingerprint(messageText2, version3) {
|
|
613849
614311
|
const indices = [4, 7, 20];
|
|
613850
|
-
const chars = indices.map((i3) =>
|
|
614312
|
+
const chars = indices.map((i3) => messageText2[i3] || "0").join("");
|
|
613851
614313
|
const fingerprintInput = `${FINGERPRINT_SALT}${chars}${version3}`;
|
|
613852
614314
|
const hash2 = createHash26("sha256").update(fingerprintInput).digest("hex");
|
|
613853
614315
|
return hash2.slice(0, 3);
|
|
613854
614316
|
}
|
|
613855
614317
|
function computeFingerprintFromMessages(messages) {
|
|
613856
614318
|
const firstMessageText = extractFirstMessageText(messages);
|
|
613857
|
-
return computeFingerprint(firstMessageText, "1.27.
|
|
614319
|
+
return computeFingerprint(firstMessageText, "1.27.6");
|
|
613858
614320
|
}
|
|
613859
614321
|
var FINGERPRINT_SALT = "59cf53e54c78";
|
|
613860
614322
|
var init_fingerprint = () => {};
|
|
@@ -613967,7 +614429,7 @@ function insertBlockAfterToolResults(content, block2) {
|
|
|
613967
614429
|
}
|
|
613968
614430
|
|
|
613969
614431
|
// src/services/api/ur.ts
|
|
613970
|
-
import { randomUUID as
|
|
614432
|
+
import { randomUUID as randomUUID40 } from "crypto";
|
|
613971
614433
|
function getExtraBodyParams(betaHeaders) {
|
|
613972
614434
|
const extraBodyStr = process.env.UR_CODE_EXTRA_BODY;
|
|
613973
614435
|
let result = {};
|
|
@@ -614682,7 +615144,7 @@ ${deferredToolList}
|
|
|
614682
615144
|
let ttftMs = 0;
|
|
614683
615145
|
let partialMessage = undefined;
|
|
614684
615146
|
const contentBlocks = [];
|
|
614685
|
-
let usage22 =
|
|
615147
|
+
let usage22 = EMPTY_USAGE2;
|
|
614686
615148
|
let costUSD = 0;
|
|
614687
615149
|
let stopReason = null;
|
|
614688
615150
|
let didFallBackToNonStreaming = false;
|
|
@@ -614743,7 +615205,7 @@ ${deferredToolList}
|
|
|
614743
615205
|
if (!options2.agentId) {
|
|
614744
615206
|
headlessProfilerCheckpoint("api_request_sent");
|
|
614745
615207
|
}
|
|
614746
|
-
clientRequestId = getAPIProvider() === "firstParty" && isFirstPartyURHQBaseUrl() ?
|
|
615208
|
+
clientRequestId = getAPIProvider() === "firstParty" && isFirstPartyURHQBaseUrl() ? randomUUID40() : undefined;
|
|
614747
615209
|
const result = await urhq.beta.messages.create({ ...params, stream: true }, {
|
|
614748
615210
|
signal,
|
|
614749
615211
|
...clientRequestId && {
|
|
@@ -614774,7 +615236,7 @@ ${deferredToolList}
|
|
|
614774
615236
|
ttftMs = 0;
|
|
614775
615237
|
partialMessage = undefined;
|
|
614776
615238
|
contentBlocks.length = 0;
|
|
614777
|
-
usage22 =
|
|
615239
|
+
usage22 = EMPTY_USAGE2;
|
|
614778
615240
|
stopReason = null;
|
|
614779
615241
|
isAdvisorInProgress = false;
|
|
614780
615242
|
const streamWatchdogEnabled = isEnvTruthy(process.env.UR_ENABLE_STREAM_WATCHDOG);
|
|
@@ -614974,7 +615436,7 @@ ${deferredToolList}
|
|
|
614974
615436
|
},
|
|
614975
615437
|
requestId: streamRequestId ?? undefined,
|
|
614976
615438
|
type: "assistant",
|
|
614977
|
-
uuid:
|
|
615439
|
+
uuid: randomUUID40(),
|
|
614978
615440
|
timestamp: new Date().toISOString(),
|
|
614979
615441
|
...process.env.USER_TYPE === "ant" && research2 !== undefined && { research: research2 },
|
|
614980
615442
|
...advisorModel && { advisorModel }
|
|
@@ -615154,7 +615616,7 @@ ${deferredToolList}
|
|
|
615154
615616
|
},
|
|
615155
615617
|
requestId: streamRequestId ?? undefined,
|
|
615156
615618
|
type: "assistant",
|
|
615157
|
-
uuid:
|
|
615619
|
+
uuid: randomUUID40(),
|
|
615158
615620
|
timestamp: new Date().toISOString(),
|
|
615159
615621
|
...process.env.USER_TYPE === "ant" && research2 !== undefined && {
|
|
615160
615622
|
research: research2
|
|
@@ -615208,7 +615670,7 @@ ${deferredToolList}
|
|
|
615208
615670
|
},
|
|
615209
615671
|
requestId: streamRequestId ?? undefined,
|
|
615210
615672
|
type: "assistant",
|
|
615211
|
-
uuid:
|
|
615673
|
+
uuid: randomUUID40(),
|
|
615212
615674
|
timestamp: new Date().toISOString(),
|
|
615213
615675
|
...process.env.USER_TYPE === "ant" && research2 !== undefined && { research: research2 },
|
|
615214
615676
|
...advisorModel && { advisorModel }
|
|
@@ -615306,7 +615768,7 @@ ${deferredToolList}
|
|
|
615306
615768
|
releaseStreamResources();
|
|
615307
615769
|
if (fallbackMessage) {
|
|
615308
615770
|
const fallbackUsage = fallbackMessage.message.usage;
|
|
615309
|
-
usage22 = updateUsage(
|
|
615771
|
+
usage22 = updateUsage(EMPTY_USAGE2, fallbackUsage);
|
|
615310
615772
|
stopReason = fallbackMessage.message.stop_reason;
|
|
615311
615773
|
const fallbackCost = calculateUSDCost(resolvedModel, fallbackUsage);
|
|
615312
615774
|
costUSD += addToTotalSessionCost(fallbackCost, fallbackUsage, options2.model);
|
|
@@ -615621,6 +616083,7 @@ function getMaxOutputTokensForModel(model) {
|
|
|
615621
616083
|
}
|
|
615622
616084
|
var MAX_NON_STREAMING_TOKENS = 64000;
|
|
615623
616085
|
var init_ur2 = __esm(() => {
|
|
616086
|
+
init_providers();
|
|
615624
616087
|
init_system();
|
|
615625
616088
|
init_Tool();
|
|
615626
616089
|
init_api3();
|
|
@@ -615719,8 +616182,8 @@ async function sideQuery(opts) {
|
|
|
615719
616182
|
if (output_format && modelSupportsStructuredOutputs(model) && !betas.includes(STRUCTURED_OUTPUTS_BETA_HEADER)) {
|
|
615720
616183
|
betas.push(STRUCTURED_OUTPUTS_BETA_HEADER);
|
|
615721
616184
|
}
|
|
615722
|
-
const
|
|
615723
|
-
const fingerprint = computeFingerprint(
|
|
616185
|
+
const messageText2 = extractFirstUserMessageText(messages);
|
|
616186
|
+
const fingerprint = computeFingerprint(messageText2, "1.27.6");
|
|
615724
616187
|
const attributionHeader = getAttributionHeader(fingerprint);
|
|
615725
616188
|
const systemBlocks = [
|
|
615726
616189
|
attributionHeader ? { type: "text", text: attributionHeader } : null,
|
|
@@ -620435,7 +620898,7 @@ var init_inboundMessages = __esm(() => {
|
|
|
620435
620898
|
});
|
|
620436
620899
|
|
|
620437
620900
|
// src/utils/messages/systemInit.ts
|
|
620438
|
-
import { randomUUID as
|
|
620901
|
+
import { randomUUID as randomUUID41 } from "crypto";
|
|
620439
620902
|
function sdkCompatToolName(name) {
|
|
620440
620903
|
return name === AGENT_TOOL_NAME ? LEGACY_AGENT_TOOL_NAME : name;
|
|
620441
620904
|
}
|
|
@@ -620457,7 +620920,7 @@ function buildSystemInitMessage(inputs) {
|
|
|
620457
620920
|
slash_commands: inputs.commands.filter((c4) => c4.userInvocable !== false).map((c4) => c4.name),
|
|
620458
620921
|
apiKeySource: getURHQApiKeyWithSource().source,
|
|
620459
620922
|
betas: getSdkBetas(),
|
|
620460
|
-
ur_version: "1.27.
|
|
620923
|
+
ur_version: "1.27.6",
|
|
620461
620924
|
output_style: outputStyle2,
|
|
620462
620925
|
agents: inputs.agents.map((agent) => agent.agentType),
|
|
620463
620926
|
skills: inputs.skills.filter((s) => s.userInvocable !== false).map((skill2) => skill2.name),
|
|
@@ -620466,7 +620929,7 @@ function buildSystemInitMessage(inputs) {
|
|
|
620466
620929
|
path: plugin2.path,
|
|
620467
620930
|
source: plugin2.source
|
|
620468
620931
|
})),
|
|
620469
|
-
uuid:
|
|
620932
|
+
uuid: randomUUID41()
|
|
620470
620933
|
};
|
|
620471
620934
|
if (false) {}
|
|
620472
620935
|
initMessage.fast_mode_state = getFastModeState(inputs.model, inputs.fastMode);
|
|
@@ -620550,7 +621013,7 @@ __export(exports_MessageSelector, {
|
|
|
620550
621013
|
messagesAfterAreOnlySynthetic: () => messagesAfterAreOnlySynthetic,
|
|
620551
621014
|
MessageSelector: () => MessageSelector
|
|
620552
621015
|
});
|
|
620553
|
-
import { randomUUID as
|
|
621016
|
+
import { randomUUID as randomUUID42 } from "crypto";
|
|
620554
621017
|
import * as path22 from "path";
|
|
620555
621018
|
function isTextBlock2(block2) {
|
|
620556
621019
|
return block2.type === "text";
|
|
@@ -620570,7 +621033,7 @@ function MessageSelector({
|
|
|
620570
621033
|
const fileHistory = useAppState((s) => s.fileHistory);
|
|
620571
621034
|
const [error40, setError] = import_react198.useState(undefined);
|
|
620572
621035
|
const isFileHistoryEnabled = fileHistoryEnabled();
|
|
620573
|
-
const currentUUID = import_react198.useMemo(
|
|
621036
|
+
const currentUUID = import_react198.useMemo(randomUUID42, []);
|
|
620574
621037
|
const messageOptions = import_react198.useMemo(() => [...messages.filter(selectableUserMessagesFilter), {
|
|
620575
621038
|
...createUserMessage({
|
|
620576
621039
|
content: ""
|
|
@@ -621287,8 +621750,8 @@ function UserMessageOption(t0) {
|
|
|
621287
621750
|
t6 = Symbol.for("react.early_return_sentinel");
|
|
621288
621751
|
bb0: {
|
|
621289
621752
|
const rawMessageText = typeof content === "string" ? content.trim() : lastBlock && isTextBlock2(lastBlock) ? lastBlock.text.trim() : "(no prompt)";
|
|
621290
|
-
const
|
|
621291
|
-
if (isEmptyMessageText(
|
|
621753
|
+
const messageText2 = stripDisplayTags(rawMessageText);
|
|
621754
|
+
if (isEmptyMessageText(messageText2)) {
|
|
621292
621755
|
let t72;
|
|
621293
621756
|
if ($3[17] !== color3 || $3[18] !== dimColor) {
|
|
621294
621757
|
t72 = /* @__PURE__ */ jsx_dev_runtime367.jsxDEV(ThemedBox_default, {
|
|
@@ -621310,8 +621773,8 @@ function UserMessageOption(t0) {
|
|
|
621310
621773
|
t6 = t72;
|
|
621311
621774
|
break bb0;
|
|
621312
621775
|
}
|
|
621313
|
-
if (
|
|
621314
|
-
const input = extractTag(
|
|
621776
|
+
if (messageText2.includes("<bash-input>")) {
|
|
621777
|
+
const input = extractTag(messageText2, "bash-input");
|
|
621315
621778
|
if (input) {
|
|
621316
621779
|
let t72;
|
|
621317
621780
|
if ($3[20] === Symbol.for("react.memo_cache_sentinel")) {
|
|
@@ -621341,10 +621804,10 @@ function UserMessageOption(t0) {
|
|
|
621341
621804
|
break bb0;
|
|
621342
621805
|
}
|
|
621343
621806
|
}
|
|
621344
|
-
if (
|
|
621345
|
-
const commandMessage = extractTag(
|
|
621346
|
-
const args = extractTag(
|
|
621347
|
-
const isSkillFormat = extractTag(
|
|
621807
|
+
if (messageText2.includes(`<${COMMAND_MESSAGE_TAG}>`)) {
|
|
621808
|
+
const commandMessage = extractTag(messageText2, COMMAND_MESSAGE_TAG);
|
|
621809
|
+
const args = extractTag(messageText2, "command-args");
|
|
621810
|
+
const isSkillFormat = extractTag(messageText2, "skill-format") === "true";
|
|
621348
621811
|
if (commandMessage) {
|
|
621349
621812
|
if (isSkillFormat) {
|
|
621350
621813
|
t6 = /* @__PURE__ */ jsx_dev_runtime367.jsxDEV(ThemedBox_default, {
|
|
@@ -621386,7 +621849,7 @@ function UserMessageOption(t0) {
|
|
|
621386
621849
|
T0 = ThemedText;
|
|
621387
621850
|
t1 = color3;
|
|
621388
621851
|
t2 = dimColor;
|
|
621389
|
-
t3 = paddingRight ? truncate(
|
|
621852
|
+
t3 = paddingRight ? truncate(messageText2, columns - paddingRight, true) : messageText2.slice(0, 500).split(`
|
|
621390
621853
|
`).slice(0, 4).join(`
|
|
621391
621854
|
`);
|
|
621392
621855
|
}
|
|
@@ -621512,8 +621975,8 @@ function selectableUserMessagesFilter(message) {
|
|
|
621512
621975
|
}
|
|
621513
621976
|
const content = message.message.content;
|
|
621514
621977
|
const lastBlock = typeof content === "string" ? null : content[content.length - 1];
|
|
621515
|
-
const
|
|
621516
|
-
if (
|
|
621978
|
+
const messageText2 = typeof content === "string" ? content.trim() : lastBlock && isTextBlock2(lastBlock) ? lastBlock.text.trim() : "";
|
|
621979
|
+
if (messageText2.indexOf(`<${LOCAL_COMMAND_STDOUT_TAG}>`) !== -1 || messageText2.indexOf(`<${LOCAL_COMMAND_STDERR_TAG}>`) !== -1 || messageText2.indexOf(`<${BASH_STDOUT_TAG}>`) !== -1 || messageText2.indexOf(`<${BASH_STDERR_TAG}>`) !== -1 || messageText2.indexOf(`<${TASK_NOTIFICATION_TAG}>`) !== -1 || messageText2.indexOf(`<${TICK_TAG}>`) !== -1 || messageText2.indexOf(`<${TEAMMATE_MESSAGE_TAG}`) !== -1) {
|
|
621517
621980
|
return false;
|
|
621518
621981
|
}
|
|
621519
621982
|
return true;
|
|
@@ -626425,7 +626888,7 @@ var init_FileEditToolDiff = __esm(() => {
|
|
|
626425
626888
|
});
|
|
626426
626889
|
|
|
626427
626890
|
// src/hooks/useDiffInIDE.ts
|
|
626428
|
-
import { randomUUID as
|
|
626891
|
+
import { randomUUID as randomUUID43 } from "crypto";
|
|
626429
626892
|
import { basename as basename48 } from "path";
|
|
626430
626893
|
function useDiffInIDE({
|
|
626431
626894
|
onChange,
|
|
@@ -626436,7 +626899,7 @@ function useDiffInIDE({
|
|
|
626436
626899
|
}) {
|
|
626437
626900
|
const isUnmounted = import_react209.useRef(false);
|
|
626438
626901
|
const [hasError, setHasError] = import_react209.useState(false);
|
|
626439
|
-
const sha = import_react209.useMemo(() =>
|
|
626902
|
+
const sha = import_react209.useMemo(() => randomUUID43().slice(0, 6), []);
|
|
626440
626903
|
const tabName = import_react209.useMemo(() => `\u2302 [UR] ${basename48(filePath)} (${sha}) \u29C9`, [filePath, sha]);
|
|
626441
626904
|
const shouldShowDiffInIDE = hasAccessToIDEExtensionDiffFeature(toolUseContext.options.mcpClients) && getGlobalConfig().diffTool === "auto" && !filePath.endsWith(".ipynb");
|
|
626442
626905
|
const ideName = getConnectedIdeName(toolUseContext.options.mcpClients) ?? "IDE";
|
|
@@ -635085,7 +635548,7 @@ var init_useVoiceEnabled = __esm(() => {
|
|
|
635085
635548
|
function getSemverPart(version3) {
|
|
635086
635549
|
return `${import_semver13.major(version3, { loose: true })}.${import_semver13.minor(version3, { loose: true })}.${import_semver13.patch(version3, { loose: true })}`;
|
|
635087
635550
|
}
|
|
635088
|
-
function useUpdateNotification(updatedVersion, initialVersion = "1.27.
|
|
635551
|
+
function useUpdateNotification(updatedVersion, initialVersion = "1.27.6") {
|
|
635089
635552
|
const [lastNotifiedSemver, setLastNotifiedSemver] = import_react226.useState(() => getSemverPart(initialVersion));
|
|
635090
635553
|
if (!updatedVersion) {
|
|
635091
635554
|
return null;
|
|
@@ -635134,7 +635597,7 @@ function AutoUpdater({
|
|
|
635134
635597
|
return;
|
|
635135
635598
|
}
|
|
635136
635599
|
if (false) {}
|
|
635137
|
-
const currentVersion = "1.27.
|
|
635600
|
+
const currentVersion = "1.27.6";
|
|
635138
635601
|
const channel = getInitialSettings()?.autoUpdatesChannel ?? "latest";
|
|
635139
635602
|
let latestVersion = await getLatestVersion(channel);
|
|
635140
635603
|
const isDisabled = isAutoUpdaterDisabled();
|
|
@@ -635363,12 +635826,12 @@ function NativeAutoUpdater({
|
|
|
635363
635826
|
logEvent("tengu_native_auto_updater_start", {});
|
|
635364
635827
|
try {
|
|
635365
635828
|
const maxVersion = await getMaxVersion();
|
|
635366
|
-
if (maxVersion && gt("1.27.
|
|
635829
|
+
if (maxVersion && gt("1.27.6", maxVersion)) {
|
|
635367
635830
|
const msg = await getMaxVersionMessage();
|
|
635368
635831
|
setMaxVersionIssue(msg ?? "affects your version");
|
|
635369
635832
|
}
|
|
635370
635833
|
const result = await installLatest(channel);
|
|
635371
|
-
const currentVersion = "1.27.
|
|
635834
|
+
const currentVersion = "1.27.6";
|
|
635372
635835
|
const latencyMs = Date.now() - startTime;
|
|
635373
635836
|
if (result.lockFailed) {
|
|
635374
635837
|
logEvent("tengu_native_auto_updater_lock_contention", {
|
|
@@ -635505,17 +635968,17 @@ function PackageManagerAutoUpdater(t0) {
|
|
|
635505
635968
|
const maxVersion = await getMaxVersion();
|
|
635506
635969
|
if (maxVersion && latest && gt(latest, maxVersion)) {
|
|
635507
635970
|
logForDebugging(`PackageManagerAutoUpdater: maxVersion ${maxVersion} is set, capping update from ${latest} to ${maxVersion}`);
|
|
635508
|
-
if (gte("1.27.
|
|
635509
|
-
logForDebugging(`PackageManagerAutoUpdater: current version ${"1.27.
|
|
635971
|
+
if (gte("1.27.6", maxVersion)) {
|
|
635972
|
+
logForDebugging(`PackageManagerAutoUpdater: current version ${"1.27.6"} is already at or above maxVersion ${maxVersion}, skipping update`);
|
|
635510
635973
|
setUpdateAvailable(false);
|
|
635511
635974
|
return;
|
|
635512
635975
|
}
|
|
635513
635976
|
latest = maxVersion;
|
|
635514
635977
|
}
|
|
635515
|
-
const hasUpdate = latest && !gte("1.27.
|
|
635978
|
+
const hasUpdate = latest && !gte("1.27.6", latest) && !shouldSkipVersion(latest);
|
|
635516
635979
|
setUpdateAvailable(!!hasUpdate);
|
|
635517
635980
|
if (hasUpdate) {
|
|
635518
|
-
logForDebugging(`PackageManagerAutoUpdater: Update available ${"1.27.
|
|
635981
|
+
logForDebugging(`PackageManagerAutoUpdater: Update available ${"1.27.6"} -> ${latest}`);
|
|
635519
635982
|
}
|
|
635520
635983
|
};
|
|
635521
635984
|
$3[0] = t1;
|
|
@@ -635549,7 +636012,7 @@ function PackageManagerAutoUpdater(t0) {
|
|
|
635549
636012
|
wrap: "truncate",
|
|
635550
636013
|
children: [
|
|
635551
636014
|
"currentVersion: ",
|
|
635552
|
-
"1.27.
|
|
636015
|
+
"1.27.6"
|
|
635553
636016
|
]
|
|
635554
636017
|
}, undefined, true, undefined, this);
|
|
635555
636018
|
$3[3] = verbose;
|
|
@@ -645885,7 +646348,7 @@ var init_teamDiscovery = __esm(() => {
|
|
|
645885
646348
|
});
|
|
645886
646349
|
|
|
645887
646350
|
// src/components/teams/TeamsDialog.tsx
|
|
645888
|
-
import { randomUUID as
|
|
646351
|
+
import { randomUUID as randomUUID44 } from "crypto";
|
|
645889
646352
|
function TeamsDialog({
|
|
645890
646353
|
initialTeams,
|
|
645891
646354
|
onDone
|
|
@@ -646509,7 +646972,7 @@ async function killTeammate(paneId, backendType, teamName, teammateId, teammateN
|
|
|
646509
646972
|
},
|
|
646510
646973
|
inbox: {
|
|
646511
646974
|
messages: [...prev.inbox.messages, {
|
|
646512
|
-
id:
|
|
646975
|
+
id: randomUUID44(),
|
|
646513
646976
|
from: "system",
|
|
646514
646977
|
text: jsonStringify({
|
|
646515
646978
|
type: "teammate_terminated",
|
|
@@ -647995,7 +648458,7 @@ function buildStatusLineCommandInput(permissionMode, exceeds200kTokens, settings
|
|
|
647995
648458
|
project_dir: getOriginalCwd(),
|
|
647996
648459
|
added_dirs: addedDirs
|
|
647997
648460
|
},
|
|
647998
|
-
version: "1.27.
|
|
648461
|
+
version: "1.27.6",
|
|
647999
648462
|
output_style: {
|
|
648000
648463
|
name: outputStyleName
|
|
648001
648464
|
},
|
|
@@ -648070,7 +648533,7 @@ function StatusLineInner({
|
|
|
648070
648533
|
const taskValues = Object.values(tasks2);
|
|
648071
648534
|
const taskRunningCount = taskValues.filter((task2) => task2.status === "running" || task2.status === "pending").length;
|
|
648072
648535
|
const defaultStatusLineText = buildDefaultStatusBar({
|
|
648073
|
-
version: "1.27.
|
|
648536
|
+
version: "1.27.6",
|
|
648074
648537
|
providerLabel: providerRuntime.providerLabel,
|
|
648075
648538
|
authMode: providerRuntime.authLabel,
|
|
648076
648539
|
model: providerRuntime.model ?? renderModelName(mainLoopModel),
|
|
@@ -652298,7 +652761,7 @@ function normalizeControlMessageKeys(obj) {
|
|
|
652298
652761
|
}
|
|
652299
652762
|
|
|
652300
652763
|
// src/bridge/bridgeMessaging.ts
|
|
652301
|
-
import { randomUUID as
|
|
652764
|
+
import { randomUUID as randomUUID45 } from "crypto";
|
|
652302
652765
|
function isSDKMessage(value) {
|
|
652303
652766
|
return value !== null && typeof value === "object" && "type" in value && typeof value.type === "string";
|
|
652304
652767
|
}
|
|
@@ -652502,11 +652965,11 @@ function makeResultMessage(sessionId) {
|
|
|
652502
652965
|
result: "",
|
|
652503
652966
|
stop_reason: null,
|
|
652504
652967
|
total_cost_usd: 0,
|
|
652505
|
-
usage: { ...
|
|
652968
|
+
usage: { ...EMPTY_USAGE2 },
|
|
652506
652969
|
modelUsage: {},
|
|
652507
652970
|
permission_denials: [],
|
|
652508
652971
|
session_id: sessionId,
|
|
652509
|
-
uuid:
|
|
652972
|
+
uuid: randomUUID45()
|
|
652510
652973
|
};
|
|
652511
652974
|
}
|
|
652512
652975
|
|
|
@@ -652550,7 +653013,7 @@ var init_bridgeMessaging = __esm(() => {
|
|
|
652550
653013
|
});
|
|
652551
653014
|
|
|
652552
653015
|
// src/remote/SessionsWebSocket.ts
|
|
652553
|
-
import { randomUUID as
|
|
653016
|
+
import { randomUUID as randomUUID46 } from "crypto";
|
|
652554
653017
|
function isSessionsMessage(value) {
|
|
652555
653018
|
if (typeof value !== "object" || value === null || !("type" in value)) {
|
|
652556
653019
|
return false;
|
|
@@ -652734,7 +653197,7 @@ class SessionsWebSocket {
|
|
|
652734
653197
|
}
|
|
652735
653198
|
const controlRequest = {
|
|
652736
653199
|
type: "control_request",
|
|
652737
|
-
request_id:
|
|
653200
|
+
request_id: randomUUID46(),
|
|
652738
653201
|
request
|
|
652739
653202
|
};
|
|
652740
653203
|
logForDebugging(`[SessionsWebSocket] Sending control request: ${request.subtype}`);
|
|
@@ -652926,11 +653389,11 @@ var init_RemoteSessionManager = __esm(() => {
|
|
|
652926
653389
|
});
|
|
652927
653390
|
|
|
652928
653391
|
// src/remote/remotePermissionBridge.ts
|
|
652929
|
-
import { randomUUID as
|
|
653392
|
+
import { randomUUID as randomUUID47 } from "crypto";
|
|
652930
653393
|
function createSyntheticAssistantMessage(request, requestId) {
|
|
652931
653394
|
return {
|
|
652932
653395
|
type: "assistant",
|
|
652933
|
-
uuid:
|
|
653396
|
+
uuid: randomUUID47(),
|
|
652934
653397
|
message: {
|
|
652935
653398
|
id: `remote-${requestId}`,
|
|
652936
653399
|
type: "message",
|
|
@@ -653733,7 +654196,7 @@ var init_useDirectConnect = __esm(() => {
|
|
|
653733
654196
|
});
|
|
653734
654197
|
|
|
653735
654198
|
// src/hooks/useSSHSession.ts
|
|
653736
|
-
import { randomUUID as
|
|
654199
|
+
import { randomUUID as randomUUID48 } from "crypto";
|
|
653737
654200
|
function useSSHSession({
|
|
653738
654201
|
session: session2,
|
|
653739
654202
|
setMessages,
|
|
@@ -653831,7 +654294,7 @@ function useSSHSession({
|
|
|
653831
654294
|
subtype: "informational",
|
|
653832
654295
|
content: `SSH connection dropped \u2014 reconnecting (attempt ${attempt}/${max2})...`,
|
|
653833
654296
|
timestamp: new Date().toISOString(),
|
|
653834
|
-
uuid:
|
|
654297
|
+
uuid: randomUUID48(),
|
|
653835
654298
|
level: "warning"
|
|
653836
654299
|
};
|
|
653837
654300
|
setMessages((prev) => [...prev, msg]);
|
|
@@ -655881,7 +656344,7 @@ var init_PermissionContext = __esm(() => {
|
|
|
655881
656344
|
});
|
|
655882
656345
|
|
|
655883
656346
|
// src/hooks/toolPermission/handlers/interactiveHandler.ts
|
|
655884
|
-
import { randomUUID as
|
|
656347
|
+
import { randomUUID as randomUUID49 } from "crypto";
|
|
655885
656348
|
function handleInteractivePermission(params, resolve49) {
|
|
655886
656349
|
const {
|
|
655887
656350
|
ctx,
|
|
@@ -655895,7 +656358,7 @@ function handleInteractivePermission(params, resolve49) {
|
|
|
655895
656358
|
let userInteracted = false;
|
|
655896
656359
|
let checkmarkTransitionTimer;
|
|
655897
656360
|
let checkmarkAbortHandler;
|
|
655898
|
-
const bridgeRequestId = bridgeCallbacks ?
|
|
656361
|
+
const bridgeRequestId = bridgeCallbacks ? randomUUID49() : undefined;
|
|
655899
656362
|
let channelUnsubscribe;
|
|
655900
656363
|
const permissionPromptStartTimeMs = Date.now();
|
|
655901
656364
|
const displayInput = result.updatedInput ?? ctx.input;
|
|
@@ -656289,9 +656752,9 @@ function matchesKeepGoingKeyword(input) {
|
|
|
656289
656752
|
}
|
|
656290
656753
|
|
|
656291
656754
|
// src/utils/processUserInput/processTextPrompt.ts
|
|
656292
|
-
import { randomUUID as
|
|
656755
|
+
import { randomUUID as randomUUID50 } from "crypto";
|
|
656293
656756
|
function processTextPrompt(input, imageContentBlocks, imagePasteIds, attachmentMessages, uuid3, permissionMode, isMeta) {
|
|
656294
|
-
const promptId =
|
|
656757
|
+
const promptId = randomUUID50();
|
|
656295
656758
|
setPromptId(promptId);
|
|
656296
656759
|
const userPromptText = typeof input === "string" ? input : input.find((block2) => block2.type === "text")?.text || "";
|
|
656297
656760
|
startInteractionSpan(userPromptText);
|
|
@@ -656425,7 +656888,7 @@ var exports_processBashCommand = {};
|
|
|
656425
656888
|
__export(exports_processBashCommand, {
|
|
656426
656889
|
processBashCommand: () => processBashCommand
|
|
656427
656890
|
});
|
|
656428
|
-
import { randomUUID as
|
|
656891
|
+
import { randomUUID as randomUUID51 } from "crypto";
|
|
656429
656892
|
async function processBashCommand(inputString, precedingInputBlocks, attachmentMessages, context4, setToolJSX) {
|
|
656430
656893
|
const usePowerShell = isPowerShellToolEnabled() && resolveDefaultShell() === "powershell";
|
|
656431
656894
|
logEvent("tengu_input_bash", {
|
|
@@ -656489,7 +656952,7 @@ async function processBashCommand(inputString, precedingInputBlocks, attachmentM
|
|
|
656489
656952
|
const mapped = await processToolResultBlock(shellTool, {
|
|
656490
656953
|
...data,
|
|
656491
656954
|
stderr: ""
|
|
656492
|
-
},
|
|
656955
|
+
}, randomUUID51());
|
|
656493
656956
|
const stdout = typeof mapped.content === "string" ? mapped.content : escapeXml(data.stdout);
|
|
656494
656957
|
return {
|
|
656495
656958
|
messages: [createSyntheticUserCaveatMessage(), userMessage, ...attachmentMessages, createUserMessage({
|
|
@@ -656538,7 +657001,7 @@ var init_processBashCommand = __esm(() => {
|
|
|
656538
657001
|
});
|
|
656539
657002
|
|
|
656540
657003
|
// src/utils/processUserInput/processUserInput.ts
|
|
656541
|
-
import { randomUUID as
|
|
657004
|
+
import { randomUUID as randomUUID52 } from "crypto";
|
|
656542
657005
|
async function processUserInput({
|
|
656543
657006
|
input,
|
|
656544
657007
|
preExpansionInput,
|
|
@@ -656600,7 +657063,7 @@ Original prompt: ${input}`, "warning")
|
|
|
656600
657063
|
type: "hook_additional_context",
|
|
656601
657064
|
content: hookResult.additionalContexts.map(applyTruncation),
|
|
656602
657065
|
hookName: "UserPromptSubmit",
|
|
656603
|
-
toolUseID: `hook-${
|
|
657066
|
+
toolUseID: `hook-${randomUUID52()}`,
|
|
656604
657067
|
hookEvent: "UserPromptSubmit"
|
|
656605
657068
|
}));
|
|
656606
657069
|
}
|
|
@@ -658246,7 +658709,7 @@ var init_sessionRestore = __esm(() => {
|
|
|
658246
658709
|
});
|
|
658247
658710
|
|
|
658248
658711
|
// src/hooks/useInboxPoller.ts
|
|
658249
|
-
import { randomUUID as
|
|
658712
|
+
import { randomUUID as randomUUID53 } from "crypto";
|
|
658250
658713
|
function getAgentNameToPoll(appState) {
|
|
658251
658714
|
if (isInProcessTeammate()) {
|
|
658252
658715
|
return;
|
|
@@ -658663,7 +659126,7 @@ function useInboxPoller({
|
|
|
658663
659126
|
messages: [
|
|
658664
659127
|
...prev.inbox.messages,
|
|
658665
659128
|
{
|
|
658666
|
-
id:
|
|
659129
|
+
id: randomUUID53(),
|
|
658667
659130
|
from: "system",
|
|
658668
659131
|
text: jsonStringify({
|
|
658669
659132
|
type: "teammate_terminated",
|
|
@@ -658703,7 +659166,7 @@ ${messageContent}
|
|
|
658703
659166
|
messages: [
|
|
658704
659167
|
...prev.inbox.messages,
|
|
658705
659168
|
...regularMessages.map((m) => ({
|
|
658706
|
-
id:
|
|
659169
|
+
id: randomUUID53(),
|
|
658707
659170
|
from: m.from,
|
|
658708
659171
|
text: m.text,
|
|
658709
659172
|
timestamp: m.timestamp,
|
|
@@ -659556,7 +660019,7 @@ async function submitTranscriptShare(messages, trigger2, appearanceId) {
|
|
|
659556
660019
|
} catch {}
|
|
659557
660020
|
const data = {
|
|
659558
660021
|
trigger: trigger2,
|
|
659559
|
-
version: "1.27.
|
|
660022
|
+
version: "1.27.6",
|
|
659560
660023
|
platform: process.platform,
|
|
659561
660024
|
transcript,
|
|
659562
660025
|
subagentTranscripts: Object.keys(subagentTranscripts).length > 0 ? subagentTranscripts : undefined,
|
|
@@ -659593,7 +660056,7 @@ var init_submitTranscriptShare = __esm(() => {
|
|
|
659593
660056
|
});
|
|
659594
660057
|
|
|
659595
660058
|
// src/components/FeedbackSurvey/useSurveyState.tsx
|
|
659596
|
-
import { randomUUID as
|
|
660059
|
+
import { randomUUID as randomUUID54 } from "crypto";
|
|
659597
660060
|
function useSurveyState({
|
|
659598
660061
|
hideThanksAfterMs,
|
|
659599
660062
|
onOpen,
|
|
@@ -659604,7 +660067,7 @@ function useSurveyState({
|
|
|
659604
660067
|
}) {
|
|
659605
660068
|
const [state2, setState] = import_react291.useState("closed");
|
|
659606
660069
|
const [lastResponse, setLastResponse] = import_react291.useState(null);
|
|
659607
|
-
const appearanceId = import_react291.useRef(
|
|
660070
|
+
const appearanceId = import_react291.useRef(randomUUID54());
|
|
659608
660071
|
const lastResponseRef = import_react291.useRef(null);
|
|
659609
660072
|
const showThanksThenClose = import_react291.useCallback(() => {
|
|
659610
660073
|
setState("thanks");
|
|
@@ -659622,7 +660085,7 @@ function useSurveyState({
|
|
|
659622
660085
|
return;
|
|
659623
660086
|
}
|
|
659624
660087
|
setState("open");
|
|
659625
|
-
appearanceId.current =
|
|
660088
|
+
appearanceId.current = randomUUID54();
|
|
659626
660089
|
onOpen(appearanceId.current);
|
|
659627
660090
|
}, [state2, onOpen]);
|
|
659628
660091
|
const handleSelect = import_react291.useCallback((selected) => {
|
|
@@ -662417,7 +662880,7 @@ var init_ndjsonSafeStringify = __esm(() => {
|
|
|
662417
662880
|
});
|
|
662418
662881
|
|
|
662419
662882
|
// src/cli/structuredIO.ts
|
|
662420
|
-
import { randomUUID as
|
|
662883
|
+
import { randomUUID as randomUUID55 } from "crypto";
|
|
662421
662884
|
function serializeDecisionReason(reason) {
|
|
662422
662885
|
if (!reason) {
|
|
662423
662886
|
return;
|
|
@@ -662665,7 +663128,7 @@ class StructuredIO {
|
|
|
662665
663128
|
writeToStdout(ndjsonSafeStringify(message) + `
|
|
662666
663129
|
`);
|
|
662667
663130
|
}
|
|
662668
|
-
async sendRequest(request, schema, signal, requestId =
|
|
663131
|
+
async sendRequest(request, schema, signal, requestId = randomUUID55()) {
|
|
662669
663132
|
const message = {
|
|
662670
663133
|
type: "control_request",
|
|
662671
663134
|
request_id: requestId,
|
|
@@ -662731,7 +663194,7 @@ class StructuredIO {
|
|
|
662731
663194
|
parentSignal.addEventListener("abort", onParentAbort, { once: true });
|
|
662732
663195
|
try {
|
|
662733
663196
|
const hookPromise = executePermissionRequestHooksForSDK(tool.name, toolUseID, input, toolUseContext, mainPermissionResult.suggestions).then((decision) => ({ source: "hook", decision }));
|
|
662734
|
-
const requestId =
|
|
663197
|
+
const requestId = randomUUID55();
|
|
662735
663198
|
onPermissionPrompt?.(buildRequiresActionDetails(tool, input, toolUseID, requestId));
|
|
662736
663199
|
const sdkPromise = this.sendRequest({
|
|
662737
663200
|
subtype: "can_use_tool",
|
|
@@ -662811,7 +663274,7 @@ class StructuredIO {
|
|
|
662811
663274
|
subtype: "can_use_tool",
|
|
662812
663275
|
tool_name: SANDBOX_NETWORK_ACCESS_TOOL_NAME,
|
|
662813
663276
|
input: { host: hostPattern.host },
|
|
662814
|
-
tool_use_id:
|
|
663277
|
+
tool_use_id: randomUUID55(),
|
|
662815
663278
|
description: `Allow network connection to ${hostPattern.host}?`
|
|
662816
663279
|
}, outputSchema39());
|
|
662817
663280
|
return result.behavior === "allow";
|
|
@@ -665242,6 +665705,7 @@ function getModelDeprecationWarning(modelId) {
|
|
|
665242
665705
|
}
|
|
665243
665706
|
var DEPRECATED_MODELS;
|
|
665244
665707
|
var init_deprecation = __esm(() => {
|
|
665708
|
+
init_providers();
|
|
665245
665709
|
DEPRECATED_MODELS = {
|
|
665246
665710
|
"ur-3-modelO": {
|
|
665247
665711
|
modelName: "UR 3 modelO",
|
|
@@ -666818,7 +667282,7 @@ __export(exports_REPL, {
|
|
|
666818
667282
|
import { dirname as dirname74, join as join211 } from "path";
|
|
666819
667283
|
import { tmpdir as tmpdir13 } from "os";
|
|
666820
667284
|
import { writeFile as writeFile47 } from "fs/promises";
|
|
666821
|
-
import { randomUUID as
|
|
667285
|
+
import { randomUUID as randomUUID56 } from "crypto";
|
|
666822
667286
|
function TranscriptModeFooter(t0) {
|
|
666823
667287
|
const $3 = import_compiler_runtime359.c(9);
|
|
666824
667288
|
const {
|
|
@@ -667557,7 +668021,7 @@ function REPL({
|
|
|
667557
668021
|
const [isMessageSelectorVisible, setIsMessageSelectorVisible] = import_react317.useState(false);
|
|
667558
668022
|
const [messageSelectorPreselect, setMessageSelectorPreselect] = import_react317.useState(undefined);
|
|
667559
668023
|
const [showCostDialog, setShowCostDialog] = import_react317.useState(false);
|
|
667560
|
-
const [conversationId, setConversationId] = import_react317.useState(
|
|
668024
|
+
const [conversationId, setConversationId] = import_react317.useState(randomUUID56());
|
|
667561
668025
|
const [idleReturnPending, setIdleReturnPending] = import_react317.useState(null);
|
|
667562
668026
|
const skipIdleCheckRef = import_react317.useRef(false);
|
|
667563
668027
|
const lastQueryCompletionTimeRef = import_react317.useRef(lastQueryCompletionTime);
|
|
@@ -668258,7 +668722,7 @@ Error: sandbox required but unavailable: ${reason}
|
|
|
668258
668722
|
} else {
|
|
668259
668723
|
setMessages(() => [newMessage]);
|
|
668260
668724
|
}
|
|
668261
|
-
setConversationId(
|
|
668725
|
+
setConversationId(randomUUID56());
|
|
668262
668726
|
if (false) {}
|
|
668263
668727
|
} else if (newMessage.type === "progress" && isEphemeralToolProgress(newMessage.data.type)) {
|
|
668264
668728
|
setMessages((oldMessages) => {
|
|
@@ -668334,7 +668798,7 @@ Error: sandbox required but unavailable: ${reason}
|
|
|
668334
668798
|
});
|
|
668335
668799
|
if (!shouldQuery) {
|
|
668336
668800
|
if (newMessages.some(isCompactBoundaryMessage)) {
|
|
668337
|
-
setConversationId(
|
|
668801
|
+
setConversationId(randomUUID56());
|
|
668338
668802
|
if (false) {}
|
|
668339
668803
|
}
|
|
668340
668804
|
resetLoadingState();
|
|
@@ -668943,7 +669407,7 @@ Error: sandbox required but unavailable: ${reason}
|
|
|
668943
669407
|
rewindToMessageIndex: messageIndex
|
|
668944
669408
|
});
|
|
668945
669409
|
setMessages(prev.slice(0, messageIndex));
|
|
668946
|
-
setConversationId(
|
|
669410
|
+
setConversationId(randomUUID56());
|
|
668947
669411
|
resetMicrocompactState();
|
|
668948
669412
|
if (false) {}
|
|
668949
669413
|
setAppState((prev2) => ({
|
|
@@ -670113,7 +670577,7 @@ Note: ctrl + z now suspends UR, ctrl + _ undoes input.
|
|
|
670113
670577
|
setMessages(postCompact);
|
|
670114
670578
|
}
|
|
670115
670579
|
if (false) {}
|
|
670116
|
-
setConversationId(
|
|
670580
|
+
setConversationId(randomUUID56());
|
|
670117
670581
|
runPostCompactCleanup(context4.options.querySource);
|
|
670118
670582
|
if (direction === "from") {
|
|
670119
670583
|
const r = textForResubmit(message);
|
|
@@ -670477,6 +670941,7 @@ var init_bootstrap = __esm(() => {
|
|
|
670477
670941
|
init_debug();
|
|
670478
670942
|
init_http2();
|
|
670479
670943
|
init_log2();
|
|
670944
|
+
init_providers();
|
|
670480
670945
|
bootstrapResponseSchema = lazySchema(() => exports_external2.object({
|
|
670481
670946
|
client_data: exports_external2.record(exports_external2.unknown()).nullish(),
|
|
670482
670947
|
additional_model_options: exports_external2.array(exports_external2.object({
|
|
@@ -671438,7 +671903,7 @@ function WelcomeV2() {
|
|
|
671438
671903
|
dimColor: true,
|
|
671439
671904
|
children: [
|
|
671440
671905
|
"v",
|
|
671441
|
-
"1.27.
|
|
671906
|
+
"1.27.6"
|
|
671442
671907
|
]
|
|
671443
671908
|
}, undefined, true, undefined, this)
|
|
671444
671909
|
]
|
|
@@ -672698,7 +673163,7 @@ function completeOnboarding() {
|
|
|
672698
673163
|
saveGlobalConfig((current) => ({
|
|
672699
673164
|
...current,
|
|
672700
673165
|
hasCompletedOnboarding: true,
|
|
672701
|
-
lastOnboardingVersion: "1.27.
|
|
673166
|
+
lastOnboardingVersion: "1.27.6"
|
|
672702
673167
|
}));
|
|
672703
673168
|
}
|
|
672704
673169
|
function showDialog(root2, renderer) {
|
|
@@ -677575,6 +678040,7 @@ var init_migrateLegacymodelOToCurrent = __esm(() => {
|
|
|
677575
678040
|
init_analytics();
|
|
677576
678041
|
init_config();
|
|
677577
678042
|
init_model();
|
|
678043
|
+
init_providers();
|
|
677578
678044
|
init_settings2();
|
|
677579
678045
|
});
|
|
677580
678046
|
|
|
@@ -677674,6 +678140,7 @@ var init_migratemodelS45TomodelS46 = __esm(() => {
|
|
|
677674
678140
|
init_analytics();
|
|
677675
678141
|
init_auth();
|
|
677676
678142
|
init_config();
|
|
678143
|
+
init_providers();
|
|
677677
678144
|
init_settings2();
|
|
677678
678145
|
});
|
|
677679
678146
|
|
|
@@ -677728,6 +678195,7 @@ var init_resetProTomodelODefault = __esm(() => {
|
|
|
677728
678195
|
init_analytics();
|
|
677729
678196
|
init_auth();
|
|
677730
678197
|
init_config();
|
|
678198
|
+
init_providers();
|
|
677731
678199
|
init_settings2();
|
|
677732
678200
|
});
|
|
677733
678201
|
|
|
@@ -677799,7 +678267,7 @@ function appendToLog(path24, message) {
|
|
|
677799
678267
|
cwd: getFsImplementation().cwd(),
|
|
677800
678268
|
userType: process.env.USER_TYPE,
|
|
677801
678269
|
sessionId: getSessionId(),
|
|
677802
|
-
version: "1.27.
|
|
678270
|
+
version: "1.27.6"
|
|
677803
678271
|
};
|
|
677804
678272
|
getLogWriter(path24).write(messageWithTimestamp);
|
|
677805
678273
|
}
|
|
@@ -678876,7 +679344,7 @@ function coalescePatches(base2, overlay) {
|
|
|
678876
679344
|
var init_WorkerStateUploader = () => {};
|
|
678877
679345
|
|
|
678878
679346
|
// src/cli/transports/ccrClient.ts
|
|
678879
|
-
import { randomUUID as
|
|
679347
|
+
import { randomUUID as randomUUID57 } from "crypto";
|
|
678880
679348
|
function alwaysValidStatus() {
|
|
678881
679349
|
return true;
|
|
678882
679350
|
}
|
|
@@ -679239,7 +679707,7 @@ class CCRClient {
|
|
|
679239
679707
|
return {
|
|
679240
679708
|
payload: {
|
|
679241
679709
|
...msg,
|
|
679242
|
-
uuid: typeof msg.uuid === "string" ? msg.uuid :
|
|
679710
|
+
uuid: typeof msg.uuid === "string" ? msg.uuid : randomUUID57()
|
|
679243
679711
|
}
|
|
679244
679712
|
};
|
|
679245
679713
|
}
|
|
@@ -679263,7 +679731,7 @@ class CCRClient {
|
|
|
679263
679731
|
payload: {
|
|
679264
679732
|
type: eventType,
|
|
679265
679733
|
...payload,
|
|
679266
|
-
uuid: typeof payload.uuid === "string" ? payload.uuid :
|
|
679734
|
+
uuid: typeof payload.uuid === "string" ? payload.uuid : randomUUID57()
|
|
679267
679735
|
},
|
|
679268
679736
|
...isCompaction && { is_compaction: true },
|
|
679269
679737
|
...agentId && { agent_id: agentId }
|
|
@@ -680774,7 +681242,7 @@ var init_queryContext = __esm(() => {
|
|
|
680774
681242
|
});
|
|
680775
681243
|
|
|
680776
681244
|
// src/QueryEngine.ts
|
|
680777
|
-
import { randomUUID as
|
|
681245
|
+
import { randomUUID as randomUUID58 } from "crypto";
|
|
680778
681246
|
|
|
680779
681247
|
class QueryEngine {
|
|
680780
681248
|
config;
|
|
@@ -680792,7 +681260,7 @@ class QueryEngine {
|
|
|
680792
681260
|
this.abortController = config3.abortController ?? createAbortController();
|
|
680793
681261
|
this.permissionDenials = [];
|
|
680794
681262
|
this.readFileState = config3.readFileCache;
|
|
680795
|
-
this.totalUsage =
|
|
681263
|
+
this.totalUsage = EMPTY_USAGE2;
|
|
680796
681264
|
}
|
|
680797
681265
|
async* submitMessage(prompt, options2) {
|
|
680798
681266
|
const {
|
|
@@ -681071,7 +681539,7 @@ class QueryEngine {
|
|
|
681071
681539
|
modelUsage: getModelUsage(),
|
|
681072
681540
|
permission_denials: this.permissionDenials,
|
|
681073
681541
|
fast_mode_state: getFastModeState(mainLoopModel, initialAppState.fastMode),
|
|
681074
|
-
uuid:
|
|
681542
|
+
uuid: randomUUID58()
|
|
681075
681543
|
};
|
|
681076
681544
|
return;
|
|
681077
681545
|
}
|
|
@@ -681085,7 +681553,7 @@ class QueryEngine {
|
|
|
681085
681553
|
}, message.uuid);
|
|
681086
681554
|
});
|
|
681087
681555
|
}
|
|
681088
|
-
let currentMessageUsage =
|
|
681556
|
+
let currentMessageUsage = EMPTY_USAGE2;
|
|
681089
681557
|
let turnCount = 1;
|
|
681090
681558
|
let hasAcknowledgedInitialMessages = false;
|
|
681091
681559
|
let structuredOutputFromTool;
|
|
@@ -681166,7 +681634,7 @@ class QueryEngine {
|
|
|
681166
681634
|
break;
|
|
681167
681635
|
case "stream_event":
|
|
681168
681636
|
if (message.event.type === "message_start") {
|
|
681169
|
-
currentMessageUsage =
|
|
681637
|
+
currentMessageUsage = EMPTY_USAGE2;
|
|
681170
681638
|
currentMessageUsage = updateUsage(currentMessageUsage, message.event.message.usage);
|
|
681171
681639
|
}
|
|
681172
681640
|
if (message.event.type === "message_delta") {
|
|
@@ -681184,7 +681652,7 @@ class QueryEngine {
|
|
|
681184
681652
|
event: message.event,
|
|
681185
681653
|
session_id: getSessionId(),
|
|
681186
681654
|
parent_tool_use_id: null,
|
|
681187
|
-
uuid:
|
|
681655
|
+
uuid: randomUUID58()
|
|
681188
681656
|
};
|
|
681189
681657
|
}
|
|
681190
681658
|
break;
|
|
@@ -681216,7 +681684,7 @@ class QueryEngine {
|
|
|
681216
681684
|
modelUsage: getModelUsage(),
|
|
681217
681685
|
permission_denials: this.permissionDenials,
|
|
681218
681686
|
fast_mode_state: getFastModeState(mainLoopModel, initialAppState.fastMode),
|
|
681219
|
-
uuid:
|
|
681687
|
+
uuid: randomUUID58(),
|
|
681220
681688
|
errors: [
|
|
681221
681689
|
`Reached maximum number of turns (${message.attachment.maxTurns})`
|
|
681222
681690
|
]
|
|
@@ -681311,7 +681779,7 @@ class QueryEngine {
|
|
|
681311
681779
|
modelUsage: getModelUsage(),
|
|
681312
681780
|
permission_denials: this.permissionDenials,
|
|
681313
681781
|
fast_mode_state: getFastModeState(mainLoopModel, initialAppState.fastMode),
|
|
681314
|
-
uuid:
|
|
681782
|
+
uuid: randomUUID58(),
|
|
681315
681783
|
errors: [`Reached maximum budget ($${maxBudgetUsd})`]
|
|
681316
681784
|
};
|
|
681317
681785
|
return;
|
|
@@ -681340,7 +681808,7 @@ class QueryEngine {
|
|
|
681340
681808
|
modelUsage: getModelUsage(),
|
|
681341
681809
|
permission_denials: this.permissionDenials,
|
|
681342
681810
|
fast_mode_state: getFastModeState(mainLoopModel, initialAppState.fastMode),
|
|
681343
|
-
uuid:
|
|
681811
|
+
uuid: randomUUID58(),
|
|
681344
681812
|
errors: [
|
|
681345
681813
|
`Failed to provide valid structured output after ${maxRetries} attempts`
|
|
681346
681814
|
]
|
|
@@ -681372,7 +681840,7 @@ class QueryEngine {
|
|
|
681372
681840
|
modelUsage: getModelUsage(),
|
|
681373
681841
|
permission_denials: this.permissionDenials,
|
|
681374
681842
|
fast_mode_state: getFastModeState(mainLoopModel, initialAppState.fastMode),
|
|
681375
|
-
uuid:
|
|
681843
|
+
uuid: randomUUID58(),
|
|
681376
681844
|
errors: (() => {
|
|
681377
681845
|
const all4 = getInMemoryErrors();
|
|
681378
681846
|
const start = errorLogWatermark ? all4.lastIndexOf(errorLogWatermark) + 1 : 0;
|
|
@@ -681409,7 +681877,7 @@ class QueryEngine {
|
|
|
681409
681877
|
permission_denials: this.permissionDenials,
|
|
681410
681878
|
structured_output: structuredOutputFromTool,
|
|
681411
681879
|
fast_mode_state: getFastModeState(mainLoopModel, initialAppState.fastMode),
|
|
681412
|
-
uuid:
|
|
681880
|
+
uuid: randomUUID58()
|
|
681413
681881
|
};
|
|
681414
681882
|
}
|
|
681415
681883
|
interrupt() {
|
|
@@ -681585,7 +682053,7 @@ var init_idleTimeout = __esm(() => {
|
|
|
681585
682053
|
});
|
|
681586
682054
|
|
|
681587
682055
|
// src/bridge/inboundAttachments.ts
|
|
681588
|
-
import { randomUUID as
|
|
682056
|
+
import { randomUUID as randomUUID59 } from "crypto";
|
|
681589
682057
|
import { mkdir as mkdir45, writeFile as writeFile49 } from "fs/promises";
|
|
681590
682058
|
import { basename as basename60, join as join214 } from "path";
|
|
681591
682059
|
function debug(msg) {
|
|
@@ -681630,7 +682098,7 @@ async function resolveOne(att) {
|
|
|
681630
682098
|
return;
|
|
681631
682099
|
}
|
|
681632
682100
|
const safeName = sanitizeFileName(att.file_name);
|
|
681633
|
-
const prefix = (att.file_uuid.slice(0, 8) ||
|
|
682101
|
+
const prefix = (att.file_uuid.slice(0, 8) || randomUUID59().slice(0, 8)).replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
681634
682102
|
const dir = uploadsDir();
|
|
681635
682103
|
const outPath = join214(dir, `${prefix}-${safeName}`);
|
|
681636
682104
|
try {
|
|
@@ -681694,11 +682162,11 @@ var init_inboundAttachments = __esm(() => {
|
|
|
681694
682162
|
});
|
|
681695
682163
|
|
|
681696
682164
|
// src/utils/sessionUrl.ts
|
|
681697
|
-
import { randomUUID as
|
|
682165
|
+
import { randomUUID as randomUUID60 } from "crypto";
|
|
681698
682166
|
function parseSessionIdentifier(resumeIdentifier) {
|
|
681699
682167
|
if (resumeIdentifier.toLowerCase().endsWith(".jsonl")) {
|
|
681700
682168
|
return {
|
|
681701
|
-
sessionId:
|
|
682169
|
+
sessionId: randomUUID60(),
|
|
681702
682170
|
ingressUrl: null,
|
|
681703
682171
|
isUrl: false,
|
|
681704
682172
|
jsonlFile: resumeIdentifier,
|
|
@@ -681717,7 +682185,7 @@ function parseSessionIdentifier(resumeIdentifier) {
|
|
|
681717
682185
|
try {
|
|
681718
682186
|
const url3 = new URL(resumeIdentifier);
|
|
681719
682187
|
return {
|
|
681720
|
-
sessionId:
|
|
682188
|
+
sessionId: randomUUID60(),
|
|
681721
682189
|
ingressUrl: url3.href,
|
|
681722
682190
|
isUrl: true,
|
|
681723
682191
|
jsonlFile: null,
|
|
@@ -681893,8 +682361,8 @@ async function getEnvLessBridgeConfig() {
|
|
|
681893
682361
|
}
|
|
681894
682362
|
async function checkEnvLessBridgeMinVersion() {
|
|
681895
682363
|
const cfg = await getEnvLessBridgeConfig();
|
|
681896
|
-
if (cfg.min_version && lt("1.27.
|
|
681897
|
-
return `Your version of UR (${"1.27.
|
|
682364
|
+
if (cfg.min_version && lt("1.27.6", cfg.min_version)) {
|
|
682365
|
+
return `Your version of UR (${"1.27.6"}) is too old for Remote Control.
|
|
681898
682366
|
Version ${cfg.min_version} or higher is required. Run \`ur update\` to update.`;
|
|
681899
682367
|
}
|
|
681900
682368
|
return null;
|
|
@@ -682326,7 +682794,7 @@ var init_bridgePointer = __esm(() => {
|
|
|
682326
682794
|
});
|
|
682327
682795
|
|
|
682328
682796
|
// src/bridge/replBridge.ts
|
|
682329
|
-
import { randomUUID as
|
|
682797
|
+
import { randomUUID as randomUUID61 } from "crypto";
|
|
682330
682798
|
async function initBridgeCore(params) {
|
|
682331
682799
|
const {
|
|
682332
682800
|
dir,
|
|
@@ -682368,7 +682836,7 @@ async function initBridgeCore(params) {
|
|
|
682368
682836
|
const rawApi = createBridgeApiClient({
|
|
682369
682837
|
baseUrl,
|
|
682370
682838
|
getAccessToken,
|
|
682371
|
-
runnerVersion: "1.27.
|
|
682839
|
+
runnerVersion: "1.27.6",
|
|
682372
682840
|
onDebug: logForDebugging,
|
|
682373
682841
|
onAuth401,
|
|
682374
682842
|
getTrustedDeviceToken
|
|
@@ -682383,9 +682851,9 @@ async function initBridgeCore(params) {
|
|
|
682383
682851
|
spawnMode: "single-session",
|
|
682384
682852
|
verbose: false,
|
|
682385
682853
|
sandbox: false,
|
|
682386
|
-
bridgeId:
|
|
682854
|
+
bridgeId: randomUUID61(),
|
|
682387
682855
|
workerType,
|
|
682388
|
-
environmentId:
|
|
682856
|
+
environmentId: randomUUID61(),
|
|
682389
682857
|
reuseEnvironmentId: prior?.environmentId,
|
|
682390
682858
|
apiBaseUrl: baseUrl,
|
|
682391
682859
|
sessionIngressUrl
|
|
@@ -684235,7 +684703,7 @@ __export(exports_print, {
|
|
|
684235
684703
|
import { readFile as readFile56, stat as stat51, writeFile as writeFile51 } from "fs/promises";
|
|
684236
684704
|
import { dirname as dirname78 } from "path";
|
|
684237
684705
|
import { cwd as cwd2 } from "process";
|
|
684238
|
-
import { randomUUID as
|
|
684706
|
+
import { randomUUID as randomUUID62 } from "crypto";
|
|
684239
684707
|
function trackReceivedMessageUuid(uuid3) {
|
|
684240
684708
|
if (receivedMessageUuids.has(uuid3)) {
|
|
684241
684709
|
return false;
|
|
@@ -684357,7 +684825,7 @@ Error: sandbox required but unavailable: ${sandboxUnavailableReason}
|
|
|
684357
684825
|
hook_id: event.hookId,
|
|
684358
684826
|
hook_name: event.hookName,
|
|
684359
684827
|
hook_event: event.hookEvent,
|
|
684360
|
-
uuid:
|
|
684828
|
+
uuid: randomUUID62(),
|
|
684361
684829
|
session_id: getSessionId()
|
|
684362
684830
|
};
|
|
684363
684831
|
case "progress":
|
|
@@ -684370,7 +684838,7 @@ Error: sandbox required but unavailable: ${sandboxUnavailableReason}
|
|
|
684370
684838
|
stdout: event.stdout,
|
|
684371
684839
|
stderr: event.stderr,
|
|
684372
684840
|
output: event.output,
|
|
684373
|
-
uuid:
|
|
684841
|
+
uuid: randomUUID62(),
|
|
684374
684842
|
session_id: getSessionId()
|
|
684375
684843
|
};
|
|
684376
684844
|
case "response":
|
|
@@ -684385,7 +684853,7 @@ Error: sandbox required but unavailable: ${sandboxUnavailableReason}
|
|
|
684385
684853
|
stderr: event.stderr,
|
|
684386
684854
|
exit_code: event.exitCode,
|
|
684387
684855
|
outcome: event.outcome,
|
|
684388
|
-
uuid:
|
|
684856
|
+
uuid: randomUUID62(),
|
|
684389
684857
|
session_id: getSessionId()
|
|
684390
684858
|
};
|
|
684391
684859
|
}
|
|
@@ -684598,7 +685066,7 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial
|
|
|
684598
685066
|
subtype: "status",
|
|
684599
685067
|
status: null,
|
|
684600
685068
|
permissionMode: newMode,
|
|
684601
|
-
uuid:
|
|
685069
|
+
uuid: randomUUID62(),
|
|
684602
685070
|
session_id: getSessionId()
|
|
684603
685071
|
});
|
|
684604
685072
|
}
|
|
@@ -684619,7 +685087,7 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial
|
|
|
684619
685087
|
isAuthenticating: status2.isAuthenticating,
|
|
684620
685088
|
output: status2.output,
|
|
684621
685089
|
error: status2.error,
|
|
684622
|
-
uuid:
|
|
685090
|
+
uuid: randomUUID62(),
|
|
684623
685091
|
session_id: getSessionId()
|
|
684624
685092
|
});
|
|
684625
685093
|
});
|
|
@@ -684630,7 +685098,7 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial
|
|
|
684630
685098
|
output.enqueue({
|
|
684631
685099
|
type: "rate_limit_event",
|
|
684632
685100
|
rate_limit_info: rateLimitInfo,
|
|
684633
|
-
uuid:
|
|
685101
|
+
uuid: randomUUID62(),
|
|
684634
685102
|
session_id: getSessionId()
|
|
684635
685103
|
});
|
|
684636
685104
|
}
|
|
@@ -684646,7 +685114,7 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial
|
|
|
684646
685114
|
enqueue({
|
|
684647
685115
|
mode: "prompt",
|
|
684648
685116
|
value: turnInterruptionState.message.message.content,
|
|
684649
|
-
uuid:
|
|
685117
|
+
uuid: randomUUID62()
|
|
684650
685118
|
});
|
|
684651
685119
|
}
|
|
684652
685120
|
const modelOptions = getModelOptions();
|
|
@@ -684739,7 +685207,7 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial
|
|
|
684739
685207
|
subtype: "elicitation_complete",
|
|
684740
685208
|
mcp_server_name: serverName,
|
|
684741
685209
|
elicitation_id: elicitationId,
|
|
684742
|
-
uuid:
|
|
685210
|
+
uuid: randomUUID62(),
|
|
684743
685211
|
session_id: getSessionId()
|
|
684744
685212
|
});
|
|
684745
685213
|
});
|
|
@@ -685084,7 +685552,7 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial
|
|
|
685084
685552
|
duration_ms: durationMsMatch ? parseInt(durationMsMatch[1], 10) : 0
|
|
685085
685553
|
} : undefined,
|
|
685086
685554
|
session_id: getSessionId(),
|
|
685087
|
-
uuid:
|
|
685555
|
+
uuid: randomUUID62()
|
|
685088
685556
|
});
|
|
685089
685557
|
}
|
|
685090
685558
|
}
|
|
@@ -685158,7 +685626,7 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial
|
|
|
685158
685626
|
subtype: "status",
|
|
685159
685627
|
status: status2,
|
|
685160
685628
|
session_id: getSessionId(),
|
|
685161
|
-
uuid:
|
|
685629
|
+
uuid: randomUUID62()
|
|
685162
685630
|
});
|
|
685163
685631
|
}
|
|
685164
685632
|
})) {
|
|
@@ -685206,7 +685674,7 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial
|
|
|
685206
685674
|
const suggestionMsg = {
|
|
685207
685675
|
type: "prompt_suggestion",
|
|
685208
685676
|
suggestion: result.suggestion,
|
|
685209
|
-
uuid:
|
|
685677
|
+
uuid: randomUUID62(),
|
|
685210
685678
|
session_id: getSessionId()
|
|
685211
685679
|
};
|
|
685212
685680
|
const lastEmittedEntry = {
|
|
@@ -685293,10 +685761,10 @@ function runHeadlessStreaming(structuredIO, mcpClients, commands, tools, initial
|
|
|
685293
685761
|
stop_reason: null,
|
|
685294
685762
|
session_id: getSessionId(),
|
|
685295
685763
|
total_cost_usd: 0,
|
|
685296
|
-
usage:
|
|
685764
|
+
usage: EMPTY_USAGE2,
|
|
685297
685765
|
modelUsage: {},
|
|
685298
685766
|
permission_denials: [],
|
|
685299
|
-
uuid:
|
|
685767
|
+
uuid: randomUUID62(),
|
|
685300
685768
|
errors: [
|
|
685301
685769
|
errorMessage2(error40),
|
|
685302
685770
|
...getInMemoryErrors().map((_) => _.error)
|
|
@@ -685380,7 +685848,7 @@ ${m.text}
|
|
|
685380
685848
|
enqueue({
|
|
685381
685849
|
mode: "prompt",
|
|
685382
685850
|
value: formatted,
|
|
685383
|
-
uuid:
|
|
685851
|
+
uuid: randomUUID62()
|
|
685384
685852
|
});
|
|
685385
685853
|
run();
|
|
685386
685854
|
return;
|
|
@@ -685391,7 +685859,7 @@ ${m.text}
|
|
|
685391
685859
|
enqueue({
|
|
685392
685860
|
mode: "prompt",
|
|
685393
685861
|
value: SHUTDOWN_TEAM_PROMPT,
|
|
685394
|
-
uuid:
|
|
685862
|
+
uuid: randomUUID62()
|
|
685395
685863
|
});
|
|
685396
685864
|
run();
|
|
685397
685865
|
return;
|
|
@@ -685415,7 +685883,7 @@ ${m.text}
|
|
|
685415
685883
|
enqueue({
|
|
685416
685884
|
mode: "prompt",
|
|
685417
685885
|
value: SHUTDOWN_TEAM_PROMPT,
|
|
685418
|
-
uuid:
|
|
685886
|
+
uuid: randomUUID62()
|
|
685419
685887
|
});
|
|
685420
685888
|
run();
|
|
685421
685889
|
} else {
|
|
@@ -686164,7 +686632,7 @@ ${m.text}
|
|
|
686164
686632
|
subtype: "bridge_state",
|
|
686165
686633
|
state: state2,
|
|
686166
686634
|
detail,
|
|
686167
|
-
uuid:
|
|
686635
|
+
uuid: randomUUID62(),
|
|
686168
686636
|
session_id: getSessionId()
|
|
686169
686637
|
});
|
|
686170
686638
|
},
|
|
@@ -686472,7 +686940,7 @@ async function handleInitializeRequest(request, requestId, initialized5, output,
|
|
|
686472
686940
|
isAuthenticating: status2.isAuthenticating,
|
|
686473
686941
|
output: status2.output,
|
|
686474
686942
|
error: status2.error,
|
|
686475
|
-
uuid:
|
|
686943
|
+
uuid: randomUUID62(),
|
|
686476
686944
|
session_id: getSessionId()
|
|
686477
686945
|
});
|
|
686478
686946
|
}
|
|
@@ -686657,10 +687125,10 @@ function emitLoadError(message, outputFormat) {
|
|
|
686657
687125
|
stop_reason: null,
|
|
686658
687126
|
session_id: getSessionId(),
|
|
686659
687127
|
total_cost_usd: 0,
|
|
686660
|
-
usage:
|
|
687128
|
+
usage: EMPTY_USAGE2,
|
|
686661
687129
|
modelUsage: {},
|
|
686662
687130
|
permission_denials: [],
|
|
686663
|
-
uuid:
|
|
687131
|
+
uuid: randomUUID62(),
|
|
686664
687132
|
errors: [message]
|
|
686665
687133
|
};
|
|
686666
687134
|
process.stdout.write(jsonStringify(errorResult) + `
|
|
@@ -687120,6 +687588,7 @@ var init_print = __esm(() => {
|
|
|
687120
687588
|
init_auth();
|
|
687121
687589
|
init_oauth2();
|
|
687122
687590
|
init_auth6();
|
|
687591
|
+
init_providers();
|
|
687123
687592
|
init_awsAuthStatusManager();
|
|
687124
687593
|
init_state();
|
|
687125
687594
|
init_SyntheticOutputTool();
|
|
@@ -688049,7 +688518,7 @@ async function startMCPServer(cwd3, debug2, verbose) {
|
|
|
688049
688518
|
setCwd(cwd3);
|
|
688050
688519
|
const server2 = new Server({
|
|
688051
688520
|
name: "ur/tengu",
|
|
688052
|
-
version: "1.27.
|
|
688521
|
+
version: "1.27.6"
|
|
688053
688522
|
}, {
|
|
688054
688523
|
capabilities: {
|
|
688055
688524
|
tools: {}
|
|
@@ -688690,7 +689159,7 @@ async function configSetHandler(key, values2) {
|
|
|
688690
689159
|
writeError(result.message);
|
|
688691
689160
|
process.exit(1);
|
|
688692
689161
|
}
|
|
688693
|
-
var
|
|
689162
|
+
var init_providers2 = __esm(() => {
|
|
688694
689163
|
init_providerRegistry();
|
|
688695
689164
|
init_settings2();
|
|
688696
689165
|
});
|
|
@@ -689862,7 +690331,7 @@ async function update() {
|
|
|
689862
690331
|
logEvent("tengu_update_check", {});
|
|
689863
690332
|
const diagnostic = await getDoctorDiagnostic();
|
|
689864
690333
|
const result = await checkUpgradeStatus({
|
|
689865
|
-
currentVersion: "1.27.
|
|
690334
|
+
currentVersion: "1.27.6",
|
|
689866
690335
|
packageName: UR_AGENT_PACKAGE_NAME,
|
|
689867
690336
|
installationType: diagnostic.installationType,
|
|
689868
690337
|
latestVersion: () => getLatestNpmPackageVersion(UR_AGENT_PACKAGE_NAME)
|
|
@@ -691108,7 +691577,7 @@ ${customInstructions}` : customInstructions;
|
|
|
691108
691577
|
}
|
|
691109
691578
|
}
|
|
691110
691579
|
logForDiagnosticsNoPII("info", "started", {
|
|
691111
|
-
version: "1.27.
|
|
691580
|
+
version: "1.27.6",
|
|
691112
691581
|
is_native_binary: isInBundledMode()
|
|
691113
691582
|
});
|
|
691114
691583
|
registerCleanup(async () => {
|
|
@@ -691892,7 +692361,7 @@ Usage: ur --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
691892
692361
|
pendingHookMessages
|
|
691893
692362
|
}, renderAndRun);
|
|
691894
692363
|
}
|
|
691895
|
-
}).version("1.27.
|
|
692364
|
+
}).version("1.27.6 (UR-AGENT)", "-v, --version", "Output the version number");
|
|
691896
692365
|
program2.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
|
|
691897
692366
|
program2.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
|
|
691898
692367
|
if (canUserConfigureAdvisor()) {
|
|
@@ -692015,51 +692484,51 @@ Usage: ur --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
692015
692484
|
auth2.command("chatgpt").description("Sign in through the official Codex CLI for ChatGPT subscription access").option("--device-auth", "Use Codex CLI device authorization when supported").option("--dry-run", "Show the official command without launching it").option("--json", "Output as JSON").action(async (options2) => {
|
|
692016
692485
|
const {
|
|
692017
692486
|
providerAuthHandler: providerAuthHandler2
|
|
692018
|
-
} = await Promise.resolve().then(() => (
|
|
692487
|
+
} = await Promise.resolve().then(() => (init_providers2(), exports_providers));
|
|
692019
692488
|
await providerAuthHandler2("chatgpt", options2);
|
|
692020
692489
|
});
|
|
692021
692490
|
auth2.command("claude").description("Sign in through the official Claude Code CLI subscription login").option("--dry-run", "Show the official command without launching it").option("--json", "Output as JSON").action(async (options2) => {
|
|
692022
692491
|
const {
|
|
692023
692492
|
providerAuthHandler: providerAuthHandler2
|
|
692024
|
-
} = await Promise.resolve().then(() => (
|
|
692493
|
+
} = await Promise.resolve().then(() => (init_providers2(), exports_providers));
|
|
692025
692494
|
await providerAuthHandler2("claude", options2);
|
|
692026
692495
|
});
|
|
692027
692496
|
auth2.command("gemini").description("Use the official Gemini CLI login flow where supported").option("--dry-run", "Show the official command without launching it").option("--json", "Output as JSON").action(async (options2) => {
|
|
692028
692497
|
const {
|
|
692029
692498
|
providerAuthHandler: providerAuthHandler2
|
|
692030
|
-
} = await Promise.resolve().then(() => (
|
|
692499
|
+
} = await Promise.resolve().then(() => (init_providers2(), exports_providers));
|
|
692031
692500
|
await providerAuthHandler2("gemini", options2);
|
|
692032
692501
|
});
|
|
692033
692502
|
auth2.command("antigravity").description("Use the official Antigravity CLI login flow where supported").option("--dry-run", "Show the official command without launching it").option("--json", "Output as JSON").action(async (options2) => {
|
|
692034
692503
|
const {
|
|
692035
692504
|
providerAuthHandler: providerAuthHandler2
|
|
692036
|
-
} = await Promise.resolve().then(() => (
|
|
692505
|
+
} = await Promise.resolve().then(() => (init_providers2(), exports_providers));
|
|
692037
692506
|
await providerAuthHandler2("antigravity", options2);
|
|
692038
692507
|
});
|
|
692039
692508
|
const provider = program2.command("provider").description("Manage legal model providers").configureHelp(createSortedHelpConfig());
|
|
692040
692509
|
provider.command("list").description("List supported provider adapters and legal access paths").option("--json", "Output as JSON").action(async (options2) => {
|
|
692041
692510
|
const {
|
|
692042
692511
|
providerListHandler: providerListHandler2
|
|
692043
|
-
} = await Promise.resolve().then(() => (
|
|
692512
|
+
} = await Promise.resolve().then(() => (init_providers2(), exports_providers));
|
|
692044
692513
|
await providerListHandler2(options2);
|
|
692045
692514
|
});
|
|
692046
692515
|
provider.command("status").description("Show selected provider readiness").option("--json", "Output as JSON").action(async (options2) => {
|
|
692047
692516
|
const {
|
|
692048
692517
|
providerStatusHandler: providerStatusHandler2
|
|
692049
|
-
} = await Promise.resolve().then(() => (
|
|
692518
|
+
} = await Promise.resolve().then(() => (init_providers2(), exports_providers));
|
|
692050
692519
|
await providerStatusHandler2(options2);
|
|
692051
692520
|
});
|
|
692052
692521
|
provider.command("doctor [provider]").description("Check a provider without reading hidden credential files").option("--json", "Output as JSON").action(async (providerArg, options2) => {
|
|
692053
692522
|
const {
|
|
692054
692523
|
providerDoctorHandler: providerDoctorHandler2
|
|
692055
|
-
} = await Promise.resolve().then(() => (
|
|
692524
|
+
} = await Promise.resolve().then(() => (init_providers2(), exports_providers));
|
|
692056
692525
|
await providerDoctorHandler2(providerArg, options2);
|
|
692057
692526
|
});
|
|
692058
692527
|
const configCmd = program2.command("config").description("Manage safe UR-AGENT settings").configureHelp(createSortedHelpConfig());
|
|
692059
692528
|
configCmd.command("set <key> <value...>").description("Set a safe non-secret setting: provider, provider.fallback, provider.command_path, model, or base_url").action(async (key, value) => {
|
|
692060
692529
|
const {
|
|
692061
692530
|
configSetHandler: configSetHandler2
|
|
692062
|
-
} = await Promise.resolve().then(() => (
|
|
692531
|
+
} = await Promise.resolve().then(() => (init_providers2(), exports_providers));
|
|
692063
692532
|
await configSetHandler2(key, value);
|
|
692064
692533
|
});
|
|
692065
692534
|
const coworkOption = () => new Option("--cowork", "Use cowork_plugins directory").hideHelp();
|
|
@@ -692676,6 +693145,7 @@ var init_main3 = __esm(() => {
|
|
|
692676
693145
|
init_ollamaModels();
|
|
692677
693146
|
init_ollamaDiscovery();
|
|
692678
693147
|
init_ollamaConfig();
|
|
693148
|
+
init_providers();
|
|
692679
693149
|
init_PermissionMode();
|
|
692680
693150
|
init_permissionSetup();
|
|
692681
693151
|
init_cacheUtils();
|
|
@@ -692769,7 +693239,7 @@ if (false) {}
|
|
|
692769
693239
|
async function main2() {
|
|
692770
693240
|
const args = process.argv.slice(2);
|
|
692771
693241
|
if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
|
|
692772
|
-
console.log(`${"1.27.
|
|
693242
|
+
console.log(`${"1.27.6"} (UR-AGENT)`);
|
|
692773
693243
|
return;
|
|
692774
693244
|
}
|
|
692775
693245
|
if (args[0] === "a2a" && args[1] === "serve" && !args.includes("--help") && !args.includes("-h")) {
|