opencommit 2.0.12 → 2.0.14
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 +62 -7
- package/out/tiktoken_bg.wasm +0 -0
- package/package.json +1 -1
package/out/cli.cjs
CHANGED
|
@@ -15157,6 +15157,8 @@ var require_tiktoken_bg = __commonJS({
|
|
|
15157
15157
|
}
|
|
15158
15158
|
var Tiktoken2 = class {
|
|
15159
15159
|
constructor(tiktoken_bfe, special_tokens, pat_str) {
|
|
15160
|
+
if (wasm == null)
|
|
15161
|
+
throw new Error("@dqbd/tiktoken: WASM binary has not been propery initialized.");
|
|
15160
15162
|
const ptr0 = passStringToWasm0(tiktoken_bfe, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
15161
15163
|
const len0 = WASM_VECTOR_LEN;
|
|
15162
15164
|
const ptr1 = passStringToWasm0(pat_str, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -15191,10 +15193,14 @@ var require_tiktoken_bg = __commonJS({
|
|
|
15191
15193
|
return ptr;
|
|
15192
15194
|
}
|
|
15193
15195
|
free() {
|
|
15196
|
+
if (wasm == null)
|
|
15197
|
+
throw new Error("@dqbd/tiktoken: WASM binary has not been propery initialized.");
|
|
15194
15198
|
const ptr = this.__destroy_into_raw();
|
|
15195
15199
|
wasm.__wbg_tiktoken_free(ptr);
|
|
15196
15200
|
}
|
|
15197
15201
|
encode(text, allowed_special, disallowed_special) {
|
|
15202
|
+
if (wasm == null)
|
|
15203
|
+
throw new Error("@dqbd/tiktoken: WASM binary has not been propery initialized.");
|
|
15198
15204
|
try {
|
|
15199
15205
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
15200
15206
|
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -15215,6 +15221,8 @@ var require_tiktoken_bg = __commonJS({
|
|
|
15215
15221
|
}
|
|
15216
15222
|
}
|
|
15217
15223
|
encode_ordinary(text) {
|
|
15224
|
+
if (wasm == null)
|
|
15225
|
+
throw new Error("@dqbd/tiktoken: WASM binary has not been propery initialized.");
|
|
15218
15226
|
try {
|
|
15219
15227
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
15220
15228
|
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -15230,6 +15238,8 @@ var require_tiktoken_bg = __commonJS({
|
|
|
15230
15238
|
}
|
|
15231
15239
|
}
|
|
15232
15240
|
encode_with_unstable(text, allowed_special, disallowed_special) {
|
|
15241
|
+
if (wasm == null)
|
|
15242
|
+
throw new Error("@dqbd/tiktoken: WASM binary has not been propery initialized.");
|
|
15233
15243
|
try {
|
|
15234
15244
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
15235
15245
|
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -15247,12 +15257,16 @@ var require_tiktoken_bg = __commonJS({
|
|
|
15247
15257
|
}
|
|
15248
15258
|
}
|
|
15249
15259
|
encode_single_token(bytes) {
|
|
15260
|
+
if (wasm == null)
|
|
15261
|
+
throw new Error("@dqbd/tiktoken: WASM binary has not been propery initialized.");
|
|
15250
15262
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export_0);
|
|
15251
15263
|
const len0 = WASM_VECTOR_LEN;
|
|
15252
15264
|
const ret = wasm.tiktoken_encode_single_token(this.ptr, ptr0, len0);
|
|
15253
15265
|
return ret >>> 0;
|
|
15254
15266
|
}
|
|
15255
15267
|
decode(tokens) {
|
|
15268
|
+
if (wasm == null)
|
|
15269
|
+
throw new Error("@dqbd/tiktoken: WASM binary has not been propery initialized.");
|
|
15256
15270
|
try {
|
|
15257
15271
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
15258
15272
|
const ptr0 = passArray32ToWasm0(tokens, wasm.__wbindgen_export_0);
|
|
@@ -15268,6 +15282,8 @@ var require_tiktoken_bg = __commonJS({
|
|
|
15268
15282
|
}
|
|
15269
15283
|
}
|
|
15270
15284
|
decode_single_token_bytes(token) {
|
|
15285
|
+
if (wasm == null)
|
|
15286
|
+
throw new Error("@dqbd/tiktoken: WASM binary has not been propery initialized.");
|
|
15271
15287
|
try {
|
|
15272
15288
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
15273
15289
|
wasm.tiktoken_decode_single_token_bytes(retptr, this.ptr, token);
|
|
@@ -15281,6 +15297,8 @@ var require_tiktoken_bg = __commonJS({
|
|
|
15281
15297
|
}
|
|
15282
15298
|
}
|
|
15283
15299
|
token_byte_values() {
|
|
15300
|
+
if (wasm == null)
|
|
15301
|
+
throw new Error("@dqbd/tiktoken: WASM binary has not been propery initialized.");
|
|
15284
15302
|
const ret = wasm.tiktoken_token_byte_values(this.ptr);
|
|
15285
15303
|
return takeObject(ret);
|
|
15286
15304
|
}
|
|
@@ -15300,6 +15318,8 @@ var require_tiktoken_bg = __commonJS({
|
|
|
15300
15318
|
takeObject(arg0);
|
|
15301
15319
|
};
|
|
15302
15320
|
module2.exports.__wbindgen_string_get = function(arg0, arg1) {
|
|
15321
|
+
if (wasm == null)
|
|
15322
|
+
throw new Error("@dqbd/tiktoken: WASM binary has not been propery initialized.");
|
|
15303
15323
|
const obj = getObject(arg1);
|
|
15304
15324
|
const ret = typeof obj === "string" ? obj : void 0;
|
|
15305
15325
|
var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -15329,8 +15349,35 @@ var require_tiktoken = __commonJS({
|
|
|
15329
15349
|
var wasm = require_tiktoken_bg();
|
|
15330
15350
|
var imports = {};
|
|
15331
15351
|
imports["./tiktoken_bg.js"] = wasm;
|
|
15332
|
-
var path4 = require("path")
|
|
15333
|
-
var
|
|
15352
|
+
var path4 = require("path");
|
|
15353
|
+
var fs3 = require("fs");
|
|
15354
|
+
var candidates = __dirname.split(path4.sep).reduce((memo, _6, index, array) => {
|
|
15355
|
+
const prefix = array.slice(0, index + 1).join(path4.sep) + path4.sep;
|
|
15356
|
+
if (!prefix.includes("node_modules" + path4.sep)) {
|
|
15357
|
+
memo.unshift(
|
|
15358
|
+
path4.join(
|
|
15359
|
+
prefix,
|
|
15360
|
+
"node_modules",
|
|
15361
|
+
"@dqbd",
|
|
15362
|
+
"tiktoken",
|
|
15363
|
+
"lite",
|
|
15364
|
+
"./tiktoken_bg.wasm"
|
|
15365
|
+
)
|
|
15366
|
+
);
|
|
15367
|
+
}
|
|
15368
|
+
return memo;
|
|
15369
|
+
}, []);
|
|
15370
|
+
candidates.unshift(path4.join(__dirname, "./tiktoken_bg.wasm"));
|
|
15371
|
+
var bytes = null;
|
|
15372
|
+
for (const candidate of candidates) {
|
|
15373
|
+
try {
|
|
15374
|
+
bytes = fs3.readFileSync(candidate);
|
|
15375
|
+
break;
|
|
15376
|
+
} catch {
|
|
15377
|
+
}
|
|
15378
|
+
}
|
|
15379
|
+
if (bytes == null)
|
|
15380
|
+
throw new Error("Missing tiktoken_bg.wasm");
|
|
15334
15381
|
var wasmModule = new WebAssembly.Module(bytes);
|
|
15335
15382
|
var wasmInstance = new WebAssembly.Instance(wasmModule, imports);
|
|
15336
15383
|
wasm.__wbg_set_wasm(wasmInstance.exports);
|
|
@@ -16076,7 +16123,7 @@ function G3(t, e2) {
|
|
|
16076
16123
|
// package.json
|
|
16077
16124
|
var package_default = {
|
|
16078
16125
|
name: "opencommit",
|
|
16079
|
-
version: "2.0.
|
|
16126
|
+
version: "2.0.13",
|
|
16080
16127
|
description: "GPT CLI to auto-generate impressive commits in 1 second. Killing lame commits with AI \u{1F92F}\u{1F52B}",
|
|
16081
16128
|
keywords: [
|
|
16082
16129
|
"git",
|
|
@@ -17430,6 +17477,14 @@ var configValidators = {
|
|
|
17430
17477
|
return value;
|
|
17431
17478
|
},
|
|
17432
17479
|
["OPENAI_MAX_TOKENS" /* OPENAI_MAX_TOKENS */](value) {
|
|
17480
|
+
if (typeof value === "string") {
|
|
17481
|
+
value = parseInt(value);
|
|
17482
|
+
validateConfig(
|
|
17483
|
+
"OPENAI_MAX_TOKENS" /* OPENAI_MAX_TOKENS */,
|
|
17484
|
+
!isNaN(value),
|
|
17485
|
+
"Must be a number"
|
|
17486
|
+
);
|
|
17487
|
+
}
|
|
17433
17488
|
validateConfig(
|
|
17434
17489
|
"OPENAI_MAX_TOKENS" /* OPENAI_MAX_TOKENS */,
|
|
17435
17490
|
typeof value === "number",
|
|
@@ -17456,8 +17511,8 @@ var configValidators = {
|
|
|
17456
17511
|
["OPENAI_BASE_PATH" /* OPENAI_BASE_PATH */](value) {
|
|
17457
17512
|
validateConfig(
|
|
17458
17513
|
"OPENAI_BASE_PATH" /* OPENAI_BASE_PATH */,
|
|
17459
|
-
typeof value
|
|
17460
|
-
|
|
17514
|
+
typeof value === "string",
|
|
17515
|
+
"Must be string"
|
|
17461
17516
|
);
|
|
17462
17517
|
return value;
|
|
17463
17518
|
},
|
|
@@ -21443,9 +21498,9 @@ var {
|
|
|
21443
21498
|
// src/api.ts
|
|
21444
21499
|
var import_openai = __toESM(require_dist(), 1);
|
|
21445
21500
|
var config = getConfig();
|
|
21446
|
-
var apiKey = config?.OPENAI_API_KEY;
|
|
21447
|
-
var basePath = config?.OPENAI_BASE_PATH;
|
|
21448
21501
|
var maxTokens = config?.OPENAI_MAX_TOKENS;
|
|
21502
|
+
var basePath = config?.OPENAI_BASE_PATH;
|
|
21503
|
+
var apiKey = config?.OPENAI_API_KEY;
|
|
21449
21504
|
var [command, mode] = process.argv.slice(2);
|
|
21450
21505
|
if (!apiKey && command !== "config" && mode !== "set" /* set */) {
|
|
21451
21506
|
ae("opencommit");
|
package/out/tiktoken_bg.wasm
CHANGED
|
Binary file
|