opencommit 1.1.39 → 1.1.40
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/out/cli.cjs +121 -60
- package/package.json +1 -1
package/out/cli.cjs
CHANGED
|
@@ -4250,8 +4250,8 @@ var require_base = __commonJS({
|
|
|
4250
4250
|
pipes: "|"
|
|
4251
4251
|
};
|
|
4252
4252
|
var BaseAPI = class {
|
|
4253
|
-
constructor(configuration,
|
|
4254
|
-
this.basePath =
|
|
4253
|
+
constructor(configuration, basePath2 = exports.BASE_PATH, axios2 = axios_1.default) {
|
|
4254
|
+
this.basePath = basePath2;
|
|
4255
4255
|
this.axios = axios2;
|
|
4256
4256
|
if (configuration) {
|
|
4257
4257
|
this.configuration = configuration;
|
|
@@ -4371,8 +4371,8 @@ var require_common2 = __commonJS({
|
|
|
4371
4371
|
return url3.pathname + url3.search + url3.hash;
|
|
4372
4372
|
};
|
|
4373
4373
|
exports.createRequestFunction = function(axiosArgs, globalAxios, BASE_PATH, configuration) {
|
|
4374
|
-
return (axios2 = globalAxios,
|
|
4375
|
-
const axiosRequestArgs = Object.assign(Object.assign({}, axiosArgs.options), { url: ((configuration === null || configuration === void 0 ? void 0 : configuration.basePath) ||
|
|
4374
|
+
return (axios2 = globalAxios, basePath2 = BASE_PATH) => {
|
|
4375
|
+
const axiosRequestArgs = Object.assign(Object.assign({}, axiosArgs.options), { url: ((configuration === null || configuration === void 0 ? void 0 : configuration.basePath) || basePath2) + axiosArgs.url });
|
|
4376
4376
|
return axios2.request(axiosRequestArgs);
|
|
4377
4377
|
};
|
|
4378
4378
|
};
|
|
@@ -5257,92 +5257,92 @@ var require_api = __commonJS({
|
|
|
5257
5257
|
}
|
|
5258
5258
|
};
|
|
5259
5259
|
};
|
|
5260
|
-
exports.OpenAIApiFactory = function(configuration,
|
|
5260
|
+
exports.OpenAIApiFactory = function(configuration, basePath2, axios2) {
|
|
5261
5261
|
const localVarFp = exports.OpenAIApiFp(configuration);
|
|
5262
5262
|
return {
|
|
5263
5263
|
cancelFineTune(fineTuneId, options) {
|
|
5264
|
-
return localVarFp.cancelFineTune(fineTuneId, options).then((request) => request(axios2,
|
|
5264
|
+
return localVarFp.cancelFineTune(fineTuneId, options).then((request) => request(axios2, basePath2));
|
|
5265
5265
|
},
|
|
5266
5266
|
createAnswer(createAnswerRequest, options) {
|
|
5267
|
-
return localVarFp.createAnswer(createAnswerRequest, options).then((request) => request(axios2,
|
|
5267
|
+
return localVarFp.createAnswer(createAnswerRequest, options).then((request) => request(axios2, basePath2));
|
|
5268
5268
|
},
|
|
5269
5269
|
createChatCompletion(createChatCompletionRequest, options) {
|
|
5270
|
-
return localVarFp.createChatCompletion(createChatCompletionRequest, options).then((request) => request(axios2,
|
|
5270
|
+
return localVarFp.createChatCompletion(createChatCompletionRequest, options).then((request) => request(axios2, basePath2));
|
|
5271
5271
|
},
|
|
5272
5272
|
createClassification(createClassificationRequest, options) {
|
|
5273
|
-
return localVarFp.createClassification(createClassificationRequest, options).then((request) => request(axios2,
|
|
5273
|
+
return localVarFp.createClassification(createClassificationRequest, options).then((request) => request(axios2, basePath2));
|
|
5274
5274
|
},
|
|
5275
5275
|
createCompletion(createCompletionRequest, options) {
|
|
5276
|
-
return localVarFp.createCompletion(createCompletionRequest, options).then((request) => request(axios2,
|
|
5276
|
+
return localVarFp.createCompletion(createCompletionRequest, options).then((request) => request(axios2, basePath2));
|
|
5277
5277
|
},
|
|
5278
5278
|
createEdit(createEditRequest, options) {
|
|
5279
|
-
return localVarFp.createEdit(createEditRequest, options).then((request) => request(axios2,
|
|
5279
|
+
return localVarFp.createEdit(createEditRequest, options).then((request) => request(axios2, basePath2));
|
|
5280
5280
|
},
|
|
5281
5281
|
createEmbedding(createEmbeddingRequest, options) {
|
|
5282
|
-
return localVarFp.createEmbedding(createEmbeddingRequest, options).then((request) => request(axios2,
|
|
5282
|
+
return localVarFp.createEmbedding(createEmbeddingRequest, options).then((request) => request(axios2, basePath2));
|
|
5283
5283
|
},
|
|
5284
5284
|
createFile(file, purpose, options) {
|
|
5285
|
-
return localVarFp.createFile(file, purpose, options).then((request) => request(axios2,
|
|
5285
|
+
return localVarFp.createFile(file, purpose, options).then((request) => request(axios2, basePath2));
|
|
5286
5286
|
},
|
|
5287
5287
|
createFineTune(createFineTuneRequest, options) {
|
|
5288
|
-
return localVarFp.createFineTune(createFineTuneRequest, options).then((request) => request(axios2,
|
|
5288
|
+
return localVarFp.createFineTune(createFineTuneRequest, options).then((request) => request(axios2, basePath2));
|
|
5289
5289
|
},
|
|
5290
5290
|
createImage(createImageRequest, options) {
|
|
5291
|
-
return localVarFp.createImage(createImageRequest, options).then((request) => request(axios2,
|
|
5291
|
+
return localVarFp.createImage(createImageRequest, options).then((request) => request(axios2, basePath2));
|
|
5292
5292
|
},
|
|
5293
5293
|
createImageEdit(image, prompt, mask, n, size, responseFormat, user, options) {
|
|
5294
|
-
return localVarFp.createImageEdit(image, prompt, mask, n, size, responseFormat, user, options).then((request) => request(axios2,
|
|
5294
|
+
return localVarFp.createImageEdit(image, prompt, mask, n, size, responseFormat, user, options).then((request) => request(axios2, basePath2));
|
|
5295
5295
|
},
|
|
5296
5296
|
createImageVariation(image, n, size, responseFormat, user, options) {
|
|
5297
|
-
return localVarFp.createImageVariation(image, n, size, responseFormat, user, options).then((request) => request(axios2,
|
|
5297
|
+
return localVarFp.createImageVariation(image, n, size, responseFormat, user, options).then((request) => request(axios2, basePath2));
|
|
5298
5298
|
},
|
|
5299
5299
|
createModeration(createModerationRequest, options) {
|
|
5300
|
-
return localVarFp.createModeration(createModerationRequest, options).then((request) => request(axios2,
|
|
5300
|
+
return localVarFp.createModeration(createModerationRequest, options).then((request) => request(axios2, basePath2));
|
|
5301
5301
|
},
|
|
5302
5302
|
createSearch(engineId, createSearchRequest, options) {
|
|
5303
|
-
return localVarFp.createSearch(engineId, createSearchRequest, options).then((request) => request(axios2,
|
|
5303
|
+
return localVarFp.createSearch(engineId, createSearchRequest, options).then((request) => request(axios2, basePath2));
|
|
5304
5304
|
},
|
|
5305
5305
|
createTranscription(file, model, prompt, responseFormat, temperature, language, options) {
|
|
5306
|
-
return localVarFp.createTranscription(file, model, prompt, responseFormat, temperature, language, options).then((request) => request(axios2,
|
|
5306
|
+
return localVarFp.createTranscription(file, model, prompt, responseFormat, temperature, language, options).then((request) => request(axios2, basePath2));
|
|
5307
5307
|
},
|
|
5308
5308
|
createTranslation(file, model, prompt, responseFormat, temperature, options) {
|
|
5309
|
-
return localVarFp.createTranslation(file, model, prompt, responseFormat, temperature, options).then((request) => request(axios2,
|
|
5309
|
+
return localVarFp.createTranslation(file, model, prompt, responseFormat, temperature, options).then((request) => request(axios2, basePath2));
|
|
5310
5310
|
},
|
|
5311
5311
|
deleteFile(fileId, options) {
|
|
5312
|
-
return localVarFp.deleteFile(fileId, options).then((request) => request(axios2,
|
|
5312
|
+
return localVarFp.deleteFile(fileId, options).then((request) => request(axios2, basePath2));
|
|
5313
5313
|
},
|
|
5314
5314
|
deleteModel(model, options) {
|
|
5315
|
-
return localVarFp.deleteModel(model, options).then((request) => request(axios2,
|
|
5315
|
+
return localVarFp.deleteModel(model, options).then((request) => request(axios2, basePath2));
|
|
5316
5316
|
},
|
|
5317
5317
|
downloadFile(fileId, options) {
|
|
5318
|
-
return localVarFp.downloadFile(fileId, options).then((request) => request(axios2,
|
|
5318
|
+
return localVarFp.downloadFile(fileId, options).then((request) => request(axios2, basePath2));
|
|
5319
5319
|
},
|
|
5320
5320
|
listEngines(options) {
|
|
5321
|
-
return localVarFp.listEngines(options).then((request) => request(axios2,
|
|
5321
|
+
return localVarFp.listEngines(options).then((request) => request(axios2, basePath2));
|
|
5322
5322
|
},
|
|
5323
5323
|
listFiles(options) {
|
|
5324
|
-
return localVarFp.listFiles(options).then((request) => request(axios2,
|
|
5324
|
+
return localVarFp.listFiles(options).then((request) => request(axios2, basePath2));
|
|
5325
5325
|
},
|
|
5326
5326
|
listFineTuneEvents(fineTuneId, stream4, options) {
|
|
5327
|
-
return localVarFp.listFineTuneEvents(fineTuneId, stream4, options).then((request) => request(axios2,
|
|
5327
|
+
return localVarFp.listFineTuneEvents(fineTuneId, stream4, options).then((request) => request(axios2, basePath2));
|
|
5328
5328
|
},
|
|
5329
5329
|
listFineTunes(options) {
|
|
5330
|
-
return localVarFp.listFineTunes(options).then((request) => request(axios2,
|
|
5330
|
+
return localVarFp.listFineTunes(options).then((request) => request(axios2, basePath2));
|
|
5331
5331
|
},
|
|
5332
5332
|
listModels(options) {
|
|
5333
|
-
return localVarFp.listModels(options).then((request) => request(axios2,
|
|
5333
|
+
return localVarFp.listModels(options).then((request) => request(axios2, basePath2));
|
|
5334
5334
|
},
|
|
5335
5335
|
retrieveEngine(engineId, options) {
|
|
5336
|
-
return localVarFp.retrieveEngine(engineId, options).then((request) => request(axios2,
|
|
5336
|
+
return localVarFp.retrieveEngine(engineId, options).then((request) => request(axios2, basePath2));
|
|
5337
5337
|
},
|
|
5338
5338
|
retrieveFile(fileId, options) {
|
|
5339
|
-
return localVarFp.retrieveFile(fileId, options).then((request) => request(axios2,
|
|
5339
|
+
return localVarFp.retrieveFile(fileId, options).then((request) => request(axios2, basePath2));
|
|
5340
5340
|
},
|
|
5341
5341
|
retrieveFineTune(fineTuneId, options) {
|
|
5342
|
-
return localVarFp.retrieveFineTune(fineTuneId, options).then((request) => request(axios2,
|
|
5342
|
+
return localVarFp.retrieveFineTune(fineTuneId, options).then((request) => request(axios2, basePath2));
|
|
5343
5343
|
},
|
|
5344
5344
|
retrieveModel(model, options) {
|
|
5345
|
-
return localVarFp.retrieveModel(model, options).then((request) => request(axios2,
|
|
5345
|
+
return localVarFp.retrieveModel(model, options).then((request) => request(axios2, basePath2));
|
|
5346
5346
|
}
|
|
5347
5347
|
};
|
|
5348
5348
|
};
|
|
@@ -15763,7 +15763,7 @@ function G3(t, e2) {
|
|
|
15763
15763
|
// package.json
|
|
15764
15764
|
var package_default = {
|
|
15765
15765
|
name: "opencommit",
|
|
15766
|
-
version: "1.1.
|
|
15766
|
+
version: "1.1.39",
|
|
15767
15767
|
description: "GPT CLI to auto-generate impressive commits in 1 second. Killing lame commits with AI \u{1F92F}\u{1F52B}",
|
|
15768
15768
|
keywords: [
|
|
15769
15769
|
"git",
|
|
@@ -16904,9 +16904,9 @@ var fr_default = {
|
|
|
16904
16904
|
// src/i18n/it.json
|
|
16905
16905
|
var it_default = {
|
|
16906
16906
|
localLanguage: "italiano",
|
|
16907
|
-
commitFix: "fix(server.ts): cambia
|
|
16908
|
-
commitFeat: "
|
|
16909
|
-
commitDescription: "La variabile
|
|
16907
|
+
commitFix: "fix(server.ts): cambia la grafia della variabile della porta dal minuscolo port al maiuscolo PORT",
|
|
16908
|
+
commitFeat: "feat(server.ts): aggiunge il supporto per la variabile di ambiente process.env.PORT",
|
|
16909
|
+
commitDescription: "La variabile port \xE8 ora chiamata PORT, migliorando la coerenza con le convenzioni di denominazione in quanto PORT \xE8 una costante. Il supporto per una variabile di ambiente consente all'applicazione di essere pi\xF9 flessibile poich\xE9 ora pu\xF2 essere eseguita su qualsiasi porta disponibile specificata tramite la variabile di ambiente process.env.PORT."
|
|
16910
16910
|
};
|
|
16911
16911
|
|
|
16912
16912
|
// src/i18n/ko.json
|
|
@@ -16935,10 +16935,10 @@ var zh_TW_default = {
|
|
|
16935
16935
|
|
|
16936
16936
|
// src/i18n/ja.json
|
|
16937
16937
|
var ja_default = {
|
|
16938
|
-
localLanguage: "\
|
|
16939
|
-
commitFix: "\u4FEE\u6B63(server.ts): \u30DD\u30FC\u30C8\u5909\u6570\
|
|
16940
|
-
commitFeat: "\u65B0\u6A5F\u80FD(server.ts):
|
|
16941
|
-
commitDescription: "\u30DD\u30FC\u30C8\u5909\u6570\u306F\u73FE\u5728PORT\u3068\u3044\u3046\u540D\u524D\u306B\u306A\
|
|
16938
|
+
localLanguage: "\u65E5\u672C\u8A9E",
|
|
16939
|
+
commitFix: "\u4FEE\u6B63(server.ts): \u30DD\u30FC\u30C8\u5909\u6570\u3092\u5C0F\u6587\u5B57\u306Eport\u304B\u3089\u5927\u6587\u5B57\u306EPORT\u306B\u5909\u66F4",
|
|
16940
|
+
commitFeat: "\u65B0\u6A5F\u80FD(server.ts): \u74B0\u5883\u5909\u6570process.env.PORT\u306E\u30B5\u30DD\u30FC\u30C8\u3092\u8FFD\u52A0",
|
|
16941
|
+
commitDescription: "\u30DD\u30FC\u30C8\u5909\u6570\u306F\u73FE\u5728PORT\u3068\u3044\u3046\u540D\u524D\u306B\u306A\u308A\u3001\u5B9A\u6570\u3067\u3042\u308BPORT\u3092\u4F7F\u3046\u3053\u3068\u3067\u547D\u540D\u898F\u5247\u306B\u4E00\u8CAB\u6027\u304C\u751F\u307E\u308C\u307E\u3057\u305F\u3002\u74B0\u5883\u5909\u6570\u3092\u30B5\u30DD\u30FC\u30C8\u3059\u308B\u3053\u3068\u3067\u3001\u74B0\u5883\u5909\u6570process.env.PORT\u3067\u6307\u5B9A\u3055\u308C\u305F\u4EFB\u610F\u306E\u5229\u7528\u53EF\u80FD\u306A\u30DD\u30FC\u30C8\u3067\u5B9F\u884C\u3067\u304D\u308B\u3088\u3046\u306B\u306A\u308A\u3001\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306F\u3088\u308A\u67D4\u8EDF\u306B\u306A\u308A\u307E\u3057\u305F\u3002"
|
|
16942
16942
|
};
|
|
16943
16943
|
|
|
16944
16944
|
// src/i18n/pt_br.json
|
|
@@ -16997,6 +16997,22 @@ var id_ID_default = {
|
|
|
16997
16997
|
commitDescription: "Port variabel bernama PORT, yang membantu konsistensi dengan memberi nama yaitu PORT yang konstan. Bantuan environment variabel membantu aplikasi lebih fleksibel, dan dapat di jalankan di port manapun yang tertulis pada process.env.PORT"
|
|
16998
16998
|
};
|
|
16999
16999
|
|
|
17000
|
+
// src/i18n/pl.json
|
|
17001
|
+
var pl_default = {
|
|
17002
|
+
localLanguage: "polski",
|
|
17003
|
+
commitFix: "fix(server.ts): poprawa wielko\u015Bci zmiennej port na pisane z du\u017Cymi literami PORT",
|
|
17004
|
+
commitFeat: "feat(server.ts): dodanie obs\u0142ugi zmiennej \u015Brodowiskowej process.env.PORT",
|
|
17005
|
+
commitDescription: "Zmienna port jest teraz nazwana PORT, co jest zgodne z konwencj\u0105 nazewnicz\u0105 poniewa\u017C PORT jest sta\u0142\u0105. Obs\u0142uga zmiennej \u015Brodowiskowej process.env.PORT pozwala \u0142atwiej zarz\u0105dza\u0107 ustawieniami przy starcie."
|
|
17006
|
+
};
|
|
17007
|
+
|
|
17008
|
+
// src/i18n/th.json
|
|
17009
|
+
var th_default = {
|
|
17010
|
+
localLanguage: "\u0E44\u0E17\u0E22",
|
|
17011
|
+
commitFix: "fix(server.ts): \u0E40\u0E1B\u0E25\u0E35\u0E48\u0E22\u0E19\u0E15\u0E31\u0E27\u0E1E\u0E34\u0E21\u0E1E\u0E4C\u0E02\u0E2D\u0E07\u0E15\u0E31\u0E27\u0E41\u0E1B\u0E23 \u0E08\u0E32\u0E01\u0E15\u0E31\u0E27\u0E1E\u0E34\u0E21\u0E1E\u0E4C\u0E40\u0E25\u0E47\u0E01 port \u0E40\u0E1B\u0E47\u0E19\u0E15\u0E31\u0E27\u0E1E\u0E34\u0E21\u0E1E\u0E4C\u0E43\u0E2B\u0E0D\u0E48 PORT",
|
|
17012
|
+
commitFeat: "feat(server.ts): \u0E40\u0E1E\u0E34\u0E48\u0E21\u0E01\u0E32\u0E23\u0E23\u0E2D\u0E07\u0E23\u0E31\u0E1A\u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A\u0E15\u0E31\u0E27\u0E41\u0E1B\u0E23\u0E2A\u0E20\u0E32\u0E1E\u0E41\u0E27\u0E14\u0E25\u0E49\u0E2D\u0E21 process.env.PORT",
|
|
17013
|
+
commitDescription: "\u0E15\u0E2D\u0E19\u0E19\u0E35\u0E49\u0E15\u0E31\u0E27\u0E41\u0E1B\u0E23\u0E1E\u0E2D\u0E23\u0E4C\u0E15\u0E21\u0E35\u0E0A\u0E37\u0E48\u0E2D\u0E27\u0E48\u0E32 PORT, \u0E0B\u0E36\u0E48\u0E07\u0E1B\u0E23\u0E31\u0E1A\u0E1B\u0E23\u0E38\u0E07\u0E04\u0E27\u0E32\u0E21\u0E2A\u0E2D\u0E14\u0E04\u0E25\u0E49\u0E2D\u0E07\u0E01\u0E31\u0E1A\u0E2B\u0E25\u0E31\u0E01\u0E01\u0E32\u0E23\u0E15\u0E31\u0E49\u0E07\u0E0A\u0E37\u0E48\u0E2D\u0E40\u0E19\u0E37\u0E48\u0E2D\u0E07\u0E08\u0E32\u0E01 PORT \u0E40\u0E1B\u0E47\u0E19\u0E04\u0E48\u0E32\u0E04\u0E07\u0E17\u0E35\u0E48. \u0E01\u0E32\u0E23\u0E2A\u0E19\u0E31\u0E1A\u0E2A\u0E19\u0E38\u0E19\u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A\u0E15\u0E31\u0E27\u0E41\u0E1B\u0E23\u0E2A\u0E20\u0E32\u0E1E\u0E41\u0E27\u0E14\u0E25\u0E49\u0E2D\u0E21 \u0E0A\u0E48\u0E27\u0E22\u0E43\u0E2B\u0E49\u0E41\u0E2D\u0E1B\u0E1E\u0E25\u0E34\u0E40\u0E04\u0E0A\u0E31\u0E19\u0E21\u0E35\u0E04\u0E27\u0E32\u0E21\u0E22\u0E37\u0E14\u0E2B\u0E22\u0E38\u0E48\u0E19\u0E21\u0E32\u0E01\u0E02\u0E36\u0E49\u0E19\u0E40\u0E19\u0E37\u0E48\u0E2D\u0E07\u0E08\u0E32\u0E01 \u0E2A\u0E32\u0E21\u0E32\u0E23\u0E16\u0E17\u0E33\u0E07\u0E32\u0E19\u0E1A\u0E19\u0E1E\u0E2D\u0E23\u0E4C\u0E15\u0E43\u0E14 \u0E46 \u0E15\u0E32\u0E21\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 \u0E0B\u0E36\u0E48\u0E07\u0E23\u0E30\u0E1A\u0E38\u0E1C\u0E48\u0E32\u0E19\u0E15\u0E31\u0E27\u0E41\u0E1B\u0E23\u0E2A\u0E20\u0E32\u0E1E\u0E41\u0E27\u0E14\u0E25\u0E49\u0E2D\u0E21 process.env.PORT"
|
|
17014
|
+
};
|
|
17015
|
+
|
|
17000
17016
|
// src/i18n/index.ts
|
|
17001
17017
|
var i18n = {
|
|
17002
17018
|
en: en_default,
|
|
@@ -17013,7 +17029,9 @@ var i18n = {
|
|
|
17013
17029
|
sv: sv_default,
|
|
17014
17030
|
id_ID: id_ID_default,
|
|
17015
17031
|
nl: nl_default,
|
|
17016
|
-
ru: ru_default
|
|
17032
|
+
ru: ru_default,
|
|
17033
|
+
pl: pl_default,
|
|
17034
|
+
th: th_default
|
|
17017
17035
|
};
|
|
17018
17036
|
var I18N_CONFIG_ALIAS = {
|
|
17019
17037
|
zh_CN: ["zh_CN", "\u7B80\u4F53\u4E2D\u6587", "\u4E2D\u6587", "\u7B80\u4F53"],
|
|
@@ -17030,7 +17048,9 @@ var I18N_CONFIG_ALIAS = {
|
|
|
17030
17048
|
es_ES: ["es_ES", "Spanish", "espa\xF1ol"],
|
|
17031
17049
|
sv: ["sv", "Swedish", "Svenska"],
|
|
17032
17050
|
ru: ["ru", "Russian", "\u0440\u0443\u0441\u0441\u043A\u0438\u0439"],
|
|
17033
|
-
id_ID: ["id_ID", "Bahasa", "bahasa"]
|
|
17051
|
+
id_ID: ["id_ID", "Bahasa", "bahasa"],
|
|
17052
|
+
pl: ["pl", "Polish", "Polski"],
|
|
17053
|
+
th: ["th", "Thai", "\u0E44\u0E17\u0E22"]
|
|
17034
17054
|
};
|
|
17035
17055
|
function getI18nLocal(value) {
|
|
17036
17056
|
for (const key in I18N_CONFIG_ALIAS) {
|
|
@@ -17089,6 +17109,14 @@ var configValidators = {
|
|
|
17089
17109
|
`${value} is not supported yet`
|
|
17090
17110
|
);
|
|
17091
17111
|
return getI18nLocal(value);
|
|
17112
|
+
},
|
|
17113
|
+
["OPENAI_BASE_PATH" /* OPENAI_BASE_PATH */](value) {
|
|
17114
|
+
validateConfig(
|
|
17115
|
+
"OPENAI_BASE_PATH" /* OPENAI_BASE_PATH */,
|
|
17116
|
+
typeof value == "string",
|
|
17117
|
+
`${value} is not supported yet`
|
|
17118
|
+
);
|
|
17119
|
+
return value;
|
|
17092
17120
|
}
|
|
17093
17121
|
};
|
|
17094
17122
|
var configPath = (0, import_path.join)((0, import_os.homedir)(), ".opencommit");
|
|
@@ -18087,6 +18115,13 @@ var getOpenCommitIgnore = () => {
|
|
|
18087
18115
|
}
|
|
18088
18116
|
return ig;
|
|
18089
18117
|
};
|
|
18118
|
+
var getCoreHooksPath = async () => {
|
|
18119
|
+
const { stdout } = await execa("git", [
|
|
18120
|
+
"config",
|
|
18121
|
+
"core.hooksPath"
|
|
18122
|
+
]);
|
|
18123
|
+
return stdout;
|
|
18124
|
+
};
|
|
18090
18125
|
var getStagedFiles = async () => {
|
|
18091
18126
|
const { stdout: gitDir } = await execa("git", [
|
|
18092
18127
|
"rev-parse",
|
|
@@ -18161,6 +18196,7 @@ switch (platform) {
|
|
|
18161
18196
|
case "darwin":
|
|
18162
18197
|
separator = "";
|
|
18163
18198
|
break;
|
|
18199
|
+
case "android":
|
|
18164
18200
|
case "linux":
|
|
18165
18201
|
separator = "";
|
|
18166
18202
|
break;
|
|
@@ -18168,9 +18204,23 @@ switch (platform) {
|
|
|
18168
18204
|
throw new Error(`Unsupported platform: ${platform}`);
|
|
18169
18205
|
}
|
|
18170
18206
|
var HOOK_NAME = "prepare-commit-msg";
|
|
18171
|
-
var
|
|
18172
|
-
var
|
|
18173
|
-
|
|
18207
|
+
var DEFAULT_SYMLINK_URL = import_path2.default.join(separator, ".git", "hooks", HOOK_NAME);
|
|
18208
|
+
var getHooksPath = async () => {
|
|
18209
|
+
try {
|
|
18210
|
+
const hooksPath = await getCoreHooksPath();
|
|
18211
|
+
return import_path2.default.join(hooksPath, HOOK_NAME);
|
|
18212
|
+
} catch (error) {
|
|
18213
|
+
return DEFAULT_SYMLINK_URL;
|
|
18214
|
+
}
|
|
18215
|
+
};
|
|
18216
|
+
var isHookCalled = async () => {
|
|
18217
|
+
const hooksPath = await getHooksPath();
|
|
18218
|
+
return process.argv[1].endsWith(hooksPath);
|
|
18219
|
+
};
|
|
18220
|
+
var isHookExists = async () => {
|
|
18221
|
+
const hooksPath = await getHooksPath();
|
|
18222
|
+
return (0, import_fs3.existsSync)(hooksPath);
|
|
18223
|
+
};
|
|
18174
18224
|
var hookCommand = G3(
|
|
18175
18225
|
{
|
|
18176
18226
|
name: "hook" /* hook */,
|
|
@@ -18178,12 +18228,13 @@ var hookCommand = G3(
|
|
|
18178
18228
|
},
|
|
18179
18229
|
async (argv) => {
|
|
18180
18230
|
const HOOK_URL = __filename;
|
|
18231
|
+
const SYMLINK_URL = await getHooksPath();
|
|
18181
18232
|
try {
|
|
18182
18233
|
await assertGitRepo();
|
|
18183
18234
|
const { setUnset: mode2 } = argv._;
|
|
18184
18235
|
if (mode2 === "set") {
|
|
18185
|
-
ae(`setting
|
|
18186
|
-
if (isHookExists) {
|
|
18236
|
+
ae(`setting opencommit as '${HOOK_NAME}' hook at ${SYMLINK_URL}`);
|
|
18237
|
+
if (await isHookExists()) {
|
|
18187
18238
|
let realPath;
|
|
18188
18239
|
try {
|
|
18189
18240
|
realPath = await import_promises.default.realpath(SYMLINK_URL);
|
|
@@ -18203,8 +18254,10 @@ var hookCommand = G3(
|
|
|
18203
18254
|
return ce(`${source_default.green("\u2714")} Hook set`);
|
|
18204
18255
|
}
|
|
18205
18256
|
if (mode2 === "unset") {
|
|
18206
|
-
ae(
|
|
18207
|
-
|
|
18257
|
+
ae(
|
|
18258
|
+
`unsetting opencommit as '${HOOK_NAME}' hook from ${SYMLINK_URL}`
|
|
18259
|
+
);
|
|
18260
|
+
if (!await isHookExists()) {
|
|
18208
18261
|
return ce(
|
|
18209
18262
|
`OpenCommit wasn't previously set as '${HOOK_NAME}' hook, nothing to remove`
|
|
18210
18263
|
);
|
|
@@ -21056,6 +21109,7 @@ var {
|
|
|
21056
21109
|
var import_openai = __toESM(require_dist(), 1);
|
|
21057
21110
|
var config = getConfig();
|
|
21058
21111
|
var apiKey = config?.OPENAI_API_KEY;
|
|
21112
|
+
var basePath = config?.OPENAI_BASE_PATH;
|
|
21059
21113
|
var [command, mode] = process.argv.slice(2);
|
|
21060
21114
|
if (!apiKey && command !== "config" && mode !== "set" /* set */) {
|
|
21061
21115
|
ae("opencommit");
|
|
@@ -21071,7 +21125,13 @@ var OpenAi = class {
|
|
|
21071
21125
|
openAiApiConfiguration = new import_openai.Configuration({
|
|
21072
21126
|
apiKey
|
|
21073
21127
|
});
|
|
21074
|
-
openAI
|
|
21128
|
+
openAI;
|
|
21129
|
+
constructor() {
|
|
21130
|
+
if (basePath) {
|
|
21131
|
+
this.openAiApiConfiguration.basePath = basePath;
|
|
21132
|
+
}
|
|
21133
|
+
this.openAI = new import_openai.OpenAIApi(this.openAiApiConfiguration);
|
|
21134
|
+
}
|
|
21075
21135
|
generateCommitMessage = async (messages) => {
|
|
21076
21136
|
try {
|
|
21077
21137
|
const { data } = await this.openAI.createChatCompletion({
|
|
@@ -21240,7 +21300,7 @@ function getCommitMsgsPromisesFromFileDiffs(diff, maxDiffLength) {
|
|
|
21240
21300
|
|
|
21241
21301
|
// src/commands/prepare-commit-msg-hook.ts
|
|
21242
21302
|
var [messageFilePath, commitSource] = process.argv.slice(2);
|
|
21243
|
-
var prepareCommitMessageHook = async () => {
|
|
21303
|
+
var prepareCommitMessageHook = async (isStageAllFlag = false) => {
|
|
21244
21304
|
try {
|
|
21245
21305
|
if (!messageFilePath) {
|
|
21246
21306
|
throw new Error(
|
|
@@ -21249,14 +21309,15 @@ var prepareCommitMessageHook = async () => {
|
|
|
21249
21309
|
}
|
|
21250
21310
|
if (commitSource)
|
|
21251
21311
|
return;
|
|
21252
|
-
|
|
21253
|
-
|
|
21254
|
-
|
|
21255
|
-
|
|
21256
|
-
|
|
21312
|
+
if (isStageAllFlag) {
|
|
21313
|
+
const changedFiles = await getChangedFiles();
|
|
21314
|
+
if (changedFiles)
|
|
21315
|
+
await gitAdd({ files: changedFiles });
|
|
21316
|
+
else {
|
|
21317
|
+
ce("No changes detected, write some code and run `oc` again");
|
|
21318
|
+
process.exit(1);
|
|
21319
|
+
}
|
|
21257
21320
|
}
|
|
21258
|
-
if (!stagedFiles && changedFiles)
|
|
21259
|
-
await gitAdd({ files: changedFiles });
|
|
21260
21321
|
const staged = await getStagedFiles();
|
|
21261
21322
|
if (!staged)
|
|
21262
21323
|
return;
|
|
@@ -21463,7 +21524,7 @@ Z2(
|
|
|
21463
21524
|
help: { description: package_default.description }
|
|
21464
21525
|
},
|
|
21465
21526
|
async () => {
|
|
21466
|
-
if (isHookCalled) {
|
|
21527
|
+
if (await isHookCalled()) {
|
|
21467
21528
|
prepareCommitMessageHook();
|
|
21468
21529
|
} else {
|
|
21469
21530
|
commit(extraArgs);
|