@aippy/runtime 0.4.1-dev.0 → 0.4.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/dist/ai/index.js +1 -1
- package/dist/audio/index.js +1 -1
- package/dist/audio/useSound.d.ts +1 -0
- package/dist/{container-message-DZYnuAQg.js → container-message-C3YXyTZj.js} +1 -1
- package/dist/core/index.js +1 -1
- package/dist/{helper-Cw67btub.js → helper-WRpB-6MD.js} +1 -1
- package/dist/index/index.js +4 -4
- package/dist/tweaks/index.js +1 -1
- package/dist/{useSound-jHl7rkaq.js → useSound-z_eIn0KH.js} +15 -15
- package/dist/{useTweaks-v5wEZGGm.js → useTweaks-C7BEMpV3.js} +21 -27
- package/package.json +11 -3
package/dist/ai/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as i, d as A, e as r, c as n, U as C, a as I, b as f, h as g, g as _, l as p, n as E, p as T, r as U, f as t, s as l, v as D } from "../helper-
|
|
1
|
+
import { D as i, d as A, e as r, c as n, U as C, a as I, b as f, h as g, g as _, l as p, n as E, p as T, r as U, f as t, s as l, v as D } from "../helper-WRpB-6MD.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import "../bridge-CtB9L5kL.js";
|
|
4
4
|
export {
|
package/dist/audio/index.js
CHANGED
package/dist/audio/useSound.d.ts
CHANGED
package/dist/core/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { D as r, g as s, m as o } from "../config-B0A7gHQM.js";
|
|
2
2
|
import { _ as t, r as i } from "../bridge-CtB9L5kL.js";
|
|
3
3
|
import { A as R, a as E, E as c, b as m, c as A } from "../errors-B3bDbQbD.js";
|
|
4
|
-
import { S as f, V as g, c as l, a as y, g as _, s as d } from "../container-message-
|
|
4
|
+
import { S as f, V as g, c as l, a as y, g as _, s as d } from "../container-message-C3YXyTZj.js";
|
|
5
5
|
import { A as D, C as O, R as F, a as I, p as S } from "../runtime-CmoG3v2m.js";
|
|
6
6
|
export {
|
|
7
7
|
D as AippyRuntime,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createOpenAICompatible as d } from "@ai-sdk/openai-compatible";
|
|
2
2
|
import { r as f } from "./bridge-CtB9L5kL.js";
|
|
3
|
-
import { s as m, a as b } from "./container-message-
|
|
3
|
+
import { s as m, a as b } from "./container-message-C3YXyTZj.js";
|
|
4
4
|
import { AISDKError as c, DefaultChatTransport as h } from "ai";
|
|
5
5
|
import { E as g, b as p, a as u } from "./errors-B3bDbQbD.js";
|
|
6
6
|
import { j as A } from "./url-c26cuIpu.js";
|
package/dist/index/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { D as r, g as s, m as o } from "../config-B0A7gHQM.js";
|
|
2
2
|
import { _ as i, g as n, r as p } from "../bridge-CtB9L5kL.js";
|
|
3
3
|
import { A as m, a as f, E as c, b as u, c as C } from "../errors-B3bDbQbD.js";
|
|
4
|
-
import { S as g, V as I, c as d, a as E, g as S, s as x } from "../container-message-
|
|
4
|
+
import { S as g, V as I, c as d, a as E, g as S, s as x } from "../container-message-C3YXyTZj.js";
|
|
5
5
|
import { A as U, C as _, R as T, a as D, p as v } from "../runtime-CmoG3v2m.js";
|
|
6
6
|
import { CameraAPI as F, FileSystemAPI as P, GeolocationAPI as h, SensorsAPI as M, camera as O, fileSystem as b, geolocation as L, isMotionSupported as w, isOrientationSupported as H, requestMotionPermission as N, sensors as V, vibrate as B, watchMotion as k, watchOrientation as q } from "../device/index.js";
|
|
7
7
|
import { P as G, a as z, c as K, b as W, g as X, i as Y, p as J, r as Q, s as Z } from "../app-version-checker-Bz7FrEZz.js";
|
|
8
8
|
import { a as ee, P as ae, p as re, b as se } from "../pwa-C5nXU0DN.js";
|
|
9
9
|
import { j as te } from "../url-c26cuIpu.js";
|
|
10
|
-
import { a as ne, b as pe } from "../useTweaks-
|
|
11
|
-
import { c as me, b as fe, i as ce, p as ue, u as Ce, a as le } from "../useSound-
|
|
10
|
+
import { a as ne, b as pe } from "../useTweaks-C7BEMpV3.js";
|
|
11
|
+
import { c as me, b as fe, i as ce, p as ue, u as Ce, a as le } from "../useSound-z_eIn0KH.js";
|
|
12
12
|
import { reportScore as Ie, sendEvent as de, updateScore as Ee } from "../leaderboard/index.js";
|
|
13
|
-
import { D as xe, d as Re, e as Ue, c as _e, U as Te, a as De, b as ve, h as ye, g as Fe, l as Pe, n as he, p as Me, r as Oe, f as be, s as Le, v as we } from "../helper-
|
|
13
|
+
import { D as xe, d as Re, e as Ue, c as _e, U as Te, a as De, b as ve, h as ye, g as Fe, l as Pe, n as he, p as Me, r as Oe, f as be, s as Le, v as we } from "../helper-WRpB-6MD.js";
|
|
14
14
|
import { c as Ne, u as Ve } from "../hooks-D5lkty5r.js";
|
|
15
15
|
import { hasNativeBridge as ke } from "../native-bridge-BnvipFJc.js";
|
|
16
16
|
export {
|
package/dist/tweaks/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var U = Object.defineProperty;
|
|
2
2
|
var j = (e, t, s) => t in e ? U(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
|
|
3
3
|
var h = (e, t, s) => j(e, typeof t != "symbol" ? t + "" : t, s);
|
|
4
|
-
import { useState as
|
|
4
|
+
import { useState as O, useRef as L, useEffect as P, useCallback as T } from "react";
|
|
5
5
|
function _() {
|
|
6
6
|
const e = navigator.userAgent;
|
|
7
7
|
return !!(/iPad|iPhone|iPod/.test(e) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1);
|
|
@@ -20,7 +20,7 @@ function F(e = "video", t = !1) {
|
|
|
20
20
|
const s = document.createElement(e);
|
|
21
21
|
return s.muted = !1, s.autoplay = !0, e === "video" && (s.playsInline = !0), t ? s.style.cssText = "position:fixed;bottom:10px;right:10px;width:200px;background:#ff0000;z-index:9999;" : s.style.cssText = "position:fixed;width:1px;height:1px;opacity:0;pointer-events:none;", s;
|
|
22
22
|
}
|
|
23
|
-
class
|
|
23
|
+
class R {
|
|
24
24
|
constructor(t, s, a, m = !1) {
|
|
25
25
|
h(this, "analyser");
|
|
26
26
|
h(this, "dataArray");
|
|
@@ -98,7 +98,7 @@ class N {
|
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
const E = /* @__PURE__ */ new WeakSet();
|
|
101
|
-
function
|
|
101
|
+
function N(e, t = {}) {
|
|
102
102
|
if (E.has(e))
|
|
103
103
|
return e;
|
|
104
104
|
const {
|
|
@@ -125,12 +125,12 @@ function R(e, t = {}) {
|
|
|
125
125
|
let y = [];
|
|
126
126
|
function S() {
|
|
127
127
|
const n = () => {
|
|
128
|
-
const
|
|
129
|
-
(
|
|
128
|
+
const x = e.state;
|
|
129
|
+
(x === "interrupted" || x === "suspended") && (l = !1);
|
|
130
130
|
};
|
|
131
131
|
e.addEventListener("statechange", n);
|
|
132
|
-
const d = (
|
|
133
|
-
|
|
132
|
+
const d = (x) => {
|
|
133
|
+
x.persisted && (l = !1);
|
|
134
134
|
};
|
|
135
135
|
window.addEventListener("pageshow", d);
|
|
136
136
|
const M = () => {
|
|
@@ -141,7 +141,7 @@ function R(e, t = {}) {
|
|
|
141
141
|
l = !1;
|
|
142
142
|
};
|
|
143
143
|
window.addEventListener("pagehide", M);
|
|
144
|
-
const
|
|
144
|
+
const C = () => {
|
|
145
145
|
if (document.visibilityState === "hidden") {
|
|
146
146
|
try {
|
|
147
147
|
e.suspend();
|
|
@@ -150,11 +150,11 @@ function R(e, t = {}) {
|
|
|
150
150
|
l = !1;
|
|
151
151
|
}
|
|
152
152
|
};
|
|
153
|
-
document.addEventListener("visibilitychange",
|
|
153
|
+
document.addEventListener("visibilitychange", C), y = [
|
|
154
154
|
() => e.removeEventListener("statechange", n),
|
|
155
155
|
() => window.removeEventListener("pageshow", d),
|
|
156
156
|
() => window.removeEventListener("pagehide", M),
|
|
157
|
-
() => document.removeEventListener("visibilitychange",
|
|
157
|
+
() => document.removeEventListener("visibilitychange", C)
|
|
158
158
|
];
|
|
159
159
|
}
|
|
160
160
|
function D() {
|
|
@@ -202,7 +202,7 @@ function R(e, t = {}) {
|
|
|
202
202
|
const r = F(g, m);
|
|
203
203
|
r.srcObject = I.stream, document.body.appendChild(r);
|
|
204
204
|
let i = null;
|
|
205
|
-
u.enabled && (i = new
|
|
205
|
+
u.enabled && (i = new R(
|
|
206
206
|
e,
|
|
207
207
|
r,
|
|
208
208
|
u,
|
|
@@ -242,9 +242,9 @@ function R(e, t = {}) {
|
|
|
242
242
|
return o(k), S(), E.add(e), k;
|
|
243
243
|
}
|
|
244
244
|
function q(e = {}) {
|
|
245
|
-
const { autoUnlock: t = !0, ...s } = e, [a, m] =
|
|
245
|
+
const { autoUnlock: t = !0, ...s } = e, [a, m] = O(null), [g, f] = O(!1), u = L(null);
|
|
246
246
|
P(() => {
|
|
247
|
-
const o = new AudioContext(), c =
|
|
247
|
+
const o = new AudioContext(), c = N(o, s);
|
|
248
248
|
return u.current = c, m(c), () => {
|
|
249
249
|
u.current = null, c.cleanup(), c.close();
|
|
250
250
|
};
|
|
@@ -339,7 +339,7 @@ function H(e, t = {}) {
|
|
|
339
339
|
}
|
|
340
340
|
A(r);
|
|
341
341
|
const n = p.createBufferSource();
|
|
342
|
-
n.buffer = k, n.loop = i?.loop ?? !1;
|
|
342
|
+
n.buffer = k, n.loop = i?.loop ?? !1, n.playbackRate.value = i?.pitch ?? 1;
|
|
343
343
|
const d = p.createGain();
|
|
344
344
|
return d.gain.value = (i?.volume ?? 1) * S.current, n.connect(d), d.connect(p.destination), n.start(), c.current.set(r, { source: n, gain: d }), n.onended = () => {
|
|
345
345
|
c.current.get(r)?.source === n && c.current.delete(r);
|
|
@@ -375,6 +375,6 @@ export {
|
|
|
375
375
|
_ as b,
|
|
376
376
|
F as c,
|
|
377
377
|
B as i,
|
|
378
|
-
|
|
378
|
+
N as p,
|
|
379
379
|
q as u
|
|
380
380
|
};
|
|
@@ -1,26 +1,20 @@
|
|
|
1
|
-
var
|
|
2
|
-
var m = (i, e, t) => e in i ?
|
|
1
|
+
var h = Object.defineProperty;
|
|
2
|
+
var m = (i, e, t) => e in i ? h(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
3
3
|
var r = (i, e, t) => m(i, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { useReducer as
|
|
4
|
+
import { useReducer as g, useEffect as v } from "react";
|
|
5
5
|
import { b as T, a as C } from "./errors-B3bDbQbD.js";
|
|
6
|
-
const I = /* @__PURE__ */ new Set(["number", "color", "boolean", "text"
|
|
7
|
-
function
|
|
6
|
+
const I = /* @__PURE__ */ new Set(["number", "color", "boolean", "text"]), O = /^#(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;
|
|
7
|
+
function R(i) {
|
|
8
8
|
const e = i.value;
|
|
9
|
-
|
|
10
|
-
if (typeof e == "number") return "number";
|
|
11
|
-
if (typeof e == "string") {
|
|
12
|
-
if (O.test(e)) return "color";
|
|
13
|
-
if (R.test(e)) return "image";
|
|
14
|
-
}
|
|
15
|
-
return "text";
|
|
9
|
+
return typeof e == "boolean" ? "boolean" : typeof e == "number" ? "number" : typeof e == "string" && O.test(e) ? "color" : "text";
|
|
16
10
|
}
|
|
17
|
-
function
|
|
11
|
+
function A(i) {
|
|
18
12
|
const e = {};
|
|
19
13
|
for (const [t, n] of Object.entries(i))
|
|
20
14
|
if (I.has(n.type))
|
|
21
15
|
e[t] = n;
|
|
22
16
|
else {
|
|
23
|
-
const a =
|
|
17
|
+
const a = R(n);
|
|
24
18
|
console.warn(
|
|
25
19
|
`⚠️ [Aippy Tweaks] Invalid type "${n.type}" for key "${t}", auto-corrected to "${a}"`
|
|
26
20
|
), e[t] = { ...n, type: a };
|
|
@@ -53,7 +47,7 @@ class k {
|
|
|
53
47
|
});
|
|
54
48
|
}
|
|
55
49
|
}
|
|
56
|
-
class
|
|
50
|
+
class E {
|
|
57
51
|
constructor(e, t) {
|
|
58
52
|
r(this, "values", {});
|
|
59
53
|
r(this, "subject", new k());
|
|
@@ -81,7 +75,7 @@ class S {
|
|
|
81
75
|
}
|
|
82
76
|
// React Hook integration
|
|
83
77
|
useState(e) {
|
|
84
|
-
const [t, n] =
|
|
78
|
+
const [t, n] = g(() => this.getValue(e), this.getValue(e));
|
|
85
79
|
return v(() => {
|
|
86
80
|
const a = this.subject.subscribe((s) => {
|
|
87
81
|
s === e && n();
|
|
@@ -92,7 +86,7 @@ class S {
|
|
|
92
86
|
}, [e]), t;
|
|
93
87
|
}
|
|
94
88
|
}
|
|
95
|
-
class
|
|
89
|
+
class S {
|
|
96
90
|
constructor() {
|
|
97
91
|
r(this, "tweaksInstance", null);
|
|
98
92
|
r(this, "tweaksDidWarn", !1);
|
|
@@ -104,8 +98,8 @@ class N {
|
|
|
104
98
|
tweaks(e) {
|
|
105
99
|
if (this.tweaksInstance)
|
|
106
100
|
return this.tweaksDidWarn || (this.tweaksDidWarn = !0, console.warn("⚠️ [Aippy Tweaks] tweaks() is expected to only be called once, returning previous value")), this.tweaksInstance;
|
|
107
|
-
e =
|
|
108
|
-
const t = new k(), n = new
|
|
101
|
+
e = A(e), this.originalConfig = { ...e };
|
|
102
|
+
const t = new k(), n = new E(t, e), a = {};
|
|
109
103
|
for (const s of Object.keys(e))
|
|
110
104
|
a[s] = {
|
|
111
105
|
useState: () => n.useState(s)
|
|
@@ -173,15 +167,15 @@ class N {
|
|
|
173
167
|
let a = 0;
|
|
174
168
|
for (const [o, c] of Object.entries(e))
|
|
175
169
|
if (c && typeof c == "object" && "value" in c) {
|
|
176
|
-
const
|
|
170
|
+
const p = c, w = this.originalConfig[o];
|
|
177
171
|
if (!w) {
|
|
178
172
|
console.warn(`⚠️ [Aippy Tweaks] Key "${o}" not found in original config, skipping`);
|
|
179
173
|
continue;
|
|
180
174
|
}
|
|
181
175
|
const b = /* @__PURE__ */ new Set(["tweakKey", "valueBefore", "tweaksType", "editType"]), f = { ...w };
|
|
182
|
-
for (const [d, l] of Object.entries(
|
|
176
|
+
for (const [d, l] of Object.entries(p))
|
|
183
177
|
b.has(d) || l != null && (f[d] = l);
|
|
184
|
-
n[o] = f, t[o] =
|
|
178
|
+
n[o] = f, t[o] = p.value, a++;
|
|
185
179
|
}
|
|
186
180
|
if (a === 0) {
|
|
187
181
|
console.warn("⚠️ [Aippy Tweaks] No valid values found in iOS data:", e);
|
|
@@ -197,11 +191,11 @@ class N {
|
|
|
197
191
|
}
|
|
198
192
|
}
|
|
199
193
|
}
|
|
200
|
-
const
|
|
201
|
-
tweaks: (i) =>
|
|
202
|
-
},
|
|
203
|
-
typeof window < "u" && (window.aippyTweaksRuntime = y, window.processNativeData =
|
|
194
|
+
const u = new S(), y = {
|
|
195
|
+
tweaks: (i) => u.tweaks(i)
|
|
196
|
+
}, V = y.tweaks;
|
|
197
|
+
typeof window < "u" && (window.aippyTweaksRuntime = y, window.processNativeData = u.processNativeData.bind(u));
|
|
204
198
|
export {
|
|
205
|
-
|
|
199
|
+
V as a,
|
|
206
200
|
y as b
|
|
207
201
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aippy/runtime",
|
|
3
|
-
"version": "0.4.1
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Aippy Runtime SDK - Runtime SDK for Aippy projects",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -67,12 +67,14 @@
|
|
|
67
67
|
"url": "https://discord.com/invite/G94ZAx6gVq"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
|
+
"@ai-sdk/react": "^3.0.210",
|
|
70
71
|
"@eslint/js": "^9.36.0",
|
|
71
72
|
"@types/node": "^24.5.2",
|
|
72
73
|
"@types/react": "^19.2.2",
|
|
73
74
|
"@types/ua-parser-js": "^0.7.39",
|
|
74
75
|
"@typescript-eslint/eslint-plugin": "^8.44.1",
|
|
75
76
|
"@typescript-eslint/parser": "^8.44.1",
|
|
77
|
+
"ai": "^6.0.208",
|
|
76
78
|
"eslint": "^9.36.0",
|
|
77
79
|
"prettier": "^3.6.2",
|
|
78
80
|
"react": "^19.1.1",
|
|
@@ -82,14 +84,20 @@
|
|
|
82
84
|
"zod": "^3.25.76"
|
|
83
85
|
},
|
|
84
86
|
"dependencies": {
|
|
85
|
-
"@ai-sdk/openai-compatible": "^2.0.
|
|
86
|
-
"ai": "^6.0.14",
|
|
87
|
+
"@ai-sdk/openai-compatible": "^2.0.51",
|
|
87
88
|
"ua-parser-js": "^2.0.5"
|
|
88
89
|
},
|
|
89
90
|
"peerDependencies": {
|
|
91
|
+
"@ai-sdk/react": "^3.0.0",
|
|
92
|
+
"ai": "^6.0.0",
|
|
90
93
|
"react": "^19.1.1",
|
|
91
94
|
"typescript": ">=5.0.0"
|
|
92
95
|
},
|
|
96
|
+
"peerDependenciesMeta": {
|
|
97
|
+
"@ai-sdk/react": {
|
|
98
|
+
"optional": true
|
|
99
|
+
}
|
|
100
|
+
},
|
|
93
101
|
"engines": {
|
|
94
102
|
"node": ">=20.0.0",
|
|
95
103
|
"pnpm": ">=10.0.0"
|