@rozenite/sqlite-plugin 1.7.0 → 1.8.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.
@@ -22,7 +22,7 @@
22
22
  <script>
23
23
  var __ROZENITE_PANEL__ = true;
24
24
  </script>
25
- <script type="module" crossorigin src="../devtools/assets/panel-B3paLkwG.js"></script>
25
+ <script type="module" crossorigin src="../devtools/assets/panel-DjRs5NTl.js"></script>
26
26
  <link rel="stylesheet" crossorigin href="../devtools/assets/panel-CIU0JBOs.css">
27
27
  </head>
28
28
  <body>
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("@rozenite/plugin-bridge"),h=require("react"),f=require("./bridge-values.cjs"),v="@rozenite/sqlite-plugin",M=a=>a.flatMap(l=>l.databases.map(s=>({id:s.id,name:s.name,adapterId:l.id,adapterName:l.name,executeStatements:s.executeStatements}))),q=a=>f.formatSqliteError(a),b=a=>a instanceof Error&&("completedResults"in a||"failedStatementIndex"in a),z=({adapters:a})=>{const l=h.useMemo(()=>M(a),[a]),s=R.useRozeniteDevToolsClient({pluginId:v}),m=h.useRef([]),S=h.useRef(new Map);return h.useEffect(()=>{if(!s)return;const g=async(n,t)=>{const r=(S.current.get(n)??Promise.resolve()).catch(()=>{}).then(t);return S.current.set(n,r.then(()=>{},()=>{})),r},w=n=>{const t=l.find(o=>o.id===n);if(!t)throw new Error(`Unknown database "${n}".`);return t},y=async(n,t)=>{const o=w(n),r=t.map(({sql:i,params:u})=>({sql:f.normalizeSingleStatementSql(i),params:u})),e=await o.executeStatements(r);if(e.length!==r.length)throw new Error(`Expected ${r.length} statement result(s), received ${e.length}.`);return{inputs:r,results:e}},x=async(n,t,o)=>{const e=(await y(n,[{sql:t,params:o}])).results[0];if(!e)throw new Error("The query completed without a result payload.");return e};return s.send("sqlite:ready",{timestamp:Date.now()}),m.current.push(s.onMessage("sqlite:list-databases",({requestId:n})=>{s.send("sqlite:list-databases:result",{requestId:n,databases:l.map(({id:t,name:o,adapterId:r,adapterName:e})=>({id:t,name:o,adapterId:r,adapterName:e}))})})),m.current.push(s.onMessage("sqlite:query",async({requestId:n,databaseId:t,sql:o,params:r})=>{try{const e=await g(t,()=>x(t,o,r));s.send("sqlite:query:result",{requestId:n,databaseId:t,result:e})}catch(e){s.send("sqlite:query:result",{requestId:n,databaseId:t,error:q(e)})}})),m.current.push(s.onMessage("sqlite:execute-script",async({requestId:n,databaseId:t,sql:o})=>{try{const r=await g(t,async()=>{const e=f.splitSqlStatements(o);if(e.length===0)throw new Error("Query cannot be empty.");const i=e.map(u=>({sql:u.text}));try{const u=await y(t,i);return{statements:e.map((c,p)=>({index:p,start:c.start,end:c.end,input:u.inputs[p],execution:{input:u.inputs[p],result:u.results[p]}})),totalStatementCount:e.length,failedStatementIndex:null}}catch(u){if(!b(u))throw u;const c=Math.max(0,Math.min(typeof u.failedStatementIndex=="number"?u.failedStatementIndex:u.completedResults?.length??0,e.length-1));return{statements:[...(u.completedResults??[]).slice(0,c).map((E,d)=>({index:d,start:e[d].start,end:e[d].end,input:i[d],execution:{input:i[d],result:E}})),{index:c,start:e[c].start,end:e[c].end,input:i[c],error:q(u)}],totalStatementCount:e.length,failedStatementIndex:c}}});s.send("sqlite:execute-script:result",{requestId:n,databaseId:t,result:r})}catch(r){s.send("sqlite:execute-script:result",{requestId:n,databaseId:t,error:q(r)})}})),()=>{m.current.forEach(n=>n.remove()),m.current=[],S.current.clear()}},[s,l]),s};exports.useRozeniteSqlitePlugin=z;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=require("@rozenite/plugin-bridge"),y=require("react"),g=require("./bridge-values.cjs"),E=require("@rozenite/agent-bridge"),M="@rozenite/sqlite-plugin",T=r=>r.flatMap(p=>p.databases.map(t=>({id:t.id,name:t.name,adapterId:p.id,adapterName:p.name,executeStatements:t.executeStatements}))),b="@rozenite/sqlite-plugin",v={name:"list-databases",description:"List all registered SQLite databases.",inputSchema:{type:"object",properties:{}}},z={name:"execute-sql",description:"Execute one or more SQL statements against a database. Supports SELECT, INSERT, UPDATE, DELETE, PRAGMA, DDL, and multi-statement scripts. Returns per-statement results including rows, columns, and metadata. Statements are executed in order and stop on first error.",inputSchema:{type:"object",properties:{databaseId:{type:"string",description:"Database ID from list-databases."},sql:{type:"string",description:"SQL to execute. May contain multiple semicolon-separated statements."}},required:["databaseId","sql"]}},I=r=>r instanceof Error&&("completedResults"in r||"failedStatementIndex"in r),L=r=>{const p=y.useCallback(t=>{const u=r.find(m=>m.id===t);if(!u){const m=r.map(c=>c.id).join(", ");throw new Error(`Unknown databaseId "${t}". Available: ${m||"(none)"}`)}return u},[r]);E.useRozenitePluginAgentTool({pluginId:b,tool:v,handler:()=>({databases:r.map(({id:t,name:u,adapterId:m,adapterName:c})=>({id:t,name:u,adapterId:m,adapterName:c}))})}),E.useRozenitePluginAgentTool({pluginId:b,tool:z,handler:async({databaseId:t,sql:u})=>{const m=p(t),c=g.splitSqlStatements(u);if(c.length===0)throw new Error("SQL cannot be empty.");const q=c.map(i=>({sql:g.normalizeSingleStatementSql(i.text)}));try{const i=await m.executeStatements(q);return{databaseId:t,totalStatementCount:c.length,failedStatementIndex:null,statements:c.map((S,n)=>{const e=i[n];return{index:n,sql:q[n].sql,rows:e.rows,columns:e.columns,metadata:e.metadata}})}}catch(i){if(!I(i))throw new Error(g.formatSqliteError(i));const S=Math.max(0,Math.min(typeof i.failedStatementIndex=="number"?i.failedStatementIndex:i.completedResults?.length??0,c.length-1)),n=(i.completedResults??[]).slice(0,S);return{databaseId:t,totalStatementCount:c.length,failedStatementIndex:S,statements:[...n.map((e,o)=>({index:o,sql:q[o].sql,rows:e.rows,columns:e.columns,metadata:e.metadata})),{index:S,sql:q[S].sql,error:g.formatSqliteError(i)}]}}}})},x=r=>g.formatSqliteError(r),P=r=>r instanceof Error&&("completedResults"in r||"failedStatementIndex"in r),A=({adapters:r})=>{const p=y.useMemo(()=>T(r),[r]);L(p);const t=D.useRozeniteDevToolsClient({pluginId:M}),u=y.useRef([]),m=y.useRef(new Map);return y.useEffect(()=>{if(!t)return;const c=async(n,e)=>{const a=(m.current.get(n)??Promise.resolve()).catch(()=>{}).then(e);return m.current.set(n,a.then(()=>{},()=>{})),a},q=n=>{const e=p.find(o=>o.id===n);if(!e)throw new Error(`Unknown database "${n}".`);return e},i=async(n,e)=>{const o=q(n),a=e.map(({sql:h,params:l})=>({sql:g.normalizeSingleStatementSql(h),params:l})),s=await o.executeStatements(a);if(s.length!==a.length)throw new Error(`Expected ${a.length} statement result(s), received ${s.length}.`);return{inputs:a,results:s}},S=async(n,e,o)=>{const s=(await i(n,[{sql:e,params:o}])).results[0];if(!s)throw new Error("The query completed without a result payload.");return s};return t.send("sqlite:ready",{timestamp:Date.now()}),u.current.push(t.onMessage("sqlite:list-databases",({requestId:n})=>{t.send("sqlite:list-databases:result",{requestId:n,databases:p.map(({id:e,name:o,adapterId:a,adapterName:s})=>({id:e,name:o,adapterId:a,adapterName:s}))})})),u.current.push(t.onMessage("sqlite:query",async({requestId:n,databaseId:e,sql:o,params:a})=>{try{const s=await c(e,()=>S(e,o,a));t.send("sqlite:query:result",{requestId:n,databaseId:e,result:s})}catch(s){t.send("sqlite:query:result",{requestId:n,databaseId:e,error:x(s)})}})),u.current.push(t.onMessage("sqlite:execute-script",async({requestId:n,databaseId:e,sql:o})=>{try{const a=await c(e,async()=>{const s=g.splitSqlStatements(o);if(s.length===0)throw new Error("Query cannot be empty.");const h=s.map(l=>({sql:l.text}));try{const l=await i(e,h);return{statements:s.map((d,f)=>({index:f,start:d.start,end:d.end,input:l.inputs[f],execution:{input:l.inputs[f],result:l.results[f]}})),totalStatementCount:s.length,failedStatementIndex:null}}catch(l){if(!P(l))throw l;const d=Math.max(0,Math.min(typeof l.failedStatementIndex=="number"?l.failedStatementIndex:l.completedResults?.length??0,s.length-1));return{statements:[...(l.completedResults??[]).slice(0,d).map((R,w)=>({index:w,start:s[w].start,end:s[w].end,input:h[w],execution:{input:h[w],result:R}})),{index:d,start:s[d].start,end:s[d].end,input:h[d],error:x(l)}],totalStatementCount:s.length,failedStatementIndex:d}}});t.send("sqlite:execute-script:result",{requestId:n,databaseId:e,result:a})}catch(a){t.send("sqlite:execute-script:result",{requestId:n,databaseId:e,error:x(a)})}})),()=>{u.current.forEach(n=>n.remove()),u.current=[],m.current.clear()}},[t,p]),t};exports.useRozeniteSqlitePlugin=A;
@@ -1,27 +1,138 @@
1
- import { useRozeniteDevToolsClient as E } from "@rozenite/plugin-bridge";
2
- import { useMemo as R, useRef as w, useEffect as v } from "react";
3
- import { f as M, a as D, n as z } from "./bridge-values.js";
4
- const b = "@rozenite/sqlite-plugin", C = (u) => u.flatMap(
5
- (l) => l.databases.map((s) => ({
6
- id: s.id,
7
- name: s.name,
8
- adapterId: l.id,
9
- adapterName: l.name,
10
- executeStatements: s.executeStatements
1
+ import { useRozeniteDevToolsClient as T } from "@rozenite/plugin-bridge";
2
+ import { useCallback as v, useMemo as I, useRef as y, useEffect as L } from "react";
3
+ import { a as R, n as D, f as x } from "./bridge-values.js";
4
+ import { useRozenitePluginAgentTool as E } from "@rozenite/agent-bridge";
5
+ const z = "@rozenite/sqlite-plugin", C = (a) => a.flatMap(
6
+ (p) => p.databases.map((e) => ({
7
+ id: e.id,
8
+ name: e.name,
9
+ adapterId: p.id,
10
+ adapterName: p.name,
11
+ executeStatements: e.executeStatements
11
12
  }))
12
- ), d = (u) => M(u), P = (u) => u instanceof Error && ("completedResults" in u || "failedStatementIndex" in u), N = ({
13
- adapters: u
13
+ ), b = "@rozenite/sqlite-plugin", Q = {
14
+ name: "list-databases",
15
+ description: "List all registered SQLite databases.",
16
+ inputSchema: { type: "object", properties: {} }
17
+ }, A = {
18
+ name: "execute-sql",
19
+ description: "Execute one or more SQL statements against a database. Supports SELECT, INSERT, UPDATE, DELETE, PRAGMA, DDL, and multi-statement scripts. Returns per-statement results including rows, columns, and metadata. Statements are executed in order and stop on first error.",
20
+ inputSchema: {
21
+ type: "object",
22
+ properties: {
23
+ databaseId: {
24
+ type: "string",
25
+ description: "Database ID from list-databases."
26
+ },
27
+ sql: {
28
+ type: "string",
29
+ description: "SQL to execute. May contain multiple semicolon-separated statements."
30
+ }
31
+ },
32
+ required: ["databaseId", "sql"]
33
+ }
34
+ }, P = (a) => a instanceof Error && ("completedResults" in a || "failedStatementIndex" in a), $ = (a) => {
35
+ const p = v(
36
+ (e) => {
37
+ const u = a.find((m) => m.id === e);
38
+ if (!u) {
39
+ const m = a.map((i) => i.id).join(", ");
40
+ throw new Error(
41
+ `Unknown databaseId "${e}". Available: ${m || "(none)"}`
42
+ );
43
+ }
44
+ return u;
45
+ },
46
+ [a]
47
+ );
48
+ E({
49
+ pluginId: b,
50
+ tool: Q,
51
+ handler: () => ({
52
+ databases: a.map(({ id: e, name: u, adapterId: m, adapterName: i }) => ({
53
+ id: e,
54
+ name: u,
55
+ adapterId: m,
56
+ adapterName: i
57
+ }))
58
+ })
59
+ }), E({
60
+ pluginId: b,
61
+ tool: A,
62
+ handler: async ({ databaseId: e, sql: u }) => {
63
+ const m = p(e), i = R(u);
64
+ if (i.length === 0)
65
+ throw new Error("SQL cannot be empty.");
66
+ const h = i.map((c) => ({
67
+ sql: D(c.text)
68
+ }));
69
+ try {
70
+ const c = await m.executeStatements(h);
71
+ return {
72
+ databaseId: e,
73
+ totalStatementCount: i.length,
74
+ failedStatementIndex: null,
75
+ statements: i.map((S, n) => {
76
+ const t = c[n];
77
+ return {
78
+ index: n,
79
+ sql: h[n].sql,
80
+ rows: t.rows,
81
+ columns: t.columns,
82
+ metadata: t.metadata
83
+ };
84
+ })
85
+ };
86
+ } catch (c) {
87
+ if (!P(c))
88
+ throw new Error(x(c));
89
+ const S = Math.max(
90
+ 0,
91
+ Math.min(
92
+ typeof c.failedStatementIndex == "number" ? c.failedStatementIndex : c.completedResults?.length ?? 0,
93
+ i.length - 1
94
+ )
95
+ ), n = (c.completedResults ?? []).slice(
96
+ 0,
97
+ S
98
+ );
99
+ return {
100
+ databaseId: e,
101
+ totalStatementCount: i.length,
102
+ failedStatementIndex: S,
103
+ statements: [
104
+ ...n.map((t, o) => ({
105
+ index: o,
106
+ sql: h[o].sql,
107
+ rows: t.rows,
108
+ columns: t.columns,
109
+ metadata: t.metadata
110
+ })),
111
+ {
112
+ index: S,
113
+ sql: h[S].sql,
114
+ error: x(c)
115
+ }
116
+ ]
117
+ };
118
+ }
119
+ }
120
+ });
121
+ }, w = (a) => x(a), k = (a) => a instanceof Error && ("completedResults" in a || "failedStatementIndex" in a), V = ({
122
+ adapters: a
14
123
  }) => {
15
- const l = R(() => C(u), [u]), s = E({
16
- pluginId: b
17
- }), m = w([]), f = w(/* @__PURE__ */ new Map());
18
- return v(() => {
19
- if (!s)
124
+ const p = I(() => C(a), [a]);
125
+ $(p);
126
+ const e = T({
127
+ pluginId: z
128
+ }), u = y([]), m = y(/* @__PURE__ */ new Map());
129
+ return L(() => {
130
+ if (!e)
20
131
  return;
21
- const S = async (n, t) => {
22
- const r = (f.current.get(n) ?? Promise.resolve()).catch(() => {
132
+ const i = async (n, t) => {
133
+ const r = (m.current.get(n) ?? Promise.resolve()).catch(() => {
23
134
  }).then(t);
24
- return f.current.set(
135
+ return m.current.set(
25
136
  n,
26
137
  r.then(
27
138
  () => {
@@ -30,160 +141,160 @@ const b = "@rozenite/sqlite-plugin", C = (u) => u.flatMap(
30
141
  }
31
142
  )
32
143
  ), r;
33
- }, g = (n) => {
34
- const t = l.find((a) => a.id === n);
144
+ }, h = (n) => {
145
+ const t = p.find((o) => o.id === n);
35
146
  if (!t)
36
147
  throw new Error(`Unknown database "${n}".`);
37
148
  return t;
38
- }, q = async (n, t) => {
39
- const a = g(n), r = t.map(({ sql: i, params: o }) => ({
40
- sql: z(i),
41
- params: o
42
- })), e = await a.executeStatements(r);
43
- if (e.length !== r.length)
149
+ }, c = async (n, t) => {
150
+ const o = h(n), r = t.map(({ sql: f, params: l }) => ({
151
+ sql: D(f),
152
+ params: l
153
+ })), s = await o.executeStatements(r);
154
+ if (s.length !== r.length)
44
155
  throw new Error(
45
- `Expected ${r.length} statement result(s), received ${e.length}.`
156
+ `Expected ${r.length} statement result(s), received ${s.length}.`
46
157
  );
47
158
  return {
48
159
  inputs: r,
49
- results: e
160
+ results: s
50
161
  };
51
- }, y = async (n, t, a) => {
52
- const e = (await q(n, [
162
+ }, S = async (n, t, o) => {
163
+ const s = (await c(n, [
53
164
  {
54
165
  sql: t,
55
- params: a
166
+ params: o
56
167
  }
57
168
  ])).results[0];
58
- if (!e)
169
+ if (!s)
59
170
  throw new Error("The query completed without a result payload.");
60
- return e;
171
+ return s;
61
172
  };
62
- return s.send("sqlite:ready", { timestamp: Date.now() }), m.current.push(
63
- s.onMessage("sqlite:list-databases", ({ requestId: n }) => {
64
- s.send("sqlite:list-databases:result", {
173
+ return e.send("sqlite:ready", { timestamp: Date.now() }), u.current.push(
174
+ e.onMessage("sqlite:list-databases", ({ requestId: n }) => {
175
+ e.send("sqlite:list-databases:result", {
65
176
  requestId: n,
66
- databases: l.map(({ id: t, name: a, adapterId: r, adapterName: e }) => ({
177
+ databases: p.map(({ id: t, name: o, adapterId: r, adapterName: s }) => ({
67
178
  id: t,
68
- name: a,
179
+ name: o,
69
180
  adapterId: r,
70
- adapterName: e
181
+ adapterName: s
71
182
  }))
72
183
  });
73
184
  })
74
- ), m.current.push(
75
- s.onMessage(
185
+ ), u.current.push(
186
+ e.onMessage(
76
187
  "sqlite:query",
77
- async ({ requestId: n, databaseId: t, sql: a, params: r }) => {
188
+ async ({ requestId: n, databaseId: t, sql: o, params: r }) => {
78
189
  try {
79
- const e = await S(
190
+ const s = await i(
80
191
  t,
81
- () => y(t, a, r)
192
+ () => S(t, o, r)
82
193
  );
83
- s.send("sqlite:query:result", {
194
+ e.send("sqlite:query:result", {
84
195
  requestId: n,
85
196
  databaseId: t,
86
- result: e
197
+ result: s
87
198
  });
88
- } catch (e) {
89
- s.send("sqlite:query:result", {
199
+ } catch (s) {
200
+ e.send("sqlite:query:result", {
90
201
  requestId: n,
91
202
  databaseId: t,
92
- error: d(e)
203
+ error: w(s)
93
204
  });
94
205
  }
95
206
  }
96
207
  )
97
- ), m.current.push(
98
- s.onMessage(
208
+ ), u.current.push(
209
+ e.onMessage(
99
210
  "sqlite:execute-script",
100
- async ({ requestId: n, databaseId: t, sql: a }) => {
211
+ async ({ requestId: n, databaseId: t, sql: o }) => {
101
212
  try {
102
- const r = await S(t, async () => {
103
- const e = D(a);
104
- if (e.length === 0)
213
+ const r = await i(t, async () => {
214
+ const s = R(o);
215
+ if (s.length === 0)
105
216
  throw new Error("Query cannot be empty.");
106
- const i = e.map((o) => ({
107
- sql: o.text
217
+ const f = s.map((l) => ({
218
+ sql: l.text
108
219
  }));
109
220
  try {
110
- const o = await q(
221
+ const l = await c(
111
222
  t,
112
- i
223
+ f
113
224
  );
114
225
  return {
115
- statements: e.map((c, p) => ({
116
- index: p,
117
- start: c.start,
118
- end: c.end,
119
- input: o.inputs[p],
226
+ statements: s.map((d, q) => ({
227
+ index: q,
228
+ start: d.start,
229
+ end: d.end,
230
+ input: l.inputs[q],
120
231
  execution: {
121
- input: o.inputs[p],
122
- result: o.results[p]
232
+ input: l.inputs[q],
233
+ result: l.results[q]
123
234
  }
124
235
  })),
125
- totalStatementCount: e.length,
236
+ totalStatementCount: s.length,
126
237
  failedStatementIndex: null
127
238
  };
128
- } catch (o) {
129
- if (!P(o))
130
- throw o;
131
- const c = Math.max(
239
+ } catch (l) {
240
+ if (!k(l))
241
+ throw l;
242
+ const d = Math.max(
132
243
  0,
133
244
  Math.min(
134
- typeof o.failedStatementIndex == "number" ? o.failedStatementIndex : o.completedResults?.length ?? 0,
135
- e.length - 1
245
+ typeof l.failedStatementIndex == "number" ? l.failedStatementIndex : l.completedResults?.length ?? 0,
246
+ s.length - 1
136
247
  )
137
248
  );
138
249
  return {
139
250
  statements: [
140
- ...(o.completedResults ?? []).slice(
251
+ ...(l.completedResults ?? []).slice(
141
252
  0,
142
- c
253
+ d
143
254
  ).map(
144
- (x, h) => ({
145
- index: h,
146
- start: e[h].start,
147
- end: e[h].end,
148
- input: i[h],
255
+ (M, g) => ({
256
+ index: g,
257
+ start: s[g].start,
258
+ end: s[g].end,
259
+ input: f[g],
149
260
  execution: {
150
- input: i[h],
151
- result: x
261
+ input: f[g],
262
+ result: M
152
263
  }
153
264
  })
154
265
  ),
155
266
  {
156
- index: c,
157
- start: e[c].start,
158
- end: e[c].end,
159
- input: i[c],
160
- error: d(o)
267
+ index: d,
268
+ start: s[d].start,
269
+ end: s[d].end,
270
+ input: f[d],
271
+ error: w(l)
161
272
  }
162
273
  ],
163
- totalStatementCount: e.length,
164
- failedStatementIndex: c
274
+ totalStatementCount: s.length,
275
+ failedStatementIndex: d
165
276
  };
166
277
  }
167
278
  });
168
- s.send("sqlite:execute-script:result", {
279
+ e.send("sqlite:execute-script:result", {
169
280
  requestId: n,
170
281
  databaseId: t,
171
282
  result: r
172
283
  });
173
284
  } catch (r) {
174
- s.send("sqlite:execute-script:result", {
285
+ e.send("sqlite:execute-script:result", {
175
286
  requestId: n,
176
287
  databaseId: t,
177
- error: d(r)
288
+ error: w(r)
178
289
  });
179
290
  }
180
291
  }
181
292
  )
182
293
  ), () => {
183
- m.current.forEach((n) => n.remove()), m.current = [], f.current.clear();
294
+ u.current.forEach((n) => n.remove()), u.current = [], m.current.clear();
184
295
  };
185
- }, [s, l]), s;
296
+ }, [e, p]), e;
186
297
  };
187
298
  export {
188
- N as useRozeniteSqlitePlugin
299
+ V as useRozeniteSqlitePlugin
189
300
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});exports.createSqliteAdapter=void 0;exports.createExpoSqliteAdapter=void 0;exports.useRozeniteSqlitePlugin=void 0;const t=typeof window<"u"&&window.navigator.product!=="ReactNative",i=process.env.NODE_ENV!=="production",a=typeof window>"u";i&&!t&&!a?(exports.createSqliteAdapter=require("./chunks/index.require.cjs").createSqliteAdapter,exports.createExpoSqliteAdapter=require("./chunks/index.require.cjs").createExpoSqliteAdapter,exports.useRozeniteSqlitePlugin=require("./chunks/useRozeniteSqlitePlugin.require.cjs").useRozeniteSqlitePlugin):(exports.createSqliteAdapter=e=>({id:e.adapterId??"sqlite",name:e.adapterName??"SQLite",databases:[]}),exports.createExpoSqliteAdapter=e=>({id:e.adapterId??"expo-sqlite",name:e.adapterName??"Expo SQLite",databases:[]}),exports.useRozeniteSqlitePlugin=()=>null);
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});exports.createSqliteAdapter=void 0;exports.createExpoSqliteAdapter=void 0;exports.useRozeniteSqlitePlugin=void 0;const t=process.env.NODE_ENV!=="production",i=typeof window<"u"&&window.navigator.product!=="ReactNative",a=typeof window>"u";t&&!i&&!a?(exports.createSqliteAdapter=require("./chunks/index.require.cjs").createSqliteAdapter,exports.createExpoSqliteAdapter=require("./chunks/index.require.cjs").createExpoSqliteAdapter,exports.useRozeniteSqlitePlugin=require("./chunks/useRozeniteSqlitePlugin.require.cjs").useRozeniteSqlitePlugin):(exports.createSqliteAdapter=e=>({id:e.adapterId??"sqlite",name:e.adapterName??"SQLite",databases:[]}),exports.createExpoSqliteAdapter=e=>({id:e.adapterId??"expo-sqlite",name:e.adapterName??"Expo SQLite",databases:[]}),exports.useRozeniteSqlitePlugin=()=>null);
@@ -1,4 +1,4 @@
1
- import { RozeniteDevToolsClient } from '../../../plugin-bridge/src/index.ts';
1
+ import { RozeniteDevToolsClient } from '@rozenite/plugin-bridge';
2
2
 
3
3
  declare type CreateExpoSqliteAdapter = createExpoSqliteAdapter_2;
4
4
 
@@ -1,6 +1,6 @@
1
1
  let t, a, i;
2
- const r = typeof window < "u" && window.navigator.product !== "ReactNative", d = process.env.NODE_ENV !== "production", n = typeof window > "u";
3
- d && !r && !n ? (t = require("./chunks/index.require.js").createSqliteAdapter, a = require("./chunks/index.require.js").createExpoSqliteAdapter, i = require("./chunks/useRozeniteSqlitePlugin.require.js").useRozeniteSqlitePlugin) : (t = (e) => ({
2
+ const r = process.env.NODE_ENV !== "production", d = typeof window < "u" && window.navigator.product !== "ReactNative", n = typeof window > "u";
3
+ r && !d && !n ? (t = require("./chunks/index.require.js").createSqliteAdapter, a = require("./chunks/index.require.js").createExpoSqliteAdapter, i = require("./chunks/useRozeniteSqlitePlugin.require.js").useRozeniteSqlitePlugin) : (t = (e) => ({
4
4
  id: e.adapterId ?? "sqlite",
5
5
  name: e.adapterName ?? "SQLite",
6
6
  databases: []
@@ -1 +1 @@
1
- {"name":"@rozenite/sqlite-plugin","version":"1.7.0","description":"SQLite inspector for Rozenite.","panels":[{"name":"SQLite","source":"/devtools/panel.html"}]}
1
+ {"name":"@rozenite/sqlite-plugin","version":"1.8.1","description":"SQLite inspector for Rozenite.","panels":[{"name":"SQLite","source":"/devtools/panel.html"}]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rozenite/sqlite-plugin",
3
- "version": "1.7.0",
3
+ "version": "1.8.1",
4
4
  "description": "SQLite inspector for Rozenite.",
5
5
  "type": "module",
6
6
  "main": "./dist/react-native/index.cjs",
@@ -15,7 +15,8 @@
15
15
  "url": "https://github.com/callstackincubator/rozenite.git"
16
16
  },
17
17
  "dependencies": {
18
- "@rozenite/plugin-bridge": "1.7.0"
18
+ "@rozenite/agent-bridge": "1.8.1",
19
+ "@rozenite/plugin-bridge": "1.8.1"
19
20
  },
20
21
  "devDependencies": {
21
22
  "@dnd-kit/core": "^6.3.1",
@@ -48,8 +49,8 @@
48
49
  "typescript": "~5.9.3",
49
50
  "vite": "^7.3.1",
50
51
  "vitest": "^3.2.4",
51
- "@rozenite/vite-plugin": "1.7.0",
52
- "rozenite": "1.7.0"
52
+ "@rozenite/vite-plugin": "1.8.1",
53
+ "rozenite": "1.8.1"
53
54
  },
54
55
  "peerDependencies": {
55
56
  "expo-sqlite": "*",
@@ -78,6 +79,6 @@
78
79
  "dev": "rozenite dev",
79
80
  "typecheck": "tsc -p tsconfig.json --noEmit",
80
81
  "lint": "eslint .",
81
- "test": "vitest --run"
82
+ "test": "vitest --run --passWithNoTests"
82
83
  }
83
84
  }
package/react-native.ts CHANGED
@@ -28,9 +28,9 @@ export let createSqliteAdapter: CreateSqliteAdapter;
28
28
  export let createExpoSqliteAdapter: CreateExpoSqliteAdapter;
29
29
  export let useRozeniteSqlitePlugin: typeof import('./src/react-native/useRozeniteSqlitePlugin').useRozeniteSqlitePlugin;
30
30
 
31
+ const isDev = process.env.NODE_ENV !== 'production';
31
32
  const isWeb =
32
33
  typeof window !== 'undefined' && window.navigator.product !== 'ReactNative';
33
- const isDev = process.env.NODE_ENV !== 'production';
34
34
  const isServer = typeof window === 'undefined';
35
35
 
36
36
  if (isDev && !isWeb && !isServer) {
@@ -10,6 +10,7 @@ import type {
10
10
  SqliteStatementInput,
11
11
  } from '../shared/types';
12
12
  import { createSqliteDatabaseViews } from './sqlite-view';
13
+ import { useSqliteAgentTools } from './useSqliteAgentTools';
13
14
 
14
15
  export type RozeniteSqlitePluginOptions = {
15
16
  adapters: SqliteAdapter[];
@@ -27,6 +28,8 @@ export const useRozeniteSqlitePlugin = ({
27
28
  adapters,
28
29
  }: RozeniteSqlitePluginOptions) => {
29
30
  const views = useMemo(() => createSqliteDatabaseViews(adapters), [adapters]);
31
+
32
+ useSqliteAgentTools(views);
30
33
  const client = useRozeniteDevToolsClient<SqliteEventMap>({
31
34
  pluginId: PLUGIN_ID,
32
35
  });