@lotics/app-sdk 0.124.9 → 0.124.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-YONY7UPS.js → chunk-BNJZBF6D.js} +3 -3
- package/dist/index.js +134 -66
- package/dist/router.d.ts +1 -1
- package/dist/router.js +1 -1
- package/docs/ai.md +1 -1
- package/docs/data_fetching.md +2 -2
- package/docs/mutations.md +1 -1
- package/docs/runtime.md +1 -1
- package/package.json +14 -12
|
@@ -193,7 +193,7 @@ function searchWords(value) {
|
|
|
193
193
|
return (typeof value === "string" ? [value] : value).map((word) => word.trim()).filter((word) => foldSearchText(word).trim() !== "");
|
|
194
194
|
}
|
|
195
195
|
|
|
196
|
-
//
|
|
196
|
+
// ../shared/node_modules/nanoid/index.browser.js
|
|
197
197
|
var random = (bytes) => crypto.getRandomValues(new Uint8Array(bytes));
|
|
198
198
|
var customRandom = (alphabet, defaultSize, getRandom) => {
|
|
199
199
|
let safeByteCutoff = 256 - 256 % alphabet.length;
|
|
@@ -204,7 +204,7 @@ var customRandom = (alphabet, defaultSize, getRandom) => {
|
|
|
204
204
|
let id = "";
|
|
205
205
|
while (true) {
|
|
206
206
|
let bytes = getRandom(size);
|
|
207
|
-
let j = size;
|
|
207
|
+
let j = size |= 0;
|
|
208
208
|
while (j--) {
|
|
209
209
|
id += alphabet[bytes[j] & mask];
|
|
210
210
|
if (id.length >= size) return id;
|
|
@@ -212,10 +212,10 @@ var customRandom = (alphabet, defaultSize, getRandom) => {
|
|
|
212
212
|
}
|
|
213
213
|
};
|
|
214
214
|
}
|
|
215
|
-
let step = Math.ceil(1.6 * 256 * defaultSize / safeByteCutoff);
|
|
216
215
|
return (size = defaultSize) => {
|
|
217
216
|
if (!size) return "";
|
|
218
217
|
let id = "";
|
|
218
|
+
let step = Math.ceil(1.6 * 256 * size / safeByteCutoff);
|
|
219
219
|
while (true) {
|
|
220
220
|
let bytes = getRandom(step);
|
|
221
221
|
let j = step;
|
package/dist/index.js
CHANGED
|
@@ -49,7 +49,7 @@ import {
|
|
|
49
49
|
subtractDecimal,
|
|
50
50
|
sumDecimal,
|
|
51
51
|
urlParam
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-BNJZBF6D.js";
|
|
53
53
|
|
|
54
54
|
// src/mount.tsx
|
|
55
55
|
import { createRoot } from "react-dom/client";
|
|
@@ -2724,36 +2724,64 @@ function isUsableLocale(locale) {
|
|
|
2724
2724
|
}
|
|
2725
2725
|
}
|
|
2726
2726
|
|
|
2727
|
+
// ../../node_modules/@noble/hashes/_u64.js
|
|
2728
|
+
var fromNumH = (n) => n / 2 ** 32 | 0;
|
|
2729
|
+
var fromNumL = (n) => n >>> 0;
|
|
2730
|
+
function setU64FromNum(view, byteOffset, n, isLE) {
|
|
2731
|
+
const h = fromNumH(n);
|
|
2732
|
+
const l = fromNumL(n);
|
|
2733
|
+
view.setUint32(byteOffset, isLE ? l : h, isLE);
|
|
2734
|
+
view.setUint32(byteOffset + 4, isLE ? h : l, isLE);
|
|
2735
|
+
}
|
|
2736
|
+
|
|
2727
2737
|
// ../../node_modules/@noble/hashes/utils.js
|
|
2728
2738
|
function isBytes(a) {
|
|
2729
2739
|
return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array" && "BYTES_PER_ELEMENT" in a && a.BYTES_PER_ELEMENT === 1;
|
|
2730
2740
|
}
|
|
2741
|
+
var atitle = (title) => title ? `"${title}" ` : "";
|
|
2742
|
+
function anumber(n, title = "") {
|
|
2743
|
+
if (typeof n !== "number")
|
|
2744
|
+
throw new TypeError(atitle(title) + "expected number, got " + typeof n);
|
|
2745
|
+
if (!Number.isSafeInteger(n) || n < 0)
|
|
2746
|
+
throw new RangeError(atitle(title) + "expected integer >= 0, got " + n);
|
|
2747
|
+
return n;
|
|
2748
|
+
}
|
|
2731
2749
|
function abytes(value, length2, title = "") {
|
|
2750
|
+
if (isBytes(value) && (length2 === void 0 || value.length === length2))
|
|
2751
|
+
return value;
|
|
2752
|
+
if (length2 !== void 0)
|
|
2753
|
+
anumber(length2, "length");
|
|
2732
2754
|
const bytes = isBytes(value);
|
|
2733
|
-
const
|
|
2734
|
-
const
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
throw new
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2755
|
+
const ofLen = length2 !== void 0 ? ` of length ${length2}` : "";
|
|
2756
|
+
const got = bytes ? `length=${value.length}` : `type=${typeof value}`;
|
|
2757
|
+
const message2 = atitle(title) + "expected Uint8Array" + ofLen + ", got " + got;
|
|
2758
|
+
if (!bytes)
|
|
2759
|
+
throw new TypeError(message2);
|
|
2760
|
+
throw new RangeError(message2);
|
|
2761
|
+
}
|
|
2762
|
+
var aobject = (value, label) => {
|
|
2763
|
+
if (value === null || typeof value !== "object" || Array.isArray(value))
|
|
2764
|
+
throw new TypeError((label === "object" ? "" : `"${label}" `) + "expected object, got type=" + typeof value);
|
|
2765
|
+
};
|
|
2766
|
+
var aopts = (value, label) => {
|
|
2767
|
+
aobject(value, label);
|
|
2768
|
+
const proto = Object.getPrototypeOf(value);
|
|
2769
|
+
if (proto !== Object.prototype && proto !== null)
|
|
2770
|
+
throw new TypeError(`"${label}" expected plain object`);
|
|
2771
|
+
if (Object.hasOwn(value, "__proto__"))
|
|
2772
|
+
throw new TypeError(`"${label}.__proto__" is not allowed`);
|
|
2773
|
+
};
|
|
2746
2774
|
function aexists(instance, checkFinished = true) {
|
|
2747
2775
|
if (instance.destroyed)
|
|
2748
|
-
throw new Error("
|
|
2776
|
+
throw new Error("hash was destroyed");
|
|
2749
2777
|
if (checkFinished && instance.finished)
|
|
2750
|
-
throw new Error("
|
|
2778
|
+
throw new Error("digest() was already called");
|
|
2751
2779
|
}
|
|
2752
2780
|
function aoutput(out, instance) {
|
|
2753
|
-
abytes(out, void 0, "
|
|
2781
|
+
abytes(out, void 0, "output");
|
|
2754
2782
|
const min3 = instance.outputLen;
|
|
2755
|
-
if (out.length
|
|
2756
|
-
throw new RangeError('"
|
|
2783
|
+
if (!(out.length >= min3)) {
|
|
2784
|
+
throw new RangeError('"output" expected length >= ' + min3);
|
|
2757
2785
|
}
|
|
2758
2786
|
}
|
|
2759
2787
|
function clean(...arrays) {
|
|
@@ -2782,15 +2810,8 @@ function bytesToHex(bytes) {
|
|
|
2782
2810
|
}
|
|
2783
2811
|
return hex;
|
|
2784
2812
|
}
|
|
2785
|
-
var asciis = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };
|
|
2786
2813
|
function asciiToBase16(ch) {
|
|
2787
|
-
|
|
2788
|
-
return ch - asciis._0;
|
|
2789
|
-
if (ch >= asciis.A && ch <= asciis.F)
|
|
2790
|
-
return ch - (asciis.A - 10);
|
|
2791
|
-
if (ch >= asciis.a && ch <= asciis.f)
|
|
2792
|
-
return ch - (asciis.a - 10);
|
|
2793
|
-
return;
|
|
2814
|
+
return ch >= 48 && ch <= 57 ? ch - 48 : ch >= 65 && ch <= 70 ? ch - (65 - 10) : ch >= 97 && ch <= 102 ? ch - (97 - 10) : void 0;
|
|
2794
2815
|
}
|
|
2795
2816
|
function hexToBytes(hex) {
|
|
2796
2817
|
if (typeof hex !== "string")
|
|
@@ -2823,7 +2844,12 @@ function hexToBytes(hex) {
|
|
|
2823
2844
|
function utf8ToBytes(str) {
|
|
2824
2845
|
if (typeof str !== "string")
|
|
2825
2846
|
throw new TypeError("string expected");
|
|
2826
|
-
|
|
2847
|
+
const encoded = new TextEncoder().encode(str);
|
|
2848
|
+
try {
|
|
2849
|
+
return new Uint8Array(encoded);
|
|
2850
|
+
} finally {
|
|
2851
|
+
clean(encoded);
|
|
2852
|
+
}
|
|
2827
2853
|
}
|
|
2828
2854
|
function concatBytes(...arrays) {
|
|
2829
2855
|
let sum2 = 0;
|
|
@@ -2840,7 +2866,17 @@ function concatBytes(...arrays) {
|
|
|
2840
2866
|
}
|
|
2841
2867
|
return res;
|
|
2842
2868
|
}
|
|
2869
|
+
function checkOpts(defaults, opts, title = "opts") {
|
|
2870
|
+
aopts(defaults, "defaults");
|
|
2871
|
+
if (opts !== void 0)
|
|
2872
|
+
aopts(opts, title);
|
|
2873
|
+
const merged = Object.assign(/* @__PURE__ */ Object.create(null), defaults, opts);
|
|
2874
|
+
return merged;
|
|
2875
|
+
}
|
|
2843
2876
|
function createHasher(hashCons, info = {}) {
|
|
2877
|
+
if (typeof hashCons !== "function")
|
|
2878
|
+
throw new TypeError('"hashCons" expected function, got type=' + typeof hashCons);
|
|
2879
|
+
info = checkOpts({}, info, "info");
|
|
2844
2880
|
const hashC = (msg, opts) => hashCons(opts).update(msg).digest();
|
|
2845
2881
|
const tmp = hashCons(void 0);
|
|
2846
2882
|
hashC.outputLen = tmp.outputLen;
|
|
@@ -2884,24 +2920,28 @@ var HashMD = class {
|
|
|
2884
2920
|
abytes(data);
|
|
2885
2921
|
const { view, buffer, blockLen } = this;
|
|
2886
2922
|
const len = data.length;
|
|
2923
|
+
let processed = false;
|
|
2887
2924
|
for (let pos = 0; pos < len; ) {
|
|
2888
2925
|
const take = Math.min(blockLen - this.pos, len - pos);
|
|
2889
2926
|
if (take === blockLen) {
|
|
2890
2927
|
const dataView = createView(data);
|
|
2891
2928
|
for (; blockLen <= len - pos; pos += blockLen)
|
|
2892
2929
|
this.process(dataView, pos);
|
|
2930
|
+
processed = true;
|
|
2893
2931
|
continue;
|
|
2894
2932
|
}
|
|
2895
|
-
buffer.set(data.subarray(pos, pos + take), this.pos);
|
|
2933
|
+
buffer.set(pos === 0 && take === len ? data : data.subarray(pos, pos + take), this.pos);
|
|
2896
2934
|
this.pos += take;
|
|
2897
2935
|
pos += take;
|
|
2898
2936
|
if (this.pos === blockLen) {
|
|
2899
2937
|
this.process(view, 0);
|
|
2900
2938
|
this.pos = 0;
|
|
2939
|
+
processed = true;
|
|
2901
2940
|
}
|
|
2902
2941
|
}
|
|
2903
2942
|
this.length += data.length;
|
|
2904
|
-
|
|
2943
|
+
if (processed)
|
|
2944
|
+
this.roundClean();
|
|
2905
2945
|
return this;
|
|
2906
2946
|
}
|
|
2907
2947
|
digestInto(out) {
|
|
@@ -2911,23 +2951,20 @@ var HashMD = class {
|
|
|
2911
2951
|
const { buffer, view, blockLen, isLE } = this;
|
|
2912
2952
|
let { pos } = this;
|
|
2913
2953
|
buffer[pos++] = 128;
|
|
2914
|
-
|
|
2954
|
+
buffer.fill(0, pos);
|
|
2915
2955
|
if (this.padOffset > blockLen - pos) {
|
|
2916
2956
|
this.process(view, 0);
|
|
2917
|
-
|
|
2957
|
+
buffer.fill(0);
|
|
2918
2958
|
}
|
|
2919
|
-
|
|
2920
|
-
buffer[i] = 0;
|
|
2921
|
-
view.setBigUint64(blockLen - 8, BigInt(this.length * 8), isLE);
|
|
2959
|
+
setU64FromNum(view, blockLen - 8, this.length * 8, isLE);
|
|
2922
2960
|
this.process(view, 0);
|
|
2923
|
-
|
|
2961
|
+
this.roundClean();
|
|
2962
|
+
const oview = out === buffer ? view : createView(out);
|
|
2924
2963
|
const len = this.outputLen;
|
|
2925
|
-
if (len % 4)
|
|
2926
|
-
throw new Error("_sha2: outputLen must be aligned to 32bit");
|
|
2927
2964
|
const outLen = len / 4;
|
|
2928
2965
|
const state = this.get();
|
|
2929
|
-
if (outLen > state.length)
|
|
2930
|
-
throw new Error("
|
|
2966
|
+
if (len % 4 || outLen > state.length)
|
|
2967
|
+
throw new Error("invalid outputLen");
|
|
2931
2968
|
for (let i = 0; i < outLen; i++)
|
|
2932
2969
|
oview.setUint32(4 * i, state[i], isLE);
|
|
2933
2970
|
}
|
|
@@ -2938,15 +2975,13 @@ var HashMD = class {
|
|
|
2938
2975
|
this.destroy();
|
|
2939
2976
|
return res;
|
|
2940
2977
|
}
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
to.set(...this.get());
|
|
2944
|
-
const { blockLen, buffer, length: length2, finished, destroyed, pos } = this;
|
|
2978
|
+
_cloneIntoMeta(to) {
|
|
2979
|
+
const { buffer, length: length2, finished, destroyed, pos } = this;
|
|
2945
2980
|
to.destroyed = destroyed;
|
|
2946
2981
|
to.finished = finished;
|
|
2947
2982
|
to.length = length2;
|
|
2948
2983
|
to.pos = pos;
|
|
2949
|
-
if (
|
|
2984
|
+
if (pos)
|
|
2950
2985
|
to.buffer.set(buffer);
|
|
2951
2986
|
return to;
|
|
2952
2987
|
}
|
|
@@ -2984,6 +3019,10 @@ var _SHA1 = class extends HashMD {
|
|
|
2984
3019
|
this.D = D | 0;
|
|
2985
3020
|
this.E = E | 0;
|
|
2986
3021
|
}
|
|
3022
|
+
_cloneInto(to) {
|
|
3023
|
+
(to ||= new this.constructor()).set(...this.get());
|
|
3024
|
+
return this._cloneIntoMeta(to);
|
|
3025
|
+
}
|
|
2987
3026
|
process(view, offset) {
|
|
2988
3027
|
for (let i = 0; i < 16; i++, offset += 4)
|
|
2989
3028
|
SHA1_W[i] = view.getUint32(offset, false);
|
|
@@ -5832,8 +5871,7 @@ var TZDateMini = class _TZDateMini extends Date {
|
|
|
5832
5871
|
this.setTime(+args[0]);
|
|
5833
5872
|
} else {
|
|
5834
5873
|
this.setTime(+new Date(...args));
|
|
5835
|
-
adjustToSystemTZ(this,
|
|
5836
|
-
syncToInternal(this);
|
|
5874
|
+
adjustToSystemTZ(this, args);
|
|
5837
5875
|
}
|
|
5838
5876
|
}
|
|
5839
5877
|
}
|
|
@@ -5851,7 +5889,7 @@ var TZDateMini = class _TZDateMini extends Date {
|
|
|
5851
5889
|
}
|
|
5852
5890
|
//#endregion
|
|
5853
5891
|
//#region time
|
|
5854
|
-
setTime(
|
|
5892
|
+
setTime(_time) {
|
|
5855
5893
|
Date.prototype.setTime.apply(this, arguments);
|
|
5856
5894
|
syncToInternal(this);
|
|
5857
5895
|
return +this;
|
|
@@ -5887,49 +5925,79 @@ Object.getOwnPropertyNames(Date.prototype).forEach((method) => {
|
|
|
5887
5925
|
});
|
|
5888
5926
|
function syncToInternal(date2) {
|
|
5889
5927
|
date2.internal.setTime(+date2);
|
|
5890
|
-
date2.internal.setUTCSeconds(date2.internal.getUTCSeconds() -
|
|
5928
|
+
date2.internal.setUTCSeconds(date2.internal.getUTCSeconds() - // Round after converting minutes to seconds to avoid fractional offset
|
|
5929
|
+
// precision errors from historical offsets.
|
|
5930
|
+
Math.round(-tzOffset(date2.timeZone, date2) * 60));
|
|
5891
5931
|
}
|
|
5892
5932
|
function syncFromInternal(date2) {
|
|
5893
5933
|
Date.prototype.setFullYear.call(date2, date2.internal.getUTCFullYear(), date2.internal.getUTCMonth(), date2.internal.getUTCDate());
|
|
5894
5934
|
Date.prototype.setHours.call(date2, date2.internal.getUTCHours(), date2.internal.getUTCMinutes(), date2.internal.getUTCSeconds(), date2.internal.getUTCMilliseconds());
|
|
5895
5935
|
adjustToSystemTZ(date2);
|
|
5896
5936
|
}
|
|
5897
|
-
function adjustToSystemTZ(date2) {
|
|
5898
|
-
const
|
|
5899
|
-
const
|
|
5937
|
+
function adjustToSystemTZ(date2, constructorArgs) {
|
|
5938
|
+
const expectedInternalTime = Array.isArray(constructorArgs) ? constructorArgsToInternalTime(constructorArgs) : +date2.internal;
|
|
5939
|
+
const offsetWithSeconds = tzOffset(date2.timeZone, date2);
|
|
5940
|
+
const offset = offsetWithSeconds > 0 ? Math.floor(offsetWithSeconds) : Math.ceil(offsetWithSeconds);
|
|
5900
5941
|
const prevHour = /* @__PURE__ */ new Date(+date2);
|
|
5901
5942
|
prevHour.setUTCHours(prevHour.getUTCHours() - 1);
|
|
5902
5943
|
const systemOffset = -(/* @__PURE__ */ new Date(+date2)).getTimezoneOffset();
|
|
5903
5944
|
const prevHourSystemOffset = -(/* @__PURE__ */ new Date(+prevHour)).getTimezoneOffset();
|
|
5904
5945
|
const systemDSTChange = systemOffset - prevHourSystemOffset;
|
|
5905
|
-
|
|
5906
|
-
if (systemDSTChange &&
|
|
5907
|
-
|
|
5908
|
-
|
|
5946
|
+
let systemOffsetForDiff = systemOffset;
|
|
5947
|
+
if (systemDSTChange && systemOffset !== offset) {
|
|
5948
|
+
const systemHour = Date.prototype.getHours.apply(date2);
|
|
5949
|
+
const expectedHour = Array.isArray(constructorArgs) ? constructorArgs[3] || 0 : date2.internal.getUTCHours();
|
|
5950
|
+
if (systemHour !== expectedHour) {
|
|
5951
|
+
const testDate = /* @__PURE__ */ new Date(+date2);
|
|
5952
|
+
const testOffsetDiff = systemOffset - offset;
|
|
5953
|
+
if (testOffsetDiff) testDate.setUTCMinutes(testDate.getUTCMinutes() + testOffsetDiff);
|
|
5954
|
+
const testOffsetWithSeconds = tzOffset(date2.timeZone, testDate);
|
|
5955
|
+
const testOffset = testOffsetWithSeconds > 0 ? Math.floor(testOffsetWithSeconds) : Math.ceil(testOffsetWithSeconds);
|
|
5956
|
+
if (testOffset === offset) systemOffsetForDiff = prevHourSystemOffset;
|
|
5957
|
+
}
|
|
5958
|
+
}
|
|
5959
|
+
const offsetDiff = systemOffsetForDiff - offset;
|
|
5960
|
+
if (offsetDiff)
|
|
5961
|
+
Date.prototype.setUTCMinutes.call(date2, Date.prototype.getUTCMinutes.call(date2) + offsetDiff);
|
|
5909
5962
|
const systemDate = /* @__PURE__ */ new Date(+date2);
|
|
5910
5963
|
systemDate.setUTCSeconds(0);
|
|
5911
5964
|
const systemSecondsOffset = systemOffset > 0 ? systemDate.getSeconds() : (systemDate.getSeconds() - 60) % 60;
|
|
5912
5965
|
const secondsOffset = Math.round(-(tzOffset(date2.timeZone, date2) * 60)) % 60;
|
|
5913
|
-
if (secondsOffset || systemSecondsOffset)
|
|
5914
|
-
date2.internal.setUTCSeconds(date2.internal.getUTCSeconds() + secondsOffset);
|
|
5966
|
+
if (secondsOffset || systemSecondsOffset)
|
|
5915
5967
|
Date.prototype.setUTCSeconds.call(date2, Date.prototype.getUTCSeconds.call(date2) + secondsOffset + systemSecondsOffset);
|
|
5916
|
-
|
|
5917
|
-
const
|
|
5918
|
-
const postOffset = postBaseOffset > 0 ? Math.floor(postBaseOffset) : Math.ceil(postBaseOffset);
|
|
5968
|
+
const postOffsetWithSeconds = tzOffset(date2.timeZone, date2);
|
|
5969
|
+
const postOffset = postOffsetWithSeconds > 0 ? Math.floor(postOffsetWithSeconds) : Math.ceil(postOffsetWithSeconds);
|
|
5919
5970
|
const postSystemOffset = -(/* @__PURE__ */ new Date(+date2)).getTimezoneOffset();
|
|
5920
5971
|
const postOffsetDiff = postSystemOffset - postOffset;
|
|
5921
5972
|
const offsetChanged = postOffset !== offset;
|
|
5922
5973
|
const postDiff = postOffsetDiff - offsetDiff;
|
|
5923
|
-
|
|
5974
|
+
const targetDSTShift = postOffset - offset;
|
|
5975
|
+
const postOffsetCandidate = expectedInternalTime - postOffset * 60 * 1e3;
|
|
5976
|
+
const normalizedTargetDSTGap = targetDSTShift > 0 && targetInternalTime(date2) - expectedInternalTime === targetDSTShift * 60 * 1e3 && targetInternalTime(date2, postOffsetCandidate) !== expectedInternalTime;
|
|
5977
|
+
if (offsetChanged && postDiff && !normalizedTargetDSTGap) {
|
|
5924
5978
|
Date.prototype.setUTCMinutes.call(date2, Date.prototype.getUTCMinutes.call(date2) + postDiff);
|
|
5925
|
-
const
|
|
5926
|
-
const newOffset =
|
|
5979
|
+
const newOffsetWithSeconds = tzOffset(date2.timeZone, date2);
|
|
5980
|
+
const newOffset = newOffsetWithSeconds > 0 ? Math.floor(newOffsetWithSeconds) : Math.ceil(newOffsetWithSeconds);
|
|
5927
5981
|
const offsetChange = postOffset - newOffset;
|
|
5928
|
-
if (offsetChange) {
|
|
5929
|
-
date2.internal.setUTCMinutes(date2.internal.getUTCMinutes() + offsetChange);
|
|
5982
|
+
if (offsetChange && postDiff < 0) {
|
|
5930
5983
|
Date.prototype.setUTCMinutes.call(date2, Date.prototype.getUTCMinutes.call(date2) + offsetChange);
|
|
5931
5984
|
}
|
|
5932
5985
|
}
|
|
5986
|
+
syncToInternal(date2);
|
|
5987
|
+
const expectedTime = constructorArgs ? expectedInternalTime : expectedInternalTime + secondsOffset * 1e3;
|
|
5988
|
+
const drift = expectedTime - +date2.internal;
|
|
5989
|
+
if (drift && Math.abs(drift) < 30 * 60 * 1e3) {
|
|
5990
|
+
Date.prototype.setTime.call(date2, +date2 + drift);
|
|
5991
|
+
syncToInternal(date2);
|
|
5992
|
+
}
|
|
5993
|
+
}
|
|
5994
|
+
function constructorArgsToInternalTime(args) {
|
|
5995
|
+
return Date.UTC(args[0], args.length > 1 ? args[1] : 0, args.length > 2 ? args[2] : 1, ...args.slice(3));
|
|
5996
|
+
}
|
|
5997
|
+
function targetInternalTime(date2, time) {
|
|
5998
|
+
const internal = new Date(time ?? +date2);
|
|
5999
|
+
internal.setUTCSeconds(internal.getUTCSeconds() - Math.round(-tzOffset(date2.timeZone, internal) * 60));
|
|
6000
|
+
return +internal;
|
|
5933
6001
|
}
|
|
5934
6002
|
|
|
5935
6003
|
// ../../node_modules/@date-fns/tz/date/index.js
|
package/dist/router.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export interface NotFoundWords {
|
|
|
4
4
|
message: (path: string) => string;
|
|
5
5
|
firstScreen: string;
|
|
6
6
|
}
|
|
7
|
-
export declare function AppRouter({ routes, notFound, drawers }: {
|
|
7
|
+
export declare function AppRouter({ routes, notFound, drawers, }: {
|
|
8
8
|
routes: RouteObject[];
|
|
9
9
|
notFound?: NotFoundWords;
|
|
10
10
|
/** The query keys a drawer opens at, the one drawn lowest first: each open counts as a screen over the path's. */
|
package/dist/router.js
CHANGED
package/docs/ai.md
CHANGED
|
@@ -13,7 +13,7 @@ Don't run a structured extraction through `askAi` (the result is stranded in a c
|
|
|
13
13
|
|
|
14
14
|
## Declared agents — what `useAgentRun` runs
|
|
15
15
|
|
|
16
|
-
`useAgentRun` runs an agent already bound to the app; none can be added, changed or removed any more. A new job for an agent is a declared Query or Workflow node of the app, which an outside agent runs with `run_app_query` and `run_app_workflow`. `.lotics/app_agents.d.ts`, generated from the app's live bindings by `lotics app
|
|
16
|
+
`useAgentRun` runs an agent already bound to the app; none can be added, changed or removed any more. A new job for an agent is a declared Query or Workflow node of the app, which an outside agent runs with `run_app_query` and `run_app_workflow`. `.lotics/app_agents.d.ts`, generated from the app's live bindings by `lotics app deploy` and `lotics app pull`, types `useAgentRun("<alias>")` by the agent's input and output shapes.
|
|
17
17
|
|
|
18
18
|
---
|
|
19
19
|
|
package/docs/data_fetching.md
CHANGED
|
@@ -11,8 +11,8 @@ alias** (bound with `set_app_queries`) and fills the template's declared `{{para
|
|
|
11
11
|
value holes; the server holds the canonical AST and runs it under the **app owner's** authority
|
|
12
12
|
([./security.md](./security.md)). The generated `.lotics/app_queries.d.ts` augments `AppQueries`,
|
|
13
13
|
so params are typed per the binding; an alias it does not carry is accepted as a plain string,
|
|
14
|
-
untyped. It is written from the app's live bindings by `lotics app
|
|
15
|
-
`lotics app
|
|
14
|
+
untyped. It is written from the app's live bindings by `lotics app deploy` and
|
|
15
|
+
`lotics app pull`. Every hook reads through the SDK's own cache, over the host RPC bridge.
|
|
16
16
|
|
|
17
17
|
## Choosing a read
|
|
18
18
|
|
package/docs/mutations.md
CHANGED
|
@@ -41,7 +41,7 @@ render: one callable per alias, each run exactly as `useWorkflow`'s.
|
|
|
41
41
|
|
|
42
42
|
Typing comes from `.lotics/app_workflows.d.ts`, which augments the SDK's `AppWorkflows` and
|
|
43
43
|
`AppWorkflowResults` interfaces from the app's bound declarations. The declarations are generated from the app's live bindings into `.lotics/` by
|
|
44
|
-
`lotics app
|
|
44
|
+
`lotics app deploy` and `lotics app pull`. The result:
|
|
45
45
|
|
|
46
46
|
| Declaration | Call-site type |
|
|
47
47
|
|---|---|
|
package/docs/runtime.md
CHANGED
|
@@ -18,7 +18,7 @@ mount(<App />);
|
|
|
18
18
|
`dist/mount.d.ts`) is called **once** from the app's entry file. It:
|
|
19
19
|
|
|
20
20
|
1. **Registers the mock fixture**, if `options.fixture` was passed (below).
|
|
21
|
-
2. **Finds or creates `#root`.** Uses the `<div id="root">` from the
|
|
21
|
+
2. **Finds or creates `#root`.** Uses the `<div id="root">` from the app's
|
|
22
22
|
`index.html`; if the bundler didn't ship one, it creates and appends it.
|
|
23
23
|
3. **Installs visible error handlers.** `window` `error` and
|
|
24
24
|
`unhandledrejection` listeners render a fixed red monospace banner (message +
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lotics/app-sdk",
|
|
3
|
-
"version": "0.124.
|
|
3
|
+
"version": "0.124.10",
|
|
4
4
|
"description": "The SDK a Lotics custom-code app reads and writes through — typed hooks over the host bridge, cell readers, mount() and AppRouter",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
"build": "tsgo -p tsconfig.build.json && node scripts/build_sdk.mjs",
|
|
27
27
|
"lint": "oxlint",
|
|
28
28
|
"test": "vitest run",
|
|
29
|
-
"typecheck": "
|
|
29
|
+
"typecheck": "tsrs --noEmit",
|
|
30
30
|
"prepack": "npm run build"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"ai": "^7.0.
|
|
33
|
+
"ai": "^7.0.152"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"react": "^19.2.0",
|
|
@@ -39,17 +39,19 @@
|
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@lotics/shared": "*",
|
|
42
|
-
"@testing-library/react": "^16.3.
|
|
43
|
-
"@types/
|
|
44
|
-
"@types/react
|
|
42
|
+
"@testing-library/react": "^16.3.3",
|
|
43
|
+
"@types/node": "^24.19.2",
|
|
44
|
+
"@types/react": "^19.3.0",
|
|
45
|
+
"@types/react-dom": "~19.3.0",
|
|
46
|
+
"@typescript/native-preview": "^7.0.0-dev.20260707.2",
|
|
45
47
|
"@vitejs/plugin-react": "^6.1.2",
|
|
46
|
-
"esbuild": "^0.28.
|
|
47
|
-
"jsdom": "^30.1.
|
|
48
|
-
"react": "^19.
|
|
49
|
-
"react-dom": "^19.
|
|
50
|
-
"react-router": "^
|
|
48
|
+
"esbuild": "^0.28.2",
|
|
49
|
+
"jsdom": "^30.1.3",
|
|
50
|
+
"react": "^19.3.1",
|
|
51
|
+
"react-dom": "^19.3.1",
|
|
52
|
+
"react-router": "^8.5.0",
|
|
51
53
|
"typescript": "~6.0.3",
|
|
52
|
-
"vite": "^8.3.
|
|
54
|
+
"vite": "^8.3.5"
|
|
53
55
|
},
|
|
54
56
|
"engines": {
|
|
55
57
|
"node": ">=18"
|