@aippy/runtime 0.4.1-dev.1 → 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 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-CZqFi-QF.js";
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 {
@@ -1,6 +1,6 @@
1
1
  import "react";
2
2
  import { g as a } from "./bridge-CtB9L5kL.js";
3
- const r = "0.4.1-dev.1", i = {
3
+ const r = "0.4.1", i = {
4
4
  version: r
5
5
  }, o = i.version, c = "@aippy/runtime";
6
6
  function w() {
@@ -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-KgL1paGV.js";
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-KgL1paGV.js";
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";
@@ -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-KgL1paGV.js";
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-v5wEZGGm.js";
10
+ import { a as ne, b as pe } from "../useTweaks-C7BEMpV3.js";
11
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-CZqFi-QF.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-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 {
@@ -1,4 +1,4 @@
1
- import { a as e, b as s } from "../useTweaks-v5wEZGGm.js";
1
+ import { a as e, b as s } from "../useTweaks-C7BEMpV3.js";
2
2
  export {
3
3
  e as aippyTweaks,
4
4
  s as aippyTweaksRuntime
@@ -1,26 +1,20 @@
1
- var g = Object.defineProperty;
2
- var m = (i, e, t) => e in i ? g(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
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 h, useEffect as v } from "react";
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", "image"]), O = /^#(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i, R = /\.(?:png|jpe?g|gif|webp|svg|avif|ico|bmp)(?:[?#]|$)/i;
7
- function A(i) {
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
- if (typeof e == "boolean") return "boolean";
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 E(i) {
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 = A(n);
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 S {
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] = h(() => this.getValue(e), this.getValue(e));
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 N {
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 = E(e), this.originalConfig = { ...e };
108
- const t = new k(), n = new S(t, e), a = {};
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 u = c, w = this.originalConfig[o];
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(u))
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] = u.value, a++;
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 p = new N(), y = {
201
- tweaks: (i) => p.tweaks(i)
202
- }, F = y.tweaks;
203
- typeof window < "u" && (window.aippyTweaksRuntime = y, window.processNativeData = p.processNativeData.bind(p));
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
- F as a,
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-dev.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.4",
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"