release-note 0.0.6 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.cjs +1 -1
- package/dist/bin.mjs +1 -1
- package/dist/{dist-DRIR3fHo.cjs → dist-BvsdEIPM.cjs} +1 -1
- package/dist/{dist-DwW1fFke.mjs → dist-CAvr2NGX.mjs} +1 -1
- package/dist/{generate-CSl3Pwtm.mjs → generate-7V2JnFA2.mjs} +72 -28
- package/dist/{generate-D2NQIyPO.cjs → generate-Dek8yxKi.cjs} +72 -28
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +34 -7
- package/dist/index.d.mts +34 -7
- package/dist/index.mjs +1 -1
- package/dist/{token-Bz5RE7Gd.cjs → token-C4YQI8jF.cjs} +1 -1
- package/dist/{token-C91WYSPw.mjs → token-CZ2jk4PL.mjs} +1 -1
- package/package.json +1 -1
package/dist/bin.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
const require_chunk = require("./chunk-Cek0wNdY.cjs");
|
|
3
|
-
const require_generate = require("./generate-
|
|
3
|
+
const require_generate = require("./generate-Dek8yxKi.cjs");
|
|
4
4
|
let node_events = require("node:events");
|
|
5
5
|
let node_child_process = require("node:child_process");
|
|
6
6
|
node_child_process = require_chunk.__toESM(node_child_process, 1);
|
package/dist/bin.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { C as resolveConfig, t as generateReleaseNote } from "./generate-
|
|
2
|
+
import { C as resolveConfig, t as generateReleaseNote } from "./generate-7V2JnFA2.mjs";
|
|
3
3
|
import { EventEmitter } from "node:events";
|
|
4
4
|
import childProcess from "node:child_process";
|
|
5
5
|
import path from "node:path";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
require("./chunk-Cek0wNdY.cjs");
|
|
2
|
-
const require_generate = require("./generate-
|
|
2
|
+
const require_generate = require("./generate-Dek8yxKi.cjs");
|
|
3
3
|
//#region node_modules/.pnpm/@ai-sdk+openai-compatible@2.0.48_zod@4.4.3/node_modules/@ai-sdk/openai-compatible/dist/index.mjs
|
|
4
4
|
function toCamelCase(str) {
|
|
5
5
|
return str.replace(/[_-]([a-z])/g, (g) => g[1].toUpperCase());
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as number, D as boolean, E as array, M as record, N as string, O as literal, P as union, S as UnsupportedFunctionalityError, T as any, _ as withUserAgentSuffix, a as convertBase64ToUint8Array, b as InvalidResponseDataError, c as createEventSourceResponseHandler, d as downloadBlob, f as generateId, g as postJsonToApi, h as postFormDataToApi, i as combineHeaders, j as object, k as looseObject, l as createJsonErrorResponseHandler, m as parseProviderOptions, o as convertToBase64, p as isParsableJson, s as convertToFormData, u as createJsonResponseHandler, v as withoutTrailingSlash, w as _enum, x as TooManyEmbeddingValuesForCallError, y as InvalidPromptError } from "./generate-
|
|
1
|
+
import { A as number, D as boolean, E as array, M as record, N as string, O as literal, P as union, S as UnsupportedFunctionalityError, T as any, _ as withUserAgentSuffix, a as convertBase64ToUint8Array, b as InvalidResponseDataError, c as createEventSourceResponseHandler, d as downloadBlob, f as generateId, g as postJsonToApi, h as postFormDataToApi, i as combineHeaders, j as object, k as looseObject, l as createJsonErrorResponseHandler, m as parseProviderOptions, o as convertToBase64, p as isParsableJson, s as convertToFormData, u as createJsonResponseHandler, v as withoutTrailingSlash, w as _enum, x as TooManyEmbeddingValuesForCallError, y as InvalidPromptError } from "./generate-7V2JnFA2.mjs";
|
|
2
2
|
//#region node_modules/.pnpm/@ai-sdk+openai-compatible@2.0.48_zod@4.4.3/node_modules/@ai-sdk/openai-compatible/dist/index.mjs
|
|
3
3
|
function toCamelCase(str) {
|
|
4
4
|
return str.replace(/[_-]([a-z])/g, (g) => g[1].toUpperCase());
|
|
@@ -13963,19 +13963,37 @@ config(en_default());
|
|
|
13963
13963
|
var zod_default = external_exports;
|
|
13964
13964
|
//#endregion
|
|
13965
13965
|
//#region src/config/config-schema.ts
|
|
13966
|
-
const
|
|
13967
|
-
const
|
|
13966
|
+
const commitSchema = object$1({ commit: string$1() });
|
|
13967
|
+
const tagSchema = object$1({
|
|
13968
|
+
tag: string$1().or(_instanceof(RegExp)),
|
|
13969
|
+
offset: number$1().int().min(0).optional()
|
|
13970
|
+
});
|
|
13971
|
+
const gitCommitTargetSchema = union([tagSchema, object$1({
|
|
13972
|
+
prev: union([tagSchema, commitSchema]),
|
|
13973
|
+
current: union([tagSchema, commitSchema])
|
|
13974
|
+
})]);
|
|
13975
|
+
const generateConfigSchema = object$1({
|
|
13968
13976
|
apiUrl: string$1().optional(),
|
|
13969
13977
|
apiKeyEnv: union([string$1(), array$1(string$1())]).optional(),
|
|
13970
13978
|
provider: _enum(Object.keys(SUPPORTED_PROVIDERS)).default("@ai-sdk/openai-compatible"),
|
|
13971
13979
|
headers: record(string$1(), string$1()).optional(),
|
|
13972
13980
|
options: record(string$1(), unknown()).optional()
|
|
13973
|
-
})
|
|
13974
|
-
|
|
13975
|
-
match: gitCommitTargetSchema.default({ tag: ".*" }),
|
|
13981
|
+
}).extend({
|
|
13982
|
+
target: gitCommitTargetSchema.default({ tag: ".*" }),
|
|
13976
13983
|
model: string$1().min(1),
|
|
13977
|
-
|
|
13978
|
-
|
|
13984
|
+
temperature: number$1().min(0).max(1).optional(),
|
|
13985
|
+
topP: number$1().min(0).max(1).optional(),
|
|
13986
|
+
topK: number$1().optional(),
|
|
13987
|
+
maxRetries: number$1().int().min(0).optional(),
|
|
13988
|
+
maxOutputTokens: number$1().int().min(1).optional(),
|
|
13989
|
+
toolChoice: _enum([
|
|
13990
|
+
"auto",
|
|
13991
|
+
"none",
|
|
13992
|
+
"required"
|
|
13993
|
+
]).optional(),
|
|
13994
|
+
steps: number$1().int().min(5).max(500).optional(),
|
|
13995
|
+
instructions: string$1().optional()
|
|
13996
|
+
});
|
|
13979
13997
|
//#endregion
|
|
13980
13998
|
//#region src/config/resolve-config.ts
|
|
13981
13999
|
const CONFIG_PATHS = [
|
|
@@ -14019,7 +14037,7 @@ async function resolveProvider(name, options) {
|
|
|
14019
14037
|
if (name === "@ai-sdk/openai-compatible") {
|
|
14020
14038
|
if (!options.apiUrl) throw new Error("\"\"apiUrl\"\" is required for openai-compatible provider");
|
|
14021
14039
|
if (!resolvedApiKey) throw new Error("No API key found in the specified environment variables");
|
|
14022
|
-
const { createOpenAICompatible } = await import("./dist-
|
|
14040
|
+
const { createOpenAICompatible } = await import("./dist-CAvr2NGX.mjs");
|
|
14023
14041
|
return createOpenAICompatible({
|
|
14024
14042
|
name,
|
|
14025
14043
|
apiKey: resolvedApiKey,
|
|
@@ -14039,6 +14057,9 @@ async function resolveProvider(name, options) {
|
|
|
14039
14057
|
}
|
|
14040
14058
|
//#endregion
|
|
14041
14059
|
//#region node_modules/.pnpm/daily-code@1.1.16/node_modules/daily-code/dist/index.mjs
|
|
14060
|
+
function numberClamp(num, min, max) {
|
|
14061
|
+
return Math.min(Math.max(num, min), max);
|
|
14062
|
+
}
|
|
14042
14063
|
function objectPick(obj, keys) {
|
|
14043
14064
|
return keys.reduce((res, key) => {
|
|
14044
14065
|
res[key] = obj[key];
|
|
@@ -14047,11 +14068,11 @@ function objectPick(obj, keys) {
|
|
|
14047
14068
|
}
|
|
14048
14069
|
//#endregion
|
|
14049
14070
|
//#region src/lib/git.ts
|
|
14050
|
-
async function getGitCommitHash(git, target,
|
|
14071
|
+
async function getGitCommitHash(git, target, defaultOffset) {
|
|
14051
14072
|
if ("tag" in target) {
|
|
14052
|
-
const
|
|
14053
|
-
const
|
|
14054
|
-
const matched = tags.filter((tag) =>
|
|
14073
|
+
const offset = target.offset ?? defaultOffset;
|
|
14074
|
+
const targetRegex = target.tag instanceof RegExp ? target.tag : new RegExp(target.tag);
|
|
14075
|
+
const matched = (await git.tags({ "--sort": "-v:refname" })).all.filter((tag) => targetRegex.test(tag));
|
|
14055
14076
|
if (matched.length === 0) throw new Error(`No tags matched pattern: ${target.tag}`);
|
|
14056
14077
|
if (offset < 0 || offset >= matched.length) throw new Error(`Offset ${offset} out of range: only ${matched.length} tag(s) matched pattern ${target.tag}`);
|
|
14057
14078
|
const tag = matched[offset];
|
|
@@ -14061,10 +14082,10 @@ async function getGitCommitHash(git, target, offset = 0) {
|
|
|
14061
14082
|
throw new Error("Invalid target: must contain either \"tag\" or \"commit\"");
|
|
14062
14083
|
}
|
|
14063
14084
|
async function getGitCommitsInfo(git, match) {
|
|
14064
|
-
const
|
|
14065
|
-
const current = await getGitCommitHash(git, match, 0);
|
|
14085
|
+
const prev = await getGitCommitHash(git, "prev" in match ? match.prev : match, 1);
|
|
14086
|
+
const current = await getGitCommitHash(git, "current" in match ? match.current : match, 0);
|
|
14066
14087
|
return [...(await git.log({
|
|
14067
|
-
from:
|
|
14088
|
+
from: prev,
|
|
14068
14089
|
to: current
|
|
14069
14090
|
})).all].map((c) => objectPick(c, [
|
|
14070
14091
|
"hash",
|
|
@@ -19910,7 +19931,7 @@ var require_get_vercel_oidc_token = /* @__PURE__ */ __commonJSMin(((exports, mod
|
|
|
19910
19931
|
err = error;
|
|
19911
19932
|
}
|
|
19912
19933
|
try {
|
|
19913
|
-
const [{ getTokenPayload, isExpired }, { refreshToken }] = await Promise.all([await Promise.resolve().then(() => /* @__PURE__ */ __toESM(require_token_util())), await import("./token-
|
|
19934
|
+
const [{ getTokenPayload, isExpired }, { refreshToken }] = await Promise.all([await Promise.resolve().then(() => /* @__PURE__ */ __toESM(require_token_util())), await import("./token-CZ2jk4PL.mjs").then((m) => /* @__PURE__ */ __toESM(m.default))]);
|
|
19914
19935
|
if (!token || isExpired(getTokenPayload(token), options?.expirationBufferMs)) {
|
|
19915
19936
|
await refreshToken(options);
|
|
19916
19937
|
token = getVercelOidcTokenSync();
|
|
@@ -30809,15 +30830,13 @@ The release notes should be concise, informative, and highlight the key changes,
|
|
|
30809
30830
|
- DO NOT use --- to separate sections, use ## for headings instead.
|
|
30810
30831
|
`;
|
|
30811
30832
|
}
|
|
30812
|
-
function
|
|
30813
|
-
return
|
|
30814
|
-
${commits.map((c) => [
|
|
30833
|
+
function buildCommitsMarkdown(commits) {
|
|
30834
|
+
return commits.map((c) => [
|
|
30815
30835
|
`- Commithash: ${c.hash}`,
|
|
30836
|
+
` - > ${c.message.replaceAll("\n", "\n > ")}`,
|
|
30816
30837
|
` - Timestamp: ${c.date}`,
|
|
30817
|
-
` - Author: ${c.author_name} <${c.author_email}
|
|
30818
|
-
|
|
30819
|
-
].join("\n")).join("\n")}
|
|
30820
|
-
`;
|
|
30838
|
+
` - Author: ${c.author_name} <${c.author_email}>`
|
|
30839
|
+
].join("\n")).join("\n\n");
|
|
30821
30840
|
}
|
|
30822
30841
|
//#endregion
|
|
30823
30842
|
//#region src/generate/tools.ts
|
|
@@ -30899,16 +30918,41 @@ function generateTools(git, logger) {
|
|
|
30899
30918
|
//#region src/generate/index.ts
|
|
30900
30919
|
async function generateReleaseNote(cwd, options) {
|
|
30901
30920
|
const git = simpleGit(cwd);
|
|
30902
|
-
const commits = await getGitCommitsInfo(git, options.
|
|
30921
|
+
const commits = await getGitCommitsInfo(git, options.target);
|
|
30922
|
+
if (commits.length < 2) throw new Error(`Not enough commits found between the specified targets to generate release notes. Found ${commits.length} commit(s).`);
|
|
30903
30923
|
const provider = await resolveProvider(options.provider, options);
|
|
30904
30924
|
if (!provider) throw new Error(`Unsupported provider: ${options.provider}`);
|
|
30905
|
-
const
|
|
30925
|
+
const commitsMarkdown = buildCommitsMarkdown(commits);
|
|
30926
|
+
options.logger?.("=".repeat(80));
|
|
30927
|
+
options.logger?.(commitsMarkdown);
|
|
30928
|
+
options.logger?.("=".repeat(80));
|
|
30929
|
+
const steps = options.steps ?? numberClamp((commits.length + 1) * 2, 10, 100);
|
|
30930
|
+
options.logger?.(`Generating with "${options.provider}" using "${options.model}" in ${steps} steps...`);
|
|
30906
30931
|
const result = await generateText({
|
|
30907
30932
|
model: provider(options.model),
|
|
30908
|
-
|
|
30909
|
-
|
|
30933
|
+
temperature: options.temperature,
|
|
30934
|
+
topP: options.topP,
|
|
30935
|
+
topK: options.topK,
|
|
30936
|
+
maxRetries: options.maxRetries,
|
|
30937
|
+
maxOutputTokens: options.maxOutputTokens,
|
|
30938
|
+
toolChoice: options.toolChoice,
|
|
30910
30939
|
tools: generateTools(git, options.logger),
|
|
30911
|
-
stopWhen: stepCountIs(
|
|
30940
|
+
stopWhen: stepCountIs(steps),
|
|
30941
|
+
system: buildSystemPrompt(Math.floor(steps / 1.5)),
|
|
30942
|
+
messages: [
|
|
30943
|
+
{
|
|
30944
|
+
role: "user",
|
|
30945
|
+
content: "Here are the commits related to the release:"
|
|
30946
|
+
},
|
|
30947
|
+
{
|
|
30948
|
+
role: "user",
|
|
30949
|
+
content: commitsMarkdown.trim()
|
|
30950
|
+
},
|
|
30951
|
+
...options.instructions ? [{
|
|
30952
|
+
role: "user",
|
|
30953
|
+
content: options.instructions
|
|
30954
|
+
}] : []
|
|
30955
|
+
]
|
|
30912
30956
|
});
|
|
30913
30957
|
return {
|
|
30914
30958
|
commits,
|
|
@@ -13968,19 +13968,37 @@ config(en_default());
|
|
|
13968
13968
|
var zod_default = external_exports;
|
|
13969
13969
|
//#endregion
|
|
13970
13970
|
//#region src/config/config-schema.ts
|
|
13971
|
-
const
|
|
13972
|
-
const
|
|
13971
|
+
const commitSchema = object$1({ commit: string$1() });
|
|
13972
|
+
const tagSchema = object$1({
|
|
13973
|
+
tag: string$1().or(_instanceof(RegExp)),
|
|
13974
|
+
offset: number$1().int().min(0).optional()
|
|
13975
|
+
});
|
|
13976
|
+
const gitCommitTargetSchema = union([tagSchema, object$1({
|
|
13977
|
+
prev: union([tagSchema, commitSchema]),
|
|
13978
|
+
current: union([tagSchema, commitSchema])
|
|
13979
|
+
})]);
|
|
13980
|
+
const generateConfigSchema = object$1({
|
|
13973
13981
|
apiUrl: string$1().optional(),
|
|
13974
13982
|
apiKeyEnv: union([string$1(), array$1(string$1())]).optional(),
|
|
13975
13983
|
provider: _enum(Object.keys(SUPPORTED_PROVIDERS)).default("@ai-sdk/openai-compatible"),
|
|
13976
13984
|
headers: record(string$1(), string$1()).optional(),
|
|
13977
13985
|
options: record(string$1(), unknown()).optional()
|
|
13978
|
-
})
|
|
13979
|
-
|
|
13980
|
-
match: gitCommitTargetSchema.default({ tag: ".*" }),
|
|
13986
|
+
}).extend({
|
|
13987
|
+
target: gitCommitTargetSchema.default({ tag: ".*" }),
|
|
13981
13988
|
model: string$1().min(1),
|
|
13982
|
-
|
|
13983
|
-
|
|
13989
|
+
temperature: number$1().min(0).max(1).optional(),
|
|
13990
|
+
topP: number$1().min(0).max(1).optional(),
|
|
13991
|
+
topK: number$1().optional(),
|
|
13992
|
+
maxRetries: number$1().int().min(0).optional(),
|
|
13993
|
+
maxOutputTokens: number$1().int().min(1).optional(),
|
|
13994
|
+
toolChoice: _enum([
|
|
13995
|
+
"auto",
|
|
13996
|
+
"none",
|
|
13997
|
+
"required"
|
|
13998
|
+
]).optional(),
|
|
13999
|
+
steps: number$1().int().min(5).max(500).optional(),
|
|
14000
|
+
instructions: string$1().optional()
|
|
14001
|
+
});
|
|
13984
14002
|
//#endregion
|
|
13985
14003
|
//#region src/config/resolve-config.ts
|
|
13986
14004
|
const CONFIG_PATHS = [
|
|
@@ -14024,7 +14042,7 @@ async function resolveProvider(name, options) {
|
|
|
14024
14042
|
if (name === "@ai-sdk/openai-compatible") {
|
|
14025
14043
|
if (!options.apiUrl) throw new Error("\"\"apiUrl\"\" is required for openai-compatible provider");
|
|
14026
14044
|
if (!resolvedApiKey) throw new Error("No API key found in the specified environment variables");
|
|
14027
|
-
const { createOpenAICompatible } = await Promise.resolve().then(() => require("./dist-
|
|
14045
|
+
const { createOpenAICompatible } = await Promise.resolve().then(() => require("./dist-BvsdEIPM.cjs"));
|
|
14028
14046
|
return createOpenAICompatible({
|
|
14029
14047
|
name,
|
|
14030
14048
|
apiKey: resolvedApiKey,
|
|
@@ -14044,6 +14062,9 @@ async function resolveProvider(name, options) {
|
|
|
14044
14062
|
}
|
|
14045
14063
|
//#endregion
|
|
14046
14064
|
//#region node_modules/.pnpm/daily-code@1.1.16/node_modules/daily-code/dist/index.mjs
|
|
14065
|
+
function numberClamp(num, min, max) {
|
|
14066
|
+
return Math.min(Math.max(num, min), max);
|
|
14067
|
+
}
|
|
14047
14068
|
function objectPick(obj, keys) {
|
|
14048
14069
|
return keys.reduce((res, key) => {
|
|
14049
14070
|
res[key] = obj[key];
|
|
@@ -14052,11 +14073,11 @@ function objectPick(obj, keys) {
|
|
|
14052
14073
|
}
|
|
14053
14074
|
//#endregion
|
|
14054
14075
|
//#region src/lib/git.ts
|
|
14055
|
-
async function getGitCommitHash(git, target,
|
|
14076
|
+
async function getGitCommitHash(git, target, defaultOffset) {
|
|
14056
14077
|
if ("tag" in target) {
|
|
14057
|
-
const
|
|
14058
|
-
const
|
|
14059
|
-
const matched = tags.filter((tag) =>
|
|
14078
|
+
const offset = target.offset ?? defaultOffset;
|
|
14079
|
+
const targetRegex = target.tag instanceof RegExp ? target.tag : new RegExp(target.tag);
|
|
14080
|
+
const matched = (await git.tags({ "--sort": "-v:refname" })).all.filter((tag) => targetRegex.test(tag));
|
|
14060
14081
|
if (matched.length === 0) throw new Error(`No tags matched pattern: ${target.tag}`);
|
|
14061
14082
|
if (offset < 0 || offset >= matched.length) throw new Error(`Offset ${offset} out of range: only ${matched.length} tag(s) matched pattern ${target.tag}`);
|
|
14062
14083
|
const tag = matched[offset];
|
|
@@ -14066,10 +14087,10 @@ async function getGitCommitHash(git, target, offset = 0) {
|
|
|
14066
14087
|
throw new Error("Invalid target: must contain either \"tag\" or \"commit\"");
|
|
14067
14088
|
}
|
|
14068
14089
|
async function getGitCommitsInfo(git, match) {
|
|
14069
|
-
const
|
|
14070
|
-
const current = await getGitCommitHash(git, match, 0);
|
|
14090
|
+
const prev = await getGitCommitHash(git, "prev" in match ? match.prev : match, 1);
|
|
14091
|
+
const current = await getGitCommitHash(git, "current" in match ? match.current : match, 0);
|
|
14071
14092
|
return [...(await git.log({
|
|
14072
|
-
from:
|
|
14093
|
+
from: prev,
|
|
14073
14094
|
to: current
|
|
14074
14095
|
})).all].map((c) => objectPick(c, [
|
|
14075
14096
|
"hash",
|
|
@@ -19915,7 +19936,7 @@ var require_get_vercel_oidc_token = /* @__PURE__ */ require_chunk.__commonJSMin(
|
|
|
19915
19936
|
err = error;
|
|
19916
19937
|
}
|
|
19917
19938
|
try {
|
|
19918
|
-
const [{ getTokenPayload, isExpired }, { refreshToken }] = await Promise.all([await Promise.resolve().then(() => /* @__PURE__ */ require_chunk.__toESM(require_token_util())), await Promise.resolve().then(() => /* @__PURE__ */ require_chunk.__toESM(require("./token-
|
|
19939
|
+
const [{ getTokenPayload, isExpired }, { refreshToken }] = await Promise.all([await Promise.resolve().then(() => /* @__PURE__ */ require_chunk.__toESM(require_token_util())), await Promise.resolve().then(() => /* @__PURE__ */ require_chunk.__toESM(require("./token-C4YQI8jF.cjs").default))]);
|
|
19919
19940
|
if (!token || isExpired(getTokenPayload(token), options?.expirationBufferMs)) {
|
|
19920
19941
|
await refreshToken(options);
|
|
19921
19942
|
token = getVercelOidcTokenSync();
|
|
@@ -30814,15 +30835,13 @@ The release notes should be concise, informative, and highlight the key changes,
|
|
|
30814
30835
|
- DO NOT use --- to separate sections, use ## for headings instead.
|
|
30815
30836
|
`;
|
|
30816
30837
|
}
|
|
30817
|
-
function
|
|
30818
|
-
return
|
|
30819
|
-
${commits.map((c) => [
|
|
30838
|
+
function buildCommitsMarkdown(commits) {
|
|
30839
|
+
return commits.map((c) => [
|
|
30820
30840
|
`- Commithash: ${c.hash}`,
|
|
30841
|
+
` - > ${c.message.replaceAll("\n", "\n > ")}`,
|
|
30821
30842
|
` - Timestamp: ${c.date}`,
|
|
30822
|
-
` - Author: ${c.author_name} <${c.author_email}
|
|
30823
|
-
|
|
30824
|
-
].join("\n")).join("\n")}
|
|
30825
|
-
`;
|
|
30843
|
+
` - Author: ${c.author_name} <${c.author_email}>`
|
|
30844
|
+
].join("\n")).join("\n\n");
|
|
30826
30845
|
}
|
|
30827
30846
|
//#endregion
|
|
30828
30847
|
//#region src/generate/tools.ts
|
|
@@ -30904,16 +30923,41 @@ function generateTools(git, logger) {
|
|
|
30904
30923
|
//#region src/generate/index.ts
|
|
30905
30924
|
async function generateReleaseNote(cwd, options) {
|
|
30906
30925
|
const git = simpleGit(cwd);
|
|
30907
|
-
const commits = await getGitCommitsInfo(git, options.
|
|
30926
|
+
const commits = await getGitCommitsInfo(git, options.target);
|
|
30927
|
+
if (commits.length < 2) throw new Error(`Not enough commits found between the specified targets to generate release notes. Found ${commits.length} commit(s).`);
|
|
30908
30928
|
const provider = await resolveProvider(options.provider, options);
|
|
30909
30929
|
if (!provider) throw new Error(`Unsupported provider: ${options.provider}`);
|
|
30910
|
-
const
|
|
30930
|
+
const commitsMarkdown = buildCommitsMarkdown(commits);
|
|
30931
|
+
options.logger?.("=".repeat(80));
|
|
30932
|
+
options.logger?.(commitsMarkdown);
|
|
30933
|
+
options.logger?.("=".repeat(80));
|
|
30934
|
+
const steps = options.steps ?? numberClamp((commits.length + 1) * 2, 10, 100);
|
|
30935
|
+
options.logger?.(`Generating with "${options.provider}" using "${options.model}" in ${steps} steps...`);
|
|
30911
30936
|
const result = await generateText({
|
|
30912
30937
|
model: provider(options.model),
|
|
30913
|
-
|
|
30914
|
-
|
|
30938
|
+
temperature: options.temperature,
|
|
30939
|
+
topP: options.topP,
|
|
30940
|
+
topK: options.topK,
|
|
30941
|
+
maxRetries: options.maxRetries,
|
|
30942
|
+
maxOutputTokens: options.maxOutputTokens,
|
|
30943
|
+
toolChoice: options.toolChoice,
|
|
30915
30944
|
tools: generateTools(git, options.logger),
|
|
30916
|
-
stopWhen: stepCountIs(
|
|
30945
|
+
stopWhen: stepCountIs(steps),
|
|
30946
|
+
system: buildSystemPrompt(Math.floor(steps / 1.5)),
|
|
30947
|
+
messages: [
|
|
30948
|
+
{
|
|
30949
|
+
role: "user",
|
|
30950
|
+
content: "Here are the commits related to the release:"
|
|
30951
|
+
},
|
|
30952
|
+
{
|
|
30953
|
+
role: "user",
|
|
30954
|
+
content: commitsMarkdown.trim()
|
|
30955
|
+
},
|
|
30956
|
+
...options.instructions ? [{
|
|
30957
|
+
role: "user",
|
|
30958
|
+
content: options.instructions
|
|
30959
|
+
}] : []
|
|
30960
|
+
]
|
|
30917
30961
|
});
|
|
30918
30962
|
return {
|
|
30919
30963
|
commits,
|
package/dist/index.cjs
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
require("./chunk-Cek0wNdY.cjs");
|
|
6
|
-
const require_generate = require("./generate-
|
|
6
|
+
const require_generate = require("./generate-Dek8yxKi.cjs");
|
|
7
7
|
//#region src/index.ts
|
|
8
8
|
var src_default = require_generate.generateReleaseNote;
|
|
9
9
|
const releaseNote = require_generate.generateReleaseNote;
|
package/dist/index.d.cts
CHANGED
|
@@ -4759,6 +4759,10 @@ interface ZodReadonly<T extends SomeType = $ZodType> extends _ZodType<$ZodReadon
|
|
|
4759
4759
|
unwrap(): T;
|
|
4760
4760
|
}
|
|
4761
4761
|
declare const ZodReadonly: $constructor<ZodReadonly>;
|
|
4762
|
+
interface ZodCustom<O = unknown, I = unknown> extends _ZodType<$ZodCustomInternals<O, I>>, $ZodCustom<O, I> {
|
|
4763
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
4764
|
+
}
|
|
4765
|
+
declare const ZodCustom: $constructor<ZodCustom>;
|
|
4762
4766
|
//#endregion
|
|
4763
4767
|
//#region node_modules/.pnpm/@ai-sdk+provider-utils@4.0.27_zod@4.4.3/node_modules/@ai-sdk/provider-utils/dist/index.d.ts
|
|
4764
4768
|
/**
|
|
@@ -6420,13 +6424,6 @@ declare global {
|
|
|
6420
6424
|
//#endregion
|
|
6421
6425
|
//#region src/config/config-schema.d.ts
|
|
6422
6426
|
declare const generateConfigSchema: ZodObject<{
|
|
6423
|
-
match: ZodDefault<ZodUnion<readonly [ZodObject<{
|
|
6424
|
-
tag: ZodString;
|
|
6425
|
-
}, $strip>, ZodObject<{
|
|
6426
|
-
commit: ZodString;
|
|
6427
|
-
}, $strip>]>>;
|
|
6428
|
-
model: ZodString;
|
|
6429
|
-
steps: ZodOptional<ZodNumber>;
|
|
6430
6427
|
apiUrl: ZodOptional<ZodString>;
|
|
6431
6428
|
apiKeyEnv: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>]>>;
|
|
6432
6429
|
provider: ZodDefault<ZodEnum<{
|
|
@@ -6454,6 +6451,36 @@ declare const generateConfigSchema: ZodObject<{
|
|
|
6454
6451
|
}>>;
|
|
6455
6452
|
headers: ZodOptional<ZodRecord<ZodString, ZodString>>;
|
|
6456
6453
|
options: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
|
|
6454
|
+
target: ZodDefault<ZodUnion<readonly [ZodObject<{
|
|
6455
|
+
tag: ZodUnion<[ZodString, ZodCustom<RegExp, RegExp>]>;
|
|
6456
|
+
offset: ZodOptional<ZodNumber>;
|
|
6457
|
+
}, $strip>, ZodObject<{
|
|
6458
|
+
prev: ZodUnion<readonly [ZodObject<{
|
|
6459
|
+
tag: ZodUnion<[ZodString, ZodCustom<RegExp, RegExp>]>;
|
|
6460
|
+
offset: ZodOptional<ZodNumber>;
|
|
6461
|
+
}, $strip>, ZodObject<{
|
|
6462
|
+
commit: ZodString;
|
|
6463
|
+
}, $strip>]>;
|
|
6464
|
+
current: ZodUnion<readonly [ZodObject<{
|
|
6465
|
+
tag: ZodUnion<[ZodString, ZodCustom<RegExp, RegExp>]>;
|
|
6466
|
+
offset: ZodOptional<ZodNumber>;
|
|
6467
|
+
}, $strip>, ZodObject<{
|
|
6468
|
+
commit: ZodString;
|
|
6469
|
+
}, $strip>]>;
|
|
6470
|
+
}, $strip>]>>;
|
|
6471
|
+
model: ZodString;
|
|
6472
|
+
temperature: ZodOptional<ZodNumber>;
|
|
6473
|
+
topP: ZodOptional<ZodNumber>;
|
|
6474
|
+
topK: ZodOptional<ZodNumber>;
|
|
6475
|
+
maxRetries: ZodOptional<ZodNumber>;
|
|
6476
|
+
maxOutputTokens: ZodOptional<ZodNumber>;
|
|
6477
|
+
toolChoice: ZodOptional<ZodEnum<{
|
|
6478
|
+
auto: "auto";
|
|
6479
|
+
none: "none";
|
|
6480
|
+
required: "required";
|
|
6481
|
+
}>>;
|
|
6482
|
+
steps: ZodOptional<ZodNumber>;
|
|
6483
|
+
instructions: ZodOptional<ZodString>;
|
|
6457
6484
|
}, $strip>;
|
|
6458
6485
|
//#endregion
|
|
6459
6486
|
//#region src/generate/index.d.ts
|
package/dist/index.d.mts
CHANGED
|
@@ -4759,6 +4759,10 @@ interface ZodReadonly<T extends SomeType = $ZodType> extends _ZodType<$ZodReadon
|
|
|
4759
4759
|
unwrap(): T;
|
|
4760
4760
|
}
|
|
4761
4761
|
declare const ZodReadonly: $constructor<ZodReadonly>;
|
|
4762
|
+
interface ZodCustom<O = unknown, I = unknown> extends _ZodType<$ZodCustomInternals<O, I>>, $ZodCustom<O, I> {
|
|
4763
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
4764
|
+
}
|
|
4765
|
+
declare const ZodCustom: $constructor<ZodCustom>;
|
|
4762
4766
|
//#endregion
|
|
4763
4767
|
//#region node_modules/.pnpm/@ai-sdk+provider-utils@4.0.27_zod@4.4.3/node_modules/@ai-sdk/provider-utils/dist/index.d.ts
|
|
4764
4768
|
/**
|
|
@@ -6420,13 +6424,6 @@ declare global {
|
|
|
6420
6424
|
//#endregion
|
|
6421
6425
|
//#region src/config/config-schema.d.ts
|
|
6422
6426
|
declare const generateConfigSchema: ZodObject<{
|
|
6423
|
-
match: ZodDefault<ZodUnion<readonly [ZodObject<{
|
|
6424
|
-
tag: ZodString;
|
|
6425
|
-
}, $strip>, ZodObject<{
|
|
6426
|
-
commit: ZodString;
|
|
6427
|
-
}, $strip>]>>;
|
|
6428
|
-
model: ZodString;
|
|
6429
|
-
steps: ZodOptional<ZodNumber>;
|
|
6430
6427
|
apiUrl: ZodOptional<ZodString>;
|
|
6431
6428
|
apiKeyEnv: ZodOptional<ZodUnion<readonly [ZodString, ZodArray<ZodString>]>>;
|
|
6432
6429
|
provider: ZodDefault<ZodEnum<{
|
|
@@ -6454,6 +6451,36 @@ declare const generateConfigSchema: ZodObject<{
|
|
|
6454
6451
|
}>>;
|
|
6455
6452
|
headers: ZodOptional<ZodRecord<ZodString, ZodString>>;
|
|
6456
6453
|
options: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
|
|
6454
|
+
target: ZodDefault<ZodUnion<readonly [ZodObject<{
|
|
6455
|
+
tag: ZodUnion<[ZodString, ZodCustom<RegExp, RegExp>]>;
|
|
6456
|
+
offset: ZodOptional<ZodNumber>;
|
|
6457
|
+
}, $strip>, ZodObject<{
|
|
6458
|
+
prev: ZodUnion<readonly [ZodObject<{
|
|
6459
|
+
tag: ZodUnion<[ZodString, ZodCustom<RegExp, RegExp>]>;
|
|
6460
|
+
offset: ZodOptional<ZodNumber>;
|
|
6461
|
+
}, $strip>, ZodObject<{
|
|
6462
|
+
commit: ZodString;
|
|
6463
|
+
}, $strip>]>;
|
|
6464
|
+
current: ZodUnion<readonly [ZodObject<{
|
|
6465
|
+
tag: ZodUnion<[ZodString, ZodCustom<RegExp, RegExp>]>;
|
|
6466
|
+
offset: ZodOptional<ZodNumber>;
|
|
6467
|
+
}, $strip>, ZodObject<{
|
|
6468
|
+
commit: ZodString;
|
|
6469
|
+
}, $strip>]>;
|
|
6470
|
+
}, $strip>]>>;
|
|
6471
|
+
model: ZodString;
|
|
6472
|
+
temperature: ZodOptional<ZodNumber>;
|
|
6473
|
+
topP: ZodOptional<ZodNumber>;
|
|
6474
|
+
topK: ZodOptional<ZodNumber>;
|
|
6475
|
+
maxRetries: ZodOptional<ZodNumber>;
|
|
6476
|
+
maxOutputTokens: ZodOptional<ZodNumber>;
|
|
6477
|
+
toolChoice: ZodOptional<ZodEnum<{
|
|
6478
|
+
auto: "auto";
|
|
6479
|
+
none: "none";
|
|
6480
|
+
required: "required";
|
|
6481
|
+
}>>;
|
|
6482
|
+
steps: ZodOptional<ZodNumber>;
|
|
6483
|
+
instructions: ZodOptional<ZodString>;
|
|
6457
6484
|
}, $strip>;
|
|
6458
6485
|
//#endregion
|
|
6459
6486
|
//#region src/generate/index.d.ts
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-Cek0wNdY.cjs");
|
|
2
|
-
const require_generate = require("./generate-
|
|
2
|
+
const require_generate = require("./generate-Dek8yxKi.cjs");
|
|
3
3
|
//#region node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token.js
|
|
4
4
|
var require_token = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
5
5
|
var __defProp = Object.defineProperty;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __commonJSMin } from "./chunk-CNf5ZN-e.mjs";
|
|
2
|
-
import { n as require_token_util, r as require_token_error } from "./generate-
|
|
2
|
+
import { n as require_token_util, r as require_token_error } from "./generate-7V2JnFA2.mjs";
|
|
3
3
|
//#region node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token.js
|
|
4
4
|
var require_token = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
5
5
|
var __defProp = Object.defineProperty;
|