@fern-api/fern-api-dev 5.10.3 → 5.11.0-2-g3fd07c40850
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/cli.cjs +156 -89
- package/package.json +2 -2
package/cli.cjs
CHANGED
|
@@ -357065,18 +357065,18 @@ var require_VersionUtils = __commonJS({
|
|
|
357065
357065
|
exports2.MAX_AI_DIFF_BYTES = 4e4;
|
|
357066
357066
|
exports2.MAX_CHUNKS = 40;
|
|
357067
357067
|
exports2.MAX_RAW_DIFF_BYTES = 1e7;
|
|
357068
|
-
var
|
|
357069
|
-
(function(
|
|
357070
|
-
|
|
357071
|
-
|
|
357072
|
-
|
|
357073
|
-
|
|
357074
|
-
})(
|
|
357068
|
+
var VersionBump3;
|
|
357069
|
+
(function(VersionBump4) {
|
|
357070
|
+
VersionBump4["MAJOR"] = "MAJOR";
|
|
357071
|
+
VersionBump4["MINOR"] = "MINOR";
|
|
357072
|
+
VersionBump4["PATCH"] = "PATCH";
|
|
357073
|
+
VersionBump4["NO_CHANGE"] = "NO_CHANGE";
|
|
357074
|
+
})(VersionBump3 || (exports2.VersionBump = VersionBump3 = {}));
|
|
357075
357075
|
var VERSION_BUMP_RANK = {
|
|
357076
|
-
[
|
|
357077
|
-
[
|
|
357078
|
-
[
|
|
357079
|
-
[
|
|
357076
|
+
[VersionBump3.MAJOR]: 3,
|
|
357077
|
+
[VersionBump3.MINOR]: 2,
|
|
357078
|
+
[VersionBump3.PATCH]: 1,
|
|
357079
|
+
[VersionBump3.NO_CHANGE]: 0
|
|
357080
357080
|
};
|
|
357081
357081
|
function maxVersionBump3(a3, b8) {
|
|
357082
357082
|
return (VERSION_BUMP_RANK[a3] ?? 0) >= (VERSION_BUMP_RANK[b8] ?? 0) ? a3 : b8;
|
|
@@ -357100,16 +357100,16 @@ var require_VersionUtils = __commonJS({
|
|
|
357100
357100
|
const preRelease = matcher[5];
|
|
357101
357101
|
const buildMetadata = matcher[6];
|
|
357102
357102
|
let preserveMetadata = false;
|
|
357103
|
-
if (versionBump ===
|
|
357103
|
+
if (versionBump === VersionBump3.MAJOR) {
|
|
357104
357104
|
major2++;
|
|
357105
357105
|
minor = 0;
|
|
357106
357106
|
patch5 = 0;
|
|
357107
|
-
} else if (versionBump ===
|
|
357107
|
+
} else if (versionBump === VersionBump3.MINOR) {
|
|
357108
357108
|
minor++;
|
|
357109
357109
|
patch5 = 0;
|
|
357110
|
-
} else if (versionBump ===
|
|
357110
|
+
} else if (versionBump === VersionBump3.PATCH) {
|
|
357111
357111
|
patch5++;
|
|
357112
|
-
} else if (versionBump ===
|
|
357112
|
+
} else if (versionBump === VersionBump3.NO_CHANGE) {
|
|
357113
357113
|
preserveMetadata = true;
|
|
357114
357114
|
} else {
|
|
357115
357115
|
throw new AutoVersioningService_js_1.AutoVersioningException("Unknown version bump type: " + versionBump);
|
|
@@ -357628,11 +357628,11 @@ var VersionBump;
|
|
|
357628
357628
|
var init_types5 = __esm({
|
|
357629
357629
|
"../ai/lib/baml_client/types.js"() {
|
|
357630
357630
|
"use strict";
|
|
357631
|
-
(function(
|
|
357632
|
-
|
|
357633
|
-
|
|
357634
|
-
|
|
357635
|
-
|
|
357631
|
+
(function(VersionBump3) {
|
|
357632
|
+
VersionBump3["MAJOR"] = "MAJOR";
|
|
357633
|
+
VersionBump3["MINOR"] = "MINOR";
|
|
357634
|
+
VersionBump3["PATCH"] = "PATCH";
|
|
357635
|
+
VersionBump3["NO_CHANGE"] = "NO_CHANGE";
|
|
357636
357636
|
})(VersionBump || (VersionBump = {}));
|
|
357637
357637
|
}
|
|
357638
357638
|
});
|
|
@@ -357662,6 +357662,24 @@ var init_watchers = __esm({
|
|
|
357662
357662
|
});
|
|
357663
357663
|
|
|
357664
357664
|
// ../ai/lib/baml_client/index.js
|
|
357665
|
+
var baml_client_exports = {};
|
|
357666
|
+
__export(baml_client_exports, {
|
|
357667
|
+
BamlClientFinishReasonError: () => import_baml6.BamlClientFinishReasonError,
|
|
357668
|
+
BamlClientHttpError: () => import_baml6.BamlClientHttpError,
|
|
357669
|
+
BamlValidationError: () => import_baml6.BamlValidationError,
|
|
357670
|
+
VersionBump: () => VersionBump,
|
|
357671
|
+
all_succeeded: () => all_succeeded,
|
|
357672
|
+
b: () => b7,
|
|
357673
|
+
flush: () => flush2,
|
|
357674
|
+
get_checks: () => get_checks,
|
|
357675
|
+
onLogEvent: () => onLogEvent,
|
|
357676
|
+
resetBamlEnvVars: () => resetBamlEnvVars,
|
|
357677
|
+
setTags: () => setTags2,
|
|
357678
|
+
traceAsync: () => traceAsync,
|
|
357679
|
+
traceSync: () => traceSync,
|
|
357680
|
+
version: () => version5,
|
|
357681
|
+
watchers: () => watchers_exports
|
|
357682
|
+
});
|
|
357665
357683
|
var import_baml5, import_baml6, version5;
|
|
357666
357684
|
var init_baml_client = __esm({
|
|
357667
357685
|
"../ai/lib/baml_client/index.js"() {
|
|
@@ -357679,6 +357697,10 @@ var init_baml_client = __esm({
|
|
|
357679
357697
|
});
|
|
357680
357698
|
|
|
357681
357699
|
// ../ai/lib/configureBamlClient.js
|
|
357700
|
+
var configureBamlClient_exports = {};
|
|
357701
|
+
__export(configureBamlClient_exports, {
|
|
357702
|
+
configureBamlClient: () => configureBamlClient
|
|
357703
|
+
});
|
|
357682
357704
|
function configureBamlClient(config5) {
|
|
357683
357705
|
const registry2 = new import_baml7.ClientRegistry();
|
|
357684
357706
|
const clientOptions = {
|
|
@@ -357699,31 +357721,59 @@ var init_configureBamlClient = __esm({
|
|
|
357699
357721
|
}
|
|
357700
357722
|
});
|
|
357701
357723
|
|
|
357724
|
+
// ../ai/lib/loader.js
|
|
357725
|
+
async function loadBamlDependencies() {
|
|
357726
|
+
try {
|
|
357727
|
+
const [baml, bamlClient, config5] = await Promise.all([
|
|
357728
|
+
import("@boundaryml/baml"),
|
|
357729
|
+
Promise.resolve().then(() => (init_baml_client(), baml_client_exports)),
|
|
357730
|
+
Promise.resolve().then(() => (init_configureBamlClient(), configureBamlClient_exports))
|
|
357731
|
+
]);
|
|
357732
|
+
return {
|
|
357733
|
+
ClientRegistry: baml.ClientRegistry,
|
|
357734
|
+
BamlClient: bamlClient.b,
|
|
357735
|
+
configureBamlClient: config5.configureBamlClient
|
|
357736
|
+
};
|
|
357737
|
+
} catch (error50) {
|
|
357738
|
+
const original = error50 instanceof Error ? error50.message : String(error50);
|
|
357739
|
+
throw new Error(`${INSTALL_MESSAGE}
|
|
357740
|
+
|
|
357741
|
+
Original error: ${original}`);
|
|
357742
|
+
}
|
|
357743
|
+
}
|
|
357744
|
+
var INSTALL_MESSAGE;
|
|
357745
|
+
var init_loader = __esm({
|
|
357746
|
+
"../ai/lib/loader.js"() {
|
|
357747
|
+
"use strict";
|
|
357748
|
+
INSTALL_MESSAGE = "@boundaryml/baml is required for AI features (auto-versioning, sdk-diff).\nInstall it with:\n npm install @boundaryml/baml\n pnpm add @boundaryml/baml";
|
|
357749
|
+
}
|
|
357750
|
+
});
|
|
357751
|
+
|
|
357752
|
+
// ../ai/lib/types.js
|
|
357753
|
+
var VersionBump2;
|
|
357754
|
+
var init_types6 = __esm({
|
|
357755
|
+
"../ai/lib/types.js"() {
|
|
357756
|
+
"use strict";
|
|
357757
|
+
(function(VersionBump3) {
|
|
357758
|
+
VersionBump3["MAJOR"] = "MAJOR";
|
|
357759
|
+
VersionBump3["MINOR"] = "MINOR";
|
|
357760
|
+
VersionBump3["PATCH"] = "PATCH";
|
|
357761
|
+
VersionBump3["NO_CHANGE"] = "NO_CHANGE";
|
|
357762
|
+
})(VersionBump2 || (VersionBump2 = {}));
|
|
357763
|
+
}
|
|
357764
|
+
});
|
|
357765
|
+
|
|
357702
357766
|
// ../ai/lib/index.js
|
|
357703
357767
|
var lib_exports11 = {};
|
|
357704
357768
|
__export(lib_exports11, {
|
|
357705
|
-
|
|
357706
|
-
|
|
357707
|
-
BamlValidationError: () => import_baml6.BamlValidationError,
|
|
357708
|
-
VersionBump: () => VersionBump,
|
|
357709
|
-
all_succeeded: () => all_succeeded,
|
|
357710
|
-
b: () => b7,
|
|
357711
|
-
configureBamlClient: () => configureBamlClient,
|
|
357712
|
-
flush: () => flush2,
|
|
357713
|
-
get_checks: () => get_checks,
|
|
357714
|
-
onLogEvent: () => onLogEvent,
|
|
357715
|
-
resetBamlEnvVars: () => resetBamlEnvVars,
|
|
357716
|
-
setTags: () => setTags2,
|
|
357717
|
-
traceAsync: () => traceAsync,
|
|
357718
|
-
traceSync: () => traceSync,
|
|
357719
|
-
version: () => version5,
|
|
357720
|
-
watchers: () => watchers_exports
|
|
357769
|
+
VersionBump: () => VersionBump2,
|
|
357770
|
+
loadBamlDependencies: () => loadBamlDependencies
|
|
357721
357771
|
});
|
|
357722
357772
|
var init_lib12 = __esm({
|
|
357723
357773
|
"../ai/lib/index.js"() {
|
|
357724
357774
|
"use strict";
|
|
357725
|
-
|
|
357726
|
-
|
|
357775
|
+
init_loader();
|
|
357776
|
+
init_types6();
|
|
357727
357777
|
}
|
|
357728
357778
|
});
|
|
357729
357779
|
|
|
@@ -358124,9 +358174,9 @@ ${newBlock}${remainder}`;
|
|
|
358124
358174
|
return `${message.trimEnd()}${FERN_TRAILER}`;
|
|
358125
358175
|
}
|
|
358126
358176
|
async analyzeSingle(cleanedDiff, language, previousVersion) {
|
|
358127
|
-
const { client: client3, VersionBump:
|
|
358177
|
+
const { client: client3, VersionBump: VersionBump3 } = await this.loadBaml();
|
|
358128
358178
|
const result = await client3.AnalyzeSdkDiff(cleanedDiff, language, previousVersion, this.config.priorChangelog ?? "", this.config.specCommitMessage ?? "");
|
|
358129
|
-
if (result.version_bump ===
|
|
358179
|
+
if (result.version_bump === VersionBump3.NO_CHANGE) {
|
|
358130
358180
|
return null;
|
|
358131
358181
|
}
|
|
358132
358182
|
return {
|
|
@@ -358137,8 +358187,8 @@ ${newBlock}${remainder}`;
|
|
|
358137
358187
|
};
|
|
358138
358188
|
}
|
|
358139
358189
|
async analyzeChunks(chunks, language, previousVersion) {
|
|
358140
|
-
const { client: client3, VersionBump:
|
|
358141
|
-
let bestBump =
|
|
358190
|
+
const { client: client3, VersionBump: VersionBump3 } = await this.loadBaml();
|
|
358191
|
+
let bestBump = VersionBump3.NO_CHANGE;
|
|
358142
358192
|
let bestMessage = "";
|
|
358143
358193
|
let bestVersionBumpReason;
|
|
358144
358194
|
const changelogEntries = [];
|
|
@@ -358148,7 +358198,7 @@ ${newBlock}${remainder}`;
|
|
|
358148
358198
|
continue;
|
|
358149
358199
|
}
|
|
358150
358200
|
const analysis = await client3.AnalyzeSdkDiff(chunk2, language, previousVersion, this.config.priorChangelog ?? "", this.config.specCommitMessage ?? "");
|
|
358151
|
-
if (analysis.version_bump ===
|
|
358201
|
+
if (analysis.version_bump === VersionBump3.NO_CHANGE) {
|
|
358152
358202
|
continue;
|
|
358153
358203
|
}
|
|
358154
358204
|
const prev = bestBump;
|
|
@@ -358162,7 +358212,7 @@ ${newBlock}${remainder}`;
|
|
|
358162
358212
|
changelogEntries.push(entry);
|
|
358163
358213
|
}
|
|
358164
358214
|
}
|
|
358165
|
-
if (bestBump ===
|
|
358215
|
+
if (bestBump === VersionBump3.NO_CHANGE) {
|
|
358166
358216
|
return null;
|
|
358167
358217
|
}
|
|
358168
358218
|
if (changelogEntries.length <= 1) {
|
|
@@ -358203,11 +358253,12 @@ ${newBlock}${remainder}`;
|
|
|
358203
358253
|
if (this.config.ai == null) {
|
|
358204
358254
|
throw new Error("AutoVersionStep: ai config is missing. Set autoVersion.ai to a BAML provider+model pair.");
|
|
358205
358255
|
}
|
|
358206
|
-
const
|
|
358207
|
-
const
|
|
358256
|
+
const { loadBamlDependencies: loadBamlDependencies2, VersionBump: VersionBump3 } = await Promise.resolve().then(() => __importStar2((init_lib12(), __toCommonJS(lib_exports11))));
|
|
358257
|
+
const { BamlClient, configureBamlClient: configureBamlClient2 } = await loadBamlDependencies2();
|
|
358258
|
+
const registry2 = configureBamlClient2(this.config.ai);
|
|
358208
358259
|
return {
|
|
358209
|
-
client:
|
|
358210
|
-
VersionBump:
|
|
358260
|
+
client: BamlClient.withOptions({ clientRegistry: registry2 }),
|
|
358261
|
+
VersionBump: VersionBump3
|
|
358211
358262
|
};
|
|
358212
358263
|
}
|
|
358213
358264
|
/**
|
|
@@ -392321,7 +392372,7 @@ var init_NodeWebSocketTransport = __esm({
|
|
|
392321
392372
|
|
|
392322
392373
|
// ../../../node_modules/.pnpm/@puppeteer+browsers@2.13.0/node_modules/@puppeteer/browsers/lib/esm/browser-data/types.js
|
|
392323
392374
|
var Browser3, BrowserPlatform, BrowserTag, ChromeReleaseChannel;
|
|
392324
|
-
var
|
|
392375
|
+
var init_types7 = __esm({
|
|
392325
392376
|
"../../../node_modules/.pnpm/@puppeteer+browsers@2.13.0/node_modules/@puppeteer/browsers/lib/esm/browser-data/types.js"() {
|
|
392326
392377
|
"use strict";
|
|
392327
392378
|
(function(Browser5) {
|
|
@@ -419518,7 +419569,7 @@ var init_chrome = __esm({
|
|
|
419518
419569
|
import_node_path28 = __toESM(require("path"), 1);
|
|
419519
419570
|
import_semver14 = __toESM(require_semver2(), 1);
|
|
419520
419571
|
init_httpUtil();
|
|
419521
|
-
|
|
419572
|
+
init_types7();
|
|
419522
419573
|
baseVersionUrl = "https://googlechromelabs.github.io/chrome-for-testing";
|
|
419523
419574
|
WINDOWS_ENV_PARAM_NAMES = [
|
|
419524
419575
|
"PROGRAMFILES",
|
|
@@ -419574,7 +419625,7 @@ var init_chrome_headless_shell = __esm({
|
|
|
419574
419625
|
"../../../node_modules/.pnpm/@puppeteer+browsers@2.13.0/node_modules/@puppeteer/browsers/lib/esm/browser-data/chrome-headless-shell.js"() {
|
|
419575
419626
|
"use strict";
|
|
419576
419627
|
import_node_path29 = __toESM(require("path"), 1);
|
|
419577
|
-
|
|
419628
|
+
init_types7();
|
|
419578
419629
|
init_chrome();
|
|
419579
419630
|
}
|
|
419580
419631
|
});
|
|
@@ -419619,7 +419670,7 @@ var init_chromedriver = __esm({
|
|
|
419619
419670
|
"../../../node_modules/.pnpm/@puppeteer+browsers@2.13.0/node_modules/@puppeteer/browsers/lib/esm/browser-data/chromedriver.js"() {
|
|
419620
419671
|
"use strict";
|
|
419621
419672
|
import_node_path30 = __toESM(require("path"), 1);
|
|
419622
|
-
|
|
419673
|
+
init_types7();
|
|
419623
419674
|
init_chrome();
|
|
419624
419675
|
}
|
|
419625
419676
|
});
|
|
@@ -419684,7 +419735,7 @@ var init_chromium = __esm({
|
|
|
419684
419735
|
"use strict";
|
|
419685
419736
|
import_node_path31 = __toESM(require("path"), 1);
|
|
419686
419737
|
init_httpUtil();
|
|
419687
|
-
|
|
419738
|
+
init_types7();
|
|
419688
419739
|
}
|
|
419689
419740
|
});
|
|
419690
419741
|
|
|
@@ -420034,7 +420085,7 @@ var init_firefox = __esm({
|
|
|
420034
420085
|
import_node_fs21 = __toESM(require("fs"), 1);
|
|
420035
420086
|
import_node_path32 = __toESM(require("path"), 1);
|
|
420036
420087
|
init_httpUtil();
|
|
420037
|
-
|
|
420088
|
+
init_types7();
|
|
420038
420089
|
(function(FirefoxChannel2) {
|
|
420039
420090
|
FirefoxChannel2["STABLE"] = "stable";
|
|
420040
420091
|
FirefoxChannel2["ESR"] = "esr";
|
|
@@ -420207,7 +420258,7 @@ var init_browser_data = __esm({
|
|
|
420207
420258
|
init_chromedriver();
|
|
420208
420259
|
init_chromium();
|
|
420209
420260
|
init_firefox();
|
|
420210
|
-
|
|
420261
|
+
init_types7();
|
|
420211
420262
|
downloadUrls = {
|
|
420212
420263
|
[Browser3.CHROMEDRIVER]: resolveDownloadUrl3,
|
|
420213
420264
|
[Browser3.CHROMEHEADLESSSHELL]: resolveDownloadUrl2,
|
|
@@ -424686,7 +424737,7 @@ var init_main = __esm({
|
|
|
424686
424737
|
init_browser_data();
|
|
424687
424738
|
init_CLI();
|
|
424688
424739
|
init_Cache();
|
|
424689
|
-
|
|
424740
|
+
init_types7();
|
|
424690
424741
|
init_DefaultProvider();
|
|
424691
424742
|
init_provider();
|
|
424692
424743
|
}
|
|
@@ -623221,7 +623272,7 @@ var AccessTokenPosthogManager = class {
|
|
|
623221
623272
|
properties: {
|
|
623222
623273
|
...event,
|
|
623223
623274
|
...event.properties,
|
|
623224
|
-
version: "5.
|
|
623275
|
+
version: "5.11.0-2-g3fd07c40850",
|
|
623225
623276
|
usingAccessToken: true
|
|
623226
623277
|
}
|
|
623227
623278
|
});
|
|
@@ -623275,7 +623326,7 @@ var UserPosthogManager = class {
|
|
|
623275
623326
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
623276
623327
|
event: "CLI",
|
|
623277
623328
|
properties: {
|
|
623278
|
-
version: "5.
|
|
623329
|
+
version: "5.11.0-2-g3fd07c40850",
|
|
623279
623330
|
...event,
|
|
623280
623331
|
...event.properties,
|
|
623281
623332
|
usingAccessToken: false,
|
|
@@ -848226,7 +848277,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
|
848226
848277
|
var LOGS_FOLDER_NAME = "logs";
|
|
848227
848278
|
var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
|
|
848228
848279
|
function getCliSource() {
|
|
848229
|
-
const version7 = "5.
|
|
848280
|
+
const version7 = "5.11.0-2-g3fd07c40850";
|
|
848230
848281
|
return `cli@${version7}`;
|
|
848231
848282
|
}
|
|
848232
848283
|
var DebugLogger = class {
|
|
@@ -858440,7 +858491,7 @@ async function createAndStartJob({ projectConfig, workspace, organization, inter
|
|
|
858440
858491
|
await startJob({ intermediateRepresentation, job, context: context3, generatorInvocation, irVersionOverride });
|
|
858441
858492
|
return job;
|
|
858442
858493
|
}
|
|
858443
|
-
async function createJob({ projectConfig, workspace, organization, generatorInvocation, version: version7, context: context3, shouldLogS3Url, token, whitelabel, absolutePathToPreview, fiddlePreview, pushPreviewBranch, fernignoreContents, skipIfNoDiff, loginCommand }) {
|
|
858494
|
+
async function createJob({ projectConfig, workspace, organization, generatorInvocation, version: version7, context: context3, shouldLogS3Url, token, whitelabel, replay, absolutePathToPreview, fiddlePreview, pushPreviewBranch, fernignoreContents, skipIfNoDiff, loginCommand }) {
|
|
858444
858495
|
const remoteGenerationService = createFiddleService({ token: token.value });
|
|
858445
858496
|
const generatorConfig = {
|
|
858446
858497
|
id: generatorInvocation.name,
|
|
@@ -858449,7 +858500,7 @@ async function createJob({ projectConfig, workspace, organization, generatorInvo
|
|
|
858449
858500
|
customConfig: generatorInvocation.config,
|
|
858450
858501
|
publishMetadata: generatorInvocation.publishMetadata
|
|
858451
858502
|
};
|
|
858452
|
-
const
|
|
858503
|
+
const createJobRequest = {
|
|
858453
858504
|
apiName: workspace.definition.rootApiFile.contents.name,
|
|
858454
858505
|
version: version7,
|
|
858455
858506
|
organizationName: organization,
|
|
@@ -858461,6 +858512,7 @@ async function createJob({ projectConfig, workspace, organization, generatorInvo
|
|
|
858461
858512
|
shouldLogS3Url
|
|
858462
858513
|
}),
|
|
858463
858514
|
whitelabel,
|
|
858515
|
+
replay: replay != null ? { enabled: replay.enabled } : void 0,
|
|
858464
858516
|
// fiddlePreview overrides what we send to Fiddle as `preview`.
|
|
858465
858517
|
// For sdk preview: fiddlePreview=false so Fiddle doesn't set dryRun=true
|
|
858466
858518
|
// (Fiddle uses `dryRun = generatePreview`, so preview=false → actual publish).
|
|
@@ -858478,7 +858530,8 @@ async function createJob({ projectConfig, workspace, organization, generatorInvo
|
|
|
858478
858530
|
// runId: process.env.FERN_RUN_ID
|
|
858479
858531
|
// Fiddle will use these for separate PRs, automerge, run_id correlation,
|
|
858480
858532
|
// and breaking change handling. (skipIfNoDiff is forwarded above — see fern-api/fiddle#708.)
|
|
858481
|
-
}
|
|
858533
|
+
};
|
|
858534
|
+
const createResponse = await remoteGenerationService.remoteGen.createJobV3(createJobRequest);
|
|
858482
858535
|
if (!createResponse.ok) {
|
|
858483
858536
|
const rawError = createResponse.error;
|
|
858484
858537
|
if (rawError?.content?.reason === "status-code" && rawError.content.statusCode === 429) {
|
|
@@ -860888,7 +860941,7 @@ var LegacyDocsPublisher = class {
|
|
|
860888
860941
|
previewId,
|
|
860889
860942
|
disableTemplates: void 0,
|
|
860890
860943
|
skipUpload,
|
|
860891
|
-
cliVersion: "5.
|
|
860944
|
+
cliVersion: "5.11.0-2-g3fd07c40850",
|
|
860892
860945
|
loginCommand: "fern auth login"
|
|
860893
860946
|
});
|
|
860894
860947
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
@@ -912730,7 +912783,7 @@ var LocalTaskHandler = class {
|
|
|
912730
912783
|
const cleanedDiffBytes = Buffer.byteLength(cleanedDiff, "utf-8");
|
|
912731
912784
|
if (cleanedDiffBytes > import_autoversion.MAX_RAW_DIFF_BYTES) {
|
|
912732
912785
|
this.context.logger.warn(`Diff too large for analysis (${(cleanedDiffBytes / 1e6).toFixed(1)}MB, limit ${import_autoversion.MAX_RAW_DIFF_BYTES / 1e6}MB). Falling back to PATCH increment.`);
|
|
912733
|
-
const newVersion2 = this.incrementVersion(previousVersion,
|
|
912786
|
+
const newVersion2 = this.incrementVersion(previousVersion, VersionBump2.PATCH);
|
|
912734
912787
|
const fallbackMessage = this.isWhitelabel ? "SDK regeneration" : "SDK regeneration\n\n\u{1F33F} Generated with Fern";
|
|
912735
912788
|
return {
|
|
912736
912789
|
version: newVersion2,
|
|
@@ -912748,7 +912801,7 @@ var LocalTaskHandler = class {
|
|
|
912748
912801
|
if (cappedChunks.length <= 1) {
|
|
912749
912802
|
analysis = await this.getAnalysis(cleanedDiff, this.generatorLanguage ?? "unknown", previousVersion ?? "0.0.0", priorChangelog, specCommitMessage);
|
|
912750
912803
|
} else {
|
|
912751
|
-
let bestBump =
|
|
912804
|
+
let bestBump = VersionBump2.NO_CHANGE;
|
|
912752
912805
|
let bestMessage = "";
|
|
912753
912806
|
let bestVersionBumpReason;
|
|
912754
912807
|
const allChangelogEntries = [];
|
|
@@ -912775,7 +912828,7 @@ var LocalTaskHandler = class {
|
|
|
912775
912828
|
}
|
|
912776
912829
|
this.context.logger.debug(`Chunk ${i9 + 1} result: ${chunkAnalysis.versionBump}` + (bestBump !== prevBest ? ` (new highest: ${bestBump})` : ""));
|
|
912777
912830
|
}
|
|
912778
|
-
if (bestBump ===
|
|
912831
|
+
if (bestBump === VersionBump2.NO_CHANGE) {
|
|
912779
912832
|
analysis = null;
|
|
912780
912833
|
} else {
|
|
912781
912834
|
let changelogEntry2;
|
|
@@ -912786,7 +912839,8 @@ var LocalTaskHandler = class {
|
|
|
912786
912839
|
try {
|
|
912787
912840
|
this.context.logger.debug(`Consolidating ${allChangelogEntries.length} changelog entries via AI rollup`);
|
|
912788
912841
|
const projectedVersion = this.incrementVersion(previousVersion, bestBump);
|
|
912789
|
-
const
|
|
912842
|
+
const { BamlClient } = await loadBamlDependencies();
|
|
912843
|
+
const rollup = await BamlClient.withOptions({
|
|
912790
912844
|
clientRegistry: await this.getClientRegistry()
|
|
912791
912845
|
}).ConsolidateChangelog(rawEntries, bestBump, this.generatorLanguage ?? "unknown", previousVersion, projectedVersion);
|
|
912792
912846
|
changelogEntry2 = rollup.consolidated_changelog?.trim() || rawEntries;
|
|
@@ -912812,7 +912866,7 @@ var LocalTaskHandler = class {
|
|
|
912812
912866
|
} catch (aiError) {
|
|
912813
912867
|
const errorMessage = extractErrorMessage(aiError);
|
|
912814
912868
|
this.context.logger.warn(`AI analysis failed, falling back to PATCH increment. Diff stats: ${cleanedDiff.length.toLocaleString()} chars cleaned (${cleanedDiffSizeKB}KB cleaned, ${rawDiffSizeKB}KB raw), ${cleanedFileCount} files remaining. ` + (cappedChunks.length > 1 ? `The diff was split into ${cappedChunks.length} chunks but analysis still failed. ` : "") + `Error: ${errorMessage}`);
|
|
912815
|
-
const newVersion2 = this.incrementVersion(previousVersion,
|
|
912869
|
+
const newVersion2 = this.incrementVersion(previousVersion, VersionBump2.PATCH);
|
|
912816
912870
|
const fallbackMessage = this.isWhitelabel ? "SDK regeneration" : "SDK regeneration\n\n\u{1F33F} Generated with Fern";
|
|
912817
912871
|
return {
|
|
912818
912872
|
version: newVersion2,
|
|
@@ -912879,9 +912933,10 @@ var LocalTaskHandler = class {
|
|
|
912879
912933
|
async getAnalysis(cleanedDiff, language, previousVersion, priorChangelog = "", specCommitMessage = "") {
|
|
912880
912934
|
const doAnalysis = async () => {
|
|
912881
912935
|
const clientRegistry = await this.getClientRegistry();
|
|
912882
|
-
const
|
|
912936
|
+
const { BamlClient } = await loadBamlDependencies();
|
|
912937
|
+
const bamlClient = BamlClient.withOptions({ clientRegistry });
|
|
912883
912938
|
const analysis = await bamlClient.AnalyzeSdkDiff(cleanedDiff, language, previousVersion, priorChangelog, specCommitMessage);
|
|
912884
|
-
if (analysis.version_bump ===
|
|
912939
|
+
if (analysis.version_bump === VersionBump2.NO_CHANGE) {
|
|
912885
912940
|
return null;
|
|
912886
912941
|
}
|
|
912887
912942
|
return {
|
|
@@ -912914,13 +912969,13 @@ var LocalTaskHandler = class {
|
|
|
912914
912969
|
}
|
|
912915
912970
|
let releaseType;
|
|
912916
912971
|
switch (versionBump) {
|
|
912917
|
-
case
|
|
912972
|
+
case VersionBump2.MAJOR:
|
|
912918
912973
|
releaseType = "major";
|
|
912919
912974
|
break;
|
|
912920
|
-
case
|
|
912975
|
+
case VersionBump2.MINOR:
|
|
912921
912976
|
releaseType = "minor";
|
|
912922
912977
|
break;
|
|
912923
|
-
case
|
|
912978
|
+
case VersionBump2.PATCH:
|
|
912924
912979
|
releaseType = "patch";
|
|
912925
912980
|
break;
|
|
912926
912981
|
default:
|
|
@@ -913000,7 +913055,8 @@ var LocalTaskHandler = class {
|
|
|
913000
913055
|
});
|
|
913001
913056
|
}
|
|
913002
913057
|
this.context.logger.debug(`Using AI service: ${this.ai.provider} with model ${this.ai.model}`);
|
|
913003
|
-
|
|
913058
|
+
const { configureBamlClient: configureBamlClient2 } = await loadBamlDependencies();
|
|
913059
|
+
return configureBamlClient2(this.ai);
|
|
913004
913060
|
}
|
|
913005
913061
|
addFernBranding(message) {
|
|
913006
913062
|
const trimmed2 = message.trim();
|
|
@@ -935449,7 +935505,7 @@ var CliContext = class _CliContext {
|
|
|
935449
935505
|
if (false) {
|
|
935450
935506
|
this.logger.error("CLI_VERSION is not defined");
|
|
935451
935507
|
}
|
|
935452
|
-
return "5.
|
|
935508
|
+
return "5.11.0-2-g3fd07c40850";
|
|
935453
935509
|
}
|
|
935454
935510
|
getCliName() {
|
|
935455
935511
|
if (false) {
|
|
@@ -952637,7 +952693,8 @@ async function getClientRegistry(context3, project) {
|
|
|
952637
952693
|
);
|
|
952638
952694
|
}
|
|
952639
952695
|
context3.logger.debug(`Using AI service: ${generatorsConfig.ai.provider} with model ${generatorsConfig.ai.model}`);
|
|
952640
|
-
|
|
952696
|
+
const { configureBamlClient: configureBamlClient2 } = await loadBamlDependencies();
|
|
952697
|
+
return configureBamlClient2(generatorsConfig.ai);
|
|
952641
952698
|
}
|
|
952642
952699
|
async function sdkDiffCommand({
|
|
952643
952700
|
context: context3,
|
|
@@ -952658,6 +952715,7 @@ async function sdkDiffCommand({
|
|
|
952658
952715
|
context3.failWithoutThrowing(`Directory not found: ${toPath4}`, void 0, { code: CliError.Code.ConfigError });
|
|
952659
952716
|
throw new TaskAbortSignal();
|
|
952660
952717
|
}
|
|
952718
|
+
const { BamlClient } = await loadBamlDependencies();
|
|
952661
952719
|
const clientRegistry = await getClientRegistry(context3, project);
|
|
952662
952720
|
context3.logger.info("Generating diff between directories...");
|
|
952663
952721
|
const gitDiff = await generateDiff({ context: context3, fromPath, toPath: toPath4 });
|
|
@@ -952666,7 +952724,7 @@ async function sdkDiffCommand({
|
|
|
952666
952724
|
return {
|
|
952667
952725
|
message: "No changes detected between the directories",
|
|
952668
952726
|
changelog_entry: "",
|
|
952669
|
-
version_bump:
|
|
952727
|
+
version_bump: VersionBump2.NO_CHANGE,
|
|
952670
952728
|
version_bump_reason: "No functional changes detected."
|
|
952671
952729
|
};
|
|
952672
952730
|
}
|
|
@@ -952692,13 +952750,13 @@ async function sdkDiffCommand({
|
|
|
952692
952750
|
}
|
|
952693
952751
|
context3.logger.info("Analyzing diff with LLM...");
|
|
952694
952752
|
try {
|
|
952695
|
-
const bamlClient =
|
|
952753
|
+
const bamlClient = BamlClient.withOptions({ clientRegistry });
|
|
952696
952754
|
if (cappedChunks.length <= 1) {
|
|
952697
952755
|
const analysis = await bamlClient.AnalyzeSdkDiff(cappedChunks[0] ?? gitDiff, "unknown", "0.0.0", "", "");
|
|
952698
952756
|
context3.logger.debug("Analysis complete");
|
|
952699
952757
|
return analysis;
|
|
952700
952758
|
}
|
|
952701
|
-
let bestBump =
|
|
952759
|
+
let bestBump = VersionBump2.NO_CHANGE;
|
|
952702
952760
|
let bestMessage = "";
|
|
952703
952761
|
let bestVersionBumpReason = "";
|
|
952704
952762
|
const allChangelogEntries = [];
|
|
@@ -952711,7 +952769,7 @@ async function sdkDiffCommand({
|
|
|
952711
952769
|
`Analyzing chunk ${i9 + 1}/${cappedChunks.length} (${Buffer.byteLength(chunk2, "utf-8")} bytes)`
|
|
952712
952770
|
);
|
|
952713
952771
|
const chunkAnalysis = await bamlClient.AnalyzeSdkDiff(chunk2, "unknown", "0.0.0", "", "");
|
|
952714
|
-
if (chunkAnalysis.version_bump ===
|
|
952772
|
+
if (chunkAnalysis.version_bump === VersionBump2.NO_CHANGE) {
|
|
952715
952773
|
context3.logger.debug(`Chunk ${i9 + 1} result: NO_CHANGE`);
|
|
952716
952774
|
continue;
|
|
952717
952775
|
}
|
|
@@ -952730,9 +952788,9 @@ async function sdkDiffCommand({
|
|
|
952730
952788
|
);
|
|
952731
952789
|
}
|
|
952732
952790
|
context3.logger.debug("Multi-chunk analysis complete");
|
|
952733
|
-
if (bestBump ===
|
|
952791
|
+
if (bestBump === VersionBump2.NO_CHANGE) {
|
|
952734
952792
|
return {
|
|
952735
|
-
version_bump:
|
|
952793
|
+
version_bump: VersionBump2.NO_CHANGE,
|
|
952736
952794
|
message: "No changes detected between the directories",
|
|
952737
952795
|
changelog_entry: "",
|
|
952738
952796
|
version_bump_reason: "No functional changes detected."
|
|
@@ -954193,11 +954251,13 @@ async function validateWorkspaces({
|
|
|
954193
954251
|
brokenLinks,
|
|
954194
954252
|
errorOnBrokenLinks,
|
|
954195
954253
|
isLocal,
|
|
954196
|
-
directFromOpenapi
|
|
954254
|
+
directFromOpenapi,
|
|
954255
|
+
commandLineApiWorkspace
|
|
954197
954256
|
}) {
|
|
954198
954257
|
const apiResults = [];
|
|
954199
954258
|
let docsResult;
|
|
954200
954259
|
let hasAnyErrors = false;
|
|
954260
|
+
const apiWorkspacesToValidate = commandLineApiWorkspace != null ? project.apiWorkspaces.filter((workspace) => workspace.workspaceName === commandLineApiWorkspace) : project.apiWorkspaces;
|
|
954201
954261
|
const docsWorkspace = project.docsWorkspaces;
|
|
954202
954262
|
if (docsWorkspace != null) {
|
|
954203
954263
|
const excludeRules = brokenLinks || errorOnBrokenLinks ? [] : ["valid-markdown-links"];
|
|
@@ -954224,7 +954284,7 @@ async function validateWorkspaces({
|
|
|
954224
954284
|
}
|
|
954225
954285
|
}
|
|
954226
954286
|
await Promise.all(
|
|
954227
|
-
|
|
954287
|
+
apiWorkspacesToValidate.map(async (workspace) => {
|
|
954228
954288
|
if (workspace.generatorsConfiguration?.groups.length === 0 && workspace.type !== "fern") {
|
|
954229
954289
|
return;
|
|
954230
954290
|
}
|
|
@@ -956670,16 +956730,23 @@ function addValidateCommand(cli, cliContext) {
|
|
|
956670
956730
|
default: false
|
|
956671
956731
|
}),
|
|
956672
956732
|
async (argv) => {
|
|
956733
|
+
const project = await loadProjectAndRegisterWorkspacesWithContext(cliContext, {
|
|
956734
|
+
commandLineApiWorkspace: void 0,
|
|
956735
|
+
defaultToAllApiWorkspaces: true
|
|
956736
|
+
});
|
|
956737
|
+
if (argv.api != null && !project.apiWorkspaces.some((ws5) => ws5.workspaceName === argv.api)) {
|
|
956738
|
+
cliContext.failAndThrow(`API does not exist: ${argv.api}`, void 0, {
|
|
956739
|
+
code: CliError.Code.ConfigError
|
|
956740
|
+
});
|
|
956741
|
+
}
|
|
956673
956742
|
await validateWorkspaces({
|
|
956674
|
-
project
|
|
956675
|
-
commandLineApiWorkspace: argv.api,
|
|
956676
|
-
defaultToAllApiWorkspaces: true
|
|
956677
|
-
}),
|
|
956743
|
+
project,
|
|
956678
956744
|
cliContext,
|
|
956679
956745
|
logWarnings: argv.warnings,
|
|
956680
956746
|
brokenLinks: argv.brokenLinks,
|
|
956681
956747
|
errorOnBrokenLinks: argv.strictBrokenLinks,
|
|
956682
|
-
directFromOpenapi: argv.fromOpenapi
|
|
956748
|
+
directFromOpenapi: argv.fromOpenapi,
|
|
956749
|
+
commandLineApiWorkspace: argv.api
|
|
956683
956750
|
});
|
|
956684
956751
|
}
|
|
956685
956752
|
);
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "5.
|
|
2
|
+
"version": "5.11.0-2-g3fd07c40850",
|
|
3
3
|
"repository": {
|
|
4
4
|
"type": "git",
|
|
5
5
|
"url": "git+https://github.com/fern-api/fern.git",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"files": [
|
|
9
9
|
"cli.cjs"
|
|
10
10
|
],
|
|
11
|
-
"
|
|
11
|
+
"optionalDependencies": {
|
|
12
12
|
"@boundaryml/baml": "^0.219.0"
|
|
13
13
|
},
|
|
14
14
|
"name": "@fern-api/fern-api-dev",
|