@johnowennixon/diffdash 1.0.2 → 1.1.0
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/README.md +1 -1
- package/out/diffdash.cjs +22 -452
- package/package.json +1 -2
package/README.md
CHANGED
|
@@ -129,7 +129,7 @@ All command-line arguments are optional.
|
|
|
129
129
|
|
|
130
130
|
## Files containing secrets
|
|
131
131
|
|
|
132
|
-
Files containing secrets should
|
|
132
|
+
Files containing secrets should not be in Git. But if they are, you can add an entry to a `.gitattributes` file with value `-diff` to prevent them being viewable by a Git diff. This will prevent DiffDash from sending any contents to the LLM. For example:
|
|
133
133
|
|
|
134
134
|
```text
|
|
135
135
|
# This is file .gitattributes
|
package/out/diffdash.cjs
CHANGED
|
@@ -5177,436 +5177,6 @@ var require_cli_table3 = __commonJS({
|
|
|
5177
5177
|
}
|
|
5178
5178
|
});
|
|
5179
5179
|
|
|
5180
|
-
// node_modules/.pnpm/tiktoken@1.0.21/node_modules/tiktoken/tiktoken_bg.cjs
|
|
5181
|
-
var require_tiktoken_bg = __commonJS({
|
|
5182
|
-
"node_modules/.pnpm/tiktoken@1.0.21/node_modules/tiktoken/tiktoken_bg.cjs"(exports2, module2) {
|
|
5183
|
-
var wasm;
|
|
5184
|
-
module2.exports.__wbg_set_wasm = function(val) {
|
|
5185
|
-
wasm = val;
|
|
5186
|
-
};
|
|
5187
|
-
var lTextDecoder = typeof TextDecoder === "undefined" ? (0, module2.require)("util").TextDecoder : TextDecoder;
|
|
5188
|
-
var cachedTextDecoder = new lTextDecoder("utf-8", { ignoreBOM: true, fatal: true });
|
|
5189
|
-
cachedTextDecoder.decode();
|
|
5190
|
-
var cachedUint8ArrayMemory0 = null;
|
|
5191
|
-
function getUint8ArrayMemory0() {
|
|
5192
|
-
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
5193
|
-
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
5194
|
-
}
|
|
5195
|
-
return cachedUint8ArrayMemory0;
|
|
5196
|
-
}
|
|
5197
|
-
function getStringFromWasm0(ptr, len) {
|
|
5198
|
-
ptr = ptr >>> 0;
|
|
5199
|
-
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
5200
|
-
}
|
|
5201
|
-
var heap = new Array(128).fill(void 0);
|
|
5202
|
-
heap.push(void 0, null, true, false);
|
|
5203
|
-
var heap_next = heap.length;
|
|
5204
|
-
function addHeapObject(obj) {
|
|
5205
|
-
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
5206
|
-
const idx = heap_next;
|
|
5207
|
-
heap_next = heap[idx];
|
|
5208
|
-
heap[idx] = obj;
|
|
5209
|
-
return idx;
|
|
5210
|
-
}
|
|
5211
|
-
function handleError(f, args) {
|
|
5212
|
-
try {
|
|
5213
|
-
return f.apply(this, args);
|
|
5214
|
-
} catch (e) {
|
|
5215
|
-
wasm.__wbindgen_export_0(addHeapObject(e));
|
|
5216
|
-
}
|
|
5217
|
-
}
|
|
5218
|
-
function getObject(idx) {
|
|
5219
|
-
return heap[idx];
|
|
5220
|
-
}
|
|
5221
|
-
function dropObject(idx) {
|
|
5222
|
-
if (idx < 132) return;
|
|
5223
|
-
heap[idx] = heap_next;
|
|
5224
|
-
heap_next = idx;
|
|
5225
|
-
}
|
|
5226
|
-
function takeObject(idx) {
|
|
5227
|
-
const ret = getObject(idx);
|
|
5228
|
-
dropObject(idx);
|
|
5229
|
-
return ret;
|
|
5230
|
-
}
|
|
5231
|
-
var WASM_VECTOR_LEN = 0;
|
|
5232
|
-
var lTextEncoder = typeof TextEncoder === "undefined" ? (0, module2.require)("util").TextEncoder : TextEncoder;
|
|
5233
|
-
var cachedTextEncoder = new lTextEncoder("utf-8");
|
|
5234
|
-
var encodeString = typeof cachedTextEncoder.encodeInto === "function" ? function(arg, view) {
|
|
5235
|
-
return cachedTextEncoder.encodeInto(arg, view);
|
|
5236
|
-
} : function(arg, view) {
|
|
5237
|
-
const buf = cachedTextEncoder.encode(arg);
|
|
5238
|
-
view.set(buf);
|
|
5239
|
-
return {
|
|
5240
|
-
read: arg.length,
|
|
5241
|
-
written: buf.length
|
|
5242
|
-
};
|
|
5243
|
-
};
|
|
5244
|
-
function passStringToWasm0(arg, malloc, realloc) {
|
|
5245
|
-
if (realloc === void 0) {
|
|
5246
|
-
const buf = cachedTextEncoder.encode(arg);
|
|
5247
|
-
const ptr2 = malloc(buf.length, 1) >>> 0;
|
|
5248
|
-
getUint8ArrayMemory0().subarray(ptr2, ptr2 + buf.length).set(buf);
|
|
5249
|
-
WASM_VECTOR_LEN = buf.length;
|
|
5250
|
-
return ptr2;
|
|
5251
|
-
}
|
|
5252
|
-
let len = arg.length;
|
|
5253
|
-
let ptr = malloc(len, 1) >>> 0;
|
|
5254
|
-
const mem = getUint8ArrayMemory0();
|
|
5255
|
-
let offset = 0;
|
|
5256
|
-
for (; offset < len; offset++) {
|
|
5257
|
-
const code = arg.charCodeAt(offset);
|
|
5258
|
-
if (code > 127) break;
|
|
5259
|
-
mem[ptr + offset] = code;
|
|
5260
|
-
}
|
|
5261
|
-
if (offset !== len) {
|
|
5262
|
-
if (offset !== 0) {
|
|
5263
|
-
arg = arg.slice(offset);
|
|
5264
|
-
}
|
|
5265
|
-
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
5266
|
-
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
5267
|
-
const ret = encodeString(arg, view);
|
|
5268
|
-
offset += ret.written;
|
|
5269
|
-
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
5270
|
-
}
|
|
5271
|
-
WASM_VECTOR_LEN = offset;
|
|
5272
|
-
return ptr;
|
|
5273
|
-
}
|
|
5274
|
-
function isLikeNone(x) {
|
|
5275
|
-
return x === void 0 || x === null;
|
|
5276
|
-
}
|
|
5277
|
-
var cachedDataViewMemory0 = null;
|
|
5278
|
-
function getDataViewMemory0() {
|
|
5279
|
-
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || cachedDataViewMemory0.buffer.detached === void 0 && cachedDataViewMemory0.buffer !== wasm.memory.buffer) {
|
|
5280
|
-
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
5281
|
-
}
|
|
5282
|
-
return cachedDataViewMemory0;
|
|
5283
|
-
}
|
|
5284
|
-
var cachedUint32ArrayMemory0 = null;
|
|
5285
|
-
function getUint32ArrayMemory0() {
|
|
5286
|
-
if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
|
|
5287
|
-
cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
|
|
5288
|
-
}
|
|
5289
|
-
return cachedUint32ArrayMemory0;
|
|
5290
|
-
}
|
|
5291
|
-
function getArrayU32FromWasm0(ptr, len) {
|
|
5292
|
-
ptr = ptr >>> 0;
|
|
5293
|
-
return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
5294
|
-
}
|
|
5295
|
-
function passArray8ToWasm0(arg, malloc) {
|
|
5296
|
-
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
5297
|
-
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
5298
|
-
WASM_VECTOR_LEN = arg.length;
|
|
5299
|
-
return ptr;
|
|
5300
|
-
}
|
|
5301
|
-
function passArray32ToWasm0(arg, malloc) {
|
|
5302
|
-
const ptr = malloc(arg.length * 4, 4) >>> 0;
|
|
5303
|
-
getUint32ArrayMemory0().set(arg, ptr / 4);
|
|
5304
|
-
WASM_VECTOR_LEN = arg.length;
|
|
5305
|
-
return ptr;
|
|
5306
|
-
}
|
|
5307
|
-
function getArrayU8FromWasm0(ptr, len) {
|
|
5308
|
-
ptr = ptr >>> 0;
|
|
5309
|
-
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
5310
|
-
}
|
|
5311
|
-
module2.exports.get_encoding = function(encoding, extend_special_tokens) {
|
|
5312
|
-
if (wasm == null) throw new Error("tiktoken: WASM binary has not been propery initialized.");
|
|
5313
|
-
try {
|
|
5314
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
5315
|
-
const ptr0 = passStringToWasm0(encoding, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
5316
|
-
const len0 = WASM_VECTOR_LEN;
|
|
5317
|
-
wasm.get_encoding(retptr, ptr0, len0, addHeapObject(extend_special_tokens));
|
|
5318
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
5319
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
5320
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
5321
|
-
if (r2) {
|
|
5322
|
-
throw takeObject(r1);
|
|
5323
|
-
}
|
|
5324
|
-
return Tiktoken.__wrap(r0);
|
|
5325
|
-
} finally {
|
|
5326
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
5327
|
-
}
|
|
5328
|
-
};
|
|
5329
|
-
module2.exports.encoding_for_model = function(model, extend_special_tokens) {
|
|
5330
|
-
if (wasm == null) throw new Error("tiktoken: WASM binary has not been propery initialized.");
|
|
5331
|
-
try {
|
|
5332
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
5333
|
-
const ptr0 = passStringToWasm0(model, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
5334
|
-
const len0 = WASM_VECTOR_LEN;
|
|
5335
|
-
wasm.encoding_for_model(retptr, ptr0, len0, addHeapObject(extend_special_tokens));
|
|
5336
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
5337
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
5338
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
5339
|
-
if (r2) {
|
|
5340
|
-
throw takeObject(r1);
|
|
5341
|
-
}
|
|
5342
|
-
return Tiktoken.__wrap(r0);
|
|
5343
|
-
} finally {
|
|
5344
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
5345
|
-
}
|
|
5346
|
-
};
|
|
5347
|
-
var TiktokenFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
5348
|
-
}, unregister: () => {
|
|
5349
|
-
} } : new FinalizationRegistry((ptr) => wasm.__wbg_tiktoken_free(ptr >>> 0, 1));
|
|
5350
|
-
var Tiktoken = class _Tiktoken {
|
|
5351
|
-
/**
|
|
5352
|
-
* @param {string} tiktoken_bfe
|
|
5353
|
-
* @param {any} special_tokens
|
|
5354
|
-
* @param {string} pat_str
|
|
5355
|
-
*/
|
|
5356
|
-
constructor(tiktoken_bfe, special_tokens, pat_str) {
|
|
5357
|
-
if (wasm == null) throw new Error("tiktoken: WASM binary has not been propery initialized.");
|
|
5358
|
-
const ptr0 = passStringToWasm0(tiktoken_bfe, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
5359
|
-
const len0 = WASM_VECTOR_LEN;
|
|
5360
|
-
const ptr1 = passStringToWasm0(pat_str, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
5361
|
-
const len1 = WASM_VECTOR_LEN;
|
|
5362
|
-
const ret = wasm.tiktoken_new(ptr0, len0, addHeapObject(special_tokens), ptr1, len1);
|
|
5363
|
-
this.__wbg_ptr = ret >>> 0;
|
|
5364
|
-
TiktokenFinalization.register(this, this.__wbg_ptr, this);
|
|
5365
|
-
return this;
|
|
5366
|
-
}
|
|
5367
|
-
/** @returns {string | undefined} */
|
|
5368
|
-
get name() {
|
|
5369
|
-
try {
|
|
5370
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
5371
|
-
wasm.tiktoken_name(retptr, this.__wbg_ptr);
|
|
5372
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
5373
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
5374
|
-
let v1;
|
|
5375
|
-
if (r0 !== 0) {
|
|
5376
|
-
v1 = getStringFromWasm0(r0, r1).slice();
|
|
5377
|
-
wasm.__wbindgen_export_3(r0, r1 * 1, 1);
|
|
5378
|
-
}
|
|
5379
|
-
return v1;
|
|
5380
|
-
} finally {
|
|
5381
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
5382
|
-
}
|
|
5383
|
-
}
|
|
5384
|
-
static __wrap(ptr) {
|
|
5385
|
-
ptr = ptr >>> 0;
|
|
5386
|
-
const obj = Object.create(_Tiktoken.prototype);
|
|
5387
|
-
obj.__wbg_ptr = ptr;
|
|
5388
|
-
TiktokenFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
5389
|
-
return obj;
|
|
5390
|
-
}
|
|
5391
|
-
__destroy_into_raw() {
|
|
5392
|
-
const ptr = this.__wbg_ptr;
|
|
5393
|
-
this.__wbg_ptr = 0;
|
|
5394
|
-
TiktokenFinalization.unregister(this);
|
|
5395
|
-
return ptr;
|
|
5396
|
-
}
|
|
5397
|
-
free() {
|
|
5398
|
-
if (wasm == null) throw new Error("tiktoken: WASM binary has not been propery initialized.");
|
|
5399
|
-
const ptr = this.__destroy_into_raw();
|
|
5400
|
-
wasm.__wbg_tiktoken_free(ptr, 0);
|
|
5401
|
-
}
|
|
5402
|
-
/**
|
|
5403
|
-
* @param {string} text
|
|
5404
|
-
* @param {any} allowed_special
|
|
5405
|
-
* @param {any} disallowed_special
|
|
5406
|
-
* @returns {Uint32Array}
|
|
5407
|
-
*/
|
|
5408
|
-
encode(text2, allowed_special, disallowed_special) {
|
|
5409
|
-
if (wasm == null) throw new Error("tiktoken: WASM binary has not been propery initialized.");
|
|
5410
|
-
try {
|
|
5411
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
5412
|
-
const ptr0 = passStringToWasm0(text2, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
5413
|
-
const len0 = WASM_VECTOR_LEN;
|
|
5414
|
-
wasm.tiktoken_encode(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(allowed_special), addHeapObject(disallowed_special));
|
|
5415
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
5416
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
5417
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
5418
|
-
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
5419
|
-
if (r3) {
|
|
5420
|
-
throw takeObject(r2);
|
|
5421
|
-
}
|
|
5422
|
-
var v2 = getArrayU32FromWasm0(r0, r1).slice();
|
|
5423
|
-
wasm.__wbindgen_export_3(r0, r1 * 4, 4);
|
|
5424
|
-
return v2;
|
|
5425
|
-
} finally {
|
|
5426
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
5427
|
-
}
|
|
5428
|
-
}
|
|
5429
|
-
/**
|
|
5430
|
-
* @param {string} text
|
|
5431
|
-
* @returns {Uint32Array}
|
|
5432
|
-
*/
|
|
5433
|
-
encode_ordinary(text2) {
|
|
5434
|
-
if (wasm == null) throw new Error("tiktoken: WASM binary has not been propery initialized.");
|
|
5435
|
-
try {
|
|
5436
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
5437
|
-
const ptr0 = passStringToWasm0(text2, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
5438
|
-
const len0 = WASM_VECTOR_LEN;
|
|
5439
|
-
wasm.tiktoken_encode_ordinary(retptr, this.__wbg_ptr, ptr0, len0);
|
|
5440
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
5441
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
5442
|
-
var v2 = getArrayU32FromWasm0(r0, r1).slice();
|
|
5443
|
-
wasm.__wbindgen_export_3(r0, r1 * 4, 4);
|
|
5444
|
-
return v2;
|
|
5445
|
-
} finally {
|
|
5446
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
5447
|
-
}
|
|
5448
|
-
}
|
|
5449
|
-
/**
|
|
5450
|
-
* @param {string} text
|
|
5451
|
-
* @param {any} allowed_special
|
|
5452
|
-
* @param {any} disallowed_special
|
|
5453
|
-
* @returns {any}
|
|
5454
|
-
*/
|
|
5455
|
-
encode_with_unstable(text2, allowed_special, disallowed_special) {
|
|
5456
|
-
if (wasm == null) throw new Error("tiktoken: WASM binary has not been propery initialized.");
|
|
5457
|
-
try {
|
|
5458
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
5459
|
-
const ptr0 = passStringToWasm0(text2, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
5460
|
-
const len0 = WASM_VECTOR_LEN;
|
|
5461
|
-
wasm.tiktoken_encode_with_unstable(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(allowed_special), addHeapObject(disallowed_special));
|
|
5462
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
5463
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
5464
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
5465
|
-
if (r2) {
|
|
5466
|
-
throw takeObject(r1);
|
|
5467
|
-
}
|
|
5468
|
-
return takeObject(r0);
|
|
5469
|
-
} finally {
|
|
5470
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
5471
|
-
}
|
|
5472
|
-
}
|
|
5473
|
-
/**
|
|
5474
|
-
* @param {Uint8Array} bytes
|
|
5475
|
-
* @returns {number}
|
|
5476
|
-
*/
|
|
5477
|
-
encode_single_token(bytes) {
|
|
5478
|
-
if (wasm == null) throw new Error("tiktoken: WASM binary has not been propery initialized.");
|
|
5479
|
-
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export_1);
|
|
5480
|
-
const len0 = WASM_VECTOR_LEN;
|
|
5481
|
-
const ret = wasm.tiktoken_encode_single_token(this.__wbg_ptr, ptr0, len0);
|
|
5482
|
-
return ret >>> 0;
|
|
5483
|
-
}
|
|
5484
|
-
/**
|
|
5485
|
-
* @param {Uint32Array} tokens
|
|
5486
|
-
* @returns {Uint8Array}
|
|
5487
|
-
*/
|
|
5488
|
-
decode(tokens) {
|
|
5489
|
-
if (wasm == null) throw new Error("tiktoken: WASM binary has not been propery initialized.");
|
|
5490
|
-
try {
|
|
5491
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
5492
|
-
const ptr0 = passArray32ToWasm0(tokens, wasm.__wbindgen_export_1);
|
|
5493
|
-
const len0 = WASM_VECTOR_LEN;
|
|
5494
|
-
wasm.tiktoken_decode(retptr, this.__wbg_ptr, ptr0, len0);
|
|
5495
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
5496
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
5497
|
-
var v2 = getArrayU8FromWasm0(r0, r1).slice();
|
|
5498
|
-
wasm.__wbindgen_export_3(r0, r1 * 1, 1);
|
|
5499
|
-
return v2;
|
|
5500
|
-
} finally {
|
|
5501
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
5502
|
-
}
|
|
5503
|
-
}
|
|
5504
|
-
/**
|
|
5505
|
-
* @param {number} token
|
|
5506
|
-
* @returns {Uint8Array}
|
|
5507
|
-
*/
|
|
5508
|
-
decode_single_token_bytes(token) {
|
|
5509
|
-
if (wasm == null) throw new Error("tiktoken: WASM binary has not been propery initialized.");
|
|
5510
|
-
try {
|
|
5511
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
5512
|
-
wasm.tiktoken_decode_single_token_bytes(retptr, this.__wbg_ptr, token);
|
|
5513
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
5514
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
5515
|
-
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
5516
|
-
wasm.__wbindgen_export_3(r0, r1 * 1, 1);
|
|
5517
|
-
return v1;
|
|
5518
|
-
} finally {
|
|
5519
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
5520
|
-
}
|
|
5521
|
-
}
|
|
5522
|
-
/** @returns {any} */
|
|
5523
|
-
token_byte_values() {
|
|
5524
|
-
if (wasm == null) throw new Error("tiktoken: WASM binary has not been propery initialized.");
|
|
5525
|
-
const ret = wasm.tiktoken_token_byte_values(this.__wbg_ptr);
|
|
5526
|
-
return takeObject(ret);
|
|
5527
|
-
}
|
|
5528
|
-
};
|
|
5529
|
-
module2.exports.Tiktoken = Tiktoken;
|
|
5530
|
-
module2.exports.__wbg_parse_def2e24ef1252aff = function() {
|
|
5531
|
-
return handleError(function(arg0, arg1) {
|
|
5532
|
-
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
|
5533
|
-
return addHeapObject(ret);
|
|
5534
|
-
}, arguments);
|
|
5535
|
-
};
|
|
5536
|
-
module2.exports.__wbg_stringify_f7ed6987935b4a24 = function() {
|
|
5537
|
-
return handleError(function(arg0) {
|
|
5538
|
-
const ret = JSON.stringify(getObject(arg0));
|
|
5539
|
-
return addHeapObject(ret);
|
|
5540
|
-
}, arguments);
|
|
5541
|
-
};
|
|
5542
|
-
module2.exports.__wbindgen_error_new = function(arg0, arg1) {
|
|
5543
|
-
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
5544
|
-
return addHeapObject(ret);
|
|
5545
|
-
};
|
|
5546
|
-
module2.exports.__wbindgen_is_undefined = function(arg0) {
|
|
5547
|
-
const ret = getObject(arg0) === void 0;
|
|
5548
|
-
return ret;
|
|
5549
|
-
};
|
|
5550
|
-
module2.exports.__wbindgen_object_drop_ref = function(arg0) {
|
|
5551
|
-
takeObject(arg0);
|
|
5552
|
-
};
|
|
5553
|
-
module2.exports.__wbindgen_string_get = function(arg0, arg1) {
|
|
5554
|
-
if (wasm == null) throw new Error("tiktoken: WASM binary has not been propery initialized.");
|
|
5555
|
-
const obj = getObject(arg1);
|
|
5556
|
-
const ret = typeof obj === "string" ? obj : void 0;
|
|
5557
|
-
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
5558
|
-
var len1 = WASM_VECTOR_LEN;
|
|
5559
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
5560
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
5561
|
-
};
|
|
5562
|
-
module2.exports.__wbindgen_throw = function(arg0, arg1) {
|
|
5563
|
-
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
5564
|
-
};
|
|
5565
|
-
}
|
|
5566
|
-
});
|
|
5567
|
-
|
|
5568
|
-
// node_modules/.pnpm/tiktoken@1.0.21/node_modules/tiktoken/tiktoken.cjs
|
|
5569
|
-
var require_tiktoken = __commonJS({
|
|
5570
|
-
"node_modules/.pnpm/tiktoken@1.0.21/node_modules/tiktoken/tiktoken.cjs"(exports2) {
|
|
5571
|
-
var wasm = require_tiktoken_bg();
|
|
5572
|
-
var imports = {};
|
|
5573
|
-
imports["./tiktoken_bg.js"] = wasm;
|
|
5574
|
-
var path2 = require("path");
|
|
5575
|
-
var fs = require("fs");
|
|
5576
|
-
var candidates = __dirname.split(path2.sep).reduce((memo, _, index, array) => {
|
|
5577
|
-
const prefix = array.slice(0, index + 1).join(path2.sep) + path2.sep;
|
|
5578
|
-
if (!prefix.includes("node_modules" + path2.sep)) {
|
|
5579
|
-
memo.unshift(
|
|
5580
|
-
path2.join(
|
|
5581
|
-
prefix,
|
|
5582
|
-
"node_modules",
|
|
5583
|
-
"tiktoken",
|
|
5584
|
-
"",
|
|
5585
|
-
"./tiktoken_bg.wasm"
|
|
5586
|
-
)
|
|
5587
|
-
);
|
|
5588
|
-
}
|
|
5589
|
-
return memo;
|
|
5590
|
-
}, []);
|
|
5591
|
-
candidates.unshift(path2.join(__dirname, "./tiktoken_bg.wasm"));
|
|
5592
|
-
var bytes = null;
|
|
5593
|
-
for (const candidate of candidates) {
|
|
5594
|
-
try {
|
|
5595
|
-
bytes = fs.readFileSync(candidate);
|
|
5596
|
-
break;
|
|
5597
|
-
} catch {
|
|
5598
|
-
}
|
|
5599
|
-
}
|
|
5600
|
-
if (bytes == null) throw new Error("Missing tiktoken_bg.wasm");
|
|
5601
|
-
var wasmModule = new WebAssembly.Module(bytes);
|
|
5602
|
-
var wasmInstance = new WebAssembly.Instance(wasmModule, imports);
|
|
5603
|
-
wasm.__wbg_set_wasm(wasmInstance.exports);
|
|
5604
|
-
exports2["get_encoding"] = wasm["get_encoding"];
|
|
5605
|
-
exports2["encoding_for_model"] = wasm["encoding_for_model"];
|
|
5606
|
-
exports2["Tiktoken"] = wasm["Tiktoken"];
|
|
5607
|
-
}
|
|
5608
|
-
});
|
|
5609
|
-
|
|
5610
5180
|
// node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js
|
|
5611
5181
|
var require_ms = __commonJS({
|
|
5612
5182
|
"node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js"(exports2, module2) {
|
|
@@ -7122,20 +6692,31 @@ var LLM_MODEL_DETAILS = [
|
|
|
7122
6692
|
{
|
|
7123
6693
|
llm_model_name: "o3",
|
|
7124
6694
|
llm_provider: "openai",
|
|
7125
|
-
llm_model_code_direct: "o3",
|
|
7126
|
-
llm_model_code_requesty: "openai/o3",
|
|
7127
|
-
llm_model_code_openrouter: "openai/o3",
|
|
6695
|
+
llm_model_code_direct: "o3-2025-04-16",
|
|
6696
|
+
llm_model_code_requesty: "openai/o3-2025-04-16",
|
|
6697
|
+
llm_model_code_openrouter: "openai/o3-2025-04-16",
|
|
6698
|
+
context_window: 2e5,
|
|
6699
|
+
cents_input: 200,
|
|
6700
|
+
cents_output: 800,
|
|
6701
|
+
has_structured_json: true
|
|
6702
|
+
},
|
|
6703
|
+
{
|
|
6704
|
+
llm_model_name: "o3-pro",
|
|
6705
|
+
llm_provider: "openai",
|
|
6706
|
+
llm_model_code_direct: "o3-pro",
|
|
6707
|
+
llm_model_code_requesty: "openai/o3-pro",
|
|
6708
|
+
llm_model_code_openrouter: "openai/o3-pro",
|
|
7128
6709
|
context_window: 2e5,
|
|
7129
|
-
cents_input:
|
|
7130
|
-
cents_output:
|
|
6710
|
+
cents_input: 2e3,
|
|
6711
|
+
cents_output: 8e3,
|
|
7131
6712
|
has_structured_json: true
|
|
7132
6713
|
},
|
|
7133
6714
|
{
|
|
7134
6715
|
llm_model_name: "o4-mini",
|
|
7135
6716
|
llm_provider: "openai",
|
|
7136
|
-
llm_model_code_direct: "o4-mini",
|
|
7137
|
-
llm_model_code_requesty: "openai/o4-mini",
|
|
7138
|
-
llm_model_code_openrouter: "openai/o4-mini",
|
|
6717
|
+
llm_model_code_direct: "o4-mini-2025-04-16",
|
|
6718
|
+
llm_model_code_requesty: "openai/o4-mini-2025-04-16",
|
|
6719
|
+
llm_model_code_openrouter: "openai/o4-mini-2025-04-16",
|
|
7139
6720
|
context_window: 2e5,
|
|
7140
6721
|
cents_input: 110,
|
|
7141
6722
|
cents_output: 440,
|
|
@@ -21323,7 +20904,7 @@ function llm_list_models({ llm_model_details }) {
|
|
|
21323
20904
|
// package.json
|
|
21324
20905
|
var package_default = {
|
|
21325
20906
|
name: "@johnowennixon/diffdash",
|
|
21326
|
-
version: "1.0.
|
|
20907
|
+
version: "1.0.3",
|
|
21327
20908
|
description: "A command-line tool to generate Git commit messages using AI",
|
|
21328
20909
|
license: "0BSD",
|
|
21329
20910
|
author: "John Owen Nixon",
|
|
@@ -21368,7 +20949,6 @@ var package_default = {
|
|
|
21368
20949
|
argparse: "2.0.1",
|
|
21369
20950
|
"cli-table3": "0.6.5",
|
|
21370
20951
|
"simple-git": "3.28.0",
|
|
21371
|
-
tiktoken: "1.0.21",
|
|
21372
20952
|
zod: "3.25.55"
|
|
21373
20953
|
},
|
|
21374
20954
|
devDependencies: {
|
|
@@ -28056,18 +27636,8 @@ async function llm_chat_generate_object({
|
|
|
28056
27636
|
}
|
|
28057
27637
|
|
|
28058
27638
|
// src/lib_llm_tokens.ts
|
|
28059
|
-
|
|
28060
|
-
|
|
28061
|
-
const { llm_model_detail } = llm_config;
|
|
28062
|
-
const { llm_model_code_direct } = llm_model_detail;
|
|
28063
|
-
switch (llm_model_code_direct) {
|
|
28064
|
-
case "gpt-4.1-mini":
|
|
28065
|
-
case "gpt-4.1-nano":
|
|
28066
|
-
case "gpt-4o-mini":
|
|
28067
|
-
return (0, import_tiktoken.encoding_for_model)(llm_model_code_direct).encode(text2).length;
|
|
28068
|
-
default:
|
|
28069
|
-
return Math.round(text2.length / 3);
|
|
28070
|
-
}
|
|
27639
|
+
function llm_tokens_count_estimated({ text: text2 }) {
|
|
27640
|
+
return Math.round(text2.length / 3);
|
|
28071
27641
|
}
|
|
28072
27642
|
function llm_tokens_debug_usage({
|
|
28073
27643
|
name: name17,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@johnowennixon/diffdash",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "A command-line tool to generate Git commit messages using AI",
|
|
5
5
|
"license": "0BSD",
|
|
6
6
|
"author": "John Owen Nixon",
|
|
@@ -30,7 +30,6 @@
|
|
|
30
30
|
"argparse": "2.0.1",
|
|
31
31
|
"cli-table3": "0.6.5",
|
|
32
32
|
"simple-git": "3.28.0",
|
|
33
|
-
"tiktoken": "1.0.21",
|
|
34
33
|
"zod": "3.25.55"
|
|
35
34
|
},
|
|
36
35
|
"devDependencies": {
|