@rozenite/storage-plugin 1.7.0-rc.2 → 1.8.0

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.
@@ -1,44 +1,45 @@
1
- import { useRozeniteDevToolsClient as S } from "@rozenite/plugin-bridge";
2
- import { useCallback as $, useMemo as v, useEffect as P } from "react";
3
- import { g as T, s as k } from "./types.js";
1
+ import { useRozeniteDevToolsClient as A } from "@rozenite/plugin-bridge";
2
+ import { useCallback as P, useMemo as T, useEffect as R } from "react";
3
+ import { g as k, s as M } from "./types.js";
4
4
  import { useRozenitePluginAgentTool as l } from "@rozenite/agent-bridge";
5
- const x = 1500, f = (e) => e.kind === "async", m = (e) => e.type === "buffer" ? `${e.type}:${e.value.join(",")}` : `${e.type}:${String(e.value)}`, M = (e) => new Map(e.map((t) => [t.key, t])), h = (e, t) => e.blacklist ? (e.blacklist.lastIndex = 0, e.blacklist.test(t)) : !1, A = (e, t, r) => {
6
- if (!k(e, t))
5
+ import { defineAgentToolContract as g } from "@rozenite/agent-shared";
6
+ const x = 1500, h = (e) => e.kind === "async", w = (e) => e.type === "buffer" ? `${e.type}:${e.value.join(",")}` : `${e.type}:${String(e.value)}`, N = (e) => new Map(e.map((t) => [t.key, t])), I = (e, t) => e.blacklist ? (e.blacklist.lastIndex = 0, e.blacklist.test(t)) : !1, z = (e, t, r) => {
7
+ if (!M(e, t))
7
8
  throw new Error(
8
9
  `Type "${t}" is not supported by storage "${r.storageId}" in adapter "${r.adapterId}".`
9
10
  );
10
- }, I = async (e) => (f(e), e.getAllKeys()), w = async (e, t) => (f(e), e.get(t)), R = async (e, t) => {
11
- if (f(e)) {
11
+ }, b = async (e) => (h(e), e.getAllKeys()), E = async (e, t) => (h(e), e.get(t)), K = async (e, t) => {
12
+ if (h(e)) {
12
13
  await e.set(t);
13
14
  return;
14
15
  }
15
16
  e.set(t);
16
- }, z = async (e, t) => {
17
- if (f(e)) {
17
+ }, j = async (e, t) => {
18
+ if (h(e)) {
18
19
  await e.delete(t);
19
20
  return;
20
21
  }
21
22
  e.delete(t);
22
- }, b = async (e) => {
23
+ }, S = async (e) => {
23
24
  const t = await e();
24
- return M(t);
25
- }, K = (e, t, r) => {
25
+ return N(t);
26
+ }, V = (e, t, r) => {
26
27
  t.forEach((s, n) => {
27
28
  const o = e.get(n);
28
29
  if (!o) {
29
30
  r.onSet(s);
30
31
  return;
31
32
  }
32
- m(o) !== m(s) && r.onSet(s);
33
+ w(o) !== w(s) && r.onSet(s);
33
34
  }), e.forEach((s, n) => {
34
35
  t.has(n) || r.onDelete(n);
35
36
  });
36
- }, N = async (e, t) => {
37
- let r = await b(e);
37
+ }, _ = async (e, t) => {
38
+ let r = await S(e);
38
39
  const s = setInterval(async () => {
39
40
  try {
40
- const n = await b(e);
41
- K(r, n, t), r = n;
41
+ const n = await S(e);
42
+ V(r, n, t), r = n;
42
43
  } catch {
43
44
  }
44
45
  }, x);
@@ -47,33 +48,33 @@ const x = 1500, f = (e) => e.kind === "async", m = (e) => e.type === "buffer" ?
47
48
  clearInterval(s);
48
49
  }
49
50
  };
50
- }, j = (e, t) => {
51
+ }, D = (e, t) => {
51
52
  const r = t.storage, s = {
52
53
  adapterId: e.id,
53
54
  storageId: t.id
54
55
  }, n = async (d) => {
55
- if (!h(t, d))
56
- return w(r, d);
56
+ if (!I(t, d))
57
+ return E(r, d);
57
58
  }, o = async () => {
58
- const d = await I(r);
59
+ const d = await b(r);
59
60
  return (await Promise.all(
60
- d.filter((c) => !h(t, c)).map((c) => w(r, c))
61
+ d.filter((c) => !I(t, c)).map((c) => E(r, c))
61
62
  )).filter((c) => !!c);
62
63
  };
63
64
  return {
64
- id: T(s),
65
+ id: k(s),
65
66
  target: s,
66
67
  adapterName: e.name,
67
68
  storageName: t.name,
68
69
  capabilities: t.capabilities,
69
70
  get: n,
70
71
  set: async (d) => {
71
- A(t.capabilities, d.type, s), await R(r, d);
72
+ z(t.capabilities, d.type, s), await K(r, d);
72
73
  },
73
74
  delete: async (d) => {
74
- await z(r, d);
75
+ await j(r, d);
75
76
  },
76
- getAllKeys: async () => (await I(r)).filter((a) => !h(t, a)),
77
+ getAllKeys: async () => (await b(r)).filter((a) => !I(t, a)),
77
78
  getAllEntries: o,
78
79
  watch: async ({ onSet: d, onDelete: a }) => r.subscribe ? r.subscribe(async (c) => {
79
80
  try {
@@ -85,11 +86,11 @@ const x = 1500, f = (e) => e.kind === "async", m = (e) => e.type === "buffer" ?
85
86
  d(i);
86
87
  } catch {
87
88
  }
88
- }) : N(o, { onSet: d, onDelete: a })
89
+ }) : _(o, { onSet: d, onDelete: a })
89
90
  };
