release-note 0.0.2 → 0.0.3
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/asyncToGenerator-J8hMsHFb.mjs +139 -0
- package/dist/asyncToGenerator-OdY5smjc.cjs +190 -0
- package/dist/bin.cjs +3025 -0
- package/dist/bin.cjs.map +1 -0
- package/dist/bin.d.cts +1 -0
- package/dist/bin.mjs +2989 -6
- package/dist/bin.mjs.map +1 -1
- package/dist/dist-Cjmk9o-a.cjs +1362 -0
- package/dist/dist-Cjmk9o-a.cjs.map +1 -0
- package/dist/dist-WE8_S7U0.mjs +1357 -0
- package/dist/dist-WE8_S7U0.mjs.map +1 -0
- package/dist/generate-DqPPuOfE.cjs +31880 -0
- package/dist/generate-DqPPuOfE.cjs.map +1 -0
- package/dist/generate-omq2Fgxt.mjs +31664 -0
- package/dist/generate-omq2Fgxt.mjs.map +1 -0
- package/dist/index.cjs +14 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +6486 -0
- package/dist/index.d.mts +6437 -19
- package/dist/index.mjs +1 -1
- package/dist/token-CI4ILhUM.cjs +70 -0
- package/dist/token-CI4ILhUM.cjs.map +1 -0
- package/dist/token-Cbnu-uz2.mjs +66 -0
- package/dist/token-Cbnu-uz2.mjs.map +1 -0
- package/package.json +1 -1
- package/dist/generate-CsLUDr-g.mjs +0 -403
- package/dist/generate-CsLUDr-g.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
const require_asyncToGenerator = require("./asyncToGenerator-OdY5smjc.cjs");
|
|
2
|
+
const require_generate = require("./generate-DqPPuOfE.cjs");
|
|
3
|
+
//#region node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token.js
|
|
4
|
+
var require_token = /* @__PURE__ */ require_asyncToGenerator.__commonJSMin(((exports, module) => {
|
|
5
|
+
require_asyncToGenerator.init_asyncToGenerator();
|
|
6
|
+
var __defProp = Object.defineProperty;
|
|
7
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
8
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __export = (target, all) => {
|
|
11
|
+
for (var name in all) __defProp(target, name, {
|
|
12
|
+
get: all[name],
|
|
13
|
+
enumerable: true
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
var __copyProps = (to, from, except, desc) => {
|
|
17
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
18
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
19
|
+
get: () => from[key],
|
|
20
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return to;
|
|
24
|
+
};
|
|
25
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
26
|
+
var token_exports = {};
|
|
27
|
+
__export(token_exports, { refreshToken: () => refreshToken });
|
|
28
|
+
module.exports = __toCommonJS(token_exports);
|
|
29
|
+
var import_token_error = require_generate.require_token_error();
|
|
30
|
+
var import_token_util = require_generate.require_token_util();
|
|
31
|
+
function refreshToken(_x) {
|
|
32
|
+
return _refreshToken.apply(this, arguments);
|
|
33
|
+
}
|
|
34
|
+
function _refreshToken() {
|
|
35
|
+
_refreshToken = require_asyncToGenerator._asyncToGenerator(function* (options) {
|
|
36
|
+
let projectId = options === null || options === void 0 ? void 0 : options.project;
|
|
37
|
+
let teamId = options === null || options === void 0 ? void 0 : options.team;
|
|
38
|
+
if (!projectId && !teamId) {
|
|
39
|
+
const projectInfo = (0, import_token_util.findProjectInfo)();
|
|
40
|
+
projectId = projectInfo.projectId;
|
|
41
|
+
teamId = projectInfo.teamId;
|
|
42
|
+
} else if (!projectId || !teamId) {
|
|
43
|
+
var _projectId, _teamId;
|
|
44
|
+
const projectInfo = (0, import_token_util.findProjectInfo)();
|
|
45
|
+
projectId = (_projectId = projectId) !== null && _projectId !== void 0 ? _projectId : projectInfo.projectId;
|
|
46
|
+
teamId = (_teamId = teamId) !== null && _teamId !== void 0 ? _teamId : projectInfo.teamId;
|
|
47
|
+
}
|
|
48
|
+
if (!projectId) throw new import_token_error.VercelOidcTokenError("Failed to refresh OIDC token: No project specified. Try re-linking your project with `vc link`");
|
|
49
|
+
let maybeToken = (0, import_token_util.loadToken)(projectId);
|
|
50
|
+
if (!maybeToken || (0, import_token_util.isExpired)((0, import_token_util.getTokenPayload)(maybeToken.token), options === null || options === void 0 ? void 0 : options.expirationBufferMs)) {
|
|
51
|
+
const authToken = yield (0, import_token_util.getVercelToken)({ expirationBufferMs: options === null || options === void 0 ? void 0 : options.expirationBufferMs });
|
|
52
|
+
maybeToken = yield (0, import_token_util.getVercelOidcToken)(authToken, projectId, teamId);
|
|
53
|
+
if (!maybeToken) throw new import_token_error.VercelOidcTokenError("Failed to refresh OIDC token");
|
|
54
|
+
(0, import_token_util.saveToken)(maybeToken, projectId);
|
|
55
|
+
}
|
|
56
|
+
process.env.VERCEL_OIDC_TOKEN = maybeToken.token;
|
|
57
|
+
});
|
|
58
|
+
return _refreshToken.apply(this, arguments);
|
|
59
|
+
}
|
|
60
|
+
0 && (module.exports = { refreshToken });
|
|
61
|
+
}));
|
|
62
|
+
//#endregion
|
|
63
|
+
Object.defineProperty(exports, "default", {
|
|
64
|
+
enumerable: true,
|
|
65
|
+
get: function() {
|
|
66
|
+
return require_token();
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
//# sourceMappingURL=token-CI4ILhUM.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token-CI4ILhUM.cjs","names":[],"sources":["../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar token_exports = {};\n__export(token_exports, {\n refreshToken: () => refreshToken\n});\nmodule.exports = __toCommonJS(token_exports);\nvar import_token_error = require(\"./token-error\");\nvar import_token_util = require(\"./token-util\");\nasync function refreshToken(options) {\n let projectId = options?.project;\n let teamId = options?.team;\n if (!projectId && !teamId) {\n const projectInfo = (0, import_token_util.findProjectInfo)();\n projectId = projectInfo.projectId;\n teamId = projectInfo.teamId;\n } else if (!projectId || !teamId) {\n const projectInfo = (0, import_token_util.findProjectInfo)();\n projectId = projectId ?? projectInfo.projectId;\n teamId = teamId ?? projectInfo.teamId;\n }\n if (!projectId) {\n throw new import_token_error.VercelOidcTokenError(\n \"Failed to refresh OIDC token: No project specified. Try re-linking your project with `vc link`\"\n );\n }\n let maybeToken = (0, import_token_util.loadToken)(projectId);\n if (!maybeToken || (0, import_token_util.isExpired)((0, import_token_util.getTokenPayload)(maybeToken.token), options?.expirationBufferMs)) {\n const authToken = await (0, import_token_util.getVercelToken)({\n expirationBufferMs: options?.expirationBufferMs\n });\n maybeToken = await (0, import_token_util.getVercelOidcToken)(authToken, projectId, teamId);\n if (!maybeToken) {\n throw new import_token_error.VercelOidcTokenError(\"Failed to refresh OIDC token\");\n }\n (0, import_token_util.saveToken)(maybeToken, projectId);\n }\n process.env.VERCEL_OIDC_TOKEN = maybeToken.token;\n return;\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n refreshToken\n});\n"],"x_google_ignoreList":[0],"mappings":";;;;;CACA,IAAI,YAAY,OAAO;CACvB,IAAI,mBAAmB,OAAO;CAC9B,IAAI,oBAAoB,OAAO;CAC/B,IAAI,eAAe,OAAO,UAAU;CACpC,IAAI,YAAY,QAAQ,QAAQ;EAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;GAAE,KAAK,IAAI;GAAO,YAAY;EAAK,CAAC;CAChE;CACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;EAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS;QACjD,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;IAAE,WAAW,KAAK;IAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;GAAW,CAAC;EAAA;EAEvH,OAAO;CACT;CACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;CACzF,IAAI,gBAAgB,CAAC;CACrB,SAAS,eAAe,EACtB,oBAAoB,aACtB,CAAC;CACD,OAAO,UAAU,aAAa,aAAa;CAC3C,IAAI,qBAAA,iBAAA,oBAAA;CACJ,IAAI,oBAAA,iBAAA,mBAAA;CACJ,SAAe,aAAa,IAAA;;;;iFAAS;GACnC,IAAI,YAAA,YAAA,QAAA,YAAA,KAAA,IAAA,KAAA,IAAY,QAAS;GACzB,IAAI,SAAA,YAAA,QAAA,YAAA,KAAA,IAAA,KAAA,IAAS,QAAS;GACtB,IAAI,CAAC,aAAa,CAAC,QAAQ;IACzB,MAAM,eAAe,GAAG,kBAAkB,iBAAiB;IAC3D,YAAY,YAAY;IACxB,SAAS,YAAY;GACvB,OAAO,IAAI,CAAC,aAAa,CAAC,QAAQ;;IAChC,MAAM,eAAe,GAAG,kBAAkB,iBAAiB;IAC3D,aAAA,aAAY,eAAA,QAAA,eAAA,KAAA,IAAA,aAAa,YAAY;IACrC,UAAA,UAAS,YAAA,QAAA,YAAA,KAAA,IAAA,UAAU,YAAY;GACjC;GACA,IAAI,CAAC,WACH,MAAM,IAAI,mBAAmB,qBAC3B,gGACF;GAEF,IAAI,cAAc,GAAG,kBAAkB,WAAW,SAAS;GAC3D,IAAI,CAAC,eAAe,GAAG,kBAAkB,YAAY,GAAG,kBAAkB,iBAAiB,WAAW,KAAK,GAAA,YAAA,QAAA,YAAA,KAAA,IAAA,KAAA,IAAG,QAAS,kBAAkB,GAAG;IAC1I,MAAM,YAAY,OAAO,GAAG,kBAAkB,gBAAgB,EAC5D,oBAAA,YAAA,QAAA,YAAA,KAAA,IAAA,KAAA,IAAoB,QAAS,mBAC/B,CAAC;IACD,aAAa,OAAO,GAAG,kBAAkB,oBAAoB,WAAW,WAAW,MAAM;IACzF,IAAI,CAAC,YACH,MAAM,IAAI,mBAAmB,qBAAqB,8BAA8B;IAElF,CAAC,GAAG,kBAAkB,WAAW,YAAY,SAAS;GACxD;GACA,QAAQ,IAAI,oBAAoB,WAAW;EAE7C,CAAA;;;CAEA,MAAM,OAAO,UAAU,EACrB,aACF"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { a as __commonJSMin, n as init_asyncToGenerator, t as _asyncToGenerator } from "./asyncToGenerator-J8hMsHFb.mjs";
|
|
2
|
+
import { n as require_token_util, r as require_token_error } from "./generate-omq2Fgxt.mjs";
|
|
3
|
+
//#region node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token.js
|
|
4
|
+
var require_token = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
5
|
+
init_asyncToGenerator();
|
|
6
|
+
var __defProp = Object.defineProperty;
|
|
7
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
8
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __export = (target, all) => {
|
|
11
|
+
for (var name in all) __defProp(target, name, {
|
|
12
|
+
get: all[name],
|
|
13
|
+
enumerable: true
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
var __copyProps = (to, from, except, desc) => {
|
|
17
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
18
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
19
|
+
get: () => from[key],
|
|
20
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return to;
|
|
24
|
+
};
|
|
25
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
26
|
+
var token_exports = {};
|
|
27
|
+
__export(token_exports, { refreshToken: () => refreshToken });
|
|
28
|
+
module.exports = __toCommonJS(token_exports);
|
|
29
|
+
var import_token_error = require_token_error();
|
|
30
|
+
var import_token_util = require_token_util();
|
|
31
|
+
function refreshToken(_x) {
|
|
32
|
+
return _refreshToken.apply(this, arguments);
|
|
33
|
+
}
|
|
34
|
+
function _refreshToken() {
|
|
35
|
+
_refreshToken = _asyncToGenerator(function* (options) {
|
|
36
|
+
let projectId = options === null || options === void 0 ? void 0 : options.project;
|
|
37
|
+
let teamId = options === null || options === void 0 ? void 0 : options.team;
|
|
38
|
+
if (!projectId && !teamId) {
|
|
39
|
+
const projectInfo = (0, import_token_util.findProjectInfo)();
|
|
40
|
+
projectId = projectInfo.projectId;
|
|
41
|
+
teamId = projectInfo.teamId;
|
|
42
|
+
} else if (!projectId || !teamId) {
|
|
43
|
+
var _projectId, _teamId;
|
|
44
|
+
const projectInfo = (0, import_token_util.findProjectInfo)();
|
|
45
|
+
projectId = (_projectId = projectId) !== null && _projectId !== void 0 ? _projectId : projectInfo.projectId;
|
|
46
|
+
teamId = (_teamId = teamId) !== null && _teamId !== void 0 ? _teamId : projectInfo.teamId;
|
|
47
|
+
}
|
|
48
|
+
if (!projectId) throw new import_token_error.VercelOidcTokenError("Failed to refresh OIDC token: No project specified. Try re-linking your project with `vc link`");
|
|
49
|
+
let maybeToken = (0, import_token_util.loadToken)(projectId);
|
|
50
|
+
if (!maybeToken || (0, import_token_util.isExpired)((0, import_token_util.getTokenPayload)(maybeToken.token), options === null || options === void 0 ? void 0 : options.expirationBufferMs)) {
|
|
51
|
+
const authToken = yield (0, import_token_util.getVercelToken)({ expirationBufferMs: options === null || options === void 0 ? void 0 : options.expirationBufferMs });
|
|
52
|
+
maybeToken = yield (0, import_token_util.getVercelOidcToken)(authToken, projectId, teamId);
|
|
53
|
+
if (!maybeToken) throw new import_token_error.VercelOidcTokenError("Failed to refresh OIDC token");
|
|
54
|
+
(0, import_token_util.saveToken)(maybeToken, projectId);
|
|
55
|
+
}
|
|
56
|
+
process.env.VERCEL_OIDC_TOKEN = maybeToken.token;
|
|
57
|
+
});
|
|
58
|
+
return _refreshToken.apply(this, arguments);
|
|
59
|
+
}
|
|
60
|
+
0 && (module.exports = { refreshToken });
|
|
61
|
+
}));
|
|
62
|
+
//#endregion
|
|
63
|
+
export default require_token();
|
|
64
|
+
export {};
|
|
65
|
+
|
|
66
|
+
//# sourceMappingURL=token-Cbnu-uz2.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token-Cbnu-uz2.mjs","names":[],"sources":["../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar token_exports = {};\n__export(token_exports, {\n refreshToken: () => refreshToken\n});\nmodule.exports = __toCommonJS(token_exports);\nvar import_token_error = require(\"./token-error\");\nvar import_token_util = require(\"./token-util\");\nasync function refreshToken(options) {\n let projectId = options?.project;\n let teamId = options?.team;\n if (!projectId && !teamId) {\n const projectInfo = (0, import_token_util.findProjectInfo)();\n projectId = projectInfo.projectId;\n teamId = projectInfo.teamId;\n } else if (!projectId || !teamId) {\n const projectInfo = (0, import_token_util.findProjectInfo)();\n projectId = projectId ?? projectInfo.projectId;\n teamId = teamId ?? projectInfo.teamId;\n }\n if (!projectId) {\n throw new import_token_error.VercelOidcTokenError(\n \"Failed to refresh OIDC token: No project specified. Try re-linking your project with `vc link`\"\n );\n }\n let maybeToken = (0, import_token_util.loadToken)(projectId);\n if (!maybeToken || (0, import_token_util.isExpired)((0, import_token_util.getTokenPayload)(maybeToken.token), options?.expirationBufferMs)) {\n const authToken = await (0, import_token_util.getVercelToken)({\n expirationBufferMs: options?.expirationBufferMs\n });\n maybeToken = await (0, import_token_util.getVercelOidcToken)(authToken, projectId, teamId);\n if (!maybeToken) {\n throw new import_token_error.VercelOidcTokenError(\"Failed to refresh OIDC token\");\n }\n (0, import_token_util.saveToken)(maybeToken, projectId);\n }\n process.env.VERCEL_OIDC_TOKEN = maybeToken.token;\n return;\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n refreshToken\n});\n"],"x_google_ignoreList":[0],"mappings":";;;;;CACA,IAAI,YAAY,OAAO;CACvB,IAAI,mBAAmB,OAAO;CAC9B,IAAI,oBAAoB,OAAO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CAAC,WACH,MAAM,IAAI,mBAAmB,qBAC3B,gGACF;GAEF,IAAI,cAAc,GAAG,kBAAkB,WAAW,SAAS;GAC3D,IAAI,CAAC,eAAe,GAAG,kBAAkB,YAAY,GAAG,kBAAkB,iBAAiB,WAAW,KAAK,GAAA,YAAA,QAAA,YAAA,KAAA,IAAA,KAAA,IAAG,QAAS,kBAAkB,GAAG;IAC1I,MAAM,YAAY,OAAO,GAAG,kBAAkB,gBAAgB,EAC5D,oBAAA,YAAA,QAAA,YAAA,KAAA,IAAA,KAAA,IAAoB,QAAS,mBAC/B,CAAC;IACD,aAAa,OAAO,GAAG,kBAAkB,oBAAoB,WAAW,WAAW,MAAM;IACzF,IAAI,CAAC,YACH,MAAM,IAAI,mBAAmB,qBAAqB,8BAA8B;IAElF,CAAC,GAAG,kBAAkB,WAAW,YAAY,SAAS;GACxD;GACA,QAAQ,IAAI,oBAAoB,WAAW;EAE7C,CAAA;;;CAEA,MAAM,OAAO,UAAU,EACrB,aACF"}
|
package/package.json
CHANGED
|
@@ -1,403 +0,0 @@
|
|
|
1
|
-
import fs from "fs";
|
|
2
|
-
import path from "path";
|
|
3
|
-
import chalk from "chalk";
|
|
4
|
-
import { parse } from "jsonc-parser";
|
|
5
|
-
import z$1, { z } from "zod";
|
|
6
|
-
import { objectPick } from "daily-code";
|
|
7
|
-
import { generateText, stepCountIs, tool } from "ai";
|
|
8
|
-
import { simpleGit } from "simple-git";
|
|
9
|
-
//#region src/constants/providers.ts
|
|
10
|
-
const SUPPORTED_PROVIDERS = {
|
|
11
|
-
"@ai-sdk/openai": { create: "createOpenAI" },
|
|
12
|
-
"@ai-sdk/openai-compatible": { create: "createOpenAICompatible" },
|
|
13
|
-
"@ai-sdk/anthropic": { create: "createAnthropic" },
|
|
14
|
-
"@ai-sdk/google": { create: "createGoogleGenerativeAI" },
|
|
15
|
-
"@ai-sdk/xai": { create: "createXai" },
|
|
16
|
-
"@ai-sdk/azure": { create: "createAzure" },
|
|
17
|
-
"@ai-sdk/amazon-bedrock": { create: "createAmazonBedrock" },
|
|
18
|
-
"@ai-sdk/groq": { create: "createGroq" },
|
|
19
|
-
"@ai-sdk/fal": { create: "createFal" },
|
|
20
|
-
"@ai-sdk/deepinfra": { create: "createDeepInfra" },
|
|
21
|
-
"@ai-sdk/google-vertex": { create: "createVertex" },
|
|
22
|
-
"@ai-sdk/mistral": { create: "createMistral" },
|
|
23
|
-
"@ai-sdk/togetherai": { create: "createTogetherAI" },
|
|
24
|
-
"@ai-sdk/cohere": { create: "createCohere" },
|
|
25
|
-
"@ai-sdk/fireworks": { create: "createFireworks" },
|
|
26
|
-
"@ai-sdk/deepseek": { create: "createDeepSeek" },
|
|
27
|
-
"@ai-sdk/cerebras": { create: "createCerebras" },
|
|
28
|
-
"@ai-sdk/perplexity": { create: "createPerplexity" },
|
|
29
|
-
"@ai-sdk/luma": { create: "createLuma" },
|
|
30
|
-
"@ai-sdk/baseten": { create: "createBaseten" },
|
|
31
|
-
"@openrouter/ai-sdk-provider": { create: "createOpenRouter" }
|
|
32
|
-
};
|
|
33
|
-
//#endregion
|
|
34
|
-
//#region src/config/config-schema.ts
|
|
35
|
-
const gitCommitTargetSchema = z.union([z.object({ tag: z.string().describe("Git tag regex") }), z.object({ commit: z.string().describe("Git commit hash") })]);
|
|
36
|
-
const providerOptionsSchema = z.object({
|
|
37
|
-
apiUrl: z.string().optional(),
|
|
38
|
-
apiKeyEnv: z.union([z.string(), z.array(z.string())]).optional(),
|
|
39
|
-
provider: z.enum(Object.keys(SUPPORTED_PROVIDERS)).default("@ai-sdk/openai-compatible"),
|
|
40
|
-
headers: z.record(z.string(), z.string()).optional(),
|
|
41
|
-
options: z.record(z.string(), z.unknown()).optional()
|
|
42
|
-
});
|
|
43
|
-
const generateConfigSchema = z.object({
|
|
44
|
-
match: gitCommitTargetSchema.default({ tag: ".*" }),
|
|
45
|
-
model: z.string().min(1),
|
|
46
|
-
steps: z.number().int().positive().optional()
|
|
47
|
-
}).extend(providerOptionsSchema.shape);
|
|
48
|
-
//#endregion
|
|
49
|
-
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/asyncToGenerator.js
|
|
50
|
-
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
51
|
-
try {
|
|
52
|
-
var i = n[a](c), u = i.value;
|
|
53
|
-
} catch (n) {
|
|
54
|
-
e(n);
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
i.done ? t(u) : Promise.resolve(u).then(r, o);
|
|
58
|
-
}
|
|
59
|
-
function _asyncToGenerator(n) {
|
|
60
|
-
return function() {
|
|
61
|
-
var t = this, e = arguments;
|
|
62
|
-
return new Promise(function(r, o) {
|
|
63
|
-
var a = n.apply(t, e);
|
|
64
|
-
function _next(n) {
|
|
65
|
-
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
|
|
66
|
-
}
|
|
67
|
-
function _throw(n) {
|
|
68
|
-
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
|
|
69
|
-
}
|
|
70
|
-
_next(void 0);
|
|
71
|
-
});
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
//#endregion
|
|
75
|
-
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/typeof.js
|
|
76
|
-
function _typeof(o) {
|
|
77
|
-
"@babel/helpers - typeof";
|
|
78
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
79
|
-
return typeof o;
|
|
80
|
-
} : function(o) {
|
|
81
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
82
|
-
}, _typeof(o);
|
|
83
|
-
}
|
|
84
|
-
//#endregion
|
|
85
|
-
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/toPrimitive.js
|
|
86
|
-
function toPrimitive(t, r) {
|
|
87
|
-
if ("object" != _typeof(t) || !t) return t;
|
|
88
|
-
var e = t[Symbol.toPrimitive];
|
|
89
|
-
if (void 0 !== e) {
|
|
90
|
-
var i = e.call(t, r || "default");
|
|
91
|
-
if ("object" != _typeof(i)) return i;
|
|
92
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
93
|
-
}
|
|
94
|
-
return ("string" === r ? String : Number)(t);
|
|
95
|
-
}
|
|
96
|
-
//#endregion
|
|
97
|
-
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/toPropertyKey.js
|
|
98
|
-
function toPropertyKey(t) {
|
|
99
|
-
var i = toPrimitive(t, "string");
|
|
100
|
-
return "symbol" == _typeof(i) ? i : i + "";
|
|
101
|
-
}
|
|
102
|
-
//#endregion
|
|
103
|
-
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/defineProperty.js
|
|
104
|
-
function _defineProperty(e, r, t) {
|
|
105
|
-
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
106
|
-
value: t,
|
|
107
|
-
enumerable: !0,
|
|
108
|
-
configurable: !0,
|
|
109
|
-
writable: !0
|
|
110
|
-
}) : e[r] = t, e;
|
|
111
|
-
}
|
|
112
|
-
//#endregion
|
|
113
|
-
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/objectSpread2.js
|
|
114
|
-
function ownKeys(e, r) {
|
|
115
|
-
var t = Object.keys(e);
|
|
116
|
-
if (Object.getOwnPropertySymbols) {
|
|
117
|
-
var o = Object.getOwnPropertySymbols(e);
|
|
118
|
-
r && (o = o.filter(function(r) {
|
|
119
|
-
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
120
|
-
})), t.push.apply(t, o);
|
|
121
|
-
}
|
|
122
|
-
return t;
|
|
123
|
-
}
|
|
124
|
-
function _objectSpread2(e) {
|
|
125
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
126
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
127
|
-
r % 2 ? ownKeys(Object(t), !0).forEach(function(r) {
|
|
128
|
-
_defineProperty(e, r, t[r]);
|
|
129
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) {
|
|
130
|
-
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
return e;
|
|
134
|
-
}
|
|
135
|
-
//#endregion
|
|
136
|
-
//#region src/config/resolve-config.ts
|
|
137
|
-
const CONFIG_PATHS = [
|
|
138
|
-
"release-note.json",
|
|
139
|
-
"release-note.jsonc",
|
|
140
|
-
".github/release-note.json",
|
|
141
|
-
".github/release-note.jsonc"
|
|
142
|
-
];
|
|
143
|
-
function resolveConfig(_x) {
|
|
144
|
-
return _resolveConfig.apply(this, arguments);
|
|
145
|
-
}
|
|
146
|
-
function _resolveConfig() {
|
|
147
|
-
_resolveConfig = _asyncToGenerator(function* (cwd, configPaths = CONFIG_PATHS) {
|
|
148
|
-
for (const configPath of configPaths) {
|
|
149
|
-
const fullPath = path.join(cwd, configPath);
|
|
150
|
-
if (fs.existsSync(fullPath)) {
|
|
151
|
-
console.log(chalk.green(`Using config file: ${fullPath}`));
|
|
152
|
-
try {
|
|
153
|
-
const configContent = yield fs.promises.readFile(fullPath, "utf8");
|
|
154
|
-
return generateConfigSchema.parse(parse(configContent));
|
|
155
|
-
} catch (_unused) {
|
|
156
|
-
console.error(chalk.red(`Error parsing config file: ${fullPath}`));
|
|
157
|
-
throw new Error(`Invalid config file: ${fullPath}`);
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
return generateConfigSchema.parse({});
|
|
162
|
-
});
|
|
163
|
-
return _resolveConfig.apply(this, arguments);
|
|
164
|
-
}
|
|
165
|
-
const PROVIDERS_FACTORY = {
|
|
166
|
-
"@ai-sdk/openai": { create: "createOpenAI" },
|
|
167
|
-
"@ai-sdk/anthropic": { create: "createAnthropic" },
|
|
168
|
-
"@openrouter/ai-sdk-provider": { create: "createOpenRouter" }
|
|
169
|
-
};
|
|
170
|
-
function resolveApiKey(vars) {
|
|
171
|
-
let resolvedApiKey;
|
|
172
|
-
const apiKeyEnvVars = typeof vars === "string" ? [vars] : vars !== null && vars !== void 0 ? vars : [];
|
|
173
|
-
for (const envVar of apiKeyEnvVars) {
|
|
174
|
-
resolvedApiKey = process.env[envVar];
|
|
175
|
-
break;
|
|
176
|
-
}
|
|
177
|
-
return resolvedApiKey;
|
|
178
|
-
}
|
|
179
|
-
function resolveProvider(_x2, _x3) {
|
|
180
|
-
return _resolveProvider.apply(this, arguments);
|
|
181
|
-
}
|
|
182
|
-
function _resolveProvider() {
|
|
183
|
-
_resolveProvider = _asyncToGenerator(function* (name, options) {
|
|
184
|
-
const resolvedApiKey = resolveApiKey(options.apiKeyEnv);
|
|
185
|
-
if (name === "@ai-sdk/openai-compatible") {
|
|
186
|
-
if (!options.apiUrl) throw new Error("\"\"apiUrl\"\" is required for openai-compatible provider");
|
|
187
|
-
if (!resolvedApiKey) throw new Error("No API key found in the specified environment variables");
|
|
188
|
-
const { createOpenAICompatible } = yield import("@ai-sdk/openai-compatible");
|
|
189
|
-
return createOpenAICompatible(_objectSpread2({
|
|
190
|
-
name,
|
|
191
|
-
apiKey: resolvedApiKey,
|
|
192
|
-
baseURL: options === null || options === void 0 ? void 0 : options.apiUrl,
|
|
193
|
-
headers: options === null || options === void 0 ? void 0 : options.headers
|
|
194
|
-
}, options === null || options === void 0 ? void 0 : options.options));
|
|
195
|
-
}
|
|
196
|
-
const provider = PROVIDERS_FACTORY[name];
|
|
197
|
-
if (provider) return (yield import(name))[provider.create](_objectSpread2({
|
|
198
|
-
apiKey: resolvedApiKey,
|
|
199
|
-
baseURL: options === null || options === void 0 ? void 0 : options.apiUrl,
|
|
200
|
-
headers: options === null || options === void 0 ? void 0 : options.headers
|
|
201
|
-
}, options === null || options === void 0 ? void 0 : options.options));
|
|
202
|
-
return null;
|
|
203
|
-
});
|
|
204
|
-
return _resolveProvider.apply(this, arguments);
|
|
205
|
-
}
|
|
206
|
-
//#endregion
|
|
207
|
-
//#region src/lib/git.ts
|
|
208
|
-
function getGitCommitHash(_x, _x2) {
|
|
209
|
-
return _getGitCommitHash.apply(this, arguments);
|
|
210
|
-
}
|
|
211
|
-
function _getGitCommitHash() {
|
|
212
|
-
_getGitCommitHash = _asyncToGenerator(function* (git, target, offset = 0) {
|
|
213
|
-
if ("tag" in target) {
|
|
214
|
-
const regex = new RegExp(target.tag);
|
|
215
|
-
const { all: tags } = yield git.tags({ "--sort": "-v:refname" });
|
|
216
|
-
const matched = tags.filter((tag) => regex.test(tag));
|
|
217
|
-
if (matched.length === 0) throw new Error(`No tags matched pattern: ${target.tag}`);
|
|
218
|
-
if (offset < 0 || offset >= matched.length) throw new Error(`Offset ${offset} out of range: only ${matched.length} tag(s) matched pattern ${target.tag}`);
|
|
219
|
-
const tag = matched[offset];
|
|
220
|
-
return (yield git.revparse([tag])).trim();
|
|
221
|
-
}
|
|
222
|
-
if ("commit" in target) return (yield git.revparse([target.commit])).trim();
|
|
223
|
-
throw new Error("Invalid target: must contain either \"tag\" or \"commit\"");
|
|
224
|
-
});
|
|
225
|
-
return _getGitCommitHash.apply(this, arguments);
|
|
226
|
-
}
|
|
227
|
-
function getGitCommitsInfo(_x3, _x4) {
|
|
228
|
-
return _getGitCommitsInfo.apply(this, arguments);
|
|
229
|
-
}
|
|
230
|
-
function _getGitCommitsInfo() {
|
|
231
|
-
_getGitCommitsInfo = _asyncToGenerator(function* (git, match) {
|
|
232
|
-
const latest = yield getGitCommitHash(git, match, 1);
|
|
233
|
-
const current = yield getGitCommitHash(git, match, 0);
|
|
234
|
-
return [...(yield git.log({
|
|
235
|
-
from: latest,
|
|
236
|
-
to: current
|
|
237
|
-
})).all].map((c) => objectPick(c, [
|
|
238
|
-
"hash",
|
|
239
|
-
"date",
|
|
240
|
-
"message",
|
|
241
|
-
"author_name",
|
|
242
|
-
"author_email"
|
|
243
|
-
]));
|
|
244
|
-
});
|
|
245
|
-
return _getGitCommitsInfo.apply(this, arguments);
|
|
246
|
-
}
|
|
247
|
-
//#endregion
|
|
248
|
-
//#region src/generate/prompt.ts
|
|
249
|
-
function buildSystemPrompt(maxTools) {
|
|
250
|
-
return `You are a helpful assistant for generating release notes based on git commit history.
|
|
251
|
-
The release notes should be concise, informative, and highlight the key changes, new features, bug fixes, and any important information that users should be aware of. The release note should be well-structured and easy to read. You are allowed to use up to ${maxTools} tools to gather necessary information from the git repository to generate accurate and comprehensive release notes.
|
|
252
|
-
|
|
253
|
-
**Target audience**: end users, product managers, and non-technical stakeholders. Write the release note for them, not for engineers reviewing the implementation.
|
|
254
|
-
|
|
255
|
-
## Guidelines:
|
|
256
|
-
- Summarize the key changes in a clear and concise manner, focusing on user-facing impact.
|
|
257
|
-
- Describe WHAT changed for the user and WHY it matters, not HOW it is implemented internally.
|
|
258
|
-
- DO NOT reveal internal implementation details. This includes but is not limited to: source code, code snippets, internal file names, internal file paths, class names, function names, variable names, API route paths, database table names, configuration keys, or any other internal identifiers.
|
|
259
|
-
- DO NOT include sensitive information such as credentials, secrets, tokens, internal URLs, private endpoints, or environment-specific values.
|
|
260
|
-
- Skip trivial changes that do not impact users (e.g., minor refactoring, file renames, formatting changes, internal tooling, dependency bumps with no user-visible effect).
|
|
261
|
-
- Use plain language that can be easily understood by a wide audience, including non-technical stakeholders. Avoid technical jargon, library/framework names, and implementation-specific terminology unless absolutely necessary.
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
## Output format:
|
|
265
|
-
- Group related changes together under appropriate headings (e.g., "New Features", "Bug Fixes", "Improvements", "Breaking Changes").
|
|
266
|
-
- Use bullet points to list individual changes for better readability.
|
|
267
|
-
- If there are breaking changes, clearly indicate them in a separate section and provide guidance on how to adapt to these changes from a user perspective.
|
|
268
|
-
- DO NOT use a top-level title to wrap the content as "Release Note"; just directly write the sections.
|
|
269
|
-
- DO NOT use --- to separate sections, use ## for headings instead.
|
|
270
|
-
- Output ONLY the release note content, with no preamble, explanation, or commentary.
|
|
271
|
-
`;
|
|
272
|
-
}
|
|
273
|
-
function buildUserPrompt(commits) {
|
|
274
|
-
return `Here are the commits related to the release:
|
|
275
|
-
${commits.map((c) => [
|
|
276
|
-
`- Commithash: ${c.hash}`,
|
|
277
|
-
` - Timestamp: ${c.date}`,
|
|
278
|
-
` - Author: ${c.author_name} <${c.author_email}>`,
|
|
279
|
-
` > ${c.message}`
|
|
280
|
-
].join("\n")).join("\n")}
|
|
281
|
-
`;
|
|
282
|
-
}
|
|
283
|
-
//#endregion
|
|
284
|
-
//#region src/generate/tools.ts
|
|
285
|
-
function parseLsTree(output) {
|
|
286
|
-
return output.split("\n").filter((line) => line.length > 0).map((line) => {
|
|
287
|
-
const tabIdx = line.indexOf(" ");
|
|
288
|
-
return tabIdx >= 0 ? line.slice(tabIdx + 1) : "";
|
|
289
|
-
});
|
|
290
|
-
}
|
|
291
|
-
function generateTools(git, logger) {
|
|
292
|
-
return {
|
|
293
|
-
check_diff: tool({
|
|
294
|
-
description: "Get the full diff of a specific commit. Returns the patch showing all changes (additions, deletions, modifications) introduced by the commit.",
|
|
295
|
-
inputSchema: z$1.object({ commithash: z$1.string().describe("The commit hash, tag, branch, or any other git ref resolvable by git rev-parse.") }),
|
|
296
|
-
execute: function() {
|
|
297
|
-
var _ref = _asyncToGenerator(function* ({ commithash }) {
|
|
298
|
-
logger === null || logger === void 0 || logger(chalk.cyan(`[check_diff] fetching diff for ${commithash}`));
|
|
299
|
-
const diff = yield git.raw([
|
|
300
|
-
"show",
|
|
301
|
-
"--no-color",
|
|
302
|
-
"--pretty=format:",
|
|
303
|
-
commithash
|
|
304
|
-
]);
|
|
305
|
-
logger === null || logger === void 0 || logger(chalk.green(`[check_diff] ${commithash} -> ${diff.length} chars of diff`));
|
|
306
|
-
return diff;
|
|
307
|
-
});
|
|
308
|
-
return function execute(_x) {
|
|
309
|
-
return _ref.apply(this, arguments);
|
|
310
|
-
};
|
|
311
|
-
}()
|
|
312
|
-
}),
|
|
313
|
-
browse_code: tool({
|
|
314
|
-
description: "Browse the code at a specific commit. If the path points to a file, returns its content. If the path points to a folder, returns the list of files and sub-folders it contains. Pass an empty string for the path to browse the repository root.",
|
|
315
|
-
inputSchema: z$1.object({
|
|
316
|
-
commithash: z$1.string().describe("The commit hash, tag, branch, or any other git ref resolvable by git rev-parse."),
|
|
317
|
-
path: z$1.string().describe("Path to a file or folder within the repository, relative to the repo root. Use forward slashes. Pass an empty string for the root.")
|
|
318
|
-
}),
|
|
319
|
-
execute: function() {
|
|
320
|
-
var _ref2 = _asyncToGenerator(function* ({ commithash, path }) {
|
|
321
|
-
const normalized = path.replace(/^\/+|\/+$/g, "");
|
|
322
|
-
logger === null || logger === void 0 || logger(chalk.cyan(`[browse_code] ${commithash} @ ${normalized === "" ? "/" : normalized}`));
|
|
323
|
-
if (normalized === "") {
|
|
324
|
-
const items = parseLsTree(yield git.raw(["ls-tree", commithash]));
|
|
325
|
-
logger === null || logger === void 0 || logger(chalk.green(`[browse_code] root -> folder with ${items.length} item(s)`));
|
|
326
|
-
return {
|
|
327
|
-
type: "folder",
|
|
328
|
-
items
|
|
329
|
-
};
|
|
330
|
-
}
|
|
331
|
-
const ref = `${commithash}:${normalized}`;
|
|
332
|
-
let objectType;
|
|
333
|
-
try {
|
|
334
|
-
objectType = (yield git.raw([
|
|
335
|
-
"cat-file",
|
|
336
|
-
"-t",
|
|
337
|
-
ref
|
|
338
|
-
])).trim();
|
|
339
|
-
} catch (_unused) {
|
|
340
|
-
logger === null || logger === void 0 || logger(chalk.yellow(`[browse_code] ${ref} does not exist`));
|
|
341
|
-
return { error: "doesn't exists" };
|
|
342
|
-
}
|
|
343
|
-
if (objectType === "tree") {
|
|
344
|
-
const items = parseLsTree(yield git.raw(["ls-tree", ref]));
|
|
345
|
-
logger === null || logger === void 0 || logger(chalk.green(`[browse_code] ${normalized} -> folder with ${items.length} item(s)`));
|
|
346
|
-
return {
|
|
347
|
-
type: "folder",
|
|
348
|
-
items
|
|
349
|
-
};
|
|
350
|
-
}
|
|
351
|
-
if (objectType === "blob") {
|
|
352
|
-
const content = yield git.show(ref);
|
|
353
|
-
logger === null || logger === void 0 || logger(chalk.green(`[browse_code] ${normalized} -> file with ${content.length} chars`));
|
|
354
|
-
return {
|
|
355
|
-
type: "file",
|
|
356
|
-
content
|
|
357
|
-
};
|
|
358
|
-
}
|
|
359
|
-
logger === null || logger === void 0 || logger(chalk.yellow(`[browse_code] ${ref} has unsupported object type "${objectType}"`));
|
|
360
|
-
return { error: "doesn't exists" };
|
|
361
|
-
});
|
|
362
|
-
return function execute(_x2) {
|
|
363
|
-
return _ref2.apply(this, arguments);
|
|
364
|
-
};
|
|
365
|
-
}()
|
|
366
|
-
})
|
|
367
|
-
};
|
|
368
|
-
}
|
|
369
|
-
//#endregion
|
|
370
|
-
//#region src/generate/index.ts
|
|
371
|
-
function generateReleaseNote(_x, _x2) {
|
|
372
|
-
return _generateReleaseNote.apply(this, arguments);
|
|
373
|
-
}
|
|
374
|
-
function _generateReleaseNote() {
|
|
375
|
-
_generateReleaseNote = _asyncToGenerator(function* (cwd, options) {
|
|
376
|
-
var _options$steps;
|
|
377
|
-
const git = simpleGit(cwd);
|
|
378
|
-
const commits = yield getGitCommitsInfo(git, options.match);
|
|
379
|
-
const provider = yield resolveProvider(options.provider, options);
|
|
380
|
-
if (!provider) throw new Error(`Unsupported provider: ${options.provider}`);
|
|
381
|
-
const maxSteps = (_options$steps = options.steps) !== null && _options$steps !== void 0 ? _options$steps : (commits.length + 1) * 2;
|
|
382
|
-
const result = yield generateText({
|
|
383
|
-
model: provider(options.model),
|
|
384
|
-
prompt: buildUserPrompt(commits).trim(),
|
|
385
|
-
system: buildSystemPrompt(maxSteps).trim(),
|
|
386
|
-
tools: generateTools(git, options.logger),
|
|
387
|
-
stopWhen: stepCountIs(maxSteps)
|
|
388
|
-
});
|
|
389
|
-
return {
|
|
390
|
-
commits,
|
|
391
|
-
note: result.text,
|
|
392
|
-
provider: {
|
|
393
|
-
usage: result.totalUsage,
|
|
394
|
-
response: result.response
|
|
395
|
-
}
|
|
396
|
-
};
|
|
397
|
-
});
|
|
398
|
-
return _generateReleaseNote.apply(this, arguments);
|
|
399
|
-
}
|
|
400
|
-
//#endregion
|
|
401
|
-
export { _asyncToGenerator as i, resolveConfig as n, _objectSpread2 as r, generateReleaseNote as t };
|
|
402
|
-
|
|
403
|
-
//# sourceMappingURL=generate-CsLUDr-g.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generate-CsLUDr-g.mjs","names":["z"],"sources":["../src/constants/providers.ts","../src/config/config-schema.ts","../src/config/resolve-config.ts","../src/lib/git.ts","../src/generate/prompt.ts","../src/generate/tools.ts","../src/generate/index.ts"],"sourcesContent":["type ProviderRecord = Record<string, { create: string }>\n\nexport const SUPPORTED_PROVIDERS = {\n '@ai-sdk/openai': { create: 'createOpenAI' },\n '@ai-sdk/openai-compatible': { create: 'createOpenAICompatible' },\n '@ai-sdk/anthropic': { create: 'createAnthropic' },\n '@ai-sdk/google': { create: 'createGoogleGenerativeAI' },\n '@ai-sdk/xai': { create: 'createXai' },\n '@ai-sdk/azure': { create: 'createAzure' },\n '@ai-sdk/amazon-bedrock': { create: 'createAmazonBedrock' },\n '@ai-sdk/groq': { create: 'createGroq' },\n '@ai-sdk/fal': { create: 'createFal' },\n '@ai-sdk/deepinfra': { create: 'createDeepInfra' },\n '@ai-sdk/google-vertex': { create: 'createVertex' },\n '@ai-sdk/mistral': { create: 'createMistral' },\n '@ai-sdk/togetherai': { create: 'createTogetherAI' },\n '@ai-sdk/cohere': { create: 'createCohere' },\n '@ai-sdk/fireworks': { create: 'createFireworks' },\n '@ai-sdk/deepseek': { create: 'createDeepSeek' },\n '@ai-sdk/cerebras': { create: 'createCerebras' },\n '@ai-sdk/perplexity': { create: 'createPerplexity' },\n '@ai-sdk/luma': { create: 'createLuma' },\n '@ai-sdk/baseten': { create: 'createBaseten' },\n '@openrouter/ai-sdk-provider': { create: 'createOpenRouter' },\n} as const satisfies ProviderRecord\n","import { SUPPORTED_PROVIDERS } from '@/constants/providers.js'\nimport { z } from 'zod'\n\nexport const gitCommitTargetSchema = z.union([\n z.object({ tag: z.string().describe('Git tag regex') }),\n z.object({ commit: z.string().describe('Git commit hash') }),\n])\n\nexport const providerOptionsSchema = z.object({\n apiUrl: z.string().optional(),\n apiKeyEnv: z.union([z.string(), z.array(z.string())]).optional(),\n\n provider: z\n .enum(\n Object.keys(SUPPORTED_PROVIDERS) as (keyof typeof SUPPORTED_PROVIDERS)[]\n )\n .default('@ai-sdk/openai-compatible'),\n\n headers: z.record(z.string(), z.string()).optional(),\n options: z.record(z.string(), z.unknown()).optional(),\n})\n\nexport const generateConfigSchema = z\n .object({\n match: gitCommitTargetSchema.default({ tag: '.*' }),\n model: z.string().min(1),\n steps: z.number().int().positive().optional(),\n })\n .extend(providerOptionsSchema.shape)\n","import { Provider } from 'ai'\nimport chalk from 'chalk'\nimport fs from 'fs'\nimport { parse } from 'jsonc-parser'\nimport path from 'path'\nimport z from 'zod'\nimport { generateConfigSchema, providerOptionsSchema } from './config-schema.js'\n\nconst CONFIG_PATHS = [\n 'release-note.json',\n 'release-note.jsonc',\n '.github/release-note.json',\n '.github/release-note.jsonc',\n]\n\nexport async function resolveConfig(\n cwd: string,\n configPaths: string[] = CONFIG_PATHS\n) {\n for (const configPath of configPaths) {\n const fullPath = path.join(cwd, configPath)\n\n if (fs.existsSync(fullPath)) {\n console.log(chalk.green(`Using config file: ${fullPath}`))\n\n try {\n const configContent = await fs.promises.readFile(fullPath, 'utf8')\n return generateConfigSchema.parse(parse(configContent))\n } catch {\n console.error(chalk.red(`Error parsing config file: ${fullPath}`))\n throw new Error(`Invalid config file: ${fullPath}`)\n }\n }\n }\n\n return generateConfigSchema.parse({})\n}\n\nconst PROVIDERS_FACTORY: Record<string, { create: string }> = {\n '@ai-sdk/openai': { create: 'createOpenAI' },\n '@ai-sdk/anthropic': { create: 'createAnthropic' },\n '@openrouter/ai-sdk-provider': { create: 'createOpenRouter' },\n}\n\nfunction resolveApiKey(\n vars: string | string[] | undefined\n): string | undefined {\n let resolvedApiKey: string | undefined\n\n const apiKeyEnvVars = typeof vars === 'string' ? [vars] : (vars ?? [])\n\n for (const envVar of apiKeyEnvVars) {\n resolvedApiKey = process.env[envVar]\n break\n }\n\n return resolvedApiKey\n}\n\nexport async function resolveProvider(\n name: string,\n options: z.infer<typeof providerOptionsSchema>\n): Promise<Provider['languageModel'] | null> {\n const resolvedApiKey = resolveApiKey(options.apiKeyEnv)\n\n if (name === '@ai-sdk/openai-compatible') {\n if (!options.apiUrl) {\n throw new Error('\"\"apiUrl\"\" is required for openai-compatible provider')\n }\n\n if (!resolvedApiKey) {\n throw new Error('No API key found in the specified environment variables')\n }\n\n const { createOpenAICompatible } = await import('@ai-sdk/openai-compatible')\n return createOpenAICompatible({\n name,\n apiKey: resolvedApiKey,\n baseURL: options?.apiUrl,\n headers: options?.headers,\n ...options?.options,\n })\n }\n\n const provider = PROVIDERS_FACTORY[name]\n if (provider) {\n const mod = await import(name)\n return mod[provider.create]({\n apiKey: resolvedApiKey,\n baseURL: options?.apiUrl,\n headers: options?.headers,\n ...options?.options,\n })\n }\n\n return null\n}\n","import { gitCommitTargetSchema } from '@/config/config-schema.js'\nimport { objectPick, Prettify } from 'daily-code'\nimport { DefaultLogFields, type SimpleGit } from 'simple-git'\nimport z from 'zod'\n\nexport type GitCommitInfo = Prettify<\n Pick<\n DefaultLogFields,\n 'hash' | 'date' | 'message' | 'author_name' | 'author_email'\n >\n>\n\nasync function getGitCommitHash(\n git: SimpleGit,\n target: z.infer<typeof gitCommitTargetSchema>,\n offset = 0\n): Promise<string> {\n if ('tag' in target) {\n const regex = new RegExp(target.tag)\n const { all: tags } = await git.tags({ '--sort': '-v:refname' })\n const matched = tags.filter((tag) => regex.test(tag))\n if (matched.length === 0) {\n throw new Error(`No tags matched pattern: ${target.tag}`)\n }\n\n if (offset < 0 || offset >= matched.length) {\n throw new Error(\n `Offset ${offset} out of range: only ${matched.length} tag(s) matched pattern ${target.tag}`\n )\n }\n\n const tag = matched[offset]\n const hash = await git.revparse([tag])\n return hash.trim()\n }\n\n if ('commit' in target) {\n const hash = await git.revparse([target.commit])\n return hash.trim()\n }\n\n throw new Error('Invalid target: must contain either \"tag\" or \"commit\"')\n}\n\nexport async function getGitCommitsInfo(\n git: SimpleGit,\n match: z.infer<typeof gitCommitTargetSchema>\n): Promise<GitCommitInfo[]> {\n const latest = await getGitCommitHash(git, match, 1)\n const current = await getGitCommitHash(git, match, 0)\n const log = await git.log({ from: latest, to: current })\n return [...log.all].map((c) =>\n objectPick(c, ['hash', 'date', 'message', 'author_name', 'author_email'])\n )\n}\n","import { GitCommitInfo } from '@/lib/git.js'\n\nexport function buildSystemPrompt(maxTools: number) {\n return `You are a helpful assistant for generating release notes based on git commit history.\nThe release notes should be concise, informative, and highlight the key changes, new features, bug fixes, and any important information that users should be aware of. The release note should be well-structured and easy to read. You are allowed to use up to ${maxTools} tools to gather necessary information from the git repository to generate accurate and comprehensive release notes.\n\n**Target audience**: end users, product managers, and non-technical stakeholders. Write the release note for them, not for engineers reviewing the implementation.\n\n## Guidelines:\n- Summarize the key changes in a clear and concise manner, focusing on user-facing impact.\n- Describe WHAT changed for the user and WHY it matters, not HOW it is implemented internally.\n- DO NOT reveal internal implementation details. This includes but is not limited to: source code, code snippets, internal file names, internal file paths, class names, function names, variable names, API route paths, database table names, configuration keys, or any other internal identifiers.\n- DO NOT include sensitive information such as credentials, secrets, tokens, internal URLs, private endpoints, or environment-specific values.\n- Skip trivial changes that do not impact users (e.g., minor refactoring, file renames, formatting changes, internal tooling, dependency bumps with no user-visible effect).\n- Use plain language that can be easily understood by a wide audience, including non-technical stakeholders. Avoid technical jargon, library/framework names, and implementation-specific terminology unless absolutely necessary.\n\n\n## Output format:\n- Group related changes together under appropriate headings (e.g., \"New Features\", \"Bug Fixes\", \"Improvements\", \"Breaking Changes\").\n- Use bullet points to list individual changes for better readability.\n- If there are breaking changes, clearly indicate them in a separate section and provide guidance on how to adapt to these changes from a user perspective.\n- DO NOT use a top-level title to wrap the content as \"Release Note\"; just directly write the sections.\n- DO NOT use --- to separate sections, use ## for headings instead.\n- Output ONLY the release note content, with no preamble, explanation, or commentary.\n`\n}\n\nexport function buildUserPrompt(commits: GitCommitInfo[]) {\n const commitsList = commits.map((c) =>\n [\n `- Commithash: ${c.hash}`,\n ` - Timestamp: ${c.date}`,\n ` - Author: ${c.author_name} <${c.author_email}>`,\n ` > ${c.message}`,\n ].join('\\n')\n )\n\n return `Here are the commits related to the release:\n${commitsList.join('\\n')}\n`\n}\n","import { tool, ToolSet } from 'ai'\nimport chalk from 'chalk'\nimport { SimpleGit } from 'simple-git'\nimport z from 'zod'\n\nfunction parseLsTree(output: string): string[] {\n return output\n .split('\\n')\n .filter((line) => line.length > 0)\n .map((line) => {\n const tabIdx = line.indexOf('\\t')\n return tabIdx >= 0 ? line.slice(tabIdx + 1) : ''\n })\n}\n\nexport function generateTools(\n git: SimpleGit,\n logger?: (...args: unknown[]) => void\n): ToolSet {\n return {\n check_diff: tool({\n description:\n 'Get the full diff of a specific commit. Returns the patch showing all changes (additions, deletions, modifications) introduced by the commit.',\n inputSchema: z.object({\n commithash: z\n .string()\n .describe(\n 'The commit hash, tag, branch, or any other git ref resolvable by git rev-parse.'\n ),\n }),\n execute: async ({ commithash }) => {\n logger?.(chalk.cyan(`[check_diff] fetching diff for ${commithash}`))\n const diff = await git.raw([\n 'show',\n '--no-color',\n '--pretty=format:',\n commithash,\n ])\n logger?.(\n chalk.green(\n `[check_diff] ${commithash} -> ${diff.length} chars of diff`\n )\n )\n return diff\n },\n }),\n browse_code: tool({\n description:\n 'Browse the code at a specific commit. If the path points to a file, returns its content. If the path points to a folder, returns the list of files and sub-folders it contains. Pass an empty string for the path to browse the repository root.',\n inputSchema: z.object({\n commithash: z\n .string()\n .describe(\n 'The commit hash, tag, branch, or any other git ref resolvable by git rev-parse.'\n ),\n path: z\n .string()\n .describe(\n 'Path to a file or folder within the repository, relative to the repo root. Use forward slashes. Pass an empty string for the root.'\n ),\n }),\n execute: async ({ commithash, path }) => {\n const normalized = path.replace(/^\\/+|\\/+$/g, '')\n logger?.(\n chalk.cyan(\n `[browse_code] ${commithash} @ ${normalized === '' ? '/' : normalized}`\n )\n )\n\n if (normalized === '') {\n const output = await git.raw(['ls-tree', commithash])\n const items = parseLsTree(output)\n logger?.(\n chalk.green(\n `[browse_code] root -> folder with ${items.length} item(s)`\n )\n )\n return { type: 'folder', items }\n }\n\n const ref = `${commithash}:${normalized}`\n let objectType: string\n try {\n objectType = (await git.raw(['cat-file', '-t', ref])).trim()\n } catch {\n logger?.(chalk.yellow(`[browse_code] ${ref} does not exist`))\n return { error: \"doesn't exists\" }\n }\n\n if (objectType === 'tree') {\n const output = await git.raw(['ls-tree', ref])\n const items = parseLsTree(output)\n logger?.(\n chalk.green(\n `[browse_code] ${normalized} -> folder with ${items.length} item(s)`\n )\n )\n return { type: 'folder', items }\n }\n\n if (objectType === 'blob') {\n const content = await git.show(ref)\n logger?.(\n chalk.green(\n `[browse_code] ${normalized} -> file with ${content.length} chars`\n )\n )\n return { type: 'file', content }\n }\n\n logger?.(\n chalk.yellow(\n `[browse_code] ${ref} has unsupported object type \"${objectType}\"`\n )\n )\n return { error: \"doesn't exists\" }\n },\n }),\n }\n}\n","import { generateConfigSchema } from '@/config/config-schema.js'\nimport { resolveProvider } from '@/config/resolve-config.js'\nimport { getGitCommitsInfo } from '@/lib/git.js'\nimport { generateText, stepCountIs } from 'ai'\nimport { simpleGit } from 'simple-git'\nimport z from 'zod'\nimport { buildSystemPrompt, buildUserPrompt } from './prompt.js'\nimport { generateTools } from './tools.js'\n\ntype GenerateOptions = z.infer<typeof generateConfigSchema> & {\n logger?: (...args: unknown[]) => void\n}\n\nexport async function generateReleaseNote(\n cwd: string,\n options: GenerateOptions\n) {\n const git = simpleGit(cwd)\n const commits = await getGitCommitsInfo(git, options.match)\n\n const provider = await resolveProvider(options.provider, options)\n if (!provider) {\n throw new Error(`Unsupported provider: ${options.provider}`)\n }\n\n const maxSteps = options.steps ?? (commits.length + 1) * 2\n const result = await generateText({\n model: provider(options.model),\n\n prompt: buildUserPrompt(commits).trim(),\n system: buildSystemPrompt(maxSteps).trim(),\n\n tools: generateTools(git, options.logger),\n stopWhen: stepCountIs(maxSteps),\n })\n\n return {\n commits,\n note: result.text,\n\n provider: {\n usage: result.totalUsage,\n response: result.response,\n },\n }\n}\n"],"mappings":";;;;;;;;;AAEA,MAAa,sBAAsB;CACjC,kBAAkB,EAAE,QAAQ,eAAe;CAC3C,6BAA6B,EAAE,QAAQ,yBAAyB;CAChE,qBAAqB,EAAE,QAAQ,kBAAkB;CACjD,kBAAkB,EAAE,QAAQ,2BAA2B;CACvD,eAAe,EAAE,QAAQ,YAAY;CACrC,iBAAiB,EAAE,QAAQ,cAAc;CACzC,0BAA0B,EAAE,QAAQ,sBAAsB;CAC1D,gBAAgB,EAAE,QAAQ,aAAa;CACvC,eAAe,EAAE,QAAQ,YAAY;CACrC,qBAAqB,EAAE,QAAQ,kBAAkB;CACjD,yBAAyB,EAAE,QAAQ,eAAe;CAClD,mBAAmB,EAAE,QAAQ,gBAAgB;CAC7C,sBAAsB,EAAE,QAAQ,mBAAmB;CACnD,kBAAkB,EAAE,QAAQ,eAAe;CAC3C,qBAAqB,EAAE,QAAQ,kBAAkB;CACjD,oBAAoB,EAAE,QAAQ,iBAAiB;CAC/C,oBAAoB,EAAE,QAAQ,iBAAiB;CAC/C,sBAAsB,EAAE,QAAQ,mBAAmB;CACnD,gBAAgB,EAAE,QAAQ,aAAa;CACvC,mBAAmB,EAAE,QAAQ,gBAAgB;CAC7C,+BAA+B,EAAE,QAAQ,mBAAmB;AAC9D;;;ACrBA,MAAa,wBAAwB,EAAE,MAAM,CAC3C,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,eAAe,EAAE,CAAC,GACtD,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,iBAAiB,EAAE,CAAC,CAC7D,CAAC;AAED,MAA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