agentinit 1.2.0 → 1.2.1

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [1.2.1](https://github.com/agentinit/agentinit/compare/v1.2.0...v1.2.1) (2025-09-20)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * upd package ([06fa82f](https://github.com/agentinit/agentinit/commit/06fa82fb67e296e85330806084ecea12f6916f05))
7
+
1
8
  # [1.2.0](https://github.com/agentinit/agentinit/compare/v1.1.0...v1.2.0) (2025-09-20)
2
9
 
3
10
 
Binary file
package/dist/index.js CHANGED
@@ -13753,402 +13753,6 @@ var require_toml = __commonJS((exports) => {
13753
13753
  exports.stringify = require_stringify2();
13754
13754
  });
13755
13755
 
13756
- // node_modules/tiktoken/tiktoken_bg.cjs
13757
- var require_tiktoken_bg = __commonJS((exports, module) => {
13758
- var getUint8ArrayMemory0 = function() {
13759
- if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
13760
- cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
13761
- }
13762
- return cachedUint8ArrayMemory0;
13763
- };
13764
- var getStringFromWasm0 = function(ptr, len) {
13765
- ptr = ptr >>> 0;
13766
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
13767
- };
13768
- var addHeapObject = function(obj) {
13769
- if (heap_next === heap.length)
13770
- heap.push(heap.length + 1);
13771
- const idx = heap_next;
13772
- heap_next = heap[idx];
13773
- heap[idx] = obj;
13774
- return idx;
13775
- };
13776
- var handleError = function(f, args) {
13777
- try {
13778
- return f.apply(this, args);
13779
- } catch (e) {
13780
- wasm.__wbindgen_export_0(addHeapObject(e));
13781
- }
13782
- };
13783
- var getObject = function(idx) {
13784
- return heap[idx];
13785
- };
13786
- var dropObject = function(idx) {
13787
- if (idx < 132)
13788
- return;
13789
- heap[idx] = heap_next;
13790
- heap_next = idx;
13791
- };
13792
- var takeObject = function(idx) {
13793
- const ret = getObject(idx);
13794
- dropObject(idx);
13795
- return ret;
13796
- };
13797
- var passStringToWasm0 = function(arg, malloc, realloc) {
13798
- if (realloc === undefined) {
13799
- const buf = cachedTextEncoder.encode(arg);
13800
- const ptr2 = malloc(buf.length, 1) >>> 0;
13801
- getUint8ArrayMemory0().subarray(ptr2, ptr2 + buf.length).set(buf);
13802
- WASM_VECTOR_LEN = buf.length;
13803
- return ptr2;
13804
- }
13805
- let len = arg.length;
13806
- let ptr = malloc(len, 1) >>> 0;
13807
- const mem = getUint8ArrayMemory0();
13808
- let offset = 0;
13809
- for (;offset < len; offset++) {
13810
- const code = arg.charCodeAt(offset);
13811
- if (code > 127)
13812
- break;
13813
- mem[ptr + offset] = code;
13814
- }
13815
- if (offset !== len) {
13816
- if (offset !== 0) {
13817
- arg = arg.slice(offset);
13818
- }
13819
- ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
13820
- const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
13821
- const ret = encodeString(arg, view);
13822
- offset += ret.written;
13823
- ptr = realloc(ptr, len, offset, 1) >>> 0;
13824
- }
13825
- WASM_VECTOR_LEN = offset;
13826
- return ptr;
13827
- };
13828
- var isLikeNone = function(x) {
13829
- return x === undefined || x === null;
13830
- };
13831
- var getDataViewMemory0 = function() {
13832
- if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer) {
13833
- cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
13834
- }
13835
- return cachedDataViewMemory0;
13836
- };
13837
- var getUint32ArrayMemory0 = function() {
13838
- if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
13839
- cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
13840
- }
13841
- return cachedUint32ArrayMemory0;
13842
- };
13843
- var getArrayU32FromWasm0 = function(ptr, len) {
13844
- ptr = ptr >>> 0;
13845
- return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
13846
- };
13847
- var passArray8ToWasm0 = function(arg, malloc) {
13848
- const ptr = malloc(arg.length * 1, 1) >>> 0;
13849
- getUint8ArrayMemory0().set(arg, ptr / 1);
13850
- WASM_VECTOR_LEN = arg.length;
13851
- return ptr;
13852
- };
13853
- var passArray32ToWasm0 = function(arg, malloc) {
13854
- const ptr = malloc(arg.length * 4, 4) >>> 0;
13855
- getUint32ArrayMemory0().set(arg, ptr / 4);
13856
- WASM_VECTOR_LEN = arg.length;
13857
- return ptr;
13858
- };
13859
- var getArrayU8FromWasm0 = function(ptr, len) {
13860
- ptr = ptr >>> 0;
13861
- return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
13862
- };
13863
- var wasm;
13864
- exports.__wbg_set_wasm = function(val) {
13865
- wasm = val;
13866
- };
13867
- var lTextDecoder = typeof TextDecoder === "undefined" ? (0, module.require)("util").TextDecoder : TextDecoder;
13868
- var cachedTextDecoder = new lTextDecoder("utf-8", { ignoreBOM: true, fatal: true });
13869
- cachedTextDecoder.decode();
13870
- var cachedUint8ArrayMemory0 = null;
13871
- var heap = new Array(128).fill(undefined);
13872
- heap.push(undefined, null, true, false);
13873
- var heap_next = heap.length;
13874
- var WASM_VECTOR_LEN = 0;
13875
- var lTextEncoder = typeof TextEncoder === "undefined" ? (0, module.require)("util").TextEncoder : TextEncoder;
13876
- var cachedTextEncoder = new lTextEncoder("utf-8");
13877
- var encodeString = typeof cachedTextEncoder.encodeInto === "function" ? function(arg, view) {
13878
- return cachedTextEncoder.encodeInto(arg, view);
13879
- } : function(arg, view) {
13880
- const buf = cachedTextEncoder.encode(arg);
13881
- view.set(buf);
13882
- return {
13883
- read: arg.length,
13884
- written: buf.length
13885
- };
13886
- };
13887
- var cachedDataViewMemory0 = null;
13888
- var cachedUint32ArrayMemory0 = null;
13889
- exports.get_encoding = function(encoding, extend_special_tokens) {
13890
- if (wasm == null)
13891
- throw new Error("tiktoken: WASM binary has not been propery initialized.");
13892
- try {
13893
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
13894
- const ptr0 = passStringToWasm0(encoding, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
13895
- const len0 = WASM_VECTOR_LEN;
13896
- wasm.get_encoding(retptr, ptr0, len0, addHeapObject(extend_special_tokens));
13897
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
13898
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
13899
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
13900
- if (r2) {
13901
- throw takeObject(r1);
13902
- }
13903
- return Tiktoken.__wrap(r0);
13904
- } finally {
13905
- wasm.__wbindgen_add_to_stack_pointer(16);
13906
- }
13907
- };
13908
- exports.encoding_for_model = function(model, extend_special_tokens) {
13909
- if (wasm == null)
13910
- throw new Error("tiktoken: WASM binary has not been propery initialized.");
13911
- try {
13912
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
13913
- const ptr0 = passStringToWasm0(model, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
13914
- const len0 = WASM_VECTOR_LEN;
13915
- wasm.encoding_for_model(retptr, ptr0, len0, addHeapObject(extend_special_tokens));
13916
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
13917
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
13918
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
13919
- if (r2) {
13920
- throw takeObject(r1);
13921
- }
13922
- return Tiktoken.__wrap(r0);
13923
- } finally {
13924
- wasm.__wbindgen_add_to_stack_pointer(16);
13925
- }
13926
- };
13927
- exports.get_encoding_name_for_model = function(model) {
13928
- if (wasm == null)
13929
- throw new Error("tiktoken: WASM binary has not been propery initialized.");
13930
- let deferred3_0;
13931
- let deferred3_1;
13932
- try {
13933
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
13934
- const ptr0 = passStringToWasm0(model, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
13935
- const len0 = WASM_VECTOR_LEN;
13936
- wasm.get_encoding_name_for_model(retptr, ptr0, len0);
13937
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
13938
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
13939
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
13940
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
13941
- var ptr2 = r0;
13942
- var len2 = r1;
13943
- if (r3) {
13944
- ptr2 = 0;
13945
- len2 = 0;
13946
- throw takeObject(r2);
13947
- }
13948
- deferred3_0 = ptr2;
13949
- deferred3_1 = len2;
13950
- return getStringFromWasm0(ptr2, len2);
13951
- } finally {
13952
- wasm.__wbindgen_add_to_stack_pointer(16);
13953
- wasm.__wbindgen_export_3(deferred3_0, deferred3_1, 1);
13954
- }
13955
- };
13956
- var TiktokenFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
13957
- }, unregister: () => {
13958
- } } : new FinalizationRegistry((ptr) => wasm.__wbg_tiktoken_free(ptr >>> 0, 1));
13959
-
13960
- class Tiktoken {
13961
- constructor(tiktoken_bfe, special_tokens, pat_str) {
13962
- if (wasm == null)
13963
- throw new Error("tiktoken: WASM binary has not been propery initialized.");
13964
- const ptr0 = passStringToWasm0(tiktoken_bfe, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
13965
- const len0 = WASM_VECTOR_LEN;
13966
- const ptr1 = passStringToWasm0(pat_str, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
13967
- const len1 = WASM_VECTOR_LEN;
13968
- const ret = wasm.tiktoken_new(ptr0, len0, addHeapObject(special_tokens), ptr1, len1);
13969
- this.__wbg_ptr = ret >>> 0;
13970
- TiktokenFinalization.register(this, this.__wbg_ptr, this);
13971
- return this;
13972
- }
13973
- get name() {
13974
- try {
13975
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
13976
- wasm.tiktoken_name(retptr, this.__wbg_ptr);
13977
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
13978
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
13979
- let v1;
13980
- if (r0 !== 0) {
13981
- v1 = getStringFromWasm0(r0, r1).slice();
13982
- wasm.__wbindgen_export_3(r0, r1 * 1, 1);
13983
- }
13984
- return v1;
13985
- } finally {
13986
- wasm.__wbindgen_add_to_stack_pointer(16);
13987
- }
13988
- }
13989
- static __wrap(ptr) {
13990
- ptr = ptr >>> 0;
13991
- const obj = Object.create(Tiktoken.prototype);
13992
- obj.__wbg_ptr = ptr;
13993
- TiktokenFinalization.register(obj, obj.__wbg_ptr, obj);
13994
- return obj;
13995
- }
13996
- __destroy_into_raw() {
13997
- const ptr = this.__wbg_ptr;
13998
- this.__wbg_ptr = 0;
13999
- TiktokenFinalization.unregister(this);
14000
- return ptr;
14001
- }
14002
- free() {
14003
- if (wasm == null)
14004
- throw new Error("tiktoken: WASM binary has not been propery initialized.");
14005
- const ptr = this.__destroy_into_raw();
14006
- wasm.__wbg_tiktoken_free(ptr, 0);
14007
- }
14008
- encode(text, allowed_special, disallowed_special) {
14009
- if (wasm == null)
14010
- throw new Error("tiktoken: WASM binary has not been propery initialized.");
14011
- try {
14012
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
14013
- const ptr0 = passStringToWasm0(text, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
14014
- const len0 = WASM_VECTOR_LEN;
14015
- wasm.tiktoken_encode(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(allowed_special), addHeapObject(disallowed_special));
14016
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
14017
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
14018
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
14019
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
14020
- if (r3) {
14021
- throw takeObject(r2);
14022
- }
14023
- var v2 = getArrayU32FromWasm0(r0, r1).slice();
14024
- wasm.__wbindgen_export_3(r0, r1 * 4, 4);
14025
- return v2;
14026
- } finally {
14027
- wasm.__wbindgen_add_to_stack_pointer(16);
14028
- }
14029
- }
14030
- encode_ordinary(text) {
14031
- if (wasm == null)
14032
- throw new Error("tiktoken: WASM binary has not been propery initialized.");
14033
- try {
14034
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
14035
- const ptr0 = passStringToWasm0(text, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
14036
- const len0 = WASM_VECTOR_LEN;
14037
- wasm.tiktoken_encode_ordinary(retptr, this.__wbg_ptr, ptr0, len0);
14038
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
14039
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
14040
- var v2 = getArrayU32FromWasm0(r0, r1).slice();
14041
- wasm.__wbindgen_export_3(r0, r1 * 4, 4);
14042
- return v2;
14043
- } finally {
14044
- wasm.__wbindgen_add_to_stack_pointer(16);
14045
- }
14046
- }
14047
- encode_with_unstable(text, allowed_special, disallowed_special) {
14048
- if (wasm == null)
14049
- throw new Error("tiktoken: WASM binary has not been propery initialized.");
14050
- try {
14051
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
14052
- const ptr0 = passStringToWasm0(text, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
14053
- const len0 = WASM_VECTOR_LEN;
14054
- wasm.tiktoken_encode_with_unstable(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(allowed_special), addHeapObject(disallowed_special));
14055
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
14056
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
14057
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
14058
- if (r2) {
14059
- throw takeObject(r1);
14060
- }
14061
- return takeObject(r0);
14062
- } finally {
14063
- wasm.__wbindgen_add_to_stack_pointer(16);
14064
- }
14065
- }
14066
- encode_single_token(bytes) {
14067
- if (wasm == null)
14068
- throw new Error("tiktoken: WASM binary has not been propery initialized.");
14069
- const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export_1);
14070
- const len0 = WASM_VECTOR_LEN;
14071
- const ret = wasm.tiktoken_encode_single_token(this.__wbg_ptr, ptr0, len0);
14072
- return ret >>> 0;
14073
- }
14074
- decode(tokens) {
14075
- if (wasm == null)
14076
- throw new Error("tiktoken: WASM binary has not been propery initialized.");
14077
- try {
14078
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
14079
- const ptr0 = passArray32ToWasm0(tokens, wasm.__wbindgen_export_1);
14080
- const len0 = WASM_VECTOR_LEN;
14081
- wasm.tiktoken_decode(retptr, this.__wbg_ptr, ptr0, len0);
14082
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
14083
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
14084
- var v2 = getArrayU8FromWasm0(r0, r1).slice();
14085
- wasm.__wbindgen_export_3(r0, r1 * 1, 1);
14086
- return v2;
14087
- } finally {
14088
- wasm.__wbindgen_add_to_stack_pointer(16);
14089
- }
14090
- }
14091
- decode_single_token_bytes(token) {
14092
- if (wasm == null)
14093
- throw new Error("tiktoken: WASM binary has not been propery initialized.");
14094
- try {
14095
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
14096
- wasm.tiktoken_decode_single_token_bytes(retptr, this.__wbg_ptr, token);
14097
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
14098
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
14099
- var v1 = getArrayU8FromWasm0(r0, r1).slice();
14100
- wasm.__wbindgen_export_3(r0, r1 * 1, 1);
14101
- return v1;
14102
- } finally {
14103
- wasm.__wbindgen_add_to_stack_pointer(16);
14104
- }
14105
- }
14106
- token_byte_values() {
14107
- if (wasm == null)
14108
- throw new Error("tiktoken: WASM binary has not been propery initialized.");
14109
- const ret = wasm.tiktoken_token_byte_values(this.__wbg_ptr);
14110
- return takeObject(ret);
14111
- }
14112
- }
14113
- exports.Tiktoken = Tiktoken;
14114
- exports.__wbg_parse_def2e24ef1252aff = function() {
14115
- return handleError(function(arg0, arg1) {
14116
- const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
14117
- return addHeapObject(ret);
14118
- }, arguments);
14119
- };
14120
- exports.__wbg_stringify_f7ed6987935b4a24 = function() {
14121
- return handleError(function(arg0) {
14122
- const ret = JSON.stringify(getObject(arg0));
14123
- return addHeapObject(ret);
14124
- }, arguments);
14125
- };
14126
- exports.__wbindgen_error_new = function(arg0, arg1) {
14127
- const ret = new Error(getStringFromWasm0(arg0, arg1));
14128
- return addHeapObject(ret);
14129
- };
14130
- exports.__wbindgen_is_undefined = function(arg0) {
14131
- const ret = getObject(arg0) === undefined;
14132
- return ret;
14133
- };
14134
- exports.__wbindgen_object_drop_ref = function(arg0) {
14135
- takeObject(arg0);
14136
- };
14137
- exports.__wbindgen_string_get = function(arg0, arg1) {
14138
- if (wasm == null)
14139
- throw new Error("tiktoken: WASM binary has not been propery initialized.");
14140
- const obj = getObject(arg1);
14141
- const ret = typeof obj === "string" ? obj : undefined;
14142
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
14143
- var len1 = WASM_VECTOR_LEN;
14144
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
14145
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
14146
- };
14147
- exports.__wbindgen_throw = function(arg0, arg1) {
14148
- throw new Error(getStringFromWasm0(arg0, arg1));
14149
- };
14150
- });
14151
-
14152
13756
  // node_modules/ajv/lib/refs/data.json
14153
13757
  var require_data = __commonJS((exports, module) => {
14154
13758
  module.exports = {
@@ -15150,8 +14754,8 @@ var require_uri_all = __commonJS((exports, module) => {
15150
14754
  wsComponents.secure = undefined;
15151
14755
  }
15152
14756
  if (wsComponents.resourceName) {
15153
- var _wsComponents$resourc = wsComponents.resourceName.split("?"), _wsComponents$resourc2 = slicedToArray(_wsComponents$resourc, 2), path2 = _wsComponents$resourc2[0], query = _wsComponents$resourc2[1];
15154
- wsComponents.path = path2 && path2 !== "/" ? path2 : undefined;
14757
+ var _wsComponents$resourc = wsComponents.resourceName.split("?"), _wsComponents$resourc2 = slicedToArray(_wsComponents$resourc, 2), path = _wsComponents$resourc2[0], query = _wsComponents$resourc2[1];
14758
+ wsComponents.path = path && path !== "/" ? path : undefined;
15155
14759
  wsComponents.query = query;
15156
14760
  wsComponents.resourceName = undefined;
15157
14761
  }
@@ -15517,12 +15121,12 @@ var require_util3 = __commonJS((exports, module) => {
15517
15121
  return "\'" + escapeQuotes(str2) + "\'";
15518
15122
  };
15519
15123
  var getPathExpr = function(currentPath, expr, jsonPointers, isNumber) {
15520
- var path2 = jsonPointers ? "\'/\' + " + expr + (isNumber ? "" : ".replace(/~/g, \'~0\').replace(/\\//g, \'~1\')") : isNumber ? "\'[\' + " + expr + " + \']\'" : "\'[\\\'\' + " + expr + " + \'\\\']\'";
15521
- return joinPaths(currentPath, path2);
15124
+ var path = jsonPointers ? "\'/\' + " + expr + (isNumber ? "" : ".replace(/~/g, \'~0\').replace(/\\//g, \'~1\')") : isNumber ? "\'[\' + " + expr + " + \']\'" : "\'[\\\'\' + " + expr + " + \'\\\']\'";
15125
+ return joinPaths(currentPath, path);
15522
15126
  };
15523
15127
  var getPath = function(currentPath, prop, jsonPointers) {
15524
- var path2 = jsonPointers ? toQuotedString("/" + escapeJsonPointer(prop)) : toQuotedString(getProperty(prop));
15525
- return joinPaths(currentPath, path2);
15128
+ var path = jsonPointers ? toQuotedString("/" + escapeJsonPointer(prop)) : toQuotedString(getProperty(prop));
15129
+ return joinPaths(currentPath, path);
15526
15130
  };
15527
15131
  var getData = function($data, lvl, paths2) {
15528
15132
  var up, jsonPointer, data, matches;
@@ -20322,7 +19926,7 @@ var require_ajv = __commonJS((exports, module) => {
20322
19926
 
20323
19927
  // node_modules/isexe/windows.js
20324
19928
  var require_windows = __commonJS((exports, module) => {
20325
- var checkPathExt = function(path2, options2) {
19929
+ var checkPathExt = function(path, options2) {
20326
19930
  var pathext = options2.pathExt !== undefined ? options2.pathExt : process.env.PATHEXT;
20327
19931
  if (!pathext) {
20328
19932
  return true;
@@ -20333,40 +19937,40 @@ var require_windows = __commonJS((exports, module) => {
20333
19937
  }
20334
19938
  for (var i = 0;i < pathext.length; i++) {
20335
19939
  var p = pathext[i].toLowerCase();
20336
- if (p && path2.substr(-p.length).toLowerCase() === p) {
19940
+ if (p && path.substr(-p.length).toLowerCase() === p) {
20337
19941
  return true;
20338
19942
  }
20339
19943
  }
20340
19944
  return false;
20341
19945
  };
20342
- var checkStat = function(stat, path2, options2) {
19946
+ var checkStat = function(stat, path, options2) {
20343
19947
  if (!stat.isSymbolicLink() && !stat.isFile()) {
20344
19948
  return false;
20345
19949
  }
20346
- return checkPathExt(path2, options2);
19950
+ return checkPathExt(path, options2);
20347
19951
  };
20348
- var isexe = function(path2, options2, cb) {
20349
- fs15.stat(path2, function(er, stat) {
20350
- cb(er, er ? false : checkStat(stat, path2, options2));
19952
+ var isexe = function(path, options2, cb) {
19953
+ fs14.stat(path, function(er, stat) {
19954
+ cb(er, er ? false : checkStat(stat, path, options2));
20351
19955
  });
20352
19956
  };
20353
- var sync = function(path2, options2) {
20354
- return checkStat(fs15.statSync(path2), path2, options2);
19957
+ var sync = function(path, options2) {
19958
+ return checkStat(fs14.statSync(path), path, options2);
20355
19959
  };
20356
19960
  module.exports = isexe;
20357
19961
  isexe.sync = sync;
20358
- var fs15 = __require("fs");
19962
+ var fs14 = __require("fs");
20359
19963
  });
20360
19964
 
20361
19965
  // node_modules/isexe/mode.js
20362
19966
  var require_mode = __commonJS((exports, module) => {
20363
- var isexe = function(path2, options2, cb) {
20364
- fs15.stat(path2, function(er, stat) {
19967
+ var isexe = function(path, options2, cb) {
19968
+ fs14.stat(path, function(er, stat) {
20365
19969
  cb(er, er ? false : checkStat(stat, options2));
20366
19970
  });
20367
19971
  };
20368
- var sync = function(path2, options2) {
20369
- return checkStat(fs15.statSync(path2), options2);
19972
+ var sync = function(path, options2) {
19973
+ return checkStat(fs14.statSync(path), options2);
20370
19974
  };
20371
19975
  var checkStat = function(stat, options2) {
20372
19976
  return stat.isFile() && checkMode(stat, options2);
@@ -20386,12 +19990,12 @@ var require_mode = __commonJS((exports, module) => {
20386
19990
  };
20387
19991
  module.exports = isexe;
20388
19992
  isexe.sync = sync;
20389
- var fs15 = __require("fs");
19993
+ var fs14 = __require("fs");
20390
19994
  });
20391
19995
 
20392
19996
  // node_modules/isexe/index.js
20393
19997
  var require_isexe = __commonJS((exports, module) => {
20394
- var isexe = function(path2, options2, cb) {
19998
+ var isexe = function(path, options2, cb) {
20395
19999
  if (typeof options2 === "function") {
20396
20000
  cb = options2;
20397
20001
  options2 = {};
@@ -20401,7 +20005,7 @@ var require_isexe = __commonJS((exports, module) => {
20401
20005
  throw new TypeError("callback not provided");
20402
20006
  }
20403
20007
  return new Promise(function(resolve9, reject) {
20404
- isexe(path2, options2 || {}, function(er, is) {
20008
+ isexe(path, options2 || {}, function(er, is) {
20405
20009
  if (er) {
20406
20010
  reject(er);
20407
20011
  } else {
@@ -20410,7 +20014,7 @@ var require_isexe = __commonJS((exports, module) => {
20410
20014
  });
20411
20015
  });
20412
20016
  }
20413
- core(path2, options2 || {}, function(er, is) {
20017
+ core(path, options2 || {}, function(er, is) {
20414
20018
  if (er) {
20415
20019
  if (er.code === "EACCES" || options2 && options2.ignoreErrors) {
20416
20020
  er = null;
@@ -20420,9 +20024,9 @@ var require_isexe = __commonJS((exports, module) => {
20420
20024
  cb(er, is);
20421
20025
  });
20422
20026
  };
20423
- var sync = function(path2, options2) {
20027
+ var sync = function(path, options2) {
20424
20028
  try {
20425
- return core.sync(path2, options2 || {});
20029
+ return core.sync(path, options2 || {});
20426
20030
  } catch (er) {
20427
20031
  if (options2 && options2.ignoreErrors || er.code === "EACCES") {
20428
20032
  return false;
@@ -20431,7 +20035,7 @@ var require_isexe = __commonJS((exports, module) => {
20431
20035
  }
20432
20036
  }
20433
20037
  };
20434
- var fs15 = __require("fs");
20038
+ var fs14 = __require("fs");
20435
20039
  var core;
20436
20040
  if (process.platform === "win32" || global.TESTING_WINDOWS) {
20437
20041
  core = require_windows();
@@ -20445,7 +20049,7 @@ var require_isexe = __commonJS((exports, module) => {
20445
20049
  // node_modules/which/which.js
20446
20050
  var require_which = __commonJS((exports, module) => {
20447
20051
  var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
20448
- var path2 = __require("path");
20052
+ var path = __require("path");
20449
20053
  var COLON = isWindows ? ";" : ":";
20450
20054
  var isexe = require_isexe();
20451
20055
  var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
@@ -20481,7 +20085,7 @@ var require_which = __commonJS((exports, module) => {
20481
20085
  return opt.all && found.length ? resolve9(found) : reject(getNotFoundError(cmd));
20482
20086
  const ppRaw = pathEnv[i];
20483
20087
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
20484
- const pCmd = path2.join(pathPart, cmd);
20088
+ const pCmd = path.join(pathPart, cmd);
20485
20089
  const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
20486
20090
  resolve9(subStep(p, i, 0));
20487
20091
  });
@@ -20508,7 +20112,7 @@ var require_which = __commonJS((exports, module) => {
20508
20112
  for (let i = 0;i < pathEnv.length; i++) {
20509
20113
  const ppRaw = pathEnv[i];
20510
20114
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
20511
- const pCmd = path2.join(pathPart, cmd);
20115
+ const pCmd = path.join(pathPart, cmd);
20512
20116
  const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
20513
20117
  for (let j = 0;j < pathExt.length; j++) {
20514
20118
  const cur = p + pathExt[j];
@@ -20565,7 +20169,7 @@ var require_resolveCommand = __commonJS((exports, module) => {
20565
20169
  try {
20566
20170
  resolved = which.sync(parsed.command, {
20567
20171
  path: env2[getPathKey({ env: env2 })],
20568
- pathExt: withoutPathExt ? path2.delimiter : undefined
20172
+ pathExt: withoutPathExt ? path.delimiter : undefined
20569
20173
  });
20570
20174
  } catch (e) {
20571
20175
  } finally {
@@ -20574,14 +20178,14 @@ var require_resolveCommand = __commonJS((exports, module) => {
20574
20178
  }
20575
20179
  }
20576
20180
  if (resolved) {
20577
- resolved = path2.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
20181
+ resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
20578
20182
  }
20579
20183
  return resolved;
20580
20184
  };
20581
20185
  var resolveCommand = function(parsed) {
20582
20186
  return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
20583
20187
  };
20584
- var path2 = __require("path");
20188
+ var path = __require("path");
20585
20189
  var which = require_which();
20586
20190
  var getPathKey = require_path_key();
20587
20191
  module.exports = resolveCommand;
@@ -20622,8 +20226,8 @@ var require_shebang_command = __commonJS((exports, module) => {
20622
20226
  if (!match) {
20623
20227
  return null;
20624
20228
  }
20625
- const [path2, argument] = match[0].replace(/#! ?/, "").split(" ");
20626
- const binary = path2.split("/").pop();
20229
+ const [path, argument] = match[0].replace(/#! ?/, "").split(" ");
20230
+ const binary = path.split("/").pop();
20627
20231
  if (binary === "env") {
20628
20232
  return argument;
20629
20233
  }
@@ -20638,14 +20242,14 @@ var require_readShebang = __commonJS((exports, module) => {
20638
20242
  const buffer = Buffer.alloc(size);
20639
20243
  let fd;
20640
20244
  try {
20641
- fd = fs15.openSync(command, "r");
20642
- fs15.readSync(fd, buffer, 0, size, 0);
20643
- fs15.closeSync(fd);
20245
+ fd = fs14.openSync(command, "r");
20246
+ fs14.readSync(fd, buffer, 0, size, 0);
20247
+ fs14.closeSync(fd);
20644
20248
  } catch (e) {
20645
20249
  }
20646
20250
  return shebangCommand(buffer.toString());
20647
20251
  };
20648
- var fs15 = __require("fs");
20252
+ var fs14 = __require("fs");
20649
20253
  var shebangCommand = require_shebang_command();
20650
20254
  module.exports = readShebang;
20651
20255
  });
@@ -20670,7 +20274,7 @@ var require_parse3 = __commonJS((exports, module) => {
20670
20274
  const needsShell = !isExecutableRegExp.test(commandFile);
20671
20275
  if (parsed.options.forceShell || needsShell) {
20672
20276
  const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
20673
- parsed.command = path2.normalize(parsed.command);
20277
+ parsed.command = path.normalize(parsed.command);
20674
20278
  parsed.command = escape.command(parsed.command);
20675
20279
  parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
20676
20280
  const shellCommand = [parsed.command].concat(parsed.args).join(" ");
@@ -20699,7 +20303,7 @@ var require_parse3 = __commonJS((exports, module) => {
20699
20303
  };
20700
20304
  return options2.shell ? parsed : parseNonShell(parsed);
20701
20305
  };
20702
- var path2 = __require("path");
20306
+ var path = __require("path");
20703
20307
  var resolveCommand = require_resolveCommand();
20704
20308
  var escape = require_escape();
20705
20309
  var readShebang = require_readShebang();
@@ -23862,9 +23466,9 @@ import {resolve as resolve7} from "path";
23862
23466
  // node_modules/contextcalc/dist/lib/index.js
23863
23467
  async function isBinaryFile(filePath) {
23864
23468
  try {
23865
- const fs8 = await import("node:fs/promises");
23469
+ const fs7 = await import("node:fs/promises");
23866
23470
  const buffer = Buffer.alloc(1024);
23867
- const fd = await fs8.open(filePath, "r");
23471
+ const fd = await fs7.open(filePath, "r");
23868
23472
  try {
23869
23473
  const { bytesRead } = await fd.read(buffer, 0, 1024, 0);
23870
23474
  for (let i = 0;i < bytesRead; i++) {
@@ -23884,47 +23488,13 @@ async function isBinaryFile(filePath) {
23884
23488
  var estimateBinaryTokens = function(sizeInBytes) {
23885
23489
  return Math.ceil(sizeInBytes / 4);
23886
23490
  };
23887
-
23888
- // node_modules/tiktoken/tiktoken.cjs
23889
- var __dirname = "/home/runner/work/agentinit/agentinit/node_modules/tiktoken";
23890
- var wasm = require_tiktoken_bg();
23891
- var imports = {};
23892
- imports["./tiktoken_bg.js"] = wasm;
23893
- var path = __require("path");
23894
- var fs7 = __require("fs");
23895
- var candidates = __dirname.split(path.sep).reduce((memo, _, index, array) => {
23896
- const prefix = array.slice(0, index + 1).join(path.sep) + path.sep;
23897
- if (!prefix.includes("node_modules" + path.sep)) {
23898
- memo.unshift(path.join(prefix, "node_modules", "tiktoken", "", "./tiktoken_bg.wasm"));
23899
- }
23900
- return memo;
23901
- }, []);
23902
- candidates.unshift(path.join(__dirname, "./tiktoken_bg.wasm"));
23903
- var bytes = null;
23904
- for (const candidate of candidates) {
23905
- try {
23906
- bytes = fs7.readFileSync(candidate);
23907
- break;
23908
- } catch {
23909
- }
23910
- }
23911
- if (bytes == null)
23912
- throw new Error("Missing tiktoken_bg.wasm");
23913
- var wasmModule = new WebAssembly.Module(bytes);
23914
- var wasmInstance = new WebAssembly.Instance(wasmModule, imports);
23915
- wasm.__wbg_set_wasm(wasmInstance.exports);
23916
- var $get_encoding = wasm["get_encoding"];
23917
- var $encoding_for_model = wasm["encoding_for_model"];
23918
- var $get_encoding_name_for_model = wasm["get_encoding_name_for_model"];
23919
- var $Tiktoken = wasm["Tiktoken"];
23920
-
23921
- // node_modules/contextcalc/dist/lib/index.js
23491
+ import {get_encoding} from "tiktoken";
23922
23492
  var initializeTiktoken = function() {
23923
23493
  if (tiktokenInstance) {
23924
23494
  return tiktokenInstance;
23925
23495
  }
23926
23496
  try {
23927
- const encoding = $get_encoding(ENCODING_NAME);
23497
+ const encoding = get_encoding(ENCODING_NAME);
23928
23498
  try {
23929
23499
  encoding.encode("test");
23930
23500
  } catch (validationError) {
@@ -24117,15 +23687,15 @@ class Tokenizer {
24117
23687
  }
24118
23688
  async countTokens(filePath) {
24119
23689
  try {
24120
- const fs8 = await import("node:fs/promises");
24121
- const stats = await fs8.stat(filePath);
23690
+ const fs7 = await import("node:fs/promises");
23691
+ const stats = await fs7.stat(filePath);
24122
23692
  if (await isBinaryFile(filePath)) {
24123
23693
  return {
24124
23694
  tokens: estimateBinaryTokens(stats.size),
24125
23695
  lines: 0
24126
23696
  };
24127
23697
  }
24128
- const content = await fs8.readFile(filePath, "utf8");
23698
+ const content = await fs7.readFile(filePath, "utf8");
24129
23699
  const tokens = this.countTokensFromText(content);
24130
23700
  const lines = this.countLines(content);
24131
23701
  return { tokens, lines };
@@ -26337,8 +25907,8 @@ function addIssueToContext(ctx, issueData) {
26337
25907
  ctx.common.issues.push(issue);
26338
25908
  }
26339
25909
  var makeIssue = (params) => {
26340
- const { data, path: path2, errorMaps, issueData } = params;
26341
- const fullPath = [...path2, ...issueData.path || []];
25910
+ const { data, path, errorMaps, issueData } = params;
25911
+ const fullPath = [...path, ...issueData.path || []];
26342
25912
  const fullIssue = {
26343
25913
  ...issueData,
26344
25914
  path: fullPath
@@ -26627,11 +26197,11 @@ function custom(check, _params = {}, fatal) {
26627
26197
  }
26628
26198
 
26629
26199
  class ParseInputLazyPath {
26630
- constructor(parent, value, path2, key) {
26200
+ constructor(parent, value, path, key) {
26631
26201
  this._cachedPath = [];
26632
26202
  this.parent = parent;
26633
26203
  this.data = value;
26634
- this._path = path2;
26204
+ this._path = path;
26635
26205
  this._key = key;
26636
26206
  }
26637
26207
  get path() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentinit",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "A CLI tool for managing and configuring AI coding agents",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -8,7 +8,7 @@
8
8
  "agentinit": "dist/index.js"
9
9
  },
10
10
  "scripts": {
11
- "build": "bun build src/index.ts --outdir dist --target node && cp -r src/templates dist/",
11
+ "build": "bun build src/index.ts --outdir dist --target node --external tiktoken && cp -r src/templates dist/",
12
12
  "dev": "bun run src/index.ts",
13
13
  "test": "vitest run",
14
14
  "test:watch": "vitest",
Binary file