90
- }, V = (e) => e.flatMap(
91
- (t) => t.storages.map((r) => j(t, r))
92
- ), g = "@rozenite/storage-plugin", y = {
91
+ }, F = (e) => e.flatMap(
92
+ (t) => t.storages.map((r) => D(t, r))
93
+ ), f = {
93
94
  adapterId: {
94
95
  type: "string",
95
96
  description: "Storage adapter ID. Required when multiple adapters are configured."
@@ -98,88 +99,100 @@ const x = 1500, f = (e) => e.kind === "async", m = (e) => e.type === "buffer" ?
98
99
  type: "string",
99
100
  description: "Storage node ID within the adapter. Required when multiple storages are configured."
100
101
  }
101
- }, F = {
102
- name: "list-storages",
103
- description: "List all storage adapters and their storage nodes currently available on the device, including supported entry types and entry counts.",
104
- inputSchema: { type: "object", properties: {} }
105
- }, q = {
106
- name: "list-entries",
107
- description: "List keys in a storage. This call intentionally does not return entry values to keep responses token-efficient.",
108
- inputSchema: {
109
- type: "object",
110
- properties: {
111
- ...y,
112
- offset: {
113
- type: "number",
114
- description: "Pagination offset. Defaults to 0."
115
- },
116
- limit: {
117
- type: "number",
118
- description: "Pagination size. Defaults to 100."
102
+ }, u = "@rozenite/storage-plugin", $ = [
103
+ "string",
104
+ "number",
105
+ "boolean",
106
+ "buffer"
107
+ ], y = {
108
+ listStorages: g({
109
+ name: "list-storages",
110
+ description: "List all storage adapters and their storage nodes currently available on the device, including supported entry types and entry counts.",
111
+ inputSchema: { type: "object", properties: {} }
112
+ }),
113
+ listEntries: g({
114
+ name: "list-entries",
115
+ description: "List keys in a storage. This call intentionally does not return entry values to keep responses token-efficient.",
116
+ inputSchema: {
117
+ type: "object",
118
+ properties: {
119
+ ...f,
120
+ offset: {
121
+ type: "number",
122
+ description: "Pagination offset. Defaults to 0."
123
+ },
124
+ limit: {
125
+ type: "number",
126
+ description: "Pagination size. Defaults to 100."
127
+ }
119
128
  }
120
129
  }
121
- }
122
- }, D = {
123
- name: "read-entry",
124
- description: "Read a single storage entry value by key.",
125
- inputSchema: {
126
- type: "object",
127
- properties: {
128
- ...y,
129
- key: { type: "string", description: "Entry key." }
130
- },
131
- required: ["key"]
132
- }
133
- }, L = {
134
- name: "create-entry",
135
- description: "Create a new storage entry. Fails if the key already exists.",
136
- inputSchema: {
137
- type: "object",
138
- properties: {
139
- ...y,
140
- key: { type: "string", description: "Entry key." },
141
- type: {
142
- type: "string",
143
- enum: ["string", "number", "boolean", "buffer"],
144
- description: "Entry value type. Must be one of the supported types for the target storage (see list-storages)."
130
+ }),
131
+ readEntry: g({
132
+ name: "read-entry",
133
+ description: "Read a single storage entry value by key.",
134
+ inputSchema: {
135
+ type: "object",
136
+ properties: {
137
+ ...f,
138
+ key: { type: "string", description: "Entry key." }
145
139
  },
146
- value: {
147
- description: "Entry value matching the provided type."
148
- }
149
- },
150
- required: ["key", "type", "value"]
151
- }
152
- }, C = {
153
- name: "edit-entry",
154
- description: "Edit an existing storage entry. Fails if the key does not exist.",
155
- inputSchema: {
156
- type: "object",
157
- properties: {
158
- ...y,
159
- key: { type: "string", description: "Entry key." },
160
- type: {
161
- type: "string",
162
- enum: ["string", "number", "boolean", "buffer"],
163
- description: "Entry value type. Must be one of the supported types for the target storage (see list-storages)."
140
+ required: ["key"]
141
+ }
142
+ }),
143
+ createEntry: g({
144
+ name: "create-entry",
145
+ description: "Create a new storage entry. Fails if the key already exists.",
146
+ inputSchema: {
147
+ type: "object",
148
+ properties: {
149
+ ...f,
150
+ key: { type: "string", description: "Entry key." },
151
+ type: {
152
+ type: "string",
153
+ enum: [...$],
154
+ description: "Entry value type. Must be one of the supported types for the target storage (see list-storages)."
155
+ },
156
+ value: {
157
+ description: "Entry value matching the provided type."
158
+ }
164
159
  },
165
- value: {
166
- description: "Entry value matching the provided type."
167
- }
168
- },
169
- required: ["key", "type", "value"]
170
- }
171
- }, _ = {
172
- name: "remove-entry",
173
- description: "Remove a storage entry by key.",
174
- inputSchema: {
175
- type: "object",
176
- properties: {
177
- ...y,
178
- key: { type: "string", description: "Entry key." }
179
- },
180
- required: ["key"]
181
- }
182
- }, E = (e, t) => {
160
+ required: ["key", "type", "value"]
161
+ }
162
+ }),
163
+ editEntry: g({
164
+ name: "edit-entry",
165
+ description: "Edit an existing storage entry. Fails if the key does not exist.",
166
+ inputSchema: {
167
+ type: "object",
168
+ properties: {
169
+ ...f,
170
+ key: { type: "string", description: "Entry key." },
171
+ type: {
172
+ type: "string",
173
+ enum: [...$],
174
+ description: "Entry value type. Must be one of the supported types for the target storage (see list-storages)."
175
+ },
176
+ value: {
177
+ description: "Entry value matching the provided type."
178
+ }
179
+ },
180
+ required: ["key", "type", "value"]
181
+ }
182
+ }),
183
+ removeEntry: g({
184
+ name: "remove-entry",
185
+ description: "Remove a storage entry by key.",
186
+ inputSchema: {
187
+ type: "object",
188
+ properties: {
189
+ ...f,
190
+ key: { type: "string", description: "Entry key." }
191
+ },
192
+ required: ["key"]
193
+ }
194
+ })
195
+ }, v = (e, t) => {
183
196
  if (e === "string") {
184
197
  if (typeof t != "string")
185
198
  throw new Error("Expected string value for type=string");
@@ -198,8 +211,8 @@ const x = 1500, f = (e) => e.kind === "async", m = (e) => e.type === "buffer" ?
198
211
  if (!Array.isArray(t) || !t.every((r) => Number.isInteger(r)))
199
212
  throw new Error("Expected number[] value for type=buffer");
200
213
  return t;
201
- }, u = (e) => `${e.target.adapterId}/${e.target.storageId}`, O = (e) => {
202
- const t = $(
214
+ }, m = (e) => `${e.target.adapterId}/${e.target.storageId}`, q = (e) => {
215
+ const t = P(
203
216
  (r, s) => {
204
217
  if (e.length === 0)
205
218
  throw new Error("No storages are registered.");
@@ -213,22 +226,22 @@ const x = 1500, f = (e) => e.kind === "async", m = (e) => e.type === "buffer" ?
213
226
  s && `storageId="${s}"`
214
227
  ].filter(Boolean).join(", ");
215
228
  throw new Error(
216
- `No storage matched ${o}. Available: ${e.map(u).join(", ")}`
229
+ `No storage matched ${o}. Available: ${e.map(m).join(", ")}`
217
230
  );
218
231
  }
219
232
  return n;
220
233
  }
221
234
  if (e.length > 1)
222
235
  throw new Error(
223
- `Multiple storages detected. Provide adapterId and/or storageId. Available: ${e.map(u).join(", ")}`
236
+ `Multiple storages detected. Provide adapterId and/or storageId. Available: ${e.map(m).join(", ")}`
224
237
  );
225
238
  return e[0];
226
239
  },
227
240
  [e]
228
241
  );
229
242
  l({
230
- pluginId: g,
231
- tool: F,
243
+ pluginId: u,
244
+ tool: y.listStorages,
232
245
  handler: async () => ({
233
246
  storages: await Promise.all(
234
247
  e.map(async (r) => ({
@@ -242,8 +255,8 @@ const x = 1500, f = (e) => e.kind === "async", m = (e) => e.type === "buffer" ?
242
255
  )
243
256
  })
244
257
  }), l({
245
- pluginId: g,
246
- tool: q,
258
+ pluginId: u,
259
+ tool: y.listEntries,
247
260
  handler: async ({ adapterId: r, storageId: s, offset: n = 0, limit: o = 100 }) => {
248
261
  const d = t(r, s), a = await d.getAllKeys(), c = Math.max(0, Math.floor(n)), i = Math.max(1, Math.floor(o)), p = a.slice(c, c + i);
249
262
  return {
@@ -256,13 +269,13 @@ const x = 1500, f = (e) => e.kind === "async", m = (e) => e.type === "buffer" ?
256
269
  };
257
270
  }
258
271
  }), l({
259
- pluginId: g,
260
- tool: D,
272
+ pluginId: u,
273
+ tool: y.readEntry,
261
274
  handler: async ({ adapterId: r, storageId: s, key: n }) => {
262
275
  const o = t(r, s), d = await o.get(n);
263
276
  if (!d)
264
277
  throw new Error(
265
- `Key "${n}" not found in storage "${u(o)}".`
278
+ `Key "${n}" not found in storage "${m(o)}".`
266
279
  );
267
280
  return {
268
281
  adapterId: o.target.adapterId,
@@ -271,15 +284,15 @@ const x = 1500, f = (e) => e.kind === "async", m = (e) => e.type === "buffer" ?
271
284
  };
272
285
  }
273
286
  }), l({
274
- pluginId: g,
275
- tool: L,
287
+ pluginId: u,
288
+ tool: y.createEntry,
276
289
  handler: async ({ adapterId: r, storageId: s, key: n, type: o, value: d }) => {
277
290
  const a = t(r, s);
278
291
  if (await a.get(n))
279
292
  throw new Error(
280
- `Key "${n}" already exists in storage "${u(a)}". Use edit-entry instead.`
293
+ `Key "${n}" already exists in storage "${m(a)}". Use edit-entry instead.`
281
294
  );
282
- const i = E(o, d);
295
+ const i = v(o, d);
283
296
  return await a.set({ key: n, type: o, value: i }), {
284
297
  adapterId: a.target.adapterId,
285
298
  storageId: a.target.storageId,
@@ -288,15 +301,15 @@ const x = 1500, f = (e) => e.kind === "async", m = (e) => e.type === "buffer" ?
288
301
  };
289
302
  }
290
303
  }), l({
291
- pluginId: g,
292
- tool: C,
304
+ pluginId: u,
305
+ tool: y.editEntry,
293
306
  handler: async ({ adapterId: r, storageId: s, key: n, type: o, value: d }) => {
294
307
  const a = t(r, s);
295
308
  if (!await a.get(n))
296
309
  throw new Error(
297
- `Key "${n}" not found in storage "${u(a)}". Use create-entry instead.`
310
+ `Key "${n}" not found in storage "${m(a)}". Use create-entry instead.`
298
311
  );
299
- const i = E(o, d);
312
+ const i = v(o, d);
300
313
  return await a.set({ key: n, type: o, value: i }), {
301
314
  adapterId: a.target.adapterId,
302
315
  storageId: a.target.storageId,
@@ -305,8 +318,8 @@ const x = 1500, f = (e) => e.kind === "async", m = (e) => e.type === "buffer" ?
305
318
  };
306
319
  }
307
320
  }), l({
308
- pluginId: g,
309
- tool: _,
321
+ pluginId: u,
322
+ tool: y.removeEntry,
310
323
  handler: async ({ adapterId: r, storageId: s, key: n }) => {
311
324
  const o = t(r, s), d = !!await o.get(n);
312
325
  return await o.delete(n), {
@@ -317,15 +330,15 @@ const x = 1500, f = (e) => e.kind === "async", m = (e) => e.type === "buffer" ?
317
330
  };
318
331
  }
319
332
  });
320
- }, J = ({
333
+ }, Y = ({
321
334
  storages: e
322
335
  }) => {
323
- const t = v(() => V(e), [e]);
324
- O(t);
325
- const r = S({
336
+ const t = T(() => F(e), [e]);
337
+ q(t);
338
+ const r = A({
326
339
  pluginId: "@rozenite/storage-plugin"
327
340
  });
328
- return P(() => {
341
+ return R(() => {
329
342
  if (!r)
330
343
  return;
331
344
  const s = async (a) => {
@@ -439,5 +452,5 @@ const x = 1500, f = (e) => e.kind === "async", m = (e) => e.type === "buffer" ?
439
452
  }, [r, t]), r;
440
453
  };
441
454
  export {
442
- J as useRozeniteStoragePlugin
455
+ Y as useRozeniteStoragePlugin
443
456
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});exports.createAsyncStorageAdapter=void 0;exports.createExpoAsyncStorageAdapter=void 0;exports.createExpoSecureStorageAdapter=void 0;exports.createMMKVStorageAdapter=void 0;exports.useRozeniteStoragePlugin=void 0;const o=typeof window<"u"&&window.navigator.product!=="ReactNative",c=process.env.NODE_ENV!=="production",d=typeof window>"u";if(c&&!o&&!d)exports.createAsyncStorageAdapter=require("./chunks/index.require.cjs").createAsyncStorageAdapter,exports.createExpoAsyncStorageAdapter=require("./chunks/index.require.cjs").createExpoAsyncStorageAdapter,exports.createExpoSecureStorageAdapter=require("./chunks/index.require.cjs").createExpoSecureStorageAdapter,exports.createMMKVStorageAdapter=require("./chunks/index.require.cjs").createMMKVStorageAdapter,exports.useRozeniteStoragePlugin=require("./chunks/useRozeniteStoragePlugin.require.cjs").useRozeniteStoragePlugin;else{const r=(e,t,a)=>({id:e?.adapterId??t,name:e?.adapterName??a,storages:[]});exports.createAsyncStorageAdapter=(e=>r(e,"async-storage","AsyncStorage")),exports.createExpoAsyncStorageAdapter=exports.createAsyncStorageAdapter,exports.createExpoSecureStorageAdapter=(e=>r(e,"expo-secure-store","Expo SecureStore")),exports.createMMKVStorageAdapter=(e=>r(e,"mmkv","MMKV")),exports.useRozeniteStoragePlugin=()=>null}
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});exports.createAsyncStorageAdapter=void 0;exports.createExpoAsyncStorageAdapter=void 0;exports.createExpoSecureStorageAdapter=void 0;exports.createMMKVStorageAdapter=void 0;exports.useRozeniteStoragePlugin=void 0;const o=typeof window<"u"&&window.navigator.product!=="ReactNative",c=process.env.NODE_ENV!=="production",d=typeof window>"u",r=(e,t,a)=>({id:e?.adapterId??t,name:e?.adapterName??a,storages:[]});if(!c||d)exports.createAsyncStorageAdapter=(e=>r(e,"async-storage","AsyncStorage")),exports.createExpoAsyncStorageAdapter=exports.createAsyncStorageAdapter,exports.createExpoSecureStorageAdapter=(e=>r(e,"expo-secure-store","Expo SecureStore")),exports.createMMKVStorageAdapter=(e=>r(e,"mmkv","MMKV")),exports.useRozeniteStoragePlugin=()=>null;else if(o){const e=require("./chunks/async-storage.require.cjs"),t=require("./chunks/secure-storage.require.cjs");exports.createAsyncStorageAdapter=e.createAsyncStorageAdapter,exports.createExpoAsyncStorageAdapter=e.createExpoAsyncStorageAdapter,exports.createExpoSecureStorageAdapter=t.createExpoSecureStorageAdapter,exports.createMMKVStorageAdapter=(a=>r(a,"mmkv","MMKV")),exports.useRozeniteStoragePlugin=require("./chunks/useRozeniteStoragePlugin.require.cjs").useRozeniteStoragePlugin}else exports.createAsyncStorageAdapter=require("./chunks/index.require.cjs").createAsyncStorageAdapter,exports.createExpoAsyncStorageAdapter=require("./chunks/index.require.cjs").createExpoAsyncStorageAdapter,exports.createExpoSecureStorageAdapter=require("./chunks/index.require.cjs").createExpoSecureStorageAdapter,exports.createMMKVStorageAdapter=require("./chunks/index.require.cjs").createMMKVStorageAdapter,exports.useRozeniteStoragePlugin=require("./chunks/useRozeniteStoragePlugin.require.cjs").useRozeniteStoragePlugin;
@@ -1,6 +1,6 @@
1
1
  import { MMKV as MMKV_2 } from 'react-native-mmkv-v3';
2
2
  import { MMKV as MMKV_3 } from 'react-native-mmkv-v4';
3
- import { RozeniteDevToolsClient } from '../../../plugin-bridge/src/index.ts';
3
+ import { RozeniteDevToolsClient } from '@rozenite/plugin-bridge';
4
4
 
5
5
  export declare type AsyncStorage = {
6
6
  kind: 'async';
@@ -1,27 +1,28 @@
1
- let t, a, o, c, n;
2
- const s = typeof window < "u" && window.navigator.product !== "ReactNative", i = process.env.NODE_ENV !== "production", u = typeof window > "u";
3
- if (i && !s && !u)
4
- t = require("./chunks/index.require.js").createAsyncStorageAdapter, a = require("./chunks/index.require.js").createExpoAsyncStorageAdapter, o = require("./chunks/index.require.js").createExpoSecureStorageAdapter, c = require("./chunks/index.require.js").createMMKVStorageAdapter, n = require("./chunks/useRozeniteStoragePlugin.require.js").useRozeniteStoragePlugin;
5
- else {
6
- const r = (e, p, d) => ({
7
- id: e?.adapterId ?? p,
8
- name: e?.adapterName ?? d,
9
- storages: []
10
- });
11
- t = ((e) => r(
1
+ let r, c, n, s, p;
2
+ const d = typeof window < "u" && window.navigator.product !== "ReactNative", i = process.env.NODE_ENV !== "production", u = typeof window > "u", t = (e, a, o) => ({
3
+ id: e?.adapterId ?? a,
4
+ name: e?.adapterName ?? o,
5
+ storages: []
6
+ });
7
+ if (!i || u)
8
+ r = ((e) => t(
12
9
  e,
13
10
  "async-storage",
14
11
  "AsyncStorage"
15
- )), a = t, o = ((e) => r(
12
+ )), c = r, n = ((e) => t(
16
13
  e,
17
14
  "expo-secure-store",
18
15
  "Expo SecureStore"
19
- )), c = ((e) => r(e, "mmkv", "MMKV")), n = () => null;
20
- }
16
+ )), s = ((e) => t(e, "mmkv", "MMKV")), p = () => null;
17
+ else if (d) {
18
+ const e = require("./chunks/async-storage.require.js"), a = require("./chunks/secure-storage.require.js");
19
+ r = e.createAsyncStorageAdapter, c = e.createExpoAsyncStorageAdapter, n = a.createExpoSecureStorageAdapter, s = ((o) => t(o, "mmkv", "MMKV")), p = require("./chunks/useRozeniteStoragePlugin.require.js").useRozeniteStoragePlugin;
20
+ } else
21
+ r = require("./chunks/index.require.js").createAsyncStorageAdapter, c = require("./chunks/index.require.js").createExpoAsyncStorageAdapter, n = require("./chunks/index.require.js").createExpoSecureStorageAdapter, s = require("./chunks/index.require.js").createMMKVStorageAdapter, p = require("./chunks/useRozeniteStoragePlugin.require.js").useRozeniteStoragePlugin;
21
22
  export {
22
- t as createAsyncStorageAdapter,
23
- a as createExpoAsyncStorageAdapter,
24
- o as createExpoSecureStorageAdapter,
25
- c as createMMKVStorageAdapter,
26
- n as useRozeniteStoragePlugin
23
+ r as createAsyncStorageAdapter,
24
+ c as createExpoAsyncStorageAdapter,
25
+ n as createExpoSecureStorageAdapter,
26
+ s as createMMKVStorageAdapter,
27
+ p as useRozeniteStoragePlugin
27
28
  };
@@ -1 +1 @@
1
- {"name":"@rozenite/storage-plugin","version":"1.7.0-rc.2","description":"Generic Storage Inspector for Rozenite.","panels":[{"name":"Storage","source":"/devtools/panel.html"}]}
1
+ {"name":"@rozenite/storage-plugin","version":"1.8.0","description":"Generic Storage Inspector for Rozenite.","panels":[{"name":"Storage","source":"/devtools/panel.html"}]}
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@rozenite/agent-shared"),t={adapterId:{type:"string",description:"Storage adapter ID. Required when multiple adapters are configured."},storageId:{type:"string",description:"Storage node ID within the adapter. Required when multiple storages are configured."}},n="@rozenite/storage-plugin",r=["string","number","boolean","buffer"],i={listStorages:e.defineAgentToolContract({name:"list-storages",description:"List all storage adapters and their storage nodes currently available on the device, including supported entry types and entry counts.",inputSchema:{type:"object",properties:{}}}),listEntries:e.defineAgentToolContract({name:"list-entries",description:"List keys in a storage. This call intentionally does not return entry values to keep responses token-efficient.",inputSchema:{type:"object",properties:{...t,offset:{type:"number",description:"Pagination offset. Defaults to 0."},limit:{type:"number",description:"Pagination size. Defaults to 100."}}}}),readEntry:e.defineAgentToolContract({name:"read-entry",description:"Read a single storage entry value by key.",inputSchema:{type:"object",properties:{...t,key:{type:"string",description:"Entry key."}},required:["key"]}}),createEntry:e.defineAgentToolContract({name:"create-entry",description:"Create a new storage entry. Fails if the key already exists.",inputSchema:{type:"object",properties:{...t,key:{type:"string",description:"Entry key."},type:{type:"string",enum:[...r],description:"Entry value type. Must be one of the supported types for the target storage (see list-storages)."},value:{description:"Entry value matching the provided type."}},required:["key","type","value"]}}),editEntry:e.defineAgentToolContract({name:"edit-entry",description:"Edit an existing storage entry. Fails if the key does not exist.",inputSchema:{type:"object",properties:{...t,key:{type:"string",description:"Entry key."},type:{type:"string",enum:[...r],description:"Entry value type. Must be one of the supported types for the target storage (see list-storages)."},value:{description:"Entry value matching the provided type."}},required:["key","type","value"]}}),removeEntry:e.defineAgentToolContract({name:"remove-entry",description:"Remove a storage entry by key.",inputSchema:{type:"object",properties:{...t,key:{type:"string",description:"Entry key."}},required:["key"]}})},o=e.defineAgentToolDescriptors(n,i);exports.STORAGE_AGENT_ENTRY_TYPES=r;exports.STORAGE_AGENT_PLUGIN_ID=n;exports.storageToolDefinitions=i;exports.storageTools=o;